@streamlayer/web-os 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/lib/cjs/gamification-feature.js +1 -1
  2. package/lib/cjs/index.js +1 -1
  3. package/lib/cjs/index2.js +25 -40
  4. package/lib/classic/cjs/classic.js +1 -1
  5. package/lib/classic/cjs/gamification-feature.js +1 -1
  6. package/lib/classic/cjs/index.js +1 -1
  7. package/lib/classic/cjs/index2.js +1 -10
  8. package/lib/classic/classic.d.ts +2 -13
  9. package/lib/classic/core/app/app.d.ts +16 -0
  10. package/lib/classic/core/app/event.d.ts +6 -0
  11. package/lib/classic/core/app/provider.d.ts +49 -0
  12. package/lib/classic/core/app/useStreamLayerApp.d.ts +23 -0
  13. package/lib/classic/core/index.d.ts +4 -0
  14. package/lib/classic/es/classic.js +78 -8
  15. package/lib/classic/es/gamification-feature.js +638 -2
  16. package/lib/classic/es/index.js +157 -10
  17. package/lib/classic/es/index2.js +19054 -11977
  18. package/lib/classic/index.d.ts +2 -13
  19. package/lib/classic.d.ts +2 -13
  20. package/lib/core/app/app.d.ts +16 -0
  21. package/lib/core/app/event.d.ts +6 -0
  22. package/lib/core/app/provider.d.ts +49 -0
  23. package/lib/core/app/useStreamLayerApp.d.ts +23 -0
  24. package/lib/core/index.d.ts +4 -0
  25. package/lib/es/gamification-feature.js +606 -2
  26. package/lib/es/index.js +2 -2
  27. package/lib/es/index2.js +16237 -23252
  28. package/lib/index.d.ts +2 -13
  29. package/package.json +19 -20
  30. package/lib/cjs/gamification-feature2.js +0 -1
  31. package/lib/classic/cjs/classic2.js +0 -10
  32. package/lib/classic/cjs/gamification-feature2.js +0 -1
  33. package/lib/classic/cjs/gamification-feature3.js +0 -1
  34. package/lib/classic/cjs/index3.js +0 -1
  35. package/lib/classic/es/classic2.js +0 -13037
  36. package/lib/classic/es/gamification-feature2.js +0 -4
  37. package/lib/classic/es/gamification-feature3.js +0 -643
  38. package/lib/classic/es/index3.js +0 -14930
  39. package/lib/es/gamification-feature2.js +0 -608
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("react/jsx-runtime"),require("./index3.js"),require("nanostores");const e=require("./classic2.js");require("react"),require("lodash.throttle"),require("react-dom"),require("react-countup"),exports.StreamLayerProvider=e.StreamLayerProvider,exports.StreamLayerSDKTv=e.StreamLayerSDKTv,exports.useStreamLayer=e.nf,exports.useStreamLayerUI=e.af;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("./index2.js"),t=require("react");require("nanostores"),require("lodash.throttle"),require("react-dom"),require("react-countup");const s=new Set([r.anonymous]),o=({sdk:e})=>(t.useEffect(()=>{e.anonymousAuthorization()},[e]),null);exports.useStreamLayer=r.useStreamLayer,exports.useStreamLayerUI=r.useStreamLayerUI,exports.StreamLayerProvider=t=>e.jsx(r.StreamLayerProvider,{...t,themeMode:"dark",withAd:!0,skipOnboarding:!0,withAdNotification:!0,autoEnable:!0,plugins:s,friendsTab:"disabled",hideFriends:!0,webOS:!0}),exports.StreamLayerSDKTv=({persistent:s,children:a,showPauseAd:n,pauseAdVastUrl:u,videoPlayerController:d,onRenderPauseAd:i,onClosePauseAd:l,options:m})=>{const c=r.useStreamLayer(),h=r.useStreamLayerTheme(),y=t.useRef();return t.useEffect(()=>{if(c)return d&&(y.current=d,c.addVideoPlayerController(y.current)),()=>{y.current&&c.removeVideoPlayerController(y.current)}},[c]),c?e.jsx("div",{className:"StreamLayerSDK",children:e.jsxs(r.h,{customTheme:h.theme,themeMode:h.themeMode,children:[e.jsx(r.W,{sdk:c,persistent:s,showPauseAd:n,onRenderPauseAd:i,pauseAdVastUrl:u,onClosePauseAd:l,options:m,children:a}),e.jsx(o,{sdk:c})]})}):null};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index2.js");exports.default=e.Ff;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),e=require("./index2.js");require("@noriginmedia/norigin-spatial-navigation");const t=require("react");require("react-countdown-circle-timer");const a=require("react-dom");require("react-countup"),require("nanostores"),require("lodash.throttle");const n=require("react-infinite-scroller"),r=e.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),l=e.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),i=e.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),d=({indicator:e,title:t})=>s.jsxs(r,{children:[s.jsx(l,{children:t}),s.jsx(i,{children:e})]}),o=e.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),c=e.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),u=e.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),p=({indicator:e,title:t})=>s.jsxs(o,{children:[s.jsx(c,{children:e}),s.jsx(u,{children:t})]}),m=e.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),h=e.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),x=e.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),f=e.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),v=e.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),j=e.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),y=e.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),I=e.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),C=e.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),A=e.styled_default("div")({name:"RtsContainer",class:"r2vgnxv",propsAsIs:!1}),g=e.styled_default("div")({name:"RtsDivider",class:"roqn06j",propsAsIs:!1}),b=e.styled_default("div")({name:"Rts",class:"r15adx7c",propsAsIs:!1}),_=e.styled_default("div")({name:"RtsIndicator",class:"rv59lta",propsAsIs:!1}),k=e.styled_default("div")({name:"RtsLabel",class:"r55lotb",propsAsIs:!1}),w=e.styled_default("div")({name:"Divider",class:"d1knfgqt",propsAsIs:!1}),S=e.styled_default("div")({name:"Ranks",class:"r1mqo824",propsAsIs:!1}),q=e.styled_default("div")({name:"Statistics",class:"sxareh6",propsAsIs:!1}),L=e.styled_default("div")({name:"AvatarPlaceholder",class:"amcu48h",propsAsIs:!1}),T=e.styled_default("button")({name:"UserAccountBtn",class:"u32nfkp",propsAsIs:!1}),N=({loading:t,hideFriendsRank:a,avatar:n,name:r,points:l,friendsRank:i,rank:o,streak:c,correct:u,incorrect:N,inTop:R,successRate:M})=>s.jsxs(m,{"data-loading":t,children:[s.jsx(h,{children:s.jsx(e.i,{loading:t,children:s.jsxs(f,{children:[s.jsxs(T,{children:[n&&s.jsx(v,{alt:"avatar",src:n}),!n&&s.jsx(L,{children:e.I(r||"")})]}),s.jsxs(j,{children:[s.jsx(y,{children:r}),s.jsxs(I,{children:[s.jsxs(A,{children:[s.jsxs(b,{children:[s.jsx(C,{alt:"rank-icon",src:"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Trophy'%3e%3cpath%20id='Combined%20Shape'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.69197%204.66662C3.69197%205.99705%203.92914%207.17787%204.4035%208.20912C3.49966%208.02451%202.74487%207.66486%202.1391%207.13014C1.53333%206.59542%201.23046%206.0798%201.23046%205.58328V4.66662H3.69197ZM14.7686%204.66662V5.58328C14.7686%206.0798%2014.4658%206.59542%2013.86%207.13014C13.2542%207.66486%2012.4994%208.02451%2011.5956%208.20912C12.0699%207.17787%2012.3071%205.99705%2012.3071%204.66662H14.7686ZM15.9998%205.58329V4.36108C15.9998%204.10645%2015.9101%203.89002%2015.7306%203.71178C15.5511%203.53354%2015.3332%203.44442%2015.0768%203.44442H12.3076V2.52776C12.3076%202.10763%2012.1569%201.74797%2011.8556%201.44878C11.5544%201.14959%2011.1922%201%2010.7691%201H5.23072C4.80764%201%204.44547%201.14959%204.14419%201.44878C3.84291%201.74797%203.69227%202.10763%203.69227%202.52776V3.44442H0.923068C0.666659%203.44442%200.448714%203.53354%200.269228%203.71178C0.0897418%203.89002%200%204.10645%200%204.36108V5.58329C0%206.03525%200.13301%206.49039%200.399034%206.94872C0.665059%207.40705%201.02403%207.82082%201.47595%208.19003C1.92787%208.55924%202.48234%208.86957%203.13939%209.12101C3.79644%209.37246%204.48713%209.51409%205.21149%209.54592C5.48071%209.88967%205.7852%2010.192%206.12494%2010.453C6.36853%2010.6695%206.53679%2010.9002%206.62974%2011.1453C6.72269%2011.3904%206.76916%2011.6752%206.76916%2011.9999C6.76916%2012.3436%206.67141%2012.6333%206.4759%2012.8688C6.28038%2013.1043%205.96789%2013.2221%205.53841%2013.2221C5.05764%2013.2221%204.62976%2013.3669%204.25476%2013.6566C3.87977%2013.9462%203.69227%2014.3106%203.69227%2014.7499V15.361C3.69227%2015.4501%203.72112%2015.5233%203.77881%2015.5806C3.8365%2015.6379%203.91022%2015.6665%203.99996%2015.6665H11.9999C12.0896%2015.6665%2012.1633%2015.6379%2012.221%2015.5806C12.2787%2015.5233%2012.3076%2015.4501%2012.3076%2015.361V14.7499C12.3076%2014.3106%2012.1201%2013.9462%2011.7451%2013.6566C11.3701%2013.3669%2010.9422%2013.2221%2010.4614%2013.2221C10.0319%2013.2221%209.71945%2013.1043%209.52394%2012.8688C9.32843%2012.6333%209.23068%2012.3436%209.23068%2011.9999C9.23068%2011.6752%209.27715%2011.3904%209.3701%2011.1453C9.46305%2010.9002%209.63131%2010.6695%209.8749%2010.453C10.2146%2010.192%2010.5191%209.88967%2010.7884%209.54592C11.5127%209.51409%2012.2034%209.37246%2012.8604%209.12101C13.5175%208.86957%2014.072%208.55924%2014.5239%208.19003C14.9758%207.82082%2015.3348%207.40705%2015.6008%206.94872C15.8668%206.49039%2015.9998%206.03525%2015.9998%205.58329ZM6.76047%207.1798L8.05109%206.49997L9.3417%207.1798L9.09521%205.73989L10.1393%204.72015L8.69639%204.51007L8.05109%203.2L7.40578%204.51007L5.96283%204.72015L7.00696%205.73989L6.76047%207.1798Z'%20fill='%23F2C94C'/%3e%3c/g%3e%3c/svg%3e"}),s.jsxs(_,{children:[e.s(l),s.jsx(k,{children:"PTS"})]})]}),a&&s.jsxs(_,{children:[s.jsx(g,{}),o||0,s.jsx(k,{children:"global rank"})]})]}),!a&&s.jsxs(s.Fragment,{children:[s.jsx(w,{}),s.jsxs("div",{children:["TOP ",R||0,"%"]})]})]})]})]})})}),s.jsxs(x,{children:[!a&&s.jsxs(S,{children:[s.jsx(e.i,{loading:t,style:{width:"100%"},children:s.jsx(d,{indicator:i||0,title:"Friends rank"})}),s.jsx(e.i,{loading:t,style:{width:"100%"},children:s.jsx(d,{indicator:o||0,title:"Global rank"})})]}),s.jsx(e.i,{loading:t,children:s.jsxs(q,{children:[s.jsx(p,{indicator:c||0,title:"Win streak"}),s.jsx(p,{indicator:u||0,title:"Correct"}),s.jsx(p,{indicator:N||0,title:"Incorrect"}),s.jsx(p,{indicator:`${M||0}%`,title:"Succ. rate"})]})})]})]}),R=e.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),M=e.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),V=e.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),B=e.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var D=(s=>(s.HOME="home",s.LEADERBOARD="leaderboard",s))(D||{});const E=({title:e,active:t,onClick:a})=>s.jsx(V,{"data-a":"intr",onClick:a,"data-selected":t,children:s.jsx(B,{"data-a":"intr",children:e})}),F=({activePage:e="home",toggleActivePage:t})=>s.jsx(R,{children:s.jsxs(M,{"data-position":"home"===e?"left":"right",children:[s.jsx(E,{title:"Home",active:"home"===e,onClick:()=>t("home")}),s.jsx(E,{title:"Friends",active:"leaderboard"===e,onClick:()=>t("leaderboard")})]})}),P=e.styled_default("button")({name:"Container",class:"cpjnajb",propsAsIs:!1}),U=e.styled_default("div")({name:"Content",class:"c4m6kaz",propsAsIs:!1}),H=e.styled_default("span")({name:"Title",class:"t1h8t9cc",propsAsIs:!1}),O=()=>s.jsx(P,{children:s.jsxs(U,{children:[s.jsx(e.B1,{name:"iconCopySuccess"}),s.jsx(H,{children:"Link Copied to Clipboard"})]})}),z=e=>{const n=t.useRef(),[r,l]=t.useState(null),i=t.useCallback(async t=>{var r;if(t&&null!=(r=null==navigator?void 0:navigator.clipboard)&&r.writeText){n.current&&(clearTimeout(n.current),l(null));try{await navigator.clipboard.writeText(t),e.current&&(l(a.createPortal(s.jsx(O,{}),e.current)),n.current=setTimeout(()=>{l(null)},1e3))}catch(i){console.error("Unable to copy to clipboard",i)}}},[e]);return t.useEffect(()=>()=>{clearTimeout(n.current)},[]),[i,r]},Q=e.styled_default("div")({name:"Container",class:"c1ux29ft",propsAsIs:!1}),$=e.styled_default(e.B1)({name:"FriendsIcon",class:"f10ncfg2",propsAsIs:!0}),Z=e.styled_default("div")({name:"Content",class:"c1yc07bd",propsAsIs:!1}),K=e.styled_default("div")({name:"Title",class:"tj6cq7w",propsAsIs:!1}),W=e.styled_default("div")({name:"Description",class:"d1ag78xo",propsAsIs:!1}),G=e.styled_default(e.B1)({name:"ArrowInviteIcon",class:"awohrz6",propsAsIs:!0}),J=({title:t,description:a,onClick:n,className:r})=>{const[l]=e.f({type:"invitation",action:"sent",payload:{from:e.InvitationFrom.TITLE_CARD}});return s.jsxs(Q,{"data-a":"intr",onClick:l(n),className:r,children:[s.jsx($,{name:"icon-friends"}),s.jsxs(Z,{children:[s.jsx(K,{children:t}),s.jsx(W,{children:a})]}),s.jsx(G,{name:"icon-copy"})]})},X=e.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Y=e.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),ss=e.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),es=e.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),ts=e.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),as=e.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),ns=e.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),rs=e.styled_default(e.B1)({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),ls=({friendsRank:t,avatar:a,name:n,userId:r,points:l,isCurrentUser:i,style:d})=>s.jsxs(X,{"data-name":r,style:d,children:[s.jsx(Y,{children:t||0}),s.jsxs(ts,{children:[a?s.jsx(ss,{alt:"leaderboard-item-avatar",src:a}):s.jsx(es,{children:e.I(n||"")}),s.jsxs(as,{children:[s.jsx(ns,{children:n||""}),i&&s.jsx(rs,{name:"icon-star"})]})]}),s.jsx("div",{children:e.s(l)})]}),is=e.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),ds=({items:e,currentUserId:a,openItemDetail:r,fetchMore:l,scrollNode:i,hasMore:d})=>{const o=t.useCallback(s=>{const e=s.target.getAttribute("data-name");e&&r(e)},[r]);return s.jsx(n,{loadMore:l,initialLoad:!1,hasMore:d,useWindow:!1,getScrollParent:()=>i.current,children:s.jsx(is,{"data-a":"intr",onClick:o,children:e.map(e=>s.jsx(ls,{...e,isCurrentUser:!!a&&a===e.userId},e.userId))})})},os=e.styled_default("div")({name:"Container",class:"c1itm4k7",propsAsIs:!1}),cs=e.styled_default("div")({name:"IconContainer",class:"i1w4fsni",propsAsIs:!1}),us=e.styled_default(e.B1)({name:"InviteGameIcon",class:"i19m85r1",propsAsIs:!0}),ps=e.styled_default("div")({name:"Content",class:"c1mbu204",propsAsIs:!1}),ms=e.styled_default("div")({name:"Heading",class:"h1amdqtv",propsAsIs:!1}),hs=e.styled_default("div")({name:"Subtext",class:"s1lhlj9j",propsAsIs:!1}),xs=e.styled_default("div")({name:"LinkContainer",class:"l1wot35e",propsAsIs:!1}),fs=e.styled_default("div")({name:"LinkInfo",class:"l1jdw39q",propsAsIs:!1}),vs=e.styled_default("span")({name:"LinkTitle",class:"l1cr5mk",propsAsIs:!1}),js=e.styled_default("span")({name:"LinkAddress",class:"lvi87q4",propsAsIs:!1}),ys=e.styled_default(e.B1)({name:"LinkIcon",class:"l1pqlvw3",propsAsIs:!0}),Is=({inviteLink:a,inviteCardTitle:n,inviteCardSubtext:r,primaryColor:l,className:i})=>{const d=t.useRef(null),[o,c]=z(d),[u]=e.f({type:"invitation",action:"sent",payload:{from:e.InvitationFrom.MENU}});return s.jsxs(os,{className:i,children:[s.jsx(cs,{style:{backgroundColor:l},children:s.jsx(us,{name:"invite-game-icon"})}),s.jsxs(ps,{children:[s.jsx(ms,{children:n||""}),s.jsx(hs,{children:r||""})]}),a&&s.jsxs(xs,{ref:d,"data-a":"intr",onClick:u(()=>o(a)),children:[s.jsxs(fs,{children:[s.jsx(vs,{children:"Invite link"}),s.jsx(js,{children:a})]}),s.jsx(ys,{name:"icon-copy"})]}),c]})},Cs=e.styled_default("div")({name:"InviteFriendsContainer",class:"i1c9dygq",propsAsIs:!1}),As=({deepLink:e})=>s.jsx(Cs,{children:s.jsx(Is,{inviteLink:e,inviteCardTitle:"It’s More Fun With Friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})}),gs=e.styled_default("div")({name:"InviteLinkContainer",class:"i1odbhm4",propsAsIs:!1}),bs=({gamification:a,scrollNode:n,scrollStore:r})=>{const l=t.useRef(null),{data:i,hasMore:d,loading:o,key:c}=e.useStore(a.leaderboardList.$store),{data:u}=e.useStore(a.deepLink.$store),[p,m]=z(l);return i.length||o?s.jsxs(s.Fragment,{children:[s.jsx(ds,{items:i,scrollNode:n,scrollStore:r,fetchMore:a.leaderboardList.fetchMore,hasMore:d,openItemDetail:a.openUser,currentUserId:a.currentUserId.get()},c),u&&s.jsx(gs,{ref:l,children:s.jsx(J,{"data-a":"intr",onClick:()=>p(u),title:"Invite Friends",description:"Challenge them now!"})}),m]}):s.jsx(As,{deepLink:u})},_s=e.styled_default(e.r)({name:"Container",class:"cll3md7",propsAsIs:!0}),ks=e.styled_default(e.S)({name:"ActionBtn",class:"a10g1iik",propsAsIs:!0}),ws=({questionId:t,...a})=>s.jsxs(_s,{"data-a":"intr","data-name":t,children:[s.jsx(e.O,{questionId:t,...a}),s.jsx(ks,{"data-a":"intr","data-name":t,children:"View Insight"})]}),Ss=e.styled_default(e.r)({name:"Container",class:"cl56x6b",propsAsIs:!0}),qs=e.styled_default("button")({name:"ActionButton",class:"a11pzf92",propsAsIs:!1}),Ls=e.styled_default("blockquote")({name:"Quote",class:"q1hbaleq",propsAsIs:!1}),Ts=({...t})=>s.jsxs(Ss,{"data-a":"intr","data-name":t.tweetId,children:[t.title&&s.jsx(Ls,{children:t.title}),s.jsx(e.b,{...t}),s.jsx(qs,{"data-a":"intr","data-name":t.tweetId,children:"View Insight"})]}),Ns=e.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),Rs=({questions:t,openQuestion:a,controlVideo:n})=>t?s.jsx(Ns,{"data-a":"intr",onClick:s=>{const t=s.target.getAttribute("data-name");t&&(e.wt(),a(t,{openedFrom:"list"}))},children:null==t?void 0:t.map(t=>{var a,r,l;if("question"===t.type&&"question"===(null==(a=t.attributes)?void 0:a.attributes.case)){const a=t.attributes.attributes.value;return s.jsx(e.R,{...a},a.questionId)}if("insight"===t.type&&"insight"===(null==(r=t.attributes)?void 0:r.attributes.case)){const e=t.attributes.attributes.value;return s.jsx(ws,{controlVideo:n,...e},e.questionId)}if("tweet"===t.type&&"tweet"===(null==(l=t.attributes)?void 0:l.attributes.case)){const e=t.attributes.attributes.value,a=t.attributes.id;return s.jsx(Ts,{controlVideo:n,...e,tweetId:a},a)}return null})}):s.jsx(Ns,{children:Array.from({length:5}).map((t,a)=>s.jsx(e.D,{},a))}),Ms=({store:t,openQuestion:a})=>{const{sdk:n}=e.p(),r=e.useStore(t);return s.jsx(Rs,{openQuestion:a,questions:r.data,controlVideo:null==n?void 0:n.controlVideoPlayer})},Vs=({userSummary:e})=>{var a;const[n,r]=t.useState(void 0);return t.useEffect(()=>{const s=e.$store.subscribe(s=>{s&&r(s)});return()=>{s()}},[e]),s.jsx(N,{loading:!(null!=n&&n.summary),...null==n?void 0:n.summary,successRate:null==(a=null==n?void 0:n.percentage)?void 0:a.correct})},Bs=({gamification:a,className:n,scrollStore:r,scrollNode:l,appNode:i,style:d,responsiveStore:o})=>{const{tabsShown:c}=e.useStore(r,{keys:["tabsShown"]}),u=e.useStore(a.friendsTabEnabled),[p,m]=t.useState(D.HOME),[,h]=e.useTransition(),{sdkInDesktopView:x,screen:f}=e.useStore(o,{keys:["sdkInDesktopView"]});t.useEffect(()=>r.subscribe(s=>{0!==s.scrollPosition?o.get().sdkInDesktopView?r.setKey("tabsShown","backward"===s.scrollDirection):r.setKey("tabsShown","forward"===s.scrollDirection):r.setKey("tabsShown",!0)}),[r,o]),t.useEffect(()=>{u||m(D.HOME)},[u]);let v="0px";return v=x?c?"0px":"calc(0px - var(--header-height))":c?"var(--header-height)":"0px",s.jsxs(e.l,{className:e.cx_default(n,"SL-Tabs","sl-hide-on-modal"),style:d,children:[u&&s.jsx(e.S$1,{style:{top:v},children:s.jsx(F,{activePage:p,toggleActivePage:s=>{h(()=>{var t;m(s),!1===x&&((null==(t=i.current)?void 0:t.getBoundingClientRect().y)||0)<0&&((s,t,a)=>{const n=t>=e.A.lg&&t<e.A.xl?75:52;s.current&&window.scrollTo({top:s.current.offsetTop-n,...a})})(i,f.size,{behavior:"instant"})})}})}),p===D.HOME&&s.jsxs(s.Fragment,{children:[s.jsx(e.m,{children:s.jsx(e.d,{children:s.jsx(Vs,{userSummary:a.userSummary})})}),s.jsx(e.n,{style:{flex:1},children:s.jsx(Ms,{openQuestion:a.openQuestion,store:a.feedList.getStore()})})]}),p===D.LEADERBOARD&&s.jsx(e.C,{children:s.jsx(bs,{scrollStore:r,scrollNode:l,gamification:a})})]})};exports.default=({gamification:e,scrollStore:t,className:a,appNode:n,scrollNode:r,responsiveStore:l})=>s.jsx(Bs,{appNode:n,scrollStore:t,scrollNode:r,className:a,gamification:e,responsiveStore:l});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("react/jsx-runtime"),require("./index3.js"),require("nanostores");const e=require("./index2.js");require("react"),require("lodash.throttle"),require("react-dom"),require("react-countup"),exports.StreamLayerProvider=e.StreamLayerProvider,exports.StreamLayerSDKTv=e.StreamLayerSDKTv,exports.StreamLayerSDKTvContent=e.StreamLayerSDKTvContent,exports.StreamLayerSDKTvPauseAd=e.StreamLayerSDKTvPauseAd,exports.useStreamLayer=e.uf,exports.useStreamLayerUI=e.hf;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("./index2.js"),t=require("react");require("nanostores"),require("lodash.throttle"),require("react-dom"),require("react-countup");const s=new Set([r.anonymous]),o=({videoPlayerController:e})=>{const s=r.useStreamLayer(),o=t.useRef();return t.useEffect(()=>{if(s)return o.current=e,s.addVideoPlayerController(o.current),()=>{o.current&&s.removeVideoPlayerController(o.current)}},[s]),null},n=({sdk:e})=>(t.useEffect(()=>{e.anonymousAuthorization()},[e]),null),a=({persistent:t,notification:s,banner:o,sdk:n})=>{const a=r.useStore(n.uiState);return a.exposedPauseAd?null:o?e.jsx(r.ge,{sdk:n,persistent:t,banner:"bottom"}):s?a.promotionNotification?e.jsx(r.ge,{sdk:n,notification:!0,persistent:t,sidebar:"right"}):e.jsx(r.Z,{sdk:n,notification:!0,persistent:t}):a.promotionSidebar?e.jsx(r.ge,{sdk:n,persistent:t,sidebar:"right"}):e.jsx(r.Z,{sdk:n,persistent:t})};exports.useStreamLayer=r.useStreamLayer,exports.useStreamLayerUI=r.useStreamLayerUI,exports.StreamLayerProvider=({children:t,videoPlayerController:n,...a})=>e.jsxs(r.StreamLayerProvider,{...a,themeMode:"dark",withAd:!0,skipOnboarding:!0,withAdNotification:!0,autoEnable:!0,plugins:s,friendsTab:"disabled",hideFriends:!0,webOS:!0,children:[t,n&&e.jsx(o,{videoPlayerController:n})]}),exports.StreamLayerSDKTv=({persistent:s,children:o,showPauseAd:a,pauseAdVastUrl:i,videoPlayerController:d,onRenderPauseAd:u,onClosePauseAd:l,options:m})=>{const c=r.useStreamLayer(),h=r.useStreamLayerTheme(),y=t.useRef();return t.useEffect(()=>{if(c)return d&&(y.current=d,c.addVideoPlayerController(y.current)),()=>{y.current&&c.removeVideoPlayerController(y.current)}},[c]),c?e.jsx("div",{className:"StreamLayerSDK",children:e.jsxs(r.h,{customTheme:h.theme,themeMode:h.themeMode,children:[e.jsx(r.W,{sdk:c,persistent:s,showPauseAd:a,onRenderPauseAd:u,pauseAdVastUrl:i,onClosePauseAd:l,options:m,children:o}),e.jsx(n,{sdk:c})]})}):null},exports.StreamLayerSDKTvContent=t=>{const s=r.useStreamLayer(),o=r.useStreamLayerTheme();return s?e.jsx("div",{className:"StreamLayerSDK",children:e.jsx(r.h,{style:{position:"relative"},customTheme:o.theme,themeMode:o.themeMode,children:e.jsx(a,{sdk:s,...t})})}):null},exports.StreamLayerSDKTvPauseAd=t=>{const s=r.useStreamLayer(),o=r.useStreamLayerTheme();return s?e.jsx("div",{className:"StreamLayerSDK",children:e.jsx(r.h,{style:{position:"relative"},customTheme:o.theme,themeMode:o.themeMode,children:e.jsx(r.re,{...t,sdk:s,isDesktop:!1})})}):null};