(function(g){var window=this;'use strict';var Vkp=function(B){if(B instanceof g.Jw)return B;if(typeof B.Fw=="function")return B.Fw(!1);if(g.B7(B)){var z=0,T=new g.Jw;T.next=function(){for(;;){if(z>=B.length)return g.YD;if(z in B)return g.pq(B[z++]);z++}}; return T}throw Error("Not implemented");},Qeg=function(B,z,T){if(g.B7(B))g.Ks(B,z,T); else for(B=Vkp(B);;){var R=B.next();if(R.done)break;z.call(T,R.value,void 0,B)}},B2=function(B){g.cu(B,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.YP()).toString(36)); return B},zD=function(B,z,T){Array.isArray(T)||(T=[String(T)]); g.u3d(B.W,z,T)},yr5=function(B,z){var T=[]; Qeg(z,function(R){try{var h=g.xe.prototype.U.call(this,R,!0)}catch(W){if(W=="Storage: Invalid value was encountered")return;throw W;}h===void 0?T.push(R):g.etr(h)&&T.push(R)},B); return T},g05=function(B,z){yr5(B,z).forEach(function(T){g.xe.prototype.remove.call(this,T)},B)},Jrp=function(B){if(B.Nh){if(B.Nh.locationOverrideToken)return{locationOverrideToken:B.Nh.locationOverrideToken}; if(B.Nh.latitudeE7!=null&&B.Nh.longitudeE7!=null)return{latitudeE7:B.Nh.latitudeE7,longitudeE7:B.Nh.longitudeE7}}return null},pfR=function(B,z){g.F5(B,z)||B.push(z)},$GF=function(B){var z=0,T; for(T in B)z++;return z},P7p=function(B,z){return g.ec(B,z)},xGq=function(B){try{return g.XK.JSON.parse(B)}catch(z){}B=String(B); if(/^\s*$/.test(B)?0:/^[\],:{}\s\u2028\u2029]*$/.test(B.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("("+B+")")}catch(z){}throw Error("Invalid JSON string: "+B);},TD=function(B){if(g.XK.JSON)try{return g.XK.JSON.parse(B)}catch(z){}return xGq(B)},v0F=function(){var B=Rd(); this.T=B;B.x3("/client_streamz/youtube/living_room/mdx/channel/opened",g.ij("channel_type"))},DGK=function(){var B=Rd(); this.T=B;B.x3("/client_streamz/youtube/living_room/mdx/channel/closed",g.ij("channel_type"))},kqh=function(){var B=Rd(); this.T=B;B.x3("/client_streamz/youtube/living_room/mdx/channel/message_received",g.ij("channel_type"))},KTg=function(){var B=Rd(); this.T=B;B.x3("/client_streamz/youtube/living_room/mdx/channel/success")},mG7=function(){var B=Rd(); this.T=B;B.x3("/client_streamz/youtube/living_room/mdx/channel/error",g.ij("channel_type"),g.ij("error_type"))},n0W=function(){var B=Rd(); this.T=B;B.x3("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},uxR=function(){var B=Rd(); this.T=B;B.x3("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},HEq=function(B){if(B.ML&&typeof B.ML=="function")return B.ML(); if(typeof Map!=="undefined"&&B instanceof Map||typeof Set!=="undefined"&&B instanceof Set)return Array.from(B.values());if(typeof B==="string")return B.split("");if(g.B7(B)){for(var z=[],T=B.length,R=0;R1){if(T%2)throw Error("Uneven number of arguments");for(var R=0;R5&&(B=B.slice(B.length-5)); var z=g.s9(pPq(),function(R){return R.loungeToken}),T=g.s9(B,function(R){return R.loungeToken}); g.E9(T,function(R){return!g.F5(z,R)})&&$RI(); g.D_("yt-remote-local-screens",B,31536E3)},rV=function(B){B||(g.KD("yt-remote-session-screen-id"),g.KD("yt-remote-session-video-id")); gvp();B=LZ();g.GU(B,CZ());QcU(B)},xRK=function(){if(!od){var B=g.n2(); B&&(od=new g.p2(B))}},vvI=function(){xRK(); return od?!!od.get("yt-remote-use-staging-server"):!1},FZ=function(B,z){g.WF[B]=!0; var T=g.RZ();T&&T.publish.apply(T,arguments);g.WF[B]=!1},DR7=function(){},Rd=function(){if(!Id){Id=new g.uc(new DR7); var B=g.UD("client_streamz_web_flush_count",-1);B!==-1&&(Id.Y=B)}return Id},kFp=function(){var B=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return B?parseInt(B[1],10):0},K4I=function(B){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+B)!=-1||document.currentScript.src.indexOf("&"+B)!=-1)},mRF=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},GD=function(B){B.length?nvP(B.shift(),function(){GD(B)}):uNU()},HLp=function(B){return"chrome-extension://"+B+"/cast_sender.js"},nvP=function(B,z,T){var R=document.createElement("script"); R.onerror=z;T&&(R.onload=T);g.lh(R,g.yr(B));(document.head||document.documentElement).appendChild(R)},fMF=function(){var B=kFp(),z=[]; if(B>1){var T=B-1;z.push("//www.gstatic.com/eureka/clank/"+B+"/cast_sender.js");z.push("//www.gstatic.com/eureka/clank/"+T+"/cast_sender.js")}return z},uNU=function(){var B=mRF(); B&&B(!1,"No cast extension found")},NJI=function(){if(OLs){var B=2,z=mRF(),T=function(){B--; B==0&&z&&z(!0)}; window.__onGCastApiAvailable=T;nvP("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",uNU,T)}},tH5=function(){NJI(); var B=fMF();B.push("//www.gstatic.com/eureka/clank/cast_sender.js");GD(B)},XPI=function(){NJI(); var B=fMF();B.push.apply(B,g.Q(jcI.map(HLp)));B.push("//www.gstatic.com/eureka/clank/cast_sender.js");GD(B)},dV=function(B,z,T){g.K.call(this); this.X=T!=null?(0,g.W7)(B,T):B;this.kh=z;this.V=(0,g.W7)(this.Zu,this);this.T=!1;this.U=0;this.Y=this.Zx=null;this.W=[]},AV=function(){},ZLF=function(){g.s3.call(this,"p")},eL5=function(){g.s3.call(this,"o")},EvR=function(){return scq=scq||new g.Lh},SDK=function(B){g.s3.call(this,"serverreachability",B)},ad=function(B){var z=EvR(); z.dispatchEvent(new SDK(z,B))},BSF=function(B){g.s3.call(this,"statevent",B)},UJ=function(B){var z=EvR(); z.dispatchEvent(new BSF(z,B))},zFI=function(B,z,T,R){g.s3.call(this,"timingevent",B); this.size=z;this.rtt=T;this.retries=R},Me=function(B,z){if(typeof B!=="function")throw Error("Fn must not be null and must be a function"); return g.XK.setTimeout(function(){B()},z)},VV=function(){},QV=function(B,z,T,R){this.Y=B; this.W=z;this.ra=T;this.Sk=R||1;this.aK=new g.FM(this);this.eI=45E3;this.lO=null;this.X=!1;this.N=this.sE=this.J=this.cD=this.WD=this.EE=this.TZ=null;this.UE=[];this.T=null;this.L=0;this.V=this.RK=null;this.U0=-1;this.zZ=!1;this.MG=0;this.Kf=null;this.Dm=this.IK=this.O0=this.XE=!1;this.U=new TSp},TSp=function(){this.Y=null; this.T="";this.U=!1},hFq=function(B,z,T){B.cD=1; B.J=B2(z.clone());B.N=T;B.XE=!0;RFh(B,null)},RFh=function(B,z){B.WD=Date.now(); yV(B);B.sE=B.J.clone();zD(B.sE,"t",B.Sk);B.L=0;var T=B.Y.cD;B.U=new TSp;B.T=WNc(B.Y,T?z:null,!B.N);B.MG>0&&(B.Kf=new g.Rm((0,g.W7)(B.dX,B,B.T),B.MG));B.aK.listen(B.T,"readystatechange",B.MC);z=B.lO?g.zR(B.lO):{};B.N?(B.RK||(B.RK="POST"),z["Content-Type"]="application/x-www-form-urlencoded",B.T.send(B.sE,B.RK,B.N,z)):(B.RK="GET",B.T.send(B.sE,B.RK,null,z));ad(1)},YWR=function(B){if(!bDR(B))return g.sn(B.T); var z=g.En(B.T);if(z==="")return"";var T="",R=z.length,h=g.ZE(B.T)==4;if(!B.U.Y){if(typeof TextDecoder==="undefined")return gV(B),JV(B),"";B.U.Y=new g.XK.TextDecoder}for(var W=0;Wz.length)return l_7;z=z.slice(R,R+T);B.L=R+T;return z},yV=function(B){B.EE=Date.now()+B.eI; iDK(B,B.eI)},iDK=function(B,z){if(B.TZ!=null)throw Error("WatchDog timer not null"); B.TZ=Me((0,g.W7)(B.J7,B),z)},cQ5=function(B){B.TZ&&(g.XK.clearTimeout(B.TZ),B.TZ=null)},JV=function(B){B.Y.i8()||B.zZ||LNR(B.Y,B)},gV=function(B){cQ5(B); g.c6(B.Kf);B.Kf=null;B.aK.removeAll();if(B.T){var z=B.T;B.T=null;z.abort();z.dispose()}},AQI=function(B,z){try{var T=B.Y; if(T.wE!=0&&(T.T==B||C9W(T.U,B)))if(!B.IK&&C9W(T.U,B)&&T.wE==3){try{var R=T.XS.T.parse(z)}catch(A){R=null}if(Array.isArray(R)&&R.length==3){var h=R;if(h[0]==0)a:{if(!T.J){if(T.T)if(T.T.WD+3E30&&(T.MG=1.5*l);R=T;var w=B.ri();if(w){var q=g.SN(w,"X-Client-Wire-Protocol");if(q){var c=R.U;!c.T&&(g.IP(q,"spdy")||g.IP(q,"quic")||g.IP(q,"h2"))&&(c.W=c.V,c.T=new Set,c.U&&(FNW(c,c.U),c.U=null))}if(R.XE){var L=g.SN(w,"X-HTTP-Session-Id");L&&(R.R7=L,g.cu(R.lO,R.XE,L))}}T.wE=3;T.V&&T.V.QN();T.s0&&(T.II=Date.now()-B.WD);R=T;var C=B;R.t0=I_p(R,R.cD?R.Sk:null,R.ra);if(C.IK){Ghg(R.U, C);var r=C,F=R.MG;F&&r.setTimeout(F);r.TZ&&(cQ5(r),yV(r));R.T=C}else d45(R);T.Y.length>0&&xF(T)}else W[0]!="stop"&&W[0]!="close"||P2(T,7);else T.wE==3&&(W[0]=="stop"||W[0]=="close"?W[0]=="stop"?P2(T,7):T.disconnect():W[0]!="noop"&&T.V&&T.V.gX(W),T.UE=0)}ad(4)}catch(A){}},a_q=function(B,z){this.T=B; this.map=z;this.context=null},U4W=function(B){this.V=B||10; g.XK.PerformanceNavigationTiming?(B=g.XK.performance.getEntriesByType("navigation"),B=B.length>0&&(B[0].nextHopProtocol=="hq"||B[0].nextHopProtocol=="h2")):B=!!(g.XK.chrome&&g.XK.chrome.loadTimes&&g.XK.chrome.loadTimes()&&g.XK.chrome.loadTimes().wasFetchedViaSpdy);this.W=B?this.V:1;this.T=null;this.W>1&&(this.T=new Set);this.U=null;this.Y=[]},MTW=function(B){return B.U?!0:B.T?B.T.size>=B.W:!1},oKg=function(B){return B.U?1:B.T?B.T.size:0},C9W=function(B,z){return B.U?B.U==z:B.T?B.T.has(z):!1},FNW= function(B,z){B.T?B.T.add(z):B.U=z},Ghg=function(B,z){B.U&&B.U==z?B.U=null:B.T&&B.T.has(z)&&B.T.delete(z)},VTR=function(B){if(B.U!=null)return B.Y.concat(B.U.UE); if(B.T!=null&&B.T.size!==0){var z=B.Y;B=g.d(B.T.values());for(var T=B.next();!T.done;T=B.next())z=z.concat(T.value.UE);return z}return g.Mg(B.Y)},Q6K=function(B,z){var T=new VV; if(g.XK.Image){var R=new Image;R.onload=g.bW(v2,T,"TestLoadImage: loaded",!0,z,R);R.onerror=g.bW(v2,T,"TestLoadImage: error",!1,z,R);R.onabort=g.bW(v2,T,"TestLoadImage: abort",!1,z,R);R.ontimeout=g.bW(v2,T,"TestLoadImage: timeout",!1,z,R);g.XK.setTimeout(function(){if(R.ontimeout)R.ontimeout()},1E4); R.src=B}else z(!1)},yQF=function(B,z){var T=new VV,R=new AbortController,h=setTimeout(function(){R.abort(); v2(T,"TestPingServer: timeout",!1,z)},1E4); fetch(B,{signal:R.signal}).then(function(W){clearTimeout(h);W.ok?v2(T,"TestPingServer: ok",!0,z):v2(T,"TestPingServer: server error",!1,z)}).catch(function(){clearTimeout(h); v2(T,"TestPingServer: error",!1,z)})},v2=function(B,z,T,R,h){try{h&&(h.onload=null,h.onerror=null,h.onabort=null,h.ontimeout=null),R(T)}catch(W){}},gKs=function(){this.T=new AV},JQF=function(B,z,T){var R=T||""; try{OEF(B,function(h,W){var b=h;g.zU(h)&&(b=g.fh(h));z.push(R+W+"="+encodeURIComponent(b))})}catch(h){throw z.push(R+"type="+encodeURIComponent("_badmap")),h; }},DT=function(B,z,T){return T&&T.Z9?T.Z9[B]||z:z},pZp=function(B){this.Y=[]; this.Sk=this.t0=this.lO=this.ra=this.T=this.R7=this.XE=this.zZ=this.L=this.U0=this.N=null;this.L2=this.sE=0;this.yl=DT("failFast",!1,B);this.IK=this.TZ=this.J=this.X=this.V=null;this.JZ=!0;this.fF=this.Kf=-1;this.Dm=this.UE=this.WD=0;this.qr=DT("baseRetryDelayMs",5E3,B);this.r3=DT("retryDelaySeedMs",1E4,B);this.Ip=DT("forwardChannelMaxRetries",2,B);this.pF=DT("forwardChannelRequestTimeoutMs",2E4,B);this.S6=B&&B.KSJ||void 0;this.tj=B&&B.cbD||void 0;this.Nh=B&&B.tPI||!1;this.MG=void 0;this.cD=B&&B.K5I|| !1;this.W="";this.U=new U4W(B&&B.daf);this.XS=new gKs;this.aK=B&&B.rUO||!1;this.EE=B&&B.DaF||!1;this.aK&&this.EE&&(this.EE=!1);this.Gj=B&&B.fPm||!1;B&&B.tME&&(this.JZ=!1);this.s0=!this.aK&&this.JZ&&B&&B.gsJ||!1;this.LF=void 0;B&&B.BX&&B.BX>0&&(this.LF=B.BX);this.C4=void 0;this.II=0;this.eI=!1;this.O0=this.RK=null},$F=function(B){B.T&&($4g(B),B.T.cancel(),B.T=null)},P9c=function(B){$F(B); B.J&&(g.XK.clearTimeout(B.J),B.J=null);pZ(B);B.U.cancel();B.X&&(typeof B.X==="number"&&g.XK.clearTimeout(B.X),B.X=null)},xF=function(B){MTW(B.U)||B.X||(B.X=!0,g.MW(B.U7,B),B.WD=0)},vKU=function(B,z){if(oKg(B.U)>=B.U.W-(B.X?1:0))return!1; if(B.X)return B.Y=z.UE.concat(B.Y),!0;if(B.wE==1||B.wE==2||B.WD>=(B.yl?0:B.Ip))return!1;B.X=Me((0,g.W7)(B.U7,B,z),x4q(B,B.WD));B.WD++;return!0},khK=function(B,z){var T; z?T=z.ra:T=B.sE++;var R=B.lO.clone();g.cu(R,"SID",B.W);g.cu(R,"RID",T);g.cu(R,"AID",B.Kf);kF(B,R);B.L&&B.N&&g.oC(R,B.L,B.N);T=new QV(B,B.W,T,B.WD+1);B.L===null&&(T.lO=B.N);z&&(B.Y=z.UE.concat(B.Y));z=D4I(B,T,1E3);T.setTimeout(Math.round(B.pF*.5)+Math.round(B.pF*.5*Math.random()));FNW(B.U,T);hFq(T,R,z)},kF=function(B,z){B.zZ&&g.uW(B.zZ,function(T,R){g.cu(z,R,T)}); B.V&&OEF({},function(T,R){g.cu(z,R,T)})},D4I=function(B,z,T){T=Math.min(B.Y.length,T); var R=B.V?(0,g.W7)(B.V.SJ,B.V,B):null;a:{for(var h=B.Y,W=-1;;){var b=["count="+T];W==-1?T>0?(W=h[0].T,b.push("ofs="+W)):W=0:b.push("ofs="+W);for(var l=!0,w=0;w=3)return!1; B.Dm++;B.J=Me((0,g.W7)(B.T1,B),x4q(B,B.UE));B.UE++;return!0},$4g=function(B){B.RK!=null&&(g.XK.clearTimeout(B.RK),B.RK=null)},KNs=function(B){B.T=new QV(B,B.W,"rpc",B.Dm); B.L===null&&(B.T.lO=B.N);B.T.MG=0;var z=B.t0.clone();g.cu(z,"RID","rpc");g.cu(z,"SID",B.W);g.cu(z,"AID",B.Kf);g.cu(z,"CI",B.IK?"0":"1");!B.IK&&B.LF&&g.cu(z,"TO",B.LF);g.cu(z,"TYPE","xmlhttp");kF(B,z);B.L&&B.N&&g.oC(z,B.L,B.N);B.MG&&B.T.setTimeout(B.MG);var T=B.T;B=B.Sk;T.cD=1;T.J=B2(z.clone());T.N=null;T.XE=!0;RFh(T,B)},pZ=function(B){B.TZ!=null&&(g.XK.clearTimeout(B.TZ),B.TZ=null)},LNR=function(B,z){var T=null; if(B.T==z){pZ(B);$4g(B);B.T=null;var R=2}else if(C9W(B.U,z))T=z.UE,Ghg(B.U,z),R=1;else return;if(B.wE!=0)if(z.X)if(R==1){T=z.N?z.N.length:0;z=Date.now()-z.WD;var h=B.WD;R=EvR();R.dispatchEvent(new zFI(R,T,z,h));xF(B)}else d45(B);else{var W=z.U0;h=z.getLastError();if(h==3||h==0&&W>0||!(R==1&&vKU(B,z)||R==2&&rQc(B)))switch(T&&T.length>0&&(z=B.U,z.Y=z.Y.concat(T)),h){case 1:P2(B,5);break;case 4:P2(B,10);break;case 3:P2(B,6);break;default:P2(B,2)}}},x4q=function(B,z){var T=B.qr+Math.floor(Math.random()* B.r3); B.isActive()||(T*=2);return T*z},P2=function(B,z){if(z==2){var T=(0,g.W7)(B.oOO,B),R=B.tj,h=!R; R=new g.hX(R||"//www.google.com/images/cleardot.gif");g.XK.location&&g.XK.location.protocol=="http"||g.Wu(R,"https");B2(R);h?Q6K(R.toString(),T):yQF(R.toString(),T)}else UJ(2);B.wE=0;B.V&&B.V.Y_(z);m47(B);P9c(B)},m47=function(B){B.wE=0; B.O0=[];if(B.V){var z=VTR(B.U);if(z.length!=0||B.Y.length!=0)g.Vq(B.O0,z),g.Vq(B.O0,B.Y),B.U.Y.length=0,g.Mg(B.Y),B.Y.length=0;B.V.O7()}},nKg=function(B){if(B.wE==0)return B.O0; var z=[];g.Vq(z,VTR(B.U));g.Vq(z,B.Y);return z},I_p=function(B,z,T){var R=g.Li(T); R.T!=""?(z&&g.bb(R,z+"."+R.T),g.Yc(R,R.Y)):(R=g.XK.location,R=NLs(R.protocol,z?z+"."+R.hostname:R.hostname,+R.port,T));z=B.XE;T=B.R7;z&&T&&g.cu(R,z,T);g.cu(R,"VER",B.im);kF(B,R);return R},WNc=function(B,z,T){if(z&&!B.cD)throw Error("Can't create secondary domain capable XhrIo object."); z=B.Nh&&!B.S6?new g.tR(new g.Bu({RE:T})):new g.tR(B.S6);z.L=B.cD;return z},uYW=function(){},HD5=function(){},mY=function(B,z){g.Lh.call(this); this.T=new pZp(z);this.V=B;this.U=z&&z.GZO||null;B=z&&z.riZ||null;z&&z.huE&&(B?B["X-Client-Protocol"]="webchannel":B={"X-Client-Protocol":"webchannel"});this.T.N=B;B=z&&z.ARm||null;z&&z.xU&&(B?B["X-WebChannel-Content-Type"]=z.xU:B={"X-WebChannel-Content-Type":z.xU});z&&z.yp&&(B?B["X-WebChannel-Client-Profile"]=z.yp:B={"X-WebChannel-Client-Profile":z.yp});this.T.U0=B;(B=z&&z.N5K)&&!g.Fy(B)&&(this.T.L=B);this.X=z&&z.K5I||!1;this.W=z&&z.hUG||!1;(z=z&&z.rb)&&!g.Fy(z)&&(this.T.XE=z,g.ZF(this.U,z)&&(B= this.U,z in B&&delete B[z]));this.Y=new KZ(this)},f_W=function(B){ZLF.call(this); B.__headers__&&(this.headers=B.__headers__,this.statusCode=B.__status__,delete B.__headers__,delete B.__status__);var z=B.__sm__;z?this.data=(this.T=g.Ng(z))?g.Sc(z,this.T):z:this.data=B},ODW=function(B){eL5.call(this); this.status=1;this.errorCode=B},KZ=function(B){this.T=B},NSh=function(B,z){this.U=B; this.T=z},tTp=function(B){return nKg(B.T).map(function(z){var T=B.U; z=z.map;"__data__"in z?(z=z.__data__,T=T.W?xGq(z):z):T=z;return T})},nZ=function(B,z){if(typeof B!=="function")throw Error("Fn must not be null and must be a function"); return g.XK.setTimeout(function(){B()},z)},H2=function(B){uf.dispatchEvent(new j6W(uf,B))},j6W=function(B){g.s3.call(this,"statevent",B)},fZ=function(B,z,T,R){this.T=B; this.W=z;this.L=T;this.X=R||1;this.U=45E3;this.Y=new g.FM(this);this.V=new g.Kh;this.V.setInterval(250)},ZDh=function(B,z,T){B.g9=1; B.ey=B2(z.clone());B.rJ=T;B.XE=!0;XZW(B,null)},eFc=function(B,z,T,R,h){B.g9=1; B.ey=B2(z.clone());B.rJ=null;B.XE=T;h&&(B.Zo=!1);XZW(B,R)},XZW=function(B,z){B.N6=Date.now(); s6P(B);B.YA=B.ey.clone();zD(B.YA,"t",B.X);B.WP=0;B.XJ=B.T.ZN(B.T.AC()?z:null);B.H5>0&&(B.OO=new g.Rm((0,g.W7)(B.WK,B,B.XJ),B.H5));B.Y.listen(B.XJ,"readystatechange",B.Cq);z=B.I9?g.zR(B.I9):{};B.rJ?(B.QX="POST",z["Content-Type"]="application/x-www-form-urlencoded",B.XJ.send(B.YA,B.QX,B.rJ,z)):(B.QX="GET",B.Zo&&!g.X8&&(z.Connection="close"),B.XJ.send(B.YA,B.QX,null,z));B.T.VZ(1)},Bjc=function(B,z){var T=B.WP,R=z.indexOf("\n",T); if(R==-1)return EKR;T=Number(z.substring(T,R));if(isNaN(T))return SW5;R+=1;if(R+T>z.length)return EKR;z=z.slice(R,R+T);B.WP=R+T;return z},s6P=function(B){B.md=Date.now()+B.U; zmF(B,B.U)},zmF=function(B,z){if(B.SX!=null)throw Error("WatchDog timer not null"); B.SX=nZ((0,g.W7)(B.sY,B),z)},TjR=function(B){B.SX&&(g.XK.clearTimeout(B.SX),B.SX=null)},Rmq=function(B){B.T.i8()||B.oZ||B.T.Me(B)},OJ=function(B){TjR(B); g.c6(B.OO);B.OO=null;B.V.stop();B.Y.removeAll();if(B.XJ){var z=B.XJ;B.XJ=null;z.abort();z.dispose()}B.sb&&(B.sb=null)},hmK=function(B,z){try{B.T.BK(B,z),B.T.VZ(4)}catch(T){}},b1U=function(B,z,T,R,h){if(R==0)T(!1); else{var W=h||0;R--;W1I(B,z,function(b){b?T(!0):g.XK.setTimeout(function(){b1U(B,z,T,R,W)},W)})}},W1I=function(B,z,T){var R=new Image; R.onload=function(){try{Ne(R),T(!0)}catch(h){}}; R.onerror=function(){try{Ne(R),T(!1)}catch(h){}}; R.onabort=function(){try{Ne(R),T(!1)}catch(h){}}; R.ontimeout=function(){try{Ne(R),T(!1)}catch(h){}}; g.XK.setTimeout(function(){if(R.ontimeout)R.ontimeout()},z); R.src=B},Ne=function(B){B.onload=null; B.onerror=null;B.onabort=null;B.ontimeout=null},Yj7=function(B){this.T=B; this.U=new AV},lss=function(B){var z=tV(B.T,B.Su,"/mail/images/cleardot.gif"); B2(z);b1U(z.toString(),5E3,(0,g.W7)(B.Ii,B),3,2E3);B.VZ(1)},w4F=function(B){var z=B.T.X; z!=null?(H2(5),z?(H2(11),js(B.T,B,!1)):(H2(12),js(B.T,B,!0))):(B.Xe=new fZ(B),B.Xe.I9=B.JB,z=B.T,z=tV(z,z.AC()?B.bx:null,B.K5),H2(5),zD(z,"TYPE","xmlhttp"),eFc(B.Xe,z,!1,B.bx,!1))},qj5=function(B,z,T){this.T=1; this.U=[];this.Y=[];this.V=new AV;this.N=B||null;this.X=z!=null?z:null;this.J=T||!1},i1I=function(B,z){this.T=B; this.map=z;this.context=null},cxh=function(B,z,T,R){g.s3.call(this,"timingevent",B); this.size=z;this.rtt=T;this.retries=R},L1U=function(B){g.s3.call(this,"serverreachability",B)},rxP=function(B){B.uE(1,0); B.BP=tV(B,null,B.SH);Cph(B)},oiW=function(B){B.PZ&&(B.PZ.abort(),B.PZ=null); B.b8&&(B.b8.cancel(),B.b8=null);B.r5&&(g.XK.clearTimeout(B.r5),B.r5=null);XZ(B);B.xY&&(B.xY.cancel(),B.xY=null);B.Qc&&(g.XK.clearTimeout(B.Qc),B.Qc=null)},F1p=function(B,z){if(B.T==0)throw Error("Invalid operation: sending map when state is closed"); B.U.push(new i1I(B.eJ++,z));B.T!=2&&B.T!=3||Cph(B)},IsF=function(B){var z=0; B.b8&&z++;B.xY&&z++;return z},Cph=function(B){B.xY||B.Qc||(B.Qc=nZ((0,g.W7)(B.VN,B),0),B.Ci=0)},Axc=function(B,z){if(B.T==1){if(!z){B.wN=Math.floor(Math.random()*1E5); z=B.wN++;var T=new fZ(B,"",z);T.I9=B.B3;var R=Goh(B),h=B.BP.clone();g.cu(h,"RID",z);g.cu(h,"CVER","1");ZT(B,h);ZDh(T,h,R);B.xY=T;B.T=2}}else B.T==3&&(z?dws(B,z):B.U.length==0||B.xY||dws(B))},dws=function(B,z){if(z)if(B.Gm>6){B.U=B.Y.concat(B.U); B.Y.length=0;var T=B.wN-1;z=Goh(B)}else T=z.L,z=z.rJ;else T=B.wN++,z=Goh(B);var R=B.BP.clone();g.cu(R,"SID",B.W);g.cu(R,"RID",T);g.cu(R,"AID",B.uT);ZT(B,R);T=new fZ(B,B.W,T,B.Ci+1);T.I9=B.B3;T.setTimeout(1E4+Math.round(1E4*Math.random()));B.xY=T;ZDh(T,R,z)},ZT=function(B,z){B.k0&&(B=B.k0.x_())&&g.uW(B,function(T,R){g.cu(z,R,T)})},Goh=function(B){var z=Math.min(B.U.length,1E3),T=["count="+z]; if(B.Gm>6&&z>0){var R=B.U[0].T;T.push("ofs="+R)}else R=0;for(var h={},W=0;W=3)return!1; B.L++;B.r5=nZ((0,g.W7)(B.Xm,B),UwU(B,B.sy));B.sy++;return!0},js=function(B,z,T){B.jH=B.X==null?T:!B.X; B.As=z.LL;B.J||rxP(B)},XZ=function(B){B.tK!=null&&(g.XK.clearTimeout(B.tK),B.tK=null)},UwU=function(B,z){var T=5E3+Math.floor(Math.random()*1E4); B.isActive()||(T*=2);return T*z},es=function(B,z){if(z==2||z==9){var T=null; B.k0&&(T=null);var R=(0,g.W7)(B.ekf,B);T||(T=new g.hX("//www.google.com/images/cleardot.gif"),B2(T));W1I(T.toString(),1E4,R)}else H2(2);Vds(B,z)},Vds=function(B,z){B.T=0; B.k0&&B.k0.DM(z);Qhp(B);oiW(B)},Qhp=function(B){B.T=0; B.As=-1;if(B.k0)if(B.Y.length==0&&B.U.length==0)B.k0.C5();else{var z=g.Mg(B.Y),T=g.Mg(B.U);B.Y.length=0;B.U.length=0;B.k0.C5(z,T)}},tV=function(B,z,T){var R=g.Li(T); if(R.T!="")z&&g.bb(R,z+"."+R.T),g.Yc(R,R.Y);else{var h=window.location;R=NLs(h.protocol,z?z+"."+h.hostname:h.hostname,+h.port,T)}B.EK&&g.uW(B.EK,function(W,b){g.cu(R,b,W)}); g.cu(R,"VER",B.Gm);ZT(B,R);return R},yx5=function(){},gis=function(){this.T=[]; this.U=[]},JxU=function(B){g.s3.call(this,"channelMessage"); this.message=B},p4I=function(B){g.s3.call(this,"channelError"); this.error=B},$wq=function(B,z){this.action=B; this.params=z||{}},sJ=function(B,z){g.K.call(this); this.T=new g.Si(this.GYJ,0,this);g.m(this,this.T);this.kh=5E3;this.U=0;if(typeof B==="function")z&&(B=(0,g.W7)(B,z));else if(B&&typeof B.handleEvent==="function")B=(0,g.W7)(B.handleEvent,B);else throw Error("Invalid listener argument");this.Y=B},PpF=function(B,z,T,R,h,W,b,l,w,q,c,L,C,r){T=T===void 0?!1:T; R=R===void 0?function(){return""}:R; h=h===void 0?!1:h;W=W===void 0?!1:W;b=b===void 0?!1:b;l=l===void 0?function(){return g.gW({})}:l; w=w===void 0?!1:w;c=c===void 0?!1:c;L=L===void 0?!1:L;C=C===void 0?!1:C;r=r===void 0?!1:r;this.cD=B;this.TZ=z;this.X=new g.Jn;this.U=new sJ(this.Ajm,this);this.T=null;this.L=!1;this.N=null;this.WD="";this.UE=this.J=0;this.Y=[];this.Dm=T;this.XE=R;this.V=W;this.lO=l;this.zZ=q;this.Sk=b;this.RK=null;this.W=g.gW();this.ra=h;this.O0=w;this.aK=c;this.EE=L;this.JZ=C;this.U0=r;this.MG=new v0F;this.IK=new DGK;this.eI=new KTg;this.sE=new kqh;this.Kf=new mG7;this.s0=new n0W;this.C4=new uxR},Dwc=function(B, z,T,R,h){xwP(B); if(B.T){var W=g.ek("ID_TOKEN"),b=B.T.B3||{};W?b["x-youtube-identity-token"]=W:delete b["x-youtube-identity-token"];B.T.B3=b}viF(B);R?(R.getState()!=3&&IsF(R)==0||R.getState(),B.T.connect(z,T,B.TZ,R.W,R.uT)):h?B.T.connect(z,T,B.TZ,h.sessionId,h.arrayId):B.T.connect(z,T,B.TZ)},nis=function(B,z){return B.JZ?!0:B.EE?Object.values(koF).includes(z):B.aK?!Object.values(K1c).includes(z):B.U0?Object.values(mwF).includes(z):!1},fsp=function(B){var z,T; g.D(function(R){if(R.U==1)return g.MB(R,2),g.P(R,uJF(B),2);g.$r(R);z=B.Y;B.Y=[];T=z.length;H1R(B,z,T);EJ(B);return g.Pb(R,0)})},H1R=function(B,z,T){for(var R=0;R0?T=Object.assign({},T,z):delete T.Authorization;B.T.B3=T}},viF=function(B){B.zZ&&!B.V&&Njs(B,B.zZ())},Ss=function(B){this.scheme="https"; this.port=this.domain="";this.T="/api/lounge";this.U=!0;B=B||document.location.href;var z=Number(g.It(B)[4]||null)||"";z&&(this.port=":"+z);this.domain=g.GK(B)||"";B=g.Va();B.search("MSIE")>=0&&(B=B.match(/MSIE ([\d.]+)/)[1],g.MS(B,"10.0")<0&&(this.U=!1))},B$=function(B,z){var T=B.T; B.U&&(T=B.scheme+"://"+B.domain+B.port+B.T);return g.Qn(T+z,{})},tdq=function(B,z){g.Lh.call(this); var T=this;this.aI=B();this.aI.subscribe("handlerOpened",this.fq,this);this.aI.subscribe("handlerClosed",this.onClosed,this);this.aI.subscribe("handlerError",function(R,h){T.onError(h)}); this.aI.subscribe("handlerMessage",this.onMessage,this);this.T=z},jhh=function(B,z,T){var R=this; T=T===void 0?function(){return""}:T; var h=h===void 0?new HD5:h;var W=W===void 0?new g.Jn:W;this.pathPrefix=B;this.T=z;this.WD=T;this.V=W;this.J=null;this.N=this.L=0;this.channel=null;this.X=0;this.Y=new sJ(function(){R.Y.isActive();var b;((b=R.channel)==null?void 0:oKg((new NSh(b,b.T)).T.U))===0&&R.connect(R.J,R.L)}); this.W={};this.U={};this.TZ=!1;this.logger=null;this.UE=[];this.H4=void 0;this.lO=new v0F;this.RK=new DGK;this.zZ=new kqh;this.XE=new mG7},X47=function(B){g.W0(B.channel,"m",function(){B.X=3; B.Y.reset();B.J=null;B.L=0;for(var z=g.d(B.UE),T=z.next();!T.done;T=z.next())T=T.value,B.channel&&B.channel.send(T);B.UE=[];B.publish("webChannelOpened");B.lO.Zc("WEB_CHANNEL")}); g.W0(B.channel,"n",function(){B.X=0;B.Y.isActive()||B.publish("webChannelClosed");var z,T=(z=B.channel)==null?void 0:tTp(new NSh(z,z.T));T&&(B.UE=[].concat(g.Q(T)));B.RK.Zc("WEB_CHANNEL")}); g.W0(B.channel,"p",function(z){var T=z.data;T[0]==="gracefulReconnect"?(B.Y.start(),B.channel&&B.channel.close()):B.publish("webChannelMessage",new $wq(T[0],T[1]));B.H4=z.statusCode;B.zZ.Zc("WEB_CHANNEL")}); g.W0(B.channel,"o",function(){B.H4===401||B.Y.start();B.publish("webChannelError");B.XE.Zc("WEB_CHANNEL","")})},Z1q=function(B){var z=B.WD(); z?B.W["x-youtube-lounge-xsrf-token"]=z:delete B.W["x-youtube-lounge-xsrf-token"]},emK=function(B){g.Lh.call(this); this.T=B();this.T.subscribe("webChannelOpened",this.NC,this);this.T.subscribe("webChannelClosed",this.onClosed,this);this.T.subscribe("webChannelError",this.onError,this);this.T.subscribe("webChannelMessage",this.onMessage,this)},sh7=function(B,z,T,R,h){function W(){return new PpF(B$(B,"/bc"),z,!1,T,R)} T=T===void 0?function(){return""}:T; return g.ac("enable_mdx_web_channel_desktop")?new emK(function(){return new jhh(B$(B,"/wc"),z,T)}):new tdq(W,h)},zdc=function(){var B=Ei7; Sjc();zx.push(B);BiF()},Tx=function(B,z){Sjc(); var T=TiP(B,String(z));zx.length==0?RdU(T):(BiF(),g.Ks(zx,function(R){R(T)}))},RG=function(B){Tx("CP",B)},Sjc=function(){zx||(zx=g.sH("yt.mdx.remote.debug.handlers_")||[],g.Zz("yt.mdx.remote.debug.handlers_",zx))},RdU=function(B){var z=(hL+1)%50; hL=z;W$[z]=B;bw||(bw=z==49)},BiF=function(){var B=zx; if(W$[0]){var z=bw?hL:-1,T={};do T={gM:void 0},z=(z+1)%50,T.gM=W$[z],g.Ks(B,function(R){return function(h){h(R.gM)}}(T)); while(z!=hL);W$=Array(50);hL=-1;bw=!1}},TiP=function(B,z){var T=(Date.now()-hdF)/1E3; T.toFixed&&(T=T.toFixed(3));var R=[];R.push("[",T+"s","] ");R.push("[","yt.mdx.remote","] ");R.push(B+": "+z,"\n");return R.join("")},Yz=function(B){g.Cl.call(this); this.X=B;this.screens=[]},WvF=function(B,z){var T=B.get(z.uuid)||B.get(z.id); if(T)return B=T.name,T.id=z.id||T.id,T.name=z.name,T.token=z.token,T.uuid=z.uuid||T.uuid,T.name!=B;B.screens.push(z);return!0},bzs=function(B,z){var T=B.screens.length!=z.length; B.screens=g.v6(B.screens,function(W){return!!UR7(z,W)}); for(var R=z.length,h=0;h0&&B.W0&&dG(B,T)},function(z){B.V=function(){}; B.Sn(z)})},DXP=function(B){var z={}; z.pairingCode=B.RK;z.theme=B.cD;vvI()&&(z.env_useStageMdx=1);return g.Vn(z)},kmq=function(B){return new Promise(function(z){B.RK=Aos(); if(B.lO){var T=new chrome.cast.DialLaunchResponse(!0,DXP(B));z(T);vkp(B)}else B.TZ=function(){g.GF(B.N);B.TZ=function(){}; B.N=NaN;var R=new chrome.cast.DialLaunchResponse(!0,DXP(B));z(R);vkp(B)},B.N=g.FN(function(){B.TZ()},100)})},mXU=function(B,z,T){B.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(z)); var R=new lf(z);return(new Promise(function(h){KvW(B,R,function(W){W?(B.UE=!0,LU(B.W,R),rG(B,R),dG(B,T)):g.Sk(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(z)+" is not online."));h(W)},5)})).then(function(h){return h?new chrome.cast.DialLaunchResponse(!1):kmq(B)})},nkF=function(B,z){var T=B.J.receiver.label,R=B.U.friendlyName; return(new Promise(function(h){IjI(B.W,T,z,R,function(W){W&&W.token&&rG(B,W);h(W)},function(W){oG(B,"Failed to get DIAL screen: "+W); h(null)})})).then(function(h){return h&&h.token?new chrome.cast.DialLaunchResponse(!1):kmq(B)})},KvW=function(B,z,T,R){g.GF(B.X); B.X=0;dXh(B.W,z,function(h){h||R<0?T(h):B.X=g.FN(function(){KvW(B,z,T,R-1)},300)})},dG=function(B,z){B.info("getDialAppInfoWithTimeout_ "+z); Gx(B)&&(g.GF(B.L),B.L=0,z==0?u0s(B):B.L=g.FN(function(){u0s(B)},z))},u0s=function(B){Gx(B)&&B.Y.getDialAppInfo(function(z){B.info("getDialAppInfo dialLaunchData: "+JSON.stringify(z)); z=z.extraData||{};var T=null;if(z.loungeToken){var R;((R=B.T)==null?void 0:R.token)==z.loungeToken&&(T="staleLoungeToken")}else T="missingLoungeToken";T?(B.WD=T,dG(B,3E4)):(B.UE=!1,B.WD="unknown",M4K(B,z.loungeToken),dG(B,z.loungeTokenRefreshIntervalMs))},function(z){B.info("getDialAppInfo error: "+z); B.WD="noLoungeTokenResponse";dG(B,3E4)})},HzI=function(B){g.GF(B.X); B.X=0;g.GF(B.L);B.L=0;B.V();B.V=function(){}; g.GF(B.N)},AL=function(B,z){CU.call(this,B,z,"ManualSession"); this.Y=g.FN((0,g.W7)(this.JI,this,null),150)},aG=function(B,z){g.Cl.call(this); this.config_=z;this.U=B;this.J=z.appId||"233637DE";this.W=z.theme||"cl";this.N=z.disableCastApi||!1;this.X=z.forceMirroring||!1;this.T=null;this.L=!1;this.Y=[];this.V=(0,g.W7)(this.fxE,this)},fj5=function(B,z){return z?g.Cs(B.Y,function(T){return wV(z,T.label)},B):null},UY=function(B){Tx("Controller",B)},Ei7=function(B){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(B)},MD=function(B){return B.L||!!B.Y.length||!!B.T},Vv=function(B,z,T){z!=B.T&&(g.c6(B.T),(B.T=z)?(T?B.publish("yt-remote-cast2-receiver-resumed", z.U):B.publish("yt-remote-cast2-receiver-selected",z.U),z.subscribe("sessionScreen",(0,g.W7)(B.nV,B,z)),z.subscribe("sessionFailed",function(){return OzI(B,z)}),z.T?B.publish("yt-remote-cast2-session-change",z.T):T&&B.T.JI(null)):B.publish("yt-remote-cast2-session-change",null))},OzI=function(B,z){B.T==z&&B.publish("yt-remote-cast2-session-failed")},NiK=function(B){var z=B.U.PK(),T=B.T&&B.T.U; B=g.s9(z,function(R){T&&wV(R,T.label)&&(T=null);var h=R.uuid?R.uuid:R.id,W=fj5(this,R);W?(W.label=h,W.friendlyName=R.name):(W=new chrome.cast.Receiver(h,R.name),W.receiverType=chrome.cast.ReceiverType.CUSTOM);return W},B); T&&(T.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(T=new chrome.cast.Receiver(T.label,T.friendlyName),T.receiverType=chrome.cast.ReceiverType.CUSTOM),B.push(T));return B},Eks=function(B,z,T,R){R.disableCastApi?Qv("Cannot initialize because disabled by Mdx config."):t4h()?jIq(z,R)&&(Xg5(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?Zzg(B,T):(window.__onGCastApiAvailable=function(h,W){h?Zzg(B,T):(yv("Failed to load cast API: "+W),edK(!1),Xg5(!1),g.KD("yt-remote-cast-available"),g.KD("yt-remote-cast-receiver"), sIh(),T(!1))},R.loadCastApiSetupScript?g.qc("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?kFp()>=60&&tH5():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?uNU():kFp()>=89?XPI():(NJI(),GD(jcI.map(HLp))))):Qv("Cannot initialize because not running Chrome")},sIh=function(){Qv("dispose"); var B=gG();B&&B.dispose();g.Zz("yt.mdx.remote.cloudview.instance_",null);Sv7(!1);g.l_(B65);B65.length=0},JL=function(){return!!g.kK("yt-remote-cast-installed")},zEU=function(){var B=g.kK("yt-remote-cast-receiver"); return B?B.friendlyName:null},T6F=function(){Qv("clearCurrentReceiver"); g.KD("yt-remote-cast-receiver")},REI=function(){return JL()?gG()?gG().getCastSession():(yv("getCastSelector: Cast is not initialized."),null):(yv("getCastSelector: Cast API is not installed!"),null)},hEK=function(){JL()?gG()?pU()?(Qv("Requesting cast selector."),gG().requestSession()):(Qv("Wait for cast API to be ready to request the session."),B65.push(g.Y2("yt-remote-cast2-api-ready",hEK))):yv("requestCastSelector: Cast is not initialized."):yv("requestCastSelector: Cast API is not installed!")}, $z=function(B,z){pU()?gG().setConnectedScreenStatus(B,z):yv("setConnectedScreenStatus called before ready.")},t4h=function(){var B=g.Va().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.PG||B},WAU=function(B,z){gG().init(B,z)},jIq=function(B,z){var T=!1; gG()||(B=new aG(B,z),B.subscribe("yt-remote-cast2-availability-change",function(R){g.D_("yt-remote-cast-available",R);FZ("yt-remote-cast2-availability-change",R)}),B.subscribe("yt-remote-cast2-receiver-selected",function(R){Qv("onReceiverSelected: "+R.friendlyName); g.D_("yt-remote-cast-receiver",R);FZ("yt-remote-cast2-receiver-selected",R)}),B.subscribe("yt-remote-cast2-receiver-resumed",function(R){Qv("onReceiverResumed: "+R.friendlyName); g.D_("yt-remote-cast-receiver",R);FZ("yt-remote-cast2-receiver-resumed",R)}),B.subscribe("yt-remote-cast2-session-change",function(R){Qv("onSessionChange: "+qe(R)); R||g.KD("yt-remote-cast-receiver");FZ("yt-remote-cast2-session-change",R)}),g.Zz("yt.mdx.remote.cloudview.instance_",B),T=!0); Qv("cloudview.createSingleton_: "+T);return T},gG=function(){return g.sH("yt.mdx.remote.cloudview.instance_")},Zzg=function(B,z){edK(!0); Xg5(!1);WAU(B,function(T){T?(Sv7(!0),g.w6("yt-remote-cast2-api-ready")):(yv("Failed to initialize cast API."),edK(!1),g.KD("yt-remote-cast-available"),g.KD("yt-remote-cast-receiver"),sIh());z(T)})},Qv=function(B){Tx("cloudview",B)},yv=function(B){Tx("cloudview",B)},edK=function(B){Qv("setCastInstalled_ "+B); g.D_("yt-remote-cast-installed",B)},pU=function(){return!!g.sH("yt.mdx.remote.cloudview.apiReady_")},Sv7=function(B){Qv("setApiReady_ "+B); g.Zz("yt.mdx.remote.cloudview.apiReady_",B)},Xg5=function(B){g.Zz("yt.mdx.remote.cloudview.initializing_",B)},P$=function(B){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.V=this.X=0;this.trackData=null;this.K1=this.xs=!1;this.J=this.Y=this.L=this.U=0;this.T=NaN;this.W=!1;this.reset(B)},bHI=function(B){B.audioTrackId=null; B.trackData=null;B.playerState=-1;B.xs=!1;B.K1=!1;B.X=0;B.V=g.YP();B.U=0;B.L=0;B.Y=0;B.J=0;B.T=NaN;B.W=!1},xz=function(B){return B.isPlaying()?(g.YP()-B.V)/1E3:0},v$=function(B,z){B.X=z; B.V=g.YP()},D2=function(B){switch(B.playerState){case 1:case 1081:return(g.YP()-B.V)/1E3+B.X; case -1E3:return 0}return B.X},YeI=function(B){return B.W?B.L+xz(B):B.L},kz=function(B,z,T){var R=B.videoId; B.videoId=z;B.index=T;z!=R&&bHI(B)},l7F=function(B){var z={}; z.index=B.index;z.listId=B.listId;z.videoId=B.videoId;z.playerState=B.playerState;z.volume=B.volume;z.muted=B.muted;z.audioTrackId=B.audioTrackId;z.trackData=g.TR(B.trackData);z.hasPrevious=B.xs;z.hasNext=B.K1;z.playerTime=B.X;z.playerTimeAt=B.V;z.seekableStart=B.U;z.seekableEnd=B.L;z.duration=B.Y;z.loadedTime=B.J;z.liveIngestionTime=B.T;return z},mL=function(B,z){g.Cl.call(this); var T=this;this.Y=0;this.W=B;this.X=[];this.V=new gis;this.U=this.T=null;this.N=(0,g.W7)(this.Qxm,this);this.L=(0,g.W7)(this.dZ,this);this.J=(0,g.W7)(this.gWf,this);this.TZ=(0,g.W7)(this.b4f,this);var R=0;B?(R=B.getProxyState(),R!=3&&(B.subscribe("proxyStateChange",this.nE,this),wF7(this))):R=3;R!=0&&(z?this.nE(R):g.FN(function(){T.nE(R)},0)); (B=REI())&&KU(this,B);this.subscribe("yt-remote-cast2-session-change",this.TZ)},nU=function(B){return new P$(B.W.getPlayerContextData())},wF7=function(B){g.Ks("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(z){this.X.push(this.W.subscribe(z,g.bW(this.uuZ,z),this))},B)},qeg=function(B){g.Ks(B.X,function(z){this.W.unsubscribeByKey(z)},B); B.X.length=0},uw=function(B){return B.getState()==1},H$=function(B,z){var T=B.V; T.T.length+T.U.length<50&&B.V.enqueue(z)},iHI=function(B,z,T){var R=nU(B); v$(R,T);R.playerState!=-1E3&&(R.playerState=z);fU(B,R)},OY=function(B,z,T){B.W.sendMessage(z,T)},fU=function(B,z){qeg(B); B.W.setPlayerContextData(l7F(z));wF7(B)},KU=function(B,z){B.U&&(B.U.removeUpdateListener(B.N),B.U.removeMediaListener(B.L),B.dZ(null)); B.U=z;B.U&&(RG("Setting cast session: "+B.U.sessionId),B.U.addUpdateListener(B.N),B.U.addMediaListener(B.L),B.U.media.length&&B.dZ(B.U.media[0]))},cWq=function(B){var z=B.T.media,T=B.T.customData; if(z&&T){var R=nU(B);z.contentId!=R.videoId&&RG("Cast changing video to: "+z.contentId);R.videoId=z.contentId;R.playerState=T.playerState;v$(R,B.T.getEstimatedTime());fU(B,R)}else RG("No cast media video. Ignoring state update.")},ND=function(B,z,T){return(0,g.W7)(function(R){this.nx("Failed to "+z+" with cast v2 channel. Error code: "+R.code); R.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.nx("Retrying "+z+" using MDx browser channel."),OY(this,z,T))},B)},Xa=function(B,z,T,R){R=R===void 0?!1:R; g.Cl.call(this);var h=this;this.X=NaN;this.RK=!1;this.N=this.J=this.UE=this.WD=NaN;this.TZ=[];this.V=this.L=this.W=this.T=this.U=null;this.lO=B;this.zZ=R;this.TZ.push(g.M4(window,"beforeunload",function(){h.Lw(2)})); this.Y=[];this.T=new P$;this.cD=z.id;this.XE=z.idType;this.U=sh7(this.lO,T,this.Lg,this.XE=="shortLived",this.cD);this.U.listen("channelOpened",function(){LA7(h)}); this.U.listen("channelClosed",function(){tL("Channel closed");isNaN(h.X)?rV(!0):rV();h.dispose()}); this.U.listen("channelError",function(W){rV();isNaN(h.fv())?(W==1&&h.XE=="shortLived"&&h.publish("browserChannelAuthError",W),tL("Channel error: "+W+" without reconnection"),h.dispose()):(h.RK=!0,tL("Channel error: "+W+" with reconnection in "+h.fv()+" ms"),jJ(h,2))}); this.U.listen("channelMessage",function(W){C_F(h,W)}); this.U.SW(z.token);this.subscribe("remoteQueueChange",function(){var W=h.T.videoId;g.mN()&&g.D_("yt-remote-session-video-id",W)})},rWK=function(B){return g.Cs(B.Y,function(z){return z.type=="LOUNGE_SCREEN"})},tL=function(B){Tx("conn",B)},jJ=function(B,z){B.publish("proxyStateChange",z)},o2q=function(B){B.X=g.FN(function(){tL("Connecting timeout"); B.Lw(1)},2E4)},FAp=function(B){g.GF(B.X); B.X=NaN},I7P=function(B){g.GF(B.WD); B.WD=NaN},dcs=function(B){GWU(B); B.UE=g.FN(function(){Z2(B,"getNowPlaying")},2E4)},GWU=function(B){g.GF(B.UE); B.UE=NaN},LA7=function(B){tL("Channel opened"); B.RK&&(B.RK=!1,I7P(B),B.WD=g.FN(function(){tL("Timing out waiting for a screen.");B.Lw(1)},15E3))},a7s=function(B,z){var T=null; if(z){var R=rWK(B);R&&(T={clientName:R.clientName,deviceMake:R.brand,deviceModel:R.model,osVersion:R.osVersion})}g.Zz("yt.mdx.remote.remoteClient_",T);z&&(FAp(B),I7P(B));T=B.U.Nw()&&isNaN(B.X);z==T?z&&(jJ(B,1),Z2(B,"getSubtitlesTrack")):z?(B.HQ()&&B.T.reset(),jJ(B,1),Z2(B,"getNowPlaying"),AW5(B)):B.Lw(1)},UcI=function(B,z){var T=z.params.videoId; delete z.params.videoId;T==B.T.videoId&&(g.Ep(z.params)?B.T.trackData=null:B.T.trackData=z.params,B.publish("remotePlayerChange"))},MGK=function(B,z,T){var R=z.params.videoId||z.params.video_id,h=parseInt(z.params.currentIndex,10); B.T.listId=z.params.listId||B.T.listId;kz(B.T,R,h);B.publish("remoteQueueChange",T)},QZ5=function(B,z){z.params=z.params||{}; MGK(B,z,"NOW_PLAYING_MAY_CHANGE");VG5(B,z);B.publish("autoplayDismissed")},VG5=function(B,z){var T=parseInt(z.params.currentTime||z.params.current_time,10); v$(B.T,isNaN(T)?0:T);T=parseInt(z.params.state,10);T=isNaN(T)?-1:T;T==-1&&B.T.playerState==-1E3&&(T=-1E3);B.T.playerState=T;T=Number(z.params.loadedTime);B.T.J=isNaN(T)?0:T;B.T.YB(Number(z.params.duration));T=B.T;var R=Number(z.params.liveIngestionTime);T.T=R;T.W=isNaN(R)?!1:!0;T=B.T;R=Number(z.params.seekableStartTime);z=Number(z.params.seekableEndTime);T.U=isNaN(R)?0:R;T.L=isNaN(z)?0:z;B.T.playerState==1?dcs(B):GWU(B);B.publish("remotePlayerChange")},yWh=function(B,z){if(B.T.playerState!=-1E3){var T= 1085; switch(parseInt(z.params.adState,10)){case 1:T=1081;break;case 2:T=1084;break;case 0:T=1083}B.T.playerState=T;z=parseInt(z.params.currentTime,10);v$(B.T,isNaN(z)?0:z);B.publish("remotePlayerChange")}},g2q=function(B,z){var T=z.params.muted=="true"; B.T.volume=parseInt(z.params.volume,10);B.T.muted=T;B.publish("remotePlayerChange")},JWg=function(B,z){B.L=z.params.videoId; B.publish("nowAutoplaying",parseInt(z.params.timeout,10))},pFI=function(B,z){B.L=z.params.videoId||null; B.publish("autoplayUpNext",B.L)},$cW=function(B,z){B.V=z.params.autoplayMode; B.publish("autoplayModeChange",B.V);B.V=="DISABLED"&&B.publish("autoplayDismissed")},P_I=function(B,z){var T=z.params.hasNext=="true"; B.T.xs=z.params.hasPrevious=="true";B.T.K1=T;B.publish("previousNextChange")},C_F=function(B,z){z=z.message; z.params?tL("Received: action="+z.action+", params="+g.fh(z.params)):tL("Received: action="+z.action+" {}");switch(z.action){case "loungeStatus":z=TD(z.params.devices);B.Y=g.s9(z,function(R){return new YF(R)}); z=!!g.Cs(B.Y,function(R){return R.type=="LOUNGE_SCREEN"}); a7s(B,z);z=B.Jy("mlm");B.publish("multiStateLoopEnabled",z);break;case "loungeScreenDisconnected":g.dF(B.Y,function(R){return R.type=="LOUNGE_SCREEN"}); a7s(B,!1);break;case "remoteConnected":var T=new YF(TD(z.params.device));g.Cs(B.Y,function(R){return R.equals(T)})||pfR(B.Y,T); break;case "remoteDisconnected":T=new YF(TD(z.params.device));g.dF(B.Y,function(R){return R.equals(T)}); break;case "gracefulDisconnect":break;case "playlistModified":MGK(B,z,"QUEUE_MODIFIED");break;case "nowPlaying":QZ5(B,z);break;case "onStateChange":VG5(B,z);break;case "onAdStateChange":yWh(B,z);break;case "onVolumeChanged":g2q(B,z);break;case "onSubtitlesTrackChanged":UcI(B,z);break;case "nowAutoplaying":JWg(B,z);break;case "autoplayDismissed":B.publish("autoplayDismissed");break;case "autoplayUpNext":pFI(B,z);break;case "onAutoplayModeChanged":$cW(B,z);break;case "onHasPreviousNextChanged":P_I(B, z);break;case "requestAssistedSignIn":B.publish("assistedSignInRequested",z.params.authCode);break;case "onLoopModeChanged":B.publish("loopModeChange",z.params.loopMode);break;default:tL("Unrecognized action: "+z.action)}},AW5=function(B){g.GF(B.N); B.N=g.FN(function(){B.Lw(1)},864E5)},Z2=function(B,z,T){T?tL("Sending: action="+z+", params="+g.fh(T)):tL("Sending: action="+z); B.U.sendMessage(z,T)},xcU=function(B){Yz.call(this,"ScreenServiceProxy"); this.l8=B;this.T=[];this.T.push(this.l8.$_s("screenChange",(0,g.W7)(this.On,this)));this.T.push(this.l8.$_s("onlineScreenChange",(0,g.W7)(this.amF,this)))},mcF=function(B,z){xRK(); if(!od||!od.get("yt-remote-disable-remote-module-for-dev")){z=g.ek("MDX_CONFIG")||z;MH7();gvp();eJ||(eJ=new Ss(z?z.loungeApiHost:void 0),vvI()&&(eJ.T="/api/loungedev"));sY||(sY=g.sH("yt.mdx.remote.deferredProxies_")||[],g.Zz("yt.mdx.remote.deferredProxies_",sY));v2R();var T=EY();if(!T){var R=new c$(eJ,z?z.disableAutomaticScreenCache||!1:!1);g.Zz("yt.mdx.remote.screenService_",R);T=EY();var h={};z&&(h={appId:z.appId,disableDial:z.disableDial,theme:z.theme,loadCastApiSetupScript:z.loadCastApiSetupScript, disableCastApi:z.disableCastApi,enableDialLoungeToken:z.enableDialLoungeToken,enableCastLoungeToken:z.enableCastLoungeToken,forceMirroring:z.forceMirroring});g.Zz("yt.mdx.remote.enableConnectWithInitialState_",z?z.enableConnectWithInitialState||!1:!1);Eks(B,R,function(W){W?SJ()&&$z(SJ(),"YouTube TV"):R.subscribe("onlineScreenChange",function(){FZ("yt-remote-receiver-availability-change")})},h)}z&&!g.sH("yt.mdx.remote.initialized_")&&(g.Zz("yt.mdx.remote.initialized_",!0),Bk("Initializing: "+g.fh(z)), zY.push(g.Y2("yt-remote-cast2-api-ready",function(){FZ("yt-remote-api-ready")})),zY.push(g.Y2("yt-remote-cast2-availability-change",function(){FZ("yt-remote-receiver-availability-change")})),zY.push(g.Y2("yt-remote-cast2-receiver-selected",function(){TY(null); FZ("yt-remote-auto-connect","cast-selector-receiver")})),zY.push(g.Y2("yt-remote-cast2-receiver-resumed",function(){FZ("yt-remote-receiver-resumed","cast-selector-receiver")})),zY.push(g.Y2("yt-remote-cast2-session-change",DcF)),zY.push(g.Y2("yt-remote-connection-change",function(W){W?$z(SJ(),"YouTube TV"):RT()||($z(null,null),T6F())})),zY.push(g.Y2("yt-remote-cast2-session-failed",function(){FZ("yt-remote-connection-failed")})),B=kWF(),z.isAuto&&(B.id+="#dial"),h=z.capabilities||[],g.ac("desktop_enable_autoplay")&& h.push("atp"),h.length>0&&(B.capabilities=h),B.name=z.device,B.app=z.app,(z=z.theme)&&(B.theme=z),Bk(" -- with channel params: "+g.fh(B)),B?(g.D_("yt-remote-session-app",B.app),g.D_("yt-remote-session-name",B.name)):(g.KD("yt-remote-session-app"),g.KD("yt-remote-session-name")),g.Zz("yt.mdx.remote.channelParams_",B),T.start(),SJ()||KAg())}},n2p=function(){var B=EY().l8.$_gos(); var z=h_();z&&Wk()&&(UR7(B,z)||B.push(z));return aMc(B)},HHU=function(){var B=uzW(); !B&&JL()&&zEU()&&(B={key:"cast-selector-receiver",name:zEU()});return B},uzW=function(){var B=n2p(),z=h_(); z||(z=RT());return g.Cs(B,function(T){return z&&wV(z,T.key)?!0:!1})},h_=function(){var B=SJ(); if(!B)return null;var z=EY().Hp();return c2(z,B)},DcF=function(B){Bk("remote.onCastSessionChange_: "+qe(B)); if(B){var z=h_();if(z&&z.id==B.id){if($z(z.id,"YouTube TV"),B.idType=="shortLived"&&(B=B.token))bg&&(bg.token=B),(z=Wk())&&z.SW(B)}else z&&Yx(),lg(B,1)}else Wk()&&Yx()},Yx=function(){pU()?gG().stopSession():yv("stopSession called before API ready."); var B=Wk();B&&(B.disconnect(1),f7W(null))},OHp=function(){var B=Wk(); return!!B&&B.getProxyState()!=3},Bk=function(B){Tx("remote",B)},EY=function(){if(!N6p){var B=g.sH("yt.mdx.remote.screenService_"); N6p=B?new xcU(B):null}return N6p},SJ=function(){return g.sH("yt.mdx.remote.currentScreenId_")},tGs=function(B){g.Zz("yt.mdx.remote.currentScreenId_",B)},jZq=function(){return g.sH("yt.mdx.remote.connectData_")},TY=function(B){g.Zz("yt.mdx.remote.connectData_",B)},Wk=function(){return g.sH("yt.mdx.remote.connection_")},f7W=function(B){var z=Wk(); TY(null);B||tGs("");g.Zz("yt.mdx.remote.connection_",B);sY&&(g.Ks(sY,function(T){T(B)}),sY.length=0); z&&!B?FZ("yt-remote-connection-change",!1):!z&&B&&FZ("yt-remote-connection-change",!0)},RT=function(){var B=g.mN(); if(!B)return null;var z=EY();if(!z)return null;z=z.Hp();return c2(z,B)},lg=function(B,z){SJ(); h_()&&h_();if(wB)bg=B;else{tGs(B.id);var T=g.sH("yt.mdx.remote.enableConnectWithInitialState_")||!1;B=new Xa(eJ,B,kWF(),T);B.connect(z,jZq());B.subscribe("beforeDisconnect",function(R){FZ("yt-remote-before-disconnect",R)}); B.subscribe("beforeDispose",function(){Wk()&&(Wk(),f7W(null))}); B.subscribe("browserChannelAuthError",function(){var R=h_();R&&R.idType=="shortLived"&&(pU()?gG().handleBrowserChannelAuthError():yv("refreshLoungeToken called before API ready."))}); f7W(B)}},KAg=function(){var B=RT(); B?(Bk("Resume connection to: "+qe(B)),lg(B,0)):(rV(),T6F(),Bk("Skipping connecting because no session screen found."))},v2R=function(){var B=kWF(); if(g.Ep(B)){B=CZ();var z=g.kK("yt-remote-session-name")||"",T=g.kK("yt-remote-session-app")||"";B={device:"REMOTE_CONTROL",id:B,name:z,app:T,mdxVersion:3};B.authuser=String(g.ek("SESSION_INDEX","0"));(z=g.ek("DELEGATED_SESSION_ID"))&&(B.pageId=String(z));g.Zz("yt.mdx.remote.channelParams_",B)}},kWF=function(){return g.sH("yt.mdx.remote.channelParams_")||{}},eEg=function(B,z,T){g.K.call(this); var R=this;this.T=B;this.j=z;this.AZ=T;this.events=new g.kb(this);this.V=!1;this.X=new g.b5(64);this.U=new g.Si(this.Yx,500,this);this.Y=new g.Si(this.Qg,1E3,this);this.J=new dV(this.RwG,0,this);this.W={};this.N=new g.Si(this.WA,1E3,this);this.L=new g.Rm(this.seekTo,1E3,this);this.TZ=this.events.Z(this.j,"onVolumeChange",function(h){XFs(R,h)}); g.m(this,this.events);this.events.Z(z,"onCaptionsTrackListChanged",this.pBO);this.events.Z(z,"captionschanged",this.O4K);this.events.Z(z,"captionssettingschanged",this.zt);this.events.Z(z,"videoplayerreset",this.q$);this.events.Z(z,"mdxautoplaycancel",function(){R.AZ.NN()}); z.D("enable_mdx_video_play_directly")&&this.events.Z(z,"videodatachange",function(){ZHU(R.T)||q7(R)||ig(R,0)}); B=this.AZ;B.xd();B.subscribe("proxyStateChange",this.RC,this);B.subscribe("remotePlayerChange",this.Qz,this);B.subscribe("remoteQueueChange",this.q$,this);B.subscribe("previousNextChange",this.We,this);B.subscribe("nowAutoplaying",this.TK,this);B.subscribe("autoplayDismissed",this.sW,this);g.m(this,this.U);g.m(this,this.Y);g.m(this,this.J);g.m(this,this.N);g.m(this,this.L);this.zt();this.q$();this.Qz()},XFs=function(B,z){if(q7(B)){B.AZ.unsubscribe("remotePlayerChange",B.Qz,B); var T=Math.round(z.volume);z=!!z.muted;var R=nU(B.AZ);if(T!==R.volume||z!==R.muted)B.AZ.setVolume(T,z),B.N.start();B.AZ.subscribe("remotePlayerChange",B.Qz,B)}},sZW=function(B){B.l$(0); B.U.stop();B.Oi(new g.b5(64))},E2c=function(B,z){if(q7(B)&&!B.V){var T=null; z&&(T={style:B.j.getSubtitlesUserSettings()},Object.assign(T,z));B.AZ.Ia(B.j.getVideoData(1).videoId,T);B.W=nU(B.AZ).trackData}},ig=function(B,z){var T=B.j.getPlaylist(); if(T==null?0:T.listId){var R=T.index;var h=T.listId.toString()}T=B.j.getVideoData(1);B.AZ.playVideo(T.videoId,z,R,h,T.playerParams,T.lO,Jrp(T));B.Oi(new g.b5(1))},SeF=function(B,z){if(z){var T=B.j.getOption("captions","tracklist",{l_:1}); T&&T.length?(B.j.setOption("captions","track",z),B.V=!1):(B.j.loadModule("captions"),B.V=!0)}else B.j.setOption("captions","track",{})},q7=function(B){return nU(B.AZ).videoId===B.j.getVideoData(1).videoId},Bds=function(B,z){g.mU.call(this,B); this.T=z},ck=function(){g.O.call(this,{B:"div", G:"ytp-mdx-popup-dialog",C:{role:"dialog"},S:[{B:"div",G:"ytp-mdx-popup-dialog-inner-content",S:[{B:"div",G:"ytp-mdx-popup-title",Yd:"\u0627\u0632 \u0633\u06cc\u0633\u062a\u0645 \u062e\u0627\u0631\u062c \u0634\u062f\u0647\u200c\u0627\u06cc\u062f"},{B:"div",G:"ytp-mdx-popup-description",Yd:"\u0648\u06cc\u062f\u06cc\u0648\u0647\u0627\u06cc\u06cc \u06a9\u0647 \u062a\u0645\u0627\u0634\u0627 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u062f \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0628\u0647 \u0633\u0627\u0628\u0642\u0647 \u062a\u0645\u0627\u0634\u0627\u06cc \u062a\u0644\u0648\u06cc\u0632\u06cc\u0648\u0646 \u0627\u0636\u0627\u0641\u0647 \u0634\u0648\u062f \u0648 \u0628\u0631 \u062a\u0648\u0635\u06cc\u0647 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc \u062a\u0644\u0648\u06cc\u0632\u06cc\u0648\u0646\u06cc \u062a\u0623\u062b\u06cc\u0631 \u0628\u06af\u0630\u0627\u0631\u062f. \u0628\u0631\u0627\u06cc \u062c\u0644\u0648\u06af\u06cc\u0631\u06cc \u0627\u0632 \u0627\u06cc\u0646 \u0627\u0645\u0631\u060c \u0644\u063a\u0648 \u06a9\u0646\u06cc\u062f \u0648 \u062f\u0631 \u0631\u0627\u06cc\u0627\u0646\u0647 \u0628\u0647 \u0633\u06cc\u0633\u062a\u0645 YouTube \u0648\u0627\u0631\u062f \u0634\u0648\u06cc\u062f."}, {B:"div",G:"ytp-mdx-privacy-popup-buttons",S:[{B:"button",nf:["ytp-button","ytp-mdx-privacy-popup-cancel"],Yd:"\u0644\u063a\u0648"},{B:"button",nf:["ytp-button","ytp-mdx-privacy-popup-confirm"],Yd:"\u062a\u0623\u06cc\u06cc\u062f"}]}]}]});this.fade=new g.Yp(this,250);this.cancelButton=this.BD("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.BD("ytp-mdx-privacy-popup-confirm");g.m(this,this.fade);this.Z(this.cancelButton,"click",this.T);this.Z(this.confirmButton,"click",this.U)},LI=function(B){g.O.call(this, {B:"div", G:"ytp-remote",S:[{B:"div",G:"ytp-remote-display-status",S:[{B:"div",G:"ytp-remote-display-status-icon",S:[g.oid()]},{B:"div",G:"ytp-remote-display-status-text",Yd:"{{statustext}}"}]}]});this.api=B;this.fade=new g.Yp(this,250);g.m(this,this.fade);this.Z(B,"presentingplayerstatechange",this.onStateChange);this.J0(B.getPlayerStateObject())},CI=function(B,z){g.kJ.call(this,"\u067e\u062e\u0634 \u062f\u0631",1,B,z); this.j=B;this.s_={};this.Z(B,"onMdxReceiversChange",this.W);this.Z(B,"presentingplayerstatechange",this.W);this.W()},zch=function(B){g.I$.call(this,B); this.JU={key:Aos(),name:"\u0627\u06cc\u0646 \u0631\u0627\u06cc\u0627\u0646\u0647"};this.zn=null;this.subscriptions=[];this.Bg=this.AZ=null;this.s_=[this.JU];this.qd=this.JU;this.mu=new g.b5(64);this.oH=0;this.Xl=-1;this.qy=!1;this.Dn=this.cJ=this.Fp=null;if(!g.vo(this.player.K())&&!g.f0(this.player.K())){B=this.player;var z=g.CB(B);z&&(z=z.m0())&&(z=new CI(B,z),g.m(this,z));z=new LI(B);g.m(this,z);g.Pw(B,z.element,4);this.Fp=new ck;g.m(this,this.Fp);g.Pw(B,this.Fp.element,4);this.qy=!!RT()}},rB=function(B){B.cJ&& (B.player.removeEventListener("presentingplayerstatechange",B.cJ),B.cJ=null)},Tdq=function(B,z,T){B.mu=T; B.player.publish("presentingplayerstatechange",new g.IS(T,z))},oT=function(B,z){if(z.key!==B.qd.key)if(z.key===B.JU.key)Yx(); else if(ZHU(B)&&RcI(B),B.qd=z,!B.player.K().D("disable_mdx_connection_in_mdx_module_for_music_web")||!g.f0(B.player.K())){var T=B.player.getPlaylistId();var R=B.player.getVideoData(1);var h=R.videoId;if(!T&&!h||(B.player.getAppState()===2||B.player.getAppState()===1)&&B.player.K().D("should_clear_video_data_on_player_cued_unstarted"))R=null;else{var W=B.player.getPlaylist();if(W){var b=[];for(var l=0;l2*this.size&&bf(this),!0):!1}; g.I.get=function(B,z){return hV(this.U,B)?this.U[B]:z}; g.I.set=function(B,z){hV(this.U,B)||(this.size+=1,this.T.push(B),this.zm++);this.U[B]=z}; g.I.forEach=function(B,z){for(var T=this.iZ(),R=0;R=R.T.length)return g.YD;var W=R.T[z++];return g.pq(B?W:R.U[W])}; return h}; var seF={InK:"atp",T_K:"ska",P9I:"que",Z1u:"mus",dVJ:"sus",B2u:"dsp",SvD:"seq",qaI:"mic",cYG:"dpa",H1K:"mlm",xZu:"dsdtr",ueK:"ntb",eOF:"vsp",KPE:"scn",qvK:"rpe",n2E:"dcn",l_D:"dcp",ULd:"pas",zBf:"drq",AfJ:"opf",MnE:"els",JYZ:"isg",o3Z:"svq",mKm:"mvp",mgE:"ads",B_K:"stcp",AgK:"sads",FPD:"dloc",yYJ:"dcw"},E05={CaI:"u",NsZ:"cl",i1i:"k",LXF:"i",WPK:"cr",JfZ:"m",a_u:"g",C$:"up"},koF={tW:"adPlaying",L$:"onAdStateChange"},K1c={ooO:"nowPlaying",wpJ:"onStateChange",tW:"adPlaying",L$:"onAdStateChange",yB:"nowPlayingShorts", rp:"onShortsStateChange"},mwF={yB:"nowPlayingShorts",rp:"onShortsStateChange"};YF.prototype.equals=function(B){return B?this.id==B.id:!1}; var yos="",od=null;DR7.prototype.flush=function(B,z){B=B===void 0?[]:B;z=z===void 0?!1:z;if(g.ac("enable_client_streamz_web")){B=g.d(B);for(var T=B.next();!T.done;T=B.next())T=g.Blz(T.value),T={serializedIncrementBatch:g.bT(T.U())},g.ip("streamzIncremented",T,{sendIsolatedPayload:z})}}; var Id,OLs=K4I("loadCastFramework")||K4I("loadCastApplicationFramework"),jcI=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.qg(dV,g.K);g.I=dV.prototype;g.I.m9=function(B){this.W=arguments;this.T=!1;this.Zx?this.Y=g.YP()+this.kh:this.Zx=g.mW(this.V,this.kh)}; g.I.stop=function(){this.Zx&&(g.XK.clearTimeout(this.Zx),this.Zx=null);this.Y=null;this.T=!1;this.W=[]}; g.I.pause=function(){++this.U}; g.I.resume=function(){this.U&&(--this.U,!this.U&&this.T&&(this.T=!1,this.X.apply(null,this.W)))}; g.I.gF=function(){this.stop();dV.gD.gF.call(this)}; g.I.Zu=function(){this.Zx&&(g.XK.clearTimeout(this.Zx),this.Zx=null);this.Y?(this.Zx=g.mW(this.V,this.Y-g.YP()),this.Y=null):this.U?this.T=!0:(this.T=!1,this.X.apply(null,this.W))};AV.prototype.stringify=function(B){return g.XK.JSON.stringify(B,void 0)}; AV.prototype.parse=function(B){return g.XK.JSON.parse(B,void 0)};g.qg(ZLF,g.s3);g.qg(eL5,g.s3);var scq=null;g.qg(SDK,g.s3);g.qg(BSF,g.s3);g.qg(zFI,g.s3);VV.prototype.debug=function(){}; VV.prototype.info=function(){}; VV.prototype.warning=function(){};var wZR={},l_7={};g.I=QV.prototype;g.I.setTimeout=function(B){this.eI=B}; g.I.MC=function(B){B=B.target;var z=this.Kf;z&&g.ZE(B)==3?z.XY():this.dX(B)}; g.I.dX=function(B){try{if(B==this.T)a:{var z=g.ZE(this.T),T=this.T.U,R=this.T.getStatus();if(!(z<3)&&(z!=3||this.T&&(this.U.U||g.sn(this.T)||g.En(this.T)))){this.zZ||z!=4||T==7||(T==8||R<=0?ad(3):ad(2));cQ5(this);var h=this.T.getStatus();this.U0=h;var W=YWR(this);if(this.X=h==200){if(this.O0&&!this.IK){b:{if(this.T){var b=g.SN(this.T,"X-HTTP-Initial-Response");if(b&&!g.Fy(b)){var l=b;break b}}l=null}if(B=l)this.IK=!0,AQI(this,B);else{this.X=!1;this.V=3;UJ(12);gV(this);JV(this);break a}}if(this.XE){B= !0;for(var w;!this.zZ&&this.L0&&!this.Dm&&(this.Dm=!0,this.Y.V$(this)):(gV(this),JV(this))}else AQI(this,W);z==4&&gV(this);this.X&&!this.zZ&&(z==4?LNR(this.Y,this):(this.X=!1,yV(this)))}else g.UFK(this.T),h==400&&W.indexOf("Unknown SID")> 0?(this.V=3,UJ(12)):(this.V=0,UJ(13)),gV(this),JV(this)}}}catch(q){}finally{}}; g.I.cancel=function(){this.zZ=!0;gV(this)}; g.I.J7=function(){this.TZ=null;var B=Date.now();B-this.EE>=0?(this.cD!=2&&(ad(3),UJ(17)),gV(this),this.V=2,JV(this)):iDK(this,this.EE-B)}; g.I.getLastError=function(){return this.V}; g.I.ri=function(){return this.T};U4W.prototype.cancel=function(){this.Y=VTR(this);if(this.U)this.U.cancel(),this.U=null;else if(this.T&&this.T.size!==0){for(var B=g.d(this.T.values()),z=B.next();!z.done;z=B.next())z.value.cancel();this.T.clear()}};g.I=pZp.prototype;g.I.im=8;g.I.wE=1;g.I.connect=function(B,z,T,R){UJ(0);this.ra=B;this.zZ=z||{};T&&R!==void 0&&(this.zZ.OSID=T,this.zZ.OAID=R);this.IK=this.JZ;this.lO=I_p(this,null,this.ra);xF(this)}; g.I.disconnect=function(){P9c(this);if(this.wE==3){var B=this.sE++,z=this.lO.clone();g.cu(z,"SID",this.W);g.cu(z,"RID",B);g.cu(z,"TYPE","terminate");kF(this,z);B=new QV(this,this.W,B);B.cD=2;B.J=B2(z.clone());z=!1;if(g.XK.navigator&&g.XK.navigator.sendBeacon)try{z=g.XK.navigator.sendBeacon(B.J.toString(),"")}catch(T){}!z&&g.XK.Image&&((new Image).src=B.J,z=!0);z||(B.T=WNc(B.Y,null),B.T.send(B.J));B.WD=Date.now();yV(B)}m47(this)}; g.I.i8=function(){return this.wE==0}; g.I.getState=function(){return this.wE}; g.I.U7=function(B){if(this.X)if(this.X=null,this.wE==1){if(!B){this.sE=Math.floor(Math.random()*1E5);B=this.sE++;var z=new QV(this,"",B),T=this.N;this.U0&&(T?(T=g.zR(T),g.RP(T,this.U0)):T=this.U0);this.L!==null||this.EE||(z.lO=T,T=null);var R;if(this.aK)a:{for(var h=R=0;h4096){R=h;break a}if(R===4096||h===this.Y.length-1){R=h+1;break a}}R= 1E3}else R=1E3;R=D4I(this,z,R);h=this.lO.clone();g.cu(h,"RID",B);g.cu(h,"CVER",22);this.XE&&g.cu(h,"X-HTTP-Session-Id",this.XE);kF(this,h);T&&(this.EE?R="headers="+g.Cr(g.H8X(T))+"&"+R:this.L&&g.oC(h,this.L,T));FNW(this.U,z);this.Gj&&g.cu(h,"TYPE","init");this.aK?(g.cu(h,"$req",R),g.cu(h,"SID","null"),z.O0=!0,hFq(z,h,null)):hFq(z,h,R);this.wE=2}}else this.wE==3&&(B?khK(this,B):this.Y.length==0||MTW(this.U)||khK(this))}; g.I.T1=function(){this.J=null;KNs(this);if(this.s0&&!(this.eI||this.T==null||this.II<=0)){var B=2*this.II;this.RK=Me((0,g.W7)(this.USE,this),B)}}; g.I.USE=function(){this.RK&&(this.RK=null,this.IK=!1,this.eI=!0,UJ(10),$F(this),KNs(this))}; g.I.V$=function(B){this.T==B&&this.s0&&!this.eI&&($4g(this),this.eI=!0,UJ(11))}; g.I.Kq=function(){this.TZ!=null&&(this.TZ=null,$F(this),rQc(this),UJ(19))}; g.I.oOO=function(B){B?UJ(2):UJ(1)}; g.I.isActive=function(){return!!this.V&&this.V.isActive(this)}; g.I=uYW.prototype;g.I.QN=function(){}; g.I.gX=function(){}; g.I.Y_=function(){}; g.I.O7=function(){}; g.I.isActive=function(){return!0}; g.I.SJ=function(){};g.qg(mY,g.Lh);mY.prototype.open=function(){this.T.V=this.Y;this.X&&(this.T.cD=!0);this.T.connect(this.V,this.U||void 0)}; mY.prototype.close=function(){this.T.disconnect()}; mY.prototype.send=function(B){var z=this.T;if(typeof B==="string"){var T={};T.__data__=B;B=T}else this.W&&(T={},T.__data__=g.fh(B),B=T);z.Y.push(new a_q(z.L2++,B));z.wE==3&&xF(z)}; mY.prototype.gF=function(){this.T.V=null;delete this.Y;this.T.disconnect();delete this.T;mY.gD.gF.call(this)}; g.qg(f_W,ZLF);g.qg(ODW,eL5);g.qg(KZ,uYW);KZ.prototype.QN=function(){this.T.dispatchEvent("m")}; KZ.prototype.gX=function(B){this.T.dispatchEvent(new f_W(B))}; KZ.prototype.Y_=function(B){this.T.dispatchEvent(new ODW(B))}; KZ.prototype.O7=function(){this.T.dispatchEvent("n")};var uf=new g.Lh;g.G(j6W,g.s3);g.I=fZ.prototype;g.I.I9=null;g.I.gP=!1;g.I.SX=null;g.I.md=null;g.I.N6=null;g.I.g9=null;g.I.ey=null;g.I.YA=null;g.I.rJ=null;g.I.XJ=null;g.I.WP=0;g.I.sb=null;g.I.QX=null;g.I.Ll=null;g.I.fC=-1;g.I.Zo=!0;g.I.oZ=!1;g.I.H5=0;g.I.OO=null;var SW5={},EKR={};g.I=fZ.prototype;g.I.setTimeout=function(B){this.U=B}; g.I.Cq=function(B){B=B.target;var z=this.OO;z&&g.ZE(B)==3?z.XY():this.WK(B)}; g.I.WK=function(B){try{if(B==this.XJ)a:{var z=g.ZE(this.XJ),T=this.XJ.U,R=this.XJ.getStatus();if(g.X8&&!g.QQ("420+")){if(z<4)break a}else if(z<3||z==3&&!g.sn(this.XJ))break a;this.oZ||z!=4||T==7||(T==8||R<=0?this.T.VZ(3):this.T.VZ(2));TjR(this);var h=this.XJ.getStatus();this.fC=h;var W=g.sn(this.XJ);if(this.gP=h==200){z==4&&OJ(this);if(this.XE){for(B=!0;!this.oZ&&this.WP0?(this.Ll=3,H2(13)):(this.Ll=0,H2(14)),OJ(this),Rmq(this)}}catch(l){}finally{}}; g.I.cancel=function(){this.oZ=!0;OJ(this)}; g.I.sY=function(){this.SX=null;var B=Date.now();B-this.md>=0?(this.g9!=2&&this.T.VZ(3),OJ(this),this.Ll=2,H2(18),Rmq(this)):zmF(this,this.md-B)}; g.I.getLastError=function(){return this.Ll};g.I=Yj7.prototype;g.I.JB=null;g.I.Xe=null;g.I.kZ=!1;g.I.K5=null;g.I.b9=null;g.I.LL=-1;g.I.bx=null;g.I.Su=null;g.I.connect=function(B){this.K5=B;B=tV(this.T,null,this.K5);H2(3);Date.now();var z=this.T.N;z!=null?(this.bx=z[0],(this.Su=z[1])?(this.b9=1,lss(this)):(this.b9=2,w4F(this))):(zD(B,"MODE","init"),this.Xe=new fZ(this),this.Xe.I9=this.JB,eFc(this.Xe,B,!1,null,!0),this.b9=0)}; g.I.Ii=function(B){if(B)this.b9=2,w4F(this);else{H2(4);var z=this.T;z.As=z.PZ.LL;es(z,9)}B&&this.VZ(2)}; g.I.ZN=function(B){return this.T.ZN(B)}; g.I.abort=function(){this.Xe&&(this.Xe.cancel(),this.Xe=null);this.LL=-1}; g.I.i8=function(){return!1}; g.I.BK=function(B,z){this.LL=B.fC;if(this.b9==0)if(z){try{var T=this.U.parse(z)}catch(R){B=this.T;B.As=this.LL;es(B,2);return}this.bx=T[0];this.Su=T[1]}else B=this.T,B.As=this.LL,es(B,2);else this.b9==2&&(this.kZ?(H2(7),Date.now()):z=="11111"?(H2(6),this.kZ=!0,Date.now(),this.LL=200,this.Xe.cancel(),H2(12),js(this.T,this,!0)):(H2(8),Date.now(),this.kZ=!1))}; g.I.Me=function(){this.LL=this.Xe.fC;if(this.Xe.gP)this.b9==0?this.Su?(this.b9=1,lss(this)):(this.b9=2,w4F(this)):this.b9==2&&(this.kZ?(H2(12),js(this.T,this,!0)):(H2(11),js(this.T,this,!1)));else{this.b9==0?H2(9):this.b9==2&&H2(10);var B=this.T;this.Xe.getLastError();B.As=this.LL;es(B,2)}}; g.I.AC=function(){return this.T.AC()}; g.I.isActive=function(){return this.T.isActive()}; g.I.VZ=function(B){this.T.VZ(B)};g.I=qj5.prototype;g.I.B3=null;g.I.EK=null;g.I.xY=null;g.I.b8=null;g.I.SH=null;g.I.BP=null;g.I.jU=null;g.I.p5=null;g.I.wN=0;g.I.eJ=0;g.I.k0=null;g.I.Qc=null;g.I.r5=null;g.I.tK=null;g.I.PZ=null;g.I.jH=null;g.I.uT=-1;g.I.Ra=-1;g.I.As=-1;g.I.Ci=0;g.I.sy=0;g.I.Gm=8;var hcU={OK:0,GnE:2,noF:4,fOd:5,scu:6,STOP:7,qI:8,twm:9,L4D:10,GRK:11,Zpf:12};g.qg(cxh,g.s3);g.qg(L1U,g.s3);g.I=qj5.prototype; g.I.connect=function(B,z,T,R,h){H2(0);this.SH=z;this.EK=T||{};R&&h!==void 0&&(this.EK.OSID=R,this.EK.OAID=h);this.J?(nZ((0,g.W7)(this.LZ,this,B),100),rxP(this)):this.LZ(B)}; g.I.disconnect=function(){oiW(this);if(this.T==3){var B=this.wN++,z=this.BP.clone();g.cu(z,"SID",this.W);g.cu(z,"RID",B);g.cu(z,"TYPE","terminate");ZT(this,z);B=new fZ(this,this.W,B);B.g9=2;B.ey=B2(z.clone());(new Image).src=B.ey.toString();B.N6=Date.now();s6P(B)}Qhp(this)}; g.I.LZ=function(B){this.PZ=new Yj7(this);this.PZ.JB=this.B3;this.PZ.U=this.V;this.PZ.connect(B)}; g.I.i8=function(){return this.T==0}; g.I.getState=function(){return this.T}; g.I.VN=function(B){this.Qc=null;Axc(this,B)}; g.I.Xm=function(){this.r5=null;this.b8=new fZ(this,this.W,"rpc",this.L);this.b8.I9=this.B3;this.b8.H5=0;var B=this.jU.clone();g.cu(B,"RID","rpc");g.cu(B,"SID",this.W);g.cu(B,"CI",this.jH?"0":"1");g.cu(B,"AID",this.uT);ZT(this,B);g.cu(B,"TYPE","xmlhttp");eFc(this.b8,B,!0,this.p5,!1)}; g.I.BK=function(B,z){if(this.T!=0&&(this.b8==B||this.xY==B))if(this.As=B.fC,this.xY==B&&this.T==3)if(this.Gm>7){try{var T=this.V.parse(z)}catch(R){T=null}if(Array.isArray(T)&&T.length==3)if(B=T,B[0]==0)a:{if(!this.r5){if(this.b8)if(this.b8.N6+3E30)){if(R=z==1)this.xY||this.Qc||this.T==1||this.Ci>=2?R=!1:(this.Qc=nZ((0,g.W7)(this.VN,this,B),UwU(this,this.Ci)),this.Ci++, R=!0);R=!(R||z==2&&Mdq(this))}if(R)switch(T){case 1:es(this,5);break;case 4:es(this,10);break;case 3:es(this,6);break;case 7:es(this,12);break;default:es(this,2)}}}; g.I.uE=function(B){if(!g.F5(arguments,this.T))throw Error("Unexpected channel state: "+this.T);}; g.I.ekf=function(B){B?H2(2):(H2(1),Vds(this,8))}; g.I.ZN=function(B){if(B)throw Error("Can't create secondary domain capable XhrIo object.");B=new g.tR;B.L=!1;return B}; g.I.isActive=function(){return!!this.k0&&this.k0.isActive(this)}; g.I.VZ=function(B){var z=uf;z.dispatchEvent(new L1U(z,B))}; g.I.AC=function(){return!1}; g.I=yx5.prototype;g.I.Fm=function(){}; g.I.lm=function(){}; g.I.z1=function(){}; g.I.DM=function(){}; g.I.C5=function(){}; g.I.x_=function(){return{}}; g.I.isActive=function(){return!0};g.I=gis.prototype;g.I.enqueue=function(B){this.U.push(B)}; g.I.isEmpty=function(){return this.T.length===0&&this.U.length===0}; g.I.clear=function(){this.T=[];this.U=[]}; g.I.contains=function(B){return g.F5(this.T,B)||g.F5(this.U,B)}; g.I.remove=function(B){var z=this.T;var T=(0,g.Cdq)(z,B);T>=0?(g.IR(z,T),z=!0):z=!1;return z||g.GU(this.U,B)}; g.I.ML=function(){for(var B=[],z=this.T.length-1;z>=0;--z)B.push(this.T[z]);z=this.U.length;for(var T=0;T=W7c.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(B=W7c[this.U],this.Zx=g.FN((0,g.W7)(this.ww,this),B),this.U++):this.publish("pairingFailed",Error("Server error "+B.status))}; g.I.wW=function(){this.T=null;this.publish("pairingFailed",Error("Server not responding"))}; var W7c=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.qg(wG,Yz);g.I=wG.prototype;g.I.start=function(){lw(this)&&this.publish("screenChange");!g.kK("yt-remote-lounge-token-expiration")&&wgh(this);g.GF(this.T);this.T=g.FN((0,g.W7)(this.start,this),1E4)}; g.I.add=function(B,z){lw(this);WvF(this,B);qD(this,!1);this.publish("screenChange");z(B);B.token||wgh(this)}; g.I.remove=function(B,z){var T=lw(this);Yvs(this,B)&&(qD(this,!1),T=!0);z(B);T&&this.publish("screenChange")}; g.I.bd=function(B,z,T,R){var h=lw(this),W=this.get(B.id);W?(W.name!=z&&(W.name=z,qD(this,!1),h=!0),T(B)):R(Error("no such local screen."));h&&this.publish("screenChange")}; g.I.gF=function(){g.GF(this.T);wG.gD.gF.call(this)}; g.I.aB=function(B){lw(this);var z=this.screens.length;B=B&&B.screens||[];for(var T=B.length,R=0;R20)break a;l=z(W,b)}W=l}h.name=W}T(LU(this,h))},this), onError:(0,g.W7)(function(h){R(Error("pairing request failed: "+h.status))},this), onTimeout:(0,g.W7)(function(){R(Error("pairing request timed out."))},this)})}; g.I.gF=function(){g.c6(this.U);g.c6(this.T);c$.gD.gF.call(this)}; g.I.Wy=function(){Akh(this);this.publish("screenChange");this.T.update()}; c$.prototype.dispose=c$.prototype.dispose;g.qg(CU,g.Cl);g.I=CU.prototype;g.I.Sn=function(B){this.xd()||(B&&(oG(this,""+B),this.publish("sessionFailed")),this.T=null,this.publish("sessionScreen",null))}; g.I.info=function(B){Tx(this.XE,B)}; g.I.qD=function(){return null}; g.I.RW=function(B){var z=this.U;B?(z.displayStatus=new chrome.cast.ReceiverDisplayStatus(B,[]),z.displayStatus.showStop=!0):z.displayStatus=null;chrome.cast.setReceiverDisplayStatus(z,(0,g.W7)(function(){this.info("Updated receiver status for "+z.friendlyName+": "+B)},this),(0,g.W7)(function(){oG(this,"Failed to update receiver status for: "+z.friendlyName)},this))}; g.I.gF=function(){this.RW("");CU.gD.gF.call(this)};g.G(Fa,CU);g.I=Fa.prototype;g.I.B2=function(B){if(this.Y){if(this.Y==B)return;oG(this,"Overriding cast session with new session object");xXR(this);this.WD=!1;this.N="unknown";this.Y.removeUpdateListener(this.UE);this.Y.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.RK)}this.Y=B;this.Y.addUpdateListener(this.UE);this.Y.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.RK);gkh(this,"getMdxSessionStatus")}; g.I.JI=function(B){this.info("launchWithParams no-op for Cast: "+g.fh(B))}; g.I.stop=function(){this.Y?this.Y.stop((0,g.W7)(function(){this.Sn()},this),(0,g.W7)(function(){this.Sn(Error("Failed to stop receiver app."))},this)):this.Sn(Error("Stopping cast device without session."))}; g.I.RW=function(){}; g.I.gF=function(){this.info("disposeInternal");xXR(this);this.Y&&(this.Y.removeUpdateListener(this.UE),this.Y.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.RK));this.Y=null;CU.prototype.gF.call(this)}; g.I.eNf=function(B,z){if(!this.xd())if(z)if(z=TD(z),g.zU(z))switch(B=""+z.type,z=z.data||{},this.info("onYoutubeMessage_: "+B+" "+g.fh(z)),B){case "mdxSessionStatus":V4g(this,z);break;case "loungeToken":JkR(this,z);break;default:oG(this,"Unknown youtube message: "+B)}else oG(this,"Unable to parse message.");else oG(this,"No data in message.")}; g.I.pN=function(B,z,T,R){g.GF(this.J);this.J=0;IjI(this.W,this.U.label,B,this.U.friendlyName,(0,g.W7)(function(h){h?z(h):R>=0?(oG(this,"Screen "+B+" appears to be offline. "+R+" retries left."),this.J=g.FN((0,g.W7)(this.pN,this,B,z,T,R-1),300)):T(Error("Unable to fetch screen."))},this),T)}; g.I.qD=function(){return this.Y}; g.I.al=function(B){this.xd()||B||(oG(this,"Cast session died."),this.Sn())};g.G(IG,CU);g.I=IG.prototype;g.I.B2=function(B){this.Y=B;this.Y.addUpdateListener(this.zZ)}; g.I.JI=function(B){this.lO=B;this.TZ()}; g.I.stop=function(){HzI(this);this.Y?this.Y.stop((0,g.W7)(this.Sn,this,null),(0,g.W7)(this.Sn,this,"Failed to stop DIAL device.")):this.Sn()}; g.I.gF=function(){HzI(this);this.Y&&this.Y.removeUpdateListener(this.zZ);this.Y=null;CU.prototype.gF.call(this)}; g.I.h7=function(B){this.xd()||B||(oG(this,"DIAL session died."),this.V(),this.V=function(){},this.Sn())};g.G(AL,CU);AL.prototype.stop=function(){this.Sn()}; AL.prototype.B2=function(){}; AL.prototype.JI=function(){g.GF(this.Y);this.Y=NaN;var B=c2(this.W.Hp(),this.U.label);B?rG(this,B):this.Sn(Error("No such screen"))}; AL.prototype.gF=function(){g.GF(this.Y);this.Y=NaN;CU.prototype.gF.call(this)};g.G(aG,g.Cl);g.I=aG.prototype; g.I.init=function(B,z){chrome.cast.timeout.requestSession=3E4;var T=new chrome.cast.SessionRequest(this.J,[chrome.cast.Capability.AUDIO_OUT]);g.ac("desktop_enable_cast_connect")&&(T.androidReceiverCompatible=!0);this.N||(T.dialRequest=new chrome.cast.DialRequest("YouTube"));var R=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;B=B||this.X?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var h=(0,g.W7)(this.EiD,this);T=new chrome.cast.ApiConfig(T,(0,g.W7)(this.Vi, this),h,R,B);T.customDialLaunchCallback=(0,g.W7)(this.lmI,this);chrome.cast.initialize(T,(0,g.W7)(function(){this.xd()||(chrome.cast.addReceiverActionListener(this.V),zdc(),this.U.subscribe("onlineScreenChange",(0,g.W7)(this.yN,this)),this.Y=NiK(this),chrome.cast.setCustomReceivers(this.Y,function(){},(0,g.W7)(function(W){this.nx("Failed to set initial custom receivers: "+g.fh(W))},this)),this.publish("yt-remote-cast2-availability-change",MD(this)),z(!0))},this),(0,g.W7)(function(W){this.nx("Failed to initialize API: "+ g.fh(W)); z(!1)},this))}; g.I.OxZ=function(B,z){UY("Setting connected screen ID: "+B+" -> "+z);if(this.T){var T=this.T.T;if(!B||T&&T.id!=B)UY("Unsetting old screen status: "+this.T.U.friendlyName),Vv(this,null)}if(B&&z){if(!this.T){B=c2(this.U.Hp(),B);if(!B){UY("setConnectedScreenStatus: Unknown screen.");return}if(B.idType=="shortLived"){UY("setConnectedScreenStatus: Screen with id type to be short lived.");return}T=fj5(this,B);T||(UY("setConnectedScreenStatus: Connected receiver not custom..."),T=new chrome.cast.Receiver(B.uuid? B.uuid:B.id,B.name),T.receiverType=chrome.cast.ReceiverType.CUSTOM,this.Y.push(T),chrome.cast.setCustomReceivers(this.Y,function(){},(0,g.W7)(function(R){this.nx("Failed to set initial custom receivers: "+g.fh(R))},this))); UY("setConnectedScreenStatus: new active receiver: "+T.friendlyName);Vv(this,new AL(this.U,T),!0)}this.T.RW(z)}else UY("setConnectedScreenStatus: no screen.")}; g.I.W5J=function(B){this.xd()?this.nx("Setting connection data on disposed cast v2"):this.T?this.T.JI(B):this.nx("Setting connection data without a session")}; g.I.TV=function(){this.xd()?this.nx("Stopping session on disposed cast v2"):this.T?(this.T.stop(),Vv(this,null)):UY("Stopping non-existing session")}; g.I.requestSession=function(){chrome.cast.requestSession((0,g.W7)(this.Vi,this),(0,g.W7)(this.DhO,this))}; g.I.gF=function(){this.U.unsubscribe("onlineScreenChange",(0,g.W7)(this.yN,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.V);var B=Ei7,z=g.sH("yt.mdx.remote.debug.handlers_");g.GU(z||[],B);g.c6(this.T);g.Cl.prototype.gF.call(this)}; g.I.nx=function(B){Tx("Controller",B)}; g.I.nV=function(B,z){this.T==B&&(z||Vv(this,null),this.publish("yt-remote-cast2-session-change",z))}; g.I.fxE=function(B,z){if(!this.xd())if(B)switch(B.friendlyName=chrome.cast.unescape(B.friendlyName),UY("onReceiverAction_ "+B.label+" / "+B.friendlyName+"-- "+z),z){case chrome.cast.ReceiverAction.CAST:if(this.T)if(this.T.U.label!=B.label)UY("onReceiverAction_: Stopping active receiver: "+this.T.U.friendlyName),this.T.stop();else{UY("onReceiverAction_: Casting to active receiver.");this.T.T&&this.publish("yt-remote-cast2-session-change",this.T.T);break}switch(B.receiverType){case chrome.cast.ReceiverType.CUSTOM:Vv(this, new AL(this.U,B));break;case chrome.cast.ReceiverType.DIAL:Vv(this,new IG(this.U,B,this.W,this.config_));break;case chrome.cast.ReceiverType.CAST:Vv(this,new Fa(this.U,B,this.config_));break;default:this.nx("Unknown receiver type: "+B.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.T&&this.T.U.label==B.label?this.T.stop():this.nx("Stopping receiver w/o session: "+B.friendlyName)}else this.nx("onReceiverAction_ called without receiver.")}; g.I.lmI=function(B){if(this.xd())return Promise.reject(Error("disposed"));var z=B.receiver;z.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.nx("Not DIAL receiver: "+z.friendlyName),z.receiverType=chrome.cast.ReceiverType.DIAL);var T=this.T?this.T.U:null;if(!T||T.label!=z.label)return this.nx("Receiving DIAL launch request for non-clicked DIAL receiver: "+z.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(T&&T.label==z.label&&T.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.T.T)return UY("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.T.T),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.nx('Changing CAST intent from "'+T.receiverType+'" to "dial" for '+z.friendlyName);Vv(this,new IG(this.U,z,this.W,this.config_))}z=this.T;z.J=B;z.J.appState==chrome.cast.DialAppState.RUNNING?(B=z.J.extraData||{},T=B.screenId||null,Gx(z)&&B.loungeToken?B.loungeTokenRefreshIntervalMs?B=mXU(z,{name:z.U.friendlyName,screenId:B.screenId,loungeToken:B.loungeToken,dialId:z.J.receiver.label, screenIdType:"shortLived"},B.loungeTokenRefreshIntervalMs):(g.Sk(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(B)+".")),B=nkF(z,T)):B=nkF(z,T)):B=kmq(z);return B}; g.I.Vi=function(B){var z=this;if(!this.xd()&&!this.X){UY("New cast session ID: "+B.sessionId);var T=B.receiver;if(T.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.T)if(T.receiverType==chrome.cast.ReceiverType.CAST)UY("Got resumed cast session before resumed mdx connection."),T.friendlyName=chrome.cast.unescape(T.friendlyName),Vv(this,new Fa(this.U,T,this.config_),!0);else{this.nx("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var R=this.T.U,h=c2(this.U.Hp(), R.label);h&&wV(h,T.label)&&R.receiverType!=chrome.cast.ReceiverType.CAST&&T.receiverType==chrome.cast.ReceiverType.CAST&&(UY("onSessionEstablished_: manual to cast session change "+T.friendlyName),g.c6(this.T),this.T=new Fa(this.U,T,this.config_),this.T.subscribe("sessionScreen",(0,g.W7)(this.nV,this,this.T)),this.T.subscribe("sessionFailed",function(){return OzI(z,z.T)}),this.T.JI(null)); this.T.B2(B)}}}; g.I.v9=function(){return this.T?this.T.qD():null}; g.I.DhO=function(B){this.xd()||(this.nx("Failed to estabilish a session: "+g.fh(B)),B.code!=chrome.cast.ErrorCode.CANCEL&&Vv(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.I.EiD=function(B){UY("Receiver availability updated: "+B);if(!this.xd()){var z=MD(this);this.L=B==chrome.cast.ReceiverAvailability.AVAILABLE;MD(this)!=z&&this.publish("yt-remote-cast2-availability-change",MD(this))}}; g.I.yN=function(){this.xd()||(this.Y=NiK(this),UY("Updating custom receivers: "+g.fh(this.Y)),chrome.cast.setCustomReceivers(this.Y,function(){},(0,g.W7)(function(){this.nx("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",MD(this)))}; aG.prototype.setLaunchParams=aG.prototype.W5J;aG.prototype.setConnectedScreenStatus=aG.prototype.OxZ;aG.prototype.stopSession=aG.prototype.TV;aG.prototype.getCastSession=aG.prototype.v9;aG.prototype.requestSession=aG.prototype.requestSession;aG.prototype.init=aG.prototype.init;aG.prototype.dispose=aG.prototype.dispose;var B65=[];g.I=P$.prototype; g.I.reset=function(B){this.listId="";this.index=-1;this.videoId="";bHI(this);this.volume=-1;this.muted=!1;B&&(this.index=B.index,this.listId=B.listId,this.videoId=B.videoId,this.playerState=B.playerState,this.volume=B.volume,this.muted=B.muted,this.audioTrackId=B.audioTrackId,this.trackData=B.trackData,this.xs=B.hasPrevious,this.K1=B.hasNext,this.X=B.playerTime,this.V=B.playerTimeAt,this.U=B.seekableStart,this.L=B.seekableEnd,this.Y=B.duration,this.J=B.loadedTime,this.T=B.liveIngestionTime,this.W= !isNaN(this.T))}; g.I.isPlaying=function(){return this.playerState==1}; g.I.isBuffering=function(){return this.playerState==3}; g.I.F8=function(){return this.playerState==1081}; g.I.YB=function(B){this.Y=isNaN(B)?0:B}; g.I.getDuration=function(){return this.W?this.Y+xz(this):this.Y}; g.I.clone=function(){return new P$(l7F(this))};g.G(mL,g.Cl);g.I=mL.prototype;g.I.getState=function(){return this.Y}; g.I.C6=function(){return this.W.getReconnectTimeout()}; g.I.TJ=function(){this.W.reconnect()}; g.I.play=function(){uw(this)?(this.T?this.T.play(null,g.LF,ND(this,"play")):OY(this,"play"),iHI(this,1,D2(nU(this))),this.publish("remotePlayerChange")):H$(this,this.play)}; g.I.pause=function(){uw(this)?(this.T?this.T.pause(null,g.LF,ND(this,"pause")):OY(this,"pause"),iHI(this,2,D2(nU(this))),this.publish("remotePlayerChange")):H$(this,this.pause)}; g.I.seekTo=function(B){if(uw(this)){if(this.T){var z=nU(this),T=new chrome.cast.media.SeekRequest;T.currentTime=B;z.isPlaying()||z.isBuffering()?T.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:T.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.T.seek(T,g.LF,ND(this,"seekTo",{newTime:B}))}else OY(this,"seekTo",{newTime:B});iHI(this,3,B);this.publish("remotePlayerChange")}else H$(this,g.bW(this.seekTo,B))}; g.I.stop=function(){if(uw(this)){this.T?this.T.stop(null,g.LF,ND(this,"stopVideo")):OY(this,"stopVideo");var B=nU(this);B.index=-1;B.videoId="";bHI(B);fU(this,B);this.publish("remotePlayerChange")}else H$(this,this.stop)}; g.I.setVolume=function(B,z){if(uw(this)){var T=nU(this);if(this.U){if(T.volume!=B){var R=Math.round(B)/100;this.U.setReceiverVolumeLevel(R,(0,g.W7)(function(){RG("set receiver volume: "+R)},this),(0,g.W7)(function(){this.nx("failed to set receiver volume.")},this))}T.muted!=z&&this.U.setReceiverMuted(z,(0,g.W7)(function(){RG("set receiver muted: "+z)},this),(0,g.W7)(function(){this.nx("failed to set receiver muted.")},this))}else{var h={volume:B, muted:z};T.volume!=-1&&(h.delta=B-T.volume);OY(this,"setVolume",h)}T.muted=z;T.volume=B;fU(this,T)}else H$(this,g.bW(this.setVolume,B,z))}; g.I.Ia=function(B,z){if(uw(this)){var T=nU(this);B={videoId:B};z&&(T.trackData={trackName:z.name,languageCode:z.languageCode,sourceLanguageCode:z.translationLanguage?z.translationLanguage.languageCode:"",languageName:z.languageName,kind:z.kind},B.style=g.fh(z.style),g.RP(B,T.trackData));OY(this,"setSubtitlesTrack",B);fU(this,T)}else H$(this,g.bW(this.Ia,B,z))}; g.I.setAudioTrack=function(B,z){uw(this)?(z=z.getLanguageInfo().getId(),OY(this,"setAudioTrack",{videoId:B,audioTrackId:z}),B=nU(this),B.audioTrackId=z,fU(this,B)):H$(this,g.bW(this.setAudioTrack,B,z))}; g.I.playVideo=function(B,z,T,R,h,W,b){R=R===void 0?null:R;h=h===void 0?null:h;W=W===void 0?null:W;b=b===void 0?null:b;var l=nU(this),w={videoId:B};T!==void 0&&(w.currentIndex=T);kz(l,B,T||0);z!==void 0&&(v$(l,z),w.currentTime=z);R&&(w.listId=R);h&&(w.playerParams=h);W&&(w.clickTrackingParams=W);b&&(w.locationInfo=g.fh(b));OY(this,"setPlaylist",w);R||fU(this,l)}; g.I.e3=function(B,z){if(uw(this)){if(B&&z){var T=nU(this);kz(T,B,z);fU(this,T)}OY(this,"previous")}else H$(this,g.bW(this.e3,B,z))}; g.I.nextVideo=function(B,z){if(uw(this)){if(B&&z){var T=nU(this);kz(T,B,z);fU(this,T)}OY(this,"next")}else H$(this,g.bW(this.nextVideo,B,z))}; g.I.A5=function(){if(uw(this)){OY(this,"clearPlaylist");var B=nU(this);B.reset();fU(this,B);this.publish("remotePlayerChange")}else H$(this,this.A5)}; g.I.NN=function(){uw(this)?OY(this,"dismissAutoplay"):H$(this,this.NN)}; g.I.dispose=function(){if(this.Y!=3){var B=this.Y;this.Y=3;this.publish("proxyStateChange",B,this.Y)}g.Cl.prototype.dispose.call(this)}; g.I.gF=function(){qeg(this);this.W=null;this.V.clear();KU(this,null);g.Cl.prototype.gF.call(this)}; g.I.nE=function(B){if((B!=this.Y||B==2)&&this.Y!=3&&B!=0){var z=this.Y;this.Y=B;this.publish("proxyStateChange",z,B);if(B==1)for(;!this.V.isEmpty();)z=B=this.V,z.T.length===0&&(z.T=z.U,z.T.reverse(),z.U=[]),B.T.pop().apply(this);else B==3&&this.dispose()}}; g.I.uuZ=function(B,z){this.publish(B,z)}; g.I.Qxm=function(B){if(!B)this.dZ(null),KU(this,null);else if(this.U.receiver.volume){B=this.U.receiver.volume;var z=nU(this),T=Math.round(100*B.level||0);if(z.volume!=T||z.muted!=B.muted)RG("Cast volume update: "+B.level+(B.muted?" muted":"")),z.volume=T,z.muted=!!B.muted,fU(this,z)}}; g.I.dZ=function(B){RG("Cast media: "+!!B);this.T&&this.T.removeUpdateListener(this.J);if(this.T=B)this.T.addUpdateListener(this.J),cWq(this),this.publish("remotePlayerChange")}; g.I.gWf=function(B){B?(cWq(this),this.publish("remotePlayerChange")):this.dZ(null)}; g.I.wL=function(){OY(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.I.b4f=function(){var B=REI();B&&KU(this,B)}; g.I.nx=function(B){Tx("CP",B)};g.G(Xa,g.Cl);g.I=Xa.prototype; g.I.connect=function(B,z){if(z){var T=z.listId,R=z.videoId,h=z.videoIds,W=z.playerParams,b=z.clickTrackingParams,l=z.index,w={videoId:R},q=z.currentTime,c=z.locationInfo;z=z.loopMode;q!==void 0&&(w.currentTime=q<=5?0:q);W&&(w.playerParams=W);c&&(w.locationInfo=c);b&&(w.clickTrackingParams=b);T&&(w.listId=T);h&&h.length>0&&(w.videoIds=h.join(","));l!==void 0&&(w.currentIndex=l);this.zZ&&(w.loopMode=z||"LOOP_MODE_OFF");T&&(this.T.listId=T);this.T.videoId=R;this.T.index=l||0;this.T.state=3;v$(this.T, q);this.V="UNSUPPORTED";T=this.zZ?"setInitialState":"setPlaylist";tL("Connecting with "+T+" and params: "+g.fh(w));this.U.connect({method:T,params:g.fh(w)},B,JoF())}else tL("Connecting without params"),this.U.connect({},B,JoF());o2q(this)}; g.I.SW=function(B){this.U.SW(B)}; g.I.dispose=function(){this.xd()||(g.Zz("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),jJ(this,3));g.Cl.prototype.dispose.call(this)}; g.I.gF=function(){FAp(this);GWU(this);I7P(this);g.GF(this.J);this.J=NaN;g.GF(this.N);this.N=NaN;this.W=null;g.VO(this.TZ);this.TZ.length=0;this.U.dispose();g.Cl.prototype.gF.call(this);this.V=this.L=this.Y=this.T=this.U=null}; g.I.Jy=function(B){if(!this.Y||this.Y.length===0)return!1;for(var z=g.d(this.Y),T=z.next();!T.done;T=z.next())if(!T.value.capabilities.has(B))return!1;return!0}; g.I.LR=function(){var B=3;this.xd()||(B=0,isNaN(this.fv())?this.U.Nw()&&isNaN(this.X)&&(B=1):B=2);return B}; g.I.Lw=function(B){tL("Disconnecting with "+B);g.Zz("yt.mdx.remote.remoteClient_",null);FAp(this);this.publish("beforeDisconnect",B);B==1&&rV();this.U.disconnect(B);this.dispose()}; g.I.xM=function(){var B=this.T;this.W&&(B=this.T.clone(),kz(B,this.W,B.index));return l7F(B)}; g.I.j1i=function(B){var z=this,T=new P$(B);T.videoId&&T.videoId!=this.T.videoId&&(this.W=T.videoId,g.GF(this.J),this.J=g.FN(function(){if(z.W){var h=z.W;z.W=null;z.T.videoId!=h&&Z2(z,"getNowPlaying")}},5E3)); var R=[];this.T.listId==T.listId&&this.T.videoId==T.videoId&&this.T.index==T.index||R.push("remoteQueueChange");this.T.playerState==T.playerState&&this.T.volume==T.volume&&this.T.muted==T.muted&&D2(this.T)==D2(T)&&g.fh(this.T.trackData)==g.fh(T.trackData)||R.push("remotePlayerChange");this.T.reset(B);g.Ks(R,function(h){this.publish(h)},this)}; g.I.HQ=function(){var B=this.U.getDeviceId(),z=g.Cs(this.Y,function(T){return T.type=="REMOTE_CONTROL"&&T.id!=B}); return z?z.id:""}; g.I.fv=function(){return this.U.C6()}; g.I.Ut=function(){return this.V||"UNSUPPORTED"}; g.I.Ot=function(){return this.L||""}; g.I.Un=function(){!isNaN(this.fv())&&this.U.TJ()}; g.I.ixF=function(B,z){Z2(this,B,z);AW5(this)}; g.I.Lg=function(){var B=g.m4("SAPISID","")||g.m4("__Secure-1PAPISID")||"",z=g.m4("__Secure-3PAPISID","")||"";if(!B&&!z)return"";B=g.bT(g.Wl(B),2);z=g.bT(g.Wl(z),2);return g.bT(g.Wl(","+B+","+z),2)}; Xa.prototype.subscribe=Xa.prototype.subscribe;Xa.prototype.unsubscribeByKey=Xa.prototype.EN;Xa.prototype.getProxyState=Xa.prototype.LR;Xa.prototype.disconnect=Xa.prototype.Lw;Xa.prototype.getPlayerContextData=Xa.prototype.xM;Xa.prototype.setPlayerContextData=Xa.prototype.j1i;Xa.prototype.getOtherConnectedRemoteId=Xa.prototype.HQ;Xa.prototype.getReconnectTimeout=Xa.prototype.fv;Xa.prototype.getAutoplayMode=Xa.prototype.Ut;Xa.prototype.getAutoplayVideoId=Xa.prototype.Ot;Xa.prototype.reconnect=Xa.prototype.Un; Xa.prototype.sendMessage=Xa.prototype.ixF;Xa.prototype.getXsrfToken=Xa.prototype.Lg;Xa.prototype.isCapabilitySupportedOnConnectedDevices=Xa.prototype.Jy;g.G(xcU,Yz);g.I=xcU.prototype;g.I.Hp=function(B){return this.l8.$_gs(B)}; g.I.contains=function(B){return!!this.l8.$_c(B)}; g.I.get=function(B){return this.l8.$_g(B)}; g.I.start=function(){this.l8.$_st()}; g.I.add=function(B,z,T){this.l8.$_a(B,z,T)}; g.I.remove=function(B,z,T){this.l8.$_r(B,z,T)}; g.I.bd=function(B,z,T,R){this.l8.$_un(B,z,T,R)}; g.I.gF=function(){for(var B=this.T.length,z=0;z1&&!this.j.getOption("remote","quickCast")?(this.s_=g.mK(B,this.T,this),this.n1(g.s9(B,this.T)),B=this.j.getOption("remote","currentReceiver"),B=this.T(B),this.options[B]&&this.hk(B),this.enable(!0)):this.enable(!1)}; CI.prototype.T=function(B){return B.key}; CI.prototype.DO=function(B){return B==="cast-selector-receiver"?"\u067e\u062e\u0634 \u0645\u062d\u062a\u0648\u0627...":this.s_[B].name}; CI.prototype.BH=function(B){g.kJ.prototype.BH.call(this,B);this.j.setOption("remote","currentReceiver",this.s_[B]);this.WB.xW()};g.G(zch,g.I$);g.I=zch.prototype; g.I.create=function(){var B=this.player.K(),z=g.xC(B);B={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:B.D("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:B.D("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:B.D("enable_cast_short_lived_lounge_token")};mcF(z,B);this.subscriptions.push(g.Y2("yt-remote-before-disconnect",this.TaO,this));this.subscriptions.push(g.Y2("yt-remote-connection-change",this.wcK,this));this.subscriptions.push(g.Y2("yt-remote-receiver-availability-change",this.j1, this));this.subscriptions.push(g.Y2("yt-remote-auto-connect",this.A0u,this));this.subscriptions.push(g.Y2("yt-remote-receiver-resumed",this.NzF,this));this.subscriptions.push(g.Y2("mdx-privacy-popup-confirm",this.ngE,this));this.subscriptions.push(g.Y2("mdx-privacy-popup-cancel",this.DrD,this));this.j1()}; g.I.load=function(){this.player.cancelPlayback();g.I$.prototype.load.call(this);this.Dn=new Bds(this.player.K(),this);this.player.Wa(this.Dn);this.zn=new eEg(this,this.player,this.AZ);var B=(B=jZq())?B.currentTime:0;var z=OHp()?new mL(Wk(),void 0):null;B==0&&z&&(B=D2(nU(z)));B!==0&&this.l$(B);Tdq(this,this.mu,this.mu);this.player.i4(6)}; g.I.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.sC();this.qd=this.JU;g.Lq(this.zn,this.AZ);this.AZ=this.Dn=this.zn=null;g.I$.prototype.unload.call(this);this.player.i4(5);rB(this)}; g.I.gF=function(){g.l_(this.subscriptions);g.I$.prototype.gF.call(this)}; g.I.Te=function(B){var z=g.K5.apply(1,arguments);this.loaded&&this.zn.yG.apply(this.zn,[B].concat(g.Q(z)))}; g.I.getAdState=function(){return this.Xl}; g.I.xs=function(){return this.AZ?nU(this.AZ).xs:!1}; g.I.K1=function(){return this.AZ?nU(this.AZ).K1:!1}; g.I.l$=function(B,z){this.oH=B||0;this.player.publish("progresssync",B,z);this.player.A0("onVideoProgress",B||0)}; g.I.getCurrentTime=function(){return this.oH}; g.I.getDuration=function(){return nU(this.AZ).getDuration()||0}; g.I.gt=function(){var B=nU(this.AZ);return B.W?B.T+xz(B):B.T}; g.I.c7=function(){return nU(this.AZ).J}; g.I.Iq=function(){return YeI(nU(this.AZ))}; g.I.oR=function(){var B=nU(this.AZ);return B.U>0?B.U+xz(B):B.U}; g.I.getProgressState=function(){var B=nU(this.AZ),z=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!B.F8()&&this.player.TO(),clipEnd:z.clipEnd,clipStart:z.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.gt(),isAtLiveHead:this.isAtLiveHead(),loaded:this.c7(),seekableEnd:this.Iq(),seekableStart:this.oR(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.I.isAtLiveHead=function(){return YeI(nU(this.AZ))-this.getCurrentTime()<=1}; g.I.nextVideo=function(){this.AZ&&this.AZ.nextVideo()}; g.I.e3=function(){this.AZ&&this.AZ.e3()}; g.I.TaO=function(B){B===1&&(this.Bg=this.AZ?nU(this.AZ):null)}; g.I.wcK=function(){var B=OHp()?new mL(Wk(),void 0):null;if(B){var z=this.qd;this.loaded&&this.unload();this.AZ=B;this.Bg=null;z.key!==this.JU.key&&(this.qd=z,this.load())}else g.c6(this.AZ),this.AZ=null,this.loaded&&(this.unload(),(B=this.Bg)&&B.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(B.videoId,D2(B)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.I.j1=function(){var B=[this.JU],z=B.concat,T=n2p();JL()&&g.kK("yt-remote-cast-available")&&T.push({key:"cast-selector-receiver",name:"Cast..."});this.s_=z.call(B,T);B=HHU()||this.JU;oT(this,B);this.player.A0("onMdxReceiversChange")}; g.I.A0u=function(){var B=HHU();oT(this,B)}; g.I.NzF=function(){this.qd=HHU()}; g.I.ngE=function(){this.qy=!0;rB(this);wB=!1;bg&&lg(bg,1);bg=null}; g.I.DrD=function(){this.qy=!1;rB(this);oT(this,this.JU);this.qd=this.JU;wB=!1;bg=null;this.player.playVideo()}; g.I.vH=function(B,z){switch(B){case "casting":return this.loaded;case "receivers":return this.s_;case "currentReceiver":return z&&(z.key==="cast-selector-receiver"?hEK():oT(this,z)),this.loaded?this.qd:this.JU;case "quickCast":return this.s_.length===2&&this.s_[1].key==="cast-selector-receiver"?(z&&hEK(),!0):!1}}; g.I.wL=function(){this.AZ.wL()}; g.I.g_=function(){return!1}; g.I.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.I.isLoggedIn=function(){var B,z;return((B=g.ek("PLAYER_CONFIG"))==null?void 0:(z=B.args)==null?void 0:z.authuser)!==void 0?!0:!(!g.ek("SESSION_INDEX")&&!g.ek("LOGGED_IN"))};g.Fj("remote",zch);})(_yt_player);