@streamlayer/react 0.41.9 → 0.41.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";const m=require("react/jsx-runtime"),_t=require("./index2.js"),Pt=require("@nanostores/react"),Qp=require("lodash.throttle"),B=require("react"),ai=require("@streamlayer/sdk-web-interfaces"),se=require("@streamlayer/sdk-web-types"),x=require("./index3.js"),Hk=require("react-countdown-circle-timer"),Wk=require("react-infinite-scroller"),um=require("@streamlayer/sdk-web-notifications"),I4=p=>[g=>(...v)=>(p&&ai.eventBus.emit(p==null?void 0:p.type,p),g?g(v):null)],qk=p=>{const g=p.target;g instanceof HTMLAnchorElement&&g.target==="_blank"&&g.getAttribute("data-analytics")==="web-link"&&ai.eventBus.emit("poll",{action:"navigated",payload:{}})},Qk=Qp((p,g)=>{var v;if(p.target instanceof Document){const S=(v=g.current)==null?void 0:v.getBoundingClientRect(),_=S&&S.top<0&&S.bottom>window.innerHeight;if(S&&!_)return}ai.eventBus.emit("interactions",{action:"scroll",payload:{}})},5e3),Kk=Qp((p,g)=>{var v;if(p.target instanceof Document){const S=(v=g.current)==null?void 0:v.getBoundingClientRect(),_=S&&S.top<0&&S.bottom>window.innerHeight;if(S&&!_)return}ai.eventBus.emit("interactions",{action:"tap",payload:{}})},5e3),Wg=(p,g)=>{const v=window.innerWidth<_t.O.xl;B.useEffect(()=>{const S=v&&g.useDomNode?document:p.current,_=T=>{g.listener(T,p)};return g.enabled&&(S==null||S.addEventListener(g.event,_)),()=>{S==null||S.removeEventListener(g.event,_)}},[v,g.enabled,g.listener])},qg=x.styled_default("div")({name:"LoadingContainer",class:"l1p1hxob",propsAsIs:!1}),Gk=({feature:p,sdk:g,children:v,className:S,noWait:_})=>{const T=Pt.useStore(p.status),b=Pt.useStore(g.sdkStore.slStreamId);if(!_){if(b!=null&&b.loading)return m.jsx(qg,{className:S,children:"Event is loading..."});if(!(b!=null&&b.data))return m.jsx(qg,{className:S,children:"Event is forbidden..."});if(T!==ai.FeatureStatus.Ready)return m.jsx(qg,{className:S,children:"Wait feature..."})}return v};var Yk=Object.defineProperty,Xk=(p,g,v)=>g in p?Yk(p,g,{enumerable:!0,configurable:!0,writable:!0,value:v}):p[g]=v,Zk=(p,g,v)=>(Xk(p,typeof g!="symbol"?g+"":g,v),v);let Jk=class{constructor(){Zk(this,"observers",new Set)}subscribe(g){this.observers.add(g)}unsubscribe(g){this.observers.delete(g)}notify(g){this.observers.forEach(v=>v(g))}};const Vp=new Jk,ex={hiding:!1,finished:!1},R4=()=>{const[p,g]=B.useState(ex),v=B.useRef(null);B.useEffect(()=>{const T=b=>{g(b)};return Vp.subscribe(T),()=>{Vp.unsubscribe(T)}},[]);const S=B.useCallback(T=>{const b={hiding:!0,finished:!1};v.current&&clearTimeout(v.current),T!=null&&T.delay?v.current=setTimeout(()=>{Vp.notify(b)},T==null?void 0:T.delay):Vp.notify(b)},[]),_=B.useCallback(()=>{p.hiding&&(v.current=null,Vp.notify({hiding:!1,finished:!0}))},[p.hiding]);return{...p,runAnimation:S,onAnimationEnd:_}},tx=x.styled_default("div")({name:"SDKContainer",class:"stu11h7",propsAsIs:!1}),L4=x.styled_default("div")({name:"SDKScrollContainer",class:"s1ucohr1",propsAsIs:!1}),N4=x.styled_default("div")({name:"SDKContentContainer",class:"s1el4wvm",propsAsIs:!1}),nx=()=>N4,pm=x.styled_default(nx())({name:"SDKWhiteContainer",class:"s1oe3036",propsAsIs:!0}),rx=x.styled_default("div")({name:"TabsContainer",class:"tzk7mst",propsAsIs:!1}),ax=()=>pm,ox=x.styled_default(ax())({name:"LeaderboardContainer",class:"lkdzy61",propsAsIs:!0}),ix=()=>pm,lx=x.styled_default(ix())({name:"TabsNavContainer",class:"tvdam54",propsAsIs:!0}),sx=x.styled_default("div")({name:"UserSummaryContainer",class:"u14fk93k",propsAsIs:!1}),mm={[se.QuestionType.TWEET]:{label:"Insight",iconName:"icon-insight"},[se.QuestionType.PROMOTION]:{label:"Insight",iconName:"icon-insight"},[se.QuestionType.UNSET]:void 0,[se.QuestionType.FACTOID]:{label:"Insight",iconName:"icon-insight"},[se.QuestionType.POLL]:{label:"Poll",iconName:"icon-poll"},[se.QuestionType.TRIVIA]:{label:"Trivia",iconName:"icon-trivia"},[se.QuestionType.PREDICTION]:{label:"Prediction",iconName:"icon-prediction"}},ux=x.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),cx=x.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),dx=()=>x.r1,fx=x.styled_default(dx())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),px=x.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),mx=x.styled_default("div")({name:"CloseIconWrap",class:"c1ao1jtv",propsAsIs:!1}),hx=()=>x.r1,vx=x.styled_default(hx())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),P4=({type:p,close:g,label:v})=>{const S=p?mm[p]:{label:v,iconName:void 0};return m.jsxs(ux,{children:[m.jsxs(cx,{children:[(S==null?void 0:S.iconName)&&m.jsx(fx,{"data-type-trivia":p===se.QuestionType.TRIVIA,"data-type-poll":p===se.QuestionType.POLL,name:S.iconName}),(S==null?void 0:S.label)&&m.jsx(px,{children:S.label})]}),m.jsx(mx,{onClick:g,children:m.jsx(vx,{name:"icon-cross"})})]})},j4=x.styled_default("div")({name:"Container",class:"cqg02m",propsAsIs:!1}),Ca=({children:p,style:g,loading:v})=>v?m.jsx(j4,{style:g,children:p}):p,ly=p=>p.split(/\s+/).map(g=>g[0]).join("").toUpperCase(),z4=p=>p?p.toLocaleString("en-US"):"0",gx=p=>{const g=new Date(p);if(!g)return"";const v=new Date,S=Math.floor(v.getTime()-g.getTime());return S<6e4?`${Math.floor(S/1e3)}s`:S<36e5?`${Math.floor(S/6e4)}m`:S<864e5?`${Math.floor(S/36e5)}h`:g.getFullYear()===v.getFullYear()?`${g.toLocaleDateString("en-US",{month:"short",day:"numeric"})}`:`${g.toLocaleDateString("en-US",{month:"2-digit",day:"2-digit",year:"2-digit"})}`},yx=x.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),bx=x.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),wx=x.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),q6=({indicator:p,title:g})=>m.jsxs(yx,{children:[m.jsx(bx,{children:g}),m.jsx(wx,{children:p})]}),kx=x.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),xx=x.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Sx=x.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),am=({indicator:p,title:g})=>m.jsxs(kx,{children:[m.jsx(xx,{children:p}),m.jsx(Sx,{children:g})]}),Cx=x.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),_x=x.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Ex=x.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Tx=x.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Ix=x.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Rx=x.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Lx=x.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Nx=x.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Px=x.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),jx=x.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),zx=x.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Ax=x.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),Dx=x.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),$x=x.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Mx=x.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),Ox=x.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),Ux=x.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),Fx="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",A4=({loading:p,avatar:g,name:v,points:S,friendsRank:_,rank:T,streak:b,correct:P,incorrect:j,inTop:z,successRate:Y})=>m.jsxs(Cx,{"data-loading":p,children:[m.jsx(_x,{children:m.jsx(Ca,{loading:p,children:m.jsxs(Tx,{children:[m.jsxs(Ux,{children:[g&&m.jsx(Ix,{alt:"avatar",src:g}),!g&&m.jsx(Ox,{children:ly(v||"")})]}),m.jsxs(Rx,{children:[m.jsx(Lx,{children:v}),m.jsxs(Nx,{children:[m.jsxs(jx,{children:[m.jsx(Px,{alt:"rank-icon",src:Fx}),m.jsxs(zx,{children:[z4(S),m.jsx(Ax,{children:"PTS"})]})]}),m.jsx(Dx,{}),m.jsxs("div",{children:["TOP ",z||0,"%"]})]})]})]})})}),m.jsxs(Ex,{children:[m.jsxs($x,{children:[m.jsx(Ca,{loading:p,style:{width:"100%"},children:m.jsx(q6,{indicator:_||0,title:"Friends rank"})}),m.jsx(Ca,{loading:p,style:{width:"100%"},children:m.jsx(q6,{indicator:T||0,title:"Global rank"})})]}),m.jsx(Ca,{loading:p,children:m.jsxs(Mx,{children:[m.jsx(am,{indicator:b||0,title:"Win streak"}),m.jsx(am,{indicator:P||0,title:"Correct"}),m.jsx(am,{indicator:j||0,title:"Incorrect"}),m.jsx(am,{indicator:`${Y||0}%`,title:"Succ. rate"})]})})]})]});function Vx(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var D4={exports:{}},mn=D4.exports={},ni,ri;function ty(){throw new Error("setTimeout has not been defined")}function ny(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ni=setTimeout:ni=ty}catch{ni=ty}try{typeof clearTimeout=="function"?ri=clearTimeout:ri=ny}catch{ri=ny}})();function $4(p){if(ni===setTimeout)return setTimeout(p,0);if((ni===ty||!ni)&&setTimeout)return ni=setTimeout,setTimeout(p,0);try{return ni(p,0)}catch{try{return ni.call(null,p,0)}catch{return ni.call(this,p,0)}}}function Bx(p){if(ri===clearTimeout)return clearTimeout(p);if((ri===ny||!ri)&&clearTimeout)return ri=clearTimeout,clearTimeout(p);try{return ri(p)}catch{try{return ri.call(null,p)}catch{return ri.call(this,p)}}}var Ji=[],Cd=!1,ku,cm=-1;function Hx(){!Cd||!ku||(Cd=!1,ku.length?Ji=ku.concat(Ji):cm=-1,Ji.length&&M4())}function M4(){if(!Cd){var p=$4(Hx);Cd=!0;for(var g=Ji.length;g;){for(ku=Ji,Ji=[];++cm<g;)ku&&ku[cm].run();cm=-1,g=Ji.length}ku=null,Cd=!1,Bx(p)}}mn.nextTick=function(p){var g=new Array(arguments.length-1);if(arguments.length>1)for(var v=1;v<arguments.length;v++)g[v-1]=arguments[v];Ji.push(new O4(p,g)),Ji.length===1&&!Cd&&$4(M4)};function O4(p,g){this.fun=p,this.array=g}O4.prototype.run=function(){this.fun.apply(null,this.array)};mn.title="browser";mn.browser=!0;mn.env={};mn.argv=[];mn.version="";mn.versions={};function el(){}mn.on=el;mn.addListener=el;mn.once=el;mn.off=el;mn.removeListener=el;mn.removeAllListeners=el;mn.emit=el;mn.prependListener=el;mn.prependOnceListener=el;mn.listeners=function(p){return[]};mn.binding=function(p){throw new Error("process.binding is not supported")};mn.cwd=function(){return"/"};mn.chdir=function(p){throw new Error("process.chdir is not supported")};mn.umask=function(){return 0};var Wx=D4.exports;const _d=Vx(Wx);var ry={exports:{}},oa={},Qg={exports:{}},Q6={};/**
1
+ "use strict";const m=require("react/jsx-runtime"),_t=require("./index2.js"),Pt=require("@nanostores/react"),Qp=require("lodash.throttle"),B=require("react"),ai=require("@streamlayer/sdk-web-interfaces"),se=require("@streamlayer/sdk-web-types"),x=require("./index3.js"),Hk=require("react-countdown-circle-timer"),Wk=require("react-infinite-scroller"),um=require("@streamlayer/sdk-web-notifications"),I4=p=>[g=>(...v)=>(p&&ai.eventBus.emit(p==null?void 0:p.type,p),g?g(v):null)],qk=p=>{const g=p.target;g instanceof HTMLAnchorElement&&g.target==="_blank"&&g.getAttribute("data-analytics")==="web-link"&&ai.eventBus.emit("poll",{action:"navigated",payload:{}})},Qk=Qp((p,g)=>{var v;if(p.target instanceof Document){const S=(v=g.current)==null?void 0:v.getBoundingClientRect(),_=S&&S.top<0&&S.bottom>window.innerHeight;if(S&&!_)return}ai.eventBus.emit("interactions",{action:"scroll",payload:{}})},5e3),Kk=Qp((p,g)=>{var v;if(p.target instanceof Document){const S=(v=g.current)==null?void 0:v.getBoundingClientRect(),_=S&&S.top<0&&S.bottom>window.innerHeight;if(S&&!_)return}ai.eventBus.emit("interactions",{action:"tap",payload:{}})},5e3),Wg=(p,g)=>{const v=window.innerWidth<_t.O.xl;B.useEffect(()=>{const S=v&&g.useDomNode?document:p.current,_=T=>{g.listener(T,p)};return g.enabled&&(S==null||S.addEventListener(g.event,_)),()=>{S==null||S.removeEventListener(g.event,_)}},[v,g.enabled,g.listener])},qg=x.styled_default("div")({name:"LoadingContainer",class:"l1p1hxob",propsAsIs:!1}),Gk=({feature:p,sdk:g,children:v,className:S,noWait:_})=>{const T=Pt.useStore(p.status),b=Pt.useStore(g.sdkStore.slStreamId);if(!_){if(b!=null&&b.loading&&!b.data)return m.jsx(qg,{className:S,children:"Event is loading..."});if(!(b!=null&&b.data))return m.jsx(qg,{className:S,children:"Event is forbidden..."});if(T!==ai.FeatureStatus.Ready)return m.jsx(qg,{className:S,children:"Wait feature..."})}return v};var Yk=Object.defineProperty,Xk=(p,g,v)=>g in p?Yk(p,g,{enumerable:!0,configurable:!0,writable:!0,value:v}):p[g]=v,Zk=(p,g,v)=>(Xk(p,typeof g!="symbol"?g+"":g,v),v);let Jk=class{constructor(){Zk(this,"observers",new Set)}subscribe(g){this.observers.add(g)}unsubscribe(g){this.observers.delete(g)}notify(g){this.observers.forEach(v=>v(g))}};const Vp=new Jk,ex={hiding:!1,finished:!1},R4=()=>{const[p,g]=B.useState(ex),v=B.useRef(null);B.useEffect(()=>{const T=b=>{g(b)};return Vp.subscribe(T),()=>{Vp.unsubscribe(T)}},[]);const S=B.useCallback(T=>{const b={hiding:!0,finished:!1};v.current&&clearTimeout(v.current),T!=null&&T.delay?v.current=setTimeout(()=>{Vp.notify(b)},T==null?void 0:T.delay):Vp.notify(b)},[]),_=B.useCallback(()=>{p.hiding&&(v.current=null,Vp.notify({hiding:!1,finished:!0}))},[p.hiding]);return{...p,runAnimation:S,onAnimationEnd:_}},tx=x.styled_default("div")({name:"SDKContainer",class:"stu11h7",propsAsIs:!1}),L4=x.styled_default("div")({name:"SDKScrollContainer",class:"s1ucohr1",propsAsIs:!1}),N4=x.styled_default("div")({name:"SDKContentContainer",class:"s1el4wvm",propsAsIs:!1}),nx=()=>N4,pm=x.styled_default(nx())({name:"SDKWhiteContainer",class:"s1oe3036",propsAsIs:!0}),rx=x.styled_default("div")({name:"TabsContainer",class:"tzk7mst",propsAsIs:!1}),ax=()=>pm,ox=x.styled_default(ax())({name:"LeaderboardContainer",class:"lkdzy61",propsAsIs:!0}),ix=()=>pm,lx=x.styled_default(ix())({name:"TabsNavContainer",class:"tvdam54",propsAsIs:!0}),sx=x.styled_default("div")({name:"UserSummaryContainer",class:"u14fk93k",propsAsIs:!1}),mm={[se.QuestionType.TWEET]:{label:"Insight",iconName:"icon-insight"},[se.QuestionType.PROMOTION]:{label:"Insight",iconName:"icon-insight"},[se.QuestionType.UNSET]:void 0,[se.QuestionType.FACTOID]:{label:"Insight",iconName:"icon-insight"},[se.QuestionType.POLL]:{label:"Poll",iconName:"icon-poll"},[se.QuestionType.TRIVIA]:{label:"Trivia",iconName:"icon-trivia"},[se.QuestionType.PREDICTION]:{label:"Prediction",iconName:"icon-prediction"}},ux=x.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),cx=x.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),dx=()=>x.r1,fx=x.styled_default(dx())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),px=x.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),mx=x.styled_default("div")({name:"CloseIconWrap",class:"c1ao1jtv",propsAsIs:!1}),hx=()=>x.r1,vx=x.styled_default(hx())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),P4=({type:p,close:g,label:v})=>{const S=p?mm[p]:{label:v,iconName:void 0};return m.jsxs(ux,{children:[m.jsxs(cx,{children:[(S==null?void 0:S.iconName)&&m.jsx(fx,{"data-type-trivia":p===se.QuestionType.TRIVIA,"data-type-poll":p===se.QuestionType.POLL,name:S.iconName}),(S==null?void 0:S.label)&&m.jsx(px,{children:S.label})]}),m.jsx(mx,{onClick:g,children:m.jsx(vx,{name:"icon-cross"})})]})},j4=x.styled_default("div")({name:"Container",class:"cqg02m",propsAsIs:!1}),Ca=({children:p,style:g,loading:v})=>v?m.jsx(j4,{style:g,children:p}):p,ly=p=>p.split(/\s+/).map(g=>g[0]).join("").toUpperCase(),z4=p=>p?p.toLocaleString("en-US"):"0",gx=p=>{const g=new Date(p);if(!g)return"";const v=new Date,S=Math.floor(v.getTime()-g.getTime());return S<6e4?`${Math.floor(S/1e3)}s`:S<36e5?`${Math.floor(S/6e4)}m`:S<864e5?`${Math.floor(S/36e5)}h`:g.getFullYear()===v.getFullYear()?`${g.toLocaleDateString("en-US",{month:"short",day:"numeric"})}`:`${g.toLocaleDateString("en-US",{month:"2-digit",day:"2-digit",year:"2-digit"})}`},yx=x.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),bx=x.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),wx=x.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),q6=({indicator:p,title:g})=>m.jsxs(yx,{children:[m.jsx(bx,{children:g}),m.jsx(wx,{children:p})]}),kx=x.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),xx=x.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Sx=x.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),am=({indicator:p,title:g})=>m.jsxs(kx,{children:[m.jsx(xx,{children:p}),m.jsx(Sx,{children:g})]}),Cx=x.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),_x=x.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Ex=x.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Tx=x.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Ix=x.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Rx=x.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Lx=x.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Nx=x.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Px=x.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),jx=x.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),zx=x.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Ax=x.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),Dx=x.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),$x=x.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Mx=x.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),Ox=x.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),Ux=x.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),Fx="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",A4=({loading:p,avatar:g,name:v,points:S,friendsRank:_,rank:T,streak:b,correct:P,incorrect:j,inTop:z,successRate:Y})=>m.jsxs(Cx,{"data-loading":p,children:[m.jsx(_x,{children:m.jsx(Ca,{loading:p,children:m.jsxs(Tx,{children:[m.jsxs(Ux,{children:[g&&m.jsx(Ix,{alt:"avatar",src:g}),!g&&m.jsx(Ox,{children:ly(v||"")})]}),m.jsxs(Rx,{children:[m.jsx(Lx,{children:v}),m.jsxs(Nx,{children:[m.jsxs(jx,{children:[m.jsx(Px,{alt:"rank-icon",src:Fx}),m.jsxs(zx,{children:[z4(S),m.jsx(Ax,{children:"PTS"})]})]}),m.jsx(Dx,{}),m.jsxs("div",{children:["TOP ",z||0,"%"]})]})]})]})})}),m.jsxs(Ex,{children:[m.jsxs($x,{children:[m.jsx(Ca,{loading:p,style:{width:"100%"},children:m.jsx(q6,{indicator:_||0,title:"Friends rank"})}),m.jsx(Ca,{loading:p,style:{width:"100%"},children:m.jsx(q6,{indicator:T||0,title:"Global rank"})})]}),m.jsx(Ca,{loading:p,children:m.jsxs(Mx,{children:[m.jsx(am,{indicator:b||0,title:"Win streak"}),m.jsx(am,{indicator:P||0,title:"Correct"}),m.jsx(am,{indicator:j||0,title:"Incorrect"}),m.jsx(am,{indicator:`${Y||0}%`,title:"Succ. rate"})]})})]})]});function Vx(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var D4={exports:{}},mn=D4.exports={},ni,ri;function ty(){throw new Error("setTimeout has not been defined")}function ny(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ni=setTimeout:ni=ty}catch{ni=ty}try{typeof clearTimeout=="function"?ri=clearTimeout:ri=ny}catch{ri=ny}})();function $4(p){if(ni===setTimeout)return setTimeout(p,0);if((ni===ty||!ni)&&setTimeout)return ni=setTimeout,setTimeout(p,0);try{return ni(p,0)}catch{try{return ni.call(null,p,0)}catch{return ni.call(this,p,0)}}}function Bx(p){if(ri===clearTimeout)return clearTimeout(p);if((ri===ny||!ri)&&clearTimeout)return ri=clearTimeout,clearTimeout(p);try{return ri(p)}catch{try{return ri.call(null,p)}catch{return ri.call(this,p)}}}var Ji=[],Cd=!1,ku,cm=-1;function Hx(){!Cd||!ku||(Cd=!1,ku.length?Ji=ku.concat(Ji):cm=-1,Ji.length&&M4())}function M4(){if(!Cd){var p=$4(Hx);Cd=!0;for(var g=Ji.length;g;){for(ku=Ji,Ji=[];++cm<g;)ku&&ku[cm].run();cm=-1,g=Ji.length}ku=null,Cd=!1,Bx(p)}}mn.nextTick=function(p){var g=new Array(arguments.length-1);if(arguments.length>1)for(var v=1;v<arguments.length;v++)g[v-1]=arguments[v];Ji.push(new O4(p,g)),Ji.length===1&&!Cd&&$4(M4)};function O4(p,g){this.fun=p,this.array=g}O4.prototype.run=function(){this.fun.apply(null,this.array)};mn.title="browser";mn.browser=!0;mn.env={};mn.argv=[];mn.version="";mn.versions={};function el(){}mn.on=el;mn.addListener=el;mn.once=el;mn.off=el;mn.removeListener=el;mn.removeAllListeners=el;mn.emit=el;mn.prependListener=el;mn.prependOnceListener=el;mn.listeners=function(p){return[]};mn.binding=function(p){throw new Error("process.binding is not supported")};mn.cwd=function(){return"/"};mn.chdir=function(p){throw new Error("process.chdir is not supported")};mn.umask=function(){return 0};var Wx=D4.exports;const _d=Vx(Wx);var ry={exports:{}},oa={},Qg={exports:{}},Q6={};/**
2
2
  * @license React
3
3
  * scheduler.production.min.js
4
4
  *
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@streamlayer/sdk-web"),l=require("react"),p=({sdkKey:t,plugins:o,production:s,autoEnable:a,onDeepLinkHandled:i,videoPlayerController:c})=>{const[f,u]=l.useState(null);return l.useEffect(()=>{let r=!1;if(!t)return console.error("streamlayer sdk key should be provided"),u(e=>(e!==null&&typeof e.disableApp=="function"&&e.disableApp(),null)),()=>{r=!0};const n=d.StreamLayer(t,s,a,{version:"0.41.9",onDeepLinkHandled:i,videoPlayerController:c});if(o)for(const e of o)n.use(e);return n.ready().then(e=>{r||u(e.sdk)}).catch(e=>console.log(e)),()=>{r=!0,n.close(function(e){if(e)throw e})}},[t,s]),f};exports.useStreamLayerApp=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@streamlayer/sdk-web"),l=require("react"),p=({sdkKey:t,plugins:o,production:s,autoEnable:a,onDeepLinkHandled:i,videoPlayerController:c})=>{const[f,u]=l.useState(null);return l.useEffect(()=>{let r=!1;if(!t)return console.error("streamlayer sdk key should be provided"),u(e=>(e!==null&&typeof e.disableApp=="function"&&e.disableApp(),null)),()=>{r=!0};const n=d.StreamLayer(t,s,a,{version:"0.41.10",onDeepLinkHandled:i,videoPlayerController:c});if(o)for(const e of o)n.use(e);return n.ready().then(e=>{r||u(e.sdk)}).catch(e=>console.log(e)),()=>{r=!0,n.close(function(e){if(e)throw e})}},[t,s]),f};exports.useStreamLayerApp=p;