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