@streamlayer/react 0.34.0 → 0.34.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("./index4.js"),Q=require("@nanostores/react"),M=require("./masters2.js"),c=require("@streamlayer/sdk-web-types"),I=require("react"),B=require("./index3.js");require("react-countup");const xe=require("react-countdown-circle-timer"),E=require("./index2.js"),je=require("react-infinite-scroller");require("@streamlayer/sdk-web-interfaces");require("@streamlayer/sdk-web-notifications");require("lodash.throttle");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const me=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),ye=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),Me=()=>n.r1,he=n.styled_default(Me())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),fe=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Ne=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),Te=()=>n.r1,Ae=n.styled_default(Te())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ne=({type:s,close:t,label:i})=>{const o=s?M.o[s]:{label:i,iconName:void 0};return e.jsxs(me,{children:[e.jsxs(ye,{children:[(o==null?void 0:o.iconName)&&e.jsx(he,{"data-type-trivia":s===c.QuestionType.TRIVIA,"data-type-poll":s===c.QuestionType.POLL,name:o.iconName}),(o==null?void 0:o.label)&&e.jsx(fe,{children:o.label})]}),e.jsx(Ne,{onClick:t,children:e.jsx(Ae,{name:"icon-cross"})})]})},ie=s=>s.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),ae=s=>s?s.toLocaleString("en-US"):"0",W=s=>s.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),F=s=>s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),H=s=>!isNaN(s.getTime()),ge=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),De=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),ve=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),J=({indicator:s,title:t})=>e.jsxs(ge,{children:[e.jsx(De,{children:t}),e.jsx(ve,{children:s})]}),ke=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Se=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),ze=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),R=({indicator:s,title:t})=>e.jsxs(ke,{children:[e.jsx(Se,{children:s}),e.jsx(ze,{children:t})]}),Ee=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Qe=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Ce=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),be=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Oe=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Le=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),we=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),_e=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),$e=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Re=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),qe=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Ue=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),Ye=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Pe=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Ve=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),Be=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),We=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),Fe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",oe=({avatar:s,name:t,points:i,friendsRank:o,rank:a,streak:u,correct:r,incorrect:l,inTop:d,successRate:p})=>e.jsxs(Ee,{children:[e.jsx(Qe,{children:e.jsxs(be,{children:[e.jsxs(We,{children:[s&&e.jsx(Oe,{alt:"avatar",src:s}),!s&&e.jsx(Be,{children:ie(t||"")})]}),e.jsxs(Le,{children:[e.jsx(we,{children:t}),e.jsxs(_e,{children:[e.jsxs(Re,{children:[e.jsx($e,{alt:"rank-icon",src:Fe}),e.jsxs(qe,{children:[ae(i),e.jsx(Ue,{children:"PTS"})]})]}),e.jsx(Ye,{}),e.jsxs("div",{children:["TOP ",d||0,"%"]})]})]})]})}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(J,{indicator:o||0,title:"Friends rank"}),e.jsx(J,{indicator:a||0,title:"Global rank"})]}),e.jsxs(Ve,{children:[e.jsx(R,{indicator:u||0,title:"Win streak"}),e.jsx(R,{indicator:r||0,title:"Correct"}),e.jsx(R,{indicator:l||0,title:"Incorrect"}),e.jsx(R,{indicator:`${p||0}%`,title:"Succ. rate"})]})]})]}),He=n.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),Ge=()=>n.r1,Ze=n.styled_default(Ge())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),Je=()=>e.jsx(He,{children:e.jsx(Ze,{name:"mastersLogo"})}),Ke=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),Xe=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),es=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),ss=({title:s,description:t})=>e.jsxs(Ke,{children:[e.jsx(n.r1,{name:"icon-check-circle"}),e.jsx(Xe,{children:s}),e.jsx(es,{children:t})]}),ts=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ns=()=>n.r1,is=n.styled_default(ns())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),_=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),q=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),as=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),L=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),V=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),os=({feedbackMessages:s,questionVotedCorrectly:t,questionVoted:i,questionType:o,hasCorrectAnswer:a,questionStatus:u,showExpiredNotification:r,showClosedNotificationTrivia:l,votedInCurrentRender:d,votedAfterQuestionClosed:p,enteredAnActiveQuestion:x,marketClosed:j})=>{const y=i&&(o===c.QuestionType.TRIVIA||o===c.QuestionType.PREDICTION)&&d&&u!==c.QuestionStatus.RESOLVED,h=o===c.QuestionType.PREDICTION&&!a,k=j&&o===c.QuestionType.PREDICTION&&!i&&!x||o===c.QuestionType.PREDICTION&&p&&d&&x,T=y&&h,S=y&&a,A=o===c.QuestionType.PREDICTION&&i&&d&&a,C=i&&o===c.QuestionType.POLL&&d;if(!r&&!l&&!T&&!S&&!k&&!C&&!A)return null;const v=t?"correct":"incorrect",D=t?s==null?void 0:s.correctFeedback:s==null?void 0:s.incorrectFeedback;return e.jsxs(ts,{"data-isPrediction":h,children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(_,{children:e.jsx(n.r1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(q,{children:e.jsx(L,{children:"Question Expired"})}),e.jsx(V,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),l&&e.jsxs(e.Fragment,{children:[e.jsx(_,{children:e.jsx(n.r1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(q,{children:e.jsx(L,{children:"Question Closed"})}),e.jsx(V,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),k&&e.jsxs(e.Fragment,{children:[e.jsx(_,{children:e.jsx(n.r1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(q,{children:e.jsx(L,{children:"Question Closed"})}),e.jsx(V,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),T&&e.jsxs(e.Fragment,{children:[e.jsx(is,{name:"icon-prediction"}),e.jsx(L,{children:"Stay tuned to see if your prediction was correct."})]}),C&&e.jsxs(e.Fragment,{children:[e.jsx(_,{"data-feedbackType":"correct",children:e.jsx(n.r1,{name:"correct"})}),e.jsx(L,{children:"That's for answering. Please stay tuned for the next question."})]}),(S||A)&&e.jsxs(e.Fragment,{children:[e.jsx(_,{"data-feedbackType":v,children:e.jsx(n.r1,{name:v})}),e.jsx("div",{children:e.jsxs(q,{children:[e.jsx(as,{"data-feedbackType":v,children:D==null?void 0:D.title}),e.jsx(L,{children:D==null?void 0:D.description})]})})]})]})},rs=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),ls=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),ds=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),cs=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),us=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),ps=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),Is=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),xs=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),js=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),re=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),ms=()=>re,ys=n.styled_default(ms())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),Ms=()=>re,hs=n.styled_default(Ms())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),fs=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Ns=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Ts=n.styled_default("span")({name:"Pts",class:"p17ajcu2",propsAsIs:!1}),As=n.styled_default("span")({name:"Percentage",class:"pu9kmlb",propsAsIs:!1}),gs=()=>n.r1,Ds=n.styled_default(gs())({name:"CheckIcon",class:"c1j2j0s0",propsAsIs:!0}),K={[c.QuestionImages.CENTERED]:s=>e.jsx(ys,{alt:"option-icon",src:s}),[c.QuestionImages.TRANSPARENT]:s=>e.jsx(xs,{children:e.jsx(js,{style:{backgroundImage:`url(${s})`}})}),[c.QuestionImages.ROUNDED]:s=>e.jsx(hs,{alt:"option-icon",src:s}),[c.QuestionImages.NONE]:()=>null,[c.QuestionImages.UNSET]:()=>null},vs=({questionType:s,hasCorrectAnswer:t,correct:i,youVoted:o,questionVoted:a})=>{if(s===c.QuestionType.POLL&&o)return"correct";if(s===c.QuestionType.PREDICTION){if(t&&a)return o?i?"correct":"incorrect":"unset";if(o)return"correct"}return s===c.QuestionType.TRIVIA&&a&&o?i?"correct":"incorrect":"unset"},ks=({questionType:s,questionVoted:t,correct:i,hasCorrectAnswer:o,questionStatus:a})=>s===c.QuestionType.TRIVIA?t&&i:s===c.QuestionType.PREDICTION?t&&i&&o||a===c.QuestionStatus.RESOLVED&&i:!1,Ss=s=>{var t;const{id:i,icon:o,text:a,percentageDecimal:u,points:r,onVote:l,markThatVoted:d,youSelected:p,questionVoted:x,imageMode:j,answerTimeExpired:y,questionStatus:h,isLoading:k,questionType:T,correct:S,hasCorrectAnswer:A,votedAfterQuestionClosed:C,enteredAnActiveQuestion:v,marketClosed:D}=s,z=vs(s),P=ks({questionType:T,questionVoted:x,correct:S,hasCorrectAnswer:A,questionStatus:h}),b=D&&T===c.QuestionType.PREDICTION,$=x||b,m=T===c.QuestionType.PREDICTION&&!x&&h!==c.QuestionStatus.RESOLVED;return e.jsxs(us,{value:i,"data-selected":p,"data-answer-state":z,disabled:x||k||y||b&&!v||b&&v&&C,"data-is-not-checked":x&&!p&&z!=="incorrect",onClick:N=>{d(T===c.QuestionType.PREDICTION?D:h===c.QuestionStatus.RESOLVED),l(N)},children:[e.jsx(ps,{"data-answer-state":z,style:{width:`${$?u:0}%`}}),e.jsxs(Is,{children:[o&&j&&((t=K[j])==null?void 0:t.call(K,o)),e.jsx(fs,{children:a}),m&&e.jsxs("div",{children:[e.jsx(B.d,{value:r}),e.jsx(Ts,{children:"pts"})]}),$&&e.jsxs(Ns,{children:[P&&e.jsx(Ds,{name:"selected"}),e.jsx(As,{children:e.jsx(B.d,{value:u,suffix:"%"})})]})]})]})},zs=[E.E.PRIMARY_GREEN1,E.E.SECONDARY_RED1,E.E.SECONDARY_RED1,E.E.NEUTRALS_GRAY3],Es=[10,10,1,0],Qs=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Cs=E.E.SECONDARY_GREEN6,X=E.E.SECONDARY_RED3,bs=E.E.NEUTRALS_GRAY3,Os=({isPlaying:s=!0,duration:t=30,onTimerExpired:i})=>{const[o,a]=I.useState(t>10?Cs:X),u=({remainingTime:d})=>e.jsx(Qs,{children:d}),r=I.useCallback(()=>{i==null||i(),a(bs)},[i,a]),l=I.useCallback(d=>{d===10&&a(X)},[a]);return e.jsx(xe.CountdownCircleTimer,{isPlaying:s,duration:t,colors:zs,colorsTime:Es,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:o,onComplete:r,onUpdate:l,children:u})},Ls=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),ws=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),_s=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),$s=()=>n.r1,Rs=n.styled_default($s())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),qs=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Us=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),Ys=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Ps=({title:s,points:t,isPlayingTimer:i,isTimer:o,questionType:a,timerDuration:u,onTimerExpired:r})=>e.jsxs(Ls,{style:{justifyContent:a===c.QuestionType.PREDICTION?"center":"space-between"},children:[e.jsxs(ws,{children:[s&&e.jsx(_s,{children:s}),t!==void 0&&a!==c.QuestionType.POLL&&e.jsxs(e.Fragment,{children:[e.jsx(Rs,{name:"icon-trophy"}),e.jsxs(qs,{children:[e.jsx(Us,{children:e.jsx(B.d,{value:t})}),e.jsx(Ys,{children:"PTS"})]})]})]}),o&&a!==c.QuestionType.PREDICTION&&e.jsx(Os,{isPlaying:i,onTimerExpired:r,duration:u})]}),Vs=({openedQuestion:s,isLoading:t,vote:i,close:o})=>{var a,u;const r=s.subject,l=s.type,d=s.status,p=(a=s.options)==null?void 0:a.options,x=s.marketClosed,[j,y]=I.useState(!1),[h,k]=I.useState(!1),[T,S]=I.useState(!0),[A,C]=I.useState(!1),[v,D]=I.useState(""),z=s==null?void 0:s.id;I.useEffect(()=>{l===c.QuestionType.PREDICTION?x&&S(!1):d===c.QuestionStatus.RESOLVED&&S(!1)},[]);const P=I.useCallback(f=>{k(f),y(!0)},[]),b=I.useCallback(async f=>{if(z){const w=f.currentTarget.value;D(w),await i(z,w)}},[z,D,i]),$=I.useCallback(()=>{C(!0),setTimeout(o,3e3)},[o]),m=I.useMemo(()=>s==null?void 0:s.answers.find(f=>f.youVoted===!0),[s]),N=I.useMemo(()=>!!(s!=null&&s.answers.find(f=>f.correct===!0)),[s]),g=I.useMemo(()=>s==null?void 0:s.answers.find(f=>f.correct===!0),[s]),de=I.useMemo(()=>s?s.answers.map(f=>{var w;return{...f,questionVoted:!!m,youSelected:v===f.id,isLoading:t,hasCorrectAnswer:N,questionType:s.type,answerTimeExpired:A,questionStatus:d,imageMode:(w=s.appearance)==null?void 0:w.images,onVote:b}}):[],[N,A,t,s,m,d,b,v]),ce=p&&(p.case==="trivia"||p.case==="prediction")?p.value:void 0,O=d===c.QuestionStatus.RESOLVED&&l===c.QuestionType.TRIVIA&&!m&&!T,G=l===c.QuestionType.TRIVIA&&h&&j&&T,Z=I.useMemo(()=>l===c.QuestionType.PREDICTION?!!(m&&!N||m&&N&&g!=null&&g.youVoted):!0,[l,m,N,g]),ue=I.useMemo(()=>{if(l===c.QuestionType.PREDICTION&&m&&(!N||N&&g!=null&&g.youVoted))return m.points;if(!(O||A))return d===c.QuestionStatus.RESOLVED?0:m?m.correct?m.points:0:g==null?void 0:g.points},[A,m,g,d,O,l,N]),pe=I.useMemo(()=>l===c.QuestionType.PREDICTION&&m?N?N&&g!=null&&g.youVoted?"You won":"":"To win":O||A?"Time expired":l===c.QuestionType.POLL?"Time remaining":m?"You won":"To win",[A,l,m,O,N,g]),Ie=m||O||G||l===c.QuestionType.TRIVIA&&d===c.QuestionStatus.RESOLVED&&T;return e.jsx(M.r,{"data-question-header":"true",children:e.jsx(rs,{children:e.jsxs(ls,{children:[e.jsx(os,{feedbackMessages:ce,questionVoted:!!m,questionVotedCorrectly:m==null?void 0:m.correct,questionType:l,hasCorrectAnswer:N,questionStatus:d,showExpiredNotification:O,showClosedNotificationTrivia:G,votedInCurrentRender:j,votedAfterQuestionClosed:h,enteredAnActiveQuestion:T,marketClosed:x}),Z&&e.jsx(Ps,{title:pe,points:ue,onTimerExpired:$,questionType:s.type,isTimer:!t,isPlayingTimer:!m,timerDuration:Ie?0:Number(((u=s==null?void 0:s.appearance)==null?void 0:u.autoHideInterval)||"30")}),A?e.jsx(ss,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):e.jsxs(e.Fragment,{children:[e.jsx(ds,{style:Z?{}:{marginTop:0},children:r}),e.jsx(cs,{children:de.map(f=>e.jsx(Ss,{...f,markThatVoted:P,votedAfterQuestionClosed:h,enteredAnActiveQuestion:T,marketClosed:x},f.id))})]})]})})})},Bs=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),Ws=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),Fs=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),Hs=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),Gs=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),Zs=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),le=({created:s,image:t,title:i,isPickHistory:o,instantView:a,notification:u})=>{const r=I.useMemo(()=>{if(s){const d=new Date(s);if(H(d))return{date:W(d),time:F(d)}}return null},[s]),l=(a==null?void 0:a.image)||t;return e.jsxs(Bs,{children:[r&&e.jsxs(Gs,{children:[r.date," · ",r.time]}),(a==null?void 0:a.video)&&e.jsx(M.w,{source:a.video.url,poster:a.video.thumbnailUrl}),l&&!(a!=null&&a.video)&&e.jsx(Zs,{src:l}),e.jsxs(Ws,{children:[e.jsx(Fs,{children:o?i:a==null?void 0:a.heading}),e.jsx(Hs,{children:o?u==null?void 0:u.body:a==null?void 0:a.body})]})]})},Js=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),Ks=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),Xs=({instantView:s,...t})=>e.jsxs(Js,{children:[e.jsx(le,{instantView:s,...t}),(s==null?void 0:s.webLink)&&e.jsxs(Ks,{href:s==null?void 0:s.webLink.url,target:"_blank",children:[s==null?void 0:s.webLink.label,e.jsx(n.r1,{name:"icon-external-link"})]})]}),et=n.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),st=n.styled_default("div")({name:"DateTime",class:"db4q22c",propsAsIs:!1}),tt=n.styled_default("blockquote")({name:"Quote",class:"q111mmic",propsAsIs:!1}),nt=({created:s,...t})=>{const i=I.useMemo(()=>{if(s){const o=new Date(s);if(H(o))return{date:W(o),time:F(o)}}return null},[s]);return e.jsxs(et,{children:[i&&e.jsxs(st,{children:[i.date," · ",i.time]}),t.title&&e.jsx(tt,{children:t.title}),e.jsx(M.u,{...t})]})},it=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),at=({openedQuestion:s})=>{var t,i;return((t=s==null?void 0:s.attributes)==null?void 0:t.attributes.case)==="insight"?e.jsx(Xs,{created:s.attributes.created,...s.attributes.attributes.value}):((i=s==null?void 0:s.attributes)==null?void 0:i.attributes.case)==="tweet"?e.jsx(nt,{created:s.attributes.created,...s.attributes.attributes.value}):null},ot=({extendedQuestion:s,vote:t,close:i})=>{const{loading:o,data:a}=s;return a?e.jsx(Vs,{vote:t,close:i,openedQuestion:a,isLoading:!!o}):null},rt=({gamification:s})=>{var t;const i=Q.useStore(s.openedQuestion.$store),o=Q.useStore(s.openedQuestion.$extendedStore);if(!i)return null;const a=i.type;return e.jsxs(it,{children:[e.jsx(ne,{close:s.closeQuestion,type:((t=i.attributes)==null?void 0:t.type)||c.QuestionType.UNSET}),a==="question"&&e.jsx(ot,{vote:s.submitAnswer,close:s.closeQuestion,extendedQuestion:o}),a!=="question"&&e.jsx(at,{openedQuestion:i}),e.jsx(Je,{sponsorLogo:""})]})},lt=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),dt=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),ct=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),ut=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var Y=(s=>(s.HOME="home",s.LEADERBOARD="leaderboard",s))(Y||{});const ee=({title:s,active:t,onClick:i})=>e.jsx(ct,{onClick:i,"data-selected":t,children:e.jsx(ut,{children:s})}),pt=({activePage:s="home",toggleActivePage:t})=>e.jsx(lt,{children:e.jsxs(dt,{"data-position":s==="home"?"left":"right",children:[e.jsx(ee,{title:"Home",active:s==="home",onClick:()=>t("home")}),e.jsx(ee,{title:"Friends",active:s==="leaderboard",onClick:()=>t("leaderboard")})]})});function It(s){var t=s.lastRenderedStartIndex,i=s.lastRenderedStopIndex,o=s.startIndex,a=s.stopIndex;return!(o>i||a<t)}function xt(s){for(var t=s.isItemLoaded,i=s.itemCount,o=s.minimumBatchSize,a=s.startIndex,u=s.stopIndex,r=[],l=null,d=null,p=a;p<=u;p++){var x=t(p);x?d!==null&&(r.push(l,d),l=d=null):(d=p,l===null&&(l=p))}if(d!==null){for(var j=Math.min(Math.max(d,l+o-1),i-1),y=d+1;y<=j&&!t(y);y++)d=y;r.push(l,d)}if(r.length)for(;r[1]-r[0]+1<o&&r[0]>0;){var h=r[0]-1;if(!t(h))r[0]=h;else break}return r}var jt=function(s,t){if(!(s instanceof t))throw new TypeError("Cannot call a class as a function")},mt=function(){function s(t,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,i,o){return i&&s(t.prototype,i),o&&s(t,o),t}}(),yt=function(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);s.prototype=Object.create(t&&t.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(s,t):s.__proto__=t)},se=function(s,t){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:s};(function(s){yt(t,s);function t(){var i,o,a,u;jt(this,t);for(var r=arguments.length,l=Array(r),d=0;d<r;d++)l[d]=arguments[d];return u=(o=(a=se(this,(i=t.__proto__||Object.getPrototypeOf(t)).call.apply(i,[this].concat(l))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(p){var x=p.visibleStartIndex,j=p.visibleStopIndex;a._lastRenderedStartIndex=x,a._lastRenderedStopIndex=j,a._ensureRowsLoaded(x,j)},a._setRef=function(p){a._listRef=p},o),se(a,u)}return mt(t,[{key:"resetloadMoreItemsCache",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],o&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var o=this.props.children;return o({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(o,a){var u=this.props,r=u.isItemLoaded,l=u.itemCount,d=u.minimumBatchSize,p=d===void 0?10:d,x=u.threshold,j=x===void 0?15:x,y=xt({isItemLoaded:r,itemCount:l,minimumBatchSize:p,startIndex:Math.max(0,o-j),stopIndex:Math.min(l-1,a+j)});(this._memoizedUnloadedRanges.length!==y.length||this._memoizedUnloadedRanges.some(function(h,k){return y[k]!==h}))&&(this._memoizedUnloadedRanges=y,this._loadUnloadedRanges(y))}},{key:"_loadUnloadedRanges",value:function(o){for(var a=this,u=this.props.loadMoreItems||this.props.loadMoreRows,r=function(p){var x=o[p],j=o[p+1],y=u(x,j);y!=null&&y.then(function(){if(It({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:x,stopIndex:j})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(x,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},l=0;l<o.length;l+=2)r(l)}}]),t})(I.PureComponent);const Mt=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),ht=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),ft=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Nt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Tt=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),At=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),gt=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Dt=()=>n.r1,vt=n.styled_default(Dt())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),kt=({rank:s,avatar:t,name:i,points:o,isCurrentUser:a,openItemDetail:u,style:r})=>e.jsxs(Mt,{onClick:u,style:r,children:[e.jsx(ht,{children:s||0}),e.jsxs(Tt,{children:[t?e.jsx(ft,{alt:"leaderboard-item-avatar",src:t}):e.jsx(Nt,{children:ie(i||"")}),e.jsxs(At,{children:[e.jsx(gt,{children:i||""}),a&&e.jsx(vt,{name:"icon-star"})]})]}),e.jsx("div",{children:ae(o)})]}),St=n.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),zt=({items:s,currentUserId:t,openItemDetail:i,fetchMore:o,scrollNode:a,hasMore:u})=>e.jsx(je,{loadMore:o,initialLoad:!1,hasMore:u,useWindow:!1,getScrollParent:()=>a.current,children:e.jsx(St,{children:s.map(r=>e.jsx(kt,{...r,openItemDetail:()=>i(r.userId),isCurrentUser:!!t&&t===r.userId},r.userId))})}),Et=({deepLink:s})=>{const{data:t}=Q.useStore(s.$store),i=t==null?void 0:t.url,o=s.desktopLink;return e.jsx(M.O,{inviteLink:i||o,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."})},Qt=({gamification:s,scrollNode:t,scrollStore:i})=>{const{data:o,hasMore:a}=Q.useStore(s.leaderboardList.$store);return o!=null&&o.length?e.jsx(zt,{items:o,scrollNode:t,scrollStore:i,fetchMore:s.leaderboardList.fetchMore,hasMore:a,openItemDetail:s.openUser,currentUserId:s.currentUserId.get()}):e.jsx(Et,{deepLink:s.deepLink})},Ct=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),bt=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Ot=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Lt=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),wt=()=>n.r1,U=n.styled_default(wt())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),_t=()=>n.r1,$t=n.styled_default(_t())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),Rt=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),qt=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),Ut=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),Yt={[c.PickHistoryStatus.LOST]:e.jsx(U,{name:"incorrectVoted"}),[c.PickHistoryStatus.WON]:e.jsx(U,{name:"icon-check"}),[c.PickHistoryStatus.UNSET]:e.jsx(U,{name:"icon-arrow"}),[c.PickHistoryStatus.DNP]:e.jsx(U,{name:"icon-arrow"})},Pt=({questionId:s,questionType:t,questionStatus:i,subject:o,openForVoting:a,openQuestion:u,status:r})=>{const l=M.o[t],d=Yt[r];return l?e.jsxs(Ct,{onClick:()=>u==null?void 0:u(s),children:[e.jsxs(qt,{children:[e.jsxs(bt,{children:[e.jsx($t,{"data-type-trivia":t===c.QuestionType.TRIVIA,"data-type-poll":t===c.QuestionType.POLL,name:l.iconName}),e.jsxs(Rt,{children:[l.label,t===c.QuestionType.TRIVIA&&i===c.QuestionStatus.RESOLVED&&" • Expired"]})]}),e.jsx(Ot,{children:o||""})]}),e.jsx(Lt,{children:a?e.jsx(Ut,{children:"Play"}):d})]}):null},Vt=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),Bt=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),Wt=({openInsight:s,questionId:t,...i})=>e.jsxs(Vt,{children:[e.jsx(le,{questionId:t,...i,isPickHistory:!0}),s&&e.jsx(Bt,{onClick:()=>s(t),children:"View Insight"})]}),Ft=n.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),Ht=()=>M.c,Gt=n.styled_default(Ht())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),Zt=n.styled_default("div")({name:"DateTime",class:"d1hbaleq",propsAsIs:!1}),Jt=n.styled_default("blockquote")({name:"Quote",class:"qvvgqjm",propsAsIs:!1}),Kt=({openTweet:s,created:t,...i})=>{const o=I.useMemo(()=>{if(t){const a=new Date(t);if(H(a))return{date:W(a),time:F(a)}}return null},[t]);return e.jsxs(Ft,{children:[o&&e.jsxs(Zt,{children:[o.date," · ",o.time]}),i.title&&e.jsx(Jt,{children:i.title}),e.jsx(M.u,{...i}),s&&e.jsx(Gt,{onClick:()=>s(i.tweetId),children:"View Insight"})]})},Xt=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),en=({questions:s,openQuestion:t})=>e.jsx(Xt,{children:s==null?void 0:s.map(i=>{var o,a,u;if(i.type==="question"&&((o=i.attributes)==null?void 0:o.attributes.case)==="question"){const r=i.attributes.attributes.value;return e.jsx(Pt,{openQuestion:t,...r},r.questionId)}if(i.type==="insight"&&((a=i.attributes)==null?void 0:a.attributes.case)==="insight"){const r=i.attributes.attributes.value,l=i.attributes.created;return e.jsx(Wt,{openInsight:t,...r,created:l},r.questionId)}if(i.type==="tweet"&&((u=i.attributes)==null?void 0:u.attributes.case)==="tweet"){const r=i.attributes.attributes.value,l=i.attributes.id,d=i.attributes.created;return e.jsx(Kt,{openTweet:t,...r,tweetId:l,created:d},l)}return null})}),sn=({store:s,openQuestion:t})=>{const i=Q.useStore(s);return i!=null&&i.data?e.jsx(en,{openQuestion:t,questions:i.data}):e.jsx("div",{children:"wait questions..."})},tn=({userSummary:s})=>{var t;const[i,o]=I.useState(void 0);return I.useEffect(()=>{const a=s.subscribe(u=>{u!=null&&u.data&&o(u.data)});return()=>{a()}},[s]),i!=null&&i.summary?e.jsx(oe,{...i.summary,successRate:(t=i.percentage)==null?void 0:t.correct}):e.jsx("div",{children:"wait user..."})},nn=({gamification:s,className:t,scrollStore:i,scrollNode:o})=>{const[a,u]=I.useState(!1),[r,l]=I.useState(Y.HOME),[,d]=I.useTransition(),p=j=>{d(()=>l(j))},x=j=>{d(()=>u(j))};return I.useEffect(()=>i.listen(j=>{if(j.scrollPosition===0){x(!1),i.setKey("tabsShown",!1);return}x(j.scrollDirection==="forward"),i.setKey("tabsShown",j.scrollDirection!=="forward")}),[i]),e.jsxs("div",{className:t,children:[e.jsx(M.a,{style:{paddingBottom:"8px",position:"sticky",transition:"top calc(var(--animation-duration) / 2) var(--animation-function)",top:a?"-60px":"0px"},children:e.jsx(pt,{activePage:r,toggleActivePage:p})}),r===Y.HOME&&e.jsxs(e.Fragment,{children:[e.jsx(M.a,{style:{paddingTop:"8px"},children:e.jsx(tn,{userSummary:s.userSummary})}),e.jsx(M.n,{children:e.jsx(sn,{openQuestion:s.openQuestion,store:s.feedList.getStore()})})]}),r===Y.LEADERBOARD&&e.jsx(M.a,{style:{paddingTop:"8px"},children:e.jsx(Qt,{scrollStore:i,scrollNode:o,gamification:s})})]})},an=()=>M.x,te=n.styled_default(an())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),on=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),rn=({correct:s,incorrect:t})=>{const i=s+t;return i===0?0:Math.round(s/i*100)},ln=({gamification:s,scrollStore:t,className:i,appNode:o,scrollNode:a})=>{const u=Q.useStore(s.openedQuestion.$store),r=Q.useStore(s.openedUser);return e.jsxs(e.Fragment,{children:[u&&o.current&&M.Pk.createPortal(e.jsx(te,{className:i,children:e.jsx(rt,{gamification:s})}),o.current),r&&o.current&&M.Pk.createPortal(e.jsx(te,{className:i,children:e.jsxs(on,{children:[e.jsx(ne,{label:"Friend's Rank",close:s.closeUser}),e.jsx(M.a,{children:e.jsx(oe,{...r,successRate:rn(r)})})]})}),o.current),e.jsx(nn,{scrollStore:t,scrollNode:a,className:i,gamification:s})]})};exports.default=ln;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("./index4.js"),Q=require("@nanostores/react"),M=require("./masters2.js"),c=require("@streamlayer/sdk-web-types"),I=require("react"),B=require("./index3.js");require("react-countup");const xe=require("react-countdown-circle-timer"),E=require("./index2.js"),je=require("react-infinite-scroller");require("@streamlayer/sdk-web-interfaces");require("@streamlayer/sdk-web-notifications");require("lodash.throttle");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const me=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),ye=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),Me=()=>n.c1,he=n.styled_default(Me())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),fe=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Ne=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),Te=()=>n.c1,Ae=n.styled_default(Te())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ne=({type:s,close:t,label:i})=>{const o=s?M.o[s]:{label:i,iconName:void 0};return e.jsxs(me,{children:[e.jsxs(ye,{children:[(o==null?void 0:o.iconName)&&e.jsx(he,{"data-type-trivia":s===c.QuestionType.TRIVIA,"data-type-poll":s===c.QuestionType.POLL,name:o.iconName}),(o==null?void 0:o.label)&&e.jsx(fe,{children:o.label})]}),e.jsx(Ne,{onClick:t,children:e.jsx(Ae,{name:"icon-cross"})})]})},ie=s=>s.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),ae=s=>s?s.toLocaleString("en-US"):"0",W=s=>s.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),F=s=>s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),H=s=>!isNaN(s.getTime()),ge=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),De=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),ve=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),J=({indicator:s,title:t})=>e.jsxs(ge,{children:[e.jsx(De,{children:t}),e.jsx(ve,{children:s})]}),ke=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Se=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),ze=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),R=({indicator:s,title:t})=>e.jsxs(ke,{children:[e.jsx(Se,{children:s}),e.jsx(ze,{children:t})]}),Ee=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Qe=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Ce=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),be=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Oe=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Le=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),we=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),_e=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),$e=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Re=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),qe=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Ue=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),Ye=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Pe=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Ve=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),Be=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),We=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),Fe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",oe=({avatar:s,name:t,points:i,friendsRank:o,rank:a,streak:u,correct:r,incorrect:l,inTop:d,successRate:p})=>e.jsxs(Ee,{children:[e.jsx(Qe,{children:e.jsxs(be,{children:[e.jsxs(We,{children:[s&&e.jsx(Oe,{alt:"avatar",src:s}),!s&&e.jsx(Be,{children:ie(t||"")})]}),e.jsxs(Le,{children:[e.jsx(we,{children:t}),e.jsxs(_e,{children:[e.jsxs(Re,{children:[e.jsx($e,{alt:"rank-icon",src:Fe}),e.jsxs(qe,{children:[ae(i),e.jsx(Ue,{children:"PTS"})]})]}),e.jsx(Ye,{}),e.jsxs("div",{children:["TOP ",d||0,"%"]})]})]})]})}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(J,{indicator:o||0,title:"Friends rank"}),e.jsx(J,{indicator:a||0,title:"Global rank"})]}),e.jsxs(Ve,{children:[e.jsx(R,{indicator:u||0,title:"Win streak"}),e.jsx(R,{indicator:r||0,title:"Correct"}),e.jsx(R,{indicator:l||0,title:"Incorrect"}),e.jsx(R,{indicator:`${p||0}%`,title:"Succ. rate"})]})]})]}),He=n.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),Ge=()=>n.c1,Ze=n.styled_default(Ge())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),Je=()=>e.jsx(He,{children:e.jsx(Ze,{name:"mastersLogo"})}),Ke=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),Xe=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),es=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),ss=({title:s,description:t})=>e.jsxs(Ke,{children:[e.jsx(n.c1,{name:"icon-check-circle"}),e.jsx(Xe,{children:s}),e.jsx(es,{children:t})]}),ts=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ns=()=>n.c1,is=n.styled_default(ns())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),_=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),q=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),as=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),L=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),V=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),os=({feedbackMessages:s,questionVotedCorrectly:t,questionVoted:i,questionType:o,hasCorrectAnswer:a,questionStatus:u,showExpiredNotification:r,showClosedNotificationTrivia:l,votedInCurrentRender:d,votedAfterQuestionClosed:p,enteredAnActiveQuestion:x,marketClosed:j})=>{const y=i&&(o===c.QuestionType.TRIVIA||o===c.QuestionType.PREDICTION)&&d&&u!==c.QuestionStatus.RESOLVED,h=o===c.QuestionType.PREDICTION&&!a,k=j&&o===c.QuestionType.PREDICTION&&!i&&!x||o===c.QuestionType.PREDICTION&&p&&d&&x,T=y&&h,S=y&&a,A=o===c.QuestionType.PREDICTION&&i&&d&&a,C=i&&o===c.QuestionType.POLL&&d;if(!r&&!l&&!T&&!S&&!k&&!C&&!A)return null;const v=t?"correct":"incorrect",D=t?s==null?void 0:s.correctFeedback:s==null?void 0:s.incorrectFeedback;return e.jsxs(ts,{"data-isPrediction":h,children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(_,{children:e.jsx(n.c1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(q,{children:e.jsx(L,{children:"Question Expired"})}),e.jsx(V,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),l&&e.jsxs(e.Fragment,{children:[e.jsx(_,{children:e.jsx(n.c1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(q,{children:e.jsx(L,{children:"Question Closed"})}),e.jsx(V,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),k&&e.jsxs(e.Fragment,{children:[e.jsx(_,{children:e.jsx(n.c1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(q,{children:e.jsx(L,{children:"Question Closed"})}),e.jsx(V,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),T&&e.jsxs(e.Fragment,{children:[e.jsx(is,{name:"icon-prediction"}),e.jsx(L,{children:"Stay tuned to see if your prediction was correct."})]}),C&&e.jsxs(e.Fragment,{children:[e.jsx(_,{"data-feedbackType":"correct",children:e.jsx(n.c1,{name:"correct"})}),e.jsx(L,{children:"That's for answering. Please stay tuned for the next question."})]}),(S||A)&&e.jsxs(e.Fragment,{children:[e.jsx(_,{"data-feedbackType":v,children:e.jsx(n.c1,{name:v})}),e.jsx("div",{children:e.jsxs(q,{children:[e.jsx(as,{"data-feedbackType":v,children:D==null?void 0:D.title}),e.jsx(L,{children:D==null?void 0:D.description})]})})]})]})},rs=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),ls=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),ds=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),cs=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),us=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),ps=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),Is=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),xs=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),js=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),re=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),ms=()=>re,ys=n.styled_default(ms())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),Ms=()=>re,hs=n.styled_default(Ms())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),fs=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Ns=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Ts=n.styled_default("span")({name:"Pts",class:"p17ajcu2",propsAsIs:!1}),As=n.styled_default("span")({name:"Percentage",class:"pu9kmlb",propsAsIs:!1}),gs=()=>n.c1,Ds=n.styled_default(gs())({name:"CheckIcon",class:"c1j2j0s0",propsAsIs:!0}),K={[c.QuestionImages.CENTERED]:s=>e.jsx(ys,{alt:"option-icon",src:s}),[c.QuestionImages.TRANSPARENT]:s=>e.jsx(xs,{children:e.jsx(js,{style:{backgroundImage:`url(${s})`}})}),[c.QuestionImages.ROUNDED]:s=>e.jsx(hs,{alt:"option-icon",src:s}),[c.QuestionImages.NONE]:()=>null,[c.QuestionImages.UNSET]:()=>null},vs=({questionType:s,hasCorrectAnswer:t,correct:i,youVoted:o,questionVoted:a})=>{if(s===c.QuestionType.POLL&&o)return"correct";if(s===c.QuestionType.PREDICTION){if(t&&a)return o?i?"correct":"incorrect":"unset";if(o)return"correct"}return s===c.QuestionType.TRIVIA&&a&&o?i?"correct":"incorrect":"unset"},ks=({questionType:s,questionVoted:t,correct:i,hasCorrectAnswer:o,questionStatus:a})=>s===c.QuestionType.TRIVIA?t&&i:s===c.QuestionType.PREDICTION?t&&i&&o||a===c.QuestionStatus.RESOLVED&&i:!1,Ss=s=>{var t;const{id:i,icon:o,text:a,percentageDecimal:u,points:r,onVote:l,markThatVoted:d,youSelected:p,questionVoted:x,imageMode:j,answerTimeExpired:y,questionStatus:h,isLoading:k,questionType:T,correct:S,hasCorrectAnswer:A,votedAfterQuestionClosed:C,enteredAnActiveQuestion:v,marketClosed:D}=s,z=vs(s),P=ks({questionType:T,questionVoted:x,correct:S,hasCorrectAnswer:A,questionStatus:h}),b=D&&T===c.QuestionType.PREDICTION,$=x||b,m=T===c.QuestionType.PREDICTION&&!x&&h!==c.QuestionStatus.RESOLVED;return e.jsxs(us,{value:i,"data-selected":p,"data-answer-state":z,disabled:x||k||y||b&&!v||b&&v&&C,"data-is-not-checked":x&&!p&&z!=="incorrect",onClick:N=>{d(T===c.QuestionType.PREDICTION?D:h===c.QuestionStatus.RESOLVED),l(N)},children:[e.jsx(ps,{"data-answer-state":z,style:{width:`${$?u:0}%`}}),e.jsxs(Is,{children:[o&&j&&((t=K[j])==null?void 0:t.call(K,o)),e.jsx(fs,{children:a}),m&&e.jsxs("div",{children:[e.jsx(B.d,{value:r}),e.jsx(Ts,{children:"pts"})]}),$&&e.jsxs(Ns,{children:[P&&e.jsx(Ds,{name:"selected"}),e.jsx(As,{children:e.jsx(B.d,{value:u,suffix:"%"})})]})]})]})},zs=[E.E.PRIMARY_GREEN1,E.E.SECONDARY_RED1,E.E.SECONDARY_RED1,E.E.NEUTRALS_GRAY3],Es=[10,10,1,0],Qs=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Cs=E.E.SECONDARY_GREEN6,X=E.E.SECONDARY_RED3,bs=E.E.NEUTRALS_GRAY3,Os=({isPlaying:s=!0,duration:t=30,onTimerExpired:i})=>{const[o,a]=I.useState(t>10?Cs:X),u=({remainingTime:d})=>e.jsx(Qs,{children:d}),r=I.useCallback(()=>{i==null||i(),a(bs)},[i,a]),l=I.useCallback(d=>{d===10&&a(X)},[a]);return e.jsx(xe.CountdownCircleTimer,{isPlaying:s,duration:t,colors:zs,colorsTime:Es,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:o,onComplete:r,onUpdate:l,children:u})},Ls=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),ws=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),_s=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),$s=()=>n.c1,Rs=n.styled_default($s())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),qs=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Us=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),Ys=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Ps=({title:s,points:t,isPlayingTimer:i,isTimer:o,questionType:a,timerDuration:u,onTimerExpired:r})=>e.jsxs(Ls,{style:{justifyContent:a===c.QuestionType.PREDICTION?"center":"space-between"},children:[e.jsxs(ws,{children:[s&&e.jsx(_s,{children:s}),t!==void 0&&a!==c.QuestionType.POLL&&e.jsxs(e.Fragment,{children:[e.jsx(Rs,{name:"icon-trophy"}),e.jsxs(qs,{children:[e.jsx(Us,{children:e.jsx(B.d,{value:t})}),e.jsx(Ys,{children:"PTS"})]})]})]}),o&&a!==c.QuestionType.PREDICTION&&e.jsx(Os,{isPlaying:i,onTimerExpired:r,duration:u})]}),Vs=({openedQuestion:s,isLoading:t,vote:i,close:o})=>{var a,u;const r=s.subject,l=s.type,d=s.status,p=(a=s.options)==null?void 0:a.options,x=s.marketClosed,[j,y]=I.useState(!1),[h,k]=I.useState(!1),[T,S]=I.useState(!0),[A,C]=I.useState(!1),[v,D]=I.useState(""),z=s==null?void 0:s.id;I.useEffect(()=>{l===c.QuestionType.PREDICTION?x&&S(!1):d===c.QuestionStatus.RESOLVED&&S(!1)},[]);const P=I.useCallback(f=>{k(f),y(!0)},[]),b=I.useCallback(async f=>{if(z){const w=f.currentTarget.value;D(w),await i(z,w)}},[z,D,i]),$=I.useCallback(()=>{C(!0),setTimeout(o,3e3)},[o]),m=I.useMemo(()=>s==null?void 0:s.answers.find(f=>f.youVoted===!0),[s]),N=I.useMemo(()=>!!(s!=null&&s.answers.find(f=>f.correct===!0)),[s]),g=I.useMemo(()=>s==null?void 0:s.answers.find(f=>f.correct===!0),[s]),de=I.useMemo(()=>s?s.answers.map(f=>{var w;return{...f,questionVoted:!!m,youSelected:v===f.id,isLoading:t,hasCorrectAnswer:N,questionType:s.type,answerTimeExpired:A,questionStatus:d,imageMode:(w=s.appearance)==null?void 0:w.images,onVote:b}}):[],[N,A,t,s,m,d,b,v]),ce=p&&(p.case==="trivia"||p.case==="prediction")?p.value:void 0,O=d===c.QuestionStatus.RESOLVED&&l===c.QuestionType.TRIVIA&&!m&&!T,G=l===c.QuestionType.TRIVIA&&h&&j&&T,Z=I.useMemo(()=>l===c.QuestionType.PREDICTION?!!(m&&!N||m&&N&&g!=null&&g.youVoted):!0,[l,m,N,g]),ue=I.useMemo(()=>{if(l===c.QuestionType.PREDICTION&&m&&(!N||N&&g!=null&&g.youVoted))return m.points;if(!(O||A))return d===c.QuestionStatus.RESOLVED?0:m?m.correct?m.points:0:g==null?void 0:g.points},[A,m,g,d,O,l,N]),pe=I.useMemo(()=>l===c.QuestionType.PREDICTION&&m?N?N&&g!=null&&g.youVoted?"You won":"":"To win":O||A?"Time expired":l===c.QuestionType.POLL?"Time remaining":m?"You won":"To win",[A,l,m,O,N,g]),Ie=m||O||G||l===c.QuestionType.TRIVIA&&d===c.QuestionStatus.RESOLVED&&T;return e.jsx(M.r,{"data-question-header":"true",children:e.jsx(rs,{children:e.jsxs(ls,{children:[e.jsx(os,{feedbackMessages:ce,questionVoted:!!m,questionVotedCorrectly:m==null?void 0:m.correct,questionType:l,hasCorrectAnswer:N,questionStatus:d,showExpiredNotification:O,showClosedNotificationTrivia:G,votedInCurrentRender:j,votedAfterQuestionClosed:h,enteredAnActiveQuestion:T,marketClosed:x}),Z&&e.jsx(Ps,{title:pe,points:ue,onTimerExpired:$,questionType:s.type,isTimer:!t,isPlayingTimer:!m,timerDuration:Ie?0:Number(((u=s==null?void 0:s.appearance)==null?void 0:u.autoHideInterval)||"30")}),A?e.jsx(ss,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):e.jsxs(e.Fragment,{children:[e.jsx(ds,{style:Z?{}:{marginTop:0},children:r}),e.jsx(cs,{children:de.map(f=>e.jsx(Ss,{...f,markThatVoted:P,votedAfterQuestionClosed:h,enteredAnActiveQuestion:T,marketClosed:x},f.id))})]})]})})})},Bs=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),Ws=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),Fs=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),Hs=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),Gs=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),Zs=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),le=({created:s,image:t,title:i,isPickHistory:o,instantView:a,notification:u})=>{const r=I.useMemo(()=>{if(s){const d=new Date(s);if(H(d))return{date:W(d),time:F(d)}}return null},[s]),l=(a==null?void 0:a.image)||t;return e.jsxs(Bs,{children:[r&&e.jsxs(Gs,{children:[r.date," · ",r.time]}),(a==null?void 0:a.video)&&e.jsx(M.w,{source:a.video.url,poster:a.video.thumbnailUrl}),l&&!(a!=null&&a.video)&&e.jsx(Zs,{src:l}),e.jsxs(Ws,{children:[e.jsx(Fs,{children:o?i:a==null?void 0:a.heading}),e.jsx(Hs,{children:o?u==null?void 0:u.body:a==null?void 0:a.body})]})]})},Js=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),Ks=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),Xs=({instantView:s,...t})=>e.jsxs(Js,{children:[e.jsx(le,{instantView:s,...t}),(s==null?void 0:s.webLink)&&e.jsxs(Ks,{href:s==null?void 0:s.webLink.url,target:"_blank",children:[s==null?void 0:s.webLink.label,e.jsx(n.c1,{name:"icon-external-link"})]})]}),et=n.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),st=n.styled_default("div")({name:"DateTime",class:"db4q22c",propsAsIs:!1}),tt=n.styled_default("blockquote")({name:"Quote",class:"q111mmic",propsAsIs:!1}),nt=({created:s,...t})=>{const i=I.useMemo(()=>{if(s){const o=new Date(s);if(H(o))return{date:W(o),time:F(o)}}return null},[s]);return e.jsxs(et,{children:[i&&e.jsxs(st,{children:[i.date," · ",i.time]}),t.title&&e.jsx(tt,{children:t.title}),e.jsx(M.u,{...t})]})},it=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),at=({openedQuestion:s})=>{var t,i;return((t=s==null?void 0:s.attributes)==null?void 0:t.attributes.case)==="insight"?e.jsx(Xs,{created:s.attributes.created,...s.attributes.attributes.value}):((i=s==null?void 0:s.attributes)==null?void 0:i.attributes.case)==="tweet"?e.jsx(nt,{created:s.attributes.created,...s.attributes.attributes.value}):null},ot=({extendedQuestion:s,vote:t,close:i})=>{const{loading:o,data:a}=s;return a?e.jsx(Vs,{vote:t,close:i,openedQuestion:a,isLoading:!!o}):null},rt=({gamification:s})=>{var t;const i=Q.useStore(s.openedQuestion.$store),o=Q.useStore(s.openedQuestion.$extendedStore);if(!i)return null;const a=i.type;return e.jsxs(it,{children:[e.jsx(ne,{close:s.closeQuestion,type:((t=i.attributes)==null?void 0:t.type)||c.QuestionType.UNSET}),a==="question"&&e.jsx(ot,{vote:s.submitAnswer,close:s.closeQuestion,extendedQuestion:o}),a!=="question"&&e.jsx(at,{openedQuestion:i}),e.jsx(Je,{sponsorLogo:""})]})},lt=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),dt=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),ct=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),ut=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var Y=(s=>(s.HOME="home",s.LEADERBOARD="leaderboard",s))(Y||{});const ee=({title:s,active:t,onClick:i})=>e.jsx(ct,{onClick:i,"data-selected":t,children:e.jsx(ut,{children:s})}),pt=({activePage:s="home",toggleActivePage:t})=>e.jsx(lt,{children:e.jsxs(dt,{"data-position":s==="home"?"left":"right",children:[e.jsx(ee,{title:"Home",active:s==="home",onClick:()=>t("home")}),e.jsx(ee,{title:"Friends",active:s==="leaderboard",onClick:()=>t("leaderboard")})]})});function It(s){var t=s.lastRenderedStartIndex,i=s.lastRenderedStopIndex,o=s.startIndex,a=s.stopIndex;return!(o>i||a<t)}function xt(s){for(var t=s.isItemLoaded,i=s.itemCount,o=s.minimumBatchSize,a=s.startIndex,u=s.stopIndex,r=[],l=null,d=null,p=a;p<=u;p++){var x=t(p);x?d!==null&&(r.push(l,d),l=d=null):(d=p,l===null&&(l=p))}if(d!==null){for(var j=Math.min(Math.max(d,l+o-1),i-1),y=d+1;y<=j&&!t(y);y++)d=y;r.push(l,d)}if(r.length)for(;r[1]-r[0]+1<o&&r[0]>0;){var h=r[0]-1;if(!t(h))r[0]=h;else break}return r}var jt=function(s,t){if(!(s instanceof t))throw new TypeError("Cannot call a class as a function")},mt=function(){function s(t,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,i,o){return i&&s(t.prototype,i),o&&s(t,o),t}}(),yt=function(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);s.prototype=Object.create(t&&t.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(s,t):s.__proto__=t)},se=function(s,t){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:s};(function(s){yt(t,s);function t(){var i,o,a,u;jt(this,t);for(var r=arguments.length,l=Array(r),d=0;d<r;d++)l[d]=arguments[d];return u=(o=(a=se(this,(i=t.__proto__||Object.getPrototypeOf(t)).call.apply(i,[this].concat(l))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(p){var x=p.visibleStartIndex,j=p.visibleStopIndex;a._lastRenderedStartIndex=x,a._lastRenderedStopIndex=j,a._ensureRowsLoaded(x,j)},a._setRef=function(p){a._listRef=p},o),se(a,u)}return mt(t,[{key:"resetloadMoreItemsCache",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],o&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var o=this.props.children;return o({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(o,a){var u=this.props,r=u.isItemLoaded,l=u.itemCount,d=u.minimumBatchSize,p=d===void 0?10:d,x=u.threshold,j=x===void 0?15:x,y=xt({isItemLoaded:r,itemCount:l,minimumBatchSize:p,startIndex:Math.max(0,o-j),stopIndex:Math.min(l-1,a+j)});(this._memoizedUnloadedRanges.length!==y.length||this._memoizedUnloadedRanges.some(function(h,k){return y[k]!==h}))&&(this._memoizedUnloadedRanges=y,this._loadUnloadedRanges(y))}},{key:"_loadUnloadedRanges",value:function(o){for(var a=this,u=this.props.loadMoreItems||this.props.loadMoreRows,r=function(p){var x=o[p],j=o[p+1],y=u(x,j);y!=null&&y.then(function(){if(It({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:x,stopIndex:j})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(x,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},l=0;l<o.length;l+=2)r(l)}}]),t})(I.PureComponent);const Mt=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),ht=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),ft=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Nt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Tt=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),At=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),gt=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Dt=()=>n.c1,vt=n.styled_default(Dt())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),kt=({rank:s,avatar:t,name:i,points:o,isCurrentUser:a,openItemDetail:u,style:r})=>e.jsxs(Mt,{onClick:u,style:r,children:[e.jsx(ht,{children:s||0}),e.jsxs(Tt,{children:[t?e.jsx(ft,{alt:"leaderboard-item-avatar",src:t}):e.jsx(Nt,{children:ie(i||"")}),e.jsxs(At,{children:[e.jsx(gt,{children:i||""}),a&&e.jsx(vt,{name:"icon-star"})]})]}),e.jsx("div",{children:ae(o)})]}),St=n.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),zt=({items:s,currentUserId:t,openItemDetail:i,fetchMore:o,scrollNode:a,hasMore:u})=>e.jsx(je,{loadMore:o,initialLoad:!1,hasMore:u,useWindow:!1,getScrollParent:()=>a.current,children:e.jsx(St,{children:s.map(r=>e.jsx(kt,{...r,openItemDetail:()=>i(r.userId),isCurrentUser:!!t&&t===r.userId},r.userId))})}),Et=({deepLink:s})=>{const{data:t}=Q.useStore(s.$store),i=t==null?void 0:t.url,o=s.desktopLink;return e.jsx(M.O,{inviteLink:i||o,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."})},Qt=({gamification:s,scrollNode:t,scrollStore:i})=>{const{data:o,hasMore:a}=Q.useStore(s.leaderboardList.$store);return o!=null&&o.length?e.jsx(zt,{items:o,scrollNode:t,scrollStore:i,fetchMore:s.leaderboardList.fetchMore,hasMore:a,openItemDetail:s.openUser,currentUserId:s.currentUserId.get()}):e.jsx(Et,{deepLink:s.deepLink})},Ct=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),bt=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Ot=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Lt=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),wt=()=>n.c1,U=n.styled_default(wt())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),_t=()=>n.c1,$t=n.styled_default(_t())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),Rt=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),qt=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),Ut=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),Yt={[c.PickHistoryStatus.LOST]:e.jsx(U,{name:"incorrectVoted"}),[c.PickHistoryStatus.WON]:e.jsx(U,{name:"icon-check"}),[c.PickHistoryStatus.UNSET]:e.jsx(U,{name:"icon-arrow"}),[c.PickHistoryStatus.DNP]:e.jsx(U,{name:"icon-arrow"})},Pt=({questionId:s,questionType:t,questionStatus:i,subject:o,openForVoting:a,openQuestion:u,status:r})=>{const l=M.o[t],d=Yt[r];return l?e.jsxs(Ct,{onClick:()=>u==null?void 0:u(s),children:[e.jsxs(qt,{children:[e.jsxs(bt,{children:[e.jsx($t,{"data-type-trivia":t===c.QuestionType.TRIVIA,"data-type-poll":t===c.QuestionType.POLL,name:l.iconName}),e.jsxs(Rt,{children:[l.label,t===c.QuestionType.TRIVIA&&i===c.QuestionStatus.RESOLVED&&" • Expired"]})]}),e.jsx(Ot,{children:o||""})]}),e.jsx(Lt,{children:a?e.jsx(Ut,{children:"Play"}):d})]}):null},Vt=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),Bt=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),Wt=({openInsight:s,questionId:t,...i})=>e.jsxs(Vt,{children:[e.jsx(le,{questionId:t,...i,isPickHistory:!0}),s&&e.jsx(Bt,{onClick:()=>s(t),children:"View Insight"})]}),Ft=n.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),Ht=()=>M.c,Gt=n.styled_default(Ht())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),Zt=n.styled_default("div")({name:"DateTime",class:"d1hbaleq",propsAsIs:!1}),Jt=n.styled_default("blockquote")({name:"Quote",class:"qvvgqjm",propsAsIs:!1}),Kt=({openTweet:s,created:t,...i})=>{const o=I.useMemo(()=>{if(t){const a=new Date(t);if(H(a))return{date:W(a),time:F(a)}}return null},[t]);return e.jsxs(Ft,{children:[o&&e.jsxs(Zt,{children:[o.date," · ",o.time]}),i.title&&e.jsx(Jt,{children:i.title}),e.jsx(M.u,{...i}),s&&e.jsx(Gt,{onClick:()=>s(i.tweetId),children:"View Insight"})]})},Xt=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),en=({questions:s,openQuestion:t})=>e.jsx(Xt,{children:s==null?void 0:s.map(i=>{var o,a,u;if(i.type==="question"&&((o=i.attributes)==null?void 0:o.attributes.case)==="question"){const r=i.attributes.attributes.value;return e.jsx(Pt,{openQuestion:t,...r},r.questionId)}if(i.type==="insight"&&((a=i.attributes)==null?void 0:a.attributes.case)==="insight"){const r=i.attributes.attributes.value,l=i.attributes.created;return e.jsx(Wt,{openInsight:t,...r,created:l},r.questionId)}if(i.type==="tweet"&&((u=i.attributes)==null?void 0:u.attributes.case)==="tweet"){const r=i.attributes.attributes.value,l=i.attributes.id,d=i.attributes.created;return e.jsx(Kt,{openTweet:t,...r,tweetId:l,created:d},l)}return null})}),sn=({store:s,openQuestion:t})=>{const i=Q.useStore(s);return i!=null&&i.data?e.jsx(en,{openQuestion:t,questions:i.data}):e.jsx("div",{children:"wait questions..."})},tn=({userSummary:s})=>{var t;const[i,o]=I.useState(void 0);return I.useEffect(()=>{const a=s.subscribe(u=>{u!=null&&u.data&&o(u.data)});return()=>{a()}},[s]),i!=null&&i.summary?e.jsx(oe,{...i.summary,successRate:(t=i.percentage)==null?void 0:t.correct}):e.jsx("div",{children:"wait user..."})},nn=({gamification:s,className:t,scrollStore:i,scrollNode:o})=>{const[a,u]=I.useState(!1),[r,l]=I.useState(Y.HOME),[,d]=I.useTransition(),p=j=>{d(()=>l(j))},x=j=>{d(()=>u(j))};return I.useEffect(()=>i.listen(j=>{if(j.scrollPosition===0){x(!1),i.setKey("tabsShown",!1);return}x(j.scrollDirection==="forward"),i.setKey("tabsShown",j.scrollDirection!=="forward")}),[i]),e.jsxs("div",{className:t,children:[e.jsx(M.a,{style:{paddingBottom:"8px",position:"sticky",transition:"top calc(var(--animation-duration) / 2) var(--animation-function)",top:a?"-60px":"0px"},children:e.jsx(pt,{activePage:r,toggleActivePage:p})}),r===Y.HOME&&e.jsxs(e.Fragment,{children:[e.jsx(M.a,{style:{paddingTop:"8px"},children:e.jsx(tn,{userSummary:s.userSummary})}),e.jsx(M.n,{children:e.jsx(sn,{openQuestion:s.openQuestion,store:s.feedList.getStore()})})]}),r===Y.LEADERBOARD&&e.jsx(M.a,{style:{paddingTop:"8px"},children:e.jsx(Qt,{scrollStore:i,scrollNode:o,gamification:s})})]})},an=()=>M.x,te=n.styled_default(an())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),on=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),rn=({correct:s,incorrect:t})=>{const i=s+t;return i===0?0:Math.round(s/i*100)},ln=({gamification:s,scrollStore:t,className:i,appNode:o,scrollNode:a})=>{const u=Q.useStore(s.openedQuestion.$store),r=Q.useStore(s.openedUser);return e.jsxs(e.Fragment,{children:[u&&o.current&&M.Pk.createPortal(e.jsx(te,{className:i,children:e.jsx(rt,{gamification:s})}),o.current),r&&o.current&&M.Pk.createPortal(e.jsx(te,{className:i,children:e.jsxs(on,{children:[e.jsx(ne,{label:"Friend's Rank",close:s.closeUser}),e.jsx(M.a,{children:e.jsx(oe,{...r,successRate:rn(r)})})]})}),o.current),e.jsx(nn,{scrollStore:t,scrollNode:a,className:i,gamification:s})]})};exports.default=ln;