1"use strict";(globalThis.__LOADABLE_LOADED_CHUNKS__||=[]).push([[6146],{60607(t,e,s){s.r(e),s.d(e,{default:()=>ct,mapStateToProps:()=>it});var a=s(2740),o=s(78047),l=s(2631),r=s.n(l),n=s(47844),i=s(5147),c=s(57690),d=s(18990),u=s(89092),p=s(13656),h=s(55102),m=s(23784),C=s(67032),S=s(10914),E=s(10660),g=s(89579),A=s(3495),k=s(66751),T=s(27473),y=s(18085),b=s(98122),v=s(52075),x=s(45479),f=s(24508),w=s(54389),I=s(70333),L=s(37880),_=s(43926),N=s(60746),O=s(5892),D=s(9140);const M=(0,k.createContext)(null),B=()=>{const t=(0,k.useContext)(M);if(!t)throw new Error("useChromecastContext must be used within a ChromecastProvider");return t};var j=s(6557),P=s(98293),F=s(65993),R=s.n(F),H=s(55729),G=s(32147);const V=(0,k.memo)(({variant:t})=>{const{t:e}=(0,I.Bd)(),{mediaType:s,state:o,options:l,ad:r}=(0,L.KQ)(),[,{play:n,pause:i}]=(0,G.H)(),d=(0,a.d4)(u.Fc),p=(0,a.d4)((0,c.G7)("player.livePause")),h=(0,k.useCallback)(()=>r.inBreak&&"lbanner"!==r.breakType&&l.optiExpo?.enabled&&l.optiExpo?.lastHit&&Date.now()-l.optiExpo.lastHit<200?null:o.isPlaying?i():n(),[r.inBreak,r.breakType,l.optiExpo?.enabled,l.optiExpo.lastHit,o.isPlaying,i,n]),m=r.inBreak&&"dai"!==r.breakType&&"lbanner"!==r.breakType?r.isAdPlaying:o.isPlaying,C="dai"!==r.breakType&&"live"===s&&(d&&p||!o.isPlaying||r.inBreak),S="dai"===r.breakType&&"live"===s&&d&&p,E="full"===t;return"live"!==s||C||S?(0,A.jsx)(L.Ec,{id:L.jx,handleInteraction:h,title:e(m?"player.controls.pause":"player.controls.play"),className:R()({[L.o4]:E}),children:(0,A.jsx)(H.In,{name:m?H.WW.Pause:H.WW.Play,iconSet:H.m_.CONTROLS,size:L.xi.XSMALL})}):null});var W=s(81084);const K=({variant:t,showTimeCodes:e=!0,showStoryboard:s=!0})=>{const{state:{streamType:a},actions:{seek:o}}=B(),l="LIVE"!==a,r=(0,k.useCallback)(t=>l&&o(t),[o,l]);return(0,A.jsx)(W.A,{variant:t,showTimeCodes:e,showStoryboard:s,onChange:r})};var U=s(74270),q=s(89535);const z=()=>{const t=(0,a.wA)(),{t:e}=(0,I.Bd)(),{state:{modal:{open:s,type:o}},metadata:{audioTracks:l,subtitles:r},actions:{setAudioTrack:n,setSubtitleTrack:i}}=(0,L.KQ)(),c=(0,k.useCallback)(()=>{t((0,_.YK)(L.ew.TRACKS,"bar"))},[t]),d=l.length>1||r.some(({forced:t})=>!t),u=s&&o===L.ew.TRACKS;return d?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(L.Ec,{tooltipPosition:"bottom",active:u,handleInteraction:c,id:L.IR,"aria-expanded":u,"aria-controls":"tracks-modal",title:e("player.controls.tracks"),children:(0,A.jsx)(H.In,{name:u?q.E:q.Z,iconSet:H.m_.CONTROLS,color:"white",size:L.xi.SMALL})}),(0,A.jsx)(U.M,{handleClose:c,audioTracks:l,subtitles:r,setAudioTrack:n,setSubtitleTrack:i})]}):null};var Q=s(68886);function X(){const{state:t,actions:e}=B(),{currentTime:s}=t,{seek:o}=e,{fullScreen:l}=(0,a.d4)(u.b),{t:r}=(0,I.Bd)();return(0,A.jsx)(L.wh,{onClick:()=>o(s-15),size:l?void 0:L.xi.XSMALL,tooltipPosition:"top",title:r("player.controls.seekBackward")})}function Z(){const{state:t,actions:e}=B(),{currentTime:s}=t,{seek:o}=e,{fullScreen:l}=(0,a.d4)(u.b),{t:r}=(0,I.Bd)();return(0,A.jsx)(L.qh,{onClick:()=>o(s+15),size:l?void 0:L.xi.XSMALL,tooltipPosition:"top",title:r("player.controls.seekForward")})}const J=()=>(0,A.jsx)(Q.f,{variant:"mini"}),Y=()=>(0,A.jsx)(V,{variant:"mini"}),$=()=>(0,A.jsx)(V,{variant:"full"}),tt={video:{mini:{slot2:null,slot3:null,slot4:null,slot5:null,slot6:X,slot7:Y,slot8:Z,slot9:()=>(0,A.jsx)(K,{variant:"side",showStoryboard:!1}),slot10:J},controller:{slot2:null,slot3:X,slot4:$,slot5:Z,slot6:null,slot7:null},topBar:{slot2:P.E,slot3:null,slot4:null,slot5:null,slot6:z,slot7:null,slot8:null,slot9:null},bottomBar:{slot1:null,slot2:null,slot3:null,slot4:null,slot5:null,slot6:null,slot7:null,slot8:J,slot9:j.m}},live:{mini:{slot2:null,slot3:null,slot4:null,slot5:null,slot6:null,slot7:Y,slot8:null,slot9:null,slot10:J},controller:{slot2:null,slot3:null,slot4:$,slot5:null,slot6:null,slot7:null},topBar:{slot2:null,slot3:null,slot4:null,slot5:null,slot6:z,slot7:null,slot8:null,slot9:null},bottomBar:{slot1:null,slot2:null,slot3:null,slot4:null,slot5:null,slot6:null,slot7:null,slot8:J,slot9:j.m}}},et=({children:t})=>(0,A.jsx)(A.Fragment,{children:t}),st=(0,k.memo)(()=>{const t=(0,a.wA)(),e=(0,k.useRef)(!0),{t:s}=(0,I.Bd)(),{fullScreen:o}=(0,a.d4)(u.b),{type:l}=(0,a.d4)(u.HG),{inBreak:r=!1,playing:n,breakType:i,options:{optiExpo:c}}=(0,a.d4)(D.B$),{state:d,actions:p}=B(),{metadata:h,castDevice:m,canDisplayMiniCastMedia:C,isPlaying:S,duration:E,currentTime:g,isMuted:T,streamType:b,audioTracks:v,subtitleTracks:x}=d,{seek:f,mute:w,stopChromecastCasting:M,setAudioTrack:j,setSubtitleTrack:P}=p;(0,k.useEffect)(()=>()=>{e.current=!1},[]);const F=(t=>{if(!t?.images?.length)return;const e=t.images[0],s=e.url.split("/")[5];return{caption:t.title,forceEager:!0,id:s,ratio:"1:1",idsByRatio:{"1:1":s},landscape:{src:e.url,id:s,caption:t.title,ratio:"1:1"}}})(h),R="LIVE"===b,H=g-(h?.sectionStartAbsoluteTime||g),G=o?N.y.FULL:N.y.MINI,V=tt[R?"live":"video"],W=(0,k.useMemo)(()=>({duration:E||0,currentTime:R?H:g,buffer:0}),[g,E,R,H]),K=(0,k.useMemo)(()=>({onManualClose:M,onMute:()=>w(!T),toggleModal:()=>t((0,_.YK)(L.ew.TRACKS,"bar")),toggleFullScreen:()=>{t((0,y.rT)(!o,{selector:G}))},toggleInfo:()=>{},seekBackInteraction:()=>{},seekForwardInteraction:()=>{},onAutoClose:()=>{},onCloseWithoutAnimation:()=>{},setAudioTrack:j,setSubtitleTrack:P}),[t,o,R,T,w,f,G,M]),U=(0,k.useMemo)(()=>({mediaType:R?"live":"audio",entityType:l,state:{isPlaying:S,isMuted:T,isFullScreen:o,isLoading:!1,isOverlayOpen:!1,isPortrait:!1,modal:{open:!1,type:""},isAudioPlayerClosing:!1},actions:K,metadata:{title:h?.title||"",extraTitle:h?.subtitle||"",authorName:"",image:F,audioTracks:v||[],subtitles:x||[]},ad:{inBreak:r,isAdPlaying:n,breakType:i},i18n:{infoLabel:s("player.controls.information"),seekBarLabel:s("player.controls.seekBarLabel"),seekBackwardButtonLabel:s("player.controls.seekBackward"),seekForwardButtonLabel:s("player.controls.seekForward"),fullScreenTooltipLabel:s("player.tooltip.fullScreen"),closeLabel:s("global.close"),playPause:s(S?"player.controls.pause":"player.controls.play"),fullScreen:s(o?"player.tooltip.exitFullScreen":"player.tooltip.fullScreen")},options:{hasBuffer:!1,skeleton:!1,noScrubberOverflow:!1,closeAnimationDelay:0,optiExpo:{enabled:c.enabled,lastHit:c?.lastHit}},slots:{TitleAction:et,...V}}),[o,F,R,T,S,h?.subtitle,h?.title,c?.enabled,c?.lastHit,K,V,s,x,v]);return C&&m?(0,A.jsxs)(L.JU,{value:U,playback:W,children:[(0,A.jsx)(O.O,{}),(0,A.jsx)(L.B,{})]}):null}),at=({children:t})=>{const[e,s]=(0,G.H)();return(0,A.jsx)(M.Provider,{value:{state:e,actions:s},children:t})},ot=(t,e)=>t&&e!==t,lt=document.location.hostname.includes("staging");class rt extends k.Component{constructor(t){super(t),this.state={frameworkLoaded:!!window.cast},window.__onGCastApiAvailable=t=>{t&&chrome.cast&&window.cast&&this.setState({frameworkLoaded:!0},()=>{this.initiate()})}}componentDidMount(){if(!this.state.frameworkLoaded){const t=document.createElement("script");
1t.type="text/javascript",t.src="//www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1",t.async=!0,t.defer=!0,document.head.appendChild(t)}}componentDidUpdate(t){if(this.state.frameworkLoaded&&(lt&&ot(this.props.chromecast.stagingAppId,t.chromecast.stagingAppId)&&this.castContext.setOptions({receiverApplicationId:this.props.chromecast.stagingAppId}),!lt&&ot(this.props.chromecast.appId,t.chromecast.appId)&&this.castContext.setOptions({receiverApplicationId:this.props.chromecast.appId}),this.props.chromecast.requestCasting!==t.chromecast.requestCasting&&!this.props.chromecast.requestCasting&&this.chromecastFlatpass?.stop(),(0,w.uj)()&&ot(this.props.hasVideoParentalFilterActivated,t.hasVideoParentalFilterActivated))){const{toggleChromecastCasting:e}=t;e(!1)}}componentWillUnmount(){this.castContext&&(this.castContext.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,this.onCastStateChanged),this.castContext.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.onSessionStateChanged)),this.chromecastFlatpass&&(this.chromecastFlatpass.removeEventListener(f.s.MEDIA_LOADED_CHANGED,this.onMediaLoadedChanged),this.chromecastFlatpass.removeEventListener(f.s.PLAYER_STATE_CHANGED,this.onChromecastStateChanged)),delete window.__onGCastApiAvailable,this.stopSession()}onCastStateChanged=t=>{const{toggleChromecastAvailability:e}=this.props;t.castState===cast.framework.CastState.NO_DEVICES_AVAILABLE?e(!1):t.castState===cast.framework.CastState.NOT_CONNECTED&&e(!0)};onSessionStateChanged=t=>{const{toggleChromecastCasting:e,displayFlashMessageWithTimeOut:s}=this.props;switch(x.A.debug("Chromecast",cast.framework.CastContextEventType.SESSION_STATE_CHANGED,t),t.sessionState){case cast.framework.SessionState.SESSION_STARTED:case cast.framework.SessionState.SESSION_RESUMED:e(!0),t.session.addMessageListener("urn:x-cast:bedrock.chromecast.tube",this.onSessionMessage);break;case cast.framework.SessionState.SESSION_START_FAILED:e(!1),s(b.Zo);break;case cast.framework.SessionState.SESSION_ENDED:x.A.error("Chromecast","onSessionEnded",t),this.stopSession(),s(b.kT);case cast.framework.SessionState.NO_SESSION:case cast.framework.SessionState.SESSION_ENDING:}switch(t.errorcode){case chrome.cast.ErrorCode.CANCEL:x.A.error("Chromecast","user cancelled cast",t),e(!1),s(b.AJ);break;case chrome.cast.ErrorCode.TIMEOUT:x.A.error("Chromecast","timeout",t),e(!1),s(b.Wc);break;case chrome.cast.ErrorCode.EXTENSION_NOT_COMPATIBLE:case chrome.cast.ErrorCode.EXTENSION_MISSING:x.A.error("Chromecast","extension problem",t),e(!1),s(b.gC);break;case chrome.cast.ErrorCode.CHANNEL_ERROR:case chrome.cast.ErrorCode.RECEIVER_UNAVAILABLE:x.A.error("Chromecast","receiver unavailable",t),e(!1),s(b.Z2);break;case chrome.cast.ErrorCode.LOAD_MEDIA_FAILED:x.A.error("Chromecast","load media failed",t),e(!1),s(b.Gp)}};onSessionMessage=(t,e)=>{let s;try{s=JSON.parse(e)}catch(e){return void x.A.error("Chromecast",t,e)}s.type!==v.A.ERROR&&this.props.dispatch({...s,meta:{...s.meta,remote:!0}})};onIsMutedChanged=({isMuted:t})=>{this.props.muted!==t&&this.props.dispatch((0,y.ho)(t))};onMediaLoadedChanged=t=>{if(t){const{media:t}=(0,w.OZ)();if(t){const{chromecastSwitchVideo:e}=this.props,{contentId:s}=t;e({id:s})}}};onChromecastStateChanged=t=>{const{chromecastChangeState:e}=this.props;e(t)};stopSession(){const t=(0,w.uj)();t&&(t.endSession(),this.props.toggleChromecastCasting(!1))}initiate(){const{stagingAppId:t,appId:e}=this.props.chromecast,s=document.location.hostname.includes("staging")&&t?t:e;this.castContext=cast.framework.CastContext.getInstance(),this.castContext.setOptions({receiverApplicationId:s,autoJoinPolicy:chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED}),this.castContext.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,this.onCastStateChanged),this.castContext.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.onSessionStateChanged),this.chromecastFlatpass=f.u.getInstance(),this.chromecastFlatpass.addEventListener(f.s.MEDIA_LOADED_CHANGED,this.onMediaLoadedChanged),this.chromecastFlatpass.addEventListener(f.s.PLAYER_STATE_CHANGED,this.onChromecastStateChanged)}render(){const{miniControllerActive:t}=this.props;return t?(0,A.jsx)(T.tH,{children:(0,A.jsx)(at,{children:(0,A.jsx)(st,{})})}):null}}rt.defaultProps={chromecast:{appId:"",requestCasting:!1,casting:!1,available:!1,deviceAvailable:!1,firstUsage:!1}};var nt=s(820);const it=t=>{const{volume:e}=(0,u.b)(t),s=(0,n.S)().getQueryData(h.C.list((0,E.$Q)(t)).queryKey),a=(0,C.$V)(t),o=(0,S.Hm)(t,r().get(a,"params.serviceCode")),l=r().get(o,"channel.code");return{chromecast:(0,nt.Q2)(t),active:!0,user:(0,E.wz)(t),profile:(0,m.Rk)(t,s),userOffers:(0,p.gW)(t),volume:e,miniControllerActive:(0,c.G7)("chromecastMiniController")(t)&&(0,nt.mh)(t),playground:t.playground||{},hasVideoParentalFilterActivated:(0,E.WI)(t),platformCode:(0,i.Nq)(t),channelCode:l}},ct=(0,a.Ng)(it,t=>({dispatch:t,...(0,o.zH)({toggleChromecastAvailability:g.Zx,toggleChromecastCasting:g.Ro,displayFlashMessageWithTimeOut:d.Pm,chromecastSwitchVideo:g.N3,chromecastChangeState:g.hQ},t)}))(rt)},5892(t,e,s){var a=s(3495),o=s(66751),l=s(65993),r=s.n(l),n=s(37880),i=s(40765),c=s(55729);const d=(0,o.lazy)(()=>s.e(7098).then(s.bind(s,27098)));s.d(e,["O",0,()=>{const{state:{isFullScreen:t}}=(0,n.KQ)(),e=(0,i.nZ)({isLocked:t});return(0,a.jsx)("aside",{ref:e,className:r()(n.Db,{[n.qG]:t,[n.Xn]:!t}),role:"dialog","aria-modal":t,"aria-labelledby":"fullaudio-title",id:"audio-full",children:(0,a.jsx)(o.Suspense,{fallback:(0,a.jsx)(c.In,{name:c.WW.Loading}),children:(0,a.jsx)(d,{})})})}])},52075(t,e,s){var a=s(2631),o=s.n(a),l=s(31523);
1const r=o().mapValues(l.CM,t=>`player/${t}`);delete r.__esModule;const n=r;s.d(e,["A",0,n])}}]); 2//# sourceMappingURL=sourcemaps/chromecast-sender-b14344a89fc7e94a.bundle.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.