@streamlayer/react 0.30.3 → 0.30.4

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 s=require("react/jsx-runtime"),n=require("./masters.js"),T=require("react"),Te=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Ne=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),Ae=()=>n.i1,Se=n.styled_default(Ae())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),De=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),ze=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),ke=()=>n.i1,Oe=n.styled_default(ke())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ce=({type:e,close:t,label:i})=>{const r=e?n.o[e]:{label:i,iconName:void 0};return s.jsxs(Te,{children:[s.jsxs(Ne,{children:[(r==null?void 0:r.iconName)&&s.jsx(Se,{name:r.iconName}),(r==null?void 0:r.label)&&s.jsx(De,{children:r.label})]}),s.jsx(ze,{onClick:t,children:s.jsx(Oe,{name:"icon-cross"})})]})},we=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),_e=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Ce=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),V=({indicator:e,title:t})=>s.jsxs(we,{children:[s.jsx(_e,{children:t}),s.jsx(Ce,{children:e})]}),be=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Ee=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),$e=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),C=({indicator:e,title:t})=>s.jsxs(be,{children:[s.jsx(Ee,{children:e}),s.jsx($e,{children:t})]}),Le=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Re=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Qe=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Ue=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),qe=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Pe=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Ye=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),We=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Fe=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Ve=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Be=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),He=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),Ge=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Ze=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Je=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),Ke=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),Xe=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),et="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",de=({avatar:e,name:t,points:i,friendsRank:r,rank:o,streak:c,correct:l,incorrect:m,inTop:d,successRate:h})=>s.jsxs(Le,{children:[s.jsx(Re,{children:s.jsxs(Ue,{children:[s.jsxs(Xe,{children:[e&&s.jsx(qe,{alt:"avatar",src:e}),!e&&s.jsx(Ke,{children:n.o$1(t||"")})]}),s.jsxs(Pe,{children:[s.jsx(Ye,{children:t}),s.jsxs(We,{children:[s.jsxs(Ve,{children:[s.jsx(Fe,{alt:"rank-icon",src:et}),s.jsxs(Be,{children:[n.i(i),s.jsx(He,{children:"PTS"})]})]}),s.jsx(Ge,{}),s.jsxs("div",{children:["TOP ",d||0,"%"]})]})]})]})}),s.jsxs(Qe,{children:[s.jsxs(Ze,{children:[s.jsx(V,{indicator:r||0,title:"Friends rank"}),s.jsx(V,{indicator:o||0,title:"Global rank"})]}),s.jsxs(Je,{children:[s.jsx(C,{indicator:c||0,title:"Win streak"}),s.jsx(C,{indicator:l||0,title:"Correct"}),s.jsx(C,{indicator:m||0,title:"Incorrect"}),s.jsx(C,{indicator:`${h||0}%`,title:"Succ. rate"})]})]})]}),tt=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),st=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),nt=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),it=({title:e,description:t})=>s.jsxs(tt,{children:[s.jsx(n.i1,{name:"icon-check-circle"}),s.jsx(st,{children:e}),s.jsx(nt,{children:t})]}),rt=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ot=()=>n.i1,at=n.styled_default(ot())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),B=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),H=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),lt=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),$=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),ct=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),dt=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:i,questionType:r,hasCorrectAnswer:o,questionStatus:c})=>{const l=i&&(r===n.QuestionType.TRIVIA||r===n.QuestionType.PREDICTION);if(!l&&c!==n.QuestionStatus.RESOLVED)return null;const m=r===n.QuestionType.PREDICTION&&!o,d=t?"correct":"incorrect",h=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(rt,{"data-isPrediction":m,children:[c===n.QuestionStatus.RESOLVED&&r===n.QuestionType.TRIVIA&&!i&&s.jsxs(s.Fragment,{children:[s.jsx(B,{children:s.jsx(n.i1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(H,{children:s.jsx($,{children:"Question Expired"})}),s.jsx(ct,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),l&&m&&s.jsxs(s.Fragment,{children:[s.jsx(at,{name:"icon-prediction"}),s.jsx($,{children:"Stay tuned to see if your prediction was correct."})]}),l&&o&&s.jsxs(s.Fragment,{children:[s.jsx(B,{"data-feedbackType":d,children:s.jsx(n.i1,{name:d})}),s.jsx("div",{children:s.jsxs(H,{children:[s.jsx(lt,{"data-feedbackType":d,children:h==null?void 0:h.title}),s.jsx($,{children:h==null?void 0:h.description})]})})]})]})},ut=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),pt=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),mt=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),ft=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),ht=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),It=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),yt=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),gt=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),xt=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),ue=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),jt=()=>ue,Mt=n.styled_default(jt())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),vt=()=>ue,Tt=n.styled_default(vt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),Nt=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),At=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),St=n.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),Dt=()=>n.i1,zt=n.styled_default(Dt())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),G={[n.QuestionImages.CENTERED]:e=>s.jsx(Mt,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(gt,{children:s.jsx(xt,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(Tt,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},kt=({questionType:e,hasCorrectAnswer:t,correct:i,youVoted:r,questionVoted:o})=>{if(e===n.QuestionType.POLL&&r)return"correct";if(e===n.QuestionType.PREDICTION){if(t&&o)return r?i?"correct":"incorrect":i?"correct":"unset";if(r)return"correct"}return e===n.QuestionType.TRIVIA&&o?r?i?"correct":"incorrect":i?"correct":"unset":"unset"},Ot=({questionType:e,questionVoted:t,correct:i,hasCorrectAnswer:r,questionStatus:o})=>e===n.QuestionType.TRIVIA?t&&i:e===n.QuestionType.PREDICTION?t&&i&&r||o===n.QuestionStatus.RESOLVED&&i:!1,wt=e=>{var t;const{id:i,icon:r,text:o,percentageDecimal:c,onVote:l,youSelected:m,questionVoted:d,imageMode:h=n.QuestionImages.ROUNDED,answerTimeExpired:M,questionStatus:g,isLoading:I,questionType:v,correct:N,hasCorrectAnswer:a}=e,u=kt(e),p=Ot({questionType:v,questionVoted:d,correct:N,hasCorrectAnswer:a,questionStatus:g}),f=d||g===n.QuestionStatus.RESOLVED&&v===n.QuestionType.PREDICTION;return s.jsxs(ht,{value:i,"data-selected":m,"data-answerState":u,disabled:d||I||M,onClick:l,children:[f&&s.jsx(It,{"data-answerState":u,style:{width:`${c}%`}}),s.jsxs(yt,{children:[r&&((t=G[h])==null?void 0:t.call(G,r)),s.jsx(Nt,{children:o}),f&&s.jsxs(At,{children:[p&&s.jsx(zt,{name:"selected"}),s.jsxs(St,{children:[c,"%"]})]})]})]})};var Z=typeof window>"u"?T.useEffect:T.useLayoutEffect,_t=({isPlaying:e,duration:t,startAt:i=0,updateInterval:r=0,onComplete:o,onUpdate:c})=>{let[l,m]=T.useState(i),d=T.useRef(0),h=T.useRef(i),M=T.useRef(i*-1e3),g=T.useRef(null),I=T.useRef(null),v=T.useRef(null),N=p=>{let f=p/1e3;if(I.current===null){I.current=f,g.current=requestAnimationFrame(N);return}let y=f-I.current,x=d.current+y;I.current=f,d.current=x;let j=h.current+(r===0?x:(x/r|0)*r),A=h.current+x,S=typeof t=="number"&&A>=t;m(S?t:j),S||(g.current=requestAnimationFrame(N))},a=()=>{g.current&&cancelAnimationFrame(g.current),v.current&&clearTimeout(v.current),I.current=null},u=T.useCallback(p=>{a(),d.current=0;let f=typeof p=="number"?p:i;h.current=f,m(f),e&&(g.current=requestAnimationFrame(N))},[e,i]);return Z(()=>{if(c==null||c(l),t&&l>=t){M.current+=t*1e3;let{shouldRepeat:p=!1,delay:f=0,newStartAt:y}=(o==null?void 0:o(M.current/1e3))||{};p&&(v.current=setTimeout(()=>u(y),f*1e3))}},[l,t]),Z(()=>(e&&(g.current=requestAnimationFrame(N)),a),[e,t,r]),{elapsedTime:l,reset:u}},Ct=(e,t,i)=>{let r=e/2,o=t/2,c=r-o,l=2*c,m=i==="clockwise"?"1,0":"0,1",d=2*Math.PI*c;return{path:`m ${r},${o} a ${c},${c} 0 ${m} 0,${l} a ${c},${c} 0 ${m} 0,-${l}`,pathLength:d}},J=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,bt=e=>({position:"relative",width:e,height:e}),Et={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},pe=(e,t,i,r,o)=>{if(r===0)return t;let c=(o?r-e:e)/r;return t+i*c},K=e=>{var t,i;return(i=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(r,o,c,l)=>`#${o}${o}${c}${c}${l}${l}`).substring(1).match(/.{2}/g))==null?void 0:t.map(r=>parseInt(r,16)))!=null?i:[]},$t=(e,t)=>{var i;let{colors:r,colorsTime:o,isSmoothColorTransition:c=!0}=e;if(typeof r=="string")return r;let l=(i=o==null?void 0:o.findIndex((I,v)=>I>=t&&t>=o[v+1]))!=null?i:-1;if(!o||l===-1)return r[0];if(!c)return r[l];let m=o[l]-t,d=o[l]-o[l+1],h=K(r[l]),M=K(r[l+1]),g=!!e.isGrowing;return`rgb(${h.map((I,v)=>pe(m,I,M[v]-I,d,g)|0).join(",")})`},Lt=e=>{let{duration:t,initialRemainingTime:i,updateInterval:r,size:o=180,strokeWidth:c=12,trailStrokeWidth:l,isPlaying:m=!1,isGrowing:d=!1,rotation:h="clockwise",onComplete:M,onUpdate:g}=e,I=T.useRef(),v=Math.max(c,l??0),{path:N,pathLength:a}=Ct(o,v,h),{elapsedTime:u}=_t({isPlaying:m,duration:t,startAt:J(t,i),updateInterval:r,onUpdate:typeof g=="function"?f=>{let y=Math.ceil(t-f);y!==I.current&&(I.current=y,g(y))}:void 0,onComplete:typeof M=="function"?f=>{var y;let{shouldRepeat:x,delay:j,newInitialRemainingTime:A}=(y=M(f))!=null?y:{};if(x)return{shouldRepeat:x,delay:j,newStartAt:J(t,A)}}:void 0}),p=t-u;return{elapsedTime:u,path:N,pathLength:a,remainingTime:Math.ceil(p),rotation:h,size:o,stroke:$t(e,p),strokeDashoffset:pe(u,0,a,t,d),strokeWidth:c}},me=e=>{let{children:t,strokeLinecap:i,trailColor:r,trailStrokeWidth:o}=e,{path:c,pathLength:l,stroke:m,strokeDashoffset:d,remainingTime:h,elapsedTime:M,size:g,strokeWidth:I}=Lt(e);return T.createElement("div",{style:bt(g)},T.createElement("svg",{viewBox:`0 0 ${g} ${g}`,width:g,height:g,xmlns:"http://www.w3.org/2000/svg"},T.createElement("path",{d:c,fill:"none",stroke:r??"#d9d9d9",strokeWidth:o??I}),T.createElement("path",{d:c,fill:"none",stroke:m,strokeLinecap:i??"round",strokeWidth:I,strokeDasharray:l,strokeDashoffset:d})),typeof t=="function"&&T.createElement("div",{style:Et},t({remainingTime:h,elapsedTime:M,color:m})))};me.displayName="CountdownCircleTimer";const Rt=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1],Qt=[10,10,0],Ut=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),qt=n.E.SECONDARY_GREEN6,X=n.E.SECONDARY_RED3,Pt=n.E.NEUTRALS_GRAY3,Yt=({isPlaying:e=!0,duration:t=30,onTimerExpired:i})=>{const[r,o]=T.useState(t>10?qt:X),c=({remainingTime:d})=>s.jsx(Ut,{children:d}),l=T.useCallback(()=>{i==null||i(),o(Pt)},[i,o]),m=T.useCallback(d=>{d===10&&o(X)},[o]);return s.jsx(me,{isPlaying:e,duration:t,colors:Rt,colorsTime:Qt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:r,onComplete:l,onUpdate:m,children:c})},Wt=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Ft=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Vt=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Bt=()=>n.i1,Ht=n.styled_default(Bt())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Gt=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Zt=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),Jt=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Kt=({title:e,points:t,isPlayingTimer:i,isTimer:r,onTimerExpired:o})=>s.jsxs(Wt,{children:[s.jsxs(Ft,{children:[e&&s.jsx(Vt,{children:e}),t!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx(Ht,{name:"icon-trophy"}),s.jsxs(Gt,{children:[s.jsx(Zt,{children:t}),s.jsx(Jt,{children:"PTS"})]})]})]}),r&&s.jsx(Yt,{isPlaying:i,onTimerExpired:o})]}),Xt=({openedQuestion:e,vote:t,close:i})=>{var r;const o=e.subject,c=e.type,l=(r=e.options)==null?void 0:r.options,[m,d]=T.useState(!1),[h,M]=T.useState(!1),[g,I]=T.useState(""),v=e==null?void 0:e.id,N=T.useCallback(async x=>{if(v){const j=x.currentTarget.value;I(j),M(!0),await t(v,j),M(!1)}},[v,I,t]),a=T.useCallback(()=>{d(!0),setTimeout(i,3e3)},[i]),u=T.useMemo(()=>e==null?void 0:e.answers.find(x=>x.youVoted===!0),[e]),p=T.useMemo(()=>!!(e!=null&&e.answers.find(x=>x.correct===!0)),[e]),f=T.useMemo(()=>e?e.answers.map(x=>({...x,questionVoted:!!u,youSelected:g===x.id,isLoading:h,hasCorrectAnswer:p,questionType:e.type,answerTimeExpired:m,questionStatus:e.status,onVote:N})):[],[p,m,h,e,u,N,g]),y=l&&(l.case==="trivia"||l.case==="prediction")?l.value:void 0;return s.jsx(n.r,{"data-question-header":"true",children:s.jsx(ut,{children:s.jsxs(pt,{children:[y&&s.jsx(dt,{feedbackMessages:y,questionVoted:!!u,questionVotedCorrectly:u==null?void 0:u.correct,questionType:c,hasCorrectAnswer:p,questionStatus:e.status}),s.jsx(Kt,{title:m?"Time expired":"To win",points:m?void 0:100,onTimerExpired:a,isTimer:!0}),m?s.jsx(it,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(mt,{children:o}),s.jsx(ft,{children:f.map(x=>s.jsx(wt,{...x},x.id))})]})]})})})},es=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),ts=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),ss=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ns=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),is=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),fe=({created:e,title:t,instantView:i})=>{const r=T.useMemo(()=>{if(e){const o=new Date(e);if(n.r$1(o))return{date:n.a(o),time:n.n(o)}}return null},[e]);return s.jsxs(es,{children:[r&&s.jsxs(is,{children:[r.date," · ",r.time]}),(i==null?void 0:i.video)&&s.jsx(n.w,{source:i.video.url,poster:i.video.thumbnailUrl}),s.jsxs(ts,{children:[s.jsx(ss,{children:(i==null?void 0:i.heading)||t}),s.jsx(ns,{children:i==null?void 0:i.body})]})]})},rs=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),os=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),as=({instantView:e,...t})=>s.jsxs(rs,{children:[s.jsx(fe,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(os,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(n.i1,{name:"icon-external-link"})]})]}),ls=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),cs=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(as,{created:e.attributes.created,...e.attributes.attributes.value}):null},ds=({extendedQuestion:e,vote:t,close:i})=>{const{loading:r,data:o}=e;return!r&&o?s.jsx(Xt,{vote:t,close:i,openedQuestion:o}):null},us=({gamification:e})=>{var t;const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedQuestion.$extendedStore);if(!i)return null;const o=i.type;return s.jsxs(ls,{children:[s.jsx(ce,{close:e.closeQuestion,type:((t=i.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),o==="question"&&s.jsx(ds,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:r}),o!=="question"&&s.jsx(cs,{openedQuestion:i})]})},ps=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),ms=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),fs=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),hs=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var b=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(b||{});const ee=({title:e,active:t,onClick:i})=>s.jsx(fs,{onClick:i,"data-selected":t,children:s.jsx(hs,{children:e})}),Is=({activePage:e="home",toggleActivePage:t})=>s.jsx(ps,{children:s.jsxs(ms,{"data-position":e==="home"?"left":"right",children:[s.jsx(ee,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(ee,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},U.apply(this,arguments)}function te(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q(e,t){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},q(e,t)}function ys(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,q(e,t)}var se=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function gs(e,t){return!!(e===t||se(e)&&se(t))}function xs(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!gs(e[i],t[i]))return!1;return!0}function L(e,t){t===void 0&&(t=xs);var i,r=[],o,c=!1;function l(){for(var m=[],d=0;d<arguments.length;d++)m[d]=arguments[d];return c&&i===this&&t(m,r)||(o=e.apply(this,m),c=!0,i=this,r=m),o}return l}var js=typeof performance=="object"&&typeof performance.now=="function",ne=js?function(){return performance.now()}:function(){return Date.now()};function ie(e){cancelAnimationFrame(e.id)}function Ms(e,t){var i=ne();function r(){ne()-i>=t?e.call(null):o.id=requestAnimationFrame(r)}var o={id:requestAnimationFrame(r)};return o}var R=-1;function re(e){if(e===void 0&&(e=!1),R===-1||e){var t=document.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",document.body.appendChild(t),R=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return R}var k=null;function oe(e){if(e===void 0&&(e=!1),k===null||e){var t=document.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",i.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?k="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?k="negative":k="positive-ascending"),document.body.removeChild(t),k}return k}var vs=150,Ts=function(t,i){return t};function Ns(e){var t,i=e.getItemOffset,r=e.getEstimatedTotalSize,o=e.getItemSize,c=e.getOffsetForIndexAndAlignment,l=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,d=e.initInstanceProps,h=e.shouldResetStyleCacheOnItemSizeChange,M=e.validateProps;return t=function(g){ys(I,g);function I(N){var a;return a=g.call(this,N)||this,a._instanceProps=d(a.props,te(a)),a._outerRef=void 0,a._resetIsScrollingTimeoutId=null,a.state={instance:te(a),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof a.props.initialScrollOffset=="number"?a.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},a._callOnItemsRendered=void 0,a._callOnItemsRendered=L(function(u,p,f,y){return a.props.onItemsRendered({overscanStartIndex:u,overscanStopIndex:p,visibleStartIndex:f,visibleStopIndex:y})}),a._callOnScroll=void 0,a._callOnScroll=L(function(u,p,f){return a.props.onScroll({scrollDirection:u,scrollOffset:p,scrollUpdateWasRequested:f})}),a._getItemStyle=void 0,a._getItemStyle=function(u){var p=a.props,f=p.direction,y=p.itemSize,x=p.layout,j=a._getItemStyleCache(h&&y,h&&x,h&&f),A;if(j.hasOwnProperty(u))A=j[u];else{var S=i(a.props,u,a._instanceProps),D=o(a.props,u,a._instanceProps),z=f==="horizontal"||x==="horizontal",w=f==="rtl",_=z?S:0;j[u]=A={position:"absolute",left:w?void 0:_,right:w?_:void 0,top:z?0:S,height:z?"100%":D,width:z?D:"100%"}}return A},a._getItemStyleCache=void 0,a._getItemStyleCache=L(function(u,p,f){return{}}),a._onScrollHorizontal=function(u){var p=u.currentTarget,f=p.clientWidth,y=p.scrollLeft,x=p.scrollWidth;a.setState(function(j){if(j.scrollOffset===y)return null;var A=a.props.direction,S=y;if(A==="rtl")switch(oe()){case"negative":S=-y;break;case"positive-descending":S=x-f-y;break}return S=Math.max(0,Math.min(S,x-f)),{isScrolling:!0,scrollDirection:j.scrollOffset<y?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._onScrollVertical=function(u){var p=u.currentTarget,f=p.clientHeight,y=p.scrollHeight,x=p.scrollTop;a.setState(function(j){if(j.scrollOffset===x)return null;var A=Math.max(0,Math.min(x,y-f));return{isScrolling:!0,scrollDirection:j.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._outerRefSetter=function(u){var p=a.props.outerRef;a._outerRef=u,typeof p=="function"?p(u):p!=null&&typeof p=="object"&&p.hasOwnProperty("current")&&(p.current=u)},a._resetIsScrollingDebounced=function(){a._resetIsScrollingTimeoutId!==null&&ie(a._resetIsScrollingTimeoutId),a._resetIsScrollingTimeoutId=Ms(a._resetIsScrolling,vs)},a._resetIsScrolling=function(){a._resetIsScrollingTimeoutId=null,a.setState({isScrolling:!1},function(){a._getItemStyleCache(-1,null)})},a}I.getDerivedStateFromProps=function(a,u){return As(a,u),M(a),null};var v=I.prototype;return v.scrollTo=function(a){a=Math.max(0,a),this.setState(function(u){return u.scrollOffset===a?null:{scrollDirection:u.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(a,u){u===void 0&&(u="auto");var p=this.props,f=p.itemCount,y=p.layout,x=this.state.scrollOffset;a=Math.max(0,Math.min(a,f-1));var j=0;if(this._outerRef){var A=this._outerRef;y==="vertical"?j=A.scrollWidth>A.clientWidth?re():0:j=A.scrollHeight>A.clientHeight?re():0}this.scrollTo(c(this.props,a,u,x,this._instanceProps,j))},v.componentDidMount=function(){var a=this.props,u=a.direction,p=a.initialScrollOffset,f=a.layout;if(typeof p=="number"&&this._outerRef!=null){var y=this._outerRef;u==="horizontal"||f==="horizontal"?y.scrollLeft=p:y.scrollTop=p}this._callPropsCallbacks()},v.componentDidUpdate=function(){var a=this.props,u=a.direction,p=a.layout,f=this.state,y=f.scrollOffset,x=f.scrollUpdateWasRequested;if(x&&this._outerRef!=null){var j=this._outerRef;if(u==="horizontal"||p==="horizontal")if(u==="rtl")switch(oe()){case"negative":j.scrollLeft=-y;break;case"positive-ascending":j.scrollLeft=y;break;default:var A=j.clientWidth,S=j.scrollWidth;j.scrollLeft=S-A-y;break}else j.scrollLeft=y;else j.scrollTop=y}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ie(this._resetIsScrollingTimeoutId)},v.render=function(){var a=this.props,u=a.children,p=a.className,f=a.direction,y=a.height,x=a.innerRef,j=a.innerElementType,A=a.innerTagName,S=a.itemCount,D=a.itemData,z=a.itemKey,w=z===void 0?Ts:z,_=a.layout,he=a.outerElementType,Ie=a.outerTagName,ye=a.style,ge=a.useIsScrolling,xe=a.width,P=this.state.isScrolling,E=f==="horizontal"||_==="horizontal",je=E?this._onScrollHorizontal:this._onScrollVertical,Y=this._getRangeToRender(),Me=Y[0],ve=Y[1],W=[];if(S>0)for(var O=Me;O<=ve;O++)W.push(T.createElement(u,{data:D,key:w(O,D),index:O,isScrolling:ge?P:void 0,style:this._getItemStyle(O)}));var F=r(this.props,this._instanceProps);return T.createElement(he||Ie||"div",{className:p,onScroll:je,ref:this._outerRefSetter,style:U({position:"relative",height:y,width:xe,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},ye)},T.createElement(j||A||"div",{children:W,ref:x,style:{height:E?"100%":F,pointerEvents:P?"none":void 0,width:E?F:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var a=this.props.itemCount;if(a>0){var u=this._getRangeToRender(),p=u[0],f=u[1],y=u[2],x=u[3];this._callOnItemsRendered(p,f,y,x)}}if(typeof this.props.onScroll=="function"){var j=this.state,A=j.scrollDirection,S=j.scrollOffset,D=j.scrollUpdateWasRequested;this._callOnScroll(A,S,D)}},v._getRangeToRender=function(){var a=this.props,u=a.itemCount,p=a.overscanCount,f=this.state,y=f.isScrolling,x=f.scrollDirection,j=f.scrollOffset;if(u===0)return[0,0,0,0];var A=l(this.props,j,this._instanceProps),S=m(this.props,A,j,this._instanceProps),D=!y||x==="backward"?Math.max(1,p):1,z=!y||x==="forward"?Math.max(1,p):1;return[Math.max(0,A-D),Math.max(0,Math.min(u-1,S+z)),A,S]},I}(T.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var As=function(t,i){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,i.instance},Ss=Ns({getItemOffset:function(t,i){var r=t.itemSize;return i*r},getItemSize:function(t,i){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var i=t.itemCount,r=t.itemSize;return r*i},getOffsetForIndexAndAlignment:function(t,i,r,o,c,l){var m=t.direction,d=t.height,h=t.itemCount,M=t.itemSize,g=t.layout,I=t.width,v=m==="horizontal"||g==="horizontal",N=v?I:d,a=Math.max(0,h*M-N),u=Math.min(a,i*M),p=Math.max(0,i*M-N+M+l);switch(r==="smart"&&(o>=p-N&&o<=u+N?r="auto":r="center"),r){case"start":return u;case"end":return p;case"center":{var f=Math.round(p+(u-p)/2);return f<Math.ceil(N/2)?0:f>a+Math.floor(N/2)?a:f}case"auto":default:return o>=p&&o<=u?o:o<p?p:u}},getStartIndexForOffset:function(t,i){var r=t.itemCount,o=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(i/o)))},getStopIndexForStartIndex:function(t,i,r){var o=t.direction,c=t.height,l=t.itemCount,m=t.itemSize,d=t.layout,h=t.width,M=o==="horizontal"||d==="horizontal",g=i*m,I=M?h:c,v=Math.ceil((I+r-g)/m);return Math.max(0,Math.min(l-1,i+v-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function Ds(e){var t=e.lastRenderedStartIndex,i=e.lastRenderedStopIndex,r=e.startIndex,o=e.stopIndex;return!(r>i||o<t)}function zs(e){for(var t=e.isItemLoaded,i=e.itemCount,r=e.minimumBatchSize,o=e.startIndex,c=e.stopIndex,l=[],m=null,d=null,h=o;h<=c;h++){var M=t(h);M?d!==null&&(l.push(m,d),m=d=null):(d=h,m===null&&(m=h))}if(d!==null){for(var g=Math.min(Math.max(d,m+r-1),i-1),I=d+1;I<=g&&!t(I);I++)d=I;l.push(m,d)}if(l.length)for(;l[1]-l[0]+1<r&&l[0]>0;){var v=l[0]-1;if(!t(v))l[0]=v;else break}return l}var ks=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Os=function(){function e(t,i){for(var r=0;r<i.length;r++){var o=i[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),ws=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)},ae=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},_s=function(e){ws(t,e);function t(){var i,r,o,c;ks(this,t);for(var l=arguments.length,m=Array(l),d=0;d<l;d++)m[d]=arguments[d];return c=(r=(o=ae(this,(i=t.__proto__||Object.getPrototypeOf(t)).call.apply(i,[this].concat(m))),o),o._lastRenderedStartIndex=-1,o._lastRenderedStopIndex=-1,o._memoizedUnloadedRanges=[],o._onItemsRendered=function(h){var M=h.visibleStartIndex,g=h.visibleStopIndex;o._lastRenderedStartIndex=M,o._lastRenderedStopIndex=g,o._ensureRowsLoaded(M,g)},o._setRef=function(h){o._listRef=h},r),ae(o,c)}return Os(t,[{key:"resetloadMoreItemsCache",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],r&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var r=this.props.children;return r({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(r,o){var c=this.props,l=c.isItemLoaded,m=c.itemCount,d=c.minimumBatchSize,h=d===void 0?10:d,M=c.threshold,g=M===void 0?15:M,I=zs({isItemLoaded:l,itemCount:m,minimumBatchSize:h,startIndex:Math.max(0,r-g),stopIndex:Math.min(m-1,o+g)});(this._memoizedUnloadedRanges.length!==I.length||this._memoizedUnloadedRanges.some(function(v,N){return I[N]!==v}))&&(this._memoizedUnloadedRanges=I,this._loadUnloadedRanges(I))}},{key:"_loadUnloadedRanges",value:function(r){for(var o=this,c=this.props.loadMoreItems||this.props.loadMoreRows,l=function(h){var M=r[h],g=r[h+1],I=c(M,g);I!=null&&I.then(function(){if(Ds({lastRenderedStartIndex:o._lastRenderedStartIndex,lastRenderedStopIndex:o._lastRenderedStopIndex,startIndex:M,stopIndex:g})){if(o._listRef==null)return;typeof o._listRef.resetAfterIndex=="function"?o._listRef.resetAfterIndex(M,!0):(typeof o._listRef._getItemStyleCache=="function"&&o._listRef._getItemStyleCache(-1),o._listRef.forceUpdate())}})},m=0;m<r.length;m+=2)l(m)}}]),t}(T.PureComponent);const Cs=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),bs=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Es=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),$s=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Ls=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Rs=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Qs=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Us=()=>n.i1,qs=n.styled_default(Us())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Ps=({rank:e,avatar:t,name:i,points:r,isCurrentUser:o,openItemDetail:c,style:l})=>s.jsxs(Cs,{onClick:c,style:l,children:[s.jsx(bs,{children:e||0}),s.jsxs(Ls,{children:[t?s.jsx(Es,{alt:"leaderboard-item-avatar",src:t}):s.jsx($s,{children:n.o$1(i||"")}),s.jsxs(Rs,{children:[s.jsx(Qs,{children:i||""}),o&&s.jsx(qs,{name:"icon-star"})]})]}),s.jsx("div",{children:n.i(r)})]}),Ys=n.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),Ws=({items:e,currentUserId:t,openItemDetail:i,fetchMore:r})=>s.jsx(n.AutoSizer,{children:({width:o,height:c})=>s.jsx(_s,{isItemLoaded:l=>l<e.length,itemCount:e.length+1,loadMoreItems:r,children:({onItemsRendered:l,ref:m})=>s.jsx(Ys,{children:s.jsx(Ss,{itemSize:56,onItemsRendered:l,ref:m,itemCount:e.length,width:o,height:c,children:({index:d,style:h})=>s.jsx(Ps,{style:{...h,maxHeight:48},...e[d],openItemDetail:()=>i(e[d].userId),isCurrentUser:!!t&&t===e[d].userId},e[d].userId)})})})}),Fs=({deepLink:e})=>{const{data:t}=n.useStore(e.$store);return s.jsx(n.O,{inviteLink:t==null?void 0:t.url,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."})},Vs=({gamification:e})=>{const{data:t}=n.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(Ws,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Fs,{deepLink:e.deepLink})},Bs=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),Hs=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Gs=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Zs=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),Js=()=>n.i1,Q=n.styled_default(Js())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),Ks=()=>n.i1,Xs=n.styled_default(Ks())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),en=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),tn=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),sn={[n.PickHistoryStatus.LOST]:s.jsx(Q,{name:"icon-cross"}),[n.PickHistoryStatus.WON]:s.jsx(Q,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:void 0,[n.PickHistoryStatus.DNP]:s.jsx(Q,{name:"icon-arrow"})},nn=({questionId:e,questionType:t,questionStatus:i,subject:r,openForVoting:o,openQuestion:c,status:l})=>{const m=n.o[t],d=sn[l];return m?s.jsxs(Bs,{onClick:()=>c==null?void 0:c(e),children:[s.jsxs(tn,{children:[s.jsxs(Hs,{children:[s.jsx(Xs,{name:m.iconName}),s.jsxs(en,{children:[m.label,t===n.QuestionType.TRIVIA&&i===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(Gs,{children:r||""})]}),s.jsx(Zs,{children:d||(o?s.jsx(n.c,{children:"Play"}):null)})]}):null},rn=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),on=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),an=({openInsight:e,questionId:t,...i})=>s.jsxs(rn,{children:[s.jsx(fe,{questionId:t,...i}),e&&s.jsx(on,{onClick:()=>e(t),children:"View Insight"})]}),ln=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),cn=({questions:e,openQuestion:t})=>s.jsx(ln,{children:e==null?void 0:e.map(i=>{var r,o;if(i.type==="question"&&((r=i.attributes)==null?void 0:r.attributes.case)==="question"){const c=i.attributes.attributes.value;return s.jsx(nn,{openQuestion:t,...c},c.questionId)}if(i.type==="insight"&&((o=i.attributes)==null?void 0:o.attributes.case)==="insight"){const c=i.attributes.attributes.value;return s.jsx(an,{openInsight:t,...c},c.questionId)}return null})}),dn=({store:e,openQuestion:t})=>{const i=n.useStore(e);return i!=null&&i.data?s.jsx(cn,{openQuestion:t,questions:i.data}):s.jsx("div",{children:"wait questions..."})},un=({userSummary:e})=>{var t,i;const r=n.useStore(e.getStore());return(t=r.data)!=null&&t.summary?s.jsx(de,{...r.data.summary,successRate:(i=r.data.percentage)==null?void 0:i.correct}):s.jsx("div",{children:"wait user..."})},pn=({gamification:e})=>{const[t,i]=T.useState(b.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(n.a$1,{style:{paddingBottom:"4px"},children:s.jsx(Is,{activePage:t,toggleActivePage:i})}),t===b.HOME&&s.jsxs(n.r,{children:[s.jsx(n.a$1,{style:{paddingTop:"12px"},children:s.jsx(un,{userSummary:e.userSummary})}),s.jsx(n.n$1,{children:s.jsx(dn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===b.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(Vs,{gamification:e})})]})},mn=()=>n.d,le=n.styled_default(mn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),fn=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),hn=({correct:e,incorrect:t})=>{const i=e+t;return i===0?0:Math.round(e/i*100)},In=({gamification:e,className:t})=>{const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[i&&s.jsx(le,{className:t,children:s.jsx(us,{gamification:e})}),r&&s.jsx(le,{className:t,children:s.jsxs(fn,{children:[s.jsx(ce,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.a$1,{children:s.jsx(de,{...r,successRate:hn(r)})})]})}),s.jsx(n.r,{className:t,"data-nav":"true",children:s.jsx(pn,{gamification:e})})]})};exports.default=In;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("./masters.js"),T=require("react"),Te=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Ne=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),Ae=()=>n.i1,Se=n.styled_default(Ae())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),De=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),ze=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),ke=()=>n.i1,Oe=n.styled_default(ke())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ce=({type:e,close:t,label:i})=>{const r=e?n.o[e]:{label:i,iconName:void 0};return s.jsxs(Te,{children:[s.jsxs(Ne,{children:[(r==null?void 0:r.iconName)&&s.jsx(Se,{name:r.iconName}),(r==null?void 0:r.label)&&s.jsx(De,{children:r.label})]}),s.jsx(ze,{onClick:t,children:s.jsx(Oe,{name:"icon-cross"})})]})},we=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),_e=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Ce=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),V=({indicator:e,title:t})=>s.jsxs(we,{children:[s.jsx(_e,{children:t}),s.jsx(Ce,{children:e})]}),be=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Ee=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),$e=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),C=({indicator:e,title:t})=>s.jsxs(be,{children:[s.jsx(Ee,{children:e}),s.jsx($e,{children:t})]}),Le=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Re=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Qe=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Ue=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),qe=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Pe=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Ye=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),We=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Fe=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Ve=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Be=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),He=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),Ge=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Ze=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Je=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),Ke=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),Xe=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),et="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",de=({avatar:e,name:t,points:i,friendsRank:r,rank:a,streak:c,correct:l,incorrect:m,inTop:d,successRate:h})=>s.jsxs(Le,{children:[s.jsx(Re,{children:s.jsxs(Ue,{children:[s.jsxs(Xe,{children:[e&&s.jsx(qe,{alt:"avatar",src:e}),!e&&s.jsx(Ke,{children:n.o$1(t||"")})]}),s.jsxs(Pe,{children:[s.jsx(Ye,{children:t}),s.jsxs(We,{children:[s.jsxs(Ve,{children:[s.jsx(Fe,{alt:"rank-icon",src:et}),s.jsxs(Be,{children:[n.i(i),s.jsx(He,{children:"PTS"})]})]}),s.jsx(Ge,{}),s.jsxs("div",{children:["TOP ",d||0,"%"]})]})]})]})}),s.jsxs(Qe,{children:[s.jsxs(Ze,{children:[s.jsx(V,{indicator:r||0,title:"Friends rank"}),s.jsx(V,{indicator:a||0,title:"Global rank"})]}),s.jsxs(Je,{children:[s.jsx(C,{indicator:c||0,title:"Win streak"}),s.jsx(C,{indicator:l||0,title:"Correct"}),s.jsx(C,{indicator:m||0,title:"Incorrect"}),s.jsx(C,{indicator:`${h||0}%`,title:"Succ. rate"})]})]})]}),tt=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),st=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),nt=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),it=({title:e,description:t})=>s.jsxs(tt,{children:[s.jsx(n.i1,{name:"icon-check-circle"}),s.jsx(st,{children:e}),s.jsx(nt,{children:t})]}),rt=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),at=()=>n.i1,ot=n.styled_default(at())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),B=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),H=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),lt=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),L=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),ct=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),dt=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:i,questionType:r,hasCorrectAnswer:a,questionStatus:c})=>{const l=i&&(r===n.QuestionType.TRIVIA||r===n.QuestionType.PREDICTION);if(!l&&c!==n.QuestionStatus.RESOLVED)return null;const m=r===n.QuestionType.PREDICTION&&!a,d=t?"correct":"incorrect",h=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(rt,{"data-isPrediction":m,children:[c===n.QuestionStatus.RESOLVED&&r===n.QuestionType.TRIVIA&&!i&&s.jsxs(s.Fragment,{children:[s.jsx(B,{children:s.jsx(n.i1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(H,{children:s.jsx(L,{children:"Question Expired"})}),s.jsx(ct,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),l&&m&&s.jsxs(s.Fragment,{children:[s.jsx(ot,{name:"icon-prediction"}),s.jsx(L,{children:"Stay tuned to see if your prediction was correct."})]}),l&&a&&s.jsxs(s.Fragment,{children:[s.jsx(B,{"data-feedbackType":d,children:s.jsx(n.i1,{name:d})}),s.jsx("div",{children:s.jsxs(H,{children:[s.jsx(lt,{"data-feedbackType":d,children:h==null?void 0:h.title}),s.jsx(L,{children:h==null?void 0:h.description})]})})]})]})},ut=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),pt=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),mt=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),ft=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),ht=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),It=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),yt=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),gt=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),xt=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),ue=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),jt=()=>ue,Mt=n.styled_default(jt())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),vt=()=>ue,Tt=n.styled_default(vt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),Nt=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),At=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),St=n.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),Dt=()=>n.i1,zt=n.styled_default(Dt())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),G={[n.QuestionImages.CENTERED]:e=>s.jsx(Mt,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(gt,{children:s.jsx(xt,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(Tt,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},kt=({questionType:e,hasCorrectAnswer:t,correct:i,youVoted:r,questionVoted:a})=>{if(e===n.QuestionType.POLL&&r)return"correct";if(e===n.QuestionType.PREDICTION){if(t&&a)return r?i?"correct":"incorrect":i?"correct":"unset";if(r)return"correct"}return e===n.QuestionType.TRIVIA&&a?r?i?"correct":"incorrect":i?"correct":"unset":"unset"},Ot=({questionType:e,questionVoted:t,correct:i,hasCorrectAnswer:r,questionStatus:a})=>e===n.QuestionType.TRIVIA?t&&i:e===n.QuestionType.PREDICTION?t&&i&&r||a===n.QuestionStatus.RESOLVED&&i:!1,wt=e=>{var t;const{id:i,icon:r,text:a,percentageDecimal:c,onVote:l,youSelected:m,questionVoted:d,imageMode:h,answerTimeExpired:M,questionStatus:g,isLoading:I,questionType:v,correct:N,hasCorrectAnswer:o}=e,u=kt(e),p=Ot({questionType:v,questionVoted:d,correct:N,hasCorrectAnswer:o,questionStatus:g}),f=d||g===n.QuestionStatus.RESOLVED&&v===n.QuestionType.PREDICTION;return s.jsxs(ht,{value:i,"data-selected":m,"data-answerState":u,disabled:d||I||M,onClick:l,children:[f&&s.jsx(It,{"data-answerState":u,style:{width:`${c}%`}}),s.jsxs(yt,{children:[r&&h&&((t=G[h])==null?void 0:t.call(G,r)),s.jsx(Nt,{children:a}),f&&s.jsxs(At,{children:[p&&s.jsx(zt,{name:"selected"}),s.jsxs(St,{children:[c,"%"]})]})]})]})};var Z=typeof window>"u"?T.useEffect:T.useLayoutEffect,_t=({isPlaying:e,duration:t,startAt:i=0,updateInterval:r=0,onComplete:a,onUpdate:c})=>{let[l,m]=T.useState(i),d=T.useRef(0),h=T.useRef(i),M=T.useRef(i*-1e3),g=T.useRef(null),I=T.useRef(null),v=T.useRef(null),N=p=>{let f=p/1e3;if(I.current===null){I.current=f,g.current=requestAnimationFrame(N);return}let y=f-I.current,j=d.current+y;I.current=f,d.current=j;let x=h.current+(r===0?j:(j/r|0)*r),A=h.current+j,S=typeof t=="number"&&A>=t;m(S?t:x),S||(g.current=requestAnimationFrame(N))},o=()=>{g.current&&cancelAnimationFrame(g.current),v.current&&clearTimeout(v.current),I.current=null},u=T.useCallback(p=>{o(),d.current=0;let f=typeof p=="number"?p:i;h.current=f,m(f),e&&(g.current=requestAnimationFrame(N))},[e,i]);return Z(()=>{if(c==null||c(l),t&&l>=t){M.current+=t*1e3;let{shouldRepeat:p=!1,delay:f=0,newStartAt:y}=(a==null?void 0:a(M.current/1e3))||{};p&&(v.current=setTimeout(()=>u(y),f*1e3))}},[l,t]),Z(()=>(e&&(g.current=requestAnimationFrame(N)),o),[e,t,r]),{elapsedTime:l,reset:u}},Ct=(e,t,i)=>{let r=e/2,a=t/2,c=r-a,l=2*c,m=i==="clockwise"?"1,0":"0,1",d=2*Math.PI*c;return{path:`m ${r},${a} a ${c},${c} 0 ${m} 0,${l} a ${c},${c} 0 ${m} 0,-${l}`,pathLength:d}},J=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,bt=e=>({position:"relative",width:e,height:e}),Et={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},pe=(e,t,i,r,a)=>{if(r===0)return t;let c=(a?r-e:e)/r;return t+i*c},K=e=>{var t,i;return(i=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(r,a,c,l)=>`#${a}${a}${c}${c}${l}${l}`).substring(1).match(/.{2}/g))==null?void 0:t.map(r=>parseInt(r,16)))!=null?i:[]},$t=(e,t)=>{var i;let{colors:r,colorsTime:a,isSmoothColorTransition:c=!0}=e;if(typeof r=="string")return r;let l=(i=a==null?void 0:a.findIndex((I,v)=>I>=t&&t>=a[v+1]))!=null?i:-1;if(!a||l===-1)return r[0];if(!c)return r[l];let m=a[l]-t,d=a[l]-a[l+1],h=K(r[l]),M=K(r[l+1]),g=!!e.isGrowing;return`rgb(${h.map((I,v)=>pe(m,I,M[v]-I,d,g)|0).join(",")})`},Lt=e=>{let{duration:t,initialRemainingTime:i,updateInterval:r,size:a=180,strokeWidth:c=12,trailStrokeWidth:l,isPlaying:m=!1,isGrowing:d=!1,rotation:h="clockwise",onComplete:M,onUpdate:g}=e,I=T.useRef(),v=Math.max(c,l??0),{path:N,pathLength:o}=Ct(a,v,h),{elapsedTime:u}=_t({isPlaying:m,duration:t,startAt:J(t,i),updateInterval:r,onUpdate:typeof g=="function"?f=>{let y=Math.ceil(t-f);y!==I.current&&(I.current=y,g(y))}:void 0,onComplete:typeof M=="function"?f=>{var y;let{shouldRepeat:j,delay:x,newInitialRemainingTime:A}=(y=M(f))!=null?y:{};if(j)return{shouldRepeat:j,delay:x,newStartAt:J(t,A)}}:void 0}),p=t-u;return{elapsedTime:u,path:N,pathLength:o,remainingTime:Math.ceil(p),rotation:h,size:a,stroke:$t(e,p),strokeDashoffset:pe(u,0,o,t,d),strokeWidth:c}},me=e=>{let{children:t,strokeLinecap:i,trailColor:r,trailStrokeWidth:a}=e,{path:c,pathLength:l,stroke:m,strokeDashoffset:d,remainingTime:h,elapsedTime:M,size:g,strokeWidth:I}=Lt(e);return T.createElement("div",{style:bt(g)},T.createElement("svg",{viewBox:`0 0 ${g} ${g}`,width:g,height:g,xmlns:"http://www.w3.org/2000/svg"},T.createElement("path",{d:c,fill:"none",stroke:r??"#d9d9d9",strokeWidth:a??I}),T.createElement("path",{d:c,fill:"none",stroke:m,strokeLinecap:i??"round",strokeWidth:I,strokeDasharray:l,strokeDashoffset:d})),typeof t=="function"&&T.createElement("div",{style:Et},t({remainingTime:h,elapsedTime:M,color:m})))};me.displayName="CountdownCircleTimer";const Rt=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1],Qt=[10,10,0],Ut=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),qt=n.E.SECONDARY_GREEN6,X=n.E.SECONDARY_RED3,Pt=n.E.NEUTRALS_GRAY3,Yt=({isPlaying:e=!0,duration:t=30,onTimerExpired:i})=>{const[r,a]=T.useState(t>10?qt:X),c=({remainingTime:d})=>s.jsx(Ut,{children:d}),l=T.useCallback(()=>{i==null||i(),a(Pt)},[i,a]),m=T.useCallback(d=>{d===10&&a(X)},[a]);return s.jsx(me,{isPlaying:e,duration:t,colors:Rt,colorsTime:Qt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:r,onComplete:l,onUpdate:m,children:c})},Wt=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Ft=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Vt=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Bt=()=>n.i1,Ht=n.styled_default(Bt())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Gt=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Zt=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),Jt=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Kt=({title:e,points:t,isPlayingTimer:i,isTimer:r,onTimerExpired:a})=>s.jsxs(Wt,{children:[s.jsxs(Ft,{children:[e&&s.jsx(Vt,{children:e}),t!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx(Ht,{name:"icon-trophy"}),s.jsxs(Gt,{children:[s.jsx(Zt,{children:t}),s.jsx(Jt,{children:"PTS"})]})]})]}),r&&s.jsx(Yt,{isPlaying:i,onTimerExpired:a})]}),Xt=({openedQuestion:e,vote:t,close:i})=>{var r;const a=e.subject,c=e.type,l=(r=e.options)==null?void 0:r.options,[m,d]=T.useState(!1),[h,M]=T.useState(!1),[g,I]=T.useState(""),v=e==null?void 0:e.id,N=T.useCallback(async j=>{if(v){const x=j.currentTarget.value;I(x),M(!0),await t(v,x),M(!1)}},[v,I,t]),o=T.useCallback(()=>{d(!0),setTimeout(i,3e3)},[i]),u=T.useMemo(()=>e==null?void 0:e.answers.find(j=>j.youVoted===!0),[e]),p=T.useMemo(()=>!!(e!=null&&e.answers.find(j=>j.correct===!0)),[e]),f=T.useMemo(()=>e?e.answers.map(j=>{var x;return{...j,questionVoted:!!u,youSelected:g===j.id,isLoading:h,hasCorrectAnswer:p,questionType:e.type,answerTimeExpired:m,questionStatus:e.status,imageMode:(x=e.appearance)==null?void 0:x.images,onVote:N}}):[],[p,m,h,e,u,N,g]),y=l&&(l.case==="trivia"||l.case==="prediction")?l.value:void 0;return s.jsx(n.r,{"data-question-header":"true",children:s.jsx(ut,{children:s.jsxs(pt,{children:[y&&s.jsx(dt,{feedbackMessages:y,questionVoted:!!u,questionVotedCorrectly:u==null?void 0:u.correct,questionType:c,hasCorrectAnswer:p,questionStatus:e.status}),s.jsx(Kt,{title:m?"Time expired":"To win",points:m?void 0:100,onTimerExpired:o,isTimer:!0}),m?s.jsx(it,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(mt,{children:a}),s.jsx(ft,{children:f.map(j=>s.jsx(wt,{...j},j.id))})]})]})})})},es=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),ts=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),ss=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ns=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),is=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),fe=({created:e,title:t,instantView:i})=>{const r=T.useMemo(()=>{if(e){const a=new Date(e);if(n.r$1(a))return{date:n.a(a),time:n.n(a)}}return null},[e]);return s.jsxs(es,{children:[r&&s.jsxs(is,{children:[r.date," · ",r.time]}),(i==null?void 0:i.video)&&s.jsx(n.w,{source:i.video.url,poster:i.video.thumbnailUrl}),s.jsxs(ts,{children:[s.jsx(ss,{children:(i==null?void 0:i.heading)||t}),s.jsx(ns,{children:i==null?void 0:i.body})]})]})},rs=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),as=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),os=({instantView:e,...t})=>s.jsxs(rs,{children:[s.jsx(fe,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(as,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(n.i1,{name:"icon-external-link"})]})]}),ls=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),cs=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(os,{created:e.attributes.created,...e.attributes.attributes.value}):null},ds=({extendedQuestion:e,vote:t,close:i})=>{const{loading:r,data:a}=e;return!r&&a?s.jsx(Xt,{vote:t,close:i,openedQuestion:a}):null},us=({gamification:e})=>{var t;const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedQuestion.$extendedStore);if(!i)return null;const a=i.type;return s.jsxs(ls,{children:[s.jsx(ce,{close:e.closeQuestion,type:((t=i.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),a==="question"&&s.jsx(ds,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:r}),a!=="question"&&s.jsx(cs,{openedQuestion:i})]})},ps=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),ms=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),fs=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),hs=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var E=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(E||{});const ee=({title:e,active:t,onClick:i})=>s.jsx(fs,{onClick:i,"data-selected":t,children:s.jsx(hs,{children:e})}),Is=({activePage:e="home",toggleActivePage:t})=>s.jsx(ps,{children:s.jsxs(ms,{"data-position":e==="home"?"left":"right",children:[s.jsx(ee,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(ee,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},U.apply(this,arguments)}function te(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q(e,t){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},q(e,t)}function ys(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,q(e,t)}var se=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function gs(e,t){return!!(e===t||se(e)&&se(t))}function xs(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!gs(e[i],t[i]))return!1;return!0}function R(e,t){t===void 0&&(t=xs);var i,r=[],a,c=!1;function l(){for(var m=[],d=0;d<arguments.length;d++)m[d]=arguments[d];return c&&i===this&&t(m,r)||(a=e.apply(this,m),c=!0,i=this,r=m),a}return l}var js=typeof performance=="object"&&typeof performance.now=="function",ne=js?function(){return performance.now()}:function(){return Date.now()};function ie(e){cancelAnimationFrame(e.id)}function Ms(e,t){var i=ne();function r(){ne()-i>=t?e.call(null):a.id=requestAnimationFrame(r)}var a={id:requestAnimationFrame(r)};return a}var Q=-1;function re(e){if(e===void 0&&(e=!1),Q===-1||e){var t=document.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",document.body.appendChild(t),Q=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Q}var k=null;function ae(e){if(e===void 0&&(e=!1),k===null||e){var t=document.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",i.direction="rtl";var r=document.createElement("div"),a=r.style;return a.width="100px",a.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?k="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?k="negative":k="positive-ascending"),document.body.removeChild(t),k}return k}var vs=150,Ts=function(t,i){return t};function Ns(e){var t,i=e.getItemOffset,r=e.getEstimatedTotalSize,a=e.getItemSize,c=e.getOffsetForIndexAndAlignment,l=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,d=e.initInstanceProps,h=e.shouldResetStyleCacheOnItemSizeChange,M=e.validateProps;return t=function(g){ys(I,g);function I(N){var o;return o=g.call(this,N)||this,o._instanceProps=d(o.props,te(o)),o._outerRef=void 0,o._resetIsScrollingTimeoutId=null,o.state={instance:te(o),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof o.props.initialScrollOffset=="number"?o.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},o._callOnItemsRendered=void 0,o._callOnItemsRendered=R(function(u,p,f,y){return o.props.onItemsRendered({overscanStartIndex:u,overscanStopIndex:p,visibleStartIndex:f,visibleStopIndex:y})}),o._callOnScroll=void 0,o._callOnScroll=R(function(u,p,f){return o.props.onScroll({scrollDirection:u,scrollOffset:p,scrollUpdateWasRequested:f})}),o._getItemStyle=void 0,o._getItemStyle=function(u){var p=o.props,f=p.direction,y=p.itemSize,j=p.layout,x=o._getItemStyleCache(h&&y,h&&j,h&&f),A;if(x.hasOwnProperty(u))A=x[u];else{var S=i(o.props,u,o._instanceProps),D=a(o.props,u,o._instanceProps),z=f==="horizontal"||j==="horizontal",w=f==="rtl",_=z?S:0;x[u]=A={position:"absolute",left:w?void 0:_,right:w?_:void 0,top:z?0:S,height:z?"100%":D,width:z?D:"100%"}}return A},o._getItemStyleCache=void 0,o._getItemStyleCache=R(function(u,p,f){return{}}),o._onScrollHorizontal=function(u){var p=u.currentTarget,f=p.clientWidth,y=p.scrollLeft,j=p.scrollWidth;o.setState(function(x){if(x.scrollOffset===y)return null;var A=o.props.direction,S=y;if(A==="rtl")switch(ae()){case"negative":S=-y;break;case"positive-descending":S=j-f-y;break}return S=Math.max(0,Math.min(S,j-f)),{isScrolling:!0,scrollDirection:x.scrollOffset<y?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._onScrollVertical=function(u){var p=u.currentTarget,f=p.clientHeight,y=p.scrollHeight,j=p.scrollTop;o.setState(function(x){if(x.scrollOffset===j)return null;var A=Math.max(0,Math.min(j,y-f));return{isScrolling:!0,scrollDirection:x.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._outerRefSetter=function(u){var p=o.props.outerRef;o._outerRef=u,typeof p=="function"?p(u):p!=null&&typeof p=="object"&&p.hasOwnProperty("current")&&(p.current=u)},o._resetIsScrollingDebounced=function(){o._resetIsScrollingTimeoutId!==null&&ie(o._resetIsScrollingTimeoutId),o._resetIsScrollingTimeoutId=Ms(o._resetIsScrolling,vs)},o._resetIsScrolling=function(){o._resetIsScrollingTimeoutId=null,o.setState({isScrolling:!1},function(){o._getItemStyleCache(-1,null)})},o}I.getDerivedStateFromProps=function(o,u){return As(o,u),M(o),null};var v=I.prototype;return v.scrollTo=function(o){o=Math.max(0,o),this.setState(function(u){return u.scrollOffset===o?null:{scrollDirection:u.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(o,u){u===void 0&&(u="auto");var p=this.props,f=p.itemCount,y=p.layout,j=this.state.scrollOffset;o=Math.max(0,Math.min(o,f-1));var x=0;if(this._outerRef){var A=this._outerRef;y==="vertical"?x=A.scrollWidth>A.clientWidth?re():0:x=A.scrollHeight>A.clientHeight?re():0}this.scrollTo(c(this.props,o,u,j,this._instanceProps,x))},v.componentDidMount=function(){var o=this.props,u=o.direction,p=o.initialScrollOffset,f=o.layout;if(typeof p=="number"&&this._outerRef!=null){var y=this._outerRef;u==="horizontal"||f==="horizontal"?y.scrollLeft=p:y.scrollTop=p}this._callPropsCallbacks()},v.componentDidUpdate=function(){var o=this.props,u=o.direction,p=o.layout,f=this.state,y=f.scrollOffset,j=f.scrollUpdateWasRequested;if(j&&this._outerRef!=null){var x=this._outerRef;if(u==="horizontal"||p==="horizontal")if(u==="rtl")switch(ae()){case"negative":x.scrollLeft=-y;break;case"positive-ascending":x.scrollLeft=y;break;default:var A=x.clientWidth,S=x.scrollWidth;x.scrollLeft=S-A-y;break}else x.scrollLeft=y;else x.scrollTop=y}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ie(this._resetIsScrollingTimeoutId)},v.render=function(){var o=this.props,u=o.children,p=o.className,f=o.direction,y=o.height,j=o.innerRef,x=o.innerElementType,A=o.innerTagName,S=o.itemCount,D=o.itemData,z=o.itemKey,w=z===void 0?Ts:z,_=o.layout,he=o.outerElementType,Ie=o.outerTagName,ye=o.style,ge=o.useIsScrolling,xe=o.width,P=this.state.isScrolling,$=f==="horizontal"||_==="horizontal",je=$?this._onScrollHorizontal:this._onScrollVertical,Y=this._getRangeToRender(),Me=Y[0],ve=Y[1],W=[];if(S>0)for(var O=Me;O<=ve;O++)W.push(T.createElement(u,{data:D,key:w(O,D),index:O,isScrolling:ge?P:void 0,style:this._getItemStyle(O)}));var F=r(this.props,this._instanceProps);return T.createElement(he||Ie||"div",{className:p,onScroll:je,ref:this._outerRefSetter,style:U({position:"relative",height:y,width:xe,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},ye)},T.createElement(x||A||"div",{children:W,ref:j,style:{height:$?"100%":F,pointerEvents:P?"none":void 0,width:$?F:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var o=this.props.itemCount;if(o>0){var u=this._getRangeToRender(),p=u[0],f=u[1],y=u[2],j=u[3];this._callOnItemsRendered(p,f,y,j)}}if(typeof this.props.onScroll=="function"){var x=this.state,A=x.scrollDirection,S=x.scrollOffset,D=x.scrollUpdateWasRequested;this._callOnScroll(A,S,D)}},v._getRangeToRender=function(){var o=this.props,u=o.itemCount,p=o.overscanCount,f=this.state,y=f.isScrolling,j=f.scrollDirection,x=f.scrollOffset;if(u===0)return[0,0,0,0];var A=l(this.props,x,this._instanceProps),S=m(this.props,A,x,this._instanceProps),D=!y||j==="backward"?Math.max(1,p):1,z=!y||j==="forward"?Math.max(1,p):1;return[Math.max(0,A-D),Math.max(0,Math.min(u-1,S+z)),A,S]},I}(T.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var As=function(t,i){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,i.instance},Ss=Ns({getItemOffset:function(t,i){var r=t.itemSize;return i*r},getItemSize:function(t,i){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var i=t.itemCount,r=t.itemSize;return r*i},getOffsetForIndexAndAlignment:function(t,i,r,a,c,l){var m=t.direction,d=t.height,h=t.itemCount,M=t.itemSize,g=t.layout,I=t.width,v=m==="horizontal"||g==="horizontal",N=v?I:d,o=Math.max(0,h*M-N),u=Math.min(o,i*M),p=Math.max(0,i*M-N+M+l);switch(r==="smart"&&(a>=p-N&&a<=u+N?r="auto":r="center"),r){case"start":return u;case"end":return p;case"center":{var f=Math.round(p+(u-p)/2);return f<Math.ceil(N/2)?0:f>o+Math.floor(N/2)?o:f}case"auto":default:return a>=p&&a<=u?a:a<p?p:u}},getStartIndexForOffset:function(t,i){var r=t.itemCount,a=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(i/a)))},getStopIndexForStartIndex:function(t,i,r){var a=t.direction,c=t.height,l=t.itemCount,m=t.itemSize,d=t.layout,h=t.width,M=a==="horizontal"||d==="horizontal",g=i*m,I=M?h:c,v=Math.ceil((I+r-g)/m);return Math.max(0,Math.min(l-1,i+v-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function Ds(e){var t=e.lastRenderedStartIndex,i=e.lastRenderedStopIndex,r=e.startIndex,a=e.stopIndex;return!(r>i||a<t)}function zs(e){for(var t=e.isItemLoaded,i=e.itemCount,r=e.minimumBatchSize,a=e.startIndex,c=e.stopIndex,l=[],m=null,d=null,h=a;h<=c;h++){var M=t(h);M?d!==null&&(l.push(m,d),m=d=null):(d=h,m===null&&(m=h))}if(d!==null){for(var g=Math.min(Math.max(d,m+r-1),i-1),I=d+1;I<=g&&!t(I);I++)d=I;l.push(m,d)}if(l.length)for(;l[1]-l[0]+1<r&&l[0]>0;){var v=l[0]-1;if(!t(v))l[0]=v;else break}return l}var ks=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Os=function(){function e(t,i){for(var r=0;r<i.length;r++){var a=i[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),ws=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)},oe=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},_s=function(e){ws(t,e);function t(){var i,r,a,c;ks(this,t);for(var l=arguments.length,m=Array(l),d=0;d<l;d++)m[d]=arguments[d];return c=(r=(a=oe(this,(i=t.__proto__||Object.getPrototypeOf(t)).call.apply(i,[this].concat(m))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(h){var M=h.visibleStartIndex,g=h.visibleStopIndex;a._lastRenderedStartIndex=M,a._lastRenderedStopIndex=g,a._ensureRowsLoaded(M,g)},a._setRef=function(h){a._listRef=h},r),oe(a,c)}return Os(t,[{key:"resetloadMoreItemsCache",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],r&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var r=this.props.children;return r({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(r,a){var c=this.props,l=c.isItemLoaded,m=c.itemCount,d=c.minimumBatchSize,h=d===void 0?10:d,M=c.threshold,g=M===void 0?15:M,I=zs({isItemLoaded:l,itemCount:m,minimumBatchSize:h,startIndex:Math.max(0,r-g),stopIndex:Math.min(m-1,a+g)});(this._memoizedUnloadedRanges.length!==I.length||this._memoizedUnloadedRanges.some(function(v,N){return I[N]!==v}))&&(this._memoizedUnloadedRanges=I,this._loadUnloadedRanges(I))}},{key:"_loadUnloadedRanges",value:function(r){for(var a=this,c=this.props.loadMoreItems||this.props.loadMoreRows,l=function(h){var M=r[h],g=r[h+1],I=c(M,g);I!=null&&I.then(function(){if(Ds({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:M,stopIndex:g})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(M,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},m=0;m<r.length;m+=2)l(m)}}]),t}(T.PureComponent);const Cs=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),bs=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Es=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),$s=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Ls=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Rs=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Qs=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Us=()=>n.i1,qs=n.styled_default(Us())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Ps=({rank:e,avatar:t,name:i,points:r,isCurrentUser:a,openItemDetail:c,style:l})=>s.jsxs(Cs,{onClick:c,style:l,children:[s.jsx(bs,{children:e||0}),s.jsxs(Ls,{children:[t?s.jsx(Es,{alt:"leaderboard-item-avatar",src:t}):s.jsx($s,{children:n.o$1(i||"")}),s.jsxs(Rs,{children:[s.jsx(Qs,{children:i||""}),a&&s.jsx(qs,{name:"icon-star"})]})]}),s.jsx("div",{children:n.i(r)})]}),Ys=n.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),Ws=({items:e,currentUserId:t,openItemDetail:i,fetchMore:r})=>s.jsx(n.AutoSizer,{children:({width:a,height:c})=>s.jsx(_s,{isItemLoaded:l=>l<e.length,itemCount:e.length+1,loadMoreItems:r,children:({onItemsRendered:l,ref:m})=>s.jsx(Ys,{children:s.jsx(Ss,{itemSize:56,onItemsRendered:l,ref:m,itemCount:e.length,width:a,height:c,children:({index:d,style:h})=>s.jsx(Ps,{style:{...h,maxHeight:48},...e[d],openItemDetail:()=>i(e[d].userId),isCurrentUser:!!t&&t===e[d].userId},e[d].userId)})})})}),Fs=({deepLink:e})=>{const{data:t}=n.useStore(e.$store);return s.jsx(n.O,{inviteLink:t==null?void 0:t.url,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."})},Vs=({gamification:e})=>{const{data:t}=n.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(Ws,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Fs,{deepLink:e.deepLink})},Bs=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),Hs=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Gs=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Zs=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),Js=()=>n.i1,b=n.styled_default(Js())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),Ks=()=>n.i1,Xs=n.styled_default(Ks())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),en=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),tn=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),sn=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),nn={[n.PickHistoryStatus.LOST]:s.jsx(b,{name:"icon-cross"}),[n.PickHistoryStatus.WON]:s.jsx(b,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:s.jsx(b,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:s.jsx(b,{name:"icon-arrow"})},rn=({questionId:e,questionType:t,questionStatus:i,subject:r,openForVoting:a,openQuestion:c,status:l})=>{const m=n.o[t],d=nn[l];return m?s.jsxs(Bs,{onClick:()=>c==null?void 0:c(e),children:[s.jsxs(tn,{children:[s.jsxs(Hs,{children:[s.jsx(Xs,{name:m.iconName}),s.jsxs(en,{children:[m.label,t===n.QuestionType.TRIVIA&&i===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(Gs,{children:r||""})]}),s.jsx(Zs,{children:a?s.jsx(sn,{children:"Play"}):d})]}):null},an=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),on=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),ln=({openInsight:e,questionId:t,...i})=>s.jsxs(an,{children:[s.jsx(fe,{questionId:t,...i}),e&&s.jsx(on,{onClick:()=>e(t),children:"View Insight"})]}),cn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),dn=({questions:e,openQuestion:t})=>s.jsx(cn,{children:e==null?void 0:e.map(i=>{var r,a;if(i.type==="question"&&((r=i.attributes)==null?void 0:r.attributes.case)==="question"){const c=i.attributes.attributes.value;return s.jsx(rn,{openQuestion:t,...c},c.questionId)}if(i.type==="insight"&&((a=i.attributes)==null?void 0:a.attributes.case)==="insight"){const c=i.attributes.attributes.value;return s.jsx(ln,{openInsight:t,...c},c.questionId)}return null})}),un=({store:e,openQuestion:t})=>{const i=n.useStore(e);return i!=null&&i.data?s.jsx(dn,{openQuestion:t,questions:i.data}):s.jsx("div",{children:"wait questions..."})},pn=({userSummary:e})=>{var t,i;const r=n.useStore(e.getStore());return(t=r.data)!=null&&t.summary?s.jsx(de,{...r.data.summary,successRate:(i=r.data.percentage)==null?void 0:i.correct}):s.jsx("div",{children:"wait user..."})},mn=({gamification:e})=>{const[t,i]=T.useState(E.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(n.a$1,{style:{paddingBottom:"4px"},children:s.jsx(Is,{activePage:t,toggleActivePage:i})}),t===E.HOME&&s.jsxs(n.r,{children:[s.jsx(n.a$1,{style:{paddingTop:"12px"},children:s.jsx(pn,{userSummary:e.userSummary})}),s.jsx(n.n$1,{children:s.jsx(un,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===E.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(Vs,{gamification:e})})]})},fn=()=>n.d,le=n.styled_default(fn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),hn=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),In=({correct:e,incorrect:t})=>{const i=e+t;return i===0?0:Math.round(e/i*100)},yn=({gamification:e,className:t})=>{const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[i&&s.jsx(le,{className:t,children:s.jsx(us,{gamification:e})}),r&&s.jsx(le,{className:t,children:s.jsxs(hn,{children:[s.jsx(ce,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.a$1,{children:s.jsx(de,{...r,successRate:In(r)})})]})}),s.jsx(n.r,{className:t,"data-nav":"true",children:s.jsx(mn,{gamification:e})})]})};exports.default=yn;
@@ -294,4 +294,4 @@ PERFORMANCE OF THIS SOFTWARE.
294
294
  `),he=`
295
295
  `+oe+(ue.length?ce("│"):" ")+" ";return oe+fe.join(he)+`
296
296
  `+ue.map(function(ve,ke){var Se=ke===ue.length-1,Me=ve.nodes&&ve.nodes.length,Pe=oe+(Se?" ":ce("│"))+" ";return oe+ce(Se?"└":"├")+ce("─")+ce(Me?"┬":"─")+" "+te(ve,Pe,le).slice(oe.length+2)}).join("")};const qs=Ms,jr=Symbol("avvio.TimeTree.untrackNode"),zt=Symbol("avvio.TimeTree.trackNode"),Vr=Symbol("avvio.TimeTree.getParent"),Mr=Symbol("avvio.TimeTree.getNode"),qr=Symbol("avvio.TimeTree.addNode");let Qs=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[zt](te){this.tableId.set(te.id,te),this.tableLabel.has(te.label)?this.tableLabel.get(te.label).push(te):this.tableLabel.set(te.label,[te])}[jr](te){this.tableId.delete(te.id);const ie=this.tableLabel.get(te.label);if(ie.id){this.tableLabel.delete(te.label);return}ie.pop(),ie.length===0&&this.tableLabel.delete(te.label)}[Vr](te){if(te===null)return this.root;const ie=this.tableLabel.get(te);return ie.id?ie:ie[ie.length-1]}[Mr](te){return this.tableId.get(te)}[qr](te,ie,oe){if(te===null)return this.root={id:"root",label:ie,start:oe,nodes:[]},this[zt](this.root),this.root.id;const le=this[Vr](te),ce=`${ie}-${Math.random()}`,ue={id:ce,parent:te,start:oe,label:ie,nodes:[]};return le.nodes.push(ue),this[zt](ue),ce}start(te,ie,oe=Date.now()){return this[qr](te,ie,oe)}stop(te,ie=Date.now()){const oe=this[Mr](te);oe&&(oe.stop=ie,oe.diff=oe.stop-oe.start||0,this[jr](oe))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const te=oe=>(oe.label=`${oe.label} ${oe.diff} ms`,oe.nodes.length>0&&(oe.nodes=oe.nodes.map(le=>te(le))),oe),ie=te(this.toJSON());return qs(ie)}};var Gs=Qs,Er={exports:{}},ur={exports:{}},Kt,Qr;function zs(){if(Qr)return Kt;Qr=1;var te=1e3,ie=te*60,oe=ie*60,le=oe*24,ce=le*7,ue=le*365.25;Kt=function(Se,Me){Me=Me||{};var Pe=typeof Se;if(Pe==="string"&&Se.length>0)return fe(Se);if(Pe==="number"&&isFinite(Se))return Me.long?ve(Se):he(Se);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(Se))};function fe(Se){if(Se=String(Se),!(Se.length>100)){var Me=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(Se);if(Me){var Pe=parseFloat(Me[1]),xe=(Me[2]||"ms").toLowerCase();switch(xe){case"years":case"year":case"yrs":case"yr":case"y":return Pe*ue;case"weeks":case"week":case"w":return Pe*ce;case"days":case"day":case"d":return Pe*le;case"hours":case"hour":case"hrs":case"hr":case"h":return Pe*oe;case"minutes":case"minute":case"mins":case"min":case"m":return Pe*ie;case"seconds":case"second":case"secs":case"sec":case"s":return Pe*te;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return Pe;default:return}}}}function he(Se){var Me=Math.abs(Se);return Me>=le?Math.round(Se/le)+"d":Me>=oe?Math.round(Se/oe)+"h":Me>=ie?Math.round(Se/ie)+"m":Me>=te?Math.round(Se/te)+"s":Se+"ms"}function ve(Se){var Me=Math.abs(Se);return Me>=le?ke(Se,Me,le,"day"):Me>=oe?ke(Se,Me,oe,"hour"):Me>=ie?ke(Se,Me,ie,"minute"):Me>=te?ke(Se,Me,te,"second"):Se+" ms"}function ke(Se,Me,Pe,xe){var Oe=Me>=Pe*1.5;return Math.round(Se/Pe)+" "+xe+(Oe?"s":"")}return Kt}function Ks(te){oe.debug=oe,oe.default=oe,oe.coerce=ve,oe.disable=ue,oe.enable=ce,oe.enabled=fe,oe.humanize=zs(),oe.destroy=ke,Object.keys(te).forEach(Se=>{oe[Se]=te[Se]}),oe.names=[],oe.skips=[],oe.formatters={};function ie(Se){let Me=0;for(let Pe=0;Pe<Se.length;Pe++)Me=(Me<<5)-Me+Se.charCodeAt(Pe),Me|=0;return oe.colors[Math.abs(Me)%oe.colors.length]}oe.selectColor=ie;function oe(Se){let Me,Pe=null,xe,Oe;function Be(...Re){if(!Be.enabled)return;const nt=Be,rt=Number(new Date),ot=rt-(Me||rt);nt.diff=ot,nt.prev=Me,nt.curr=rt,Me=rt,Re[0]=oe.coerce(Re[0]),typeof Re[0]!="string"&&Re.unshift("%O");let ht=0;Re[0]=Re[0].replace(/%([a-zA-Z%])/g,(dt,Rt)=>{if(dt==="%%")return"%";ht++;const Ct=oe.formatters[Rt];if(typeof Ct=="function"){const Nt=Re[ht];dt=Ct.call(nt,Nt),Re.splice(ht,1),ht--}return dt}),oe.formatArgs.call(nt,Re),(nt.log||oe.log).apply(nt,Re)}return Be.namespace=Se,Be.useColors=oe.useColors(),Be.color=oe.selectColor(Se),Be.extend=le,Be.destroy=oe.destroy,Object.defineProperty(Be,"enabled",{enumerable:!0,configurable:!1,get:()=>Pe!==null?Pe:(xe!==oe.namespaces&&(xe=oe.namespaces,Oe=oe.enabled(Se)),Oe),set:Re=>{Pe=Re}}),typeof oe.init=="function"&&oe.init(Be),Be}function le(Se,Me){const Pe=oe(this.namespace+(typeof Me>"u"?":":Me)+Se);return Pe.log=this.log,Pe}function ce(Se){oe.save(Se),oe.namespaces=Se,oe.names=[],oe.skips=[];let Me;const Pe=(typeof Se=="string"?Se:"").split(/[\s,]+/),xe=Pe.length;for(Me=0;Me<xe;Me++)Pe[Me]&&(Se=Pe[Me].replace(/\*/g,".*?"),Se[0]==="-"?oe.skips.push(new RegExp("^"+Se.slice(1)+"$")):oe.names.push(new RegExp("^"+Se+"$")))}function ue(){const Se=[...oe.names.map(he),...oe.skips.map(he).map(Me=>"-"+Me)].join(",");return oe.enable(""),Se}function fe(Se){if(Se[Se.length-1]==="*")return!0;let Me,Pe;for(Me=0,Pe=oe.skips.length;Me<Pe;Me++)if(oe.skips[Me].test(Se))return!1;for(Me=0,Pe=oe.names.length;Me<Pe;Me++)if(oe.names[Me].test(Se))return!0;return!1}function he(Se){return Se.toString().substring(2,Se.toString().length-2).replace(/\.\*\?$/,"*")}function ve(Se){return Se instanceof Error?Se.stack||Se.message:Se}function ke(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return oe.enable(oe.load()),oe}var Hs=Ks;(function(te,ie){ie.formatArgs=le,ie.save=ce,ie.load=ue,ie.useColors=oe,ie.storage=fe(),ie.destroy=(()=>{let ve=!1;return()=>{ve||(ve=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),ie.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function oe(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function le(ve){if(ve[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+ve[0]+(this.useColors?"%c ":" ")+"+"+te.exports.humanize(this.diff),!this.useColors)return;const ke="color: "+this.color;ve.splice(1,0,ke,"color: inherit");let Se=0,Me=0;ve[0].replace(/%[a-zA-Z%]/g,Pe=>{Pe!=="%%"&&(Se++,Pe==="%c"&&(Me=Se))}),ve.splice(Me,0,ke)}ie.log=console.debug||console.log||(()=>{});function ce(ve){try{ve?ie.storage.setItem("debug",ve):ie.storage.removeItem("debug")}catch{}}function ue(){let ve;try{ve=ie.storage.getItem("debug")}catch{}return!ve&&typeof O.process<"u"&&"env"in O.process&&(ve=O.process.env.DEBUG),ve}function fe(){try{return localStorage}catch{}}te.exports=Hs(ie);const{formatters:he}=te.exports;he.j=function(ve){try{return JSON.stringify(ve)}catch(ke){return"[UnexpectedJSONParseError]: "+ke.message}}})(ur,ur.exports);var $n=ur.exports;const Ws=fn,Js=wn.EventEmitter,Ys=kt.inherits,Z=$n("avvio"),{AVV_ERR_READY_TIMEOUT:Xs}=Un,Ht=Symbol.for("plugin-meta");function Zs(te,ie){return te[Ht]&&te[Ht].name?te[Ht].name:typeof ie<"u"&&typeof ie!="function"&&ie.name?ie.name:te.name?te.name:te.toString().split(`
297
- `).slice(0,2).map(oe=>oe.trim()).join(" -- ")}function ea(){const te={};return te.promise=new Promise((ie,oe)=>{te.resolve=ie,te.reject=oe}),te}function tt(te,ie,oe,le,ce){this.started=!1,this.func=ie,this.opts=oe,this.onFinish=null,this.parent=te,this.timeout=ce===void 0?te._timeout:ce,this.name=Zs(ie,oe),this.isAfter=le,this.q=Ws(te,ta,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Ys(tt,Js);tt.prototype.exec=function(te,ie){const oe=this.func;let le=!1;const ce=this.name;if(this.parent._error&&!this.isAfter){Z("skipping loading of plugin as parent errored and it is not an after",ce),O.process.nextTick(ie);return}if(this.isAfter)this.server=te;else try{this.server=this.parent.override(te,oe,this.opts)}catch(ve){return Z("override errored",ce),ie(ve)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Z("exec",ce);let ue;const fe=ve=>{if(le){Z("loading complete",ce);return}this._error=ve,Z(ve?"exec errored":"exec completed",ce),le=!0,ue&&clearTimeout(ue),ie(ve)};this.timeout>0&&(Z("setting up timeout",ce,this.timeout),ue=setTimeout(function(){Z("timed out",ce),ue=null;const ve=new Xs(ce);ve.fn=oe,fe(ve)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const he=oe(this.server,this.opts,fe);he&&typeof he.then=="function"&&(Z("exec: resolving promise",ce),he.then(()=>O.process.nextTick(fe),ve=>O.process.nextTick(fe,ve)))};tt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const te=()=>{this.server.after((oe,le)=>{this._error=oe,this.q.pause(),oe?(Z("rejecting promise",this.name,oe),this._promise.reject(oe)):(Z("resolving promise",this.name),this._promise.resolve()),this._promise=null,O.process.nextTick(le,oe)}),this.q.resume()};let ie;return this._promise?ie=Promise.resolve():(this._promise=ea(),ie=this._promise.promise,this.server?te():this.on("start",te)),ie};tt.prototype.enqueue=function(te,ie){Z("enqueue",this.name,te.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(te,ie)};tt.prototype.finish=function(te,ie){Z("finish",this.name,te);const oe=()=>{this.loaded||(Z("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,ie(te))};if(te){this._promise&&(this._promise.reject(te),this._promise=null),oe();return}const le=()=>{if(Z("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const ce=()=>{Z("wrap"),queueMicrotask(le)};this._promise.resolve(),this._promise.promise.then(ce,ce),this._promise=null}else oe();else Z("delayed",this.name),this.q.drain=()=>{Z("drain",this.name),this.q.drain=ra,queueMicrotask(le)}};queueMicrotask(le),this.q.resume()};function ta(te,ie){const oe=this;O.process.nextTick(Ir.bind(oe),te,ie)}function Ir(te,ie){if(typeof te.func.then=="function"){te.func.then(le=>{typeof le.default=="function"&&(le=le.default),te.func=le,Ir.call(this,te,ie)},ie);return}const oe=this._current[0];this._current.unshift(te),te.exec(oe&&oe.server||this._server,le=>{te.finish(le,ce=>{this._current.shift(),ie(ce)})})}function ra(){}Er.exports=tt;Er.exports.loadPlugin=Ir;var na=Er.exports;const Gr=fn,ia=wn.EventEmitter,oa=kt.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Wt,AVV_ERR_CALLBACK_NOT_FN:ct,AVV_ERR_PLUGIN_NOT_VALID:sa,AVV_ERR_ROOT_PLG_BOOTED:aa,AVV_ERR_READY_TIMEOUT:ua}=Un,ca=Gs,cr=na,Ze=$n("avvio"),_t=Symbol("kAvvio"),Jt=Symbol("kThenifyDoNotWrap");function fa(te,ie,oe){const le=ie.expose||{},ce=le.use||"use",ue=le.after||"after",fe=le.ready||"ready",he=le.onClose||"onClose",ve=le.close||"close";if(te[ce])throw new Wt(ce);if(te[ue])throw new Wt(ue);if(te[fe])throw new Wt(fe);te[ce]=function(ke,Se){return oe.use(ke,Se),this},Object.defineProperty(te,"then",{get:Dn.bind(oe)}),te[_t]=!0,te[ue]=function(ke){return typeof ke!="function"?oe._loadRegistered():(oe.after(Yt(ke,this)),this)},te[fe]=function(ke){if(ke&&typeof ke!="function")throw new ct(fe,typeof ke);return oe.ready(ke?Yt(ke,this):void 0)},te[he]=function(ke){if(typeof ke!="function")throw new ct(he,typeof ke);return oe.onClose(ya(ke,this)),this},te[ve]=function(ke){if(ke&&typeof ke!="function")throw new ct(ve,typeof ke);return ke?(oe.close(Yt(ke,this)),this):oe.close()}}function ee(te,ie,oe){if(typeof te=="function"&&arguments.length===1&&(oe=te,ie={},te=null),typeof ie=="function"&&(oe=ie,ie={}),ie=ie||{},!(this instanceof ee)){const le=new ee(te,ie,oe);return te&&fa(te,ie,le),le}ie.autostart!==!1&&(ie.autostart=!0),te=te||this,this._timeout=Number(ie.timeout)||0,this._server=te,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),oe&&this.once("start",oe),this.started=!1,this.booted=!1,this.pluginTree=new ca,this._readyQ=Gr(this,jn,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=zr},this._closeQ=Gr(this,da,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=zr},this._doStart=null,this._root=new cr(this,la.bind(this),ie,!1,0),this._root.once("start",(le,ce,ue)=>{const fe=this.pluginTree.start(null,ce,ue);this._root.once("loaded",(he,ve,ke)=>{this.pluginTree.stop(fe,ke)})}),cr.loadPlugin.call(this,this._root,le=>{Ze("root plugin ready");try{this.emit("preReady"),this._root=null}catch(ce){le=le||this._error||ce}if(le){if(this._error=le,this._readyQ.length()===0)throw le}else this.booted=!0;this._readyQ.resume()})}function la(te,ie,oe){this._doStart=oe,ie.autostart&&this.start()}oa(ee,ia);ee.prototype.start=function(){return this.started=!0,O.process.nextTick(this._doStart),this};ee.prototype.override=function(te,ie,oe){return te};function ha(te){if(te&&typeof te=="object"&&typeof te.default=="function"&&(te=te.default),!(te&&(typeof te=="function"||typeof te.then=="function")))throw new sa(typeof te);return te}ee.prototype[_t]=!0;ee.prototype.use=function(te,ie){return this._lastUsed=this._addPlugin(te,ie,!1),this};ee.prototype._loadRegistered=function(){const te=this._current[0];return!this.started&&!this.booted&&O.process.nextTick(()=>this._root.q.resume()),te?te.loadedSoFar():Promise.resolve()};Object.defineProperty(ee.prototype,"then",{get:Dn});ee.prototype._addPlugin=function(te,ie,oe){if(te=ha(te),ie=ie||{},this.booted)throw new aa;const le=this._current[0],ce=new cr(this,te,ie,oe);if(ce.once("start",(ue,fe,he)=>{const ve=this.pluginTree.start(le.name,fe,he);ce.once("loaded",(ke,Se,Me)=>{this.pluginTree.stop(ve,Me)})}),le.loaded)throw new Error(ce.name,le.name);return le.enqueue(ce,ue=>{ue&&(this._error=ue)}),ce};ee.prototype.after=function(te){if(!te)return this._loadRegistered();this._addPlugin(ie.bind(this),{},!0);function ie(oe,le,ce){jn.call(this,te,ce)}return this};ee.prototype.onClose=function(te){if(typeof te!="function")throw new Error("not a function");te[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(te,ie.bind(this));function ie(oe){oe&&(this._error=oe)}return this};ee.prototype.close=function(te){let ie;if(te){if(typeof te!="function")throw new ct("close",typeof te)}else ie=new Promise(function(oe,le){te=function(ce){if(ce)return le(ce);oe()}});return this.ready(()=>{this._error=null,this._closeQ.push(te),O.process.nextTick(this._closeQ.resume.bind(this._closeQ))}),ie};ee.prototype.ready=function(te){if(te){if(typeof te!="function")throw new ct("ready",typeof te);this._readyQ.push(te),queueMicrotask(this.start.bind(this));return}return new Promise((ie,oe)=>{this._readyQ.push(ce),this.start();const le=this._current[0].server;function ce(ue,fe,he){ue?oe(ue):ie(le),O.process.nextTick(he)}})};ee.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};ee.prototype.toJSON=function(){return this.pluginTree.toJSON()};function zr(){}function Dn(){if(this.booted){Ze("thenify returning null because we are already booted");return}if(this[Jt]){this[Jt]=!1;return}return Ze("thenify"),(te,ie)=>this._loadRegistered().then(()=>(this[Jt]=!0,te(this._server)),ie)}function jn(te,ie){const oe=this._server,le=this._error;let ce;if(this._error=null,te.length===0)this._error=le,ce=te(),ce&&!ce[_t]&&typeof ce.then=="function"?ce.then(()=>O.process.nextTick(ie),ue=>O.process.nextTick(ie,ue)):O.process.nextTick(ie);else if(te.length===1)ce=te(le),ce&&!ce[_t]&&typeof ce.then=="function"?ce.then(()=>O.process.nextTick(ie),ue=>O.process.nextTick(ie,ue)):O.process.nextTick(ie);else if(this._timeout===0){const ue=fe=>{this._error=fe,ie(this._error)};te.length===2?te(le,ue):te(le,oe,ue)}else pa.call(this,te,le,oe,ie)}function pa(te,ie,oe,le){const ce=te.name;Ze("setting up ready timeout",ce,this._timeout);let ue=setTimeout(()=>{Ze("timed out",ce),ue=null;const he=new ua(ce);he.fn=te,this._error=he,le(he)},this._timeout);te.length===2?te(ie,fe.bind(this)):te(ie,oe,fe.bind(this));function fe(he){ue&&(clearTimeout(ue),this._error=he,le(this._error))}}function da(te,ie){const oe=this._server,le=te[this._isOnCloseHandlerKey];if(te.length===0||te.length===1){let ce;le?ce=te(oe):ce=te(this._error),ce&&typeof ce.then=="function"?(Ze("resolving close/onClose promise"),ce.then(()=>O.process.nextTick(ie),ue=>O.process.nextTick(ie,ue))):O.process.nextTick(ie)}else te.length===2?te(le?oe:this._error,ie):le?te(oe,ie):te(this._error,oe,ie)}function ya(te,ie){return oe.bind(ie);function oe(le,ce){let ue;te.length===0?(ue=te(),ue&&ue.then?ue.then(function(){O.process.nextTick(ce)},ce):O.process.nextTick(ce)):te.length===1?(ue=te(this),ue&&ue.then?ue.then(function(){O.process.nextTick(ce)},ce):O.process.nextTick(ce)):te(this,ce)}}function Yt(te,ie){return oe.bind(ie);function oe(le,ce){let ue;te?te.length===0?(ue=te(),ue&&ue.then?ue.then(function(){O.process.nextTick(ce,le)},ce):O.process.nextTick(ce,le)):te.length===1?(ue=te(le),ue&&ue.then?ue.then(function(){O.process.nextTick(ce)},ce):O.process.nextTick(ce)):te.length===2?te(le,ce):te(le,this,ce):O.process.nextTick(ce)}}yr.exports=ee;yr.exports.express=function(te){return ee(te,{expose:{use:"load"}})};var ga=yr.exports;const ma=Yn(ga);function La(te,ie=!0,oe=!0){const le=ie?"https://grpc-web.streamlayer.io:443":"https://grpc-web.next.streamlayer.io:443",ce=ma(Object.create({}),{autostart:!1});return ce.use(Bi),ce.use(Ei,{sdkKey:te,host:le}),ce.use(xi),ce.use(Oi),ce.use(co),ce.use(Ji),oe&&ce.after(async(ue,fe,he)=>{if(ue)throw ue;await fe.sdk.initializeApp(),he()}),ce.onClose(()=>{console.log("close")}),ce}const useStreamLayerApp=(te,ie,oe,le)=>{const[ce,ue]=e$9.useState(null);return e$9.useEffect(()=>{let fe=!1;if(!te)return console.error("streamlayer sdk key should be provided"),ue(ve=>(ve!==null&&typeof ve.disableApp=="function"&&ve.disableApp(),null)),()=>{fe=!0};const he=La(te,oe,le);if(ie)for(const ve of ie)he.use(ve);return he.ready().then(ve=>{fe||ue(ve.sdk)}).catch(ve=>console.log(ve)),()=>{fe=!0,he.close(function(ve){if(ve)throw ve})}},[te,oe]),ce};var StreamLayerStatus=(te=>(te[te.UNSET=0]="UNSET",te[te.CONNECTED=1]="CONNECTED",te[te.READY=2]="READY",te))(StreamLayerStatus||{});const StreamLayerContext=e$9.createContext({status:0,sdk:null}),StreamLayerProvider=({sdkKey:te,plugins:ie,children:oe,production:le=!0,autoEnable:ce=!0})=>{const ue=useStreamLayerApp(te,ie,le,ce),fe=e$9.useMemo(()=>ue?{sdk:ue,status:2}:{status:1,sdk:null},[ue]);return jsxRuntime.jsx(StreamLayerContext.Provider,{value:fe,children:oe})},MastersStreamLayerProvider=({sdkKey:te,plugins:ie,children:oe,production:le=!0})=>jsxRuntime.jsx(StreamLayerProvider,{sdkKey:te,plugins:ie,production:le,autoEnable:!1,children:oe}),MastersStreamLayerSDKReact=({children:te,overlays:ie})=>{const{sdk:oe,status:le}=e$9.useContext(StreamLayerContext);if(le===StreamLayerStatus.UNSET)throw new Error("Wrap app in `StreamLayerProvider`");return oe?jsxRuntime.jsx("div",{className:"StreamLayerSDK",children:jsxRuntime.jsx(s$3,{style:{height:"100%"},children:jsxRuntime.jsx(Mt$1,{sdk:oe,overlays:ie,children:te})})}):te({})},useStreamLayer=()=>{const{sdk:te}=e$9.useContext(StreamLayerContext);return te},StreamLayerLogin=({token:te,schema:ie})=>{const oe=useStreamLayer();return e$9.useEffect(()=>{te&&ie&&oe&&oe.authorizationBypass(ie,te)},[te,ie,oe]),null},o=te=>te.split(/\s+/).map(ie=>ie[0]).join("").toUpperCase(),i=te=>te?te.toLocaleString("en-US"):"0",a$1=te=>te.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),n$1=te=>te.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),r$1=te=>!isNaN(te.getTime()),a=styled_default("div")({name:"PointsContainer",class:"psiob9b",propsAsIs:!1}),l=styled_default("div")({name:"PointsIcon",class:"p1gqe4lh",propsAsIs:!1}),n=()=>i1,c=styled_default(n())({name:"PointsSvg",class:"p15syg2y",propsAsIs:!0}),r=styled_default("div")({name:"PointsBody",class:"p12n4f2h",propsAsIs:!1}),m=styled_default("div")({name:"PointsTitle",class:"poqmx89",propsAsIs:!1}),P=styled_default("div")({name:"PointsValue",class:"prj9b3v",propsAsIs:!1}),y=({points:te})=>jsxRuntime.jsxs(a,{className:d$a,children:[jsxRuntime.jsx(l,{children:jsxRuntime.jsx(c,{name:"icon-trophy"})}),jsxRuntime.jsxs(r,{children:[jsxRuntime.jsx(m,{children:"Total points"}),jsxRuntime.jsx(P,{children:i(te)})]})]}),StreamLayerSDKPointsProvider=({userSummary:te})=>{const[ie,oe]=e$9.useState(0);return e$9.useEffect(()=>{const le=te.subscribe(ce=>{var ue,fe;(fe=(ue=ce.data)==null?void 0:ue.summary)!=null&&fe.points&&oe(ce.data.summary.points)});return()=>{le()}},[te]),jsxRuntime.jsx("div",{className:"StreamLayerSDK",children:jsxRuntime.jsx(s$3,{children:jsxRuntime.jsx(y,{points:ie})})})},GamificationProvider=({sdk:te})=>{if(useStore(te.sdkStore.status)!=="ready")return null;const oe=te.getFeature(SdkOverlayType.GAMES);return oe?jsxRuntime.jsx(StreamLayerSDKPointsProvider,{userSummary:oe.userSummary.getStore()}):null},StreamLayerSDKPoints=()=>{const te=useStreamLayer();return te?jsxRuntime.jsx(GamificationProvider,{sdk:te}):null};exports.AutoSizer=AutoSizer;exports.E=E$1;exports.MastersStreamLayerProvider=MastersStreamLayerProvider;exports.MastersStreamLayerSDKReact=MastersStreamLayerSDKReact;exports.O=O$1;exports.PickHistoryStatus=PickHistoryStatus;exports.QuestionImages=QuestionImages;exports.QuestionStatus=QuestionStatus;exports.QuestionType=QuestionType;exports.StreamLayerLogin=StreamLayerLogin;exports.StreamLayerSDKPoints=StreamLayerSDKPoints;exports.a=a$1;exports.a$1=a$2;exports.c=c$1;exports.d=d$2;exports.i=i;exports.i1=i1;exports.n=n$1;exports.n$1=n$2;exports.o=o$a;exports.o$1=o;exports.r=r$2;exports.r$1=r$1;exports.styled_default=styled_default;exports.useStore=useStore;exports.w=w$1;
297
+ `).slice(0,2).map(oe=>oe.trim()).join(" -- ")}function ea(){const te={};return te.promise=new Promise((ie,oe)=>{te.resolve=ie,te.reject=oe}),te}function tt(te,ie,oe,le,ce){this.started=!1,this.func=ie,this.opts=oe,this.onFinish=null,this.parent=te,this.timeout=ce===void 0?te._timeout:ce,this.name=Zs(ie,oe),this.isAfter=le,this.q=Ws(te,ta,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Ys(tt,Js);tt.prototype.exec=function(te,ie){const oe=this.func;let le=!1;const ce=this.name;if(this.parent._error&&!this.isAfter){Z("skipping loading of plugin as parent errored and it is not an after",ce),O.process.nextTick(ie);return}if(this.isAfter)this.server=te;else try{this.server=this.parent.override(te,oe,this.opts)}catch(ve){return Z("override errored",ce),ie(ve)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Z("exec",ce);let ue;const fe=ve=>{if(le){Z("loading complete",ce);return}this._error=ve,Z(ve?"exec errored":"exec completed",ce),le=!0,ue&&clearTimeout(ue),ie(ve)};this.timeout>0&&(Z("setting up timeout",ce,this.timeout),ue=setTimeout(function(){Z("timed out",ce),ue=null;const ve=new Xs(ce);ve.fn=oe,fe(ve)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const he=oe(this.server,this.opts,fe);he&&typeof he.then=="function"&&(Z("exec: resolving promise",ce),he.then(()=>O.process.nextTick(fe),ve=>O.process.nextTick(fe,ve)))};tt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const te=()=>{this.server.after((oe,le)=>{this._error=oe,this.q.pause(),oe?(Z("rejecting promise",this.name,oe),this._promise.reject(oe)):(Z("resolving promise",this.name),this._promise.resolve()),this._promise=null,O.process.nextTick(le,oe)}),this.q.resume()};let ie;return this._promise?ie=Promise.resolve():(this._promise=ea(),ie=this._promise.promise,this.server?te():this.on("start",te)),ie};tt.prototype.enqueue=function(te,ie){Z("enqueue",this.name,te.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(te,ie)};tt.prototype.finish=function(te,ie){Z("finish",this.name,te);const oe=()=>{this.loaded||(Z("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,ie(te))};if(te){this._promise&&(this._promise.reject(te),this._promise=null),oe();return}const le=()=>{if(Z("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const ce=()=>{Z("wrap"),queueMicrotask(le)};this._promise.resolve(),this._promise.promise.then(ce,ce),this._promise=null}else oe();else Z("delayed",this.name),this.q.drain=()=>{Z("drain",this.name),this.q.drain=ra,queueMicrotask(le)}};queueMicrotask(le),this.q.resume()};function ta(te,ie){const oe=this;O.process.nextTick(Ir.bind(oe),te,ie)}function Ir(te,ie){if(typeof te.func.then=="function"){te.func.then(le=>{typeof le.default=="function"&&(le=le.default),te.func=le,Ir.call(this,te,ie)},ie);return}const oe=this._current[0];this._current.unshift(te),te.exec(oe&&oe.server||this._server,le=>{te.finish(le,ce=>{this._current.shift(),ie(ce)})})}function ra(){}Er.exports=tt;Er.exports.loadPlugin=Ir;var na=Er.exports;const Gr=fn,ia=wn.EventEmitter,oa=kt.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Wt,AVV_ERR_CALLBACK_NOT_FN:ct,AVV_ERR_PLUGIN_NOT_VALID:sa,AVV_ERR_ROOT_PLG_BOOTED:aa,AVV_ERR_READY_TIMEOUT:ua}=Un,ca=Gs,cr=na,Ze=$n("avvio"),_t=Symbol("kAvvio"),Jt=Symbol("kThenifyDoNotWrap");function fa(te,ie,oe){const le=ie.expose||{},ce=le.use||"use",ue=le.after||"after",fe=le.ready||"ready",he=le.onClose||"onClose",ve=le.close||"close";if(te[ce])throw new Wt(ce);if(te[ue])throw new Wt(ue);if(te[fe])throw new Wt(fe);te[ce]=function(ke,Se){return oe.use(ke,Se),this},Object.defineProperty(te,"then",{get:Dn.bind(oe)}),te[_t]=!0,te[ue]=function(ke){return typeof ke!="function"?oe._loadRegistered():(oe.after(Yt(ke,this)),this)},te[fe]=function(ke){if(ke&&typeof ke!="function")throw new ct(fe,typeof ke);return oe.ready(ke?Yt(ke,this):void 0)},te[he]=function(ke){if(typeof ke!="function")throw new ct(he,typeof ke);return oe.onClose(ya(ke,this)),this},te[ve]=function(ke){if(ke&&typeof ke!="function")throw new ct(ve,typeof ke);return ke?(oe.close(Yt(ke,this)),this):oe.close()}}function ee(te,ie,oe){if(typeof te=="function"&&arguments.length===1&&(oe=te,ie={},te=null),typeof ie=="function"&&(oe=ie,ie={}),ie=ie||{},!(this instanceof ee)){const le=new ee(te,ie,oe);return te&&fa(te,ie,le),le}ie.autostart!==!1&&(ie.autostart=!0),te=te||this,this._timeout=Number(ie.timeout)||0,this._server=te,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),oe&&this.once("start",oe),this.started=!1,this.booted=!1,this.pluginTree=new ca,this._readyQ=Gr(this,jn,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=zr},this._closeQ=Gr(this,da,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=zr},this._doStart=null,this._root=new cr(this,la.bind(this),ie,!1,0),this._root.once("start",(le,ce,ue)=>{const fe=this.pluginTree.start(null,ce,ue);this._root.once("loaded",(he,ve,ke)=>{this.pluginTree.stop(fe,ke)})}),cr.loadPlugin.call(this,this._root,le=>{Ze("root plugin ready");try{this.emit("preReady"),this._root=null}catch(ce){le=le||this._error||ce}if(le){if(this._error=le,this._readyQ.length()===0)throw le}else this.booted=!0;this._readyQ.resume()})}function la(te,ie,oe){this._doStart=oe,ie.autostart&&this.start()}oa(ee,ia);ee.prototype.start=function(){return this.started=!0,O.process.nextTick(this._doStart),this};ee.prototype.override=function(te,ie,oe){return te};function ha(te){if(te&&typeof te=="object"&&typeof te.default=="function"&&(te=te.default),!(te&&(typeof te=="function"||typeof te.then=="function")))throw new sa(typeof te);return te}ee.prototype[_t]=!0;ee.prototype.use=function(te,ie){return this._lastUsed=this._addPlugin(te,ie,!1),this};ee.prototype._loadRegistered=function(){const te=this._current[0];return!this.started&&!this.booted&&O.process.nextTick(()=>this._root.q.resume()),te?te.loadedSoFar():Promise.resolve()};Object.defineProperty(ee.prototype,"then",{get:Dn});ee.prototype._addPlugin=function(te,ie,oe){if(te=ha(te),ie=ie||{},this.booted)throw new aa;const le=this._current[0],ce=new cr(this,te,ie,oe);if(ce.once("start",(ue,fe,he)=>{const ve=this.pluginTree.start(le.name,fe,he);ce.once("loaded",(ke,Se,Me)=>{this.pluginTree.stop(ve,Me)})}),le.loaded)throw new Error(ce.name,le.name);return le.enqueue(ce,ue=>{ue&&(this._error=ue)}),ce};ee.prototype.after=function(te){if(!te)return this._loadRegistered();this._addPlugin(ie.bind(this),{},!0);function ie(oe,le,ce){jn.call(this,te,ce)}return this};ee.prototype.onClose=function(te){if(typeof te!="function")throw new Error("not a function");te[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(te,ie.bind(this));function ie(oe){oe&&(this._error=oe)}return this};ee.prototype.close=function(te){let ie;if(te){if(typeof te!="function")throw new ct("close",typeof te)}else ie=new Promise(function(oe,le){te=function(ce){if(ce)return le(ce);oe()}});return this.ready(()=>{this._error=null,this._closeQ.push(te),O.process.nextTick(this._closeQ.resume.bind(this._closeQ))}),ie};ee.prototype.ready=function(te){if(te){if(typeof te!="function")throw new ct("ready",typeof te);this._readyQ.push(te),queueMicrotask(this.start.bind(this));return}return new Promise((ie,oe)=>{this._readyQ.push(ce),this.start();const le=this._current[0].server;function ce(ue,fe,he){ue?oe(ue):ie(le),O.process.nextTick(he)}})};ee.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};ee.prototype.toJSON=function(){return this.pluginTree.toJSON()};function zr(){}function Dn(){if(this.booted){Ze("thenify returning null because we are already booted");return}if(this[Jt]){this[Jt]=!1;return}return Ze("thenify"),(te,ie)=>this._loadRegistered().then(()=>(this[Jt]=!0,te(this._server)),ie)}function jn(te,ie){const oe=this._server,le=this._error;let ce;if(this._error=null,te.length===0)this._error=le,ce=te(),ce&&!ce[_t]&&typeof ce.then=="function"?ce.then(()=>O.process.nextTick(ie),ue=>O.process.nextTick(ie,ue)):O.process.nextTick(ie);else if(te.length===1)ce=te(le),ce&&!ce[_t]&&typeof ce.then=="function"?ce.then(()=>O.process.nextTick(ie),ue=>O.process.nextTick(ie,ue)):O.process.nextTick(ie);else if(this._timeout===0){const ue=fe=>{this._error=fe,ie(this._error)};te.length===2?te(le,ue):te(le,oe,ue)}else pa.call(this,te,le,oe,ie)}function pa(te,ie,oe,le){const ce=te.name;Ze("setting up ready timeout",ce,this._timeout);let ue=setTimeout(()=>{Ze("timed out",ce),ue=null;const he=new ua(ce);he.fn=te,this._error=he,le(he)},this._timeout);te.length===2?te(ie,fe.bind(this)):te(ie,oe,fe.bind(this));function fe(he){ue&&(clearTimeout(ue),this._error=he,le(this._error))}}function da(te,ie){const oe=this._server,le=te[this._isOnCloseHandlerKey];if(te.length===0||te.length===1){let ce;le?ce=te(oe):ce=te(this._error),ce&&typeof ce.then=="function"?(Ze("resolving close/onClose promise"),ce.then(()=>O.process.nextTick(ie),ue=>O.process.nextTick(ie,ue))):O.process.nextTick(ie)}else te.length===2?te(le?oe:this._error,ie):le?te(oe,ie):te(this._error,oe,ie)}function ya(te,ie){return oe.bind(ie);function oe(le,ce){let ue;te.length===0?(ue=te(),ue&&ue.then?ue.then(function(){O.process.nextTick(ce)},ce):O.process.nextTick(ce)):te.length===1?(ue=te(this),ue&&ue.then?ue.then(function(){O.process.nextTick(ce)},ce):O.process.nextTick(ce)):te(this,ce)}}function Yt(te,ie){return oe.bind(ie);function oe(le,ce){let ue;te?te.length===0?(ue=te(),ue&&ue.then?ue.then(function(){O.process.nextTick(ce,le)},ce):O.process.nextTick(ce,le)):te.length===1?(ue=te(le),ue&&ue.then?ue.then(function(){O.process.nextTick(ce)},ce):O.process.nextTick(ce)):te.length===2?te(le,ce):te(le,this,ce):O.process.nextTick(ce)}}yr.exports=ee;yr.exports.express=function(te){return ee(te,{expose:{use:"load"}})};var ga=yr.exports;const ma=Yn(ga);function La(te,ie=!0,oe=!0){const le=ie?"https://grpc-web.streamlayer.io:443":"https://grpc-web.next.streamlayer.io:443",ce=ma(Object.create({}),{autostart:!1});return ce.use(Bi),ce.use(Ei,{sdkKey:te,host:le}),ce.use(xi),ce.use(Oi),ce.use(co),ce.use(Ji),oe&&ce.after(async(ue,fe,he)=>{if(ue)throw ue;await fe.sdk.initializeApp(),he()}),ce.onClose(()=>{console.log("close")}),ce}const useStreamLayerApp=(te,ie,oe,le)=>{const[ce,ue]=e$9.useState(null);return e$9.useEffect(()=>{let fe=!1;if(!te)return console.error("streamlayer sdk key should be provided"),ue(ve=>(ve!==null&&typeof ve.disableApp=="function"&&ve.disableApp(),null)),()=>{fe=!0};const he=La(te,oe,le);if(ie)for(const ve of ie)he.use(ve);return he.ready().then(ve=>{fe||ue(ve.sdk)}).catch(ve=>console.log(ve)),()=>{fe=!0,he.close(function(ve){if(ve)throw ve})}},[te,oe]),ce};var StreamLayerStatus=(te=>(te[te.UNSET=0]="UNSET",te[te.CONNECTED=1]="CONNECTED",te[te.READY=2]="READY",te))(StreamLayerStatus||{});const StreamLayerContext=e$9.createContext({status:0,sdk:null}),StreamLayerProvider=({sdkKey:te,plugins:ie,children:oe,production:le=!0,autoEnable:ce=!0})=>{const ue=useStreamLayerApp(te,ie,le,ce),fe=e$9.useMemo(()=>ue?{sdk:ue,status:2}:{status:1,sdk:null},[ue]);return jsxRuntime.jsx(StreamLayerContext.Provider,{value:fe,children:oe})},MastersStreamLayerProvider=({sdkKey:te,plugins:ie,children:oe,production:le=!0})=>jsxRuntime.jsx(StreamLayerProvider,{sdkKey:te,plugins:ie,production:le,autoEnable:!1,children:oe}),MastersStreamLayerSDKReact=({children:te,overlays:ie})=>{const{sdk:oe,status:le}=e$9.useContext(StreamLayerContext);if(le===StreamLayerStatus.UNSET)throw new Error("Wrap app in `StreamLayerProvider`");return oe?jsxRuntime.jsx("div",{className:"StreamLayerSDK",children:jsxRuntime.jsx(s$3,{style:{height:"100%"},children:jsxRuntime.jsx(Mt$1,{sdk:oe,overlays:ie,children:te})})}):te({})},useStreamLayer=()=>{const{sdk:te}=e$9.useContext(StreamLayerContext);return te},StreamLayerLogin=({token:te,schema:ie})=>{const oe=useStreamLayer();return e$9.useEffect(()=>{te&&ie&&oe&&oe.authorizationBypass(ie,te)},[te,ie,oe]),null},o=te=>te.split(/\s+/).map(ie=>ie[0]).join("").toUpperCase(),i=te=>te?te.toLocaleString("en-US"):"0",a$1=te=>te.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),n$1=te=>te.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),r$1=te=>!isNaN(te.getTime()),a=styled_default("div")({name:"PointsContainer",class:"psiob9b",propsAsIs:!1}),l=styled_default("div")({name:"PointsIcon",class:"p1gqe4lh",propsAsIs:!1}),n=()=>i1,c=styled_default(n())({name:"PointsSvg",class:"p15syg2y",propsAsIs:!0}),r=styled_default("div")({name:"PointsBody",class:"p12n4f2h",propsAsIs:!1}),m=styled_default("div")({name:"PointsTitle",class:"poqmx89",propsAsIs:!1}),P=styled_default("div")({name:"PointsValue",class:"prj9b3v",propsAsIs:!1}),y=({points:te})=>jsxRuntime.jsxs(a,{className:d$a,children:[jsxRuntime.jsx(l,{children:jsxRuntime.jsx(c,{name:"icon-trophy"})}),jsxRuntime.jsxs(r,{children:[jsxRuntime.jsx(m,{children:"Total points"}),jsxRuntime.jsx(P,{children:i(te)})]})]}),StreamLayerSDKPointsProvider=({userSummary:te})=>{const[ie,oe]=e$9.useState(0);return e$9.useEffect(()=>{const le=te.subscribe(ce=>{var ue,fe;(fe=(ue=ce.data)==null?void 0:ue.summary)!=null&&fe.points&&oe(ce.data.summary.points)});return()=>{le()}},[te]),jsxRuntime.jsx("div",{className:"StreamLayerSDK",children:jsxRuntime.jsx(s$3,{children:jsxRuntime.jsx(y,{points:ie})})})},GamificationProvider=({sdk:te})=>{if(useStore(te.sdkStore.status)!=="ready")return null;const oe=te.getFeature(SdkOverlayType.GAMES);return oe?jsxRuntime.jsx(StreamLayerSDKPointsProvider,{userSummary:oe.userSummary.getStore()}):null},StreamLayerSDKPoints=()=>{const te=useStreamLayer();return te?jsxRuntime.jsx(GamificationProvider,{sdk:te}):null};exports.AutoSizer=AutoSizer;exports.E=E$1;exports.MastersStreamLayerProvider=MastersStreamLayerProvider;exports.MastersStreamLayerSDKReact=MastersStreamLayerSDKReact;exports.O=O$1;exports.PickHistoryStatus=PickHistoryStatus;exports.QuestionImages=QuestionImages;exports.QuestionStatus=QuestionStatus;exports.QuestionType=QuestionType;exports.StreamLayerLogin=StreamLayerLogin;exports.StreamLayerSDKPoints=StreamLayerSDKPoints;exports.a=a$1;exports.a$1=a$2;exports.d=d$2;exports.i=i;exports.i1=i1;exports.n=n$1;exports.n$1=n$2;exports.o=o$a;exports.o$1=o;exports.r=r$2;exports.r$1=r$1;exports.styled_default=styled_default;exports.useStore=useStore;exports.w=w$1;