@streamlayer/react 1.9.4 → 1.9.6
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/index2.js +30 -30
- package/lib/cjs/useStreamLayerApp2.js +12 -12
- package/lib/dist/cjs/masters.js +54 -54
- package/lib/dist/es/masters.js +7818 -7759
- package/lib/es/advertisement.js +201 -191
- package/lib/es/index2.js +693 -692
- package/lib/es/useStreamLayerApp2.js +2906 -2848
- package/package.json +15 -15
package/lib/cjs/advertisement.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),g=require("react"),t=require("./index2.js"),u=require("./useStreamLayerApp2.js"),ue=t.styled_default("div")({name:"Container",class:"c5b6wdg",propsAsIs:!1}),pe="a1rlj479",ye="s35f1di",ve="sj4471g",fe="b12050d8",Ae="b1d5ybek",ge=e=>e==="left"||e==="right"?ye:fe,xe=e=>e==="left"||e==="right"?ve:Ae,Ie=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(ue,{style:s,className:t.cx_default(l,pe,Ie(a),n&&!r&&ge(a),n&&r&&xe(a)),onAnimationEnd:c,children:e}),he=t.styled_default("a")({name:"Link",class:"l1sgte8c",propsAsIs:!1}),je=t.styled_default("div")({name:"BannerContainer",class:"b7yfc72",propsAsIs:!1}),_e=()=>he,be=t.styled_default(_e())({name:"BannerLink",class:"bejjq94",propsAsIs:!0}),Ne=({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(je,{className:"BannerContainer",children:o.jsx(be,{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}),Pe=t.styled_default("div")({name:"Body",class:"b1ia90c2",propsAsIs:!1}),$e=t.styled_default("div")({name:"Title",class:"tg2z08v",propsAsIs:!1}),Te=t.styled_default("div")({name:"Text",class:"t59zdk1",propsAsIs:!1}),D=t.styled_default("div")({name:"MediaImgBottom",class:"m1ab9fq",propsAsIs:!1}),Ee=()=>D,Ce=t.styled_default(Ee())({name:"MediaImgMiddle",class:"m9fsr0y",propsAsIs:!0}),Le=t.styled_default("img")({name:"CtaIcon",class:"cvi9y5q",propsAsIs:!1}),Me=t.styled_default("button")({name:"Button",class:"bgl6boa",propsAsIs:!1}),ke=t.styled_default("div")({name:"Logo",class:"l5mq0z",propsAsIs:!1}),Oe=t.styled_default("div")({name:"Footer",class:"f1mse0ft",propsAsIs:!1}),Be=t.styled_default("div")({name:"Vector",class:"v1hcloah",propsAsIs:!1}),De=t.styled_default("div")({name:"NotificationContainer",class:"n3n65jf",propsAsIs:!1}),Re={[u.NotificationPromotionImagePosition.BOTTOM]:D,[u.NotificationPromotionImagePosition.MIDDLE]:Ce},qe=({src:e,imagePosition:s})=>{const l=Re[s]||D;return o.jsx(l,{children:o.jsx("img",{src:e,alt:""})})},we=({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(qe,{src:r,imagePosition:v}),o.jsxs(Pe,{children:[l&&o.jsx($e,{children:l}),n&&o.jsx(Te,{children:n})]})]}),o.jsxs(Oe,{children:[p!==u.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&o.jsxs(o.Fragment,{children:[o.jsx(ke,{children:o.jsx("img",{src:c,alt:l})}),o.jsx(Be,{})]}),o.jsxs(Me,{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(Le,{src:i==null?void 0:i.ctaIcon,alt:"cta-icon"}),(i==null?void 0:i.label)||"Open"]})]})]})},Ve=t.styled_default("div")({name:"NotificationContent",class:"n1ku6hz",propsAsIs:!1}),Fe=t.styled_default("div")({name:"NotificationContainer",class:"nbxqmol",propsAsIs:!1}),Ue=t.styled_default("div")({name:"Body",class:"b1gu3eml",propsAsIs:!1}),ze=t.styled_default("div")({name:"Title",class:"t1u17zva",propsAsIs:!1}),Ge=t.styled_default("div")({name:"Text",class:"t10ko1g",propsAsIs:!1}),C=t.styled_default("div")({name:"Media",class:"mntc42e",propsAsIs:!1}),Ke=()=>C,J=t.styled_default(Ke())({name:"MediaImgFit",class:"ml060eo",propsAsIs:!0}),We=()=>C,oe=t.styled_default(We())({name:"MediaImgCentered",class:"m1vqlvig",propsAsIs:!0}),He=()=>oe,Ye=t.styled_default(He())({name:"MediaImgBottom",class:"m1e7tvi5",propsAsIs:!0}),Je=()=>C,Xe=t.styled_default(Je())({name:"MediaImgSolid",class:"mqvntt2",propsAsIs:!0}),Ze=()=>C,Qe=t.styled_default(Ze())({name:"MediaImgMiddle",class:"m12jtj3u",propsAsIs:!0}),eo=t.styled_default("img")({name:"CtaIcon",class:"ckq1frv",propsAsIs:!1}),oo=t.styled_default("button")({name:"Button",class:"bis90pl",propsAsIs:!1}),to=()=>t.h1,so=t.styled_default(to())({name:"StyledChevronRight",class:"s9mjmz3",propsAsIs:!0}),no=t.styled_default("div")({name:"Logo",class:"l1cf50a7",propsAsIs:!1}),lo={[u.NotificationPromotionImagePosition.UNSET]:J,[u.NotificationPromotionImagePosition.FIT]:J,[u.NotificationPromotionImagePosition.CENTERED]:oe,[u.NotificationPromotionImagePosition.BOTTOM]:Ye,[u.NotificationPromotionImagePosition.SOLID]:Xe,[u.NotificationPromotionImagePosition.MIDDLE]:Qe},io=({src:e,imagePosition:s})=>{const l=lo[s];return o.jsx(l,{children:o.jsx("img",{src:e,alt:""})})},ao=({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(we,{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(Fe,{onClick:s,children:[f!==u.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&o.jsx(no,{children:o.jsx("img",{src:i,alt:a})}),o.jsxs(Ve,{children:[o.jsx(io,{src:p,imagePosition:y}),o.jsxs(Ue,{children:[a&&o.jsx(ze,{children:a}),c&&o.jsx(Ge,{children:c})]}),o.jsxs(oo,{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(eo,{src:m==null?void 0:m.ctaIcon,alt:"cta-icon"}),(m==null?void 0:m.label)||"Open"]}),o.jsx(so,{name:"chevronRight"})]})]})})},ro=t.styled_default("div")({name:"OverlayContainer",class:"okzhq2w",propsAsIs:!1}),te=t.styled_default("div")({name:"PromoOverlay",class:"pmgz5i",propsAsIs:!1}),se=t.styled_default("div")({name:"Header",class:"hyxi3jt",propsAsIs:!1}),ne=t.styled_default("div")({name:"HeaderContent",class:"h149e3gp",propsAsIs:!1}),le="h10toh7",X=t.styled_default("img")({name:"SponsorLogo",class:"s1jyea6t",propsAsIs:!1}),co=t.styled_default("div")({name:"SponsorName",class:"szpfa3h",propsAsIs:!1}),ie=t.styled_default("div")({name:"Media",class:"m1crmu01",propsAsIs:!1}),mo=t.styled_default("img")({name:"PromoImg",class:"p1l37r8s",propsAsIs:!1}),uo="s1nmch9k",Z=t.styled_default("div")({name:"Content",class:"c1er0ljd",propsAsIs:!1}),po=t.styled_default("div")({name:"Description",class:"dydopmr",propsAsIs:!1}),yo=t.styled_default("div")({name:"Sponsor",class:"s1w6nt04",propsAsIs:!1}),vo=t.styled_default("div")({name:"SponsorText",class:"s1evcmtq",propsAsIs:!1}),ae=t.styled_default("div")({name:"ADLogo",class:"awodx0x",propsAsIs:!1}),fo=t.styled_default("span")({name:"SponsoredText",class:"s1q3n6oi",propsAsIs:!1}),Ao=t.styled_default("div")({name:"ActionBtnWrap",class:"a8d4xfk",propsAsIs:!1}),go=t.styled_default("a")({name:"ActionButton",class:"at6oobh",propsAsIs:!1}),xo=t.styled_default("div")({name:"Title",class:"t1gyg7tt",propsAsIs:!1}),Io="h17rwbtk",ho=t.styled_default("div")({name:"Container",class:"c10m2bce",propsAsIs:!1}),Q=t.styled_default("div")({name:"Item",class:"ig23yq5",propsAsIs:!1}),jo=t.styled_default("div")({name:"Dot",class:"d1f6aqua",propsAsIs:!1}),_o=({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(ho,{children:[s>1&&o.jsxs(o.Fragment,{children:[o.jsxs(Q,{children:[l," of ",s]}),o.jsx(jo,{})]}),o.jsxs(Q,{children:[n,":",r<10?`0${r}`:r]})]})},bo=(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}},No=t.styled_default("div")({name:"Container",class:"c4q6dw1",propsAsIs:!1}),So=t.styled_default("div")({name:"ControlsContainer",class:"c1la67r",propsAsIs:!1}),Po="m3guev",$o="m7099mt",To="mmm6o5s",Eo=({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,x]=g.useState(0),[_,A]=g.useState(0),I=g.useRef(),h=g.useCallback(()=>{y(0),x(0),A(0),i(!1),s==null||s({muted:!1})},[s]);g.useEffect(()=>{if(r!=null&&r.url&&p.current){h();const j=bo(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(),h()},onProgress:b=>{y(Math.round(b.duration-b.currentTime)),x(b.totalAds),A(b.adPosition)}})();return I.current=j,()=>{I.current=void 0,j()}}},[r==null?void 0:r.url,s,h,l,e.type,n]);const P=((c=e.sponsor)==null?void 0:c.logo)&&e.logoMode===u.PromotionLogoMode.CENTER;return o.jsxs(te,{className:"PromoOverlay",children:[o.jsxs(se,{children:[o.jsx(ne,{className:t.cx_default(!P&&le),children:o.jsx(ae,{style:{transform:"scale(1.5)"},children:"Ad"})}),o.jsxs(So,{children:[o.jsx(_o,{time:f,adCount:m,adPosition:_}),a&&o.jsx(t.b,{className:"ClosePromoIcon",close:()=>{var j;(j=I.current)==null||j.call(I),n==null||n(),h()}})]})]}),o.jsx(ie,{className:t.cx_default(Po,v&&$o,!v&&To),children:o.jsx(No,{ref:p})})]})},ee=e=>{var s,l,n,r,a,c,p,v,i,f,y,m,x,_,A,I,h,P,j,b,R,q,w,V,F,U,z,G,K,W;const{promotion:d,advertisementPaused:de,togglePause:N,controlVideo:$,skipAutoClose:ce,promotionId:T,onClose:me,markAsViewed:L,externalAd:H}=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,Y=!!((n=(l=d.banner)==null?void 0:l.video)!=null&&n.url),E=d.autoPlayVideo===u.AutoPlayVideo.ENABLED;if(g.useEffect(()=>{N==null||N(Y||E)},[]),g.useEffect(()=>{T&&d.type&&L&&L()},[T,d.type,L]),g.useEffect(()=>()=>{$==null||$({muted:!1})},[$]),H)return o.jsx(Eo,{...e,externalAd:H});let S=(r=d.banner)==null?void 0:r.url;S&&S.indexOf("http")!==0&&(S=`https://${S}`);let O=!0;return Y&&(!de||!E?O=!0:O=!1),o.jsxs(te,{className:"PromoOverlay",children:[o.jsxs(se,{children:[o.jsxs(ne,{className:t.cx_default(!k&&le),children:[((a=d.sponsor)==null?void 0:a.logo)&&d.logoMode===u.PromotionLogoMode.LEFT&&o.jsx(X,{src:(c=d.sponsor)==null?void 0:c.logo,alt:"promo"}),o.jsxs(yo,{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(co,{children:(i=d.sponsor)==null?void 0:i.name}),o.jsxs(vo,{className:"SponsorText",children:[o.jsx(ae,{children:"AD"}),o.jsx(fo,{children:"SPONSORED"})]})]})]}),o.jsx(t.b,{className:"ClosePromoIcon",close:me,autoClose:(f=d.closeTimer)==null?void 0:f.auto,duration:ce?0:(y=d.closeTimer)==null?void 0:y.seconds,isPlaying:O})]}),o.jsxs(ie,{children:[k&&o.jsx(X,{className:uo,src:(m=d.sponsor)==null?void 0:m.logo,alt:"promo"}),o.jsx(Z,{children:(_=(x=d.banner)==null?void 0:x.video)!=null&&_.url?o.jsx(t.Y,{source:(I=(A=d.banner)==null?void 0:A.video)==null?void 0:I.url,poster:(P=(h=d.banner)==null?void 0:h.video)==null?void 0:P.thumbnailUrl,aspectRatio:M?"1/1":"16/9",onPause:()=>{E&&(N==null||N(!0))},onPlay:()=>{t.eventBus.emit("advertisement",{action:"videoPlay",payload:{id:T,type:d.type}}),N==null||N(!1)},controlVideo:$,autoPlay:E}):(j=d.banner)!=null&&j.imageUrl?o.jsx(mo,{style:M?{aspectRatio:"1/1"}:{},src:(b=d.banner)==null?void 0:b.imageUrl,alt:"promo"}):null}),!M&&o.jsxs(Z,{children:[((R=d.banner)==null?void 0:R.title)&&o.jsx(xo,{className:t.cx_default("AdvTitle",k&&Io),children:(q=d.banner)==null?void 0:q.title}),((w=d.banner)==null?void 0:w.body)&&o.jsx(po,{className:"AdvDescription",children:(V=d.banner)==null?void 0:V.body})]})]}),d.buttonType!==u.PromotionButtonType.NO_BUTTON&&o.jsx(Ao,{children:o.jsx(go,{href:S,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":T,"data-promo-type":d.type,target:"_blank",children:(W=(K=d.banner)==null?void 0:K.ctaButton)==null?void 0:W.label})})]})},Co=t.styled_default("div")({name:"SidebarContainer",class:"s1abskp8",propsAsIs:!1}),Lo=({children:e,direction:s,style:l,className:n,hiding:r})=>o.jsx(B,{direction:s,style:l,hiding:r,className:n,children:o.jsx(Co,{children:e})}),Mo=e=>(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB11_LBAR||(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB21_LBAR,ko=e=>(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB11||(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB21,Oo=({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:x})=>e.promotion?c&&e.notification?o.jsx(ao,{open:i,notification:e.notification,promotionId:e.question.id}):!a&&!p&&(l||ko(e.promotion))?o.jsx(ro,{className:"PromoOverlayContainer",children:o.jsx(ee,{markAsViewed:v,promotionId:e.question.id,promotion:e.promotion,onClose:s,skipAutoClose:n,externalAd:f,controlVideo:y,advertisementPaused:m,togglePause:x})}):a&&(l||Mo(e.promotion))?o.jsx(Lo,{className:"PromoSidebarContainer",direction:a,hiding:!1,children:o.jsx(ee,{markAsViewed:v,promotionId:e.question.id,promotion:e.promotion,externalAd:f,onClose:s,controlVideo:y,skipAutoClose:n,advertisementPaused:m,togglePause:x})}):p?o.jsx(Ne,{promotionId:e.question.id,hiding:!1,promotion:e.promotion,direction:p}):null:null,Bo=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}})}},Ro=({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,x;const _=g.useRef(null),A=t.useStore(e.advertisement.$store);t.L(_,{enabled:!!A.data,event:"click",listener:Do});const I=!a&&!r;if(A.data===void 0||!v&&A.isViewed)return null;const h=((x=(m=(y=A==null?void 0:A.data)==null?void 0:y.notification)==null?void 0:m.promotion)==null?void 0:x.mode)===u.NotificationPromotionMode.LOWER_THIRD;return o.jsx(Bo,{ref:_,style:{height:I?"auto":"100%"},className:t.cx_default("SL-AdvertisementUIWrap",p&&"mobile-view",h&&"SL-AdvertisementUIWrap--lower-third"),children:o.jsx(Oo,{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})})},re=({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(Ro,{gamification:y,sidebar:s,banner:n,layoutMode:c,isMobileScreen:p,persistent:v,notification:i,skipTypeCheck:a,skipAutoClose:r,externalAd:l,controlVideo:e.controlVideoPlayer}):null},qo=({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.d,{customTheme:c??m,children:o.jsx(re,{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=qo;exports.StreamLayerSDKAdvertisementUI=re;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),g=require("react"),t=require("./index2.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,xe=e=>e==="left"||e==="right"?fe:ge,he=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,he(a),n&&!r&&Ie(a),n&&r&&xe(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}),$e=t.styled_default("div")({name:"Title",class:"tg2z08v",propsAsIs:!1}),Ee=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($e,{children:l}),n&&o.jsx(Ee,{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.h1,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}),xo=t.styled_default("div")({name:"Title",class:"t1gyg7tt",propsAsIs:!1}),ho="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",$o="m7099mt",Eo="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),x=g.useRef(),h=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){h();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(),h()},onProgress:b=>{y(Math.round(b.duration-b.currentTime)),I(b.totalAds),A(b.adPosition)}})();return x.current=j,()=>{x.current=void 0,j()}}},[r==null?void 0:r.url,s,h,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=x.current)==null||j.call(x),n==null||n(),h()}})]})]}),o.jsx(ae,{className:t.cx_default(To,v&&$o,!v&&Eo),children:o.jsx(Po,{ref:p})})]})},oe=e=>{var s,l,n,r,a,c,p,v,i,f,y,m,I,_,A,x,h,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:$,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),E=d.autoPlayVideo===u.AutoPlayVideo.ENABLED;if(g.useEffect(()=>{N==null||N(J||E),H==null||H()},[]),g.useEffect(()=>{$&&d.type&&L&&L()},[$,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||!E?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,{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:(x=(A=d.banner)==null?void 0:A.video)==null?void 0:x.url,poster:(S=(h=d.banner)==null?void 0:h.video)==null?void 0:S.thumbnailUrl,aspectRatio:M?"1/1":"16/9",onPause:()=>{E&&(N==null||N(!0))},onPlay:()=>{t.eventBus.emit("advertisement",{action:"videoPlay",payload:{id:$,type:d.type}}),N==null||N(!1)},controlVideo:T,autoPlay:E}):(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(xo,{className:t.cx_default("AdvTitle",k&&ho),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":$,"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 x=!a&&!r;if(A.data===void 0||!v&&A.isViewed)return null;const h=((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:x?"auto":"100%"},className:t.cx_default("SL-AdvertisementUIWrap",p&&"mobile-view",h&&"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.d,{customTheme:c??m,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;
|