(function(g){var window=this;'use strict';var y30=function(n){if(n instanceof g.dM)return n;if(typeof n.Ch=="function")return n.Ch(!1);if(g.PG(n)){var q=0,w=new g.dM;w.next=function(){for(;;){if(q>=n.length)return g.OK;if(q in n)return g.gM(n[q++]);q++}}; return w}throw Error("Not implemented");},aOL=function(n,q,w){if(g.PG(n))g.Jw(n,q,w); else for(n=y30(n);;){var X=n.next();if(X.done)break;q.call(w,X.value,void 0,n)}},NS=function(n){g.RW(n,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.eB()).toString(36)); return n},nr=function(n,q,w){Array.isArray(w)||(w=[String(w)]); g.Ynh(n.W,q,w)},VYz=function(n,q){var w=[]; aOL(q,function(X){try{var P=g.aU.prototype.X.call(this,X,!0)}catch(R){if(R=="Storage: Invalid value was encountered")return;throw R;}P===void 0?w.push(X):g.Wps(P)&&w.push(X)},n); return w},pAj=function(n,q){VYz(n,q).forEach(function(w){g.aU.prototype.remove.call(this,w)},n)},TWi=function(n){if(n.aS){if(n.aS.locationOverrideToken)return{locationOverrideToken:n.aS.locationOverrideToken}; if(n.aS.latitudeE7!=null&&n.aS.longitudeE7!=null)return{latitudeE7:n.aS.latitudeE7,longitudeE7:n.aS.longitudeE7}}return null},FuG=function(n,q){g.yv(n,q)||n.push(q)},$Nv=function(n){var q=0,w; for(w in n)q++;return q},vvw=function(n,q){return g.sl(n,q)},LuL=function(n){try{return g.W0.JSON.parse(n)}catch(q){}n=String(n); if(/^\s*$/.test(n)?0:/^[\],:{}\s\u2028\u2029]*$/.test(n.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("("+n+")")}catch(q){}throw Error("Invalid JSON string: "+n);},qv=function(n){if(g.W0.JSON)try{return g.W0.JSON.parse(n)}catch(q){}return LuL(n)},MYG=function(){var n=wS(); this.N=n;n.fh("/client_streamz/youtube/living_room/mdx/channel/opened",g.wm("channel_type"))},xNj=function(){var n=wS(); this.N=n;n.fh("/client_streamz/youtube/living_room/mdx/channel/closed",g.wm("channel_type"))},DNL=function(){var n=wS(); this.N=n;n.fh("/client_streamz/youtube/living_room/mdx/channel/message_received",g.wm("channel_type"))},hcf=function(){var n=wS(); this.N=n;n.fh("/client_streamz/youtube/living_room/mdx/channel/success")},lOG=function(){var n=wS(); this.N=n;n.fh("/client_streamz/youtube/living_room/mdx/channel/error",g.wm("channel_type"),g.wm("error_type"))},GVl=function(){var n=wS(); this.N=n;n.fh("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},CpG=function(){var n=wS(); this.N=n;n.fh("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},Ev5=function(n,q,w,X){var P=new g.zu(null); n&&g.WR(P,n);q&&g.NL(P,q);w&&g.n9(P,w);X&&(P.X=X);return P},ovj=function(n,q){return new g.ZK(n,q)},Xs=function(n,q){return Object.prototype.hasOwnProperty.call(n,q)},biB=function(n,q){return n===q},Pu=function(n,q){this.X={}; this.N=[];this.Er=this.size=0;var w=arguments.length;if(w>1){if(w%2)throw Error("Uneven number of arguments");for(var X=0;X5&&(n=n.slice(n.length-5)); var q=g.Hh(VzD(),function(X){return X.loungeToken}),w=g.Hh(n,function(X){return X.loungeToken}); g.UF(w,function(X){return!g.yv(q,X)})&&pUv(); g.Fo("yt-remote-local-screens",n,31536E3)},Ov=function(n){n||(g.vz("yt-remote-session-screen-id"),g.vz("yt-remote-session-video-id")); yVj();n=et();g.Vv(n,fr());gAl(n)},FNz=function(){if(!Hu){var n=g.vN(); n&&(Hu=new g.ge(n))}},$g5=function(){FNz(); return Hu?!!Hu.get("yt-remote-use-staging-server"):!1},Uv=function(n,q){g.Bo[n]=!0; var w=g.Sv();w&&w.publish.apply(w,arguments);g.Bo[n]=!1},vAv=function(){},wS=function(){if(!tc){tc=new g.DP(new vAv); var n=g.HU("client_streamz_web_flush_count",-1);n!==-1&&(tc.C=n)}return tc},LN5=function(){var n=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return n?parseInt(n[1],10):0},Mzw=function(n){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+n)!=-1||document.currentScript.src.indexOf("&"+n)!=-1)},xgG=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},dS=function(n){n.length?Dg5(n.shift(),function(){dS(n)}):hPv()},lIf=function(n){return"chrome-extension://"+n+"/cast_sender.js"},Dg5=function(n,q,w){var X=document.createElement("script"); X.onerror=q;w&&(X.onload=w);g.mr(X,g.Uq(n));(document.head||document.documentElement).appendChild(X)},GSt=function(){var n=LN5(),q=[]; if(n>1){var w=n-1;q.push("//www.gstatic.com/eureka/clank/"+n+"/cast_sender.js");q.push("//www.gstatic.com/eureka/clank/"+w+"/cast_sender.js")}return q},hPv=function(){var n=xgG(); n&&n(!1,"No cast extension found")},EA5=function(){if(Cbj){var n=2,q=xgG(),w=function(){n--; n==0&&q&&q(!0)}; window.__onGCastApiAvailable=w;Dg5("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",hPv,w)}},oAj=function(){EA5(); var n=GSt();n.push("//www.gstatic.com/eureka/clank/cast_sender.js");dS(n)},AVf=function(){EA5(); var n=GSt();n.push.apply(n,g.D(be0.map(lIf)));n.push("//www.gstatic.com/eureka/clank/cast_sender.js");dS(n)},gS=function(n,q,w){g.A.call(this); this.D=w!=null?(0,g.ki)(n,w):n;this.V5=q;this.K=(0,g.ki)(this.xo,this);this.N=!1;this.X=0;this.C=this.Gk=null;this.W=[]},mV=function(){},YUv=function(){g.Kv.call(this,"p")},KNj=function(){g.Kv.call(this,"o")},uR0=function(){return SU5=SU5||new g.IR},BNf=function(n){g.Kv.call(this,"serverreachability",n)},yF=function(n){var q=uR0(); q.dispatchEvent(new BNf(q,n))},QdD=function(n){g.Kv.call(this,"statevent",n)},aG=function(n){var q=uR0(); q.dispatchEvent(new QdD(q,n))},Zet=function(n,q,w,X){g.Kv.call(this,"timingevent",n); this.size=q;this.rtt=w;this.retries=X},VF=function(n,q){if(typeof n!=="function")throw Error("Fn must not be null and must be a function"); return g.W0.setTimeout(function(){n()},q)},pr=function(){},Tk=function(n,q,w,X){this.C=n; this.W=q;this.ej=w;this.KM=X||1;this.qe=new g.jq(this);this.RH=45E3;this.n5=null;this.D=!1;this.L=this.oH=this.V=this.D0=this.vW=this.Ne=this.qP=null;this.PW=[];this.N=null;this.G=0;this.K=this.WW=null;this.AK=-1;this.Tp=!1;this.je=0;this.IH=null;this.nM=this.Ff=this.Me=this.HW=!1;this.X=new JVt},JVt=function(){this.X=null; this.N="";this.C=!1},WNB=function(n,q,w){n.D0=1; n.V=NS(q.clone());n.L=w;n.HW=!0;zPB(n,null)},zPB=function(n,q){n.vW=Date.now(); Fs(n);n.oH=n.V.clone();nr(n.oH,"t",n.KM);n.G=0;var w=n.C.D0;n.X=new JVt;n.N=NNt(n.C,w?q:null,!n.L);n.je>0&&(n.IH=new g.Bt((0,g.ki)(n.CF,n,n.N),n.je));n.qe.listen(n.N,"readystatechange",n.AG);q=n.n5?g.HJ(n.n5):{};n.L?(n.WW||(n.WW="POST"),q["Content-Type"]="application/x-www-form-urlencoded",n.N.send(n.oH,n.WW,n.L,q)):(n.WW="GET",n.N.send(n.oH,n.WW,null,q));yF(1)},q85=function(n){if(!nNi(n))return g.KE(n.N); var q=g.SX(n.N);if(q==="")return"";var w="",X=q.length,P=g.Aj(n.N)==4;if(!n.X.X){if(typeof TextDecoder==="undefined")return $4(n),vu(n),"";n.X.X=new g.W0.TextDecoder}for(var R=0;Rq.length)return wz0;q=q.slice(X,X+w);n.G=X+w;return q},Fs=function(n){n.Ne=Date.now()+n.RH; R7B(n,n.RH)},R7B=function(n,q){if(n.qP!=null)throw Error("WatchDog timer not null"); n.qP=VF((0,g.ki)(n.py,n),q)},chw=function(n){n.qP&&(g.W0.clearTimeout(n.qP),n.qP=null)},vu=function(n){n.C.jV()||n.Tp||IEG(n.C,n)},$4=function(n){chw(n); g.wM(n.IH);n.IH=null;n.qe.removeAll();if(n.N){var q=n.N;n.N=null;q.abort();q.dispose()}},iDD=function(n,q){try{var w=n.C; if(w.VJ!=0&&(w.N==n||kaw(w.X,n)))if(!n.Ff&&kaw(w.X,n)&&w.VJ==3){try{var X=w.HX.N.parse(q)}catch(V){X=null}if(Array.isArray(X)&&X.length==3){var P=X;if(P[0]==0)a:{if(!w.V){if(w.N)if(w.N.vW+3E30&&(w.je=1.5*k);X=w;var r=n.LI();if(r){var e=g.uH(r,"X-Client-Wire-Protocol");if(e){var f=X.X;!f.N&&(g.Mo(e,"spdy")||g.Mo(e,"quic")||g.Mo(e,"h2"))&&(f.W=f.K,f.N=new Set,f.X&&(sli(f,f.X),f.X=null))}if(X.HW){var O=g.uH(r,"X-HTTP-Session-Id");O&&(X.KV=O,g.RW(X.n5,X.HW,O))}}w.VJ=3;w.K&&w.K.nF();w.sD&&(w.tU=Date.now()-n.vW);X=w;var H=n;X.iS=e7f(X,X.D0?X.KM:null,X.ej);if(H.Ff){fED(X.X, H);var U=H,t=X.je;t&&U.setTimeout(t);U.qP&&(chw(U),Fs(U));X.N=H}else ODz(X);w.C.length>0&&Dw(w)}else R[0]!="stop"&&R[0]!="close"||x4(w,7);else w.VJ==3&&(R[0]=="stop"||R[0]=="close"?R[0]=="stop"?x4(w,7):w.disconnect():R[0]!="noop"&&w.K&&w.K.tj(R),w.PW=0)}yF(4)}catch(V){}},HDh=function(n,q){this.N=n; this.map=q;this.context=null},UHG=function(n){this.K=n||10; g.W0.PerformanceNavigationTiming?(n=g.W0.performance.getEntriesByType("navigation"),n=n.length>0&&(n[0].nextHopProtocol=="hq"||n[0].nextHopProtocol=="h2")):n=!!(g.W0.chrome&&g.W0.chrome.loadTimes&&g.W0.chrome.loadTimes()&&g.W0.chrome.loadTimes().wasFetchedViaSpdy);this.W=n?this.K:1;this.N=null;this.W>1&&(this.N=new Set);this.X=null;this.C=[]},tuL=function(n){return n.X?!0:n.N?n.N.size>=n.W:!1},jlj=function(n){return n.X?1:n.N?n.N.size:0},kaw=function(n,q){return n.X?n.X==q:n.N?n.N.has(q):!1},sli= function(n,q){n.N?n.N.add(q):n.X=q},fED=function(n,q){n.X&&n.X==q?n.X=null:n.N&&n.N.has(q)&&n.N.delete(q)},dHv=function(n){if(n.X!=null)return n.C.concat(n.X.PW); if(n.N!=null&&n.N.size!==0){var q=n.C;n=g.a(n.N.values());for(var w=n.next();!w.done;w=n.next())q=q.concat(w.value.PW);return q}return g.Ml(n.C)},gN0=function(n,q){var w=new pr; if(g.W0.Image){var X=new Image;X.onload=g.r0(hc,w,"TestLoadImage: loaded",!0,q,X);X.onerror=g.r0(hc,w,"TestLoadImage: error",!1,q,X);X.onabort=g.r0(hc,w,"TestLoadImage: abort",!1,q,X);X.ontimeout=g.r0(hc,w,"TestLoadImage: timeout",!1,q,X);g.W0.setTimeout(function(){if(X.ontimeout)X.ontimeout()},1E4); X.src=n}else q(!1)},mHL=function(n,q){var w=new pr,X=new AbortController,P=setTimeout(function(){X.abort(); hc(w,"TestPingServer: timeout",!1,q)},1E4); fetch(n,{signal:X.signal}).then(function(R){clearTimeout(P);R.ok?hc(w,"TestPingServer: ok",!0,q):hc(w,"TestPingServer: server error",!1,q)}).catch(function(){clearTimeout(P); hc(w,"TestPingServer: error",!1,q)})},hc=function(n,q,w,X,P){try{P&&(P.onload=null,P.onerror=null,P.onabort=null,P.ontimeout=null),X(w)}catch(R){}},yhw=function(){this.N=new mV},ln=function(n,q,w){return w&&w.ND?w.ND[n]||q:q},aEt=function(n){this.C=[]; this.KM=this.iS=this.n5=this.ej=this.N=this.KV=this.HW=this.Tp=this.G=this.AK=this.L=null;this.KD=this.oH=0;this.hJ=ln("failFast",!1,n);this.Ff=this.qP=this.V=this.D=this.K=null;this.YE=!0;this.N7=this.IH=-1;this.nM=this.PW=this.vW=0;this.k6=ln("baseRetryDelayMs",5E3,n);this.zG=ln("retryDelaySeedMs",1E4,n);this.TG=ln("forwardChannelMaxRetries",2,n);this.VL=ln("forwardChannelRequestTimeoutMs",2E4,n);this.aS=n&&n.aTh||void 0;this.u7=n&&n.yQ0||void 0;this.bx=n&&n.pFg||!1;this.je=void 0;this.D0=n&&n.PP0|| !1;this.W="";this.X=new UHG(n&&n.DQn);this.HX=new yhw;this.qe=n&&n.NDi||!1;this.Ne=n&&n.VLn||!1;this.qe&&this.Ne&&(this.Ne=!1);this.DF=n&&n.J5p||!1;n&&n.xMe&&(this.YE=!1);this.sD=!this.qe&&this.YE&&n&&n.eRW||!1;this.KG=void 0;n&&n.di&&n.di>0&&(this.KG=n.di);this.JU=void 0;this.tU=0;this.RH=!1;this.Me=this.WW=null},Mv=function(n){n.N&&(Vuf(n),n.N.cancel(),n.N=null)},pzh=function(n){Mv(n); n.V&&(g.W0.clearTimeout(n.V),n.V=null);Lr(n);n.X.cancel();n.D&&(typeof n.D==="number"&&g.W0.clearTimeout(n.D),n.D=null)},Dw=function(n){tuL(n.X)||n.D||(n.D=!0,g.Uz(n.wX,n),n.vW=0)},F1t=function(n,q){if(jlj(n.X)>=n.X.W-(n.D?1:0))return!1; if(n.D)return n.C=q.PW.concat(n.C),!0;if(n.VJ==1||n.VJ==2||n.vW>=(n.hJ?0:n.TG))return!1;n.D=VF((0,g.ki)(n.wX,n,q),Ttw(n,n.vW));n.vW++;return!0},vNj=function(n,q){var w; q?w=q.ej:w=n.oH++;var X=n.n5.clone();g.RW(X,"SID",n.W);g.RW(X,"RID",w);g.RW(X,"AID",n.IH);Gk(n,X);n.G&&n.L&&g.ri(X,n.G,n.L);w=new Tk(n,n.W,w,n.vW+1);n.G===null&&(w.n5=n.L);q&&(n.C=q.PW.concat(n.C));q=$Hj(n,w,1E3);w.setTimeout(Math.round(n.VL*.5)+Math.round(n.VL*.5*Math.random()));sli(n.X,w);WNB(w,X,q)},Gk=function(n,q){n.Tp&&g.nV(n.Tp,function(w,X){g.RW(q,X,w)}); n.K&&g.nV({},function(w,X){g.RW(q,X,w)})},$Hj=function(n,q,w){w=Math.min(n.C.length,w); var X=n.K?(0,g.ki)(n.K.Mm,n.K,n):null;a:{for(var P=n.C,R=-1;;){var c=["count="+w];R==-1?w>0?(R=P[0].N,c.push("ofs="+R)):R=0:c.push("ofs="+R);for(var k=!0,r=0;r=3)return!1; n.nM++;n.V=VF((0,g.ki)(n.HT,n),Ttw(n,n.PW));n.PW++;return!0},Vuf=function(n){n.WW!=null&&(g.W0.clearTimeout(n.WW),n.WW=null)},L1f=function(n){n.N=new Tk(n,n.W,"rpc",n.nM); n.G===null&&(n.N.n5=n.L);n.N.je=0;var q=n.iS.clone();g.RW(q,"RID","rpc");g.RW(q,"SID",n.W);g.RW(q,"AID",n.IH);g.RW(q,"CI",n.Ff?"0":"1");!n.Ff&&n.KG&&g.RW(q,"TO",n.KG);g.RW(q,"TYPE","xmlhttp");Gk(n,q);n.G&&n.L&&g.ri(q,n.G,n.L);n.je&&n.N.setTimeout(n.je);var w=n.N;n=n.KM;w.D0=1;w.V=NS(q.clone());w.L=null;w.HW=!0;zPB(w,n)},Lr=function(n){n.qP!=null&&(g.W0.clearTimeout(n.qP),n.qP=null)},IEG=function(n,q){var w=null; if(n.N==q){Lr(n);Vuf(n);n.N=null;var X=2}else if(kaw(n.X,q))w=q.PW,fED(n.X,q),X=1;else return;if(n.VJ!=0)if(q.D)if(X==1){w=q.L?q.L.length:0;q=Date.now()-q.vW;var P=n.vW;X=uR0();X.dispatchEvent(new Zet(X,w,q,P));Dw(n)}else ODz(n);else{var R=q.AK;P=q.getLastError();if(P==3||P==0&&R>0||!(X==1&&F1t(n,q)||X==2&&rhG(n)))switch(w&&w.length>0&&(q=n.X,q.C=q.C.concat(w)),P){case 1:x4(n,5);break;case 4:x4(n,10);break;case 3:x4(n,6);break;default:x4(n,2)}}},Ttw=function(n,q){var w=n.k6+Math.floor(Math.random()* n.zG); n.isActive()||(w*=2);return w*q},x4=function(n,q){if(q==2){var w=(0,g.ki)(n.CPq,n),X=n.u7,P=!X; X=new g.zu(X||"//www.google.com/images/cleardot.gif");g.W0.location&&g.W0.location.protocol=="http"||g.WR(X,"https");NS(X);P?gN0(X.toString(),w):mHL(X.toString(),w)}else aG(2);n.VJ=0;n.K&&n.K.Jj(q);Mu5(n);pzh(n)},Mu5=function(n){n.VJ=0; n.Me=[];if(n.K){var q=dHv(n.X);if(q.length!=0||n.C.length!=0)g.xi(n.Me,q),g.xi(n.Me,n.C),n.X.C.length=0,g.Ml(n.C),n.C.length=0;n.K.cT()}},xHG=function(n){if(n.VJ==0)return n.Me; var q=[];g.xi(q,dHv(n.X));g.xi(q,n.C);return q},e7f=function(n,q,w){var X=g.ct(w); X.N!=""?(q&&g.NL(X,q+"."+X.N),g.n9(X,X.C)):(X=g.W0.location,X=Ev5(X.protocol,q?q+"."+X.hostname:X.hostname,+X.port,w));q=n.HW;w=n.KV;q&&w&&g.RW(X,q,w);g.RW(X,"VER",n.fF);Gk(n,X);return X},NNt=function(n,q,w){if(q&&!n.D0)throw Error("Can't create secondary domain capable XhrIo object."); q=n.bx&&!n.aS?new g.Ez(new g.BR({rz:w})):new g.Ez(n.aS);q.G=n.D0;return q},DHj=function(){},h7i=function(){},Ev=function(n,q){g.IR.call(this); this.N=new aEt(q);this.K=n;this.X=q&&q.bW||null;n=q&&q.SQ||null;q&&q.zRh&&(n?n["X-Client-Protocol"]="webchannel":n={"X-Client-Protocol":"webchannel"});this.N.L=n;n=q&&q.lHf||null;q&&q.U7&&(n?n["X-WebChannel-Content-Type"]=q.U7:n={"X-WebChannel-Content-Type":q.U7});q&&q.Is&&(n?n["X-WebChannel-Client-Profile"]=q.Is:n={"X-WebChannel-Client-Profile":q.Is});this.N.AK=n;(n=q&&q.nph)&&!g.LV(n)&&(this.N.G=n);this.D=q&&q.PP0||!1;this.W=q&&q.rDW||!1;(q=q&&q.Up)&&!g.LV(q)&&(this.N.HW=q,g.jn(this.X,q)&&(n=this.X, q in n&&delete n[q]));this.C=new Cr(this)},lEf=function(n){YUv.call(this); n.__headers__&&(this.headers=n.__headers__,this.statusCode=n.__status__,delete n.__headers__,delete n.__status__);var q=n.__sm__;q?this.data=(this.N=g.cJ(q))?g.Ol(q,this.N):q:this.data=n},GaB=function(n){KNj.call(this); this.status=1;this.errorCode=n},Cr=function(n){this.N=n},C4t=function(n,q){this.X=n; this.N=q},ENz=function(n){return xHG(n.N).map(function(q){var w=n.X; q=q.map;"__data__"in q?(q=q.__data__,w=w.W?LuL(q):q):w=q;return w})},oG=function(n,q){if(typeof n!=="function")throw Error("Fn must not be null and must be a function"); return g.W0.setTimeout(function(){n()},q)},Ac=function(n){bn.dispatchEvent(new oNl(bn,n))},oNl=function(n){g.Kv.call(this,"statevent",n)},Y4=function(n,q,w,X){this.N=n; this.W=q;this.G=w;this.D=X||1;this.X=45E3;this.C=new g.jq(this);this.K=new g.LE;this.K.setInterval(250)},Ahv=function(n,q,w){n.R3=1; n.DE=NS(q.clone());n.au=w;n.HW=!0;bD5(n,null)},Y8i=function(n,q,w,X,P){n.R3=1; n.DE=NS(q.clone());n.au=null;n.HW=w;P&&(n.b0=!1);bD5(n,X)},bD5=function(n,q){n.Fb=Date.now(); K1B(n);n.Be=n.DE.clone();nr(n.Be,"t",n.D);n.bu=0;n.Ax=n.N.PL(n.N.O6()?q:null);n.Ew>0&&(n.UC=new g.Bt((0,g.ki)(n.lm,n,n.Ax),n.Ew));n.C.listen(n.Ax,"readystatechange",n.Cy);q=n.v9?g.HJ(n.v9):{};n.au?(n.S9="POST",q["Content-Type"]="application/x-www-form-urlencoded",n.Ax.send(n.Be,n.S9,n.au,q)):(n.S9="GET",n.b0&&!g.j4&&(q.Connection="close"),n.Ax.send(n.Be,n.S9,null,q));n.N.qC(1)},Btl=function(n,q){var w=n.bu,X=q.indexOf("\n",w); if(X==-1)return S8l;w=Number(q.substring(w,X));if(isNaN(w))return uoG;X+=1;if(X+w>q.length)return S8l;q=q.slice(X,X+w);n.bu=X+w;return q},K1B=function(n){n.q6=Date.now()+n.X; Qlt(n,n.X)},Qlt=function(n,q){if(n.Z4!=null)throw Error("WatchDog timer not null"); n.Z4=oG((0,g.ki)(n.v0,n),q)},ZDG=function(n){n.Z4&&(g.W0.clearTimeout(n.Z4),n.Z4=null)},Jh0=function(n){n.N.jV()||n.uV||n.N.pC(n)},Kr=function(n){ZDG(n); g.wM(n.UC);n.UC=null;n.K.stop();n.C.removeAll();if(n.Ax){var q=n.Ax;n.Ax=null;q.abort();q.dispose()}n.LH&&(n.LH=null)},z7B=function(n,q){try{n.N.kP(n,q),n.N.qC(4)}catch(w){}},NtG=function(n,q,w,X,P){if(X==0)w(!1); else{var R=P||0;X--;W1w(n,q,function(c){c?w(!0):g.W0.setTimeout(function(){NtG(n,q,w,X,R)},R)})}},W1w=function(n,q,w){var X=new Image; X.onload=function(){try{St(X),w(!0)}catch(P){}}; X.onerror=function(){try{St(X),w(!1)}catch(P){}}; X.onabort=function(){try{St(X),w(!1)}catch(P){}}; X.ontimeout=function(){try{St(X),w(!1)}catch(P){}}; g.W0.setTimeout(function(){if(X.ontimeout)X.ontimeout()},q); X.src=n},St=function(n){n.onload=null; n.onerror=null;n.onabort=null;n.ontimeout=null},ndG=function(n){this.N=n; this.X=new mV},qYD=function(n){var q=un(n.N,n.zm,"/mail/images/cleardot.gif"); NS(q);NtG(q.toString(),5E3,(0,g.ki)(n.oB,n),3,2E3);n.qC(1)},w3l=function(n){var q=n.N.D; q!=null?(Ac(5),q?(Ac(11),Bu(n.N,n,!1)):(Ac(12),Bu(n.N,n,!0))):(n.Cq=new Y4(n),n.Cq.v9=n.xQ,q=n.N,q=un(q,q.O6()?n.mw:null,n.AZ),Ac(5),nr(q,"TYPE","xmlhttp"),Y8i(n.Cq,q,!1,n.mw,!1))},X3D=function(n,q,w){this.N=1; this.X=[];this.C=[];this.K=new mV;this.L=n||null;this.D=q!=null?q:null;this.V=w||!1},Pgz=function(n,q){this.N=n; this.map=q;this.context=null},RvG=function(n,q,w,X){g.Kv.call(this,"timingevent",n); this.size=q;this.rtt=w;this.retries=X},cNf=function(n){g.Kv.call(this,"serverreachability",n)},kn0=function(n){n.aO(1,0); n.yn=un(n,null,n.M6);Iai(n)},rNz=function(n){n.M3&&(n.M3.abort(),n.M3=null); n.RY&&(n.RY.cancel(),n.RY=null);n.Hi&&(g.W0.clearTimeout(n.Hi),n.Hi=null);QF(n);n.ww&&(n.ww.cancel(),n.ww=null);n.Ir&&(g.W0.clearTimeout(n.Ir),n.Ir=null)},j4G=function(n,q){if(n.N==0)throw Error("Invalid operation: sending map when state is closed"); n.X.push(new Pgz(n.H0++,q));n.N!=2&&n.N!=3||Iai(n)},s4j=function(n){var q=0; n.RY&&q++;n.ww&&q++;return q},Iai=function(n){n.ww||n.Ir||(n.Ir=oG((0,g.ki)(n.Dc,n),0),n.Qh=0)},OWj=function(n,q){if(n.N==1){if(!q){n.KP=Math.floor(Math.random()*1E5); q=n.KP++;var w=new Y4(n,"",q);w.v9=n.ph;var X=evj(n),P=n.yn.clone();g.RW(P,"RID",q);g.RW(P,"CVER","1");Zw(n,P);Ahv(w,P,X);n.ww=w;n.N=2}}else n.N==3&&(q?faw(n,q):n.X.length==0||n.ww||faw(n))},faw=function(n,q){if(q)if(n.H9>6){n.X=n.C.concat(n.X); n.C.length=0;var w=n.KP-1;q=evj(n)}else w=q.G,q=q.au;else w=n.KP++,q=evj(n);var X=n.yn.clone();g.RW(X,"SID",n.W);g.RW(X,"RID",w);g.RW(X,"AID",n.gC);Zw(n,X);w=new Y4(n,n.W,w,n.Qh+1);w.v9=n.ph;w.setTimeout(1E4+Math.round(1E4*Math.random()));n.ww=w;Ahv(w,X,q)},Zw=function(n,q){n.I0&&(n=n.I0.dX())&&g.nV(n,function(w,X){g.RW(q,X,w)})},evj=function(n){var q=Math.min(n.X.length,1E3),w=["count="+q]; if(n.H9>6&&q>0){var X=n.X[0].N;w.push("ofs="+X)}else X=0;for(var P={},R=0;R=3)return!1; n.G++;n.Hi=oG((0,g.ki)(n.zo,n),HWj(n,n.GR));n.GR++;return!0},Bu=function(n,q,w){n.Zt=n.D==null?w:!n.D; n.k0=q.fz;n.V||kn0(n)},QF=function(n){n.W9!=null&&(g.W0.clearTimeout(n.W9),n.W9=null)},HWj=function(n,q){var w=5E3+Math.floor(Math.random()*1E4); n.isActive()||(w*=2);return w*q},Jc=function(n,q){if(q==2||q==9){var w=null; n.I0&&(w=null);var X=(0,g.ki)(n.v8W,n);w||(w=new g.zu("//www.google.com/images/cleardot.gif"),NS(w));W1w(w.toString(),1E4,X)}else Ac(2);tIj(n,q)},tIj=function(n,q){n.N=0; n.I0&&n.I0.rX(q);dU0(n);rNz(n)},dU0=function(n){n.N=0; n.k0=-1;if(n.I0)if(n.C.length==0&&n.X.length==0)n.I0.vL();else{var q=g.Ml(n.C),w=g.Ml(n.X);n.C.length=0;n.X.length=0;n.I0.vL(q,w)}},un=function(n,q,w){var X=g.ct(w); if(X.N!="")q&&g.NL(X,q+"."+X.N),g.n9(X,X.C);else{var P=window.location;X=Ev5(P.protocol,q?q+"."+P.hostname:P.hostname,+P.port,w)}n.dL&&g.nV(n.dL,function(R,c){g.RW(X,c,R)}); g.RW(X,"VER",n.H9);Zw(n,X);return X},gdj=function(){},mUt=function(){this.N=[]; this.X=[]},yNB=function(n){g.Kv.call(this,"channelMessage"); this.message=n},aaz=function(n){g.Kv.call(this,"channelError"); this.error=n},VIv=function(n,q){this.action=n; this.params=q||{}},zk=function(n,q){g.A.call(this); this.N=new g.YF(this.bGH,0,this);g.K(this,this.N);this.V5=5E3;this.X=0;if(typeof n==="function")q&&(n=(0,g.ki)(n,q));else if(n&&typeof n.handleEvent==="function")n=(0,g.ki)(n.handleEvent,n);else throw Error("Invalid listener argument");this.C=n},p3G=function(n,q,w,X,P,R,c,k,r,e,f,O,H,U){w=w===void 0?!1:w; X=X===void 0?function(){return""}:X; P=P===void 0?!1:P;R=R===void 0?!1:R;c=c===void 0?!1:c;k=k===void 0?function(){return g.pE({})}:k; r=r===void 0?!1:r;f=f===void 0?!1:f;O=O===void 0?!1:O;H=H===void 0?!1:H;U=U===void 0?!1:U;this.D0=n;this.qP=q;this.D=new g.de;this.X=new zk(this.HLq,this);this.N=null;this.G=!1;this.L=null;this.vW="";this.PW=this.V=0;this.C=[];this.nM=w;this.HW=X;this.K=R;this.n5=k;this.Tp=e;this.KM=c;this.WW=null;this.W=g.pE();this.ej=P;this.Me=r;this.qe=f;this.Ne=O;this.YE=H;this.AK=U;this.je=new MYG;this.Ff=new xNj;this.RH=new hcf;this.oH=new DNL;this.IH=new lOG;this.sD=new GVl;this.JU=new CpG},$UG=function(n, q,w,X,P){TZv(n); if(n.N){var R=g.bp("ID_TOKEN"),c=n.N.ph||{};R?c["x-youtube-identity-token"]=R:delete c["x-youtube-identity-token"];n.N.ph=c}F$z(n);X?(X.getState()!=3&&s4j(X)==0||X.getState(),n.N.connect(q,w,n.qP,X.W,X.gC)):P?n.N.connect(q,w,n.qP,P.sessionId,P.arrayId):n.N.connect(q,w,n.qP)},xUv=function(n,q){return n.YE?!0:n.Ne?Object.values(vdf).includes(q):n.qe?!Object.values(L$i).includes(q):n.AK?Object.values(MIz).includes(q):!1},laD=function(n){var q,w; g.b(function(X){if(X.X==1)return g.pO(X,2),g.l(X,DUw(n),2);g.Dm(X);q=n.C;n.C=[];w=q.length;hv0(n,q,w);Wu(n);return g.hO(X,0)})},hv0=function(n,q,w){for(var X=0;X0?w=Object.assign({},w,q):delete w.Authorization;n.N.ph=w}},F$z=function(n){n.Tp&&!n.K&&Cgj(n,n.Tp())},Nv=function(n){this.scheme="https"; this.port=this.domain="";this.N="/api/lounge";this.X=!0;n=n||document.location.href;var q=Number(g.cg(n)[4]||null)||"";q&&(this.port=":"+q);this.domain=g.IB(n)||"";n=g.CV();n.search("MSIE")>=0&&(n=n.match(/MSIE ([\d.]+)/)[1],g.GF(n,"10.0")<0&&(this.X=!1))},n5=function(n,q){var w=n.N; n.X&&(w=n.scheme+"://"+n.domain+n.port+n.N);return g.OV(w+q,{})},Edw=function(n,q){g.IR.call(this); var w=this;this.Sg=n();this.Sg.subscribe("handlerOpened",this.wU,this);this.Sg.subscribe("handlerClosed",this.onClosed,this);this.Sg.subscribe("handlerError",function(X,P){w.onError(P)}); this.Sg.subscribe("handlerMessage",this.onMessage,this);this.N=q},odG=function(n,q,w){var X=this; w=w===void 0?function(){return""}:w; var P=P===void 0?new h7i:P;var R=R===void 0?new g.de:R;this.pathPrefix=n;this.N=q;this.vW=w;this.K=R;this.V=null;this.L=this.G=0;this.channel=null;this.D=0;this.C=new zk(function(){X.C.isActive();var c;((c=X.channel)==null?void 0:jlj((new C4t(c,c.N)).N.X))===0&&X.connect(X.V,X.G)}); this.W={};this.X={};this.qP=!1;this.logger=null;this.PW=[];this.k8=void 0;this.n5=new MYG;this.WW=new xNj;this.Tp=new DNL;this.HW=new lOG},bWG=function(n){g.Wf(n.channel,"m",function(){n.D=3; n.C.reset();n.V=null;n.G=0;for(var q=g.a(n.PW),w=q.next();!w.done;w=q.next())w=w.value,n.channel&&n.channel.send(w);n.PW=[];n.publish("webChannelOpened");n.n5.Ot("WEB_CHANNEL")}); g.Wf(n.channel,"n",function(){n.D=0;n.C.isActive()||n.publish("webChannelClosed");var q,w=(q=n.channel)==null?void 0:ENz(new C4t(q,q.N));w&&(n.PW=[].concat(g.D(w)));n.WW.Ot("WEB_CHANNEL")}); g.Wf(n.channel,"p",function(q){var w=q.data;w[0]==="gracefulReconnect"?(n.C.start(),n.channel&&n.channel.close()):n.publish("webChannelMessage",new VIv(w[0],w[1]));n.k8=q.statusCode;n.Tp.Ot("WEB_CHANNEL")}); g.Wf(n.channel,"o",function(){n.k8===401||n.C.start();n.publish("webChannelError");n.HW.Ot("WEB_CHANNEL","")})},AN5=function(n){var q=n.vW(); q?n.W["x-youtube-lounge-xsrf-token"]=q:delete n.W["x-youtube-lounge-xsrf-token"]},YY0=function(n){g.IR.call(this); this.N=n();this.N.subscribe("webChannelOpened",this.JG,this);this.N.subscribe("webChannelClosed",this.onClosed,this);this.N.subscribe("webChannelError",this.onError,this);this.N.subscribe("webChannelMessage",this.onMessage,this)},K$v=function(n,q,w,X,P){function R(){return new p3G(n5(n,"/bc"),q,!1,w,X)} w=w===void 0?function(){return""}:w; return g.OU("enable_mdx_web_channel_desktop")?new YY0(function(){return new odG(n5(n,"/wc"),q,w)}):new Edw(R,P)},Q40=function(){var n=SYt; uc5();qu.push(n);BZh()},wO=function(n,q){uc5(); var w=ZWD(n,String(q));qu.length==0?JNz(w):(BZh(),g.Jw(qu,function(X){X(w)}))},Xj=function(n){wO("CP",n)},uc5=function(){qu||(qu=g.w0("yt.mdx.remote.debug.handlers_")||[],g.nj("yt.mdx.remote.debug.handlers_",qu))},JNz=function(n){var q=(PT+1)%50; PT=q;Rz[q]=n;cT||(cT=q==49)},BZh=function(){var n=qu; if(Rz[0]){var q=cT?PT:-1,w={};do w={TI:void 0},q=(q+1)%50,w.TI=Rz[q],g.Jw(n,function(X){return function(P){P(X.TI)}}(w)); while(q!=PT);Rz=Array(50);PT=-1;cT=!1}},ZWD=function(n,q){var w=(Date.now()-zvi)/1E3; w.toFixed&&(w=w.toFixed(3));var X=[];X.push("[",w+"s","] ");X.push("[","yt.mdx.remote","] ");X.push(n+": "+q,"\n");return X.join("")},Iz=function(n){g.np.call(this); this.D=n;this.screens=[]},W$v=function(n,q){var w=n.get(q.uuid)||n.get(q.id); if(w)return n=w.name,w.id=q.id||w.id,w.name=q.name,w.token=q.token,w.uuid=q.uuid||w.uuid,w.name!=n;n.screens.push(q);return!0},NZw=function(n,q){var w=n.screens.length!=q.length; n.screens=g.Vr(n.screens,function(R){return!!Ugi(q,R)}); for(var X=q.length,P=0;P0&&n.W0&&gO(n,w)},function(q){n.K=function(){}; n.Q$(q)})},$7l=function(n){var q={}; q.pairingCode=n.WW;q.theme=n.D0;$g5()&&(q.env_useStageMdx=1);return g.fF(q)},vsv=function(n){return new Promise(function(q){n.WW=iel(); if(n.n5){var w=new chrome.cast.DialLaunchResponse(!0,$7l(n));q(w);Fcf(n)}else n.qP=function(){g.sU(n.L);n.qP=function(){}; n.L=NaN;var X=new chrome.cast.DialLaunchResponse(!0,$7l(n));q(X);Fcf(n)},n.L=g.rN(function(){n.qP()},100)})},MvD=function(n,q,w){n.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(q)); var X=new IG(q);return(new Promise(function(P){Lcj(n,X,function(R){R?(n.PW=!0,f5(n.W,X),i8(n,X),gO(n,w)):g.Ki(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(q)+" is not online."));P(R)},5)})).then(function(P){return P?new chrome.cast.DialLaunchResponse(!1):vsv(n)})},x7j=function(n,q){var w=n.V.receiver.label,X=n.X.friendlyName; return(new Promise(function(P){sAL(n.W,w,q,X,function(R){R&&R.token&&i8(n,R);P(R)},function(R){HT(n,"Failed to get DIAL screen: "+R); P(null)})})).then(function(P){return P&&P.token?new chrome.cast.DialLaunchResponse(!1):vsv(n)})},Lcj=function(n,q,w,X){g.sU(n.D); n.D=0;fui(n.W,q,function(P){P||X<0?w(P):n.D=g.rN(function(){Lcj(n,q,w,X-1)},300)})},gO=function(n,q){n.info("getDialAppInfoWithTimeout_ "+q); dO(n)&&(g.sU(n.G),n.G=0,q==0?D7l(n):n.G=g.rN(function(){D7l(n)},q))},D7l=function(n){dO(n)&&n.C.getDialAppInfo(function(q){n.info("getDialAppInfo dialLaunchData: "+JSON.stringify(q)); q=q.extraData||{};var w=null;if(q.loungeToken){var X;((X=n.N)==null?void 0:X.token)==q.loungeToken&&(w="staleLoungeToken")}else w="missingLoungeToken";w?(n.vW=w,gO(n,3E4)):(n.PW=!1,n.vW="unknown",U7D(n,q.loungeToken),gO(n,q.loungeTokenRefreshIntervalMs))},function(q){n.info("getDialAppInfo error: "+q); n.vW="noLoungeTokenResponse";gO(n,3E4)})},hNj=function(n){g.sU(n.D); n.D=0;g.sU(n.G);n.G=0;n.K();n.K=function(){}; g.sU(n.L)},mP=function(n,q){OH.call(this,n,q,"ManualSession"); this.C=g.rN((0,g.ki)(this.T6,this,null),150)},yI=function(n,q){g.np.call(this); this.config_=q;this.X=n;this.V=q.appId||"233637DE";this.W=q.theme||"cl";this.L=q.disableCastApi||!1;this.D=q.forceMirroring||!1;this.N=null;this.G=!1;this.C=[];this.K=(0,g.ki)(this.fCq,this)},luL=function(n,q){return q?g.d0(n.C,function(w){return k4(q,w.label)},n):null},az=function(n){wO("Controller",n)},SYt=function(n){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(n)},VI=function(n){return n.G||!!n.C.length||!!n.N},p5=function(n,q,w){q!=n.N&&(g.wM(n.N),(n.N=q)?(w?n.publish("yt-remote-cast2-receiver-resumed", q.X):n.publish("yt-remote-cast2-receiver-selected",q.X),q.subscribe("sessionScreen",(0,g.ki)(n.Iq,n,q)),q.subscribe("sessionFailed",function(){return GgG(n,q)}),q.N?n.publish("yt-remote-cast2-session-change",q.N):w&&n.N.T6(null)):n.publish("yt-remote-cast2-session-change",null))},GgG=function(n,q){n.N==q&&n.publish("yt-remote-cast2-session-failed")},Cdv=function(n){var q=n.X.KF(),w=n.N&&n.N.X; n=g.Hh(q,function(X){w&&k4(X,w.label)&&(w=null);var P=X.uuid?X.uuid:X.id,R=luL(this,X);R?(R.label=P,R.friendlyName=X.name):(R=new chrome.cast.Receiver(P,X.name),R.receiverType=chrome.cast.ReceiverType.CUSTOM);return R},n); w&&(w.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(w=new chrome.cast.Receiver(w.label,w.friendlyName),w.receiverType=chrome.cast.ReceiverType.CUSTOM),n.push(w));return n},S9f=function(n,q,w,X){X.disableCastApi?Tq("Cannot initialize because disabled by Mdx config."):EsG()?osw(q,X)&&(bHw(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?A8B(n,w):(window.__onGCastApiAvailable=function(P,R){P?A8B(n,w):(Fj("Failed to load cast API: "+R),Y9D(!1),bHw(!1),g.vz("yt-remote-cast-available"),g.vz("yt-remote-cast-receiver"), Kch(),w(!1))},X.loadCastApiSetupScript?g.Wo("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?LN5()>=60&&oAj():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?hPv():LN5()>=89?AVf():(EA5(),dS(be0.map(lIf))))):Tq("Cannot initialize because not running Chrome")},Kch=function(){Tq("dispose"); var n=$n();n&&n.dispose();g.nj("yt.mdx.remote.cloudview.instance_",null);u0j(!1);g.J8(BIv);BIv.length=0},vT=function(){return!!g.$N("yt-remote-cast-installed")},QAB=function(){var n=g.$N("yt-remote-cast-receiver"); return n?n.friendlyName:null},ZHf=function(){Tq("clearCurrentReceiver"); g.vz("yt-remote-cast-receiver")},J8v=function(){return vT()?$n()?$n().getCastSession():(Fj("getCastSelector: Cast is not initialized."),null):(Fj("getCastSelector: Cast API is not installed!"),null)},zNf=function(){vT()?$n()?L5()?(Tq("Requesting cast selector."),$n().requestSession()):(Tq("Wait for cast API to be ready to request the session."),BIv.push(g.Zu("yt-remote-cast2-api-ready",zNf))):Fj("requestCastSelector: Cast is not initialized."):Fj("requestCastSelector: Cast API is not installed!")}, Mu=function(n,q){L5()?$n().setConnectedScreenStatus(n,q):Fj("setConnectedScreenStatus called before ready.")},EsG=function(){var n=g.CV().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.fT||n},Wc0=function(n,q){$n().init(n,q)},osw=function(n,q){var w=!1; $n()||(n=new yI(n,q),n.subscribe("yt-remote-cast2-availability-change",function(X){g.Fo("yt-remote-cast-available",X);Uv("yt-remote-cast2-availability-change",X)}),n.subscribe("yt-remote-cast2-receiver-selected",function(X){Tq("onReceiverSelected: "+X.friendlyName); g.Fo("yt-remote-cast-receiver",X);Uv("yt-remote-cast2-receiver-selected",X)}),n.subscribe("yt-remote-cast2-receiver-resumed",function(X){Tq("onReceiverResumed: "+X.friendlyName); g.Fo("yt-remote-cast-receiver",X);Uv("yt-remote-cast2-receiver-resumed",X)}),n.subscribe("yt-remote-cast2-session-change",function(X){Tq("onSessionChange: "+rS(X)); X||g.vz("yt-remote-cast-receiver");Uv("yt-remote-cast2-session-change",X)}),g.nj("yt.mdx.remote.cloudview.instance_",n),w=!0); Tq("cloudview.createSingleton_: "+w);return w},$n=function(){return g.w0("yt.mdx.remote.cloudview.instance_")},A8B=function(n,q){Y9D(!0); bHw(!1);Wc0(n,function(w){w?(u0j(!0),g.zg("yt-remote-cast2-api-ready")):(Fj("Failed to initialize cast API."),Y9D(!1),g.vz("yt-remote-cast-available"),g.vz("yt-remote-cast-receiver"),Kch());q(w)})},Tq=function(n){wO("cloudview",n)},Fj=function(n){wO("cloudview",n)},Y9D=function(n){Tq("setCastInstalled_ "+n); g.Fo("yt-remote-cast-installed",n)},L5=function(){return!!g.w0("yt.mdx.remote.cloudview.apiReady_")},u0j=function(n){Tq("setApiReady_ "+n); g.nj("yt.mdx.remote.cloudview.apiReady_",n)},bHw=function(n){g.nj("yt.mdx.remote.cloudview.initializing_",n)},xn=function(n){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.K=this.D=0;this.trackData=null;this.Om=this.qM=!1;this.V=this.C=this.G=this.X=0;this.N=NaN;this.W=!1;this.reset(n)},NIv=function(n){n.audioTrackId=null; n.trackData=null;n.playerState=-1;n.qM=!1;n.Om=!1;n.D=0;n.K=g.eB();n.X=0;n.G=0;n.C=0;n.V=0;n.N=NaN;n.W=!1},DW=function(n){return n.isPlaying()?(g.eB()-n.K)/1E3:0},hi=function(n,q){n.D=q; n.K=g.eB()},l8=function(n){switch(n.playerState){case 1:case 1081:return(g.eB()-n.K)/1E3+n.D; case -1E3:return 0}return n.D},n2t=function(n){return n.W?n.G+DW(n):n.G},Gq=function(n,q,w){var X=n.videoId; n.videoId=q;n.index=w;q!=X&&NIv(n)},qsB=function(n){var q={}; q.index=n.index;q.listId=n.listId;q.videoId=n.videoId;q.playerState=n.playerState;q.volume=n.volume;q.muted=n.muted;q.audioTrackId=n.audioTrackId;q.trackData=g.Ul(n.trackData);q.hasPrevious=n.qM;q.hasNext=n.Om;q.playerTime=n.D;q.playerTimeAt=n.K;q.seekableStart=n.X;q.seekableEnd=n.G;q.duration=n.C;q.loadedTime=n.V;q.liveIngestionTime=n.N;return q},EH=function(n,q){g.np.call(this); var w=this;this.C=0;this.W=n;this.D=[];this.K=new mUt;this.X=this.N=null;this.L=(0,g.ki)(this.rge,this);this.G=(0,g.ki)(this.K_,this);this.V=(0,g.ki)(this.ufn,this);this.qP=(0,g.ki)(this.O55,this);var X=0;n?(X=n.getProxyState(),X!=3&&(n.subscribe("proxyStateChange",this.O$,this),wqz(this))):X=3;X!=0&&(q?this.O$(X):g.rN(function(){w.O$(X)},0)); (n=J8v())&&C5(this,n);this.subscribe("yt-remote-cast2-session-change",this.qP)},oz=function(n){return new xn(n.W.getPlayerContextData())},wqz=function(n){g.Jw("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(q){this.D.push(this.W.subscribe(q,g.r0(this.v4o,q),this))},n)},Xqi=function(n){g.Jw(n.D,function(q){this.W.unsubscribeByKey(q)},n); n.D.length=0},b8=function(n){return n.getState()==1},Ai=function(n,q){var w=n.K; w.N.length+w.X.length<50&&n.K.enqueue(q)},P0j=function(n,q,w){var X=oz(n); hi(X,w);X.playerState!=-1E3&&(X.playerState=q);Yn(n,X)},K5=function(n,q,w){n.W.sendMessage(q,w)},Yn=function(n,q){Xqi(n); n.W.setPlayerContextData(qsB(q));wqz(n)},C5=function(n,q){n.X&&(n.X.removeUpdateListener(n.L),n.X.removeMediaListener(n.G),n.K_(null)); n.X=q;n.X&&(Xj("Setting cast session: "+n.X.sessionId),n.X.addUpdateListener(n.L),n.X.addMediaListener(n.G),n.X.media.length&&n.K_(n.X.media[0]))},RS5=function(n){var q=n.N.media,w=n.N.customData; if(q&&w){var X=oz(n);q.contentId!=X.videoId&&Xj("Cast changing video to: "+q.contentId);X.videoId=q.contentId;X.playerState=w.playerState;hi(X,n.N.getEstimatedTime());Yn(n,X)}else Xj("No cast media video. Ignoring state update.")},Sp=function(n,q,w){return(0,g.ki)(function(X){this.A$("Failed to "+q+" with cast v2 channel. Error code: "+X.code); X.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.A$("Retrying "+q+" using MDx browser channel."),K5(this,q,w))},n)},QI=function(n,q,w,X){X=X===void 0?!1:X; g.np.call(this);var P=this;this.D=NaN;this.WW=!1;this.L=this.V=this.PW=this.vW=NaN;this.qP=[];this.K=this.G=this.W=this.N=this.X=null;this.n5=n;this.Tp=X;this.qP.push(g.U8(window,"beforeunload",function(){P.tP(2)})); this.C=[];this.N=new xn;this.D0=q.id;this.HW=q.idType;this.X=K$v(this.n5,w,this.YP,this.HW=="shortLived",this.D0);this.X.listen("channelOpened",function(){cPf(P)}); this.X.listen("channelClosed",function(){u8("Channel closed");isNaN(P.D)?Ov(!0):Ov();P.dispose()}); this.X.listen("channelError",function(R){Ov();isNaN(P.Dn())?(R==1&&P.HW=="shortLived"&&P.publish("browserChannelAuthError",R),u8("Channel error: "+R+" without reconnection"),P.dispose()):(P.WW=!0,u8("Channel error: "+R+" with reconnection in "+P.Dn()+" ms"),BT(P,2))}); this.X.listen("channelMessage",function(R){IAh(P,R)}); this.X.DA(q.token);this.subscribe("remoteQueueChange",function(){var R=P.N.videoId;g.LD()&&g.Fo("yt-remote-session-video-id",R)})},kvG=function(n){return g.d0(n.C,function(q){return q.type=="LOUNGE_SCREEN"})},u8=function(n){wO("conn",n)},BT=function(n,q){n.publish("proxyStateChange",q)},rPh=function(n){n.D=g.rN(function(){u8("Connecting timeout"); n.tP(1)},2E4)},jjz=function(n){g.sU(n.D); n.D=NaN},sjD=function(n){g.sU(n.vW); n.vW=NaN},fAj=function(n){eSv(n); n.PW=g.rN(function(){ZW(n,"getNowPlaying")},2E4)},eSv=function(n){g.sU(n.PW); n.PW=NaN},cPf=function(n){u8("Channel opened"); n.WW&&(n.WW=!1,sjD(n),n.vW=g.rN(function(){u8("Timing out waiting for a screen.");n.tP(1)},15E3))},iRG=function(n,q){var w=null; if(q){var X=kvG(n);X&&(w={clientName:X.clientName,deviceMake:X.brand,deviceModel:X.model,osVersion:X.osVersion})}g.nj("yt.mdx.remote.remoteClient_",w);q&&(jjz(n),sjD(n));w=n.X.ij()&&isNaN(n.D);q==w?q&&(BT(n,1),ZW(n,"getSubtitlesTrack")):q?(n.yP()&&n.N.reset(),BT(n,1),ZW(n,"getNowPlaying"),ORB(n)):n.tP(1)},HR0=function(n,q){var w=q.params.videoId; delete q.params.videoId;w==n.N.videoId&&(g.fV(q.params)?n.N.trackData=null:n.N.trackData=q.params,n.publish("remotePlayerChange"))},Uit=function(n,q,w){var X=q.params.videoId||q.params.video_id,P=parseInt(q.params.currentIndex,10); n.N.listId=q.params.listId||n.N.listId;Gq(n.N,X,P);n.publish("remoteQueueChange",w)},diB=function(n,q){q.params=q.params||{}; Uit(n,q,"NOW_PLAYING_MAY_CHANGE");t2h(n,q);n.publish("autoplayDismissed")},t2h=function(n,q){var w=parseInt(q.params.currentTime||q.params.current_time,10); hi(n.N,isNaN(w)?0:w);w=parseInt(q.params.state,10);w=isNaN(w)?-1:w;w==-1&&n.N.playerState==-1E3&&(w=-1E3);n.N.playerState=w;w=Number(q.params.loadedTime);n.N.V=isNaN(w)?0:w;n.N.Rg(Number(q.params.duration));w=n.N;var X=Number(q.params.liveIngestionTime);w.N=X;w.W=isNaN(X)?!1:!0;w=n.N;X=Number(q.params.seekableStartTime);q=Number(q.params.seekableEndTime);w.X=isNaN(X)?0:X;w.G=isNaN(q)?0:q;n.N.playerState==1?fAj(n):eSv(n);n.publish("remotePlayerChange")},g2v=function(n,q){if(n.N.playerState!=-1E3){var w= 1085; switch(parseInt(q.params.adState,10)){case 1:w=1081;break;case 2:w=1084;break;case 0:w=1083}n.N.playerState=w;q=parseInt(q.params.currentTime,10);hi(n.N,isNaN(q)?0:q);n.publish("remotePlayerChange")}},miL=function(n,q){var w=q.params.muted=="true"; n.N.volume=parseInt(q.params.volume,10);n.N.muted=w;n.publish("remotePlayerChange")},yPv=function(n,q){n.G=q.params.videoId; n.publish("nowAutoplaying",parseInt(q.params.timeout,10))},aAt=function(n,q){n.G=q.params.videoId||null; n.publish("autoplayUpNext",n.G)},V2z=function(n,q){n.K=q.params.autoplayMode; n.publish("autoplayModeChange",n.K);n.K=="DISABLED"&&n.publish("autoplayDismissed")},pqj=function(n,q){var w=q.params.hasNext=="true"; n.N.qM=q.params.hasPrevious=="true";n.N.Om=w;n.publish("previousNextChange")},IAh=function(n,q){q=q.message; q.params?u8("Received: action="+q.action+", params="+g.lH(q.params)):u8("Received: action="+q.action+" {}");switch(q.action){case "loungeStatus":q=qv(q.params.devices);n.C=g.Hh(q,function(X){return new cu(X)}); q=!!g.d0(n.C,function(X){return X.type=="LOUNGE_SCREEN"}); iRG(n,q);q=n.bT("mlm");n.publish("multiStateLoopEnabled",q);break;case "loungeScreenDisconnected":g.vG(n.C,function(X){return X.type=="LOUNGE_SCREEN"}); iRG(n,!1);break;case "remoteConnected":var w=new cu(qv(q.params.device));g.d0(n.C,function(X){return X.equals(w)})||FuG(n.C,w); break;case "remoteDisconnected":w=new cu(qv(q.params.device));g.vG(n.C,function(X){return X.equals(w)}); break;case "gracefulDisconnect":break;case "playlistModified":Uit(n,q,"QUEUE_MODIFIED");break;case "nowPlaying":diB(n,q);break;case "onStateChange":t2h(n,q);break;case "onAdStateChange":g2v(n,q);break;case "onVolumeChanged":miL(n,q);break;case "onSubtitlesTrackChanged":HR0(n,q);break;case "nowAutoplaying":yPv(n,q);break;case "autoplayDismissed":n.publish("autoplayDismissed");break;case "autoplayUpNext":aAt(n,q);break;case "onAutoplayModeChanged":V2z(n,q);break;case "onHasPreviousNextChanged":pqj(n, q);break;case "requestAssistedSignIn":n.publish("assistedSignInRequested",q.params.authCode);break;case "onLoopModeChanged":n.publish("loopModeChange",q.params.loopMode);break;default:u8("Unrecognized action: "+q.action)}},ORB=function(n){g.sU(n.L); n.L=g.rN(function(){n.tP(1)},864E5)},ZW=function(n,q,w){w?u8("Sending: action="+q+", params="+g.lH(w)):u8("Sending: action="+q); n.X.sendMessage(q,w)},TPB=function(n){Iz.call(this,"ScreenServiceProxy"); this.Pd=n;this.N=[];this.N.push(this.Pd.$_s("screenChange",(0,g.ki)(this.Oz,this)));this.N.push(this.Pd.$_s("onlineScreenChange",(0,g.ki)(this.JKT,this)))},M2D=function(n,q){FNz(); if(!Hu||!Hu.get("yt-remote-disable-remote-module-for-dev")){q=g.bp("MDX_CONFIG")||q;tzj();yVj();Ji||(Ji=new Nv(q?q.loungeApiHost:void 0),$g5()&&(Ji.N="/api/loungedev"));zq||(zq=g.w0("yt.mdx.remote.deferredProxies_")||[],g.nj("yt.mdx.remote.deferredProxies_",zq));FUv();var w=WT();if(!w){var X=new ep(Ji,q?q.disableAutomaticScreenCache||!1:!1);g.nj("yt.mdx.remote.screenService_",X);w=WT();var P={};q&&(P={appId:q.appId,disableDial:q.disableDial,theme:q.theme,loadCastApiSetupScript:q.loadCastApiSetupScript, disableCastApi:q.disableCastApi,enableDialLoungeToken:q.enableDialLoungeToken,enableCastLoungeToken:q.enableCastLoungeToken,forceMirroring:q.forceMirroring});g.nj("yt.mdx.remote.enableConnectWithInitialState_",q?q.enableConnectWithInitialState||!1:!1);S9f(n,X,function(R){R?Nu()&&Mu(Nu(),"YouTube TV"):X.subscribe("onlineScreenChange",function(){Uv("yt-remote-receiver-availability-change")})},P)}q&&!g.w0("yt.mdx.remote.initialized_")&&(g.nj("yt.mdx.remote.initialized_",!0),n7("Initializing: "+g.lH(q)), qR.push(g.Zu("yt-remote-cast2-api-ready",function(){Uv("yt-remote-api-ready")})),qR.push(g.Zu("yt-remote-cast2-availability-change",function(){Uv("yt-remote-receiver-availability-change")})),qR.push(g.Zu("yt-remote-cast2-receiver-selected",function(){wX(null); Uv("yt-remote-auto-connect","cast-selector-receiver")})),qR.push(g.Zu("yt-remote-cast2-receiver-resumed",function(){Uv("yt-remote-receiver-resumed","cast-selector-receiver")})),qR.push(g.Zu("yt-remote-cast2-session-change",$iz)),qR.push(g.Zu("yt-remote-connection-change",function(R){R?Mu(Nu(),"YouTube TV"):X_()||(Mu(null,null),ZHf())})),qR.push(g.Zu("yt-remote-cast2-session-failed",function(){Uv("yt-remote-connection-failed")})),n=v25(),q.isAuto&&(n.id+="#dial"),P=q.capabilities||[],P.length>0&&(n.capabilities= P),n.name=q.device,n.app=q.app,(q=q.theme)&&(n.theme=q),n7(" -- with channel params: "+g.lH(n)),n?(g.Fo("yt-remote-session-app",n.app),g.Fo("yt-remote-session-name",n.name)):(g.vz("yt-remote-session-app"),g.vz("yt-remote-session-name")),g.nj("yt.mdx.remote.channelParams_",n),w.start(),Nu()||LU0())}},xiG=function(){var n=WT().Pd.$_gos(); var q=Pv();q&&RD()&&(Ugi(n,q)||n.push(q));return HeB(n)},hSL=function(){var n=Diz(); !n&&vT()&&QAB()&&(n={key:"cast-selector-receiver",name:QAB()});return n},Diz=function(){var n=xiG(),q=Pv(); q||(q=X_());return g.d0(n,function(w){return q&&k4(q,w.key)?!0:!1})},Pv=function(){var n=Nu(); if(!n)return null;var q=WT().uX();return jt(q,n)},$iz=function(n){n7("remote.onCastSessionChange_: "+rS(n)); if(n){var q=Pv();if(q&&q.id==n.id){if(Mu(q.id,"YouTube TV"),n.idType=="shortLived"&&(n=n.token))cv&&(cv.token=n),(q=RD())&&q.DA(n)}else q&&ID(),kX(n,1)}else RD()&&ID()},ID=function(){L5()?$n().stopSession():Fj("stopSession called before API ready."); var n=RD();n&&(n.disconnect(1),lAj(null))},GvB=function(){var n=RD(); return!!n&&n.getProxyState()!=3},n7=function(n){wO("remote",n)},WT=function(){if(!C0z){var n=g.w0("yt.mdx.remote.screenService_"); C0z=n?new TPB(n):null}return C0z},Nu=function(){return g.w0("yt.mdx.remote.currentScreenId_")},E2B=function(n){g.nj("yt.mdx.remote.currentScreenId_",n)},o2v=function(){return g.w0("yt.mdx.remote.connectData_")},wX=function(n){g.nj("yt.mdx.remote.connectData_",n)},RD=function(){return g.w0("yt.mdx.remote.connection_")},lAj=function(n){var q=RD(); wX(null);n||E2B("");g.nj("yt.mdx.remote.connection_",n);zq&&(g.Jw(zq,function(w){w(n)}),zq.length=0); q&&!n?Uv("yt-remote-connection-change",!1):!q&&n&&Uv("yt-remote-connection-change",!0)},X_=function(){var n=g.LD(); if(!n)return null;var q=WT();if(!q)return null;q=q.uX();return jt(q,n)},kX=function(n,q){Nu(); Pv()&&Pv();if(rX)cv=n;else{E2B(n.id);var w=g.w0("yt.mdx.remote.enableConnectWithInitialState_")||!1;n=new QI(Ji,n,v25(),w);n.connect(q,o2v());n.subscribe("beforeDisconnect",function(X){Uv("yt-remote-before-disconnect",X)}); n.subscribe("beforeDispose",function(){RD()&&(RD(),lAj(null))}); n.subscribe("browserChannelAuthError",function(){var X=Pv();X&&X.idType=="shortLived"&&(L5()?$n().handleBrowserChannelAuthError():Fj("refreshLoungeToken called before API ready."))}); lAj(n)}},LU0=function(){var n=X_(); n?(n7("Resume connection to: "+rS(n)),kX(n,0)):(Ov(),ZHf(),n7("Skipping connecting because no session screen found."))},FUv=function(){var n=v25(); if(g.fV(n)){n=fr();var q=g.$N("yt-remote-session-name")||"",w=g.$N("yt-remote-session-app")||"";n={device:"REMOTE_CONTROL",id:n,name:q,app:w,mdxVersion:3};n.authuser=String(g.bp("SESSION_INDEX","0"));(q=g.bp("DELEGATED_SESSION_ID"))&&(n.pageId=String(q));g.nj("yt.mdx.remote.channelParams_",n)}},v25=function(){return g.w0("yt.mdx.remote.channelParams_")||{}},YsG=function(n,q,w){g.A.call(this); var X=this;this.N=n;this.T=q;this.Sj=w;this.events=new g.Um(this);this.K=!1;this.D=new g.OG(64);this.X=new g.YF(this.ll,500,this);this.C=new g.YF(this.kW,1E3,this);this.V=new gS(this.KzH,0,this);this.W={};this.L=new g.YF(this.h2,1E3,this);this.G=new g.Bt(this.seekTo,1E3,this);this.qP=this.events.j(this.T,"onVolumeChange",function(P){bRt(X,P)}); g.K(this,this.events);this.events.j(q,"onCaptionsTrackListChanged",this.xel);this.events.j(q,"captionschanged",this.zn5);this.events.j(q,"captionssettingschanged",this.Ze);this.events.j(q,"videoplayerreset",this.R7);this.events.j(q,"mdxautoplaycancel",function(){X.Sj.Cw()}); q.Z("enable_mdx_video_play_directly")&&this.events.j(q,"videodatachange",function(){APi(X.N)||j8(X)||so(X,0)}); n=this.Sj;n.zp();n.subscribe("proxyStateChange",this.Yx,this);n.subscribe("remotePlayerChange",this.Y_,this);n.subscribe("remoteQueueChange",this.R7,this);n.subscribe("previousNextChange",this.Zu,this);n.subscribe("nowAutoplaying",this.uN,this);n.subscribe("autoplayDismissed",this.CY,this);g.K(this,this.X);g.K(this,this.C);g.K(this,this.V);g.K(this,this.L);g.K(this,this.G);this.Ze();this.R7();this.Y_()},bRt=function(n,q){if(j8(n)){n.Sj.unsubscribe("remotePlayerChange",n.Y_,n); var w=Math.round(q.volume);q=!!q.muted;var X=oz(n.Sj);if(w!==X.volume||q!==X.muted)n.Sj.setVolume(w,q),n.L.start();n.Sj.subscribe("remotePlayerChange",n.Y_,n)}},KU5=function(n){n.hU(0); n.X.stop();n.NU(new g.OG(64))},SsG=function(n,q){if(j8(n)&&!n.K){var w=null; q&&(w={style:n.T.getSubtitlesUserSettings()},Object.assign(w,q));n.Sj.gX(n.T.getVideoData(1).videoId,w);n.W=oz(n.Sj).trackData}},so=function(n,q){var w=n.T.getPlaylist(); if(w==null?0:w.listId){var X=w.index;var P=w.listId.toString()}w=n.T.getVideoData(1);n.Sj.playVideo(w.videoId,q,X,P,w.playerParams,w.n5,TWi(w));n.NU(new g.OG(1))},u10=function(n,q){if(q){var w=n.T.getOption("captions","tracklist",{jZ:1}); w&&w.length?(n.T.setOption("captions","track",q),n.K=!1):(n.T.loadModule("captions"),n.K=!0)}else n.T.setOption("captions","track",{})},j8=function(n){return oz(n.Sj).videoId===n.T.getVideoData(1).videoId},BPD=function(n,q){g.zm.call(this,n); this.N=q},e8=function(){g.Q.call(this,{J:"div", Y:"ytp-mdx-popup-dialog",U:{role:"dialog"},S:[{J:"div",Y:"ytp-mdx-popup-dialog-inner-content",S:[{J:"div",Y:"ytp-mdx-popup-title",Ag:"You're signed out"},{J:"div",Y:"ytp-mdx-popup-description",Ag:"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."},{J:"div",Y:"ytp-mdx-privacy-popup-buttons",S:[{J:"button",Jg:["ytp-button","ytp-mdx-privacy-popup-cancel"],Ag:"Cancel"},{J:"button",Jg:["ytp-button", "ytp-mdx-privacy-popup-confirm"],Ag:"Confirm"}]}]}]});this.fade=new g.ZF(this,250);this.cancelButton=this.C5("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.C5("ytp-mdx-privacy-popup-confirm");g.K(this,this.fade);this.j(this.cancelButton,"click",this.N);this.j(this.confirmButton,"click",this.X)},f7=function(n){g.Q.call(this,{J:"div", Y:"ytp-remote",S:[{J:"div",Y:"ytp-remote-display-status",S:[{J:"div",Y:"ytp-remote-display-status-icon",S:[g.ODs()]},{J:"div",Y:"ytp-remote-display-status-text",Ag:"{{statustext}}"}]}]});this.api=n;this.fade=new g.ZF(this,250);g.K(this,this.fade);this.j(n,"presentingplayerstatechange",this.onStateChange);this.eg(n.getPlayerStateObject())},Oo=function(n,q){g.bB.call(this,"Play on",1,n,q); this.T=n;this.z3={};this.j(n,"onMdxReceiversChange",this.W);this.j(n,"presentingplayerstatechange",this.W);this.W()},QjG=function(n){g.Lq.call(this,n); this.wD={key:iel(),name:"This computer"};this.ag=null;this.subscriptions=[];this.G2=this.Sj=null;this.z3=[this.wD];this.Cm=this.wD;this.jP=new g.OG(64);this.Ao=0;this.Mr=-1;this.Pk=!1;this.aX=this.qX=this.AB=null;if(!g.qI(this.player.B())&&!g.LX(this.player.B())){n=this.player;var q=g.L0(n);q&&(q=q.tf())&&(q=new Oo(n,q),g.K(this,q));q=new f7(n);g.K(this,q);g.Zp(n,q.element,4);this.AB=new e8;g.K(this,this.AB);g.Zp(n,this.AB.element,4);this.Pk=!!X_()}},iW=function(n){n.qX&&(n.player.removeEventListener("presentingplayerstatechange", n.qX),n.qX=null)},ZRz=function(n,q,w){n.jP=w; n.player.publish("presentingplayerstatechange",new g.cn(w,q))},Hv=function(n,q){if(q.key!==n.Cm.key)if(q.key===n.wD.key)ID(); else if(APi(n)&&JPG(n),n.Cm=q,!n.player.B().Z("disable_mdx_connection_in_mdx_module_for_music_web")||!g.LX(n.player.B())){var w=n.player.getPlaylistId();var X=n.player.getVideoData(1);var P=X.videoId;if(!w&&!P||(n.player.getAppState()===2||n.player.getAppState()===1)&&n.player.B().Z("should_clear_video_data_on_player_cued_unstarted"))X=null;else{var R=n.player.getPlaylist();if(R){var c=[];for(var k=0;k2*this.size&&RG(this),!0):!1}; g.d.get=function(n,q){return Xs(this.X,n)?this.X[n]:q}; g.d.set=function(n,q){Xs(this.X,n)||(this.size+=1,this.N.push(n),this.Er++);this.X[n]=q}; g.d.forEach=function(n,q){for(var w=this.Bt(),X=0;X=X.N.length)return g.OK;var R=X.N[q++];return g.gM(n?R:X.X[R])}; return P}; var SqG={mLh:"atp",FYH:"ska",Smn:"que",pwH:"mus",uq5:"sus",Qcp:"dsp",a2h:"seq",bOH:"mic",Sif:"dpa",PXq:"mlm",Bp5:"dsdtr",Hqf:"ntb",wri:"vsp",MJP:"scn",mgf:"rpe",VGf:"dcn",Iip:"dcp",Oqo:"pas",Urq:"drq",nLg:"opf",Xlq:"els",Axe:"isg",cvf:"svq",xgW:"mvp",Ewp:"ads",gvq:"stcp",nvh:"sads",o5q:"dloc",mrT:"dcw",PIH:"asw",qFP:"apw"},upi={Hoi:"u",JSl:"cl",uUP:"k",Lsf:"i",Zbf:"cr",AhT:"m",hj5:"g",xb:"up"},vdf={oZ:"adPlaying",Uh:"onAdStateChange"},L$i={wwi:"nowPlaying",kHl:"onStateChange",oZ:"adPlaying",Uh:"onAdStateChange", IF:"nowPlayingShorts",BD:"onShortsStateChange"},MIz={IF:"nowPlayingShorts",BD:"onShortsStateChange"};cu.prototype.equals=function(n){return n?this.id==n.id:!1}; var mgh="",Hu=null;g.m(vAv,g.x0);var tc,Cbj=Mzw("loadCastFramework")||Mzw("loadCastApplicationFramework"),be0=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.Ot(gS,g.A);g.d=gS.prototype;g.d.P0=function(n){this.W=arguments;this.N=!1;this.Gk?this.C=g.eB()+this.V5:this.Gk=g.Mn(this.K,this.V5)}; g.d.stop=function(){this.Gk&&(g.W0.clearTimeout(this.Gk),this.Gk=null);this.C=null;this.N=!1;this.W=[]}; g.d.pause=function(){++this.X}; g.d.resume=function(){this.X&&(--this.X,!this.X&&this.N&&(this.N=!1,this.D.apply(null,this.W)))}; g.d.Xf=function(){this.stop();gS.mT.Xf.call(this)}; g.d.xo=function(){this.Gk&&(g.W0.clearTimeout(this.Gk),this.Gk=null);this.C?(this.Gk=g.Mn(this.K,this.C-g.eB()),this.C=null):this.X?this.N=!0:(this.N=!1,this.D.apply(null,this.W))};mV.prototype.stringify=function(n){return g.W0.JSON.stringify(n,void 0)}; mV.prototype.parse=function(n){return g.W0.JSON.parse(n,void 0)};g.Ot(YUv,g.Kv);g.Ot(KNj,g.Kv);var SU5=null;g.Ot(BNf,g.Kv);g.Ot(QdD,g.Kv);g.Ot(Zet,g.Kv);pr.prototype.debug=function(){}; pr.prototype.info=function(){}; pr.prototype.warning=function(){};var Xzh={},wz0={};g.d=Tk.prototype;g.d.setTimeout=function(n){this.RH=n}; g.d.AG=function(n){n=n.target;var q=this.IH;q&&g.Aj(n)==3?q.EQ():this.CF(n)}; g.d.CF=function(n){try{if(n==this.N)a:{var q=g.Aj(this.N),w=this.N.X,X=this.N.getStatus();if(!(q<3)&&(q!=3||this.N&&(this.X.C||g.KE(this.N)||g.SX(this.N)))){this.Tp||q!=4||w==7||(w==8||X<=0?yF(3):yF(2));chw(this);var P=this.N.getStatus();this.AK=P;var R=q85(this);if(this.D=P==200){if(this.Me&&!this.Ff){b:{if(this.N){var c=g.uH(this.N,"X-HTTP-Initial-Response");if(c&&!g.LV(c)){var k=c;break b}}k=null}if(n=k)this.Ff=!0,iDD(this,n);else{this.D=!1;this.K=3;aG(12);$4(this);vu(this);break a}}if(this.HW){n= !0;for(var r;!this.Tp&&this.G0&&!this.nM&&(this.nM=!0,this.C.i$(this)):($4(this),vu(this))}else iDD(this,R);q==4&&$4(this);this.D&&!this.Tp&&(q==4?IEG(this.C,this):(this.D=!1,Fs(this)))}else g.yRm(this.N),P==400&&R.indexOf("Unknown SID")> 0?(this.K=3,aG(12)):(this.K=0,aG(13)),$4(this),vu(this)}}}catch(e){}finally{}}; g.d.cancel=function(){this.Tp=!0;$4(this)}; g.d.py=function(){this.qP=null;var n=Date.now();n-this.Ne>=0?(this.D0!=2&&(yF(3),aG(17)),$4(this),this.K=2,vu(this)):R7B(this,this.Ne-n)}; g.d.getLastError=function(){return this.K}; g.d.LI=function(){return this.N};UHG.prototype.cancel=function(){this.C=dHv(this);if(this.X)this.X.cancel(),this.X=null;else if(this.N&&this.N.size!==0){for(var n=g.a(this.N.values()),q=n.next();!q.done;q=n.next())q.value.cancel();this.N.clear()}};g.d=aEt.prototype;g.d.fF=8;g.d.VJ=1;g.d.connect=function(n,q,w,X){aG(0);this.ej=n;this.Tp=q||{};w&&X!==void 0&&(this.Tp.OSID=w,this.Tp.OAID=X);this.Ff=this.YE;this.n5=e7f(this,null,this.ej);Dw(this)}; g.d.disconnect=function(){pzh(this);if(this.VJ==3){var n=this.oH++,q=this.n5.clone();g.RW(q,"SID",this.W);g.RW(q,"RID",n);g.RW(q,"TYPE","terminate");Gk(this,q);n=new Tk(this,this.W,n);n.D0=2;n.V=NS(q.clone());q=!1;if(g.W0.navigator&&g.W0.navigator.sendBeacon)try{q=g.W0.navigator.sendBeacon(n.V.toString(),"")}catch(w){}!q&&g.W0.Image&&((new Image).src=n.V,q=!0);q||(n.N=NNt(n.C,null),n.N.send(n.V));n.vW=Date.now();Fs(n)}Mu5(this)}; g.d.jV=function(){return this.VJ==0}; g.d.getState=function(){return this.VJ}; g.d.wX=function(n){if(this.D)if(this.D=null,this.VJ==1){if(!n){this.oH=Math.floor(Math.random()*1E5);n=this.oH++;var q=new Tk(this,"",n),w=this.L;this.AK&&(w?(w=g.HJ(w),g.tX(w,this.AK)):w=this.AK);this.G!==null||this.Ne||(q.n5=w,w=null);var X;if(this.qe)a:{for(var P=X=0;P4096){X=P;break a}if(X===4096||P===this.C.length-1){X=P+1;break a}}X= 1E3}else X=1E3;X=$Hj(this,q,X);P=this.n5.clone();g.RW(P,"RID",n);g.RW(P,"CVER",22);this.HW&&g.RW(P,"X-HTTP-Session-Id",this.HW);Gk(this,P);w&&(this.Ne?X="headers="+g.$1(g.Ko3(w))+"&"+X:this.G&&g.ri(P,this.G,w));sli(this.X,q);this.DF&&g.RW(P,"TYPE","init");this.qe?(g.RW(P,"$req",X),g.RW(P,"SID","null"),q.Me=!0,WNB(q,P,null)):WNB(q,P,X);this.VJ=2}}else this.VJ==3&&(n?vNj(this,n):this.C.length==0||tuL(this.X)||vNj(this))}; g.d.HT=function(){this.V=null;L1f(this);if(this.sD&&!(this.RH||this.N==null||this.tU<=0)){var n=2*this.tU;this.WW=VF((0,g.ki)(this.Tlg,this),n)}}; g.d.Tlg=function(){this.WW&&(this.WW=null,this.Ff=!1,this.RH=!0,aG(10),Mv(this),L1f(this))}; g.d.i$=function(n){this.N==n&&this.sD&&!this.RH&&(Vuf(this),this.RH=!0,aG(11))}; g.d.Xh=function(){this.qP!=null&&(this.qP=null,Mv(this),rhG(this),aG(19))}; g.d.CPq=function(n){n?aG(2):aG(1)}; g.d.isActive=function(){return!!this.K&&this.K.isActive(this)}; g.d=DHj.prototype;g.d.nF=function(){}; g.d.tj=function(){}; g.d.Jj=function(){}; g.d.cT=function(){}; g.d.isActive=function(){return!0}; g.d.Mm=function(){};g.Ot(Ev,g.IR);Ev.prototype.open=function(){this.N.K=this.C;this.D&&(this.N.D0=!0);this.N.connect(this.K,this.X||void 0)}; Ev.prototype.close=function(){this.N.disconnect()}; Ev.prototype.send=function(n){var q=this.N;if(typeof n==="string"){var w={};w.__data__=n;n=w}else this.W&&(w={},w.__data__=g.lH(n),n=w);q.C.push(new HDh(q.KD++,n));q.VJ==3&&Dw(q)}; Ev.prototype.Xf=function(){this.N.K=null;delete this.C;this.N.disconnect();delete this.N;Ev.mT.Xf.call(this)}; g.Ot(lEf,YUv);g.Ot(GaB,KNj);g.Ot(Cr,DHj);Cr.prototype.nF=function(){this.N.dispatchEvent("m")}; Cr.prototype.tj=function(n){this.N.dispatchEvent(new lEf(n))}; Cr.prototype.Jj=function(n){this.N.dispatchEvent(new GaB(n))}; Cr.prototype.cT=function(){this.N.dispatchEvent("n")};var bn=new g.IR;g.m(oNl,g.Kv);g.d=Y4.prototype;g.d.v9=null;g.d.Vz=!1;g.d.Z4=null;g.d.q6=null;g.d.Fb=null;g.d.R3=null;g.d.DE=null;g.d.Be=null;g.d.au=null;g.d.Ax=null;g.d.bu=0;g.d.LH=null;g.d.S9=null;g.d.Ct=null;g.d.rL=-1;g.d.b0=!0;g.d.uV=!1;g.d.Ew=0;g.d.UC=null;var uoG={},S8l={};g.d=Y4.prototype;g.d.setTimeout=function(n){this.X=n}; g.d.Cy=function(n){n=n.target;var q=this.UC;q&&g.Aj(n)==3?q.EQ():this.lm(n)}; g.d.lm=function(n){try{if(n==this.Ax)a:{var q=g.Aj(this.Ax),w=this.Ax.X,X=this.Ax.getStatus();if(g.j4&&!g.A_("420+")){if(q<4)break a}else if(q<3||q==3&&!g.KE(this.Ax))break a;this.uV||q!=4||w==7||(w==8||X<=0?this.N.qC(3):this.N.qC(2));ZDG(this);var P=this.Ax.getStatus();this.rL=P;var R=g.KE(this.Ax);if(this.Vz=P==200){q==4&&Kr(this);if(this.HW){for(n=!0;!this.uV&&this.bu0?(this.Ct=3,Ac(13)):(this.Ct=0,Ac(14)),Kr(this),Jh0(this)}}catch(k){}finally{}}; g.d.cancel=function(){this.uV=!0;Kr(this)}; g.d.v0=function(){this.Z4=null;var n=Date.now();n-this.q6>=0?(this.R3!=2&&this.N.qC(3),Kr(this),this.Ct=2,Ac(18),Jh0(this)):Qlt(this,this.q6-n)}; g.d.getLastError=function(){return this.Ct};g.d=ndG.prototype;g.d.xQ=null;g.d.Cq=null;g.d.zl=!1;g.d.AZ=null;g.d.xv=null;g.d.fz=-1;g.d.mw=null;g.d.zm=null;g.d.connect=function(n){this.AZ=n;n=un(this.N,null,this.AZ);Ac(3);Date.now();var q=this.N.L;q!=null?(this.mw=q[0],(this.zm=q[1])?(this.xv=1,qYD(this)):(this.xv=2,w3l(this))):(nr(n,"MODE","init"),this.Cq=new Y4(this),this.Cq.v9=this.xQ,Y8i(this.Cq,n,!1,null,!0),this.xv=0)}; g.d.oB=function(n){if(n)this.xv=2,w3l(this);else{Ac(4);var q=this.N;q.k0=q.M3.fz;Jc(q,9)}n&&this.qC(2)}; g.d.PL=function(n){return this.N.PL(n)}; g.d.abort=function(){this.Cq&&(this.Cq.cancel(),this.Cq=null);this.fz=-1}; g.d.jV=function(){return!1}; g.d.kP=function(n,q){this.fz=n.rL;if(this.xv==0)if(q){try{var w=this.X.parse(q)}catch(X){n=this.N;n.k0=this.fz;Jc(n,2);return}this.mw=w[0];this.zm=w[1]}else n=this.N,n.k0=this.fz,Jc(n,2);else this.xv==2&&(this.zl?(Ac(7),Date.now()):q=="11111"?(Ac(6),this.zl=!0,Date.now(),this.fz=200,this.Cq.cancel(),Ac(12),Bu(this.N,this,!0)):(Ac(8),Date.now(),this.zl=!1))}; g.d.pC=function(){this.fz=this.Cq.rL;if(this.Cq.Vz)this.xv==0?this.zm?(this.xv=1,qYD(this)):(this.xv=2,w3l(this)):this.xv==2&&(this.zl?(Ac(12),Bu(this.N,this,!0)):(Ac(11),Bu(this.N,this,!1)));else{this.xv==0?Ac(9):this.xv==2&&Ac(10);var n=this.N;this.Cq.getLastError();n.k0=this.fz;Jc(n,2)}}; g.d.O6=function(){return this.N.O6()}; g.d.isActive=function(){return this.N.isActive()}; g.d.qC=function(n){this.N.qC(n)};g.d=X3D.prototype;g.d.ph=null;g.d.dL=null;g.d.ww=null;g.d.RY=null;g.d.M6=null;g.d.yn=null;g.d.hj=null;g.d.XB=null;g.d.KP=0;g.d.H0=0;g.d.I0=null;g.d.Ir=null;g.d.Hi=null;g.d.W9=null;g.d.M3=null;g.d.Zt=null;g.d.gC=-1;g.d.To=-1;g.d.k0=-1;g.d.Qh=0;g.d.GR=0;g.d.H9=8;var zSi={OK:0,qgq:2,V$T:4,Jhl:5,fNh:6,STOP:7,Vw:8,E5e:9,yMi:10,NpT:11,xL5:12};g.Ot(RvG,g.Kv);g.Ot(cNf,g.Kv);g.d=X3D.prototype; g.d.connect=function(n,q,w,X,P){Ac(0);this.M6=q;this.dL=w||{};X&&P!==void 0&&(this.dL.OSID=X,this.dL.OAID=P);this.V?(oG((0,g.ki)(this.Bo,this,n),100),kn0(this)):this.Bo(n)}; g.d.disconnect=function(){rNz(this);if(this.N==3){var n=this.KP++,q=this.yn.clone();g.RW(q,"SID",this.W);g.RW(q,"RID",n);g.RW(q,"TYPE","terminate");Zw(this,q);n=new Y4(this,this.W,n);n.R3=2;n.DE=NS(q.clone());(new Image).src=n.DE.toString();n.Fb=Date.now();K1B(n)}dU0(this)}; g.d.Bo=function(n){this.M3=new ndG(this);this.M3.xQ=this.ph;this.M3.X=this.K;this.M3.connect(n)}; g.d.jV=function(){return this.N==0}; g.d.getState=function(){return this.N}; g.d.Dc=function(n){this.Ir=null;OWj(this,n)}; g.d.zo=function(){this.Hi=null;this.RY=new Y4(this,this.W,"rpc",this.G);this.RY.v9=this.ph;this.RY.Ew=0;var n=this.hj.clone();g.RW(n,"RID","rpc");g.RW(n,"SID",this.W);g.RW(n,"CI",this.Zt?"0":"1");g.RW(n,"AID",this.gC);Zw(this,n);g.RW(n,"TYPE","xmlhttp");Y8i(this.RY,n,!0,this.XB,!1)}; g.d.kP=function(n,q){if(this.N!=0&&(this.RY==n||this.ww==n))if(this.k0=n.rL,this.ww==n&&this.N==3)if(this.H9>7){try{var w=this.K.parse(q)}catch(X){w=null}if(Array.isArray(w)&&w.length==3)if(n=w,n[0]==0)a:{if(!this.Hi){if(this.RY)if(this.RY.Fb+3E30)){if(X=q==1)this.ww||this.Ir||this.N==1||this.Qh>=2?X=!1:(this.Ir=oG((0,g.ki)(this.Dc,this,n),HWj(this,this.Qh)),this.Qh++, X=!0);X=!(X||q==2&&UUf(this))}if(X)switch(w){case 1:Jc(this,5);break;case 4:Jc(this,10);break;case 3:Jc(this,6);break;case 7:Jc(this,12);break;default:Jc(this,2)}}}; g.d.aO=function(n){if(!g.yv(arguments,this.N))throw Error("Unexpected channel state: "+this.N);}; g.d.v8W=function(n){n?Ac(2):(Ac(1),tIj(this,8))}; g.d.PL=function(n){if(n)throw Error("Can't create secondary domain capable XhrIo object.");n=new g.Ez;n.G=!1;return n}; g.d.isActive=function(){return!!this.I0&&this.I0.isActive(this)}; g.d.qC=function(n){var q=bn;q.dispatchEvent(new cNf(q,n))}; g.d.O6=function(){return!1}; g.d=gdj.prototype;g.d.OA=function(){}; g.d.FO=function(){}; g.d.eO=function(){}; g.d.rX=function(){}; g.d.vL=function(){}; g.d.dX=function(){return{}}; g.d.isActive=function(){return!0};g.d=mUt.prototype;g.d.enqueue=function(n){this.X.push(n)}; g.d.isEmpty=function(){return this.N.length===0&&this.X.length===0}; g.d.clear=function(){this.N=[];this.X=[]}; g.d.contains=function(n){return g.yv(this.N,n)||g.yv(this.X,n)}; g.d.remove=function(n){var q=this.N;var w=(0,g.Nxz)(q,n);w>=0?(g.a5(q,w),q=!0):q=!1;return q||g.Vv(this.X,n)}; g.d.uU=function(){for(var n=[],q=this.N.length-1;q>=0;--q)n.push(this.N[q]);q=this.X.length;for(var w=0;w=WUG.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(n=WUG[this.X],this.Gk=g.rN((0,g.ki)(this.HR,this),n),this.X++):this.publish("pairingFailed",Error("Server error "+n.status))}; g.d.hG=function(){this.N=null;this.publish("pairingFailed",Error("Server not responding"))}; var WUG=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.Ot(rO,Iz);g.d=rO.prototype;g.d.start=function(){kn(this)&&this.publish("screenChange");!g.$N("yt-remote-lounge-token-expiration")&&wo0(this);g.sU(this.N);this.N=g.rN((0,g.ki)(this.start,this),1E4)}; g.d.add=function(n,q){kn(this);W$v(this,n);jp(this,!1);this.publish("screenChange");q(n);n.token||wo0(this)}; g.d.remove=function(n,q){var w=kn(this);nsf(this,n)&&(jp(this,!1),w=!0);q(n);w&&this.publish("screenChange")}; g.d.e8=function(n,q,w,X){var P=kn(this),R=this.get(n.id);R?(R.name!=q&&(R.name=q,jp(this,!1),P=!0),w(n)):X(Error("no such local screen."));P&&this.publish("screenChange")}; g.d.Xf=function(){g.sU(this.N);rO.mT.Xf.call(this)}; g.d.WP=function(n){kn(this);var q=this.screens.length;n=n&&n.screens||[];for(var w=n.length,X=0;X20)break a;k=q(R,c)}R=k}P.name=R}w(f5(this,P))},this), onError:(0,g.ki)(function(P){X(Error("pairing request failed: "+P.status))},this), onTimeout:(0,g.ki)(function(){X(Error("pairing request timed out."))},this)})}; g.d.Xf=function(){g.wM(this.X);g.wM(this.N);ep.mT.Xf.call(this)}; g.d.Do=function(){OHt(this);this.publish("screenChange");this.N.update()}; ep.prototype.dispose=ep.prototype.dispose;g.Ot(OH,g.np);g.d=OH.prototype;g.d.Q$=function(n){this.zp()||(n&&(HT(this,""+n),this.publish("sessionFailed")),this.N=null,this.publish("sessionScreen",null))}; g.d.info=function(n){wO(this.HW,n)}; g.d.Go=function(){return null}; g.d.Dh=function(n){var q=this.X;n?(q.displayStatus=new chrome.cast.ReceiverDisplayStatus(n,[]),q.displayStatus.showStop=!0):q.displayStatus=null;chrome.cast.setReceiverDisplayStatus(q,(0,g.ki)(function(){this.info("Updated receiver status for "+q.friendlyName+": "+n)},this),(0,g.ki)(function(){HT(this,"Failed to update receiver status for: "+q.friendlyName)},this))}; g.d.Xf=function(){this.Dh("");OH.mT.Xf.call(this)};g.m(UH,OH);g.d=UH.prototype;g.d.Ty=function(n){if(this.C){if(this.C==n)return;HT(this,"Overriding cast session with new session object");TIh(this);this.vW=!1;this.L="unknown";this.C.removeUpdateListener(this.PW);this.C.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.WW)}this.C=n;this.C.addUpdateListener(this.PW);this.C.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.WW);m75(this,"getMdxSessionStatus")}; g.d.T6=function(n){this.info("launchWithParams no-op for Cast: "+g.lH(n))}; g.d.stop=function(){this.C?this.C.stop((0,g.ki)(function(){this.Q$()},this),(0,g.ki)(function(){this.Q$(Error("Failed to stop receiver app."))},this)):this.Q$(Error("Stopping cast device without session."))}; g.d.Dh=function(){}; g.d.Xf=function(){this.info("disposeInternal");TIh(this);this.C&&(this.C.removeUpdateListener(this.PW),this.C.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.WW));this.C=null;OH.prototype.Xf.call(this)}; g.d.vHp=function(n,q){if(!this.zp())if(q)if(q=qv(q),g.R5(q))switch(n=""+q.type,q=q.data||{},this.info("onYoutubeMessage_: "+n+" "+g.lH(q)),n){case "mdxSessionStatus":tvw(this,q);break;case "loungeToken":y8t(this,q);break;default:HT(this,"Unknown youtube message: "+n)}else HT(this,"Unable to parse message.");else HT(this,"No data in message.")}; g.d.xX=function(n,q,w,X){g.sU(this.V);this.V=0;sAL(this.W,this.X.label,n,this.X.friendlyName,(0,g.ki)(function(P){P?q(P):X>=0?(HT(this,"Screen "+n+" appears to be offline. "+X+" retries left."),this.V=g.rN((0,g.ki)(this.xX,this,n,q,w,X-1),300)):w(Error("Unable to fetch screen."))},this),w)}; g.d.Go=function(){return this.C}; g.d.zB=function(n){this.zp()||n||(HT(this,"Cast session died."),this.Q$())};g.m(ti,OH);g.d=ti.prototype;g.d.Ty=function(n){this.C=n;this.C.addUpdateListener(this.Tp)}; g.d.T6=function(n){this.n5=n;this.qP()}; g.d.stop=function(){hNj(this);this.C?this.C.stop((0,g.ki)(this.Q$,this,null),(0,g.ki)(this.Q$,this,"Failed to stop DIAL device.")):this.Q$()}; g.d.Xf=function(){hNj(this);this.C&&this.C.removeUpdateListener(this.Tp);this.C=null;OH.prototype.Xf.call(this)}; g.d.Dv=function(n){this.zp()||n||(HT(this,"DIAL session died."),this.K(),this.K=function(){},this.Q$())};g.m(mP,OH);mP.prototype.stop=function(){this.Q$()}; mP.prototype.Ty=function(){}; mP.prototype.T6=function(){g.sU(this.C);this.C=NaN;var n=jt(this.W.uX(),this.X.label);n?i8(this,n):this.Q$(Error("No such screen"))}; mP.prototype.Xf=function(){g.sU(this.C);this.C=NaN;OH.prototype.Xf.call(this)};g.m(yI,g.np);g.d=yI.prototype; g.d.init=function(n,q){chrome.cast.timeout.requestSession=3E4;var w=new chrome.cast.SessionRequest(this.V,[chrome.cast.Capability.AUDIO_OUT]);g.OU("desktop_enable_cast_connect")&&(w.androidReceiverCompatible=!0);this.L||(w.dialRequest=new chrome.cast.DialRequest("YouTube"));var X=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;n=n||this.D?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var P=(0,g.ki)(this.wbi,this);w=new chrome.cast.ApiConfig(w,(0,g.ki)(this.iN, this),P,X,n);w.customDialLaunchCallback=(0,g.ki)(this.YqT,this);chrome.cast.initialize(w,(0,g.ki)(function(){this.zp()||(chrome.cast.addReceiverActionListener(this.K),Q40(),this.X.subscribe("onlineScreenChange",(0,g.ki)(this.Qm,this)),this.C=Cdv(this),chrome.cast.setCustomReceivers(this.C,function(){},(0,g.ki)(function(R){this.A$("Failed to set initial custom receivers: "+g.lH(R))},this)),this.publish("yt-remote-cast2-availability-change",VI(this)),q(!0))},this),(0,g.ki)(function(R){this.A$("Failed to initialize API: "+ g.lH(R)); q(!1)},this))}; g.d.Dio=function(n,q){az("Setting connected screen ID: "+n+" -> "+q);if(this.N){var w=this.N.N;if(!n||w&&w.id!=n)az("Unsetting old screen status: "+this.N.X.friendlyName),p5(this,null)}if(n&&q){if(!this.N){n=jt(this.X.uX(),n);if(!n){az("setConnectedScreenStatus: Unknown screen.");return}if(n.idType=="shortLived"){az("setConnectedScreenStatus: Screen with id type to be short lived.");return}w=luL(this,n);w||(az("setConnectedScreenStatus: Connected receiver not custom..."),w=new chrome.cast.Receiver(n.uuid? n.uuid:n.id,n.name),w.receiverType=chrome.cast.ReceiverType.CUSTOM,this.C.push(w),chrome.cast.setCustomReceivers(this.C,function(){},(0,g.ki)(function(X){this.A$("Failed to set initial custom receivers: "+g.lH(X))},this))); az("setConnectedScreenStatus: new active receiver: "+w.friendlyName);p5(this,new mP(this.X,w),!0)}this.N.Dh(q)}else az("setConnectedScreenStatus: no screen.")}; g.d.OL5=function(n){this.zp()?this.A$("Setting connection data on disposed cast v2"):this.N?this.N.T6(n):this.A$("Setting connection data without a session")}; g.d.rU=function(){this.zp()?this.A$("Stopping session on disposed cast v2"):this.N?(this.N.stop(),p5(this,null)):az("Stopping non-existing session")}; g.d.requestSession=function(){chrome.cast.requestSession((0,g.ki)(this.iN,this),(0,g.ki)(this.g4T,this))}; g.d.Xf=function(){this.X.unsubscribe("onlineScreenChange",(0,g.ki)(this.Qm,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.K);var n=SYt,q=g.w0("yt.mdx.remote.debug.handlers_");g.Vv(q||[],n);g.wM(this.N);g.np.prototype.Xf.call(this)}; g.d.A$=function(n){wO("Controller",n)}; g.d.Iq=function(n,q){this.N==n&&(q||p5(this,null),this.publish("yt-remote-cast2-session-change",q))}; g.d.fCq=function(n,q){if(!this.zp())if(n)switch(n.friendlyName=chrome.cast.unescape(n.friendlyName),az("onReceiverAction_ "+n.label+" / "+n.friendlyName+"-- "+q),q){case chrome.cast.ReceiverAction.CAST:if(this.N)if(this.N.X.label!=n.label)az("onReceiverAction_: Stopping active receiver: "+this.N.X.friendlyName),this.N.stop();else{az("onReceiverAction_: Casting to active receiver.");this.N.N&&this.publish("yt-remote-cast2-session-change",this.N.N);break}switch(n.receiverType){case chrome.cast.ReceiverType.CUSTOM:p5(this, new mP(this.X,n));break;case chrome.cast.ReceiverType.DIAL:p5(this,new ti(this.X,n,this.W,this.config_));break;case chrome.cast.ReceiverType.CAST:p5(this,new UH(this.X,n,this.config_));break;default:this.A$("Unknown receiver type: "+n.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.N&&this.N.X.label==n.label?this.N.stop():this.A$("Stopping receiver w/o session: "+n.friendlyName)}else this.A$("onReceiverAction_ called without receiver.")}; g.d.YqT=function(n){if(this.zp())return Promise.reject(Error("disposed"));var q=n.receiver;q.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.A$("Not DIAL receiver: "+q.friendlyName),q.receiverType=chrome.cast.ReceiverType.DIAL);var w=this.N?this.N.X:null;if(!w||w.label!=q.label)return this.A$("Receiving DIAL launch request for non-clicked DIAL receiver: "+q.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(w&&w.label==q.label&&w.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.N.N)return az("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.N.N),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.A$('Changing CAST intent from "'+w.receiverType+'" to "dial" for '+q.friendlyName);p5(this,new ti(this.X,q,this.W,this.config_))}q=this.N;q.V=n;q.V.appState==chrome.cast.DialAppState.RUNNING?(n=q.V.extraData||{},w=n.screenId||null,dO(q)&&n.loungeToken?n.loungeTokenRefreshIntervalMs?n=MvD(q,{name:q.X.friendlyName,screenId:n.screenId,loungeToken:n.loungeToken,dialId:q.V.receiver.label, screenIdType:"shortLived"},n.loungeTokenRefreshIntervalMs):(g.Ki(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(n)+".")),n=x7j(q,w)):n=x7j(q,w)):n=vsv(q);return n}; g.d.iN=function(n){var q=this;if(!this.zp()&&!this.D){az("New cast session ID: "+n.sessionId);var w=n.receiver;if(w.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.N)if(w.receiverType==chrome.cast.ReceiverType.CAST)az("Got resumed cast session before resumed mdx connection."),w.friendlyName=chrome.cast.unescape(w.friendlyName),p5(this,new UH(this.X,w,this.config_),!0);else{this.A$("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var X=this.N.X,P=jt(this.X.uX(), X.label);P&&k4(P,w.label)&&X.receiverType!=chrome.cast.ReceiverType.CAST&&w.receiverType==chrome.cast.ReceiverType.CAST&&(az("onSessionEstablished_: manual to cast session change "+w.friendlyName),g.wM(this.N),this.N=new UH(this.X,w,this.config_),this.N.subscribe("sessionScreen",(0,g.ki)(this.Iq,this,this.N)),this.N.subscribe("sessionFailed",function(){return GgG(q,q.N)}),this.N.T6(null)); this.N.Ty(n)}}}; g.d.uC=function(){return this.N?this.N.Go():null}; g.d.g4T=function(n){this.zp()||(this.A$("Failed to estabilish a session: "+g.lH(n)),n.code!=chrome.cast.ErrorCode.CANCEL&&p5(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.d.wbi=function(n){az("Receiver availability updated: "+n);if(!this.zp()){var q=VI(this);this.G=n==chrome.cast.ReceiverAvailability.AVAILABLE;VI(this)!=q&&this.publish("yt-remote-cast2-availability-change",VI(this))}}; g.d.Qm=function(){this.zp()||(this.C=Cdv(this),az("Updating custom receivers: "+g.lH(this.C)),chrome.cast.setCustomReceivers(this.C,function(){},(0,g.ki)(function(){this.A$("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",VI(this)))}; yI.prototype.setLaunchParams=yI.prototype.OL5;yI.prototype.setConnectedScreenStatus=yI.prototype.Dio;yI.prototype.stopSession=yI.prototype.rU;yI.prototype.getCastSession=yI.prototype.uC;yI.prototype.requestSession=yI.prototype.requestSession;yI.prototype.init=yI.prototype.init;yI.prototype.dispose=yI.prototype.dispose;var BIv=[];g.d=xn.prototype; g.d.reset=function(n){this.listId="";this.index=-1;this.videoId="";NIv(this);this.volume=-1;this.muted=!1;n&&(this.index=n.index,this.listId=n.listId,this.videoId=n.videoId,this.playerState=n.playerState,this.volume=n.volume,this.muted=n.muted,this.audioTrackId=n.audioTrackId,this.trackData=n.trackData,this.qM=n.hasPrevious,this.Om=n.hasNext,this.D=n.playerTime,this.K=n.playerTimeAt,this.X=n.seekableStart,this.G=n.seekableEnd,this.C=n.duration,this.V=n.loadedTime,this.N=n.liveIngestionTime,this.W= !isNaN(this.N))}; g.d.isPlaying=function(){return this.playerState==1}; g.d.isBuffering=function(){return this.playerState==3}; g.d.Rg=function(n){this.C=isNaN(n)?0:n}; g.d.getDuration=function(){return this.W?this.C+DW(this):this.C}; g.d.clone=function(){return new xn(qsB(this))};g.m(EH,g.np);g.d=EH.prototype;g.d.getState=function(){return this.C}; g.d.rG=function(){return this.W.getReconnectTimeout()}; g.d.mF=function(){this.W.reconnect()}; g.d.play=function(){b8(this)?(this.N?this.N.play(null,g.MY,Sp(this,"play")):K5(this,"play"),P0j(this,1,l8(oz(this))),this.publish("remotePlayerChange")):Ai(this,this.play)}; g.d.pause=function(){b8(this)?(this.N?this.N.pause(null,g.MY,Sp(this,"pause")):K5(this,"pause"),P0j(this,2,l8(oz(this))),this.publish("remotePlayerChange")):Ai(this,this.pause)}; g.d.seekTo=function(n){if(b8(this)){if(this.N){var q=oz(this),w=new chrome.cast.media.SeekRequest;w.currentTime=n;q.isPlaying()||q.isBuffering()?w.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:w.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.N.seek(w,g.MY,Sp(this,"seekTo",{newTime:n}))}else K5(this,"seekTo",{newTime:n});P0j(this,3,n);this.publish("remotePlayerChange")}else Ai(this,g.r0(this.seekTo,n))}; g.d.stop=function(){if(b8(this)){this.N?this.N.stop(null,g.MY,Sp(this,"stopVideo")):K5(this,"stopVideo");var n=oz(this);n.index=-1;n.videoId="";NIv(n);Yn(this,n);this.publish("remotePlayerChange")}else Ai(this,this.stop)}; g.d.setVolume=function(n,q){if(b8(this)){var w=oz(this);if(this.X){if(w.volume!=n){var X=Math.round(n)/100;this.X.setReceiverVolumeLevel(X,(0,g.ki)(function(){Xj("set receiver volume: "+X)},this),(0,g.ki)(function(){this.A$("failed to set receiver volume.")},this))}w.muted!=q&&this.X.setReceiverMuted(q,(0,g.ki)(function(){Xj("set receiver muted: "+q)},this),(0,g.ki)(function(){this.A$("failed to set receiver muted.")},this))}else{var P={volume:n, muted:q};w.volume!=-1&&(P.delta=n-w.volume);K5(this,"setVolume",P)}w.muted=q;w.volume=n;Yn(this,w)}else Ai(this,g.r0(this.setVolume,n,q))}; g.d.gX=function(n,q){if(b8(this)){var w=oz(this);n={videoId:n};q&&(w.trackData={trackName:q.name,languageCode:q.languageCode,sourceLanguageCode:q.translationLanguage?q.translationLanguage.languageCode:"",languageName:q.languageName,kind:q.kind},n.style=g.lH(q.style),g.tX(n,w.trackData));K5(this,"setSubtitlesTrack",n);Yn(this,w)}else Ai(this,g.r0(this.gX,n,q))}; g.d.setAudioTrack=function(n,q){b8(this)?(q=q.getLanguageInfo().getId(),K5(this,"setAudioTrack",{videoId:n,audioTrackId:q}),n=oz(this),n.audioTrackId=q,Yn(this,n)):Ai(this,g.r0(this.setAudioTrack,n,q))}; g.d.playVideo=function(n,q,w,X,P,R,c){X=X===void 0?null:X;P=P===void 0?null:P;R=R===void 0?null:R;c=c===void 0?null:c;var k=oz(this),r={videoId:n};w!==void 0&&(r.currentIndex=w);Gq(k,n,w||0);q!==void 0&&(hi(k,q),r.currentTime=q);X&&(r.listId=X);P&&(r.playerParams=P);R&&(r.clickTrackingParams=R);c&&(r.locationInfo=g.lH(c));K5(this,"setPlaylist",r);X||Yn(this,k)}; g.d.W$=function(n,q){if(b8(this)){if(n&&q){var w=oz(this);Gq(w,n,q);Yn(this,w)}K5(this,"previous")}else Ai(this,g.r0(this.W$,n,q))}; g.d.nextVideo=function(n,q){if(b8(this)){if(n&&q){var w=oz(this);Gq(w,n,q);Yn(this,w)}K5(this,"next")}else Ai(this,g.r0(this.nextVideo,n,q))}; g.d.hR=function(){if(b8(this)){K5(this,"clearPlaylist");var n=oz(this);n.reset();Yn(this,n);this.publish("remotePlayerChange")}else Ai(this,this.hR)}; g.d.Cw=function(){b8(this)?K5(this,"dismissAutoplay"):Ai(this,this.Cw)}; g.d.dispose=function(){if(this.C!=3){var n=this.C;this.C=3;this.publish("proxyStateChange",n,this.C)}g.np.prototype.dispose.call(this)}; g.d.Xf=function(){Xqi(this);this.W=null;this.K.clear();C5(this,null);g.np.prototype.Xf.call(this)}; g.d.O$=function(n){if((n!=this.C||n==2)&&this.C!=3&&n!=0){var q=this.C;this.C=n;this.publish("proxyStateChange",q,n);if(n==1)for(;!this.K.isEmpty();)q=n=this.K,q.N.length===0&&(q.N=q.X,q.N.reverse(),q.X=[]),n.N.pop().apply(this);else n==3&&this.dispose()}}; g.d.v4o=function(n,q){this.publish(n,q)}; g.d.rge=function(n){if(!n)this.K_(null),C5(this,null);else if(this.X.receiver.volume){n=this.X.receiver.volume;var q=oz(this),w=Math.round(100*n.level||0);if(q.volume!=w||q.muted!=n.muted)Xj("Cast volume update: "+n.level+(n.muted?" muted":"")),q.volume=w,q.muted=!!n.muted,Yn(this,q)}}; g.d.K_=function(n){Xj("Cast media: "+!!n);this.N&&this.N.removeUpdateListener(this.V);if(this.N=n)this.N.addUpdateListener(this.V),RS5(this),this.publish("remotePlayerChange")}; g.d.ufn=function(n){n?(RS5(this),this.publish("remotePlayerChange")):this.K_(null)}; g.d.X6=function(){K5(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.d.O55=function(){var n=J8v();n&&C5(this,n)}; g.d.A$=function(n){wO("CP",n)};g.m(QI,g.np);g.d=QI.prototype; g.d.connect=function(n,q){if(q){var w=q.listId,X=q.videoId,P=q.videoIds,R=q.playerParams,c=q.clickTrackingParams,k=q.index,r={videoId:X},e=q.currentTime,f=q.locationInfo;q=q.loopMode;e!==void 0&&(r.currentTime=e<=5?0:e);R&&(r.playerParams=R);f&&(r.locationInfo=f);c&&(r.clickTrackingParams=c);w&&(r.listId=w);P&&P.length>0&&(r.videoIds=P.join(","));k!==void 0&&(r.currentIndex=k);this.Tp&&(r.loopMode=q||"LOOP_MODE_OFF");w&&(this.N.listId=w);this.N.videoId=X;this.N.index=k||0;this.N.state=3;hi(this.N, e);this.K="UNSUPPORTED";w=this.Tp?"setInitialState":"setPlaylist";u8("Connecting with "+w+" and params: "+g.lH(r));this.X.connect({method:w,params:g.lH(r)},n,aIG())}else u8("Connecting without params"),this.X.connect({},n,aIG());rPh(this)}; g.d.DA=function(n){this.X.DA(n)}; g.d.dispose=function(){this.zp()||(g.nj("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),BT(this,3));g.np.prototype.dispose.call(this)}; g.d.Xf=function(){jjz(this);eSv(this);sjD(this);g.sU(this.V);this.V=NaN;g.sU(this.L);this.L=NaN;this.W=null;g.th(this.qP);this.qP.length=0;this.X.dispose();g.np.prototype.Xf.call(this);this.K=this.G=this.C=this.N=this.X=null}; g.d.bT=function(n){if(!this.C||this.C.length===0)return!1;for(var q=g.a(this.C),w=q.next();!w.done;w=q.next())if(!w.value.capabilities.has(n))return!1;return!0}; g.d.oN=function(){var n=3;this.zp()||(n=0,isNaN(this.Dn())?this.X.ij()&&isNaN(this.D)&&(n=1):n=2);return n}; g.d.tP=function(n){u8("Disconnecting with "+n);g.nj("yt.mdx.remote.remoteClient_",null);jjz(this);this.publish("beforeDisconnect",n);n==1&&Ov();this.X.disconnect(n);this.dispose()}; g.d.YM=function(){var n=this.N;this.W&&(n=this.N.clone(),Gq(n,this.W,n.index));return qsB(n)}; g.d.KTP=function(n){var q=this,w=new xn(n);w.videoId&&w.videoId!=this.N.videoId&&(this.W=w.videoId,g.sU(this.V),this.V=g.rN(function(){if(q.W){var P=q.W;q.W=null;q.N.videoId!=P&&ZW(q,"getNowPlaying")}},5E3)); var X=[];this.N.listId==w.listId&&this.N.videoId==w.videoId&&this.N.index==w.index||X.push("remoteQueueChange");this.N.playerState==w.playerState&&this.N.volume==w.volume&&this.N.muted==w.muted&&l8(this.N)==l8(w)&&g.lH(this.N.trackData)==g.lH(w.trackData)||X.push("remotePlayerChange");this.N.reset(n);g.Jw(X,function(P){this.publish(P)},this)}; g.d.yP=function(){var n=this.X.getDeviceId(),q=g.d0(this.C,function(w){return w.type=="REMOTE_CONTROL"&&w.id!=n}); return q?q.id:""}; g.d.Dn=function(){return this.X.rG()}; g.d.lY=function(){return this.K||"UNSUPPORTED"}; g.d.kM=function(){return this.G||""}; g.d.Fh=function(){!isNaN(this.Dn())&&this.X.mF()}; g.d.kGf=function(n,q){ZW(this,n,q);ORB(this)}; g.d.YP=function(){var n=g.Mg("SAPISID","")||g.Mg("__Secure-1PAPISID")||"",q=g.Mg("__Secure-3PAPISID","")||"";if(!n&&!q)return"";n=g.p1(g.Vk(n),2);q=g.p1(g.Vk(q),2);return g.p1(g.Vk(","+n+","+q),2)}; QI.prototype.subscribe=QI.prototype.subscribe;QI.prototype.unsubscribeByKey=QI.prototype.iI;QI.prototype.getProxyState=QI.prototype.oN;QI.prototype.disconnect=QI.prototype.tP;QI.prototype.getPlayerContextData=QI.prototype.YM;QI.prototype.setPlayerContextData=QI.prototype.KTP;QI.prototype.getOtherConnectedRemoteId=QI.prototype.yP;QI.prototype.getReconnectTimeout=QI.prototype.Dn;QI.prototype.getAutoplayMode=QI.prototype.lY;QI.prototype.getAutoplayVideoId=QI.prototype.kM;QI.prototype.reconnect=QI.prototype.Fh; QI.prototype.sendMessage=QI.prototype.kGf;QI.prototype.getXsrfToken=QI.prototype.YP;QI.prototype.isCapabilitySupportedOnConnectedDevices=QI.prototype.bT;g.m(TPB,Iz);g.d=TPB.prototype;g.d.uX=function(n){return this.Pd.$_gs(n)}; g.d.contains=function(n){return!!this.Pd.$_c(n)}; g.d.get=function(n){return this.Pd.$_g(n)}; g.d.start=function(){this.Pd.$_st()}; g.d.add=function(n,q,w){this.Pd.$_a(n,q,w)}; g.d.remove=function(n,q,w){this.Pd.$_r(n,q,w)}; g.d.e8=function(n,q,w,X){this.Pd.$_un(n,q,w,X)}; g.d.Xf=function(){for(var n=this.N.length,q=0;q1&&!this.T.getOption("remote","quickCast")?(this.z3=g.zf(n,this.N,this),this.Hw(g.Hh(n,this.N)),n=this.T.getOption("remote","currentReceiver"),n=this.N(n),this.options[n]&&this.UF(n),this.enable(!0)):this.enable(!1)}; Oo.prototype.N=function(n){return n.key}; Oo.prototype.fq=function(n){return n==="cast-selector-receiver"?"Cast...":this.z3[n].name}; Oo.prototype.SV=function(n){g.bB.prototype.SV.call(this,n);this.T.setOption("remote","currentReceiver",this.z3[n]);this.aP.hK()};g.m(QjG,g.Lq);g.d=QjG.prototype; g.d.create=function(){var n=this.player.B(),q=g.ny(n);n={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:n.Z("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:n.Z("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:n.Z("enable_cast_short_lived_lounge_token")};M2D(q,n);this.subscriptions.push(g.Zu("yt-remote-before-disconnect",this.hne,this));this.subscriptions.push(g.Zu("yt-remote-connection-change",this.cUp,this));this.subscriptions.push(g.Zu("yt-remote-receiver-availability-change",this.gf, this));this.subscriptions.push(g.Zu("yt-remote-auto-connect",this.Wcl,this));this.subscriptions.push(g.Zu("yt-remote-receiver-resumed",this.HG5,this));this.subscriptions.push(g.Zu("mdx-privacy-popup-confirm",this.gH5,this));this.subscriptions.push(g.Zu("mdx-privacy-popup-cancel",this.QSo,this));this.gf()}; g.d.load=function(){this.player.cancelPlayback();g.Lq.prototype.load.call(this);this.aX=new BPD(this.player.B(),this);this.player.IC(this.aX);this.ag=new YsG(this,this.player,this.Sj);var n=(n=o2v())?n.currentTime:0;var q=GvB()?new EH(RD(),void 0):null;n==0&&q&&(n=l8(oz(q)));n!==0&&this.hU(n);ZRz(this,this.jP,this.jP);this.player.gD(6)}; g.d.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.Tg();this.Cm=this.wD;g.XP(this.ag,this.Sj);this.Sj=this.aX=this.ag=null;g.Lq.prototype.unload.call(this);this.player.gD(5);iW(this)}; g.d.Xf=function(){g.J8(this.subscriptions);g.Lq.prototype.Xf.call(this)}; g.d.e0=function(n){var q=g.bs.apply(1,arguments);this.loaded&&this.ag.kS.apply(this.ag,[n].concat(g.D(q)))}; g.d.getAdState=function(){return this.Mr}; g.d.qM=function(){return this.Sj?oz(this.Sj).qM:!1}; g.d.Om=function(){return this.Sj?oz(this.Sj).Om:!1}; g.d.hU=function(n,q){this.Ao=n||0;this.player.publish("progresssync",n,q);this.player.pV("onVideoProgress",n||0)}; g.d.getCurrentTime=function(){return this.Ao}; g.d.getDuration=function(){return oz(this.Sj).getDuration()||0}; g.d.Py=function(){var n=oz(this.Sj);return n.W?n.N+DW(n):n.N}; g.d.Jf=function(){return oz(this.Sj).V}; g.d.kJ=function(){return n2t(oz(this.Sj))}; g.d.dH=function(){var n=oz(this.Sj);return n.X>0?n.X+DW(n):n.X}; g.d.getProgressState=function(){var n=oz(this.Sj),q=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:n.playerState!=1081&&this.player.sT(),clipEnd:q.clipEnd,clipStart:q.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.Py(),isAtLiveHead:this.isAtLiveHead(),loaded:this.Jf(),seekableEnd:this.kJ(),seekableStart:this.dH(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.d.isAtLiveHead=function(){return n2t(oz(this.Sj))-this.getCurrentTime()<=1}; g.d.nextVideo=function(){this.Sj&&this.Sj.nextVideo()}; g.d.W$=function(){this.Sj&&this.Sj.W$()}; g.d.hne=function(n){n===1&&(this.G2=this.Sj?oz(this.Sj):null)}; g.d.cUp=function(){var n=GvB()?new EH(RD(),void 0):null;if(n){var q=this.Cm;this.loaded&&this.unload();this.Sj=n;this.G2=null;q.key!==this.wD.key&&(this.Cm=q,this.load())}else g.wM(this.Sj),this.Sj=null,this.loaded&&(this.unload(),(n=this.G2)&&n.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(n.videoId,l8(n)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.d.gf=function(){var n=[this.wD],q=n.concat,w=xiG();vT()&&g.$N("yt-remote-cast-available")&&w.push({key:"cast-selector-receiver",name:"Cast..."});this.z3=q.call(n,w);n=hSL()||this.wD;Hv(this,n);this.player.pV("onMdxReceiversChange")}; g.d.Wcl=function(){var n=hSL();Hv(this,n)}; g.d.HG5=function(){this.Cm=hSL()}; g.d.gH5=function(){this.Pk=!0;iW(this);rX=!1;cv&&kX(cv,1);cv=null}; g.d.QSo=function(){this.Pk=!1;iW(this);Hv(this,this.wD);this.Cm=this.wD;rX=!1;cv=null;this.player.playVideo()}; g.d.Bd=function(n,q){switch(n){case "casting":return this.loaded;case "receivers":return this.z3;case "currentReceiver":return q&&(q.key==="cast-selector-receiver"?zNf():Hv(this,q)),this.loaded?this.Cm:this.wD;case "quickCast":return this.z3.length===2&&this.z3[1].key==="cast-selector-receiver"?(q&&zNf(),!0):!1}}; g.d.X6=function(){this.Sj.X6()}; g.d.BO=function(){return!1}; g.d.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.d.isLoggedIn=function(){var n,q;return((n=g.bp("PLAYER_CONFIG"))==null?void 0:(q=n.args)==null?void 0:q.authuser)!==void 0?!0:!(!g.bp("SESSION_INDEX")&&!g.bp("LOGGED_IN"))};g.vb("remote",QjG);})(_yt_player);