@streamlayer/react 1.21.2 → 1.21.3
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/cjs/advertisement.js +1 -1
- package/lib/cjs/insight.js +1 -1
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/provider.js +1 -1
- package/lib/cjs/useStreamLayerApp2.js +1 -1
- package/lib/classic/cjs/advertisement.js +1 -1
- package/lib/classic/cjs/insight.js +1 -1
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/provider.js +1 -1
- package/lib/classic/cjs/useStreamLayerApp2.js +1 -1
- package/lib/classic/es/advertisement.js +1 -1
- package/lib/classic/es/insight.js +1 -1
- package/lib/classic/es/notification.js +1 -1
- package/lib/classic/es/points.js +1 -1
- package/lib/classic/es/provider.js +18 -18
- package/lib/classic/es/useStreamLayerApp2.js +1 -1
- package/lib/dist/cjs/gamification-feature2.js +1 -1
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +2 -2
- package/lib/dist/es/gamification-feature2.js +1 -1
- package/lib/dist/es/index.js +1 -1
- package/lib/dist/es/masters.js +51 -51
- package/lib/es/advertisement.js +1 -1
- package/lib/es/insight.js +1 -1
- package/lib/es/notification.js +1 -1
- package/lib/es/points.js +1 -1
- package/lib/es/provider.js +18 -18
- package/lib/es/useStreamLayerApp2.js +1 -1
- package/package.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),y=require("react");require("nanostores");const e=require("./provider.js");require("lodash.throttle");require("react-dom");require("react-countup");const r=require("./useStreamLayerApp2.js"),I=e.styled_default("div")({name:"Media",class:"m1bcvojl",propsAsIs:!1}),os=()=>I,is=e.styled_default(os())({name:"MediaImgBottom",class:"m58gin0",propsAsIs:!0}),ls=()=>I,w=e.styled_default(ls())({name:"MediaImgSolid",class:"m1atm8do",propsAsIs:!0}),as=()=>I,ds=e.styled_default(as())({name:"MediaImgRounded",class:"myx3xoi",propsAsIs:!0}),rs=()=>I,cs=e.styled_default(rs())({name:"MediaImgCentered",class:"m1bwv0gx",propsAsIs:!0}),us=()=>I,ps=e.styled_default(us())({name:"MediaImgInsight",class:"mntjanp",propsAsIs:!0}),ms=e.styled_default("div")({name:"VideoIcon",class:"v1kofb47",propsAsIs:!1}),ys={[r.QuestionImages.UNSET]:w,[r.QuestionImages.NONE]:w,[r.QuestionImages.ROUNDED]:ds,[r.QuestionImages.CENTERED]:cs,[r.QuestionImages.TRANSPARENT]:is,[r.QuestionImages.SOLID]:w},N=({src:t,imageMode:o=r.QuestionImages.UNSET,withVideo:i,fromInsight:n})=>{if(o===r.QuestionImages.NONE)return null;const l=n?ps:ys[o];return s.jsxs(l,{children:[s.jsx("img",{src:t,alt:""}),i&&s.jsx(ms,{children:s.jsx(e.B1,{name:"icon-play"})})]})},xs=e.styled_default("div")({name:"NotificationContent",class:"nuraq9m",propsAsIs:!1}),vs=e.styled_default("div")({name:"NotificationContainer",class:"ns1nzpg",propsAsIs:!1}),R=e.styled_default("div")({name:"Body",class:"b1j59nzs",propsAsIs:!1}),fs=e.styled_default("div")({name:"Title",class:"t9vmnpp",propsAsIs:!1}),js=e.styled_default("button")({name:"Button",class:"b14ivj5k",propsAsIs:!1}),Is=()=>e.B1,As=e.styled_default(Is())({name:"StyledChevronRight",class:"s1atci8n",propsAsIs:!0}),hs=e.styled_default("div")({name:"QuoteWrap",class:"q4w8jgs",propsAsIs:!1}),$s=e.styled_default("blockquote")({name:"Quote",class:"qaa0kez",propsAsIs:!1}),gs=e.styled_default("div")({name:"Body",class:"b1wvd52w",propsAsIs:!1}),_s=e.styled_default("div")({name:"Container",class:"ccvukea",propsAsIs:!1}),ws=({image:t,tweet:o,account:i,accountVerified:n,body:l,title:u})=>{var c;return s.jsxs(_s,{children:[u&&s.jsx(hs,{children:s.jsx($s,{children:u})}),s.jsx(e.D,{image:t,name:(c=o==null?void 0:o.meta)==null?void 0:c.accountName,userName:i,verified:n,createdTweet:o==null?void 0:o.date}),s.jsx(gs,{children:e.D$1(l)})]})},Ts=({title:t,questionType:o,questionTypeData:i})=>s.jsxs(R,{children:[s.jsx(e.x,{questionTypeData:i,questionType:o,questionStatus:r.QuestionStatus.UNSET}),t&&s.jsx(fs,{children:t})]}),bs=({tweet:t})=>t?s.jsx(R,{children:s.jsx(ws,{...t,controlVideo:()=>{}})}):null,Cs=({action:t,questionType:o,inApp:i,insight:n,tweet:l})=>{var u;const c=e.e[o],a=e.o[o];if(!c||!i||!i.notification)return null;const{title:p,image:m,imageMode:v}=i.notification;let x=m;o===r.QuestionType.TWEET&&l!=null&&l.tweetMedia&&(x=l.tweetMedia.image),v===r.QuestionImages.NONE&&(x="");const f=i.useMediaFromContent&&(n==null?void 0:n.image),d=o===r.QuestionType.TWEET&&((u=l==null?void 0:l.tweetMedia)==null?void 0:u.video)||o===r.QuestionType.FACTOID&&(n==null?void 0:n.video);return s.jsx(vs,{"data-a":"intr",className:"SL_InApp",onClick:t,children:s.jsxs(xs,{style:x?{}:{paddingLeft:"1.5rem"},children:[x&&!f&&s.jsx(N,{src:x,imageMode:v,withVideo:!!d}),f&&s.jsx(N,{src:f,fromInsight:!0,withVideo:!!d}),o===r.QuestionType.TWEET?s.jsx(bs,{tweet:l}):s.jsx(Ts,{questionTypeData:c,questionType:o,title:p}),s.jsx(js,{name:"inapp-button",children:a||"Open"}),s.jsx(As,{name:"chevronRight"})]})})},Ns=()=>({color:t})=>t,k=e.styled_default("div")({name:"MediaComponentWrap",class:"mek728j",propsAsIs:!1,vars:{"mek728j-0":[Ns()]}}),j=e.styled_default("div")({name:"Media",class:"m461t56",propsAsIs:!1}),ks=()=>j,qs=e.styled_default(ks())({name:"MediaImgBottom",class:"m22bh04",propsAsIs:!0}),Ss=()=>j,Es=e.styled_default(Ss())({name:"MediaVideo",class:"m17u1e34",propsAsIs:!0}),Ls=()=>j,Ms=e.styled_default(Ls())({name:"MediaImgContentMedia",class:"m4j3eds",propsAsIs:!0}),Ds=()=>j,Bs=e.styled_default(Ds())({name:"MediaImgSolid",class:"m1lp3swr",propsAsIs:!0}),Qs=()=>j,Rs=e.styled_default(Qs())({name:"MediaImgRounded",class:"mc7lij",propsAsIs:!0}),Os=()=>j,Us=e.styled_default(Os())({name:"MediaImgCentered",class:"mwwaw7o",propsAsIs:!0}),Ps=()=>j,T=e.styled_default(Ps())({name:"MediaNone",class:"mqfzyyr",propsAsIs:!0}),zs="v170mtgf",Vs={[r.QuestionImages.UNSET]:T,[r.QuestionImages.NONE]:T,[r.QuestionImages.ROUNDED]:Rs,[r.QuestionImages.CENTERED]:Us,[r.QuestionImages.TRANSPARENT]:qs,[r.QuestionImages.SOLID]:Bs},q=({src:t,imageMode:o=r.QuestionImages.UNSET,withVideo:i,color:n,useContentMedia:l,thumbnailUrl:u})=>{if(!t)return s.jsx(k,{color:n,children:s.jsx(T,{})});const c=l===r.NotificationUseContentMedia.ENABLED?Ms:Vs[o];return s.jsx(k,{color:n,children:i?s.jsx(Es,{children:s.jsx(e.Et,{className:zs,source:t,poster:u||""})}):s.jsx(c,{children:s.jsx("img",{src:t,alt:""})})})},Fs=()=>({withoutPadding:t})=>t?"0px":"1rem",O=e.styled_default("div")({name:"NotificationContent",class:"n1p3bk1c",propsAsIs:!1,vars:{"n1p3bk1c-0":[Fs()]}}),Ws=e.styled_default("div")({name:"MainContent",class:"m1g211mu",propsAsIs:!1}),Ys=()=>e.B1,Ks=e.styled_default(Ys())({name:"StyledChevronRight",class:"sx1hq4c",propsAsIs:!0}),U=e.styled_default("div")({name:"NotificationContainer",class:"n1fcriet",propsAsIs:!1}),Gs=()=>({questionType:t})=>t===r.QuestionType.FACTOID?"7.3rem":"4.5rem",Hs=()=>({webos:t})=>t?"11px 0px 8px 0px":"11px 0px",Js=()=>({imageMode:t,webos:o})=>o?"330px":t===r.QuestionImages.SOLID?"310px":t===r.QuestionImages.CENTERED||t===r.QuestionImages.ROUNDED||t===r.QuestionImages.TRANSPARENT?"370px":"430px",Xs=e.styled_default("div")({name:"Body",class:"b1byyovs",propsAsIs:!1,vars:{"b1byyovs-0":[Gs()],"b1byyovs-1":[Hs()],"b1byyovs-2":[Js()]}}),Zs=()=>({webos:t})=>t?"0.85rem":"1.033rem",se=()=>({webos:t})=>t?"0.95rem":"1.25rem",ee=()=>({webos:t})=>t?"4.7rem":"2.25rem",te=()=>({webos:t})=>t?"pre-wrap":"nowrap",ne=e.styled_default("div")({name:"Title",class:"t1y5k5id",propsAsIs:!1,vars:{"t1y5k5id-0":[Zs()],"t1y5k5id-1":[se()],"t1y5k5id-2":[ee()],"t1y5k5id-3":[te()]}}),oe=e.styled_default("div")({name:"Description",class:"dw9eb7l",propsAsIs:!1}),ie=e.styled_default("div")({name:"LogoImgContainer",class:"ldu8wgy",propsAsIs:!1}),P=e.styled_default("img")({name:"LogoImg",class:"ln4a3eh",propsAsIs:!1}),le=()=>U,ae=e.styled_default(le())({name:"NotificationInterstitialContainer",class:"no2k63v",propsAsIs:!0}),de=e.styled_default("div")({name:"TVButtons",class:"th9nn6a",propsAsIs:!1}),z=e.styled_default("button")({name:"TVButton",class:"t1eee77p",propsAsIs:!1}),re=()=>z,ce=e.styled_default(re())({name:"DismissButton",class:"ds000hw",propsAsIs:!0}),ue=()=>z,pe=e.styled_default(ue())({name:"AnswerButton",class:"a1nz9hoe",propsAsIs:!0}),me=({title:t,questionType:o,questionTypeData:i,description:n,imageMode:l,webos:u})=>s.jsxs(Xs,{imageMode:l,questionType:o,webos:u,children:[s.jsx(e.x,{questionTypeData:i,questionType:o,questionStatus:r.QuestionStatus.UNSET}),t&&s.jsx(ne,{webos:u,children:t}),n&&s.jsx(oe,{children:n})]}),ye=e.O(ae),xe=e.O(ce),ve=e.O(pe),fe=({sponsorLogo:t,onClick:o,webos:i})=>s.jsx(ye,{autoFocus:!0,webos:i,onClick:o,"data-webos":i,children:s.jsx(O,{withoutPadding:!0,children:s.jsx(P,{src:t})})}),je=({action:t,close:o,questionType:i,inApp:n,insight:l,color:u,webos:c})=>{var a,p,m;const[v,x]=y.useState(!1),f=y.useRef();y.useEffect(()=>(n!=null&&n.sponsorLogo&&(x(!0),f.current=setTimeout(()=>{x(!1)},5e3)),()=>clearTimeout(f.current)),[n==null?void 0:n.sponsorLogo]);const d=e.e[i];if(!d||!n||!n.notification)return null;const{title:Z,image:ss,imageMode:h,useContentMedia:$}=n.notification,es=i===r.QuestionType.FACTOID?l==null?void 0:l.heading:Z,ts=i===r.QuestionType.FACTOID?l==null?void 0:l.body:"",ns=ss,g=i===r.QuestionType.FACTOID&&((a=l==null?void 0:l.video)==null?void 0:a.url)&&(n==null?void 0:n.isVideo)&&$===r.NotificationUseContentMedia.ENABLED,_=$===r.NotificationUseContentMedia.ENABLED?g?(p=l==null?void 0:l.video)==null?void 0:p.url:l==null?void 0:l.image:"";return n!=null&&n.sponsorLogo&&v?s.jsx(fe,{sponsorLogo:n==null?void 0:n.sponsorLogo,webos:c,onClick:()=>x(!1)}):s.jsxs(U,{"data-a":"intr",className:"SL_InApp",onClick:A=>{c||t==null||t(A)},"data-is-insight":i===r.QuestionType.FACTOID,"data-webos":c,children:[(n==null?void 0:n.sponsorLogo)&&s.jsx(ie,{children:s.jsx(P,{src:n==null?void 0:n.sponsorLogo})}),s.jsxs(O,{children:[s.jsxs(Ws,{children:[!_&&s.jsx(q,{src:ns,imageMode:h,withVideo:!!g,color:u}),_&&s.jsx(q,{src:_,imageMode:h,withVideo:!!g,color:u,useContentMedia:$,thumbnailUrl:(m=l==null?void 0:l.video)==null?void 0:m.thumbnailUrl}),s.jsx(me,{questionTypeData:d,questionType:i,title:es,description:ts,imageMode:h,webos:c})]}),!c&&s.jsx(Ks,{name:"chevronRight"}),c&&s.jsxs(de,{children:[s.jsx(xe,{webos:!0,"data-close-btn":"true",onClick:A=>{A.stopPropagation(),o==null||o(A)},children:"Dismiss"}),s.jsx(ve,{webos:!0,autoFocus:!0,onClick:t,children:"Answer"})]})]})]})},Ie=e.styled_default("div")({name:"NotificationContainer",class:"n11jcrxe",propsAsIs:!1}),S=e.styled_default("img")({name:"Icon",class:"i1vmpt6u",propsAsIs:!1}),Ae=e.styled_default("div")({name:"IconContainer",class:"i180665s",propsAsIs:!1}),he=()=>e.B1,$e=e.styled_default(he())({name:"TitleIcon",class:"t16zzzei",propsAsIs:!0}),ge=()=>e.y,_e=e.styled_default(ge())({name:"Close",class:"c1sur0q2",propsAsIs:!0}),we=e.styled_default("div")({name:"Body",class:"bai9j52",propsAsIs:!1}),Te=e.styled_default("div")({name:"Title",class:"t1bnt25p",propsAsIs:!1}),be=e.styled_default("div")({name:"Description",class:"dmixjec",propsAsIs:!1}),Ce=e.styled_default("button")({name:"Button",class:"b1ubkw1q",propsAsIs:!1}),Ne=({open:t,close:o,...i})=>{var n,l;return s.jsxs(Ie,{"data-a":"intr",onClick:()=>{t==null||t(),i&&i.markIstantOpen()},children:[s.jsxs(Ae,{children:[s.jsx(S,{className:"on-light",src:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification.png"}),s.jsx(S,{className:"on-dark",src:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification-dark.png"})]}),s.jsxs(we,{children:[s.jsxs(Te,{children:[s.jsx($e,{name:"icon-trophy-solid"}),(n=i==null?void 0:i.titleCard)==null?void 0:n.title]}),s.jsxs(be,{children:[s.jsx("span",{children:(l=i==null?void 0:i.titleCard)==null?void 0:l.subtitle}),s.jsx(Ce,{name:"inapp-button",children:"Play Now"})]})]}),s.jsx(_e,{close:u=>{u==null||u.stopPropagation(),o==null||o()}})]})},ke=e.styled_default("div")({name:"Container",class:"cef8huz",propsAsIs:!1}),qe=()=>e.B1,Se=e.styled_default(qe())({name:"CheckIcon",class:"c1mo15kk",propsAsIs:!0}),Ee=()=>e.B1,Le=e.styled_default(Ee())({name:"PredictionIcon",class:"p16zkqnm",propsAsIs:!0}),Me=e.styled_default("div")({name:"PredictionIconContainer",class:"pjszi7a",propsAsIs:!1}),De=e.styled_default("div")({name:"BodyContainer",class:"bftbmo3",propsAsIs:!1}),Be=e.styled_default("div")({name:"Body",class:"barrbyu",propsAsIs:!1}),Qe=e.styled_default("div")({name:"Subtitle",class:"sz7237i",propsAsIs:!1}),Re=({step:t,children:o,answer:i,state:n="pending"})=>{const[l,u]=y.useState(0),[c]=y.useState(()=>new ResizeObserver(p=>{window.requestAnimationFrame(()=>{var m,v;u(((v=(m=p==null?void 0:p[0])==null?void 0:m.contentRect)==null?void 0:v.width)??0)})})),a=y.useCallback(p=>{p?c.observe(p):c.disconnect()},[c]);return y.useEffect(()=>()=>{c.disconnect()},[c]),s.jsxs(ke,{children:[s.jsx(Me,{children:s.jsx(Le,{name:"icon-prediction"})}),s.jsx(De,{style:{minWidth:`${l}px`},children:s.jsx(Be,{children:o},t)}),s.jsx(Qe,{ref:a,className:n,children:s.jsxs("div",{children:[s.jsx(Se,{name:"icon-check"}),"Your Pick: ",i]})})]})},Oe=e.styled_default("div")({name:"Container",class:"ckyzolp",propsAsIs:!1}),b=e.styled_default("div")({name:"Line",class:"l16t1zr7",propsAsIs:!1}),Ue=()=>b,Pe=e.styled_default(Ue())({name:"Line1",class:"le78kvg",propsAsIs:!0}),ze=()=>b,Ve=e.styled_default(ze())({name:"Line2",class:"l1o7966d",propsAsIs:!0}),Fe=()=>b,We=e.styled_default(Fe())({name:"Line3",class:"lu9lyxq",propsAsIs:!0}),Ye=()=>s.jsxs(Oe,{children:[s.jsx(Pe,{children:s.jsx("div",{})}),s.jsx(Ve,{children:s.jsx("div",{})}),s.jsx(We,{children:s.jsx("div",{})})]}),Ke=e.styled_default("div")({name:"Container",class:"c10jy6zf",propsAsIs:!1}),Ge=()=>e.B1,He=e.styled_default(Ge())({name:"CheckIcon",class:"c1c7scay",propsAsIs:!0}),Je=()=>s.jsxs(Ke,{children:[s.jsx(He,{name:"icon-check"})," Prediction results are in!"]}),Xe=e.styled_default("div")({name:"Container",class:"cf6k2yy",propsAsIs:!1}),Ze=e.styled_default("div")({name:"Caption",class:"c1c8xjus",propsAsIs:!1}),st=e.styled_default("div")({name:"Title",class:"t1d1uekn",propsAsIs:!1}),et=({title:t})=>s.jsxs(Xe,{children:[s.jsx(Ze,{children:"Results for"}),s.jsx(st,{children:t})]}),V=e.styled_default("div")({name:"Container",class:"c181a1as",propsAsIs:!1}),F=e.styled_default("div")({name:"Title",class:"t1cduox6",propsAsIs:!1}),tt=()=>e.B1,W=e.styled_default(tt())({name:"CorrectIcon",class:"c1onrv6j",propsAsIs:!0}),nt=()=>W,ot=e.styled_default(nt())({name:"InCorrectIcon",class:"i17n9o7e",propsAsIs:!0}),it=()=>s.jsxs(V,{children:[s.jsxs(F,{children:["Congratulations!",s.jsx("br",{}),"You answered correctly."]}),s.jsx(W,{name:"icon-check"})]}),lt=({title:t})=>s.jsxs(V,{children:[s.jsxs(F,{children:["Better luck next time!",s.jsx("br",{}),"Correct: ",t]}),s.jsx(ot,{name:"icon-cross"})]}),at=e.styled_default("div")({name:"Container",class:"cnxgcs2",propsAsIs:!1}),dt=e.styled_default("div")({name:"Title",class:"t903f8n",propsAsIs:!1}),rt=()=>e.B1,ct=e.styled_default(rt())({name:"CheckIcon",class:"ceyu3qj",propsAsIs:!0}),ut=({points:t})=>s.jsxs(at,{children:[s.jsxs(dt,{children:["You won ",s.jsx(e.d,{delay:.5,prefix:"+",suffix:" points",value:t})]}),s.jsx(ct,{name:"icon-trophy-solid"})]}),E=e.styled_default("div")({name:"Container",class:"cq3agu2",propsAsIs:!1}),L=e.styled_default("div")({name:"Body",class:"b16qj0do",propsAsIs:!1}),M={1:3e3,2:4e3,3:4e3,4:4e3},pt=({close:t,action:o,setStep:i,votedAnswer:n,correct:l,correctAnswerTitle:u,questionTitle:c,step:a})=>{if(y.useEffect(()=>{if(i){const m=setTimeout(()=>{M[a+1]&&(l||a<3)?i(a+1):t==null||t()},M[a]);return()=>{m&&clearTimeout(m)}}return()=>{}},[i,a,t,l]),a===1)return s.jsx(E,{children:s.jsx(L,{children:s.jsx(Je,{})})});let p="pending";return(a===3||a===4)&&(p=l?"correct":"incorrect"),s.jsx(E,{"data-a":"intr",onClick:()=>o==null?void 0:o(),children:s.jsxs(L,{children:[a!==1&&s.jsx(Ye,{},a),s.jsxs(Re,{state:p,step:a,answer:(n==null?void 0:n.title)||"unknown",children:[a===2&&s.jsx(et,{title:c||"unknown"}),a===3&&l&&s.jsx(it,{}),a===3&&!l&&s.jsx(lt,{title:u||"unknown"}),a===4&&s.jsx(ut,{points:(n==null?void 0:n.points)||0})]})]})})},mt=({close:t,action:o,votedAnswer:i,correct:n,correctAnswerTitle:l,questionTitle:u})=>{const[c,a]=y.useState(1);return s.jsx(pt,{close:t,action:o,votedAnswer:i,correct:n,correctAnswerTitle:l,questionTitle:u,setStep:a,step:c,title:""})},yt=e.styled_default("div")({name:"NotificationContainer",class:"n1i4h28u",propsAsIs:!1}),xt=t=>s.jsx(yt,{children:s.jsx(mt,{...t})}),vt=e.styled_default("div")({name:"Container",class:"cwa9tgs",propsAsIs:!1}),ft=e.styled_default("div")({name:"BodyContainer",class:"b1xx7swj",propsAsIs:!1}),jt=e.styled_default("div")({name:"Body",class:"b1a21en",propsAsIs:!1}),It=({step:t,children:o,state:i="pending"})=>{const[n,l]=y.useState(0);return y.useEffect(()=>{const u=new ResizeObserver(c=>{window.requestAnimationFrame(()=>{var a,p;const m=((p=(a=c==null?void 0:c[0])==null?void 0:a.contentRect)==null?void 0:p.width)??0;l(m)})});return()=>{u.disconnect()}},[]),s.jsx(vt,{style:{padding:`${t===3&&i==="incorrect"||t===1?"5px 100px":"5px 40px"}`},children:s.jsx(ft,{style:{minWidth:`${n}px`},children:s.jsx(jt,{children:o},t)})})},At=e.styled_default("div")({name:"Container",class:"c1nd5cu8",propsAsIs:!1}),C=e.styled_default("div")({name:"Line",class:"lgbipw0",propsAsIs:!1}),ht=()=>C,$t=e.styled_default(ht())({name:"Line1",class:"l1anth16",propsAsIs:!0}),gt=()=>C,_t=e.styled_default(gt())({name:"Line2",class:"l193yd7v",propsAsIs:!0}),wt=()=>C,Tt=e.styled_default(wt())({name:"Line3",class:"lhbflsp",propsAsIs:!0}),bt=()=>s.jsxs(At,{children:[s.jsx($t,{children:s.jsx("div",{})}),s.jsx(_t,{children:s.jsx("div",{})}),s.jsx(Tt,{children:s.jsx("div",{})})]}),Ct=e.styled_default("div")({name:"Container",class:"c1lvd429",propsAsIs:!1}),Nt=()=>e.B1,kt=e.styled_default(Nt())({name:"PredictionIcon",class:"p1n4m87t",propsAsIs:!0}),qt=()=>s.jsxs(Ct,{children:[s.jsx(kt,{name:"icon-prediction"})," Prediction results are in!"]}),St=()=>e.B1,Et=e.styled_default(St())({name:"CheckIcon",class:"c126r8f9",propsAsIs:!0}),Lt=e.styled_default("div")({name:"Answer",class:"a1o2rpgl",propsAsIs:!1}),Mt=e.styled_default("div")({name:"Container",class:"cej6ci1",propsAsIs:!1}),Dt=e.styled_default("div")({name:"Title",class:"tob24mr",propsAsIs:!1}),Bt=({title:t,answer:o})=>s.jsxs(Mt,{children:[s.jsx(Dt,{children:t}),s.jsxs(Lt,{children:[s.jsx(Et,{name:"icon-prediction"}),"Your Pick: ",o]})]}),Y=e.styled_default("div")({name:"Container",class:"c1lesal4",propsAsIs:!1}),K=e.styled_default("div")({name:"Title",class:"tv66n4w",propsAsIs:!1}),Qt=()=>e.B1,Rt=e.styled_default(Qt())({name:"CorrectIcon",class:"cx0vlv2",propsAsIs:!0}),G=e.styled_default("div")({name:"Answer",class:"akfh4v5",propsAsIs:!1}),Ot=({answer:t})=>s.jsxs(Y,{children:[s.jsx(K,{children:"Congratulations! You answered correctly."}),s.jsxs(G,{children:[s.jsx(Rt,{name:"icon-correct"}),"Your Pick: ",t]})]}),Ut=({title:t,answer:o})=>s.jsxs(Y,{children:[s.jsxs(K,{children:["Better luck next time!",s.jsx("br",{}),"Correct: ",t]}),s.jsxs(G,{children:["Your Pick: ",o]})]}),D=e.styled_default("div")({name:"Container",class:"cmox3ot",propsAsIs:!1}),B=e.styled_default("div")({name:"Body",class:"bqq1ix4",propsAsIs:!1}),Q={1:3e3,2:4e3,3:4e3},Pt=({close:t,action:o,setStep:i,votedAnswer:n,correct:l,correctAnswerTitle:u,questionTitle:c,step:a})=>{if(y.useEffect(()=>{if(i){const m=setTimeout(()=>{Q[a+1]&&(l||a<3)?i(a+1):t==null||t()},Q[a]);return()=>{m&&clearTimeout(m)}}return()=>{}},[i,a,t,l]),a===1)return s.jsx(D,{children:s.jsx(B,{children:s.jsx(qt,{})})});let p="pending";return a===3&&(p=l?"correct":"incorrect"),s.jsx(D,{"data-a":"intr",onClick:()=>o==null?void 0:o(),children:s.jsxs(B,{children:[a!==1&&s.jsx(bt,{},a),s.jsxs(It,{state:p,step:a,children:[a===2&&s.jsx(Bt,{title:c||"unknown",answer:(n==null?void 0:n.title)||"unknown"}),a===3&&l&&s.jsx(Ot,{answer:(n==null?void 0:n.title)||"unknown"}),a===3&&!l&&s.jsx(Ut,{title:u||"unknown",answer:(n==null?void 0:n.title)||"unknown"})]})]})})},zt=({close:t,action:o,votedAnswer:i,correct:n,correctAnswerTitle:l,questionTitle:u})=>{const[c,a]=y.useState(1);return s.jsx(Pt,{close:t,action:o,votedAnswer:i,correct:n,correctAnswerTitle:l,questionTitle:u,setStep:a,step:c,title:""})},H=e.styled_default("div")({name:"NotificationContainer",class:"nn0nqh6",propsAsIs:!1}),Vt=()=>({withoutPadding:t})=>t?"0px":"1rem",Ft=e.styled_default("div")({name:"NotificationContent",class:"n1bcdf3j",propsAsIs:!1,vars:{"n1bcdf3j-0":[Vt()]}}),J=e.styled_default("img")({name:"LogoImg",class:"l8jorbq",propsAsIs:!1}),Wt=()=>H,Yt=e.styled_default(Wt())({name:"NotificationInterstitialContainer",class:"nf920y3",propsAsIs:!0}),Kt=e.styled_default("div")({name:"LogoImgContainer",class:"lzsmehn",propsAsIs:!1}),Gt=({sponsorLogo:t,onClick:o})=>s.jsx(Yt,{onClick:o,children:s.jsx(Ft,{withoutPadding:!0,children:s.jsx(J,{src:t})})}),Ht=t=>{var o,i,n,l,u;const[c,a]=y.useState(!1),p=y.useRef();return y.useEffect(()=>{var m;return(m=t==null?void 0:t.inApp)!=null&&m.sponsorLogo&&(a(!0),p.current=setTimeout(()=>{a(!1)},5e3)),()=>clearTimeout(p.current)},[(o=t==null?void 0:t.inApp)==null?void 0:o.sponsorLogo]),(i=t==null?void 0:t.inApp)!=null&&i.sponsorLogo&&c?s.jsx(Gt,{sponsorLogo:(n=t.inApp)==null?void 0:n.sponsorLogo,onClick:()=>a(!1)}):s.jsx(H,{children:s.jsxs("div",{children:[((l=t==null?void 0:t.inApp)==null?void 0:l.sponsorLogo)&&s.jsx(Kt,{children:s.jsx(J,{src:(u=t==null?void 0:t.inApp)==null?void 0:u.sponsorLogo})}),s.jsx(zt,{...t})]})})},X=({sdk:t,webos:o})=>{var i,n,l,u,c,a,p,m;const[v]=y.useState(t.getNotificationsStore()),x=e.useStore(v),f=t.getFeature(r.SdkOverlayType.GAMES),d=y.useMemo(()=>t.getActiveNotification(),[t,x]);return y.useEffect(()=>{d&&e.eventBus.emit("notification",{action:"rendered",payload:{questionId:d.data.questionId,questionType:d.data.questionType}})},[d]),d&&d.type===e.NotificationType.QUESTION_RESOLVED?d.data.question&&d.data.questionType===r.QuestionType.PREDICTION?d&&((i=d.data.inApp)==null?void 0:i.adUnit)===r.AdUnit.STANDART?s.jsx(Ht,{action:d.action,close:d.close,...d.data.question,inApp:d.data.inApp}):s.jsx(xt,{action:d.action,close:d.close,...d.data.question}):null:d&&d.type===e.NotificationType.ONBOARDING?d.data.onboarding?s.jsx(Ne,{open:f==null?void 0:f.openOnboarding,close:d.close,...d.data.onboarding}):null:d&&((n=d.data.inApp)==null?void 0:n.adUnit)===r.AdUnit.STANDART?s.jsx(je,{...d.data,action:d.action,close:d.close,color:((c=(u=(l=d==null?void 0:d.data)==null?void 0:l.inApp)==null?void 0:u.notification)==null?void 0:c.indicatorColor)||((m=(p=(a=d==null?void 0:d.data)==null?void 0:a.inApp)==null?void 0:p.appearance)==null?void 0:m.primaryColor),webos:o}):d&&s.jsx(Cs,{...d.data,action:d.action})},Jt=({theme:t})=>{const o=e.useStreamLayer(),i=e.useStreamLayerTheme(),n=e.useStreamLayerUI();return o&&(n.appNotification||n.onboardingNotification)?n.app&&!n.onboardingNotification?null:s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(e.h,{customTheme:t??i.theme,themeMode:i.themeMode,children:s.jsx(X,{sdk:o})})}):null};exports.StreamLayerSDKNotification=Jt;exports.StreamLayerSDKNotificationUI=X;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),y=require("react"),e=require("./provider.js");require("nanostores");require("lodash.throttle");require("react-dom");require("react-countup");const r=require("./useStreamLayerApp2.js"),I=e.styled_default("div")({name:"Media",class:"m1bcvojl",propsAsIs:!1}),os=()=>I,is=e.styled_default(os())({name:"MediaImgBottom",class:"m58gin0",propsAsIs:!0}),ls=()=>I,w=e.styled_default(ls())({name:"MediaImgSolid",class:"m1atm8do",propsAsIs:!0}),as=()=>I,ds=e.styled_default(as())({name:"MediaImgRounded",class:"myx3xoi",propsAsIs:!0}),rs=()=>I,cs=e.styled_default(rs())({name:"MediaImgCentered",class:"m1bwv0gx",propsAsIs:!0}),us=()=>I,ps=e.styled_default(us())({name:"MediaImgInsight",class:"mntjanp",propsAsIs:!0}),ms=e.styled_default("div")({name:"VideoIcon",class:"v1kofb47",propsAsIs:!1}),ys={[r.QuestionImages.UNSET]:w,[r.QuestionImages.NONE]:w,[r.QuestionImages.ROUNDED]:ds,[r.QuestionImages.CENTERED]:cs,[r.QuestionImages.TRANSPARENT]:is,[r.QuestionImages.SOLID]:w},N=({src:t,imageMode:o=r.QuestionImages.UNSET,withVideo:i,fromInsight:n})=>{if(o===r.QuestionImages.NONE)return null;const l=n?ps:ys[o];return s.jsxs(l,{children:[s.jsx("img",{src:t,alt:""}),i&&s.jsx(ms,{children:s.jsx(e.B1,{name:"icon-play"})})]})},xs=e.styled_default("div")({name:"NotificationContent",class:"nuraq9m",propsAsIs:!1}),vs=e.styled_default("div")({name:"NotificationContainer",class:"ns1nzpg",propsAsIs:!1}),R=e.styled_default("div")({name:"Body",class:"b1j59nzs",propsAsIs:!1}),fs=e.styled_default("div")({name:"Title",class:"t9vmnpp",propsAsIs:!1}),js=e.styled_default("button")({name:"Button",class:"b14ivj5k",propsAsIs:!1}),Is=()=>e.B1,As=e.styled_default(Is())({name:"StyledChevronRight",class:"s1atci8n",propsAsIs:!0}),hs=e.styled_default("div")({name:"QuoteWrap",class:"q4w8jgs",propsAsIs:!1}),$s=e.styled_default("blockquote")({name:"Quote",class:"qaa0kez",propsAsIs:!1}),gs=e.styled_default("div")({name:"Body",class:"b1wvd52w",propsAsIs:!1}),_s=e.styled_default("div")({name:"Container",class:"ccvukea",propsAsIs:!1}),ws=({image:t,tweet:o,account:i,accountVerified:n,body:l,title:u})=>{var c;return s.jsxs(_s,{children:[u&&s.jsx(hs,{children:s.jsx($s,{children:u})}),s.jsx(e.D,{image:t,name:(c=o==null?void 0:o.meta)==null?void 0:c.accountName,userName:i,verified:n,createdTweet:o==null?void 0:o.date}),s.jsx(gs,{children:e.D$1(l)})]})},Ts=({title:t,questionType:o,questionTypeData:i})=>s.jsxs(R,{children:[s.jsx(e.x,{questionTypeData:i,questionType:o,questionStatus:r.QuestionStatus.UNSET}),t&&s.jsx(fs,{children:t})]}),bs=({tweet:t})=>t?s.jsx(R,{children:s.jsx(ws,{...t,controlVideo:()=>{}})}):null,Cs=({action:t,questionType:o,inApp:i,insight:n,tweet:l})=>{var u;const c=e.e[o],a=e.o[o];if(!c||!i||!i.notification)return null;const{title:p,image:m,imageMode:v}=i.notification;let x=m;o===r.QuestionType.TWEET&&l!=null&&l.tweetMedia&&(x=l.tweetMedia.image),v===r.QuestionImages.NONE&&(x="");const f=i.useMediaFromContent&&(n==null?void 0:n.image),d=o===r.QuestionType.TWEET&&((u=l==null?void 0:l.tweetMedia)==null?void 0:u.video)||o===r.QuestionType.FACTOID&&(n==null?void 0:n.video);return s.jsx(vs,{"data-a":"intr",className:"SL_InApp",onClick:t,children:s.jsxs(xs,{style:x?{}:{paddingLeft:"1.5rem"},children:[x&&!f&&s.jsx(N,{src:x,imageMode:v,withVideo:!!d}),f&&s.jsx(N,{src:f,fromInsight:!0,withVideo:!!d}),o===r.QuestionType.TWEET?s.jsx(bs,{tweet:l}):s.jsx(Ts,{questionTypeData:c,questionType:o,title:p}),s.jsx(js,{name:"inapp-button",children:a||"Open"}),s.jsx(As,{name:"chevronRight"})]})})},Ns=()=>({color:t})=>t,k=e.styled_default("div")({name:"MediaComponentWrap",class:"mek728j",propsAsIs:!1,vars:{"mek728j-0":[Ns()]}}),j=e.styled_default("div")({name:"Media",class:"m461t56",propsAsIs:!1}),ks=()=>j,qs=e.styled_default(ks())({name:"MediaImgBottom",class:"m22bh04",propsAsIs:!0}),Ss=()=>j,Es=e.styled_default(Ss())({name:"MediaVideo",class:"m17u1e34",propsAsIs:!0}),Ls=()=>j,Ms=e.styled_default(Ls())({name:"MediaImgContentMedia",class:"m4j3eds",propsAsIs:!0}),Ds=()=>j,Bs=e.styled_default(Ds())({name:"MediaImgSolid",class:"m1lp3swr",propsAsIs:!0}),Qs=()=>j,Rs=e.styled_default(Qs())({name:"MediaImgRounded",class:"mc7lij",propsAsIs:!0}),Os=()=>j,Us=e.styled_default(Os())({name:"MediaImgCentered",class:"mwwaw7o",propsAsIs:!0}),Ps=()=>j,T=e.styled_default(Ps())({name:"MediaNone",class:"mqfzyyr",propsAsIs:!0}),zs="v170mtgf",Vs={[r.QuestionImages.UNSET]:T,[r.QuestionImages.NONE]:T,[r.QuestionImages.ROUNDED]:Rs,[r.QuestionImages.CENTERED]:Us,[r.QuestionImages.TRANSPARENT]:qs,[r.QuestionImages.SOLID]:Bs},q=({src:t,imageMode:o=r.QuestionImages.UNSET,withVideo:i,color:n,useContentMedia:l,thumbnailUrl:u})=>{if(!t)return s.jsx(k,{color:n,children:s.jsx(T,{})});const c=l===r.NotificationUseContentMedia.ENABLED?Ms:Vs[o];return s.jsx(k,{color:n,children:i?s.jsx(Es,{children:s.jsx(e.Et,{className:zs,source:t,poster:u||""})}):s.jsx(c,{children:s.jsx("img",{src:t,alt:""})})})},Fs=()=>({withoutPadding:t})=>t?"0px":"1rem",O=e.styled_default("div")({name:"NotificationContent",class:"n1p3bk1c",propsAsIs:!1,vars:{"n1p3bk1c-0":[Fs()]}}),Ws=e.styled_default("div")({name:"MainContent",class:"m1g211mu",propsAsIs:!1}),Ys=()=>e.B1,Ks=e.styled_default(Ys())({name:"StyledChevronRight",class:"sx1hq4c",propsAsIs:!0}),U=e.styled_default("div")({name:"NotificationContainer",class:"n1fcriet",propsAsIs:!1}),Gs=()=>({questionType:t})=>t===r.QuestionType.FACTOID?"7.3rem":"4.5rem",Hs=()=>({webos:t})=>t?"11px 0px 8px 0px":"11px 0px",Js=()=>({imageMode:t,webos:o})=>o?"330px":t===r.QuestionImages.SOLID?"310px":t===r.QuestionImages.CENTERED||t===r.QuestionImages.ROUNDED||t===r.QuestionImages.TRANSPARENT?"370px":"430px",Xs=e.styled_default("div")({name:"Body",class:"b1byyovs",propsAsIs:!1,vars:{"b1byyovs-0":[Gs()],"b1byyovs-1":[Hs()],"b1byyovs-2":[Js()]}}),Zs=()=>({webos:t})=>t?"0.85rem":"1.033rem",se=()=>({webos:t})=>t?"0.95rem":"1.25rem",ee=()=>({webos:t})=>t?"4.7rem":"2.25rem",te=()=>({webos:t})=>t?"pre-wrap":"nowrap",ne=e.styled_default("div")({name:"Title",class:"t1y5k5id",propsAsIs:!1,vars:{"t1y5k5id-0":[Zs()],"t1y5k5id-1":[se()],"t1y5k5id-2":[ee()],"t1y5k5id-3":[te()]}}),oe=e.styled_default("div")({name:"Description",class:"dw9eb7l",propsAsIs:!1}),ie=e.styled_default("div")({name:"LogoImgContainer",class:"ldu8wgy",propsAsIs:!1}),P=e.styled_default("img")({name:"LogoImg",class:"ln4a3eh",propsAsIs:!1}),le=()=>U,ae=e.styled_default(le())({name:"NotificationInterstitialContainer",class:"no2k63v",propsAsIs:!0}),de=e.styled_default("div")({name:"TVButtons",class:"th9nn6a",propsAsIs:!1}),z=e.styled_default("button")({name:"TVButton",class:"t1eee77p",propsAsIs:!1}),re=()=>z,ce=e.styled_default(re())({name:"DismissButton",class:"ds000hw",propsAsIs:!0}),ue=()=>z,pe=e.styled_default(ue())({name:"AnswerButton",class:"a1nz9hoe",propsAsIs:!0}),me=({title:t,questionType:o,questionTypeData:i,description:n,imageMode:l,webos:u})=>s.jsxs(Xs,{imageMode:l,questionType:o,webos:u,children:[s.jsx(e.x,{questionTypeData:i,questionType:o,questionStatus:r.QuestionStatus.UNSET}),t&&s.jsx(ne,{webos:u,children:t}),n&&s.jsx(oe,{children:n})]}),ye=e.O(ae),xe=e.O(ce),ve=e.O(pe),fe=({sponsorLogo:t,onClick:o,webos:i})=>s.jsx(ye,{autoFocus:!0,webos:i,onClick:o,"data-webos":i,children:s.jsx(O,{withoutPadding:!0,children:s.jsx(P,{src:t})})}),je=({action:t,close:o,questionType:i,inApp:n,insight:l,color:u,webos:c})=>{var a,p,m;const[v,x]=y.useState(!1),f=y.useRef();y.useEffect(()=>(n!=null&&n.sponsorLogo&&(x(!0),f.current=setTimeout(()=>{x(!1)},5e3)),()=>clearTimeout(f.current)),[n==null?void 0:n.sponsorLogo]);const d=e.e[i];if(!d||!n||!n.notification)return null;const{title:Z,image:ss,imageMode:h,useContentMedia:$}=n.notification,es=i===r.QuestionType.FACTOID?l==null?void 0:l.heading:Z,ts=i===r.QuestionType.FACTOID?l==null?void 0:l.body:"",ns=ss,g=i===r.QuestionType.FACTOID&&((a=l==null?void 0:l.video)==null?void 0:a.url)&&(n==null?void 0:n.isVideo)&&$===r.NotificationUseContentMedia.ENABLED,_=$===r.NotificationUseContentMedia.ENABLED?g?(p=l==null?void 0:l.video)==null?void 0:p.url:l==null?void 0:l.image:"";return n!=null&&n.sponsorLogo&&v?s.jsx(fe,{sponsorLogo:n==null?void 0:n.sponsorLogo,webos:c,onClick:()=>x(!1)}):s.jsxs(U,{"data-a":"intr",className:"SL_InApp",onClick:A=>{c||t==null||t(A)},"data-is-insight":i===r.QuestionType.FACTOID,"data-webos":c,children:[(n==null?void 0:n.sponsorLogo)&&s.jsx(ie,{children:s.jsx(P,{src:n==null?void 0:n.sponsorLogo})}),s.jsxs(O,{children:[s.jsxs(Ws,{children:[!_&&s.jsx(q,{src:ns,imageMode:h,withVideo:!!g,color:u}),_&&s.jsx(q,{src:_,imageMode:h,withVideo:!!g,color:u,useContentMedia:$,thumbnailUrl:(m=l==null?void 0:l.video)==null?void 0:m.thumbnailUrl}),s.jsx(me,{questionTypeData:d,questionType:i,title:es,description:ts,imageMode:h,webos:c})]}),!c&&s.jsx(Ks,{name:"chevronRight"}),c&&s.jsxs(de,{children:[s.jsx(xe,{webos:!0,"data-close-btn":"true",onClick:A=>{A.stopPropagation(),o==null||o(A)},children:"Dismiss"}),s.jsx(ve,{webos:!0,autoFocus:!0,onClick:t,children:"Answer"})]})]})]})},Ie=e.styled_default("div")({name:"NotificationContainer",class:"n11jcrxe",propsAsIs:!1}),S=e.styled_default("img")({name:"Icon",class:"i1vmpt6u",propsAsIs:!1}),Ae=e.styled_default("div")({name:"IconContainer",class:"i180665s",propsAsIs:!1}),he=()=>e.B1,$e=e.styled_default(he())({name:"TitleIcon",class:"t16zzzei",propsAsIs:!0}),ge=()=>e.y,_e=e.styled_default(ge())({name:"Close",class:"c1sur0q2",propsAsIs:!0}),we=e.styled_default("div")({name:"Body",class:"bai9j52",propsAsIs:!1}),Te=e.styled_default("div")({name:"Title",class:"t1bnt25p",propsAsIs:!1}),be=e.styled_default("div")({name:"Description",class:"dmixjec",propsAsIs:!1}),Ce=e.styled_default("button")({name:"Button",class:"b1ubkw1q",propsAsIs:!1}),Ne=({open:t,close:o,...i})=>{var n,l;return s.jsxs(Ie,{"data-a":"intr",onClick:()=>{t==null||t(),i&&i.markIstantOpen()},children:[s.jsxs(Ae,{children:[s.jsx(S,{className:"on-light",src:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification.png"}),s.jsx(S,{className:"on-dark",src:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification-dark.png"})]}),s.jsxs(we,{children:[s.jsxs(Te,{children:[s.jsx($e,{name:"icon-trophy-solid"}),(n=i==null?void 0:i.titleCard)==null?void 0:n.title]}),s.jsxs(be,{children:[s.jsx("span",{children:(l=i==null?void 0:i.titleCard)==null?void 0:l.subtitle}),s.jsx(Ce,{name:"inapp-button",children:"Play Now"})]})]}),s.jsx(_e,{close:u=>{u==null||u.stopPropagation(),o==null||o()}})]})},ke=e.styled_default("div")({name:"Container",class:"cef8huz",propsAsIs:!1}),qe=()=>e.B1,Se=e.styled_default(qe())({name:"CheckIcon",class:"c1mo15kk",propsAsIs:!0}),Ee=()=>e.B1,Le=e.styled_default(Ee())({name:"PredictionIcon",class:"p16zkqnm",propsAsIs:!0}),Me=e.styled_default("div")({name:"PredictionIconContainer",class:"pjszi7a",propsAsIs:!1}),De=e.styled_default("div")({name:"BodyContainer",class:"bftbmo3",propsAsIs:!1}),Be=e.styled_default("div")({name:"Body",class:"barrbyu",propsAsIs:!1}),Qe=e.styled_default("div")({name:"Subtitle",class:"sz7237i",propsAsIs:!1}),Re=({step:t,children:o,answer:i,state:n="pending"})=>{const[l,u]=y.useState(0),[c]=y.useState(()=>new ResizeObserver(p=>{window.requestAnimationFrame(()=>{var m,v;u(((v=(m=p==null?void 0:p[0])==null?void 0:m.contentRect)==null?void 0:v.width)??0)})})),a=y.useCallback(p=>{p?c.observe(p):c.disconnect()},[c]);return y.useEffect(()=>()=>{c.disconnect()},[c]),s.jsxs(ke,{children:[s.jsx(Me,{children:s.jsx(Le,{name:"icon-prediction"})}),s.jsx(De,{style:{minWidth:`${l}px`},children:s.jsx(Be,{children:o},t)}),s.jsx(Qe,{ref:a,className:n,children:s.jsxs("div",{children:[s.jsx(Se,{name:"icon-check"}),"Your Pick: ",i]})})]})},Oe=e.styled_default("div")({name:"Container",class:"ckyzolp",propsAsIs:!1}),b=e.styled_default("div")({name:"Line",class:"l16t1zr7",propsAsIs:!1}),Ue=()=>b,Pe=e.styled_default(Ue())({name:"Line1",class:"le78kvg",propsAsIs:!0}),ze=()=>b,Ve=e.styled_default(ze())({name:"Line2",class:"l1o7966d",propsAsIs:!0}),Fe=()=>b,We=e.styled_default(Fe())({name:"Line3",class:"lu9lyxq",propsAsIs:!0}),Ye=()=>s.jsxs(Oe,{children:[s.jsx(Pe,{children:s.jsx("div",{})}),s.jsx(Ve,{children:s.jsx("div",{})}),s.jsx(We,{children:s.jsx("div",{})})]}),Ke=e.styled_default("div")({name:"Container",class:"c10jy6zf",propsAsIs:!1}),Ge=()=>e.B1,He=e.styled_default(Ge())({name:"CheckIcon",class:"c1c7scay",propsAsIs:!0}),Je=()=>s.jsxs(Ke,{children:[s.jsx(He,{name:"icon-check"})," Prediction results are in!"]}),Xe=e.styled_default("div")({name:"Container",class:"cf6k2yy",propsAsIs:!1}),Ze=e.styled_default("div")({name:"Caption",class:"c1c8xjus",propsAsIs:!1}),st=e.styled_default("div")({name:"Title",class:"t1d1uekn",propsAsIs:!1}),et=({title:t})=>s.jsxs(Xe,{children:[s.jsx(Ze,{children:"Results for"}),s.jsx(st,{children:t})]}),V=e.styled_default("div")({name:"Container",class:"c181a1as",propsAsIs:!1}),F=e.styled_default("div")({name:"Title",class:"t1cduox6",propsAsIs:!1}),tt=()=>e.B1,W=e.styled_default(tt())({name:"CorrectIcon",class:"c1onrv6j",propsAsIs:!0}),nt=()=>W,ot=e.styled_default(nt())({name:"InCorrectIcon",class:"i17n9o7e",propsAsIs:!0}),it=()=>s.jsxs(V,{children:[s.jsxs(F,{children:["Congratulations!",s.jsx("br",{}),"You answered correctly."]}),s.jsx(W,{name:"icon-check"})]}),lt=({title:t})=>s.jsxs(V,{children:[s.jsxs(F,{children:["Better luck next time!",s.jsx("br",{}),"Correct: ",t]}),s.jsx(ot,{name:"icon-cross"})]}),at=e.styled_default("div")({name:"Container",class:"cnxgcs2",propsAsIs:!1}),dt=e.styled_default("div")({name:"Title",class:"t903f8n",propsAsIs:!1}),rt=()=>e.B1,ct=e.styled_default(rt())({name:"CheckIcon",class:"ceyu3qj",propsAsIs:!0}),ut=({points:t})=>s.jsxs(at,{children:[s.jsxs(dt,{children:["You won ",s.jsx(e.d,{delay:.5,prefix:"+",suffix:" points",value:t})]}),s.jsx(ct,{name:"icon-trophy-solid"})]}),E=e.styled_default("div")({name:"Container",class:"cq3agu2",propsAsIs:!1}),L=e.styled_default("div")({name:"Body",class:"b16qj0do",propsAsIs:!1}),M={1:3e3,2:4e3,3:4e3,4:4e3},pt=({close:t,action:o,setStep:i,votedAnswer:n,correct:l,correctAnswerTitle:u,questionTitle:c,step:a})=>{if(y.useEffect(()=>{if(i){const m=setTimeout(()=>{M[a+1]&&(l||a<3)?i(a+1):t==null||t()},M[a]);return()=>{m&&clearTimeout(m)}}return()=>{}},[i,a,t,l]),a===1)return s.jsx(E,{children:s.jsx(L,{children:s.jsx(Je,{})})});let p="pending";return(a===3||a===4)&&(p=l?"correct":"incorrect"),s.jsx(E,{"data-a":"intr",onClick:()=>o==null?void 0:o(),children:s.jsxs(L,{children:[a!==1&&s.jsx(Ye,{},a),s.jsxs(Re,{state:p,step:a,answer:(n==null?void 0:n.title)||"unknown",children:[a===2&&s.jsx(et,{title:c||"unknown"}),a===3&&l&&s.jsx(it,{}),a===3&&!l&&s.jsx(lt,{title:u||"unknown"}),a===4&&s.jsx(ut,{points:(n==null?void 0:n.points)||0})]})]})})},mt=({close:t,action:o,votedAnswer:i,correct:n,correctAnswerTitle:l,questionTitle:u})=>{const[c,a]=y.useState(1);return s.jsx(pt,{close:t,action:o,votedAnswer:i,correct:n,correctAnswerTitle:l,questionTitle:u,setStep:a,step:c,title:""})},yt=e.styled_default("div")({name:"NotificationContainer",class:"n1i4h28u",propsAsIs:!1}),xt=t=>s.jsx(yt,{children:s.jsx(mt,{...t})}),vt=e.styled_default("div")({name:"Container",class:"cwa9tgs",propsAsIs:!1}),ft=e.styled_default("div")({name:"BodyContainer",class:"b1xx7swj",propsAsIs:!1}),jt=e.styled_default("div")({name:"Body",class:"b1a21en",propsAsIs:!1}),It=({step:t,children:o,state:i="pending"})=>{const[n,l]=y.useState(0);return y.useEffect(()=>{const u=new ResizeObserver(c=>{window.requestAnimationFrame(()=>{var a,p;const m=((p=(a=c==null?void 0:c[0])==null?void 0:a.contentRect)==null?void 0:p.width)??0;l(m)})});return()=>{u.disconnect()}},[]),s.jsx(vt,{style:{padding:`${t===3&&i==="incorrect"||t===1?"5px 100px":"5px 40px"}`},children:s.jsx(ft,{style:{minWidth:`${n}px`},children:s.jsx(jt,{children:o},t)})})},At=e.styled_default("div")({name:"Container",class:"c1nd5cu8",propsAsIs:!1}),C=e.styled_default("div")({name:"Line",class:"lgbipw0",propsAsIs:!1}),ht=()=>C,$t=e.styled_default(ht())({name:"Line1",class:"l1anth16",propsAsIs:!0}),gt=()=>C,_t=e.styled_default(gt())({name:"Line2",class:"l193yd7v",propsAsIs:!0}),wt=()=>C,Tt=e.styled_default(wt())({name:"Line3",class:"lhbflsp",propsAsIs:!0}),bt=()=>s.jsxs(At,{children:[s.jsx($t,{children:s.jsx("div",{})}),s.jsx(_t,{children:s.jsx("div",{})}),s.jsx(Tt,{children:s.jsx("div",{})})]}),Ct=e.styled_default("div")({name:"Container",class:"c1lvd429",propsAsIs:!1}),Nt=()=>e.B1,kt=e.styled_default(Nt())({name:"PredictionIcon",class:"p1n4m87t",propsAsIs:!0}),qt=()=>s.jsxs(Ct,{children:[s.jsx(kt,{name:"icon-prediction"})," Prediction results are in!"]}),St=()=>e.B1,Et=e.styled_default(St())({name:"CheckIcon",class:"c126r8f9",propsAsIs:!0}),Lt=e.styled_default("div")({name:"Answer",class:"a1o2rpgl",propsAsIs:!1}),Mt=e.styled_default("div")({name:"Container",class:"cej6ci1",propsAsIs:!1}),Dt=e.styled_default("div")({name:"Title",class:"tob24mr",propsAsIs:!1}),Bt=({title:t,answer:o})=>s.jsxs(Mt,{children:[s.jsx(Dt,{children:t}),s.jsxs(Lt,{children:[s.jsx(Et,{name:"icon-prediction"}),"Your Pick: ",o]})]}),Y=e.styled_default("div")({name:"Container",class:"c1lesal4",propsAsIs:!1}),K=e.styled_default("div")({name:"Title",class:"tv66n4w",propsAsIs:!1}),Qt=()=>e.B1,Rt=e.styled_default(Qt())({name:"CorrectIcon",class:"cx0vlv2",propsAsIs:!0}),G=e.styled_default("div")({name:"Answer",class:"akfh4v5",propsAsIs:!1}),Ot=({answer:t})=>s.jsxs(Y,{children:[s.jsx(K,{children:"Congratulations! You answered correctly."}),s.jsxs(G,{children:[s.jsx(Rt,{name:"icon-correct"}),"Your Pick: ",t]})]}),Ut=({title:t,answer:o})=>s.jsxs(Y,{children:[s.jsxs(K,{children:["Better luck next time!",s.jsx("br",{}),"Correct: ",t]}),s.jsxs(G,{children:["Your Pick: ",o]})]}),D=e.styled_default("div")({name:"Container",class:"cmox3ot",propsAsIs:!1}),B=e.styled_default("div")({name:"Body",class:"bqq1ix4",propsAsIs:!1}),Q={1:3e3,2:4e3,3:4e3},Pt=({close:t,action:o,setStep:i,votedAnswer:n,correct:l,correctAnswerTitle:u,questionTitle:c,step:a})=>{if(y.useEffect(()=>{if(i){const m=setTimeout(()=>{Q[a+1]&&(l||a<3)?i(a+1):t==null||t()},Q[a]);return()=>{m&&clearTimeout(m)}}return()=>{}},[i,a,t,l]),a===1)return s.jsx(D,{children:s.jsx(B,{children:s.jsx(qt,{})})});let p="pending";return a===3&&(p=l?"correct":"incorrect"),s.jsx(D,{"data-a":"intr",onClick:()=>o==null?void 0:o(),children:s.jsxs(B,{children:[a!==1&&s.jsx(bt,{},a),s.jsxs(It,{state:p,step:a,children:[a===2&&s.jsx(Bt,{title:c||"unknown",answer:(n==null?void 0:n.title)||"unknown"}),a===3&&l&&s.jsx(Ot,{answer:(n==null?void 0:n.title)||"unknown"}),a===3&&!l&&s.jsx(Ut,{title:u||"unknown",answer:(n==null?void 0:n.title)||"unknown"})]})]})})},zt=({close:t,action:o,votedAnswer:i,correct:n,correctAnswerTitle:l,questionTitle:u})=>{const[c,a]=y.useState(1);return s.jsx(Pt,{close:t,action:o,votedAnswer:i,correct:n,correctAnswerTitle:l,questionTitle:u,setStep:a,step:c,title:""})},H=e.styled_default("div")({name:"NotificationContainer",class:"nn0nqh6",propsAsIs:!1}),Vt=()=>({withoutPadding:t})=>t?"0px":"1rem",Ft=e.styled_default("div")({name:"NotificationContent",class:"n1bcdf3j",propsAsIs:!1,vars:{"n1bcdf3j-0":[Vt()]}}),J=e.styled_default("img")({name:"LogoImg",class:"l8jorbq",propsAsIs:!1}),Wt=()=>H,Yt=e.styled_default(Wt())({name:"NotificationInterstitialContainer",class:"nf920y3",propsAsIs:!0}),Kt=e.styled_default("div")({name:"LogoImgContainer",class:"lzsmehn",propsAsIs:!1}),Gt=({sponsorLogo:t,onClick:o})=>s.jsx(Yt,{onClick:o,children:s.jsx(Ft,{withoutPadding:!0,children:s.jsx(J,{src:t})})}),Ht=t=>{var o,i,n,l,u;const[c,a]=y.useState(!1),p=y.useRef();return y.useEffect(()=>{var m;return(m=t==null?void 0:t.inApp)!=null&&m.sponsorLogo&&(a(!0),p.current=setTimeout(()=>{a(!1)},5e3)),()=>clearTimeout(p.current)},[(o=t==null?void 0:t.inApp)==null?void 0:o.sponsorLogo]),(i=t==null?void 0:t.inApp)!=null&&i.sponsorLogo&&c?s.jsx(Gt,{sponsorLogo:(n=t.inApp)==null?void 0:n.sponsorLogo,onClick:()=>a(!1)}):s.jsx(H,{children:s.jsxs("div",{children:[((l=t==null?void 0:t.inApp)==null?void 0:l.sponsorLogo)&&s.jsx(Kt,{children:s.jsx(J,{src:(u=t==null?void 0:t.inApp)==null?void 0:u.sponsorLogo})}),s.jsx(zt,{...t})]})})},X=({sdk:t,webos:o})=>{var i,n,l,u,c,a,p,m;const[v]=y.useState(t.getNotificationsStore()),x=e.useStore(v),f=t.getFeature(r.SdkOverlayType.GAMES),d=y.useMemo(()=>t.getActiveNotification(),[t,x]);return y.useEffect(()=>{d&&e.eventBus.emit("notification",{action:"rendered",payload:{questionId:d.data.questionId,questionType:d.data.questionType}})},[d]),d&&d.type===e.NotificationType.QUESTION_RESOLVED?d.data.question&&d.data.questionType===r.QuestionType.PREDICTION?d&&((i=d.data.inApp)==null?void 0:i.adUnit)===r.AdUnit.STANDART?s.jsx(Ht,{action:d.action,close:d.close,...d.data.question,inApp:d.data.inApp}):s.jsx(xt,{action:d.action,close:d.close,...d.data.question}):null:d&&d.type===e.NotificationType.ONBOARDING?d.data.onboarding?s.jsx(Ne,{open:f==null?void 0:f.openOnboarding,close:d.close,...d.data.onboarding}):null:d&&((n=d.data.inApp)==null?void 0:n.adUnit)===r.AdUnit.STANDART?s.jsx(je,{...d.data,action:d.action,close:d.close,color:((c=(u=(l=d==null?void 0:d.data)==null?void 0:l.inApp)==null?void 0:u.notification)==null?void 0:c.indicatorColor)||((m=(p=(a=d==null?void 0:d.data)==null?void 0:a.inApp)==null?void 0:p.appearance)==null?void 0:m.primaryColor),webos:o}):d&&s.jsx(Cs,{...d.data,action:d.action})},Jt=({theme:t})=>{const o=e.useStreamLayer(),i=e.useStreamLayerTheme(),n=e.useStreamLayerUI();return o&&(n.appNotification||n.onboardingNotification)?n.app&&!n.onboardingNotification?null:s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(e.h,{customTheme:t??i.theme,themeMode:i.themeMode,children:s.jsx(X,{sdk:o})})}):null};exports.StreamLayerSDKNotification=Jt;exports.StreamLayerSDKNotificationUI=X;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),u=require("react")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),u=require("react"),e=require("./provider.js");require("nanostores");require("lodash.throttle");require("react-dom");require("react-countup");const c=require("./useStreamLayerApp2.js"),d=e.styled_default("div")({name:"PointsContainer",class:"psiob9b",propsAsIs:!1}),p=e.styled_default("div")({name:"PointsIcon",class:"p1gqe4lh",propsAsIs:!1}),m=()=>e.B1,y=e.styled_default(m())({name:"PointsSvg",class:"p15syg2y",propsAsIs:!0}),S=e.styled_default("div")({name:"PointsBody",class:"p12n4f2h",propsAsIs:!1}),v=e.styled_default("div")({name:"PointsTitle",class:"poqmx89",propsAsIs:!1}),h=e.styled_default("div")({name:"PointsValue",class:"prj9b3v",propsAsIs:!1}),f=({points:t,onClick:r})=>s.jsxs(d,{className:e.m,onClick:r,children:[s.jsx(p,{children:s.jsx(y,{name:"icon-trophy-solid"})}),s.jsxs(S,{children:[s.jsx(v,{children:"Total points"}),s.jsx(h,{children:s.jsx(e.d,{value:t})})]})]}),j=({gamification:t})=>{const r=t.userSummary.$store,[a,l]=u.useState(0);return u.useEffect(()=>{const n=r.subscribe(i=>{var o;(o=i==null?void 0:i.summary)!=null&&o.points&&l(i.summary.points)});return()=>{n()}},[r]),s.jsx(f,{points:a,onClick:()=>{const n=t.status.get();n===e.FeatureStatus.Suspended?(t.openFeature(),e.eventBus.emit("app",{action:"open",payload:{}}),e.eventBus.emit("interactions",{action:"tap",payload:{}})):n===e.FeatureStatus.Ready&&(t.closeFeature(!1),e.eventBus.emit("app",{action:"close",payload:{}}),e.eventBus.emit("interactions",{action:"tap",payload:{}}))}})},x=({sdk:t})=>{if(!e.useStore(t.featuresList.getStore()))return null;const r=t.getFeature(c.SdkOverlayType.GAMES);return r?s.jsx(j,{gamification:r}):null},g=({theme:t})=>{const r=e.useStreamLayer(),a=e.useStreamLayerTheme();return r?s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(e.h,{customTheme:t??a.theme,themeMode:a.themeMode,children:s.jsx(x,{sdk:r})})}):null};exports.StreamLayerSDKPoints=g;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var G1=f;function on(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ln=typeof Object.is=="function"?Object.is:on,cn=G1.useState,dn=G1.useEffect,un=G1.useLayoutEffect,pn=G1.useDebugValue;function Cn(e,t){var n=t(),r=cn({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return un(function(){i.value=n,i.getSnapshot=t,N2(i)&&a({inst:i})},[e,n,t]),dn(function(){return N2(i)&&a({inst:i}),e(function(){N2(i)&&a({inst:i})})},[e]),pn(n),n}function N2(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ln(e,n)}catch{return!0}}function hn(e,t){return t()}var fn=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?hn:Cn;C6.useSyncExternalStore=G1.useSyncExternalStore!==void 0?G1.useSyncExternalStore:fn;p6.exports=C6;var vn=p6.exports;const H2=(e,t)=>n=>{e.current!==n&&(e.current=n,t())};function mn(e,{keys:t,deps:n=[e,t]}={}){const r=f.useRef();r.current=e.get();const i=f.useCallback(o=>(H2(r,o)(e.value),(t==null?void 0:t.length)>0?j7.listenKeys(e,t,H2(r,o)):e.listen(H2(r,o))),n),a=()=>r.current;return f.useSyncExternalStore?f.useSyncExternalStore(i,a,a):vn.useSyncExternalStore(i,a,a)}const Y=mn,gn=()=>[!1,e=>{window.requestAnimationFrame(()=>e())}],yn=
|
|
9
|
+
*/var G1=f;function on(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ln=typeof Object.is=="function"?Object.is:on,cn=G1.useState,dn=G1.useEffect,un=G1.useLayoutEffect,pn=G1.useDebugValue;function Cn(e,t){var n=t(),r=cn({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return un(function(){i.value=n,i.getSnapshot=t,N2(i)&&a({inst:i})},[e,n,t]),dn(function(){return N2(i)&&a({inst:i}),e(function(){N2(i)&&a({inst:i})})},[e]),pn(n),n}function N2(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ln(e,n)}catch{return!0}}function hn(e,t){return t()}var fn=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?hn:Cn;C6.useSyncExternalStore=G1.useSyncExternalStore!==void 0?G1.useSyncExternalStore:fn;p6.exports=C6;var vn=p6.exports;const H2=(e,t)=>n=>{e.current!==n&&(e.current=n,t())};function mn(e,{keys:t,deps:n=[e,t]}={}){const r=f.useRef();r.current=e.get();const i=f.useCallback(o=>(H2(r,o)(e.value),(t==null?void 0:t.length)>0?j7.listenKeys(e,t,H2(r,o)):e.listen(H2(r,o))),n),a=()=>r.current;return f.useSyncExternalStore?f.useSyncExternalStore(i,a,a):vn.useSyncExternalStore(i,a,a)}const Y=mn,gn=()=>[!1,e=>{window.requestAnimationFrame(()=>e())}],yn=f.useTransition||gn,xn=e=>{const t=Y(e.getActiveFeature()),n=Y(e.streamStore()),[r,i]=f.useState(null);return f.useEffect(()=>{const a=e.getFeatures();if(!t)i(null);else for(const[o,l]of a)o===t?(l.status.get()===exports.FeatureStatus.Suspended&&l.enable(),i(l)):l.status.get()===exports.FeatureStatus.Ready&&l.disable();return()=>{for(const[,o]of a)o.status.get()===exports.FeatureStatus.Ready&&o.disable()}},[t,e,n]),[t,r]},wn={BLUE_QUESTION_ACTION_BTN:"#1589ee",WHITE:"#FFFFFF",BLUE:"#2d6ffd",GREY_PRIMARY:"#909395",GREY_PRIMARY_ONBOARDING_INAPP:"#B5B7B8",PRIMARY_1:"#1D7BFF",PRIMARY_2:"#095CD1",PRIMARY_TEXT:"#090E13",SECONDARY_TEXT:"rgba(10, 14, 19, 0.70)",QUESTION_TYPE_ICON:"#1D7BFF",QUESTION_BODY_TEXT:"#090E13",PRESENTED_BY_TEXT:"#090E13",SUCCESS:"#107D57",UNSUCCESS:"#DF2F3B",SECONDARY_RED1:"#DF2F3B",NEUTRALS_WHITE:"#FFFFFF",NEUTRALS_WHITE1:"#FFFFFF",NEUTRALS_GRAY1:"#F7F7F7",NEUTRALS_GRAY2:"#F2F2F1",NEUTRALS_GRAY3:"#E8E8E8",NEUTRALS_GRAY4:"#D9D9D6",NEUTRALS_GRAY5:"#B1B3B3",NEUTRALS_GRAY6:"#888B8D",NEUTRALS_GRAY7:"#6B6F73",NEUTRALS_GRAY9:"#25282A",SDK_CONTAINER_BG:"#F7F7F7",SDK_WHITE_CONTAINER_BG:"#fff",SDK_DARK_CONTAINER_BG:"#fff",SDK_PREDICTION_RESULT_SUCCESS_BG:"#fff",SDK_PREDICTION_RESULT_INCORRECT_BG:"#fff",SDK_PREDICTION_RESULT_SUCCESS_TEXT:"#107D57",SDK_PREDICTION_RESULT_ERROR_TITLE:"#090E13",SDK_PREDICTION_RESULT_ERROR_SUBTITLE:"#DF2F3B",SDK_PREDICTION_RESULT_CLOSE_ICON:"#6B6F73",SDK_PREDICTION_FEEDBACK_SUCCESS_ICON:"#107D57",SDK_PREDICTION_FEEDBACK_INCORRECT_RECT1:"#CD2525",SDK_PREDICTION_FEEDBACK_INCORRECT_RECT2:"#fff",PREDICTION_BG_LINES_CORRECT:"#01AB58",PREDICTION_BG_LINES_INCORRECT:"#888B8D",SKELETON_COLOR_1:"#f1efef",SKELETON_COLOR_2:"#f9f8f8",TABS_CONTAINER_BG:"#F2F2F1",TABS_ACTIVE_BG:"#FFFFFF",TABS_COLOR:"#6B6F73",TABS_ACTIVE_COLOR:"#1D7BFF",CARD_BG:"#FFFFFF",CARD_BORDER:"#fff",BORDER:"#E8E8E8",VOTE_BTN_BG:"#F7F7F7",VOTE_BTN_BORDER:"rgb(232, 232, 232)",VOTE_BTN_DISABLED_BORDER:"#B1B3B3",VOTE_BTN_SELECTED_BORDER:"#25282A",VOTE_BTN_NOT_SELECTED_BORDER:"#E8E8E8",VOTE_BTN_SELECTED_BG:"#FFFFFF",VOTE_BTN_SELECTED_BG_AD_UNIT:"#FFFFFF",VOTE_BTN_NOT_SELECTED_BG:"#FFFFFF",VOTE_BTN_NOT_SELECTED_BG_UNSET:"rgb(196, 196, 196)",VOTED_ANSWER_BG:"#FFFFFF",VOTED_BTN_RCT_BG:"#2d5694",IN_APP_BG:"rgba(255, 255, 255, 0.90)",IN_APP_QUESTION_TYPE_ICON:"#1D7BFF",IN_APP_QUESTION_TYPE_LABEL:"#82899E",IN_APP_QUESTION_QUOTE:"rgba(10, 14, 19, 0.70)",IN_APP_QUESTION_RESULT_SUBTITLE_BG:"#1D7BFF",IN_APP_QUESTION_RESULT_LINE:"#babfc5",QUOTE_BORDER:"#E8E8E8",QUOTE_TEXT:"rgba(10, 14, 19, 0.70)"},bn={BG_PRIMARY:"#13212b",BG_SECONDARY:"#152430",BG_SECONDARY1:"#435059",BORDER_PRIMARY:"rgba(255, 255, 255, 0.1)",TEXT_PRIMARY:"#f9f9f9",TEXT_PRIMARY1:"#f9f9f9",TEXT_SECONDARY:"rgba(255, 255, 255, 0.8)",TEXT_SECONDARY1:"#878787",WHITE:"#fff"},Ln=["#107D57","#DF2F3B","#DF2F3B","#E8E8E8"],En="#cee5de",In="#f9d6d8",_n="#E8E8E8",$1={xs:324,sm:576,md:768,lg:992,xl:1200,xxl:1440};Object.entries(wn).reduce((e,[t,n])=>`
|
|
10
10
|
${e}
|
|
11
11
|
--color-${t.toLowerCase().replaceAll("_","-")}: ${n};
|
|
12
12
|
`,"");Object.entries(bn).reduce((e,[t,n])=>`
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
`),a=`
|
|
14
14
|
`+n+(i.length?o("│"):" ")+" ";return n+c.join(a)+`
|
|
15
15
|
`+i.map(function(s,r){var u=r===i.length-1,V=s.nodes&&s.nodes.length,R=n+(u?" ":o("│"))+" ";return n+o(u?"└":"├")+o("─")+o(V?"┬":"─")+" "+e(s,R,l).slice(n.length+2)}).join("")};const Vb=ub,mi=Symbol("avvio.TimeTree.untrackNode"),Pn=Symbol("avvio.TimeTree.trackNode"),gi=Symbol("avvio.TimeTree.getParent"),hi=Symbol("avvio.TimeTree.getNode"),Wi=Symbol("avvio.TimeTree.addNode");let bb=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Pn](e){this.tableId.set(e.id,e),this.tableLabel.has(e.label)?this.tableLabel.get(e.label).push(e):this.tableLabel.set(e.label,[e])}[mi](e){this.tableId.delete(e.id);const t=this.tableLabel.get(e.label);if(t.id){this.tableLabel.delete(e.label);return}t.pop(),t.length===0&&this.tableLabel.delete(e.label)}[gi](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[hi](e){return this.tableId.get(e)}[Wi](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[Pn](this.root),this.root.id;const l=this[gi](e),o=`${t}-${Math.random()}`,i={id:o,parent:e,start:n,label:t,nodes:[]};return l.nodes.push(i),this[Pn](i),o}start(e,t,n=Date.now()){return this[Wi](e,t,n)}stop(e,t=Date.now()){const n=this[hi](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[mi](n))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const e=n=>(n.label=`${n.label} ${n.diff} ms`,n.nodes.length>0&&(n.nodes=n.nodes.map(l=>e(l))),n),t=e(this.toJSON());return Vb(t)}};var Rb=bb,$l={exports:{}},Xl={exports:{}},_n,Zi;function Ab(){if(Zi)return _n;Zi=1;var e=1e3,t=e*60,n=t*60,l=n*24,o=l*7,i=l*365.25;_n=function(u,V){V=V||{};var R=typeof u;if(R==="string"&&u.length>0)return c(u);if(R==="number"&&isFinite(u))return V.long?s(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function c(u){if(u=String(u),!(u.length>100)){var V=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(V){var R=parseFloat(V[1]),g=(V[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return R*i;case"weeks":case"week":case"w":return R*o;case"days":case"day":case"d":return R*l;case"hours":case"hour":case"hrs":case"hr":case"h":return R*n;case"minutes":case"minute":case"mins":case"min":case"m":return R*t;case"seconds":case"second":case"secs":case"sec":case"s":return R*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return R;default:return}}}}function a(u){var V=Math.abs(u);return V>=l?Math.round(u/l)+"d":V>=n?Math.round(u/n)+"h":V>=t?Math.round(u/t)+"m":V>=e?Math.round(u/e)+"s":u+"ms"}function s(u){var V=Math.abs(u);return V>=l?r(u,V,l,"day"):V>=n?r(u,V,n,"hour"):V>=t?r(u,V,t,"minute"):V>=e?r(u,V,e,"second"):u+" ms"}function r(u,V,R,g){var h=V>=R*1.5;return Math.round(u/R)+" "+g+(h?"s":"")}return _n}function mb(e){n.debug=n,n.default=n,n.coerce=s,n.disable=i,n.enable=o,n.enabled=c,n.humanize=Ab(),n.destroy=r,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let V=0;for(let R=0;R<u.length;R++)V=(V<<5)-V+u.charCodeAt(R),V|=0;return n.colors[Math.abs(V)%n.colors.length]}n.selectColor=t;function n(u){let V,R=null,g,h;function X(...p){if(!X.enabled)return;const W=X,A=Number(new Date),F=A-(V||A);W.diff=F,W.prev=V,W.curr=A,V=A,p[0]=n.coerce(p[0]),typeof p[0]!="string"&&p.unshift("%O");let y=0;p[0]=p[0].replace(/%([a-zA-Z%])/g,(N,U)=>{if(N==="%%")return"%";y++;const S=n.formatters[U];if(typeof S=="function"){const M=p[y];N=S.call(W,M),p.splice(y,1),y--}return N}),n.formatArgs.call(W,p),(W.log||n.log).apply(W,p)}return X.namespace=u,X.useColors=n.useColors(),X.color=n.selectColor(u),X.extend=l,X.destroy=n.destroy,Object.defineProperty(X,"enabled",{enumerable:!0,configurable:!1,get:()=>R!==null?R:(g!==n.namespaces&&(g=n.namespaces,h=n.enabled(u)),h),set:p=>{R=p}}),typeof n.init=="function"&&n.init(X),X}function l(u,V){const R=n(this.namespace+(typeof V>"u"?":":V)+u);return R.log=this.log,R}function o(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let V;const R=(typeof u=="string"?u:"").split(/[\s,]+/),g=R.length;for(V=0;V<g;V++)R[V]&&(u=R[V].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function i(){const u=[...n.names.map(a),...n.skips.map(a).map(V=>"-"+V)].join(",");return n.enable(""),u}function c(u){if(u[u.length-1]==="*")return!0;let V,R;for(V=0,R=n.skips.length;V<R;V++)if(n.skips[V].test(u))return!1;for(V=0,R=n.names.length;V<R;V++)if(n.names[V].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function s(u){return u instanceof Error?u.stack||u.message:u}function r(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var gb=mb;(function(e,t){t.formatArgs=l,t.save=o,t.load=i,t.useColors=n,t.storage=c(),t.destroy=(()=>{let s=!1;return()=>{s||(s=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function l(s){if(s[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+s[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;s.splice(1,0,r,"color: inherit");let u=0,V=0;s[0].replace(/%[a-zA-Z%]/g,R=>{R!=="%%"&&(u++,R==="%c"&&(V=u))}),s.splice(V,0,r)}t.log=console.debug||console.log||(()=>{});function o(s){try{s?t.storage.setItem("debug",s):t.storage.removeItem("debug")}catch{}}function i(){let s;try{s=t.storage.getItem("debug")}catch{}return!s&&typeof B<"u"&&"env"in B&&(s=B.env.DEBUG),s}function c(){try{return localStorage}catch{}}e.exports=gb(t);const{formatters:a}=e.exports;a.j=function(s){try{return JSON.stringify(s)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}})(Xl,Xl.exports);var wc=Xl.exports;const hb=mc,Wb=yc.EventEmitter,Zb=Nn.inherits,be=wc("avvio"),{AVV_ERR_READY_TIMEOUT:Eb}=Lc,qn=Symbol.for("plugin-meta");function Gb(e,t){return e[qn]&&e[qn].name?e[qn].name:typeof t<"u"&&typeof t!="function"&&t.name?t.name:e.name?e.name:e.toString().split(`
|
|
16
|
-
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function Xb(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function ft(e,t,n,l,o){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=o===void 0?e._timeout:o,this.name=Gb(t,n),this.isAfter=l,this.q=hb(e,pb,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Zb(ft,Wb);ft.prototype.exec=function(e,t){const n=this.func;let l=!1;const o=this.name;if(this.parent._error&&!this.isAfter){be("skipping loading of plugin as parent errored and it is not an after",o),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(s){return be("override errored",o),t(s)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,be("exec",o);let i;const c=s=>{if(l){be("loading complete",o);return}this._error=s,be(s?"exec errored":"exec completed",o),l=!0,i&&clearTimeout(i),t(s)};this.timeout>0&&(be("setting up timeout",o,this.timeout),i=setTimeout(function(){be("timed out",o),i=null;const s=new Eb(o);s.fn=n,c(s)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const a=n(this.server,this.opts,c);a&&typeof a.then=="function"&&(be("exec: resolving promise",o),a.then(()=>B.nextTick(c),s=>B.nextTick(c,s)))};ft.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,l)=>{this._error=n,this.q.pause(),n?(be("rejecting promise",this.name,n),this._promise.reject(n)):(be("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(l,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=Xb(),t=this._promise.promise,this.server?e():this.on("start",e)),t};ft.prototype.enqueue=function(e,t){be("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};ft.prototype.finish=function(e,t){be("finish",this.name,e);const n=()=>{this.loaded||(be("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const l=()=>{if(be("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const o=()=>{be("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(o,o),this._promise=null}else n();else be("delayed",this.name),this.q.drain=()=>{be("drain",this.name),this.q.drain=yb,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function pb(e,t){const n=this;B.nextTick(eo.bind(n),e,t)}function eo(e,t){if(typeof e.func.then=="function"){e.func.then(l=>{typeof l.default=="function"&&(l=l.default),e.func=l,eo.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,l=>{e.finish(l,o=>{this._current.shift(),t(o)})})}function yb(){}$l.exports=ft;$l.exports.loadPlugin=eo;var Fb=$l.exports;const Ei=mc,Sb=yc.EventEmitter,Yb=Nn.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:$n,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:Nb,AVV_ERR_ROOT_PLG_BOOTED:Ib,AVV_ERR_READY_TIMEOUT:Ub}=Lc,Bb=Rb,pl=Fb,Ut=wc("avvio"),pn=Symbol("kAvvio"),el=Symbol("kThenifyDoNotWrap");function fb(e,t,n){const l=t.expose||{},o=l.use||"use",i=l.after||"after",c=l.ready||"ready",a=l.onClose||"onClose",s=l.close||"close";if(e[o])throw new $n(o);if(e[i])throw new $n(i);if(e[c])throw new $n(c);e[o]=function(r,u){return n.use(r,u),this},Object.defineProperty(e,"then",{get:xc.bind(n)}),e[pn]=!0,e[i]=function(r){return typeof r!="function"?n._loadRegistered():(n.after(tl(r,this)),this)},e[c]=function(r){if(r&&typeof r!="function")throw new zt(c,typeof r);return n.ready(r?tl(r,this):void 0)},e[a]=function(r){if(typeof r!="function")throw new zt(a,typeof r);return n.onClose(vb(r,this)),this},e[s]=function(r){if(r&&typeof r!="function")throw new zt(s,typeof r);return r?(n.close(tl(r,this)),this):n.close()}}function Ve(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof Ve)){const l=new Ve(e,t,n);return e&&fb(e,t,l),l}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new Bb,this._readyQ=Ei(this,Mc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Gi},this._closeQ=Ei(this,Qb,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Gi},this._doStart=null,this._root=new pl(this,Cb.bind(this),t,!1,0),this._root.once("start",(l,o,i)=>{const c=this.pluginTree.start(null,o,i);this._root.once("loaded",(a,s,r)=>{this.pluginTree.stop(c,r)})}),pl.loadPlugin.call(this,this._root,l=>{Ut("root plugin ready");try{this.emit("preReady"),this._root=null}catch(o){l=l||this._error||o}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function Cb(e,t,n){this._doStart=n,t.autostart&&this.start()}Yb(Ve,Sb);Ve.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};Ve.prototype.override=function(e,t,n){return e};function Jb(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new Nb(typeof e);return e}Ve.prototype[pn]=!0;Ve.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};Ve.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&B.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(Ve.prototype,"then",{get:xc});Ve.prototype._addPlugin=function(e,t,n){if(e=Jb(e),t=t||{},this.booted)throw new Ib;const l=this._current[0],o=new pl(this,e,t,n);if(o.once("start",(i,c,a)=>{const s=this.pluginTree.start(l.name,c,a);o.once("loaded",(r,u,V)=>{this.pluginTree.stop(s,V)})}),l.loaded)throw new Error(o.name,l.name);return l.enqueue(o,i=>{i&&(this._error=i)}),o};Ve.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,l,o){Mc.call(this,e,o)}return this};Ve.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};Ve.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,l){e=function(o){if(o)return l(o);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};Ve.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(o),this.start();const l=this._current[0].server;function o(i,c,a){i?n(i):t(l),B.nextTick(a)}})};Ve.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Ve.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Gi(){}function xc(){if(this.booted){Ut("thenify returning null because we are already booted");return}if(this[el]){this[el]=!1;return}return Ut("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[el]=!0,e(this._server)),t)}function Mc(e,t){const n=this._server,l=this._error;let o;if(this._error=null,e.length===0)this._error=l,o=e(),o&&!o[pn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(e.length===1)o=e(l),o&&!o[pn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(this._timeout===0){const i=c=>{this._error=c,t(this._error)};e.length===2?e(l,i):e(l,n,i)}else Tb.call(this,e,l,n,t)}function Tb(e,t,n,l){const o=e.name;Ut("setting up ready timeout",o,this._timeout);let i=setTimeout(()=>{Ut("timed out",o),i=null;const a=new Ub(o);a.fn=e,this._error=a,l(a)},this._timeout);e.length===2?e(t,c.bind(this)):e(t,n,c.bind(this));function c(a){i&&(clearTimeout(i),this._error=a,l(this._error))}}function Qb(e,t){const n=this._server,l=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let o;l?o=e(n):o=e(this._error),o&&typeof o.then=="function"?(Ut("resolving close/onClose promise"),o.then(()=>B.nextTick(t),i=>B.nextTick(t,i))):B.nextTick(t)}else e.length===2?e(l?n:this._error,t):l?e(n,t):e(this._error,n,t)}function vb(e,t){return n.bind(t);function n(l,o){let i;e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===1?(i=e(this),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e(this,o)}}function tl(e,t){return n.bind(t);function n(l,o){let i;e?e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o,l)},o):B.nextTick(o,l)):e.length===1?(i=e(l),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===2?e(l,o):e(l,this,o):B.nextTick(o)}}Ll.exports=Ve;Ll.exports.express=function(e){return Ve(e,{expose:{use:"load"}})};var kb=Ll.exports;const zb=Ru(kb);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const o=n?window.performance.now():new Date().getTime(),i=Math.max(0,16-(o-t)),c=window.setTimeout(function(){l(o+i)},i);return t=o+i,c},window.cancelAnimationFrame=clearTimeout}})();function Kb(e,t=!0,n=!0,l={friendsTab:"enabled"}){const o=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",i=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",c=zb(Object.create({}),{autostart:!1});return c.use(Md,{hideFriends:l.hideFriends,skipOnboarding:l.skipOnboarding,betPack:l.betPack,friendsTab:l.friendsTab,theme:l.theme,themeMode:l.themeMode}),c.use(vd,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),c.use(Ld,{videoPlayerController:l==null?void 0:l.videoPlayerController}),c.use(xd,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),c.use(od,{sdkKey:e,host:o,analyticsHost:i,version:l==null?void 0:l.version,webOS:l==null?void 0:l.webOS}),c.use(rd),c.use(Kd),c.use(nu),c.use(Ud),c.use(bu),c.after((a,s,r)=>{if(a)throw a;s.ready(),r()}),n&&c.after(async(a,s,r)=>{if(a)throw a;await s.sdk.initializeApp(),r()}),c.onClose(()=>{console.log("close StreamLayer instance")}),c}const Lb=({sdkKey:e,plugins:t,production:n,autoEnable:l,onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:c,hideFriends:a,skipOnboarding:s,withAdNotification:r,withAd:u,friendsTab:V,betPack:R,webOS:g})=>{const[h,X]=oo.useState(null);return oo.useEffect(()=>{let p=!1;if(!e)return console.error("streamlayer sdk key should be provided"),X(A=>(A!==null&&typeof A.disableApp=="function"&&A.disableApp(),null)),()=>{p=!0};const W=Kb(e,n,l,{version:"1.21.2",onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:c,skipOnboarding:s,withAdNotification:r,withAd:u,hideFriends:a,friendsTab:V,betPack:R,webOS:g});if(t)for(const A of t)W.use(A);return W.ready().then(A=>{p||(X(A.sdk),typeof window<"u")}).catch(A=>console.log(A)),()=>{p=!0,W.close(function(A){if(A)throw A})}},[e,n]),h};exports.AdUnit=pe;exports.AutoPlayVideo=$s;exports.CloseTimerAuto=_s;exports.CtaIconMode=vs;exports.InvitationFrom=rl;exports.NotificationEnabled=sl;exports.NotificationPromotionImagePosition=Cs;exports.NotificationPromotionMode=Bs;exports.NotificationSponsorLogoMode=Ts;exports.NotificationUseContentMedia=Ds;exports.PickHistoryStatus=Tt;exports.PlayVideoMuted=tr;exports.PromotionButtonType=Ks;exports.PromotionLogoMode=ws;exports.PromotionType=T;exports.QuestionImages=Is;exports.QuestionStatus=ue;exports.QuestionType=f;exports.SdkOverlayType=O;exports.global=dl;exports.useStreamLayerApp=Lb;
|
|
16
|
+
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function Xb(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function ft(e,t,n,l,o){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=o===void 0?e._timeout:o,this.name=Gb(t,n),this.isAfter=l,this.q=hb(e,pb,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Zb(ft,Wb);ft.prototype.exec=function(e,t){const n=this.func;let l=!1;const o=this.name;if(this.parent._error&&!this.isAfter){be("skipping loading of plugin as parent errored and it is not an after",o),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(s){return be("override errored",o),t(s)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,be("exec",o);let i;const c=s=>{if(l){be("loading complete",o);return}this._error=s,be(s?"exec errored":"exec completed",o),l=!0,i&&clearTimeout(i),t(s)};this.timeout>0&&(be("setting up timeout",o,this.timeout),i=setTimeout(function(){be("timed out",o),i=null;const s=new Eb(o);s.fn=n,c(s)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const a=n(this.server,this.opts,c);a&&typeof a.then=="function"&&(be("exec: resolving promise",o),a.then(()=>B.nextTick(c),s=>B.nextTick(c,s)))};ft.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,l)=>{this._error=n,this.q.pause(),n?(be("rejecting promise",this.name,n),this._promise.reject(n)):(be("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(l,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=Xb(),t=this._promise.promise,this.server?e():this.on("start",e)),t};ft.prototype.enqueue=function(e,t){be("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};ft.prototype.finish=function(e,t){be("finish",this.name,e);const n=()=>{this.loaded||(be("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const l=()=>{if(be("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const o=()=>{be("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(o,o),this._promise=null}else n();else be("delayed",this.name),this.q.drain=()=>{be("drain",this.name),this.q.drain=yb,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function pb(e,t){const n=this;B.nextTick(eo.bind(n),e,t)}function eo(e,t){if(typeof e.func.then=="function"){e.func.then(l=>{typeof l.default=="function"&&(l=l.default),e.func=l,eo.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,l=>{e.finish(l,o=>{this._current.shift(),t(o)})})}function yb(){}$l.exports=ft;$l.exports.loadPlugin=eo;var Fb=$l.exports;const Ei=mc,Sb=yc.EventEmitter,Yb=Nn.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:$n,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:Nb,AVV_ERR_ROOT_PLG_BOOTED:Ib,AVV_ERR_READY_TIMEOUT:Ub}=Lc,Bb=Rb,pl=Fb,Ut=wc("avvio"),pn=Symbol("kAvvio"),el=Symbol("kThenifyDoNotWrap");function fb(e,t,n){const l=t.expose||{},o=l.use||"use",i=l.after||"after",c=l.ready||"ready",a=l.onClose||"onClose",s=l.close||"close";if(e[o])throw new $n(o);if(e[i])throw new $n(i);if(e[c])throw new $n(c);e[o]=function(r,u){return n.use(r,u),this},Object.defineProperty(e,"then",{get:xc.bind(n)}),e[pn]=!0,e[i]=function(r){return typeof r!="function"?n._loadRegistered():(n.after(tl(r,this)),this)},e[c]=function(r){if(r&&typeof r!="function")throw new zt(c,typeof r);return n.ready(r?tl(r,this):void 0)},e[a]=function(r){if(typeof r!="function")throw new zt(a,typeof r);return n.onClose(vb(r,this)),this},e[s]=function(r){if(r&&typeof r!="function")throw new zt(s,typeof r);return r?(n.close(tl(r,this)),this):n.close()}}function Ve(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof Ve)){const l=new Ve(e,t,n);return e&&fb(e,t,l),l}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new Bb,this._readyQ=Ei(this,Mc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Gi},this._closeQ=Ei(this,Qb,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Gi},this._doStart=null,this._root=new pl(this,Cb.bind(this),t,!1,0),this._root.once("start",(l,o,i)=>{const c=this.pluginTree.start(null,o,i);this._root.once("loaded",(a,s,r)=>{this.pluginTree.stop(c,r)})}),pl.loadPlugin.call(this,this._root,l=>{Ut("root plugin ready");try{this.emit("preReady"),this._root=null}catch(o){l=l||this._error||o}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function Cb(e,t,n){this._doStart=n,t.autostart&&this.start()}Yb(Ve,Sb);Ve.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};Ve.prototype.override=function(e,t,n){return e};function Jb(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new Nb(typeof e);return e}Ve.prototype[pn]=!0;Ve.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};Ve.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&B.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(Ve.prototype,"then",{get:xc});Ve.prototype._addPlugin=function(e,t,n){if(e=Jb(e),t=t||{},this.booted)throw new Ib;const l=this._current[0],o=new pl(this,e,t,n);if(o.once("start",(i,c,a)=>{const s=this.pluginTree.start(l.name,c,a);o.once("loaded",(r,u,V)=>{this.pluginTree.stop(s,V)})}),l.loaded)throw new Error(o.name,l.name);return l.enqueue(o,i=>{i&&(this._error=i)}),o};Ve.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,l,o){Mc.call(this,e,o)}return this};Ve.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};Ve.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,l){e=function(o){if(o)return l(o);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};Ve.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(o),this.start();const l=this._current[0].server;function o(i,c,a){i?n(i):t(l),B.nextTick(a)}})};Ve.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Ve.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Gi(){}function xc(){if(this.booted){Ut("thenify returning null because we are already booted");return}if(this[el]){this[el]=!1;return}return Ut("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[el]=!0,e(this._server)),t)}function Mc(e,t){const n=this._server,l=this._error;let o;if(this._error=null,e.length===0)this._error=l,o=e(),o&&!o[pn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(e.length===1)o=e(l),o&&!o[pn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(this._timeout===0){const i=c=>{this._error=c,t(this._error)};e.length===2?e(l,i):e(l,n,i)}else Tb.call(this,e,l,n,t)}function Tb(e,t,n,l){const o=e.name;Ut("setting up ready timeout",o,this._timeout);let i=setTimeout(()=>{Ut("timed out",o),i=null;const a=new Ub(o);a.fn=e,this._error=a,l(a)},this._timeout);e.length===2?e(t,c.bind(this)):e(t,n,c.bind(this));function c(a){i&&(clearTimeout(i),this._error=a,l(this._error))}}function Qb(e,t){const n=this._server,l=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let o;l?o=e(n):o=e(this._error),o&&typeof o.then=="function"?(Ut("resolving close/onClose promise"),o.then(()=>B.nextTick(t),i=>B.nextTick(t,i))):B.nextTick(t)}else e.length===2?e(l?n:this._error,t):l?e(n,t):e(this._error,n,t)}function vb(e,t){return n.bind(t);function n(l,o){let i;e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===1?(i=e(this),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e(this,o)}}function tl(e,t){return n.bind(t);function n(l,o){let i;e?e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o,l)},o):B.nextTick(o,l)):e.length===1?(i=e(l),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===2?e(l,o):e(l,this,o):B.nextTick(o)}}Ll.exports=Ve;Ll.exports.express=function(e){return Ve(e,{expose:{use:"load"}})};var kb=Ll.exports;const zb=Ru(kb);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const o=n?window.performance.now():new Date().getTime(),i=Math.max(0,16-(o-t)),c=window.setTimeout(function(){l(o+i)},i);return t=o+i,c},window.cancelAnimationFrame=clearTimeout}})();function Kb(e,t=!0,n=!0,l={friendsTab:"enabled"}){const o=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",i=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",c=zb(Object.create({}),{autostart:!1});return c.use(Md,{hideFriends:l.hideFriends,skipOnboarding:l.skipOnboarding,betPack:l.betPack,friendsTab:l.friendsTab,theme:l.theme,themeMode:l.themeMode}),c.use(vd,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),c.use(Ld,{videoPlayerController:l==null?void 0:l.videoPlayerController}),c.use(xd,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),c.use(od,{sdkKey:e,host:o,analyticsHost:i,version:l==null?void 0:l.version,webOS:l==null?void 0:l.webOS}),c.use(rd),c.use(Kd),c.use(nu),c.use(Ud),c.use(bu),c.after((a,s,r)=>{if(a)throw a;s.ready(),r()}),n&&c.after(async(a,s,r)=>{if(a)throw a;await s.sdk.initializeApp(),r()}),c.onClose(()=>{console.log("close StreamLayer instance")}),c}const Lb=({sdkKey:e,plugins:t,production:n,autoEnable:l,onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:c,hideFriends:a,skipOnboarding:s,withAdNotification:r,withAd:u,friendsTab:V,betPack:R,webOS:g})=>{const[h,X]=oo.useState(null);return oo.useEffect(()=>{let p=!1;if(!e)return console.error("streamlayer sdk key should be provided"),X(A=>(A!==null&&typeof A.disableApp=="function"&&A.disableApp(),null)),()=>{p=!0};const W=Kb(e,n,l,{version:"1.21.3",onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:c,skipOnboarding:s,withAdNotification:r,withAd:u,hideFriends:a,friendsTab:V,betPack:R,webOS:g});if(t)for(const A of t)W.use(A);return W.ready().then(A=>{p||(X(A.sdk),typeof window<"u")}).catch(A=>console.log(A)),()=>{p=!0,W.close(function(A){if(A)throw A})}},[e,n]),h};exports.AdUnit=pe;exports.AutoPlayVideo=$s;exports.CloseTimerAuto=_s;exports.CtaIconMode=vs;exports.InvitationFrom=rl;exports.NotificationEnabled=sl;exports.NotificationPromotionImagePosition=Cs;exports.NotificationPromotionMode=Bs;exports.NotificationSponsorLogoMode=Ts;exports.NotificationUseContentMedia=Ds;exports.PickHistoryStatus=Tt;exports.PlayVideoMuted=tr;exports.PromotionButtonType=Ks;exports.PromotionLogoMode=ws;exports.PromotionType=T;exports.QuestionImages=Is;exports.QuestionStatus=ue;exports.QuestionType=f;exports.SdkOverlayType=O;exports.global=dl;exports.useStreamLayerApp=Lb;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as Y, jsxs as pe, Fragment as to } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect as It, useState as Lo, useRef as wi, useCallback as nn } from "react";
|
|
3
|
-
import "nanostores";
|
|
4
3
|
import { n as ai, s as J, i as Ht, O as Fr, B as gm, q as fm, k as mm, e as bs, y as io, E as ym, r as _m, t as bm, u as Tm, c as vm, d as Sm, a as Ni, h as Em } from "./provider.js";
|
|
4
|
+
import "nanostores";
|
|
5
5
|
import "lodash.throttle";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
import "react-countup";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as u, jsxs as p } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as l, useEffect as h } from "react";
|
|
3
|
-
import "nanostores";
|
|
4
3
|
import { e as m, s as f, T as S, u as I, d as g, h as v, a as k } from "./provider.js";
|
|
4
|
+
import "nanostores";
|
|
5
5
|
import "lodash.throttle";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
import "react-countup";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as l, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { useState as w, useRef as _, useEffect as y, useCallback as As, useMemo as hs } from "react";
|
|
3
|
-
import "nanostores";
|
|
4
3
|
import { s as n, B as A, D as Is, v as $s, x as K, w as G, z as gs, E as ws, O as x, y as ys, f as Ts, e as bs, i as Cs, N as O, u as fs, d as ks, c as Ns, h as qs } from "./provider.js";
|
|
4
|
+
import "nanostores";
|
|
5
5
|
import "lodash.throttle";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
import "react-countup";
|
package/lib/classic/es/points.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u, useEffect as d } from "react";
|
|
3
|
-
import "nanostores";
|
|
4
3
|
import { s as a, B as y, m as h, f as S, e as f, F as c, i as r, u as v, d as g, h as k } from "./provider.js";
|
|
4
|
+
import "nanostores";
|
|
5
5
|
import "lodash.throttle";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
import "react-countup";
|
|
@@ -3,7 +3,7 @@ var M7 = (e, t, n) => t in e ? k7(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var p1 = (e, t, n) => M7(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { jsx as a, jsxs as g, Fragment as d1 } from "react/jsx-runtime";
|
|
5
5
|
import * as d from "react";
|
|
6
|
-
import
|
|
6
|
+
import F1, { useState as Z, useEffect as j, useRef as l1, createContext as E6, useContext as Q1, useCallback as o1, useMemo as f1, useLayoutEffect as A6, forwardRef as k3, memo as V7, Component as F7, createElement as O7, PureComponent as N7, lazy as H7, Suspense as D7 } from "react";
|
|
7
7
|
import { S as E1, h as S, k as q7, Q as K1, i as r2, A as T6, f as B7, e as w3, I as R6, l as P7, m as A2, u as Z7 } from "./useStreamLayerApp2.js";
|
|
8
8
|
import { listenKeys as K7 } from "nanostores";
|
|
9
9
|
import { pino as U7 } from "pino";
|
|
@@ -247,8 +247,8 @@ function c5(e) {
|
|
|
247
247
|
f[R] = y[R];
|
|
248
248
|
}), C.style = f;
|
|
249
249
|
}
|
|
250
|
-
return e.__wyw_meta && e !== l ? (C.as = l,
|
|
251
|
-
}, i =
|
|
250
|
+
return e.__wyw_meta && e !== l ? (C.as = l, F1.createElement(e, C)) : F1.createElement(l, C);
|
|
251
|
+
}, i = F1.forwardRef ? F1.forwardRef(r) : (
|
|
252
252
|
// React.forwardRef won't available on older React versions and in Preact
|
|
253
253
|
// Fallback to a innerRef prop in that case
|
|
254
254
|
(s) => {
|
|
@@ -310,7 +310,7 @@ var m2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
310
310
|
* This source code is licensed under the MIT license found in the
|
|
311
311
|
* LICENSE file in the root directory of this source tree.
|
|
312
312
|
*/
|
|
313
|
-
var a2 =
|
|
313
|
+
var a2 = F1;
|
|
314
314
|
function w5(e, t) {
|
|
315
315
|
return e === t && (e !== 0 || 1 / e === 1 / t) || e !== e && t !== t;
|
|
316
316
|
}
|
|
@@ -352,17 +352,17 @@ const Y2 = (e, t) => (n) => {
|
|
|
352
352
|
e.current !== n && (e.current = n, t());
|
|
353
353
|
};
|
|
354
354
|
function $5(e, { keys: t, deps: n = [e, t] } = {}) {
|
|
355
|
-
const r =
|
|
355
|
+
const r = F1.useRef();
|
|
356
356
|
r.current = e.get();
|
|
357
|
-
const i =
|
|
358
|
-
return
|
|
357
|
+
const i = F1.useCallback((o) => (Y2(r, o)(e.value), (t == null ? void 0 : t.length) > 0 ? K7(e, t, Y2(r, o)) : e.listen(Y2(r, o))), n), s = () => r.current;
|
|
358
|
+
return F1.useSyncExternalStore ? F1.useSyncExternalStore(i, s, s) : x5.useSyncExternalStore(i, s, s);
|
|
359
359
|
}
|
|
360
360
|
const J = $5, S5 = () => [
|
|
361
361
|
!1,
|
|
362
362
|
(e) => {
|
|
363
363
|
window.requestAnimationFrame(() => e());
|
|
364
364
|
}
|
|
365
|
-
], k5 =
|
|
365
|
+
], k5 = F1.useTransition || S5, M5 = (e) => {
|
|
366
366
|
const t = J(e.getActiveFeature()), n = J(e.streamStore()), [r, i] = Z(null);
|
|
367
367
|
return j(() => {
|
|
368
368
|
const s = e.getFeatures();
|
|
@@ -2519,7 +2519,7 @@ function ls() {
|
|
|
2519
2519
|
}
|
|
2520
2520
|
(function(e, t) {
|
|
2521
2521
|
(function(n, r) {
|
|
2522
|
-
e.exports = r(q6(), Or(), U9(), z9(), W9(), Y9(), X9(), J9(), as(), os(), ls(),
|
|
2522
|
+
e.exports = r(q6(), Or(), U9(), z9(), W9(), Y9(), X9(), J9(), as(), os(), ls(), F1);
|
|
2523
2523
|
})(m2, function(n, r, i, s, o, l, u, p, C, v, f, y) {
|
|
2524
2524
|
return function() {
|
|
2525
2525
|
var A = { 654: function(L, m, w) {
|
|
@@ -2593,8 +2593,8 @@ function ls() {
|
|
|
2593
2593
|
return Math.abs(G - n1);
|
|
2594
2594
|
}
|
|
2595
2595
|
if (x === "edges") {
|
|
2596
|
-
var b1 = Math.min(X, Q), c1 = Math.min(z, u1), $1 = Math.max(X, Q), B1 = Math.max(z, u1),
|
|
2597
|
-
return Math.min(
|
|
2596
|
+
var b1 = Math.min(X, Q), c1 = Math.min(z, u1), $1 = Math.max(X, Q), B1 = Math.max(z, u1), O1 = Math.abs(b1 - c1), S1 = Math.abs($1 - B1);
|
|
2597
|
+
return Math.min(O1, S1);
|
|
2598
2598
|
}
|
|
2599
2599
|
var C2 = [Math.abs(z - X), Math.abs(z - Q), Math.abs(u1 - X), Math.abs(u1 - Q)];
|
|
2600
2600
|
return Math.min.apply(Math, C2);
|
|
@@ -2605,8 +2605,8 @@ function ls() {
|
|
|
2605
2605
|
return F.log("smartNavigate", "distance (primary, secondary, total weighted) for ".concat(U.focusKey, " relative to ").concat(x, " is"), z, u1, G), F.log("smartNavigate", "priority for ".concat(U.focusKey, " relative to ").concat(x, " is"), n1), F.visualDebugger && (F.visualDebugger.drawPoint(t1.a.x, t1.a.y, "yellow", 6), F.visualDebugger.drawPoint(t1.b.x, t1.b.y, "yellow", 6)), n1;
|
|
2606
2606
|
});
|
|
2607
2607
|
}, T.prototype.init = function(h) {
|
|
2608
|
-
var b = this, I = h === void 0 ? {} : h, x = I.debug, F = x !== void 0 && x, q = I.visualDebug, B = q !== void 0 && q, U = I.nativeMode, t1 = U !== void 0 && U, e1 = I.throttle, X = e1 === void 0 ? 0 : e1, Q = I.throttleKeypresses, z = Q !== void 0 && Q, u1 = I.useGetBoundingClientRect, G = u1 !== void 0 && u1, n1 = I.shouldFocusDOMNode, b1 = n1 !== void 0 && n1, c1 = I.domNodeFocusOptions, $1 = c1 === void 0 ? {} : c1, B1 = I.shouldUseNativeEvents,
|
|
2609
|
-
if (!this.enabled && (this.domNodeFocusOptions = $1, this.enabled = !0, this.nativeMode = t1, this.throttleKeypresses = z, this.useGetBoundingClientRect = G, this.shouldFocusDOMNode = b1 && !t1, this.shouldUseNativeEvents =
|
|
2608
|
+
var b = this, I = h === void 0 ? {} : h, x = I.debug, F = x !== void 0 && x, q = I.visualDebug, B = q !== void 0 && q, U = I.nativeMode, t1 = U !== void 0 && U, e1 = I.throttle, X = e1 === void 0 ? 0 : e1, Q = I.throttleKeypresses, z = Q !== void 0 && Q, u1 = I.useGetBoundingClientRect, G = u1 !== void 0 && u1, n1 = I.shouldFocusDOMNode, b1 = n1 !== void 0 && n1, c1 = I.domNodeFocusOptions, $1 = c1 === void 0 ? {} : c1, B1 = I.shouldUseNativeEvents, O1 = B1 !== void 0 && B1, S1 = I.rtl, C2 = S1 !== void 0 && S1, h1 = I.distanceCalculationMethod, _1 = h1 === void 0 ? "corners" : h1, it = I.customDistanceCalculationFunction, $7 = it === void 0 ? void 0 : it;
|
|
2609
|
+
if (!this.enabled && (this.domNodeFocusOptions = $1, this.enabled = !0, this.nativeMode = t1, this.throttleKeypresses = z, this.useGetBoundingClientRect = G, this.shouldFocusDOMNode = b1 && !t1, this.shouldUseNativeEvents = O1, this.writingDirection = C2 ? C1.default.RTL : C1.default.LTR, this.distanceCalculationMethod = _1, this.customDistanceCalculationFunction = $7, this.debug = F, !this.nativeMode && (Number.isInteger(X) && X > 0 && (this.throttle = X), this.bindEventHandlers(), B))) {
|
|
2610
2610
|
this.visualDebugger = new I1.default(this.writingDirection);
|
|
2611
2611
|
var st = function() {
|
|
2612
2612
|
requestAnimationFrame(function() {
|
|
@@ -2758,12 +2758,12 @@ function ls() {
|
|
|
2758
2758
|
var b = h.focusKey, I = h.node, x = h.parentFocusKey, F = h.onEnterPress, q = h.onEnterRelease, B = h.onArrowPress, U = h.onArrowRelease, t1 = h.onFocus, e1 = h.onBlur, X = h.saveLastFocusedChild, Q = h.trackChildren, z = h.onUpdateFocus, u1 = h.onUpdateHasFocusedChild, G = h.preferredChildFocusKey, n1 = h.autoRestoreFocus, b1 = h.forceFocus, c1 = h.focusable, $1 = h.isFocusBoundary, B1 = h.focusBoundaryDirections;
|
|
2759
2759
|
if (this.focusableComponents[b] = { focusKey: b, node: I, parentFocusKey: x, onEnterPress: F, onEnterRelease: q, onArrowPress: B, onArrowRelease: U, onFocus: t1, onBlur: e1, onUpdateFocus: z, onUpdateHasFocusedChild: u1, saveLastFocusedChild: X, trackChildren: Q, preferredChildFocusKey: G, focusable: c1, isFocusBoundary: $1, focusBoundaryDirections: B1, autoRestoreFocus: n1, forceFocus: b1, lastFocusedChildKey: null, layout: { x: 0, y: 0, width: 0, height: 0, left: 0, top: 0, right: 0, bottom: 0, node: I }, layoutUpdated: !1 }, I || console.warn('Component added without a node reference. This will result in its coordinates being empty and may cause lost focus. Check the "ref" passed to "useFocusable": ', this.focusableComponents[b]), !this.nativeMode) {
|
|
2760
2760
|
this.updateLayout(b), this.log("addFocusable", "Component added: ", this.focusableComponents[b]), b === this.focusKey && this.setFocus(G || b);
|
|
2761
|
-
for (var
|
|
2762
|
-
if (
|
|
2761
|
+
for (var O1 = this.focusableComponents[this.focusKey]; O1; ) {
|
|
2762
|
+
if (O1.parentFocusKey === b) {
|
|
2763
2763
|
this.updateParentsHasFocusedChild(this.focusKey, {}), this.updateParentsLastFocusedChild(this.focusKey);
|
|
2764
2764
|
break;
|
|
2765
2765
|
}
|
|
2766
|
-
|
|
2766
|
+
O1 = this.focusableComponents[O1.parentFocusKey];
|
|
2767
2767
|
}
|
|
2768
2768
|
}
|
|
2769
2769
|
}, T.prototype.removeFocusable = function(h) {
|
|
@@ -2970,14 +2970,14 @@ function ls() {
|
|
|
2970
2970
|
x(h1, B, _1);
|
|
2971
2971
|
}, [B, x]), z = (0, _.useCallback)(function(h1, _1) {
|
|
2972
2972
|
q(h1, B, _1);
|
|
2973
|
-
}, [B, q]), u1 = (0, _.useRef)(null), G = (0, _.useState)(!1), n1 = G[0], b1 = G[1], c1 = (0, _.useState)(!1), $1 = c1[0], B1 = c1[1],
|
|
2973
|
+
}, [B, q]), u1 = (0, _.useRef)(null), G = (0, _.useState)(!1), n1 = G[0], b1 = G[1], c1 = (0, _.useState)(!1), $1 = c1[0], B1 = c1[1], O1 = (0, H.useFocusContext)(), S1 = (0, _.useMemo)(function() {
|
|
2974
2974
|
return x1 || (0, k.default)("sn:focusable-item-");
|
|
2975
2975
|
}, [x1]), C2 = (0, _.useCallback)(function(h1) {
|
|
2976
2976
|
h1 === void 0 && (h1 = {}), V.SpatialNavigation.setFocus(S1, h1);
|
|
2977
2977
|
}, [S1]);
|
|
2978
2978
|
return (0, _.useEffect)(function() {
|
|
2979
2979
|
var h1 = u1.current;
|
|
2980
|
-
return V.SpatialNavigation.addFocusable({ focusKey: S1, node: h1, parentFocusKey:
|
|
2980
|
+
return V.SpatialNavigation.addFocusable({ focusKey: S1, node: h1, parentFocusKey: O1, preferredChildFocusKey: Y, onEnterPress: U, onEnterRelease: t1, onArrowPress: e1, onArrowRelease: X, onFocus: Q, onBlur: z, onUpdateFocus: function(_1) {
|
|
2981
2981
|
return _1 === void 0 && (_1 = !1), b1(_1);
|
|
2982
2982
|
}, onUpdateHasFocusedChild: function(_1) {
|
|
2983
2983
|
return _1 === void 0 && (_1 = !1), B1(_1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),e=require("./masters.js"),u=require("react");require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),e=require("./masters.js"),u=require("react");require("react-countdown-circle-timer");require("react-dom");require("react-countup");require("nanostores");require("lodash.throttle");const A=require("react-infinite-scroller"),S=(t,a,r)=>{const n=a>=e.A.lg&&a<e.A.xl?75:52;t.current&&window.scrollTo({top:t.current.offsetTop-n,...r})},k=e.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),C=e.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),_=e.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),$=e.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var h=(t=>(t.HOME="home",t.LEADERBOARD="leaderboard",t))(h||{});const y=({title:t,active:a,onClick:r})=>s.jsx(_,{"data-a":"intr",onClick:r,"data-selected":a,children:s.jsx($,{"data-a":"intr",children:t})}),N=({activePage:t="home",toggleActivePage:a})=>s.jsx(k,{children:s.jsxs(C,{"data-position":t==="home"?"left":"right",children:[s.jsx(y,{title:"Home",active:t==="home",onClick:()=>a("home")}),s.jsx(y,{title:"Friends",active:t==="leaderboard",onClick:()=>a("leaderboard")})]})}),w=e.styled_default("div")({name:"Container",class:"c1ux29ft",propsAsIs:!1}),M=()=>e.B1,q=e.styled_default(M())({name:"FriendsIcon",class:"f10ncfg2",propsAsIs:!0}),T=e.styled_default("div")({name:"Content",class:"c1yc07bd",propsAsIs:!1}),D=e.styled_default("div")({name:"Title",class:"tj6cq7w",propsAsIs:!1}),E=e.styled_default("div")({name:"Description",class:"d1ag78xo",propsAsIs:!1}),L=()=>e.B1,R=e.styled_default(L())({name:"ArrowInviteIcon",class:"awohrz6",propsAsIs:!0}),P=({title:t,description:a,onClick:r,className:n})=>{const[o]=e.f({type:"invitation",action:"sent",payload:{from:e.InvitationFrom.TITLE_CARD}});return s.jsxs(w,{"data-a":"intr",onClick:o(r),className:n,children:[s.jsx(q,{name:"icon-friends"}),s.jsxs(T,{children:[s.jsx(D,{children:t}),s.jsx(E,{children:a})]}),s.jsx(R,{name:"icon-copy"})]})},F=e.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),B=e.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),O=e.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),U=e.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),z=e.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),H=e.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),V=e.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Q=()=>e.B1,K=e.styled_default(Q())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),W=({friendsRank:t,avatar:a,name:r,userId:n,points:o,isCurrentUser:l,style:c})=>s.jsxs(F,{"data-name":n,style:c,children:[s.jsx(B,{children:t||0}),s.jsxs(z,{children:[a?s.jsx(O,{alt:"leaderboard-item-avatar",src:a}):s.jsx(U,{children:e.I(r||"")}),s.jsxs(H,{children:[s.jsx(V,{children:r||""}),l&&s.jsx(K,{name:"icon-star"})]})]}),s.jsx("div",{children:e.s(o)})]}),G=e.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),J=({items:t,currentUserId:a,openItemDetail:r,fetchMore:n,scrollNode:o,hasMore:l})=>{const c=u.useCallback(i=>{const d=i.target.getAttribute("data-name");d&&r(d)},[r]);return s.jsx(A,{loadMore:n,initialLoad:!1,hasMore:l,useWindow:!1,getScrollParent:()=>o.current,children:s.jsx(G,{"data-a":"intr",onClick:c,children:t.map(i=>s.jsx(W,{...i,isCurrentUser:!!a&&a===i.userId},i.userId))})})},X=e.styled_default("div")({name:"InviteFriendsContainer",class:"i1c9dygq",propsAsIs:!1}),Y=({deepLink:t})=>s.jsx(X,{children:s.jsx(e.M,{inviteLink:t,inviteCardTitle:"It’s More Fun With Friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})}),Z=e.styled_default("div")({name:"InviteLinkContainer",class:"i1odbhm4",propsAsIs:!1}),ee=({gamification:t,scrollNode:a,scrollStore:r})=>{const n=u.useRef(null),{data:o,hasMore:l,loading:c,key:i}=e.useStore(t.leaderboardList.$store),{data:d}=e.useStore(t.deepLink.$store),[p,f]=e.T(n);return!o.length&&!c?s.jsx(Y,{deepLink:d}):s.jsxs(s.Fragment,{children:[s.jsx(J,{items:o,scrollNode:a,scrollStore:r,fetchMore:t.leaderboardList.fetchMore,hasMore:l,openItemDetail:t.openUser,currentUserId:t.currentUserId.get()},i),d&&s.jsx(Z,{ref:n,children:s.jsx(P,{"data-a":"intr",onClick:()=>p(d),title:"Invite Friends",description:"Challenge them now!"})}),f]})},se=({store:t,openQuestion:a})=>{const{sdk:r}=e.p(),n=e.useStore(t);return s.jsx(e.k,{openQuestion:a,questions:n.data,controlVideo:r==null?void 0:r.controlVideoPlayer})},te=({userSummary:t})=>{var a;const[r,n]=u.useState(void 0);return u.useEffect(()=>{const o=t.$store.subscribe(l=>{l&&n(l)});return()=>{o()}},[t]),s.jsx(e.z,{loading:!(r!=null&&r.summary),...r==null?void 0:r.summary,successRate:(a=r==null?void 0:r.percentage)==null?void 0:a.correct})},re=({gamification:t,className:a,scrollStore:r,scrollNode:n,appNode:o,style:l,responsiveStore:c})=>{const{tabsShown:i}=e.useStore(r,{keys:["tabsShown"]}),d=e.useStore(t.friendsTabEnabled),[p,f]=u.useState(h.HOME),[,I]=e.useTransition(),{sdkInDesktopView:v,screen:g}=e.useStore(c,{keys:["sdkInDesktopView"]}),b=m=>{I(()=>{var j;f(m),v===!1&&(((j=o.current)==null?void 0:j.getBoundingClientRect().y)||0)<0&&S(o,g.size,{behavior:"instant"})})};u.useEffect(()=>r.subscribe(m=>{if(m.scrollPosition===0){r.setKey("tabsShown",!0);return}c.get().sdkInDesktopView?r.setKey("tabsShown",m.scrollDirection==="backward"):r.setKey("tabsShown",m.scrollDirection==="forward")}),[r,c]),u.useEffect(()=>{d||f(h.HOME)},[d]);let x="0px";return v?x=i?"0px":"calc(0px - var(--header-height))":x=i?"var(--header-height)":"0px",s.jsxs(e.l,{className:e.cx_default(a,"SL-Tabs","sl-hide-on-modal"),style:l,children:[d&&s.jsx(e.S,{style:{top:x},children:s.jsx(N,{activePage:p,toggleActivePage:b})}),p===h.HOME&&s.jsxs(s.Fragment,{children:[s.jsx(e.m,{children:s.jsx(e.d,{children:s.jsx(te,{userSummary:t.userSummary})})}),s.jsx(e.n,{style:{flex:1},children:s.jsx(se,{openQuestion:t.openQuestion,store:t.feedList.getStore()})})]}),p===h.LEADERBOARD&&s.jsx(e.C$1,{children:s.jsx(ee,{scrollStore:r,scrollNode:n,gamification:t})})]})},ae=({gamification:t,scrollStore:a,className:r,appNode:n,scrollNode:o,responsiveStore:l})=>s.jsx(re,{appNode:n,scrollStore:a,scrollNode:o,className:r,gamification:t,responsiveStore:l});exports.default=ae;
|
package/lib/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("lodash.throttle");require("react");
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("lodash.throttle");require("react");const e=require("./masters.js");require("nanostores");require("react-dom");require("react-countup");exports.BetPackStandalone=e.BetPackStandalone;exports.MastersStreamLayerProvider=e.MastersStreamLayerProvider;exports.MastersStreamLayerSDKReact=e.MastersStreamLayerSDKReact;exports.StreamLayerLogin=e.StreamLayerLogin;exports.StreamLayerSDKPoints=e.StreamLayerSDKPoints;exports.useStreamLayer=e.useStreamLayer;
|