@streamlayer/react 0.37.0 → 0.37.1

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,5 +1,5 @@
1
- "use strict";var je=Object.defineProperty;var Ce=(e,t,o)=>t in e?je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var V=(e,t,o)=>(Ce(e,typeof t!="symbol"?t+"":t,o),o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("./masters.js"),p=require("react"),ge=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Ae=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),Te=()=>n.c1,be=n.styled_default(Te())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),$e=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),we=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),Se=()=>n.c1,_e=n.styled_default(Se())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),oe=({type:e,close:t,label:o})=>{const i=e?n.o[e]:{label:o,iconName:void 0};return s.jsxs(ge,{children:[s.jsxs(Ae,{children:[(i==null?void 0:i.iconName)&&s.jsx(be,{"data-type-trivia":e===n.QuestionType.TRIVIA,"data-type-poll":e===n.QuestionType.POLL,name:i.iconName}),(i==null?void 0:i.label)&&s.jsx($e,{children:i.label})]}),s.jsx(we,{onClick:t,children:s.jsx(_e,{name:"icon-cross"})})]})},ie=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),re=e=>e?e.toLocaleString("en-US"):"0",W=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),B=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),z=e=>!isNaN(e.getTime()),Re=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),ke=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Ee=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),Z=({indicator:e,title:t})=>s.jsxs(Re,{children:[s.jsx(ke,{children:t}),s.jsx(Ee,{children:e})]}),Le=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Pe=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),qe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),N=({indicator:e,title:t})=>s.jsxs(Le,{children:[s.jsx(Pe,{children:e}),s.jsx(qe,{children:t})]}),Qe=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Ne=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),De=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Me=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Oe=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Ve=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Ue=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Fe=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),We=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Be=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),ze=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),He=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),Ye=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}),Ke=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),Je=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),Xe="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Trophy'%3e%3cpath%20id='Combined%20Shape'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.69197%204.66662C3.69197%205.99705%203.92914%207.17787%204.4035%208.20912C3.49966%208.02451%202.74487%207.66486%202.1391%207.13014C1.53333%206.59542%201.23046%206.0798%201.23046%205.58328V4.66662H3.69197ZM14.7686%204.66662V5.58328C14.7686%206.0798%2014.4658%206.59542%2013.86%207.13014C13.2542%207.66486%2012.4994%208.02451%2011.5956%208.20912C12.0699%207.17787%2012.3071%205.99705%2012.3071%204.66662H14.7686ZM15.9998%205.58329V4.36108C15.9998%204.10645%2015.9101%203.89002%2015.7306%203.71178C15.5511%203.53354%2015.3332%203.44442%2015.0768%203.44442H12.3076V2.52776C12.3076%202.10763%2012.1569%201.74797%2011.8556%201.44878C11.5544%201.14959%2011.1922%201%2010.7691%201H5.23072C4.80764%201%204.44547%201.14959%204.14419%201.44878C3.84291%201.74797%203.69227%202.10763%203.69227%202.52776V3.44442H0.923068C0.666659%203.44442%200.448714%203.53354%200.269228%203.71178C0.0897418%203.89002%200%204.10645%200%204.36108V5.58329C0%206.03525%200.13301%206.49039%200.399034%206.94872C0.665059%207.40705%201.02403%207.82082%201.47595%208.19003C1.92787%208.55924%202.48234%208.86957%203.13939%209.12101C3.79644%209.37246%204.48713%209.51409%205.21149%209.54592C5.48071%209.88967%205.7852%2010.192%206.12494%2010.453C6.36853%2010.6695%206.53679%2010.9002%206.62974%2011.1453C6.72269%2011.3904%206.76916%2011.6752%206.76916%2011.9999C6.76916%2012.3436%206.67141%2012.6333%206.4759%2012.8688C6.28038%2013.1043%205.96789%2013.2221%205.53841%2013.2221C5.05764%2013.2221%204.62976%2013.3669%204.25476%2013.6566C3.87977%2013.9462%203.69227%2014.3106%203.69227%2014.7499V15.361C3.69227%2015.4501%203.72112%2015.5233%203.77881%2015.5806C3.8365%2015.6379%203.91022%2015.6665%203.99996%2015.6665H11.9999C12.0896%2015.6665%2012.1633%2015.6379%2012.221%2015.5806C12.2787%2015.5233%2012.3076%2015.4501%2012.3076%2015.361V14.7499C12.3076%2014.3106%2012.1201%2013.9462%2011.7451%2013.6566C11.3701%2013.3669%2010.9422%2013.2221%2010.4614%2013.2221C10.0319%2013.2221%209.71945%2013.1043%209.52394%2012.8688C9.32843%2012.6333%209.23068%2012.3436%209.23068%2011.9999C9.23068%2011.6752%209.27715%2011.3904%209.3701%2011.1453C9.46305%2010.9002%209.63131%2010.6695%209.8749%2010.453C10.2146%2010.192%2010.5191%209.88967%2010.7884%209.54592C11.5127%209.51409%2012.2034%209.37246%2012.8604%209.12101C13.5175%208.86957%2014.072%208.55924%2014.5239%208.19003C14.9758%207.82082%2015.3348%207.40705%2015.6008%206.94872C15.8668%206.49039%2015.9998%206.03525%2015.9998%205.58329ZM6.76047%207.1798L8.05109%206.49997L9.3417%207.1798L9.09521%205.73989L10.1393%204.72015L8.69639%204.51007L8.05109%203.2L7.40578%204.51007L5.96283%204.72015L7.00696%205.73989L6.76047%207.1798Z'%20fill='%23F2C94C'/%3e%3c/g%3e%3c/svg%3e",ae=({avatar:e,name:t,points:o,friendsRank:i,rank:r,streak:l,correct:a,incorrect:d,inTop:c,successRate:u})=>s.jsxs(Qe,{children:[s.jsx(Ne,{children:s.jsxs(Me,{children:[s.jsxs(Je,{children:[e&&s.jsx(Oe,{alt:"avatar",src:e}),!e&&s.jsx(Ke,{children:ie(t||"")})]}),s.jsxs(Ve,{children:[s.jsx(Ue,{children:t}),s.jsxs(Fe,{children:[s.jsxs(Be,{children:[s.jsx(We,{alt:"rank-icon",src:Xe}),s.jsxs(ze,{children:[re(o),s.jsx(He,{children:"PTS"})]})]}),s.jsx(Ye,{}),s.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),s.jsxs(De,{children:[s.jsxs(Ze,{children:[s.jsx(Z,{indicator:i||0,title:"Friends rank"}),s.jsx(Z,{indicator:r||0,title:"Global rank"})]}),s.jsxs(Ge,{children:[s.jsx(N,{indicator:l||0,title:"Win streak"}),s.jsx(N,{indicator:a||0,title:"Correct"}),s.jsx(N,{indicator:d||0,title:"Incorrect"}),s.jsx(N,{indicator:`${u||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"})}),os=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),is=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(os,{children:[s.jsx(n.c1,{name:"icon-check-circle"}),s.jsx(is,{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}),D=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),us=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),L=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),U=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ps=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:o,questionType:i,hasCorrectAnswer:r,questionStatus:l,showExpiredNotification:a,showClosedNotificationTrivia:d,votedInCurrentRender:c,votedAfterQuestionClosed:u,enteredAnActiveQuestion:h,marketClosed:f})=>{const m=o&&(i===n.QuestionType.TRIVIA||i===n.QuestionType.PREDICTION)&&c&&l!==n.QuestionStatus.RESOLVED,y=i===n.QuestionType.PREDICTION&&!r,g=f&&i===n.QuestionType.PREDICTION&&!o&&!h||i===n.QuestionType.PREDICTION&&u&&c&&h,v=m&&y,j=m&&r,I=i===n.QuestionType.PREDICTION&&o&&c&&r,x=o&&i===n.QuestionType.POLL&&c;if(!a&&!d&&!v&&!j&&!g&&!x&&!I)return null;const C=t?"correct":"incorrect",T=t?e==null?void 0:e.correctFeedback:e==null?void 0:e.incorrectFeedback;return s.jsxs(ls,{"data-isPrediction":y,children:[a&&s.jsxs(s.Fragment,{children:[s.jsx(q,{children:s.jsx(n.c1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(D,{children:s.jsx(L,{children:"Question Expired"})}),s.jsx(U,{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(D,{children:s.jsx(L,{children:"Question Closed"})}),s.jsx(U,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),g&&s.jsxs(s.Fragment,{children:[s.jsx(q,{children:s.jsx(n.c1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(D,{children:s.jsx(L,{children:"Question Closed"})}),s.jsx(U,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),v&&s.jsxs(s.Fragment,{children:[s.jsx(cs,{name:"icon-prediction"}),s.jsx(L,{children:"Stay tuned to see if your prediction was correct."})]}),x&&s.jsxs(s.Fragment,{children:[s.jsx(q,{"data-feedback-type":"correct",children:s.jsx(n.c1,{name:"correct"})}),s.jsx(L,{children:"That's for answering. Please stay tuned for the next question."})]}),(j||I)&&s.jsxs(s.Fragment,{children:[s.jsx(q,{"data-feedback-type":C,children:s.jsx(n.c1,{name:C})}),s.jsx("div",{children:s.jsxs(D,{children:[s.jsx(us,{"data-feedback-type":C,children:T==null?void 0:T.title}),s.jsx(L,{children:T==null?void 0:T.description})]})})]})]})},hs=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),ms=()=>n.c,fs=n.styled_default(ms())({name:"QuestionScrollContainer",class:"q1tlqx57",propsAsIs:!0}),ys=n.styled_default("div")({name:"Content",class:"c1hq58md",propsAsIs:!1}),vs=n.styled_default("div")({name:"Title",class:"t1c8nxcx",propsAsIs:!1}),xs=n.styled_default("div")({name:"Options",class:"oiozuc3",propsAsIs:!1}),Is=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),js=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),Cs=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),gs=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),As=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),le=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),Ts=()=>le,bs=n.styled_default(Ts())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),$s=()=>le,ws=n.styled_default($s())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),Ss=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),_s=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Rs=n.styled_default("span")({name:"Pts",class:"p17ajcu2",propsAsIs:!1}),ks=n.styled_default("span")({name:"Percentage",class:"pu9kmlb",propsAsIs:!1}),Es=()=>n.c1,Ls=n.styled_default(Es())({name:"CheckIcon",class:"c1j2j0s0",propsAsIs:!0}),G={[n.QuestionImages.CENTERED]:e=>s.jsx(bs,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(gs,{children:s.jsx(As,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(ws,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},Ps=({questionType:e,hasCorrectAnswer:t,correct:o,youVoted:i,questionVoted:r})=>{if(e===n.QuestionType.POLL&&i)return"correct";if(e===n.QuestionType.PREDICTION){if(t&&r)return i?o?"correct":"incorrect":"unset";if(i)return"correct"}return e===n.QuestionType.TRIVIA&&r&&i?o?"correct":"incorrect":"unset"},qs=({questionType:e,questionVoted:t,correct:o,hasCorrectAnswer:i,questionStatus:r})=>e===n.QuestionType.TRIVIA?t&&o:e===n.QuestionType.PREDICTION?t&&o&&i||r===n.QuestionStatus.RESOLVED&&o:!1,Qs=e=>{var t;const{id:o,icon:i,text:r,percentageDecimal:l,points:a,onVote:d,markThatVoted:c,youSelected:u,questionVoted:h,imageMode:f,answerTimeExpired:m,questionStatus:y,isLoading:g,questionType:v,correct:j,hasCorrectAnswer:I,votedAfterQuestionClosed:x,enteredAnActiveQuestion:C,marketClosed:T}=e,S=Ps(e),k=qs({questionType:v,questionVoted:h,correct:j,hasCorrectAnswer:I,questionStatus:y}),R=T&&v===n.QuestionType.PREDICTION,Q=h||R,A=v===n.QuestionType.PREDICTION&&!h&&!T;return s.jsxs(Is,{value:o,"data-selected":u,"data-answer-state":S,disabled:h||g||m||R&&!C||R&&C&&x,"data-is-not-checked":h&&!u&&S!=="incorrect",onClick:$=>{c(v===n.QuestionType.PREDICTION?T:y===n.QuestionStatus.RESOLVED),d($)},children:[s.jsx(js,{"data-answer-state":S,style:{width:`${Q?l:0}%`}}),s.jsxs(Cs,{children:[i&&f&&((t=G[f])==null?void 0:t.call(G,i)),s.jsx(Ss,{children:r}),A&&s.jsxs("div",{children:[s.jsx(n.d,{value:a}),s.jsx(Rs,{children:"pts"})]}),Q&&s.jsxs(_s,{children:[k&&s.jsx(Ls,{name:"selected"}),s.jsx(ks,{children:s.jsx(n.d,{value:l,suffix:"%"})})]})]})]})};var K=typeof window>"u"?p.useEffect:p.useLayoutEffect,Ns=({isPlaying:e,duration:t,startAt:o=0,updateInterval:i=0,onComplete:r,onUpdate:l})=>{let[a,d]=p.useState(o),c=p.useRef(0),u=p.useRef(o),h=p.useRef(o*-1e3),f=p.useRef(null),m=p.useRef(null),y=p.useRef(null),g=I=>{let x=I/1e3;if(m.current===null){m.current=x,f.current=requestAnimationFrame(g);return}let C=x-m.current,T=c.current+C;m.current=x,c.current=T;let S=u.current+(i===0?T:(T/i|0)*i),k=u.current+T,R=typeof t=="number"&&k>=t;d(R?t:S),R||(f.current=requestAnimationFrame(g))},v=()=>{f.current&&cancelAnimationFrame(f.current),y.current&&clearTimeout(y.current),m.current=null},j=p.useCallback(I=>{v(),c.current=0;let x=typeof I=="number"?I:o;u.current=x,d(x),e&&(f.current=requestAnimationFrame(g))},[e,o]);return K(()=>{if(l==null||l(a),t&&a>=t){h.current+=t*1e3;let{shouldRepeat:I=!1,delay:x=0,newStartAt:C}=(r==null?void 0:r(h.current/1e3))||{};I&&(y.current=setTimeout(()=>j(C),x*1e3))}},[a,t]),K(()=>(e&&(f.current=requestAnimationFrame(g)),v),[e,t,i]),{elapsedTime:a,reset:j}},Ds=(e,t,o)=>{let i=e/2,r=t/2,l=i-r,a=2*l,d=o==="clockwise"?"1,0":"0,1",c=2*Math.PI*l;return{path:`m ${i},${r} a ${l},${l} 0 ${d} 0,${a} a ${l},${l} 0 ${d} 0,-${a}`,pathLength:c}},J=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,Ms=e=>({position:"relative",width:e,height:e}),Os={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},de=(e,t,o,i,r)=>{if(i===0)return t;let l=(r?i-e:e)/i;return t+o*l},X=e=>{var t,o;return(o=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(i,r,l,a)=>`#${r}${r}${l}${l}${a}${a}`).substring(1).match(/.{2}/g))==null?void 0:t.map(i=>parseInt(i,16)))!=null?o:[]},Vs=(e,t)=>{var o;let{colors:i,colorsTime:r,isSmoothColorTransition:l=!0}=e;if(typeof i=="string")return i;let a=(o=r==null?void 0:r.findIndex((m,y)=>m>=t&&t>=r[y+1]))!=null?o:-1;if(!r||a===-1)return i[0];if(!l)return i[a];let d=r[a]-t,c=r[a]-r[a+1],u=X(i[a]),h=X(i[a+1]),f=!!e.isGrowing;return`rgb(${u.map((m,y)=>de(d,m,h[y]-m,c,f)|0).join(",")})`},Us=e=>{let{duration:t,initialRemainingTime:o,updateInterval:i,size:r=180,strokeWidth:l=12,trailStrokeWidth:a,isPlaying:d=!1,isGrowing:c=!1,rotation:u="clockwise",onComplete:h,onUpdate:f}=e,m=p.useRef(),y=Math.max(l,a??0),{path:g,pathLength:v}=Ds(r,y,u),{elapsedTime:j}=Ns({isPlaying:d,duration:t,startAt:J(t,o),updateInterval:i,onUpdate:typeof f=="function"?x=>{let C=Math.ceil(t-x);C!==m.current&&(m.current=C,f(C))}:void 0,onComplete:typeof h=="function"?x=>{var C;let{shouldRepeat:T,delay:S,newInitialRemainingTime:k}=(C=h(x))!=null?C:{};if(T)return{shouldRepeat:T,delay:S,newStartAt:J(t,k)}}:void 0}),I=t-j;return{elapsedTime:j,path:g,pathLength:v,remainingTime:Math.ceil(I),rotation:u,size:r,stroke:Vs(e,I),strokeDashoffset:de(j,0,v,t,c),strokeWidth:l}},ce=e=>{let{children:t,strokeLinecap:o,trailColor:i,trailStrokeWidth:r}=e,{path:l,pathLength:a,stroke:d,strokeDashoffset:c,remainingTime:u,elapsedTime:h,size:f,strokeWidth:m}=Us(e);return p.createElement("div",{style:Ms(f)},p.createElement("svg",{viewBox:`0 0 ${f} ${f}`,width:f,height:f,xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:l,fill:"none",stroke:i??"#d9d9d9",strokeWidth:r??m}),p.createElement("path",{d:l,fill:"none",stroke:d,strokeLinecap:o??"round",strokeWidth:m,strokeDasharray:a,strokeDashoffset:c})),typeof t=="function"&&p.createElement("div",{style:Os},t({remainingTime:u,elapsedTime:h,color:d})))};ce.displayName="CountdownCircleTimer";const Fs=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1,n.E.NEUTRALS_GRAY3],Ws=[10,10,1,0],Bs=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),zs=n.E.SECONDARY_GREEN6,ee=n.E.SECONDARY_RED3,Hs=n.E.NEUTRALS_GRAY3,Ys=({isPlaying:e=!0,duration:t=30,onTimerExpired:o})=>{const[i,r]=p.useState(t>10?zs:ee),l=({remainingTime:c})=>s.jsx(Bs,{children:c}),a=p.useCallback(()=>{o==null||o(),r(Hs)},[o,r]),d=p.useCallback(c=>{c===10&&r(ee)},[r]);return s.jsx(ce,{isPlaying:e,duration:t,colors:Fs,colorsTime:Ws,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:a,onUpdate:d,children:l})},Zs=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Gs=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Ks=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Js=()=>n.c1,Xs=n.styled_default(Js())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),et=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),st=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),tt=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),nt=({title:e,points:t,isPlayingTimer:o,isTimer:i,questionType:r,timerDuration:l,onTimerExpired:a})=>s.jsxs(Zs,{style:{justifyContent:r===n.QuestionType.PREDICTION?"center":"space-between"},children:[s.jsxs(Gs,{children:[e&&s.jsx(Ks,{children:e}),t!==void 0&&r!==n.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(Xs,{name:"icon-trophy"}),s.jsxs(et,{children:[s.jsx(st,{children:s.jsx(n.d,{value:t})}),s.jsx(tt,{children:"PTS"})]})]})]}),i&&r!==n.QuestionType.PREDICTION&&s.jsx(Ys,{isPlaying:o,onTimerExpired:a,duration:l})]}),ot=({openedQuestion:e,isLoading:t,vote:o,close:i})=>{var r,l;const a=e.subject,d=e.type,c=e.status,u=(r=e.options)==null?void 0:r.options,h=e.marketClosed,[f,m]=p.useState(!1),[y,g]=p.useState(!1),[v,j]=p.useState(!0),[I,x]=p.useState(!1),[C,T]=p.useState(""),S=e==null?void 0:e.id;p.useEffect(()=>{d===n.QuestionType.PREDICTION?h&&j(!1):c===n.QuestionStatus.RESOLVED&&j(!1)},[]);const k=p.useCallback(b=>{g(b),m(!0)},[]),R=p.useCallback(async b=>{if(S){const P=b.currentTarget.value;T(P),await o(S,P)}},[S,T,o]),Q=p.useCallback(()=>{x(!0),setTimeout(i,3e3)},[i]),A=p.useMemo(()=>e==null?void 0:e.answers.find(b=>b.youVoted===!0),[e]),$=p.useMemo(()=>!!(e!=null&&e.answers.find(b=>b.correct===!0)),[e]),_=p.useMemo(()=>e==null?void 0:e.answers.find(b=>b.correct===!0),[e]),fe=p.useMemo(()=>e?e.answers.map(b=>{var P;return{...b,questionVoted:!!A,youSelected:C===b.id,isLoading:t,hasCorrectAnswer:$,questionType:e.type,answerTimeExpired:I,questionStatus:c,imageMode:(P=e.appearance)==null?void 0:P.images,onVote:R}}):[],[$,I,t,e,A,c,R,C]),ye=u&&(u.case==="trivia"||u.case==="prediction")?u.value:void 0,E=c===n.QuestionStatus.RESOLVED&&d===n.QuestionType.TRIVIA&&!A&&!v,H=d===n.QuestionType.TRIVIA&&y&&f&&v,Y=p.useMemo(()=>d===n.QuestionType.PREDICTION?!!(A&&!$||A&&$&&_!=null&&_.youVoted):!0,[d,A,$,_]),ve=p.useMemo(()=>{if(d===n.QuestionType.PREDICTION&&A&&(!$||$&&_!=null&&_.youVoted))return A.points;if(!(E||I))return c===n.QuestionStatus.RESOLVED?0:A?A.correct?A.points:0:_==null?void 0:_.points},[I,A,_,c,E,d,$]),xe=p.useMemo(()=>d===n.QuestionType.PREDICTION&&A?$?$&&_!=null&&_.youVoted?"You won":"":"To win":E||I?"Time expired":d===n.QuestionType.POLL?"Time remaining":A?"You won":"To win",[I,d,A,E,$,_]),Ie=A||E||H||d===n.QuestionType.TRIVIA&&c===n.QuestionStatus.RESOLVED&&v;return s.jsx(fs,{children:s.jsx(hs,{children:s.jsxs(ys,{children:[s.jsx(ps,{feedbackMessages:ye,questionVoted:!!A,questionVotedCorrectly:A==null?void 0:A.correct,questionType:d,hasCorrectAnswer:$,questionStatus:c,showExpiredNotification:E,showClosedNotificationTrivia:H,votedInCurrentRender:f,votedAfterQuestionClosed:y,enteredAnActiveQuestion:v,marketClosed:h}),Y&&s.jsx(nt,{title:xe,points:ve,onTimerExpired:Q,questionType:e.type,isTimer:!t,isPlayingTimer:!A,timerDuration:Ie?0:Number(((l=e==null?void 0:e.appearance)==null?void 0:l.autoHideInterval)||"30")}),I?s.jsx(as,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(vs,{style:Y?{}:{marginTop:0},children:a}),s.jsx(xs,{children:fe.map(b=>s.jsx(Qs,{...b,markThatVoted:k,votedAfterQuestionClosed:y,enteredAnActiveQuestion:v,marketClosed:h},b.id))})]})]})})})},it=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),rt=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),at=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),lt=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),dt=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),ct=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),ue=({created:e,title:t,isPickHistory:o,instantView:i,notification:r})=>{const l=p.useMemo(()=>{if(e){const a=new Date(e);if(z(a))return{date:W(a),time:B(a)}}return null},[e]);return s.jsxs(it,{children:[l&&s.jsxs(dt,{children:[l.date," · ",l.time]}),(i==null?void 0:i.video)&&s.jsx(n.w,{source:i.video.url,poster:i.video.thumbnailUrl}),(i==null?void 0:i.image)&&!(i!=null&&i.video)&&s.jsx(ct,{src:i==null?void 0:i.image}),s.jsxs(rt,{children:[s.jsx(at,{children:o?t:i==null?void 0:i.heading}),s.jsx(lt,{children:o?r==null?void 0:r.body:i==null?void 0:i.body})]})]})},ut=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),pt=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ht=({instantView:e,...t})=>s.jsxs(ut,{children:[s.jsx(ue,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(pt,{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"})]})]}),mt=n.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),ft=n.styled_default("div")({name:"DateTime",class:"db4q22c",propsAsIs:!1}),yt=n.styled_default("blockquote")({name:"Quote",class:"q111mmic",propsAsIs:!1}),vt=({created:e,...t})=>{const o=p.useMemo(()=>{if(e){const i=new Date(e);if(z(i))return{date:W(i),time:B(i)}}return null},[e]);return s.jsxs(mt,{children:[o&&s.jsxs(ft,{children:[o.date," · ",o.time]}),t.title&&s.jsx(yt,{children:t.title}),s.jsx(n.j,{...t})]})},xt=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),It=({openedQuestion:e})=>{var t,o;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ht,{created:e.attributes.created,...e.attributes.attributes.value}):((o=e==null?void 0:e.attributes)==null?void 0:o.attributes.case)==="tweet"?s.jsx(vt,{created:e.attributes.created,...e.attributes.attributes.value}):null},jt=({extendedQuestion:e,vote:t,close:o})=>{const{loading:i,data:r}=e;return r?s.jsx(ot,{vote:t,close:o,openedQuestion:r,isLoading:!!i}):null},Ct=({gamification:e})=>{var t;const o=n.useStore(e.openedQuestion.$store),i=n.useStore(e.openedQuestion.$extendedStore);if(!o)return null;const r=o.type;return s.jsxs(xt,{children:[s.jsx(oe,{close:e.closeQuestion,type:((t=o.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),r==="question"&&s.jsx(jt,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),r!=="question"&&s.jsx(It,{openedQuestion:o}),s.jsx(ns,{sponsorLogo:""})]})},gt=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),At=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),Tt=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),bt=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var O=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(O||{});const se=({title:e,active:t,onClick:o})=>s.jsx(Tt,{onClick:o,"data-selected":t,children:s.jsx(bt,{children:e})}),$t=({activePage:e="home",toggleActivePage:t})=>s.jsx(gt,{children:s.jsxs(At,{"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")})]})}),wt=n.styled_default("div")({name:"Container",class:"c1ux29ft",propsAsIs:!1}),St=n.styled_default("img")({name:"FriendsIcon",class:"f10ncfg2",propsAsIs:!1}),_t=n.styled_default("div")({name:"Content",class:"c1yc07bd",propsAsIs:!1}),Rt=n.styled_default("div")({name:"Title",class:"tj6cq7w",propsAsIs:!1}),kt=n.styled_default("div")({name:"Description",class:"d1ag78xo",propsAsIs:!1}),Et=()=>n.c1,Lt=n.styled_default(Et())({name:"ArrowInviteIcon",class:"awohrz6",propsAsIs:!0}),Pt="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20d='M10.4615%2012.6875C9.44231%2012.6875%208.61538%2013.4665%208.61538%2014.4266C8.61538%2015.3868%209.44231%2016.1658%2010.4615%2016.1658C11.4808%2016.1658%2012.3077%2015.3868%2012.3077%2014.4266C12.3077%2013.4665%2011.4808%2012.6875%2010.4615%2012.6875ZM10.4615%2016.1658C9.10817%2016.1658%208%2017.2097%208%2018.4846V19.7527C8%2019.7527%208.61538%2020.2237%2010.4615%2020.2237C12.3077%2020.2237%2012.9231%2019.7527%2012.9231%2019.7527V18.4846C12.9231%2017.2097%2011.8149%2016.1658%2010.4615%2016.1658ZM21.5385%2012.6875C20.5192%2012.6875%2019.6923%2013.4665%2019.6923%2014.4266C19.6923%2015.3868%2020.5192%2016.1658%2021.5385%2016.1658C22.5577%2016.1658%2023.3846%2015.3868%2023.3846%2014.4266C23.3846%2013.4665%2022.5577%2012.6875%2021.5385%2012.6875ZM21.5385%2016.1658C20.1851%2016.1658%2019.0769%2017.2097%2019.0769%2018.4846V19.7527C19.0769%2019.7527%2019.6923%2020.2237%2021.5385%2020.2237C23.3846%2020.2237%2024%2019.7527%2024%2019.7527V18.4846C24%2017.2097%2022.8918%2016.1658%2021.5385%2016.1658ZM16%2015.0063C14.9808%2015.0063%2014.1538%2015.7853%2014.1538%2016.7455C14.1538%2017.7056%2014.9808%2018.4846%2016%2018.4846C17.0192%2018.4846%2017.8462%2017.7056%2017.8462%2016.7455C17.8462%2015.7853%2017.0192%2015.0063%2016%2015.0063ZM16%2018.4846C14.6466%2018.4846%2013.5385%2019.5285%2013.5385%2020.8034V22.0715C13.5385%2022.0715%2014.1538%2022.5425%2016%2022.5425C17.8462%2022.5425%2018.4615%2022.0715%2018.4615%2022.0715V20.8034C18.4615%2019.5285%2017.3534%2018.4846%2016%2018.4846Z'%20fill='%23107D57'/%3e%3cpath%20opacity='0.5'%20d='M13.3908%209C12.3103%209%2011.4336%209.82584%2011.4336%2010.8437C11.4336%2011.8616%2012.3103%2012.6875%2013.3908%2012.6875C14.4713%2012.6875%2015.348%2011.8616%2015.348%2010.8437C15.348%209.82584%2014.4713%209%2013.3908%209ZM13.3908%2012.6875C13.1946%2012.6875%2012.9958%2012.6827%2012.7996%2012.7451C13.192%2013.2372%2013.3908%2013.8542%2013.3908%2014.5312C13.3908%2014.7761%2013.3296%2015.0161%2013.3296%2015.261C13.8521%2014.524%2014.6956%2014.0391%2015.6742%2013.9166C15.218%2013.1796%2014.3694%2012.6875%2013.3908%2012.6875ZM18.61%209C17.5295%209%2016.6528%209.82584%2016.6528%2010.8437C16.6528%2011.8616%2017.5295%2012.6875%2018.61%2012.6875C19.6905%2012.6875%2020.5672%2011.8616%2020.5672%2010.8437C20.5672%209.82584%2019.6905%209%2018.61%209ZM18.61%2012.6875C17.6314%2012.6875%2016.7828%2013.1796%2016.3266%2013.9166C17.3052%2014.0391%2018.1487%2014.524%2018.6712%2015.261C18.6712%2015.0161%2018.61%2014.7761%2018.61%2014.5312C18.61%2013.8542%2018.8088%2013.2372%2019.2012%2012.7451C19.005%2012.6827%2018.8062%2012.6875%2018.61%2012.6875Z'%20fill='%23107D57'/%3e%3c/svg%3e",qt=({title:e,description:t,onClick:o,className:i})=>s.jsxs(wt,{onClick:o,className:i,children:[s.jsx(St,{alt:"friends-icon",src:Pt}),s.jsxs(_t,{children:[s.jsx(Rt,{children:e}),s.jsx(kt,{children:t})]}),s.jsx(Lt,{name:"icon-copy"})]});function Qt(e){var t=e.lastRenderedStartIndex,o=e.lastRenderedStopIndex,i=e.startIndex,r=e.stopIndex;return!(i>o||r<t)}function Nt(e){for(var t=e.isItemLoaded,o=e.itemCount,i=e.minimumBatchSize,r=e.startIndex,l=e.stopIndex,a=[],d=null,c=null,u=r;u<=l;u++){var h=t(u);h?c!==null&&(a.push(d,c),d=c=null):(c=u,d===null&&(d=u))}if(c!==null){for(var f=Math.min(Math.max(c,d+i-1),o-1),m=c+1;m<=f&&!t(m);m++)c=m;a.push(d,c)}if(a.length)for(;a[1]-a[0]+1<i&&a[0]>0;){var y=a[0]-1;if(!t(y))a[0]=y;else break}return a}var Dt=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Mt=function(){function e(t,o){for(var i=0;i<o.length;i++){var r=o[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,o,i){return o&&e(t.prototype,o),i&&e(t,i),t}}(),Ot=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){Ot(t,e);function t(){var o,i,r,l;Dt(this,t);for(var a=arguments.length,d=Array(a),c=0;c<a;c++)d[c]=arguments[c];return l=(i=(r=te(this,(o=t.__proto__||Object.getPrototypeOf(t)).call.apply(o,[this].concat(d))),r),r._lastRenderedStartIndex=-1,r._lastRenderedStopIndex=-1,r._memoizedUnloadedRanges=[],r._onItemsRendered=function(u){var h=u.visibleStartIndex,f=u.visibleStopIndex;r._lastRenderedStartIndex=h,r._lastRenderedStopIndex=f,r._ensureRowsLoaded(h,f)},r._setRef=function(u){r._listRef=u},i),te(r,l)}return Mt(t,[{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,r){var l=this.props,a=l.isItemLoaded,d=l.itemCount,c=l.minimumBatchSize,u=c===void 0?10:c,h=l.threshold,f=h===void 0?15:h,m=Nt({isItemLoaded:a,itemCount:d,minimumBatchSize:u,startIndex:Math.max(0,i-f),stopIndex:Math.min(d-1,r+f)});(this._memoizedUnloadedRanges.length!==m.length||this._memoizedUnloadedRanges.some(function(y,g){return m[g]!==y}))&&(this._memoizedUnloadedRanges=m,this._loadUnloadedRanges(m))}},{key:"_loadUnloadedRanges",value:function(i){for(var r=this,l=this.props.loadMoreItems||this.props.loadMoreRows,a=function(u){var h=i[u],f=i[u+1],m=l(h,f);m!=null&&m.then(function(){if(Qt({lastRenderedStartIndex:r._lastRenderedStartIndex,lastRenderedStopIndex:r._lastRenderedStopIndex,startIndex:h,stopIndex:f})){if(r._listRef==null)return;typeof r._listRef.resetAfterIndex=="function"?r._listRef.resetAfterIndex(h,!0):(typeof r._listRef._getItemStyleCache=="function"&&r._listRef._getItemStyleCache(-1),r._listRef.forceUpdate())}})},d=0;d<i.length;d+=2)a(d)}}]),t})(p.PureComponent);const Vt=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Ut=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Ft=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Wt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Bt=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),zt=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Ht=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Yt=()=>n.c1,Zt=n.styled_default(Yt())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0});var pe={exports:{}},Gt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Kt=Gt,Jt=Kt;function he(){}function me(){}me.resetWarningCache=he;var Xt=function(){function e(i,r,l,a,d,c){if(c!==Jt){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var o={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:me,resetWarningCache:he};return o.PropTypes=o,o};pe.exports=Xt();var en=pe.exports;const w=n.getDefaultExportFromCjs(en);class F extends p.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 o={get passive(){t=!0}};try{document.addEventListener("test",null,o),document.removeEventListener("test",null,o)}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 o=this.props.getScrollParent&&this.props.getScrollParent();return o??(t&&t.parentNode)}filterProps(t){return t}attachScrollListener(){const t=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!t)return;let o=window;this.props.useWindow===!1&&(o=t),o.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),o.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),o.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,o=window,i=this.getParentElement(t);let r;if(this.props.useWindow){const l=document.documentElement||document.body.parentNode||document.body,a=o.pageYOffset!==void 0?o.pageYOffset:l.scrollTop;this.props.isReverse?r=a:r=this.calculateOffset(t,a)}else this.props.isReverse?r=i.scrollTop:r=t.scrollHeight-i.scrollTop-i.clientHeight;r<Number(this.props.threshold)&&t&&t.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=i.scrollHeight,this.beforeScrollTop=i.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}calculateOffset(t,o){return t?this.calculateTopPosition(t)+(t.offsetHeight-o-window.innerHeight):0}calculateTopPosition(t){return t?t.offsetTop+this.calculateTopPosition(t.offsetParent):0}render(){const t=this.filterProps(this.props),{children:o,element:i,hasMore:r,initialLoad:l,isReverse:a,loader:d,loadMore:c,pageStart:u,ref:h,threshold:f,useCapture:m,useWindow:y,getScrollParent:g,...v}=t;v.ref=I=>{this.scrollComponent=I,h&&h(I)};const j=[o];return r&&(d?a?j.unshift(d):j.push(d):this.defaultLoader&&(a?j.unshift(this.defaultLoader):j.push(this.defaultLoader))),p.createElement(i,v,j)}}V(F,"propTypes",{children:w.node.isRequired,element:w.node,hasMore:w.bool,initialLoad:w.bool,isReverse:w.bool,loader:w.node,loadMore:w.func.isRequired,pageStart:w.number,ref:w.func,getScrollParent:w.func,threshold:w.number,useCapture:w.bool,useWindow:w.bool}),V(F,"defaultProps",{element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null});const sn=({rank:e,avatar:t,name:o,points:i,isCurrentUser:r,openItemDetail:l,style:a})=>s.jsxs(Vt,{onClick:l,style:a,children:[s.jsx(Ut,{children:e||0}),s.jsxs(Bt,{children:[t?s.jsx(Ft,{alt:"leaderboard-item-avatar",src:t}):s.jsx(Wt,{children:ie(o||"")}),s.jsxs(zt,{children:[s.jsx(Ht,{children:o||""}),r&&s.jsx(Zt,{name:"icon-star"})]})]}),s.jsx("div",{children:re(i)})]}),tn=n.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),nn=({items:e,currentUserId:t,openItemDetail:o,fetchMore:i,scrollNode:r,hasMore:l})=>s.jsx(F,{loadMore:i,initialLoad:!1,hasMore:l,useWindow:!1,getScrollParent:()=>r.current,children:s.jsx(tn,{children:e.map(a=>s.jsx(sn,{...a,openItemDetail:()=>o(a.userId),isCurrentUser:!!t&&t===a.userId},a.userId))})}),on=({renderClipBoardNode:e,deepLink:t})=>s.jsx(n.E$1,{renderToNode:e,inviteLink:t,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."}),rn=n.styled_default("div")({name:"InviteLinkContainer",class:"i1chxfpe",propsAsIs:!1}),an=({gamification:e,scrollNode:t,scrollStore:o,renderClipBoardNode:i})=>{const{data:r,hasMore:l,loading:a,key:d}=n.useStore(e.leaderboardList.$store),{data:c}=n.useStore(e.deepLink.$store),[u,h]=n.Kk(i);return!r.length&&!a?s.jsx(on,{renderClipBoardNode:i,deepLink:c}):s.jsxs(s.Fragment,{children:[s.jsx(nn,{items:r,scrollNode:t,scrollStore:o,fetchMore:e.leaderboardList.fetchMore,hasMore:l,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()},d),c&&s.jsx(rn,{children:s.jsx(qt,{onClick:()=>u(c),title:"Invite Friends",description:"Challenge them now!"})}),h]})},ln=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),dn=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),cn=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),un=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),pn=()=>n.c1,M=n.styled_default(pn())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),hn=()=>n.c1,mn=n.styled_default(hn())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),fn=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),yn=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),vn=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),xn={[n.PickHistoryStatus.LOST]:s.jsx(M,{name:"incorrectVoted"}),[n.PickHistoryStatus.WON]:s.jsx(M,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:s.jsx(M,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:s.jsx(M,{name:"icon-arrow"})},In=({questionId:e,questionType:t,questionStatus:o,subject:i,openForVoting:r,openQuestion:l,status:a})=>{const d=n.o[t],c=xn[a];return d?s.jsxs(ln,{onClick:()=>l==null?void 0:l(e),children:[s.jsxs(yn,{children:[s.jsxs(dn,{children:[s.jsx(mn,{"data-type-trivia":t===n.QuestionType.TRIVIA,"data-type-poll":t===n.QuestionType.POLL,name:d.iconName}),s.jsxs(fn,{children:[d.label,t===n.QuestionType.TRIVIA&&o===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(cn,{children:i||""})]}),s.jsx(un,{children:r?s.jsx(vn,{children:"Play"}):c})]}):null},jn=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),Cn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),gn=({openInsight:e,questionId:t,...o})=>s.jsxs(jn,{children:[s.jsx(ue,{questionId:t,...o,isPickHistory:!0}),e&&s.jsx(Cn,{onClick:()=>e(t),children:"View Insight"})]}),An=n.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),Tn=()=>n.c$1,bn=n.styled_default(Tn())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),$n=n.styled_default("div")({name:"DateTime",class:"d1hbaleq",propsAsIs:!1}),wn=n.styled_default("blockquote")({name:"Quote",class:"qvvgqjm",propsAsIs:!1}),Sn=({openTweet:e,created:t,...o})=>{const i=p.useMemo(()=>{if(t){const r=new Date(t);if(z(r))return{date:W(r),time:B(r)}}return null},[t]);return s.jsxs(An,{children:[i&&s.jsxs($n,{children:[i.date," · ",i.time]}),o.title&&s.jsx(wn,{children:o.title}),s.jsx(n.j,{...o}),e&&s.jsx(bn,{onClick:()=>e(o.tweetId),children:"View Insight"})]})},_n=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),Rn=({questions:e,openQuestion:t})=>s.jsx(_n,{children:e==null?void 0:e.map(o=>{var i,r,l;if(o.type==="question"&&((i=o.attributes)==null?void 0:i.attributes.case)==="question"){const a=o.attributes.attributes.value;return s.jsx(In,{openQuestion:t,...a},a.questionId)}if(o.type==="insight"&&((r=o.attributes)==null?void 0:r.attributes.case)==="insight"){const a=o.attributes.attributes.value,d=o.attributes.created;return s.jsx(gn,{openInsight:t,...a,created:d},a.questionId)}if(o.type==="tweet"&&((l=o.attributes)==null?void 0:l.attributes.case)==="tweet"){const a=o.attributes.attributes.value,d=o.attributes.id,c=o.attributes.created;return s.jsx(Sn,{openTweet:t,...a,tweetId:d,created:c},d)}return null})}),kn=({store:e,openQuestion:t})=>{const o=n.useStore(e);return o!=null&&o.data?s.jsx(Rn,{openQuestion:t,questions:o.data}):s.jsx("div",{children:"wait questions..."})},En=({userSummary:e})=>{var t;const[o,i]=p.useState(void 0);return p.useEffect(()=>{const r=e.subscribe(l=>{l!=null&&l.data&&i(l.data)});return()=>{r()}},[e]),o!=null&&o.summary?s.jsx(ae,{...o.summary,successRate:(t=o.percentage)==null?void 0:t.correct}):s.jsx("div",{children:"wait user..."})},Ln=({gamification:e,className:t,scrollStore:o,scrollNode:i,appNode:r,style:l,responsiveStore:a,headerNode:d})=>{const[c,u]=p.useState(!1),[h,f]=p.useState(O.HOME),[,m]=p.useTransition(),{sdkInScrollView:y}=n.useStore(a,{keys:["sdkInScrollView"]}),g=x=>{m(()=>{var C;f(x),y===!1&&((C=r.current)==null||C.scrollIntoView({behavior:"instant"}))})},v=x=>{m(()=>u(x))};p.useEffect(()=>o.listen(x=>{if(x.scrollPosition===0){v(!1),o.setKey("tabsShown",!1);return}v(x.scrollDirection==="forward"),o.setKey("tabsShown",x.scrollDirection!=="forward")}),[o]);let j="0px";y?j=c?"-60px":"0px":j=c?"0px":"68px";const I=y?r:d;return s.jsxs(n.p,{className:t,style:l,children:[s.jsx(n.C,{style:{top:j},children:s.jsx($t,{activePage:h,toggleActivePage:g})}),h===O.HOME&&s.jsxs(s.Fragment,{children:[s.jsx(n.n,{style:{paddingTop:"8px"},children:s.jsx(En,{userSummary:e.userSummary})}),s.jsx(n.a,{style:{flex:1},children:s.jsx(kn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),h===O.LEADERBOARD&&s.jsx(n.l,{children:s.jsx(an,{renderClipBoardNode:I,scrollStore:o,scrollNode:i,gamification:e})})]})},Pn=()=>n.l$1,ne=n.styled_default(Pn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),qn=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Qn=({correct:e,incorrect:t})=>{const o=e+t;return o===0?0:Math.round(e/o*100)},Nn=`
1
+ "use strict";var Ce=Object.defineProperty;var ge=(e,s,o)=>s in e?Ce(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o;var F=(e,s,o)=>(ge(e,typeof s!="symbol"?s+"":s,o),o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("./masters.js"),h=require("react"),Te=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Ae=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),be=()=>n.c1,$e=n.styled_default(be())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),we=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Se=n.styled_default("div")({name:"CloseIconWrap",class:"c1ao1jtv",propsAsIs:!1}),_e=()=>n.c1,Re=n.styled_default(_e())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),re=({type:e,close:s,label:o})=>{const i=e?n.o[e]:{label:o,iconName:void 0};return t.jsxs(Te,{children:[t.jsxs(Ae,{children:[(i==null?void 0:i.iconName)&&t.jsx($e,{"data-type-trivia":e===n.QuestionType.TRIVIA,"data-type-poll":e===n.QuestionType.POLL,name:i.iconName}),(i==null?void 0:i.label)&&t.jsx(we,{children:i.label})]}),t.jsx(Se,{onClick:s,children:t.jsx(Re,{name:"icon-cross"})})]})},ae=e=>e.split(/\s+/).map(s=>s[0]).join("").toUpperCase(),le=e=>e?e.toLocaleString("en-US"):"0",z=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),H=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Y=e=>!isNaN(e.getTime()),ke=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),Ee=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Le=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),K=({indicator:e,title:s})=>t.jsxs(ke,{children:[t.jsx(Ee,{children:s}),t.jsx(Le,{children:e})]}),Pe=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),qe=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Qe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),Q=({indicator:e,title:s})=>t.jsxs(Pe,{children:[t.jsx(qe,{children:e}),t.jsx(Qe,{children:s})]}),Ne=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),De=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Me=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Oe=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Ve=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Ue=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Fe=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),We=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Be=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),ze=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),He=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Ye=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),Ze=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Ge=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Ke=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}),es="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Trophy'%3e%3cpath%20id='Combined%20Shape'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.69197%204.66662C3.69197%205.99705%203.92914%207.17787%204.4035%208.20912C3.49966%208.02451%202.74487%207.66486%202.1391%207.13014C1.53333%206.59542%201.23046%206.0798%201.23046%205.58328V4.66662H3.69197ZM14.7686%204.66662V5.58328C14.7686%206.0798%2014.4658%206.59542%2013.86%207.13014C13.2542%207.66486%2012.4994%208.02451%2011.5956%208.20912C12.0699%207.17787%2012.3071%205.99705%2012.3071%204.66662H14.7686ZM15.9998%205.58329V4.36108C15.9998%204.10645%2015.9101%203.89002%2015.7306%203.71178C15.5511%203.53354%2015.3332%203.44442%2015.0768%203.44442H12.3076V2.52776C12.3076%202.10763%2012.1569%201.74797%2011.8556%201.44878C11.5544%201.14959%2011.1922%201%2010.7691%201H5.23072C4.80764%201%204.44547%201.14959%204.14419%201.44878C3.84291%201.74797%203.69227%202.10763%203.69227%202.52776V3.44442H0.923068C0.666659%203.44442%200.448714%203.53354%200.269228%203.71178C0.0897418%203.89002%200%204.10645%200%204.36108V5.58329C0%206.03525%200.13301%206.49039%200.399034%206.94872C0.665059%207.40705%201.02403%207.82082%201.47595%208.19003C1.92787%208.55924%202.48234%208.86957%203.13939%209.12101C3.79644%209.37246%204.48713%209.51409%205.21149%209.54592C5.48071%209.88967%205.7852%2010.192%206.12494%2010.453C6.36853%2010.6695%206.53679%2010.9002%206.62974%2011.1453C6.72269%2011.3904%206.76916%2011.6752%206.76916%2011.9999C6.76916%2012.3436%206.67141%2012.6333%206.4759%2012.8688C6.28038%2013.1043%205.96789%2013.2221%205.53841%2013.2221C5.05764%2013.2221%204.62976%2013.3669%204.25476%2013.6566C3.87977%2013.9462%203.69227%2014.3106%203.69227%2014.7499V15.361C3.69227%2015.4501%203.72112%2015.5233%203.77881%2015.5806C3.8365%2015.6379%203.91022%2015.6665%203.99996%2015.6665H11.9999C12.0896%2015.6665%2012.1633%2015.6379%2012.221%2015.5806C12.2787%2015.5233%2012.3076%2015.4501%2012.3076%2015.361V14.7499C12.3076%2014.3106%2012.1201%2013.9462%2011.7451%2013.6566C11.3701%2013.3669%2010.9422%2013.2221%2010.4614%2013.2221C10.0319%2013.2221%209.71945%2013.1043%209.52394%2012.8688C9.32843%2012.6333%209.23068%2012.3436%209.23068%2011.9999C9.23068%2011.6752%209.27715%2011.3904%209.3701%2011.1453C9.46305%2010.9002%209.63131%2010.6695%209.8749%2010.453C10.2146%2010.192%2010.5191%209.88967%2010.7884%209.54592C11.5127%209.51409%2012.2034%209.37246%2012.8604%209.12101C13.5175%208.86957%2014.072%208.55924%2014.5239%208.19003C14.9758%207.82082%2015.3348%207.40705%2015.6008%206.94872C15.8668%206.49039%2015.9998%206.03525%2015.9998%205.58329ZM6.76047%207.1798L8.05109%206.49997L9.3417%207.1798L9.09521%205.73989L10.1393%204.72015L8.69639%204.51007L8.05109%203.2L7.40578%204.51007L5.96283%204.72015L7.00696%205.73989L6.76047%207.1798Z'%20fill='%23F2C94C'/%3e%3c/g%3e%3c/svg%3e",de=({avatar:e,name:s,points:o,friendsRank:i,rank:r,streak:l,correct:a,incorrect:d,inTop:c,successRate:u})=>t.jsxs(Ne,{children:[t.jsx(De,{children:t.jsxs(Oe,{children:[t.jsxs(Xe,{children:[e&&t.jsx(Ve,{alt:"avatar",src:e}),!e&&t.jsx(Je,{children:ae(s||"")})]}),t.jsxs(Ue,{children:[t.jsx(Fe,{children:s}),t.jsxs(We,{children:[t.jsxs(ze,{children:[t.jsx(Be,{alt:"rank-icon",src:es}),t.jsxs(He,{children:[le(o),t.jsx(Ye,{children:"PTS"})]})]}),t.jsx(Ze,{}),t.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),t.jsxs(Me,{children:[t.jsxs(Ge,{children:[t.jsx(K,{indicator:i||0,title:"Friends rank"}),t.jsx(K,{indicator:r||0,title:"Global rank"})]}),t.jsxs(Ke,{children:[t.jsx(Q,{indicator:l||0,title:"Win streak"}),t.jsx(Q,{indicator:a||0,title:"Correct"}),t.jsx(Q,{indicator:d||0,title:"Incorrect"}),t.jsx(Q,{indicator:`${u||0}%`,title:"Succ. rate"})]})]})]}),ss=n.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),ts=()=>n.c1,ns=n.styled_default(ts())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),os=()=>t.jsx(ss,{children:t.jsx(ns,{name:"mastersLogo"})}),is=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),rs=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),as=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),ls=({title:e,description:s})=>t.jsxs(is,{children:[t.jsx(n.c1,{name:"icon-check-circle"}),t.jsx(rs,{children:e}),t.jsx(as,{children:s})]}),ds=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),cs=()=>n.c1,us=n.styled_default(cs())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),q=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),N=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),ps=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),L=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),W=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),hs=({feedbackMessages:e,questionVotedCorrectly:s,questionVoted:o,questionType:i,hasCorrectAnswer:r,questionStatus:l,showExpiredNotification:a,showClosedNotificationTrivia:d,votedInCurrentRender:c,votedAfterQuestionClosed:u,enteredAnActiveQuestion:p,marketClosed:f})=>{const m=o&&(i===n.QuestionType.TRIVIA||i===n.QuestionType.PREDICTION)&&c&&l!==n.QuestionStatus.RESOLVED,v=i===n.QuestionType.PREDICTION&&!r,T=f&&i===n.QuestionType.PREDICTION&&!o&&!p||i===n.QuestionType.PREDICTION&&u&&c&&p,y=m&&v,j=m&&r,x=i===n.QuestionType.PREDICTION&&o&&c&&r,I=o&&i===n.QuestionType.POLL&&c;if(!a&&!d&&!y&&!j&&!T&&!I&&!x)return null;const g=s?"correct":"incorrect",A=s?e==null?void 0:e.correctFeedback:e==null?void 0:e.incorrectFeedback;return t.jsxs(ds,{"data-isPrediction":v,children:[a&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(n.c1,{name:"questionExpired"})}),t.jsxs("div",{children:[t.jsx(N,{children:t.jsx(L,{children:"Question Expired"})}),t.jsx(W,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),d&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(n.c1,{name:"questionExpired"})}),t.jsxs("div",{children:[t.jsx(N,{children:t.jsx(L,{children:"Question Closed"})}),t.jsx(W,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),T&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(n.c1,{name:"questionExpired"})}),t.jsxs("div",{children:[t.jsx(N,{children:t.jsx(L,{children:"Question Closed"})}),t.jsx(W,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),y&&t.jsxs(t.Fragment,{children:[t.jsx(us,{name:"icon-prediction"}),t.jsx(L,{children:"Stay tuned to see if your prediction was correct."})]}),I&&t.jsxs(t.Fragment,{children:[t.jsx(q,{"data-feedback-type":"correct",children:t.jsx(n.c1,{name:"correct"})}),t.jsx(L,{children:"That's for answering. Please stay tuned for the next question."})]}),(j||x)&&t.jsxs(t.Fragment,{children:[t.jsx(q,{"data-feedback-type":g,children:t.jsx(n.c1,{name:g})}),t.jsx("div",{children:t.jsxs(N,{children:[t.jsx(ps,{"data-feedback-type":g,children:A==null?void 0:A.title}),t.jsx(L,{children:A==null?void 0:A.description})]})})]})]})},ms=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),fs=()=>n.c,vs=n.styled_default(fs())({name:"QuestionScrollContainer",class:"q1tlqx57",propsAsIs:!0}),ys=n.styled_default("div")({name:"Content",class:"c1hq58md",propsAsIs:!1}),xs=n.styled_default("div")({name:"Title",class:"t1c8nxcx",propsAsIs:!1}),Is=n.styled_default("div")({name:"Options",class:"oiozuc3",propsAsIs:!1}),js=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),Cs=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),gs=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Ts=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),As=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),ce=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),bs=()=>ce,$s=n.styled_default(bs())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),ws=()=>ce,Ss=n.styled_default(ws())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),_s=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Rs=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),ks=n.styled_default("span")({name:"Pts",class:"p17ajcu2",propsAsIs:!1}),Es=n.styled_default("span")({name:"Percentage",class:"pu9kmlb",propsAsIs:!1}),Ls=()=>n.c1,Ps=n.styled_default(Ls())({name:"CheckIcon",class:"c1j2j0s0",propsAsIs:!0}),J={[n.QuestionImages.CENTERED]:e=>t.jsx($s,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>t.jsx(Ts,{children:t.jsx(As,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>t.jsx(Ss,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},qs=({questionType:e,hasCorrectAnswer:s,correct:o,youVoted:i,questionVoted:r})=>{if(e===n.QuestionType.POLL&&i)return"correct";if(e===n.QuestionType.PREDICTION){if(s&&r)return i?o?"correct":"incorrect":"unset";if(i)return"correct"}return e===n.QuestionType.TRIVIA&&r&&i?o?"correct":"incorrect":"unset"},Qs=({questionType:e,questionVoted:s,correct:o,hasCorrectAnswer:i,questionStatus:r})=>e===n.QuestionType.TRIVIA?s&&o:e===n.QuestionType.PREDICTION?s&&o&&i||r===n.QuestionStatus.RESOLVED&&o:!1,Ns=e=>{var s;const{id:o,icon:i,text:r,percentageDecimal:l,points:a,onVote:d,markThatVoted:c,youSelected:u,questionVoted:p,imageMode:f,answerTimeExpired:m,questionStatus:v,isLoading:T,questionType:y,correct:j,hasCorrectAnswer:x,votedAfterQuestionClosed:I,enteredAnActiveQuestion:g,marketClosed:A}=e,[_,k]=h.useState(l),R=qs(e),O=Qs({questionType:y,questionVoted:p,correct:j,hasCorrectAnswer:x,questionStatus:v}),C=A&&y===n.QuestionType.PREDICTION,b=p||C,$=y===n.QuestionType.PREDICTION&&!p&&!A,V=p&&!u&&R!=="incorrect";return h.useLayoutEffect(()=>{l>0&&(k(0),requestAnimationFrame(()=>{k(l)}))},[l]),t.jsxs(js,{value:o,"data-selected":u,"data-answer-state":R,disabled:p||T||m||C&&!g||C&&g&&I,"data-is-not-checked":V,onClick:U=>{c(y===n.QuestionType.PREDICTION?A:v===n.QuestionStatus.RESOLVED),d(U)},children:[t.jsx(Cs,{"data-answer-state":R,style:{width:`${b?_:0}%`}}),t.jsxs(gs,{children:[i&&f&&((s=J[f])==null?void 0:s.call(J,i)),t.jsx(_s,{children:r}),$&&t.jsxs("div",{children:[a,t.jsx(ks,{children:"pts"})]}),b&&t.jsxs(Rs,{children:[O&&t.jsx(Ps,{name:"selected"}),t.jsx(Es,{children:t.jsx(n.d,{value:l,suffix:"%"})})]})]})]})};var X=typeof window>"u"?h.useEffect:h.useLayoutEffect,Ds=({isPlaying:e,duration:s,startAt:o=0,updateInterval:i=0,onComplete:r,onUpdate:l})=>{let[a,d]=h.useState(o),c=h.useRef(0),u=h.useRef(o),p=h.useRef(o*-1e3),f=h.useRef(null),m=h.useRef(null),v=h.useRef(null),T=x=>{let I=x/1e3;if(m.current===null){m.current=I,f.current=requestAnimationFrame(T);return}let g=I-m.current,A=c.current+g;m.current=I,c.current=A;let _=u.current+(i===0?A:(A/i|0)*i),k=u.current+A,R=typeof s=="number"&&k>=s;d(R?s:_),R||(f.current=requestAnimationFrame(T))},y=()=>{f.current&&cancelAnimationFrame(f.current),v.current&&clearTimeout(v.current),m.current=null},j=h.useCallback(x=>{y(),c.current=0;let I=typeof x=="number"?x:o;u.current=I,d(I),e&&(f.current=requestAnimationFrame(T))},[e,o]);return X(()=>{if(l==null||l(a),s&&a>=s){p.current+=s*1e3;let{shouldRepeat:x=!1,delay:I=0,newStartAt:g}=(r==null?void 0:r(p.current/1e3))||{};x&&(v.current=setTimeout(()=>j(g),I*1e3))}},[a,s]),X(()=>(e&&(f.current=requestAnimationFrame(T)),y),[e,s,i]),{elapsedTime:a,reset:j}},Ms=(e,s,o)=>{let i=e/2,r=s/2,l=i-r,a=2*l,d=o==="clockwise"?"1,0":"0,1",c=2*Math.PI*l;return{path:`m ${i},${r} a ${l},${l} 0 ${d} 0,${a} a ${l},${l} 0 ${d} 0,-${a}`,pathLength:c}},ee=(e,s)=>e===0||e===s?0:typeof s=="number"?e-s:0,Os=e=>({position:"relative",width:e,height:e}),Vs={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},ue=(e,s,o,i,r)=>{if(i===0)return s;let l=(r?i-e:e)/i;return s+o*l},se=e=>{var s,o;return(o=(s=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(i,r,l,a)=>`#${r}${r}${l}${l}${a}${a}`).substring(1).match(/.{2}/g))==null?void 0:s.map(i=>parseInt(i,16)))!=null?o:[]},Us=(e,s)=>{var o;let{colors:i,colorsTime:r,isSmoothColorTransition:l=!0}=e;if(typeof i=="string")return i;let a=(o=r==null?void 0:r.findIndex((m,v)=>m>=s&&s>=r[v+1]))!=null?o:-1;if(!r||a===-1)return i[0];if(!l)return i[a];let d=r[a]-s,c=r[a]-r[a+1],u=se(i[a]),p=se(i[a+1]),f=!!e.isGrowing;return`rgb(${u.map((m,v)=>ue(d,m,p[v]-m,c,f)|0).join(",")})`},Fs=e=>{let{duration:s,initialRemainingTime:o,updateInterval:i,size:r=180,strokeWidth:l=12,trailStrokeWidth:a,isPlaying:d=!1,isGrowing:c=!1,rotation:u="clockwise",onComplete:p,onUpdate:f}=e,m=h.useRef(),v=Math.max(l,a??0),{path:T,pathLength:y}=Ms(r,v,u),{elapsedTime:j}=Ds({isPlaying:d,duration:s,startAt:ee(s,o),updateInterval:i,onUpdate:typeof f=="function"?I=>{let g=Math.ceil(s-I);g!==m.current&&(m.current=g,f(g))}:void 0,onComplete:typeof p=="function"?I=>{var g;let{shouldRepeat:A,delay:_,newInitialRemainingTime:k}=(g=p(I))!=null?g:{};if(A)return{shouldRepeat:A,delay:_,newStartAt:ee(s,k)}}:void 0}),x=s-j;return{elapsedTime:j,path:T,pathLength:y,remainingTime:Math.ceil(x),rotation:u,size:r,stroke:Us(e,x),strokeDashoffset:ue(j,0,y,s,c),strokeWidth:l}},pe=e=>{let{children:s,strokeLinecap:o,trailColor:i,trailStrokeWidth:r}=e,{path:l,pathLength:a,stroke:d,strokeDashoffset:c,remainingTime:u,elapsedTime:p,size:f,strokeWidth:m}=Fs(e);return h.createElement("div",{style:Os(f)},h.createElement("svg",{viewBox:`0 0 ${f} ${f}`,width:f,height:f,xmlns:"http://www.w3.org/2000/svg"},h.createElement("path",{d:l,fill:"none",stroke:i??"#d9d9d9",strokeWidth:r??m}),h.createElement("path",{d:l,fill:"none",stroke:d,strokeLinecap:o??"round",strokeWidth:m,strokeDasharray:a,strokeDashoffset:c})),typeof s=="function"&&h.createElement("div",{style:Vs},s({remainingTime:u,elapsedTime:p,color:d})))};pe.displayName="CountdownCircleTimer";const Ws=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1,n.E.NEUTRALS_GRAY3],Bs=[10,10,1,0],zs=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Hs=n.E.SECONDARY_GREEN6,te=n.E.SECONDARY_RED3,Ys=n.E.NEUTRALS_GRAY3,Zs=({isPlaying:e=!0,duration:s=30,onTimerExpired:o})=>{const[i,r]=h.useState(s>10?Hs:te),l=({remainingTime:c})=>t.jsx(zs,{children:c}),a=h.useCallback(()=>{o==null||o(),r(Ys)},[o,r]),d=h.useCallback(c=>{c===10&&r(te)},[r]);return t.jsx(pe,{isPlaying:e,duration:s,colors:Ws,colorsTime:Bs,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:a,onUpdate:d,children:l})},Gs=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Ks=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Js=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Xs=()=>n.c1,et=n.styled_default(Xs())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),st=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),tt=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),nt=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),ot=({title:e,points:s,isPlayingTimer:o,isTimer:i,animatePoints:r,questionType:l,timerDuration:a,onTimerExpired:d})=>t.jsxs(Gs,{style:{justifyContent:l===n.QuestionType.PREDICTION?"center":"space-between"},children:[t.jsxs(Ks,{children:[e&&t.jsx(Js,{children:e}),s!==void 0&&l!==n.QuestionType.POLL&&t.jsxs(t.Fragment,{children:[t.jsx(et,{name:"icon-trophy"}),t.jsxs(st,{children:[t.jsx(tt,{children:r?t.jsx(n.d,{value:s,delay:.3}):s}),t.jsx(nt,{children:"PTS"})]})]})]}),i&&l!==n.QuestionType.PREDICTION&&t.jsx(Zs,{isPlaying:o,onTimerExpired:d,duration:a})]}),it=({openedQuestion:e,isLoading:s,vote:o,close:i})=>{var r,l;const a=e.subject,d=e.type,c=e.status,u=(r=e.options)==null?void 0:r.options,p=e.marketClosed,[f,m]=h.useState(!1),[v,T]=h.useState(!1),[y,j]=h.useState(!0),[x,I]=h.useState(!1),[g,A]=h.useState(""),_=e==null?void 0:e.id;h.useEffect(()=>{d===n.QuestionType.PREDICTION?p&&j(!1):c===n.QuestionStatus.RESOLVED&&j(!1)},[]);const k=h.useCallback(w=>{T(w),m(!0)},[]),R=h.useCallback(async w=>{if(_){const P=w.currentTarget.value;A(P),await o(_,P)}},[_,A,o]),O=h.useCallback(()=>{I(!0),setTimeout(i,3e3)},[i]),C=h.useMemo(()=>e==null?void 0:e.answers.find(w=>w.youVoted===!0),[e]),b=h.useMemo(()=>!!(e!=null&&e.answers.find(w=>w.correct===!0)),[e]),$=h.useMemo(()=>e==null?void 0:e.answers.find(w=>w.correct===!0),[e]),V=h.useMemo(()=>e?e.answers.map(w=>{var P;return{...w,questionVoted:!!C,youSelected:g===w.id,isLoading:s,hasCorrectAnswer:b,questionType:e.type,answerTimeExpired:x,questionStatus:c,imageMode:(P=e.appearance)==null?void 0:P.images,onVote:R}}):[],[b,x,s,e,C,c,R,g]),U=u&&(u.case==="trivia"||u.case==="prediction")?u.value:void 0,E=c===n.QuestionStatus.RESOLVED&&d===n.QuestionType.TRIVIA&&!C&&!y,Z=d===n.QuestionType.TRIVIA&&v&&f&&y,G=h.useMemo(()=>d===n.QuestionType.PREDICTION?!!(C&&!b||C&&b&&$!=null&&$.youVoted):!0,[d,C,b,$]),ye=h.useMemo(()=>{if(d===n.QuestionType.PREDICTION&&C&&(!b||b&&$!=null&&$.youVoted))return C.points;if(!(E||x))return c===n.QuestionStatus.RESOLVED?0:C?C.correct?C.points:0:$==null?void 0:$.points},[x,C,$,c,E,d,b]),xe=h.useMemo(()=>d===n.QuestionType.PREDICTION&&C?b?b&&$!=null&&$.youVoted?"You won":"":"To win":E||x?"Time expired":d===n.QuestionType.POLL?"Time remaining":C?"You won":"To win",[x,d,C,E,b,$]),Ie=(d===n.QuestionType.TRIVIA||d===n.QuestionType.PREDICTION)&&C&&b&&($==null?void 0:$.youVoted),je=C||E||Z||d===n.QuestionType.TRIVIA&&c===n.QuestionStatus.RESOLVED&&y;return t.jsx(vs,{children:t.jsx(ms,{children:t.jsxs(ys,{children:[t.jsx(hs,{feedbackMessages:U,questionVoted:!!C,questionVotedCorrectly:C==null?void 0:C.correct,questionType:d,hasCorrectAnswer:b,questionStatus:c,showExpiredNotification:E,showClosedNotificationTrivia:Z,votedInCurrentRender:f,votedAfterQuestionClosed:v,enteredAnActiveQuestion:y,marketClosed:p}),G&&t.jsx(ot,{title:xe,points:ye,onTimerExpired:O,questionType:e.type,isTimer:!s,isPlayingTimer:!C,animatePoints:Ie,timerDuration:je?0:Number(((l=e==null?void 0:e.appearance)==null?void 0:l.autoHideInterval)||"30")}),x?t.jsx(ls,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):t.jsxs(t.Fragment,{children:[t.jsx(xs,{style:G?{}:{marginTop:0},children:a}),t.jsx(Is,{children:V.map(w=>t.jsx(Ns,{...w,markThatVoted:k,votedAfterQuestionClosed:v,enteredAnActiveQuestion:y,marketClosed:p},w.id))})]})]})})})},rt=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),at=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),lt=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),dt=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),ct=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),ut=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),he=({created:e,instantView:s,isDetail:o,notification:i})=>{const r=h.useMemo(()=>{if(e){const p=new Date(e);if(Y(p))return{date:z(p),time:H(p)}}return null},[e]),l=s==null?void 0:s.heading,a=s==null?void 0:s.body,d=l||a,c=i==null?void 0:i.title,u=i==null?void 0:i.body;return t.jsxs(rt,{children:[r&&t.jsxs(ct,{children:[r.date," · ",r.time]}),(s==null?void 0:s.video)&&t.jsx(n.w,{source:s.video.url,poster:s.video.thumbnailUrl}),(s==null?void 0:s.image)&&!(s!=null&&s.video)&&t.jsx(ut,{src:s==null?void 0:s.image}),t.jsxs(at,{children:[t.jsx(lt,{children:o&&d?l:c}),t.jsx(dt,{children:o&&d?a:u})]})]})},pt=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),ht=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),mt=({instantView:e,...s})=>t.jsxs(pt,{children:[t.jsx(he,{instantView:e,...s,isDetail:!0}),(e==null?void 0:e.webLink)&&t.jsxs(ht,{href:e==null?void 0:e.webLink.url,target:"_blank",children:[e==null?void 0:e.webLink.label,t.jsx(n.c1,{name:"icon-external-link"})]})]}),ft=n.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),vt=n.styled_default("div")({name:"DateTime",class:"db4q22c",propsAsIs:!1}),yt=n.styled_default("blockquote")({name:"Quote",class:"q111mmic",propsAsIs:!1}),xt=({created:e,...s})=>{const o=h.useMemo(()=>{if(e){const i=new Date(e);if(Y(i))return{date:z(i),time:H(i)}}return null},[e]);return t.jsxs(ft,{children:[o&&t.jsxs(vt,{children:[o.date," · ",o.time]}),s.title&&t.jsx(yt,{children:s.title}),t.jsx(n.j,{...s})]})},It=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),jt=({openedQuestion:e})=>{var s,o;return((s=e==null?void 0:e.attributes)==null?void 0:s.attributes.case)==="insight"?t.jsx(mt,{created:e.attributes.created,...e.attributes.attributes.value}):((o=e==null?void 0:e.attributes)==null?void 0:o.attributes.case)==="tweet"?t.jsx(xt,{created:e.attributes.created,...e.attributes.attributes.value}):null},Ct=({extendedQuestion:e,vote:s,close:o})=>{const{loading:i,data:r}=e;return r?t.jsx(it,{vote:s,close:o,openedQuestion:r,isLoading:!!i}):null},gt=({gamification:e})=>{var s;const o=n.useStore(e.openedQuestion.$store),i=n.useStore(e.openedQuestion.$extendedStore);if(!o)return null;const r=o.type;return t.jsxs(It,{children:[t.jsx(re,{close:e.closeQuestion,type:((s=o.attributes)==null?void 0:s.type)||n.QuestionType.UNSET}),r==="question"&&t.jsx(Ct,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),r!=="question"&&t.jsx(jt,{openedQuestion:o}),t.jsx(os,{sponsorLogo:""})]})},Tt=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),At=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),bt=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),$t=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var M=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(M||{});const ne=({title:e,active:s,onClick:o})=>t.jsx(bt,{onClick:o,"data-selected":s,children:t.jsx($t,{children:e})}),wt=({activePage:e="home",toggleActivePage:s})=>t.jsx(Tt,{children:t.jsxs(At,{"data-position":e==="home"?"left":"right",children:[t.jsx(ne,{title:"Home",active:e==="home",onClick:()=>s("home")}),t.jsx(ne,{title:"Friends",active:e==="leaderboard",onClick:()=>s("leaderboard")})]})}),St=n.styled_default("div")({name:"Container",class:"c1ux29ft",propsAsIs:!1}),_t=n.styled_default("img")({name:"FriendsIcon",class:"f10ncfg2",propsAsIs:!1}),Rt=n.styled_default("div")({name:"Content",class:"c1yc07bd",propsAsIs:!1}),kt=n.styled_default("div")({name:"Title",class:"tj6cq7w",propsAsIs:!1}),Et=n.styled_default("div")({name:"Description",class:"d1ag78xo",propsAsIs:!1}),Lt=()=>n.c1,Pt=n.styled_default(Lt())({name:"ArrowInviteIcon",class:"awohrz6",propsAsIs:!0}),qt="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20d='M10.4615%2012.6875C9.44231%2012.6875%208.61538%2013.4665%208.61538%2014.4266C8.61538%2015.3868%209.44231%2016.1658%2010.4615%2016.1658C11.4808%2016.1658%2012.3077%2015.3868%2012.3077%2014.4266C12.3077%2013.4665%2011.4808%2012.6875%2010.4615%2012.6875ZM10.4615%2016.1658C9.10817%2016.1658%208%2017.2097%208%2018.4846V19.7527C8%2019.7527%208.61538%2020.2237%2010.4615%2020.2237C12.3077%2020.2237%2012.9231%2019.7527%2012.9231%2019.7527V18.4846C12.9231%2017.2097%2011.8149%2016.1658%2010.4615%2016.1658ZM21.5385%2012.6875C20.5192%2012.6875%2019.6923%2013.4665%2019.6923%2014.4266C19.6923%2015.3868%2020.5192%2016.1658%2021.5385%2016.1658C22.5577%2016.1658%2023.3846%2015.3868%2023.3846%2014.4266C23.3846%2013.4665%2022.5577%2012.6875%2021.5385%2012.6875ZM21.5385%2016.1658C20.1851%2016.1658%2019.0769%2017.2097%2019.0769%2018.4846V19.7527C19.0769%2019.7527%2019.6923%2020.2237%2021.5385%2020.2237C23.3846%2020.2237%2024%2019.7527%2024%2019.7527V18.4846C24%2017.2097%2022.8918%2016.1658%2021.5385%2016.1658ZM16%2015.0063C14.9808%2015.0063%2014.1538%2015.7853%2014.1538%2016.7455C14.1538%2017.7056%2014.9808%2018.4846%2016%2018.4846C17.0192%2018.4846%2017.8462%2017.7056%2017.8462%2016.7455C17.8462%2015.7853%2017.0192%2015.0063%2016%2015.0063ZM16%2018.4846C14.6466%2018.4846%2013.5385%2019.5285%2013.5385%2020.8034V22.0715C13.5385%2022.0715%2014.1538%2022.5425%2016%2022.5425C17.8462%2022.5425%2018.4615%2022.0715%2018.4615%2022.0715V20.8034C18.4615%2019.5285%2017.3534%2018.4846%2016%2018.4846Z'%20fill='%23107D57'/%3e%3cpath%20opacity='0.5'%20d='M13.3908%209C12.3103%209%2011.4336%209.82584%2011.4336%2010.8437C11.4336%2011.8616%2012.3103%2012.6875%2013.3908%2012.6875C14.4713%2012.6875%2015.348%2011.8616%2015.348%2010.8437C15.348%209.82584%2014.4713%209%2013.3908%209ZM13.3908%2012.6875C13.1946%2012.6875%2012.9958%2012.6827%2012.7996%2012.7451C13.192%2013.2372%2013.3908%2013.8542%2013.3908%2014.5312C13.3908%2014.7761%2013.3296%2015.0161%2013.3296%2015.261C13.8521%2014.524%2014.6956%2014.0391%2015.6742%2013.9166C15.218%2013.1796%2014.3694%2012.6875%2013.3908%2012.6875ZM18.61%209C17.5295%209%2016.6528%209.82584%2016.6528%2010.8437C16.6528%2011.8616%2017.5295%2012.6875%2018.61%2012.6875C19.6905%2012.6875%2020.5672%2011.8616%2020.5672%2010.8437C20.5672%209.82584%2019.6905%209%2018.61%209ZM18.61%2012.6875C17.6314%2012.6875%2016.7828%2013.1796%2016.3266%2013.9166C17.3052%2014.0391%2018.1487%2014.524%2018.6712%2015.261C18.6712%2015.0161%2018.61%2014.7761%2018.61%2014.5312C18.61%2013.8542%2018.8088%2013.2372%2019.2012%2012.7451C19.005%2012.6827%2018.8062%2012.6875%2018.61%2012.6875Z'%20fill='%23107D57'/%3e%3c/svg%3e",Qt=({title:e,description:s,onClick:o,className:i})=>t.jsxs(St,{onClick:o,className:i,children:[t.jsx(_t,{alt:"friends-icon",src:qt}),t.jsxs(Rt,{children:[t.jsx(kt,{children:e}),t.jsx(Et,{children:s})]}),t.jsx(Pt,{name:"icon-copy"})]});function Nt(e){var s=e.lastRenderedStartIndex,o=e.lastRenderedStopIndex,i=e.startIndex,r=e.stopIndex;return!(i>o||r<s)}function Dt(e){for(var s=e.isItemLoaded,o=e.itemCount,i=e.minimumBatchSize,r=e.startIndex,l=e.stopIndex,a=[],d=null,c=null,u=r;u<=l;u++){var p=s(u);p?c!==null&&(a.push(d,c),d=c=null):(c=u,d===null&&(d=u))}if(c!==null){for(var f=Math.min(Math.max(c,d+i-1),o-1),m=c+1;m<=f&&!s(m);m++)c=m;a.push(d,c)}if(a.length)for(;a[1]-a[0]+1<i&&a[0]>0;){var v=a[0]-1;if(!s(v))a[0]=v;else break}return a}var Mt=function(e,s){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")},Ot=function(){function e(s,o){for(var i=0;i<o.length;i++){var r=o[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(s,r.key,r)}}return function(s,o,i){return o&&e(s.prototype,o),i&&e(s,i),s}}(),Vt=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)},oe=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};(function(e){Vt(s,e);function s(){var o,i,r,l;Mt(this,s);for(var a=arguments.length,d=Array(a),c=0;c<a;c++)d[c]=arguments[c];return l=(i=(r=oe(this,(o=s.__proto__||Object.getPrototypeOf(s)).call.apply(o,[this].concat(d))),r),r._lastRenderedStartIndex=-1,r._lastRenderedStopIndex=-1,r._memoizedUnloadedRanges=[],r._onItemsRendered=function(u){var p=u.visibleStartIndex,f=u.visibleStopIndex;r._lastRenderedStartIndex=p,r._lastRenderedStopIndex=f,r._ensureRowsLoaded(p,f)},r._setRef=function(u){r._listRef=u},i),oe(r,l)}return Ot(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,r){var l=this.props,a=l.isItemLoaded,d=l.itemCount,c=l.minimumBatchSize,u=c===void 0?10:c,p=l.threshold,f=p===void 0?15:p,m=Dt({isItemLoaded:a,itemCount:d,minimumBatchSize:u,startIndex:Math.max(0,i-f),stopIndex:Math.min(d-1,r+f)});(this._memoizedUnloadedRanges.length!==m.length||this._memoizedUnloadedRanges.some(function(v,T){return m[T]!==v}))&&(this._memoizedUnloadedRanges=m,this._loadUnloadedRanges(m))}},{key:"_loadUnloadedRanges",value:function(i){for(var r=this,l=this.props.loadMoreItems||this.props.loadMoreRows,a=function(u){var p=i[u],f=i[u+1],m=l(p,f);m!=null&&m.then(function(){if(Nt({lastRenderedStartIndex:r._lastRenderedStartIndex,lastRenderedStopIndex:r._lastRenderedStopIndex,startIndex:p,stopIndex:f})){if(r._listRef==null)return;typeof r._listRef.resetAfterIndex=="function"?r._listRef.resetAfterIndex(p,!0):(typeof r._listRef._getItemStyleCache=="function"&&r._listRef._getItemStyleCache(-1),r._listRef.forceUpdate())}})},d=0;d<i.length;d+=2)a(d)}}]),s})(h.PureComponent);const Ut=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Ft=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Wt=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Bt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),zt=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Ht=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Yt=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Zt=()=>n.c1,Gt=n.styled_default(Zt())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0});var me={exports:{}},Kt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Jt=Kt,Xt=Jt;function fe(){}function ve(){}ve.resetWarningCache=fe;var en=function(){function e(i,r,l,a,d,c){if(c!==Xt){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function s(){return e}var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:s,element:e,elementType:e,instanceOf:s,node:e,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:ve,resetWarningCache:fe};return o.PropTypes=o,o};me.exports=en();var sn=me.exports;const S=n.getDefaultExportFromCjs(sn);class B extends h.Component{constructor(s){super(s),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 s=this.getParentElement(this.scrollComponent);s.scrollTop=s.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}componentWillUnmount(){this.detachScrollListener(),this.detachMousewheelListener()}isPassiveSupported(){let s=!1;const o={get passive(){s=!0}};try{document.addEventListener("test",null,o),document.removeEventListener("test",null,o)}catch{}return s}eventListenerOptions(){let s=this.props.useCapture;return this.isPassiveSupported()?s={useCapture:this.props.useCapture,passive:!0}:s={passive:!1},s}setDefaultLoader(s){this.defaultLoader=s}detachMousewheelListener(){let s=window;this.props.useWindow===!1&&(s=this.scrollComponent.parentNode),s.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}detachScrollListener(){let s=window;this.props.useWindow===!1&&(s=this.getParentElement(this.scrollComponent)),s.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),s.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}getParentElement(s){const o=this.props.getScrollParent&&this.props.getScrollParent();return o??(s&&s.parentNode)}filterProps(s){return s}attachScrollListener(){const s=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!s)return;let o=window;this.props.useWindow===!1&&(o=s),o.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),o.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),o.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}mousewheelListener(s){s.deltaY===1&&!this.isPassiveSupported()&&s.preventDefault()}scrollListener(){const s=this.scrollComponent,o=window,i=this.getParentElement(s);let r;if(this.props.useWindow){const l=document.documentElement||document.body.parentNode||document.body,a=o.pageYOffset!==void 0?o.pageYOffset:l.scrollTop;this.props.isReverse?r=a:r=this.calculateOffset(s,a)}else this.props.isReverse?r=i.scrollTop:r=s.scrollHeight-i.scrollTop-i.clientHeight;r<Number(this.props.threshold)&&s&&s.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=i.scrollHeight,this.beforeScrollTop=i.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}calculateOffset(s,o){return s?this.calculateTopPosition(s)+(s.offsetHeight-o-window.innerHeight):0}calculateTopPosition(s){return s?s.offsetTop+this.calculateTopPosition(s.offsetParent):0}render(){const s=this.filterProps(this.props),{children:o,element:i,hasMore:r,initialLoad:l,isReverse:a,loader:d,loadMore:c,pageStart:u,ref:p,threshold:f,useCapture:m,useWindow:v,getScrollParent:T,...y}=s;y.ref=x=>{this.scrollComponent=x,p&&p(x)};const j=[o];return r&&(d?a?j.unshift(d):j.push(d):this.defaultLoader&&(a?j.unshift(this.defaultLoader):j.push(this.defaultLoader))),h.createElement(i,y,j)}}F(B,"propTypes",{children:S.node.isRequired,element:S.node,hasMore:S.bool,initialLoad:S.bool,isReverse:S.bool,loader:S.node,loadMore:S.func.isRequired,pageStart:S.number,ref:S.func,getScrollParent:S.func,threshold:S.number,useCapture:S.bool,useWindow:S.bool}),F(B,"defaultProps",{element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null});const tn=({rank:e,avatar:s,name:o,points:i,isCurrentUser:r,openItemDetail:l,style:a})=>t.jsxs(Ut,{onClick:l,style:a,children:[t.jsx(Ft,{children:e||0}),t.jsxs(zt,{children:[s?t.jsx(Wt,{alt:"leaderboard-item-avatar",src:s}):t.jsx(Bt,{children:ae(o||"")}),t.jsxs(Ht,{children:[t.jsx(Yt,{children:o||""}),r&&t.jsx(Gt,{name:"icon-star"})]})]}),t.jsx("div",{children:le(i)})]}),nn=n.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),on=({items:e,currentUserId:s,openItemDetail:o,fetchMore:i,scrollNode:r,hasMore:l})=>t.jsx(B,{loadMore:i,initialLoad:!1,hasMore:l,useWindow:!1,getScrollParent:()=>r.current,children:t.jsx(nn,{children:e.map(a=>t.jsx(tn,{...a,openItemDetail:()=>o(a.userId),isCurrentUser:!!s&&s===a.userId},a.userId))})}),rn=({renderClipBoardNode:e,deepLink:s})=>t.jsx(n.E$1,{renderToNode:e,inviteLink:s,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s More Fun With Friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."}),an=n.styled_default("div")({name:"InviteLinkContainer",class:"i1chxfpe",propsAsIs:!1}),ln=({gamification:e,scrollNode:s,scrollStore:o,renderClipBoardNode:i})=>{const{data:r,hasMore:l,loading:a,key:d}=n.useStore(e.leaderboardList.$store),{data:c}=n.useStore(e.deepLink.$store),[u,p]=n.Kk(i);return!r.length&&!a?t.jsx(rn,{renderClipBoardNode:i,deepLink:c}):t.jsxs(t.Fragment,{children:[t.jsx(on,{items:r,scrollNode:s,scrollStore:o,fetchMore:e.leaderboardList.fetchMore,hasMore:l,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()},d),c&&t.jsx(an,{children:t.jsx(Qt,{onClick:()=>u(c),title:"Invite Friends",description:"Challenge them now!"})}),p]})},dn=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),cn=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),un=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),pn=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),hn=()=>n.c1,D=n.styled_default(hn())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),mn=()=>n.c1,fn=n.styled_default(mn())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),vn=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),yn=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),xn=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),In={[n.PickHistoryStatus.LOST]:t.jsx(D,{name:"incorrectVoted"}),[n.PickHistoryStatus.WON]:t.jsx(D,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:t.jsx(D,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:t.jsx(D,{name:"icon-arrow"})},jn=({questionId:e,questionType:s,questionStatus:o,subject:i,openForVoting:r,openQuestion:l,status:a})=>{const d=n.o[s],c=In[a];return d?t.jsxs(dn,{onClick:()=>l==null?void 0:l(e),children:[t.jsxs(yn,{children:[t.jsxs(cn,{children:[t.jsx(fn,{"data-type-trivia":s===n.QuestionType.TRIVIA,"data-type-poll":s===n.QuestionType.POLL,name:d.iconName}),t.jsxs(vn,{children:[d.label,s===n.QuestionType.TRIVIA&&o===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),t.jsx(un,{children:i||""})]}),t.jsx(pn,{children:r?t.jsx(xn,{children:"Play"}):c})]}):null},Cn=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),gn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),Tn=({openInsight:e,questionId:s,...o})=>t.jsxs(Cn,{children:[t.jsx(he,{questionId:s,...o}),e&&t.jsx(gn,{onClick:()=>e(s),children:"View Insight"})]}),An=n.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),bn=()=>n.c$1,$n=n.styled_default(bn())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),wn=n.styled_default("div")({name:"DateTime",class:"d1hbaleq",propsAsIs:!1}),Sn=n.styled_default("blockquote")({name:"Quote",class:"qvvgqjm",propsAsIs:!1}),_n=({openTweet:e,created:s,...o})=>{const i=h.useMemo(()=>{if(s){const r=new Date(s);if(Y(r))return{date:z(r),time:H(r)}}return null},[s]);return t.jsxs(An,{children:[i&&t.jsxs(wn,{children:[i.date," · ",i.time]}),o.title&&t.jsx(Sn,{children:o.title}),t.jsx(n.j,{...o}),e&&t.jsx($n,{onClick:()=>e(o.tweetId),children:"View Insight"})]})},Rn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),kn=({questions:e,openQuestion:s})=>t.jsx(Rn,{children:e==null?void 0:e.map(o=>{var i,r,l;if(o.type==="question"&&((i=o.attributes)==null?void 0:i.attributes.case)==="question"){const a=o.attributes.attributes.value;return t.jsx(jn,{openQuestion:s,...a},a.questionId)}if(o.type==="insight"&&((r=o.attributes)==null?void 0:r.attributes.case)==="insight"){const a=o.attributes.attributes.value,d=o.attributes.created;return t.jsx(Tn,{openInsight:s,...a,created:d},a.questionId)}if(o.type==="tweet"&&((l=o.attributes)==null?void 0:l.attributes.case)==="tweet"){const a=o.attributes.attributes.value,d=o.attributes.id,c=o.attributes.created;return t.jsx(_n,{openTweet:s,...a,tweetId:d,created:c},d)}return null})}),En=({store:e,openQuestion:s})=>{const o=n.useStore(e);return o!=null&&o.data?t.jsx(kn,{openQuestion:s,questions:o.data}):t.jsx("div",{children:"wait questions..."})},Ln=({userSummary:e})=>{var s;const[o,i]=h.useState(void 0);return h.useEffect(()=>{const r=e.subscribe(l=>{l!=null&&l.data&&i(l.data)});return()=>{r()}},[e]),o!=null&&o.summary?t.jsx(de,{...o.summary,successRate:(s=o.percentage)==null?void 0:s.correct}):t.jsx("div",{children:"wait user..."})},Pn=({gamification:e,className:s,scrollStore:o,scrollNode:i,appNode:r,style:l,responsiveStore:a,headerNode:d})=>{const[c,u]=h.useState(!1),[p,f]=h.useState(M.HOME),[,m]=h.useTransition(),{sdkInScrollView:v}=n.useStore(a,{keys:["sdkInScrollView"]}),T=I=>{m(()=>{var g;f(I),v===!1&&(((g=r.current)==null?void 0:g.getBoundingClientRect().y)||0)<0&&n.D(r,{behavior:"instant"})})},y=I=>{m(()=>u(I))};h.useEffect(()=>o.listen(I=>{if(I.scrollPosition===0){y(!1),o.setKey("tabsShown",!1);return}y(I.scrollDirection==="forward"),o.setKey("tabsShown",I.scrollDirection!=="forward")}),[o]);let j="0px";v?j=c?"calc(8px - var(--header-height) - var(--header-offset))":"0px":j=c?"calc(var(--header-height) + var(--header-offset))":"0px";const x=v?r:d;return t.jsxs(n.p,{className:s,style:l,children:[t.jsx(n.C,{style:{top:j},children:t.jsx(wt,{activePage:p,toggleActivePage:T})}),p===M.HOME&&t.jsxs(t.Fragment,{children:[t.jsx(n.n,{style:{paddingTop:"8px"},children:t.jsx(n.m,{children:t.jsx(Ln,{userSummary:e.userSummary})})}),t.jsx(n.a,{style:{flex:1},children:t.jsx(En,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),p===M.LEADERBOARD&&t.jsx(n.l,{children:t.jsx(ln,{renderClipBoardNode:x,scrollStore:o,scrollNode:i,gamification:e})})]})},qn=()=>n.l$1,ie=n.styled_default(qn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),Qn=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Nn=({correct:e,incorrect:s})=>{const o=e+s;return o===0?0:Math.round(e/o*100)},Dn=`
2
2
  body {
3
3
  overflow: hidden
4
4
  }
5
- `,Dn=({gamification:e,scrollStore:t,className:o,appNode:i,scrollNode:r,headerNode:l,responsiveStore:a})=>{const d=n.useStore(e.openedQuestion.$store),c=n.useStore(e.openedUser),{sdkInScrollView:u}=n.useStore(a,{keys:["sdkInScrollView"]}),h=p.useRef(0),[f,m]=p.useMemo(()=>{var y;const g=u?i:l,v=(((y=i.current)==null?void 0:y.getBoundingClientRect().y)||0)<0;if((d||c)&&g.current){v&&(h.current=window.scrollY);const j=()=>(p.useEffect(()=>{const I=setTimeout(()=>{var x;(x=i.current)==null||x.scrollIntoView()},1e3);return()=>{clearTimeout(I),h.current!==0&&(window.scroll({top:h.current}),h.current=0)}},[]),s.jsx("style",{children:Nn}));return[v,d?n.Yk.createPortal(s.jsxs(ne,{className:o,children:[s.jsx(Ct,{gamification:e}),v&&!u&&s.jsx(j,{})]}),g.current):c?n.Yk.createPortal(s.jsx(ne,{className:o,children:s.jsxs(qn,{children:[s.jsx(oe,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.n,{children:s.jsx(ae,{...c,successRate:Qn(c)})})]})}),g.current):null]}return[v,null]},[i,o,e,l,d,c,u]);return s.jsxs(s.Fragment,{children:[m,s.jsx(Ln,{appNode:i,headerNode:l,scrollStore:t,scrollNode:r,className:o,gamification:e,responsiveStore:a,style:!u&&!f&&m!==null?{height:"0",overflow:"hidden"}:{}})]})};exports.default=Dn;
5
+ `,Mn=({gamification:e,scrollStore:s,className:o,appNode:i,scrollNode:r,headerNode:l,responsiveStore:a})=>{const d=n.useStore(e.openedQuestion.$store),c=n.useStore(e.openedUser),{sdkInScrollView:u}=n.useStore(a,{keys:["sdkInScrollView"]}),p=h.useRef(0),[f,m]=h.useMemo(()=>{var v;const T=u?i:l,y=(((v=i.current)==null?void 0:v.getBoundingClientRect().y)||0)<0;if((d||c)&&T.current){y&&(p.current=window.scrollY);const j=()=>(h.useEffect(()=>{const x=setTimeout(()=>{n.D(i,{behavior:"instant"})},1e3);return()=>{clearTimeout(x),p.current!==0&&(window.scroll({top:p.current}),p.current=0)}},[]),t.jsx("style",{children:Dn}));return[y,d?n.Yk.createPortal(t.jsxs(ie,{className:o,children:[t.jsx(gt,{gamification:e}),y&&!u&&t.jsx(j,{})]}),T.current):c?n.Yk.createPortal(t.jsx(ie,{className:o,children:t.jsxs(Qn,{children:[t.jsx(re,{label:"Friend's Rank",close:e.closeUser}),t.jsx(n.n,{children:t.jsx(de,{...c,successRate:Nn(c)})})]})}),T.current):null]}return[y,null]},[i,o,e,l,d,c,u]);return t.jsxs(t.Fragment,{children:[m,t.jsx(Pn,{appNode:i,headerNode:l,scrollStore:s,scrollNode:r,className:o,gamification:e,responsiveStore:a,style:!u&&!f&&m!==null?{height:"0",overflow:"hidden"}:{}})]})};exports.default=Mn;