(function(g){var window=this;'use strict';var fVs=function(w){if(w instanceof g.yH)return w;if(typeof w.KS=="function")return w.KS(!1);if(g.Lk(w)){var D=0,M=new g.yH;M.next=function(){for(;;){if(D>=w.length)return g.lT;if(D in w)return g.Ix(w[D++]);D++}}; return M}throw Error("Not implemented");},qOZ=function(w,D,M){if(g.Lk(w))g.PQ(w,D,M); else for(w=fVs(w);;){var L=w.next();if(L.done)break;D.call(M,L.value,void 0,w)}},AC=function(w){g.YA(w,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.pk()).toString(36)); return w},wc=function(w,D,M){Array.isArray(M)||(M=[String(M)]); g.B1x(w.D,D,M)},rY3=function(w,D){var M=[]; qOZ(D,function(L){try{var Z=g.H7.prototype.V.call(this,L,!0)}catch(k){if(k=="Storage: Invalid value was encountered")return;throw k;}Z===void 0?M.push(L):g.zOJ(Z)&&M.push(L)},w); return M},egZ=function(w,D){rY3(w,D).forEach(function(M){g.H7.prototype.remove.call(this,M)},w)},XoD=function(w){if(w.UV){if(w.UV.locationOverrideToken)return{locationOverrideToken:w.UV.locationOverrideToken}; if(w.UV.latitudeE7!=null&&w.UV.longitudeE7!=null)return{latitudeE7:w.UV.latitudeE7,longitudeE7:w.UV.longitudeE7}}return null},Tz3=function(w,D){g.xB(w,D)||w.push(D)},uND=function(w){var D=0,M; for(M in w)D++;return D},SOB=function(w,D){return g.E3(w,D)},Q_Z=function(w){try{return g.KI.JSON.parse(w)}catch(D){}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(D){}throw Error("Invalid JSON string: "+w);},DH=function(w){if(g.KI.JSON)try{return g.KI.JSON.parse(w)}catch(D){}return Q_Z(w)},JYD=function(){var w=Mo(); this.T=w;w.CS("/client_streamz/youtube/living_room/mdx/channel/opened",g.Mj("channel_type"))},zgB=function(){var w=Mo(); this.T=w;w.CS("/client_streamz/youtube/living_room/mdx/channel/closed",g.Mj("channel_type"))},VJZ=function(){var w=Mo(); this.T=w;w.CS("/client_streamz/youtube/living_room/mdx/channel/message_received",g.Mj("channel_type"))},PUx=function(){var w=Mo(); this.T=w;w.CS("/client_streamz/youtube/living_room/mdx/channel/success")},O7Z=function(){var w=Mo(); this.T=w;w.CS("/client_streamz/youtube/living_room/mdx/channel/error",g.Mj("channel_type"),g.Mj("error_type"))},KUS=function(){var w=Mo(); this.T=w;w.CS("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},m2Z=function(){var w=Mo(); this.T=w;w.CS("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},AYr=function(w,D,M,L){var Z=new g.Au(null); w&&g.wG(Z,w);D&&g.Df(Z,D);M&&g.Mh(Z,M);L&&(Z.V=L);return Z},wgs=function(w,D){return new g.Pf(w,D)},Lx=function(w,D){return Object.prototype.hasOwnProperty.call(w,D)},DAZ=function(w,D){return w===D},ZH=function(w,D){this.V={}; this.T=[];this.fh=this.size=0;var M=arguments.length;if(M>1){if(M%2)throw Error("Uneven number of arguments");for(var L=0;L5&&(w=w.slice(w.length-5)); var D=g.yR(raP(),function(L){return L.loungeToken}),M=g.yR(w,function(L){return L.loungeToken}); g.IJ(M,function(L){return!g.xB(D,L)})&&e6Z(); g.gQ("yt-remote-local-screens",w,31536E3)},hZ=function(w){w||(g.oj("yt-remote-session-screen-id"),g.oj("yt-remote-session-video-id")); fx7();w=px();g.HQ(w,W0());cak(w)},TQs=function(){if(!tZ){var w=g.F3(); w&&(tZ=new g.Ub(w))}},uR3=function(){TQs(); return tZ?!!tZ.get("yt-remote-use-staging-server"):!1},$p=function(w,D){g.JK[w]=!0; var M=g.SB();M&&M.publish.apply(M,arguments);g.JK[w]=!1},S4S=function(){},Mo=function(){if(!iq){iq=new g.fv(new S4S); var w=g.tY("client_streamz_web_flush_count",-1);w!==-1&&(iq.L=w)}return iq},QjQ=function(){var w=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return w?parseInt(w[1],10):0},Jax=function(w){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+w)!=-1||document.currentScript.src.indexOf("&"+w)!=-1)},z6l=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},dc=function(w){w.length?VYr(w.shift(),function(){dc(w)}):PCB()},OeZ=function(w){return"chrome-extension://"+w+"/cast_sender.js"},VYr=function(w,D,M){var L=document.createElement("script"); L.onerror=D;M&&(L.onload=M);g.UQ(L,g.y6(w));(document.head||document.documentElement).appendChild(L)},KE7=function(){var w=QjQ(),D=[]; if(w>1){var M=w-1;D.push("//www.gstatic.com/eureka/clank/"+w+"/cast_sender.js");D.push("//www.gstatic.com/eureka/clank/"+M+"/cast_sender.js")}return D},PCB=function(){var w=z6l(); w&&w(!1,"No cast extension found")},AaB=function(){if(mAr){var w=2,D=z6l(),M=function(){w--; w==0&&D&&D(!0)}; window.__onGCastApiAvailable=M;VYr("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",PCB,M)}},wTr=function(){AaB(); var w=KE7();w.push("//www.gstatic.com/eureka/clank/cast_sender.js");dc(w)},M$Q=function(){AaB(); var w=KE7();w.push.apply(w,g.tG(DDQ.map(OeZ)));w.push("//www.gstatic.com/eureka/clank/cast_sender.js");dc(w)},yk=function(w,D,M){g.X.call(this); this.Y=M!=null?(0,g.Ck)(w,M):w;this.LP=D;this.W=(0,g.Ck)(this.v0,this);this.T=!1;this.V=0;this.L=this.bj=null;this.D=[]},IU=function(){},Lgl=function(){g.SO.call(this,"p")},Zfl=function(){g.SO.call(this,"o")},bfr=function(){return kV7=kV7||new g.Ej},Y6B=function(w){g.SO.call(this,"serverreachability",w)},UG=function(w){var D=bfr(); D.dispatchEvent(new Y6B(D,w))},CEs=function(w){g.SO.call(this,"statevent",w)},xp=function(w){var D=bfr(); D.dispatchEvent(new CEs(D,w))},lDr=function(w,D,M,L){g.SO.call(this,"timingevent",w); this.size=D;this.rtt=M;this.retries=L},No=function(w,D){if(typeof w!=="function")throw Error("Fn must not be null and must be a function"); return g.KI.setTimeout(function(){w()},D)},H0=function(){},jR=function(w,D,M,L){this.L=w; this.D=D;this.GU=M;this.Sb=L||1;this.iW=new g.Wf(this);this.EL=45E3;this.Jc=null;this.Y=!1;this.B=this.bW=this.U=this.Md=this.nV=this.pV=this.y7=null;this.V7=[];this.T=null;this.G=0;this.W=this.c_=null;this.mu=-1;this.fV=!1;this.Nd=0;this.XE=null;this.oO=this.jk=this.TU=this.W_=!1;this.V=new Eq7},Eq7=function(){this.V=null; this.T="";this.L=!1},WgB=function(w,D,M){w.Md=1; w.U=AC(D.clone());w.B=M;w.W_=!0;pT7(w,null)},pT7=function(w,D){w.nV=Date.now(); RU(w);w.bW=w.U.clone();wc(w.bW,"t",w.Sb);w.G=0;var M=w.L.Md;w.V=new Eq7;w.T=hP1(w.L,M?D:null,!w.B);w.Nd>0&&(w.XE=new g.zC((0,g.Ck)(w.JN,w,w.T),w.Nd));w.iW.listen(w.T,"readystatechange",w.Ix);D=w.Jc?g.$O(w.Jc):{};w.B?(w.c_||(w.c_="POST"),D["Content-Type"]="application/x-www-form-urlencoded",w.T.send(w.bW,w.c_,w.B,D)):(w.c_="GET",w.T.send(w.bW,w.c_,null,D));UG(1)},$DZ=function(w){if(!t$D(w))return g.zy(w.T); var D=g.VF(w.T);if(D==="")return"";var M="",L=D.length,Z=g.QF(w.T)==4;if(!w.V.V){if(typeof TextDecoder==="undefined")return oU(w),nx(w),"";w.V.V=new g.KI.TextDecoder}for(var k=0;kD.length)return ifS;D=D.slice(L,L+M);w.G=L+M;return D},RU=function(w){w.pV=Date.now()+w.EL; ID7(w,w.EL)},ID7=function(w,D){if(w.y7!=null)throw Error("WatchDog timer not null"); w.y7=No((0,g.Ck)(w.lV,w),D)},UDB=function(w){w.y7&&(g.KI.clearTimeout(w.y7),w.y7=null)},nx=function(w){w.L.VL()||w.fV||xDQ(w.L,w)},oU=function(w){UDB(w); g.M9(w.XE);w.XE=null;w.iW.removeAll();if(w.T){var D=w.T;w.T=null;D.abort();D.dispose()}},FgD=function(w,D){try{var M=w.L; if(M.Tr!=0&&(M.T==w||N_7(M.V,w)))if(!w.jk&&N_7(M.V,w)&&M.Tr==3){try{var L=M.yF.T.parse(D)}catch(N){L=null}if(Array.isArray(L)&&L.length==3){var Z=L;if(Z[0]==0)a:{if(!M.U){if(M.T)if(M.T.nV+3E30&&(M.Nd=1.5*C);L=M;var l=w.k_();if(l){var E=g.Pj(l,"X-Client-Wire-Protocol");if(E){var p=L.V;!p.T&&(g.ak(E,"spdy")||g.ak(E,"quic")||g.ak(E,"h2"))&&(p.D=p.W,p.T=new Set,p.V&&(gqQ(p,p.V),p.V=null))}if(L.W_){var W=g.Pj(l,"X-HTTP-Session-Id");W&&(L.k6=W,g.YA(L.Jc,L.W_,W))}}M.Tr=3;M.W&&M.W.GT();M.HA&&(M.FQ=Date.now()-w.nV);L=M;var h=w;L.Qi=RPx(L,L.Md?L.GU:null,L.NC);if(h.jk){oqZ(L.V, h);var t=h,d=L.Nd;d&&t.setTimeout(d);t.y7&&(UDB(t),RU(t));L.T=h}else nqs(L);M.L.length>0&&aU(M)}else k[0]!="stop"&&k[0]!="close"||sG(M,7);else M.Tr==3&&(k[0]=="stop"||k[0]=="close"?k[0]=="stop"?sG(M,7):M.disconnect():k[0]!="noop"&&M.W&&M.W.r$(k),M.V7=0)}UG(4)}catch(N){}},GVZ=function(w,D){this.T=w; this.map=D;this.context=null},sC7=function(w){this.W=w||10; g.KI.PerformanceNavigationTiming?(w=g.KI.performance.getEntriesByType("navigation"),w=w.length>0&&(w[0].nextHopProtocol=="hq"||w[0].nextHopProtocol=="h2")):w=!!(g.KI.chrome&&g.KI.chrome.loadTimes&&g.KI.chrome.loadTimes()&&g.KI.chrome.loadTimes().wasFetchedViaSpdy);this.D=w?this.W:1;this.T=null;this.D>1&&(this.T=new Set);this.V=null;this.L=[]},aDP=function(w){return w.V?!0:w.T?w.T.size>=w.D:!1},jC7=function(w){return w.V?1:w.T?w.T.size:0},N_7=function(w,D){return w.V?w.V==D:w.T?w.T.has(D):!1},gqQ= function(w,D){w.T?w.T.add(D):w.V=D},oqZ=function(w,D){w.V&&w.V==D?w.V=null:w.T&&w.T.has(D)&&w.T.delete(D)},vqk=function(w){if(w.V!=null)return w.L.concat(w.V.V7); if(w.T!=null&&w.T.size!==0){var D=w.L;w=g.x(w.T.values());for(var M=w.next();!M.done;M=w.next())D=D.concat(M.value.V7);return D}return g.GD(w.L)},c5Q=function(w,D){var M=new H0; if(g.KI.Image){var L=new Image;L.onload=g.El(v0,M,"TestLoadImage: loaded",!0,D,L);L.onerror=g.El(v0,M,"TestLoadImage: error",!1,D,L);L.onabort=g.El(v0,M,"TestLoadImage: abort",!1,D,L);L.ontimeout=g.El(v0,M,"TestLoadImage: timeout",!1,D,L);g.KI.setTimeout(function(){if(L.ontimeout)L.ontimeout()},1E4); L.src=w}else D(!1)},B_S=function(w,D){var M=new H0,L=new AbortController,Z=setTimeout(function(){L.abort(); v0(M,"TestPingServer: timeout",!1,D)},1E4); fetch(w,{signal:L.signal}).then(function(k){clearTimeout(Z);k.ok?v0(M,"TestPingServer: ok",!0,D):v0(M,"TestPingServer: server error",!1,D)}).catch(function(){clearTimeout(Z); v0(M,"TestPingServer: error",!1,D)})},v0=function(w,D,M,L,Z){try{Z&&(Z.onload=null,Z.onerror=null,Z.onabort=null,Z.ontimeout=null),L(M)}catch(k){}},fDl=function(){this.T=new IU},c0=function(w,D,M){return M&&M.Eu?M.Eu[w]||D:D},q6r=function(w){this.L=[]; this.GU=this.Qi=this.Jc=this.NC=this.T=this.k6=this.W_=this.fV=this.G=this.TU=this.B=null;this.BI=this.bW=0;this.Nr=c0("failFast",!1,w);this.jk=this.y7=this.U=this.Y=this.W=null;this.wW=!0;this.UV=this.XE=-1;this.Sb=this.V7=this.nV=0;this.Wd=c0("baseRetryDelayMs",5E3,w);this.X6=c0("retryDelaySeedMs",1E4,w);this.wz=c0("forwardChannelMaxRetries",2,w);this.uj=c0("forwardChannelRequestTimeoutMs",2E4,w);this.FK=w&&w.W3_||void 0;this.QF=w&&w.LWt||void 0;this.TC=w&&w.oU7||!1;this.Nd=void 0;this.Md=w&&w.qH5|| !1;this.D="";this.V=new sC7(w&&w.Xsd);this.yF=new fDl;this.iW=w&&w.W_J||!1;this.pV=w&&w.TsV||!1;this.iW&&this.pV&&(this.pV=!1);this.kP=w&&w.dnE||!1;w&&w.tEW&&(this.wW=!1);this.HA=!this.iW&&this.wW&&w&&w.eTE||!1;this.Is=void 0;w&&w.Tm&&w.Tm>0&&(this.Is=w.Tm);this.mu=void 0;this.FQ=0;this.EL=!1;this.oO=this.c_=null},GS=function(w){w.T&&(r5r(w),w.T.cancel(),w.T=null)},ePZ=function(w){GS(w); w.U&&(g.KI.clearTimeout(w.U),w.U=null);FL(w);w.V.cancel();w.Y&&(typeof w.Y==="number"&&g.KI.clearTimeout(w.Y),w.Y=null)},aU=function(w){aDP(w.V)||w.Y||(w.Y=!0,g.j4(w.f4,w),w.nV=0)},T_S=function(w,D){if(jC7(w.V)>=w.V.D-(w.Y?1:0))return!1; if(w.Y)return w.L=D.V7.concat(w.L),!0;if(w.Tr==1||w.Tr==2||w.nV>=(w.Nr?0:w.wz))return!1;w.Y=No((0,g.Ck)(w.f4,w,D),XTB(w,w.nV));w.nV++;return!0},S6P=function(w,D){var M; D?M=D.GU:M=w.bW++;var L=w.Jc.clone();g.YA(L,"SID",w.D);g.YA(L,"RID",M);g.YA(L,"AID",w.XE);B0(w,L);w.G&&w.B&&g.po(L,w.G,w.B);M=new jR(w,w.D,M,w.nV+1);w.G===null&&(M.Jc=w.B);D&&(w.L=D.V7.concat(w.L));D=uTx(w,M,1E3);M.setTimeout(Math.round(w.uj*.5)+Math.round(w.uj*.5*Math.random()));gqQ(w.V,M);WgB(M,L,D)},B0=function(w,D){w.fV&&g.mr(w.fV,function(M,L){g.YA(D,L,M)}); w.W&&g.mr({},function(M,L){g.YA(D,L,M)})},uTx=function(w,D,M){M=Math.min(w.L.length,M); var L=w.W?(0,g.Ck)(w.W.wq,w.W,w):null;a:{for(var Z=w.L,k=-1;;){var b=["count="+M];k==-1?M>0?(k=Z[0].T,b.push("ofs="+k)):k=0:b.push("ofs="+k);for(var C=!0,l=0;l=3)return!1; w.Sb++;w.U=No((0,g.Ck)(w.F5,w),XTB(w,w.V7));w.V7++;return!0},r5r=function(w){w.c_!=null&&(g.KI.clearTimeout(w.c_),w.c_=null)},QCZ=function(w){w.T=new jR(w,w.D,"rpc",w.Sb); w.G===null&&(w.T.Jc=w.B);w.T.Nd=0;var D=w.Qi.clone();g.YA(D,"RID","rpc");g.YA(D,"SID",w.D);g.YA(D,"AID",w.XE);g.YA(D,"CI",w.jk?"0":"1");!w.jk&&w.Is&&g.YA(D,"TO",w.Is);g.YA(D,"TYPE","xmlhttp");B0(w,D);w.G&&w.B&&g.po(D,w.G,w.B);w.Nd&&w.T.setTimeout(w.Nd);var M=w.T;w=w.GU;M.Md=1;M.U=AC(D.clone());M.B=null;M.W_=!0;pT7(M,w)},FL=function(w){w.y7!=null&&(g.KI.clearTimeout(w.y7),w.y7=null)},xDQ=function(w,D){var M=null; if(w.T==D){FL(w);r5r(w);w.T=null;var L=2}else if(N_7(w.V,D))M=D.V7,oqZ(w.V,D),L=1;else return;if(w.Tr!=0)if(D.Y)if(L==1){M=D.B?D.B.length:0;D=Date.now()-D.nV;var Z=w.nV;L=bfr();L.dispatchEvent(new lDr(L,M,D,Z));aU(w)}else nqs(w);else{var k=D.mu;Z=D.getLastError();if(Z==3||Z==0&&k>0||!(L==1&&T_S(w,D)||L==2&&Hfr(w)))switch(M&&M.length>0&&(D=w.V,D.L=D.L.concat(M)),Z){case 1:sG(w,5);break;case 4:sG(w,10);break;case 3:sG(w,6);break;default:sG(w,2)}}},XTB=function(w,D){var M=w.Wd+Math.floor(Math.random()* w.X6); w.isActive()||(M*=2);return M*D},sG=function(w,D){if(D==2){var M=(0,g.Ck)(w.AWE,w),L=w.QF,Z=!L; L=new g.Au(L||"//www.google.com/images/cleardot.gif");g.KI.location&&g.KI.location.protocol=="http"||g.wG(L,"https");AC(L);Z?c5Q(L.toString(),M):B_S(L.toString(),M)}else xp(2);w.Tr=0;w.W&&w.W.Mw(D);J5D(w);ePZ(w)},J5D=function(w){w.Tr=0; w.oO=[];if(w.W){var D=vqk(w.V);if(D.length!=0||w.L.length!=0)g.sl(w.oO,D),g.sl(w.oO,w.L),w.V.L.length=0,g.GD(w.L),w.L.length=0;w.W.xz()}},zPP=function(w){if(w.Tr==0)return w.oO; var D=[];g.sl(D,vqk(w.V));g.sl(D,w.L);return D},RPx=function(w,D,M){var L=g.Co(M); L.T!=""?(D&&g.Df(L,D+"."+L.T),g.Mh(L,L.L)):(L=g.KI.location,L=AYr(L.protocol,D?D+"."+L.hostname:L.hostname,+L.port,M));D=w.W_;M=w.k6;D&&M&&g.YA(L,D,M);g.YA(L,"VER",w.g$);B0(w,L);return L},hP1=function(w,D,M){if(D&&!w.Md)throw Error("Can't create secondary domain capable XhrIo object."); D=w.TC&&!w.FK?new g.Ty(new g.Px({Ae:M})):new g.Ty(w.FK);D.G=w.Md;return D},V$1=function(){},PEk=function(){},qo=function(w,D){g.Ej.call(this); this.T=new q6r(D);this.W=w;this.V=D&&D.w_D||null;w=D&&D.N9J||null;D&&D.wsc&&(w?w["X-Client-Protocol"]="webchannel":w={"X-Client-Protocol":"webchannel"});this.T.B=w;w=D&&D.hb7||null;D&&D.Wa&&(w?w["X-WebChannel-Content-Type"]=D.Wa:w={"X-WebChannel-Content-Type":D.Wa});D&&D.qj&&(w?w["X-WebChannel-Client-Profile"]=D.qj:w={"X-WebChannel-Client-Profile":D.qj});this.T.TU=w;(w=D&&D.vQJ)&&!g.s3(w)&&(this.T.G=w);this.Y=D&&D.qH5||!1;this.D=D&&D.vZD||!1;(D=D&&D.N9)&&!g.s3(D)&&(this.T.W_=D,g.l1(this.V,D)&&(w= this.V,D in w&&delete w[D]));this.L=new fx(this)},Ofk=function(w){Lgl.call(this); w.__headers__&&(this.headers=w.__headers__,this.statusCode=w.__status__,delete w.__headers__,delete w.__status__);var D=w.__sm__;D?this.data=(this.T=g.Mc(D))?g.h7(D,this.T):D:this.data=w},Kgr=function(w){Zfl.call(this); this.status=1;this.errorCode=w},fx=function(w){this.T=w},mD7=function(w,D){this.V=w; this.T=D},A5r=function(w){return zPP(w.T).map(function(D){var M=w.V; D=D.map;"__data__"in D?(D=D.__data__,M=M.D?Q_Z(D):D):M=D;return M})},rc=function(w,D){if(typeof w!=="function")throw Error("Fn must not be null and must be a function"); return g.KI.setTimeout(function(){w()},D)},XL=function(w){eR.dispatchEvent(new wAZ(eR,w))},wAZ=function(w){g.SO.call(this,"statevent",w)},TS=function(w,D,M,L){this.T=w; this.D=D;this.G=M;this.Y=L||1;this.V=45E3;this.L=new g.Wf(this);this.W=new g.vj;this.W.setInterval(250)},MBl=function(w,D,M){w.KB=1; w.bl=AC(D.clone());w.Nf=M;w.W_=!0;DRQ(w,null)},Lyx=function(w,D,M,L,Z){w.KB=1; w.bl=AC(D.clone());w.Nf=null;w.W_=M;Z&&(w.Cj=!1);DRQ(w,L)},DRQ=function(w,D){w.eX=Date.now(); Zuk(w);w.W7=w.bl.clone();wc(w.W7,"t",w.Y);w.t7=0;w.xk=w.T.k5(w.T.q7()?D:null);w.NA>0&&(w.P7=new g.zC((0,g.Ck)(w.jR,w,w.xk),w.NA));w.L.listen(w.xk,"readystatechange",w.kS);D=w.vV?g.$O(w.vV):{};w.Nf?(w.c7="POST",D["Content-Type"]="application/x-www-form-urlencoded",w.xk.send(w.W7,w.c7,w.Nf,D)):(w.c7="GET",w.Cj&&!g.Eg&&(D.Connection="close"),w.xk.send(w.W7,w.c7,null,D));w.T.ZE(1)},Yns=function(w,D){var M=w.t7,L=D.indexOf("\n",M); if(L==-1)return kG7;M=Number(D.substring(M,L));if(isNaN(M))return bu1;L+=1;if(L+M>D.length)return kG7;D=D.slice(L,L+M);w.t7=L+M;return D},Zuk=function(w){w.Xq=Date.now()+w.V; CZ7(w,w.V)},CZ7=function(w,D){if(w.zW!=null)throw Error("WatchDog timer not null"); w.zW=rc((0,g.Ck)(w.Xn,w),D)},lF1=function(w){w.zW&&(g.KI.clearTimeout(w.zW),w.zW=null)},EoZ=function(w){w.T.VL()||w.Ql||w.T.Qu(w)},uq=function(w){lF1(w); g.M9(w.P7);w.P7=null;w.W.stop();w.L.removeAll();if(w.xk){var D=w.xk;w.xk=null;D.abort();D.dispose()}w.gQ&&(w.gQ=null)},pAk=function(w,D){try{w.T.d$(w,D),w.T.ZE(4)}catch(M){}},heS=function(w,D,M,L,Z){if(L==0)M(!1); else{var k=Z||0;L--;Wy1(w,D,function(b){b?M(!0):g.KI.setTimeout(function(){heS(w,D,M,L,k)},k)})}},Wy1=function(w,D,M){var L=new Image; L.onload=function(){try{SR(L),M(!0)}catch(Z){}}; L.onerror=function(){try{SR(L),M(!1)}catch(Z){}}; L.onabort=function(){try{SR(L),M(!1)}catch(Z){}}; L.ontimeout=function(){try{SR(L),M(!1)}catch(Z){}}; g.KI.setTimeout(function(){if(L.ontimeout)L.ontimeout()},D); L.src=w},SR=function(w){w.onload=null; w.onerror=null;w.onabort=null;w.ontimeout=null},tB3=function(w){this.T=w; this.V=new IU},$Rx=function(w){var D=Qk(w.T,w.Ih,"/mail/images/cleardot.gif"); AC(D);heS(D.toString(),5E3,(0,g.Ck)(w.BP,w),3,2E3);w.ZE(1)},iuD=function(w){var D=w.T.Y; D!=null?(XL(5),D?(XL(11),JZ(w.T,w,!1)):(XL(12),JZ(w.T,w,!0))):(w.WX=new TS(w),w.WX.vV=w.b4,D=w.T,D=Qk(D,D.q7()?w.CB:null,w.EE),XL(5),wc(D,"TYPE","xmlhttp"),Lyx(w.WX,D,!1,w.CB,!1))},dR1=function(w,D,M){this.T=1; this.V=[];this.L=[];this.W=new IU;this.B=w||null;this.Y=D!=null?D:null;this.U=M||!1},yKS=function(w,D){this.T=w; this.map=D;this.context=null},IFl=function(w,D,M,L){g.SO.call(this,"timingevent",w); this.size=D;this.rtt=M;this.retries=L},URQ=function(w){g.SO.call(this,"serverreachability",w)},N47=function(w){w.bV(1,0); w.aI=Qk(w,null,w.qA);xRr(w)},HuD=function(w){w.fD&&(w.fD.abort(),w.fD=null); w.P9&&(w.P9.cancel(),w.P9=null);w.Pw&&(g.KI.clearTimeout(w.Pw),w.Pw=null);zS(w);w.GV&&(w.GV.cancel(),w.GV=null);w.Hi&&(g.KI.clearTimeout(w.Hi),w.Hi=null)},jzQ=function(w,D){if(w.T==0)throw Error("Invalid operation: sending map when state is closed"); w.V.push(new yKS(w.Qc++,D));w.T!=2&&w.T!=3||xRr(w)},go7=function(w){var D=0; w.P9&&D++;w.GV&&D++;return D},xRr=function(w){w.GV||w.Hi||(w.Hi=rc((0,g.Ck)(w.Id,w),0),w.Dg=0)},no3=function(w,D){if(w.T==1){if(!D){w.R_=Math.floor(Math.random()*1E5); D=w.R_++;var M=new TS(w,"",D);M.vV=w.oQ;var L=Re7(w),Z=w.aI.clone();g.YA(Z,"RID",D);g.YA(Z,"CVER","1");Vk(w,Z);MBl(M,Z,L);w.GV=M;w.T=2}}else w.T==3&&(D?oor(w,D):w.V.length==0||w.GV||oor(w))},oor=function(w,D){if(D)if(w.w0>6){w.V=w.L.concat(w.V); w.L.length=0;var M=w.R_-1;D=Re7(w)}else M=D.G,D=D.Nf;else M=w.R_++,D=Re7(w);var L=w.aI.clone();g.YA(L,"SID",w.D);g.YA(L,"RID",M);g.YA(L,"AID",w.n1);Vk(w,L);M=new TS(w,w.D,M,w.Dg+1);M.vV=w.oQ;M.setTimeout(1E4+Math.round(1E4*Math.random()));w.GV=M;MBl(M,L,D)},Vk=function(w,D){w.y4&&(w=w.y4.bR())&&g.mr(w,function(M,L){g.YA(D,L,M)})},Re7=function(w){var D=Math.min(w.V.length,1E3),M=["count="+D]; if(w.w0>6&&D>0){var L=w.V[0].T;M.push("ofs="+L)}else L=0;for(var Z={},k=0;k=3)return!1; w.G++;w.Pw=rc((0,g.Ck)(w.lR,w),GGr(w,w.o3));w.o3++;return!0},JZ=function(w,D,M){w.oL=w.Y==null?M:!w.Y; w.x7=D.ZH;w.U||N47(w)},zS=function(w){w.Xf!=null&&(g.KI.clearTimeout(w.Xf),w.Xf=null)},GGr=function(w,D){var M=5E3+Math.floor(Math.random()*1E4); w.isActive()||(M*=2);return M*D},P0=function(w,D){if(D==2||D==9){var M=null; w.y4&&(M=null);var L=(0,g.Ck)(w.BdV,w);M||(M=new g.Au("//www.google.com/images/cleardot.gif"),AC(M));Wy1(M.toString(),1E4,L)}else XL(2);aFD(w,D)},aFD=function(w,D){w.T=0; w.y4&&w.y4.Nw(D);vo1(w);HuD(w)},vo1=function(w){w.T=0; w.x7=-1;if(w.y4)if(w.L.length==0&&w.V.length==0)w.y4.u4();else{var D=g.GD(w.L),M=g.GD(w.V);w.L.length=0;w.V.length=0;w.y4.u4(D,M)}},Qk=function(w,D,M){var L=g.Co(M); if(L.T!="")D&&g.Df(L,D+"."+L.T),g.Mh(L,L.L);else{var Z=window.location;L=AYr(Z.protocol,D?D+"."+Z.hostname:Z.hostname,+Z.port,M)}w.ul&&g.mr(w.ul,function(k,b){g.YA(L,b,k)}); g.YA(L,"VER",w.w0);Vk(w,L);return L},cKs=function(){},B4P=function(){this.T=[]; this.V=[]},fFZ=function(w){g.SO.call(this,"channelMessage"); this.message=w},qnx=function(w){g.SO.call(this,"channelError"); this.error=w},rK3=function(w,D){this.action=w; this.params=D||{}},OG=function(w,D){g.X.call(this); this.T=new g.ui(this.XrJ,0,this);g.T(this,this.T);this.LP=5E3;this.V=0;if(typeof w==="function")D&&(w=(0,g.Ck)(w,D));else if(w&&typeof w.handleEvent==="function")w=(0,g.Ck)(w.handleEvent,w);else throw Error("Invalid listener argument");this.L=w},eeS=function(w,D,M,L,Z,k,b,C,l,E,p,W,h,t){M=M===void 0?!1:M; L=L===void 0?function(){return""}:L; Z=Z===void 0?!1:Z;k=k===void 0?!1:k;b=b===void 0?!1:b;C=C===void 0?function(){return g.nv({})}:C; l=l===void 0?!1:l;p=p===void 0?!1:p;W=W===void 0?!1:W;h=h===void 0?!1:h;t=t===void 0?!1:t;this.Md=w;this.y7=D;this.Y=new g.IF;this.V=new OG(this.yWD,this);this.T=null;this.G=!1;this.B=null;this.nV="";this.V7=this.U=0;this.L=[];this.oO=M;this.W_=L;this.W=k;this.Jc=C;this.fV=E;this.Sb=b;this.c_=null;this.D=g.nv();this.GU=Z;this.TU=l;this.iW=p;this.pV=W;this.NC=h;this.mu=t;this.Nd=new JYD;this.jk=new zgB;this.EL=new PUx;this.bW=new VJZ;this.XE=new O7Z;this.wW=new KUS;this.HA=new m2Z},uV3=function(w, D,M,L,Z){XAs(w); if(w.T){var k=g.Xg("ID_TOKEN"),b=w.T.oQ||{};k?b["x-youtube-identity-token"]=k:delete b["x-youtube-identity-token"];w.T.oQ=b}T4B(w);L?(L.getState()!=3&&go7(L)==0||L.getState(),w.T.connect(D,M,w.y7,L.D,L.n1)):Z?w.T.connect(D,M,w.y7,Z.sessionId,Z.arrayId):w.T.connect(D,M,w.y7)},zer=function(w,D){return w.NC?!0:w.pV?Object.values(Sn1).includes(D):w.iW?!Object.values(QzZ).includes(D):w.mu?Object.values(JK1).includes(D):!1},Ou3=function(w){var D,M; g.B(function(L){if(L.T==1)return g.gR(L,2),g.c(L,VB1(w),2);g.vr(L);D=w.L;w.L=[];M=D.length;PZ7(w,D,M);Kx(w);return g.cr(L,0)})},PZ7=function(w,D,M){for(var L=0;L0?M=Object.assign({},M,D):delete M.Authorization;w.T.oQ=M}},T4B=function(w){w.fV&&!w.W&&mR3(w,w.fV())},mn=function(w){this.scheme="https"; this.port=this.domain="";this.T="/api/lounge";this.V=!0;w=w||document.location.href;var D=Number(g.lX(w)[4]||null)||"";D&&(this.port=":"+D);this.domain=g.ER(w)||"";w=g.qc();w.search("MSIE")>=0&&(w=w.match(/MSIE ([\d.]+)/)[1],g.fW(w,"10.0")<0&&(this.V=!1))},AZ=function(w,D){var M=w.T; w.V&&(M=w.scheme+"://"+w.domain+w.port+w.T);return g.dh(M+D,{})},AK3=function(w,D){g.Ej.call(this); var M=this;this.handler=w();this.handler.subscribe("handlerOpened",this.qe,this);this.handler.subscribe("handlerClosed",this.onClosed,this);this.handler.subscribe("handlerError",function(L,Z){M.onError(Z)}); this.handler.subscribe("handlerMessage",this.onMessage,this);this.T=D},wJr=function(w,D,M){var L=this; M=M===void 0?function(){return""}:M; var Z=Z===void 0?new PEk:Z;var k=k===void 0?new g.IF:k;this.pathPrefix=w;this.T=D;this.nV=M;this.W=k;this.U=null;this.B=this.G=0;this.channel=null;this.Y=0;this.L=new OG(function(){L.L.isActive();var b;((b=L.channel)==null?void 0:jC7((new mD7(b,b.T)).T.V))===0&&L.connect(L.U,L.G)}); this.D={};this.V={};this.y7=!1;this.logger=null;this.V7=[];this.Qy=void 0;this.Jc=new JYD;this.c_=new zgB;this.fV=new VJZ;this.W_=new O7Z},DY3=function(w){g.mK(w.channel,"m",function(){w.Y=3; w.L.reset();w.U=null;w.G=0;for(var D=g.x(w.V7),M=D.next();!M.done;M=D.next())M=M.value,w.channel&&w.channel.send(M);w.V7=[];w.publish("webChannelOpened");w.Jc.qr("WEB_CHANNEL")}); g.mK(w.channel,"n",function(){w.Y=0;w.L.isActive()||w.publish("webChannelClosed");var D,M=(D=w.channel)==null?void 0:A5r(new mD7(D,D.T));M&&(w.V7=[].concat(g.tG(M)));w.c_.qr("WEB_CHANNEL")}); g.mK(w.channel,"p",function(D){var M=D.data;M[0]==="gracefulReconnect"?(w.L.start(),w.channel&&w.channel.close()):w.publish("webChannelMessage",new rK3(M[0],M[1]));w.Qy=D.statusCode;w.fV.qr("WEB_CHANNEL")}); g.mK(w.channel,"o",function(){w.Qy===401||w.L.start();w.publish("webChannelError");w.W_.qr("WEB_CHANNEL","")})},MCD=function(w){var D=w.nV(); D?w.D["x-youtube-lounge-xsrf-token"]=D:delete w.D["x-youtube-lounge-xsrf-token"]},LOP=function(w){g.Ej.call(this); this.T=w();this.T.subscribe("webChannelOpened",this.uV,this);this.T.subscribe("webChannelClosed",this.onClosed,this);this.T.subscribe("webChannelError",this.onError,this);this.T.subscribe("webChannelMessage",this.onMessage,this)},ZVx=function(w,D,M,L,Z){function k(){return new eeS(AZ(w,"/bc"),D,!1,M,L)} M=M===void 0?function(){return""}:M; return g.hY("enable_mdx_web_channel_desktop")?new LOP(function(){return new wJr(AZ(w,"/wc"),D,M)}):new AK3(k,Z)},CGD=function(){var w=khr; bVZ();wm.push(w);YaP()},Dc=function(w,D){bVZ(); var M=ler(w,String(D));wm.length==0?Erx(M):(YaP(),g.PQ(wm,function(L){L(M)}))},Ms=function(w){Dc("CP",w)},bVZ=function(){wm||(wm=g.w3("yt.mdx.remote.debug.handlers_")||[],g.mC("yt.mdx.remote.debug.handlers_",wm))},Erx=function(w){var D=(L0+1)%50; L0=D;Zc[D]=w;kh||(kh=D==49)},YaP=function(){var w=wm; if(Zc[0]){var D=kh?L0:-1,M={};do M={qM:void 0},D=(D+1)%50,M.qM=Zc[D],g.PQ(w,function(L){return function(Z){Z(L.qM)}}(M)); while(D!=L0);Zc=Array(50);L0=-1;kh=!1}},ler=function(w,D){var M=(Date.now()-pJD)/1E3; M.toFixed&&(M=M.toFixed(3));var L=[];L.push("[",M+"s","] ");L.push("[","yt.mdx.remote","] ");L.push(w+": "+D,"\n");return L.join("")},bV=function(w){g.mI.call(this); this.Y=w;this.screens=[]},WOs=function(w,D){var M=w.get(D.uuid)||w.get(D.id); if(M)return w=M.name,M.id=D.id||M.id,M.name=D.name,M.token=D.token,M.uuid=D.uuid||M.uuid,M.name!=w;w.screens.push(D);return!0},h9B=function(w,D){var M=w.screens.length!=D.length; w.screens=g.ox(w.screens,function(k){return!!sjr(D,k)}); for(var L=D.length,Z=0;Z0&&w.D0&&Il(w,M)},function(D){w.W=function(){}; w.R4(D)})},uSk=function(w){var D={}; D.pairingCode=w.c_;D.theme=w.Md;uR3()&&(D.env_useStageMdx=1);return g.iX(D)},Sas=function(w){return new Promise(function(D){w.c_=FEQ(); if(w.Jc){var M=new chrome.cast.DialLaunchResponse(!0,uSk(w));D(M);THZ(w)}else w.y7=function(){g.EO(w.B);w.y7=function(){}; w.B=NaN;var L=new chrome.cast.DialLaunchResponse(!0,uSk(w));D(L);THZ(w)},w.B=g.C7(function(){w.y7()},100)})},JzS=function(w,D,M){w.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(D)); var L=new Yp(D);return(new Promise(function(Z){QRs(w,L,function(k){k?(w.V7=!0,W6(w.D,L),tl(w,L),Il(w,M)):g.S2(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(D)+" is not online."));Z(k)},5)})).then(function(Z){return Z?new chrome.cast.DialLaunchResponse(!1):Sas(w)})},z97=function(w,D){var M=w.U.receiver.label,L=w.V.friendlyName; return(new Promise(function(Z){grS(w.D,M,D,L,function(k){k&&k.token&&tl(w,k);Z(k)},function(k){$h(w,"Failed to get DIAL screen: "+k); Z(null)})})).then(function(Z){return Z&&Z.token?new chrome.cast.DialLaunchResponse(!1):Sas(w)})},QRs=function(w,D,M,L){g.EO(w.Y); w.Y=0;or3(w.D,D,function(Z){Z||L<0?M(Z):w.Y=g.C7(function(){QRs(w,D,M,L-1)},300)})},Il=function(w,D){w.info("getDialAppInfoWithTimeout_ "+D); yV(w)&&(g.EO(w.G),w.G=0,D==0?VCB(w):w.G=g.C7(function(){VCB(w)},D))},VCB=function(w){yV(w)&&w.L.getDialAppInfo(function(D){w.info("getDialAppInfo dialLaunchData: "+JSON.stringify(D)); D=D.extraData||{};var M=null;if(D.loungeToken){var L;((L=w.T)==null?void 0:L.token)==D.loungeToken&&(M="staleLoungeToken")}else M="missingLoungeToken";M?(w.nV=M,Il(w,3E4)):(w.V7=!1,w.nV="unknown",sRP(w,D.loungeToken),Il(w,D.loungeTokenRefreshIntervalMs))},function(D){w.info("getDialAppInfo error: "+D); w.nV="noLoungeTokenResponse";Il(w,3E4)})},PGr=function(w){g.EO(w.Y); w.Y=0;g.EO(w.G);w.G=0;w.W();w.W=function(){}; g.EO(w.B)},Um=function(w,D){hl.call(this,w,D,"ManualSession"); this.L=g.C7((0,g.Ck)(this.uX,this,null),150)},xh=function(w,D){g.mI.call(this); this.config_=D;this.V=w;this.U=D.appId||"233637DE";this.D=D.theme||"cl";this.B=D.disableCastApi||!1;this.Y=D.forceMirroring||!1;this.T=null;this.G=!1;this.L=[];this.W=(0,g.Ck)(this.U$k,this)},OVr=function(w,D){return D?g.y1(w.L,function(M){return Cx(D,M.label)},w):null},Ns=function(w){Dc("Controller",w)},khr=function(w){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(w)},H6=function(w){return w.G||!!w.L.length||!!w.T},jS=function(w,D,M){D!=w.T&&(g.M9(w.T),(w.T=D)?(M?w.publish("yt-remote-cast2-receiver-resumed", D.V):w.publish("yt-remote-cast2-receiver-selected",D.V),D.subscribe("sessionScreen",(0,g.Ck)(w.n_,w,D)),D.subscribe("sessionFailed",function(){return KOQ(w,D)}),D.T?w.publish("yt-remote-cast2-session-change",D.T):M&&w.T.uX(null)):w.publish("yt-remote-cast2-session-change",null))},KOQ=function(w,D){w.T==D&&w.publish("yt-remote-cast2-session-failed")},mYl=function(w){var D=w.V.QS(),M=w.T&&w.T.V; w=g.yR(D,function(L){M&&Cx(L,M.label)&&(M=null);var Z=L.uuid?L.uuid:L.id,k=OVr(this,L);k?(k.label=Z,k.friendlyName=L.name):(k=new chrome.cast.Receiver(Z,L.name),k.receiverType=chrome.cast.ReceiverType.CUSTOM);return k},w); M&&(M.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(M=new chrome.cast.Receiver(M.label,M.friendlyName),M.receiverType=chrome.cast.ReceiverType.CUSTOM),w.push(M));return w},b1D=function(w,D,M,L){L.disableCastApi?gm("Cannot initialize because disabled by Mdx config."):Azr()?wLP(D,L)&&(DmS(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?Mn7(w,M):(window.__onGCastApiAvailable=function(Z,k){Z?Mn7(w,M):(Rl("Failed to load cast API: "+k),LIS(!1),DmS(!1),g.oj("yt-remote-cast-available"),g.oj("yt-remote-cast-receiver"), Z11(),M(!1))},L.loadCastApiSetupScript?g.Ku(ko3):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?QjQ()>=60&&wTr():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?PCB():QjQ()>=89?M$Q():(AaB(),dc(DDQ.map(OeZ))))):gm("Cannot initialize because not running Chrome")},Z11=function(){gm("dispose"); var w=ol();w&&w.dispose();g.mC("yt.mdx.remote.cloudview.instance_",null);Yfx(!1);g.PA(CyQ);CyQ.length=0},n0=function(){return!!g.Rj("yt-remote-cast-installed")},lSx=function(){var w=g.Rj("yt-remote-cast-receiver"); return w?w.friendlyName:null},E9D=function(){gm("clearCurrentReceiver"); g.oj("yt-remote-cast-receiver")},pL1=function(){return n0()?ol()?ol().getCastSession():(Rl("getCastSelector: Cast is not initialized."),null):(Rl("getCastSelector: Cast API is not installed!"),null)},WIs=function(){n0()?ol()?Fd()?(gm("Requesting cast selector."),ol().requestSession()):(gm("Wait for cast API to be ready to request the session."),CyQ.push(g.Vn("yt-remote-cast2-api-ready",WIs))):Rl("requestCastSelector: Cast is not initialized."):Rl("requestCastSelector: Cast API is not installed!")}, GE=function(w,D){Fd()?ol().setConnectedScreenStatus(w,D):Rl("setConnectedScreenStatus called before ready.")},Azr=function(){var w=g.qc().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.d5||w},hb1=function(w,D){ol().init(w,D)},wLP=function(w,D){var M=!1; ol()||(w=new xh(w,D),w.subscribe("yt-remote-cast2-availability-change",function(L){g.gQ("yt-remote-cast-available",L);$p("yt-remote-cast2-availability-change",L)}),w.subscribe("yt-remote-cast2-receiver-selected",function(L){gm("onReceiverSelected: "+L.friendlyName); g.gQ("yt-remote-cast-receiver",L);$p("yt-remote-cast2-receiver-selected",L)}),w.subscribe("yt-remote-cast2-receiver-resumed",function(L){gm("onReceiverResumed: "+L.friendlyName); g.gQ("yt-remote-cast-receiver",L);$p("yt-remote-cast2-receiver-resumed",L)}),w.subscribe("yt-remote-cast2-session-change",function(L){gm("onSessionChange: "+lq(L)); L||g.oj("yt-remote-cast-receiver");$p("yt-remote-cast2-session-change",L)}),g.mC("yt.mdx.remote.cloudview.instance_",w),M=!0); gm("cloudview.createSingleton_: "+M);return M},ol=function(){return g.w3("yt.mdx.remote.cloudview.instance_")},Mn7=function(w,D){LIS(!0); DmS(!1);hb1(w,function(M){M?(Yfx(!0),g.On("yt-remote-cast2-api-ready")):(Rl("Failed to initialize cast API."),LIS(!1),g.oj("yt-remote-cast-available"),g.oj("yt-remote-cast-receiver"),Z11());D(M)})},gm=function(w){Dc("cloudview",w)},Rl=function(w){Dc("cloudview",w)},LIS=function(w){gm("setCastInstalled_ "+w); g.gQ("yt-remote-cast-installed",w)},Fd=function(){return!!g.w3("yt.mdx.remote.cloudview.apiReady_")},Yfx=function(w){gm("setApiReady_ "+w); g.mC("yt.mdx.remote.cloudview.apiReady_",w)},DmS=function(w){g.mC("yt.mdx.remote.cloudview.initializing_",w)},sm=function(w){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.W=this.Y=0;this.trackData=null;this.lz=this.ym=!1;this.U=this.L=this.G=this.V=0;this.T=NaN;this.D=!1;this.reset(w)},tn3=function(w){w.audioTrackId=null; w.trackData=null;w.playerState=-1;w.ym=!1;w.lz=!1;w.Y=0;w.W=g.pk();w.V=0;w.G=0;w.L=0;w.U=0;w.T=NaN;w.D=!1},al=function(w){return w.isPlaying()?(g.pk()-w.W)/1E3:0},v6=function(w,D){w.Y=D; w.W=g.pk()},c6=function(w){switch(w.playerState){case 1:case 1081:return(g.pk()-w.W)/1E3+w.Y; case -1E3:return 0}return w.Y},$mZ=function(w){return w.D?w.G+al(w):w.G},B6=function(w,D,M){var L=w.videoId; w.videoId=D;w.index=M;D!=L&&tn3(w)},i1x=function(w){var D={}; D.index=w.index;D.listId=w.listId;D.videoId=w.videoId;D.playerState=w.playerState;D.volume=w.volume;D.muted=w.muted;D.audioTrackId=w.audioTrackId;D.trackData=g.i1(w.trackData);D.hasPrevious=w.ym;D.hasNext=w.lz;D.playerTime=w.Y;D.playerTimeAt=w.W;D.seekableStart=w.V;D.seekableEnd=w.G;D.duration=w.L;D.loadedTime=w.U;D.liveIngestionTime=w.T;return D},qs=function(w,D){g.mI.call(this); var M=this;this.L=0;this.D=w;this.Y=[];this.W=new B4P;this.V=this.T=null;this.B=(0,g.Ck)(this.Ku7,this);this.G=(0,g.Ck)(this.yR,this);this.U=(0,g.Ck)(this.Wu_,this);this.y7=(0,g.Ck)(this.tb_,this);var L=0;w?(L=w.getProxyState(),L!=3&&(w.subscribe("proxyStateChange",this.aX,this),dm7(this))):L=3;L!=0&&(D?this.aX(L):g.C7(function(){M.aX(L)},0)); (w=pL1())&&f0(this,w);this.subscribe("yt-remote-cast2-session-change",this.y7)},rm=function(w){return new sm(w.D.getPlayerContextData())},dm7=function(w){g.PQ("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(D){this.Y.push(this.D.subscribe(D,g.El(this.Btd,D),this))},w)},yn3=function(w){g.PQ(w.Y,function(D){this.D.unsubscribeByKey(D)},w); w.Y.length=0},eS=function(w){return w.getState()==1},Xd=function(w,D){var M=w.W; M.T.length+M.V.length<50&&w.W.enqueue(D)},ISB=function(w,D,M){var L=rm(w); v6(L,M);L.playerState!=-1E3&&(L.playerState=D);TE(w,L)},uV=function(w,D,M){w.D.sendMessage(D,M)},TE=function(w,D){yn3(w); w.D.setPlayerContextData(i1x(D));dm7(w)},f0=function(w,D){w.V&&(w.V.removeUpdateListener(w.B),w.V.removeMediaListener(w.G),w.yR(null)); w.V=D;w.V&&(Ms("Setting cast session: "+w.V.sessionId),w.V.addUpdateListener(w.B),w.V.addMediaListener(w.G),w.V.media.length&&w.yR(w.V.media[0]))},Umr=function(w){var D=w.T.media,M=w.T.customData; if(D&&M){var L=rm(w);D.contentId!=L.videoId&&Ms("Cast changing video to: "+D.contentId);L.videoId=D.contentId;L.playerState=M.playerState;v6(L,w.T.getEstimatedTime());TE(w,L)}else Ms("No cast media video. Ignoring state update.")},SS=function(w,D,M){return(0,g.Ck)(function(L){this.FX("Failed to "+D+" with cast v2 channel. Error code: "+L.code); L.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.FX("Retrying "+D+" using MDx browser channel."),uV(this,D,M))},w)},zE=function(w,D,M,L){L=L===void 0?!1:L; g.mI.call(this);var Z=this;this.Y=NaN;this.c_=!1;this.B=this.U=this.V7=this.nV=NaN;this.y7=[];this.W=this.G=this.D=this.T=this.V=null;this.Jc=w;this.fV=L;this.y7.push(g.$7(window,"beforeunload",function(){Z.bx(2)})); this.L=[];this.T=new sm;this.Md=D.id;this.W_=D.idType;this.V=ZVx(this.Jc,M,this.Rd,this.W_=="shortLived",this.Md);this.V.listen("channelOpened",function(){xmB(Z)}); this.V.listen("channelClosed",function(){QV("Channel closed");isNaN(Z.Y)?hZ(!0):hZ();Z.dispose()}); this.V.listen("channelError",function(k){hZ();isNaN(Z.EY())?(k==1&&Z.W_=="shortLived"&&Z.publish("browserChannelAuthError",k),QV("Channel error: "+k+" without reconnection"),Z.dispose()):(Z.c_=!0,QV("Channel error: "+k+" with reconnection in "+Z.EY()+" ms"),Jl(Z,2))}); this.V.listen("channelMessage",function(k){NOB(Z,k)}); this.V.XN(D.token);this.subscribe("remoteQueueChange",function(){var k=Z.T.videoId;g.ne()&&g.gQ("yt-remote-session-video-id",k)})},H1S=function(w){return g.y1(w.L,function(D){return D.type=="LOUNGE_SCREEN"})},QV=function(w){Dc("conn",w)},Jl=function(w,D){w.publish("proxyStateChange",D)},jDB=function(w){w.Y=g.C7(function(){QV("Connecting timeout"); w.bx(1)},2E4)},g9x=function(w){g.EO(w.Y); w.Y=NaN},Rbr=function(w){g.EO(w.nV); w.nV=NaN},n9l=function(w){o91(w); w.V7=g.C7(function(){VV(w,"getNowPlaying")},2E4)},o91=function(w){g.EO(w.V7); w.V7=NaN},xmB=function(w){QV("Channel opened"); w.c_&&(w.c_=!1,Rbr(w),w.nV=g.C7(function(){QV("Timing out waiting for a screen.");w.bx(1)},15E3))},Gos=function(w,D){var M=null; if(D){var L=H1S(w);L&&(M={clientName:L.clientName,deviceMake:L.brand,deviceModel:L.model,osVersion:L.osVersion})}g.mC("yt.mdx.remote.remoteClient_",M);D&&(g9x(w),Rbr(w));M=w.V.Zz()&&isNaN(w.Y);D==M?D&&(Jl(w,1),VV(w,"getSubtitlesTrack")):D?(w.Ct()&&w.T.reset(),Jl(w,1),VV(w,"getNowPlaying"),FIZ(w)):w.bx(1)},sDx=function(w,D){var M=D.params.videoId; delete D.params.videoId;M==w.T.videoId&&(g.WD(D.params)?w.T.trackData=null:w.T.trackData=D.params,w.publish("remotePlayerChange"))},aSs=function(w,D,M){var L=D.params.videoId||D.params.video_id,Z=parseInt(D.params.currentIndex,10); w.T.listId=D.params.listId||w.T.listId;B6(w.T,L,Z);w.publish("remoteQueueChange",M)},cnB=function(w,D){D.params=D.params||{}; aSs(w,D,"NOW_PLAYING_MAY_CHANGE");v9B(w,D);w.publish("autoplayDismissed")},v9B=function(w,D){var M=parseInt(D.params.currentTime||D.params.current_time,10); v6(w.T,isNaN(M)?0:M);M=parseInt(D.params.state,10);M=isNaN(M)?-1:M;M==-1&&w.T.playerState==-1E3&&(M=-1E3);w.T.playerState=M;M=Number(D.params.loadedTime);w.T.U=isNaN(M)?0:M;w.T.OM(Number(D.params.duration));M=w.T;var L=Number(D.params.liveIngestionTime);M.T=L;M.D=isNaN(L)?!1:!0;M=w.T;L=Number(D.params.seekableStartTime);D=Number(D.params.seekableEndTime);M.V=isNaN(L)?0:L;M.G=isNaN(D)?0:D;w.T.playerState==1?n9l(w):o91(w);w.publish("remotePlayerChange")},BO3=function(w,D){if(w.T.playerState!=-1E3){var M= 1085; switch(parseInt(D.params.adState,10)){case 1:M=1081;break;case 2:M=1084;break;case 0:M=1083}w.T.playerState=M;D=parseInt(D.params.currentTime,10);v6(w.T,isNaN(D)?0:D);w.publish("remotePlayerChange")}},fSZ=function(w,D){var M=D.params.muted=="true"; w.T.volume=parseInt(D.params.volume,10);w.T.muted=M;w.publish("remotePlayerChange")},qfr=function(w,D){w.G=D.params.videoId; w.publish("nowAutoplaying",parseInt(D.params.timeout,10))},rnl=function(w,D){w.G=D.params.videoId||null; w.publish("autoplayUpNext",w.G)},eb3=function(w,D){w.W=D.params.autoplayMode; w.publish("autoplayModeChange",w.W);w.W=="DISABLED"&&w.publish("autoplayDismissed")},XLr=function(w,D){var M=D.params.hasNext=="true"; w.T.ym=D.params.hasPrevious=="true";w.T.lz=M;w.publish("previousNextChange")},NOB=function(w,D){D=D.message; D.params?QV("Received: action="+D.action+", params="+g.ri(D.params)):QV("Received: action="+D.action+" {}");switch(D.action){case "loungeStatus":D=DH(D.params.devices);w.L=g.yR(D,function(L){return new bq(L)}); D=!!g.y1(w.L,function(L){return L.type=="LOUNGE_SCREEN"}); Gos(w,D);D=w.Fg("mlm");w.publish("multiStateLoopEnabled",D);break;case "loungeScreenDisconnected":g.nk(w.L,function(L){return L.type=="LOUNGE_SCREEN"}); Gos(w,!1);break;case "remoteConnected":var M=new bq(DH(D.params.device));g.y1(w.L,function(L){return L.equals(M)})||Tz3(w.L,M); break;case "remoteDisconnected":M=new bq(DH(D.params.device));g.nk(w.L,function(L){return L.equals(M)}); break;case "gracefulDisconnect":break;case "playlistModified":aSs(w,D,"QUEUE_MODIFIED");break;case "nowPlaying":cnB(w,D);break;case "onStateChange":v9B(w,D);break;case "onAdStateChange":BO3(w,D);break;case "onVolumeChanged":fSZ(w,D);break;case "onSubtitlesTrackChanged":sDx(w,D);break;case "nowAutoplaying":qfr(w,D);break;case "autoplayDismissed":w.publish("autoplayDismissed");break;case "autoplayUpNext":rnl(w,D);break;case "onAutoplayModeChanged":eb3(w,D);break;case "onHasPreviousNextChanged":XLr(w, D);break;case "requestAssistedSignIn":w.publish("assistedSignInRequested",D.params.authCode);break;case "onLoopModeChanged":w.publish("loopModeChange",D.params.loopMode);break;default:QV("Unrecognized action: "+D.action)}},FIZ=function(w){g.EO(w.B); w.B=g.C7(function(){w.bx(1)},864E5)},VV=function(w,D,M){M?QV("Sending: action="+D+", params="+g.ri(M)):QV("Sending: action="+D); w.V.sendMessage(D,M)},TOl=function(w){bV.call(this,"ScreenServiceProxy"); this.gI=w;this.T=[];this.T.push(this.gI.$_s("screenChange",(0,g.Ck)(this.HQ,this)));this.T.push(this.gI.$_s("onlineScreenChange",(0,g.Ck)(this.V2W,this)))},zb3=function(w,D){TQs(); if(!tZ||!tZ.get("yt-remote-disable-remote-module-for-dev")){D=g.Xg("MDX_CONFIG")||D;ax1();fx7();P6||(P6=new mn(D?D.loungeApiHost:void 0),uR3()&&(P6.T="/api/loungedev"));Om||(Om=g.w3("yt.mdx.remote.deferredProxies_")||[],g.mC("yt.mdx.remote.deferredProxies_",Om));uUZ();var M=K0();if(!M){var L=new p0(P6,D?D.disableAutomaticScreenCache||!1:!1);g.mC("yt.mdx.remote.screenService_",L);M=K0();var Z={};D&&(Z={appId:D.appId,disableDial:D.disableDial,theme:D.theme,loadCastApiSetupScript:D.loadCastApiSetupScript, disableCastApi:D.disableCastApi,enableDialLoungeToken:D.enableDialLoungeToken,enableCastLoungeToken:D.enableCastLoungeToken,forceMirroring:D.forceMirroring});g.mC("yt.mdx.remote.enableConnectWithInitialState_",D?D.enableConnectWithInitialState||!1:!1);b1D(w,L,function(k){k?mW()&&GE(mW(),"YouTube TV"):L.subscribe("onlineScreenChange",function(){$p("yt-remote-receiver-availability-change")})},Z)}D&&!g.w3("yt.mdx.remote.initialized_")&&(g.mC("yt.mdx.remote.initialized_",!0),Al("Initializing: "+g.ri(D)), wK.push(g.Vn("yt-remote-cast2-api-ready",function(){$p("yt-remote-api-ready")})),wK.push(g.Vn("yt-remote-cast2-availability-change",function(){$p("yt-remote-receiver-availability-change")})),wK.push(g.Vn("yt-remote-cast2-receiver-selected",function(){DI(null); $p("yt-remote-auto-connect","cast-selector-receiver")})),wK.push(g.Vn("yt-remote-cast2-receiver-resumed",function(){$p("yt-remote-receiver-resumed","cast-selector-receiver")})),wK.push(g.Vn("yt-remote-cast2-session-change",Sf1)),wK.push(g.Vn("yt-remote-connection-change",function(k){k?GE(mW(),"YouTube TV"):MT()||(GE(null,null),E9D())})),wK.push(g.Vn("yt-remote-cast2-session-failed",function(){$p("yt-remote-connection-failed")})),w=QDr(),D.isAuto&&(w.id+="#dial"),Z=D.capabilities||[],Z.length>0&&(w.capabilities= Z),w.name=D.device,w.app=D.app,(D=D.theme)&&(w.theme=D),Al(" -- with channel params: "+g.ri(w)),w?(g.gQ("yt-remote-session-app",w.app),g.gQ("yt-remote-session-name",w.name)):(g.oj("yt-remote-session-app"),g.oj("yt-remote-session-name")),g.mC("yt.mdx.remote.channelParams_",w),M.start(),mW()||Jnr())}},VnZ=function(){var w=K0().gI.$_gos(); var D=Lw();D&&ZI()&&(sjr(w,D)||w.push(D));return G_3(w)},O1x=function(){var w=PyS(); !w&&n0()&&lSx()&&(w={key:"cast-selector-receiver",name:lSx()});return w},PyS=function(){var w=VnZ(),D=Lw(); D||(D=MT());return g.y1(w,function(M){return D&&Cx(D,M.key)?!0:!1})},Lw=function(){var w=mW(); if(!w)return null;var D=K0().dV();return EG(D,w)},Sf1=function(w){Al("remote.onCastSessionChange_: "+lq(w)); if(w){var D=Lw();if(D&&D.id==w.id){if(GE(D.id,"YouTube TV"),w.idType=="shortLived"&&(w=w.token))kv&&(kv.token=w),(D=ZI())&&D.XN(w)}else D&&b9(),Yv(w,1)}else ZI()&&b9()},b9=function(){Fd()?ol().stopSession():Rl("stopSession called before API ready."); var w=ZI();w&&(w.disconnect(1),KIZ(null))},mmP=function(){var w=ZI(); return!!w&&w.getProxyState()!=3},Al=function(w){Dc("remote",w)},K0=function(){if(!An1){var w=g.w3("yt.mdx.remote.screenService_"); An1=w?new TOl(w):null}return An1},mW=function(){return g.w3("yt.mdx.remote.currentScreenId_")},wv7=function(w){g.mC("yt.mdx.remote.currentScreenId_",w)},DXB=function(){return g.w3("yt.mdx.remote.connectData_")},DI=function(w){g.mC("yt.mdx.remote.connectData_",w)},ZI=function(){return g.w3("yt.mdx.remote.connection_")},KIZ=function(w){var D=ZI(); DI(null);w||wv7("");g.mC("yt.mdx.remote.connection_",w);Om&&(g.PQ(Om,function(M){M(w)}),Om.length=0); D&&!w?$p("yt-remote-connection-change",!1):!D&&w&&$p("yt-remote-connection-change",!0)},MT=function(){var w=g.ne(); if(!w)return null;var D=K0();if(!D)return null;D=D.dV();return EG(D,w)},Yv=function(w,D){mW(); Lw()&&Lw();if(Cw)kv=w;else{wv7(w.id);var M=g.w3("yt.mdx.remote.enableConnectWithInitialState_")||!1;w=new zE(P6,w,QDr(),M);w.connect(D,DXB());w.subscribe("beforeDisconnect",function(L){$p("yt-remote-before-disconnect",L)}); w.subscribe("beforeDispose",function(){ZI()&&(ZI(),KIZ(null))}); w.subscribe("browserChannelAuthError",function(){var L=Lw();L&&L.idType=="shortLived"&&(Fd()?ol().handleBrowserChannelAuthError():Rl("refreshLoungeToken called before API ready."))}); KIZ(w)}},Jnr=function(){var w=MT(); w?(Al("Resume connection to: "+lq(w)),Yv(w,0)):(hZ(),E9D(),Al("Skipping connecting because no session screen found."))},uUZ=function(){var w=QDr(); if(g.WD(w)){w=W0();var D=g.Rj("yt-remote-session-name")||"",M=g.Rj("yt-remote-session-app")||"";w={device:"REMOTE_CONTROL",id:w,name:D,app:M,mdxVersion:3};w.authuser=String(g.Xg("SESSION_INDEX","0"));(D=g.Xg("DELEGATED_SESSION_ID"))&&(w.pageId=String(D));g.mC("yt.mdx.remote.channelParams_",w)}},QDr=function(){return g.w3("yt.mdx.remote.channelParams_")||{}},Zb7=function(w,D,M){g.X.call(this); var L=this;this.T=w;this.K=D;this.u9=M;this.events=new g.xM(this);this.W=!1;this.Y=new g.FF(64);this.V=new g.ui(this.eT,500,this);this.L=new g.ui(this.qa,1E3,this);this.U=new yk(this.g9c,0,this);this.D={};this.B=new g.ui(this.ip,1E3,this);this.G=new g.zC(this.seekTo,1E3,this);this.y7=this.events.j(this.K,"onVolumeChange",function(Z){MGr(L,Z)}); g.T(this,this.events);this.events.j(D,"onCaptionsTrackListChanged",this.qBc);this.events.j(D,"captionschanged",this.Za9);this.events.j(D,"captionssettingschanged",this.ys);this.events.j(D,"videoplayerreset",this.FP);this.events.j(D,"mdxautoplaycancel",function(){L.u9.JT()}); D.C("enable_mdx_video_play_directly")&&this.events.j(D,"videodatachange",function(){LPQ(L.T)||l9(L)||Et(L,0)}); w=this.u9;w.xt();w.subscribe("proxyStateChange",this.L_,this);w.subscribe("remotePlayerChange",this.oE,this);w.subscribe("remoteQueueChange",this.FP,this);w.subscribe("previousNextChange",this.TI,this);w.subscribe("nowAutoplaying",this.pg,this);w.subscribe("autoplayDismissed",this.va,this);g.T(this,this.V);g.T(this,this.L);g.T(this,this.U);g.T(this,this.B);g.T(this,this.G);this.ys();this.FP();this.oE()},MGr=function(w,D){if(l9(w)){w.u9.unsubscribe("remotePlayerChange",w.oE,w); var M=Math.round(D.volume);D=!!D.muted;var L=rm(w.u9);if(M!==L.volume||D!==L.muted)w.u9.setVolume(M,D),w.B.start();w.u9.subscribe("remotePlayerChange",w.oE,w)}},kLS=function(w){w.M$(0); w.V.stop();w.UB(new g.FF(64))},bbQ=function(w,D){if(l9(w)&&!w.W){var M=null; D&&(M={style:w.K.getSubtitlesUserSettings()},Object.assign(M,D));w.u9.uR(w.K.getVideoData(1).videoId,M);w.D=rm(w.u9).trackData}},Et=function(w,D){var M=w.K.getPlaylist(); if(M==null?0:M.listId){var L=M.index;var Z=M.listId.toString()}M=w.K.getVideoData(1);w.u9.playVideo(M.videoId,D,L,Z,M.playerParams,M.Jc,XoD(M));w.UB(new g.FF(1))},YWS=function(w,D){if(D){var M=w.K.getOption("captions","tracklist",{PF:1}); M&&M.length?(w.K.setOption("captions","track",D),w.W=!1):(w.K.loadModule("captions"),w.W=!0)}else w.K.setOption("captions","track",{})},l9=function(w){return rm(w.u9).videoId===w.K.getVideoData(1).videoId},CIQ=function(w,D){g.Qh.call(this,w); this.T=D},pw=function(){g.J.call(this,{Z:"div", J:"ytp-mdx-popup-dialog",S:{role:"dialog"},N:[{Z:"div",J:"ytp-mdx-popup-dialog-inner-content",N:[{Z:"div",J:"ytp-mdx-popup-title",LV:"You're signed out"},{Z:"div",J:"ytp-mdx-popup-description",LV:"Videos you watch may be added to the TV's watch history and influence TV recommendations. To avoid this, cancel and sign in to YouTube on your computer."},{Z:"div",J:"ytp-mdx-privacy-popup-buttons",N:[{Z:"button",Yt:["ytp-button","ytp-mdx-privacy-popup-cancel"],LV:"Cancel"},{Z:"button",Yt:["ytp-button", "ytp-mdx-privacy-popup-confirm"],LV:"Confirm"}]}]}]});this.fade=new g.V9(this,250);this.cancelButton=this.Z5("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.Z5("ytp-mdx-privacy-popup-confirm");g.T(this,this.fade);this.j(this.cancelButton,"click",this.T);this.j(this.confirmButton,"click",this.V)},WH=function(w){g.J.call(this,{Z:"div", J:"ytp-remote",N:[{Z:"div",J:"ytp-remote-display-status",N:[{Z:"div",J:"ytp-remote-display-status-icon",N:[g.WEk()]},{Z:"div",J:"ytp-remote-display-status-text",LV:"{{statustext}}"}]}]});this.api=w;this.fade=new g.V9(this,250);g.T(this,this.fade);this.j(w,"presentingplayerstatechange",this.onStateChange);this.lj(w.getPlayerStateObject())},ht=function(w,D){g.cp.call(this,"Play on",1,w,D); this.K=w;this.Rp={};this.j(w,"onMdxReceiversChange",this.V);this.j(w,"presentingplayerstatechange",this.V);this.V()},lqk=function(w){g.xX.call(this,w); this.aK={key:FEQ(),name:"This computer"};this.tV=null;this.subscriptions=[];this.MW=this.u9=null;this.Rp=[this.aK];this.M0=this.aK;this.uT=new g.FF(64);this.lP=0;this.Jt=-1;this.dn=!1;this.F1=this.j0=this.j4=null;if(!g.Y2(this.player.X())&&!g.Fs(this.player.X())){w=this.player;var D=g.c$(w);D&&(D=D.Vg())&&(D=new ht(w,D),g.T(this,D));D=new WH(w);g.T(this,D);g.mH(w,D.element,4);this.j4=new pw;g.T(this,this.j4);g.mH(w,this.j4.element,4);this.dn=!!MT()}},tt=function(w){w.j0&&(w.player.removeEventListener("presentingplayerstatechange", w.j0),w.j0=null)},EbB=function(w,D,M){w.uT=M; w.player.publish("presentingplayerstatechange",new g.k0(M,D))},$v=function(w,D){if(D.key!==w.M0.key)if(D.key===w.aK.key)b9(); else if(LPQ(w)&&pvZ(w),w.M0=D,!g.Fs(w.player.X())){var M=w.player.getPlaylistId();var L=w.player.getVideoData(1);var Z=L.videoId;if(!M&&!Z||(w.player.getAppState()===2||w.player.getAppState()===1)&&w.player.X().C("should_clear_video_data_on_player_cued_unstarted"))L=null;else{var k=w.player.getPlaylist();if(k){var b=[];for(var C=0;C2*this.size&&kp(this),!0):!1}; g.y.get=function(w,D){return Lx(this.V,w)?this.V[w]:D}; g.y.set=function(w,D){Lx(this.V,w)||(this.size+=1,this.T.push(w),this.fh++);this.V[w]=D}; g.y.forEach=function(w,D){for(var M=this.iy(),L=0;L=L.T.length)return g.lT;var k=L.T[D++];return g.Ix(w?k:L.V[k])}; return Z}; var k_x={pH9:"atp",eut:"ska",DQD:"que",T29:"mus",QoD:"sus",v8_:"dsp",Mt5:"seq",RAE:"mic",q0h:"dpa",UR_:"mlm",EkV:"dsdtr",nLc:"ntb",dNE:"vsp",HfW:"scn",ZmE:"rpe",Xyk:"dcn",k$h:"dcp",MxE:"pas",Q49:"drq",cV9:"opf",yH9:"els",TC9:"isg",S35:"svq",mTJ:"mvp",p9W:"ads",Adk:"stcp",lSc:"sads",bPE:"dloc",RNh:"dcw",ix9:"asw",suJ:"apw",QQc:"pcw",a99:"ipv"},be3={GRJ:"u",WbD:"cl",f9c:"k",sqk:"i",d2E:"cr",yVV:"m",aBE:"g",aW:"up"},Sn1={KR:"adPlaying",oW:"onAdStateChange"},QzZ={P2V:"nowPlaying",C25:"onStateChange", KR:"adPlaying",oW:"onAdStateChange",L9:"nowPlayingShorts",D$:"onShortsStateChange"},JK1={L9:"nowPlayingShorts",D$:"onShortsStateChange"};bq.prototype.equals=function(w){return w?this.id==w.id:!1}; var BQl="",tZ=null;g.I(S4S,g.sx);var iq,mAr=Jax("loadCastFramework")||Jax("loadCastApplicationFramework"),DDQ=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.hx(yk,g.X);g.y=yk.prototype;g.y.Sp=function(w){this.D=arguments;this.T=!1;this.bj?this.L=g.pk()+this.LP:this.bj=g.cj(this.W,this.LP)}; g.y.stop=function(){this.bj&&(g.KI.clearTimeout(this.bj),this.bj=null);this.L=null;this.T=!1;this.D=[]}; g.y.pause=function(){++this.V}; g.y.resume=function(){this.V&&(--this.V,!this.V&&this.T&&(this.T=!1,this.Y.apply(null,this.D)))}; g.y.oJ=function(){this.stop();yk.zk.oJ.call(this)}; g.y.v0=function(){this.bj&&(g.KI.clearTimeout(this.bj),this.bj=null);this.L?(this.bj=g.cj(this.W,this.L-g.pk()),this.L=null):this.V?this.T=!0:(this.T=!1,this.Y.apply(null,this.D))};IU.prototype.stringify=function(w){return g.KI.JSON.stringify(w,void 0)}; IU.prototype.parse=function(w){return g.KI.JSON.parse(w,void 0)};g.hx(Lgl,g.SO);g.hx(Zfl,g.SO);var kV7=null;g.hx(Y6B,g.SO);g.hx(CEs,g.SO);g.hx(lDr,g.SO);H0.prototype.debug=function(){}; H0.prototype.info=function(){}; H0.prototype.warning=function(){};var dDD={},ifS={};g.y=jR.prototype;g.y.setTimeout=function(w){this.EL=w}; g.y.Ix=function(w){w=w.target;var D=this.XE;D&&g.QF(w)==3?D.gx():this.JN(w)}; g.y.JN=function(w){try{if(w==this.T)a:{var D=g.QF(this.T),M=this.T.V,L=this.T.getStatus();if(!(D<3)&&(D!=3||this.T&&(this.V.L||g.zy(this.T)||g.VF(this.T)))){this.fV||D!=4||M==7||(M==8||L<=0?UG(3):UG(2));UDB(this);var Z=this.T.getStatus();this.mu=Z;var k=$DZ(this);if(this.Y=Z==200){if(this.TU&&!this.jk){b:{if(this.T){var b=g.Pj(this.T,"X-HTTP-Initial-Response");if(b&&!g.s3(b)){var C=b;break b}}C=null}if(w=C)this.jk=!0,FgD(this,w);else{this.Y=!1;this.W=3;xp(12);oU(this);nx(this);break a}}if(this.W_){w= !0;for(var l;!this.fV&&this.G0&&!this.oO&&(this.oO=!0,this.L.hA(this)):(oU(this),nx(this))}else FgD(this,k);D==4&&oU(this);this.Y&&!this.fV&&(D==4?xDQ(this.L,this):(this.Y=!1,RU(this)))}else g.isr(this.T),Z==400&&k.indexOf("Unknown SID")> 0?(this.W=3,xp(12)):(this.W=0,xp(13)),oU(this),nx(this)}}}catch(E){}finally{}}; g.y.cancel=function(){this.fV=!0;oU(this)}; g.y.lV=function(){this.y7=null;var w=Date.now();w-this.pV>=0?(this.Md!=2&&(UG(3),xp(17)),oU(this),this.W=2,nx(this)):ID7(this,this.pV-w)}; g.y.getLastError=function(){return this.W}; g.y.k_=function(){return this.T};sC7.prototype.cancel=function(){this.L=vqk(this);if(this.V)this.V.cancel(),this.V=null;else if(this.T&&this.T.size!==0){for(var w=g.x(this.T.values()),D=w.next();!D.done;D=w.next())D.value.cancel();this.T.clear()}};g.y=q6r.prototype;g.y.g$=8;g.y.Tr=1;g.y.connect=function(w,D,M,L){xp(0);this.NC=w;this.fV=D||{};M&&L!==void 0&&(this.fV.OSID=M,this.fV.OAID=L);this.jk=this.wW;this.Jc=RPx(this,null,this.NC);aU(this)}; g.y.disconnect=function(){ePZ(this);if(this.Tr==3){var w=this.bW++,D=this.Jc.clone();g.YA(D,"SID",this.D);g.YA(D,"RID",w);g.YA(D,"TYPE","terminate");B0(this,D);w=new jR(this,this.D,w);w.Md=2;w.U=AC(D.clone());D=!1;if(g.KI.navigator&&g.KI.navigator.sendBeacon)try{D=g.KI.navigator.sendBeacon(w.U.toString(),"")}catch(M){}!D&&g.KI.Image&&((new Image).src=w.U,D=!0);D||(w.T=hP1(w.L,null),w.T.send(w.U));w.nV=Date.now();RU(w)}J5D(this)}; g.y.VL=function(){return this.Tr==0}; g.y.getState=function(){return this.Tr}; g.y.f4=function(w){if(this.Y)if(this.Y=null,this.Tr==1){if(!w){this.bW=Math.floor(Math.random()*1E5);w=this.bW++;var D=new jR(this,"",w),M=this.B;this.TU&&(M?(M=g.$O(M),g.dC(M,this.TU)):M=this.TU);this.G!==null||this.pV||(D.Jc=M,M=null);var L;if(this.iW)a:{for(var Z=L=0;Z4096){L=Z;break a}if(L===4096||Z===this.L.length-1){L=Z+1;break a}}L= 1E3}else L=1E3;L=uTx(this,D,L);Z=this.Jc.clone();g.YA(Z,"RID",w);g.YA(Z,"CVER",22);this.W_&&g.YA(Z,"X-HTTP-Session-Id",this.W_);B0(this,Z);M&&(this.pV?L="headers="+g.og(g.fUK(M))+"&"+L:this.G&&g.po(Z,this.G,M));gqQ(this.V,D);this.kP&&g.YA(Z,"TYPE","init");this.iW?(g.YA(Z,"$req",L),g.YA(Z,"SID","null"),D.TU=!0,WgB(D,Z,null)):WgB(D,Z,L);this.Tr=2}}else this.Tr==3&&(w?S6P(this,w):this.L.length==0||aDP(this.V)||S6P(this))}; g.y.F5=function(){this.U=null;QCZ(this);if(this.HA&&!(this.EL||this.T==null||this.FQ<=0)){var w=4*this.FQ;this.c_=No((0,g.Ck)(this.nl5,this),w)}}; g.y.nl5=function(){this.c_&&(this.c_=null,this.jk=!1,this.EL=!0,xp(10),GS(this),QCZ(this))}; g.y.hA=function(w){this.T==w&&this.HA&&!this.EL&&(r5r(this),this.EL=!0,xp(11))}; g.y.Ne=function(){this.y7!=null&&(this.y7=null,GS(this),Hfr(this),xp(19))}; g.y.AWE=function(w){w?xp(2):xp(1)}; g.y.isActive=function(){return!!this.W&&this.W.isActive(this)}; g.y=V$1.prototype;g.y.GT=function(){}; g.y.r$=function(){}; g.y.Mw=function(){}; g.y.xz=function(){}; g.y.isActive=function(){return!0}; g.y.wq=function(){};g.hx(qo,g.Ej);qo.prototype.open=function(){this.T.W=this.L;this.Y&&(this.T.Md=!0);this.T.connect(this.W,this.V||void 0)}; qo.prototype.close=function(){this.T.disconnect()}; qo.prototype.send=function(w){var D=this.T;if(typeof w==="string"){var M={};M.__data__=w;w=M}else this.D&&(M={},M.__data__=g.ri(w),w=M);D.L.push(new GVZ(D.BI++,w));D.Tr==3&&aU(D)}; qo.prototype.oJ=function(){this.T.W=null;delete this.L;this.T.disconnect();delete this.T;qo.zk.oJ.call(this)}; g.hx(Ofk,Lgl);g.hx(Kgr,Zfl);g.hx(fx,V$1);fx.prototype.GT=function(){this.T.dispatchEvent("m")}; fx.prototype.r$=function(w){this.T.dispatchEvent(new Ofk(w))}; fx.prototype.Mw=function(w){this.T.dispatchEvent(new Kgr(w))}; fx.prototype.xz=function(){this.T.dispatchEvent("n")}; mD7.prototype.commit=function(w){this.T.mu=w};var eR=new g.Ej;g.I(wAZ,g.SO);g.y=TS.prototype;g.y.vV=null;g.y.yx=!1;g.y.zW=null;g.y.Xq=null;g.y.eX=null;g.y.KB=null;g.y.bl=null;g.y.W7=null;g.y.Nf=null;g.y.xk=null;g.y.t7=0;g.y.gQ=null;g.y.c7=null;g.y.IG=null;g.y.Es=-1;g.y.Cj=!0;g.y.Ql=!1;g.y.NA=0;g.y.P7=null;var bu1={},kG7={};g.y=TS.prototype;g.y.setTimeout=function(w){this.V=w}; g.y.kS=function(w){w=w.target;var D=this.P7;D&&g.QF(w)==3?D.gx():this.jR(w)}; g.y.jR=function(w){try{if(w==this.xk)a:{var D=g.QF(this.xk),M=this.xk.V,L=this.xk.getStatus();if(g.Eg&&!g.eq("420+")){if(D<4)break a}else if(D<3||D==3&&!g.zy(this.xk))break a;this.Ql||D!=4||M==7||(M==8||L<=0?this.T.ZE(3):this.T.ZE(2));lF1(this);var Z=this.xk.getStatus();this.Es=Z;var k=g.zy(this.xk);if(this.yx=Z==200){D==4&&uq(this);if(this.W_){for(w=!0;!this.Ql&&this.t70?(this.IG=3,XL(13)):(this.IG=0,XL(14)),uq(this),EoZ(this)}}catch(C){}finally{}}; g.y.cancel=function(){this.Ql=!0;uq(this)}; g.y.Xn=function(){this.zW=null;var w=Date.now();w-this.Xq>=0?(this.KB!=2&&this.T.ZE(3),uq(this),this.IG=2,XL(18),EoZ(this)):CZ7(this,this.Xq-w)}; g.y.getLastError=function(){return this.IG};g.y=tB3.prototype;g.y.b4=null;g.y.WX=null;g.y.Od=!1;g.y.EE=null;g.y.zg=null;g.y.ZH=-1;g.y.CB=null;g.y.Ih=null;g.y.connect=function(w){this.EE=w;w=Qk(this.T,null,this.EE);XL(3);Date.now();var D=this.T.B;D!=null?(this.CB=D[0],(this.Ih=D[1])?(this.zg=1,$Rx(this)):(this.zg=2,iuD(this))):(wc(w,"MODE","init"),this.WX=new TS(this),this.WX.vV=this.b4,Lyx(this.WX,w,!1,null,!0),this.zg=0)}; g.y.BP=function(w){if(w)this.zg=2,iuD(this);else{XL(4);var D=this.T;D.x7=D.fD.ZH;P0(D,9)}w&&this.ZE(2)}; g.y.k5=function(w){return this.T.k5(w)}; g.y.abort=function(){this.WX&&(this.WX.cancel(),this.WX=null);this.ZH=-1}; g.y.VL=function(){return!1}; g.y.d$=function(w,D){this.ZH=w.Es;if(this.zg==0)if(D){try{var M=this.V.parse(D)}catch(L){w=this.T;w.x7=this.ZH;P0(w,2);return}this.CB=M[0];this.Ih=M[1]}else w=this.T,w.x7=this.ZH,P0(w,2);else this.zg==2&&(this.Od?(XL(7),Date.now()):D=="11111"?(XL(6),this.Od=!0,Date.now(),this.ZH=200,this.WX.cancel(),XL(12),JZ(this.T,this,!0)):(XL(8),Date.now(),this.Od=!1))}; g.y.Qu=function(){this.ZH=this.WX.Es;if(this.WX.yx)this.zg==0?this.Ih?(this.zg=1,$Rx(this)):(this.zg=2,iuD(this)):this.zg==2&&(this.Od?(XL(12),JZ(this.T,this,!0)):(XL(11),JZ(this.T,this,!1)));else{this.zg==0?XL(9):this.zg==2&&XL(10);var w=this.T;this.WX.getLastError();w.x7=this.ZH;P0(w,2)}}; g.y.q7=function(){return this.T.q7()}; g.y.isActive=function(){return this.T.isActive()}; g.y.ZE=function(w){this.T.ZE(w)};g.y=dR1.prototype;g.y.oQ=null;g.y.ul=null;g.y.GV=null;g.y.P9=null;g.y.qA=null;g.y.aI=null;g.y.SR=null;g.y.e7=null;g.y.R_=0;g.y.Qc=0;g.y.y4=null;g.y.Hi=null;g.y.Pw=null;g.y.Xf=null;g.y.fD=null;g.y.oL=null;g.y.n1=-1;g.y.hN=-1;g.y.x7=-1;g.y.Dg=0;g.y.o3=0;g.y.w0=8;var WPS={OK:0,ttL:2,kKW:4,WmE:5,r3_:6,STOP:7,Vw:8,AtD:9,sTh:10,BZE:11,BI7:12};g.hx(IFl,g.SO);g.hx(URQ,g.SO);g.y=dR1.prototype; g.y.connect=function(w,D,M,L,Z){XL(0);this.qA=D;this.ul=M||{};L&&Z!==void 0&&(this.ul.OSID=L,this.ul.OAID=Z);this.U?(rc((0,g.Ck)(this.A6,this,w),100),N47(this)):this.A6(w)}; g.y.disconnect=function(){HuD(this);if(this.T==3){var w=this.R_++,D=this.aI.clone();g.YA(D,"SID",this.D);g.YA(D,"RID",w);g.YA(D,"TYPE","terminate");Vk(this,D);w=new TS(this,this.D,w);w.KB=2;w.bl=AC(D.clone());(new Image).src=w.bl.toString();w.eX=Date.now();Zuk(w)}vo1(this)}; g.y.A6=function(w){this.fD=new tB3(this);this.fD.b4=this.oQ;this.fD.V=this.W;this.fD.connect(w)}; g.y.VL=function(){return this.T==0}; g.y.getState=function(){return this.T}; g.y.Id=function(w){this.Hi=null;no3(this,w)}; g.y.lR=function(){this.Pw=null;this.P9=new TS(this,this.D,"rpc",this.G);this.P9.vV=this.oQ;this.P9.NA=0;var w=this.SR.clone();g.YA(w,"RID","rpc");g.YA(w,"SID",this.D);g.YA(w,"CI",this.oL?"0":"1");g.YA(w,"AID",this.n1);Vk(this,w);g.YA(w,"TYPE","xmlhttp");Lyx(this.P9,w,!0,this.e7,!1)}; g.y.d$=function(w,D){if(this.T!=0&&(this.P9==w||this.GV==w))if(this.x7=w.Es,this.GV==w&&this.T==3)if(this.w0>7){try{var M=this.W.parse(D)}catch(L){M=null}if(Array.isArray(M)&&M.length==3)if(w=M,w[0]==0)a:{if(!this.Pw){if(this.P9)if(this.P9.eX+3E30)){if(L=D==1)this.GV||this.Hi||this.T==1||this.Dg>=2?L=!1:(this.Hi=rc((0,g.Ck)(this.Id,this,w),GGr(this,this.Dg)),this.Dg++, L=!0);L=!(L||D==2&&szr(this))}if(L)switch(M){case 1:P0(this,5);break;case 4:P0(this,10);break;case 3:P0(this,6);break;case 7:P0(this,12);break;default:P0(this,2)}}}; g.y.bV=function(w){if(!g.xB(arguments,this.T))throw Error("Unexpected channel state: "+this.T);}; g.y.BdV=function(w){w?XL(2):(XL(1),aFD(this,8))}; g.y.k5=function(w){if(w)throw Error("Can't create secondary domain capable XhrIo object.");w=new g.Ty;w.G=!1;return w}; g.y.isActive=function(){return!!this.y4&&this.y4.isActive(this)}; g.y.ZE=function(w){var D=eR;D.dispatchEvent(new URQ(D,w))}; g.y.q7=function(){return!1}; g.y=cKs.prototype;g.y.X5=function(){}; g.y.w$=function(){}; g.y.kz=function(){}; g.y.Nw=function(){}; g.y.u4=function(){}; g.y.bR=function(){return{}}; g.y.isActive=function(){return!0};g.y=B4P.prototype;g.y.enqueue=function(w){this.V.push(w)}; g.y.isEmpty=function(){return this.T.length===0&&this.V.length===0}; g.y.clear=function(){this.T=[];this.V=[]}; g.y.contains=function(w){return g.xB(this.T,w)||g.xB(this.V,w)}; g.y.remove=function(w){var D=this.T;var M=(0,g.lY7)(D,w);M>=0?(g.NZ(D,M),D=!0):D=!1;return D||g.HQ(this.V,w)}; g.y.hV=function(){for(var w=[],D=this.T.length-1;D>=0;--D)w.push(this.T[D]);D=this.V.length;for(var M=0;M=hxl.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(w=hxl[this.V],this.bj=g.C7((0,g.Ck)(this.lU,this),w),this.V++):this.publish("pairingFailed",Error("Server error "+w.status))}; g.y.B0=function(){this.T=null;this.publish("pairingFailed",Error("Server not responding"))}; var hxl=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.hx(C0,bV);g.y=C0.prototype;g.y.start=function(){Yh(this)&&this.publish("screenChange");!g.Rj("yt-remote-lounge-token-expiration")&&iVB(this);g.EO(this.T);this.T=g.C7((0,g.Ck)(this.start,this),1E4)}; g.y.add=function(w,D){Yh(this);WOs(this,w);lV(this,!1);this.publish("screenChange");D(w);w.token||iVB(this)}; g.y.remove=function(w,D){var M=Yh(this);tC7(this,w)&&(lV(this,!1),M=!0);D(w);M&&this.publish("screenChange")}; g.y.Lv=function(w,D,M,L){var Z=Yh(this),k=this.get(w.id);k?(k.name!=D&&(k.name=D,lV(this,!1),Z=!0),M(w)):L(Error("no such local screen."));Z&&this.publish("screenChange")}; g.y.oJ=function(){g.EO(this.T);C0.zk.oJ.call(this)}; g.y.o1=function(w){Yh(this);var D=this.screens.length;w=w&&w.screens||[];for(var M=w.length,L=0;L20)break a;C=D(k,b)}k=C}Z.name=k}M(W6(this,Z))},this), onError:(0,g.Ck)(function(Z){L(Error("pairing request failed: "+Z.status))},this), onTimeout:(0,g.Ck)(function(){L(Error("pairing request timed out."))},this)})}; g.y.oJ=function(){g.M9(this.V);g.M9(this.T);p0.zk.oJ.call(this)}; g.y.Y0=function(){nrS(this);this.publish("screenChange");this.T.update()}; p0.prototype.dispose=p0.prototype.dispose;g.hx(hl,g.mI);g.y=hl.prototype;g.y.R4=function(w){this.xt()||(w&&($h(this,""+w),this.publish("sessionFailed")),this.T=null,this.publish("sessionScreen",null))}; g.y.info=function(w){Dc(this.W_,w)}; g.y.eR=function(){return null}; g.y.Ke=function(w){var D=this.V;w?(D.displayStatus=new chrome.cast.ReceiverDisplayStatus(w,[]),D.displayStatus.showStop=!0):D.displayStatus=null;chrome.cast.setReceiverDisplayStatus(D,(0,g.Ck)(function(){this.info("Updated receiver status for "+D.friendlyName+": "+w)},this),(0,g.Ck)(function(){$h(this,"Failed to update receiver status for: "+D.friendlyName)},this))}; g.y.oJ=function(){this.Ke("");hl.zk.oJ.call(this)};g.I(iV,hl);g.y=iV.prototype;g.y.PZ=function(w){if(this.L){if(this.L==w)return;$h(this,"Overriding cast session with new session object");XJx(this);this.nV=!1;this.B="unknown";this.L.removeUpdateListener(this.V7);this.L.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.c_)}this.L=w;this.L.addUpdateListener(this.V7);this.L.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.c_);BH7(this,"getMdxSessionStatus")}; g.y.uX=function(w){this.info("launchWithParams no-op for Cast: "+g.ri(w))}; g.y.stop=function(){this.L?this.L.stop((0,g.Ck)(function(){this.R4()},this),(0,g.Ck)(function(){this.R4(Error("Failed to stop receiver app."))},this)):this.R4(Error("Stopping cast device without session."))}; g.y.Ke=function(){}; g.y.oJ=function(){this.info("disposeInternal");XJx(this);this.L&&(this.L.removeUpdateListener(this.V7),this.L.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.c_));this.L=null;hl.prototype.oJ.call(this)}; g.y.AuE=function(w,D){if(!this.xt())if(D)if(D=DH(D),g.ZZ(D))switch(w=""+D.type,D=D.data||{},this.info("onYoutubeMessage_: "+w+" "+g.ri(D)),w){case "mdxSessionStatus":ae7(this,D);break;case "loungeToken":feD(this,D);break;default:$h(this,"Unknown youtube message: "+w)}else $h(this,"Unable to parse message.");else $h(this,"No data in message.")}; g.y.Go=function(w,D,M,L){g.EO(this.U);this.U=0;grS(this.D,this.V.label,w,this.V.friendlyName,(0,g.Ck)(function(Z){Z?D(Z):L>=0?($h(this,"Screen "+w+" appears to be offline. "+L+" retries left."),this.U=g.C7((0,g.Ck)(this.Go,this,w,D,M,L-1),300)):M(Error("Unable to fetch screen."))},this),M)}; g.y.eR=function(){return this.L}; g.y.Ov=function(w){this.xt()||w||($h(this,"Cast session died."),this.R4())};g.I(dm,hl);g.y=dm.prototype;g.y.PZ=function(w){this.L=w;this.L.addUpdateListener(this.fV)}; g.y.uX=function(w){this.Jc=w;this.y7()}; g.y.stop=function(){PGr(this);this.L?this.L.stop((0,g.Ck)(this.R4,this,null),(0,g.Ck)(this.R4,this,"Failed to stop DIAL device.")):this.R4()}; g.y.oJ=function(){PGr(this);this.L&&this.L.removeUpdateListener(this.fV);this.L=null;hl.prototype.oJ.call(this)}; g.y.Uv=function(w){this.xt()||w||($h(this,"DIAL session died."),this.W(),this.W=function(){},this.R4())};g.I(Um,hl);Um.prototype.stop=function(){this.R4()}; Um.prototype.PZ=function(){}; Um.prototype.uX=function(){g.EO(this.L);this.L=NaN;var w=EG(this.D.dV(),this.V.label);w?tl(this,w):this.R4(Error("No such screen"))}; Um.prototype.oJ=function(){g.EO(this.L);this.L=NaN;hl.prototype.oJ.call(this)};g.I(xh,g.mI);g.y=xh.prototype; g.y.init=function(w,D){chrome.cast.timeout.requestSession=3E4;var M=new chrome.cast.SessionRequest(this.U,[chrome.cast.Capability.AUDIO_OUT]);g.hY("desktop_enable_cast_connect")&&(M.androidReceiverCompatible=!0);this.B||(M.dialRequest=new chrome.cast.DialRequest("YouTube"));var L=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;w=w||this.Y?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var Z=(0,g.Ck)(this.yuc,this);M=new chrome.cast.ApiConfig(M,(0,g.Ck)(this.o7, this),Z,L,w);M.customDialLaunchCallback=(0,g.Ck)(this.xCW,this);chrome.cast.initialize(M,(0,g.Ck)(function(){this.xt()||(chrome.cast.addReceiverActionListener(this.W),CGD(),this.V.subscribe("onlineScreenChange",(0,g.Ck)(this.qw,this)),this.L=mYl(this),chrome.cast.setCustomReceivers(this.L,function(){},(0,g.Ck)(function(k){this.FX("Failed to set initial custom receivers: "+g.ri(k))},this)),this.publish("yt-remote-cast2-availability-change",H6(this)),D(!0))},this),(0,g.Ck)(function(k){this.FX("Failed to initialize API: "+ g.ri(k)); D(!1)},this))}; g.y.cW7=function(w,D){Ns("Setting connected screen ID: "+w+" -> "+D);if(this.T){var M=this.T.T;if(!w||M&&M.id!=w)Ns("Unsetting old screen status: "+this.T.V.friendlyName),jS(this,null)}if(w&&D){if(!this.T){w=EG(this.V.dV(),w);if(!w){Ns("setConnectedScreenStatus: Unknown screen.");return}if(w.idType=="shortLived"){Ns("setConnectedScreenStatus: Screen with id type to be short lived.");return}M=OVr(this,w);M||(Ns("setConnectedScreenStatus: Connected receiver not custom..."),M=new chrome.cast.Receiver(w.uuid? w.uuid:w.id,w.name),M.receiverType=chrome.cast.ReceiverType.CUSTOM,this.L.push(M),chrome.cast.setCustomReceivers(this.L,function(){},(0,g.Ck)(function(L){this.FX("Failed to set initial custom receivers: "+g.ri(L))},this))); Ns("setConnectedScreenStatus: new active receiver: "+M.friendlyName);jS(this,new Um(this.V,M),!0)}this.T.Ke(D)}else Ns("setConnectedScreenStatus: no screen.")}; g.y.YHd=function(w){this.xt()?this.FX("Setting connection data on disposed cast v2"):this.T?this.T.uX(w):this.FX("Setting connection data without a session")}; g.y.T9=function(){this.xt()?this.FX("Stopping session on disposed cast v2"):this.T?(this.T.stop(),jS(this,null)):Ns("Stopping non-existing session")}; g.y.requestSession=function(){chrome.cast.requestSession((0,g.Ck)(this.o7,this),(0,g.Ck)(this.MvE,this))}; g.y.oJ=function(){this.V.unsubscribe("onlineScreenChange",(0,g.Ck)(this.qw,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.W);var w=khr,D=g.w3("yt.mdx.remote.debug.handlers_");g.HQ(D||[],w);g.M9(this.T);g.mI.prototype.oJ.call(this)}; g.y.FX=function(w){Dc("Controller",w)}; g.y.n_=function(w,D){this.T==w&&(D||jS(this,null),this.publish("yt-remote-cast2-session-change",D))}; g.y.U$k=function(w,D){if(!this.xt())if(w)switch(w.friendlyName=chrome.cast.unescape(w.friendlyName),Ns("onReceiverAction_ "+w.label+" / "+w.friendlyName+"-- "+D),D){case chrome.cast.ReceiverAction.CAST:if(this.T)if(this.T.V.label!=w.label)Ns("onReceiverAction_: Stopping active receiver: "+this.T.V.friendlyName),this.T.stop();else{Ns("onReceiverAction_: Casting to active receiver.");this.T.T&&this.publish("yt-remote-cast2-session-change",this.T.T);break}switch(w.receiverType){case chrome.cast.ReceiverType.CUSTOM:jS(this, new Um(this.V,w));break;case chrome.cast.ReceiverType.DIAL:jS(this,new dm(this.V,w,this.D,this.config_));break;case chrome.cast.ReceiverType.CAST:jS(this,new iV(this.V,w,this.config_));break;default:this.FX("Unknown receiver type: "+w.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.T&&this.T.V.label==w.label?this.T.stop():this.FX("Stopping receiver w/o session: "+w.friendlyName)}else this.FX("onReceiverAction_ called without receiver.")}; g.y.xCW=function(w){if(this.xt())return Promise.reject(Error("disposed"));var D=w.receiver;D.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.FX("Not DIAL receiver: "+D.friendlyName),D.receiverType=chrome.cast.ReceiverType.DIAL);var M=this.T?this.T.V:null;if(!M||M.label!=D.label)return this.FX("Receiving DIAL launch request for non-clicked DIAL receiver: "+D.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(M&&M.label==D.label&&M.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.T.T)return Ns("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.T.T),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.FX('Changing CAST intent from "'+M.receiverType+'" to "dial" for '+D.friendlyName);jS(this,new dm(this.V,D,this.D,this.config_))}D=this.T;D.U=w;D.U.appState==chrome.cast.DialAppState.RUNNING?(w=D.U.extraData||{},M=w.screenId||null,yV(D)&&w.loungeToken?w.loungeTokenRefreshIntervalMs?w=JzS(D,{name:D.V.friendlyName,screenId:w.screenId,loungeToken:w.loungeToken,dialId:D.U.receiver.label, screenIdType:"shortLived"},w.loungeTokenRefreshIntervalMs):(g.S2(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(w)+".")),w=z97(D,M)):w=z97(D,M)):w=Sas(D);return w}; g.y.o7=function(w){var D=this;if(!this.xt()&&!this.Y){Ns("New cast session ID: "+w.sessionId);var M=w.receiver;if(M.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.T)if(M.receiverType==chrome.cast.ReceiverType.CAST)Ns("Got resumed cast session before resumed mdx connection."),M.friendlyName=chrome.cast.unescape(M.friendlyName),jS(this,new iV(this.V,M,this.config_),!0);else{this.FX("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var L=this.T.V,Z=EG(this.V.dV(), L.label);Z&&Cx(Z,M.label)&&L.receiverType!=chrome.cast.ReceiverType.CAST&&M.receiverType==chrome.cast.ReceiverType.CAST&&(Ns("onSessionEstablished_: manual to cast session change "+M.friendlyName),g.M9(this.T),this.T=new iV(this.V,M,this.config_),this.T.subscribe("sessionScreen",(0,g.Ck)(this.n_,this,this.T)),this.T.subscribe("sessionFailed",function(){return KOQ(D,D.T)}),this.T.uX(null)); this.T.PZ(w)}}}; g.y.mX=function(){return this.T?this.T.eR():null}; g.y.MvE=function(w){this.xt()||(this.FX("Failed to estabilish a session: "+g.ri(w)),w.code!=chrome.cast.ErrorCode.CANCEL&&jS(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.y.yuc=function(w){Ns("Receiver availability updated: "+w);if(!this.xt()){var D=H6(this);this.G=w==chrome.cast.ReceiverAvailability.AVAILABLE;H6(this)!=D&&this.publish("yt-remote-cast2-availability-change",H6(this))}}; g.y.qw=function(){this.xt()||(this.L=mYl(this),Ns("Updating custom receivers: "+g.ri(this.L)),chrome.cast.setCustomReceivers(this.L,function(){},(0,g.Ck)(function(){this.FX("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",H6(this)))}; xh.prototype.setLaunchParams=xh.prototype.YHd;xh.prototype.setConnectedScreenStatus=xh.prototype.cW7;xh.prototype.stopSession=xh.prototype.T9;xh.prototype.getCastSession=xh.prototype.mX;xh.prototype.requestSession=xh.prototype.requestSession;xh.prototype.init=xh.prototype.init;xh.prototype.dispose=xh.prototype.dispose;var tGk=g.$x(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),CyQ=[],ko3=g.mx(tGk);g.y=sm.prototype; g.y.reset=function(w){this.listId="";this.index=-1;this.videoId="";tn3(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.ym=w.hasPrevious,this.lz=w.hasNext,this.Y=w.playerTime,this.W=w.playerTimeAt,this.V=w.seekableStart,this.G=w.seekableEnd,this.L=w.duration,this.U=w.loadedTime,this.T=w.liveIngestionTime,this.D= !isNaN(this.T))}; g.y.isPlaying=function(){return this.playerState==1}; g.y.isBuffering=function(){return this.playerState==3}; g.y.OM=function(w){this.L=isNaN(w)?0:w}; g.y.getDuration=function(){return this.D?this.L+al(this):this.L}; g.y.clone=function(){return new sm(i1x(this))};g.I(qs,g.mI);g.y=qs.prototype;g.y.getState=function(){return this.L}; g.y.q0=function(){return this.D.getReconnectTimeout()}; g.y.tB=function(){this.D.reconnect()}; g.y.play=function(){eS(this)?(this.T?this.T.play(null,g.vb,SS(this,"play")):uV(this,"play"),ISB(this,1,c6(rm(this))),this.publish("remotePlayerChange")):Xd(this,this.play)}; g.y.pause=function(){eS(this)?(this.T?this.T.pause(null,g.vb,SS(this,"pause")):uV(this,"pause"),ISB(this,2,c6(rm(this))),this.publish("remotePlayerChange")):Xd(this,this.pause)}; g.y.seekTo=function(w){if(eS(this)){if(this.T){var D=rm(this),M=new chrome.cast.media.SeekRequest;M.currentTime=w;D.isPlaying()||D.isBuffering()?M.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:M.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.T.seek(M,g.vb,SS(this,"seekTo",{newTime:w}))}else uV(this,"seekTo",{newTime:w});ISB(this,3,w);this.publish("remotePlayerChange")}else Xd(this,g.El(this.seekTo,w))}; g.y.stop=function(){if(eS(this)){this.T?this.T.stop(null,g.vb,SS(this,"stopVideo")):uV(this,"stopVideo");var w=rm(this);w.index=-1;w.videoId="";tn3(w);TE(this,w);this.publish("remotePlayerChange")}else Xd(this,this.stop)}; g.y.setVolume=function(w,D){if(eS(this)){var M=rm(this);if(this.V){if(M.volume!=w){var L=Math.round(w)/100;this.V.setReceiverVolumeLevel(L,(0,g.Ck)(function(){Ms("set receiver volume: "+L)},this),(0,g.Ck)(function(){this.FX("failed to set receiver volume.")},this))}M.muted!=D&&this.V.setReceiverMuted(D,(0,g.Ck)(function(){Ms("set receiver muted: "+D)},this),(0,g.Ck)(function(){this.FX("failed to set receiver muted.")},this))}else{var Z={volume:w, muted:D};M.volume!=-1&&(Z.delta=w-M.volume);uV(this,"setVolume",Z)}M.muted=D;M.volume=w;TE(this,M)}else Xd(this,g.El(this.setVolume,w,D))}; g.y.uR=function(w,D){if(eS(this)){var M=rm(this);w={videoId:w};D&&(M.trackData={trackName:D.name,languageCode:D.languageCode,sourceLanguageCode:D.translationLanguage?D.translationLanguage.languageCode:"",languageName:D.languageName,kind:D.kind},w.style=g.ri(D.style),g.dC(w,M.trackData));uV(this,"setSubtitlesTrack",w);TE(this,M)}else Xd(this,g.El(this.uR,w,D))}; g.y.setAudioTrack=function(w,D){eS(this)?(D=D.getLanguageInfo().getId(),uV(this,"setAudioTrack",{videoId:w,audioTrackId:D}),w=rm(this),w.audioTrackId=D,TE(this,w)):Xd(this,g.El(this.setAudioTrack,w,D))}; g.y.playVideo=function(w,D,M,L,Z,k,b){L=L===void 0?null:L;Z=Z===void 0?null:Z;k=k===void 0?null:k;b=b===void 0?null:b;var C=rm(this),l={videoId:w};M!==void 0&&(l.currentIndex=M);B6(C,w,M||0);D!==void 0&&(v6(C,D),l.currentTime=D);L&&(l.listId=L);Z&&(l.playerParams=Z);k&&(l.clickTrackingParams=k);b&&(l.locationInfo=g.ri(b));uV(this,"setPlaylist",l);L||TE(this,C)}; g.y.e6=function(w,D){if(eS(this)){if(w&&D){var M=rm(this);B6(M,w,D);TE(this,M)}uV(this,"previous")}else Xd(this,g.El(this.e6,w,D))}; g.y.nextVideo=function(w,D){if(eS(this)){if(w&&D){var M=rm(this);B6(M,w,D);TE(this,M)}uV(this,"next")}else Xd(this,g.El(this.nextVideo,w,D))}; g.y.T6=function(){if(eS(this)){uV(this,"clearPlaylist");var w=rm(this);w.reset();TE(this,w);this.publish("remotePlayerChange")}else Xd(this,this.T6)}; g.y.JT=function(){eS(this)?uV(this,"dismissAutoplay"):Xd(this,this.JT)}; g.y.dispose=function(){if(this.L!=3){var w=this.L;this.L=3;this.publish("proxyStateChange",w,this.L)}g.mI.prototype.dispose.call(this)}; g.y.oJ=function(){yn3(this);this.D=null;this.W.clear();f0(this,null);g.mI.prototype.oJ.call(this)}; g.y.aX=function(w){if((w!=this.L||w==2)&&this.L!=3&&w!=0){var D=this.L;this.L=w;this.publish("proxyStateChange",D,w);if(w==1)for(;!this.W.isEmpty();)D=w=this.W,D.T.length===0&&(D.T=D.V,D.T.reverse(),D.V=[]),w.T.pop().apply(this);else w==3&&this.dispose()}}; g.y.Btd=function(w,D){this.publish(w,D)}; g.y.Ku7=function(w){if(!w)this.yR(null),f0(this,null);else if(this.V.receiver.volume){w=this.V.receiver.volume;var D=rm(this),M=Math.round(100*w.level||0);if(D.volume!=M||D.muted!=w.muted)Ms("Cast volume update: "+w.level+(w.muted?" muted":"")),D.volume=M,D.muted=!!w.muted,TE(this,D)}}; g.y.yR=function(w){Ms("Cast media: "+!!w);this.T&&this.T.removeUpdateListener(this.U);if(this.T=w)this.T.addUpdateListener(this.U),Umr(this),this.publish("remotePlayerChange")}; g.y.Wu_=function(w){w?(Umr(this),this.publish("remotePlayerChange")):this.yR(null)}; g.y.H2=function(){uV(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.y.tb_=function(){var w=pL1();w&&f0(this,w)}; g.y.FX=function(w){Dc("CP",w)};g.I(zE,g.mI);g.y=zE.prototype; g.y.connect=function(w,D){if(D){var M=D.listId,L=D.videoId,Z=D.videoIds,k=D.playerParams,b=D.clickTrackingParams,C=D.index,l={videoId:L},E=D.currentTime,p=D.locationInfo;D=D.loopMode;E!==void 0&&(l.currentTime=E<=5?0:E);k&&(l.playerParams=k);p&&(l.locationInfo=p);b&&(l.clickTrackingParams=b);M&&(l.listId=M);Z&&Z.length>0&&(l.videoIds=Z.join(","));C!==void 0&&(l.currentIndex=C);this.fV&&(l.loopMode=D||"LOOP_MODE_OFF");M&&(this.T.listId=M);this.T.videoId=L;this.T.index=C||0;this.T.state=3;v6(this.T, E);this.W="UNSUPPORTED";M=this.fV?"setInitialState":"setPlaylist";QV("Connecting with "+M+" and params: "+g.ri(l));this.V.connect({method:M,params:g.ri(l)},w,q43())}else QV("Connecting without params"),this.V.connect({},w,q43());jDB(this)}; g.y.XN=function(w){this.V.XN(w)}; g.y.dispose=function(){this.xt()||(g.mC("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),Jl(this,3));g.mI.prototype.dispose.call(this)}; g.y.oJ=function(){g9x(this);o91(this);Rbr(this);g.EO(this.U);this.U=NaN;g.EO(this.B);this.B=NaN;this.D=null;g.iC(this.y7);this.y7.length=0;this.V.dispose();g.mI.prototype.oJ.call(this);this.W=this.G=this.L=this.T=this.V=null}; g.y.Fg=function(w){if(!this.L||this.L.length===0)return!1;for(var D=g.x(this.L),M=D.next();!M.done;M=D.next())if(!M.value.capabilities.has(w))return!1;return!0}; g.y.kW=function(){var w=3;this.xt()||(w=0,isNaN(this.EY())?this.V.Zz()&&isNaN(this.Y)&&(w=1):w=2);return w}; g.y.bx=function(w){QV("Disconnecting with "+w);g.mC("yt.mdx.remote.remoteClient_",null);g9x(this);this.publish("beforeDisconnect",w);w==1&&hZ();this.V.disconnect(w);this.dispose()}; g.y.hM=function(){var w=this.T;this.D&&(w=this.T.clone(),B6(w,this.D,w.index));return i1x(w)}; g.y.FKJ=function(w){var D=this,M=new sm(w);M.videoId&&M.videoId!=this.T.videoId&&(this.D=M.videoId,g.EO(this.U),this.U=g.C7(function(){if(D.D){var Z=D.D;D.D=null;D.T.videoId!=Z&&VV(D,"getNowPlaying")}},5E3)); var L=[];this.T.listId==M.listId&&this.T.videoId==M.videoId&&this.T.index==M.index||L.push("remoteQueueChange");this.T.playerState==M.playerState&&this.T.volume==M.volume&&this.T.muted==M.muted&&c6(this.T)==c6(M)&&g.ri(this.T.trackData)==g.ri(M.trackData)||L.push("remotePlayerChange");this.T.reset(w);g.PQ(L,function(Z){this.publish(Z)},this)}; g.y.Ct=function(){var w=this.V.getDeviceId(),D=g.y1(this.L,function(M){return M.type=="REMOTE_CONTROL"&&M.id!=w}); return D?D.id:""}; g.y.EY=function(){return this.V.q0()}; g.y.tM=function(){return this.W||"UNSUPPORTED"}; g.y.CI=function(){return this.G||""}; g.y.yv=function(){!isNaN(this.EY())&&this.V.tB()}; g.y.ZyE=function(w,D){VV(this,w,D);FIZ(this)}; g.y.Rd=function(){var w=g.FN("SAPISID","")||g.FN("__Secure-1PAPISID")||"",D=g.FN("__Secure-3PAPISID","")||"";if(!w&&!D)return"";w=g.oJ(g.RJ(w),2);D=g.oJ(g.RJ(D),2);return g.oJ(g.RJ(","+w+","+D),2)}; zE.prototype.subscribe=zE.prototype.subscribe;zE.prototype.unsubscribeByKey=zE.prototype.mY;zE.prototype.getProxyState=zE.prototype.kW;zE.prototype.disconnect=zE.prototype.bx;zE.prototype.getPlayerContextData=zE.prototype.hM;zE.prototype.setPlayerContextData=zE.prototype.FKJ;zE.prototype.getOtherConnectedRemoteId=zE.prototype.Ct;zE.prototype.getReconnectTimeout=zE.prototype.EY;zE.prototype.getAutoplayMode=zE.prototype.tM;zE.prototype.getAutoplayVideoId=zE.prototype.CI;zE.prototype.reconnect=zE.prototype.yv; zE.prototype.sendMessage=zE.prototype.ZyE;zE.prototype.getXsrfToken=zE.prototype.Rd;zE.prototype.isCapabilitySupportedOnConnectedDevices=zE.prototype.Fg;g.I(TOl,bV);g.y=TOl.prototype;g.y.dV=function(w){return this.gI.$_gs(w)}; g.y.contains=function(w){return!!this.gI.$_c(w)}; g.y.get=function(w){return this.gI.$_g(w)}; g.y.start=function(){this.gI.$_st()}; g.y.add=function(w,D,M){this.gI.$_a(w,D,M)}; g.y.remove=function(w,D,M){this.gI.$_r(w,D,M)}; g.y.Lv=function(w,D,M,L){this.gI.$_un(w,D,M,L)}; g.y.oJ=function(){for(var w=this.T.length,D=0;D1&&!this.K.getOption("remote","quickCast")?(this.Rp=g.Ol(w,this.T,this),this.cX(g.yR(w,this.T)),w=this.K.getOption("remote","currentReceiver"),w=this.T(w),this.options[w]&&this.V4(w),this.enable(!0)):this.enable(!1)}; ht.prototype.T=function(w){return w.key}; ht.prototype.Kf=function(w){return w==="cast-selector-receiver"?"Cast...":this.Rp[w].name}; ht.prototype.W9=function(w){g.cp.prototype.W9.call(this,w);this.K.setOption("remote","currentReceiver",this.Rp[w]);this.Ac.aO()};g.I(lqk,g.xX);g.y=lqk.prototype; g.y.create=function(){var w=this.player.X(),D=g.bw(w);w={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:w.C("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:w.C("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:w.C("enable_cast_short_lived_lounge_token")};zb3(D,w);this.subscriptions.push(g.Vn("yt-remote-before-disconnect",this.DCE,this));this.subscriptions.push(g.Vn("yt-remote-connection-change",this.H6V,this));this.subscriptions.push(g.Vn("yt-remote-receiver-availability-change",this.VE, this));this.subscriptions.push(g.Vn("yt-remote-auto-connect",this.TH5,this));this.subscriptions.push(g.Vn("yt-remote-receiver-resumed",this.m8V,this));this.subscriptions.push(g.Vn("mdx-privacy-popup-confirm",this.r8V,this));this.subscriptions.push(g.Vn("mdx-privacy-popup-cancel",this.MJd,this));this.VE()}; g.y.load=function(){this.player.cancelPlayback();g.xX.prototype.load.call(this);this.F1=new CIQ(this.player.X(),this);this.player.Cw(this.F1);this.tV=new Zb7(this,this.player,this.u9);var w=(w=DXB())?w.currentTime:0;var D=mmP()?new qs(ZI(),void 0):null;w==0&&D&&(w=c6(rm(D)));w!==0&&this.M$(w);EbB(this,this.uT,this.uT);this.player.bA(6)}; g.y.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.iq();this.M0=this.aK;g.Ls(this.tV,this.u9);this.u9=this.F1=this.tV=null;g.xX.prototype.unload.call(this);this.player.bA(5);tt(this)}; g.y.oJ=function(){g.PA(this.subscriptions);g.xX.prototype.oJ.call(this)}; g.y.LA=function(w){var D=g.rR.apply(1,arguments);this.loaded&&this.tV.hH.apply(this.tV,[w].concat(g.tG(D)))}; g.y.getAdState=function(){return this.Jt}; g.y.ym=function(){return this.u9?rm(this.u9).ym:!1}; g.y.lz=function(){return this.u9?rm(this.u9).lz:!1}; g.y.M$=function(w,D){this.lP=w||0;this.player.publish("progresssync",w,D);this.player.n6("onVideoProgress",w||0)}; g.y.getCurrentTime=function(){return this.lP}; g.y.getDuration=function(){return rm(this.u9).getDuration()||0}; g.y.mj=function(){var w=rm(this.u9);return w.D?w.T+al(w):w.T}; g.y.dC=function(){return rm(this.u9).U}; g.y.hf=function(){return $mZ(rm(this.u9))}; g.y.N3=function(){var w=rm(this.u9);return w.V>0?w.V+al(w):w.V}; g.y.getProgressState=function(){var w=rm(this.u9),D=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:w.playerState!=1081&&this.player.Lx(),clipEnd:D.clipEnd,clipStart:D.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.mj(),isAtLiveHead:this.isAtLiveHead(),loaded:this.dC(),seekableEnd:this.hf(),seekableStart:this.N3(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.y.isAtLiveHead=function(){return $mZ(rm(this.u9))-this.getCurrentTime()<=1}; g.y.nextVideo=function(){this.u9&&this.u9.nextVideo()}; g.y.e6=function(){this.u9&&this.u9.e6()}; g.y.DCE=function(w){w===1&&(this.MW=this.u9?rm(this.u9):null)}; g.y.H6V=function(){var w=mmP()?new qs(ZI(),void 0):null;if(w){var D=this.M0;this.loaded&&this.unload();this.u9=w;this.MW=null;D.key!==this.aK.key&&(this.M0=D,this.load())}else g.M9(this.u9),this.u9=null,this.loaded&&(this.unload(),(w=this.MW)&&w.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(w.videoId,c6(w)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.y.VE=function(){var w=[this.aK],D=w.concat,M=VnZ();n0()&&g.Rj("yt-remote-cast-available")&&M.push({key:"cast-selector-receiver",name:"Cast..."});this.Rp=D.call(w,M);w=O1x()||this.aK;$v(this,w);this.player.n6("onMdxReceiversChange")}; g.y.TH5=function(){var w=O1x();$v(this,w)}; g.y.m8V=function(){this.M0=O1x()}; g.y.r8V=function(){this.dn=!0;tt(this);Cw=!1;kv&&Yv(kv,1);kv=null}; g.y.MJd=function(){this.dn=!1;tt(this);$v(this,this.aK);this.M0=this.aK;Cw=!1;kv=null;this.player.playVideo()}; g.y.LJ=function(w,D){switch(w){case "casting":return this.loaded;case "receivers":return this.Rp;case "currentReceiver":return D&&(D.key==="cast-selector-receiver"?WIs():$v(this,D)),this.loaded?this.M0:this.aK;case "quickCast":return this.Rp.length===2&&this.Rp[1].key==="cast-selector-receiver"?(D&&WIs(),!0):!1}}; g.y.H2=function(){this.u9.H2()}; g.y.UM=function(){return!1}; g.y.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.y.isLoggedIn=function(){var w,D;return((w=g.Xg("PLAYER_CONFIG"))==null?void 0:(D=w.args)==null?void 0:D.authuser)!==void 0?!0:!(!g.Xg("SESSION_INDEX")&&!g.Xg("LOGGED_IN"))};g.Uc("remote",lqk);})(_yt_player);