@streamlayer/react 0.29.9 → 0.29.10

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";const s=require("react/jsx-runtime"),I=require("./index-89c19a6e.cjs"),o=require("react"),u=require("@streamlayer/sdk-web-types"),y=require("@nanostores/react"),A=require("@streamlayer/sdk-web-interfaces"),e=require("./index-b0206045.cjs"),S=require("@streamlayer/sdk-web-notifications"),V=({feature:t,sdk:a,children:l,className:n})=>{const d=y.useStore(t.status),{slStreamId:r}=y.useStore(a.sdkStore);return r!=null&&r.loading?s.jsx("div",{className:n,children:"event is loading..."}):r!=null&&r.data?d!==A.FeatureStatus.Ready?s.jsx("div",{className:n,children:"wait feature..."}):l:s.jsx("div",{className:n,children:"event is forbidden..."})},K=o.lazy(()=>Promise.resolve().then(()=>require("./index-3ce72dff.cjs"))),H=({sdk:t,feature:a,className:l})=>{const n=o.useMemo(()=>a&&a.featureConfig.get().type===u.FeatureType.GAMES?s.jsx(V,{className:l,sdk:t,feature:a,children:s.jsx(K,{className:l,gamification:a,sdk:t})}):null,[t,a,l]);return s.jsx(o.Suspense,{fallback:s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"page loading..."}),children:n})};const J=e.styled_default("button")({name:"e",class:"enu64b2",propsAsIs:!1}),X=e.styled_default("span")({name:"t",class:"tw2meku",propsAsIs:!1}),Z=e.styled_default("span")({name:"a",class:"aka8vam",propsAsIs:!1}),N=({disabled:t,active:a,onClick:l,label:n,icon:d})=>s.jsx(J,{onClick:l,disabled:t,"data-selected":a,children:s.jsxs(s.Fragment,{children:[d&&s.jsx(X,{children:d}),s.jsx(Z,{children:n})]})});const ss=()=>e.C1,es=e.styled_default(ss())({name:"a",class:"a10lggiw",propsAsIs:!0}),g="channels",ts=t=>{var a;return s.jsx(N,{...t,id:"channels",label:"Channels",icon:s.jsx(es,{name:"icon-btn-channels","data-selected":(a=t.active)==null?void 0:a.toString()})})};const as=()=>e.C1,ls=e.styled_default(as())({name:"d",class:"d1x5s8ie",propsAsIs:!0}),f="featuredGroups",ns=t=>{var a;return s.jsx(N,{...t,label:"FG+",id:"featuredGroups",icon:s.jsx(ls,{name:"icon-btn-feature-groups","data-selected":(a=t.active)==null?void 0:a.toString()})})};const rs=()=>e.C1,ds=e.styled_default(rs())({name:"n",class:"ntav86o",propsAsIs:!0}),k="leaderboard",cs=t=>{var a;return s.jsx(N,{...t,label:"Leader Board",id:"leaderboard",icon:s.jsx(ds,{name:"icon-btn-leaderboard","data-selected":(a=t.active)==null?void 0:a.toString()})})};const is=e.styled_default("div")({name:"n",class:"n1rlvhvz",propsAsIs:!1}),os=({children:t,className:a})=>s.jsx(is,{className:a,children:t});const us=()=>os,ps=e.styled_default(us())({name:"n",class:"n9bnom",propsAsIs:!0}),xs=({activeOverlay:t,setActiveOverlay:a,sdkReady:l,className:n})=>s.jsxs(ps,{className:n,children:[s.jsx(ts,{active:t===g,onClick:()=>a(g)}),s.jsx(ns,{active:t===f,disabled:!l,onClick:()=>{a(f)}}),s.jsx(cs,{active:t===k,onClick:()=>a(k)})]}),M={[u.QuestionType.TWEET]:{label:"Insight",iconName:"icon-insight"},[u.QuestionType.PROMOTION]:{label:"Insight",iconName:"icon-insight"},[u.QuestionType.UNSET]:void 0,[u.QuestionType.FACTOID]:{label:"Insight",iconName:"icon-insight"},[u.QuestionType.POLL]:{label:"Poll",iconName:"icon-poll"},[u.QuestionType.TRIVIA]:{label:"Trivia",iconName:"icon-trivia"},[u.QuestionType.PREDICTION]:{label:"Prediction",iconName:"icon-prediction"}};const fs=e.styled_default("div")({name:"i",class:"i1bwjtdb",propsAsIs:!1}),js=e.styled_default("video")({name:"e",class:"enb7moc",propsAsIs:!1}),ys=e.styled_default("img")({name:"r",class:"r1ws5lyh",propsAsIs:!1}),ms=e.styled_default("div")({name:"s",class:"soibf55",propsAsIs:!1}),U=({poster:t,source:a})=>{const l=o.useRef(null),[n,d]=o.useState(!1),[r,c]=o.useState(!0);return s.jsxs(fs,{onClick:()=>{const i=l==null?void 0:l.current;i&&d(j=>j?(i.pause(),!1):(i.play(),c(!1),!0))},children:[s.jsx(js,{ref:l,src:a,onEnded:()=>{var i;(i=l==null?void 0:l.current)==null||i.load(),d(!1),c(!0)},style:{visibility:r?"hidden":"visible"}}),s.jsx(ys,{src:t,style:{visibility:r?"visible":"hidden"}}),s.jsx(ms,{children:!n&&s.jsx(e.C1,{name:"icon-play"})})]})};const hs=e.styled_default("div")({name:"r",class:"rcr31jh",propsAsIs:!1}),vs=e.styled_default("div")({name:"i",class:"ihj4z8w",propsAsIs:!1}),_s=e.styled_default("h3")({name:"t",class:"t1oks4sz",propsAsIs:!1}),Is=e.styled_default("div")({name:"n",class:"n18s3mno",propsAsIs:!1}),As=e.styled_default("button")({name:"l",class:"lc8mqwv",propsAsIs:!1}),$s=({video:t,heading:a,body:l,action:n})=>s.jsxs(hs,{children:[(t==null?void 0:t.url)&&s.jsx(U,{source:t.url,poster:t.thumbnailUrl}),s.jsxs(vs,{children:[s.jsx(_s,{children:a}),s.jsx(Is,{children:l}),n&&s.jsx(As,{onClick:n,children:"View Insight"})]})]});const gs=()=>p,bs=()=>p,ks=()=>p,Ss=()=>p,Ts=()=>p,ws=()=>p,Ns=()=>p,Cs=()=>p,Es=()=>p,Fs=()=>p,qs=()=>p,Os=()=>p,Ls=()=>p,Rs=()=>p,h=e.styled_default("div")({name:"o",class:"oeeit6",propsAsIs:!1}),p=e.styled_default("div")({name:"e",class:"e1v245rb",propsAsIs:!1}),zs=e.styled_default(gs())({name:"n",class:"neiocf7",propsAsIs:!0}),Ps=e.styled_default(bs())({name:"t",class:"t1vmkqme",propsAsIs:!0}),Qs=e.styled_default(ks())({name:"r",class:"r1ln3ryw",propsAsIs:!0}),C=e.styled_default(Ss())({name:"a",class:"a1s6rgzs",propsAsIs:!0}),E=e.styled_default(Ts())({name:"h",class:"h13kvn19",propsAsIs:!0}),F=e.styled_default(ws())({name:"d",class:"dcrmlko",propsAsIs:!0}),q=e.styled_default(Ns())({name:"m",class:"m16755u3",propsAsIs:!0}),O=e.styled_default(Cs())({name:"c",class:"cdwashk",propsAsIs:!0}),L=e.styled_default(Es())({name:"w",class:"w1lh1meo",propsAsIs:!0}),R=e.styled_default(Fs())({name:"p",class:"p1y0qeoo",propsAsIs:!0}),Ds=e.styled_default(qs())({name:"L",class:"l1wanjqa",propsAsIs:!0}),Gs=e.styled_default(Os())({name:"l",class:"l1aaziu",propsAsIs:!0}),Ms=e.styled_default(Ls())({name:"f",class:"fwkppnn",propsAsIs:!0}),Us=e.styled_default(Rs())({name:"u",class:"uw10l4r",propsAsIs:!0}),Ws=({step:t,correct:a})=>s.jsxs(s.Fragment,{children:[s.jsxs(h,{"data-active":t===1,"data-first-screen":"true",children:[s.jsx(zs,{}),s.jsx(Ps,{}),s.jsx(Qs,{})]}),s.jsxs(h,{"data-active":t===2,children:[s.jsx(C,{}),s.jsx(E,{}),s.jsx(F,{})]}),s.jsxs(h,{"data-active":t===3,children:[s.jsx(C,{}),s.jsx(E,{}),s.jsx(F,{})]}),a?s.jsxs(s.Fragment,{children:[s.jsxs(h,{"data-active":t===4,"data-correct":"false",children:[s.jsx(q,{}),s.jsx(O,{}),s.jsx(L,{}),s.jsx(R,{})]}),s.jsxs(h,{"data-active":t===5,"data-correct":"false","data-last-screen":"true",children:[s.jsx(q,{}),s.jsx(O,{}),s.jsx(L,{}),s.jsx(R,{})]})]}):s.jsxs(h,{"data-active":t===4,"data-correct":"false","data-last-screen":"true",children:[s.jsx(Ds,{}),s.jsx(Gs,{}),s.jsx(Ms,{}),s.jsx(Us,{})]})]});const Ys=()=>$,Bs=()=>e.C1,Vs=()=>e.C1,Ks=e.styled_default("div")({name:"c",class:"c1iwvsrd",propsAsIs:!1}),Hs=e.styled_default("div")({name:"s",class:"s16ztc4y",propsAsIs:!1}),v=e.styled_default("div")({name:"l",class:"lpu10kq",propsAsIs:!1}),_=e.styled_default("div")({name:"p",class:"pv9ujcb",propsAsIs:!1}),$=e.styled_default("div")({name:"o",class:"ow7lyj4",propsAsIs:!1}),z=e.styled_default(Ys())({name:"d",class:"d1xtwn2m",propsAsIs:!0}),b=e.styled_default("div")({name:"f",class:"f1bvvudl",propsAsIs:!1}),T=e.styled_default(Bs())({name:"g",class:"g56gji0",propsAsIs:!0}),P=e.styled_default("button")({name:"x",class:"x8gvwg8",propsAsIs:!1}),Q=e.styled_default(Vs())({name:"u",class:"uckrlxs",propsAsIs:!0}),Js=({close:t,votedAnswer:a,correct:l,correctAnswerTitle:n})=>{const[d,r]=o.useState(1);return o.useEffect(()=>{const c=setInterval(()=>{r(i=>l&&i>4||!l&&i>3?i:++i)},6e3);return()=>clearInterval(c)},[l]),s.jsxs(Ks,{"data-bg-color-white":d>3,children:[s.jsx(Ws,{step:d,correct:l}),s.jsxs(Hs,{"data-active-number":d,children:[s.jsxs(v,{children:[s.jsx(_,{children:"Master"}),s.jsx(z,{children:"FEATURED GROUPS +"})]}),s.jsxs(v,{children:[s.jsx(_,{children:"Prediction results are in!"}),s.jsx(z,{children:"FEATURED GROUPS +"})]}),s.jsxs(v,{children:[s.jsx(_,{children:"Who holds the most birdies in golf?"}),s.jsxs($,{children:["Your Pick: ",s.jsx(b,{children:a==null?void 0:a.title})]})]}),l?s.jsxs(s.Fragment,{children:[s.jsxs(v,{"data-color-green":"true",children:[s.jsx(_,{children:"Congratulations! You answered correctly."}),s.jsxs($,{children:[s.jsx(T,{name:"selected"}),"Your Pick: ",s.jsx(b,{children:a==null?void 0:a.title})]})]}),s.jsxs(v,{"data-color-green":"true",children:[s.jsx(P,{onClick:t,children:s.jsx(Q,{name:"icon-cross"})}),s.jsxs(_,{children:["+",a==null?void 0:a.points," points"]}),s.jsxs($,{children:[s.jsx(T,{name:"selected"}),"Your Pick: ",s.jsx(b,{children:a==null?void 0:a.title})]})]})]}):s.jsxs(v,{children:[s.jsx(P,{onClick:t,children:s.jsx(Q,{name:"icon-cross"})}),s.jsxs(_,{"data-incorrect":"true",children:["Better luck next time! Correct: ",n,"."]}),s.jsxs($,{"data-incorrect":"true",children:[s.jsx(T,{name:"circleClose"}),"Your Pick: ",s.jsx(b,{children:a==null?void 0:a.title})]})]})]})]})};const Xs=()=>e.C1,Zs=()=>e.C1,se=e.styled_default("div")({name:"p",class:"p16oo5uk",propsAsIs:!1}),ee=e.styled_default("div")({name:"a",class:"a18c5k3h",propsAsIs:!1}),te=e.styled_default(Xs())({name:"c",class:"czv5t8k",propsAsIs:!0}),ae=e.styled_default("div")({name:"s",class:"s1wp1emp",propsAsIs:!1}),le=e.styled_default(Zs())({name:"l",class:"l1nz0q6x",propsAsIs:!0}),ne=e.styled_default("span")({name:"g",class:"g1jhb9lu",propsAsIs:!1}),re=e.styled_default("div")({name:"d",class:"ds6gfsv",propsAsIs:!1}),de=e.styled_default("button")({name:"x",class:"xkzz16s",propsAsIs:!1});const ce=e.styled_default("div")({name:"i",class:"i1j5f618",propsAsIs:!1}),ie=e.styled_default("div")({name:"n",class:"n1fqaem9",propsAsIs:!1}),oe=e.styled_default("img")({name:"o",class:"o1jovu9m",propsAsIs:!1}),ue=e.styled_default("div")({name:"a",class:"a12ibiz8",propsAsIs:!1}),pe=e.styled_default("div")({name:"r",class:"r1r4eua",propsAsIs:!1}),xe=e.styled_default("div")({name:"l",class:"l1ymr3ce",propsAsIs:!1}),fe=({image:t,name:a,userName:l,verified:n})=>s.jsxs(ce,{children:[s.jsx(ie,{children:s.jsx(oe,{src:t})}),s.jsxs(ue,{children:[s.jsxs(pe,{children:[a," ",n&&s.jsx(e.C1,{name:"icon-twitter-verified"})]}),s.jsx(xe,{children:l})]})]});const je=e.styled_default("div")({name:"t",class:"tfx5umz",propsAsIs:!1}),ye=e.styled_default("button")({name:"e",class:"e1a1fcxr",propsAsIs:!1}),me=e.styled_default("div")({name:"i",class:"i1iknwgy",propsAsIs:!1}),he=e.styled_default("img")({name:"n",class:"n1uc9lmn",propsAsIs:!1}),ve=e.styled_default("div")({name:"a",class:"ae4b7qd",propsAsIs:!1}),_e=e.styled_default("div")({name:"l",class:"l1udpjlr",propsAsIs:!1}),Ie=e.styled_default("blockquote")({name:"d",class:"d7ui2j0",propsAsIs:!1}),Ae=({account:t,body:a,image:l,title:n,action:d})=>s.jsxs(je,{children:[s.jsx(_e,{children:s.jsx(Ie,{children:n})}),s.jsxs(ve,{children:[s.jsx(fe,{...t}),s.jsx(me,{children:a}),l&&s.jsx(he,{src:l})]}),d&&s.jsx(ye,{onClick:d,children:"View Tweet"})]}),D=({close:t,action:a,data:{questionType:l,question:n,insight:d,tweet:r}})=>{const c=M[l];return c?n!=null&&n.predictionResult?s.jsx(Js,{close:t,...n}):s.jsxs(se,{children:[s.jsx(ee,{onClick:t,children:s.jsx(te,{name:"icon-cross"})}),l!==u.QuestionType.TWEET&&s.jsxs(ae,{children:[s.jsx(le,{name:c.iconName}),s.jsx(ne,{children:c.label})]}),l===u.QuestionType.FACTOID&&s.jsx($s,{...d,action:a}),l===u.QuestionType.TWEET&&s.jsx(Ae,{...r,action:a}),l!==u.QuestionType.FACTOID&&l!==u.QuestionType.TWEET&&s.jsxs(s.Fragment,{children:[s.jsx(re,{children:n==null?void 0:n.title}),s.jsx(de,{onClick:a,children:"Answer"})]})]}):null};const $e=e.styled_default("div")({name:"s",class:"s1aopxp8",propsAsIs:!1}),ge="c1t0h6s",W=({children:t,style:a,className:l,hiding:n})=>s.jsx($e,{style:a,className:e.cx_default(l,n&&ge),children:t});const be=()=>W,G=e.styled_default(be())({name:"d",class:"d1qqtt3e",propsAsIs:!0}),ke=({sdk:t})=>{const a=t.getNotificationsStore(),l=y.useStore(a),n=o.useMemo(()=>{if(!(l!=null&&l.size))return null;for(const d of l.values())if(d.type===S.NotificationType.ONBOARDING)return d;return l.values().next().value},[l]);return(n==null?void 0:n.type)===S.NotificationType.QUESTION?s.jsx(G,{hiding:n.hiding,children:s.jsx("div",{children:s.jsx(D,{...n})})}):(n==null?void 0:n.type)===S.NotificationType.QUESTION_RESOLVED?s.jsx(G,{hiding:n.hiding,children:s.jsx("div",{children:s.jsx(D,{...n})})}):null};const Se=()=>Y,Te=e.styled_default("div")({name:"i",class:"idhrx8x",propsAsIs:!1}),w=e.styled_default("div")({name:"r",class:"r1k6v4ep",propsAsIs:!1}),Y=e.styled_default("div")({name:"n",class:"n1v8kucd",propsAsIs:!1}),we=e.styled_default(Se())({name:"e",class:"e16yw7z1",propsAsIs:!0}),Ne=t=>{const[a,l]=o.useState(!1),n=y.useStore(t.status),{data:d}=y.useStore(t.getUserStore()),r=n==="ready",[c,i]=o.useState(f),j=o.useCallback((x,m)=>{i(m),m===f?(x&&t.createEventSession(x),t.openFeature(u.FeatureType.GAMES)):t.closeFeature()},[t]);return o.useEffect(()=>{!r&&c===f&&(i(g),t.closeFeature())},[r,c,t]),{sdkEnabled:a,sdkReady:r,activeOverlay:c,activateAndLoadOverlay:j,enableSdk:x=>{t.initializeApp().then(({enabled:m,err:B})=>{if(l(!0),B){j(x,g);return}if(m){j(x,f);return}})},disableSdk:()=>{l(!1),t.disableApp()},isLogged:!!d}},Ce=t=>{const a=y.useStore(t.getActiveFeature()),l=y.useStore(t.streamStore()),[n,d]=o.useState(null);return o.useEffect(()=>{const r=t.getFeatures();if(a)for(const[c,i]of r)c===a?i.status.get()===A.FeatureStatus.Suspended&&(i.enable(),d(i)):i.status.get()===A.FeatureStatus.Ready&&i.disable();else{for(const[,c]of r)c.status.get()===A.FeatureStatus.Ready&&c.disable();d(null)}return()=>{for(const[,c]of r)c.status.get()===A.FeatureStatus.Ready&&c.disable()}},[a,t,l]),[a,n]},Ee=({sdk:t,className:a})=>{const[,l]=Ce(t);return s.jsx(H,{className:a,feature:l,sdk:t})},Fe=({sdk:t,overlays:a,children:l})=>{const{sdkEnabled:n,sdkReady:d,activeOverlay:r,activateAndLoadOverlay:c,enableSdk:i,disableSdk:j,isLogged:x}=Ne(t);return s.jsxs(Te,{children:[n&&s.jsx(xs,{sdkReady:d,activeOverlay:r,className:I.f,setActiveOverlay:m=>c("",m)}),n&&s.jsx(ke,{sdk:t}),s.jsx(w,{"data-nav":n.toString(),style:{display:!n||r===g?"block":"none"},children:l&&l({enableSdk:i,disableSdk:j})}),s.jsx(w,{"data-nav":n.toString(),style:{display:r===k?"block":"none"},children:a&&r===k&&a[r]}),x&&n&&r===f&&s.jsx(Ee,{className:I.f,sdk:t}),!x&&n&&r===f&&s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"You are not logged in."})]})},qe=({sdkKey:t,plugins:a,children:l,production:n=!0})=>s.jsx(I.StreamLayerProvider,{sdkKey:t,plugins:a,production:n,autoEnable:!1,children:l}),Oe=({children:t,overlays:a})=>{const{sdk:l,status:n}=o.useContext(I.StreamLayerContext);if(n===I.StreamLayerStatus.UNSET)throw new Error("Wrap app in `StreamLayerProvider`");return l?s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(I.p,{style:{height:"100%"},children:s.jsx(Fe,{sdk:l,overlays:a,children:t})})}):t({})};exports.MastersStreamLayerProvider=qe;exports.MastersStreamLayerSDKReact=Oe;exports.e=we;exports.f=W;exports.n=Y;exports.o=M;exports.r=w;exports.w=U;
1
+ "use strict";const s=require("react/jsx-runtime"),I=require("./index-89c19a6e.cjs"),o=require("react"),u=require("@streamlayer/sdk-web-types"),y=require("@nanostores/react"),A=require("@streamlayer/sdk-web-interfaces"),e=require("./index-b0206045.cjs"),S=require("@streamlayer/sdk-web-notifications"),V=({feature:t,sdk:a,children:l,className:n})=>{const d=y.useStore(t.status),{slStreamId:r}=y.useStore(a.sdkStore);return r!=null&&r.loading?s.jsx("div",{className:n,children:"event is loading..."}):r!=null&&r.data?d!==A.FeatureStatus.Ready?s.jsx("div",{className:n,children:"wait feature..."}):l:s.jsx("div",{className:n,children:"event is forbidden..."})},K=o.lazy(()=>Promise.resolve().then(()=>require("./index-3f5c6152.cjs"))),H=({sdk:t,feature:a,className:l})=>{const n=o.useMemo(()=>a&&a.featureConfig.get().type===u.FeatureType.GAMES?s.jsx(V,{className:l,sdk:t,feature:a,children:s.jsx(K,{className:l,gamification:a,sdk:t})}):null,[t,a,l]);return s.jsx(o.Suspense,{fallback:s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"page loading..."}),children:n})};const J=e.styled_default("button")({name:"e",class:"enu64b2",propsAsIs:!1}),X=e.styled_default("span")({name:"t",class:"tw2meku",propsAsIs:!1}),Z=e.styled_default("span")({name:"a",class:"aka8vam",propsAsIs:!1}),N=({disabled:t,active:a,onClick:l,label:n,icon:d})=>s.jsx(J,{onClick:l,disabled:t,"data-selected":a,children:s.jsxs(s.Fragment,{children:[d&&s.jsx(X,{children:d}),s.jsx(Z,{children:n})]})});const ss=()=>e.C1,es=e.styled_default(ss())({name:"a",class:"a10lggiw",propsAsIs:!0}),g="channels",ts=t=>{var a;return s.jsx(N,{...t,id:"channels",label:"Channels",icon:s.jsx(es,{name:"icon-btn-channels","data-selected":(a=t.active)==null?void 0:a.toString()})})};const as=()=>e.C1,ls=e.styled_default(as())({name:"d",class:"d1x5s8ie",propsAsIs:!0}),f="featuredGroups",ns=t=>{var a;return s.jsx(N,{...t,label:"FG+",id:"featuredGroups",icon:s.jsx(ls,{name:"icon-btn-feature-groups","data-selected":(a=t.active)==null?void 0:a.toString()})})};const rs=()=>e.C1,ds=e.styled_default(rs())({name:"n",class:"ntav86o",propsAsIs:!0}),k="leaderboard",cs=t=>{var a;return s.jsx(N,{...t,label:"Leader Board",id:"leaderboard",icon:s.jsx(ds,{name:"icon-btn-leaderboard","data-selected":(a=t.active)==null?void 0:a.toString()})})};const is=e.styled_default("div")({name:"n",class:"n1rlvhvz",propsAsIs:!1}),os=({children:t,className:a})=>s.jsx(is,{className:a,children:t});const us=()=>os,ps=e.styled_default(us())({name:"n",class:"n9bnom",propsAsIs:!0}),xs=({activeOverlay:t,setActiveOverlay:a,sdkReady:l,className:n})=>s.jsxs(ps,{className:n,children:[s.jsx(ts,{active:t===g,onClick:()=>a(g)}),s.jsx(ns,{active:t===f,disabled:!l,onClick:()=>{a(f)}}),s.jsx(cs,{active:t===k,onClick:()=>a(k)})]}),M={[u.QuestionType.TWEET]:{label:"Insight",iconName:"icon-insight"},[u.QuestionType.PROMOTION]:{label:"Insight",iconName:"icon-insight"},[u.QuestionType.UNSET]:void 0,[u.QuestionType.FACTOID]:{label:"Insight",iconName:"icon-insight"},[u.QuestionType.POLL]:{label:"Poll",iconName:"icon-poll"},[u.QuestionType.TRIVIA]:{label:"Trivia",iconName:"icon-trivia"},[u.QuestionType.PREDICTION]:{label:"Prediction",iconName:"icon-prediction"}};const fs=e.styled_default("div")({name:"i",class:"i1bwjtdb",propsAsIs:!1}),js=e.styled_default("video")({name:"e",class:"enb7moc",propsAsIs:!1}),ys=e.styled_default("img")({name:"r",class:"r1ws5lyh",propsAsIs:!1}),ms=e.styled_default("div")({name:"s",class:"soibf55",propsAsIs:!1}),U=({poster:t,source:a})=>{const l=o.useRef(null),[n,d]=o.useState(!1),[r,c]=o.useState(!0);return s.jsxs(fs,{onClick:()=>{const i=l==null?void 0:l.current;i&&d(j=>j?(i.pause(),!1):(i.play(),c(!1),!0))},children:[s.jsx(js,{ref:l,src:a,onEnded:()=>{var i;(i=l==null?void 0:l.current)==null||i.load(),d(!1),c(!0)},style:{visibility:r?"hidden":"visible"}}),s.jsx(ys,{src:t,style:{visibility:r?"visible":"hidden"}}),s.jsx(ms,{children:!n&&s.jsx(e.C1,{name:"icon-play"})})]})};const hs=e.styled_default("div")({name:"r",class:"rcr31jh",propsAsIs:!1}),vs=e.styled_default("div")({name:"i",class:"ihj4z8w",propsAsIs:!1}),_s=e.styled_default("h3")({name:"t",class:"t1oks4sz",propsAsIs:!1}),Is=e.styled_default("div")({name:"n",class:"n18s3mno",propsAsIs:!1}),As=e.styled_default("button")({name:"l",class:"lc8mqwv",propsAsIs:!1}),$s=({video:t,heading:a,body:l,action:n})=>s.jsxs(hs,{children:[(t==null?void 0:t.url)&&s.jsx(U,{source:t.url,poster:t.thumbnailUrl}),s.jsxs(vs,{children:[s.jsx(_s,{children:a}),s.jsx(Is,{children:l}),n&&s.jsx(As,{onClick:n,children:"View Insight"})]})]});const gs=()=>p,bs=()=>p,ks=()=>p,Ss=()=>p,Ts=()=>p,ws=()=>p,Ns=()=>p,Cs=()=>p,Es=()=>p,Fs=()=>p,qs=()=>p,Os=()=>p,Ls=()=>p,Rs=()=>p,h=e.styled_default("div")({name:"o",class:"oeeit6",propsAsIs:!1}),p=e.styled_default("div")({name:"e",class:"e1v245rb",propsAsIs:!1}),zs=e.styled_default(gs())({name:"n",class:"neiocf7",propsAsIs:!0}),Ps=e.styled_default(bs())({name:"t",class:"t1vmkqme",propsAsIs:!0}),Qs=e.styled_default(ks())({name:"r",class:"r1ln3ryw",propsAsIs:!0}),C=e.styled_default(Ss())({name:"a",class:"a1s6rgzs",propsAsIs:!0}),E=e.styled_default(Ts())({name:"h",class:"h13kvn19",propsAsIs:!0}),F=e.styled_default(ws())({name:"d",class:"dcrmlko",propsAsIs:!0}),q=e.styled_default(Ns())({name:"m",class:"m16755u3",propsAsIs:!0}),O=e.styled_default(Cs())({name:"c",class:"cdwashk",propsAsIs:!0}),L=e.styled_default(Es())({name:"w",class:"w1lh1meo",propsAsIs:!0}),R=e.styled_default(Fs())({name:"p",class:"p1y0qeoo",propsAsIs:!0}),Ds=e.styled_default(qs())({name:"L",class:"l1wanjqa",propsAsIs:!0}),Gs=e.styled_default(Os())({name:"l",class:"l1aaziu",propsAsIs:!0}),Ms=e.styled_default(Ls())({name:"f",class:"fwkppnn",propsAsIs:!0}),Us=e.styled_default(Rs())({name:"u",class:"uw10l4r",propsAsIs:!0}),Ws=({step:t,correct:a})=>s.jsxs(s.Fragment,{children:[s.jsxs(h,{"data-active":t===1,"data-first-screen":"true",children:[s.jsx(zs,{}),s.jsx(Ps,{}),s.jsx(Qs,{})]}),s.jsxs(h,{"data-active":t===2,children:[s.jsx(C,{}),s.jsx(E,{}),s.jsx(F,{})]}),s.jsxs(h,{"data-active":t===3,children:[s.jsx(C,{}),s.jsx(E,{}),s.jsx(F,{})]}),a?s.jsxs(s.Fragment,{children:[s.jsxs(h,{"data-active":t===4,"data-correct":"false",children:[s.jsx(q,{}),s.jsx(O,{}),s.jsx(L,{}),s.jsx(R,{})]}),s.jsxs(h,{"data-active":t===5,"data-correct":"false","data-last-screen":"true",children:[s.jsx(q,{}),s.jsx(O,{}),s.jsx(L,{}),s.jsx(R,{})]})]}):s.jsxs(h,{"data-active":t===4,"data-correct":"false","data-last-screen":"true",children:[s.jsx(Ds,{}),s.jsx(Gs,{}),s.jsx(Ms,{}),s.jsx(Us,{})]})]});const Ys=()=>$,Bs=()=>e.C1,Vs=()=>e.C1,Ks=e.styled_default("div")({name:"c",class:"c1iwvsrd",propsAsIs:!1}),Hs=e.styled_default("div")({name:"s",class:"s16ztc4y",propsAsIs:!1}),v=e.styled_default("div")({name:"l",class:"lpu10kq",propsAsIs:!1}),_=e.styled_default("div")({name:"p",class:"pv9ujcb",propsAsIs:!1}),$=e.styled_default("div")({name:"o",class:"ow7lyj4",propsAsIs:!1}),z=e.styled_default(Ys())({name:"d",class:"d1xtwn2m",propsAsIs:!0}),b=e.styled_default("div")({name:"f",class:"f1bvvudl",propsAsIs:!1}),T=e.styled_default(Bs())({name:"g",class:"g56gji0",propsAsIs:!0}),P=e.styled_default("button")({name:"x",class:"x8gvwg8",propsAsIs:!1}),Q=e.styled_default(Vs())({name:"u",class:"uckrlxs",propsAsIs:!0}),Js=({close:t,votedAnswer:a,correct:l,correctAnswerTitle:n})=>{const[d,r]=o.useState(1);return o.useEffect(()=>{const c=setInterval(()=>{r(i=>l&&i>4||!l&&i>3?i:++i)},6e3);return()=>clearInterval(c)},[l]),s.jsxs(Ks,{"data-bg-color-white":d>3,children:[s.jsx(Ws,{step:d,correct:l}),s.jsxs(Hs,{"data-active-number":d,children:[s.jsxs(v,{children:[s.jsx(_,{children:"Master"}),s.jsx(z,{children:"FEATURED GROUPS +"})]}),s.jsxs(v,{children:[s.jsx(_,{children:"Prediction results are in!"}),s.jsx(z,{children:"FEATURED GROUPS +"})]}),s.jsxs(v,{children:[s.jsx(_,{children:"Who holds the most birdies in golf?"}),s.jsxs($,{children:["Your Pick: ",s.jsx(b,{children:a==null?void 0:a.title})]})]}),l?s.jsxs(s.Fragment,{children:[s.jsxs(v,{"data-color-green":"true",children:[s.jsx(_,{children:"Congratulations! You answered correctly."}),s.jsxs($,{children:[s.jsx(T,{name:"selected"}),"Your Pick: ",s.jsx(b,{children:a==null?void 0:a.title})]})]}),s.jsxs(v,{"data-color-green":"true",children:[s.jsx(P,{onClick:t,children:s.jsx(Q,{name:"icon-cross"})}),s.jsxs(_,{children:["+",a==null?void 0:a.points," points"]}),s.jsxs($,{children:[s.jsx(T,{name:"selected"}),"Your Pick: ",s.jsx(b,{children:a==null?void 0:a.title})]})]})]}):s.jsxs(v,{children:[s.jsx(P,{onClick:t,children:s.jsx(Q,{name:"icon-cross"})}),s.jsxs(_,{"data-incorrect":"true",children:["Better luck next time! Correct: ",n,"."]}),s.jsxs($,{"data-incorrect":"true",children:[s.jsx(T,{name:"circleClose"}),"Your Pick: ",s.jsx(b,{children:a==null?void 0:a.title})]})]})]})]})};const Xs=()=>e.C1,Zs=()=>e.C1,se=e.styled_default("div")({name:"p",class:"p16oo5uk",propsAsIs:!1}),ee=e.styled_default("div")({name:"a",class:"a18c5k3h",propsAsIs:!1}),te=e.styled_default(Xs())({name:"c",class:"czv5t8k",propsAsIs:!0}),ae=e.styled_default("div")({name:"s",class:"s1wp1emp",propsAsIs:!1}),le=e.styled_default(Zs())({name:"l",class:"l1nz0q6x",propsAsIs:!0}),ne=e.styled_default("span")({name:"g",class:"g1jhb9lu",propsAsIs:!1}),re=e.styled_default("div")({name:"d",class:"ds6gfsv",propsAsIs:!1}),de=e.styled_default("button")({name:"x",class:"xkzz16s",propsAsIs:!1});const ce=e.styled_default("div")({name:"i",class:"i1j5f618",propsAsIs:!1}),ie=e.styled_default("div")({name:"n",class:"n1fqaem9",propsAsIs:!1}),oe=e.styled_default("img")({name:"o",class:"o1jovu9m",propsAsIs:!1}),ue=e.styled_default("div")({name:"a",class:"a12ibiz8",propsAsIs:!1}),pe=e.styled_default("div")({name:"r",class:"r1r4eua",propsAsIs:!1}),xe=e.styled_default("div")({name:"l",class:"l1ymr3ce",propsAsIs:!1}),fe=({image:t,name:a,userName:l,verified:n})=>s.jsxs(ce,{children:[s.jsx(ie,{children:s.jsx(oe,{src:t})}),s.jsxs(ue,{children:[s.jsxs(pe,{children:[a," ",n&&s.jsx(e.C1,{name:"icon-twitter-verified"})]}),s.jsx(xe,{children:l})]})]});const je=e.styled_default("div")({name:"t",class:"tfx5umz",propsAsIs:!1}),ye=e.styled_default("button")({name:"e",class:"e1a1fcxr",propsAsIs:!1}),me=e.styled_default("div")({name:"i",class:"i1iknwgy",propsAsIs:!1}),he=e.styled_default("img")({name:"n",class:"n1uc9lmn",propsAsIs:!1}),ve=e.styled_default("div")({name:"a",class:"ae4b7qd",propsAsIs:!1}),_e=e.styled_default("div")({name:"l",class:"l1udpjlr",propsAsIs:!1}),Ie=e.styled_default("blockquote")({name:"d",class:"d7ui2j0",propsAsIs:!1}),Ae=({account:t,body:a,image:l,title:n,action:d})=>s.jsxs(je,{children:[s.jsx(_e,{children:s.jsx(Ie,{children:n})}),s.jsxs(ve,{children:[s.jsx(fe,{...t}),s.jsx(me,{children:a}),l&&s.jsx(he,{src:l})]}),d&&s.jsx(ye,{onClick:d,children:"View Tweet"})]}),D=({close:t,action:a,data:{questionType:l,question:n,insight:d,tweet:r}})=>{const c=M[l];return c?n!=null&&n.predictionResult?s.jsx(Js,{close:t,...n}):s.jsxs(se,{children:[s.jsx(ee,{onClick:t,children:s.jsx(te,{name:"icon-cross"})}),l!==u.QuestionType.TWEET&&s.jsxs(ae,{children:[s.jsx(le,{name:c.iconName}),s.jsx(ne,{children:c.label})]}),l===u.QuestionType.FACTOID&&s.jsx($s,{...d,action:a}),l===u.QuestionType.TWEET&&s.jsx(Ae,{...r,action:a}),l!==u.QuestionType.FACTOID&&l!==u.QuestionType.TWEET&&s.jsxs(s.Fragment,{children:[s.jsx(re,{children:n==null?void 0:n.title}),s.jsx(de,{onClick:a,children:"Answer"})]})]}):null};const $e=e.styled_default("div")({name:"s",class:"s1aopxp8",propsAsIs:!1}),ge="c1t0h6s",W=({children:t,style:a,className:l,hiding:n})=>s.jsx($e,{style:a,className:e.cx_default(l,n&&ge),children:t});const be=()=>W,G=e.styled_default(be())({name:"d",class:"d1qqtt3e",propsAsIs:!0}),ke=({sdk:t})=>{const a=t.getNotificationsStore(),l=y.useStore(a),n=o.useMemo(()=>{if(!(l!=null&&l.size))return null;for(const d of l.values())if(d.type===S.NotificationType.ONBOARDING)return d;return l.values().next().value},[l]);return(n==null?void 0:n.type)===S.NotificationType.QUESTION?s.jsx(G,{hiding:n.hiding,children:s.jsx("div",{children:s.jsx(D,{...n})})}):(n==null?void 0:n.type)===S.NotificationType.QUESTION_RESOLVED?s.jsx(G,{hiding:n.hiding,children:s.jsx("div",{children:s.jsx(D,{...n})})}):null};const Se=()=>Y,Te=e.styled_default("div")({name:"i",class:"idhrx8x",propsAsIs:!1}),w=e.styled_default("div")({name:"r",class:"r1k6v4ep",propsAsIs:!1}),Y=e.styled_default("div")({name:"n",class:"n1v8kucd",propsAsIs:!1}),we=e.styled_default(Se())({name:"e",class:"e16yw7z1",propsAsIs:!0}),Ne=t=>{const[a,l]=o.useState(!1),n=y.useStore(t.status),{data:d}=y.useStore(t.getUserStore()),r=n==="ready",[c,i]=o.useState(f),j=o.useCallback((x,m)=>{i(m),m===f?(x&&t.createEventSession(x),t.openFeature(u.FeatureType.GAMES)):t.closeFeature()},[t]);return o.useEffect(()=>{!r&&c===f&&(i(g),t.closeFeature())},[r,c,t]),{sdkEnabled:a,sdkReady:r,activeOverlay:c,activateAndLoadOverlay:j,enableSdk:x=>{t.initializeApp().then(({enabled:m,err:B})=>{if(l(!0),B){j(x,g);return}if(m){j(x,f);return}})},disableSdk:()=>{l(!1),t.disableApp()},isLogged:!!d}},Ce=t=>{const a=y.useStore(t.getActiveFeature()),l=y.useStore(t.streamStore()),[n,d]=o.useState(null);return o.useEffect(()=>{const r=t.getFeatures();if(a)for(const[c,i]of r)c===a?i.status.get()===A.FeatureStatus.Suspended&&(i.enable(),d(i)):i.status.get()===A.FeatureStatus.Ready&&i.disable();else{for(const[,c]of r)c.status.get()===A.FeatureStatus.Ready&&c.disable();d(null)}return()=>{for(const[,c]of r)c.status.get()===A.FeatureStatus.Ready&&c.disable()}},[a,t,l]),[a,n]},Ee=({sdk:t,className:a})=>{const[,l]=Ce(t);return s.jsx(H,{className:a,feature:l,sdk:t})},Fe=({sdk:t,overlays:a,children:l})=>{const{sdkEnabled:n,sdkReady:d,activeOverlay:r,activateAndLoadOverlay:c,enableSdk:i,disableSdk:j,isLogged:x}=Ne(t);return s.jsxs(Te,{children:[n&&s.jsx(xs,{sdkReady:d,activeOverlay:r,className:I.f,setActiveOverlay:m=>c("",m)}),n&&s.jsx(ke,{sdk:t}),s.jsx(w,{"data-nav":n.toString(),style:{display:!n||r===g?"block":"none"},children:l&&l({enableSdk:i,disableSdk:j})}),s.jsx(w,{"data-nav":n.toString(),style:{display:r===k?"block":"none"},children:a&&r===k&&a[r]}),x&&n&&r===f&&s.jsx(Ee,{className:I.f,sdk:t}),!x&&n&&r===f&&s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"You are not logged in."})]})},qe=({sdkKey:t,plugins:a,children:l,production:n=!0})=>s.jsx(I.StreamLayerProvider,{sdkKey:t,plugins:a,production:n,autoEnable:!1,children:l}),Oe=({children:t,overlays:a})=>{const{sdk:l,status:n}=o.useContext(I.StreamLayerContext);if(n===I.StreamLayerStatus.UNSET)throw new Error("Wrap app in `StreamLayerProvider`");return l?s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(I.p,{style:{height:"100%"},children:s.jsx(Fe,{sdk:l,overlays:a,children:t})})}):t({})};exports.MastersStreamLayerProvider=qe;exports.MastersStreamLayerSDKReact=Oe;exports.e=we;exports.f=W;exports.n=Y;exports.o=M;exports.r=w;exports.w=U;
@@ -9,7 +9,7 @@ import { NotificationType as C } from "@streamlayer/sdk-web-notifications";
9
9
  const rs = ({ feature: e, sdk: n, children: l, className: t }) => {
10
10
  const i = I(e.status), { slStreamId: c } = I(n.sdkStore);
11
11
  return c != null && c.loading ? /* @__PURE__ */ s("div", { className: t, children: "event is loading..." }) : c != null && c.data ? i !== k.Ready ? /* @__PURE__ */ s("div", { className: t, children: "wait feature..." }) : l : /* @__PURE__ */ s("div", { className: t, children: "event is forbidden..." });
12
- }, cs = ss(() => import("./index-8774a3f9.js")), is = ({
12
+ }, cs = ss(() => import("./index-66ccd267.js")), is = ({
13
13
  sdk: e,
14
14
  feature: n,
15
15
  className: l
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react",
3
- "version": "0.29.9",
3
+ "version": "0.29.10",
4
4
  "type": "module",
5
5
  "author": "StreamLayer, Inc (https://streamlayer.io)",
6
6
  "maintainers": [
@@ -54,14 +54,14 @@
54
54
  }
55
55
  ],
56
56
  "dependencies": {
57
- "@streamlayer/feature-gamification": "^0.26.0",
58
- "@streamlayer/sdk-web": "^0.28.22",
57
+ "@streamlayer/feature-gamification": "^0.26.1",
58
+ "@streamlayer/sdk-web": "^0.28.23",
59
59
  "@streamlayer/sdk-web-core": "^0.17.8",
60
- "@streamlayer/sdk-web-features": "^0.10.25",
61
60
  "@streamlayer/sdk-web-api": "^0.0.1",
62
- "@streamlayer/sdk-web-interfaces": "^0.18.15",
61
+ "@streamlayer/sdk-web-features": "^0.10.26",
63
62
  "@streamlayer/sdk-web-logger": "^0.0.4",
64
63
  "@streamlayer/sdk-web-notifications": "^0.13.0",
64
+ "@streamlayer/sdk-web-interfaces": "^0.18.15",
65
65
  "@streamlayer/sdk-web-storage": "^0.0.4",
66
66
  "@streamlayer/sdk-web-types": "^0.20.1"
67
67
  },
@@ -114,7 +114,7 @@
114
114
  "size-limit": "^11.0.0",
115
115
  "url-loader": "^4.1.1",
116
116
  "vite-plugin-dts": "^3.6.3",
117
- "@streamlayer/react-ui": "^0.65.2"
117
+ "@streamlayer/react-ui": "^0.65.3"
118
118
  },
119
119
  "scripts": {
120
120
  "size-limit": "size-limit"
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("./masters-759c16c9.cjs"),M=require("react");const be=()=>n.C1,Ee=()=>n.C1,Oe=n.styled_default("div")({name:"a",class:"acysrl1",propsAsIs:!1}),Ce=n.styled_default("div")({name:"l",class:"lo57cjm",propsAsIs:!1}),Le=n.styled_default(be())({name:"p",class:"p14kwh4y",propsAsIs:!0}),Re=n.styled_default("span")({name:"s",class:"sxun7sq",propsAsIs:!1}),$e=n.styled_default("button")({name:"c",class:"c1i8ida8",propsAsIs:!1}),Qe=n.styled_default(Ee())({name:"g",class:"g1m0xfmw",propsAsIs:!0}),ye=({type:t,close:e,label:i})=>{const r=t?n.o[t]:{label:i,iconName:void 0};return s.jsxs(Oe,{children:[s.jsxs(Ce,{children:[(r==null?void 0:r.iconName)&&s.jsx(Le,{name:r.iconName}),(r==null?void 0:r.label)&&s.jsx(Re,{children:r.label})]}),s.jsx($e,{onClick:e,children:s.jsx(Qe,{name:"icon-cross"})})]})};const Ue=n.styled_default("div")({name:"t",class:"taj61ja",propsAsIs:!1}),qe=n.styled_default("div")({name:"r",class:"r19fxewd",propsAsIs:!1}),Ye=n.styled_default("div")({name:"i",class:"i1whkbqh",propsAsIs:!1}),J=({indicator:t,title:e})=>s.jsxs(Ue,{children:[s.jsx(qe,{children:e}),s.jsx(Ye,{children:t})]});const Pe=n.styled_default("div")({name:"i",class:"i4lbhzs",propsAsIs:!1}),Fe=n.styled_default("div")({name:"o",class:"ordquhq",propsAsIs:!1}),We=n.styled_default("div")({name:"n",class:"nwzed99",propsAsIs:!1}),C=({indicator:t,title:e})=>s.jsxs(Pe,{children:[s.jsx(Fe,{children:t}),s.jsx(We,{children:e})]});const Ve=n.styled_default("div")({name:"o",class:"o15y0waw",propsAsIs:!1}),He=n.styled_default("div")({name:"i",class:"ihjewwf",propsAsIs:!1}),Be=n.styled_default("div")({name:"n",class:"n10e9lv8",propsAsIs:!1}),Ge=n.styled_default("div")({name:"r",class:"r13bxv",propsAsIs:!1}),Ze=n.styled_default("img")({name:"a",class:"a1fi59c9",propsAsIs:!1}),Je=n.styled_default("div")({name:"s",class:"s1kkihge",propsAsIs:!1}),Ke=n.styled_default("div")({name:"c",class:"cy4f4t",propsAsIs:!1}),Xe=n.styled_default("div")({name:"p",class:"p18cnlx1",propsAsIs:!1}),et=n.styled_default("img")({name:"l",class:"lboqgs5",propsAsIs:!1}),tt=n.styled_default("div")({name:"d",class:"d1oaal4",propsAsIs:!1}),st=n.styled_default("div")({name:"x",class:"x1yzgo0u",propsAsIs:!1}),nt=n.styled_default("div")({name:"f",class:"f1l9i8s8",propsAsIs:!1}),it=n.styled_default("div")({name:"g",class:"g4cgl4u",propsAsIs:!1}),rt=n.styled_default("div")({name:"h",class:"h1qn1tmd",propsAsIs:!1}),at=n.styled_default("div")({name:"u",class:"u1gsbhq4",propsAsIs:!1}),lt=n.styled_default("div")({name:"m",class:"mvj8oco",propsAsIs:!1}),ot=n.styled_default("button")({name:"v",class:"viqiaf2",propsAsIs:!1}),ct="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",Ie=({avatar:t,name:e,points:i,friendsRank:r,rank:a,streak:d,correct:u,incorrect:m,inTop:h,successRate:g})=>s.jsxs(Ve,{children:[s.jsx(He,{children:s.jsxs(Ge,{children:[s.jsxs(ot,{children:[t&&s.jsx(Ze,{alt:"avatar",src:t}),!t&&s.jsx(lt,{children:n.o$1(e||"")})]}),s.jsxs(Je,{children:[s.jsx(Ke,{children:e}),s.jsxs(Xe,{children:[s.jsxs(tt,{children:[s.jsx(et,{alt:"rank-icon",src:ct}),s.jsxs(st,{children:[n.i(i),s.jsx(nt,{children:"PTS"})]})]}),s.jsx(it,{}),s.jsxs("div",{children:["TOP ",h||0,"%"]})]})]})]})}),s.jsxs(Be,{children:[s.jsxs(rt,{children:[s.jsx(J,{indicator:r||0,title:"Friends rank"}),s.jsx(J,{indicator:a||0,title:"Global rank"})]}),s.jsxs(at,{children:[s.jsx(C,{indicator:d||0,title:"Win streak"}),s.jsx(C,{indicator:u||0,title:"Correct"}),s.jsx(C,{indicator:m||0,title:"Incorrect"}),s.jsx(C,{indicator:`${g||0}%`,title:"Succ. rate"})]})]})]});const dt=()=>n.C1,ut=n.styled_default("div")({name:"c",class:"ciyeb68",propsAsIs:!1}),pt=n.styled_default(dt())({name:"n",class:"nfic4xc",propsAsIs:!0}),K=n.styled_default("div")({name:"d",class:"d1pd1p66",propsAsIs:!1}),X=n.styled_default("div")({name:"p",class:"p132yxcv",propsAsIs:!1}),ft=n.styled_default("span")({name:"l",class:"l4a8aw",propsAsIs:!1}),R=n.styled_default("span")({name:"g",class:"gzdx7pk",propsAsIs:!1}),ht=n.styled_default("div")({name:"s",class:"smnc4zm",propsAsIs:!1}),mt=({feedbackMessages:t,questionVotedCorrectly:e,questionVoted:i,questionType:r,hasCorrectAnswer:a,questionStatus:d})=>{const u=i&&(r===n.QuestionType.TRIVIA||r===n.QuestionType.PREDICTION);if(!u&&d!==n.QuestionStatus.RESOLVED)return null;const m=r===n.QuestionType.PREDICTION&&!a,h=e?"correct":"incorrect",g=e?t.correctFeedback:t.incorrectFeedback;return s.jsxs(ut,{"data-isPrediction":m,children:[d===n.QuestionStatus.RESOLVED&&r===n.QuestionType.TRIVIA&&!i&&s.jsxs(s.Fragment,{children:[s.jsx(K,{children:s.jsx(n.C1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(X,{children:s.jsx(R,{children:"Question Expired"})}),s.jsx(ht,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),u&&m&&s.jsxs(s.Fragment,{children:[s.jsx(pt,{name:"icon-prediction"}),s.jsx(R,{children:"Stay tuned to see if your prediction was correct."})]}),u&&a&&s.jsxs(s.Fragment,{children:[s.jsx(K,{"data-feedbackType":h,children:s.jsx(n.C1,{name:h})}),s.jsx("div",{children:s.jsxs(X,{children:[s.jsx(ft,{"data-feedbackType":h,children:g==null?void 0:g.title}),s.jsx(R,{children:g==null?void 0:g.description})]})})]})]})};const gt=n.styled_default("div")({name:"o",class:"olc1eph",propsAsIs:!1}),yt=n.styled_default("div")({name:"n",class:"n1yoh29a",propsAsIs:!1}),It=n.styled_default("div")({name:"p",class:"pjkr5mb",propsAsIs:!1}),xt=n.styled_default("div")({name:"r",class:"r82wnnx",propsAsIs:!1});const vt=()=>xe,_t=()=>xe,jt=()=>n.C1,Mt=n.styled_default("button")({name:"c",class:"cpm4u8k",propsAsIs:!1}),zt=n.styled_default("div")({name:"l",class:"lwfomc3",propsAsIs:!1}),Nt=n.styled_default("span")({name:"d",class:"dmltvg2",propsAsIs:!1}),Tt=n.styled_default("div")({name:"s",class:"stfjpqz",propsAsIs:!1}),At=n.styled_default("div")({name:"p",class:"p198m24r",propsAsIs:!1}),xe=n.styled_default("img")({name:"r",class:"rbq5eu7",propsAsIs:!1}),St=n.styled_default(vt())({name:"g",class:"g1iv6oeb",propsAsIs:!0}),Dt=n.styled_default(_t())({name:"h",class:"h1qtxlqc",propsAsIs:!0}),wt=n.styled_default("span")({name:"u",class:"udm736q",propsAsIs:!1}),kt=n.styled_default("span")({name:"b",class:"b1da34tx",propsAsIs:!1}),bt=n.styled_default("span")({name:"x",class:"x1dqwq83",propsAsIs:!1}),Et=n.styled_default(jt())({name:"v",class:"v10s9my2",propsAsIs:!0}),ee={[n.QuestionImages.CENTERED]:t=>s.jsx(St,{alt:"option-icon",src:t}),[n.QuestionImages.TRANSPARENT]:t=>s.jsx(Tt,{children:s.jsx(At,{style:{backgroundImage:`url(${t})`}})}),[n.QuestionImages.ROUNDED]:t=>s.jsx(Dt,{alt:"option-icon",src:t}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},Ot=({questionType:t,hasCorrectAnswer:e,correct:i,youVoted:r,questionVoted:a})=>{if(t===n.QuestionType.POLL&&r)return"correct";if(t===n.QuestionType.PREDICTION){if(e&&a)return r?i?"correct":"incorrect":i?"correct":"unset";if(r)return"correct"}return t===n.QuestionType.TRIVIA&&a?r?i?"correct":"incorrect":i?"correct":"unset":"unset"},Ct=({questionType:t,questionVoted:e,correct:i,hasCorrectAnswer:r,questionStatus:a})=>t===n.QuestionType.TRIVIA?e&&i:t===n.QuestionType.PREDICTION?e&&i&&r||a===n.QuestionStatus.RESOLVED&&i:!1,Lt=t=>{var e;const{id:i,icon:r,text:a,percentageDecimal:d,onVote:u,youSelected:m,questionVoted:h,imageMode:g=n.QuestionImages.ROUNDED,answerTimeExpired:_,questionStatus:v,isLoading:o,questionType:x,correct:I,hasCorrectAnswer:l}=t,f=Ot(t),c=Ct({questionType:x,questionVoted:h,correct:I,hasCorrectAnswer:l,questionStatus:v}),p=h||v===n.QuestionStatus.RESOLVED&&x===n.QuestionType.PREDICTION;return s.jsxs(Mt,{value:i,"data-selected":m,"data-answerState":f,disabled:h||o||_,onClick:u,children:[p&&s.jsx(zt,{"data-answerState":f,style:{width:`${d}%`}}),s.jsxs(Nt,{children:[r&&((e=ee[g])==null?void 0:e.call(ee,r)),s.jsx(wt,{children:a}),p&&s.jsxs(kt,{children:[c&&s.jsx(Et,{name:"selected"}),s.jsxs(bt,{children:[d,"%"]})]})]})]})};var te=typeof window>"u"?M.useEffect:M.useLayoutEffect,Rt=({isPlaying:t,duration:e,startAt:i=0,updateInterval:r=0,onComplete:a,onUpdate:d})=>{let[u,m]=M.useState(i),h=M.useRef(0),g=M.useRef(i),_=M.useRef(i*-1e3),v=M.useRef(null),o=M.useRef(null),x=M.useRef(null),I=c=>{let p=c/1e3;if(o.current===null){o.current=p,v.current=requestAnimationFrame(I);return}let y=p-o.current,z=h.current+y;o.current=p,h.current=z;let j=g.current+(r===0?z:(z/r|0)*r),N=g.current+z,T=typeof e=="number"&&N>=e;m(T?e:j),T||(v.current=requestAnimationFrame(I))},l=()=>{v.current&&cancelAnimationFrame(v.current),x.current&&clearTimeout(x.current),o.current=null},f=M.useCallback(c=>{l(),h.current=0;let p=typeof c=="number"?c:i;g.current=p,m(p),t&&(v.current=requestAnimationFrame(I))},[t,i]);return te(()=>{if(d==null||d(u),e&&u>=e){_.current+=e*1e3;let{shouldRepeat:c=!1,delay:p=0,newStartAt:y}=(a==null?void 0:a(_.current/1e3))||{};c&&(x.current=setTimeout(()=>f(y),p*1e3))}},[u,e]),te(()=>(t&&(v.current=requestAnimationFrame(I)),l),[t,e,r]),{elapsedTime:u,reset:f}},$t=(t,e,i)=>{let r=t/2,a=e/2,d=r-a,u=2*d,m=i==="clockwise"?"1,0":"0,1",h=2*Math.PI*d;return{path:`m ${r},${a} a ${d},${d} 0 ${m} 0,${u} a ${d},${d} 0 ${m} 0,-${u}`,pathLength:h}},se=(t,e)=>t===0||t===e?0:typeof e=="number"?t-e:0,Qt=t=>({position:"relative",width:t,height:t}),Ut={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},ve=(t,e,i,r,a)=>{if(r===0)return e;let d=(a?r-t:t)/r;return e+i*d},ne=t=>{var e,i;return(i=(e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(r,a,d,u)=>`#${a}${a}${d}${d}${u}${u}`).substring(1).match(/.{2}/g))==null?void 0:e.map(r=>parseInt(r,16)))!=null?i:[]},qt=(t,e)=>{var i;let{colors:r,colorsTime:a,isSmoothColorTransition:d=!0}=t;if(typeof r=="string")return r;let u=(i=a==null?void 0:a.findIndex((o,x)=>o>=e&&e>=a[x+1]))!=null?i:-1;if(!a||u===-1)return r[0];if(!d)return r[u];let m=a[u]-e,h=a[u]-a[u+1],g=ne(r[u]),_=ne(r[u+1]),v=!!t.isGrowing;return`rgb(${g.map((o,x)=>ve(m,o,_[x]-o,h,v)|0).join(",")})`},Yt=t=>{let{duration:e,initialRemainingTime:i,updateInterval:r,size:a=180,strokeWidth:d=12,trailStrokeWidth:u,isPlaying:m=!1,isGrowing:h=!1,rotation:g="clockwise",onComplete:_,onUpdate:v}=t,o=M.useRef(),x=Math.max(d,u??0),{path:I,pathLength:l}=$t(a,x,g),{elapsedTime:f}=Rt({isPlaying:m,duration:e,startAt:se(e,i),updateInterval:r,onUpdate:typeof v=="function"?p=>{let y=Math.ceil(e-p);y!==o.current&&(o.current=y,v(y))}:void 0,onComplete:typeof _=="function"?p=>{var y;let{shouldRepeat:z,delay:j,newInitialRemainingTime:N}=(y=_(p))!=null?y:{};if(z)return{shouldRepeat:z,delay:j,newStartAt:se(e,N)}}:void 0}),c=e-f;return{elapsedTime:f,path:I,pathLength:l,remainingTime:Math.ceil(c),rotation:g,size:a,stroke:qt(t,c),strokeDashoffset:ve(f,0,l,e,h),strokeWidth:d}},_e=t=>{let{children:e,strokeLinecap:i,trailColor:r,trailStrokeWidth:a}=t,{path:d,pathLength:u,stroke:m,strokeDashoffset:h,remainingTime:g,elapsedTime:_,size:v,strokeWidth:o}=Yt(t);return M.createElement("div",{style:Qt(v)},M.createElement("svg",{viewBox:`0 0 ${v} ${v}`,width:v,height:v,xmlns:"http://www.w3.org/2000/svg"},M.createElement("path",{d,fill:"none",stroke:r??"#d9d9d9",strokeWidth:a??o}),M.createElement("path",{d,fill:"none",stroke:m,strokeLinecap:i??"round",strokeWidth:o,strokeDasharray:u,strokeDashoffset:h})),typeof e=="function"&&M.createElement("div",{style:Ut},e({remainingTime:g,elapsedTime:_,color:m})))};_e.displayName="CountdownCircleTimer";const Pt=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1],Ft=[10,10,0],Wt=n.styled_default("div")({name:"A",class:"a1f928zy",propsAsIs:!1}),Vt=n.E.SECONDARY_GREEN6,ie=n.E.SECONDARY_RED3,Ht=n.E.NEUTRALS_GRAY3,Bt=({isPlaying:t=!0,duration:e=30,onTimerExpired:i})=>{const[r,a]=M.useState(e>10?Vt:ie),d=({remainingTime:h})=>s.jsx(Wt,{children:h}),u=M.useCallback(()=>{i==null||i(),a(Ht)},[i,a]),m=M.useCallback(h=>{h===10&&a(ie)},[a]);return s.jsx(_e,{isPlaying:t,duration:e,colors:Pt,colorsTime:Ft,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:r,onComplete:u,onUpdate:m,children:d})};const Gt=()=>n.C1,Zt=n.styled_default("div")({name:"a",class:"a1r7f3z4",propsAsIs:!1}),Jt=n.styled_default("div")({name:"s",class:"sblndl",propsAsIs:!1}),Kt=n.styled_default("div")({name:"l",class:"l7ka1tv",propsAsIs:!1}),Xt=n.styled_default(Gt())({name:"p",class:"p1edlxt3",propsAsIs:!0}),es=n.styled_default("div")({name:"g",class:"ghm08u2",propsAsIs:!1}),ts=n.styled_default("span")({name:"c",class:"c12nsh46",propsAsIs:!1}),ss=n.styled_default("span")({name:"d",class:"dlr9eoc",propsAsIs:!1}),ns=({title:t,points:e,isPlayingTimer:i,isTimer:r,onTimerExpired:a})=>s.jsxs(Zt,{children:[s.jsxs(Jt,{children:[t&&s.jsx(Kt,{children:t}),e!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx(Xt,{name:"icon-trophy"}),s.jsxs(es,{children:[s.jsx(ts,{children:e}),s.jsx(ss,{children:"PTS"})]})]})]}),r&&s.jsx(Bt,{isPlaying:i,onTimerExpired:a})]}),is=({openedQuestion:t,vote:e})=>{var i;const r=t.subject,a=t.type,d=(i=t.options)==null?void 0:i.options,[u,m]=M.useState(!1),[h,g]=M.useState(!1),[_,v]=M.useState(""),o=t==null?void 0:t.id,x=M.useCallback(async p=>{if(o){const y=p.currentTarget.value;v(y),g(!0),await e(o,y),g(!1)}},[o,v,e]),I=M.useMemo(()=>t==null?void 0:t.answers.find(p=>p.youVoted===!0),[t]),l=M.useMemo(()=>!!(t!=null&&t.answers.find(p=>p.correct===!0)),[t]),f=M.useMemo(()=>t?t.answers.map(p=>({...p,questionVoted:!!I,youSelected:_===p.id,isLoading:h,hasCorrectAnswer:l,questionType:t.type,answerTimeExpired:u,questionStatus:t.status,onVote:x})):[],[l,u,h,t,I,x,_]),c=d&&(d.case==="trivia"||d.case==="prediction")?d.value:void 0;return s.jsx(n.r,{"data-question-header":"true",children:s.jsx(gt,{children:s.jsxs(yt,{children:[c&&s.jsx(mt,{feedbackMessages:c,questionVoted:!!I,questionVotedCorrectly:I==null?void 0:I.correct,questionType:a,hasCorrectAnswer:l,questionStatus:t.status}),s.jsx(ns,{title:u?"Expired":"To win",points:u?void 0:100,onTimerExpired:()=>m(!0),isTimer:!0}),s.jsx(It,{children:r}),s.jsx(xt,{children:f.map(p=>s.jsx(Lt,{...p},p.id))})]})})})};const rs=n.styled_default("div")({name:"e",class:"e1eio0mt",propsAsIs:!1}),as=n.styled_default("div")({name:"i",class:"iigl87b",propsAsIs:!1}),ls=n.styled_default("h3")({name:"n",class:"n1o2cwub",propsAsIs:!1}),os=n.styled_default("div")({name:"r",class:"r3uxe45",propsAsIs:!1}),cs=n.styled_default("div")({name:"l",class:"lrqius",propsAsIs:!1}),je=({created:t,title:e,instantView:i})=>{const r=M.useMemo(()=>{if(t){const a=new Date(t);if(n.r$1(a))return{date:n.a(a),time:n.n(a)}}return null},[t]);return s.jsxs(rs,{children:[r&&s.jsxs(cs,{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(as,{children:[s.jsx(ls,{children:(i==null?void 0:i.heading)||e}),s.jsx(os,{children:i==null?void 0:i.body})]})]})};const ds=n.styled_default("div")({name:"o",class:"o18unvw4",propsAsIs:!1}),us=n.styled_default("a")({name:"n",class:"ns0uvk8",propsAsIs:!1}),ps=({instantView:t,...e})=>s.jsxs(ds,{children:[s.jsx(je,{instantView:t,...e}),(t==null?void 0:t.webLink)&&s.jsxs(us,{href:t==null?void 0:t.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(n.C1,{name:"icon-external-link"})]})]});const fs=n.styled_default("div")({name:"d",class:"dk8r1eq",propsAsIs:!1}),hs=({openedQuestion:t})=>{var e;return((e=t==null?void 0:t.attributes)==null?void 0:e.attributes.case)==="insight"?s.jsx(ps,{created:t.attributes.created,...t.attributes.attributes.value}):null},ms=({extendedQuestion:t,vote:e})=>{const{loading:i,data:r}=t;return!i&&r?s.jsx(is,{vote:e,openedQuestion:r}):null},gs=({gamification:t})=>{var e;const i=n.useStore(t.openedQuestion.$store),r=n.useStore(t.openedQuestion.$extendedStore);if(!i)return null;const a=i.type;return s.jsxs(fs,{children:[s.jsx(ye,{close:t.closeQuestion,type:((e=i.attributes)==null?void 0:e.type)||n.QuestionType.UNSET}),a==="question"&&s.jsx(ms,{vote:t.submitAnswer,extendedQuestion:r}),a!=="question"&&s.jsx(hs,{openedQuestion:i})]})};const ys=n.styled_default("div")({name:"t",class:"tcim9sm",propsAsIs:!1}),Is=n.styled_default("div")({name:"e",class:"e8wco6o",propsAsIs:!1}),xs=n.styled_default("button")({name:"n",class:"n1ardwzl",propsAsIs:!1}),vs=n.styled_default("span")({name:"i",class:"i1vk8ojx",propsAsIs:!1});var b=(t=>(t.HOME="home",t.LEADERBOARD="leaderboard",t))(b||{});const re=({title:t,active:e,onClick:i})=>s.jsx(xs,{onClick:i,"data-selected":e,children:s.jsx(vs,{children:t})}),_s=({activePage:t="home",toggleActivePage:e})=>s.jsx(ys,{children:s.jsxs(Is,{"data-position":t==="home"?"left":"right",children:[s.jsx(re,{title:"Home",active:t==="home",onClick:()=>e("home")}),s.jsx(re,{title:"Leader Board",active:t==="leaderboard",onClick:()=>e("leaderboard")})]})});let A;typeof window<"u"?A=window:typeof self<"u"?A=self:A=n.dist.global;let P=null,F=null;const ae=20,$=A.clearTimeout,le=A.setTimeout,Q=A.cancelAnimationFrame||A.mozCancelAnimationFrame||A.webkitCancelAnimationFrame,oe=A.requestAnimationFrame||A.mozRequestAnimationFrame||A.webkitRequestAnimationFrame;Q==null||oe==null?(P=$,F=function(e){return le(e,ae)}):(P=function([e,i]){Q(e),$(i)},F=function(e){const i=oe(function(){$(r),e()}),r=le(function(){Q(i),e()},ae);return[i,r]});function js(t){let e,i,r,a,d,u,m;const h=typeof document<"u"&&document.attachEvent;if(!h){u=function(c){const p=c.__resizeTriggers__,y=p.firstElementChild,z=p.lastElementChild,j=y.firstElementChild;z.scrollLeft=z.scrollWidth,z.scrollTop=z.scrollHeight,j.style.width=y.offsetWidth+1+"px",j.style.height=y.offsetHeight+1+"px",y.scrollLeft=y.scrollWidth,y.scrollTop=y.scrollHeight},d=function(c){return c.offsetWidth!==c.__resizeLast__.width||c.offsetHeight!==c.__resizeLast__.height},m=function(c){if(c.target.className&&typeof c.target.className.indexOf=="function"&&c.target.className.indexOf("contract-trigger")<0&&c.target.className.indexOf("expand-trigger")<0)return;const p=this;u(this),this.__resizeRAF__&&P(this.__resizeRAF__),this.__resizeRAF__=F(function(){d(p)&&(p.__resizeLast__.width=p.offsetWidth,p.__resizeLast__.height=p.offsetHeight,p.__resizeListeners__.forEach(function(j){j.call(p,c)}))})};let o=!1,x="";r="animationstart";const I="Webkit Moz O ms".split(" ");let l="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),f="";{const c=document.createElement("fakeelement");if(c.style.animationName!==void 0&&(o=!0),o===!1){for(let p=0;p<I.length;p++)if(c.style[I[p]+"AnimationName"]!==void 0){f=I[p],x="-"+f.toLowerCase()+"-",r=l[p],o=!0;break}}}i="resizeanim",e="@"+x+"keyframes "+i+" { from { opacity: 0; } to { opacity: 0; } } ",a=x+"animation: 1ms "+i+"; "}const g=function(o){if(!o.getElementById("detectElementResize")){const x=(e||"")+".resize-triggers { "+(a||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',I=o.head||o.getElementsByTagName("head")[0],l=o.createElement("style");l.id="detectElementResize",l.type="text/css",t!=null&&l.setAttribute("nonce",t),l.styleSheet?l.styleSheet.cssText=x:l.appendChild(o.createTextNode(x)),I.appendChild(l)}};return{addResizeListener:function(o,x){if(h)o.attachEvent("onresize",x);else{if(!o.__resizeTriggers__){const I=o.ownerDocument,l=A.getComputedStyle(o);l&&l.position==="static"&&(o.style.position="relative"),g(I),o.__resizeLast__={},o.__resizeListeners__=[],(o.__resizeTriggers__=I.createElement("div")).className="resize-triggers";const f=I.createElement("div");f.className="expand-trigger",f.appendChild(I.createElement("div"));const c=I.createElement("div");c.className="contract-trigger",o.__resizeTriggers__.appendChild(f),o.__resizeTriggers__.appendChild(c),o.appendChild(o.__resizeTriggers__),u(o),o.addEventListener("scroll",m,!0),r&&(o.__resizeTriggers__.__animationListener__=function(y){y.animationName===i&&u(o)},o.__resizeTriggers__.addEventListener(r,o.__resizeTriggers__.__animationListener__))}o.__resizeListeners__.push(x)}},removeResizeListener:function(o,x){if(h)o.detachEvent("onresize",x);else if(o.__resizeListeners__.splice(o.__resizeListeners__.indexOf(x),1),!o.__resizeListeners__.length){o.removeEventListener("scroll",m,!0),o.__resizeTriggers__.__animationListener__&&(o.__resizeTriggers__.removeEventListener(r,o.__resizeTriggers__.__animationListener__),o.__resizeTriggers__.__animationListener__=null);try{o.__resizeTriggers__=!o.removeChild(o.__resizeTriggers__)}catch{}}}}}class Ms extends M.Component{constructor(...e){super(...e),this.state={height:this.props.defaultHeight||0,scaledHeight:this.props.defaultHeight||0,scaledWidth:this.props.defaultWidth||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;const{disableHeight:i,disableWidth:r,onResize:a}=this.props;if(this._parentNode){var d,u,m,h;const g=window.getComputedStyle(this._parentNode)||{},_=parseFloat((d=g.paddingLeft)!==null&&d!==void 0?d:"0"),v=parseFloat((u=g.paddingRight)!==null&&u!==void 0?u:"0"),o=parseFloat((m=g.paddingTop)!==null&&m!==void 0?m:"0"),x=parseFloat((h=g.paddingBottom)!==null&&h!==void 0?h:"0"),I=this._parentNode.getBoundingClientRect(),l=I.height-o-x,f=I.width-_-v,c=this._parentNode.offsetHeight-o-x,p=this._parentNode.offsetWidth-_-v;(!i&&(this.state.height!==c||this.state.scaledHeight!==l)||!r&&(this.state.width!==p||this.state.scaledWidth!==f))&&(this.setState({height:c,width:p,scaledHeight:l,scaledWidth:f}),typeof a=="function"&&a({height:c,scaledHeight:l,scaledWidth:f,width:p}))}},this._setRef=i=>{this._autoSizer=i}}componentDidMount(){const{nonce:e}=this.props;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._parentNode!=null&&(typeof ResizeObserver<"u"?(this._resizeObserver=new ResizeObserver(()=>{this._timeoutId=setTimeout(this._onResize,0)}),this._resizeObserver.observe(this._parentNode)):(this._detectElementResize=js(e),this._detectElementResize.addResizeListener(this._parentNode,this._onResize)),this._onResize()))}componentWillUnmount(){this._parentNode&&(this._detectElementResize&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize),this._timeoutId!==null&&clearTimeout(this._timeoutId),this._resizeObserver&&(this._resizeObserver.observe(this._parentNode),this._resizeObserver.disconnect()))}render(){const{children:e,defaultHeight:i,defaultWidth:r,disableHeight:a=!1,disableWidth:d=!1,nonce:u,onResize:m,style:h={},tagName:g="div",..._}=this.props,{height:v,scaledHeight:o,scaledWidth:x,width:I}=this.state,l={overflow:"visible"},f={};let c=!1;return a||(v===0&&(c=!0),l.height=0,f.height=v,f.scaledHeight=o),d||(I===0&&(c=!0),l.width=0,f.width=I,f.scaledWidth=x),M.createElement(g,{ref:this._setRef,style:{...l,...h},..._},!c&&e(f))}}function W(){return W=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},W.apply(this,arguments)}function ce(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function V(t,e){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},V(t,e)}function zs(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,V(t,e)}var de=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Ns(t,e){return!!(t===e||de(t)&&de(e))}function Ts(t,e){if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(!Ns(t[i],e[i]))return!1;return!0}function U(t,e){e===void 0&&(e=Ts);var i,r=[],a,d=!1;function u(){for(var m=[],h=0;h<arguments.length;h++)m[h]=arguments[h];return d&&i===this&&e(m,r)||(a=t.apply(this,m),d=!0,i=this,r=m),a}return u}var As=typeof performance=="object"&&typeof performance.now=="function",ue=As?function(){return performance.now()}:function(){return Date.now()};function pe(t){cancelAnimationFrame(t.id)}function Ss(t,e){var i=ue();function r(){ue()-i>=e?t.call(null):a.id=requestAnimationFrame(r)}var a={id:requestAnimationFrame(r)};return a}var q=-1;function fe(t){if(t===void 0&&(t=!1),q===-1||t){var e=document.createElement("div"),i=e.style;i.width="50px",i.height="50px",i.overflow="scroll",document.body.appendChild(e),q=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return q}var w=null;function he(t){if(t===void 0&&(t=!1),w===null||t){var e=document.createElement("div"),i=e.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",e.appendChild(r),document.body.appendChild(e),e.scrollLeft>0?w="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?w="negative":w="positive-ascending"),document.body.removeChild(e),w}return w}var Ds=150,ws=function(e,i){return e};function ks(t){var e,i=t.getItemOffset,r=t.getEstimatedTotalSize,a=t.getItemSize,d=t.getOffsetForIndexAndAlignment,u=t.getStartIndexForOffset,m=t.getStopIndexForStartIndex,h=t.initInstanceProps,g=t.shouldResetStyleCacheOnItemSizeChange,_=t.validateProps;return e=function(v){zs(o,v);function o(I){var l;return l=v.call(this,I)||this,l._instanceProps=h(l.props,ce(l)),l._outerRef=void 0,l._resetIsScrollingTimeoutId=null,l.state={instance:ce(l),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof l.props.initialScrollOffset=="number"?l.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},l._callOnItemsRendered=void 0,l._callOnItemsRendered=U(function(f,c,p,y){return l.props.onItemsRendered({overscanStartIndex:f,overscanStopIndex:c,visibleStartIndex:p,visibleStopIndex:y})}),l._callOnScroll=void 0,l._callOnScroll=U(function(f,c,p){return l.props.onScroll({scrollDirection:f,scrollOffset:c,scrollUpdateWasRequested:p})}),l._getItemStyle=void 0,l._getItemStyle=function(f){var c=l.props,p=c.direction,y=c.itemSize,z=c.layout,j=l._getItemStyleCache(g&&y,g&&z,g&&p),N;if(j.hasOwnProperty(f))N=j[f];else{var T=i(l.props,f,l._instanceProps),S=a(l.props,f,l._instanceProps),D=p==="horizontal"||z==="horizontal",E=p==="rtl",O=D?T:0;j[f]=N={position:"absolute",left:E?void 0:O,right:E?O:void 0,top:D?0:T,height:D?"100%":S,width:D?S:"100%"}}return N},l._getItemStyleCache=void 0,l._getItemStyleCache=U(function(f,c,p){return{}}),l._onScrollHorizontal=function(f){var c=f.currentTarget,p=c.clientWidth,y=c.scrollLeft,z=c.scrollWidth;l.setState(function(j){if(j.scrollOffset===y)return null;var N=l.props.direction,T=y;if(N==="rtl")switch(he()){case"negative":T=-y;break;case"positive-descending":T=z-p-y;break}return T=Math.max(0,Math.min(T,z-p)),{isScrolling:!0,scrollDirection:j.scrollOffset<y?"forward":"backward",scrollOffset:T,scrollUpdateWasRequested:!1}},l._resetIsScrollingDebounced)},l._onScrollVertical=function(f){var c=f.currentTarget,p=c.clientHeight,y=c.scrollHeight,z=c.scrollTop;l.setState(function(j){if(j.scrollOffset===z)return null;var N=Math.max(0,Math.min(z,y-p));return{isScrolling:!0,scrollDirection:j.scrollOffset<N?"forward":"backward",scrollOffset:N,scrollUpdateWasRequested:!1}},l._resetIsScrollingDebounced)},l._outerRefSetter=function(f){var c=l.props.outerRef;l._outerRef=f,typeof c=="function"?c(f):c!=null&&typeof c=="object"&&c.hasOwnProperty("current")&&(c.current=f)},l._resetIsScrollingDebounced=function(){l._resetIsScrollingTimeoutId!==null&&pe(l._resetIsScrollingTimeoutId),l._resetIsScrollingTimeoutId=Ss(l._resetIsScrolling,Ds)},l._resetIsScrolling=function(){l._resetIsScrollingTimeoutId=null,l.setState({isScrolling:!1},function(){l._getItemStyleCache(-1,null)})},l}o.getDerivedStateFromProps=function(l,f){return bs(l,f),_(l),null};var x=o.prototype;return x.scrollTo=function(l){l=Math.max(0,l),this.setState(function(f){return f.scrollOffset===l?null:{scrollDirection:f.scrollOffset<l?"forward":"backward",scrollOffset:l,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},x.scrollToItem=function(l,f){f===void 0&&(f="auto");var c=this.props,p=c.itemCount,y=c.layout,z=this.state.scrollOffset;l=Math.max(0,Math.min(l,p-1));var j=0;if(this._outerRef){var N=this._outerRef;y==="vertical"?j=N.scrollWidth>N.clientWidth?fe():0:j=N.scrollHeight>N.clientHeight?fe():0}this.scrollTo(d(this.props,l,f,z,this._instanceProps,j))},x.componentDidMount=function(){var l=this.props,f=l.direction,c=l.initialScrollOffset,p=l.layout;if(typeof c=="number"&&this._outerRef!=null){var y=this._outerRef;f==="horizontal"||p==="horizontal"?y.scrollLeft=c:y.scrollTop=c}this._callPropsCallbacks()},x.componentDidUpdate=function(){var l=this.props,f=l.direction,c=l.layout,p=this.state,y=p.scrollOffset,z=p.scrollUpdateWasRequested;if(z&&this._outerRef!=null){var j=this._outerRef;if(f==="horizontal"||c==="horizontal")if(f==="rtl")switch(he()){case"negative":j.scrollLeft=-y;break;case"positive-ascending":j.scrollLeft=y;break;default:var N=j.clientWidth,T=j.scrollWidth;j.scrollLeft=T-N-y;break}else j.scrollLeft=y;else j.scrollTop=y}this._callPropsCallbacks()},x.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&pe(this._resetIsScrollingTimeoutId)},x.render=function(){var l=this.props,f=l.children,c=l.className,p=l.direction,y=l.height,z=l.innerRef,j=l.innerElementType,N=l.innerTagName,T=l.itemCount,S=l.itemData,D=l.itemKey,E=D===void 0?ws:D,O=l.layout,ze=l.outerElementType,Ne=l.outerTagName,Te=l.style,Ae=l.useIsScrolling,Se=l.width,H=this.state.isScrolling,L=p==="horizontal"||O==="horizontal",De=L?this._onScrollHorizontal:this._onScrollVertical,B=this._getRangeToRender(),we=B[0],ke=B[1],G=[];if(T>0)for(var k=we;k<=ke;k++)G.push(M.createElement(f,{data:S,key:E(k,S),index:k,isScrolling:Ae?H:void 0,style:this._getItemStyle(k)}));var Z=r(this.props,this._instanceProps);return M.createElement(ze||Ne||"div",{className:c,onScroll:De,ref:this._outerRefSetter,style:W({position:"relative",height:y,width:Se,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:p},Te)},M.createElement(j||N||"div",{children:G,ref:z,style:{height:L?"100%":Z,pointerEvents:H?"none":void 0,width:L?Z:"100%"}}))},x._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var l=this.props.itemCount;if(l>0){var f=this._getRangeToRender(),c=f[0],p=f[1],y=f[2],z=f[3];this._callOnItemsRendered(c,p,y,z)}}if(typeof this.props.onScroll=="function"){var j=this.state,N=j.scrollDirection,T=j.scrollOffset,S=j.scrollUpdateWasRequested;this._callOnScroll(N,T,S)}},x._getRangeToRender=function(){var l=this.props,f=l.itemCount,c=l.overscanCount,p=this.state,y=p.isScrolling,z=p.scrollDirection,j=p.scrollOffset;if(f===0)return[0,0,0,0];var N=u(this.props,j,this._instanceProps),T=m(this.props,N,j,this._instanceProps),S=!y||z==="backward"?Math.max(1,c):1,D=!y||z==="forward"?Math.max(1,c):1;return[Math.max(0,N-S),Math.max(0,Math.min(f-1,T+D)),N,T]},o}(M.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var bs=function(e,i){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,i.instance},Es=ks({getItemOffset:function(e,i){var r=e.itemSize;return i*r},getItemSize:function(e,i){var r=e.itemSize;return r},getEstimatedTotalSize:function(e){var i=e.itemCount,r=e.itemSize;return r*i},getOffsetForIndexAndAlignment:function(e,i,r,a,d,u){var m=e.direction,h=e.height,g=e.itemCount,_=e.itemSize,v=e.layout,o=e.width,x=m==="horizontal"||v==="horizontal",I=x?o:h,l=Math.max(0,g*_-I),f=Math.min(l,i*_),c=Math.max(0,i*_-I+_+u);switch(r==="smart"&&(a>=c-I&&a<=f+I?r="auto":r="center"),r){case"start":return f;case"end":return c;case"center":{var p=Math.round(c+(f-c)/2);return p<Math.ceil(I/2)?0:p>l+Math.floor(I/2)?l:p}case"auto":default:return a>=c&&a<=f?a:a<c?c:f}},getStartIndexForOffset:function(e,i){var r=e.itemCount,a=e.itemSize;return Math.max(0,Math.min(r-1,Math.floor(i/a)))},getStopIndexForStartIndex:function(e,i,r){var a=e.direction,d=e.height,u=e.itemCount,m=e.itemSize,h=e.layout,g=e.width,_=a==="horizontal"||h==="horizontal",v=i*m,o=_?g:d,x=Math.ceil((o+r-v)/m);return Math.max(0,Math.min(u-1,i+x-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});function Os(t){var e=t.lastRenderedStartIndex,i=t.lastRenderedStopIndex,r=t.startIndex,a=t.stopIndex;return!(r>i||a<e)}function Cs(t){for(var e=t.isItemLoaded,i=t.itemCount,r=t.minimumBatchSize,a=t.startIndex,d=t.stopIndex,u=[],m=null,h=null,g=a;g<=d;g++){var _=e(g);_?h!==null&&(u.push(m,h),m=h=null):(h=g,m===null&&(m=g))}if(h!==null){for(var v=Math.min(Math.max(h,m+r-1),i-1),o=h+1;o<=v&&!e(o);o++)h=o;u.push(m,h)}if(u.length)for(;u[1]-u[0]+1<r&&u[0]>0;){var x=u[0]-1;if(!e(x))u[0]=x;else break}return u}var Ls=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Rs=function(){function t(e,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(e,a.key,a)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),$s=function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},me=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t},Qs=function(t){$s(e,t);function e(){var i,r,a,d;Ls(this,e);for(var u=arguments.length,m=Array(u),h=0;h<u;h++)m[h]=arguments[h];return d=(r=(a=me(this,(i=e.__proto__||Object.getPrototypeOf(e)).call.apply(i,[this].concat(m))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(g){var _=g.visibleStartIndex,v=g.visibleStopIndex;a._lastRenderedStartIndex=_,a._lastRenderedStopIndex=v,a._ensureRowsLoaded(_,v)},a._setRef=function(g){a._listRef=g},r),me(a,d)}return Rs(e,[{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 d=this.props,u=d.isItemLoaded,m=d.itemCount,h=d.minimumBatchSize,g=h===void 0?10:h,_=d.threshold,v=_===void 0?15:_,o=Cs({isItemLoaded:u,itemCount:m,minimumBatchSize:g,startIndex:Math.max(0,r-v),stopIndex:Math.min(m-1,a+v)});(this._memoizedUnloadedRanges.length!==o.length||this._memoizedUnloadedRanges.some(function(x,I){return o[I]!==x}))&&(this._memoizedUnloadedRanges=o,this._loadUnloadedRanges(o))}},{key:"_loadUnloadedRanges",value:function(r){for(var a=this,d=this.props.loadMoreItems||this.props.loadMoreRows,u=function(g){var _=r[g],v=r[g+1],o=d(_,v);o!=null&&o.then(function(){if(Os({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:_,stopIndex:v})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(_,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},m=0;m<r.length;m+=2)u(m)}}]),e}(M.PureComponent);const Us=()=>n.C1,qs=n.styled_default("div")({name:"a",class:"a1w9zony",propsAsIs:!1}),Ys=n.styled_default("div")({name:"l",class:"l16qcfv8",propsAsIs:!1}),Ps=n.styled_default("img")({name:"p",class:"p1gmcc5f",propsAsIs:!1}),Fs=n.styled_default("div")({name:"s",class:"s1doddh0",propsAsIs:!1}),Ws=n.styled_default("div")({name:"c",class:"c1js9xhe",propsAsIs:!1}),Vs=n.styled_default("div")({name:"d",class:"d1tmnqsh",propsAsIs:!1}),Hs=n.styled_default("span")({name:"g",class:"gi9h87j",propsAsIs:!1}),Bs=n.styled_default(Us())({name:"x",class:"x13mk3z6",propsAsIs:!0}),Gs=({rank:t,avatar:e,name:i,points:r,isCurrentUser:a,openItemDetail:d,style:u})=>s.jsxs(qs,{onClick:d,style:u,children:[s.jsx(Ys,{children:t||0}),s.jsxs(Ws,{children:[e?s.jsx(Ps,{alt:"leaderboard-item-avatar",src:e}):s.jsx(Fs,{children:n.o$1(i||"")}),s.jsxs(Vs,{children:[s.jsx(Hs,{children:i||""}),a&&s.jsx(Bs,{name:"icon-star"})]})]}),s.jsx("div",{children:n.i(r)})]}),Zs=({items:t,openItemDetail:e,fetchMore:i})=>s.jsx(Ms,{children:({width:r,height:a})=>s.jsx(Qs,{isItemLoaded:d=>d<t.length,itemCount:t.length+1,loadMoreItems:i,children:({onItemsRendered:d,ref:u})=>s.jsx(Es,{itemSize:56,onItemsRendered:d,ref:u,itemCount:t.length,width:r,height:a,children:({index:m,style:h})=>s.jsx(Gs,{style:{...h,maxHeight:48},...t[m],openItemDetail:()=>e(t[m].userId)},t[m].userId)})})});const Js=()=>n.C1,Ks=()=>n.C1,Xs=n.styled_default("div")({name:"a",class:"ay8exst",propsAsIs:!1}),en=n.styled_default("div")({name:"l",class:"l31riw0",propsAsIs:!1}),tn=n.styled_default(Js())({name:"p",class:"pcmm4w7",propsAsIs:!0}),sn=n.styled_default("div")({name:"c",class:"cct922a",propsAsIs:!1}),nn=n.styled_default("div")({name:"s",class:"s12b7u74",propsAsIs:!1}),rn=n.styled_default("div")({name:"x",class:"x1896nrl",propsAsIs:!1}),an=n.styled_default("div")({name:"d",class:"d1vnagog",propsAsIs:!1}),ln=n.styled_default("div")({name:"g",class:"gznzzc2",propsAsIs:!1}),on=n.styled_default("span")({name:"f",class:"fnmvyxu",propsAsIs:!1}),cn=n.styled_default("span")({name:"h",class:"h1iubd2g",propsAsIs:!1}),dn=n.styled_default(Ks())({name:"m",class:"mmvjfuo",propsAsIs:!0}),un=n.styled_default("div")({name:"v",class:"v1oi1553",propsAsIs:!1}),pn=n.styled_default("a")({name:"w",class:"w1vwcogq",propsAsIs:!1}),fn=n.styled_default("span")({name:"u",class:"utbqo0e",propsAsIs:!1}),hn=({inviteLink:t,socialLinks:e,inviteCardTitle:i,inviteCardSubtext:r,primaryColor:a,className:d})=>s.jsxs(Xs,{className:d,children:[s.jsx(en,{style:{backgroundColor:a},children:s.jsx(tn,{name:"invite-game-icon"})}),s.jsxs(sn,{children:[s.jsx(nn,{children:i||""}),s.jsx(rn,{children:r||""})]}),t&&s.jsxs(an,{onClick:async()=>{if(t)try{await navigator.clipboard.writeText(t)}catch(u){console.error("Unable to copy to clipboard",u)}},children:[s.jsxs(ln,{children:[s.jsx(on,{children:"Invite link"}),s.jsx(cn,{children:t})]}),s.jsx(dn,{name:"icon-copy"})]}),e&&e.length>0&&s.jsx(un,{children:e.map(({icon:u,link:m,label:h})=>s.jsxs(pn,{href:m,target:"_blank",children:[s.jsx(n.C1,{name:u}),s.jsx(fn,{children:h})]},m))})]}),mn=({deepLink:t})=>{const{data:e}=n.useStore(t.$store);return s.jsx(hn,{inviteLink:e==null?void 0:e.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."})},gn=({gamification:t})=>{const{data:e}=n.useStore(t.leaderboardList.$store);return e!=null&&e.length?s.jsx(Zs,{fetchMore:t.leaderboardList.fetchMore,items:e,openItemDetail:t.openUser}):s.jsx(mn,{deepLink:t.deepLink})};const yn=n.styled_default("button")({name:"a",class:"akly9h2",propsAsIs:!1}),In=n.styled_default("span")({name:"e",class:"eptoiz9",propsAsIs:!1}),xn=({disabled:t,variant:e="primary",onClick:i,children:r,...a})=>s.jsx(yn,{onClick:i,disabled:t,"data-variant":e,...a,children:s.jsx(In,{children:r})});const vn=()=>n.C1,_n=()=>n.C1,jn=n.styled_default("div")({name:"s",class:"s1lblda3",propsAsIs:!1}),Mn=n.styled_default("div")({name:"a",class:"ascvb2g",propsAsIs:!1}),zn=n.styled_default("div")({name:"p",class:"p17rl8zy",propsAsIs:!1}),Nn=n.styled_default("div")({name:"l",class:"l1vvttbn",propsAsIs:!1}),Y=n.styled_default(vn())({name:"c",class:"c6fk2ph",propsAsIs:!0}),Tn=n.styled_default(_n())({name:"d",class:"d1rdm136",propsAsIs:!0}),An=n.styled_default("div")({name:"f",class:"fwqnnel",propsAsIs:!1}),Sn=n.styled_default("div")({name:"u",class:"ucyxnlg",propsAsIs:!1}),Dn={[n.PickHistoryStatus.LOST]:s.jsx(Y,{name:"icon-cross"}),[n.PickHistoryStatus.WON]:s.jsx(Y,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:void 0,[n.PickHistoryStatus.DNP]:s.jsx(Y,{name:"icon-arrow"})},wn=({questionId:t,questionType:e,questionStatus:i,subject:r,openForVoting:a,openQuestion:d,status:u})=>{const m=n.o[e],h=Dn[u];return m?s.jsxs(jn,{onClick:()=>d==null?void 0:d(t),children:[s.jsxs(Sn,{children:[s.jsxs(Mn,{children:[s.jsx(Tn,{name:m.iconName}),s.jsxs(An,{children:[m.label,e===n.QuestionType.TRIVIA&&i===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(zn,{children:r||""})]}),s.jsx(Nn,{children:h||(a?s.jsx(xn,{children:"Play"}):null)})]}):null};const kn=n.styled_default("div")({name:"n",class:"n1jcgove",propsAsIs:!1}),bn=n.styled_default("button")({name:"l",class:"l1bwp7hh",propsAsIs:!1}),En=({openInsight:t,questionId:e,...i})=>s.jsxs(kn,{children:[s.jsx(je,{questionId:e,...i}),t&&s.jsx(bn,{onClick:()=>t(e),children:"View Insight"})]});const On=n.styled_default("div")({name:"t",class:"t19vr3p1",propsAsIs:!1}),Cn=({questions:t,openQuestion:e})=>s.jsx(On,{children:t==null?void 0:t.map(i=>{var r,a;if(i.type==="question"&&((r=i.attributes)==null?void 0:r.attributes.case)==="question"){const d=i.attributes.attributes.value;return s.jsx(wn,{openQuestion:e,...d},d.questionId)}if(i.type==="insight"&&((a=i.attributes)==null?void 0:a.attributes.case)==="insight"){const d=i.attributes.attributes.value;return s.jsx(En,{openInsight:e,...d},d.questionId)}return null})}),Ln=({store:t,openQuestion:e})=>{const i=n.useStore(t);return i!=null&&i.data?s.jsx(Cn,{openQuestion:e,questions:i.data}):s.jsx("div",{children:"wait questions..."})},Rn=({userSummary:t})=>{var e,i;const r=n.useStore(t.getStore());return(e=r.data)!=null&&e.summary?s.jsx(Ie,{...r.data.summary,successRate:(i=r.data.percentage)==null?void 0:i.correct}):s.jsx("div",{children:"wait user..."})},$n=({gamification:t})=>{const[e,i]=M.useState(b.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[s.jsxs(n.e,{children:[s.jsx(_s,{activePage:e,toggleActivePage:i}),e===b.HOME&&s.jsx(Rn,{userSummary:t.userSummary})]}),e===b.HOME&&s.jsx(n.n$1,{children:s.jsx(Ln,{openQuestion:t.openQuestion,store:t.feedList.getStore()})}),e===b.LEADERBOARD&&s.jsx(n.e,{style:{flex:"1 1 auto",paddingTop:0,paddingBottom:0},children:s.jsx(gn,{gamification:t})})]})};const Qn=()=>n.f,ge=n.styled_default(Qn())({name:"n",class:"n1ph66cs",propsAsIs:!0}),Un=n.styled_default("div")({name:"x",class:"xorme7i",propsAsIs:!1}),qn=({correct:t,incorrect:e})=>{const i=t+e;return i===0?0:Math.round(t/i*100)},Me=({gamification:t,className:e})=>{const i=n.useStore(t.openedQuestion.$store),r=n.useStore(t.openedUser);return s.jsxs(s.Fragment,{children:[i&&s.jsx(ge,{className:e,children:s.jsx(gs,{gamification:t})}),r&&s.jsx(ge,{className:e,children:s.jsxs(Un,{children:[s.jsx(ye,{label:"Friend's Rank",close:t.closeUser}),s.jsx(n.e,{children:s.jsx(Ie,{...r,successRate:qn(r)})})]})}),s.jsx(n.r,{className:e,"data-nav":"true",children:s.jsx($n,{gamification:t})})]})};exports.GamificationOverlay=Me;exports.default=Me;