@streamlayer/react 0.31.12 → 0.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- "use strict";const n=require("react/jsx-runtime"),ae=require("./index2.js"),j=require("react"),U=require("@streamlayer/sdk-web-types"),X=require("@nanostores/react"),de=require("@streamlayer/sdk-web-interfaces"),d=require("./index4.js"),me=require("@streamlayer/sdk-web-notifications"),Rt=({feature:o,sdk:s,children:c,className:p})=>{const m=X.useStore(o.status),y=X.useStore(s.sdkStore.slStreamId);return y!=null&&y.loading?n.jsx("div",{className:p,children:"event is loading..."}):y!=null&&y.data?m!==de.FeatureStatus.Ready?n.jsx("div",{className:p,children:"wait feature..."}):c:n.jsx("div",{className:p,children:"event is forbidden..."})},Ut=j.lazy(()=>Promise.resolve().then(()=>require("./gamification-feature.js"))),zt=({sdk:o,feature:s,className:c})=>{const p=j.useMemo(()=>s&&s.featureConfig.get().type===U.FeatureType.GAMES?n.jsx(Rt,{className:c,sdk:o,feature:s,children:n.jsx(Ut,{className:c,gamification:s,sdk:o})}):null,[o,s,c]);return n.jsx(j.Suspense,{fallback:n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"page loading..."}),children:p})},Ot=d.styled_default("button")({name:"SButton",class:"sxxa0c",propsAsIs:!1}),Dt=d.styled_default("span")({name:"ButtonIcon",class:"b193dcyu",propsAsIs:!1}),Pt=d.styled_default("span")({name:"ButtonLabel",class:"b40tuix",propsAsIs:!1}),Se=({disabled:o,active:s,onClick:c,label:p,icon:m})=>n.jsx(Ot,{onClick:c,disabled:o,"data-selected":s,children:n.jsxs(n.Fragment,{children:[m&&n.jsx(Dt,{children:m}),n.jsx(Pt,{children:p})]})}),qt=()=>d.n1,Mt=d.styled_default(qt())({name:"ButtonIcon",class:"b1whzxvd",propsAsIs:!0}),le="channels",Gt=o=>{var s;return n.jsx(Se,{...o,id:"channels",label:"Channels",icon:n.jsx(Mt,{name:"icon-btn-channels","data-selected":(s=o.active)==null?void 0:s.toString()})})},Wt=()=>d.n1,Ht=d.styled_default(Wt())({name:"ButtonIcon",class:"b11des7c",propsAsIs:!0}),J="featuredGroups",Qt=o=>{var s;return n.jsx(Se,{...o,label:"FG+",id:"featuredGroups",icon:n.jsx(Ht,{name:"icon-btn-feature-groups","data-selected":(s=o.active)==null?void 0:s.toString()})})},Yt=()=>d.n1,Vt=d.styled_default(Yt())({name:"ButtonIcon",class:"b180jd7l",propsAsIs:!0}),xe="leaderboard",Kt=o=>{var s;return n.jsx(Se,{...o,label:"Leader Board",id:"leaderboard",icon:n.jsx(Vt,{name:"icon-btn-leaderboard","data-selected":(s=o.active)==null?void 0:s.toString()})})},Xt=d.styled_default("div")({name:"Buttons",class:"b6tbwuy",propsAsIs:!1}),Jt=({children:o,className:s})=>n.jsx(Xt,{className:s,children:o}),Zt=()=>Jt,er=d.styled_default(Zt())({name:"Navigation",class:"n19lpak2",propsAsIs:!0}),tr=({activeOverlay:o,setActiveOverlay:s,sdkReady:c,className:p})=>n.jsxs(er,{className:p,children:[n.jsx(Gt,{active:o===le,onClick:()=>s(le)}),n.jsx(Qt,{active:o===J,disabled:!c,onClick:()=>{s(J)}}),n.jsx(Kt,{active:o===xe,onClick:()=>s(xe)})]}),ot={[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"}},rr=d.styled_default("div")({name:"Container",class:"c1bgb86j",propsAsIs:!1}),ir=d.styled_default("video")({name:"Player",class:"p6703cq",propsAsIs:!1}),nr=d.styled_default("img")({name:"Poster",class:"p12ow7zo",propsAsIs:!1}),sr=d.styled_default("div")({name:"Control",class:"cdpal9o",propsAsIs:!1}),at=({poster:o,source:s})=>{const c=j.useRef(null),[p,m]=j.useState(!1),[y,f]=j.useState(!0);return n.jsxs(rr,{onClick:()=>{const a=c==null?void 0:c.current;a&&m(g=>g?(a.pause(),!1):(a.play(),f(!1),!0))},children:[n.jsx(ir,{ref:c,src:s,onEnded:()=>{var a;(a=c==null?void 0:c.current)==null||a.load(),m(!1),f(!0)},style:{visibility:y?"hidden":"visible"}}),n.jsx(nr,{src:o,style:{visibility:y?"visible":"hidden"}}),n.jsx(sr,{children:!p&&n.jsx(d.n1,{name:"icon-play"})})]})},or=d.styled_default("div")({name:"InsightContainer",class:"i1pqqgpo",propsAsIs:!1}),ar=d.styled_default("img")({name:"Image",class:"igj7luu",propsAsIs:!1}),lr=d.styled_default("div")({name:"InsightContent",class:"i1qne9g6",propsAsIs:!1}),cr=d.styled_default("h3")({name:"Title",class:"ttpr98r",propsAsIs:!1}),ur=d.styled_default("div")({name:"Description",class:"d17iaqp8",propsAsIs:!1}),dr=d.styled_default("button")({name:"ActionBtn",class:"a16t3y7s",propsAsIs:!1}),hr=({video:o,image:s,heading:c,body:p,action:m})=>n.jsxs(or,{children:[(o==null?void 0:o.url)&&n.jsx(at,{source:o.url,poster:o.thumbnailUrl}),s&&n.jsx(ar,{src:s}),n.jsxs(lr,{children:[n.jsx(cr,{children:c}),n.jsx(ur,{children:p}),m&&n.jsx(dr,{onClick:m,children:"View Insight"})]})]}),re=d.styled_default("div")({name:"BGWrap",class:"b1dqe0sz",propsAsIs:!1}),O=d.styled_default("div")({name:"BGLineBase",class:"b1v6w7ni",propsAsIs:!1}),pr=()=>O,fr=d.styled_default(pr())({name:"BGOneLineOne",class:"b2nqb1p",propsAsIs:!0}),mr=()=>O,yr=d.styled_default(mr())({name:"BGOneLineTwo",class:"b1xxgmbk",propsAsIs:!0}),xr=()=>O,gr=d.styled_default(xr())({name:"BGOneLineThree",class:"b63lwcb",propsAsIs:!0}),wr=()=>O,He=d.styled_default(wr())({name:"BGTwoLineOne",class:"b2iah4",propsAsIs:!0}),_r=()=>O,Qe=d.styled_default(_r())({name:"BGTwoLineTwo",class:"b1xezvf6",propsAsIs:!0}),Ir=()=>O,Ye=d.styled_default(Ir())({name:"BGTwoLineThree",class:"b1jz1hg0",propsAsIs:!0}),Ar=()=>O,Ve=d.styled_default(Ar())({name:"BGThreeLineOne",class:"b18ho1tk",propsAsIs:!0}),br=()=>O,Ke=d.styled_default(br())({name:"BGThreeLineTwo",class:"b14uvjfm",propsAsIs:!0}),Er=()=>O,Xe=d.styled_default(Er())({name:"BGThreeLineThree",class:"b11c3ns7",propsAsIs:!0}),Br=()=>O,Je=d.styled_default(Br())({name:"BGThreeLineFour",class:"b1bqhhet",propsAsIs:!0}),vr=()=>O,jr=d.styled_default(vr())({name:"BGFourLineOne",class:"b1xyzi7o",propsAsIs:!0}),Tr=()=>O,Cr=d.styled_default(Tr())({name:"BGFourLineTwo",class:"byo0rup",propsAsIs:!0}),Fr=()=>O,Sr=d.styled_default(Fr())({name:"BGFourLineThree",class:"b1oyiqgv",propsAsIs:!0}),$r=()=>O,kr=d.styled_default($r())({name:"BGFourLineFour",class:"bx3ddqw",propsAsIs:!0}),Lr=({step:o,correct:s})=>n.jsxs(n.Fragment,{children:[n.jsxs(re,{"data-active":o===1,"data-first-screen":"true",children:[n.jsx(fr,{}),n.jsx(yr,{}),n.jsx(gr,{})]}),n.jsxs(re,{"data-active":o===2,children:[n.jsx(He,{}),n.jsx(Qe,{}),n.jsx(Ye,{})]}),n.jsxs(re,{"data-active":o===3,children:[n.jsx(He,{}),n.jsx(Qe,{}),n.jsx(Ye,{})]}),s?n.jsxs(n.Fragment,{children:[n.jsxs(re,{"data-active":o===4,"data-correct":"false",children:[n.jsx(Ve,{}),n.jsx(Ke,{}),n.jsx(Xe,{}),n.jsx(Je,{})]}),n.jsxs(re,{"data-active":o===5,"data-correct":"false","data-last-screen":"true",children:[n.jsx(Ve,{}),n.jsx(Ke,{}),n.jsx(Xe,{}),n.jsx(Je,{})]})]}):n.jsxs(re,{"data-active":o===4,"data-correct":"false","data-last-screen":"true",children:[n.jsx(jr,{}),n.jsx(Cr,{}),n.jsx(Sr,{}),n.jsx(kr,{})]})]}),Nr=d.styled_default("div")({name:"Container",class:"c10131zw",propsAsIs:!1}),Rr=d.styled_default("div")({name:"AnimateContent",class:"ar6k2eo",propsAsIs:!1}),ie=d.styled_default("div")({name:"Content",class:"c1hwoq9l",propsAsIs:!1}),ne=d.styled_default("div")({name:"Title",class:"t4ujo4g",propsAsIs:!1}),he=d.styled_default("div")({name:"Subtitle",class:"s1pjil1h",propsAsIs:!1}),Ur=()=>he,Ze=d.styled_default(Ur())({name:"SubtitleFG",class:"s1iorwr9",propsAsIs:!0}),fe=d.styled_default("div")({name:"AnswerText",class:"a51sv9d",propsAsIs:!1}),zr=()=>d.n1,Ae=d.styled_default(zr())({name:"FeedbackIcon",class:"f1lbk2ye",propsAsIs:!0}),et=d.styled_default("button")({name:"CloseButton",class:"crcvk3t",propsAsIs:!1}),Or=()=>d.n1,tt=d.styled_default(Or())({name:"CloseIcon",class:"c33p82r",propsAsIs:!0}),Dr=({close:o,votedAnswer:s,correct:c,correctAnswerTitle:p})=>{const[m,y]=j.useState(1);return j.useEffect(()=>{const f=setInterval(()=>{y(a=>c&&a>4||!c&&a>3?a:++a)},6e3);return()=>clearInterval(f)},[c]),n.jsxs(Nr,{"data-bg-color-white":m>3,children:[n.jsx(Lr,{step:m,correct:c}),n.jsxs(Rr,{"data-active-number":m,children:[n.jsxs(ie,{children:[n.jsx(ne,{children:"Master"}),n.jsx(Ze,{children:"FEATURED GROUPS +"})]}),n.jsxs(ie,{children:[n.jsx(ne,{children:"Prediction results are in!"}),n.jsx(Ze,{children:"FEATURED GROUPS +"})]}),n.jsxs(ie,{children:[n.jsx(ne,{children:"Who holds the most birdies in golf?"}),n.jsxs(he,{children:["Your Pick: ",n.jsx(fe,{children:s==null?void 0:s.title})]})]}),c?n.jsxs(n.Fragment,{children:[n.jsxs(ie,{"data-color-green":"true",children:[n.jsx(ne,{children:"Congratulations! You answered correctly."}),n.jsxs(he,{children:[n.jsx(Ae,{name:"selected"}),"Your Pick: ",n.jsx(fe,{children:s==null?void 0:s.title})]})]}),n.jsxs(ie,{"data-color-green":"true",children:[n.jsx(et,{onClick:o,children:n.jsx(tt,{name:"icon-cross"})}),n.jsxs(ne,{children:["+",s==null?void 0:s.points," points"]}),n.jsxs(he,{children:[n.jsx(Ae,{name:"selected"}),"Your Pick: ",n.jsx(fe,{children:s==null?void 0:s.title})]})]})]}):n.jsxs(ie,{children:[n.jsx(et,{onClick:o,children:n.jsx(tt,{name:"icon-cross"})}),n.jsxs(ne,{"data-incorrect":"true",children:["Better luck next time! Correct: ",p,"."]}),n.jsxs(he,{"data-incorrect":"true",children:[n.jsx(Ae,{name:"circleClose"}),"Your Pick: ",n.jsx(fe,{children:s==null?void 0:s.title})]})]})]})]})},Pr=d.styled_default("div")({name:"Container",class:"c1eptrjd",propsAsIs:!1}),qr=d.styled_default("div")({name:"CloseIconWrap",class:"crylm65",propsAsIs:!1}),Mr=()=>d.n1,Gr=d.styled_default(Mr())({name:"CloseIcon",class:"c9mrcz7",propsAsIs:!0}),Wr=d.styled_default("div")({name:"Header",class:"hw3lzv4",propsAsIs:!1}),Hr=()=>d.n1,Qr=d.styled_default(Hr())({name:"TypeIcon",class:"t1rrb3kf",propsAsIs:!0}),Yr=d.styled_default("span")({name:"TypeName",class:"t1ydnjov",propsAsIs:!1}),Vr=d.styled_default("div")({name:"Question",class:"qlf90cl",propsAsIs:!1}),Kr=d.styled_default("button")({name:"AnswerButton",class:"a1e0nhcl",propsAsIs:!1}),Xr=d.styled_default("div")({name:"Container",class:"cjq447q",propsAsIs:!1}),Jr=d.styled_default("div")({name:"ImageContainer",class:"i14egogb",propsAsIs:!1}),Zr=d.styled_default("img")({name:"Image",class:"i2g9g4l",propsAsIs:!1}),ei=d.styled_default("div")({name:"Details",class:"d1c454nm",propsAsIs:!1}),ti=d.styled_default("div")({name:"Name",class:"n11nigc3",propsAsIs:!1}),ri=d.styled_default("div")({name:"UserName",class:"urxa4k8",propsAsIs:!1}),ii=({image:o,name:s,userName:c,verified:p})=>n.jsxs(Xr,{children:[n.jsx(Jr,{children:n.jsx(Zr,{src:o})}),n.jsxs(ei,{children:[n.jsxs(ti,{children:[s," ",p&&n.jsx(d.n1,{name:"icon-twitter-verified"})]}),n.jsx(ri,{children:c})]})]}),ni=d.styled_default("div")({name:"Container",class:"c1t4f0x4",propsAsIs:!1}),si=d.styled_default("button")({name:"ActionBtn",class:"a16w1nl6",propsAsIs:!1}),oi=d.styled_default("div")({name:"Body",class:"b14u54rf",propsAsIs:!1}),ai=d.styled_default("img")({name:"Image",class:"i1hxm6zo",propsAsIs:!1}),li=d.styled_default("div")({name:"Details",class:"d1s19yop",propsAsIs:!1}),ci=d.styled_default("div")({name:"QuoteWrap",class:"q1qyx94r",propsAsIs:!1}),ui=d.styled_default("blockquote")({name:"Quote",class:"qs97clu",propsAsIs:!1}),di=({account:o,body:s,image:c,title:p,action:m})=>n.jsxs(ni,{children:[n.jsx(ci,{children:n.jsx(ui,{children:p})}),n.jsxs(li,{children:[n.jsx(ii,{...o}),n.jsx(oi,{children:s}),c&&n.jsx(ai,{src:c})]}),m&&n.jsx(si,{onClick:m,children:"View Tweet"})]}),rt=({close:o,action:s,data:{questionType:c,question:p,insight:m,tweet:y}})=>{const f=ot[c];return f?p!=null&&p.predictionResult?n.jsx(Dr,{close:o,...p}):n.jsxs(Pr,{children:[n.jsx(qr,{onClick:o,children:n.jsx(Gr,{name:"icon-cross"})}),c!==U.QuestionType.TWEET&&n.jsxs(Wr,{children:[n.jsx(Qr,{"data-type-trivia":c===U.QuestionType.TRIVIA,"data-type-poll":c===U.QuestionType.POLL,name:f.iconName}),n.jsx(Yr,{children:f.label})]}),c===U.QuestionType.FACTOID&&n.jsx(hr,{...m,action:s}),c===U.QuestionType.TWEET&&n.jsx(di,{...y,action:s}),c!==U.QuestionType.FACTOID&&c!==U.QuestionType.TWEET&&n.jsxs(n.Fragment,{children:[n.jsx(Vr,{children:p==null?void 0:p.title}),n.jsx(Kr,{onClick:s,children:"Answer"})]})]}):null};var lt={},ct={},ge={};ge.byteLength=fi;ge.toByteArray=yi;ge.fromByteArray=wi;var H=[],P=[],hi=typeof Uint8Array<"u"?Uint8Array:Array,be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var se=0,pi=be.length;se<pi;++se)H[se]=be[se],P[be.charCodeAt(se)]=se;P["-".charCodeAt(0)]=62;P["_".charCodeAt(0)]=63;function ut(o){var s=o.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=o.indexOf("=");c===-1&&(c=s);var p=c===s?0:4-c%4;return[c,p]}function fi(o){var s=ut(o),c=s[0],p=s[1];return(c+p)*3/4-p}function mi(o,s,c){return(s+c)*3/4-c}function yi(o){var s,c=ut(o),p=c[0],m=c[1],y=new hi(mi(o,p,m)),f=0,a=m>0?p-4:p,g;for(g=0;g<a;g+=4)s=P[o.charCodeAt(g)]<<18|P[o.charCodeAt(g+1)]<<12|P[o.charCodeAt(g+2)]<<6|P[o.charCodeAt(g+3)],y[f++]=s>>16&255,y[f++]=s>>8&255,y[f++]=s&255;return m===2&&(s=P[o.charCodeAt(g)]<<2|P[o.charCodeAt(g+1)]>>4,y[f++]=s&255),m===1&&(s=P[o.charCodeAt(g)]<<10|P[o.charCodeAt(g+1)]<<4|P[o.charCodeAt(g+2)]>>2,y[f++]=s>>8&255,y[f++]=s&255),y}function xi(o){return H[o>>18&63]+H[o>>12&63]+H[o>>6&63]+H[o&63]}function gi(o,s,c){for(var p,m=[],y=s;y<c;y+=3)p=(o[y]<<16&16711680)+(o[y+1]<<8&65280)+(o[y+2]&255),m.push(xi(p));return m.join("")}function wi(o){for(var s,c=o.length,p=c%3,m=[],y=16383,f=0,a=c-p;f<a;f+=y)m.push(gi(o,f,f+y>a?a:f+y));return p===1?(s=o[c-1],m.push(H[s>>2]+H[s<<4&63]+"==")):p===2&&(s=(o[c-2]<<8)+o[c-1],m.push(H[s>>10]+H[s>>4&63]+H[s<<2&63]+"=")),m.join("")}var $e={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */$e.read=function(o,s,c,p,m){var y,f,a=m*8-p-1,g=(1<<a)-1,E=g>>1,A=-7,v=c?m-1:0,x=c?-1:1,w=o[s+v];for(v+=x,y=w&(1<<-A)-1,w>>=-A,A+=a;A>0;y=y*256+o[s+v],v+=x,A-=8);for(f=y&(1<<-A)-1,y>>=-A,A+=p;A>0;f=f*256+o[s+v],v+=x,A-=8);if(y===0)y=1-E;else{if(y===g)return f?NaN:(w?-1:1)*(1/0);f=f+Math.pow(2,p),y=y-E}return(w?-1:1)*f*Math.pow(2,y-p)};$e.write=function(o,s,c,p,m,y){var f,a,g,E=y*8-m-1,A=(1<<E)-1,v=A>>1,x=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=p?0:y-1,_=p?1:-1,b=s<0||s===0&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(a=isNaN(s)?1:0,f=A):(f=Math.floor(Math.log(s)/Math.LN2),s*(g=Math.pow(2,-f))<1&&(f--,g*=2),f+v>=1?s+=x/g:s+=x*Math.pow(2,1-v),s*g>=2&&(f++,g/=2),f+v>=A?(a=0,f=A):f+v>=1?(a=(s*g-1)*Math.pow(2,m),f=f+v):(a=s*Math.pow(2,v-1)*Math.pow(2,m),f=0));m>=8;o[c+w]=a&255,w+=_,a/=256,m-=8);for(f=f<<m|a,E+=m;E>0;o[c+w]=f&255,w+=_,f/=256,E-=8);o[c+w-_]|=b*128};/*!
1
+ "use strict";const n=require("react/jsx-runtime"),ae=require("./index2.js"),j=require("react"),U=require("@streamlayer/sdk-web-types"),X=require("@nanostores/react"),de=require("@streamlayer/sdk-web-interfaces"),d=require("./index4.js"),me=require("@streamlayer/sdk-web-notifications"),Rt=({feature:o,sdk:s,children:c,className:p})=>{const m=X.useStore(o.status),y=X.useStore(s.sdkStore.slStreamId);return y!=null&&y.loading?n.jsx("div",{className:p,children:"event is loading..."}):y!=null&&y.data?m!==de.FeatureStatus.Ready?n.jsx("div",{className:p,children:"wait feature..."}):c:n.jsx("div",{className:p,children:"event is forbidden..."})},Ut=j.lazy(()=>Promise.resolve().then(()=>require("./gamification-feature.js"))),zt=({sdk:o,feature:s,className:c})=>{const p=j.useMemo(()=>s&&s.featureConfig.get().type===U.FeatureType.GAMES?n.jsx(Rt,{className:c,sdk:o,feature:s,children:n.jsx(Ut,{className:c,gamification:s,sdk:o})}):null,[o,s,c]);return n.jsx(j.Suspense,{fallback:n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"page loading..."}),children:p})},Ot=d.styled_default("button")({name:"SButton",class:"sxxa0c",propsAsIs:!1}),Dt=d.styled_default("span")({name:"ButtonIcon",class:"b193dcyu",propsAsIs:!1}),Pt=d.styled_default("span")({name:"ButtonLabel",class:"b40tuix",propsAsIs:!1}),Se=({disabled:o,active:s,onClick:c,label:p,icon:m})=>n.jsx(Ot,{onClick:c,disabled:o,"data-selected":s,children:n.jsxs(n.Fragment,{children:[m&&n.jsx(Dt,{children:m}),n.jsx(Pt,{children:p})]})}),Mt=()=>d.n1,qt=d.styled_default(Mt())({name:"ButtonIcon",class:"b1whzxvd",propsAsIs:!0}),le="channels",Wt=o=>{var s;return n.jsx(Se,{...o,id:"channels",label:"Channels",icon:n.jsx(qt,{name:"icon-btn-channels","data-selected":(s=o.active)==null?void 0:s.toString()})})},Gt=()=>d.n1,Ht=d.styled_default(Gt())({name:"ButtonIcon",class:"b11des7c",propsAsIs:!0}),J="featuredGroups",Qt=o=>{var s;return n.jsx(Se,{...o,label:"FG+",id:"featuredGroups",icon:n.jsx(Ht,{name:"icon-btn-feature-groups","data-selected":(s=o.active)==null?void 0:s.toString()})})},Yt=()=>d.n1,Vt=d.styled_default(Yt())({name:"ButtonIcon",class:"b180jd7l",propsAsIs:!0}),xe="leaderboard",Kt=o=>{var s;return n.jsx(Se,{...o,label:"Leader Board",id:"leaderboard",icon:n.jsx(Vt,{name:"icon-btn-leaderboard","data-selected":(s=o.active)==null?void 0:s.toString()})})},Xt=d.styled_default("div")({name:"Buttons",class:"b6tbwuy",propsAsIs:!1}),Jt=({children:o,className:s})=>n.jsx(Xt,{className:s,children:o}),Zt=()=>Jt,er=d.styled_default(Zt())({name:"Navigation",class:"n19lpak2",propsAsIs:!0}),tr=({activeOverlay:o,setActiveOverlay:s,sdkReady:c,className:p})=>n.jsxs(er,{className:p,children:[n.jsx(Wt,{active:o===le,onClick:()=>s(le)}),n.jsx(Qt,{active:o===J,disabled:!c,onClick:()=>{s(J)}}),n.jsx(Kt,{active:o===xe,onClick:()=>s(xe)})]}),ot={[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"}},rr=d.styled_default("div")({name:"Container",class:"c1bgb86j",propsAsIs:!1}),ir=d.styled_default("video")({name:"Player",class:"p6703cq",propsAsIs:!1}),nr=d.styled_default("img")({name:"Poster",class:"p12ow7zo",propsAsIs:!1}),sr=d.styled_default("div")({name:"Control",class:"cdpal9o",propsAsIs:!1}),at=({poster:o,source:s})=>{const c=j.useRef(null),[p,m]=j.useState(!1),[y,f]=j.useState(!0);return n.jsxs(rr,{onClick:()=>{const a=c==null?void 0:c.current;a&&m(g=>g?(a.pause(),!1):(a.play(),f(!1),!0))},children:[n.jsx(ir,{ref:c,src:s,onEnded:()=>{var a;(a=c==null?void 0:c.current)==null||a.load(),m(!1),f(!0)},style:{visibility:y?"hidden":"visible"}}),n.jsx(nr,{src:o,style:{visibility:y?"visible":"hidden"}}),n.jsx(sr,{children:!p&&n.jsx(d.n1,{name:"icon-play"})})]})},or=d.styled_default("div")({name:"InsightContainer",class:"i1pqqgpo",propsAsIs:!1}),ar=d.styled_default("img")({name:"Image",class:"igj7luu",propsAsIs:!1}),lr=d.styled_default("div")({name:"InsightContent",class:"i1qne9g6",propsAsIs:!1}),cr=d.styled_default("h3")({name:"Title",class:"ttpr98r",propsAsIs:!1}),ur=d.styled_default("div")({name:"Description",class:"d17iaqp8",propsAsIs:!1}),dr=d.styled_default("button")({name:"ActionBtn",class:"a16t3y7s",propsAsIs:!1}),hr=({video:o,image:s,heading:c,body:p,action:m})=>n.jsxs(or,{children:[(o==null?void 0:o.url)&&n.jsx(at,{source:o.url,poster:o.thumbnailUrl}),s&&n.jsx(ar,{src:s}),n.jsxs(lr,{children:[n.jsx(cr,{children:c}),n.jsx(ur,{children:p}),m&&n.jsx(dr,{onClick:m,children:"View Insight"})]})]}),re=d.styled_default("div")({name:"BGWrap",class:"b1dqe0sz",propsAsIs:!1}),O=d.styled_default("div")({name:"BGLineBase",class:"b1v6w7ni",propsAsIs:!1}),pr=()=>O,fr=d.styled_default(pr())({name:"BGOneLineOne",class:"b2nqb1p",propsAsIs:!0}),mr=()=>O,yr=d.styled_default(mr())({name:"BGOneLineTwo",class:"b1xxgmbk",propsAsIs:!0}),xr=()=>O,gr=d.styled_default(xr())({name:"BGOneLineThree",class:"b63lwcb",propsAsIs:!0}),wr=()=>O,He=d.styled_default(wr())({name:"BGTwoLineOne",class:"b2iah4",propsAsIs:!0}),_r=()=>O,Qe=d.styled_default(_r())({name:"BGTwoLineTwo",class:"b1xezvf6",propsAsIs:!0}),Ir=()=>O,Ye=d.styled_default(Ir())({name:"BGTwoLineThree",class:"b1jz1hg0",propsAsIs:!0}),Ar=()=>O,Ve=d.styled_default(Ar())({name:"BGThreeLineOne",class:"b18ho1tk",propsAsIs:!0}),Er=()=>O,Ke=d.styled_default(Er())({name:"BGThreeLineTwo",class:"b14uvjfm",propsAsIs:!0}),br=()=>O,Xe=d.styled_default(br())({name:"BGThreeLineThree",class:"b11c3ns7",propsAsIs:!0}),vr=()=>O,Je=d.styled_default(vr())({name:"BGThreeLineFour",class:"b1bqhhet",propsAsIs:!0}),Br=()=>O,jr=d.styled_default(Br())({name:"BGFourLineOne",class:"b1xyzi7o",propsAsIs:!0}),Tr=()=>O,Cr=d.styled_default(Tr())({name:"BGFourLineTwo",class:"byo0rup",propsAsIs:!0}),Fr=()=>O,Sr=d.styled_default(Fr())({name:"BGFourLineThree",class:"b1oyiqgv",propsAsIs:!0}),$r=()=>O,kr=d.styled_default($r())({name:"BGFourLineFour",class:"bx3ddqw",propsAsIs:!0}),Lr=({step:o,correct:s})=>n.jsxs(n.Fragment,{children:[n.jsxs(re,{"data-active":o===1,"data-first-screen":"true",children:[n.jsx(fr,{}),n.jsx(yr,{}),n.jsx(gr,{})]}),n.jsxs(re,{"data-active":o===2,children:[n.jsx(He,{}),n.jsx(Qe,{}),n.jsx(Ye,{})]}),n.jsxs(re,{"data-active":o===3,children:[n.jsx(He,{}),n.jsx(Qe,{}),n.jsx(Ye,{})]}),s?n.jsxs(n.Fragment,{children:[n.jsxs(re,{"data-active":o===4,"data-correct":"false",children:[n.jsx(Ve,{}),n.jsx(Ke,{}),n.jsx(Xe,{}),n.jsx(Je,{})]}),n.jsxs(re,{"data-active":o===5,"data-correct":"false","data-last-screen":"true",children:[n.jsx(Ve,{}),n.jsx(Ke,{}),n.jsx(Xe,{}),n.jsx(Je,{})]})]}):n.jsxs(re,{"data-active":o===4,"data-correct":"false","data-last-screen":"true",children:[n.jsx(jr,{}),n.jsx(Cr,{}),n.jsx(Sr,{}),n.jsx(kr,{})]})]}),Nr=d.styled_default("div")({name:"Container",class:"c10131zw",propsAsIs:!1}),Rr=d.styled_default("div")({name:"AnimateContent",class:"ar6k2eo",propsAsIs:!1}),ie=d.styled_default("div")({name:"Content",class:"c1hwoq9l",propsAsIs:!1}),ne=d.styled_default("div")({name:"Title",class:"t4ujo4g",propsAsIs:!1}),he=d.styled_default("div")({name:"Subtitle",class:"s1pjil1h",propsAsIs:!1}),Ur=()=>he,Ze=d.styled_default(Ur())({name:"SubtitleFG",class:"s1iorwr9",propsAsIs:!0}),fe=d.styled_default("div")({name:"AnswerText",class:"a51sv9d",propsAsIs:!1}),zr=()=>d.n1,Ae=d.styled_default(zr())({name:"FeedbackIcon",class:"f1lbk2ye",propsAsIs:!0}),et=d.styled_default("button")({name:"CloseButton",class:"crcvk3t",propsAsIs:!1}),Or=()=>d.n1,tt=d.styled_default(Or())({name:"CloseIcon",class:"c33p82r",propsAsIs:!0}),Dr=({close:o,votedAnswer:s,correct:c,correctAnswerTitle:p})=>{const[m,y]=j.useState(1);return j.useEffect(()=>{const f=setInterval(()=>{y(a=>c&&a>4||!c&&a>3?a:++a)},6e3);return()=>clearInterval(f)},[c]),n.jsxs(Nr,{"data-bg-color-white":m>3,children:[n.jsx(Lr,{step:m,correct:c}),n.jsxs(Rr,{"data-active-number":m,children:[n.jsxs(ie,{children:[n.jsx(ne,{children:"Master"}),n.jsx(Ze,{children:"FEATURED GROUPS +"})]}),n.jsxs(ie,{children:[n.jsx(ne,{children:"Prediction results are in!"}),n.jsx(Ze,{children:"FEATURED GROUPS +"})]}),n.jsxs(ie,{children:[n.jsx(ne,{children:"Who holds the most birdies in golf?"}),n.jsxs(he,{children:["Your Pick: ",n.jsx(fe,{children:s==null?void 0:s.title})]})]}),c?n.jsxs(n.Fragment,{children:[n.jsxs(ie,{"data-color-green":"true",children:[n.jsx(ne,{children:"Congratulations! You answered correctly."}),n.jsxs(he,{children:[n.jsx(Ae,{name:"selected"}),"Your Pick: ",n.jsx(fe,{children:s==null?void 0:s.title})]})]}),n.jsxs(ie,{"data-color-green":"true",children:[n.jsx(et,{onClick:o,children:n.jsx(tt,{name:"icon-cross"})}),n.jsxs(ne,{children:["+",s==null?void 0:s.points," points"]}),n.jsxs(he,{children:[n.jsx(Ae,{name:"selected"}),"Your Pick: ",n.jsx(fe,{children:s==null?void 0:s.title})]})]})]}):n.jsxs(ie,{children:[n.jsx(et,{onClick:o,children:n.jsx(tt,{name:"icon-cross"})}),n.jsxs(ne,{"data-incorrect":"true",children:["Better luck next time! Correct: ",p,"."]}),n.jsxs(he,{"data-incorrect":"true",children:[n.jsx(Ae,{name:"circleClose"}),"Your Pick: ",n.jsx(fe,{children:s==null?void 0:s.title})]})]})]})]})},Pr=d.styled_default("div")({name:"Container",class:"c1eptrjd",propsAsIs:!1}),Mr=d.styled_default("div")({name:"CloseIconWrap",class:"crylm65",propsAsIs:!1}),qr=()=>d.n1,Wr=d.styled_default(qr())({name:"CloseIcon",class:"c9mrcz7",propsAsIs:!0}),Gr=d.styled_default("div")({name:"Header",class:"hw3lzv4",propsAsIs:!1}),Hr=()=>d.n1,Qr=d.styled_default(Hr())({name:"TypeIcon",class:"t1rrb3kf",propsAsIs:!0}),Yr=d.styled_default("span")({name:"TypeName",class:"t1ydnjov",propsAsIs:!1}),Vr=d.styled_default("div")({name:"Question",class:"qlf90cl",propsAsIs:!1}),Kr=d.styled_default("button")({name:"AnswerButton",class:"a1e0nhcl",propsAsIs:!1}),Xr=d.styled_default("div")({name:"Container",class:"cjq447q",propsAsIs:!1}),Jr=d.styled_default("div")({name:"ImageContainer",class:"i14egogb",propsAsIs:!1}),Zr=d.styled_default("img")({name:"Image",class:"i2g9g4l",propsAsIs:!1}),ei=d.styled_default("div")({name:"Details",class:"d1c454nm",propsAsIs:!1}),ti=d.styled_default("div")({name:"Name",class:"n11nigc3",propsAsIs:!1}),ri=d.styled_default("div")({name:"UserName",class:"urxa4k8",propsAsIs:!1}),ii=({image:o,name:s,userName:c,verified:p})=>n.jsxs(Xr,{children:[n.jsx(Jr,{children:n.jsx(Zr,{src:o})}),n.jsxs(ei,{children:[n.jsxs(ti,{children:[s," ",p&&n.jsx(d.n1,{name:"icon-twitter-verified"})]}),n.jsx(ri,{children:c})]})]}),ni=d.styled_default("div")({name:"Container",class:"c1t4f0x4",propsAsIs:!1}),si=d.styled_default("button")({name:"ActionBtn",class:"a16w1nl6",propsAsIs:!1}),oi=d.styled_default("div")({name:"Body",class:"b14u54rf",propsAsIs:!1}),ai=d.styled_default("img")({name:"Image",class:"i1hxm6zo",propsAsIs:!1}),li=d.styled_default("div")({name:"Details",class:"d1s19yop",propsAsIs:!1}),ci=d.styled_default("div")({name:"QuoteWrap",class:"q1qyx94r",propsAsIs:!1}),ui=d.styled_default("blockquote")({name:"Quote",class:"qs97clu",propsAsIs:!1}),di=({account:o,body:s,image:c,title:p,action:m})=>n.jsxs(ni,{children:[n.jsx(ci,{children:n.jsx(ui,{children:p})}),n.jsxs(li,{children:[n.jsx(ii,{...o}),n.jsx(oi,{children:s}),c&&n.jsx(ai,{src:c})]}),m&&n.jsx(si,{onClick:m,children:"View Tweet"})]}),rt=({close:o,action:s,data:{questionType:c,question:p,insight:m,tweet:y}})=>{const f=ot[c];return f?p!=null&&p.predictionResult?n.jsx(Dr,{close:o,...p}):n.jsxs(Pr,{children:[n.jsx(Mr,{onClick:o,children:n.jsx(Wr,{name:"icon-cross"})}),c!==U.QuestionType.TWEET&&n.jsxs(Gr,{children:[n.jsx(Qr,{"data-type-trivia":c===U.QuestionType.TRIVIA,"data-type-poll":c===U.QuestionType.POLL,name:f.iconName}),n.jsx(Yr,{children:f.label})]}),c===U.QuestionType.FACTOID&&n.jsx(hr,{...m,action:s}),c===U.QuestionType.TWEET&&n.jsx(di,{...y,action:s}),c!==U.QuestionType.FACTOID&&c!==U.QuestionType.TWEET&&n.jsxs(n.Fragment,{children:[n.jsx(Vr,{children:p==null?void 0:p.title}),n.jsx(Kr,{onClick:s,children:"Answer"})]})]}):null};var lt={},ct={},ge={};ge.byteLength=fi;ge.toByteArray=yi;ge.fromByteArray=wi;var H=[],P=[],hi=typeof Uint8Array<"u"?Uint8Array:Array,Ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var se=0,pi=Ee.length;se<pi;++se)H[se]=Ee[se],P[Ee.charCodeAt(se)]=se;P["-".charCodeAt(0)]=62;P["_".charCodeAt(0)]=63;function ut(o){var s=o.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=o.indexOf("=");c===-1&&(c=s);var p=c===s?0:4-c%4;return[c,p]}function fi(o){var s=ut(o),c=s[0],p=s[1];return(c+p)*3/4-p}function mi(o,s,c){return(s+c)*3/4-c}function yi(o){var s,c=ut(o),p=c[0],m=c[1],y=new hi(mi(o,p,m)),f=0,a=m>0?p-4:p,g;for(g=0;g<a;g+=4)s=P[o.charCodeAt(g)]<<18|P[o.charCodeAt(g+1)]<<12|P[o.charCodeAt(g+2)]<<6|P[o.charCodeAt(g+3)],y[f++]=s>>16&255,y[f++]=s>>8&255,y[f++]=s&255;return m===2&&(s=P[o.charCodeAt(g)]<<2|P[o.charCodeAt(g+1)]>>4,y[f++]=s&255),m===1&&(s=P[o.charCodeAt(g)]<<10|P[o.charCodeAt(g+1)]<<4|P[o.charCodeAt(g+2)]>>2,y[f++]=s>>8&255,y[f++]=s&255),y}function xi(o){return H[o>>18&63]+H[o>>12&63]+H[o>>6&63]+H[o&63]}function gi(o,s,c){for(var p,m=[],y=s;y<c;y+=3)p=(o[y]<<16&16711680)+(o[y+1]<<8&65280)+(o[y+2]&255),m.push(xi(p));return m.join("")}function wi(o){for(var s,c=o.length,p=c%3,m=[],y=16383,f=0,a=c-p;f<a;f+=y)m.push(gi(o,f,f+y>a?a:f+y));return p===1?(s=o[c-1],m.push(H[s>>2]+H[s<<4&63]+"==")):p===2&&(s=(o[c-2]<<8)+o[c-1],m.push(H[s>>10]+H[s>>4&63]+H[s<<2&63]+"=")),m.join("")}var $e={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */$e.read=function(o,s,c,p,m){var y,f,a=m*8-p-1,g=(1<<a)-1,b=g>>1,A=-7,B=c?m-1:0,x=c?-1:1,w=o[s+B];for(B+=x,y=w&(1<<-A)-1,w>>=-A,A+=a;A>0;y=y*256+o[s+B],B+=x,A-=8);for(f=y&(1<<-A)-1,y>>=-A,A+=p;A>0;f=f*256+o[s+B],B+=x,A-=8);if(y===0)y=1-b;else{if(y===g)return f?NaN:(w?-1:1)*(1/0);f=f+Math.pow(2,p),y=y-b}return(w?-1:1)*f*Math.pow(2,y-p)};$e.write=function(o,s,c,p,m,y){var f,a,g,b=y*8-m-1,A=(1<<b)-1,B=A>>1,x=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=p?0:y-1,_=p?1:-1,E=s<0||s===0&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(a=isNaN(s)?1:0,f=A):(f=Math.floor(Math.log(s)/Math.LN2),s*(g=Math.pow(2,-f))<1&&(f--,g*=2),f+B>=1?s+=x/g:s+=x*Math.pow(2,1-B),s*g>=2&&(f++,g/=2),f+B>=A?(a=0,f=A):f+B>=1?(a=(s*g-1)*Math.pow(2,m),f=f+B):(a=s*Math.pow(2,B-1)*Math.pow(2,m),f=0));m>=8;o[c+w]=a&255,w+=_,a/=256,m-=8);for(f=f<<m|a,b+=m;b>0;o[c+w]=f&255,w+=_,f/=256,b-=8);o[c+w-_]|=E*128};/*!
2
2
  * The buffer module from node.js, for the browser.
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
5
5
  * @license MIT
6
- */(function(o){const s=ge,c=$e,p=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;o.Buffer=a,o.SlowBuffer=C,o.INSPECT_MAX_BYTES=50;const m=2147483647;o.kMaxLength=m,a.TYPED_ARRAY_SUPPORT=y(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function y(){try{const r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function f(r){if(r>m)throw new RangeError('The value "'+r+'" is invalid for option "size"');const e=new Uint8Array(r);return Object.setPrototypeOf(e,a.prototype),e}function a(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return v(r)}return g(r,e,t)}a.poolSize=8192;function g(r,e,t){if(typeof r=="string")return x(r,e);if(ArrayBuffer.isView(r))return _(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(M(r,ArrayBuffer)||r&&M(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(M(r,SharedArrayBuffer)||r&&M(r.buffer,SharedArrayBuffer)))return b(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const i=r.valueOf&&r.valueOf();if(i!=null&&i!==r)return a.from(i,e,t);const l=L(r);if(l)return l;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return a.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}a.from=function(r,e,t){return g(r,e,t)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function E(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function A(r,e,t){return E(r),r<=0?f(r):e!==void 0?typeof t=="string"?f(r).fill(e,t):f(r).fill(e):f(r)}a.alloc=function(r,e,t){return A(r,e,t)};function v(r){return E(r),f(r<0?0:B(r)|0)}a.allocUnsafe=function(r){return v(r)},a.allocUnsafeSlow=function(r){return v(r)};function x(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const t=R(r,e)|0;let i=f(t);const l=i.write(r,e);return l!==t&&(i=i.slice(0,l)),i}function w(r){const e=r.length<0?0:B(r.length)|0,t=f(e);for(let i=0;i<e;i+=1)t[i]=r[i]&255;return t}function _(r){if(M(r,Uint8Array)){const e=new Uint8Array(r);return b(e.buffer,e.byteOffset,e.byteLength)}return w(r)}function b(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&t===void 0?i=new Uint8Array(r):t===void 0?i=new Uint8Array(r,e):i=new Uint8Array(r,e,t),Object.setPrototypeOf(i,a.prototype),i}function L(r){if(a.isBuffer(r)){const e=B(r.length)|0,t=f(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||Ie(r.length)?f(0):w(r);if(r.type==="Buffer"&&Array.isArray(r.data))return w(r.data)}function B(r){if(r>=m)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m.toString(16)+" bytes");return r|0}function C(r){return+r!=r&&(r=0),a.alloc(+r)}a.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==a.prototype},a.compare=function(e,t){if(M(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),M(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let i=e.length,l=t.length;for(let u=0,h=Math.min(i,l);u<h;++u)if(e[u]!==t[u]){i=e[u],l=t[u];break}return i<l?-1:l<i?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return a.alloc(0);let i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;const l=a.allocUnsafe(t);let u=0;for(i=0;i<e.length;++i){let h=e[i];if(M(h,Uint8Array))u+h.length>l.length?(a.isBuffer(h)||(h=a.from(h)),h.copy(l,u)):Uint8Array.prototype.set.call(l,h,u);else if(a.isBuffer(h))h.copy(l,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=h.length}return l};function R(r,e){if(a.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||M(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);const t=r.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let l=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return _e(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return We(r).length;default:if(l)return i?-1:_e(r).length;e=(""+e).toLowerCase(),l=!0}}a.byteLength=R;function Q(r,e,t){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return jt(this,e,t);case"utf8":case"utf-8":return Re(this,e,t);case"ascii":return Bt(this,e,t);case"latin1":case"binary":return vt(this,e,t);case"base64":return bt(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Tt(this,e,t);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),i=!0}}a.prototype._isBuffer=!0;function D(r,e,t){const i=r[e];r[e]=r[t],r[t]=i}a.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)D(this,t,t+1);return this},a.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)D(this,t,t+3),D(this,t+1,t+2);return this},a.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)D(this,t,t+7),D(this,t+1,t+6),D(this,t+2,t+5),D(this,t+3,t+4);return this},a.prototype.toString=function(){const e=this.length;return e===0?"":arguments.length===0?Re(this,0,e):Q.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:a.compare(this,e)===0},a.prototype.inspect=function(){let e="";const t=o.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},p&&(a.prototype[p]=a.prototype.inspect),a.prototype.compare=function(e,t,i,l,u){if(M(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),i===void 0&&(i=e?e.length:0),l===void 0&&(l=0),u===void 0&&(u=this.length),t<0||i>e.length||l<0||u>this.length)throw new RangeError("out of range index");if(l>=u&&t>=i)return 0;if(l>=u)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,l>>>=0,u>>>=0,this===e)return 0;let h=u-l,I=i-t;const S=Math.min(h,I),F=this.slice(l,u),$=e.slice(t,i);for(let T=0;T<S;++T)if(F[T]!==$[T]){h=F[T],I=$[T];break}return h<I?-1:I<h?1:0};function Le(r,e,t,i,l){if(r.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Ie(t)&&(t=l?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(l)return-1;t=r.length-1}else if(t<0)if(l)t=0;else return-1;if(typeof e=="string"&&(e=a.from(e,i)),a.isBuffer(e))return e.length===0?-1:Ne(r,e,t,i,l);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?l?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Ne(r,[e],t,i,l);throw new TypeError("val must be string, number or Buffer")}function Ne(r,e,t,i,l){let u=1,h=r.length,I=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(r.length<2||e.length<2)return-1;u=2,h/=2,I/=2,t/=2}function S($,T){return u===1?$[T]:$.readUInt16BE(T*u)}let F;if(l){let $=-1;for(F=t;F<h;F++)if(S(r,F)===S(e,$===-1?0:F-$)){if($===-1&&($=F),F-$+1===I)return $*u}else $!==-1&&(F-=F-$),$=-1}else for(t+I>h&&(t=h-I),F=t;F>=0;F--){let $=!0;for(let T=0;T<I;T++)if(S(r,F+T)!==S(e,T)){$=!1;break}if($)return F}return-1}a.prototype.includes=function(e,t,i){return this.indexOf(e,t,i)!==-1},a.prototype.indexOf=function(e,t,i){return Le(this,e,t,i,!0)},a.prototype.lastIndexOf=function(e,t,i){return Le(this,e,t,i,!1)};function gt(r,e,t,i){t=Number(t)||0;const l=r.length-t;i?(i=Number(i),i>l&&(i=l)):i=l;const u=e.length;i>u/2&&(i=u/2);let h;for(h=0;h<i;++h){const I=parseInt(e.substr(h*2,2),16);if(Ie(I))return h;r[t+h]=I}return h}function wt(r,e,t,i){return pe(_e(e,r.length-t),r,t,i)}function _t(r,e,t,i){return pe($t(e),r,t,i)}function It(r,e,t,i){return pe(We(e),r,t,i)}function At(r,e,t,i){return pe(kt(e,r.length-t),r,t,i)}a.prototype.write=function(e,t,i,l){if(t===void 0)l="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")l=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,l===void 0&&(l="utf8")):(l=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const u=this.length-t;if((i===void 0||i>u)&&(i=u),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");l||(l="utf8");let h=!1;for(;;)switch(l){case"hex":return gt(this,e,t,i);case"utf8":case"utf-8":return wt(this,e,t,i);case"ascii":case"latin1":case"binary":return _t(this,e,t,i);case"base64":return It(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return At(this,e,t,i);default:if(h)throw new TypeError("Unknown encoding: "+l);l=(""+l).toLowerCase(),h=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function bt(r,e,t){return e===0&&t===r.length?s.fromByteArray(r):s.fromByteArray(r.slice(e,t))}function Re(r,e,t){t=Math.min(r.length,t);const i=[];let l=e;for(;l<t;){const u=r[l];let h=null,I=u>239?4:u>223?3:u>191?2:1;if(l+I<=t){let S,F,$,T;switch(I){case 1:u<128&&(h=u);break;case 2:S=r[l+1],(S&192)===128&&(T=(u&31)<<6|S&63,T>127&&(h=T));break;case 3:S=r[l+1],F=r[l+2],(S&192)===128&&(F&192)===128&&(T=(u&15)<<12|(S&63)<<6|F&63,T>2047&&(T<55296||T>57343)&&(h=T));break;case 4:S=r[l+1],F=r[l+2],$=r[l+3],(S&192)===128&&(F&192)===128&&($&192)===128&&(T=(u&15)<<18|(S&63)<<12|(F&63)<<6|$&63,T>65535&&T<1114112&&(h=T))}}h===null?(h=65533,I=1):h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|h&1023),i.push(h),l+=I}return Et(i)}const Ue=4096;function Et(r){const e=r.length;if(e<=Ue)return String.fromCharCode.apply(String,r);let t="",i=0;for(;i<e;)t+=String.fromCharCode.apply(String,r.slice(i,i+=Ue));return t}function Bt(r,e,t){let i="";t=Math.min(r.length,t);for(let l=e;l<t;++l)i+=String.fromCharCode(r[l]&127);return i}function vt(r,e,t){let i="";t=Math.min(r.length,t);for(let l=e;l<t;++l)i+=String.fromCharCode(r[l]);return i}function jt(r,e,t){const i=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>i)&&(t=i);let l="";for(let u=e;u<t;++u)l+=Lt[r[u]];return l}function Tt(r,e,t){const i=r.slice(e,t);let l="";for(let u=0;u<i.length-1;u+=2)l+=String.fromCharCode(i[u]+i[u+1]*256);return l}a.prototype.slice=function(e,t){const i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);const l=this.subarray(e,t);return Object.setPrototypeOf(l,a.prototype),l};function N(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,i){e=e>>>0,t=t>>>0,i||N(e,t,this.length);let l=this[e],u=1,h=0;for(;++h<t&&(u*=256);)l+=this[e+h]*u;return l},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,i){e=e>>>0,t=t>>>0,i||N(e,t,this.length);let l=this[e+--t],u=1;for(;t>0&&(u*=256);)l+=this[e+--t]*u;return l},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e=e>>>0,t||N(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||N(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||N(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||N(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=K(function(e){e=e>>>0,te(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&ue(e,this.length-8);const l=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,u=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(l)+(BigInt(u)<<BigInt(32))}),a.prototype.readBigUInt64BE=K(function(e){e=e>>>0,te(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&ue(e,this.length-8);const l=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],u=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(l)<<BigInt(32))+BigInt(u)}),a.prototype.readIntLE=function(e,t,i){e=e>>>0,t=t>>>0,i||N(e,t,this.length);let l=this[e],u=1,h=0;for(;++h<t&&(u*=256);)l+=this[e+h]*u;return u*=128,l>=u&&(l-=Math.pow(2,8*t)),l},a.prototype.readIntBE=function(e,t,i){e=e>>>0,t=t>>>0,i||N(e,t,this.length);let l=t,u=1,h=this[e+--l];for(;l>0&&(u*=256);)h+=this[e+--l]*u;return u*=128,h>=u&&(h-=Math.pow(2,8*t)),h},a.prototype.readInt8=function(e,t){return e=e>>>0,t||N(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},a.prototype.readInt16LE=function(e,t){e=e>>>0,t||N(e,2,this.length);const i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i},a.prototype.readInt16BE=function(e,t){e=e>>>0,t||N(e,2,this.length);const i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i},a.prototype.readInt32LE=function(e,t){return e=e>>>0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e=e>>>0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=K(function(e){e=e>>>0,te(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&ue(e,this.length-8);const l=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(l)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),a.prototype.readBigInt64BE=K(function(e){e=e>>>0,te(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&ue(e,this.length-8);const l=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(l)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)}),a.prototype.readFloatLE=function(e,t){return e=e>>>0,t||N(e,4,this.length),c.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e=e>>>0,t||N(e,4,this.length),c.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||N(e,8,this.length),c.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||N(e,8,this.length),c.read(this,e,!1,52,8)};function z(r,e,t,i,l,u){if(!a.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>l||e<u)throw new RangeError('"value" argument is out of bounds');if(t+i>r.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,i,l){if(e=+e,t=t>>>0,i=i>>>0,!l){const I=Math.pow(2,8*i)-1;z(this,e,t,i,I,0)}let u=1,h=0;for(this[t]=e&255;++h<i&&(u*=256);)this[t+h]=e/u&255;return t+i},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,i,l){if(e=+e,t=t>>>0,i=i>>>0,!l){const I=Math.pow(2,8*i)-1;z(this,e,t,i,I,0)}let u=i-1,h=1;for(this[t+u]=e&255;--u>=0&&(h*=256);)this[t+u]=e/h&255;return t+i},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,1,255,0),this[t]=e&255,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function ze(r,e,t,i,l){Ge(e,i,l,r,t,7);let u=Number(e&BigInt(4294967295));r[t++]=u,u=u>>8,r[t++]=u,u=u>>8,r[t++]=u,u=u>>8,r[t++]=u;let h=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]=h,h=h>>8,r[t++]=h,h=h>>8,r[t++]=h,h=h>>8,r[t++]=h,t}function Oe(r,e,t,i,l){Ge(e,i,l,r,t,7);let u=Number(e&BigInt(4294967295));r[t+7]=u,u=u>>8,r[t+6]=u,u=u>>8,r[t+5]=u,u=u>>8,r[t+4]=u;let h=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=h,h=h>>8,r[t+2]=h,h=h>>8,r[t+1]=h,h=h>>8,r[t]=h,t+8}a.prototype.writeBigUInt64LE=K(function(e,t=0){return ze(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=K(function(e,t=0){return Oe(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(e,t,i,l){if(e=+e,t=t>>>0,!l){const S=Math.pow(2,8*i-1);z(this,e,t,i,S-1,-S)}let u=0,h=1,I=0;for(this[t]=e&255;++u<i&&(h*=256);)e<0&&I===0&&this[t+u-1]!==0&&(I=1),this[t+u]=(e/h>>0)-I&255;return t+i},a.prototype.writeIntBE=function(e,t,i,l){if(e=+e,t=t>>>0,!l){const S=Math.pow(2,8*i-1);z(this,e,t,i,S-1,-S)}let u=i-1,h=1,I=0;for(this[t+u]=e&255;--u>=0&&(h*=256);)e<0&&I===0&&this[t+u+1]!==0&&(I=1),this[t+u]=(e/h>>0)-I&255;return t+i},a.prototype.writeInt8=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},a.prototype.writeInt16LE=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},a.prototype.writeInt32LE=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},a.prototype.writeBigInt64LE=K(function(e,t=0){return ze(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=K(function(e,t=0){return Oe(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function De(r,e,t,i,l,u){if(t+i>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Pe(r,e,t,i,l){return e=+e,t=t>>>0,l||De(r,e,t,4),c.write(r,e,t,i,23,4),t+4}a.prototype.writeFloatLE=function(e,t,i){return Pe(this,e,t,!0,i)},a.prototype.writeFloatBE=function(e,t,i){return Pe(this,e,t,!1,i)};function qe(r,e,t,i,l){return e=+e,t=t>>>0,l||De(r,e,t,8),c.write(r,e,t,i,52,8),t+8}a.prototype.writeDoubleLE=function(e,t,i){return qe(this,e,t,!0,i)},a.prototype.writeDoubleBE=function(e,t,i){return qe(this,e,t,!1,i)},a.prototype.copy=function(e,t,i,l){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!l&&l!==0&&(l=this.length),t>=e.length&&(t=e.length),t||(t=0),l>0&&l<i&&(l=i),l===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(l<0)throw new RangeError("sourceEnd out of bounds");l>this.length&&(l=this.length),e.length-t<l-i&&(l=e.length-t+i);const u=l-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,i,l):Uint8Array.prototype.set.call(e,this.subarray(i,l),t),u},a.prototype.fill=function(e,t,i,l){if(typeof e=="string"){if(typeof t=="string"?(l=t,t=0,i=this.length):typeof i=="string"&&(l=i,i=this.length),l!==void 0&&typeof l!="string")throw new TypeError("encoding must be a string");if(typeof l=="string"&&!a.isEncoding(l))throw new TypeError("Unknown encoding: "+l);if(e.length===1){const h=e.charCodeAt(0);(l==="utf8"&&h<128||l==="latin1")&&(e=h)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let u;if(typeof e=="number")for(u=t;u<i;++u)this[u]=e;else{const h=a.isBuffer(e)?e:a.from(e,l),I=h.length;if(I===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(u=0;u<i-t;++u)this[u+t]=h[u%I]}return this};const ee={};function we(r,e,t){ee[r]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(l){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:l,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}we("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),we("ERR_INVALID_ARG_TYPE",function(r,e){return`The "${r}" argument must be of type number. Received type ${typeof e}`},TypeError),we("ERR_OUT_OF_RANGE",function(r,e,t){let i=`The value of "${r}" is out of range.`,l=t;return Number.isInteger(t)&&Math.abs(t)>2**32?l=Me(String(t)):typeof t=="bigint"&&(l=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(l=Me(l)),l+="n"),i+=` It must be ${e}. Received ${l}`,i},RangeError);function Me(r){let e="",t=r.length;const i=r[0]==="-"?1:0;for(;t>=i+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}function Ct(r,e,t){te(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&ue(e,r.length-(t+1))}function Ge(r,e,t,i,l,u){if(r>t||r<e){const h=typeof e=="bigint"?"n":"";let I;throw u>3?e===0||e===BigInt(0)?I=`>= 0${h} and < 2${h} ** ${(u+1)*8}${h}`:I=`>= -(2${h} ** ${(u+1)*8-1}${h}) and < 2 ** ${(u+1)*8-1}${h}`:I=`>= ${e}${h} and <= ${t}${h}`,new ee.ERR_OUT_OF_RANGE("value",I,r)}Ct(i,l,u)}function te(r,e){if(typeof r!="number")throw new ee.ERR_INVALID_ARG_TYPE(e,"number",r)}function ue(r,e,t){throw Math.floor(r)!==r?(te(r,t),new ee.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new ee.ERR_BUFFER_OUT_OF_BOUNDS:new ee.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}const Ft=/[^+/0-9A-Za-z-_]/g;function St(r){if(r=r.split("=")[0],r=r.trim().replace(Ft,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function _e(r,e){e=e||1/0;let t;const i=r.length;let l=null;const u=[];for(let h=0;h<i;++h){if(t=r.charCodeAt(h),t>55295&&t<57344){if(!l){if(t>56319){(e-=3)>-1&&u.push(239,191,189);continue}else if(h+1===i){(e-=3)>-1&&u.push(239,191,189);continue}l=t;continue}if(t<56320){(e-=3)>-1&&u.push(239,191,189),l=t;continue}t=(l-55296<<10|t-56320)+65536}else l&&(e-=3)>-1&&u.push(239,191,189);if(l=null,t<128){if((e-=1)<0)break;u.push(t)}else if(t<2048){if((e-=2)<0)break;u.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;u.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;u.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return u}function $t(r){const e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function kt(r,e){let t,i,l;const u=[];for(let h=0;h<r.length&&!((e-=2)<0);++h)t=r.charCodeAt(h),i=t>>8,l=t%256,u.push(l),u.push(i);return u}function We(r){return s.toByteArray(St(r))}function pe(r,e,t,i){let l;for(l=0;l<i&&!(l+t>=e.length||l>=r.length);++l)e[l+t]=r[l];return l}function M(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function Ie(r){return r!==r}const Lt=function(){const r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){const i=t*16;for(let l=0;l<16;++l)e[i+l]=r[t]+r[l]}return e}();function K(r){return typeof BigInt>"u"?Nt:r}function Nt(){throw new Error("BigInt not supported")}})(ct);var dt={exports:{}},k=dt.exports={},G,W;function ve(){throw new Error("setTimeout has not been defined")}function je(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?G=setTimeout:G=ve}catch{G=ve}try{typeof clearTimeout=="function"?W=clearTimeout:W=je}catch{W=je}})();function ht(o){if(G===setTimeout)return setTimeout(o,0);if((G===ve||!G)&&setTimeout)return G=setTimeout,setTimeout(o,0);try{return G(o,0)}catch{try{return G.call(null,o,0)}catch{return G.call(this,o,0)}}}function _i(o){if(W===clearTimeout)return clearTimeout(o);if((W===je||!W)&&clearTimeout)return W=clearTimeout,clearTimeout(o);try{return W(o)}catch{try{return W.call(null,o)}catch{return W.call(this,o)}}}var Y=[],ce=!1,Z,ye=-1;function Ii(){!ce||!Z||(ce=!1,Z.length?Y=Z.concat(Y):ye=-1,Y.length&&pt())}function pt(){if(!ce){var o=ht(Ii);ce=!0;for(var s=Y.length;s;){for(Z=Y,Y=[];++ye<s;)Z&&Z[ye].run();ye=-1,s=Y.length}Z=null,ce=!1,_i(o)}}k.nextTick=function(o){var s=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)s[c-1]=arguments[c];Y.push(new ft(o,s)),Y.length===1&&!ce&&ht(pt)};function ft(o,s){this.fun=o,this.array=s}ft.prototype.run=function(){this.fun.apply(null,this.array)};k.title="browser";k.browser=!0;k.env={};k.argv=[];k.version="";k.versions={};function V(){}k.on=V;k.addListener=V;k.once=V;k.off=V;k.removeListener=V;k.removeAllListeners=V;k.emit=V;k.prependListener=V;k.prependOnceListener=V;k.listeners=function(o){return[]};k.binding=function(o){throw new Error("process.binding is not supported")};k.cwd=function(){return"/"};k.chdir=function(o){throw new Error("process.chdir is not supported")};k.umask=function(){return 0};var Ai=dt.exports;(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const s=ct,c=Ai,p=f=>f&&f.__esModule?f:{default:f},m=p(c),y=globalThis||void 0||self;Object.defineProperty(o,"Buffer",{enumerable:!0,get:()=>s.Buffer}),Object.defineProperty(o,"process",{enumerable:!0,get:()=>m.default}),o.global=y})(lt);let q;typeof window<"u"?q=window:typeof self<"u"?q=self:q=lt.global;let Te=null,Ce=null;const it=20,Ee=q.clearTimeout,nt=q.setTimeout,Be=q.cancelAnimationFrame||q.mozCancelAnimationFrame||q.webkitCancelAnimationFrame,st=q.requestAnimationFrame||q.mozRequestAnimationFrame||q.webkitRequestAnimationFrame;Be==null||st==null?(Te=Ee,Ce=function(s){return nt(s,it)}):(Te=function([s,c]){Be(s),Ee(c)},Ce=function(s){const c=st(function(){Ee(p),s()}),p=nt(function(){Be(c),s()},it);return[c,p]});function bi(o){let s,c,p,m,y,f,a;const g=typeof document<"u"&&document.attachEvent;if(!g){f=function(B){const C=B.__resizeTriggers__,R=C.firstElementChild,Q=C.lastElementChild,D=R.firstElementChild;Q.scrollLeft=Q.scrollWidth,Q.scrollTop=Q.scrollHeight,D.style.width=R.offsetWidth+1+"px",D.style.height=R.offsetHeight+1+"px",R.scrollLeft=R.scrollWidth,R.scrollTop=R.scrollHeight},y=function(B){return B.offsetWidth!==B.__resizeLast__.width||B.offsetHeight!==B.__resizeLast__.height},a=function(B){if(B.target.className&&typeof B.target.className.indexOf=="function"&&B.target.className.indexOf("contract-trigger")<0&&B.target.className.indexOf("expand-trigger")<0)return;const C=this;f(this),this.__resizeRAF__&&Te(this.__resizeRAF__),this.__resizeRAF__=Ce(function(){y(C)&&(C.__resizeLast__.width=C.offsetWidth,C.__resizeLast__.height=C.offsetHeight,C.__resizeListeners__.forEach(function(D){D.call(C,B)}))})};let x=!1,w="";p="animationstart";const _="Webkit Moz O ms".split(" ");let b="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),L="";{const B=document.createElement("fakeelement");if(B.style.animationName!==void 0&&(x=!0),x===!1){for(let C=0;C<_.length;C++)if(B.style[_[C]+"AnimationName"]!==void 0){L=_[C],w="-"+L.toLowerCase()+"-",p=b[C],x=!0;break}}}c="resizeanim",s="@"+w+"keyframes "+c+" { from { opacity: 0; } to { opacity: 0; } } ",m=w+"animation: 1ms "+c+"; "}const E=function(x){if(!x.getElementById("detectElementResize")){const w=(s||"")+".resize-triggers { "+(m||"")+'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%; }',_=x.head||x.getElementsByTagName("head")[0],b=x.createElement("style");b.id="detectElementResize",b.type="text/css",o!=null&&b.setAttribute("nonce",o),b.styleSheet?b.styleSheet.cssText=w:b.appendChild(x.createTextNode(w)),_.appendChild(b)}};return{addResizeListener:function(x,w){if(g)x.attachEvent("onresize",w);else{if(!x.__resizeTriggers__){const _=x.ownerDocument,b=q.getComputedStyle(x);b&&b.position==="static"&&(x.style.position="relative"),E(_),x.__resizeLast__={},x.__resizeListeners__=[],(x.__resizeTriggers__=_.createElement("div")).className="resize-triggers";const L=_.createElement("div");L.className="expand-trigger",L.appendChild(_.createElement("div"));const B=_.createElement("div");B.className="contract-trigger",x.__resizeTriggers__.appendChild(L),x.__resizeTriggers__.appendChild(B),x.appendChild(x.__resizeTriggers__),f(x),x.addEventListener("scroll",a,!0),p&&(x.__resizeTriggers__.__animationListener__=function(R){R.animationName===c&&f(x)},x.__resizeTriggers__.addEventListener(p,x.__resizeTriggers__.__animationListener__))}x.__resizeListeners__.push(w)}},removeResizeListener:function(x,w){if(g)x.detachEvent("onresize",w);else if(x.__resizeListeners__.splice(x.__resizeListeners__.indexOf(w),1),!x.__resizeListeners__.length){x.removeEventListener("scroll",a,!0),x.__resizeTriggers__.__animationListener__&&(x.__resizeTriggers__.removeEventListener(p,x.__resizeTriggers__.__animationListener__),x.__resizeTriggers__.__animationListener__=null);try{x.__resizeTriggers__=!x.removeChild(x.__resizeTriggers__)}catch{}}}}}class mt extends j.Component{constructor(...s){super(...s),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:c,disableWidth:p,onResize:m}=this.props;if(this._parentNode){var y,f,a,g;const E=window.getComputedStyle(this._parentNode)||{},A=parseFloat((y=E.paddingLeft)!==null&&y!==void 0?y:"0"),v=parseFloat((f=E.paddingRight)!==null&&f!==void 0?f:"0"),x=parseFloat((a=E.paddingTop)!==null&&a!==void 0?a:"0"),w=parseFloat((g=E.paddingBottom)!==null&&g!==void 0?g:"0"),_=this._parentNode.getBoundingClientRect(),b=_.height-x-w,L=_.width-A-v,B=this._parentNode.offsetHeight-x-w,C=this._parentNode.offsetWidth-A-v;(!c&&(this.state.height!==B||this.state.scaledHeight!==b)||!p&&(this.state.width!==C||this.state.scaledWidth!==L))&&(this.setState({height:B,width:C,scaledHeight:b,scaledWidth:L}),typeof m=="function"&&m({height:B,scaledHeight:b,scaledWidth:L,width:C}))}},this._setRef=c=>{this._autoSizer=c}}componentDidMount(){const{nonce:s}=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=bi(s),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:s,defaultHeight:c,defaultWidth:p,disableHeight:m=!1,disableWidth:y=!1,nonce:f,onResize:a,style:g={},tagName:E="div",...A}=this.props,{height:v,scaledHeight:x,scaledWidth:w,width:_}=this.state,b={overflow:"visible"},L={};let B=!1;return m||(v===0&&(B=!0),b.height=0,L.height=v,L.scaledHeight=x),y||(_===0&&(B=!0),b.width=0,L.width=_,L.scaledWidth=w),j.createElement(E,{ref:this._setRef,style:{...b,...g},...A},!B&&s(L))}}const Ei=d.styled_default("div")({name:"Container",class:"c1htq1lb",propsAsIs:!1}),Bi=d.styled_default("div")({name:"Content",class:"cjyzpp7",propsAsIs:!1}),vi=d.styled_default("div")({name:"Graphic",class:"g16mldgz",propsAsIs:!1}),ji=d.styled_default("div")({name:"Headline",class:"h69js65",propsAsIs:!1}),Ti=d.styled_default("div")({name:"StepsContainer",class:"smm7qmo",propsAsIs:!1}),Ci=d.styled_default("span")({name:"StepIndicator",class:"s17knuw2",propsAsIs:!1}),Fi=({width:o,graphicSrc:s,headline:c,stepsCount:p,currentStep:m})=>n.jsxs(Ei,{children:[n.jsxs(Bi,{children:[n.jsx(vi,{"data-centered":m===0,children:n.jsx("img",{src:s,alt:c,width:o||300})}),c&&n.jsx(ji,{children:c})]}),n.jsx(Ti,{children:Array.from({length:p}).map((y,f)=>n.jsx(Ci,{"data-active":m===f},f))})]}),Si=d.styled_default("div")({name:"Container",class:"c1itm4k7",propsAsIs:!1}),$i=d.styled_default("div")({name:"IconContainer",class:"i1w4fsni",propsAsIs:!1}),ki=()=>d.n1,Li=d.styled_default(ki())({name:"InviteGameIcon",class:"i19m85r1",propsAsIs:!0}),Ni=d.styled_default("div")({name:"Content",class:"c1mbu204",propsAsIs:!1}),Ri=d.styled_default("div")({name:"Heading",class:"h1amdqtv",propsAsIs:!1}),Ui=d.styled_default("div")({name:"Subtext",class:"s1lhlj9j",propsAsIs:!1}),zi=d.styled_default("div")({name:"LinkContainer",class:"l1wot35e",propsAsIs:!1}),Oi=d.styled_default("div")({name:"LinkInfo",class:"l1jdw39q",propsAsIs:!1}),Di=d.styled_default("span")({name:"LinkTitle",class:"l1cr5mk",propsAsIs:!1}),Pi=d.styled_default("span")({name:"LinkAddress",class:"lvi87q4",propsAsIs:!1}),qi=()=>d.n1,Mi=d.styled_default(qi())({name:"LinkIcon",class:"l1pqlvw3",propsAsIs:!0}),Gi=d.styled_default("div")({name:"SocialLinksContainer",class:"s1n7kzeh",propsAsIs:!1}),Wi=d.styled_default("a")({name:"SocialLink",class:"s2m9o9y",propsAsIs:!1}),Hi=d.styled_default("span")({name:"SocialLinkLabel",class:"sewjbbn",propsAsIs:!1}),yt=({inviteLink:o,socialLinks:s,inviteCardTitle:c,inviteCardSubtext:p,primaryColor:m,className:y})=>n.jsxs(Si,{className:y,children:[n.jsx($i,{style:{backgroundColor:m},children:n.jsx(Li,{name:"invite-game-icon"})}),n.jsxs(Ni,{children:[n.jsx(Ri,{children:c||""}),n.jsx(Ui,{children:p||""})]}),o&&n.jsxs(zi,{onClick:async()=>{if(o)try{await navigator.clipboard.writeText(o)}catch(f){console.error("Unable to copy to clipboard",f)}},children:[n.jsxs(Oi,{children:[n.jsx(Di,{children:"Invite link"}),n.jsx(Pi,{children:o})]}),n.jsx(Mi,{name:"icon-copy"})]}),s&&s.length>0&&n.jsx(Gi,{children:s.map(({icon:f,link:a,label:g})=>n.jsxs(Wi,{href:a,target:"_blank",children:[n.jsx(d.n1,{name:f}),n.jsx(Hi,{children:g})]},a))})]}),Qi=d.styled_default("div")({name:"Container",class:"cm0bev",propsAsIs:!1}),Yi=d.styled_default("div")({name:"Content",class:"ce7x737",propsAsIs:!1}),Vi=d.styled_default("div")({name:"Title",class:"tc2tor6",propsAsIs:!1}),Ki=d.styled_default("div")({name:"RulesList",class:"r1k5klql",propsAsIs:!1}),Xi=d.styled_default("div")({name:"RulesItem",class:"r1tf3ft2",propsAsIs:!1}),Ji=d.styled_default("div")({name:"RuleIcon",class:"rwpvg1k",propsAsIs:!1}),Zi=d.styled_default("div")({name:"RuleText",class:"rbxiag0",propsAsIs:!1}),en=d.styled_default("button")({name:"TermsButton",class:"t6cyrry",propsAsIs:!1}),tn=({rules:o,rulesTitle:s,primaryColor:c})=>n.jsxs(Qi,{children:[n.jsxs(Yi,{children:[n.jsx(Vi,{children:s}),n.jsx(Ki,{children:o==null?void 0:o.map(({label:p,icon:m},y)=>n.jsxs(Xi,{children:[m&&n.jsx(Ji,{style:{backgroundColor:c},children:n.jsx(d.n1,{name:m,"data-icon":m})}),n.jsx(Zi,{children:p})]},y))})]}),n.jsx(en,{children:"See Terms and Conditions"})]}),rn=d.styled_default("button")({name:"SButton",class:"s1nve60q",propsAsIs:!1}),nn=d.styled_default("span")({name:"ButtonLabel",class:"b1xoswwx",propsAsIs:!1}),sn=({disabled:o,variant:s="primary",onClick:c,children:p,...m})=>n.jsx(rn,{onClick:c,disabled:o,"data-variant":s,...m,children:n.jsx(nn,{children:p})}),on=d.styled_default("div")({name:"Container",class:"c18uddbs",propsAsIs:!1}),an=d.styled_default("div")({name:"Content",class:"cvcfjf6",propsAsIs:!1}),ln=d.styled_default("div")({name:"OnboardingHeader",class:"o1ie27lw",propsAsIs:!1}),cn=d.styled_default("button")({name:"CloseBtn",class:"c15cjkwi",propsAsIs:!1}),un=()=>d.n1,dn=d.styled_default(un())({name:"IconClose",class:"i1mavjt2",propsAsIs:!0}),hn=d.styled_default("div")({name:"OnboardingFooter",class:"o1x0dyzv",propsAsIs:!1}),pn=()=>sn,fn=d.styled_default(pn())({name:"OnboardingActionBtn",class:"o1jfi9c3",propsAsIs:!0}),oe={steps:!1,rules:!1,inviteCard:!1},mn=({gamification:o,steps:s,rules:c,rulesBtnLabel:p,rulesTitle:m,primaryColor:y,inviteLink:f,socialLinks:a,inviteCardTitle:g,inviteCardSubtext:E,inviteCardBtnLabel:A,onClose:v})=>{const[x,w]=j.useState(0),[_,b]=j.useState(oe);j.useEffect(()=>{s!=null&&s.length?b({...oe,steps:!0}):c!=null&&c.length?b({...oe,rules:!0}):b({...oe,inviteCard:!0})},[]);const L=j.useMemo(()=>_.steps&&x===0?"Continue":_.rules?p||"Got it":_.inviteCard?A||"Play Now":"Next",[_,x,p,A]),B=j.useCallback(()=>{s!=null&&s.length&&x<s.length-1?w(R=>++R):c!=null&&c.length&&_.steps?b({...oe,rules:!0}):_.rules&&b({...oe,inviteCard:!0})},[x,s==null?void 0:s.length,c==null?void 0:c.length,_,w,b]),C=async()=>{await o.onboardingStatus.submitInplay()};return n.jsx(mt,{children:({width:R,height:Q})=>n.jsxs(on,{style:{width:R,height:Q},children:[n.jsx(ln,{children:n.jsx(cn,{onClick:v,children:n.jsx(dn,{name:"icon-close-btn-gray"})})}),n.jsxs(an,{children:[_.steps&&(s==null?void 0:s.length)&&n.jsx(Fi,{stepsCount:s.length,currentStep:x,...s[x]}),_.rules&&n.jsx(tn,{rules:c,rulesTitle:m,primaryColor:y}),_.inviteCard&&n.jsx(yt,{inviteLink:f,inviteCardTitle:g,inviteCardSubtext:E,primaryColor:y,socialLinks:a})]}),n.jsx(hn,{children:n.jsx(fn,{onClick:_.inviteCard?C:B,children:L})})]})})},yn=d.styled_default("div")({name:"Container",class:"c1pgyo67",propsAsIs:!1}),xn="hx17qu6",ke=({children:o,style:s,className:c,hiding:p})=>n.jsx(yn,{style:s,className:d.cx_default(c,p&&xn),children:o}),gn=d.styled_default("div")({name:"Container",class:"cocfo2g",propsAsIs:!1}),wn=d.styled_default("div")({name:"CloseIconWrap",class:"c1pdhxdk",propsAsIs:!1}),_n=()=>d.n1,In=d.styled_default(_n())({name:"CloseIcon",class:"c1funj3r",propsAsIs:!0}),An=d.styled_default("div")({name:"Title",class:"t1okg06y",propsAsIs:!1}),bn=d.styled_default("img")({name:"SponsorLogo",class:"sb1n923",propsAsIs:!1}),En=d.styled_default("div")({name:"PresentsTitle",class:"p1stllxd",propsAsIs:!1}),Bn=d.styled_default("div")({name:"Subtitle",class:"s13kvdzw",propsAsIs:!1}),vn=d.styled_default("div")({name:"Description",class:"dfvmv3t",propsAsIs:!1}),jn=d.styled_default("button")({name:"ActionButton",class:"ay8e3j9",propsAsIs:!1}),Tn=({close:o,action:s,onboarding:c})=>{var p,m,y,f,a,g,E,A;return n.jsxs(gn,{children:[n.jsx(wn,{onClick:o,children:n.jsx(In,{name:"icon-cross"})}),((m=(p=c==null?void 0:c.titleCard)==null?void 0:p.media)==null?void 0:m.sponsorLogo)&&n.jsxs(An,{children:[n.jsx(bn,{alt:"sponsor-logo",src:(f=(y=c==null?void 0:c.titleCard)==null?void 0:y.media)==null?void 0:f.sponsorLogo}),n.jsx(En,{children:"PRESENTS"})]}),((a=c==null?void 0:c.titleCard)==null?void 0:a.title)&&n.jsx(Bn,{children:(g=c==null?void 0:c.titleCard)==null?void 0:g.title}),((E=c==null?void 0:c.titleCard)==null?void 0:E.subtitle)&&n.jsx(vn,{children:(A=c==null?void 0:c.titleCard)==null?void 0:A.subtitle}),n.jsx(jn,{onClick:s,children:"Play Now"})]})},Cn=()=>ke,Fn=d.styled_default(Cn())({name:"OnboardingContainer",class:"o9squag",propsAsIs:!0}),Sn=({hiding:o,deepLink:s,onboardingOpts:c,setOpened:p,notification:m,gamification:y})=>{var f,a,g,E,A,v;const{data:x}=X.useStore(s.$store);return n.jsx(Fn,{hiding:o,children:n.jsx(mn,{rules:[{label:"Answer as many questions as you like.",icon:"icon-btn-feature-groups"},{label:"Win points for each correct trivia or prediction answer.",icon:"icon-thumb-up"},{label:"Top the leader board and best your friends.",icon:"icon-trophy"}],rulesBtnLabel:(f=c.rules)==null?void 0:f.buttonLabel,rulesTitle:(a=c.rules)==null?void 0:a.heading,steps:[{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_1.png",headline:"Welcome to the Featured Groups +",width:80},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_2.png",headline:"Get real-time insights",width:264},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_3.png",headline:"Predictions, trivia & polls synced to match play"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_4.png",headline:"Win points for every answer you get right"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_5.png",headline:"Compete against friends on the leaderboard"}],primaryColor:(g=c.inviteCard)==null?void 0:g.iconColor,inviteLink:x==null?void 0:x.url,inviteCardTitle:(E=c.inviteCard)==null?void 0:E.heading,inviteCardSubtext:(A=c.inviteCard)==null?void 0:A.subtext,inviteCardBtnLabel:(v=c.inviteCard)==null?void 0:v.buttonLabel,onClose:()=>{var w;p(!1),(w=m.close)==null||w.call(m)},socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],gamification:y})})},$n=({sdk:o,notification:s})=>{const[c,p]=j.useState(!1),m=o.getFeature(U.FeatureType.GAMES),y=s.data.onboarding;return c&&m&&y?n.jsx(Sn,{notification:s,setOpened:p,gamification:m,onboardingOpts:y,deepLink:m.deepLink}):n.jsx("div",{children:n.jsx(Tn,{close:s.close,action:()=>p(!0),onboarding:y})})},kn=()=>ke,Ln=d.styled_default(kn())({name:"Container",class:"ctckejh",propsAsIs:!0}),Nn=({sdk:o,notification:s})=>s.type===me.NotificationType.QUESTION?n.jsx("div",{children:n.jsx(rt,{...s})}):s.type===me.NotificationType.QUESTION_RESOLVED?n.jsx("div",{children:n.jsx(rt,{...s})}):s.type===me.NotificationType.ONBOARDING?n.jsx($n,{sdk:o,notification:s,hiding:s.hiding}):null,Rn=({sdk:o})=>{const[s]=j.useState(o.getNotificationsStore()),c=X.useStore(s),p=j.useMemo(()=>{if(!(c!=null&&c.size))return null;for(const m of c.values())if(m.type===me.NotificationType.ONBOARDING)return m;return c.values().next().value},[c]);return p?n.jsx(Ln,{hiding:p.hiding,children:n.jsx(Nn,{sdk:o,notification:p})}):null},Un=d.styled_default("div")({name:"SDKContainer",class:"stu11h7",propsAsIs:!1}),Fe=d.styled_default("div")({name:"SDKScrollContainer",class:"s1ucohr1",propsAsIs:!1}),xt=d.styled_default("div")({name:"SDKContentContainer",class:"s1el4wvm",propsAsIs:!1}),zn=()=>xt,On=d.styled_default(zn())({name:"SDKWhiteContainer",class:"s1oe3036",propsAsIs:!0}),Dn=o=>{const s=j.useRef(""),[c,p]=j.useState(!1),m=X.useStore(o.status),y=X.useStore(o.userId()),f=m==="ready",[a,g]=j.useState(J),E=j.useCallback((x,w)=>{g(w),w===J?(x&&o.createEventSession(x),o.openFeature(U.FeatureType.GAMES)):o.closeFeature()},[o]);j.useEffect(()=>{!f&&a===J&&(g(le),o.closeFeature())},[f,a,o]);const A=x=>{s.current=x,o.initializeApp().then(({enabled:w,err:_})=>{if(p(!0),_){E(x,le);return}if(w){o.isUserAuthorized().then(b=>{if(b){E(x,J);return}else o.disableApp()});return}})},v=()=>{p(!1),o.disableApp()};return j.useEffect(()=>{if(!y){f&&(g(le),o.disableApp());return}y&&s.current&&c&&o.initializeApp().then(()=>{o.createEventSession(s.current)})},[y]),{sdkEnabled:c,sdkReady:f,activeOverlay:a,activateAndLoadOverlay:E,enableSdk:A,disableSdk:v,isLogged:!!y}},Pn=o=>{const s=X.useStore(o.getActiveFeature()),c=X.useStore(o.streamStore()),[p,m]=j.useState(null);return j.useEffect(()=>{const y=o.getFeatures();if(s)for(const[f,a]of y)f===s?a.status.get()===de.FeatureStatus.Suspended&&(a.enable(),m(a)):a.status.get()===de.FeatureStatus.Ready&&a.disable();else{for(const[,f]of y)f.status.get()===de.FeatureStatus.Ready&&f.disable();m(null)}return()=>{for(const[,f]of y)f.status.get()===de.FeatureStatus.Ready&&f.disable()}},[s,o,c]),[s,p]},qn=({sdk:o,className:s})=>{const[,c]=Pn(o);return n.jsx(zt,{className:s,feature:c,sdk:o})},Mn=({sdk:o,overlays:s,children:c})=>{const{sdkEnabled:p,sdkReady:m,activeOverlay:y,activateAndLoadOverlay:f,enableSdk:a,disableSdk:g,isLogged:E}=Dn(o);return j.useEffect(()=>{Promise.resolve().then(()=>require("./gamification-feature.js"))},[]),n.jsxs(Un,{children:[p&&n.jsx(tr,{sdkReady:m,activeOverlay:y,className:ae.d,setActiveOverlay:A=>f("",A)}),m&&n.jsx(Rn,{sdk:o}),n.jsx(Fe,{"data-nav":p.toString(),style:{display:!p||y===le?"block":"none"},children:c&&c({enableSdk:a,disableSdk:g})}),n.jsx(Fe,{"data-nav":p.toString(),style:{display:y===xe?"block":"none"},children:s&&y===xe&&s[y]}),m&&y===J&&n.jsx(qn,{className:ae.d,sdk:o}),!E&&n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"You are not logged in."})]})};const Gn=({sdkKey:o,plugins:s,children:c,production:p=!0})=>n.jsx(ae.StreamLayerProvider,{sdkKey:o,plugins:s,production:p,autoEnable:!1,children:c}),Wn=({children:o,overlays:s})=>{const{sdk:c,status:p}=j.useContext(ae.StreamLayerContext);if(p===ae.StreamLayerStatus.UNSET)throw new Error("Wrap app in `StreamLayerProvider`");return c?n.jsx("div",{className:"StreamLayerSDK",children:n.jsx(ae.s,{style:{height:"100%"},children:n.jsx(Mn,{sdk:c,overlays:s,children:o})})}):o({})};exports.AutoSizer=mt;exports.MastersStreamLayerProvider=Gn;exports.MastersStreamLayerSDKReact=Wn;exports.O=yt;exports.a=On;exports.d=ke;exports.n=xt;exports.o=ot;exports.r=Fe;exports.w=at;
6
+ */(function(o){const s=ge,c=$e,p=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;o.Buffer=a,o.SlowBuffer=C,o.INSPECT_MAX_BYTES=50;const m=2147483647;o.kMaxLength=m,a.TYPED_ARRAY_SUPPORT=y(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function y(){try{const r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function f(r){if(r>m)throw new RangeError('The value "'+r+'" is invalid for option "size"');const e=new Uint8Array(r);return Object.setPrototypeOf(e,a.prototype),e}function a(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return B(r)}return g(r,e,t)}a.poolSize=8192;function g(r,e,t){if(typeof r=="string")return x(r,e);if(ArrayBuffer.isView(r))return _(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(q(r,ArrayBuffer)||r&&q(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(q(r,SharedArrayBuffer)||r&&q(r.buffer,SharedArrayBuffer)))return E(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const i=r.valueOf&&r.valueOf();if(i!=null&&i!==r)return a.from(i,e,t);const l=L(r);if(l)return l;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return a.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}a.from=function(r,e,t){return g(r,e,t)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function b(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function A(r,e,t){return b(r),r<=0?f(r):e!==void 0?typeof t=="string"?f(r).fill(e,t):f(r).fill(e):f(r)}a.alloc=function(r,e,t){return A(r,e,t)};function B(r){return b(r),f(r<0?0:v(r)|0)}a.allocUnsafe=function(r){return B(r)},a.allocUnsafeSlow=function(r){return B(r)};function x(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const t=R(r,e)|0;let i=f(t);const l=i.write(r,e);return l!==t&&(i=i.slice(0,l)),i}function w(r){const e=r.length<0?0:v(r.length)|0,t=f(e);for(let i=0;i<e;i+=1)t[i]=r[i]&255;return t}function _(r){if(q(r,Uint8Array)){const e=new Uint8Array(r);return E(e.buffer,e.byteOffset,e.byteLength)}return w(r)}function E(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&t===void 0?i=new Uint8Array(r):t===void 0?i=new Uint8Array(r,e):i=new Uint8Array(r,e,t),Object.setPrototypeOf(i,a.prototype),i}function L(r){if(a.isBuffer(r)){const e=v(r.length)|0,t=f(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||Ie(r.length)?f(0):w(r);if(r.type==="Buffer"&&Array.isArray(r.data))return w(r.data)}function v(r){if(r>=m)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m.toString(16)+" bytes");return r|0}function C(r){return+r!=r&&(r=0),a.alloc(+r)}a.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==a.prototype},a.compare=function(e,t){if(q(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),q(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let i=e.length,l=t.length;for(let u=0,h=Math.min(i,l);u<h;++u)if(e[u]!==t[u]){i=e[u],l=t[u];break}return i<l?-1:l<i?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return a.alloc(0);let i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;const l=a.allocUnsafe(t);let u=0;for(i=0;i<e.length;++i){let h=e[i];if(q(h,Uint8Array))u+h.length>l.length?(a.isBuffer(h)||(h=a.from(h)),h.copy(l,u)):Uint8Array.prototype.set.call(l,h,u);else if(a.isBuffer(h))h.copy(l,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=h.length}return l};function R(r,e){if(a.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||q(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);const t=r.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let l=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return _e(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ge(r).length;default:if(l)return i?-1:_e(r).length;e=(""+e).toLowerCase(),l=!0}}a.byteLength=R;function Q(r,e,t){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return jt(this,e,t);case"utf8":case"utf-8":return Re(this,e,t);case"ascii":return vt(this,e,t);case"latin1":case"binary":return Bt(this,e,t);case"base64":return Et(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Tt(this,e,t);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),i=!0}}a.prototype._isBuffer=!0;function D(r,e,t){const i=r[e];r[e]=r[t],r[t]=i}a.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)D(this,t,t+1);return this},a.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)D(this,t,t+3),D(this,t+1,t+2);return this},a.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)D(this,t,t+7),D(this,t+1,t+6),D(this,t+2,t+5),D(this,t+3,t+4);return this},a.prototype.toString=function(){const e=this.length;return e===0?"":arguments.length===0?Re(this,0,e):Q.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:a.compare(this,e)===0},a.prototype.inspect=function(){let e="";const t=o.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},p&&(a.prototype[p]=a.prototype.inspect),a.prototype.compare=function(e,t,i,l,u){if(q(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),i===void 0&&(i=e?e.length:0),l===void 0&&(l=0),u===void 0&&(u=this.length),t<0||i>e.length||l<0||u>this.length)throw new RangeError("out of range index");if(l>=u&&t>=i)return 0;if(l>=u)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,l>>>=0,u>>>=0,this===e)return 0;let h=u-l,I=i-t;const S=Math.min(h,I),F=this.slice(l,u),$=e.slice(t,i);for(let T=0;T<S;++T)if(F[T]!==$[T]){h=F[T],I=$[T];break}return h<I?-1:I<h?1:0};function Le(r,e,t,i,l){if(r.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Ie(t)&&(t=l?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(l)return-1;t=r.length-1}else if(t<0)if(l)t=0;else return-1;if(typeof e=="string"&&(e=a.from(e,i)),a.isBuffer(e))return e.length===0?-1:Ne(r,e,t,i,l);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?l?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Ne(r,[e],t,i,l);throw new TypeError("val must be string, number or Buffer")}function Ne(r,e,t,i,l){let u=1,h=r.length,I=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(r.length<2||e.length<2)return-1;u=2,h/=2,I/=2,t/=2}function S($,T){return u===1?$[T]:$.readUInt16BE(T*u)}let F;if(l){let $=-1;for(F=t;F<h;F++)if(S(r,F)===S(e,$===-1?0:F-$)){if($===-1&&($=F),F-$+1===I)return $*u}else $!==-1&&(F-=F-$),$=-1}else for(t+I>h&&(t=h-I),F=t;F>=0;F--){let $=!0;for(let T=0;T<I;T++)if(S(r,F+T)!==S(e,T)){$=!1;break}if($)return F}return-1}a.prototype.includes=function(e,t,i){return this.indexOf(e,t,i)!==-1},a.prototype.indexOf=function(e,t,i){return Le(this,e,t,i,!0)},a.prototype.lastIndexOf=function(e,t,i){return Le(this,e,t,i,!1)};function gt(r,e,t,i){t=Number(t)||0;const l=r.length-t;i?(i=Number(i),i>l&&(i=l)):i=l;const u=e.length;i>u/2&&(i=u/2);let h;for(h=0;h<i;++h){const I=parseInt(e.substr(h*2,2),16);if(Ie(I))return h;r[t+h]=I}return h}function wt(r,e,t,i){return pe(_e(e,r.length-t),r,t,i)}function _t(r,e,t,i){return pe($t(e),r,t,i)}function It(r,e,t,i){return pe(Ge(e),r,t,i)}function At(r,e,t,i){return pe(kt(e,r.length-t),r,t,i)}a.prototype.write=function(e,t,i,l){if(t===void 0)l="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")l=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,l===void 0&&(l="utf8")):(l=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const u=this.length-t;if((i===void 0||i>u)&&(i=u),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");l||(l="utf8");let h=!1;for(;;)switch(l){case"hex":return gt(this,e,t,i);case"utf8":case"utf-8":return wt(this,e,t,i);case"ascii":case"latin1":case"binary":return _t(this,e,t,i);case"base64":return It(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return At(this,e,t,i);default:if(h)throw new TypeError("Unknown encoding: "+l);l=(""+l).toLowerCase(),h=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Et(r,e,t){return e===0&&t===r.length?s.fromByteArray(r):s.fromByteArray(r.slice(e,t))}function Re(r,e,t){t=Math.min(r.length,t);const i=[];let l=e;for(;l<t;){const u=r[l];let h=null,I=u>239?4:u>223?3:u>191?2:1;if(l+I<=t){let S,F,$,T;switch(I){case 1:u<128&&(h=u);break;case 2:S=r[l+1],(S&192)===128&&(T=(u&31)<<6|S&63,T>127&&(h=T));break;case 3:S=r[l+1],F=r[l+2],(S&192)===128&&(F&192)===128&&(T=(u&15)<<12|(S&63)<<6|F&63,T>2047&&(T<55296||T>57343)&&(h=T));break;case 4:S=r[l+1],F=r[l+2],$=r[l+3],(S&192)===128&&(F&192)===128&&($&192)===128&&(T=(u&15)<<18|(S&63)<<12|(F&63)<<6|$&63,T>65535&&T<1114112&&(h=T))}}h===null?(h=65533,I=1):h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|h&1023),i.push(h),l+=I}return bt(i)}const Ue=4096;function bt(r){const e=r.length;if(e<=Ue)return String.fromCharCode.apply(String,r);let t="",i=0;for(;i<e;)t+=String.fromCharCode.apply(String,r.slice(i,i+=Ue));return t}function vt(r,e,t){let i="";t=Math.min(r.length,t);for(let l=e;l<t;++l)i+=String.fromCharCode(r[l]&127);return i}function Bt(r,e,t){let i="";t=Math.min(r.length,t);for(let l=e;l<t;++l)i+=String.fromCharCode(r[l]);return i}function jt(r,e,t){const i=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>i)&&(t=i);let l="";for(let u=e;u<t;++u)l+=Lt[r[u]];return l}function Tt(r,e,t){const i=r.slice(e,t);let l="";for(let u=0;u<i.length-1;u+=2)l+=String.fromCharCode(i[u]+i[u+1]*256);return l}a.prototype.slice=function(e,t){const i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);const l=this.subarray(e,t);return Object.setPrototypeOf(l,a.prototype),l};function N(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,i){e=e>>>0,t=t>>>0,i||N(e,t,this.length);let l=this[e],u=1,h=0;for(;++h<t&&(u*=256);)l+=this[e+h]*u;return l},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,i){e=e>>>0,t=t>>>0,i||N(e,t,this.length);let l=this[e+--t],u=1;for(;t>0&&(u*=256);)l+=this[e+--t]*u;return l},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e=e>>>0,t||N(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||N(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||N(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||N(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=K(function(e){e=e>>>0,te(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&ue(e,this.length-8);const l=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,u=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(l)+(BigInt(u)<<BigInt(32))}),a.prototype.readBigUInt64BE=K(function(e){e=e>>>0,te(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&ue(e,this.length-8);const l=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],u=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(l)<<BigInt(32))+BigInt(u)}),a.prototype.readIntLE=function(e,t,i){e=e>>>0,t=t>>>0,i||N(e,t,this.length);let l=this[e],u=1,h=0;for(;++h<t&&(u*=256);)l+=this[e+h]*u;return u*=128,l>=u&&(l-=Math.pow(2,8*t)),l},a.prototype.readIntBE=function(e,t,i){e=e>>>0,t=t>>>0,i||N(e,t,this.length);let l=t,u=1,h=this[e+--l];for(;l>0&&(u*=256);)h+=this[e+--l]*u;return u*=128,h>=u&&(h-=Math.pow(2,8*t)),h},a.prototype.readInt8=function(e,t){return e=e>>>0,t||N(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},a.prototype.readInt16LE=function(e,t){e=e>>>0,t||N(e,2,this.length);const i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i},a.prototype.readInt16BE=function(e,t){e=e>>>0,t||N(e,2,this.length);const i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i},a.prototype.readInt32LE=function(e,t){return e=e>>>0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e=e>>>0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=K(function(e){e=e>>>0,te(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&ue(e,this.length-8);const l=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(l)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),a.prototype.readBigInt64BE=K(function(e){e=e>>>0,te(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&ue(e,this.length-8);const l=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(l)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)}),a.prototype.readFloatLE=function(e,t){return e=e>>>0,t||N(e,4,this.length),c.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e=e>>>0,t||N(e,4,this.length),c.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||N(e,8,this.length),c.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||N(e,8,this.length),c.read(this,e,!1,52,8)};function z(r,e,t,i,l,u){if(!a.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>l||e<u)throw new RangeError('"value" argument is out of bounds');if(t+i>r.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,i,l){if(e=+e,t=t>>>0,i=i>>>0,!l){const I=Math.pow(2,8*i)-1;z(this,e,t,i,I,0)}let u=1,h=0;for(this[t]=e&255;++h<i&&(u*=256);)this[t+h]=e/u&255;return t+i},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,i,l){if(e=+e,t=t>>>0,i=i>>>0,!l){const I=Math.pow(2,8*i)-1;z(this,e,t,i,I,0)}let u=i-1,h=1;for(this[t+u]=e&255;--u>=0&&(h*=256);)this[t+u]=e/h&255;return t+i},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,1,255,0),this[t]=e&255,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function ze(r,e,t,i,l){We(e,i,l,r,t,7);let u=Number(e&BigInt(4294967295));r[t++]=u,u=u>>8,r[t++]=u,u=u>>8,r[t++]=u,u=u>>8,r[t++]=u;let h=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]=h,h=h>>8,r[t++]=h,h=h>>8,r[t++]=h,h=h>>8,r[t++]=h,t}function Oe(r,e,t,i,l){We(e,i,l,r,t,7);let u=Number(e&BigInt(4294967295));r[t+7]=u,u=u>>8,r[t+6]=u,u=u>>8,r[t+5]=u,u=u>>8,r[t+4]=u;let h=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=h,h=h>>8,r[t+2]=h,h=h>>8,r[t+1]=h,h=h>>8,r[t]=h,t+8}a.prototype.writeBigUInt64LE=K(function(e,t=0){return ze(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=K(function(e,t=0){return Oe(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(e,t,i,l){if(e=+e,t=t>>>0,!l){const S=Math.pow(2,8*i-1);z(this,e,t,i,S-1,-S)}let u=0,h=1,I=0;for(this[t]=e&255;++u<i&&(h*=256);)e<0&&I===0&&this[t+u-1]!==0&&(I=1),this[t+u]=(e/h>>0)-I&255;return t+i},a.prototype.writeIntBE=function(e,t,i,l){if(e=+e,t=t>>>0,!l){const S=Math.pow(2,8*i-1);z(this,e,t,i,S-1,-S)}let u=i-1,h=1,I=0;for(this[t+u]=e&255;--u>=0&&(h*=256);)e<0&&I===0&&this[t+u+1]!==0&&(I=1),this[t+u]=(e/h>>0)-I&255;return t+i},a.prototype.writeInt8=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},a.prototype.writeInt16LE=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},a.prototype.writeInt32LE=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,i){return e=+e,t=t>>>0,i||z(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},a.prototype.writeBigInt64LE=K(function(e,t=0){return ze(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=K(function(e,t=0){return Oe(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function De(r,e,t,i,l,u){if(t+i>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Pe(r,e,t,i,l){return e=+e,t=t>>>0,l||De(r,e,t,4),c.write(r,e,t,i,23,4),t+4}a.prototype.writeFloatLE=function(e,t,i){return Pe(this,e,t,!0,i)},a.prototype.writeFloatBE=function(e,t,i){return Pe(this,e,t,!1,i)};function Me(r,e,t,i,l){return e=+e,t=t>>>0,l||De(r,e,t,8),c.write(r,e,t,i,52,8),t+8}a.prototype.writeDoubleLE=function(e,t,i){return Me(this,e,t,!0,i)},a.prototype.writeDoubleBE=function(e,t,i){return Me(this,e,t,!1,i)},a.prototype.copy=function(e,t,i,l){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!l&&l!==0&&(l=this.length),t>=e.length&&(t=e.length),t||(t=0),l>0&&l<i&&(l=i),l===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(l<0)throw new RangeError("sourceEnd out of bounds");l>this.length&&(l=this.length),e.length-t<l-i&&(l=e.length-t+i);const u=l-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,i,l):Uint8Array.prototype.set.call(e,this.subarray(i,l),t),u},a.prototype.fill=function(e,t,i,l){if(typeof e=="string"){if(typeof t=="string"?(l=t,t=0,i=this.length):typeof i=="string"&&(l=i,i=this.length),l!==void 0&&typeof l!="string")throw new TypeError("encoding must be a string");if(typeof l=="string"&&!a.isEncoding(l))throw new TypeError("Unknown encoding: "+l);if(e.length===1){const h=e.charCodeAt(0);(l==="utf8"&&h<128||l==="latin1")&&(e=h)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let u;if(typeof e=="number")for(u=t;u<i;++u)this[u]=e;else{const h=a.isBuffer(e)?e:a.from(e,l),I=h.length;if(I===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(u=0;u<i-t;++u)this[u+t]=h[u%I]}return this};const ee={};function we(r,e,t){ee[r]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(l){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:l,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}we("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),we("ERR_INVALID_ARG_TYPE",function(r,e){return`The "${r}" argument must be of type number. Received type ${typeof e}`},TypeError),we("ERR_OUT_OF_RANGE",function(r,e,t){let i=`The value of "${r}" is out of range.`,l=t;return Number.isInteger(t)&&Math.abs(t)>2**32?l=qe(String(t)):typeof t=="bigint"&&(l=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(l=qe(l)),l+="n"),i+=` It must be ${e}. Received ${l}`,i},RangeError);function qe(r){let e="",t=r.length;const i=r[0]==="-"?1:0;for(;t>=i+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}function Ct(r,e,t){te(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&ue(e,r.length-(t+1))}function We(r,e,t,i,l,u){if(r>t||r<e){const h=typeof e=="bigint"?"n":"";let I;throw u>3?e===0||e===BigInt(0)?I=`>= 0${h} and < 2${h} ** ${(u+1)*8}${h}`:I=`>= -(2${h} ** ${(u+1)*8-1}${h}) and < 2 ** ${(u+1)*8-1}${h}`:I=`>= ${e}${h} and <= ${t}${h}`,new ee.ERR_OUT_OF_RANGE("value",I,r)}Ct(i,l,u)}function te(r,e){if(typeof r!="number")throw new ee.ERR_INVALID_ARG_TYPE(e,"number",r)}function ue(r,e,t){throw Math.floor(r)!==r?(te(r,t),new ee.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new ee.ERR_BUFFER_OUT_OF_BOUNDS:new ee.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}const Ft=/[^+/0-9A-Za-z-_]/g;function St(r){if(r=r.split("=")[0],r=r.trim().replace(Ft,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function _e(r,e){e=e||1/0;let t;const i=r.length;let l=null;const u=[];for(let h=0;h<i;++h){if(t=r.charCodeAt(h),t>55295&&t<57344){if(!l){if(t>56319){(e-=3)>-1&&u.push(239,191,189);continue}else if(h+1===i){(e-=3)>-1&&u.push(239,191,189);continue}l=t;continue}if(t<56320){(e-=3)>-1&&u.push(239,191,189),l=t;continue}t=(l-55296<<10|t-56320)+65536}else l&&(e-=3)>-1&&u.push(239,191,189);if(l=null,t<128){if((e-=1)<0)break;u.push(t)}else if(t<2048){if((e-=2)<0)break;u.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;u.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;u.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return u}function $t(r){const e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function kt(r,e){let t,i,l;const u=[];for(let h=0;h<r.length&&!((e-=2)<0);++h)t=r.charCodeAt(h),i=t>>8,l=t%256,u.push(l),u.push(i);return u}function Ge(r){return s.toByteArray(St(r))}function pe(r,e,t,i){let l;for(l=0;l<i&&!(l+t>=e.length||l>=r.length);++l)e[l+t]=r[l];return l}function q(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function Ie(r){return r!==r}const Lt=function(){const r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){const i=t*16;for(let l=0;l<16;++l)e[i+l]=r[t]+r[l]}return e}();function K(r){return typeof BigInt>"u"?Nt:r}function Nt(){throw new Error("BigInt not supported")}})(ct);var dt={exports:{}},k=dt.exports={},W,G;function Be(){throw new Error("setTimeout has not been defined")}function je(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?W=setTimeout:W=Be}catch{W=Be}try{typeof clearTimeout=="function"?G=clearTimeout:G=je}catch{G=je}})();function ht(o){if(W===setTimeout)return setTimeout(o,0);if((W===Be||!W)&&setTimeout)return W=setTimeout,setTimeout(o,0);try{return W(o,0)}catch{try{return W.call(null,o,0)}catch{return W.call(this,o,0)}}}function _i(o){if(G===clearTimeout)return clearTimeout(o);if((G===je||!G)&&clearTimeout)return G=clearTimeout,clearTimeout(o);try{return G(o)}catch{try{return G.call(null,o)}catch{return G.call(this,o)}}}var Y=[],ce=!1,Z,ye=-1;function Ii(){!ce||!Z||(ce=!1,Z.length?Y=Z.concat(Y):ye=-1,Y.length&&pt())}function pt(){if(!ce){var o=ht(Ii);ce=!0;for(var s=Y.length;s;){for(Z=Y,Y=[];++ye<s;)Z&&Z[ye].run();ye=-1,s=Y.length}Z=null,ce=!1,_i(o)}}k.nextTick=function(o){var s=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)s[c-1]=arguments[c];Y.push(new ft(o,s)),Y.length===1&&!ce&&ht(pt)};function ft(o,s){this.fun=o,this.array=s}ft.prototype.run=function(){this.fun.apply(null,this.array)};k.title="browser";k.browser=!0;k.env={};k.argv=[];k.version="";k.versions={};function V(){}k.on=V;k.addListener=V;k.once=V;k.off=V;k.removeListener=V;k.removeAllListeners=V;k.emit=V;k.prependListener=V;k.prependOnceListener=V;k.listeners=function(o){return[]};k.binding=function(o){throw new Error("process.binding is not supported")};k.cwd=function(){return"/"};k.chdir=function(o){throw new Error("process.chdir is not supported")};k.umask=function(){return 0};var Ai=dt.exports;(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const s=ct,c=Ai,p=f=>f&&f.__esModule?f:{default:f},m=p(c),y=globalThis||void 0||self;Object.defineProperty(o,"Buffer",{enumerable:!0,get:()=>s.Buffer}),Object.defineProperty(o,"process",{enumerable:!0,get:()=>m.default}),o.global=y})(lt);let M;typeof window<"u"?M=window:typeof self<"u"?M=self:M=lt.global;let Te=null,Ce=null;const it=20,be=M.clearTimeout,nt=M.setTimeout,ve=M.cancelAnimationFrame||M.mozCancelAnimationFrame||M.webkitCancelAnimationFrame,st=M.requestAnimationFrame||M.mozRequestAnimationFrame||M.webkitRequestAnimationFrame;ve==null||st==null?(Te=be,Ce=function(s){return nt(s,it)}):(Te=function([s,c]){ve(s),be(c)},Ce=function(s){const c=st(function(){be(p),s()}),p=nt(function(){ve(c),s()},it);return[c,p]});function Ei(o){let s,c,p,m,y,f,a;const g=typeof document<"u"&&document.attachEvent;if(!g){f=function(v){const C=v.__resizeTriggers__,R=C.firstElementChild,Q=C.lastElementChild,D=R.firstElementChild;Q.scrollLeft=Q.scrollWidth,Q.scrollTop=Q.scrollHeight,D.style.width=R.offsetWidth+1+"px",D.style.height=R.offsetHeight+1+"px",R.scrollLeft=R.scrollWidth,R.scrollTop=R.scrollHeight},y=function(v){return v.offsetWidth!==v.__resizeLast__.width||v.offsetHeight!==v.__resizeLast__.height},a=function(v){if(v.target.className&&typeof v.target.className.indexOf=="function"&&v.target.className.indexOf("contract-trigger")<0&&v.target.className.indexOf("expand-trigger")<0)return;const C=this;f(this),this.__resizeRAF__&&Te(this.__resizeRAF__),this.__resizeRAF__=Ce(function(){y(C)&&(C.__resizeLast__.width=C.offsetWidth,C.__resizeLast__.height=C.offsetHeight,C.__resizeListeners__.forEach(function(D){D.call(C,v)}))})};let x=!1,w="";p="animationstart";const _="Webkit Moz O ms".split(" ");let E="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),L="";{const v=document.createElement("fakeelement");if(v.style.animationName!==void 0&&(x=!0),x===!1){for(let C=0;C<_.length;C++)if(v.style[_[C]+"AnimationName"]!==void 0){L=_[C],w="-"+L.toLowerCase()+"-",p=E[C],x=!0;break}}}c="resizeanim",s="@"+w+"keyframes "+c+" { from { opacity: 0; } to { opacity: 0; } } ",m=w+"animation: 1ms "+c+"; "}const b=function(x){if(!x.getElementById("detectElementResize")){const w=(s||"")+".resize-triggers { "+(m||"")+'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%; }',_=x.head||x.getElementsByTagName("head")[0],E=x.createElement("style");E.id="detectElementResize",E.type="text/css",o!=null&&E.setAttribute("nonce",o),E.styleSheet?E.styleSheet.cssText=w:E.appendChild(x.createTextNode(w)),_.appendChild(E)}};return{addResizeListener:function(x,w){if(g)x.attachEvent("onresize",w);else{if(!x.__resizeTriggers__){const _=x.ownerDocument,E=M.getComputedStyle(x);E&&E.position==="static"&&(x.style.position="relative"),b(_),x.__resizeLast__={},x.__resizeListeners__=[],(x.__resizeTriggers__=_.createElement("div")).className="resize-triggers";const L=_.createElement("div");L.className="expand-trigger",L.appendChild(_.createElement("div"));const v=_.createElement("div");v.className="contract-trigger",x.__resizeTriggers__.appendChild(L),x.__resizeTriggers__.appendChild(v),x.appendChild(x.__resizeTriggers__),f(x),x.addEventListener("scroll",a,!0),p&&(x.__resizeTriggers__.__animationListener__=function(R){R.animationName===c&&f(x)},x.__resizeTriggers__.addEventListener(p,x.__resizeTriggers__.__animationListener__))}x.__resizeListeners__.push(w)}},removeResizeListener:function(x,w){if(g)x.detachEvent("onresize",w);else if(x.__resizeListeners__.splice(x.__resizeListeners__.indexOf(w),1),!x.__resizeListeners__.length){x.removeEventListener("scroll",a,!0),x.__resizeTriggers__.__animationListener__&&(x.__resizeTriggers__.removeEventListener(p,x.__resizeTriggers__.__animationListener__),x.__resizeTriggers__.__animationListener__=null);try{x.__resizeTriggers__=!x.removeChild(x.__resizeTriggers__)}catch{}}}}}class mt extends j.Component{constructor(...s){super(...s),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:c,disableWidth:p,onResize:m}=this.props;if(this._parentNode){var y,f,a,g;const b=window.getComputedStyle(this._parentNode)||{},A=parseFloat((y=b.paddingLeft)!==null&&y!==void 0?y:"0"),B=parseFloat((f=b.paddingRight)!==null&&f!==void 0?f:"0"),x=parseFloat((a=b.paddingTop)!==null&&a!==void 0?a:"0"),w=parseFloat((g=b.paddingBottom)!==null&&g!==void 0?g:"0"),_=this._parentNode.getBoundingClientRect(),E=_.height-x-w,L=_.width-A-B,v=this._parentNode.offsetHeight-x-w,C=this._parentNode.offsetWidth-A-B;(!c&&(this.state.height!==v||this.state.scaledHeight!==E)||!p&&(this.state.width!==C||this.state.scaledWidth!==L))&&(this.setState({height:v,width:C,scaledHeight:E,scaledWidth:L}),typeof m=="function"&&m({height:v,scaledHeight:E,scaledWidth:L,width:C}))}},this._setRef=c=>{this._autoSizer=c}}componentDidMount(){const{nonce:s}=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=Ei(s),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:s,defaultHeight:c,defaultWidth:p,disableHeight:m=!1,disableWidth:y=!1,nonce:f,onResize:a,style:g={},tagName:b="div",...A}=this.props,{height:B,scaledHeight:x,scaledWidth:w,width:_}=this.state,E={overflow:"visible"},L={};let v=!1;return m||(B===0&&(v=!0),E.height=0,L.height=B,L.scaledHeight=x),y||(_===0&&(v=!0),E.width=0,L.width=_,L.scaledWidth=w),j.createElement(b,{ref:this._setRef,style:{...E,...g},...A},!v&&s(L))}}const bi=d.styled_default("div")({name:"Container",class:"c1htq1lb",propsAsIs:!1}),vi=d.styled_default("div")({name:"Content",class:"cjyzpp7",propsAsIs:!1}),Bi=d.styled_default("div")({name:"Graphic",class:"g16mldgz",propsAsIs:!1}),ji=d.styled_default("div")({name:"Headline",class:"h69js65",propsAsIs:!1}),Ti=d.styled_default("div")({name:"StepsContainer",class:"smm7qmo",propsAsIs:!1}),Ci=d.styled_default("span")({name:"StepIndicator",class:"s17knuw2",propsAsIs:!1}),Fi=({width:o,graphicSrc:s,headline:c,stepsCount:p,currentStep:m})=>n.jsxs(bi,{children:[n.jsxs(vi,{children:[n.jsx(Bi,{"data-centered":m===0,children:n.jsx("img",{src:s,alt:c,width:o||300})}),c&&n.jsx(ji,{children:c})]}),n.jsx(Ti,{children:Array.from({length:p}).map((y,f)=>n.jsx(Ci,{"data-active":m===f},f))})]}),Si=d.styled_default("div")({name:"Container",class:"c1itm4k7",propsAsIs:!1}),$i=d.styled_default("div")({name:"IconContainer",class:"i1w4fsni",propsAsIs:!1}),ki=()=>d.n1,Li=d.styled_default(ki())({name:"InviteGameIcon",class:"i19m85r1",propsAsIs:!0}),Ni=d.styled_default("div")({name:"Content",class:"c1mbu204",propsAsIs:!1}),Ri=d.styled_default("div")({name:"Heading",class:"h1amdqtv",propsAsIs:!1}),Ui=d.styled_default("div")({name:"Subtext",class:"s1lhlj9j",propsAsIs:!1}),zi=d.styled_default("div")({name:"LinkContainer",class:"l1wot35e",propsAsIs:!1}),Oi=d.styled_default("div")({name:"LinkInfo",class:"l1jdw39q",propsAsIs:!1}),Di=d.styled_default("span")({name:"LinkTitle",class:"l1cr5mk",propsAsIs:!1}),Pi=d.styled_default("span")({name:"LinkAddress",class:"lvi87q4",propsAsIs:!1}),Mi=()=>d.n1,qi=d.styled_default(Mi())({name:"LinkIcon",class:"l1pqlvw3",propsAsIs:!0}),Wi=d.styled_default("div")({name:"SocialLinksContainer",class:"s1n7kzeh",propsAsIs:!1}),Gi=d.styled_default("a")({name:"SocialLink",class:"s2m9o9y",propsAsIs:!1}),Hi=d.styled_default("span")({name:"SocialLinkLabel",class:"sewjbbn",propsAsIs:!1}),yt=({inviteLink:o,socialLinks:s,inviteCardTitle:c,inviteCardSubtext:p,primaryColor:m,className:y})=>n.jsxs(Si,{className:y,children:[n.jsx($i,{style:{backgroundColor:m},children:n.jsx(Li,{name:"invite-game-icon"})}),n.jsxs(Ni,{children:[n.jsx(Ri,{children:c||""}),n.jsx(Ui,{children:p||""})]}),o&&n.jsxs(zi,{onClick:async()=>{if(o)try{await navigator.clipboard.writeText(o)}catch(f){console.error("Unable to copy to clipboard",f)}},children:[n.jsxs(Oi,{children:[n.jsx(Di,{children:"Invite link"}),n.jsx(Pi,{children:o})]}),n.jsx(qi,{name:"icon-copy"})]}),s&&s.length>0&&n.jsx(Wi,{children:s.map(({icon:f,link:a,label:g})=>n.jsxs(Gi,{href:a,target:"_blank",children:[n.jsx(d.n1,{name:f}),n.jsx(Hi,{children:g})]},a))})]}),Qi=d.styled_default("div")({name:"Container",class:"cm0bev",propsAsIs:!1}),Yi=d.styled_default("div")({name:"Content",class:"ce7x737",propsAsIs:!1}),Vi=d.styled_default("div")({name:"Title",class:"tc2tor6",propsAsIs:!1}),Ki=d.styled_default("div")({name:"RulesList",class:"r1k5klql",propsAsIs:!1}),Xi=d.styled_default("div")({name:"RulesItem",class:"r1tf3ft2",propsAsIs:!1}),Ji=d.styled_default("div")({name:"RuleIcon",class:"rwpvg1k",propsAsIs:!1}),Zi=d.styled_default("div")({name:"RuleText",class:"rbxiag0",propsAsIs:!1}),en=d.styled_default("button")({name:"TermsButton",class:"t6cyrry",propsAsIs:!1}),tn=({rules:o,rulesTitle:s,primaryColor:c})=>n.jsxs(Qi,{children:[n.jsxs(Yi,{children:[n.jsx(Vi,{children:s}),n.jsx(Ki,{children:o==null?void 0:o.map(({label:p,icon:m},y)=>n.jsxs(Xi,{children:[m&&n.jsx(Ji,{style:{backgroundColor:c},children:n.jsx(d.n1,{name:m,"data-icon":m})}),n.jsx(Zi,{children:p})]},y))})]}),n.jsx(en,{children:"See Terms and Conditions"})]}),rn=d.styled_default("button")({name:"SButton",class:"s1nve60q",propsAsIs:!1}),nn=d.styled_default("span")({name:"ButtonLabel",class:"b1xoswwx",propsAsIs:!1}),sn=({disabled:o,variant:s="primary",onClick:c,children:p,...m})=>n.jsx(rn,{onClick:c,disabled:o,"data-variant":s,...m,children:n.jsx(nn,{children:p})}),on=d.styled_default("div")({name:"Container",class:"c18uddbs",propsAsIs:!1}),an=d.styled_default("div")({name:"Content",class:"cvcfjf6",propsAsIs:!1}),ln=d.styled_default("div")({name:"OnboardingHeader",class:"o1ie27lw",propsAsIs:!1}),cn=d.styled_default("button")({name:"CloseBtn",class:"c15cjkwi",propsAsIs:!1}),un=()=>d.n1,dn=d.styled_default(un())({name:"IconClose",class:"i1mavjt2",propsAsIs:!0}),hn=d.styled_default("div")({name:"OnboardingFooter",class:"o1x0dyzv",propsAsIs:!1}),pn=()=>sn,fn=d.styled_default(pn())({name:"OnboardingActionBtn",class:"o1jfi9c3",propsAsIs:!0}),oe={steps:!1,rules:!1,inviteCard:!1},mn=({gamification:o,steps:s,rules:c,rulesBtnLabel:p,rulesTitle:m,primaryColor:y,inviteLink:f,socialLinks:a,inviteCardTitle:g,inviteCardSubtext:b,inviteCardBtnLabel:A,onClose:B})=>{const[x,w]=j.useState(0),[_,E]=j.useState(oe);j.useEffect(()=>{s!=null&&s.length?E({...oe,steps:!0}):c!=null&&c.length?E({...oe,rules:!0}):E({...oe,inviteCard:!0})},[]);const L=j.useMemo(()=>_.steps&&x===0?"Continue":_.rules?p||"Got it":_.inviteCard?A||"Play Now":"Next",[_,x,p,A]),v=j.useCallback(()=>{s!=null&&s.length&&x<s.length-1?w(R=>++R):c!=null&&c.length&&_.steps?E({...oe,rules:!0}):_.rules&&E({...oe,inviteCard:!0})},[x,s==null?void 0:s.length,c==null?void 0:c.length,_,w,E]),C=async()=>{await o.onboardingStatus.submitInplay()};return n.jsx(mt,{children:({width:R,height:Q})=>n.jsxs(on,{style:{width:R,height:Q},children:[n.jsx(ln,{children:n.jsx(cn,{onClick:B,children:n.jsx(dn,{name:"icon-close-btn-gray"})})}),n.jsxs(an,{children:[_.steps&&(s==null?void 0:s.length)&&n.jsx(Fi,{stepsCount:s.length,currentStep:x,...s[x]}),_.rules&&n.jsx(tn,{rules:c,rulesTitle:m,primaryColor:y}),_.inviteCard&&n.jsx(yt,{inviteLink:f,inviteCardTitle:g,inviteCardSubtext:b,primaryColor:y,socialLinks:a})]}),n.jsx(hn,{children:n.jsx(fn,{onClick:_.inviteCard?C:v,children:L})})]})})},yn=d.styled_default("div")({name:"Container",class:"c1pgyo67",propsAsIs:!1}),xn="hx17qu6",ke=({children:o,style:s,className:c,hiding:p})=>n.jsx(yn,{style:s,className:d.cx_default(c,p&&xn),children:o}),gn=d.styled_default("div")({name:"Container",class:"cocfo2g",propsAsIs:!1}),wn=d.styled_default("div")({name:"CloseIconWrap",class:"c1pdhxdk",propsAsIs:!1}),_n=()=>d.n1,In=d.styled_default(_n())({name:"CloseIcon",class:"c1funj3r",propsAsIs:!0}),An=d.styled_default("div")({name:"Title",class:"t1okg06y",propsAsIs:!1}),En=d.styled_default("img")({name:"SponsorLogo",class:"sb1n923",propsAsIs:!1}),bn=d.styled_default("div")({name:"PresentsTitle",class:"p1stllxd",propsAsIs:!1}),vn=d.styled_default("div")({name:"Subtitle",class:"s13kvdzw",propsAsIs:!1}),Bn=d.styled_default("div")({name:"Description",class:"dfvmv3t",propsAsIs:!1}),jn=d.styled_default("button")({name:"ActionButton",class:"ay8e3j9",propsAsIs:!1}),Tn=({close:o,action:s,onboarding:c})=>{var p,m,y,f,a,g,b,A;return n.jsxs(gn,{children:[n.jsx(wn,{onClick:o,children:n.jsx(In,{name:"icon-cross"})}),((m=(p=c==null?void 0:c.titleCard)==null?void 0:p.media)==null?void 0:m.sponsorLogo)&&n.jsxs(An,{children:[n.jsx(En,{alt:"sponsor-logo",src:(f=(y=c==null?void 0:c.titleCard)==null?void 0:y.media)==null?void 0:f.sponsorLogo}),n.jsx(bn,{children:"PRESENTS"})]}),((a=c==null?void 0:c.titleCard)==null?void 0:a.title)&&n.jsx(vn,{children:(g=c==null?void 0:c.titleCard)==null?void 0:g.title}),((b=c==null?void 0:c.titleCard)==null?void 0:b.subtitle)&&n.jsx(Bn,{children:(A=c==null?void 0:c.titleCard)==null?void 0:A.subtitle}),n.jsx(jn,{onClick:s,children:"Play Now"})]})},Cn=()=>ke,Fn=d.styled_default(Cn())({name:"OnboardingContainer",class:"o9squag",propsAsIs:!0}),Sn=({hiding:o,deepLink:s,onboardingOpts:c,setOpened:p,notification:m,gamification:y})=>{var f,a,g,b,A,B;const{data:x}=X.useStore(s.$store);return n.jsx(Fn,{hiding:o,children:n.jsx(mn,{rules:[{label:"Answer as many questions as you like.",icon:"icon-btn-feature-groups"},{label:"Win points for each correct trivia or prediction answer.",icon:"icon-thumb-up"},{label:"Top the leader board and best your friends.",icon:"icon-trophy"}],rulesBtnLabel:(f=c.rules)==null?void 0:f.buttonLabel,rulesTitle:(a=c.rules)==null?void 0:a.heading,steps:[{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_1.png",headline:"Welcome to the Featured Groups +",width:80},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_2.png",headline:"Get real-time insights",width:264},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_3.png",headline:"Predictions, trivia & polls synced to match play"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_4.png",headline:"Win points for every answer you get right"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_5.png",headline:"Compete against friends on the leaderboard"}],primaryColor:(g=c.inviteCard)==null?void 0:g.iconColor,inviteLink:x==null?void 0:x.url,inviteCardTitle:(b=c.inviteCard)==null?void 0:b.heading,inviteCardSubtext:(A=c.inviteCard)==null?void 0:A.subtext,inviteCardBtnLabel:(B=c.inviteCard)==null?void 0:B.buttonLabel,onClose:()=>{var w;p(!1),(w=m.close)==null||w.call(m)},socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],gamification:y})})},$n=({sdk:o,notification:s})=>{const[c,p]=j.useState(!1),m=o.getFeature(U.FeatureType.GAMES),y=s.data.onboarding;return c&&m&&y?n.jsx(Sn,{notification:s,setOpened:p,gamification:m,onboardingOpts:y,deepLink:m.deepLink}):n.jsx("div",{children:n.jsx(Tn,{close:s.close,action:()=>p(!0),onboarding:y})})},kn=()=>ke,Ln=d.styled_default(kn())({name:"Container",class:"ctckejh",propsAsIs:!0}),Nn=({sdk:o,notification:s})=>s.type===me.NotificationType.QUESTION?n.jsx("div",{children:n.jsx(rt,{...s})}):s.type===me.NotificationType.QUESTION_RESOLVED?n.jsx("div",{children:n.jsx(rt,{...s})}):s.type===me.NotificationType.ONBOARDING?n.jsx($n,{sdk:o,notification:s,hiding:s.hiding}):null,Rn=({sdk:o})=>{const[s]=j.useState(o.getNotificationsStore()),c=X.useStore(s),p=j.useMemo(()=>{if(!(c!=null&&c.size))return null;for(const m of c.values())if(m.type===me.NotificationType.ONBOARDING)return m;return c.values().next().value},[c]);return p?n.jsx(Ln,{hiding:p.hiding,children:n.jsx(Nn,{sdk:o,notification:p})}):null},Un=d.styled_default("div")({name:"SDKContainer",class:"stu11h7",propsAsIs:!1}),Fe=d.styled_default("div")({name:"SDKScrollContainer",class:"s1ucohr1",propsAsIs:!1}),xt=d.styled_default("div")({name:"SDKContentContainer",class:"s1el4wvm",propsAsIs:!1}),zn=()=>xt,On=d.styled_default(zn())({name:"SDKWhiteContainer",class:"s1oe3036",propsAsIs:!0}),Dn=o=>{const s=j.useRef(""),[c,p]=j.useState(!1),m=X.useStore(o.status),y=X.useStore(o.userId()),f=m==="ready",[a,g]=j.useState(J),b=j.useCallback((x,w)=>{g(w),w===J?(x&&o.createEventSession(x),o.openFeature(U.FeatureType.GAMES)):o.closeFeature()},[o]);j.useEffect(()=>{!f&&a===J&&(g(le),o.closeFeature())},[f,a,o]);const A=x=>{s.current=x,o.initializeApp().then(({enabled:w,err:_})=>{if(p(!0),_){b(x,le);return}if(w){o.isUserAuthorized().then(E=>{if(E){b(x,J);return}else o.disableApp()});return}})},B=()=>{p(!1),o.disableApp()};return j.useEffect(()=>{if(!y){f&&(g(le),o.disableApp());return}y&&s.current&&c&&o.initializeApp().then(()=>{o.createEventSession(s.current)})},[y]),{sdkEnabled:c,sdkReady:f,activeOverlay:a,activateAndLoadOverlay:b,activateEventWithId:A,deactivate:B,isLogged:!!y}},Pn=o=>{const s=X.useStore(o.getActiveFeature()),c=X.useStore(o.streamStore()),[p,m]=j.useState(null);return j.useEffect(()=>{const y=o.getFeatures();if(s)for(const[f,a]of y)f===s?a.status.get()===de.FeatureStatus.Suspended&&(a.enable(),m(a)):a.status.get()===de.FeatureStatus.Ready&&a.disable();else{for(const[,f]of y)f.status.get()===de.FeatureStatus.Ready&&f.disable();m(null)}return()=>{for(const[,f]of y)f.status.get()===de.FeatureStatus.Ready&&f.disable()}},[s,o,c]),[s,p]},Mn=({sdk:o,className:s})=>{const[,c]=Pn(o);return n.jsx(zt,{className:s,feature:c,sdk:o})},qn=({sdk:o,overlays:s,children:c})=>{const{sdkEnabled:p,sdkReady:m,activeOverlay:y,activateAndLoadOverlay:f,activateEventWithId:a,deactivate:g,isLogged:b}=Dn(o);return j.useEffect(()=>{Promise.resolve().then(()=>require("./gamification-feature.js"))},[]),n.jsxs(Un,{children:[p&&n.jsx(tr,{sdkReady:m,activeOverlay:y,className:ae.d,setActiveOverlay:A=>f("",A)}),m&&n.jsx(Rn,{sdk:o}),n.jsx(Fe,{"data-nav":p.toString(),style:{display:!p||y===le?"block":"none"},children:c&&c({activateEventWithId:a,deactivate:g})}),n.jsx(Fe,{"data-nav":p.toString(),style:{display:y===xe?"block":"none"},children:s&&y===xe&&s[y]}),m&&y===J&&n.jsx(Mn,{className:ae.d,sdk:o}),!b&&n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"You are not logged in."})]})};const Wn=({sdkKey:o,plugins:s,children:c,production:p=!0})=>n.jsx(ae.StreamLayerProvider,{sdkKey:o,plugins:s,production:p,autoEnable:!1,children:c}),Gn=({children:o,overlays:s})=>{const{sdk:c,status:p}=j.useContext(ae.StreamLayerContext);if(p===ae.StreamLayerStatus.UNSET)throw new Error("Wrap app in `StreamLayerProvider`");return c?n.jsx("div",{className:"StreamLayerSDK",children:n.jsx(ae.s,{style:{height:"100%"},children:n.jsx(qn,{sdk:c,overlays:s,children:o})})}):o({})};exports.AutoSizer=mt;exports.MastersStreamLayerProvider=Wn;exports.MastersStreamLayerSDKReact=Gn;exports.O=yt;exports.a=On;exports.d=ke;exports.n=xt;exports.o=ot;exports.r=Fe;exports.w=at;
@@ -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,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+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,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+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:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),ot=()=>n.n1,lt=n.styled_default(ot())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),ct=()=>s.jsx(at,{children:s.jsx(lt,{name:"mastersLogo"})}),dt=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),ut=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),pt=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),mt=({title:e,description:t})=>s.jsxs(dt,{children:[s.jsx(n.n1,{name:"icon-check-circle"}),s.jsx(ut,{children:e}),s.jsx(pt,{children:t})]}),ft=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ht=()=>n.n1,It=n.styled_default(ht())({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}),yt=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),$=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),gt=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),xt=({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(ft,{"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(gt,{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(It,{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(yt,{"data-feedbackType":u,children:f==null?void 0:f.title}),s.jsx($,{children:f==null?void 0:f.description})]})})]})]})},jt=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),vt=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),Mt=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),Tt=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),Nt=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),At=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),St=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Dt=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),zt=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),me=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),kt=()=>me,Ot=n.styled_default(kt())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),wt=()=>me,Ct=n.styled_default(wt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),_t=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),bt=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Et=n.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),Lt=()=>n.n1,$t=n.styled_default(Lt())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),G={[n.QuestionImages.CENTERED]:e=>s.jsx(Ot,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(Dt,{children:s.jsx(zt,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(Ct,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},Rt=({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"},Qt=({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,Ut=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=Rt(e),p=Qt({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(Nt,{value:r,"data-selected":m,"data-answerState":d,disabled:u||y||v||h,"data-isNotChecked":u&&!m&&d!=="incorrect",onClick:c,children:[s.jsx(At,{"data-answerState":d,style:{width:`${I?l:0}%`}}),s.jsxs(St,{children:[i&&f&&((t=G[f])==null?void 0:t.call(G,i)),s.jsx(_t,{children:a}),I&&s.jsxs(bt,{children:[p&&s.jsx($t,{name:"selected"}),s.jsx(Et,{children:s.jsx(n.d,{value:l,suffix:"%"})})]})]})]})};var Z=typeof window>"u"?T.useEffect:T.useLayoutEffect,Pt=({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}},qt=(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,Yt=e=>({position:"relative",width:e,height:e}),Wt={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:[]},Ft=(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(",")})`},Vt=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}=qt(a,M,f),{elapsedTime:d}=Pt({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:Ft(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}=Vt(e);return T.createElement("div",{style:Yt(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:Wt},t({remainingTime:f,elapsedTime:v,color:m})))};he.displayName="CountdownCircleTimer";const Bt=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1],Ht=[10,10,0],Gt=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Zt=n.E.SECONDARY_GREEN6,X=n.E.SECONDARY_RED3,Jt=n.E.NEUTRALS_GRAY3,Kt=({isPlaying:e=!0,duration:t=30,onTimerExpired:r})=>{const[i,a]=T.useState(t>10?Zt:X),l=({remainingTime:u})=>s.jsx(Gt,{children:u}),c=T.useCallback(()=>{r==null||r(),a(Jt)},[r,a]),m=T.useCallback(u=>{u===10&&a(X)},[a]);return s.jsx(he,{isPlaying:e,duration:t,colors:Bt,colorsTime:Ht,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:c,onUpdate:m,children:l})},Xt=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),es=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),ts=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),ss=()=>n.n1,ns=n.styled_default(ss())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),is=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),rs=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),as=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),os=({title:e,points:t,isPlayingTimer:r,isTimer:i,questionType:a,timerDuration:l,onTimerExpired:c})=>s.jsxs(Xt,{children:[s.jsxs(es,{children:[e&&s.jsx(ts,{children:e}),t!==void 0&&a!==n.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(ns,{name:"icon-trophy"}),s.jsxs(is,{children:[s.jsx(rs,{children:s.jsx(n.d,{value:t})}),s.jsx(as,{children:"PTS"})]})]})]}),i&&s.jsx(Kt,{isPlaying:r,onTimerExpired:c,duration:l})]}),ls=({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(jt,{children:s.jsxs(vt,{children:[I&&s.jsx(xt,{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(os,{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(mt,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(Mt,{"data-isPrediction":e.type===n.QuestionType.PREDICTION,children:c}),s.jsx(Tt,{children:h.map(j=>s.jsx(Ut,{...j},j.id))})]})]})})})},cs=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),ds=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),us=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ps=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),ms=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),fs=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(cs,{children:[a&&s.jsxs(ms,{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(fs,{src:l}),s.jsxs(ds,{children:[s.jsx(us,{children:(i==null?void 0:i.heading)||r}),s.jsx(ps,{children:i==null?void 0:i.body})]})]})},hs=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),Is=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ys=({instantView:e,...t})=>s.jsxs(hs,{children:[s.jsx(Ie,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(Is,{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"})]})]}),gs=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),xs=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ys,{created:e.attributes.created,...e.attributes.attributes.value}):null},js=({extendedQuestion:e,vote:t,close:r})=>{const{loading:i,data:a}=e;return a?s.jsx(ls,{vote:t,close:r,openedQuestion:a,isLoading:!!i}):null},vs=({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(gs,{children:[s.jsx(ce,{close:e.closeQuestion,type:((t=r.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),a==="question"&&s.jsx(js,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),a!=="question"&&s.jsx(xs,{openedQuestion:r}),s.jsx(ct,{sponsorLogo:""})]})},Ms=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),Ts=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),Ns=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),As=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(Ns,{onClick:r,"data-selected":t,children:s.jsx(As,{children:e})}),Ss=({activePage:e="home",toggleActivePage:t})=>s.jsx(Ms,{children:s.jsxs(Ts,{"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 Ds(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 zs(e,t){return!!(e===t||se(e)&&se(t))}function ks(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!zs(e[r],t[r]))return!1;return!0}function R(e,t){t===void 0&&(t=ks);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 Os=typeof performance=="object"&&typeof performance.now=="function",ne=Os?function(){return performance.now()}:function(){return Date.now()};function ie(e){cancelAnimationFrame(e.id)}function ws(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 Cs=150,_s=function(t,r){return t};function bs(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){Ds(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=ws(o._resetIsScrolling,Cs)},o._resetIsScrolling=function(){o._resetIsScrollingTimeoutId=null,o.setState({isScrolling:!1},function(){o._getItemStyleCache(-1,null)})},o}y.getDerivedStateFromProps=function(o,d){return Es(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?_s: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 Es=function(t,r){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,r.instance},Ls=bs({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 Rs(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 Qs=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Us=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}}(),Ps=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},qs=function(e){Ps(t,e);function t(){var r,i,a,l;Qs(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 Us(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=Rs({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 Ys=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Ws=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Fs=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Vs=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Bs=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Hs=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Gs=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Zs=()=>n.n1,Js=n.styled_default(Zs())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Ks=({rank:e,avatar:t,name:r,points:i,isCurrentUser:a,openItemDetail:l,style:c})=>s.jsxs(Ys,{onClick:l,style:c,children:[s.jsx(Ws,{children:e||0}),s.jsxs(Bs,{children:[t?s.jsx(Fs,{alt:"leaderboard-item-avatar",src:t}):s.jsx(Vs,{children:de(r||"")}),s.jsxs(Hs,{children:[s.jsx(Gs,{children:r||""}),a&&s.jsx(Js,{name:"icon-star"})]})]}),s.jsx("div",{children:ue(i)})]}),Xs=n.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),en=({items:e,currentUserId:t,openItemDetail:r,fetchMore:i})=>s.jsx(n.AutoSizer,{children:({width:a,height:l})=>s.jsx(qs,{isItemLoaded:c=>c<e.length,itemCount:e.length+1,loadMoreItems:i,children:({onItemsRendered:c,ref:m})=>s.jsx(Xs,{children:s.jsx(Ls,{itemSize:56,onItemsRendered:c,ref:m,itemCount:e.length,width:a,height:l,children:({index:u,style:f})=>s.jsx(Ks,{style:{...f,maxHeight:48},...e[u],openItemDetail:()=>r(e[u].userId),isCurrentUser:!!t&&t===e[u].userId},e[u].userId)})})})}),tn=({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."})},sn=({gamification:e})=>{const{data:t}=n.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(en,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(tn,{deepLink:e.deepLink})},nn=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),rn=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),an=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),on=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),ln=()=>n.n1,b=n.styled_default(ln())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),cn=()=>n.n1,dn=n.styled_default(cn())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),un=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),pn=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),mn=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),fn={[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"})},hn=({questionId:e,questionType:t,questionStatus:r,subject:i,openForVoting:a,openQuestion:l,status:c})=>{const m=n.o[t],u=fn[c];return m?s.jsxs(nn,{onClick:()=>l==null?void 0:l(e),children:[s.jsxs(pn,{children:[s.jsxs(rn,{children:[s.jsx(dn,{"data-type-trivia":t===n.QuestionType.TRIVIA,"data-type-poll":t===n.QuestionType.POLL,name:m.iconName}),s.jsxs(un,{children:[m.label,t===n.QuestionType.TRIVIA&&r===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(an,{children:i||""})]}),s.jsx(on,{children:a?s.jsx(mn,{children:"Play"}):u})]}):null},In=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),yn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),gn=({openInsight:e,questionId:t,...r})=>s.jsxs(In,{children:[s.jsx(Ie,{questionId:t,...r}),e&&s.jsx(yn,{onClick:()=>e(t),children:"View Insight"})]}),xn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),jn=({questions:e,openQuestion:t})=>s.jsx(xn,{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(hn,{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(gn,{openInsight:t,...l},l.questionId)}return null})}),vn=({store:e,openQuestion:t})=>{const r=n.useStore(e);return r!=null&&r.data?s.jsx(jn,{openQuestion:t,questions:r.data}):s.jsx("div",{children:"wait questions..."})},Mn=({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..."})},Tn=({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(Ss,{activePage:t,toggleActivePage:r})}),t===E.HOME&&s.jsxs(n.r,{children:[s.jsx(n.a,{style:{paddingTop:"12px"},children:s.jsx(Mn,{userSummary:e.userSummary})}),s.jsx(n.n,{children:s.jsx(vn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===E.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(sn,{gamification:e})})]})},Nn=()=>n.d$1,le=n.styled_default(Nn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),An=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Sn=({correct:e,incorrect:t})=>{const r=e+t;return r===0?0:Math.round(e/r*100)},Dn=({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(vs,{gamification:e})}),i&&s.jsx(le,{className:t,children:s.jsxs(An,{children:[s.jsx(ce,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.a,{children:s.jsx(pe,{...i,successRate:Sn(i)})})]})}),s.jsx(n.r,{className:t,"data-nav":"true",children:s.jsx(Tn,{gamification:e})})]})};exports.default=Dn;