(function(g){var window=this;'use strict';var Fiv=function(h){if(h instanceof g.FM)return h;if(typeof h.tS=="function")return h.tS(!1);if(g.Yy(h)){var t=0,Y=new g.FM;Y.next=function(){for(;;){if(t>=h.length)return g.yu;if(t in h)return g.si(h[t++]);t++}}; return Y}throw Error("Not implemented");},spE=function(h,t,Y){if(g.Yy(h))g.B1(h,t,Y); else for(h=Fiv(h);;){var L=h.next();if(L.done)break;t.call(Y,L.value,void 0,h)}},DM=function(h){g.qb(h,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.H1()).toString(36)); return h},h9=function(h,t,Y){Array.isArray(Y)||(Y=[String(Y)]); g.OGi(h.W,t,Y)},jp3=function(h,t){var Y=[]; spE(t,function(L){try{var q=g.ZW.prototype.T.call(this,L,!0)}catch(z){if(z=="Storage: Invalid value was encountered")return;throw z;}q===void 0?Y.push(L):g.R6i(q)&&Y.push(L)},h); return Y},Z$3=function(h,t){jp3(h,t).forEach(function(Y){g.ZW.prototype.remove.call(this,Y)},h)},b$v=function(h){if(h.UX){if(h.UX.locationOverrideToken)return{locationOverrideToken:h.UX.locationOverrideToken}; if(h.UX.latitudeE7!=null&&h.UX.longitudeE7!=null)return{latitudeE7:h.UX.latitudeE7,longitudeE7:h.UX.longitudeE7}}return null},o50=function(h,t){g.jE(h,t)||h.push(t)},dul=function(h){var t=0,Y; for(Y in h)t++;return t},GqP=function(h,t){return g.HZ(h,t)},QpE=function(h){try{return g.D$.JSON.parse(h)}catch(t){}h=String(h); if(/^\s*$/.test(h)?0:/^[\],:{}\s\u2028\u2029]*$/.test(h.replace(/\\["\\\/bfnrtu]/g,"@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+h+")")}catch(t){}throw Error("Invalid JSON string: "+h);},t9=function(h){if(g.D$.JSON)try{return g.D$.JSON.parse(h)}catch(t){}return QpE(h)},rTv=function(){var h=iQ(); this.G=h;h.LH("/client_streamz/youtube/living_room/mdx/channel/opened",g.ho("channel_type"))},cTy=function(){var h=iQ(); this.G=h;h.LH("/client_streamz/youtube/living_room/mdx/channel/closed",g.ho("channel_type"))},uk8=function(){var h=iQ(); this.G=h;h.LH("/client_streamz/youtube/living_room/mdx/channel/message_received",g.ho("channel_type"))},eYh=function(){var h=iQ(); this.G=h;h.LH("/client_streamz/youtube/living_room/mdx/channel/success")},JTl=function(){var h=iQ(); this.G=h;h.LH("/client_streamz/youtube/living_room/mdx/channel/error",g.ho("channel_type"),g.ho("error_type"))},pBl=function(){var h=iQ(); this.G=h;h.LH("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},v5h=function(){var h=iQ(); this.G=h;h.LH("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},Kiv=function(h,t,Y,L){var q=new g.mo(null); h&&g.DR(q,h);t&&g.hS(q,t);Y&&g.tS(q,Y);L&&(q.T=L);return q},aFs=function(h,t){return new g.Ih(h,t)},gm=function(h,t){return Object.prototype.hasOwnProperty.call(h,t)},xuh=function(h,t){return h===t},YS=function(h,t){this.T={}; this.G=[];this.T2=this.size=0;var Y=arguments.length;if(Y>1){if(Y%2)throw Error("Uneven number of arguments");for(var L=0;L5&&(h=h.slice(h.length-5)); var t=g.CQ(jFP(),function(L){return L.loungeToken}),Y=g.CQ(h,function(L){return L.loungeToken}); g.MG(Y,function(L){return!g.jE(t,L)})&&Zil(); g.dK("yt-remote-local-screens",h,31536E3)},W4=function(h){h||(g.QS("yt-remote-session-screen-id"),g.QS("yt-remote-session-video-id")); FJ0();h=H4();g.bl(h,wm());CZ8(h)},oTv=function(){if(!yq){var h=g.r$(); h&&(yq=new g.Fg(h))}},dcH=function(){oTv(); return yq?!!yq.get("yt-remote-use-staging-server"):!1},Xt=function(h,t){g.Tg[h]=!0; var Y=g.fN();Y&&Y.publish.apply(Y,arguments);g.Tg[h]=!1},Gz8=function(){},iQ=function(){if(!Ut){Ut=new g.vk(new Gz8); var h=g.W2("client_streamz_web_flush_count",-1);h!==-1&&(Ut.S=h)}return Ut},QF0=function(){var h=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return h?parseInt(h[1],10):0},r78=function(h){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+h)!=-1||document.currentScript.src.indexOf("&"+h)!=-1)},c7L=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},Cg=function(h){h.length?uxv(h.shift(),function(){Cg(h)}):eX1()},J7h=function(h){return"chrome-extension://"+h+"/cast_sender.js"},uxv=function(h,t,Y){var L=document.createElement("script"); L.onerror=t;Y&&(L.onload=Y);g.je(L,g.Uy(h));(document.head||document.documentElement).appendChild(L)},p2v=function(){var h=QF0(),t=[]; if(h>1){var Y=h-1;t.push("//www.gstatic.com/eureka/clank/"+h+"/cast_sender.js");t.push("//www.gstatic.com/eureka/clank/"+Y+"/cast_sender.js")}return t},eX1=function(){var h=c7L(); h&&h(!1,"No cast extension found")},KJl=function(){if(vT1){var h=2,t=c7L(),Y=function(){h--; h==0&&t&&t(!0)}; window.__onGCastApiAvailable=Y;uxv("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",eX1,Y)}},aHE=function(){KJl(); var h=p2v();h.push("//www.gstatic.com/eureka/clank/cast_sender.js");Cg(h)},ETv=function(){KJl(); var h=p2v();h.push.apply(h,g.p(xcs.map(J7h)));h.push("//www.gstatic.com/eureka/clank/cast_sender.js");Cg(h)},ME=function(h,t,Y){g.O.call(this); this.U=Y!=null?(0,g.Vv)(h,Y):h;this.iM=t;this.X=(0,g.Vv)(this.ut,this);this.G=!1;this.T=0;this.S=this.yb=null;this.W=[]},Ft=function(){},kz3=function(){g.nX.call(this,"p")},Oil=function(){g.nX.call(this,"o")},fHs=function(){return nT0=nT0||new g.Vm},$cl=function(h){g.nX.call(this,"serverreachability",h)},jY=function(h){var t=fHs(); t.dispatchEvent(new $cl(t,h))},Tjv=function(h){g.nX.call(this,"statevent",h)},Za=function(h){var t=fHs(); t.dispatchEvent(new Tjv(t,h))},A7l=function(h,t,Y,L){g.nX.call(this,"timingevent",h); this.size=t;this.rtt=Y;this.retries=L},bQ=function(h,t){if(typeof h!=="function")throw Error("Fn must not be null and must be a function"); return g.D$.setTimeout(function(){h()},t)},ol=function(){},dm=function(h,t,Y,L){this.S=h; this.W=t;this.Ds=Y;this.Hq=L||1;this.MD=new g.H$(this);this.iP=45E3;this.Zx=null;this.U=!1;this.L=this.JQ=this.Y=this.Ne=this.R0=this.tQ=this.AQ=null;this.x8=[];this.G=null;this.C=0;this.X=this.Wm=null;this.Pq=-1;this.X5=!1;this.yG=0;this.Y8=null;this.Q4=this.lP=this.G$=this.gU=!1;this.T=new SAC},SAC=function(){this.S=null; this.G="";this.T=!1},RXL=function(h,t,Y){h.Ne=1; h.Y=DM(t.clone());h.L=Y;h.gU=!0;IH3(h,null)},IH3=function(h,t){h.R0=Date.now(); GC(h);h.JQ=h.Y.clone();h9(h.JQ,"t",h.Hq);h.C=0;var Y=h.S.Ne;h.T=new SAC;h.G=BjE(h.S,Y?t:null,!h.L);h.yG>0&&(h.Y8=new g.AS((0,g.Vv)(h.zj,h,h.G),h.yG));h.MD.listen(h.G,"readystatechange",h.Ts);t=h.Zx?g.Uw(h.Zx):{};h.L?(h.Wm||(h.Wm="POST"),t["Content-Type"]="application/x-www-form-urlencoded",h.G.send(h.JQ,h.Wm,h.L,t)):(h.Wm="GET",h.G.send(h.JQ,h.Wm,null,t));jY(1)},mcL=function(h){if(!PZ8(h))return g.Tc(h.G); var t=g.AH(h.G);if(t==="")return"";var Y="",L=t.length,q=g.fm(h.G)==4;if(!h.T.S){if(typeof TextDecoder==="undefined")return Qq(h),rm(h),"";h.T.S=new g.D$.TextDecoder}for(var z=0;zt.length)return DcC;t=t.slice(L,L+Y);h.C=L+Y;return t},GC=function(h){h.tQ=Date.now()+h.iP; iY1(h,h.iP)},iY1=function(h,t){if(h.AQ!=null)throw Error("WatchDog timer not null"); h.AQ=bQ((0,g.Vv)(h.Rg,h),t)},gIy=function(h){h.AQ&&(g.D$.clearTimeout(h.AQ),h.AQ=null)},rm=function(h){h.S.bj()||h.X5||YaE(h.S,h)},Qq=function(h){gIy(h); g.hN(h.Y8);h.Y8=null;h.MD.removeAll();if(h.G){var t=h.G;h.G=null;t.abort();t.dispose()}},wY1=function(h,t){try{var Y=h.S; if(Y.BM!=0&&(Y.G==h||LeE(Y.T,h)))if(!h.lP&&LeE(Y.T,h)&&Y.BM==3){try{var L=Y.eh.G.parse(t)}catch(d){L=null}if(Array.isArray(L)&&L.length==3){var q=L;if(q[0]==0)a:{if(!Y.Y){if(Y.G)if(Y.G.R0+3E30&&(Y.yG=1.5*l);L=Y;var H=h.xr();if(H){var w=g.St(H,"X-Client-Wire-Protocol");if(w){var W=L.T;!W.G&&(g.Jd(w,"spdy")||g.Jd(w,"quic")||g.Jd(w,"h2"))&&(W.W=W.X,W.G=new Set,W.T&&(VqP(W,W.T),W.T=null))}if(L.gU){var y=g.St(H,"X-HTTP-Session-Id");y&&(L.UX=y,g.qb(L.Zx,L.gU,y))}}Y.BM=3;Y.X&&Y.X.NO();Y.dP&&(Y.pn=Date.now()-h.R0);L=Y;var X=h;L.m$=NKl(L,L.Ne?L.Hq:null,L.Ds);if(X.lP){lZ3(L.T, X);var U=X,C=L.yG;C&&U.setTimeout(C);U.AQ&&(gIy(U),GC(U));L.G=X}else HYl(L);Y.S.length>0&&J9(Y)}else z[0]!="stop"&&z[0]!="close"||eY(Y,7);else Y.BM==3&&(z[0]=="stop"||z[0]=="close"?z[0]=="stop"?eY(Y,7):Y.disconnect():z[0]!="noop"&&Y.X&&Y.X.X4(z),Y.x8=0)}jY(4)}catch(d){}},WeC=function(h,t){this.G=h; this.map=t;this.context=null},yGv=function(h){this.X=h||10; g.D$.PerformanceNavigationTiming?(h=g.D$.performance.getEntriesByType("navigation"),h=h.length>0&&(h[0].nextHopProtocol=="hq"||h[0].nextHopProtocol=="h2")):h=!!(g.D$.chrome&&g.D$.chrome.loadTimes&&g.D$.chrome.loadTimes()&&g.D$.chrome.loadTimes().wasFetchedViaSpdy);this.W=h?this.X:1;this.G=null;this.W>1&&(this.G=new Set);this.T=null;this.S=[]},XY8=function(h){return h.T?!0:h.G?h.G.size>=h.W:!1},zL1=function(h){return h.T?1:h.G?h.G.size:0},LeE=function(h,t){return h.T?h.T==t:h.G?h.G.has(t):!1},VqP= function(h,t){h.G?h.G.add(t):h.T=t},lZ3=function(h,t){h.T&&h.T==t?h.T=null:h.G&&h.G.has(t)&&h.G.delete(t)},UM0=function(h){if(h.T!=null)return h.S.concat(h.T.x8); if(h.G!=null&&h.G.size!==0){var t=h.S;h=g.b(h.G.values());for(var Y=h.next();!Y.done;Y=h.next())t=t.concat(Y.value.x8);return t}return g.ul(h.S)},CeE=function(h,t){var Y=new ol; if(g.D$.Image){var L=new Image;L.onload=g.Nh(pg,Y,"TestLoadImage: loaded",!0,t,L);L.onerror=g.Nh(pg,Y,"TestLoadImage: error",!1,t,L);L.onabort=g.Nh(pg,Y,"TestLoadImage: abort",!1,t,L);L.ontimeout=g.Nh(pg,Y,"TestLoadImage: timeout",!1,t,L);g.D$.setTimeout(function(){if(L.ontimeout)L.ontimeout()},1E4); L.src=h}else t(!1)},MqP=function(h,t){var Y=new ol,L=new AbortController,q=setTimeout(function(){L.abort(); pg(Y,"TestPingServer: timeout",!1,t)},1E4); fetch(h,{signal:L.signal}).then(function(z){clearTimeout(q);z.ok?pg(Y,"TestPingServer: ok",!0,t):pg(Y,"TestPingServer: server error",!1,t)}).catch(function(){clearTimeout(q); pg(Y,"TestPingServer: error",!1,t)})},pg=function(h,t,Y,L,q){try{q&&(q.onload=null,q.onerror=null,q.onabort=null,q.ontimeout=null),L(Y)}catch(z){}},Fel=function(){this.G=new Ft},szn=function(h,t,Y){var L=Y||""; try{g.Pm(h,function(q,z){var V=q;g.LH(q)&&(V=g.aR(q));t.push(L+z+"="+encodeURIComponent(V))})}catch(q){throw t.push(L+"type="+encodeURIComponent("_badmap")),q; }},v4=function(h,t,Y){return Y&&Y.xH?Y.xH[h]||t:t},jz1=function(h){this.S=[]; this.Hq=this.m$=this.Zx=this.Ds=this.G=this.UX=this.gU=this.X5=this.C=this.Pq=this.L=null;this.Y1=this.JQ=0;this.NU=v4("failFast",!1,h);this.lP=this.AQ=this.Y=this.U=this.X=null;this.y4=!0;this.M6=this.Y8=-1;this.Q4=this.x8=this.R0=0;this.XI=v4("baseRetryDelayMs",5E3,h);this.Df=v4("retryDelaySeedMs",1E4,h);this.Cr=v4("forwardChannelMaxRetries",2,h);this.Vb=v4("forwardChannelRequestTimeoutMs",2E4,h);this.R7=h&&h.cmz||void 0;this.mK=h&&h.a6i||void 0;this.sX=h&&h.uEi||!1;this.yG=void 0;this.Ne=h&&h.R0e|| !1;this.W="";this.T=new yGv(h&&h.m4m);this.eh=new Fel;this.MD=h&&h.Pe5||!1;this.tQ=h&&h.BAM||!1;this.MD&&this.tQ&&(this.tQ=!1);this.lR=h&&h.fR8||!1;h&&h.uom&&(this.y4=!1);this.dP=!this.MD&&this.y4&&h&&h.y_U||!1;this.fn=void 0;h&&h.dR&&h.dR>0&&(this.fn=h.dR);this.Im=void 0;this.pn=0;this.iP=!1;this.G$=this.Wm=null},uQ=function(h){h.G&&(ZYv(h),h.G.cancel(),h.G=null)},bYL=function(h){uQ(h); h.Y&&(g.D$.clearTimeout(h.Y),h.Y=null);c4(h);h.T.cancel();h.U&&(typeof h.U==="number"&&g.D$.clearTimeout(h.U),h.U=null)},J9=function(h){XY8(h.T)||h.U||(h.U=!0,g.ZL(h.Zl,h),h.R0=0)},dMH=function(h,t){if(zL1(h.T)>=h.T.W-(h.U?1:0))return!1; if(h.U)return h.S=t.x8.concat(h.S),!0;if(h.BM==1||h.BM==2||h.R0>=(h.NU?0:h.Cr))return!1;h.U=bQ((0,g.Vv)(h.Zl,h,t),oIl(h,h.R0));h.R0++;return!0},QzC=function(h,t){var Y; t?Y=t.Ds:Y=h.JQ++;var L=h.Zx.clone();g.qb(L,"SID",h.W);g.qb(L,"RID",Y);g.qb(L,"AID",h.Y8);Kg(h,L);h.C&&h.L&&g.l3(L,h.C,h.L);Y=new dm(h,h.W,Y,h.R0+1);h.C===null&&(Y.Zx=h.L);t&&(h.S=t.x8.concat(h.S));t=GIv(h,Y,1E3);Y.setTimeout(Math.round(h.Vb*.5)+Math.round(h.Vb*.5*Math.random()));VqP(h.T,Y);RXL(Y,L,t)},Kg=function(h,t){h.X5&&g.hd(h.X5,function(Y,L){g.qb(t,L,Y)}); h.X&&g.Pm({},function(Y,L){g.qb(t,L,Y)})},GIv=function(h,t,Y){Y=Math.min(h.S.length,Y); var L=h.X?(0,g.Vv)(h.X.ge,h.X,h):null;a:{for(var q=h.S,z=-1;;){var V=["count="+Y];z==-1?Y>0?(z=q[0].G,V.push("ofs="+z)):z=0:V.push("ofs="+z);for(var l=!0,H=0;H=3)return!1; h.Q4++;h.Y=bQ((0,g.Vv)(h.Ev,h),oIl(h,h.x8));h.x8++;return!0},ZYv=function(h){h.Wm!=null&&(g.D$.clearTimeout(h.Wm),h.Wm=null)},rGy=function(h){h.G=new dm(h,h.W,"rpc",h.Q4); h.C===null&&(h.G.Zx=h.L);h.G.yG=0;var t=h.m$.clone();g.qb(t,"RID","rpc");g.qb(t,"SID",h.W);g.qb(t,"AID",h.Y8);g.qb(t,"CI",h.lP?"0":"1");!h.lP&&h.fn&&g.qb(t,"TO",h.fn);g.qb(t,"TYPE","xmlhttp");Kg(h,t);h.C&&h.L&&g.l3(t,h.C,h.L);h.yG&&h.G.setTimeout(h.yG);var Y=h.G;h=h.Hq;Y.Ne=1;Y.Y=DM(t.clone());Y.L=null;Y.gU=!0;IH3(Y,h)},c4=function(h){h.AQ!=null&&(g.D$.clearTimeout(h.AQ),h.AQ=null)},YaE=function(h,t){var Y=null; if(h.G==t){c4(h);ZYv(h);h.G=null;var L=2}else if(LeE(h.T,t))Y=t.x8,lZ3(h.T,t),L=1;else return;if(h.BM!=0)if(t.U)if(L==1){Y=t.L?t.L.length:0;t=Date.now()-t.R0;var q=h.R0;L=fHs();L.dispatchEvent(new A7l(L,Y,t,q));J9(h)}else HYl(h);else{var z=t.Pq;q=t.getLastError();if(q==3||q==0&&z>0||!(L==1&&dMH(h,t)||L==2&&qaE(h)))switch(Y&&Y.length>0&&(t=h.T,t.S=t.S.concat(Y)),q){case 1:eY(h,5);break;case 4:eY(h,10);break;case 3:eY(h,6);break;default:eY(h,2)}}},oIl=function(h,t){var Y=h.XI+Math.floor(Math.random()* h.Df); h.isActive()||(Y*=2);return Y*t},eY=function(h,t){if(t==2){var Y=(0,g.Vv)(h.z0e,h),L=h.mK,q=!L; L=new g.mo(L||"//www.google.com/images/cleardot.gif");g.D$.location&&g.D$.location.protocol=="http"||g.DR(L,"https");DM(L);q?CeE(L.toString(),Y):MqP(L.toString(),Y)}else Za(2);h.BM=0;h.X&&h.X.Uv(t);cGP(h);bYL(h)},cGP=function(h){h.BM=0; h.G$=[];if(h.X){var t=UM0(h.T);if(t.length!=0||h.S.length!=0)g.v1(h.G$,t),g.v1(h.G$,h.S),h.T.S.length=0,g.ul(h.S),h.S.length=0;h.X.Ke()}},u4s=function(h){if(h.BM==0)return h.G$; var t=[];g.v1(t,UM0(h.T));g.v1(t,h.S);return t},NKl=function(h,t,Y){var L=g.zU(Y); L.G!=""?(t&&g.hS(L,t+"."+L.G),g.tS(L,L.S)):(L=g.D$.location,L=Kiv(L.protocol,t?t+"."+L.hostname:L.hostname,+L.port,Y));t=h.gU;Y=h.UX;t&&Y&&g.qb(L,t,Y);g.qb(L,"VER",h.Q9);Kg(h,L);return L},BjE=function(h,t,Y){if(t&&!h.Ne)throw Error("Can't create secondary domain capable XhrIo object."); t=h.sX&&!h.R7?new g.kc(new g.Sw({V_:Y})):new g.kc(h.R7);t.C=h.Ne;return t},eL8=function(){},JGl=function(){},xS=function(h,t){g.Vm.call(this); this.G=new jz1(t);this.X=h;this.T=t&&t.axG||null;h=t&&t.n88||null;t&&t.lR0&&(h?h["X-Client-Protocol"]="webchannel":h={"X-Client-Protocol":"webchannel"});this.G.L=h;h=t&&t.pAb||null;t&&t.hT&&(h?h["X-WebChannel-Content-Type"]=t.hT:h={"X-WebChannel-Content-Type":t.hT});t&&t.nY&&(h?h["X-WebChannel-Client-Profile"]=t.nY:h={"X-WebChannel-Client-Profile":t.nY});this.G.Pq=h;(h=t&&t.XA5)&&!g.e$(h)&&(this.G.C=h);this.U=t&&t.R0e||!1;this.W=t&&t.Hii||!1;(t=t&&t.hZ)&&!g.e$(t)&&(this.G.gU=t,g.lv(this.T,t)&&(h= this.T,t in h&&delete h[t]));this.S=new al(this)},pY1=function(h){kz3.call(this); h.__headers__&&(this.headers=h.__headers__,this.statusCode=h.__status__,delete h.__headers__,delete h.__status__);var t=h.__sm__;t?this.data=(this.G=g.qn(t))?g.yo(t,this.G):t:this.data=h},vIs=function(h){Oil.call(this); this.status=1;this.errorCode=h},al=function(h){this.G=h},Kev=function(h,t){this.T=h; this.G=t},aZl=function(h){return u4s(h.G).map(function(t){var Y=h.T; t=t.map;"__data__"in t?(t=t.__data__,Y=Y.W?QpE(t):t):Y=t;return Y})},Et=function(h,t){if(typeof h!=="function")throw Error("Fn must not be null and must be a function"); return g.D$.setTimeout(function(){h()},t)},Ot=function(h){kS.dispatchEvent(new xME(kS,h))},xME=function(h){g.nX.call(this,"statevent",h)},ng=function(h,t,Y,L){this.G=h; this.W=t;this.C=Y;this.U=L||1;this.T=45E3;this.S=new g.H$(this);this.X=new g.et;this.X.setInterval(250)},kIH=function(h,t,Y){h.LO=1; h.pj=DM(t.clone());h.Zw=Y;h.gU=!0;EI0(h,null)},OYv=function(h,t,Y,L,q){h.LO=1; h.pj=DM(t.clone());h.Zw=null;h.gU=Y;q&&(h.aK=!1);EI0(h,L)},EI0=function(h,t){h.Dd=Date.now(); nIE(h);h.hg=h.pj.clone();h9(h.hg,"t",h.U);h.qY=0;h.ek=h.G.uN(h.G.lm()?t:null);h.oo>0&&(h.wI=new g.AS((0,g.Vv)(h.Ce,h,h.ek),h.oo));h.S.listen(h.ek,"readystatechange",h.c_);t=h.Q3?g.Uw(h.Q3):{};h.Zw?(h.MY="POST",t["Content-Type"]="application/x-www-form-urlencoded",h.ek.send(h.hg,h.MY,h.Zw,t)):(h.MY="GET",h.aK&&!g.lI&&(t.Connection="close"),h.ek.send(h.hg,h.MY,null,t));h.G.LV(1)},TK0=function(h,t){var Y=h.qY,L=t.indexOf("\n",Y); if(L==-1)return fZs;Y=Number(t.substring(Y,L));if(isNaN(Y))return $Ms;L+=1;if(L+Y>t.length)return fZs;t=t.slice(L,L+Y);h.qY=L+Y;return t},nIE=function(h){h.GU=Date.now()+h.T; AG8(h,h.T)},AG8=function(h,t){if(h.rb!=null)throw Error("WatchDog timer not null"); h.rb=Et((0,g.Vv)(h.eY,h),t)},SaP=function(h){h.rb&&(g.D$.clearTimeout(h.rb),h.rb=null)},IZs=function(h){h.G.bj()||h.NL||h.G.TU(h)},fg=function(h){SaP(h); g.hN(h.wI);h.wI=null;h.X.stop();h.S.removeAll();if(h.ek){var t=h.ek;h.ek=null;t.abort();t.dispose()}h.TC&&(h.TC=null)},RLH=function(h,t){try{h.G.Dl(h,t),h.G.LV(4)}catch(Y){}},PeP=function(h,t,Y,L,q){if(L==0)Y(!1); else{var z=q||0;L--;BKv(h,t,function(V){V?Y(!0):g.D$.setTimeout(function(){PeP(h,t,Y,L,z)},z)})}},BKv=function(h,t,Y){var L=new Image; L.onload=function(){try{$S(L),Y(!0)}catch(q){}}; L.onerror=function(){try{$S(L),Y(!1)}catch(q){}}; L.onabort=function(){try{$S(L),Y(!1)}catch(q){}}; L.ontimeout=function(){try{$S(L),Y(!1)}catch(q){}}; g.D$.setTimeout(function(){if(L.ontimeout)L.ontimeout()},t); L.src=h},$S=function(h){h.onload=null; h.onerror=null;h.onabort=null;h.ontimeout=null},mM3=function(h){this.G=h; this.T=new Ft},DML=function(h){var t=TC(h.G,h.Zn,"/mail/images/cleardot.gif"); DM(t);PeP(t.toString(),5E3,(0,g.Vv)(h.Bf,h),3,2E3);h.LV(1)},ha0=function(h){var t=h.G.U; t!=null?(Ot(5),t?(Ot(11),A9(h.G,h,!1)):(Ot(12),A9(h.G,h,!0))):(h.qG=new ng(h),h.qG.Q3=h.Ro,t=h.G,t=TC(t,t.lm()?h.nD:null,h.Sj),Ot(5),h9(t,"TYPE","xmlhttp"),OYv(h.qG,t,!1,h.nD,!1))},t4P=function(h,t,Y){this.G=1; this.T=[];this.S=[];this.X=new Ft;this.L=h||null;this.U=t!=null?t:null;this.Y=Y||!1},ijv=function(h,t){this.G=h; this.map=t;this.context=null},gL1=function(h,t,Y,L){g.nX.call(this,"timingevent",h); this.size=t;this.rtt=Y;this.retries=L},YxL=function(h){g.nX.call(this,"serverreachability",h)},qx8=function(h){h.W_(1,0); h.Ad=TC(h,null,h.ej);LP1(h)},za3=function(h){h.gN&&(h.gN.abort(),h.gN=null); h.aF&&(h.aF.cancel(),h.aF=null);h.St&&(g.D$.clearTimeout(h.St),h.St=null);SY(h);h.g4&&(h.g4.cancel(),h.g4=null);h.tK&&(g.D$.clearTimeout(h.tK),h.tK=null)},V4h=function(h,t){if(h.G==0)throw Error("Invalid operation: sending map when state is closed"); h.T.push(new ijv(h.zs++,t));h.G!=2&&h.G!=3||LP1(h)},NIv=function(h){var t=0; h.aF&&t++;h.g4&&t++;return t},LP1=function(h){h.g4||h.tK||(h.tK=Et((0,g.Vv)(h.V9,h),0),h.vk=0)},wql=function(h,t){if(h.G==1){if(!t){h.H4=Math.floor(Math.random()*1E5); t=h.H4++;var Y=new ng(h,"",t);Y.Q3=h.bz;var L=lbn(h),q=h.Ad.clone();g.qb(q,"RID",t);g.qb(q,"CVER","1");Il(h,q);kIH(Y,q,L);h.g4=Y;h.G=2}}else h.G==3&&(t?Hj3(h,t):h.T.length==0||h.g4||Hj3(h))},Hj3=function(h,t){if(t)if(h.KA>6){h.T=h.S.concat(h.T); h.S.length=0;var Y=h.H4-1;t=lbn(h)}else Y=t.C,t=t.Zw;else Y=h.H4++,t=lbn(h);var L=h.Ad.clone();g.qb(L,"SID",h.W);g.qb(L,"RID",Y);g.qb(L,"AID",h.Fp);Il(h,L);Y=new ng(h,h.W,Y,h.vk+1);Y.Q3=h.bz;Y.setTimeout(1E4+Math.round(1E4*Math.random()));h.g4=Y;kIH(Y,L,t)},Il=function(h,t){h.wk&&(h=h.wk.kW())&&g.hd(h,function(Y,L){g.qb(t,L,Y)})},lbn=function(h){var t=Math.min(h.T.length,1E3),Y=["count="+t]; if(h.KA>6&&t>0){var L=h.T[0].G;Y.push("ofs="+L)}else L=0;for(var q={},z=0;z=3)return!1; h.C++;h.St=Et((0,g.Vv)(h.Ov,h),yqC(h,h.yZ));h.yZ++;return!0},A9=function(h,t,Y){h.JX=h.U==null?Y:!h.U; h.Ey=t.Tt;h.Y||qx8(h)},SY=function(h){h.fA!=null&&(g.D$.clearTimeout(h.fA),h.fA=null)},yqC=function(h,t){var Y=5E3+Math.floor(Math.random()*1E4); h.isActive()||(Y*=2);return Y*t},Rl=function(h,t){if(t==2||t==9){var Y=null; h.wk&&(Y=null);var L=(0,g.Vv)(h.WT5,h);Y||(Y=new g.mo("//www.google.com/images/cleardot.gif"),DM(Y));BKv(Y.toString(),1E4,L)}else Ot(2);Uq3(h,t)},Uq3=function(h,t){h.G=0; h.wk&&h.wk.rM(t);Cjy(h);za3(h)},Cjy=function(h){h.G=0; h.Ey=-1;if(h.wk)if(h.S.length==0&&h.T.length==0)h.wk.c9();else{var t=g.ul(h.S),Y=g.ul(h.T);h.S.length=0;h.T.length=0;h.wk.c9(t,Y)}},TC=function(h,t,Y){var L=g.zU(Y); if(L.G!="")t&&g.hS(L,t+"."+L.G),g.tS(L,L.S);else{var q=window.location;L=Kiv(q.protocol,t?t+"."+q.hostname:q.hostname,+q.port,Y)}h.mq&&g.hd(h.mq,function(z,V){g.qb(L,V,z)}); g.qb(L,"VER",h.KA);Il(h,L);return L},M4n=function(){},FP1=function(){this.G=[]; this.T=[]},sYE=function(h){g.nX.call(this,"channelMessage"); this.message=h},jYC=function(h){g.nX.call(this,"channelError"); this.error=h},Zj8=function(h,t){this.action=h; this.params=t||{}},B4=function(h,t){g.O.call(this); this.G=new g.nE(this.ae5,0,this);g.f(this,this.G);this.iM=5E3;this.T=0;if(typeof h==="function")t&&(h=(0,g.Vv)(h,t));else if(h&&typeof h.handleEvent==="function")h=(0,g.Vv)(h.handleEvent,h);else throw Error("Invalid listener argument");this.S=h},bjL=function(h,t,Y,L,q,z,V,l,H,w,W,y,X,U){Y=Y===void 0?!1:Y; L=L===void 0?function(){return""}:L; q=q===void 0?!1:q;z=z===void 0?!1:z;V=V===void 0?!1:V;l=l===void 0?function(){return g.Gc({})}:l; H=H===void 0?!1:H;W=W===void 0?!1:W;y=y===void 0?!1:y;X=X===void 0?!1:X;U=U===void 0?!1:U;this.Ne=h;this.AQ=t;this.U=new g.Mz;this.T=new B4(this.Zr_,this);this.G=null;this.C=!1;this.L=null;this.R0="";this.x8=this.Y=0;this.S=[];this.Q4=Y;this.gU=L;this.X=z;this.Zx=l;this.X5=w;this.Hq=V;this.Wm=null;this.W=g.Gc();this.Ds=q;this.G$=H;this.MD=W;this.tQ=y;this.y4=X;this.Pq=U;this.yG=new rTv;this.lP=new cTy;this.iP=new eYh;this.JQ=new uk8;this.Y8=new JTl;this.dP=new pBl;this.Im=new v5h},GYC=function(h, t,Y,L,q){oLv(h); if(h.G){var z=g.Ey("ID_TOKEN"),V=h.G.bz||{};z?V["x-youtube-identity-token"]=z:delete V["x-youtube-identity-token"];h.G.bz=V}dqH(h);L?(L.getState()!=3&&NIv(L)==0||L.getState(),h.G.connect(t,Y,h.AQ,L.W,L.Fp)):q?h.G.connect(t,Y,h.AQ,q.sessionId,q.arrayId):h.G.connect(t,Y,h.AQ)},uHP=function(h,t){return h.y4?!0:h.tQ?Object.values(QYP).includes(t):h.MD?!Object.values(rq1).includes(t):h.Pq?Object.values(cql).includes(t):!1},pqH=function(h){var t,Y; g.k(function(L){if(L.T==1)return g.d3(L,2),g.K(L,eaE(h),2);g.pL(L);t=h.S;h.S=[];Y=t.length;Jq1(h,t,Y);P4(h);return g.vW(L,0)})},Jq1=function(h,t,Y){for(var L=0;L0?Y=Object.assign({},Y,t):delete Y.Authorization;h.G.bz=Y}},dqH=function(h){h.X5&&!h.X&&KP0(h,h.X5())},mF=function(h){this.scheme="https"; this.port=this.domain="";this.G="/api/lounge";this.T=!0;h=h||document.location.href;var t=Number(g.zF(h)[4]||null)||"";t&&(this.port=":"+t);this.domain=g.VC(h)||"";h=g.xp();h.search("MSIE")>=0&&(h=h.match(/MSIE ([\d.]+)/)[1],g.a7(h,"10.0")<0&&(this.T=!1))},Da=function(h,t){var Y=h.G; h.T&&(Y=h.scheme+"://"+h.domain+h.port+h.G);return g.Xz(Y+t,{})},abn=function(h,t){g.Vm.call(this); var Y=this;this.tJ=h();this.tJ.subscribe("handlerOpened",this.Ea,this);this.tJ.subscribe("handlerClosed",this.onClosed,this);this.tJ.subscribe("handlerError",function(L,q){Y.onError(q)}); this.tJ.subscribe("handlerMessage",this.onMessage,this);this.G=t},xq3=function(h,t,Y){var L=this; Y=Y===void 0?function(){return""}:Y; var q=q===void 0?new JGl:q;var z=z===void 0?new g.Mz:z;this.pathPrefix=h;this.G=t;this.R0=Y;this.X=z;this.Y=null;this.L=this.C=0;this.channel=null;this.U=0;this.S=new B4(function(){L.S.isActive();var V;((V=L.channel)==null?void 0:zL1((new Kev(V,V.G)).G.T))===0&&L.connect(L.Y,L.C)}); this.W={};this.T={};this.AQ=!1;this.logger=null;this.x8=[];this.Dg=void 0;this.Zx=new rTv;this.Wm=new cTy;this.X5=new uk8;this.gU=new JTl},EL8=function(h){g.B6(h.channel,"m",function(){h.U=3; h.S.reset();h.Y=null;h.C=0;for(var t=g.b(h.x8),Y=t.next();!Y.done;Y=t.next())Y=Y.value,h.channel&&h.channel.send(Y);h.x8=[];h.publish("webChannelOpened");h.Zx.Vx("WEB_CHANNEL")}); g.B6(h.channel,"n",function(){h.U=0;h.S.isActive()||h.publish("webChannelClosed");var t,Y=(t=h.channel)==null?void 0:aZl(new Kev(t,t.G));Y&&(h.x8=[].concat(g.p(Y)));h.Wm.Vx("WEB_CHANNEL")}); g.B6(h.channel,"p",function(t){var Y=t.data;Y[0]==="gracefulReconnect"?(h.S.start(),h.channel&&h.channel.close()):h.publish("webChannelMessage",new Zj8(Y[0],Y[1]));h.Dg=t.statusCode;h.X5.Vx("WEB_CHANNEL")}); g.B6(h.channel,"o",function(){h.Dg===401||h.S.start();h.publish("webChannelError");h.gU.Vx("WEB_CHANNEL","")})},kYv=function(h){var t=h.R0(); t?h.W["x-youtube-lounge-xsrf-token"]=t:delete h.W["x-youtube-lounge-xsrf-token"]},Oj3=function(h){g.Vm.call(this); this.G=h();this.G.subscribe("webChannelOpened",this.ZN,this);this.G.subscribe("webChannelClosed",this.onClosed,this);this.G.subscribe("webChannelError",this.onError,this);this.G.subscribe("webChannelMessage",this.onMessage,this)},nL3=function(h,t,Y,L,q){function z(){return new bjL(Da(h,"/bc"),t,!1,Y,L)} Y=Y===void 0?function(){return""}:Y; return g.wj("enable_mdx_web_channel_desktop")?new Oj3(function(){return new xq3(Da(h,"/wc"),t,Y)}):new abn(z,q)},AqC=function(){var h=fb0; $qE();hc.push(h);TI8()},tc=function(h,t){$qE(); var Y=Sxh(h,String(t));hc.length==0?IbH(Y):(TI8(),g.B1(hc,function(L){L(Y)}))},ig=function(h){tc("CP",h)},$qE=function(){hc||(hc=g.il("yt.mdx.remote.debug.handlers_")||[],g.t3("yt.mdx.remote.debug.handlers_",hc))},IbH=function(h){var t=(gH+1)%50; gH=t;Yd[t]=h;L9||(L9=t==49)},TI8=function(){var h=hc; if(Yd[0]){var t=L9?gH:-1,Y={};do Y={Oc:void 0},t=(t+1)%50,Y.Oc=Yd[t],g.B1(h,function(L){return function(q){q(L.Oc)}}(Y)); while(t!=gH);Yd=Array(50);gH=-1;L9=!1}},Sxh=function(h,t){var Y=(Date.now()-Ran)/1E3; Y.toFixed&&(Y=Y.toFixed(3));var L=[];L.push("[",Y+"s","] ");L.push("[","yt.mdx.remote","] ");L.push(h+": "+t,"\n");return L.join("")},qg=function(h){g.PD.call(this); this.U=h;this.screens=[]},BIv=function(h,t){var Y=h.get(t.uuid)||h.get(t.id); if(Y)return h=Y.name,Y.id=t.id||Y.id,Y.name=t.name,Y.token=t.token,Y.uuid=t.uuid||Y.uuid,Y.name!=h;h.screens.push(t);return!0},PjE=function(h,t){var Y=h.screens.length!=t.length; h.screens=g.oK(h.screens,function(z){return!!y73(t,z)}); for(var L=t.length,q=0;q0&&h.W0&&FU(h,Y)},function(t){h.X=function(){}; h.vI(t)})},GgP=function(h){var t={}; t.pairingCode=h.Wm;t.theme=h.Ne;dcH()&&(t.env_useStageMdx=1);return g.yC(t)},Q_C=function(h){return new Promise(function(t){h.Wm=w2y(); if(h.Zx){var Y=new chrome.cast.DialLaunchResponse(!0,GgP(h));t(Y);dPl(h)}else h.AQ=function(){g.Nc(h.L);h.AQ=function(){}; h.L=NaN;var L=new chrome.cast.DialLaunchResponse(!0,GgP(h));t(L);dPl(h)},h.L=g.zz(function(){h.AQ()},100)})},cny=function(h,t,Y){h.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(t)); var L=new zC(t);return(new Promise(function(q){rn0(h,L,function(z){z?(h.x8=!0,wH(h.W,L),yV(h,L),FU(h,Y)):g.n$(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(t)+" is not online."));q(z)},5)})).then(function(q){return q?new chrome.cast.DialLaunchResponse(!1):Q_C(h)})},u9E=function(h,t){var Y=h.Y.receiver.label,L=h.T.friendlyName; return(new Promise(function(q){Ndn(h.W,Y,t,L,function(z){z&&z.token&&yV(h,z);q(z)},function(z){XU(h,"Failed to get DIAL screen: "+z); q(null)})})).then(function(q){return q&&q.token?new chrome.cast.DialLaunchResponse(!1):Q_C(h)})},rn0=function(h,t,Y,L){g.Nc(h.U); h.U=0;HN1(h.W,t,function(q){q||L<0?Y(q):h.U=g.zz(function(){rn0(h,t,Y,L-1)},300)})},FU=function(h,t){h.info("getDialAppInfoWithTimeout_ "+t); Mg(h)&&(g.Nc(h.C),h.C=0,t==0?exl(h):h.C=g.zz(function(){exl(h)},t))},exl=function(h){Mg(h)&&h.S.getDialAppInfo(function(t){h.info("getDialAppInfo dialLaunchData: "+JSON.stringify(t)); t=t.extraData||{};var Y=null;if(t.loungeToken){var L;((L=h.G)==null?void 0:L.token)==t.loungeToken&&(Y="staleLoungeToken")}else Y="missingLoungeToken";Y?(h.R0=Y,FU(h,3E4)):(h.x8=!1,h.R0="unknown",Xev(h,t.loungeToken),FU(h,t.loungeTokenRefreshIntervalMs))},function(t){h.info("getDialAppInfo error: "+t); h.R0="noLoungeTokenResponse";FU(h,3E4)})},Jnn=function(h){g.Nc(h.U); h.U=0;g.Nc(h.C);h.C=0;h.X();h.X=function(){}; g.Nc(h.L)},sD=function(h,t){Wj.call(this,h,t,"ManualSession"); this.S=g.zz((0,g.Vv)(this.KU,this,null),150)},jv=function(h,t){g.PD.call(this); this.config_=t;this.T=h;this.Y=t.appId||"233637DE";this.W=t.theme||"cl";this.L=t.disableCastApi||!1;this.U=t.forceMirroring||!1;this.G=null;this.C=!1;this.S=[];this.X=(0,g.Vv)(this.EeQ,this)},peE=function(h,t){return t?g.Mh(h.S,function(Y){return Vq(t,Y.label)},h):null},Zf=function(h){tc("Controller",h)},fb0=function(h){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(h)},bg=function(h){return h.C||!!h.S.length||!!h.G},ow=function(h,t,Y){t!=h.G&&(g.hN(h.G),(h.G=t)?(Y?h.publish("yt-remote-cast2-receiver-resumed", t.T):h.publish("yt-remote-cast2-receiver-selected",t.T),t.subscribe("sessionScreen",(0,g.Vv)(h.MM,h,t)),t.subscribe("sessionFailed",function(){return vCn(h,t)}),t.G?h.publish("yt-remote-cast2-session-change",t.G):Y&&h.G.KU(null)):h.publish("yt-remote-cast2-session-change",null))},vCn=function(h,t){h.G==t&&h.publish("yt-remote-cast2-session-failed")},KE8=function(h){var t=h.T.YW(),Y=h.G&&h.G.T; h=g.CQ(t,function(L){Y&&Vq(L,Y.label)&&(Y=null);var q=L.uuid?L.uuid:L.id,z=peE(this,L);z?(z.label=q,z.friendlyName=L.name):(z=new chrome.cast.Receiver(q,L.name),z.receiverType=chrome.cast.ReceiverType.CUSTOM);return z},h); Y&&(Y.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(Y=new chrome.cast.Receiver(Y.label,Y.friendlyName),Y.receiverType=chrome.cast.ReceiverType.CUSTOM),h.push(Y));return h},fEn=function(h,t,Y,L){L.disableCastApi?dH("Cannot initialize because disabled by Mdx config."):aE0()?xPy(t,L)&&(ECl(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?kgs(h,Y):(window.__onGCastApiAvailable=function(q,z){q?kgs(h,Y):(Gp("Failed to load cast API: "+z),ONE(!1),ECl(!1),g.QS("yt-remote-cast-available"),g.QS("yt-remote-cast-receiver"), nC0(),Y(!1))},L.loadCastApiSetupScript?g.Be("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?QF0()>=60&&aHE():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?eX1():QF0()>=89?ETv():(KJl(),Cg(xcs.map(J7h))))):dH("Cannot initialize because not running Chrome")},nC0=function(){dH("dispose"); var h=QV();h&&h.dispose();g.t3("yt.mdx.remote.cloudview.instance_",null);$PL(!1);g.I_(Tdv);Tdv.length=0},rH=function(){return!!g.GI("yt-remote-cast-installed")},Anv=function(){var h=g.GI("yt-remote-cast-receiver"); return h?h.friendlyName:null},Son=function(){dH("clearCurrentReceiver"); g.QS("yt-remote-cast-receiver")},IEP=function(){return rH()?QV()?QV().getCastSession():(Gp("getCastSelector: Cast is not initialized."),null):(Gp("getCastSelector: Cast API is not installed!"),null)},Rxv=function(){rH()?QV()?cj()?(dH("Requesting cast selector."),QV().requestSession()):(dH("Wait for cast API to be ready to request the session."),Tdv.push(g.Ss("yt-remote-cast2-api-ready",Rxv))):Gp("requestCastSelector: Cast is not initialized."):Gp("requestCastSelector: Cast API is not installed!")}, ug=function(h,t){cj()?QV().setConnectedScreenStatus(h,t):Gp("setConnectedScreenStatus called before ready.")},aE0=function(){var h=g.xp().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.wq||h},BdH=function(h,t){QV().init(h,t)},xPy=function(h,t){var Y=!1; QV()||(h=new jv(h,t),h.subscribe("yt-remote-cast2-availability-change",function(L){g.dK("yt-remote-cast-available",L);Xt("yt-remote-cast2-availability-change",L)}),h.subscribe("yt-remote-cast2-receiver-selected",function(L){dH("onReceiverSelected: "+L.friendlyName); g.dK("yt-remote-cast-receiver",L);Xt("yt-remote-cast2-receiver-selected",L)}),h.subscribe("yt-remote-cast2-receiver-resumed",function(L){dH("onReceiverResumed: "+L.friendlyName); g.dK("yt-remote-cast-receiver",L);Xt("yt-remote-cast2-receiver-resumed",L)}),h.subscribe("yt-remote-cast2-session-change",function(L){dH("onSessionChange: "+NE(L)); L||g.QS("yt-remote-cast-receiver");Xt("yt-remote-cast2-session-change",L)}),g.t3("yt.mdx.remote.cloudview.instance_",h),Y=!0); dH("cloudview.createSingleton_: "+Y);return Y},QV=function(){return g.il("yt.mdx.remote.cloudview.instance_")},kgs=function(h,t){ONE(!0); ECl(!1);BdH(h,function(Y){Y?($PL(!0),g.R_("yt-remote-cast2-api-ready")):(Gp("Failed to initialize cast API."),ONE(!1),g.QS("yt-remote-cast-available"),g.QS("yt-remote-cast-receiver"),nC0());t(Y)})},dH=function(h){tc("cloudview",h)},Gp=function(h){tc("cloudview",h)},ONE=function(h){dH("setCastInstalled_ "+h); g.dK("yt-remote-cast-installed",h)},cj=function(){return!!g.il("yt.mdx.remote.cloudview.apiReady_")},$PL=function(h){dH("setApiReady_ "+h); g.t3("yt.mdx.remote.cloudview.apiReady_",h)},ECl=function(h){g.t3("yt.mdx.remote.cloudview.initializing_",h)},ev=function(h){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.X=this.U=0;this.trackData=null;this.fH=this.B0=!1;this.Y=this.S=this.C=this.T=0;this.G=NaN;this.W=!1;this.reset(h)},PNE=function(h){h.audioTrackId=null; h.trackData=null;h.playerState=-1;h.B0=!1;h.fH=!1;h.U=0;h.X=g.H1();h.T=0;h.C=0;h.S=0;h.Y=0;h.G=NaN;h.W=!1},Jc=function(h){return h.isPlaying()?(g.H1()-h.X)/1E3:0},p9=function(h,t){h.U=t; h.X=g.H1()},vj=function(h){switch(h.playerState){case 1:case 1081:return(g.H1()-h.X)/1E3+h.U; case -1E3:return 0}return h.U},mPy=function(h){return h.W?h.C+Jc(h):h.C},K9=function(h,t,Y){var L=h.videoId; h.videoId=t;h.index=Y;t!=L&&PNE(h)},DPC=function(h){var t={}; t.index=h.index;t.listId=h.listId;t.videoId=h.videoId;t.playerState=h.playerState;t.volume=h.volume;t.muted=h.muted;t.audioTrackId=h.audioTrackId;t.trackData=g.Cu(h.trackData);t.hasPrevious=h.B0;t.hasNext=h.fH;t.playerTime=h.U;t.playerTimeAt=h.X;t.seekableStart=h.T;t.seekableEnd=h.C;t.duration=h.S;t.loadedTime=h.Y;t.liveIngestionTime=h.G;return t},xd=function(h,t){g.PD.call(this); var Y=this;this.S=0;this.W=h;this.U=[];this.X=new FP1;this.T=this.G=null;this.L=(0,g.Vv)(this.rQM,this);this.C=(0,g.Vv)(this.HG,this);this.Y=(0,g.Vv)(this.VMP,this);this.AQ=(0,g.Vv)(this.v8m,this);var L=0;h?(L=h.getProxyState(),L!=3&&(h.subscribe("proxyStateChange",this.VT,this),hos(this))):L=3;L!=0&&(t?this.VT(L):g.zz(function(){Y.VT(L)},0)); (h=IEP())&&aw(this,h);this.subscribe("yt-remote-cast2-session-change",this.AQ)},ED=function(h){return new ev(h.W.getPlayerContextData())},hos=function(h){g.B1("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(t){this.U.push(this.W.subscribe(t,g.Nh(this.W$G,t),this))},h)},tM8=function(h){g.B1(h.U,function(t){this.W.unsubscribeByKey(t)},h); h.U.length=0},kd=function(h){return h.getState()==1},OD=function(h,t){var Y=h.X; Y.G.length+Y.T.length<50&&h.X.enqueue(t)},ixL=function(h,t,Y){var L=ED(h); p9(L,Y);L.playerState!=-1E3&&(L.playerState=t);n9(h,L)},f9=function(h,t,Y){h.W.sendMessage(t,Y)},n9=function(h,t){tM8(h); h.W.setPlayerContextData(DPC(t));hos(h)},aw=function(h,t){h.T&&(h.T.removeUpdateListener(h.L),h.T.removeMediaListener(h.C),h.HG(null)); h.T=t;h.T&&(ig("Setting cast session: "+h.T.sessionId),h.T.addUpdateListener(h.L),h.T.addMediaListener(h.C),h.T.media.length&&h.HG(h.T.media[0]))},gFC=function(h){var t=h.G.media,Y=h.G.customData; if(t&&Y){var L=ED(h);t.contentId!=L.videoId&&ig("Cast changing video to: "+t.contentId);L.videoId=t.contentId;L.playerState=Y.playerState;p9(L,h.G.getEstimatedTime());n9(h,L)}else ig("No cast media video. Ignoring state update.")},$d=function(h,t,Y){return(0,g.Vv)(function(L){this.g0("Failed to "+t+" with cast v2 channel. Error code: "+L.code); L.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.g0("Retrying "+t+" using MDx browser channel."),f9(this,t,Y))},h)},Sv=function(h,t,Y,L){L=L===void 0?!1:L; g.PD.call(this);var q=this;this.U=NaN;this.Wm=!1;this.L=this.Y=this.x8=this.R0=NaN;this.AQ=[];this.X=this.C=this.W=this.G=this.T=null;this.Zx=h;this.X5=L;this.AQ.push(g.X4(window,"beforeunload",function(){q.zg(2)})); this.S=[];this.G=new ev;this.Ne=t.id;this.gU=t.idType;this.T=nL3(this.Zx,Y,this.B8,this.gU=="shortLived",this.Ne);this.T.listen("channelOpened",function(){YPP(q)}); this.T.listen("channelClosed",function(){Tp("Channel closed");isNaN(q.U)?W4(!0):W4();q.dispose()}); this.T.listen("channelError",function(z){W4();isNaN(q.U4())?(z==1&&q.gU=="shortLived"&&q.publish("browserChannelAuthError",z),Tp("Channel error: "+z+" without reconnection"),q.dispose()):(q.Wm=!0,Tp("Channel error: "+z+" with reconnection in "+q.U4()+" ms"),Ac(q,2))}); this.T.listen("channelMessage",function(z){LYy(q,z)}); this.T.Ci(t.token);this.subscribe("remoteQueueChange",function(){var z=q.G.videoId;g.rK()&&g.dK("yt-remote-session-video-id",z)})},qPh=function(h){return g.Mh(h.S,function(t){return t.type=="LOUNGE_SCREEN"})},Tp=function(h){tc("conn",h)},Ac=function(h,t){h.publish("proxyStateChange",t)},zoE=function(h){h.U=g.zz(function(){Tp("Connecting timeout"); h.zg(1)},2E4)},VMl=function(h){g.Nc(h.U); h.U=NaN},Nr8=function(h){g.Nc(h.R0); h.R0=NaN},HxL=function(h){lky(h); h.x8=g.zz(function(){Iw(h,"getNowPlaying")},2E4)},lky=function(h){g.Nc(h.x8); h.x8=NaN},YPP=function(h){Tp("Channel opened"); h.Wm&&(h.Wm=!1,Nr8(h),h.R0=g.zz(function(){Tp("Timing out waiting for a screen.");h.zg(1)},15E3))},WY8=function(h,t){var Y=null; if(t){var L=qPh(h);L&&(Y={clientName:L.clientName,deviceMake:L.brand,deviceModel:L.model,osVersion:L.osVersion})}g.t3("yt.mdx.remote.remoteClient_",Y);t&&(VMl(h),Nr8(h));Y=h.T.kt()&&isNaN(h.U);t==Y?t&&(Ac(h,1),Iw(h,"getSubtitlesTrack")):t?(h.gZ()&&h.G.reset(),Ac(h,1),Iw(h,"getNowPlaying"),w3h(h)):h.zg(1)},yl3=function(h,t){var Y=t.params.videoId; delete t.params.videoId;Y==h.G.videoId&&(g.WZ(t.params)?h.G.trackData=null:h.G.trackData=t.params,h.publish("remotePlayerChange"))},X3n=function(h,t,Y){var L=t.params.videoId||t.params.video_id,q=parseInt(t.params.currentIndex,10); h.G.listId=t.params.listId||h.G.listId;K9(h.G,L,q);h.publish("remoteQueueChange",Y)},CSv=function(h,t){t.params=t.params||{}; X3n(h,t,"NOW_PLAYING_MAY_CHANGE");Uev(h,t);h.publish("autoplayDismissed")},Uev=function(h,t){var Y=parseInt(t.params.currentTime||t.params.current_time,10); p9(h.G,isNaN(Y)?0:Y);Y=parseInt(t.params.state,10);Y=isNaN(Y)?-1:Y;Y==-1&&h.G.playerState==-1E3&&(Y=-1E3);h.G.playerState=Y;Y=Number(t.params.loadedTime);h.G.Y=isNaN(Y)?0:Y;h.G.rd(Number(t.params.duration));Y=h.G;var L=Number(t.params.liveIngestionTime);Y.G=L;Y.W=isNaN(L)?!1:!0;Y=h.G;L=Number(t.params.seekableStartTime);t=Number(t.params.seekableEndTime);Y.T=isNaN(L)?0:L;Y.C=isNaN(t)?0:t;h.G.playerState==1?HxL(h):lky(h);h.publish("remotePlayerChange")},MML=function(h,t){if(h.G.playerState!=-1E3){var Y= 1085; switch(parseInt(t.params.adState,10)){case 1:Y=1081;break;case 2:Y=1084;break;case 0:Y=1083}h.G.playerState=Y;t=parseInt(t.params.currentTime,10);p9(h.G,isNaN(t)?0:t);h.publish("remotePlayerChange")}},FYv=function(h,t){var Y=t.params.muted=="true"; h.G.volume=parseInt(t.params.volume,10);h.G.muted=Y;h.publish("remotePlayerChange")},sPy=function(h,t){h.C=t.params.videoId; h.publish("nowAutoplaying",parseInt(t.params.timeout,10))},jPv=function(h,t){h.C=t.params.videoId||null; h.publish("autoplayUpNext",h.C)},Zxv=function(h,t){h.X=t.params.autoplayMode; h.publish("autoplayModeChange",h.X);h.X=="DISABLED"&&h.publish("autoplayDismissed")},bxn=function(h,t){var Y=t.params.hasNext=="true"; h.G.B0=t.params.hasPrevious=="true";h.G.fH=Y;h.publish("previousNextChange")},LYy=function(h,t){t=t.message; t.params?Tp("Received: action="+t.action+", params="+g.aR(t.params)):Tp("Received: action="+t.action+" {}");switch(t.action){case "loungeStatus":t=t9(t.params.devices);h.S=g.CQ(t,function(L){return new qE(L)}); t=!!g.Mh(h.S,function(L){return L.type=="LOUNGE_SCREEN"}); WY8(h,t);t=h.uq("mlm");h.publish("multiStateLoopEnabled",t);break;case "loungeScreenDisconnected":g.Qv(h.S,function(L){return L.type=="LOUNGE_SCREEN"}); WY8(h,!1);break;case "remoteConnected":var Y=new qE(t9(t.params.device));g.Mh(h.S,function(L){return L.equals(Y)})||o50(h.S,Y); break;case "remoteDisconnected":Y=new qE(t9(t.params.device));g.Qv(h.S,function(L){return L.equals(Y)}); break;case "gracefulDisconnect":break;case "playlistModified":X3n(h,t,"QUEUE_MODIFIED");break;case "nowPlaying":CSv(h,t);break;case "onStateChange":Uev(h,t);break;case "onAdStateChange":MML(h,t);break;case "onVolumeChanged":FYv(h,t);break;case "onSubtitlesTrackChanged":yl3(h,t);break;case "nowAutoplaying":sPy(h,t);break;case "autoplayDismissed":h.publish("autoplayDismissed");break;case "autoplayUpNext":jPv(h,t);break;case "onAutoplayModeChanged":Zxv(h,t);break;case "onHasPreviousNextChanged":bxn(h, t);break;case "requestAssistedSignIn":h.publish("assistedSignInRequested",t.params.authCode);break;case "onLoopModeChanged":h.publish("loopModeChange",t.params.loopMode);break;default:Tp("Unrecognized action: "+t.action)}},w3h=function(h){g.Nc(h.L); h.L=g.zz(function(){h.zg(1)},864E5)},Iw=function(h,t,Y){Y?Tp("Sending: action="+t+", params="+g.aR(Y)):Tp("Sending: action="+t); h.T.sendMessage(t,Y)},oF1=function(h){qg.call(this,"ScreenServiceProxy"); this.gk=h;this.G=[];this.G.push(this.gk.$_s("screenChange",(0,g.Vv)(this.H_,this)));this.G.push(this.gk.$_s("onlineScreenChange",(0,g.Vv)(this.Xq8,this)))},clv=function(h,t){oTv(); if(!yq||!yq.get("yt-remote-disable-remote-module-for-dev")){t=g.Ey("MDX_CONFIG")||t;X2L();FJ0();Rw||(Rw=new mF(t?t.loungeApiHost:void 0),dcH()&&(Rw.G="/api/loungedev"));Bj||(Bj=g.il("yt.mdx.remote.deferredProxies_")||[],g.t3("yt.mdx.remote.deferredProxies_",Bj));del();var Y=Pj();if(!Y){var L=new Hj(Rw,t?t.disableAutomaticScreenCache||!1:!1);g.t3("yt.mdx.remote.screenService_",L);Y=Pj();var q={};t&&(q={appId:t.appId,disableDial:t.disableDial,theme:t.theme,loadCastApiSetupScript:t.loadCastApiSetupScript, disableCastApi:t.disableCastApi,enableDialLoungeToken:t.enableDialLoungeToken,enableCastLoungeToken:t.enableCastLoungeToken,forceMirroring:t.forceMirroring});g.t3("yt.mdx.remote.enableConnectWithInitialState_",t?t.enableConnectWithInitialState||!1:!1);fEn(h,L,function(z){z?mr()&&ug(mr(),"YouTube TV"):L.subscribe("onlineScreenChange",function(){Xt("yt-remote-receiver-availability-change")})},q)}t&&!g.il("yt.mdx.remote.initialized_")&&(g.t3("yt.mdx.remote.initialized_",!0),Df("Initializing: "+g.aR(t)), hD.push(g.Ss("yt-remote-cast2-api-ready",function(){Xt("yt-remote-api-ready")})),hD.push(g.Ss("yt-remote-cast2-availability-change",function(){Xt("yt-remote-receiver-availability-change")})),hD.push(g.Ss("yt-remote-cast2-receiver-selected",function(){tD(null); Xt("yt-remote-auto-connect","cast-selector-receiver")})),hD.push(g.Ss("yt-remote-cast2-receiver-resumed",function(){Xt("yt-remote-receiver-resumed","cast-selector-receiver")})),hD.push(g.Ss("yt-remote-cast2-session-change",Gd1)),hD.push(g.Ss("yt-remote-connection-change",function(z){z?ug(mr(),"YouTube TV"):ih()||(ug(null,null),Son())})),hD.push(g.Ss("yt-remote-cast2-session-failed",function(){Xt("yt-remote-connection-failed")})),h=QPn(),t.isAuto&&(h.id+="#dial"),q=t.capabilities||[],q.length>0&&(h.capabilities= q),h.name=t.device,h.app=t.app,(t=t.theme)&&(h.theme=t),Df(" -- with channel params: "+g.aR(h)),h?(g.dK("yt-remote-session-app",h.app),g.dK("yt-remote-session-name",h.name)):(g.QS("yt-remote-session-app"),g.QS("yt-remote-session-name")),g.t3("yt.mdx.remote.channelParams_",h),Y.start(),mr()||rly())}},u21=function(){var h=Pj().gk.$_gos(); var t=gV();t&&Y8()&&(y73(h,t)||h.push(t));return WJn(h)},Jlv=function(){var h=eoC(); !h&&rH()&&Anv()&&(h={key:"cast-selector-receiver",name:Anv()});return h},eoC=function(){var h=u21(),t=gV(); t||(t=ih());return g.Mh(h,function(Y){return t&&Vq(t,Y.key)?!0:!1})},gV=function(){var h=mr(); if(!h)return null;var t=Pj().E$();return lQ(t,h)},Gd1=function(h){Df("remote.onCastSessionChange_: "+NE(h)); if(h){var t=gV();if(t&&t.id==h.id){if(ug(t.id,"YouTube TV"),h.idType=="shortLived"&&(h=h.token))LJ&&(LJ.token=h),(t=Y8())&&t.Ci(h)}else t&&qj(),zh(h,1)}else Y8()&&qj()},qj=function(){cj()?QV().stopSession():Gp("stopSession called before API ready."); var h=Y8();h&&(h.disconnect(1),p3P(null))},vFP=function(){var h=Y8(); return!!h&&h.getProxyState()!=3},Df=function(h){tc("remote",h)},Pj=function(){if(!KYl){var h=g.il("yt.mdx.remote.screenService_"); KYl=h?new oF1(h):null}return KYl},mr=function(){return g.il("yt.mdx.remote.currentScreenId_")},akL=function(h){g.t3("yt.mdx.remote.currentScreenId_",h)},xeL=function(){return g.il("yt.mdx.remote.connectData_")},tD=function(h){g.t3("yt.mdx.remote.connectData_",h)},Y8=function(){return g.il("yt.mdx.remote.connection_")},p3P=function(h){var t=Y8(); tD(null);h||akL("");g.t3("yt.mdx.remote.connection_",h);Bj&&(g.B1(Bj,function(Y){Y(h)}),Bj.length=0); t&&!h?Xt("yt-remote-connection-change",!1):!t&&h&&Xt("yt-remote-connection-change",!0)},ih=function(){var h=g.rK(); if(!h)return null;var t=Pj();if(!t)return null;t=t.E$();return lQ(t,h)},zh=function(h,t){mr(); gV()&&gV();if(V3)LJ=h;else{akL(h.id);var Y=g.il("yt.mdx.remote.enableConnectWithInitialState_")||!1;h=new Sv(Rw,h,QPn(),Y);h.connect(t,xeL());h.subscribe("beforeDisconnect",function(L){Xt("yt-remote-before-disconnect",L)}); h.subscribe("beforeDispose",function(){Y8()&&(Y8(),p3P(null))}); h.subscribe("browserChannelAuthError",function(){var L=gV();L&&L.idType=="shortLived"&&(cj()?QV().handleBrowserChannelAuthError():Gp("refreshLoungeToken called before API ready."))}); p3P(h)}},rly=function(){var h=ih(); h?(Df("Resume connection to: "+NE(h)),zh(h,0)):(W4(),Son(),Df("Skipping connecting because no session screen found."))},del=function(){var h=QPn(); if(g.WZ(h)){h=wm();var t=g.GI("yt-remote-session-name")||"",Y=g.GI("yt-remote-session-app")||"";h={device:"REMOTE_CONTROL",id:h,name:t,app:Y,mdxVersion:3};h.authuser=String(g.Ey("SESSION_INDEX","0"));(t=g.Ey("DELEGATED_SESSION_ID"))&&(h.pageId=String(t));g.t3("yt.mdx.remote.channelParams_",h)}},QPn=function(){return g.il("yt.mdx.remote.channelParams_")||{}},Oxs=function(h,t,Y){g.O.call(this); var L=this;this.G=h;this.K=t;this.tC=Y;this.events=new g.UF(this);this.X=!1;this.U=new g.yT(64);this.T=new g.nE(this.ph,500,this);this.S=new g.nE(this.NV,1E3,this);this.Y=new ME(this.Y9_,0,this);this.W={};this.L=new g.nE(this.Yb,1E3,this);this.C=new g.AS(this.seekTo,1E3,this);this.AQ=this.events.V(this.K,"onVolumeChange",function(q){EFs(L,q)}); g.f(this,this.events);this.events.V(t,"onCaptionsTrackListChanged",this.TPM);this.events.V(t,"captionschanged",this.Hb_);this.events.V(t,"captionssettingschanged",this.dE);this.events.V(t,"videoplayerreset",this.oO);this.events.V(t,"mdxautoplaycancel",function(){L.tC.Un()}); t.N("enable_mdx_video_play_directly")&&this.events.V(t,"videodatachange",function(){kdE(L.G)||Nj(L)||lh(L,0)}); h=this.tC;h.Ui();h.subscribe("proxyStateChange",this.sA,this);h.subscribe("remotePlayerChange",this.k6,this);h.subscribe("remoteQueueChange",this.oO,this);h.subscribe("previousNextChange",this.j$,this);h.subscribe("nowAutoplaying",this.VD,this);h.subscribe("autoplayDismissed",this.zr,this);g.f(this,this.T);g.f(this,this.S);g.f(this,this.Y);g.f(this,this.L);g.f(this,this.C);this.dE();this.oO();this.k6()},EFs=function(h,t){if(Nj(h)){h.tC.unsubscribe("remotePlayerChange",h.k6,h); var Y=Math.round(t.volume);t=!!t.muted;var L=ED(h.tC);if(Y!==L.volume||t!==L.muted)h.tC.setVolume(Y,t),h.L.start();h.tC.subscribe("remotePlayerChange",h.k6,h)}},nFn=function(h){h.Kn(0); h.T.stop();h.a4(new g.yT(64))},fk0=function(h,t){if(Nj(h)&&!h.X){var Y=null; t&&(Y={style:h.K.getSubtitlesUserSettings()},Object.assign(Y,t));h.tC.IS(h.K.getVideoData(1).videoId,Y);h.W=ED(h.tC).trackData}},lh=function(h,t){var Y=h.K.getPlaylist(); if(Y==null?0:Y.listId){var L=Y.index;var q=Y.listId.toString()}Y=h.K.getVideoData(1);h.tC.playVideo(Y.videoId,t,L,q,Y.playerParams,Y.Zx,b$v(Y));h.a4(new g.yT(1))},$eE=function(h,t){if(t){var Y=h.K.getOption("captions","tracklist",{L$:1}); Y&&Y.length?(h.K.setOption("captions","track",t),h.X=!1):(h.K.loadModule("captions"),h.X=!0)}else h.K.setOption("captions","track",{})},Nj=function(h){return ED(h.tC).videoId===h.K.getVideoData(1).videoId},Tr0=function(h,t){g.A$.call(this,h); this.G=t},H9=function(){g.I.call(this,{Z:"div", D:"ytp-mdx-popup-dialog",j:{role:"dialog"},B:[{Z:"div",D:"ytp-mdx-popup-dialog-inner-content",B:[{Z:"div",D:"ytp-mdx-popup-title",o0:"You're signed out"},{Z:"div",D:"ytp-mdx-popup-description",o0:"Videos you watch may be added to the TV's watch history and influence TV recommendations. To avoid this, cancel and sign in to YouTube on your computer."},{Z:"div",D:"ytp-mdx-privacy-popup-buttons",B:[{Z:"button",Ei:["ytp-button","ytp-mdx-privacy-popup-cancel"],o0:"Cancel"},{Z:"button",Ei:["ytp-button", "ytp-mdx-privacy-popup-confirm"],o0:"Confirm"}]}]}]});this.fade=new g.ST(this,250);this.cancelButton=this.Tz("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.Tz("ytp-mdx-privacy-popup-confirm");g.f(this,this.fade);this.V(this.cancelButton,"click",this.G);this.V(this.confirmButton,"click",this.T)},wV=function(h){g.I.call(this,{Z:"div", D:"ytp-remote",B:[{Z:"div",D:"ytp-remote-display-status",B:[{Z:"div",D:"ytp-remote-display-status-icon",B:[g.HYi()]},{Z:"div",D:"ytp-remote-display-status-text",o0:"{{statustext}}"}]}]});this.api=h;this.fade=new g.ST(this,250);g.f(this,this.fade);this.V(h,"presentingplayerstatechange",this.onStateChange);this.H3(h.getPlayerStateObject())},W9=function(h,t){g.aq.call(this,"Play on",1,h,t); this.K=h;this.yy={};this.V(h,"onMdxReceiversChange",this.W);this.V(h,"presentingplayerstatechange",this.W);this.W()},Al1=function(h){g.Gt.call(this,h); this.ue={key:w2y(),name:"This computer"};this.hS=null;this.subscriptions=[];this.d5=this.tC=null;this.yy=[this.ue];this.WD=this.ue;this.yp=new g.yT(64);this.Ex=0;this.S1=-1;this.Pe=!1;this.Wd=this.Al=this.Pg=null;if(!g.SI(this.player.J())&&!g.rP(this.player.J())){h=this.player;var t=g.jH(h);t&&(t=t.Q7())&&(t=new W9(h,t),g.f(this,t));t=new wV(h);g.f(this,t);g.kl(h,t.element,4);this.Pg=new H9;g.f(this,this.Pg);g.kl(h,this.Pg.element,4);this.Pe=!!ih()}},y3=function(h){h.Al&&(h.player.removeEventListener("presentingplayerstatechange", h.Al),h.Al=null)},SPP=function(h,t,Y){h.yp=Y; h.player.publish("presentingplayerstatechange",new g.Yu(Y,t))},Xb=function(h,t){if(t.key!==h.WD.key)if(t.key===h.ue.key)qj(); else if(kdE(h)&&Iky(h),h.WD=t,!h.player.J().N("disable_mdx_connection_in_mdx_module_for_music_web")||!g.rP(h.player.J())){var Y=h.player.getPlaylistId();var L=h.player.getVideoData(1);var q=L.videoId;if(!Y&&!q||(h.player.getAppState()===2||h.player.getAppState()===1)&&h.player.J().N("should_clear_video_data_on_player_cued_unstarted"))L=null;else{var z=h.player.getPlaylist();if(z){var V=[];for(var l=0;l2*this.size&&Lg(this),!0):!1}; g.M.get=function(h,t){return gm(this.T,h)?this.T[h]:t}; g.M.set=function(h,t){gm(this.T,h)||(this.size+=1,this.G.push(h),this.T2++);this.T[h]=t}; g.M.forEach=function(h,t){for(var Y=this.dA(),L=0;L=L.G.length)return g.yu;var z=L.G[t++];return g.si(h?z:L.T[z])}; return q}; var n5v={AFm:"atp",rjG:"ska",qWM:"que",S$5:"mus",OqP:"sus",JHU:"dsp",zQ_:"seq",aCG:"mic",q80:"dpa",Rq8:"mlm",LGx:"dsdtr",ZHz:"ntb",Ke0:"vsp",enQ:"scn",aDM:"rpe",sTz:"dcn",wdx:"dcp",yS5:"pas",hRG:"drq",pS_:"opf",g3M:"els",S8e:"isg",fDi:"svq",TV5:"mvp",GZP:"ads",j$P:"stcp",poe:"sads",t1M:"dloc",akU:"dcw",RZ5:"asw",uXz:"apw"},fFh={Eab:"u",UW5:"cl",OIG:"k",PB_:"i",YLG:"cr",gQi:"m",Dq0:"g",uK:"up"},QYP={xk:"adPlaying",t9:"onAdStateChange"},rq1={fCi:"nowPlaying",Czm:"onStateChange",xk:"adPlaying",t9:"onAdStateChange", sR:"nowPlayingShorts",h9:"onShortsStateChange"},cql={sR:"nowPlayingShorts",h9:"onShortsStateChange"};qE.prototype.equals=function(h){return h?this.id==h.id:!1}; var Ma0="",yq=null;g.F(Gz8,g.u9);var Ut,vT1=r78("loadCastFramework")||r78("loadCastApplicationFramework"),xcs=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.W1(ME,g.O);g.M=ME.prototype;g.M.Gs=function(h){this.W=arguments;this.G=!1;this.yb?this.S=g.H1()+this.iM:this.yb=g.JH(this.X,this.iM)}; g.M.stop=function(){this.yb&&(g.D$.clearTimeout(this.yb),this.yb=null);this.S=null;this.G=!1;this.W=[]}; g.M.pause=function(){++this.T}; g.M.resume=function(){this.T&&(--this.T,!this.T&&this.G&&(this.G=!1,this.U.apply(null,this.W)))}; g.M.Gz=function(){this.stop();ME.aD.Gz.call(this)}; g.M.ut=function(){this.yb&&(g.D$.clearTimeout(this.yb),this.yb=null);this.S?(this.yb=g.JH(this.X,this.S-g.H1()),this.S=null):this.T?this.G=!0:(this.G=!1,this.U.apply(null,this.W))};Ft.prototype.stringify=function(h){return g.D$.JSON.stringify(h,void 0)}; Ft.prototype.parse=function(h){return g.D$.JSON.parse(h,void 0)};g.W1(kz3,g.nX);g.W1(Oil,g.nX);var nT0=null;g.W1($cl,g.nX);g.W1(Tjv,g.nX);g.W1(A7l,g.nX);ol.prototype.debug=function(){}; ol.prototype.info=function(){}; ol.prototype.warning=function(){};var hL1={},DcC={};g.M=dm.prototype;g.M.setTimeout=function(h){this.iP=h}; g.M.Ts=function(h){h=h.target;var t=this.Y8;t&&g.fm(h)==3?t.o1():this.zj(h)}; g.M.zj=function(h){try{if(h==this.G)a:{var t=g.fm(this.G),Y=this.G.T,L=this.G.getStatus();if(!(t<3)&&(t!=3||this.G&&(this.T.T||g.Tc(this.G)||g.AH(this.G)))){this.X5||t!=4||Y==7||(Y==8||L<=0?jY(3):jY(2));gIy(this);var q=this.G.getStatus();this.Pq=q;var z=mcL(this);if(this.U=q==200){if(this.G$&&!this.lP){b:{if(this.G){var V=g.St(this.G,"X-HTTP-Initial-Response");if(V&&!g.e$(V)){var l=V;break b}}l=null}if(h=l)this.lP=!0,wY1(this,h);else{this.U=!1;this.X=3;Za(12);Qq(this);rm(this);break a}}if(this.gU){h= !0;for(var H;!this.X5&&this.C0&&!this.Q4&&(this.Q4=!0,this.S.w2(this)):(Qq(this),rm(this))}else wY1(this,z);t==4&&Qq(this);this.U&&!this.X5&&(t==4?YaE(this.S,this):(this.U=!1,GC(this)))}else g.jK$(this.G),q==400&&z.indexOf("Unknown SID")> 0?(this.X=3,Za(12)):(this.X=0,Za(13)),Qq(this),rm(this)}}}catch(w){}finally{}}; g.M.cancel=function(){this.X5=!0;Qq(this)}; g.M.Rg=function(){this.AQ=null;var h=Date.now();h-this.tQ>=0?(this.Ne!=2&&(jY(3),Za(17)),Qq(this),this.X=2,rm(this)):iY1(this,this.tQ-h)}; g.M.getLastError=function(){return this.X}; g.M.xr=function(){return this.G};yGv.prototype.cancel=function(){this.S=UM0(this);if(this.T)this.T.cancel(),this.T=null;else if(this.G&&this.G.size!==0){for(var h=g.b(this.G.values()),t=h.next();!t.done;t=h.next())t.value.cancel();this.G.clear()}};g.M=jz1.prototype;g.M.Q9=8;g.M.BM=1;g.M.connect=function(h,t,Y,L){Za(0);this.Ds=h;this.X5=t||{};Y&&L!==void 0&&(this.X5.OSID=Y,this.X5.OAID=L);this.lP=this.y4;this.Zx=NKl(this,null,this.Ds);J9(this)}; g.M.disconnect=function(){bYL(this);if(this.BM==3){var h=this.JQ++,t=this.Zx.clone();g.qb(t,"SID",this.W);g.qb(t,"RID",h);g.qb(t,"TYPE","terminate");Kg(this,t);h=new dm(this,this.W,h);h.Ne=2;h.Y=DM(t.clone());t=!1;if(g.D$.navigator&&g.D$.navigator.sendBeacon)try{t=g.D$.navigator.sendBeacon(h.Y.toString(),"")}catch(Y){}!t&&g.D$.Image&&((new Image).src=h.Y,t=!0);t||(h.G=BjE(h.S,null),h.G.send(h.Y));h.R0=Date.now();GC(h)}cGP(this)}; g.M.bj=function(){return this.BM==0}; g.M.getState=function(){return this.BM}; g.M.Zl=function(h){if(this.U)if(this.U=null,this.BM==1){if(!h){this.JQ=Math.floor(Math.random()*1E5);h=this.JQ++;var t=new dm(this,"",h),Y=this.L;this.Pq&&(Y?(Y=g.Uw(Y),g.Mn(Y,this.Pq)):Y=this.Pq);this.C!==null||this.tQ||(t.Zx=Y,Y=null);var L;if(this.MD)a:{for(var q=L=0;q4096){L=q;break a}if(L===4096||q===this.S.length-1){L=q+1;break a}}L= 1E3}else L=1E3;L=GIv(this,t,L);q=this.Zx.clone();g.qb(q,"RID",h);g.qb(q,"CVER",22);this.gU&&g.qb(q,"X-HTTP-Session-Id",this.gU);Kg(this,q);Y&&(this.tQ?L="headers="+g.rk(g.nAi(Y))+"&"+L:this.C&&g.l3(q,this.C,Y));VqP(this.T,t);this.lR&&g.qb(q,"TYPE","init");this.MD?(g.qb(q,"$req",L),g.qb(q,"SID","null"),t.G$=!0,RXL(t,q,null)):RXL(t,q,L);this.BM=2}}else this.BM==3&&(h?QzC(this,h):this.S.length==0||XY8(this.T)||QzC(this))}; g.M.Ev=function(){this.Y=null;rGy(this);if(this.dP&&!(this.iP||this.G==null||this.pn<=0)){var h=2*this.pn;this.Wm=bQ((0,g.Vv)(this.meM,this),h)}}; g.M.meM=function(){this.Wm&&(this.Wm=null,this.lP=!1,this.iP=!0,Za(10),uQ(this),rGy(this))}; g.M.w2=function(h){this.G==h&&this.dP&&!this.iP&&(ZYv(this),this.iP=!0,Za(11))}; g.M.SY=function(){this.AQ!=null&&(this.AQ=null,uQ(this),qaE(this),Za(19))}; g.M.z0e=function(h){h?Za(2):Za(1)}; g.M.isActive=function(){return!!this.X&&this.X.isActive(this)}; g.M=eL8.prototype;g.M.NO=function(){}; g.M.X4=function(){}; g.M.Uv=function(){}; g.M.Ke=function(){}; g.M.isActive=function(){return!0}; g.M.ge=function(){};g.W1(xS,g.Vm);xS.prototype.open=function(){this.G.X=this.S;this.U&&(this.G.Ne=!0);this.G.connect(this.X,this.T||void 0)}; xS.prototype.close=function(){this.G.disconnect()}; xS.prototype.send=function(h){var t=this.G;if(typeof h==="string"){var Y={};Y.__data__=h;h=Y}else this.W&&(Y={},Y.__data__=g.aR(h),h=Y);t.S.push(new WeC(t.Y1++,h));t.BM==3&&J9(t)}; xS.prototype.Gz=function(){this.G.X=null;delete this.S;this.G.disconnect();delete this.G;xS.aD.Gz.call(this)}; g.W1(pY1,kz3);g.W1(vIs,Oil);g.W1(al,eL8);al.prototype.NO=function(){this.G.dispatchEvent("m")}; al.prototype.X4=function(h){this.G.dispatchEvent(new pY1(h))}; al.prototype.Uv=function(h){this.G.dispatchEvent(new vIs(h))}; al.prototype.Ke=function(){this.G.dispatchEvent("n")};var kS=new g.Vm;g.F(xME,g.nX);g.M=ng.prototype;g.M.Q3=null;g.M.wJ=!1;g.M.rb=null;g.M.GU=null;g.M.Dd=null;g.M.LO=null;g.M.pj=null;g.M.hg=null;g.M.Zw=null;g.M.ek=null;g.M.qY=0;g.M.TC=null;g.M.MY=null;g.M.EZ=null;g.M.Cj=-1;g.M.aK=!0;g.M.NL=!1;g.M.oo=0;g.M.wI=null;var $Ms={},fZs={};g.M=ng.prototype;g.M.setTimeout=function(h){this.T=h}; g.M.c_=function(h){h=h.target;var t=this.wI;t&&g.fm(h)==3?t.o1():this.Ce(h)}; g.M.Ce=function(h){try{if(h==this.ek)a:{var t=g.fm(this.ek),Y=this.ek.T,L=this.ek.getStatus();if(g.lI&&!g.Ob("420+")){if(t<4)break a}else if(t<3||t==3&&!g.Tc(this.ek))break a;this.NL||t!=4||Y==7||(Y==8||L<=0?this.G.LV(3):this.G.LV(2));SaP(this);var q=this.ek.getStatus();this.Cj=q;var z=g.Tc(this.ek);if(this.wJ=q==200){t==4&&fg(this);if(this.gU){for(h=!0;!this.NL&&this.qY0?(this.EZ=3,Ot(13)):(this.EZ=0,Ot(14)),fg(this),IZs(this)}}catch(l){}finally{}}; g.M.cancel=function(){this.NL=!0;fg(this)}; g.M.eY=function(){this.rb=null;var h=Date.now();h-this.GU>=0?(this.LO!=2&&this.G.LV(3),fg(this),this.EZ=2,Ot(18),IZs(this)):AG8(this,this.GU-h)}; g.M.getLastError=function(){return this.EZ};g.M=mM3.prototype;g.M.Ro=null;g.M.qG=null;g.M.V6=!1;g.M.Sj=null;g.M.iz=null;g.M.Tt=-1;g.M.nD=null;g.M.Zn=null;g.M.connect=function(h){this.Sj=h;h=TC(this.G,null,this.Sj);Ot(3);Date.now();var t=this.G.L;t!=null?(this.nD=t[0],(this.Zn=t[1])?(this.iz=1,DML(this)):(this.iz=2,ha0(this))):(h9(h,"MODE","init"),this.qG=new ng(this),this.qG.Q3=this.Ro,OYv(this.qG,h,!1,null,!0),this.iz=0)}; g.M.Bf=function(h){if(h)this.iz=2,ha0(this);else{Ot(4);var t=this.G;t.Ey=t.gN.Tt;Rl(t,9)}h&&this.LV(2)}; g.M.uN=function(h){return this.G.uN(h)}; g.M.abort=function(){this.qG&&(this.qG.cancel(),this.qG=null);this.Tt=-1}; g.M.bj=function(){return!1}; g.M.Dl=function(h,t){this.Tt=h.Cj;if(this.iz==0)if(t){try{var Y=this.T.parse(t)}catch(L){h=this.G;h.Ey=this.Tt;Rl(h,2);return}this.nD=Y[0];this.Zn=Y[1]}else h=this.G,h.Ey=this.Tt,Rl(h,2);else this.iz==2&&(this.V6?(Ot(7),Date.now()):t=="11111"?(Ot(6),this.V6=!0,Date.now(),this.Tt=200,this.qG.cancel(),Ot(12),A9(this.G,this,!0)):(Ot(8),Date.now(),this.V6=!1))}; g.M.TU=function(){this.Tt=this.qG.Cj;if(this.qG.wJ)this.iz==0?this.Zn?(this.iz=1,DML(this)):(this.iz=2,ha0(this)):this.iz==2&&(this.V6?(Ot(12),A9(this.G,this,!0)):(Ot(11),A9(this.G,this,!1)));else{this.iz==0?Ot(9):this.iz==2&&Ot(10);var h=this.G;this.qG.getLastError();h.Ey=this.Tt;Rl(h,2)}}; g.M.lm=function(){return this.G.lm()}; g.M.isActive=function(){return this.G.isActive()}; g.M.LV=function(h){this.G.LV(h)};g.M=t4P.prototype;g.M.bz=null;g.M.mq=null;g.M.g4=null;g.M.aF=null;g.M.ej=null;g.M.Ad=null;g.M.lc=null;g.M.gw=null;g.M.H4=0;g.M.zs=0;g.M.wk=null;g.M.tK=null;g.M.St=null;g.M.fA=null;g.M.gN=null;g.M.JX=null;g.M.Fp=-1;g.M.H8=-1;g.M.Ey=-1;g.M.vk=0;g.M.yZ=0;g.M.KA=8;var Ron={OK:0,GT_:2,wi8:4,UG0:5,Qkz:6,STOP:7,B$:8,Gyb:9,PMG:10,ovb:11,Tki:12};g.W1(gL1,g.nX);g.W1(YxL,g.nX);g.M=t4P.prototype; g.M.connect=function(h,t,Y,L,q){Ot(0);this.ej=t;this.mq=Y||{};L&&q!==void 0&&(this.mq.OSID=L,this.mq.OAID=q);this.Y?(Et((0,g.Vv)(this.Aq,this,h),100),qx8(this)):this.Aq(h)}; g.M.disconnect=function(){za3(this);if(this.G==3){var h=this.H4++,t=this.Ad.clone();g.qb(t,"SID",this.W);g.qb(t,"RID",h);g.qb(t,"TYPE","terminate");Il(this,t);h=new ng(this,this.W,h);h.LO=2;h.pj=DM(t.clone());(new Image).src=h.pj.toString();h.Dd=Date.now();nIE(h)}Cjy(this)}; g.M.Aq=function(h){this.gN=new mM3(this);this.gN.Ro=this.bz;this.gN.T=this.X;this.gN.connect(h)}; g.M.bj=function(){return this.G==0}; g.M.getState=function(){return this.G}; g.M.V9=function(h){this.tK=null;wql(this,h)}; g.M.Ov=function(){this.St=null;this.aF=new ng(this,this.W,"rpc",this.C);this.aF.Q3=this.bz;this.aF.oo=0;var h=this.lc.clone();g.qb(h,"RID","rpc");g.qb(h,"SID",this.W);g.qb(h,"CI",this.JX?"0":"1");g.qb(h,"AID",this.Fp);Il(this,h);g.qb(h,"TYPE","xmlhttp");OYv(this.aF,h,!0,this.gw,!1)}; g.M.Dl=function(h,t){if(this.G!=0&&(this.aF==h||this.g4==h))if(this.Ey=h.Cj,this.g4==h&&this.G==3)if(this.KA>7){try{var Y=this.X.parse(t)}catch(L){Y=null}if(Array.isArray(Y)&&Y.length==3)if(h=Y,h[0]==0)a:{if(!this.St){if(this.aF)if(this.aF.Dd+3E30)){if(L=t==1)this.g4||this.tK||this.G==1||this.vk>=2?L=!1:(this.tK=Et((0,g.Vv)(this.V9,this,h),yqC(this,this.vk)),this.vk++, L=!0);L=!(L||t==2&&Xqy(this))}if(L)switch(Y){case 1:Rl(this,5);break;case 4:Rl(this,10);break;case 3:Rl(this,6);break;case 7:Rl(this,12);break;default:Rl(this,2)}}}; g.M.W_=function(h){if(!g.jE(arguments,this.G))throw Error("Unexpected channel state: "+this.G);}; g.M.WT5=function(h){h?Ot(2):(Ot(1),Uq3(this,8))}; g.M.uN=function(h){if(h)throw Error("Can't create secondary domain capable XhrIo object.");h=new g.kc;h.C=!1;return h}; g.M.isActive=function(){return!!this.wk&&this.wk.isActive(this)}; g.M.LV=function(h){var t=kS;t.dispatchEvent(new YxL(t,h))}; g.M.lm=function(){return!1}; g.M=M4n.prototype;g.M.v8=function(){}; g.M.y9=function(){}; g.M.F4=function(){}; g.M.rM=function(){}; g.M.c9=function(){}; g.M.kW=function(){return{}}; g.M.isActive=function(){return!0};g.M=FP1.prototype;g.M.enqueue=function(h){this.T.push(h)}; g.M.isEmpty=function(){return this.G.length===0&&this.T.length===0}; g.M.clear=function(){this.G=[];this.T=[]}; g.M.contains=function(h){return g.jE(this.G,h)||g.jE(this.T,h)}; g.M.remove=function(h){var t=this.G;var Y=(0,g.hPv)(t,h);Y>=0?(g.ZC(t,Y),t=!0):t=!1;return t||g.bl(this.T,h)}; g.M.TT=function(){for(var h=[],t=this.G.length-1;t>=0;--t)h.push(this.G[t]);t=this.T.length;for(var Y=0;Y=Br8.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(h=Br8[this.T],this.yb=g.zz((0,g.Vv)(this.f8,this),h),this.T++):this.publish("pairingFailed",Error("Server error "+h.status))}; g.M.Ua=function(){this.G=null;this.publish("pairingFailed",Error("Server not responding"))}; var Br8=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.W1(VV,qg);g.M=VV.prototype;g.M.start=function(){zp(this)&&this.publish("screenChange");!g.GI("yt-remote-lounge-token-expiration")&&hx0(this);g.Nc(this.G);this.G=g.zz((0,g.Vv)(this.start,this),1E4)}; g.M.add=function(h,t){zp(this);BIv(this,h);Ng(this,!1);this.publish("screenChange");t(h);h.token||hx0(this)}; g.M.remove=function(h,t){var Y=zp(this);mqy(this,h)&&(Ng(this,!1),Y=!0);t(h);Y&&this.publish("screenChange")}; g.M.YZ=function(h,t,Y,L){var q=zp(this),z=this.get(h.id);z?(z.name!=t&&(z.name=t,Ng(this,!1),q=!0),Y(h)):L(Error("no such local screen."));q&&this.publish("screenChange")}; g.M.Gz=function(){g.Nc(this.G);VV.aD.Gz.call(this)}; g.M.Q$=function(h){zp(this);var t=this.screens.length;h=h&&h.screens||[];for(var Y=h.length,L=0;L20)break a;l=t(z,V)}z=l}q.name=z}Y(wH(this,q))},this), onError:(0,g.Vv)(function(q){L(Error("pairing request failed: "+q.status))},this), onTimeout:(0,g.Vv)(function(){L(Error("pairing request timed out."))},this)})}; g.M.Gz=function(){g.hN(this.T);g.hN(this.G);Hj.aD.Gz.call(this)}; g.M.O6=function(){weE(this);this.publish("screenChange");this.G.update()}; Hj.prototype.dispose=Hj.prototype.dispose;g.W1(Wj,g.PD);g.M=Wj.prototype;g.M.vI=function(h){this.Ui()||(h&&(XU(this,""+h),this.publish("sessionFailed")),this.G=null,this.publish("sessionScreen",null))}; g.M.info=function(h){tc(this.gU,h)}; g.M.Ju=function(){return null}; g.M.lA=function(h){var t=this.T;h?(t.displayStatus=new chrome.cast.ReceiverDisplayStatus(h,[]),t.displayStatus.showStop=!0):t.displayStatus=null;chrome.cast.setReceiverDisplayStatus(t,(0,g.Vv)(function(){this.info("Updated receiver status for "+t.friendlyName+": "+h)},this),(0,g.Vv)(function(){XU(this,"Failed to update receiver status for: "+t.friendlyName)},this))}; g.M.Gz=function(){this.lA("");Wj.aD.Gz.call(this)};g.F(UD,Wj);g.M=UD.prototype;g.M.CP=function(h){if(this.S){if(this.S==h)return;XU(this,"Overriding cast session with new session object");oCy(this);this.R0=!1;this.L="unknown";this.S.removeUpdateListener(this.x8);this.S.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Wm)}this.S=h;this.S.addUpdateListener(this.x8);this.S.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.Wm);FE1(this,"getMdxSessionStatus")}; g.M.KU=function(h){this.info("launchWithParams no-op for Cast: "+g.aR(h))}; g.M.stop=function(){this.S?this.S.stop((0,g.Vv)(function(){this.vI()},this),(0,g.Vv)(function(){this.vI(Error("Failed to stop receiver app."))},this)):this.vI(Error("Stopping cast device without session."))}; g.M.lA=function(){}; g.M.Gz=function(){this.info("disposeInternal");oCy(this);this.S&&(this.S.removeUpdateListener(this.x8),this.S.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Wm));this.S=null;Wj.prototype.Gz.call(this)}; g.M.Wai=function(h,t){if(!this.Ui())if(t)if(t=t9(t),g.LH(t))switch(h=""+t.type,t=t.data||{},this.info("onYoutubeMessage_: "+h+" "+g.aR(t)),h){case "mdxSessionStatus":UP1(this,t);break;case "loungeToken":s_y(this,t);break;default:XU(this,"Unknown youtube message: "+h)}else XU(this,"Unable to parse message.");else XU(this,"No data in message.")}; g.M.EK=function(h,t,Y,L){g.Nc(this.Y);this.Y=0;Ndn(this.W,this.T.label,h,this.T.friendlyName,(0,g.Vv)(function(q){q?t(q):L>=0?(XU(this,"Screen "+h+" appears to be offline. "+L+" retries left."),this.Y=g.zz((0,g.Vv)(this.EK,this,h,t,Y,L-1),300)):Y(Error("Unable to fetch screen."))},this),Y)}; g.M.Ju=function(){return this.S}; g.M.pF=function(h){this.Ui()||h||(XU(this,"Cast session died."),this.vI())};g.F(C9,Wj);g.M=C9.prototype;g.M.CP=function(h){this.S=h;this.S.addUpdateListener(this.X5)}; g.M.KU=function(h){this.Zx=h;this.AQ()}; g.M.stop=function(){Jnn(this);this.S?this.S.stop((0,g.Vv)(this.vI,this,null),(0,g.Vv)(this.vI,this,"Failed to stop DIAL device.")):this.vI()}; g.M.Gz=function(){Jnn(this);this.S&&this.S.removeUpdateListener(this.X5);this.S=null;Wj.prototype.Gz.call(this)}; g.M.Nj=function(h){this.Ui()||h||(XU(this,"DIAL session died."),this.X(),this.X=function(){},this.vI())};g.F(sD,Wj);sD.prototype.stop=function(){this.vI()}; sD.prototype.CP=function(){}; sD.prototype.KU=function(){g.Nc(this.S);this.S=NaN;var h=lQ(this.W.E$(),this.T.label);h?yV(this,h):this.vI(Error("No such screen"))}; sD.prototype.Gz=function(){g.Nc(this.S);this.S=NaN;Wj.prototype.Gz.call(this)};g.F(jv,g.PD);g.M=jv.prototype; g.M.init=function(h,t){chrome.cast.timeout.requestSession=3E4;var Y=new chrome.cast.SessionRequest(this.Y,[chrome.cast.Capability.AUDIO_OUT]);g.wj("desktop_enable_cast_connect")&&(Y.androidReceiverCompatible=!0);this.L||(Y.dialRequest=new chrome.cast.DialRequest("YouTube"));var L=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;h=h||this.U?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var q=(0,g.Vv)(this.foQ,this);Y=new chrome.cast.ApiConfig(Y,(0,g.Vv)(this.hB, this),q,L,h);Y.customDialLaunchCallback=(0,g.Vv)(this.ibM,this);chrome.cast.initialize(Y,(0,g.Vv)(function(){this.Ui()||(chrome.cast.addReceiverActionListener(this.X),AqC(),this.T.subscribe("onlineScreenChange",(0,g.Vv)(this.jC,this)),this.S=KE8(this),chrome.cast.setCustomReceivers(this.S,function(){},(0,g.Vv)(function(z){this.g0("Failed to set initial custom receivers: "+g.aR(z))},this)),this.publish("yt-remote-cast2-availability-change",bg(this)),t(!0))},this),(0,g.Vv)(function(z){this.g0("Failed to initialize API: "+ g.aR(z)); t(!1)},this))}; g.M.OrP=function(h,t){Zf("Setting connected screen ID: "+h+" -> "+t);if(this.G){var Y=this.G.G;if(!h||Y&&Y.id!=h)Zf("Unsetting old screen status: "+this.G.T.friendlyName),ow(this,null)}if(h&&t){if(!this.G){h=lQ(this.T.E$(),h);if(!h){Zf("setConnectedScreenStatus: Unknown screen.");return}if(h.idType=="shortLived"){Zf("setConnectedScreenStatus: Screen with id type to be short lived.");return}Y=peE(this,h);Y||(Zf("setConnectedScreenStatus: Connected receiver not custom..."),Y=new chrome.cast.Receiver(h.uuid? h.uuid:h.id,h.name),Y.receiverType=chrome.cast.ReceiverType.CUSTOM,this.S.push(Y),chrome.cast.setCustomReceivers(this.S,function(){},(0,g.Vv)(function(L){this.g0("Failed to set initial custom receivers: "+g.aR(L))},this))); Zf("setConnectedScreenStatus: new active receiver: "+Y.friendlyName);ow(this,new sD(this.T,Y),!0)}this.G.lA(t)}else Zf("setConnectedScreenStatus: no screen.")}; g.M.vTm=function(h){this.Ui()?this.g0("Setting connection data on disposed cast v2"):this.G?this.G.KU(h):this.g0("Setting connection data without a session")}; g.M.DN=function(){this.Ui()?this.g0("Stopping session on disposed cast v2"):this.G?(this.G.stop(),ow(this,null)):Zf("Stopping non-existing session")}; g.M.requestSession=function(){chrome.cast.requestSession((0,g.Vv)(this.hB,this),(0,g.Vv)(this.Ioz,this))}; g.M.Gz=function(){this.T.unsubscribe("onlineScreenChange",(0,g.Vv)(this.jC,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.X);var h=fb0,t=g.il("yt.mdx.remote.debug.handlers_");g.bl(t||[],h);g.hN(this.G);g.PD.prototype.Gz.call(this)}; g.M.g0=function(h){tc("Controller",h)}; g.M.MM=function(h,t){this.G==h&&(t||ow(this,null),this.publish("yt-remote-cast2-session-change",t))}; g.M.EeQ=function(h,t){if(!this.Ui())if(h)switch(h.friendlyName=chrome.cast.unescape(h.friendlyName),Zf("onReceiverAction_ "+h.label+" / "+h.friendlyName+"-- "+t),t){case chrome.cast.ReceiverAction.CAST:if(this.G)if(this.G.T.label!=h.label)Zf("onReceiverAction_: Stopping active receiver: "+this.G.T.friendlyName),this.G.stop();else{Zf("onReceiverAction_: Casting to active receiver.");this.G.G&&this.publish("yt-remote-cast2-session-change",this.G.G);break}switch(h.receiverType){case chrome.cast.ReceiverType.CUSTOM:ow(this, new sD(this.T,h));break;case chrome.cast.ReceiverType.DIAL:ow(this,new C9(this.T,h,this.W,this.config_));break;case chrome.cast.ReceiverType.CAST:ow(this,new UD(this.T,h,this.config_));break;default:this.g0("Unknown receiver type: "+h.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.G&&this.G.T.label==h.label?this.G.stop():this.g0("Stopping receiver w/o session: "+h.friendlyName)}else this.g0("onReceiverAction_ called without receiver.")}; g.M.ibM=function(h){if(this.Ui())return Promise.reject(Error("disposed"));var t=h.receiver;t.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.g0("Not DIAL receiver: "+t.friendlyName),t.receiverType=chrome.cast.ReceiverType.DIAL);var Y=this.G?this.G.T:null;if(!Y||Y.label!=t.label)return this.g0("Receiving DIAL launch request for non-clicked DIAL receiver: "+t.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(Y&&Y.label==t.label&&Y.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.G.G)return Zf("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.G.G),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.g0('Changing CAST intent from "'+Y.receiverType+'" to "dial" for '+t.friendlyName);ow(this,new C9(this.T,t,this.W,this.config_))}t=this.G;t.Y=h;t.Y.appState==chrome.cast.DialAppState.RUNNING?(h=t.Y.extraData||{},Y=h.screenId||null,Mg(t)&&h.loungeToken?h.loungeTokenRefreshIntervalMs?h=cny(t,{name:t.T.friendlyName,screenId:h.screenId,loungeToken:h.loungeToken,dialId:t.Y.receiver.label, screenIdType:"shortLived"},h.loungeTokenRefreshIntervalMs):(g.n$(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(h)+".")),h=u9E(t,Y)):h=u9E(t,Y)):h=Q_C(t);return h}; g.M.hB=function(h){var t=this;if(!this.Ui()&&!this.U){Zf("New cast session ID: "+h.sessionId);var Y=h.receiver;if(Y.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.G)if(Y.receiverType==chrome.cast.ReceiverType.CAST)Zf("Got resumed cast session before resumed mdx connection."),Y.friendlyName=chrome.cast.unescape(Y.friendlyName),ow(this,new UD(this.T,Y,this.config_),!0);else{this.g0("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var L=this.G.T,q=lQ(this.T.E$(), L.label);q&&Vq(q,Y.label)&&L.receiverType!=chrome.cast.ReceiverType.CAST&&Y.receiverType==chrome.cast.ReceiverType.CAST&&(Zf("onSessionEstablished_: manual to cast session change "+Y.friendlyName),g.hN(this.G),this.G=new UD(this.T,Y,this.config_),this.G.subscribe("sessionScreen",(0,g.Vv)(this.MM,this,this.G)),this.G.subscribe("sessionFailed",function(){return vCn(t,t.G)}),this.G.KU(null)); this.G.CP(h)}}}; g.M.CF=function(){return this.G?this.G.Ju():null}; g.M.Ioz=function(h){this.Ui()||(this.g0("Failed to estabilish a session: "+g.aR(h)),h.code!=chrome.cast.ErrorCode.CANCEL&&ow(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.M.foQ=function(h){Zf("Receiver availability updated: "+h);if(!this.Ui()){var t=bg(this);this.C=h==chrome.cast.ReceiverAvailability.AVAILABLE;bg(this)!=t&&this.publish("yt-remote-cast2-availability-change",bg(this))}}; g.M.jC=function(){this.Ui()||(this.S=KE8(this),Zf("Updating custom receivers: "+g.aR(this.S)),chrome.cast.setCustomReceivers(this.S,function(){},(0,g.Vv)(function(){this.g0("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",bg(this)))}; jv.prototype.setLaunchParams=jv.prototype.vTm;jv.prototype.setConnectedScreenStatus=jv.prototype.OrP;jv.prototype.stopSession=jv.prototype.DN;jv.prototype.getCastSession=jv.prototype.CF;jv.prototype.requestSession=jv.prototype.requestSession;jv.prototype.init=jv.prototype.init;jv.prototype.dispose=jv.prototype.dispose;var Tdv=[];g.M=ev.prototype; g.M.reset=function(h){this.listId="";this.index=-1;this.videoId="";PNE(this);this.volume=-1;this.muted=!1;h&&(this.index=h.index,this.listId=h.listId,this.videoId=h.videoId,this.playerState=h.playerState,this.volume=h.volume,this.muted=h.muted,this.audioTrackId=h.audioTrackId,this.trackData=h.trackData,this.B0=h.hasPrevious,this.fH=h.hasNext,this.U=h.playerTime,this.X=h.playerTimeAt,this.T=h.seekableStart,this.C=h.seekableEnd,this.S=h.duration,this.Y=h.loadedTime,this.G=h.liveIngestionTime,this.W= !isNaN(this.G))}; g.M.isPlaying=function(){return this.playerState==1}; g.M.isBuffering=function(){return this.playerState==3}; g.M.xd=function(){return this.playerState==1081}; g.M.rd=function(h){this.S=isNaN(h)?0:h}; g.M.getDuration=function(){return this.W?this.S+Jc(this):this.S}; g.M.clone=function(){return new ev(DPC(this))};g.F(xd,g.PD);g.M=xd.prototype;g.M.getState=function(){return this.S}; g.M.VV=function(){return this.W.getReconnectTimeout()}; g.M.BR=function(){this.W.reconnect()}; g.M.play=function(){kd(this)?(this.G?this.G.play(null,g.Jf,$d(this,"play")):f9(this,"play"),ixL(this,1,vj(ED(this))),this.publish("remotePlayerChange")):OD(this,this.play)}; g.M.pause=function(){kd(this)?(this.G?this.G.pause(null,g.Jf,$d(this,"pause")):f9(this,"pause"),ixL(this,2,vj(ED(this))),this.publish("remotePlayerChange")):OD(this,this.pause)}; g.M.seekTo=function(h){if(kd(this)){if(this.G){var t=ED(this),Y=new chrome.cast.media.SeekRequest;Y.currentTime=h;t.isPlaying()||t.isBuffering()?Y.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:Y.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.G.seek(Y,g.Jf,$d(this,"seekTo",{newTime:h}))}else f9(this,"seekTo",{newTime:h});ixL(this,3,h);this.publish("remotePlayerChange")}else OD(this,g.Nh(this.seekTo,h))}; g.M.stop=function(){if(kd(this)){this.G?this.G.stop(null,g.Jf,$d(this,"stopVideo")):f9(this,"stopVideo");var h=ED(this);h.index=-1;h.videoId="";PNE(h);n9(this,h);this.publish("remotePlayerChange")}else OD(this,this.stop)}; g.M.setVolume=function(h,t){if(kd(this)){var Y=ED(this);if(this.T){if(Y.volume!=h){var L=Math.round(h)/100;this.T.setReceiverVolumeLevel(L,(0,g.Vv)(function(){ig("set receiver volume: "+L)},this),(0,g.Vv)(function(){this.g0("failed to set receiver volume.")},this))}Y.muted!=t&&this.T.setReceiverMuted(t,(0,g.Vv)(function(){ig("set receiver muted: "+t)},this),(0,g.Vv)(function(){this.g0("failed to set receiver muted.")},this))}else{var q={volume:h, muted:t};Y.volume!=-1&&(q.delta=h-Y.volume);f9(this,"setVolume",q)}Y.muted=t;Y.volume=h;n9(this,Y)}else OD(this,g.Nh(this.setVolume,h,t))}; g.M.IS=function(h,t){if(kd(this)){var Y=ED(this);h={videoId:h};t&&(Y.trackData={trackName:t.name,languageCode:t.languageCode,sourceLanguageCode:t.translationLanguage?t.translationLanguage.languageCode:"",languageName:t.languageName,kind:t.kind},h.style=g.aR(t.style),g.Mn(h,Y.trackData));f9(this,"setSubtitlesTrack",h);n9(this,Y)}else OD(this,g.Nh(this.IS,h,t))}; g.M.setAudioTrack=function(h,t){kd(this)?(t=t.getLanguageInfo().getId(),f9(this,"setAudioTrack",{videoId:h,audioTrackId:t}),h=ED(this),h.audioTrackId=t,n9(this,h)):OD(this,g.Nh(this.setAudioTrack,h,t))}; g.M.playVideo=function(h,t,Y,L,q,z,V){L=L===void 0?null:L;q=q===void 0?null:q;z=z===void 0?null:z;V=V===void 0?null:V;var l=ED(this),H={videoId:h};Y!==void 0&&(H.currentIndex=Y);K9(l,h,Y||0);t!==void 0&&(p9(l,t),H.currentTime=t);L&&(H.listId=L);q&&(H.playerParams=q);z&&(H.clickTrackingParams=z);V&&(H.locationInfo=g.aR(V));f9(this,"setPlaylist",H);L||n9(this,l)}; g.M.NH=function(h,t){if(kd(this)){if(h&&t){var Y=ED(this);K9(Y,h,t);n9(this,Y)}f9(this,"previous")}else OD(this,g.Nh(this.NH,h,t))}; g.M.nextVideo=function(h,t){if(kd(this)){if(h&&t){var Y=ED(this);K9(Y,h,t);n9(this,Y)}f9(this,"next")}else OD(this,g.Nh(this.nextVideo,h,t))}; g.M.NI=function(){if(kd(this)){f9(this,"clearPlaylist");var h=ED(this);h.reset();n9(this,h);this.publish("remotePlayerChange")}else OD(this,this.NI)}; g.M.Un=function(){kd(this)?f9(this,"dismissAutoplay"):OD(this,this.Un)}; g.M.dispose=function(){if(this.S!=3){var h=this.S;this.S=3;this.publish("proxyStateChange",h,this.S)}g.PD.prototype.dispose.call(this)}; g.M.Gz=function(){tM8(this);this.W=null;this.X.clear();aw(this,null);g.PD.prototype.Gz.call(this)}; g.M.VT=function(h){if((h!=this.S||h==2)&&this.S!=3&&h!=0){var t=this.S;this.S=h;this.publish("proxyStateChange",t,h);if(h==1)for(;!this.X.isEmpty();)t=h=this.X,t.G.length===0&&(t.G=t.T,t.G.reverse(),t.T=[]),h.G.pop().apply(this);else h==3&&this.dispose()}}; g.M.W$G=function(h,t){this.publish(h,t)}; g.M.rQM=function(h){if(!h)this.HG(null),aw(this,null);else if(this.T.receiver.volume){h=this.T.receiver.volume;var t=ED(this),Y=Math.round(100*h.level||0);if(t.volume!=Y||t.muted!=h.muted)ig("Cast volume update: "+h.level+(h.muted?" muted":"")),t.volume=Y,t.muted=!!h.muted,n9(this,t)}}; g.M.HG=function(h){ig("Cast media: "+!!h);this.G&&this.G.removeUpdateListener(this.Y);if(this.G=h)this.G.addUpdateListener(this.Y),gFC(this),this.publish("remotePlayerChange")}; g.M.VMP=function(h){h?(gFC(this),this.publish("remotePlayerChange")):this.HG(null)}; g.M.gh=function(){f9(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.M.v8m=function(){var h=IEP();h&&aw(this,h)}; g.M.g0=function(h){tc("CP",h)};g.F(Sv,g.PD);g.M=Sv.prototype; g.M.connect=function(h,t){if(t){var Y=t.listId,L=t.videoId,q=t.videoIds,z=t.playerParams,V=t.clickTrackingParams,l=t.index,H={videoId:L},w=t.currentTime,W=t.locationInfo;t=t.loopMode;w!==void 0&&(H.currentTime=w<=5?0:w);z&&(H.playerParams=z);W&&(H.locationInfo=W);V&&(H.clickTrackingParams=V);Y&&(H.listId=Y);q&&q.length>0&&(H.videoIds=q.join(","));l!==void 0&&(H.currentIndex=l);this.X5&&(H.loopMode=t||"LOOP_MODE_OFF");Y&&(this.G.listId=Y);this.G.videoId=L;this.G.index=l||0;this.G.state=3;p9(this.G, w);this.X="UNSUPPORTED";Y=this.X5?"setInitialState":"setPlaylist";Tp("Connecting with "+Y+" and params: "+g.aR(H));this.T.connect({method:Y,params:g.aR(H)},h,sFP())}else Tp("Connecting without params"),this.T.connect({},h,sFP());zoE(this)}; g.M.Ci=function(h){this.T.Ci(h)}; g.M.dispose=function(){this.Ui()||(g.t3("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),Ac(this,3));g.PD.prototype.dispose.call(this)}; g.M.Gz=function(){VMl(this);lky(this);Nr8(this);g.Nc(this.Y);this.Y=NaN;g.Nc(this.L);this.L=NaN;this.W=null;g.Ua(this.AQ);this.AQ.length=0;this.T.dispose();g.PD.prototype.Gz.call(this);this.X=this.C=this.S=this.G=this.T=null}; g.M.uq=function(h){if(!this.S||this.S.length===0)return!1;for(var t=g.b(this.S),Y=t.next();!Y.done;Y=t.next())if(!Y.value.capabilities.has(h))return!1;return!0}; g.M.BQ=function(){var h=3;this.Ui()||(h=0,isNaN(this.U4())?this.T.kt()&&isNaN(this.U)&&(h=1):h=2);return h}; g.M.zg=function(h){Tp("Disconnecting with "+h);g.t3("yt.mdx.remote.remoteClient_",null);VMl(this);this.publish("beforeDisconnect",h);h==1&&W4();this.T.disconnect(h);this.dispose()}; g.M.du=function(){var h=this.G;this.W&&(h=this.G.clone(),K9(h,this.W,h.index));return DPC(h)}; g.M.Yze=function(h){var t=this,Y=new ev(h);Y.videoId&&Y.videoId!=this.G.videoId&&(this.W=Y.videoId,g.Nc(this.Y),this.Y=g.zz(function(){if(t.W){var q=t.W;t.W=null;t.G.videoId!=q&&Iw(t,"getNowPlaying")}},5E3)); var L=[];this.G.listId==Y.listId&&this.G.videoId==Y.videoId&&this.G.index==Y.index||L.push("remoteQueueChange");this.G.playerState==Y.playerState&&this.G.volume==Y.volume&&this.G.muted==Y.muted&&vj(this.G)==vj(Y)&&g.aR(this.G.trackData)==g.aR(Y.trackData)||L.push("remotePlayerChange");this.G.reset(h);g.B1(L,function(q){this.publish(q)},this)}; g.M.gZ=function(){var h=this.T.getDeviceId(),t=g.Mh(this.S,function(Y){return Y.type=="REMOTE_CONTROL"&&Y.id!=h}); return t?t.id:""}; g.M.U4=function(){return this.T.VV()}; g.M.UG=function(){return this.X||"UNSUPPORTED"}; g.M.X1=function(){return this.C||""}; g.M.m9=function(){!isNaN(this.U4())&&this.T.BR()}; g.M.DUQ=function(h,t){Iw(this,h,t);w3h(this)}; g.M.B8=function(){var h=g.c2("SAPISID","")||g.c2("__Secure-1PAPISID")||"",t=g.c2("__Secure-3PAPISID","")||"";if(!h&&!t)return"";h=g.Gv(g.de(h),2);t=g.Gv(g.de(t),2);return g.Gv(g.de(","+h+","+t),2)}; Sv.prototype.subscribe=Sv.prototype.subscribe;Sv.prototype.unsubscribeByKey=Sv.prototype.bZ;Sv.prototype.getProxyState=Sv.prototype.BQ;Sv.prototype.disconnect=Sv.prototype.zg;Sv.prototype.getPlayerContextData=Sv.prototype.du;Sv.prototype.setPlayerContextData=Sv.prototype.Yze;Sv.prototype.getOtherConnectedRemoteId=Sv.prototype.gZ;Sv.prototype.getReconnectTimeout=Sv.prototype.U4;Sv.prototype.getAutoplayMode=Sv.prototype.UG;Sv.prototype.getAutoplayVideoId=Sv.prototype.X1;Sv.prototype.reconnect=Sv.prototype.m9; Sv.prototype.sendMessage=Sv.prototype.DUQ;Sv.prototype.getXsrfToken=Sv.prototype.B8;Sv.prototype.isCapabilitySupportedOnConnectedDevices=Sv.prototype.uq;g.F(oF1,qg);g.M=oF1.prototype;g.M.E$=function(h){return this.gk.$_gs(h)}; g.M.contains=function(h){return!!this.gk.$_c(h)}; g.M.get=function(h){return this.gk.$_g(h)}; g.M.start=function(){this.gk.$_st()}; g.M.add=function(h,t,Y){this.gk.$_a(h,t,Y)}; g.M.remove=function(h,t,Y){this.gk.$_r(h,t,Y)}; g.M.YZ=function(h,t,Y,L){this.gk.$_un(h,t,Y,L)}; g.M.Gz=function(){for(var h=this.G.length,t=0;t1&&!this.K.getOption("remote","quickCast")?(this.yy=g.P1(h,this.G,this),this.AS(g.CQ(h,this.G)),h=this.K.getOption("remote","currentReceiver"),h=this.G(h),this.options[h]&&this.hP(h),this.enable(!0)):this.enable(!1)}; W9.prototype.G=function(h){return h.key}; W9.prototype.aJ=function(h){return h==="cast-selector-receiver"?"Cast...":this.yy[h].name}; W9.prototype.AP=function(h){g.aq.prototype.AP.call(this,h);this.K.setOption("remote","currentReceiver",this.yy[h]);this.Rm.KZ()};g.F(Al1,g.Gt);g.M=Al1.prototype; g.M.create=function(){var h=this.player.J(),t=g.AU(h);h={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:h.N("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:h.N("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:h.N("enable_cast_short_lived_lounge_token")};clv(t,h);this.subscriptions.push(g.Ss("yt-remote-before-disconnect",this.lxG,this));this.subscriptions.push(g.Ss("yt-remote-connection-change",this.U_P,this));this.subscriptions.push(g.Ss("yt-remote-receiver-availability-change",this.BJ, this));this.subscriptions.push(g.Ss("yt-remote-auto-connect",this.K$G,this));this.subscriptions.push(g.Ss("yt-remote-receiver-resumed",this.Zne,this));this.subscriptions.push(g.Ss("mdx-privacy-popup-confirm",this.Iei,this));this.subscriptions.push(g.Ss("mdx-privacy-popup-cancel",this.j7G,this));this.BJ()}; g.M.load=function(){this.player.cancelPlayback();g.Gt.prototype.load.call(this);this.Wd=new Tr0(this.player.J(),this);this.player.q7(this.Wd);this.hS=new Oxs(this,this.player,this.tC);var h=(h=xeL())?h.currentTime:0;var t=vFP()?new xd(Y8(),void 0):null;h==0&&t&&(h=vj(ED(t)));h!==0&&this.Kn(h);SPP(this,this.yp,this.yp);this.player.mO(6)}; g.M.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.X3();this.WD=this.ue;g.tN(this.hS,this.tC);this.tC=this.Wd=this.hS=null;g.Gt.prototype.unload.call(this);this.player.mO(5);y3(this)}; g.M.Gz=function(){g.I_(this.subscriptions);g.Gt.prototype.Gz.call(this)}; g.M.dg=function(h){var t=g.OL.apply(1,arguments);this.loaded&&this.hS.ZJ.apply(this.hS,[h].concat(g.p(t)))}; g.M.getAdState=function(){return this.S1}; g.M.B0=function(){return this.tC?ED(this.tC).B0:!1}; g.M.fH=function(){return this.tC?ED(this.tC).fH:!1}; g.M.Kn=function(h,t){this.Ex=h||0;this.player.publish("progresssync",h,t);this.player.PZ("onVideoProgress",h||0)}; g.M.getCurrentTime=function(){return this.Ex}; g.M.getDuration=function(){return ED(this.tC).getDuration()||0}; g.M.a7=function(){var h=ED(this.tC);return h.W?h.G+Jc(h):h.G}; g.M.zq=function(){return ED(this.tC).Y}; g.M.Xn=function(){return mPy(ED(this.tC))}; g.M.CV=function(){var h=ED(this.tC);return h.T>0?h.T+Jc(h):h.T}; g.M.getProgressState=function(){var h=ED(this.tC),t=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!h.xd()&&this.player.B2(),clipEnd:t.clipEnd,clipStart:t.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.a7(),isAtLiveHead:this.isAtLiveHead(),loaded:this.zq(),seekableEnd:this.Xn(),seekableStart:this.CV(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.M.isAtLiveHead=function(){return mPy(ED(this.tC))-this.getCurrentTime()<=1}; g.M.nextVideo=function(){this.tC&&this.tC.nextVideo()}; g.M.NH=function(){this.tC&&this.tC.NH()}; g.M.lxG=function(h){h===1&&(this.d5=this.tC?ED(this.tC):null)}; g.M.U_P=function(){var h=vFP()?new xd(Y8(),void 0):null;if(h){var t=this.WD;this.loaded&&this.unload();this.tC=h;this.d5=null;t.key!==this.ue.key&&(this.WD=t,this.load())}else g.hN(this.tC),this.tC=null,this.loaded&&(this.unload(),(h=this.d5)&&h.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(h.videoId,vj(h)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.M.BJ=function(){var h=[this.ue],t=h.concat,Y=u21();rH()&&g.GI("yt-remote-cast-available")&&Y.push({key:"cast-selector-receiver",name:"Cast..."});this.yy=t.call(h,Y);h=Jlv()||this.ue;Xb(this,h);this.player.PZ("onMdxReceiversChange")}; g.M.K$G=function(){var h=Jlv();Xb(this,h)}; g.M.Zne=function(){this.WD=Jlv()}; g.M.Iei=function(){this.Pe=!0;y3(this);V3=!1;LJ&&zh(LJ,1);LJ=null}; g.M.j7G=function(){this.Pe=!1;y3(this);Xb(this,this.ue);this.WD=this.ue;V3=!1;LJ=null;this.player.playVideo()}; g.M.LQ=function(h,t){switch(h){case "casting":return this.loaded;case "receivers":return this.yy;case "currentReceiver":return t&&(t.key==="cast-selector-receiver"?Rxv():Xb(this,t)),this.loaded?this.WD:this.ue;case "quickCast":return this.yy.length===2&&this.yy[1].key==="cast-selector-receiver"?(t&&Rxv(),!0):!1}}; g.M.gh=function(){this.tC.gh()}; g.M.yI=function(){return!1}; g.M.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.M.isLoggedIn=function(){var h,t;return((h=g.Ey("PLAYER_CONFIG"))==null?void 0:(t=h.args)==null?void 0:t.authuser)!==void 0?!0:!(!g.Ey("SESSION_INDEX")&&!g.Ey("LOGGED_IN"))};g.dE("remote",Al1);})(_yt_player);