@streamlayer/react 0.31.12 → 0.32.0

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