@streamlayer/react 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/lib/app/app.d.ts +1 -0
  2. package/lib/app/masters.d.ts +11 -18
  3. package/lib/app/provider.d.ts +2 -0
  4. package/lib/app/useStreamLayerApp.d.ts +3 -1
  5. package/lib/cjs/advertisement.js +1 -1
  6. package/lib/cjs/bet-pack.js +1 -1
  7. package/lib/cjs/gamification-feature2.js +1 -1
  8. package/lib/cjs/index2.js +6 -2
  9. package/lib/cjs/masters.js +1 -1
  10. package/lib/cjs/masters2.js +3 -3
  11. package/lib/cjs/notification.js +1 -1
  12. package/lib/cjs/points.js +1 -1
  13. package/lib/cjs/provider.js +28 -162
  14. package/lib/cjs/useStreamLayerApp2.js +9 -9
  15. package/lib/classic/app/app.d.ts +1 -0
  16. package/lib/classic/app/masters.d.ts +11 -18
  17. package/lib/classic/app/provider.d.ts +2 -0
  18. package/lib/classic/app/useStreamLayerApp.d.ts +3 -1
  19. package/lib/classic/cjs/advertisement.js +1 -1
  20. package/lib/classic/cjs/bet-pack.js +1 -1
  21. package/lib/classic/cjs/gamification-feature2.js +1 -1
  22. package/lib/classic/cjs/index2.js +6 -2
  23. package/lib/classic/cjs/masters.js +1 -1
  24. package/lib/classic/cjs/masters2.js +3 -3
  25. package/lib/classic/cjs/notification.js +1 -1
  26. package/lib/classic/cjs/points.js +1 -1
  27. package/lib/classic/cjs/provider.js +28 -162
  28. package/lib/classic/cjs/useStreamLayerApp2.js +9 -9
  29. package/lib/classic/es/advertisement.js +30 -30
  30. package/lib/classic/es/bet-pack.js +1 -1
  31. package/lib/classic/es/gamification-feature2.js +1 -1
  32. package/lib/classic/es/index.js +1 -1
  33. package/lib/classic/es/index2.js +1160 -1055
  34. package/lib/classic/es/masters.js +5 -4
  35. package/lib/classic/es/masters2.js +467 -580
  36. package/lib/classic/es/notification.js +42 -42
  37. package/lib/classic/es/points.js +5 -5
  38. package/lib/classic/es/provider.js +8535 -22157
  39. package/lib/classic/es/useStreamLayerApp2.js +2321 -2232
  40. package/lib/classic/style.css +1 -1
  41. package/lib/dist/cjs/gamification-feature.js +1 -1
  42. package/lib/dist/cjs/gamification-feature2.js +1 -1
  43. package/lib/dist/cjs/index.js +1 -1
  44. package/lib/dist/cjs/masters.js +53 -183
  45. package/lib/dist/es/gamification-feature.js +1 -1
  46. package/lib/dist/es/gamification-feature2.js +231 -77
  47. package/lib/dist/es/index.js +3 -2
  48. package/lib/dist/es/masters.js +19314 -32998
  49. package/lib/dist/style.css +1 -1
  50. package/lib/es/advertisement.js +30 -30
  51. package/lib/es/bet-pack.js +1 -1
  52. package/lib/es/gamification-feature2.js +1 -1
  53. package/lib/es/index.js +1 -1
  54. package/lib/es/index2.js +1160 -1055
  55. package/lib/es/masters.js +5 -4
  56. package/lib/es/masters2.js +467 -580
  57. package/lib/es/notification.js +42 -42
  58. package/lib/es/points.js +5 -5
  59. package/lib/es/provider.js +8524 -22146
  60. package/lib/es/useStreamLayerApp2.js +2321 -2232
  61. package/lib/style.css +1 -1
  62. package/package.json +17 -15
package/lib/app/app.d.ts CHANGED
@@ -10,6 +10,7 @@ export declare const useStreamLayerUI: () => {
10
10
  promotionBanner?: boolean;
11
11
  app?: boolean;
12
12
  appNotification?: boolean;
13
+ onboardingNotification?: boolean;
13
14
  };
14
15
  export declare const StreamLayerSDKReact: React.FC<{
15
16
  event?: string;
@@ -1,28 +1,21 @@
1
- import { Component } from 'react';
1
+ import { Component, ErrorInfo } from 'react';
2
2
  import { StreamLayerProps } from './provider';
3
3
  import '@streamlayer/react-ui/style.css';
4
- export declare const MastersStreamLayerProvider: React.FC<Omit<StreamLayerProps, 'autoEnable'> & {
4
+ export { useStreamLayer } from './app';
5
+ export declare const MastersStreamLayerProvider: React.FC<Omit<StreamLayerProps, 'autoEnable' | 'friendsTab' | 'hideFriends'> & {
5
6
  children: React.ReactNode;
6
7
  }>;
7
- type Overlays = {
8
- leaderboard: React.ReactNode;
9
- };
10
- type MastersAppChildrenProps = {
11
- activateEventWithId: (event: string) => void;
12
- deactivate: () => void;
13
- };
14
- type MastersAppProps = {
15
- overlays?: Overlays;
16
- children: (methods: MastersAppChildrenProps) => React.ReactNode;
17
- };
18
- export declare class MastersStreamLayerSDKReact extends Component<MastersAppProps, {
8
+ export declare class MastersStreamLayerSDKReact extends Component<{
9
+ betPack?: boolean;
10
+ }, {
19
11
  hasError: boolean;
20
12
  }> {
21
- constructor(props: MastersAppProps);
13
+ constructor(props: {
14
+ betPack?: boolean;
15
+ });
22
16
  static getDerivedStateFromError(): {
23
17
  hasError: boolean;
24
18
  };
25
- componentDidCatch(error: any, info: any): void;
26
- render(): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import('react').ReactNode> | null | undefined;
19
+ componentDidCatch(error: Error, info: ErrorInfo): void;
20
+ render(): import("react/jsx-runtime").JSX.Element | null;
27
21
  }
28
- export {};
@@ -35,9 +35,11 @@ export type StreamLayerProps = {
35
35
  theme?: string;
36
36
  withAdNotification?: boolean;
37
37
  withAd?: boolean;
38
+ hideFriends?: boolean;
38
39
  friendsTab?: 'enabled' | 'disabled' | 'activatedGame';
39
40
  themeMode?: 'light' | 'dark';
40
41
  };
41
42
  export declare const StreamLayerProvider: React.FC<StreamLayerProps & {
42
43
  children: React.ReactNode;
44
+ skipOnboarding?: boolean;
43
45
  }>;
@@ -5,7 +5,7 @@ declare global {
5
5
  sl: unknown;
6
6
  }
7
7
  }
8
- export declare const useStreamLayerApp: ({ sdkKey, plugins, production, autoEnable, onDeepLinkHandled, videoPlayerController, onContentActivate, withAdNotification, withAd, friendsTab, }: {
8
+ export declare const useStreamLayerApp: ({ sdkKey, plugins, production, autoEnable, onDeepLinkHandled, videoPlayerController, onContentActivate, hideFriends, skipOnboarding, withAdNotification, withAd, friendsTab, }: {
9
9
  sdkKey: string;
10
10
  plugins?: Set<StreamLayerPlugin>;
11
11
  production?: boolean;
@@ -13,7 +13,9 @@ export declare const useStreamLayerApp: ({ sdkKey, plugins, production, autoEnab
13
13
  onDeepLinkHandled?: DeepLinkCallback;
14
14
  videoPlayerController?: VideoPlayerCallback;
15
15
  onContentActivate?: OnContentActivateCallback;
16
+ skipOnboarding?: boolean;
16
17
  withAdNotification?: boolean;
18
+ hideFriends?: boolean;
17
19
  withAd?: boolean;
18
20
  friendsTab: "enabled" | "disabled" | "activatedGame";
19
21
  }) => StreamLayerSDK | null;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),g=require("react"),t=require("./provider.js"),u=require("./useStreamLayerApp2.js"),pe=t.styled_default("div")({name:"Container",class:"c5b6wdg",propsAsIs:!1}),ye="a1rlj479",ve="s35f1di",fe="sj4471g",Ae="b12050d8",ge="b1d5ybek",Ie=e=>e==="left"||e==="right"?ve:Ae,he=e=>e==="left"||e==="right"?fe:ge,xe=e=>e==="left"?"avdxyl3":e==="right"?"a1bisd08":e==="top"?"a1u9y2aj":"a1qqaks",B=({children:e,style:s,className:l,enabled:n=!0,hiding:r,direction:a="left",onAnimationEnd:c})=>o.jsx(pe,{style:s,className:t.cx_default(l,ye,xe(a),n&&!r&&Ie(a),n&&r&&he(a)),onAnimationEnd:c,children:e}),je=t.styled_default("a")({name:"Link",class:"l1sgte8c",propsAsIs:!1}),_e=t.styled_default("div")({name:"BannerContainer",class:"b7yfc72",propsAsIs:!1}),be=()=>je,Ne=t.styled_default(be())({name:"BannerLink",class:"bejjq94",propsAsIs:!0}),Pe=({promotion:e,promotionId:s,hiding:l,direction:n="bottom"})=>{var r,a;if(!((r=e.additionalBanner)!=null&&r.imageUrl))return null;let c=(a=e.additionalBanner)==null?void 0:a.url;return c&&c.indexOf("http")!==0&&(c=`https://${c}`),o.jsx(B,{direction:n,hiding:l,children:o.jsx(_e,{className:"BannerContainer",children:o.jsx(Ne,{as:c?"a":"span",className:"BannerLink",href:c,style:{backgroundImage:`url(${e.additionalBanner.imageUrl})`,cursor:c?"pointer":"default"},"data-promo-id":s,"data-promo-type":e.type,"data-analytics":"banner",target:"_blank"})})})},Se=t.styled_default("div")({name:"NotificationContent",class:"n18wsqoo",propsAsIs:!1}),Te=t.styled_default("div")({name:"Body",class:"b1ia90c2",propsAsIs:!1}),Ee=t.styled_default("div")({name:"Title",class:"tg2z08v",propsAsIs:!1}),$e=t.styled_default("div")({name:"Text",class:"t59zdk1",propsAsIs:!1}),R=t.styled_default("div")({name:"MediaImgBottom",class:"m1ab9fq",propsAsIs:!1}),Ce=()=>R,Le=t.styled_default(Ce())({name:"MediaImgMiddle",class:"m9fsr0y",propsAsIs:!0}),Me=t.styled_default("img")({name:"CtaIcon",class:"cvi9y5q",propsAsIs:!1}),ke=t.styled_default("button")({name:"Button",class:"bgl6boa",propsAsIs:!1}),Oe=t.styled_default("div")({name:"Logo",class:"l5mq0z",propsAsIs:!1}),Be=t.styled_default("div")({name:"Footer",class:"f1mse0ft",propsAsIs:!1}),Re=t.styled_default("div")({name:"Vector",class:"v1hcloah",propsAsIs:!1}),De=t.styled_default("div")({name:"NotificationContainer",class:"n3n65jf",propsAsIs:!1}),qe={[u.NotificationPromotionImagePosition.BOTTOM]:R,[u.NotificationPromotionImagePosition.MIDDLE]:Le},we=({src:e,imagePosition:s})=>{const l=qe[s]||R;return o.jsx(l,{children:o.jsx("img",{src:e,alt:""})})},Ve=({notification:e,open:s})=>{if(!e||!e.promotion||e.enabled!==u.NotificationEnabled.NOTIFICATION_ENABLED)return null;const{title:l,body:n,image:r,promotion:a}=e,{sponsorLogo:c,sponsorLogoMode:p,imagePosition:v,ctaButton:i}=a;return o.jsxs(De,{className:"SL_Lower_Third_Notification",onClick:s,children:[o.jsxs(Se,{children:[o.jsx(we,{src:r,imagePosition:v}),o.jsxs(Te,{children:[l&&o.jsx(Ee,{children:l}),n&&o.jsx($e,{children:n})]})]}),o.jsxs(Be,{children:[p!==u.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&o.jsxs(o.Fragment,{children:[o.jsx(Oe,{children:o.jsx("img",{src:c,alt:l})}),o.jsx(Re,{})]}),o.jsxs(ke,{name:"promo-button",style:{color:i==null?void 0:i.textColor,backgroundColor:i==null?void 0:i.color},children:[(i==null?void 0:i.ctaIcon)&&(i==null?void 0:i.ctaIconMode)===u.CtaIconMode.CTA_ICON_TRANSPARENT&&o.jsx(Me,{src:i==null?void 0:i.ctaIcon,alt:"cta-icon"}),(i==null?void 0:i.label)||"Open"]})]})]})},Fe=t.styled_default("div")({name:"NotificationContent",class:"n1ku6hz",propsAsIs:!1}),Ue=t.styled_default("div")({name:"NotificationContainer",class:"nbxqmol",propsAsIs:!1}),ze=t.styled_default("div")({name:"Body",class:"b1gu3eml",propsAsIs:!1}),Ge=t.styled_default("div")({name:"Title",class:"t1u17zva",propsAsIs:!1}),Ke=t.styled_default("div")({name:"Text",class:"t10ko1g",propsAsIs:!1}),C=t.styled_default("div")({name:"Media",class:"mntc42e",propsAsIs:!1}),We=()=>C,Z=t.styled_default(We())({name:"MediaImgFit",class:"ml060eo",propsAsIs:!0}),He=()=>C,te=t.styled_default(He())({name:"MediaImgCentered",class:"m1vqlvig",propsAsIs:!0}),Ye=()=>te,Je=t.styled_default(Ye())({name:"MediaImgBottom",class:"m1e7tvi5",propsAsIs:!0}),Ze=()=>C,Qe=t.styled_default(Ze())({name:"MediaImgSolid",class:"mqvntt2",propsAsIs:!0}),Xe=()=>C,eo=t.styled_default(Xe())({name:"MediaImgMiddle",class:"m12jtj3u",propsAsIs:!0}),oo=t.styled_default("img")({name:"CtaIcon",class:"ckq1frv",propsAsIs:!1}),to=t.styled_default("button")({name:"Button",class:"bis90pl",propsAsIs:!1}),so=()=>t.E1,no=t.styled_default(so())({name:"StyledChevronRight",class:"s9mjmz3",propsAsIs:!0}),lo=t.styled_default("div")({name:"Logo",class:"l1cf50a7",propsAsIs:!1}),io={[u.NotificationPromotionImagePosition.UNSET]:Z,[u.NotificationPromotionImagePosition.FIT]:Z,[u.NotificationPromotionImagePosition.CENTERED]:te,[u.NotificationPromotionImagePosition.BOTTOM]:Je,[u.NotificationPromotionImagePosition.SOLID]:Qe,[u.NotificationPromotionImagePosition.MIDDLE]:eo},ao=({src:e,imagePosition:s})=>{const l=io[s];return o.jsx(l,{children:o.jsx("img",{src:e,alt:""})})},ro=({notification:e,open:s,promotionId:l,hiding:n,direction:r="left"})=>{if(!e||!e.promotion||e.enabled!==u.NotificationEnabled.NOTIFICATION_ENABLED)return null;if(e.promotion.mode===u.NotificationPromotionMode.LOWER_THIRD)return o.jsx(Ve,{notification:e,open:s});const{title:a,body:c,image:p,promotion:v}=e,{sponsorLogo:i,sponsorLogoMode:f,imagePosition:y,ctaButton:m}=v;return o.jsx(B,{className:"SL_Rich_Notification",direction:r,hiding:n,children:o.jsxs(Ue,{onClick:s,children:[f!==u.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&o.jsx(lo,{children:o.jsx("img",{src:i,alt:a})}),o.jsxs(Fe,{children:[o.jsx(ao,{src:p,imagePosition:y}),o.jsxs(ze,{children:[a&&o.jsx(Ge,{children:a}),c&&o.jsx(Ke,{children:c})]}),o.jsxs(to,{name:"promo-button",style:{color:m==null?void 0:m.textColor,backgroundColor:m==null?void 0:m.color},children:[(m==null?void 0:m.ctaIcon)&&(m==null?void 0:m.ctaIconMode)===u.CtaIconMode.CTA_ICON_TRANSPARENT&&o.jsx(oo,{src:m==null?void 0:m.ctaIcon,alt:"cta-icon"}),(m==null?void 0:m.label)||"Open"]}),o.jsx(no,{name:"chevronRight"})]})]})})},co=t.styled_default("div")({name:"OverlayContainer",class:"okzhq2w",propsAsIs:!1}),se=t.styled_default("div")({name:"PromoOverlay",class:"pmgz5i",propsAsIs:!1}),ne=t.styled_default("div")({name:"Header",class:"hyxi3jt",propsAsIs:!1}),le=t.styled_default("div")({name:"HeaderContent",class:"h149e3gp",propsAsIs:!1}),ie="h10toh7",Q=t.styled_default("img")({name:"SponsorLogo",class:"s1jyea6t",propsAsIs:!1}),mo=t.styled_default("div")({name:"SponsorName",class:"szpfa3h",propsAsIs:!1}),ae=t.styled_default("div")({name:"Media",class:"m1crmu01",propsAsIs:!1}),uo=t.styled_default("img")({name:"PromoImg",class:"p1l37r8s",propsAsIs:!1}),po="s1nmch9k",X=t.styled_default("div")({name:"Content",class:"c1er0ljd",propsAsIs:!1}),yo=t.styled_default("div")({name:"Description",class:"dydopmr",propsAsIs:!1}),vo=t.styled_default("div")({name:"Sponsor",class:"s1w6nt04",propsAsIs:!1}),fo=t.styled_default("div")({name:"SponsorText",class:"s1evcmtq",propsAsIs:!1}),re=t.styled_default("div")({name:"ADLogo",class:"awodx0x",propsAsIs:!1}),Ao=t.styled_default("span")({name:"SponsoredText",class:"s1q3n6oi",propsAsIs:!1}),go=t.styled_default("div")({name:"ActionBtnWrap",class:"a8d4xfk",propsAsIs:!1}),Io=t.styled_default("a")({name:"ActionButton",class:"at6oobh",propsAsIs:!1}),ho=t.styled_default("div")({name:"Title",class:"t1gyg7tt",propsAsIs:!1}),xo="h17rwbtk",jo=t.styled_default("div")({name:"Container",class:"c10m2bce",propsAsIs:!1}),ee=t.styled_default("div")({name:"Item",class:"ig23yq5",propsAsIs:!1}),_o=t.styled_default("div")({name:"Dot",class:"d1f6aqua",propsAsIs:!1}),bo=({time:e,adCount:s,adPosition:l})=>{const n=Math.floor(e/60),r=e-n*60;return n===0&&r===0&&s===l?null:o.jsxs(jo,{children:[s>1&&o.jsxs(o.Fragment,{children:[o.jsxs(ee,{children:[l," of ",s]}),o.jsx(_o,{})]}),o.jsxs(ee,{children:[n,":",r<10?`0${r}`:r]})]})},No=(e,s,{onPlay:l,onStop:n,onProgress:r})=>{const a=google.ima;let c=new a.AdDisplayContainer(e),p=new a.AdsLoader(c),v=new a.AdsRequest,i;p.addEventListener(a.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,y=>{i=y.getAdsManager(e),l&&i.addEventListener(a.AdEvent.Type.STARTED,l),n&&i.addEventListener(a.AdEvent.Type.COMPLETE,n),r&&i.addEventListener(a.AdEvent.Type.AD_PROGRESS,m=>r(m.getAdData())),i.init(e.clientWidth,e.clientHeight,a.ViewMode.NORMAL),i.start()},!1),p.addEventListener(a.AdErrorEvent.Type.AD_ERROR,()=>{console.log("ad error"),n==null||n()},!1),v.linearAdSlotWidth=e.clientWidth,v.linearAdSlotHeight=e.clientHeight,v.adTagUrl=s,p.requestAds(v);const f=()=>{i==null||i.destroy(),p==null||p.destroy(),c==null||c.destroy(),c=void 0,p=void 0,v=void 0,i=void 0};return()=>{try{c.initialize()}catch(y){n==null||n(),console.log("AdsManager could not be started",y)}return f}},Po=t.styled_default("div")({name:"Container",class:"c4q6dw1",propsAsIs:!1}),So=t.styled_default("div")({name:"ControlsContainer",class:"c1la67r",propsAsIs:!1}),To="m3guev",Eo="m7099mt",$o="mmm6o5s",Co=({promotion:e,controlVideo:s,promotionId:l,onClose:n,externalAd:r,skipAutoClose:a})=>{var c;const p=g.useRef(null),[v,i]=g.useState(!1),[f,y]=g.useState(0),[m,I]=g.useState(0),[_,A]=g.useState(0),h=g.useRef(),x=g.useCallback(()=>{y(0),I(0),A(0),i(!1),s==null||s({muted:!1})},[s]);g.useEffect(()=>{if(r!=null&&r.url&&p.current){x();const j=No(p.current,r.url,{onPlay:()=>{t.eventBus.emit("advertisement",{action:"videoPlay",payload:{id:l,type:e.type}}),s==null||s({muted:!0}),i(!0)},onStop:()=>{n==null||n(),x()},onProgress:b=>{y(Math.round(b.duration-b.currentTime)),I(b.totalAds),A(b.adPosition)}})();return h.current=j,()=>{h.current=void 0,j()}}},[r==null?void 0:r.url,s,x,l,e.type,n]);const S=((c=e.sponsor)==null?void 0:c.logo)&&e.logoMode===u.PromotionLogoMode.CENTER;return o.jsxs(se,{className:"PromoOverlay",children:[o.jsxs(ne,{children:[o.jsx(le,{className:t.cx_default(!S&&ie),children:o.jsx(re,{style:{transform:"scale(1.5)"},children:"Ad"})}),o.jsxs(So,{children:[o.jsx(bo,{time:f,adCount:m,adPosition:_}),a&&o.jsx(t.b,{className:"ClosePromoIcon",close:()=>{var j;(j=h.current)==null||j.call(h),n==null||n(),x()}})]})]}),o.jsx(ae,{className:t.cx_default(To,v&&Eo,!v&&$o),children:o.jsx(Po,{ref:p})})]})},oe=e=>{var s,l,n,r,a,c,p,v,i,f,y,m,I,_,A,h,x,S,j,b,D,q,w,V,F,U,z,G,K,W;const{promotion:d,open:H,advertisementPaused:ce,togglePause:N,controlVideo:T,skipAutoClose:me,promotionId:E,onClose:ue,markAsViewed:L,externalAd:Y}=e,M=d.type===u.PromotionType.INGAME_IAB11_LBAR||d.type===u.PromotionType.INGAME_IAB11,k=((s=d.sponsor)==null?void 0:s.logo)&&d.logoMode===u.PromotionLogoMode.CENTER,J=!!((n=(l=d.banner)==null?void 0:l.video)!=null&&n.url),$=d.autoPlayVideo===u.AutoPlayVideo.ENABLED;if(g.useEffect(()=>{N==null||N(J||$),H==null||H()},[]),g.useEffect(()=>{E&&d.type&&L&&L()},[E,d.type,L]),g.useEffect(()=>()=>{T==null||T({muted:!1})},[T]),Y)return o.jsx(Co,{...e,externalAd:Y});let P=(r=d.banner)==null?void 0:r.url;P&&P.indexOf("http")!==0&&(P=`https://${P}`);let O=!0;return J&&(!ce||!$?O=!0:O=!1),o.jsxs(se,{className:"PromoOverlay",children:[o.jsxs(ne,{children:[o.jsxs(le,{className:t.cx_default(!k&&ie),children:[((a=d.sponsor)==null?void 0:a.logo)&&d.logoMode===u.PromotionLogoMode.LEFT&&o.jsx(Q,{className:"PromoSponsorLogo",src:(c=d.sponsor)==null?void 0:c.logo,alt:"promo"}),o.jsxs(vo,{style:{paddingLeft:(p=d.sponsor)!=null&&p.logo&&d.logoMode===u.PromotionLogoMode.LEFT?"0px":"8px"},children:[((v=d.sponsor)==null?void 0:v.logo)&&d.logoMode===u.PromotionLogoMode.LEFT&&o.jsx(mo,{children:(i=d.sponsor)==null?void 0:i.name}),o.jsxs(fo,{className:"SponsorText",children:[o.jsx(re,{children:"AD"}),o.jsx(Ao,{children:"SPONSORED"})]})]})]}),o.jsx(t.b,{className:"ClosePromoIcon",close:ue,autoClose:(f=d.closeTimer)==null?void 0:f.auto,duration:me?0:(y=d.closeTimer)==null?void 0:y.seconds,isPlaying:O})]}),o.jsxs(ae,{children:[k&&o.jsx(Q,{className:po,src:(m=d.sponsor)==null?void 0:m.logo,alt:"promo"}),o.jsx(X,{children:(_=(I=d.banner)==null?void 0:I.video)!=null&&_.url?o.jsx(t.Y,{source:(h=(A=d.banner)==null?void 0:A.video)==null?void 0:h.url,poster:(S=(x=d.banner)==null?void 0:x.video)==null?void 0:S.thumbnailUrl,aspectRatio:M?"1/1":"16/9",onPause:()=>{$&&(N==null||N(!0))},onPlay:()=>{t.eventBus.emit("advertisement",{action:"videoPlay",payload:{id:E,type:d.type}}),N==null||N(!1)},controlVideo:T,autoPlay:$}):(j=d.banner)!=null&&j.imageUrl?o.jsx(uo,{style:M?{aspectRatio:"1/1"}:{},src:(b=d.banner)==null?void 0:b.imageUrl,alt:"promo"}):null}),!M&&o.jsxs(X,{children:[((D=d.banner)==null?void 0:D.title)&&o.jsx(ho,{className:t.cx_default("AdvTitle",k&&xo),children:(q=d.banner)==null?void 0:q.title}),((w=d.banner)==null?void 0:w.body)&&o.jsx(yo,{className:"AdvDescription",children:(V=d.banner)==null?void 0:V.body})]})]}),d.buttonType!==u.PromotionButtonType.NO_BUTTON&&o.jsx(go,{children:o.jsx(Io,{href:P,style:{backgroundColor:((U=(F=d.banner)==null?void 0:F.ctaButton)==null?void 0:U.color)||"#009dc4",color:((G=(z=d.banner)==null?void 0:z.ctaButton)==null?void 0:G.textColor)||"#fff"},"data-analytics":"button","data-promo-id":E,"data-promo-type":d.type,target:"_blank",children:(W=(K=d.banner)==null?void 0:K.ctaButton)==null?void 0:W.label})})]})},Lo=t.styled_default("div")({name:"SidebarContainer",class:"s1abskp8",propsAsIs:!1}),Mo=({children:e,direction:s,style:l,className:n,hiding:r})=>o.jsx(B,{direction:s,style:l,hiding:r,className:n,children:o.jsx(Lo,{children:e})}),ko=e=>(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB11_LBAR||(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB21_LBAR,Oo=e=>(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB11||(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB21,Bo=({advertisement:e,close:s,skipTypeCheck:l,skipAutoClose:n,layoutMode:r="side-by-side",sidebar:a,isNotification:c,banner:p,markAsViewed:v,open:i,externalAd:f,controlVideo:y,advertisementPaused:m,togglePause:I})=>e.promotion?c&&e.notification?o.jsx(ro,{open:()=>i==null?void 0:i({fromNotification:!0}),notification:e.notification,promotionId:e.question.id}):!a&&!p&&(l||Oo(e.promotion))?o.jsx(co,{className:"PromoOverlayContainer",children:o.jsx(oe,{markAsViewed:v,promotionId:e.question.id,promotion:e.promotion,onClose:s,open:i,skipAutoClose:n,externalAd:f,controlVideo:y,advertisementPaused:m,togglePause:I})}):a&&(l||ko(e.promotion))?o.jsx(Mo,{className:"PromoSidebarContainer",direction:a,hiding:!1,children:o.jsx(oe,{markAsViewed:v,promotionId:e.question.id,promotion:e.promotion,externalAd:f,onClose:s,open:i,controlVideo:y,skipAutoClose:n,advertisementPaused:m,togglePause:I})}):p?o.jsx(Pe,{promotionId:e.question.id,hiding:!1,promotion:e.promotion,direction:p}):null:null,Ro=t.styled_default("div")({name:"AdvertisementUIWrap",class:"aa6pjif",propsAsIs:!1}),Do=e=>{const s=e.target;if(s instanceof HTMLAnchorElement&&s.target==="_blank"){const l=s.getAttribute("data-promo-id")||"",n=s.getAttribute("data-promo-type")||u.PromotionType.UNSET;s.getAttribute("data-analytics")==="button"&&t.eventBus.emit("advertisement",{action:"buttonSelect",payload:{id:l,type:n}}),s.getAttribute("data-analytics")==="banner"&&t.eventBus.emit("advertisement",{action:"bannerSelect",payload:{id:l,type:n}})}},qo=({gamification:e,layoutMode:s,skipAutoClose:l,skipTypeCheck:n,sidebar:r,banner:a,notification:c,isMobileScreen:p,persistent:v,externalAd:i,controlVideo:f})=>{var y,m,I;const _=g.useRef(null),A=t.useStore(e.advertisement.$store);t.L(_,{enabled:!!A.data,event:"click",listener:Do});const h=!a&&!r;if(A.data===void 0||!v&&A.isViewed)return null;const x=((I=(m=(y=A==null?void 0:A.data)==null?void 0:y.notification)==null?void 0:m.promotion)==null?void 0:I.mode)===u.NotificationPromotionMode.LOWER_THIRD;return o.jsx(Ro,{ref:_,style:{height:h?"auto":"100%"},className:t.cx_default("SL-AdvertisementUIWrap",p&&"mobile-view",x&&"SL-AdvertisementUIWrap--lower-third"),children:o.jsx(Bo,{skipTypeCheck:n,sidebar:r,banner:a,advertisement:A.data,advertisementPaused:A.isPaused,togglePause:A.togglePause,close:A.close,externalAd:i?A.externalAd:void 0,markAsViewed:e.advertisement.markAsViewed,open:e.advertisement.open,layoutMode:s,isNotification:c,skipAutoClose:l,controlVideo:f})})},de=({sdk:e,sidebar:s,externalAd:l,banner:n,skipAutoClose:r,skipTypeCheck:a,layoutMode:c,isMobileScreen:p,persistent:v,notification:i})=>{const f=t.useStore(e.featuresList.getStore());if(g.useEffect(()=>{if(l){const m=document.createElement("script");m.async=!0,m.src="https://imasdk.googleapis.com/js/sdkloader/ima3.js",document.body.appendChild(m)}},[l]),s&&n)return o.jsx("div",{style:{color:"red"},children:"define either sidebar or banner, not both."});if(n&&l)return o.jsx("div",{style:{color:"red"},children:"externalAd is not supported with banner"});if(!f)return null;const y=e.getFeature(u.SdkOverlayType.GAMES);return y?o.jsx(qo,{gamification:y,sidebar:s,banner:n,layoutMode:c,isMobileScreen:p,persistent:v,notification:i,skipTypeCheck:a,skipAutoClose:r,externalAd:l,controlVideo:e.controlVideoPlayer}):null},wo=({event:e,sidebar:s,banner:l,isMobileScreen:n,skipAutoClose:r,persistent:a,theme:c,notification:p,skipTypeCheck:v,externalAd:i})=>{const f=t.useStreamLayer(),y=t.useStreamLayerUI(),m=t.useStreamLayerTheme();return f?i&&!y.promotionExternalAd?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):!i&&y.promotionExternalAd?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):s&&!y.promotionSidebar?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):l&&!y.promotionBanner?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):p&&!y.promotionNotification?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):!l&&!s&&!p&&!y.promotionOverlay?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):o.jsxs("div",{className:"StreamLayerSDK",children:[o.jsx(t.h,{customTheme:c??m.theme,themeMode:m.themeMode,children:o.jsx(de,{sdk:f,sidebar:s,banner:l,isMobileScreen:n,persistent:a,notification:p,skipTypeCheck:v,skipAutoClose:r,layoutMode:"side-by-side",externalAd:i})}),e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e})]}):null};exports.StreamLayerSDKAdvertisement=wo;exports.StreamLayerSDKAdvertisementUI=de;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),g=require("react"),t=require("./provider.js"),u=require("./useStreamLayerApp2.js"),pe=t.styled_default("div")({name:"Container",class:"c5b6wdg",propsAsIs:!1}),ye="a1rlj479",ve="s35f1di",fe="sj4471g",Ae="b12050d8",ge="b1d5ybek",Ie=e=>e==="left"||e==="right"?ve:Ae,he=e=>e==="left"||e==="right"?fe:ge,xe=e=>e==="left"?"avdxyl3":e==="right"?"a1bisd08":e==="top"?"a1u9y2aj":"a1qqaks",B=({children:e,style:s,className:l,enabled:n=!0,hiding:r,direction:a="left",onAnimationEnd:c})=>o.jsx(pe,{style:s,className:t.cx_default(l,ye,xe(a),n&&!r&&Ie(a),n&&r&&he(a)),onAnimationEnd:c,children:e}),je=t.styled_default("a")({name:"Link",class:"l1sgte8c",propsAsIs:!1}),_e=t.styled_default("div")({name:"BannerContainer",class:"b7yfc72",propsAsIs:!1}),be=()=>je,Ne=t.styled_default(be())({name:"BannerLink",class:"bejjq94",propsAsIs:!0}),Pe=({promotion:e,promotionId:s,hiding:l,direction:n="bottom"})=>{var r,a;if(!((r=e.additionalBanner)!=null&&r.imageUrl))return null;let c=(a=e.additionalBanner)==null?void 0:a.url;return c&&c.indexOf("http")!==0&&(c=`https://${c}`),o.jsx(B,{direction:n,hiding:l,children:o.jsx(_e,{className:"BannerContainer",children:o.jsx(Ne,{as:c?"a":"span",className:"BannerLink",href:c,style:{backgroundImage:`url(${e.additionalBanner.imageUrl})`,cursor:c?"pointer":"default"},"data-promo-id":s,"data-promo-type":e.type,"data-analytics":"banner",target:"_blank"})})})},Se=t.styled_default("div")({name:"NotificationContent",class:"n18wsqoo",propsAsIs:!1}),Te=t.styled_default("div")({name:"Body",class:"b1ia90c2",propsAsIs:!1}),Ee=t.styled_default("div")({name:"Title",class:"tg2z08v",propsAsIs:!1}),$e=t.styled_default("div")({name:"Text",class:"t59zdk1",propsAsIs:!1}),R=t.styled_default("div")({name:"MediaImgBottom",class:"m1ab9fq",propsAsIs:!1}),Ce=()=>R,Le=t.styled_default(Ce())({name:"MediaImgMiddle",class:"m9fsr0y",propsAsIs:!0}),Me=t.styled_default("img")({name:"CtaIcon",class:"cvi9y5q",propsAsIs:!1}),ke=t.styled_default("button")({name:"Button",class:"bgl6boa",propsAsIs:!1}),Oe=t.styled_default("div")({name:"Logo",class:"l5mq0z",propsAsIs:!1}),Be=t.styled_default("div")({name:"Footer",class:"f1mse0ft",propsAsIs:!1}),Re=t.styled_default("div")({name:"Vector",class:"v1hcloah",propsAsIs:!1}),De=t.styled_default("div")({name:"NotificationContainer",class:"n3n65jf",propsAsIs:!1}),qe={[u.NotificationPromotionImagePosition.BOTTOM]:R,[u.NotificationPromotionImagePosition.MIDDLE]:Le},we=({src:e,imagePosition:s})=>{const l=qe[s]||R;return o.jsx(l,{children:o.jsx("img",{src:e,alt:""})})},Ve=({notification:e,open:s})=>{if(!e||!e.promotion||e.enabled!==u.NotificationEnabled.NOTIFICATION_ENABLED)return null;const{title:l,body:n,image:r,promotion:a}=e,{sponsorLogo:c,sponsorLogoMode:p,imagePosition:v,ctaButton:i}=a;return o.jsxs(De,{className:"SL_Lower_Third_Notification",onClick:s,children:[o.jsxs(Se,{children:[o.jsx(we,{src:r,imagePosition:v}),o.jsxs(Te,{children:[l&&o.jsx(Ee,{children:l}),n&&o.jsx($e,{children:n})]})]}),o.jsxs(Be,{children:[p!==u.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&o.jsxs(o.Fragment,{children:[o.jsx(Oe,{children:o.jsx("img",{src:c,alt:l})}),o.jsx(Re,{})]}),o.jsxs(ke,{name:"promo-button",style:{color:i==null?void 0:i.textColor,backgroundColor:i==null?void 0:i.color},children:[(i==null?void 0:i.ctaIcon)&&(i==null?void 0:i.ctaIconMode)===u.CtaIconMode.CTA_ICON_TRANSPARENT&&o.jsx(Me,{src:i==null?void 0:i.ctaIcon,alt:"cta-icon"}),(i==null?void 0:i.label)||"Open"]})]})]})},Fe=t.styled_default("div")({name:"NotificationContent",class:"n1ku6hz",propsAsIs:!1}),Ue=t.styled_default("div")({name:"NotificationContainer",class:"nbxqmol",propsAsIs:!1}),ze=t.styled_default("div")({name:"Body",class:"b1gu3eml",propsAsIs:!1}),Ge=t.styled_default("div")({name:"Title",class:"t1u17zva",propsAsIs:!1}),Ke=t.styled_default("div")({name:"Text",class:"t10ko1g",propsAsIs:!1}),C=t.styled_default("div")({name:"Media",class:"mntc42e",propsAsIs:!1}),We=()=>C,J=t.styled_default(We())({name:"MediaImgFit",class:"ml060eo",propsAsIs:!0}),He=()=>C,te=t.styled_default(He())({name:"MediaImgCentered",class:"m1vqlvig",propsAsIs:!0}),Ye=()=>te,Ze=t.styled_default(Ye())({name:"MediaImgBottom",class:"m1e7tvi5",propsAsIs:!0}),Je=()=>C,Qe=t.styled_default(Je())({name:"MediaImgSolid",class:"mqvntt2",propsAsIs:!0}),Xe=()=>C,eo=t.styled_default(Xe())({name:"MediaImgMiddle",class:"m12jtj3u",propsAsIs:!0}),oo=t.styled_default("img")({name:"CtaIcon",class:"ckq1frv",propsAsIs:!1}),to=t.styled_default("button")({name:"Button",class:"bis90pl",propsAsIs:!1}),so=()=>t.Z1,no=t.styled_default(so())({name:"StyledChevronRight",class:"s9mjmz3",propsAsIs:!0}),lo=t.styled_default("div")({name:"Logo",class:"l1cf50a7",propsAsIs:!1}),io={[u.NotificationPromotionImagePosition.UNSET]:J,[u.NotificationPromotionImagePosition.FIT]:J,[u.NotificationPromotionImagePosition.CENTERED]:te,[u.NotificationPromotionImagePosition.BOTTOM]:Ze,[u.NotificationPromotionImagePosition.SOLID]:Qe,[u.NotificationPromotionImagePosition.MIDDLE]:eo},ao=({src:e,imagePosition:s})=>{const l=io[s];return o.jsx(l,{children:o.jsx("img",{src:e,alt:""})})},ro=({notification:e,open:s,promotionId:l,hiding:n,direction:r="left"})=>{if(!e||!e.promotion||e.enabled!==u.NotificationEnabled.NOTIFICATION_ENABLED)return null;if(e.promotion.mode===u.NotificationPromotionMode.LOWER_THIRD)return o.jsx(Ve,{notification:e,open:s});const{title:a,body:c,image:p,promotion:v}=e,{sponsorLogo:i,sponsorLogoMode:f,imagePosition:y,ctaButton:m}=v;return o.jsx(B,{className:"SL_Rich_Notification",direction:r,hiding:n,children:o.jsxs(Ue,{onClick:s,children:[f!==u.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&o.jsx(lo,{children:o.jsx("img",{src:i,alt:a})}),o.jsxs(Fe,{children:[o.jsx(ao,{src:p,imagePosition:y}),o.jsxs(ze,{children:[a&&o.jsx(Ge,{children:a}),c&&o.jsx(Ke,{children:c})]}),o.jsxs(to,{name:"promo-button",style:{color:m==null?void 0:m.textColor,backgroundColor:m==null?void 0:m.color},children:[(m==null?void 0:m.ctaIcon)&&(m==null?void 0:m.ctaIconMode)===u.CtaIconMode.CTA_ICON_TRANSPARENT&&o.jsx(oo,{src:m==null?void 0:m.ctaIcon,alt:"cta-icon"}),(m==null?void 0:m.label)||"Open"]}),o.jsx(no,{name:"chevronRight"})]})]})})},co=t.styled_default("div")({name:"OverlayContainer",class:"okzhq2w",propsAsIs:!1}),se=t.styled_default("div")({name:"PromoOverlay",class:"pmgz5i",propsAsIs:!1}),ne=t.styled_default("div")({name:"Header",class:"hyxi3jt",propsAsIs:!1}),le=t.styled_default("div")({name:"HeaderContent",class:"h149e3gp",propsAsIs:!1}),ie="h10toh7",Q=t.styled_default("img")({name:"SponsorLogo",class:"s1jyea6t",propsAsIs:!1}),mo=t.styled_default("div")({name:"SponsorName",class:"szpfa3h",propsAsIs:!1}),ae=t.styled_default("div")({name:"Media",class:"m1crmu01",propsAsIs:!1}),uo=t.styled_default("img")({name:"PromoImg",class:"p1l37r8s",propsAsIs:!1}),po="s1nmch9k",X=t.styled_default("div")({name:"Content",class:"c1er0ljd",propsAsIs:!1}),yo=t.styled_default("div")({name:"Description",class:"dydopmr",propsAsIs:!1}),vo=t.styled_default("div")({name:"Sponsor",class:"s1w6nt04",propsAsIs:!1}),fo=t.styled_default("div")({name:"SponsorText",class:"s1evcmtq",propsAsIs:!1}),re=t.styled_default("div")({name:"ADLogo",class:"awodx0x",propsAsIs:!1}),Ao=t.styled_default("span")({name:"SponsoredText",class:"s1q3n6oi",propsAsIs:!1}),go=t.styled_default("div")({name:"ActionBtnWrap",class:"a8d4xfk",propsAsIs:!1}),Io=t.styled_default("a")({name:"ActionButton",class:"at6oobh",propsAsIs:!1}),ho=t.styled_default("div")({name:"Title",class:"t1gyg7tt",propsAsIs:!1}),xo="h17rwbtk",jo=t.styled_default("div")({name:"Container",class:"c10m2bce",propsAsIs:!1}),ee=t.styled_default("div")({name:"Item",class:"ig23yq5",propsAsIs:!1}),_o=t.styled_default("div")({name:"Dot",class:"d1f6aqua",propsAsIs:!1}),bo=({time:e,adCount:s,adPosition:l})=>{const n=Math.floor(e/60),r=e-n*60;return n===0&&r===0&&s===l?null:o.jsxs(jo,{children:[s>1&&o.jsxs(o.Fragment,{children:[o.jsxs(ee,{children:[l," of ",s]}),o.jsx(_o,{})]}),o.jsxs(ee,{children:[n,":",r<10?`0${r}`:r]})]})},No=(e,s,{onPlay:l,onStop:n,onProgress:r})=>{const a=google.ima;let c=new a.AdDisplayContainer(e),p=new a.AdsLoader(c),v=new a.AdsRequest,i;p.addEventListener(a.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,y=>{i=y.getAdsManager(e),l&&i.addEventListener(a.AdEvent.Type.STARTED,l),n&&i.addEventListener(a.AdEvent.Type.COMPLETE,n),r&&i.addEventListener(a.AdEvent.Type.AD_PROGRESS,m=>r(m.getAdData())),i.init(e.clientWidth,e.clientHeight,a.ViewMode.NORMAL),i.start()},!1),p.addEventListener(a.AdErrorEvent.Type.AD_ERROR,()=>{console.log("ad error"),n==null||n()},!1),v.linearAdSlotWidth=e.clientWidth,v.linearAdSlotHeight=e.clientHeight,v.adTagUrl=s,p.requestAds(v);const f=()=>{i==null||i.destroy(),p==null||p.destroy(),c==null||c.destroy(),c=void 0,p=void 0,v=void 0,i=void 0};return()=>{try{c.initialize()}catch(y){n==null||n(),console.log("AdsManager could not be started",y)}return f}},Po=t.styled_default("div")({name:"Container",class:"c4q6dw1",propsAsIs:!1}),So=t.styled_default("div")({name:"ControlsContainer",class:"c1la67r",propsAsIs:!1}),To="m3guev",Eo="m7099mt",$o="mmm6o5s",Co=({promotion:e,controlVideo:s,promotionId:l,onClose:n,externalAd:r,skipAutoClose:a})=>{var c;const p=g.useRef(null),[v,i]=g.useState(!1),[f,y]=g.useState(0),[m,I]=g.useState(0),[_,A]=g.useState(0),h=g.useRef(),x=g.useCallback(()=>{y(0),I(0),A(0),i(!1),s==null||s({muted:!1})},[s]);g.useEffect(()=>{if(r!=null&&r.url&&p.current){x();const j=No(p.current,r.url,{onPlay:()=>{t.eventBus.emit("advertisement",{action:"videoPlay",payload:{id:l,type:e.type}}),s==null||s({muted:!0}),i(!0)},onStop:()=>{n==null||n(),x()},onProgress:b=>{y(Math.round(b.duration-b.currentTime)),I(b.totalAds),A(b.adPosition)}})();return h.current=j,()=>{h.current=void 0,j()}}},[r==null?void 0:r.url,s,x,l,e.type,n]);const S=((c=e.sponsor)==null?void 0:c.logo)&&e.logoMode===u.PromotionLogoMode.CENTER;return o.jsxs(se,{className:"PromoOverlay",children:[o.jsxs(ne,{children:[o.jsx(le,{className:t.cx_default(!S&&ie),children:o.jsx(re,{style:{transform:"scale(1.5)"},children:"Ad"})}),o.jsxs(So,{children:[o.jsx(bo,{time:f,adCount:m,adPosition:_}),a&&o.jsx(t.b,{className:"ClosePromoIcon",close:()=>{var j;(j=h.current)==null||j.call(h),n==null||n(),x()}})]})]}),o.jsx(ae,{className:t.cx_default(To,v&&Eo,!v&&$o),children:o.jsx(Po,{ref:p})})]})},oe=e=>{var s,l,n,r,a,c,p,v,i,f,y,m,I,_,A,h,x,S,j,b,D,q,w,V,F,U,z,G,K,W;const{promotion:d,open:H,advertisementPaused:ce,togglePause:N,controlVideo:T,skipAutoClose:me,promotionId:E,onClose:ue,markAsViewed:L,externalAd:Y}=e,M=d.type===u.PromotionType.INGAME_IAB11_LBAR||d.type===u.PromotionType.INGAME_IAB11,k=((s=d.sponsor)==null?void 0:s.logo)&&d.logoMode===u.PromotionLogoMode.CENTER,Z=!!((n=(l=d.banner)==null?void 0:l.video)!=null&&n.url),$=d.autoPlayVideo===u.AutoPlayVideo.ENABLED;if(g.useEffect(()=>{N==null||N(Z||$),H==null||H()},[]),g.useEffect(()=>{E&&d.type&&L&&L()},[E,d.type,L]),g.useEffect(()=>()=>{T==null||T({muted:!1})},[T]),Y)return o.jsx(Co,{...e,externalAd:Y});let P=(r=d.banner)==null?void 0:r.url;P&&P.indexOf("http")!==0&&(P=`https://${P}`);let O=!0;return Z&&(!ce||!$?O=!0:O=!1),o.jsxs(se,{className:"PromoOverlay",children:[o.jsxs(ne,{children:[o.jsxs(le,{className:t.cx_default(!k&&ie),children:[((a=d.sponsor)==null?void 0:a.logo)&&d.logoMode===u.PromotionLogoMode.LEFT&&o.jsx(Q,{className:"PromoSponsorLogo",src:(c=d.sponsor)==null?void 0:c.logo,alt:"promo"}),o.jsxs(vo,{style:{paddingLeft:(p=d.sponsor)!=null&&p.logo&&d.logoMode===u.PromotionLogoMode.LEFT?"0px":"8px"},children:[((v=d.sponsor)==null?void 0:v.logo)&&d.logoMode===u.PromotionLogoMode.LEFT&&o.jsx(mo,{children:(i=d.sponsor)==null?void 0:i.name}),o.jsxs(fo,{className:"SponsorText",children:[o.jsx(re,{children:"AD"}),o.jsx(Ao,{children:"SPONSORED"})]})]})]}),o.jsx(t.b,{className:"ClosePromoIcon",close:ue,autoClose:(f=d.closeTimer)==null?void 0:f.auto,duration:me?0:(y=d.closeTimer)==null?void 0:y.seconds,isPlaying:O})]}),o.jsxs(ae,{children:[k&&o.jsx(Q,{className:po,src:(m=d.sponsor)==null?void 0:m.logo,alt:"promo"}),o.jsx(X,{children:(_=(I=d.banner)==null?void 0:I.video)!=null&&_.url?o.jsx(t.Y,{source:(h=(A=d.banner)==null?void 0:A.video)==null?void 0:h.url,poster:(S=(x=d.banner)==null?void 0:x.video)==null?void 0:S.thumbnailUrl,aspectRatio:M?"1/1":"16/9",onPause:()=>{$&&(N==null||N(!0))},onPlay:()=>{t.eventBus.emit("advertisement",{action:"videoPlay",payload:{id:E,type:d.type}}),N==null||N(!1)},controlVideo:T,autoPlay:$}):(j=d.banner)!=null&&j.imageUrl?o.jsx(uo,{style:M?{aspectRatio:"1/1"}:{},src:(b=d.banner)==null?void 0:b.imageUrl,alt:"promo"}):null}),!M&&o.jsxs(X,{children:[((D=d.banner)==null?void 0:D.title)&&o.jsx(ho,{className:t.cx_default("AdvTitle",k&&xo),children:(q=d.banner)==null?void 0:q.title}),((w=d.banner)==null?void 0:w.body)&&o.jsx(yo,{className:"AdvDescription",children:(V=d.banner)==null?void 0:V.body})]})]}),d.buttonType!==u.PromotionButtonType.NO_BUTTON&&o.jsx(go,{children:o.jsx(Io,{href:P,style:{backgroundColor:((U=(F=d.banner)==null?void 0:F.ctaButton)==null?void 0:U.color)||"#009dc4",color:((G=(z=d.banner)==null?void 0:z.ctaButton)==null?void 0:G.textColor)||"#fff"},"data-analytics":"button","data-promo-id":E,"data-promo-type":d.type,target:"_blank",children:(W=(K=d.banner)==null?void 0:K.ctaButton)==null?void 0:W.label})})]})},Lo=t.styled_default("div")({name:"SidebarContainer",class:"s1abskp8",propsAsIs:!1}),Mo=({children:e,direction:s,style:l,className:n,hiding:r})=>o.jsx(B,{direction:s,style:l,hiding:r,className:n,children:o.jsx(Lo,{children:e})}),ko=e=>(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB11_LBAR||(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB21_LBAR,Oo=e=>(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB11||(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB21,Bo=({advertisement:e,close:s,skipTypeCheck:l,skipAutoClose:n,layoutMode:r="side-by-side",sidebar:a,isNotification:c,banner:p,markAsViewed:v,open:i,externalAd:f,controlVideo:y,advertisementPaused:m,togglePause:I})=>e.promotion?c&&e.notification?o.jsx(ro,{open:()=>i==null?void 0:i({fromNotification:!0}),notification:e.notification,promotionId:e.question.id}):!a&&!p&&(l||Oo(e.promotion))?o.jsx(co,{className:"PromoOverlayContainer",children:o.jsx(oe,{markAsViewed:v,promotionId:e.question.id,promotion:e.promotion,onClose:s,open:i,skipAutoClose:n,externalAd:f,controlVideo:y,advertisementPaused:m,togglePause:I})}):a&&(l||ko(e.promotion))?o.jsx(Mo,{className:"PromoSidebarContainer",direction:a,hiding:!1,children:o.jsx(oe,{markAsViewed:v,promotionId:e.question.id,promotion:e.promotion,externalAd:f,onClose:s,open:i,controlVideo:y,skipAutoClose:n,advertisementPaused:m,togglePause:I})}):p?o.jsx(Pe,{promotionId:e.question.id,hiding:!1,promotion:e.promotion,direction:p}):null:null,Ro=t.styled_default("div")({name:"AdvertisementUIWrap",class:"aa6pjif",propsAsIs:!1}),Do=e=>{const s=e.target;if(s instanceof HTMLAnchorElement&&s.target==="_blank"){const l=s.getAttribute("data-promo-id")||"",n=s.getAttribute("data-promo-type")||u.PromotionType.UNSET;s.getAttribute("data-analytics")==="button"&&t.eventBus.emit("advertisement",{action:"buttonSelect",payload:{id:l,type:n}}),s.getAttribute("data-analytics")==="banner"&&t.eventBus.emit("advertisement",{action:"bannerSelect",payload:{id:l,type:n}})}},qo=({gamification:e,layoutMode:s,skipAutoClose:l,skipTypeCheck:n,sidebar:r,banner:a,notification:c,isMobileScreen:p,persistent:v,externalAd:i,controlVideo:f})=>{var y,m,I;const _=g.useRef(null),A=t.useStore(e.advertisement.$store);t.L(_,{enabled:!!A.data,event:"click",listener:Do});const h=!a&&!r;if(A.data===void 0||!v&&A.isViewed)return null;const x=((I=(m=(y=A==null?void 0:A.data)==null?void 0:y.notification)==null?void 0:m.promotion)==null?void 0:I.mode)===u.NotificationPromotionMode.LOWER_THIRD;return o.jsx(Ro,{ref:_,style:{height:h?"auto":"100%"},className:t.cx_default("SL-AdvertisementUIWrap",p&&"mobile-view",x&&"SL-AdvertisementUIWrap--lower-third"),children:o.jsx(Bo,{skipTypeCheck:n,sidebar:r,banner:a,advertisement:A.data,advertisementPaused:A.isPaused,togglePause:A.togglePause,close:A.close,externalAd:i?A.externalAd:void 0,markAsViewed:e.advertisement.markAsViewed,open:e.advertisement.open,layoutMode:s,isNotification:c,skipAutoClose:l,controlVideo:f})})},de=({sdk:e,sidebar:s,externalAd:l,banner:n,skipAutoClose:r,skipTypeCheck:a,layoutMode:c,isMobileScreen:p,persistent:v,notification:i})=>{const f=t.useStore(e.featuresList.getStore());if(g.useEffect(()=>{if(l){const m=document.createElement("script");m.async=!0,m.src="https://imasdk.googleapis.com/js/sdkloader/ima3.js",document.body.appendChild(m)}},[l]),s&&n)return o.jsx("div",{style:{color:"red"},children:"define either sidebar or banner, not both."});if(n&&l)return o.jsx("div",{style:{color:"red"},children:"externalAd is not supported with banner"});if(!f)return null;const y=e.getFeature(u.SdkOverlayType.GAMES);return y?o.jsx(qo,{gamification:y,sidebar:s,banner:n,layoutMode:c,isMobileScreen:p,persistent:v,notification:i,skipTypeCheck:a,skipAutoClose:r,externalAd:l,controlVideo:e.controlVideoPlayer}):null},wo=({event:e,sidebar:s,banner:l,isMobileScreen:n,skipAutoClose:r,persistent:a,theme:c,notification:p,skipTypeCheck:v,externalAd:i})=>{const f=t.useStreamLayer(),y=t.useStreamLayerUI(),m=t.useStreamLayerTheme();return f?i&&!y.promotionExternalAd?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):!i&&y.promotionExternalAd?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):s&&!y.promotionSidebar?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):l&&!y.promotionBanner?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):p&&!y.promotionNotification?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):!l&&!s&&!p&&!y.promotionOverlay?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):o.jsxs("div",{className:"StreamLayerSDK",children:[o.jsx(t.h,{customTheme:c??m.theme,themeMode:m.themeMode,children:o.jsx(de,{sdk:f,sidebar:s,banner:l,isMobileScreen:n,persistent:a,notification:p,skipTypeCheck:v,skipAutoClose:r,layoutMode:"side-by-side",externalAd:i})}),e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e})]}):null};exports.StreamLayerSDKAdvertisement=wo;exports.StreamLayerSDKAdvertisementUI=de;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("./index2.js"),o=require("./provider.js"),i=()=>{const e=o.useStreamLayer();return e?t.jsx(n.Y,{sdk:e}):null},u=({close:e,onEvent:s})=>{const r=o.useStreamLayer();return r?t.jsx(n.re,{sdk:r,onEvent:s,close:e}):null};exports.BetPackOverlayProvider=u;exports.BetPackProvider=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("./index2.js"),o=require("./provider.js"),i=()=>{const e=o.useStreamLayer();return e?t.jsx(n.q,{sdk:e}):null},u=({close:e,onEvent:s})=>{const r=o.useStreamLayer();return r?t.jsx(n.ne,{sdk:r,onEvent:s,close:e}):null};exports.BetPackOverlayProvider=u;exports.BetPackProvider=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./masters2.js");exports.default=e.z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./masters2.js");exports.default=e.A;