(function(g){var window=this;'use strict';var zEK=function(W){if(W instanceof g.MF)return W;if(typeof W.JL=="function")return W.JL(!1);if(g.kh(W)){var Y=0,k=new g.MF;k.next=function(){for(;;){if(Y>=W.length)return g.OO;if(Y in W)return g.tL(W[Y++]);Y++}}; return k}throw Error("Not implemented");},dKK=function(W,Y,k){if(g.kh(W))g.xh(W,Y,k); else for(W=zEK(W);;){var P=W.next();if(P.done)break;Y.call(k,P.value,void 0,W)}},Yl=function(W){g.I2(W,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.Bp()).toString(36)); return W},$l=function(W,Y,k){Array.isArray(k)||(k=[String(k)]); g.w4v(W.T,Y,k)},mK9=function(W,Y){var k=[]; dKK(Y,function(P){try{var T=g.Gx.prototype.K.call(this,P,!0)}catch(I){if(I=="Storage: Invalid value was encountered")return;throw I;}T===void 0?k.push(P):g.cW0(T)&&k.push(P)},W); return k},DKi=function(W,Y){mK9(W,Y).forEach(function(k){g.Gx.prototype.remove.call(this,k)},W)},gGB=function(W){if(W.LH){if(W.LH.locationOverrideToken)return{locationOverrideToken:W.LH.locationOverrideToken}; if(W.LH.latitudeE7!=null&&W.LH.longitudeE7!=null)return{latitudeE7:W.LH.latitudeE7,longitudeE7:W.LH.longitudeE7}}return null},Ffj=function(W,Y){g.n$(W,Y)||W.push(Y)},wyz=function(W){var Y=0,k; for(k in W)Y++;return Y},Qih=function(W,Y){return g.hm(W,Y)},yBi=function(W){try{return g.V0.JSON.parse(W)}catch(Y){}W=String(W); if(/^\s*$/.test(W)?0:/^[\],:{}\s\u2028\u2029]*$/.test(W.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("("+W+")")}catch(Y){}throw Error("Invalid JSON string: "+W);},kl=function(W){if(g.V0.JSON)try{return g.V0.JSON.parse(W)}catch(Y){}return yBi(W)},eEc=function(){var W=PY(); this.W=W;W.oM("/client_streamz/youtube/living_room/mdx/channel/opened",g.WI("channel_type"))},oGK=function(){var W=PY(); this.W=W;W.oM("/client_streamz/youtube/living_room/mdx/channel/closed",g.WI("channel_type"))},vGw=function(){var W=PY(); this.W=W;W.oM("/client_streamz/youtube/living_room/mdx/channel/message_received",g.WI("channel_type"))},Cww=function(){var W=PY(); this.W=W;W.oM("/client_streamz/youtube/living_room/mdx/channel/success")},LfQ=function(){var W=PY(); this.W=W;W.oM("/client_streamz/youtube/living_room/mdx/channel/error",g.WI("channel_type"),g.WI("error_type"))},UKQ=function(){var W=PY(); this.W=W;W.oM("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},lJh=function(){var W=PY(); this.W=W;W.oM("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},bNw=function(W,Y,k,P){var T=new g.av(null); W&&g.WH(T,W);Y&&g.YA(T,Y);k&&g.$A(T,k);P&&(T.K=P);return T},cBc=function(W,Y){return new g.xA(W,Y)},Tq=function(W,Y){return Object.prototype.hasOwnProperty.call(W,Y)},xKc=function(W,Y){return W===Y},jg=function(W,Y){this.K={}; this.W=[];this.bM=this.size=0;var k=arguments.length;if(k>1){if(k%2)throw Error("Uneven number of arguments");for(var P=0;P5&&(W=W.slice(W.length-5)); var Y=g.tx(m8$(),function(P){return P.loungeToken}),k=g.tx(W,function(P){return P.loungeToken}); g.q_(k,function(P){return!g.n$(Y,P)})&&D8h(); g.Ke("yt-remote-local-screens",W,31536E3)},iv=function(W){W||(g.Jl("yt-remote-session-screen-id"),g.Jl("yt-remote-session-video-id")); zB$();W=uv();g.GK(W,ZF());rlh(W)},Fr9=function(){if(!Mh){var W=g.A4(); W&&(Mh=new g.He(W))}},wOp=function(){Fr9(); return Mh?!!Mh.get("yt-remote-use-staging-server"):!1},tY=function(W,Y){g.Uj[W]=!0; var k=g.CQ();k&&k.publish.apply(k,arguments);g.Uj[W]=!1},QkK=function(){},PY=function(){if(!qh){qh=new g.FA(new QkK); var W=g.uw("client_streamz_web_flush_count",-1);W!==-1&&(qh.J=W)}return qh},ylN=function(){var W=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return W?parseInt(W[1],10):0},eB$=function(W){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+W)!=-1||document.currentScript.src.indexOf("&"+W)!=-1)},oFp=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},RE=function(W){W.length?vF9(W.shift(),function(){RE(W)}):CC9()},Lrc=function(W){return"chrome-extension://"+W+"/cast_sender.js"},vF9=function(W,Y,k){var P=document.createElement("script"); P.onerror=Y;k&&(P.onload=k);g.Rp(P,g.tr(W));(document.head||document.documentElement).appendChild(P)},U8p=function(){var W=ylN(),Y=[]; if(W>1){var k=W-1;Y.push("//www.gstatic.com/eureka/clank/"+W+"/cast_sender.js");Y.push("//www.gstatic.com/eureka/clank/"+k+"/cast_sender.js")}return Y},CC9=function(){var W=oFp(); W&&W(!1,"No cast extension found")},beB=function(){if(lVK){var W=2,Y=oFp(),k=function(){W--; W==0&&Y&&Y(!0)}; window.__onGCastApiAvailable=k;vF9("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",CC9,k)}},cli=function(){beB(); var W=U8p();W.push("//www.gstatic.com/eureka/clank/cast_sender.js");RE(W)},fV9=function(){beB(); var W=U8p();W.push.apply(W,g.ZX(x8i.map(Lrc)));W.push("//www.gstatic.com/eureka/clank/cast_sender.js");RE(W)},HY=function(W,Y,k){g.e.call(this); this.X=k!=null?(0,g.Xz)(W,k):W;this.z9=Y;this.C=(0,g.Xz)(this.sC,this);this.W=!1;this.K=0;this.J=this.kq=null;this.T=[]},n0=function(){},V0w=function(){g.CH.call(this,"p")},ND1=function(){g.CH.call(this,"o")},WdN=function(){return aV9=aV9||new g.S2},YP9=function(W){g.CH.call(this,"serverreachability",W)},p0=function(W){var Y=WdN(); Y.dispatchEvent(new YP9(Y,W))},$5B=function(W){g.CH.call(this,"statevent",W)},Gq=function(W){var Y=WdN(); Y.dispatchEvent(new $5B(Y,W))},kXp=function(W,Y,k,P){g.CH.call(this,"timingevent",W); this.size=Y;this.rtt=k;this.retries=P},K0=function(W,Y){if(typeof W!=="function")throw Error("Fn must not be null and must be a function"); return g.V0.setTimeout(function(){W()},Y)},Em=function(){},JY=function(W,Y,k,P){this.J=W; this.T=Y;this.Gn=k;this.xm=P||1;this.Lg=new g.OU(this);this.bz=45E3;this.UP=null;this.X=!1;this.N=this.rD=this.L=this.Fr=this.wD=this.e1=this.A5=null;this.Kg=[];this.W=null;this.G=0;this.C=this.gD=null;this.A9=-1;this.OP=!1;this.Q5=0;this.V5=null;this.J9=this.GJ=this.K1=this.TJ=!1;this.K=new PNw},PNw=function(){this.K=null; this.W="";this.J=!1},jyK=function(W,Y,k){W.Fr=1; W.L=Yl(Y.clone());W.N=k;W.TJ=!0;TeK(W,null)},TeK=function(W,Y){W.wD=Date.now(); sm(W);W.rD=W.L.clone();$l(W.rD,"t",W.xm);W.G=0;var k=W.J.Fr;W.K=new PNw;W.W=ISh(W.J,k?Y:null,!W.N);W.Q5>0&&(W.V5=new g.b9((0,g.Xz)(W.t8,W,W.W),W.Q5));W.Lg.listen(W.W,"readystatechange",W.Xk);Y=W.UP?g.ij(W.UP):{};W.N?(W.gD||(W.gD="POST"),Y["Content-Type"]="application/x-www-form-urlencoded",W.W.send(W.rD,W.gD,W.N,Y)):(W.gD="GET",W.W.send(W.rD,W.gD,null,Y));p0(1)},SP9=function(W){if(!X8h(W))return g.l3(W.W); var Y=g.b3(W.W);if(Y==="")return"";var k="",P=Y.length,T=g.Lv(W.W)==4;if(!W.K.K){if(typeof TextDecoder==="undefined")return rh(W),AY(W),"";W.K.K=new g.V0.TextDecoder}for(var I=0;IY.length)return hbi;Y=Y.slice(P,P+k);W.G=P+k;return Y},sm=function(W){W.e1=Date.now()+W.bz; uH9(W,W.bz)},uH9=function(W,Y){if(W.A5!=null)throw Error("WatchDog timer not null"); W.A5=K0((0,g.Xz)(W.OC,W),Y)},ZJc=function(W){W.A5&&(g.V0.clearTimeout(W.A5),W.A5=null)},AY=function(W){W.J.Lu()||W.OP||iJj(W.J,W)},rh=function(W){ZJc(W); g.Wu(W.V5);W.V5=null;W.Lg.removeAll();if(W.W){var Y=W.W;W.W=null;Y.abort();Y.dispose()}},GXw=function(W,Y){try{var k=W.J; if(k.z8!=0&&(k.W==W||M5c(k.K,W)))if(!W.GJ&&M5c(k.K,W)&&k.z8==3){try{var P=k.KN.W.parse(Y)}catch(G){P=null}if(Array.isArray(P)&&P.length==3){var T=P;if(T[0]==0)a:{if(!k.L){if(k.W)if(k.W.wD+3E30&&(k.Q5=1.5*h);P=k;var B=W.Nj();if(B){var O=g.c9(B,"X-Client-Wire-Protocol");if(O){var u=P.K;!u.W&&(g.dY(O,"spdy")||g.dY(O,"quic")||g.dY(O,"h2"))&&(u.T=u.C,u.W=new Set,u.K&&(RbQ(u,u.K),u.K=null))}if(P.TJ){var Z=g.c9(B,"X-HTTP-Session-Id");Z&&(P.Qa=Z,g.I2(P.UP,P.TJ,Z))}}k.z8=3;k.C&&k.C.Gm();k.KH&&(k.tT=Date.now()-W.wD);P=k;var M=W;P.DY=HJp(P,P.Fr?P.Gn:null,P.f1);if(M.GJ){nuc(P.K, M);var t=M,q=P.Q5;q&&t.setTimeout(q);t.A5&&(ZJc(t),sm(t));P.W=M}else p8K(P);k.J.length>0&&DF(k)}else I[0]!="stop"&&I[0]!="close"||m_(k,7);else k.z8==3&&(I[0]=="stop"||I[0]=="close"?I[0]=="stop"?m_(k,7):k.disconnect():I[0]!="noop"&&k.C&&k.C.q3(I),k.Kg=0)}p0(4)}catch(G){}},Kdh=function(W,Y){this.W=W; this.map=Y;this.context=null},Eu$=function(W){this.C=W||10; g.V0.PerformanceNavigationTiming?(W=g.V0.performance.getEntriesByType("navigation"),W=W.length>0&&(W[0].nextHopProtocol=="hq"||W[0].nextHopProtocol=="h2")):W=!!(g.V0.chrome&&g.V0.chrome.loadTimes&&g.V0.chrome.loadTimes()&&g.V0.chrome.loadTimes().wasFetchedViaSpdy);this.T=W?this.C:1;this.W=null;this.T>1&&(this.W=new Set);this.K=null;this.J=[]},Jjh=function(W){return W.K?!0:W.W?W.W.size>=W.T:!1},qPc=function(W){return W.K?1:W.W?W.W.size:0},M5c=function(W,Y){return W.K?W.K==Y:W.W?W.W.has(Y):!1},RbQ= function(W,Y){W.W?W.W.add(Y):W.K=Y},nuc=function(W,Y){W.K&&W.K==Y?W.K=null:W.W&&W.W.has(Y)&&W.W.delete(Y)},syB=function(W){if(W.K!=null)return W.J.concat(W.K.Kg); if(W.W!=null&&W.W.size!==0){var Y=W.J;W=g.p(W.W.values());for(var k=W.next();!k.done;k=W.next())Y=Y.concat(k.value.Kg);return Y}return g.zK(W.J)},rji=function(W,Y){var k=new Em; if(g.V0.Image){var P=new Image;P.onload=g.hN(gh,k,"TestLoadImage: loaded",!0,Y,P);P.onerror=g.hN(gh,k,"TestLoadImage: error",!1,Y,P);P.onabort=g.hN(gh,k,"TestLoadImage: abort",!1,Y,P);P.ontimeout=g.hN(gh,k,"TestLoadImage: timeout",!1,Y,P);g.V0.setTimeout(function(){if(P.ontimeout)P.ontimeout()},1E4); P.src=W}else Y(!1)},Aj9=function(W,Y){var k=new Em,P=new AbortController,T=setTimeout(function(){P.abort(); gh(k,"TestPingServer: timeout",!1,Y)},1E4); fetch(W,{signal:P.signal}).then(function(I){clearTimeout(T);I.ok?gh(k,"TestPingServer: ok",!0,Y):gh(k,"TestPingServer: server error",!1,Y)}).catch(function(){clearTimeout(T); gh(k,"TestPingServer: error",!1,Y)})},gh=function(W,Y,k,P,T){try{T&&(T.onload=null,T.onerror=null,T.onabort=null,T.ontimeout=null),P(k)}catch(I){}},zbB=function(){this.W=new n0},Ff=function(W,Y,k){return k&&k.Ze?k.Ze[W]||Y:Y},d5K=function(W){this.J=[]; this.Gn=this.DY=this.UP=this.f1=this.W=this.Qa=this.TJ=this.OP=this.G=this.K1=this.N=null;this.rV=this.rD=0;this.jW=Ff("failFast",!1,W);this.GJ=this.A5=this.L=this.X=this.C=null;this.D_=!0;this.LH=this.V5=-1;this.xm=this.Kg=this.wD=0;this.CN=Ff("baseRetryDelayMs",5E3,W);this.fN=Ff("retryDelaySeedMs",1E4,W);this.Zm=Ff("forwardChannelMaxRetries",2,W);this.rZ=Ff("forwardChannelRequestTimeoutMs",2E4,W);this.UV=W&&W.Jli||void 0;this.Dm=W&&W.Agi||void 0;this.AC=W&&W.Kk5||!1;this.Q5=void 0;this.Fr=W&&W.BV1|| !1;this.T="";this.K=new Eu$(W&&W.ZI6);this.KN=new zbB;this.Lg=W&&W.ws5||!1;this.e1=W&&W.LTJ||!1;this.Lg&&this.e1&&(this.e1=!1);this.k8=W&&W.FTg||!1;W&&W.o$1&&(this.D_=!1);this.KH=!this.Lg&&this.D_&&W&&W.Bfa||!1;this.xq=void 0;W&&W.bj&&W.bj>0&&(this.xq=W.bj);this.A9=void 0;this.tT=0;this.bz=!1;this.J9=this.gD=null},dh=function(W){W.W&&(m5i(W),W.W.cancel(),W.W=null)},D5w=function(W){dh(W); W.L&&(g.V0.clearTimeout(W.L),W.L=null);zq(W);W.K.cancel();W.X&&(typeof W.X==="number"&&g.V0.clearTimeout(W.X),W.X=null)},DF=function(W){Jjh(W.K)||W.X||(W.X=!0,g.GR(W.XF,W),W.wD=0)},Fdp=function(W,Y){if(qPc(W.K)>=W.K.T-(W.X?1:0))return!1; if(W.X)return W.J=Y.Kg.concat(W.J),!0;if(W.z8==1||W.z8==2||W.wD>=(W.jW?0:W.Zm))return!1;W.X=K0((0,g.Xz)(W.XF,W,Y),guj(W,W.wD));W.wD++;return!0},Qyw=function(W,Y){var k; Y?k=Y.Gn:k=W.rD++;var P=W.UP.clone();g.I2(P,"SID",W.T);g.I2(P,"RID",k);g.I2(P,"AID",W.V5);wh(W,P);W.G&&W.N&&g.BH(P,W.G,W.N);k=new JY(W,W.T,k,W.wD+1);W.G===null&&(k.UP=W.N);Y&&(W.J=Y.Kg.concat(W.J));Y=w8j(W,k,1E3);k.setTimeout(Math.round(W.rZ*.5)+Math.round(W.rZ*.5*Math.random()));RbQ(W.K,k);jyK(k,P,Y)},wh=function(W,Y){W.OP&&g.Nc(W.OP,function(k,P){g.I2(Y,P,k)}); W.C&&g.Nc({},function(k,P){g.I2(Y,P,k)})},w8j=function(W,Y,k){k=Math.min(W.J.length,k); var P=W.C?(0,g.Xz)(W.C.HN,W.C,W):null;a:{for(var T=W.J,I=-1;;){var X=["count="+k];I==-1?k>0?(I=T[0].W,X.push("ofs="+I)):I=0:X.push("ofs="+I);for(var h=!0,B=0;B=3)return!1; W.xm++;W.L=K0((0,g.Xz)(W.Oj,W),guj(W,W.Kg));W.Kg++;return!0},m5i=function(W){W.gD!=null&&(g.V0.clearTimeout(W.gD),W.gD=null)},yji=function(W){W.W=new JY(W,W.T,"rpc",W.xm); W.G===null&&(W.W.UP=W.N);W.W.Q5=0;var Y=W.DY.clone();g.I2(Y,"RID","rpc");g.I2(Y,"SID",W.T);g.I2(Y,"AID",W.V5);g.I2(Y,"CI",W.GJ?"0":"1");!W.GJ&&W.xq&&g.I2(Y,"TO",W.xq);g.I2(Y,"TYPE","xmlhttp");wh(W,Y);W.G&&W.N&&g.BH(Y,W.G,W.N);W.Q5&&W.W.setTimeout(W.Q5);var k=W.W;W=W.Gn;k.Fr=1;k.L=Yl(Y.clone());k.N=null;k.TJ=!0;TeK(k,W)},zq=function(W){W.A5!=null&&(g.V0.clearTimeout(W.A5),W.A5=null)},iJj=function(W,Y){var k=null; if(W.W==Y){zq(W);m5i(W);W.W=null;var P=2}else if(M5c(W.K,Y))k=Y.Kg,nuc(W.K,Y),P=1;else return;if(W.z8!=0)if(Y.X)if(P==1){k=Y.N?Y.N.length:0;Y=Date.now()-Y.wD;var T=W.wD;P=WdN();P.dispatchEvent(new kXp(P,k,Y,T));DF(W)}else p8K(W);else{var I=Y.A9;T=Y.getLastError();if(T==3||T==0&&I>0||!(P==1&&Fdp(W,Y)||P==2&&t5c(W)))switch(k&&k.length>0&&(Y=W.K,Y.J=Y.J.concat(k)),T){case 1:m_(W,5);break;case 4:m_(W,10);break;case 3:m_(W,6);break;default:m_(W,2)}}},guj=function(W,Y){var k=W.CN+Math.floor(Math.random()* W.fN); W.isActive()||(k*=2);return k*Y},m_=function(W,Y){if(Y==2){var k=(0,g.Xz)(W.aga,W),P=W.Dm,T=!P; P=new g.av(P||"//www.google.com/images/cleardot.gif");g.V0.location&&g.V0.location.protocol=="http"||g.WH(P,"https");Yl(P);T?rji(P.toString(),k):Aj9(P.toString(),k)}else Gq(2);W.z8=0;W.C&&W.C.Hg(Y);ebB(W);D5w(W)},ebB=function(W){W.z8=0; W.J9=[];if(W.C){var Y=syB(W.K);if(Y.length!=0||W.J.length!=0)g.dB(W.J9,Y),g.dB(W.J9,W.J),W.K.J.length=0,g.zK(W.J),W.J.length=0;W.C.FF()}},ouh=function(W){if(W.z8==0)return W.J9; var Y=[];g.dB(Y,syB(W.K));g.dB(Y,W.J);return Y},HJp=function(W,Y,k){var P=g.X0(k); P.W!=""?(Y&&g.YA(P,Y+"."+P.W),g.$A(P,P.J)):(P=g.V0.location,P=bNw(P.protocol,Y?Y+"."+P.hostname:P.hostname,+P.port,k));Y=W.TJ;k=W.Qa;Y&&k&&g.I2(P,Y,k);g.I2(P,"VER",W.sj);wh(W,P);return P},ISh=function(W,Y,k){if(Y&&!W.Fr)throw Error("Can't create secondary domain capable XhrIo object."); Y=W.AC&&!W.UV?new g.ox(new g.xw({Rq:k})):new g.ox(W.UV);Y.G=W.Fr;return Y},vu9=function(){},CNQ=function(){},yM=function(W,Y){g.S2.call(this); this.W=new d5K(Y);this.C=W;this.K=Y&&Y.I26||null;W=Y&&Y.mqa||null;Y&&Y.jCr&&(W?W["X-Client-Protocol"]="webchannel":W={"X-Client-Protocol":"webchannel"});this.W.N=W;W=Y&&Y.mVh||null;Y&&Y.KT&&(W?W["X-WebChannel-Content-Type"]=Y.KT:W={"X-WebChannel-Content-Type":Y.KT});Y&&Y.Ez&&(W?W["X-WebChannel-Client-Profile"]=Y.Ez:W={"X-WebChannel-Client-Profile":Y.Ez});this.W.K1=W;(W=Y&&Y.GU2)&&!g.zm(W)&&(this.W.G=W);this.X=Y&&Y.BV1||!1;this.T=Y&&Y.Gci||!1;(Y=Y&&Y.qD)&&!g.zm(Y)&&(this.W.TJ=Y,g.SV(this.K,Y)&&(W= this.K,Y in W&&delete W[Y]));this.J=new QM(this)},LdQ=function(W){V0w.call(this); W.__headers__&&(this.headers=W.__headers__,this.statusCode=W.__status__,delete W.__headers__,delete W.__status__);var Y=W.__sm__;Y?this.data=(this.W=g.$8(Y))?g.uj(Y,this.W):Y:this.data=W},U5p=function(W){ND1.call(this); this.status=1;this.errorCode=W},QM=function(W){this.W=W},lSN=function(W,Y){this.K=W; this.W=Y},bJi=function(W){return ouh(W.W).map(function(Y){var k=W.K; Y=Y.map;"__data__"in Y?(Y=Y.__data__,k=k.T?yBi(Y):Y):k=Y;return k})},eg=function(W,Y){if(typeof W!=="function")throw Error("Fn must not be null and must be a function"); return g.V0.setTimeout(function(){W()},Y)},vY=function(W){oE.dispatchEvent(new cjQ(oE,W))},cjQ=function(W){g.CH.call(this,"statevent",W)},C0=function(W,Y,k,P){this.W=W; this.T=Y;this.G=k;this.X=P||1;this.K=45E3;this.J=new g.OU(this);this.C=new g.mQ;this.C.setInterval(250)},fSc=function(W,Y,k){W.Tx=1; W.H1=Yl(Y.clone());W.Ah=k;W.TJ=!0;x5B(W,null)},V5z=function(W,Y,k,P,T){W.Tx=1; W.H1=Yl(Y.clone());W.Ah=null;W.TJ=k;T&&(W.Pt=!1);x5B(W,P)},x5B=function(W,Y){W.mJ=Date.now(); Neh(W);W.p6=W.H1.clone();$l(W.p6,"t",W.X);W.Sv=0;W.YZ=W.W.RV(W.W.I8()?Y:null);W.VX>0&&(W.J2=new g.b9((0,g.Xz)(W.ID,W,W.YZ),W.VX));W.J.listen(W.YZ,"readystatechange",W.Ga);Y=W.zT?g.ij(W.zT):{};W.Ah?(W.oW="POST",Y["Content-Type"]="application/x-www-form-urlencoded",W.YZ.send(W.p6,W.oW,W.Ah,Y)):(W.oW="GET",W.Pt&&!g.Sh&&(Y.Connection="close"),W.YZ.send(W.p6,W.oW,null,Y));W.W.N8(1)},Yjp=function(W,Y){var k=W.Sv,P=Y.indexOf("\n",k); if(P==-1)return aS9;k=Number(Y.substring(k,P));if(isNaN(k))return Wgh;P+=1;if(P+k>Y.length)return aS9;Y=Y.slice(P,P+k);W.Sv=P+k;return Y},Neh=function(W){W.rE=Date.now()+W.K; $PB(W,W.K)},$PB=function(W,Y){if(W.rp!=null)throw Error("WatchDog timer not null"); W.rp=eg((0,g.Xz)(W.qN,W),Y)},k_N=function(W){W.rp&&(g.V0.clearTimeout(W.rp),W.rp=null)},Puj=function(W){W.W.Lu()||W.qd||W.W.bO(W)},L0=function(W){k_N(W); g.Wu(W.J2);W.J2=null;W.C.stop();W.J.removeAll();if(W.YZ){var Y=W.YZ;W.YZ=null;Y.abort();Y.dispose()}W.Cx&&(W.Cx=null)},TSK=function(W,Y){try{W.W.xz(W,Y),W.W.N8(4)}catch(k){}},IKh=function(W,Y,k,P,T){if(P==0)k(!1); else{var I=T||0;P--;j0Q(W,Y,function(X){X?k(!0):g.V0.setTimeout(function(){IKh(W,Y,k,P,I)},I)})}},j0Q=function(W,Y,k){var P=new Image; P.onload=function(){try{Um(P),k(!0)}catch(T){}}; P.onerror=function(){try{Um(P),k(!1)}catch(T){}}; P.onabort=function(){try{Um(P),k(!1)}catch(T){}}; P.ontimeout=function(){try{Um(P),k(!1)}catch(T){}}; g.V0.setTimeout(function(){if(P.ontimeout)P.ontimeout()},Y); P.src=W},Um=function(W){W.onload=null; W.onerror=null;W.onabort=null;W.ontimeout=null},Xww=function(W){this.W=W; this.K=new n0},Sjw=function(W){var Y=lv(W.W,W.Gf,"/mail/images/cleardot.gif"); Yl(Y);IKh(Y.toString(),5E3,(0,g.Xz)(W.Qh,W),3,2E3);W.N8(1)},h$1=function(W){var Y=W.W.X; Y!=null?(vY(5),Y?(vY(11),bv(W.W,W,!1)):(vY(12),bv(W.W,W,!0))):(W.pL=new C0(W),W.pL.zT=W.NZ,Y=W.W,Y=lv(Y,Y.I8()?W.C6:null,W.aV),vY(5),$l(Y,"TYPE","xmlhttp"),V5z(W.pL,Y,!1,W.C6,!1))},BSc=function(W,Y,k){this.W=1; this.K=[];this.J=[];this.C=new n0;this.N=W||null;this.X=Y!=null?Y:null;this.L=k||!1},OQj=function(W,Y){this.W=W; this.map=Y;this.context=null},uJB=function(W,Y,k,P){g.CH.call(this,"timingevent",W); this.size=Y;this.rtt=k;this.retries=P},ZQ$=function(W){g.CH.call(this,"serverreachability",W)},Mrc=function(W){W.m0(1,0); W.gr=lv(W,null,W.lO);iQh(W)},trj=function(W){W.eD&&(W.eD.abort(),W.eD=null); W.Ks&&(W.Ks.cancel(),W.Ks=null);W.yx&&(g.V0.clearTimeout(W.yx),W.yx=null);cY(W);W.Oq&&(W.Oq.cancel(),W.Oq=null);W.jD&&(g.V0.clearTimeout(W.jD),W.jD=null)},qjz=function(W,Y){if(W.W==0)throw Error("Invalid operation: sending map when state is closed"); W.K.push(new OQj(W.IK++,Y));W.W!=2&&W.W!=3||iQh(W)},R$j=function(W){var Y=0; W.Ks&&Y++;W.Oq&&Y++;return Y},iQh=function(W){W.Oq||W.jD||(W.jD=eg((0,g.Xz)(W.kz,W),0),W.ao=0)},pwj=function(W,Y){if(W.W==1){if(!Y){W.jw=Math.floor(Math.random()*1E5); Y=W.jw++;var k=new C0(W,"",Y);k.zT=W.yy;var P=HQK(W),T=W.gr.clone();g.I2(T,"RID",Y);g.I2(T,"CVER","1");xl(W,T);fSc(k,T,P);W.Oq=k;W.W=2}}else W.W==3&&(Y?n4$(W,Y):W.K.length==0||W.Oq||n4$(W))},n4$=function(W,Y){if(Y)if(W.yw>6){W.K=W.J.concat(W.K); W.J.length=0;var k=W.jw-1;Y=HQK(W)}else k=Y.G,Y=Y.Ah;else k=W.jw++,Y=HQK(W);var P=W.gr.clone();g.I2(P,"SID",W.T);g.I2(P,"RID",k);g.I2(P,"AID",W.E4);xl(W,P);k=new C0(W,W.T,k,W.ao+1);k.zT=W.yy;k.setTimeout(1E4+Math.round(1E4*Math.random()));W.Oq=k;fSc(k,P,Y)},xl=function(W,Y){W.WU&&(W=W.WU.V1())&&g.Nc(W,function(k,P){g.I2(Y,P,k)})},HQK=function(W){var Y=Math.min(W.K.length,1E3),k=["count="+Y]; if(W.yw>6&&Y>0){var P=W.K[0].W;k.push("ofs="+P)}else P=0;for(var T={},I=0;I=3)return!1; W.G++;W.yx=eg((0,g.Xz)(W.fD,W),KgQ(W,W.Ro));W.Ro++;return!0},bv=function(W,Y,k){W.Yx=W.X==null?k:!W.X; W.u4=Y.Ad;W.L||Mrc(W)},cY=function(W){W.K4!=null&&(g.V0.clearTimeout(W.K4),W.K4=null)},KgQ=function(W,Y){var k=5E3+Math.floor(Math.random()*1E4); W.isActive()||(k*=2);return k*Y},f0=function(W,Y){if(Y==2||Y==9){var k=null; W.WU&&(k=null);var P=(0,g.Xz)(W.bu5,W);k||(k=new g.av("//www.google.com/images/cleardot.gif"),Yl(k));j0Q(k.toString(),1E4,P)}else vY(2);J8i(W,Y)},J8i=function(W,Y){W.W=0; W.WU&&W.WU.DZ(Y);s0B(W);trj(W)},s0B=function(W){W.W=0; W.u4=-1;if(W.WU)if(W.J.length==0&&W.K.length==0)W.WU.eQ();else{var Y=g.zK(W.J),k=g.zK(W.K);W.J.length=0;W.K.length=0;W.WU.eQ(Y,k)}},lv=function(W,Y,k){var P=g.X0(k); if(P.W!="")Y&&g.YA(P,Y+"."+P.W),g.$A(P,P.J);else{var T=window.location;P=bNw(T.protocol,Y?Y+"."+T.hostname:T.hostname,+T.port,k)}W.xw&&g.Nc(W.xw,function(I,X){g.I2(P,X,I)}); g.I2(P,"VER",W.yw);xl(W,P);return P},r8$=function(){},A8w=function(){this.W=[]; this.K=[]},z$1=function(W){g.CH.call(this,"channelMessage"); this.message=W},dPQ=function(W){g.CH.call(this,"channelError"); this.error=W},mPh=function(W,Y){this.action=W; this.params=Y||{}},VM=function(W,Y){g.e.call(this); this.W=new g.C_(this.xtS,0,this);g.v(this,this.W);this.z9=5E3;this.K=0;if(typeof W==="function")Y&&(W=(0,g.Xz)(W,Y));else if(W&&typeof W.handleEvent==="function")W=(0,g.Xz)(W.handleEvent,W);else throw Error("Invalid listener argument");this.J=W},DPc=function(W,Y,k,P,T,I,X,h,B,O,u,Z,M,t){k=k===void 0?!1:k; P=P===void 0?function(){return""}:P; T=T===void 0?!1:T;I=I===void 0?!1:I;X=X===void 0?!1:X;h=h===void 0?function(){return g.sJ({})}:h; B=B===void 0?!1:B;u=u===void 0?!1:u;Z=Z===void 0?!1:Z;M=M===void 0?!1:M;t=t===void 0?!1:t;this.Fr=W;this.A5=Y;this.X=new g.RY;this.K=new VM(this.cCh,this);this.W=null;this.G=!1;this.N=null;this.wD="";this.Kg=this.L=0;this.J=[];this.J9=k;this.TJ=P;this.C=I;this.UP=h;this.OP=O;this.xm=X;this.gD=null;this.T=g.sJ();this.Gn=T;this.K1=B;this.Lg=u;this.e1=Z;this.f1=M;this.A9=t;this.Q5=new eEc;this.GJ=new oGK;this.bz=new Cww;this.rD=new vGw;this.V5=new LfQ;this.D_=new UKQ;this.KH=new lJh},ww1=function(W, Y,k,P,T){g4i(W); if(W.W){var I=g.eM("ID_TOKEN"),X=W.W.yy||{};I?X["x-youtube-identity-token"]=I:delete X["x-youtube-identity-token"];W.W.yy=X}FgK(W);P?(P.getState()!=3&&R$j(P)==0||P.getState(),W.W.connect(Y,k,W.A5,P.T,P.E4)):T?W.W.connect(Y,k,W.A5,T.sessionId,T.arrayId):W.W.connect(Y,k,W.A5)},o41=function(W,Y){return W.f1?!0:W.e1?Object.values(Q01).includes(Y):W.Lg?!Object.values(y8K).includes(Y):W.A9?Object.values(e$Q).includes(Y):!1},LgK=function(W){var Y,k; g.D(function(P){if(P.W==1)return g.E2(P,2),g.m(P,v4Q(W),2);g.DX(P);Y=W.J;W.J=[];k=Y.length;CuK(W,Y,k);Nh(W);return g.gv(P,0)})},CuK=function(W,Y,k){for(var P=0;P0?k=Object.assign({},k,Y):delete k.Authorization;W.W.yy=k}},FgK=function(W){W.OP&&!W.C&&lKB(W,W.OP())},aE=function(W){this.scheme="https"; this.port=this.domain="";this.W="/api/lounge";this.K=!0;W=W||document.location.href;var Y=Number(g.I8(W)[4]||null)||"";Y&&(this.port=":"+Y);this.domain=g.Xl(W)||"";W=g.wY();W.search("MSIE")>=0&&(W=W.match(/MSIE ([\d.]+)/)[1],g.FD(W,"10.0")<0&&(this.K=!1))},Wc=function(W,Y){var k=W.W; W.K&&(k=W.scheme+"://"+W.domain+W.port+W.W);return g.MH(k+Y,{})},bQc=function(W,Y){g.S2.call(this); var k=this;this.handler=W();this.handler.subscribe("handlerOpened",this.jg,this);this.handler.subscribe("handlerClosed",this.onClosed,this);this.handler.subscribe("handlerError",function(P,T){k.onError(T)}); this.handler.subscribe("handlerMessage",this.onMessage,this);this.W=Y},c81=function(W,Y,k){var P=this; k=k===void 0?function(){return""}:k; var T=T===void 0?new CNQ:T;var I=I===void 0?new g.RY:I;this.pathPrefix=W;this.W=Y;this.wD=k;this.C=I;this.L=null;this.N=this.G=0;this.channel=null;this.X=0;this.J=new VM(function(){P.J.isActive();var X;((X=P.channel)==null?void 0:qPc((new lSN(X,X.W)).W.K))===0&&P.connect(P.L,P.G)}); this.T={};this.K={};this.A5=!1;this.logger=null;this.Kg=[];this.Zg=void 0;this.UP=new eEc;this.gD=new oGK;this.OP=new vGw;this.TJ=new LfQ},xPh=function(W){g.VS(W.channel,"m",function(){W.X=3; W.J.reset();W.L=null;W.G=0;for(var Y=g.p(W.Kg),k=Y.next();!k.done;k=Y.next())k=k.value,W.channel&&W.channel.send(k);W.Kg=[];W.publish("webChannelOpened");W.UP.Vt("WEB_CHANNEL")}); g.VS(W.channel,"n",function(){W.X=0;W.J.isActive()||W.publish("webChannelClosed");var Y,k=(Y=W.channel)==null?void 0:bJi(new lSN(Y,Y.W));k&&(W.Kg=[].concat(g.ZX(k)));W.gD.Vt("WEB_CHANNEL")}); g.VS(W.channel,"p",function(Y){var k=Y.data;k[0]==="gracefulReconnect"?(W.J.start(),W.channel&&W.channel.close()):W.publish("webChannelMessage",new mPh(k[0],k[1]));W.Zg=Y.statusCode;W.OP.Vt("WEB_CHANNEL")}); g.VS(W.channel,"o",function(){W.Zg===401||W.J.start();W.publish("webChannelError");W.TJ.Vt("WEB_CHANNEL","")})},fKc=function(W){var Y=W.wD(); Y?W.T["x-youtube-lounge-xsrf-token"]=Y:delete W.T["x-youtube-lounge-xsrf-token"]},Vr1=function(W){g.S2.call(this); this.W=W();this.W.subscribe("webChannelOpened",this.Zv,this);this.W.subscribe("webChannelClosed",this.onClosed,this);this.W.subscribe("webChannelError",this.onError,this);this.W.subscribe("webChannelMessage",this.onMessage,this)},NS9=function(W,Y,k,P,T){function I(){return new DPc(Wc(W,"/bc"),Y,!1,k,P)} k=k===void 0?function(){return""}:k; return g.Oi("enable_mdx_web_channel_desktop")?new Vr1(function(){return new c81(Wc(W,"/wc"),Y,k)}):new bQc(I,T)},$li=function(){var W=aKw; WpQ();YC.push(W);YYB()},$C=function(W,Y){WpQ(); var k=kNi(W,String(Y));YC.length==0?P$j(k):(YYB(),g.xh(YC,function(P){P(k)}))},kC=function(W){$C("CP",W)},WpQ=function(){YC||(YC=g.Wp("yt.mdx.remote.debug.handlers_")||[],g.N6("yt.mdx.remote.debug.handlers_",YC))},P$j=function(W){var Y=(Pc+1)%50; Pc=Y;TE[Y]=W;jT||(jT=Y==49)},YYB=function(){var W=YC; if(TE[0]){var Y=jT?Pc:-1,k={};do k={fl:void 0},Y=(Y+1)%50,k.fl=TE[Y],g.xh(W,function(P){return function(T){T(P.fl)}}(k)); while(Y!=Pc);TE=Array(50);Pc=-1;jT=!1}},kNi=function(W,Y){var k=(Date.now()-TyK)/1E3; k.toFixed&&(k=k.toFixed(3));var P=[];P.push("[",k+"s","] ");P.push("[","yt.mdx.remote","] ");P.push(W+": "+Y,"\n");return P.join("")},IZ=function(W){g.NR.call(this); this.X=W;this.screens=[]},jBN=function(W,Y){var k=W.get(Y.uuid)||W.get(Y.id); if(k)return W=k.name,k.id=Y.id||k.id,k.name=Y.name,k.token=Y.token,k.uuid=Y.uuid||k.uuid,k.name!=W;W.screens.push(Y);return!0},Igc=function(W,Y){var k=W.screens.length!=Y.length; W.screens=g.Eo(W.screens,function(I){return!!EFK(Y,I)}); for(var P=Y.length,T=0;T0&&W.T0&&Hc(W,k)},function(Y){W.C=function(){}; W.Qb(Y)})},wAc=function(W){var Y={}; Y.pairingCode=W.gD;Y.theme=W.Fr;wOp()&&(Y.env_useStageMdx=1);return g.ih(Y)},QBB=function(W){return new Promise(function(Y){W.gD=GSK(); if(W.UP){var k=new chrome.cast.DialLaunchResponse(!0,wAc(W));Y(k);Fpz(W)}else W.A5=function(){g.SU(W.N);W.A5=function(){}; W.N=NaN;var P=new chrome.cast.DialLaunchResponse(!0,wAc(W));Y(P);Fpz(W)},W.N=g.Ii(function(){W.A5()},100)})},efN=function(W,Y,k){W.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(Y)); var P=new Sg(Y);return(new Promise(function(T){yIB(W,P,function(I){I?(W.Kg=!0,uM(W.T,P),iM(W,P),Hc(W,k)):g.CI(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(Y)+" is not online."));T(I)},5)})).then(function(T){return T?new chrome.cast.DialLaunchResponse(!1):QBB(W)})},ojK=function(W,Y){var k=W.L.receiver.label,P=W.K.friendlyName; return(new Promise(function(T){Rfj(W.T,k,Y,P,function(I){I&&I.token&&iM(W,I);T(I)},function(I){Mz(W,"Failed to get DIAL screen: "+I); T(null)})})).then(function(T){return T&&T.token?new chrome.cast.DialLaunchResponse(!1):QBB(W)})},yIB=function(W,Y,k,P){g.SU(W.X); W.X=0;njc(W.T,Y,function(T){T||P<0?k(T):W.X=g.Ii(function(){yIB(W,Y,k,P-1)},300)})},Hc=function(W,Y){W.info("getDialAppInfoWithTimeout_ "+Y); RZ(W)&&(g.SU(W.G),W.G=0,Y==0?vjK(W):W.G=g.Ii(function(){vjK(W)},Y))},vjK=function(W){RZ(W)&&W.J.getDialAppInfo(function(Y){W.info("getDialAppInfo dialLaunchData: "+JSON.stringify(Y)); Y=Y.extraData||{};var k=null;if(Y.loungeToken){var P;((P=W.W)==null?void 0:P.token)==Y.loungeToken&&(k="staleLoungeToken")}else k="missingLoungeToken";k?(W.wD=k,Hc(W,3E4)):(W.Kg=!1,W.wD="unknown",Ejp(W,Y.loungeToken),Hc(W,Y.loungeTokenRefreshIntervalMs))},function(Y){W.info("getDialAppInfo error: "+Y); W.wD="noLoungeTokenResponse";Hc(W,3E4)})},C$K=function(W){g.SU(W.X); W.X=0;g.SU(W.G);W.G=0;W.C();W.C=function(){}; g.SU(W.N)},nw=function(W,Y){ZL.call(this,W,Y,"ManualSession"); this.J=g.Ii((0,g.Xz)(this.xs,this,null),150)},pw=function(W,Y){g.NR.call(this); this.config_=Y;this.K=W;this.L=Y.appId||"233637DE";this.T=Y.theme||"cl";this.N=Y.disableCastApi||!1;this.X=Y.forceMirroring||!1;this.W=null;this.G=!1;this.J=[];this.C=(0,g.Xz)(this.lYr,this)},Lpi=function(W,Y){return Y?g.qc(W.J,function(k){return hY(Y,k.label)},W):null},GE=function(W){$C("Controller",W)},aKw=function(W){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(W)},Kw=function(W){return W.G||!!W.J.length||!!W.W},ER=function(W,Y,k){Y!=W.W&&(g.Wu(W.W),(W.W=Y)?(k?W.publish("yt-remote-cast2-receiver-resumed", Y.K):W.publish("yt-remote-cast2-receiver-selected",Y.K),Y.subscribe("sessionScreen",(0,g.Xz)(W.hK,W,Y)),Y.subscribe("sessionFailed",function(){return Ulj(W,Y)}),Y.W?W.publish("yt-remote-cast2-session-change",Y.W):k&&W.W.xs(null)):W.publish("yt-remote-cast2-session-change",null))},Ulj=function(W,Y){W.W==Y&&W.publish("yt-remote-cast2-session-failed")},lgK=function(W){var Y=W.K.rj(),k=W.W&&W.W.K; W=g.tx(Y,function(P){k&&hY(P,k.label)&&(k=null);var T=P.uuid?P.uuid:P.id,I=Lpi(this,P);I?(I.label=T,I.friendlyName=P.name):(I=new chrome.cast.Receiver(T,P.name),I.receiverType=chrome.cast.ReceiverType.CUSTOM);return I},W); k&&(k.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(k=new chrome.cast.Receiver(k.label,k.friendlyName),k.receiverType=chrome.cast.ReceiverType.CUSTOM),W.push(k));return W},WSj=function(W,Y,k,P){P.disableCastApi?JF("Cannot initialize because disabled by Mdx config."):ba1()?cIi(Y,P)&&(xl9(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?fgp(W,k):(window.__onGCastApiAvailable=function(T,I){T?fgp(W,k):(sR("Failed to load cast API: "+I),VKB(!1),xl9(!1),g.Jl("yt-remote-cast-available"),g.Jl("yt-remote-cast-receiver"), Nyc(),k(!1))},P.loadCastApiSetupScript?g.fQ(agh):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?ylN()>=60&&cli():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?CC9():ylN()>=89?fV9():(beB(),RE(x8i.map(Lrc))))):JF("Cannot initialize because not running Chrome")},Nyc=function(){JF("dispose"); var W=r1();W&&W.dispose();g.N6("yt.mdx.remote.cloudview.instance_",null);Y5p(!1);g.cw($RN);$RN.length=0},AF=function(){return!!g.Es("yt-remote-cast-installed")},kHB=function(){var W=g.Es("yt-remote-cast-receiver"); return W?W.friendlyName:null},PDc=function(){JF("clearCurrentReceiver"); g.Jl("yt-remote-cast-receiver")},Tjj=function(){return AF()?r1()?r1().getCastSession():(sR("getCastSelector: Cast is not initialized."),null):(sR("getCastSelector: Cast API is not installed!"),null)},jsp=function(){AF()?r1()?zE()?(JF("Requesting cast selector."),r1().requestSession()):(JF("Wait for cast API to be ready to request the session."),$RN.push(g.bu("yt-remote-cast2-api-ready",jsp))):sR("requestCastSelector: Cast is not initialized."):sR("requestCastSelector: Cast API is not installed!")}, d1=function(W,Y){zE()?r1().setConnectedScreenStatus(W,Y):sR("setConnectedScreenStatus called before ready.")},ba1=function(){var W=g.wY().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.qn||W},IeK=function(W,Y){r1().init(W,Y)},cIi=function(W,Y){var k=!1; r1()||(W=new pw(W,Y),W.subscribe("yt-remote-cast2-availability-change",function(P){g.Ke("yt-remote-cast-available",P);tY("yt-remote-cast2-availability-change",P)}),W.subscribe("yt-remote-cast2-receiver-selected",function(P){JF("onReceiverSelected: "+P.friendlyName); g.Ke("yt-remote-cast-receiver",P);tY("yt-remote-cast2-receiver-selected",P)}),W.subscribe("yt-remote-cast2-receiver-resumed",function(P){JF("onReceiverResumed: "+P.friendlyName); g.Ke("yt-remote-cast-receiver",P);tY("yt-remote-cast2-receiver-resumed",P)}),W.subscribe("yt-remote-cast2-session-change",function(P){JF("onSessionChange: "+BY(P)); P||g.Jl("yt-remote-cast-receiver");tY("yt-remote-cast2-session-change",P)}),g.N6("yt.mdx.remote.cloudview.instance_",W),k=!0); JF("cloudview.createSingleton_: "+k);return k},r1=function(){return g.Wp("yt.mdx.remote.cloudview.instance_")},fgp=function(W,Y){VKB(!0); xl9(!1);IeK(W,function(k){k?(Y5p(!0),g.x4("yt-remote-cast2-api-ready")):(sR("Failed to initialize cast API."),VKB(!1),g.Jl("yt-remote-cast-available"),g.Jl("yt-remote-cast-receiver"),Nyc());Y(k)})},JF=function(W){$C("cloudview",W)},sR=function(W){$C("cloudview",W)},VKB=function(W){JF("setCastInstalled_ "+W); g.Ke("yt-remote-cast-installed",W)},zE=function(){return!!g.Wp("yt.mdx.remote.cloudview.apiReady_")},Y5p=function(W){JF("setApiReady_ "+W); g.N6("yt.mdx.remote.cloudview.apiReady_",W)},xl9=function(W){g.N6("yt.mdx.remote.cloudview.initializing_",W)},mI=function(W){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.C=this.X=0;this.trackData=null;this.Gg=this.EK=!1;this.L=this.J=this.G=this.K=0;this.W=NaN;this.T=!1;this.reset(W)},XJN=function(W){W.audioTrackId=null; W.trackData=null;W.playerState=-1;W.EK=!1;W.Gg=!1;W.X=0;W.C=g.Bp();W.K=0;W.G=0;W.J=0;W.L=0;W.W=NaN;W.T=!1},DL=function(W){return W.isPlaying()?(g.Bp()-W.C)/1E3:0},g1=function(W,Y){W.X=Y; W.C=g.Bp()},Fj=function(W){switch(W.playerState){case 1:case 1081:return(g.Bp()-W.C)/1E3+W.X; case -1E3:return 0}return W.X},S5h=function(W){return W.T?W.G+DL(W):W.G},w1=function(W,Y,k){var P=W.videoId; W.videoId=Y;W.index=k;Y!=P&&XJN(W)},hWK=function(W){var Y={}; Y.index=W.index;Y.listId=W.listId;Y.videoId=W.videoId;Y.playerState=W.playerState;Y.volume=W.volume;Y.muted=W.muted;Y.audioTrackId=W.audioTrackId;Y.trackData=g.MS(W.trackData);Y.hasPrevious=W.EK;Y.hasNext=W.Gg;Y.playerTime=W.X;Y.playerTimeAt=W.C;Y.seekableStart=W.K;Y.seekableEnd=W.G;Y.duration=W.J;Y.loadedTime=W.L;Y.liveIngestionTime=W.W;return Y},y6=function(W,Y){g.NR.call(this); var k=this;this.J=0;this.T=W;this.X=[];this.C=new A8w;this.K=this.W=null;this.N=(0,g.Xz)(this.P8P,this);this.G=(0,g.Xz)(this.Mk,this);this.L=(0,g.Xz)(this.i15,this);this.A5=(0,g.Xz)(this.J9J,this);var P=0;W?(P=W.getProxyState(),P!=3&&(W.subscribe("proxyStateChange",this.Ix,this),Bjw(this))):P=3;P!=0&&(Y?this.Ix(P):g.Ii(function(){k.Ix(P)},0)); (W=Tjj())&&Q6(this,W);this.subscribe("yt-remote-cast2-session-change",this.A5)},eT=function(W){return new mI(W.T.getPlayerContextData())},Bjw=function(W){g.xh("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(Y){this.X.push(this.T.subscribe(Y,g.hN(this.bH5,Y),this))},W)},OxK=function(W){g.xh(W.X,function(Y){this.T.unsubscribeByKey(Y)},W); W.X.length=0},oZ=function(W){return W.getState()==1},vc=function(W,Y){var k=W.C; k.W.length+k.K.length<50&&W.C.enqueue(Y)},uej=function(W,Y,k){var P=eT(W); g1(P,k);P.playerState!=-1E3&&(P.playerState=Y);Cw(W,P)},Lw=function(W,Y,k){W.T.sendMessage(Y,k)},Cw=function(W,Y){OxK(W); W.T.setPlayerContextData(hWK(Y));Bjw(W)},Q6=function(W,Y){W.K&&(W.K.removeUpdateListener(W.N),W.K.removeMediaListener(W.G),W.Mk(null)); W.K=Y;W.K&&(kC("Setting cast session: "+W.K.sessionId),W.K.addUpdateListener(W.N),W.K.addMediaListener(W.G),W.K.media.length&&W.Mk(W.K.media[0]))},Zxi=function(W){var Y=W.W.media,k=W.W.customData; if(Y&&k){var P=eT(W);Y.contentId!=P.videoId&&kC("Cast changing video to: "+Y.contentId);P.videoId=Y.contentId;P.playerState=k.playerState;g1(P,W.W.getEstimatedTime());Cw(W,P)}else kC("No cast media video. Ignoring state update.")},UR=function(W,Y,k){return(0,g.Xz)(function(P){this.UE("Failed to "+Y+" with cast v2 channel. Error code: "+P.code); P.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.UE("Retrying "+Y+" using MDx browser channel."),Lw(this,Y,k))},W)},cc=function(W,Y,k,P){P=P===void 0?!1:P; g.NR.call(this);var T=this;this.X=NaN;this.gD=!1;this.N=this.L=this.Kg=this.wD=NaN;this.A5=[];this.C=this.G=this.T=this.W=this.K=null;this.UP=W;this.OP=P;this.A5.push(g.ZV(window,"beforeunload",function(){T.FM(2)})); this.J=[];this.W=new mI;this.Fr=Y.id;this.TJ=Y.idType;this.K=NS9(this.UP,k,this.Ej,this.TJ=="shortLived",this.Fr);this.K.listen("channelOpened",function(){ixB(T)}); this.K.listen("channelClosed",function(){lM("Channel closed");isNaN(T.X)?iv(!0):iv();T.dispose()}); this.K.listen("channelError",function(I){iv();isNaN(T.dH())?(I==1&&T.TJ=="shortLived"&&T.publish("browserChannelAuthError",I),lM("Channel error: "+I+" without reconnection"),T.dispose()):(T.gD=!0,lM("Channel error: "+I+" with reconnection in "+T.dH()+" ms"),bM(T,2))}); this.K.listen("channelMessage",function(I){MY9(T,I)}); this.K.C5(Y.token);this.subscribe("remoteQueueChange",function(){var I=T.W.videoId;g.rD()&&g.Ke("yt-remote-session-video-id",I)})},tYN=function(W){return g.qc(W.J,function(Y){return Y.type=="LOUNGE_SCREEN"})},lM=function(W){$C("conn",W)},bM=function(W,Y){W.publish("proxyStateChange",Y)},q5c=function(W){W.X=g.Ii(function(){lM("Connecting timeout"); W.FM(1)},2E4)},RWB=function(W){g.SU(W.X); W.X=NaN},HxB=function(W){g.SU(W.wD); W.wD=NaN},pJK=function(W){nxc(W); W.Kg=g.Ii(function(){xC(W,"getNowPlaying")},2E4)},nxc=function(W){g.SU(W.Kg); W.Kg=NaN},ixB=function(W){lM("Channel opened"); W.gD&&(W.gD=!1,HxB(W),W.wD=g.Ii(function(){lM("Timing out waiting for a screen.");W.FM(1)},15E3))},KSc=function(W,Y){var k=null; if(Y){var P=tYN(W);P&&(k={clientName:P.clientName,deviceMake:P.brand,deviceModel:P.model,osVersion:P.osVersion})}g.N6("yt.mdx.remote.remoteClient_",k);Y&&(RWB(W),HxB(W));k=W.K.QY()&&isNaN(W.X);Y==k?Y&&(bM(W,1),xC(W,"getSubtitlesTrack")):Y?(W.Sd()&&W.W.reset(),bM(W,1),xC(W,"getNowPlaying"),GH$(W)):W.FM(1)},ExN=function(W,Y){var k=Y.params.videoId; delete Y.params.videoId;k==W.W.videoId&&(g.Ox(Y.params)?W.W.trackData=null:W.W.trackData=Y.params,W.publish("remotePlayerChange"))},JhB=function(W,Y,k){var P=Y.params.videoId||Y.params.video_id,T=parseInt(Y.params.currentIndex,10); W.W.listId=Y.params.listId||W.W.listId;w1(W.W,P,T);W.publish("remoteQueueChange",k)},rh9=function(W,Y){Y.params=Y.params||{}; JhB(W,Y,"NOW_PLAYING_MAY_CHANGE");ssj(W,Y);W.publish("autoplayDismissed")},ssj=function(W,Y){var k=parseInt(Y.params.currentTime||Y.params.current_time,10); g1(W.W,isNaN(k)?0:k);k=parseInt(Y.params.state,10);k=isNaN(k)?-1:k;k==-1&&W.W.playerState==-1E3&&(k=-1E3);W.W.playerState=k;k=Number(Y.params.loadedTime);W.W.L=isNaN(k)?0:k;W.W.Nv(Number(Y.params.duration));k=W.W;var P=Number(Y.params.liveIngestionTime);k.W=P;k.T=isNaN(P)?!1:!0;k=W.W;P=Number(Y.params.seekableStartTime);Y=Number(Y.params.seekableEndTime);k.K=isNaN(P)?0:P;k.G=isNaN(Y)?0:Y;W.W.playerState==1?pJK(W):nxc(W);W.publish("remotePlayerChange")},Ahi=function(W,Y){if(W.W.playerState!=-1E3){var k= 1085; switch(parseInt(Y.params.adState,10)){case 1:k=1081;break;case 2:k=1084;break;case 0:k=1083}W.W.playerState=k;Y=parseInt(Y.params.currentTime,10);g1(W.W,isNaN(Y)?0:Y);W.publish("remotePlayerChange")}},zWc=function(W,Y){var k=Y.params.muted=="true"; W.W.volume=parseInt(Y.params.volume,10);W.W.muted=k;W.publish("remotePlayerChange")},dRi=function(W,Y){W.G=Y.params.videoId; W.publish("nowAutoplaying",parseInt(Y.params.timeout,10))},mRB=function(W,Y){W.G=Y.params.videoId||null; W.publish("autoplayUpNext",W.G)},DRp=function(W,Y){W.C=Y.params.autoplayMode; W.publish("autoplayModeChange",W.C);W.C=="DISABLED"&&W.publish("autoplayDismissed")},gx$=function(W,Y){var k=Y.params.hasNext=="true"; W.W.EK=Y.params.hasPrevious=="true";W.W.Gg=k;W.publish("previousNextChange")},MY9=function(W,Y){Y=Y.message; Y.params?lM("Received: action="+Y.action+", params="+g.Qx(Y.params)):lM("Received: action="+Y.action+" {}");switch(Y.action){case "loungeStatus":Y=kl(Y.params.devices);W.J=g.tx(Y,function(P){return new Xf(P)}); Y=!!g.qc(W.J,function(P){return P.type=="LOUNGE_SCREEN"}); KSc(W,Y);Y=W.o2("mlm");W.publish("multiStateLoopEnabled",Y);break;case "loungeScreenDisconnected":g.rB(W.J,function(P){return P.type=="LOUNGE_SCREEN"}); KSc(W,!1);break;case "remoteConnected":var k=new Xf(kl(Y.params.device));g.qc(W.J,function(P){return P.equals(k)})||Ffj(W.J,k); break;case "remoteDisconnected":k=new Xf(kl(Y.params.device));g.rB(W.J,function(P){return P.equals(k)}); break;case "gracefulDisconnect":break;case "playlistModified":JhB(W,Y,"QUEUE_MODIFIED");break;case "nowPlaying":rh9(W,Y);break;case "onStateChange":ssj(W,Y);break;case "onAdStateChange":Ahi(W,Y);break;case "onVolumeChanged":zWc(W,Y);break;case "onSubtitlesTrackChanged":ExN(W,Y);break;case "nowAutoplaying":dRi(W,Y);break;case "autoplayDismissed":W.publish("autoplayDismissed");break;case "autoplayUpNext":mRB(W,Y);break;case "onAutoplayModeChanged":DRp(W,Y);break;case "onHasPreviousNextChanged":gx$(W, Y);break;case "requestAssistedSignIn":W.publish("assistedSignInRequested",Y.params.authCode);break;case "onLoopModeChanged":W.publish("loopModeChange",Y.params.loopMode);break;default:lM("Unrecognized action: "+Y.action)}},GH$=function(W){g.SU(W.N); W.N=g.Ii(function(){W.FM(1)},864E5)},xC=function(W,Y,k){k?lM("Sending: action="+Y+", params="+g.Qx(k)):lM("Sending: action="+Y); W.K.sendMessage(Y,k)},FSh=function(W){IZ.call(this,"ScreenServiceProxy"); this.u_=W;this.W=[];this.W.push(this.u_.$_s("screenChange",(0,g.Xz)(this.aK,this)));this.W.push(this.u_.$_s("onlineScreenChange",(0,g.Xz)(this.Mrq,this)))},oxz=function(W,Y){Fr9(); if(!Mh||!Mh.get("yt-remote-disable-remote-module-for-dev")){Y=g.eM("MDX_CONFIG")||Y;Jlj();zB$();fw||(fw=new aE(Y?Y.loungeApiHost:void 0),wOp()&&(fw.W="/api/loungedev"));V6||(V6=g.Wp("yt.mdx.remote.deferredProxies_")||[],g.N6("yt.mdx.remote.deferredProxies_",V6));wJQ();var k=Nz();if(!k){var P=new OR(fw,Y?Y.disableAutomaticScreenCache||!1:!1);g.N6("yt.mdx.remote.screenService_",P);k=Nz();var T={};Y&&(T={appId:Y.appId,disableDial:Y.disableDial,theme:Y.theme,loadCastApiSetupScript:Y.loadCastApiSetupScript, disableCastApi:Y.disableCastApi,enableDialLoungeToken:Y.enableDialLoungeToken,enableCastLoungeToken:Y.enableCastLoungeToken,forceMirroring:Y.forceMirroring});g.N6("yt.mdx.remote.enableConnectWithInitialState_",Y?Y.enableConnectWithInitialState||!1:!1);WSj(W,P,function(I){I?aZ()&&d1(aZ(),"YouTube TV"):P.subscribe("onlineScreenChange",function(){tY("yt-remote-receiver-availability-change")})},T)}Y&&!g.Wp("yt.mdx.remote.initialized_")&&(g.N6("yt.mdx.remote.initialized_",!0),Wt("Initializing: "+g.Qx(Y)), Y2.push(g.bu("yt-remote-cast2-api-ready",function(){tY("yt-remote-api-ready")})),Y2.push(g.bu("yt-remote-cast2-availability-change",function(){tY("yt-remote-receiver-availability-change")})),Y2.push(g.bu("yt-remote-cast2-receiver-selected",function(){$2(null); tY("yt-remote-auto-connect","cast-selector-receiver")})),Y2.push(g.bu("yt-remote-cast2-receiver-resumed",function(){tY("yt-remote-receiver-resumed","cast-selector-receiver")})),Y2.push(g.bu("yt-remote-cast2-session-change",Qs1)),Y2.push(g.bu("yt-remote-connection-change",function(I){I?d1(aZ(),"YouTube TV"):k2()||(d1(null,null),PDc())})),Y2.push(g.bu("yt-remote-cast2-session-failed",function(){tY("yt-remote-connection-failed")})),W=yhN(),Y.isAuto&&(W.id+="#dial"),T=Y.capabilities||[],T.length>0&&(W.capabilities= T),W.name=Y.device,W.app=Y.app,(Y=Y.theme)&&(W.theme=Y),Wt(" -- with channel params: "+g.Qx(W)),W?(g.Ke("yt-remote-session-app",W.app),g.Ke("yt-remote-session-name",W.name)):(g.Jl("yt-remote-session-app"),g.Jl("yt-remote-session-name")),g.N6("yt.mdx.remote.channelParams_",W),k.start(),aZ()||eWK())}},vxQ=function(){var W=Nz().u_.$_gos(); var Y=Pt();Y&&Tr()&&(EFK(W,Y)||W.push(Y));return KrK(W)},LSc=function(){var W=CDB(); !W&&AF()&&kHB()&&(W={key:"cast-selector-receiver",name:kHB()});return W},CDB=function(){var W=vxQ(),Y=Pt(); Y||(Y=k2());return g.qc(W,function(k){return Y&&hY(Y,k.key)?!0:!1})},Pt=function(){var W=aZ(); if(!W)return null;var Y=Nz().FZ();return Om(Y,W)},Qs1=function(W){Wt("remote.onCastSessionChange_: "+BY(W)); if(W){var Y=Pt();if(Y&&Y.id==W.id){if(d1(Y.id,"YouTube TV"),W.idType=="shortLived"&&(W=W.token))jH&&(jH.token=W),(Y=Tr())&&Y.C5(W)}else Y&&I6(),Xa(W,1)}else Tr()&&I6()},I6=function(){zE()?r1().stopSession():sR("stopSession called before API ready."); var W=Tr();W&&(W.disconnect(1),URp(null))},le1=function(){var W=Tr(); return!!W&&W.getProxyState()!=3},Wt=function(W){$C("remote",W)},Nz=function(){if(!bx1){var W=g.Wp("yt.mdx.remote.screenService_"); bx1=W?new FSh(W):null}return bx1},aZ=function(){return g.Wp("yt.mdx.remote.currentScreenId_")},chN=function(W){g.N6("yt.mdx.remote.currentScreenId_",W)},xR1=function(){return g.Wp("yt.mdx.remote.connectData_")},$2=function(W){g.N6("yt.mdx.remote.connectData_",W)},Tr=function(){return g.Wp("yt.mdx.remote.connection_")},URp=function(W){var Y=Tr(); $2(null);W||chN("");g.N6("yt.mdx.remote.connection_",W);V6&&(g.xh(V6,function(k){k(W)}),V6.length=0); Y&&!W?tY("yt-remote-connection-change",!1):!Y&&W&&tY("yt-remote-connection-change",!0)},k2=function(){var W=g.rD(); if(!W)return null;var Y=Nz();if(!Y)return null;Y=Y.FZ();return Om(Y,W)},Xa=function(W,Y){aZ(); Pt()&&Pt();if(SH)jH=W;else{chN(W.id);var k=g.Wp("yt.mdx.remote.enableConnectWithInitialState_")||!1;W=new cc(fw,W,yhN(),k);W.connect(Y,xR1());W.subscribe("beforeDisconnect",function(P){tY("yt-remote-before-disconnect",P)}); W.subscribe("beforeDispose",function(){Tr()&&(Tr(),URp(null))}); W.subscribe("browserChannelAuthError",function(){var P=Pt();P&&P.idType=="shortLived"&&(zE()?r1().handleBrowserChannelAuthError():sR("refreshLoungeToken called before API ready."))}); URp(W)}},eWK=function(){var W=k2(); W?(Wt("Resume connection to: "+BY(W)),Xa(W,0)):(iv(),PDc(),Wt("Skipping connecting because no session screen found."))},wJQ=function(){var W=yhN(); if(g.Ox(W)){W=ZF();var Y=g.Es("yt-remote-session-name")||"",k=g.Es("yt-remote-session-app")||"";W={device:"REMOTE_CONTROL",id:W,name:Y,app:k,mdxVersion:3};W.authuser=String(g.eM("SESSION_INDEX","0"));(Y=g.eM("DELEGATED_SESSION_ID"))&&(W.pageId=String(Y));g.N6("yt.mdx.remote.channelParams_",W)}},yhN=function(){return g.Wp("yt.mdx.remote.channelParams_")||{}},Nj$=function(W,Y,k){g.e.call(this); var P=this;this.W=W;this.Y=Y;this.l8=k;this.events=new g.p5(this);this.C=!1;this.X=new g.zc(64);this.K=new g.C_(this.kA,500,this);this.J=new g.C_(this.D5,1E3,this);this.L=new HY(this.g7z,0,this);this.T={};this.N=new g.C_(this.Qj,1E3,this);this.G=new g.b9(this.seekTo,1E3,this);this.A5=this.events.Z(this.Y,"onVolumeChange",function(T){feK(P,T)}); g.v(this,this.events);this.events.Z(Y,"onCaptionsTrackListChanged",this.Bx1);this.events.Z(Y,"captionschanged",this.K21);this.events.Z(Y,"captionssettingschanged",this.Lp);this.events.Z(Y,"videoplayerreset",this.xb);this.events.Z(Y,"mdxautoplaycancel",function(){P.l8.YK()}); Y.U("enable_mdx_video_play_directly")&&this.events.Z(Y,"videodatachange",function(){VYQ(P.W)||hc(P)||Bt(P,0)}); W=this.l8;W.Xr();W.subscribe("proxyStateChange",this.lA,this);W.subscribe("remotePlayerChange",this.K3,this);W.subscribe("remoteQueueChange",this.xb,this);W.subscribe("previousNextChange",this.NQ,this);W.subscribe("nowAutoplaying",this.DK,this);W.subscribe("autoplayDismissed",this.sb,this);g.v(this,this.K);g.v(this,this.J);g.v(this,this.L);g.v(this,this.N);g.v(this,this.G);this.Lp();this.xb();this.K3()},feK=function(W,Y){if(hc(W)){W.l8.unsubscribe("remotePlayerChange",W.K3,W); var k=Math.round(Y.volume);Y=!!Y.muted;var P=eT(W.l8);if(k!==P.volume||Y!==P.muted)W.l8.setVolume(k,Y),W.N.start();W.l8.subscribe("remotePlayerChange",W.K3,W)}},aez=function(W){W.Xi(0); W.K.stop();W.AT(new g.zc(64))},WqQ=function(W,Y){if(hc(W)&&!W.C){var k=null; Y&&(k={style:W.Y.getSubtitlesUserSettings()},Object.assign(k,Y));W.l8.aD(W.Y.getVideoData(1).videoId,k);W.T=eT(W.l8).trackData}},Bt=function(W,Y){var k=W.Y.getPlaylist(); if(k==null?0:k.listId){var P=k.index;var T=k.listId.toString()}k=W.Y.getVideoData(1);W.l8.playVideo(k.videoId,Y,P,T,k.playerParams,k.UP,gGB(k));W.AT(new g.zc(1))},YZc=function(W,Y){if(Y){var k=W.Y.getOption("captions","tracklist",{Wv:1}); k&&k.length?(W.Y.setOption("captions","track",Y),W.C=!1):(W.Y.loadModule("captions"),W.C=!0)}else W.Y.setOption("captions","track",{})},hc=function(W){return eT(W.l8).videoId===W.Y.getVideoData(1).videoId},$Op=function(W,Y){g.xM.call(this,W); this.W=Y},O8=function(){g.l.call(this,{S:"div", j:"ytp-mdx-popup-dialog",D:{role:"dialog"},B:[{S:"div",j:"ytp-mdx-popup-dialog-inner-content",B:[{S:"div",j:"ytp-mdx-popup-title",v6:"Saliste de tu cuenta"},{S:"div",j:"ytp-mdx-popup-description",v6:"Es posible que los videos que mires se agreguen al historial de reproducciones de la TV, lo que puede influir en las recomendaciones. Para que esto no suceda, presiona \u201cCancelar\u201d y accede a YouTube desde tu computadora."},{S:"div",j:"ytp-mdx-privacy-popup-buttons",B:[{S:"button",Ya:["ytp-button", "ytp-mdx-privacy-popup-cancel"],v6:"Cancelar"},{S:"button",Ya:["ytp-button","ytp-mdx-privacy-popup-confirm"],v6:"Confirmar"}]}]}]});this.fade=new g.cM(this,250);this.cancelButton=this.J5("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.J5("ytp-mdx-privacy-popup-confirm");g.v(this,this.fade);this.Z(this.cancelButton,"click",this.W);this.Z(this.confirmButton,"click",this.K)},uI=function(W){g.l.call(this,{S:"div", j:"ytp-remote",B:[{S:"div",j:"ytp-remote-display-status",B:[{S:"div",j:"ytp-remote-display-status-icon",B:[g.u5C()]},{S:"div",j:"ytp-remote-display-status-text",v6:"{{statustext}}"}]}]});this.api=W;this.fade=new g.cM(this,250);g.v(this,this.fade);this.Z(W,"presentingplayerstatechange",this.onStateChange);this.ZY(W.getPlayerStateObject())},ZH=function(W,Y){g.eo.call(this,"Reproducir en",1,W,Y); this.Y=W;this.SI={};this.Z(W,"onMdxReceiversChange",this.K);this.Z(W,"presentingplayerstatechange",this.K);this.K()},kyw=function(W){g.JJ.call(this,W); this.Jr={key:GSK(),name:"Esta computadora"};this.TC=null;this.subscriptions=[];this.kW=this.l8=null;this.SI=[this.Jr];this.L5=this.Jr;this.b7=new g.zc(64);this.sH=0;this.Yf=-1;this.Xh=!1;this.sA=this.OF=this.gY=null;if(!g.XF(this.player.V())&&!g.dq(this.player.V())){W=this.player;var Y=g.Fs(W);Y&&(Y=Y.ML())&&(Y=new ZH(W,Y),g.v(this,Y));Y=new uI(W);g.v(this,Y);g.aR(W,Y.element,4);this.gY=new O8;g.v(this,this.gY);g.aR(W,this.gY.element,4);this.Xh=!!k2()}},iI=function(W){W.OF&&(W.player.removeEventListener("presentingplayerstatechange", W.OF),W.OF=null)},Pdp=function(W,Y,k){W.b7=k; W.player.publish("presentingplayerstatechange",new g.T4(k,Y))},MY=function(W,Y){if(Y.key!==W.L5.key)if(Y.key===W.Jr.key)I6(); else if(VYQ(W)&&THc(W),W.L5=Y,!g.dq(W.player.V())){var k=W.player.getPlaylistId();var P=W.player.getVideoData(1);var T=P.videoId;if(!k&&!T||(W.player.getAppState()===2||W.player.getAppState()===1)&&W.player.V().U("should_clear_video_data_on_player_cued_unstarted"))P=null;else{var I=W.player.getPlaylist();if(I){var X=[];for(var h=0;h2*this.size&&IE(this),!0):!1}; g.R.get=function(W,Y){return Tq(this.K,W)?this.K[W]:Y}; g.R.set=function(W,Y){Tq(this.K,W)||(this.size+=1,this.W.push(W),this.bM++);this.K[W]=Y}; g.R.forEach=function(W,Y){for(var k=this.dU(),P=0;P=P.W.length)return g.OO;var I=P.W[Y++];return g.tL(W?I:P.K[I])}; return T}; var aJK={reh:"atp",BiD:"ska",Kgz:"que",cjz:"mus",Dhz:"sus",Haz:"dsp",tN5:"seq",V6D:"mic",Bsg:"dpa",ldJ:"mlm",DA2:"dsdtr",Kzi:"ntb",FOg:"vsp",hhJ:"scn",ir1:"rpe",jB5:"dcn",Zhg:"dcp",nkD:"pas",k95:"drq",JLP:"opf",Ldz:"els",cfi:"isg",Hr5:"svq",eOD:"mvp",r$z:"ads",ENz:"stcp",mhP:"sads",f6r:"dloc",V5r:"dcw",NcS:"asw",R_S:"apw",kCz:"pcw",o4h:"ipv"},Wrz={O8S:"u",PY1:"cl",Y3i:"k",RRD:"i",XlP:"cr",LmS:"m",oJ1:"g",vY:"up"},Q01={Az:"adPlaying",l1:"onAdStateChange"},y8K={i7i:"nowPlaying",TXS:"onStateChange", Az:"adPlaying",l1:"onAdStateChange",aT:"nowPlayingShorts",cI:"onShortsStateChange"},e$Q={aT:"nowPlayingShorts",cI:"onShortsStateChange"};Xf.prototype.equals=function(W){return W?this.id==W.id:!1}; var Alp="",Mh=null;g.H(QkK,g.DO);var qh,lVK=eB$("loadCastFramework")||eB$("loadCastApplicationFramework"),x8i=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.uQ(HY,g.e);g.R=HY.prototype;g.R.nV=function(W){this.T=arguments;this.W=!1;this.kq?this.J=g.Bp()+this.z9:this.kq=g.D4(this.C,this.z9)}; g.R.stop=function(){this.kq&&(g.V0.clearTimeout(this.kq),this.kq=null);this.J=null;this.W=!1;this.T=[]}; g.R.pause=function(){++this.K}; g.R.resume=function(){this.K&&(--this.K,!this.K&&this.W&&(this.W=!1,this.X.apply(null,this.T)))}; g.R.iz=function(){this.stop();HY.Ku.iz.call(this)}; g.R.sC=function(){this.kq&&(g.V0.clearTimeout(this.kq),this.kq=null);this.J?(this.kq=g.D4(this.C,this.J-g.Bp()),this.J=null):this.K?this.W=!0:(this.W=!1,this.X.apply(null,this.T))};n0.prototype.stringify=function(W){return g.V0.JSON.stringify(W,void 0)}; n0.prototype.parse=function(W){return g.V0.JSON.parse(W,void 0)};g.uQ(V0w,g.CH);g.uQ(ND1,g.CH);var aV9=null;g.uQ(YP9,g.CH);g.uQ($5B,g.CH);g.uQ(kXp,g.CH);Em.prototype.debug=function(){}; Em.prototype.info=function(){}; Em.prototype.warning=function(){};var Be1={},hbi={};g.R=JY.prototype;g.R.setTimeout=function(W){this.bz=W}; g.R.Xk=function(W){W=W.target;var Y=this.V5;Y&&g.Lv(W)==3?Y.n6():this.t8(W)}; g.R.t8=function(W){try{if(W==this.W)a:{var Y=g.Lv(this.W),k=this.W.K,P=this.W.getStatus();if(!(Y<3)&&(Y!=3||this.W&&(this.K.J||g.l3(this.W)||g.b3(this.W)))){this.OP||Y!=4||k==7||(k==8||P<=0?p0(3):p0(2));ZJc(this);var T=this.W.getStatus();this.A9=T;var I=SP9(this);if(this.X=T==200){if(this.K1&&!this.GJ){b:{if(this.W){var X=g.c9(this.W,"X-HTTP-Initial-Response");if(X&&!g.zm(X)){var h=X;break b}}h=null}if(W=h)this.GJ=!0,GXw(this,W);else{this.X=!1;this.C=3;Gq(12);rh(this);AY(this);break a}}if(this.TJ){W= !0;for(var B;!this.OP&&this.G0&&!this.J9&&(this.J9=!0,this.J.ra(this)):(rh(this),AY(this))}else GXw(this,I);Y==4&&rh(this);this.X&&!this.OP&&(Y==4?iJj(this.J,this):(this.X=!1,sm(this)))}else g.tDS(this.W),T==400&&I.indexOf("Unknown SID")> 0?(this.C=3,Gq(12)):(this.C=0,Gq(13)),rh(this),AY(this)}}}catch(O){}finally{}}; g.R.cancel=function(){this.OP=!0;rh(this)}; g.R.OC=function(){this.A5=null;var W=Date.now();W-this.e1>=0?(this.Fr!=2&&(p0(3),Gq(17)),rh(this),this.C=2,AY(this)):uH9(this,this.e1-W)}; g.R.getLastError=function(){return this.C}; g.R.Nj=function(){return this.W};Eu$.prototype.cancel=function(){this.J=syB(this);if(this.K)this.K.cancel(),this.K=null;else if(this.W&&this.W.size!==0){for(var W=g.p(this.W.values()),Y=W.next();!Y.done;Y=W.next())Y.value.cancel();this.W.clear()}};g.R=d5K.prototype;g.R.sj=8;g.R.z8=1;g.R.connect=function(W,Y,k,P){Gq(0);this.f1=W;this.OP=Y||{};k&&P!==void 0&&(this.OP.OSID=k,this.OP.OAID=P);this.GJ=this.D_;this.UP=HJp(this,null,this.f1);DF(this)}; g.R.disconnect=function(){D5w(this);if(this.z8==3){var W=this.rD++,Y=this.UP.clone();g.I2(Y,"SID",this.T);g.I2(Y,"RID",W);g.I2(Y,"TYPE","terminate");wh(this,Y);W=new JY(this,this.T,W);W.Fr=2;W.L=Yl(Y.clone());Y=!1;if(g.V0.navigator&&g.V0.navigator.sendBeacon)try{Y=g.V0.navigator.sendBeacon(W.L.toString(),"")}catch(k){}!Y&&g.V0.Image&&((new Image).src=W.L,Y=!0);Y||(W.W=ISh(W.J,null),W.W.send(W.L));W.wD=Date.now();sm(W)}ebB(this)}; g.R.Lu=function(){return this.z8==0}; g.R.getState=function(){return this.z8}; g.R.XF=function(W){if(this.X)if(this.X=null,this.z8==1){if(!W){this.rD=Math.floor(Math.random()*1E5);W=this.rD++;var Y=new JY(this,"",W),k=this.N;this.K1&&(k?(k=g.ij(k),g.tm(k,this.K1)):k=this.K1);this.G!==null||this.e1||(Y.UP=k,k=null);var P;if(this.Lg)a:{for(var T=P=0;T4096){P=T;break a}if(P===4096||T===this.J.length-1){P=T+1;break a}}P= 1E3}else P=1E3;P=w8j(this,Y,P);T=this.UP.clone();g.I2(T,"RID",W);g.I2(T,"CVER",22);this.TJ&&g.I2(T,"X-HTTP-Session-Id",this.TJ);wh(this,T);k&&(this.e1?P="headers="+g.JQ(g.QzX(k))+"&"+P:this.G&&g.BH(T,this.G,k));RbQ(this.K,Y);this.k8&&g.I2(T,"TYPE","init");this.Lg?(g.I2(T,"$req",P),g.I2(T,"SID","null"),Y.K1=!0,jyK(Y,T,null)):jyK(Y,T,P);this.z8=2}}else this.z8==3&&(W?Qyw(this,W):this.J.length==0||Jjh(this.K)||Qyw(this))}; g.R.Oj=function(){this.L=null;yji(this);if(this.KH&&!(this.bz||this.W==null||this.tT<=0)){var W=4*this.tT;this.gD=K0((0,g.Xz)(this.y9g,this),W)}}; g.R.y9g=function(){this.gD&&(this.gD=null,this.GJ=!1,this.bz=!0,Gq(10),dh(this),yji(this))}; g.R.ra=function(W){this.W==W&&this.KH&&!this.bz&&(m5i(this),this.bz=!0,Gq(11))}; g.R.Fk=function(){this.A5!=null&&(this.A5=null,dh(this),t5c(this),Gq(19))}; g.R.aga=function(W){W?Gq(2):Gq(1)}; g.R.isActive=function(){return!!this.C&&this.C.isActive(this)}; g.R=vu9.prototype;g.R.Gm=function(){}; g.R.q3=function(){}; g.R.Hg=function(){}; g.R.FF=function(){}; g.R.isActive=function(){return!0}; g.R.HN=function(){};g.uQ(yM,g.S2);yM.prototype.open=function(){this.W.C=this.J;this.X&&(this.W.Fr=!0);this.W.connect(this.C,this.K||void 0)}; yM.prototype.close=function(){this.W.disconnect()}; yM.prototype.send=function(W){var Y=this.W;if(typeof W==="string"){var k={};k.__data__=W;W=k}else this.T&&(k={},k.__data__=g.Qx(W),W=k);Y.J.push(new Kdh(Y.rV++,W));Y.z8==3&&DF(Y)}; yM.prototype.iz=function(){this.W.C=null;delete this.J;this.W.disconnect();delete this.W;yM.Ku.iz.call(this)}; g.uQ(LdQ,V0w);g.uQ(U5p,ND1);g.uQ(QM,vu9);QM.prototype.Gm=function(){this.W.dispatchEvent("m")}; QM.prototype.q3=function(W){this.W.dispatchEvent(new LdQ(W))}; QM.prototype.Hg=function(W){this.W.dispatchEvent(new U5p(W))}; QM.prototype.FF=function(){this.W.dispatchEvent("n")}; lSN.prototype.commit=function(W){this.W.A9=W};var oE=new g.S2;g.H(cjQ,g.CH);g.R=C0.prototype;g.R.zT=null;g.R.xB=!1;g.R.rp=null;g.R.rE=null;g.R.mJ=null;g.R.Tx=null;g.R.H1=null;g.R.p6=null;g.R.Ah=null;g.R.YZ=null;g.R.Sv=0;g.R.Cx=null;g.R.oW=null;g.R.Wr=null;g.R.GF=-1;g.R.Pt=!0;g.R.qd=!1;g.R.VX=0;g.R.J2=null;var Wgh={},aS9={};g.R=C0.prototype;g.R.setTimeout=function(W){this.K=W}; g.R.Ga=function(W){W=W.target;var Y=this.J2;Y&&g.Lv(W)==3?Y.n6():this.ID(W)}; g.R.ID=function(W){try{if(W==this.YZ)a:{var Y=g.Lv(this.YZ),k=this.YZ.K,P=this.YZ.getStatus();if(g.Sh&&!g.yg("420+")){if(Y<4)break a}else if(Y<3||Y==3&&!g.l3(this.YZ))break a;this.qd||Y!=4||k==7||(k==8||P<=0?this.W.N8(3):this.W.N8(2));k_N(this);var T=this.YZ.getStatus();this.GF=T;var I=g.l3(this.YZ);if(this.xB=T==200){Y==4&&L0(this);if(this.TJ){for(W=!0;!this.qd&&this.Sv0?(this.Wr=3,vY(13)):(this.Wr=0,vY(14)),L0(this),Puj(this)}}catch(h){}finally{}}; g.R.cancel=function(){this.qd=!0;L0(this)}; g.R.qN=function(){this.rp=null;var W=Date.now();W-this.rE>=0?(this.Tx!=2&&this.W.N8(3),L0(this),this.Wr=2,vY(18),Puj(this)):$PB(this,this.rE-W)}; g.R.getLastError=function(){return this.Wr};g.R=Xww.prototype;g.R.NZ=null;g.R.pL=null;g.R.PJ=!1;g.R.aV=null;g.R.AL=null;g.R.Ad=-1;g.R.C6=null;g.R.Gf=null;g.R.connect=function(W){this.aV=W;W=lv(this.W,null,this.aV);vY(3);Date.now();var Y=this.W.N;Y!=null?(this.C6=Y[0],(this.Gf=Y[1])?(this.AL=1,Sjw(this)):(this.AL=2,h$1(this))):($l(W,"MODE","init"),this.pL=new C0(this),this.pL.zT=this.NZ,V5z(this.pL,W,!1,null,!0),this.AL=0)}; g.R.Qh=function(W){if(W)this.AL=2,h$1(this);else{vY(4);var Y=this.W;Y.u4=Y.eD.Ad;f0(Y,9)}W&&this.N8(2)}; g.R.RV=function(W){return this.W.RV(W)}; g.R.abort=function(){this.pL&&(this.pL.cancel(),this.pL=null);this.Ad=-1}; g.R.Lu=function(){return!1}; g.R.xz=function(W,Y){this.Ad=W.GF;if(this.AL==0)if(Y){try{var k=this.K.parse(Y)}catch(P){W=this.W;W.u4=this.Ad;f0(W,2);return}this.C6=k[0];this.Gf=k[1]}else W=this.W,W.u4=this.Ad,f0(W,2);else this.AL==2&&(this.PJ?(vY(7),Date.now()):Y=="11111"?(vY(6),this.PJ=!0,Date.now(),this.Ad=200,this.pL.cancel(),vY(12),bv(this.W,this,!0)):(vY(8),Date.now(),this.PJ=!1))}; g.R.bO=function(){this.Ad=this.pL.GF;if(this.pL.xB)this.AL==0?this.Gf?(this.AL=1,Sjw(this)):(this.AL=2,h$1(this)):this.AL==2&&(this.PJ?(vY(12),bv(this.W,this,!0)):(vY(11),bv(this.W,this,!1)));else{this.AL==0?vY(9):this.AL==2&&vY(10);var W=this.W;this.pL.getLastError();W.u4=this.Ad;f0(W,2)}}; g.R.I8=function(){return this.W.I8()}; g.R.isActive=function(){return this.W.isActive()}; g.R.N8=function(W){this.W.N8(W)};g.R=BSc.prototype;g.R.yy=null;g.R.xw=null;g.R.Oq=null;g.R.Ks=null;g.R.lO=null;g.R.gr=null;g.R.j4=null;g.R.Eu=null;g.R.jw=0;g.R.IK=0;g.R.WU=null;g.R.jD=null;g.R.yx=null;g.R.K4=null;g.R.eD=null;g.R.Yx=null;g.R.E4=-1;g.R.ZZ=-1;g.R.u4=-1;g.R.ao=0;g.R.Ro=0;g.R.yw=8;var jac={OK:0,Tia:2,ZLD:4,PEg:5,sA2:6,STOP:7,b1:8,aJP:9,RH5:10,bna:11,bsg:12};g.uQ(uJB,g.CH);g.uQ(ZQ$,g.CH);g.R=BSc.prototype; g.R.connect=function(W,Y,k,P,T){vY(0);this.lO=Y;this.xw=k||{};P&&T!==void 0&&(this.xw.OSID=P,this.xw.OAID=T);this.L?(eg((0,g.Xz)(this.hB,this,W),100),Mrc(this)):this.hB(W)}; g.R.disconnect=function(){trj(this);if(this.W==3){var W=this.jw++,Y=this.gr.clone();g.I2(Y,"SID",this.T);g.I2(Y,"RID",W);g.I2(Y,"TYPE","terminate");xl(this,Y);W=new C0(this,this.T,W);W.Tx=2;W.H1=Yl(Y.clone());(new Image).src=W.H1.toString();W.mJ=Date.now();Neh(W)}s0B(this)}; g.R.hB=function(W){this.eD=new Xww(this);this.eD.NZ=this.yy;this.eD.K=this.C;this.eD.connect(W)}; g.R.Lu=function(){return this.W==0}; g.R.getState=function(){return this.W}; g.R.kz=function(W){this.jD=null;pwj(this,W)}; g.R.fD=function(){this.yx=null;this.Ks=new C0(this,this.T,"rpc",this.G);this.Ks.zT=this.yy;this.Ks.VX=0;var W=this.j4.clone();g.I2(W,"RID","rpc");g.I2(W,"SID",this.T);g.I2(W,"CI",this.Yx?"0":"1");g.I2(W,"AID",this.E4);xl(this,W);g.I2(W,"TYPE","xmlhttp");V5z(this.Ks,W,!0,this.Eu,!1)}; g.R.xz=function(W,Y){if(this.W!=0&&(this.Ks==W||this.Oq==W))if(this.u4=W.GF,this.Oq==W&&this.W==3)if(this.yw>7){try{var k=this.C.parse(Y)}catch(P){k=null}if(Array.isArray(k)&&k.length==3)if(W=k,W[0]==0)a:{if(!this.yx){if(this.Ks)if(this.Ks.mJ+3E30)){if(P=Y==1)this.Oq||this.jD||this.W==1||this.ao>=2?P=!1:(this.jD=eg((0,g.Xz)(this.kz,this,W),KgQ(this,this.ao)),this.ao++, P=!0);P=!(P||Y==2&&E4K(this))}if(P)switch(k){case 1:f0(this,5);break;case 4:f0(this,10);break;case 3:f0(this,6);break;case 7:f0(this,12);break;default:f0(this,2)}}}; g.R.m0=function(W){if(!g.n$(arguments,this.W))throw Error("Unexpected channel state: "+this.W);}; g.R.bu5=function(W){W?vY(2):(vY(1),J8i(this,8))}; g.R.RV=function(W){if(W)throw Error("Can't create secondary domain capable XhrIo object.");W=new g.ox;W.G=!1;return W}; g.R.isActive=function(){return!!this.WU&&this.WU.isActive(this)}; g.R.N8=function(W){var Y=oE;Y.dispatchEvent(new ZQ$(Y,W))}; g.R.I8=function(){return!1}; g.R=r8$.prototype;g.R.Bg=function(){}; g.R.Q1=function(){}; g.R.dj=function(){}; g.R.DZ=function(){}; g.R.eQ=function(){}; g.R.V1=function(){return{}}; g.R.isActive=function(){return!0};g.R=A8w.prototype;g.R.enqueue=function(W){this.K.push(W)}; g.R.isEmpty=function(){return this.W.length===0&&this.K.length===0}; g.R.clear=function(){this.W=[];this.K=[]}; g.R.contains=function(W){return g.n$(this.W,W)||g.n$(this.K,W)}; g.R.remove=function(W){var Y=this.W;var k=(0,g.XkK)(Y,W);k>=0?(g.p$(Y,k),Y=!0):Y=!1;return Y||g.GK(this.K,W)}; g.R.F7=function(){for(var W=[],Y=this.W.length-1;Y>=0;--Y)W.push(this.W[Y]);Y=this.K.length;for(var k=0;k=IMh.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(W=IMh[this.K],this.kq=g.Ii((0,g.Xz)(this.Fy,this),W),this.K++):this.publish("pairingFailed",Error("Server error "+W.status))}; g.R.Q6=function(){this.W=null;this.publish("pairingFailed",Error("Server not responding"))}; var IMh=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.uQ(ST,IZ);g.R=ST.prototype;g.R.start=function(){Xj(this)&&this.publish("screenChange");!g.Es("yt-remote-lounge-token-expiration")&&hfj(this);g.SU(this.W);this.W=g.Ii((0,g.Xz)(this.start,this),1E4)}; g.R.add=function(W,Y){Xj(this);jBN(this,W);hF(this,!1);this.publish("screenChange");Y(W);W.token||hfj(this)}; g.R.remove=function(W,Y){var k=Xj(this);XA9(this,W)&&(hF(this,!1),k=!0);Y(W);k&&this.publish("screenChange")}; g.R.gE=function(W,Y,k,P){var T=Xj(this),I=this.get(W.id);I?(I.name!=Y&&(I.name=Y,hF(this,!1),T=!0),k(W)):P(Error("no such local screen."));T&&this.publish("screenChange")}; g.R.iz=function(){g.SU(this.W);ST.Ku.iz.call(this)}; g.R.Mn=function(W){Xj(this);var Y=this.screens.length;W=W&&W.screens||[];for(var k=W.length,P=0;P20)break a;h=Y(I,X)}I=h}T.name=I}k(uM(this,T))},this), onError:(0,g.Xz)(function(T){P(Error("pairing request failed: "+T.status))},this), onTimeout:(0,g.Xz)(function(){P(Error("pairing request timed out."))},this)})}; g.R.iz=function(){g.Wu(this.K);g.Wu(this.W);OR.Ku.iz.call(this)}; g.R.pj=function(){pA$(this);this.publish("screenChange");this.W.update()}; OR.prototype.dispose=OR.prototype.dispose;g.uQ(ZL,g.NR);g.R=ZL.prototype;g.R.Qb=function(W){this.Xr()||(W&&(Mz(this,""+W),this.publish("sessionFailed")),this.W=null,this.publish("sessionScreen",null))}; g.R.info=function(W){$C(this.TJ,W)}; g.R.N3=function(){return null}; g.R.Hc=function(W){var Y=this.K;W?(Y.displayStatus=new chrome.cast.ReceiverDisplayStatus(W,[]),Y.displayStatus.showStop=!0):Y.displayStatus=null;chrome.cast.setReceiverDisplayStatus(Y,(0,g.Xz)(function(){this.info("Updated receiver status for "+Y.friendlyName+": "+W)},this),(0,g.Xz)(function(){Mz(this,"Failed to update receiver status for: "+Y.friendlyName)},this))}; g.R.iz=function(){this.Hc("");ZL.Ku.iz.call(this)};g.H(tF,ZL);g.R=tF.prototype;g.R.Xm=function(W){if(this.J){if(this.J==W)return;Mz(this,"Overriding cast session with new session object");gjc(this);this.wD=!1;this.N="unknown";this.J.removeUpdateListener(this.Kg);this.J.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.gD)}this.J=W;this.J.addUpdateListener(this.Kg);this.J.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.gD);AI9(this,"getMdxSessionStatus")}; g.R.xs=function(W){this.info("launchWithParams no-op for Cast: "+g.Qx(W))}; g.R.stop=function(){this.J?this.J.stop((0,g.Xz)(function(){this.Qb()},this),(0,g.Xz)(function(){this.Qb(Error("Failed to stop receiver app."))},this)):this.Qb(Error("Stopping cast device without session."))}; g.R.Hc=function(){}; g.R.iz=function(){this.info("disposeInternal");gjc(this);this.J&&(this.J.removeUpdateListener(this.Kg),this.J.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.gD));this.J=null;ZL.prototype.iz.call(this)}; g.R.bq1=function(W,Y){if(!this.Xr())if(Y)if(Y=kl(Y),g.Pp(Y))switch(W=""+Y.type,Y=Y.data||{},this.info("onYoutubeMessage_: "+W+" "+g.Qx(Y)),W){case "mdxSessionStatus":JIK(this,Y);break;case "loungeToken":zfN(this,Y);break;default:Mz(this,"Unknown youtube message: "+W)}else Mz(this,"Unable to parse message.");else Mz(this,"No data in message.")}; g.R.nQ=function(W,Y,k,P){g.SU(this.L);this.L=0;Rfj(this.T,this.K.label,W,this.K.friendlyName,(0,g.Xz)(function(T){T?Y(T):P>=0?(Mz(this,"Screen "+W+" appears to be offline. "+P+" retries left."),this.L=g.Ii((0,g.Xz)(this.nQ,this,W,Y,k,P-1),300)):k(Error("Unable to fetch screen."))},this),k)}; g.R.N3=function(){return this.J}; g.R.dF=function(W){this.Xr()||W||(Mz(this,"Cast session died."),this.Qb())};g.H(qz,ZL);g.R=qz.prototype;g.R.Xm=function(W){this.J=W;this.J.addUpdateListener(this.OP)}; g.R.xs=function(W){this.UP=W;this.A5()}; g.R.stop=function(){C$K(this);this.J?this.J.stop((0,g.Xz)(this.Qb,this,null),(0,g.Xz)(this.Qb,this,"Failed to stop DIAL device.")):this.Qb()}; g.R.iz=function(){C$K(this);this.J&&this.J.removeUpdateListener(this.OP);this.J=null;ZL.prototype.iz.call(this)}; g.R.V6=function(W){this.Xr()||W||(Mz(this,"DIAL session died."),this.C(),this.C=function(){},this.Qb())};g.H(nw,ZL);nw.prototype.stop=function(){this.Qb()}; nw.prototype.Xm=function(){}; nw.prototype.xs=function(){g.SU(this.J);this.J=NaN;var W=Om(this.T.FZ(),this.K.label);W?iM(this,W):this.Qb(Error("No such screen"))}; nw.prototype.iz=function(){g.SU(this.J);this.J=NaN;ZL.prototype.iz.call(this)};g.H(pw,g.NR);g.R=pw.prototype; g.R.init=function(W,Y){chrome.cast.timeout.requestSession=3E4;var k=new chrome.cast.SessionRequest(this.L,[chrome.cast.Capability.AUDIO_OUT]);g.Oi("desktop_enable_cast_connect")&&(k.androidReceiverCompatible=!0);this.N||(k.dialRequest=new chrome.cast.DialRequest("YouTube"));var P=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;W=W||this.X?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var T=(0,g.Xz)(this.Loh,this);k=new chrome.cast.ApiConfig(k,(0,g.Xz)(this.cj, this),T,P,W);k.customDialLaunchCallback=(0,g.Xz)(this.YRP,this);chrome.cast.initialize(k,(0,g.Xz)(function(){this.Xr()||(chrome.cast.addReceiverActionListener(this.C),$li(),this.K.subscribe("onlineScreenChange",(0,g.Xz)(this.bU,this)),this.J=lgK(this),chrome.cast.setCustomReceivers(this.J,function(){},(0,g.Xz)(function(I){this.UE("Failed to set initial custom receivers: "+g.Qx(I))},this)),this.publish("yt-remote-cast2-availability-change",Kw(this)),Y(!0))},this),(0,g.Xz)(function(I){this.UE("Failed to initialize API: "+ g.Qx(I)); Y(!1)},this))}; g.R.wkg=function(W,Y){GE("Setting connected screen ID: "+W+" -> "+Y);if(this.W){var k=this.W.W;if(!W||k&&k.id!=W)GE("Unsetting old screen status: "+this.W.K.friendlyName),ER(this,null)}if(W&&Y){if(!this.W){W=Om(this.K.FZ(),W);if(!W){GE("setConnectedScreenStatus: Unknown screen.");return}if(W.idType=="shortLived"){GE("setConnectedScreenStatus: Screen with id type to be short lived.");return}k=Lpi(this,W);k||(GE("setConnectedScreenStatus: Connected receiver not custom..."),k=new chrome.cast.Receiver(W.uuid? W.uuid:W.id,W.name),k.receiverType=chrome.cast.ReceiverType.CUSTOM,this.J.push(k),chrome.cast.setCustomReceivers(this.J,function(){},(0,g.Xz)(function(P){this.UE("Failed to set initial custom receivers: "+g.Qx(P))},this))); GE("setConnectedScreenStatus: new active receiver: "+k.friendlyName);ER(this,new nw(this.K,k),!0)}this.W.Hc(Y)}else GE("setConnectedScreenStatus: no screen.")}; g.R.oH6=function(W){this.Xr()?this.UE("Setting connection data on disposed cast v2"):this.W?this.W.xs(W):this.UE("Setting connection data without a session")}; g.R.RK=function(){this.Xr()?this.UE("Stopping session on disposed cast v2"):this.W?(this.W.stop(),ER(this,null)):GE("Stopping non-existing session")}; g.R.requestSession=function(){chrome.cast.requestSession((0,g.Xz)(this.cj,this),(0,g.Xz)(this.UtS,this))}; g.R.iz=function(){this.K.unsubscribe("onlineScreenChange",(0,g.Xz)(this.bU,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.C);var W=aKw,Y=g.Wp("yt.mdx.remote.debug.handlers_");g.GK(Y||[],W);g.Wu(this.W);g.NR.prototype.iz.call(this)}; g.R.UE=function(W){$C("Controller",W)}; g.R.hK=function(W,Y){this.W==W&&(Y||ER(this,null),this.publish("yt-remote-cast2-session-change",Y))}; g.R.lYr=function(W,Y){if(!this.Xr())if(W)switch(W.friendlyName=chrome.cast.unescape(W.friendlyName),GE("onReceiverAction_ "+W.label+" / "+W.friendlyName+"-- "+Y),Y){case chrome.cast.ReceiverAction.CAST:if(this.W)if(this.W.K.label!=W.label)GE("onReceiverAction_: Stopping active receiver: "+this.W.K.friendlyName),this.W.stop();else{GE("onReceiverAction_: Casting to active receiver.");this.W.W&&this.publish("yt-remote-cast2-session-change",this.W.W);break}switch(W.receiverType){case chrome.cast.ReceiverType.CUSTOM:ER(this, new nw(this.K,W));break;case chrome.cast.ReceiverType.DIAL:ER(this,new qz(this.K,W,this.T,this.config_));break;case chrome.cast.ReceiverType.CAST:ER(this,new tF(this.K,W,this.config_));break;default:this.UE("Unknown receiver type: "+W.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.W&&this.W.K.label==W.label?this.W.stop():this.UE("Stopping receiver w/o session: "+W.friendlyName)}else this.UE("onReceiverAction_ called without receiver.")}; g.R.YRP=function(W){if(this.Xr())return Promise.reject(Error("disposed"));var Y=W.receiver;Y.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.UE("Not DIAL receiver: "+Y.friendlyName),Y.receiverType=chrome.cast.ReceiverType.DIAL);var k=this.W?this.W.K:null;if(!k||k.label!=Y.label)return this.UE("Receiving DIAL launch request for non-clicked DIAL receiver: "+Y.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(k&&k.label==Y.label&&k.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.W.W)return GE("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.W.W),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.UE('Changing CAST intent from "'+k.receiverType+'" to "dial" for '+Y.friendlyName);ER(this,new qz(this.K,Y,this.T,this.config_))}Y=this.W;Y.L=W;Y.L.appState==chrome.cast.DialAppState.RUNNING?(W=Y.L.extraData||{},k=W.screenId||null,RZ(Y)&&W.loungeToken?W.loungeTokenRefreshIntervalMs?W=efN(Y,{name:Y.K.friendlyName,screenId:W.screenId,loungeToken:W.loungeToken,dialId:Y.L.receiver.label, screenIdType:"shortLived"},W.loungeTokenRefreshIntervalMs):(g.CI(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(W)+".")),W=ojK(Y,k)):W=ojK(Y,k)):W=QBB(Y);return W}; g.R.cj=function(W){var Y=this;if(!this.Xr()&&!this.X){GE("New cast session ID: "+W.sessionId);var k=W.receiver;if(k.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.W)if(k.receiverType==chrome.cast.ReceiverType.CAST)GE("Got resumed cast session before resumed mdx connection."),k.friendlyName=chrome.cast.unescape(k.friendlyName),ER(this,new tF(this.K,k,this.config_),!0);else{this.UE("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var P=this.W.K,T=Om(this.K.FZ(), P.label);T&&hY(T,k.label)&&P.receiverType!=chrome.cast.ReceiverType.CAST&&k.receiverType==chrome.cast.ReceiverType.CAST&&(GE("onSessionEstablished_: manual to cast session change "+k.friendlyName),g.Wu(this.W),this.W=new tF(this.K,k,this.config_),this.W.subscribe("sessionScreen",(0,g.Xz)(this.hK,this,this.W)),this.W.subscribe("sessionFailed",function(){return Ulj(Y,Y.W)}),this.W.xs(null)); this.W.Xm(W)}}}; g.R.rF=function(){return this.W?this.W.N3():null}; g.R.UtS=function(W){this.Xr()||(this.UE("Failed to estabilish a session: "+g.Qx(W)),W.code!=chrome.cast.ErrorCode.CANCEL&&ER(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.R.Loh=function(W){GE("Receiver availability updated: "+W);if(!this.Xr()){var Y=Kw(this);this.G=W==chrome.cast.ReceiverAvailability.AVAILABLE;Kw(this)!=Y&&this.publish("yt-remote-cast2-availability-change",Kw(this))}}; g.R.bU=function(){this.Xr()||(this.J=lgK(this),GE("Updating custom receivers: "+g.Qx(this.J)),chrome.cast.setCustomReceivers(this.J,function(){},(0,g.Xz)(function(){this.UE("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",Kw(this)))}; pw.prototype.setLaunchParams=pw.prototype.oH6;pw.prototype.setConnectedScreenStatus=pw.prototype.wkg;pw.prototype.stopSession=pw.prototype.RK;pw.prototype.getCastSession=pw.prototype.rF;pw.prototype.requestSession=pw.prototype.requestSession;pw.prototype.init=pw.prototype.init;pw.prototype.dispose=pw.prototype.dispose;var XMN=g.iF(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),$RN=[],agh=g.Vg(XMN);g.R=mI.prototype; g.R.reset=function(W){this.listId="";this.index=-1;this.videoId="";XJN(this);this.volume=-1;this.muted=!1;W&&(this.index=W.index,this.listId=W.listId,this.videoId=W.videoId,this.playerState=W.playerState,this.volume=W.volume,this.muted=W.muted,this.audioTrackId=W.audioTrackId,this.trackData=W.trackData,this.EK=W.hasPrevious,this.Gg=W.hasNext,this.X=W.playerTime,this.C=W.playerTimeAt,this.K=W.seekableStart,this.G=W.seekableEnd,this.J=W.duration,this.L=W.loadedTime,this.W=W.liveIngestionTime,this.T= !isNaN(this.W))}; g.R.isPlaying=function(){return this.playerState==1}; g.R.isBuffering=function(){return this.playerState==3}; g.R.Nv=function(W){this.J=isNaN(W)?0:W}; g.R.getDuration=function(){return this.T?this.J+DL(this):this.J}; g.R.clone=function(){return new mI(hWK(this))};g.H(y6,g.NR);g.R=y6.prototype;g.R.getState=function(){return this.J}; g.R.Cy=function(){return this.T.getReconnectTimeout()}; g.R.lK=function(){this.T.reconnect()}; g.R.play=function(){oZ(this)?(this.W?this.W.play(null,g.ds,UR(this,"play")):Lw(this,"play"),uej(this,1,Fj(eT(this))),this.publish("remotePlayerChange")):vc(this,this.play)}; g.R.pause=function(){oZ(this)?(this.W?this.W.pause(null,g.ds,UR(this,"pause")):Lw(this,"pause"),uej(this,2,Fj(eT(this))),this.publish("remotePlayerChange")):vc(this,this.pause)}; g.R.seekTo=function(W){if(oZ(this)){if(this.W){var Y=eT(this),k=new chrome.cast.media.SeekRequest;k.currentTime=W;Y.isPlaying()||Y.isBuffering()?k.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:k.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.W.seek(k,g.ds,UR(this,"seekTo",{newTime:W}))}else Lw(this,"seekTo",{newTime:W});uej(this,3,W);this.publish("remotePlayerChange")}else vc(this,g.hN(this.seekTo,W))}; g.R.stop=function(){if(oZ(this)){this.W?this.W.stop(null,g.ds,UR(this,"stopVideo")):Lw(this,"stopVideo");var W=eT(this);W.index=-1;W.videoId="";XJN(W);Cw(this,W);this.publish("remotePlayerChange")}else vc(this,this.stop)}; g.R.setVolume=function(W,Y){if(oZ(this)){var k=eT(this);if(this.K){if(k.volume!=W){var P=Math.round(W)/100;this.K.setReceiverVolumeLevel(P,(0,g.Xz)(function(){kC("set receiver volume: "+P)},this),(0,g.Xz)(function(){this.UE("failed to set receiver volume.")},this))}k.muted!=Y&&this.K.setReceiverMuted(Y,(0,g.Xz)(function(){kC("set receiver muted: "+Y)},this),(0,g.Xz)(function(){this.UE("failed to set receiver muted.")},this))}else{var T={volume:W, muted:Y};k.volume!=-1&&(T.delta=W-k.volume);Lw(this,"setVolume",T)}k.muted=Y;k.volume=W;Cw(this,k)}else vc(this,g.hN(this.setVolume,W,Y))}; g.R.aD=function(W,Y){if(oZ(this)){var k=eT(this);W={videoId:W};Y&&(k.trackData={trackName:Y.name,languageCode:Y.languageCode,sourceLanguageCode:Y.translationLanguage?Y.translationLanguage.languageCode:"",languageName:Y.languageName,kind:Y.kind},W.style=g.Qx(Y.style),g.tm(W,k.trackData));Lw(this,"setSubtitlesTrack",W);Cw(this,k)}else vc(this,g.hN(this.aD,W,Y))}; g.R.setAudioTrack=function(W,Y){oZ(this)?(Y=Y.getLanguageInfo().getId(),Lw(this,"setAudioTrack",{videoId:W,audioTrackId:Y}),W=eT(this),W.audioTrackId=Y,Cw(this,W)):vc(this,g.hN(this.setAudioTrack,W,Y))}; g.R.playVideo=function(W,Y,k,P,T,I,X){P=P===void 0?null:P;T=T===void 0?null:T;I=I===void 0?null:I;X=X===void 0?null:X;var h=eT(this),B={videoId:W};k!==void 0&&(B.currentIndex=k);w1(h,W,k||0);Y!==void 0&&(g1(h,Y),B.currentTime=Y);P&&(B.listId=P);T&&(B.playerParams=T);I&&(B.clickTrackingParams=I);X&&(B.locationInfo=g.Qx(X));Lw(this,"setPlaylist",B);P||Cw(this,h)}; g.R.My=function(W,Y){if(oZ(this)){if(W&&Y){var k=eT(this);w1(k,W,Y);Cw(this,k)}Lw(this,"previous")}else vc(this,g.hN(this.My,W,Y))}; g.R.nextVideo=function(W,Y){if(oZ(this)){if(W&&Y){var k=eT(this);w1(k,W,Y);Cw(this,k)}Lw(this,"next")}else vc(this,g.hN(this.nextVideo,W,Y))}; g.R.yd=function(){if(oZ(this)){Lw(this,"clearPlaylist");var W=eT(this);W.reset();Cw(this,W);this.publish("remotePlayerChange")}else vc(this,this.yd)}; g.R.YK=function(){oZ(this)?Lw(this,"dismissAutoplay"):vc(this,this.YK)}; g.R.dispose=function(){if(this.J!=3){var W=this.J;this.J=3;this.publish("proxyStateChange",W,this.J)}g.NR.prototype.dispose.call(this)}; g.R.iz=function(){OxK(this);this.T=null;this.C.clear();Q6(this,null);g.NR.prototype.iz.call(this)}; g.R.Ix=function(W){if((W!=this.J||W==2)&&this.J!=3&&W!=0){var Y=this.J;this.J=W;this.publish("proxyStateChange",Y,W);if(W==1)for(;!this.C.isEmpty();)Y=W=this.C,Y.W.length===0&&(Y.W=Y.K,Y.W.reverse(),Y.K=[]),W.W.pop().apply(this);else W==3&&this.dispose()}}; g.R.bH5=function(W,Y){this.publish(W,Y)}; g.R.P8P=function(W){if(!W)this.Mk(null),Q6(this,null);else if(this.K.receiver.volume){W=this.K.receiver.volume;var Y=eT(this),k=Math.round(100*W.level||0);if(Y.volume!=k||Y.muted!=W.muted)kC("Cast volume update: "+W.level+(W.muted?" muted":"")),Y.volume=k,Y.muted=!!W.muted,Cw(this,Y)}}; g.R.Mk=function(W){kC("Cast media: "+!!W);this.W&&this.W.removeUpdateListener(this.L);if(this.W=W)this.W.addUpdateListener(this.L),Zxi(this),this.publish("remotePlayerChange")}; g.R.i15=function(W){W?(Zxi(this),this.publish("remotePlayerChange")):this.Mk(null)}; g.R.pz=function(){Lw(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.R.J9J=function(){var W=Tjj();W&&Q6(this,W)}; g.R.UE=function(W){$C("CP",W)};g.H(cc,g.NR);g.R=cc.prototype; g.R.connect=function(W,Y){if(Y){var k=Y.listId,P=Y.videoId,T=Y.videoIds,I=Y.playerParams,X=Y.clickTrackingParams,h=Y.index,B={videoId:P},O=Y.currentTime,u=Y.locationInfo;Y=Y.loopMode;O!==void 0&&(B.currentTime=O<=5?0:O);I&&(B.playerParams=I);u&&(B.locationInfo=u);X&&(B.clickTrackingParams=X);k&&(B.listId=k);T&&T.length>0&&(B.videoIds=T.join(","));h!==void 0&&(B.currentIndex=h);this.OP&&(B.loopMode=Y||"LOOP_MODE_OFF");k&&(this.W.listId=k);this.W.videoId=P;this.W.index=h||0;this.W.state=3;g1(this.W, O);this.C="UNSUPPORTED";k=this.OP?"setInitialState":"setPlaylist";lM("Connecting with "+k+" and params: "+g.Qx(B));this.K.connect({method:k,params:g.Qx(B)},W,d8N())}else lM("Connecting without params"),this.K.connect({},W,d8N());q5c(this)}; g.R.C5=function(W){this.K.C5(W)}; g.R.dispose=function(){this.Xr()||(g.N6("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),bM(this,3));g.NR.prototype.dispose.call(this)}; g.R.iz=function(){RWB(this);nxc(this);HxB(this);g.SU(this.L);this.L=NaN;g.SU(this.N);this.N=NaN;this.T=null;g.iC(this.A5);this.A5.length=0;this.K.dispose();g.NR.prototype.iz.call(this);this.C=this.G=this.J=this.W=this.K=null}; g.R.o2=function(W){if(!this.J||this.J.length===0)return!1;for(var Y=g.p(this.J),k=Y.next();!k.done;k=Y.next())if(!k.value.capabilities.has(W))return!1;return!0}; g.R.m3=function(){var W=3;this.Xr()||(W=0,isNaN(this.dH())?this.K.QY()&&isNaN(this.X)&&(W=1):W=2);return W}; g.R.FM=function(W){lM("Disconnecting with "+W);g.N6("yt.mdx.remote.remoteClient_",null);RWB(this);this.publish("beforeDisconnect",W);W==1&&iv();this.K.disconnect(W);this.dispose()}; g.R.Ok=function(){var W=this.W;this.T&&(W=this.W.clone(),w1(W,this.T,W.index));return hWK(W)}; g.R.gHg=function(W){var Y=this,k=new mI(W);k.videoId&&k.videoId!=this.W.videoId&&(this.T=k.videoId,g.SU(this.L),this.L=g.Ii(function(){if(Y.T){var T=Y.T;Y.T=null;Y.W.videoId!=T&&xC(Y,"getNowPlaying")}},5E3)); var P=[];this.W.listId==k.listId&&this.W.videoId==k.videoId&&this.W.index==k.index||P.push("remoteQueueChange");this.W.playerState==k.playerState&&this.W.volume==k.volume&&this.W.muted==k.muted&&Fj(this.W)==Fj(k)&&g.Qx(this.W.trackData)==g.Qx(k.trackData)||P.push("remotePlayerChange");this.W.reset(W);g.xh(P,function(T){this.publish(T)},this)}; g.R.Sd=function(){var W=this.K.getDeviceId(),Y=g.qc(this.J,function(k){return k.type=="REMOTE_CONTROL"&&k.id!=W}); return Y?Y.id:""}; g.R.dH=function(){return this.K.Cy()}; g.R.yT=function(){return this.C||"UNSUPPORTED"}; g.R.KO=function(){return this.G||""}; g.R.NN=function(){!isNaN(this.dH())&&this.K.lK()}; g.R.KW1=function(W,Y){xC(this,W,Y);GH$(this)}; g.R.Ej=function(){var W=g.rn("SAPISID","")||g.rn("__Secure-1PAPISID")||"",Y=g.rn("__Secure-3PAPISID","")||"";if(!W&&!Y)return"";W=g.Jx(g.E$(W),2);Y=g.Jx(g.E$(Y),2);return g.Jx(g.E$(","+W+","+Y),2)}; cc.prototype.subscribe=cc.prototype.subscribe;cc.prototype.unsubscribeByKey=cc.prototype.MI;cc.prototype.getProxyState=cc.prototype.m3;cc.prototype.disconnect=cc.prototype.FM;cc.prototype.getPlayerContextData=cc.prototype.Ok;cc.prototype.setPlayerContextData=cc.prototype.gHg;cc.prototype.getOtherConnectedRemoteId=cc.prototype.Sd;cc.prototype.getReconnectTimeout=cc.prototype.dH;cc.prototype.getAutoplayMode=cc.prototype.yT;cc.prototype.getAutoplayVideoId=cc.prototype.KO;cc.prototype.reconnect=cc.prototype.NN; cc.prototype.sendMessage=cc.prototype.KW1;cc.prototype.getXsrfToken=cc.prototype.Ej;cc.prototype.isCapabilitySupportedOnConnectedDevices=cc.prototype.o2;g.H(FSh,IZ);g.R=FSh.prototype;g.R.FZ=function(W){return this.u_.$_gs(W)}; g.R.contains=function(W){return!!this.u_.$_c(W)}; g.R.get=function(W){return this.u_.$_g(W)}; g.R.start=function(){this.u_.$_st()}; g.R.add=function(W,Y,k){this.u_.$_a(W,Y,k)}; g.R.remove=function(W,Y,k){this.u_.$_r(W,Y,k)}; g.R.gE=function(W,Y,k,P){this.u_.$_un(W,Y,k,P)}; g.R.iz=function(){for(var W=this.W.length,Y=0;Y1&&!this.Y.getOption("remote","quickCast")?(this.SI=g.f$(W,this.W,this),this.oS(g.tx(W,this.W)),W=this.Y.getOption("remote","currentReceiver"),W=this.W(W),this.options[W]&&this.yH(W),this.enable(!0)):this.enable(!1)}; ZH.prototype.W=function(W){return W.key}; ZH.prototype.wM=function(W){return W==="cast-selector-receiver"?"Transmitir\u2026":this.SI[W].name}; ZH.prototype.vK=function(W){g.eo.prototype.vK.call(this,W);this.Y.setOption("remote","currentReceiver",this.SI[W]);this.Mq.n1()};g.H(kyw,g.JJ);g.R=kyw.prototype; g.R.create=function(){var W=this.player.V(),Y=g.IT(W);W={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:W.U("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:W.U("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:W.U("enable_cast_short_lived_lounge_token")};oxz(Y,W);this.subscriptions.push(g.bu("yt-remote-before-disconnect",this.A9h,this));this.subscriptions.push(g.bu("yt-remote-connection-change",this.hNg,this));this.subscriptions.push(g.bu("yt-remote-receiver-availability-change",this.Eb, this));this.subscriptions.push(g.bu("yt-remote-auto-connect",this.cTa,this));this.subscriptions.push(g.bu("yt-remote-receiver-resumed",this.eNg,this));this.subscriptions.push(g.bu("mdx-privacy-popup-confirm",this.n8a,this));this.subscriptions.push(g.bu("mdx-privacy-popup-cancel",this.Uar,this));this.Eb()}; g.R.load=function(){this.player.cancelPlayback();g.JJ.prototype.load.call(this);this.sA=new $Op(this.player.V(),this);this.player.o9(this.sA);this.TC=new Nj$(this,this.player,this.l8);var W=(W=xR1())?W.currentTime:0;var Y=le1()?new y6(Tr(),void 0):null;W==0&&Y&&(W=Fj(eT(Y)));W!==0&&this.Xi(W);Pdp(this,this.b7,this.b7);this.player.IC(6)}; g.R.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.rJ();this.L5=this.Jr;g.Yn(this.TC,this.l8);this.l8=this.sA=this.TC=null;g.JJ.prototype.unload.call(this);this.player.IC(5);iI(this)}; g.R.iz=function(){g.cw(this.subscriptions);g.JJ.prototype.iz.call(this)}; g.R.C_=function(W){var Y=g.y0.apply(1,arguments);this.loaded&&this.TC.Gw.apply(this.TC,[W].concat(g.ZX(Y)))}; g.R.getAdState=function(){return this.Yf}; g.R.EK=function(){return this.l8?eT(this.l8).EK:!1}; g.R.Gg=function(){return this.l8?eT(this.l8).Gg:!1}; g.R.Xi=function(W,Y){this.sH=W||0;this.player.publish("progresssync",W,Y);this.player.i7("onVideoProgress",W||0)}; g.R.getCurrentTime=function(){return this.sH}; g.R.getDuration=function(){return eT(this.l8).getDuration()||0}; g.R.hT=function(){var W=eT(this.l8);return W.T?W.W+DL(W):W.W}; g.R.F8=function(){return eT(this.l8).L}; g.R.qA=function(){return S5h(eT(this.l8))}; g.R.nC=function(){var W=eT(this.l8);return W.K>0?W.K+DL(W):W.K}; g.R.getProgressState=function(){var W=eT(this.l8),Y=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:W.playerState!=1081&&this.player.hD(),clipEnd:Y.clipEnd,clipStart:Y.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.hT(),isAtLiveHead:this.isAtLiveHead(),loaded:this.F8(),seekableEnd:this.qA(),seekableStart:this.nC(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.R.isAtLiveHead=function(){return S5h(eT(this.l8))-this.getCurrentTime()<=1}; g.R.nextVideo=function(){this.l8&&this.l8.nextVideo()}; g.R.My=function(){this.l8&&this.l8.My()}; g.R.A9h=function(W){W===1&&(this.kW=this.l8?eT(this.l8):null)}; g.R.hNg=function(){var W=le1()?new y6(Tr(),void 0):null;if(W){var Y=this.L5;this.loaded&&this.unload();this.l8=W;this.kW=null;Y.key!==this.Jr.key&&(this.L5=Y,this.load())}else g.Wu(this.l8),this.l8=null,this.loaded&&(this.unload(),(W=this.kW)&&W.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(W.videoId,Fj(W)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.R.Eb=function(){var W=[this.Jr],Y=W.concat,k=vxQ();AF()&&g.Es("yt-remote-cast-available")&&k.push({key:"cast-selector-receiver",name:"Cast..."});this.SI=Y.call(W,k);W=LSc()||this.Jr;MY(this,W);this.player.i7("onMdxReceiversChange")}; g.R.cTa=function(){var W=LSc();MY(this,W)}; g.R.eNg=function(){this.L5=LSc()}; g.R.n8a=function(){this.Xh=!0;iI(this);SH=!1;jH&&Xa(jH,1);jH=null}; g.R.Uar=function(){this.Xh=!1;iI(this);MY(this,this.Jr);this.L5=this.Jr;SH=!1;jH=null;this.player.playVideo()}; g.R.Kn=function(W,Y){switch(W){case "casting":return this.loaded;case "receivers":return this.SI;case "currentReceiver":return Y&&(Y.key==="cast-selector-receiver"?jsp():MY(this,Y)),this.loaded?this.L5:this.Jr;case "quickCast":return this.SI.length===2&&this.SI[1].key==="cast-selector-receiver"?(Y&&jsp(),!0):!1}}; g.R.pz=function(){this.l8.pz()}; g.R.bE=function(){return!1}; g.R.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.R.isLoggedIn=function(){var W,Y;return((W=g.eM("PLAYER_CONFIG"))==null?void 0:(Y=W.args)==null?void 0:Y.authuser)!==void 0?!0:!(!g.eM("SESSION_INDEX")&&!g.eM("LOGGED_IN"))};g.EX("remote",kyw);})(_yt_player);