(function(g){var window=this;'use strict';var Rp=function(Q){g.Gn(Q,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.Qs()).toString(36));return Q},Q2=function(Q,z,H){Array.isArray(H)||(H=[String(H)]); g.mKp(Q.D,z,H)},bTT=function(Q){if(Q instanceof g.L8)return Q; if(typeof Q.xM=="function")return Q.xM(!1);if(g.mZ(Q)){var z=0,H=new g.L8;H.next=function(){for(;;){if(z>=Q.length)return g.XQ;if(z in Q)return g.u2(Q[z++]);z++}}; return H}throw Error("Not implemented");},Lku=function(Q,z,H){if(g.mZ(Q))g.qI(Q,z,H); else for(Q=bTT(Q);;){var f=Q.next();if(f.done)break;z.call(H,f.value,void 0,Q)}},uys=function(Q,z){var H=[]; Lku(z,function(f){try{var b=g.YF.prototype.B.call(this,f,!0)}catch(L){if(L=="Storage: Invalid value was encountered")return;throw L;}b===void 0?H.push(f):g.fPp(b)&&H.push(f)},Q); return H},S9Y=function(Q,z){uys(Q,z).forEach(function(H){g.YF.prototype.remove.call(this,H)},Q)},X5x=function(Q){if(Q.Ze){if(Q.Ze.locationOverrideToken)return{locationOverrideToken:Q.Ze.locationOverrideToken}; if(Q.Ze.latitudeE7!=null&&Q.Ze.longitudeE7!=null)return{latitudeE7:Q.Ze.latitudeE7,longitudeE7:Q.Ze.longitudeE7}}return null},vcB=function(Q,z){g.kO(Q,z)||Q.push(z)},yut=function(Q){var z=0,H; for(H in Q)z++;return z},q9L=function(Q,z){return g.II(Q,z)},MyR=function(Q){try{return g.iL.JSON.parse(Q)}catch(z){}Q=String(Q); if(/^\s*$/.test(Q)?0:/^[\],:{}\s\u2028\u2029]*$/.test(Q.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("("+Q+")")}catch(z){}throw Error("Invalid JSON string: "+Q);},zV=function(Q){if(g.iL.JSON)try{return g.iL.JSON.parse(Q)}catch(z){}return MyR(Q)},Cqx=function(Q){if(Q.fg&&typeof Q.fg=="function")return Q.fg(); if(typeof Map!=="undefined"&&Q instanceof Map||typeof Set!=="undefined"&&Q instanceof Set)return Array.from(Q.values());if(typeof Q==="string")return Q.split("");if(g.mZ(Q)){for(var z=[],H=Q.length,f=0;f1){if(H%2)throw Error("Uneven number of arguments");for(var f=0;f5&&(Q=Q.slice(Q.length-5)); var z=g.J5(X2J(),function(f){return f.loungeToken}),H=g.J5(Q,function(f){return f.loungeToken}); g.NT(H,function(f){return!g.kO(z,f)})&&v75(); g.Bw("yt-remote-local-screens",Q,31536E3)},Cd=function(Q){Q||(g.a4("yt-remote-session-screen-id"),g.a4("yt-remote-session-video-id")); uZY();Q=qE();g.e5(Q,ME());b1Y(Q)},qMm=function(){if(!ty){var Q=g.UF(); Q&&(ty=new g.NP(Q))}},MTR=function(){qMm(); return ty?!!ty.get("yt-remote-use-staging-server"):!1},Et=function(Q,z){g.b8[Q]=!0; var H=g.Hb();H&&H.publish.apply(H,arguments);g.b8[Q]=!1},CvR=function(){},H$=function(){if(!pd){pd=new g.Jj(new CvR); var Q=g.FZ("client_streamz_web_flush_count",-1);Q!==-1&&(pd.L=Q)}return pd},tTT=function(){var Q=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return Q?parseInt(Q[1],10):0},E7u=function(Q){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+Q)!=-1||document.currentScript.src.indexOf("&"+Q)!=-1)},p2s=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},nd=function(Q){Q.length?n7B(Q.shift(),function(){nd(Q)}):g7R()},Z1s=function(Q){return"chrome-extension://"+Q+"/cast_sender.js"},n7B=function(Q,z,H){var f=document.createElement("script"); f.onerror=z;H&&(f.onload=H);g.K$(f,g.of(Q));(document.head||document.documentElement).appendChild(f)},GrL=function(){var Q=tTT(),z=[]; if(Q>1){var H=Q-1;z.push("//www.gstatic.com/eureka/clank/"+Q+"/cast_sender.js");z.push("//www.gstatic.com/eureka/clank/"+H+"/cast_sender.js")}return z},g7R=function(){var Q=p2s(); Q&&Q(!1,"No cast extension found")},jnJ=function(){if($nY){var Q=2,z=p2s(),H=function(){Q--; Q==0&&z&&z(!0)}; window.__onGCastApiAvailable=H;n7B("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",g7R,H)}},FWu=function(){jnJ(); var Q=GrL();Q.push("//www.gstatic.com/eureka/clank/cast_sender.js");nd(Q)},O1t=function(){jnJ(); var Q=GrL();Q.push.apply(Q,g.F(xns.map(Z1s)));Q.push("//www.gstatic.com/eureka/clank/cast_sender.js");nd(Q)},gy=function(Q,z,H){g.h.call(this); this.j=H!=null?(0,g.lL)(Q,H):Q;this.I6=z;this.S=(0,g.lL)(this.Sw,this);this.Z=!1;this.B=0;this.L=this.C5=null;this.D=[]},Z8=function(){},o7x=function(){g.Px.call(this,"p")},JFu=function(){g.Px.call(this,"o")},IKO=function(){return NRL=NRL||new g.Qe},AFu=function(Q){g.Px.call(this,"serverreachability",Q)},GV=function(Q){var z=IKO(); z.dispatchEvent(new AFu(z,Q))},YMR=function(Q){g.Px.call(this,"statevent",Q)},$X=function(Q){var z=IKO(); z.dispatchEvent(new YMR(z,Q))},rFs=function(Q,z,H,f){g.Px.call(this,"timingevent",Q); this.size=z;this.rtt=H;this.retries=f},jI=function(Q,z){if(typeof Q!=="function")throw Error("Fn must not be null and must be a function"); return g.iL.setTimeout(function(){Q()},z)},Fb=function(){},xX=function(Q,z,H,f){this.L=Q; this.D=z;this.EY=H;this.Xa=f||1;this.gh=new g.Oa(this);this.WI=45E3;this.jm=null;this.j=!1;this.U=this.uT=this.N=this.mq=this.L3=this.rT=this.Ze=null;this.wh=[];this.Z=null;this.Y=0;this.S=this.De=null;this.ZJ=-1;this.f3=!1;this.C3=0;this.iT=null;this.KH=this.En=this.yE=this.yl=!1;this.B=new snu},snu=function(){this.L=null; this.Z="";this.B=!1},Pvm=function(Q,z,H){Q.mq=1; Q.N=Rp(z.clone());Q.U=H;Q.yl=!0;BRs(Q,null)},BRs=function(Q,z){Q.L3=Date.now(); Ot(Q);Q.uT=Q.N.clone();Q2(Q.uT,"t",Q.Xa);Q.Y=0;var H=Q.L.mq;Q.B=new snu;Q.Z=aK5(Q.L,H?z:null,!Q.U);Q.C3>0&&(Q.iT=new g.ze((0,g.lL)(Q.Z8,Q,Q.Z),Q.C3));Q.gh.listen(Q.Z,"readystatechange",Q.Am);z=Q.jm?g.B3(Q.jm):{};Q.U?(Q.De||(Q.De="POST"),z["Content-Type"]="application/x-www-form-urlencoded",Q.Z.send(Q.uT,Q.De,Q.U,z)):(Q.De="GET",Q.Z.send(Q.uT,Q.De,null,z));GV(1)},cFu=function(Q){if(!Unx(Q))return g.Q$(Q.Z); var z=g.zA(Q.Z);if(z==="")return"";var H="",f=z.length,b=g.ld(Q.Z)==4;if(!Q.B.L){if(typeof TextDecoder==="undefined")return o1(Q),Jy(Q),"";Q.B.L=new g.iL.TextDecoder}for(var L=0;Lz.length)return i1t;z=z.slice(f,f+H);Q.Y=f+H;return z},Ot=function(Q){Q.rT=Date.now()+Q.WI; Dnm(Q,Q.WI)},Dnm=function(Q,z){if(Q.Ze!=null)throw Error("WatchDog timer not null"); Q.Ze=jI((0,g.lL)(Q.fm,Q),z)},KW5=function(Q){Q.Ze&&(g.iL.clearTimeout(Q.Ze),Q.Ze=null)},Jy=function(Q){Q.L.eU()||Q.f3||VTu(Q.L,Q)},o1=function(Q){KW5(Q); g.S5(Q.iT);Q.iT=null;Q.gh.removeAll();if(Q.Z){var z=Q.Z;Q.Z=null;z.abort();z.dispose()}},RzT=function(Q,z){try{var H=Q.L; if(H.FR!=0&&(H.Z==Q||dnB(H.B,Q)))if(!Q.En&&dnB(H.B,Q)&&H.FR==3){try{var f=H.Tx.Z.parse(z)}catch(G){f=null}if(Array.isArray(f)&&f.length==3){var b=f;if(b[0]==0)a:{if(!H.N){if(H.Z)if(H.Z.L3+3E30&&(H.C3=1.5*X);f=H;var v=Q.rH();if(v){var y=g.Hn(v,"X-Client-Wire-Protocol");if(y){var q=f.B;!q.Z&&(g.Fx(y,"spdy")||g.Fx(y,"quic")||g.Fx(y,"h2"))&&(q.D=q.S,q.Z=new Set,q.B&&(kru(q,q.B),q.B=null))}if(f.yl){var M=g.Hn(v,"X-HTTP-Session-Id");M&&(f.Bc=M,g.Gn(f.jm,f.yl,M))}}H.FR=3;H.S&&H.S.LL();H.UY&&(H.ys=Date.now()-Q.L3);f=H;var C=Q;f.p5=TRs(f,f.mq?f.Xa:null,f.EY);if(C.En){ezT(f.B, C);var t=C,E=f.C3;E&&t.setTimeout(E);t.Ze&&(KW5(t),Ot(t));f.Z=C}else lKJ(f);H.L.length>0&&YX(H)}else L[0]!="stop"&&L[0]!="close"||Ay(H,7);else H.FR==3&&(L[0]=="stop"||L[0]=="close"?L[0]=="stop"?Ay(H,7):H.disconnect():L[0]!="noop"&&H.S&&H.S.qh(L),H.wh=0)}GV(4)}catch(G){}},Q4J=function(Q,z){this.Z=Q; this.map=z;this.context=null},zMO=function(Q){this.S=Q||10; g.iL.PerformanceNavigationTiming?(Q=g.iL.performance.getEntriesByType("navigation"),Q=Q.length>0&&(Q[0].nextHopProtocol=="hq"||Q[0].nextHopProtocol=="h2")):Q=!!(g.iL.chrome&&g.iL.chrome.loadTimes&&g.iL.chrome.loadTimes()&&g.iL.chrome.loadTimes().wasFetchedViaSpdy);this.D=Q?this.S:1;this.Z=null;this.D>1&&(this.Z=new Set);this.B=null;this.L=[]},HFu=function(Q){return Q.B?!0:Q.Z?Q.Z.size>=Q.D:!1},w2O=function(Q){return Q.B?1:Q.Z?Q.Z.size:0},dnB=function(Q,z){return Q.B?Q.B==z:Q.Z?Q.Z.has(z):!1},kru= function(Q,z){Q.Z?Q.Z.add(z):Q.B=z},ezT=function(Q,z){Q.B&&Q.B==z?Q.B=null:Q.Z&&Q.Z.has(z)&&Q.Z.delete(z)},fQx=function(Q){if(Q.B!=null)return Q.L.concat(Q.B.wh); if(Q.Z!=null&&Q.Z.size!==0){var z=Q.L;Q=g.n(Q.Z.values());for(var H=Q.next();!H.done;H=Q.next())z=z.concat(H.value.wh);return z}return g.Qi(Q.L)},bFs=function(Q,z){var H=new Fb; if(g.iL.Image){var f=new Image;f.onload=g.RJ(ry,H,"TestLoadImage: loaded",!0,z,f);f.onerror=g.RJ(ry,H,"TestLoadImage: error",!1,z,f);f.onabort=g.RJ(ry,H,"TestLoadImage: abort",!1,z,f);f.ontimeout=g.RJ(ry,H,"TestLoadImage: timeout",!1,z,f);g.iL.setTimeout(function(){if(f.ontimeout)f.ontimeout()},1E4); f.src=Q}else z(!1)},L3R=function(Q,z){var H=new Fb,f=new AbortController,b=setTimeout(function(){f.abort(); ry(H,"TestPingServer: timeout",!1,z)},1E4); fetch(Q,{signal:f.signal}).then(function(L){clearTimeout(b);L.ok?ry(H,"TestPingServer: ok",!0,z):ry(H,"TestPingServer: server error",!1,z)}).catch(function(){clearTimeout(b); ry(H,"TestPingServer: error",!1,z)})},ry=function(Q,z,H,f,b){try{b&&(b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null),f(H)}catch(L){}},uXY=function(){this.Z=new Z8},SPm=function(Q,z,H){var f=H||""; try{Ecm(Q,function(b,L){var u=b;g.wc(b)&&(u=g.IR(b));z.push(f+L+"="+encodeURIComponent(u))})}catch(b){throw z.push(f+"type="+encodeURIComponent("_badmap")),b; }},B$=function(Q,z,H){return H&&H.eSl?H.eSl[Q]||z:z},Xw5=function(Q){this.L=[]; this.Xa=this.p5=this.jm=this.EY=this.Z=this.Bc=this.yl=this.f3=this.Y=this.ZJ=this.U=null;this.YJ=this.uT=0;this.m4=B$("failFast",!1,Q);this.En=this.Ze=this.N=this.j=this.S=null;this.Wz=!0;this.d4=this.iT=-1;this.KH=this.wh=this.L3=0;this.D6=B$("baseRetryDelayMs",5E3,Q);this.sj=B$("retryDelaySeedMs",1E4,Q);this.cq=B$("forwardChannelMaxRetries",2,Q);this.yR=B$("forwardChannelRequestTimeoutMs",2E4,Q);this.zx=Q&&Q.qWm||void 0;this.Ci=Q&&Q.O85||void 0;this.QN=Q&&Q.P1T||!1;this.C3=void 0;this.mq=Q&&Q.pBT|| !1;this.D="";this.B=new zMO(Q&&Q.Izv);this.Tx=new uXY;this.gh=Q&&Q.kYl||!1;this.rT=Q&&Q.HZ$||!1;this.gh&&this.rT&&(this.rT=!1);this.h$=Q&&Q.p0v||!1;Q&&Q.DFT&&(this.Wz=!1);this.UY=!this.gh&&this.Wz&&Q&&Q.WZ5||!1;this.Vs=void 0;Q&&Q.Rd&&Q.Rd>0&&(this.Vs=Q.Rd);this.gT=void 0;this.ys=0;this.WI=!1;this.yE=this.De=null},I1=function(Q){Q.Z&&(vQu(Q),Q.Z.cancel(),Q.Z=null)},yqL=function(Q){I1(Q); Q.N&&(g.iL.clearTimeout(Q.N),Q.N=null);NE(Q);Q.B.cancel();Q.j&&(typeof Q.j==="number"&&g.iL.clearTimeout(Q.j),Q.j=null)},YX=function(Q){HFu(Q.B)||Q.j||(Q.j=!0,g.qH(Q.xe,Q),Q.L3=0)},Msu=function(Q,z){if(w2O(Q.B)>=Q.B.D-(Q.j?1:0))return!1; if(Q.j)return Q.L=z.wh.concat(Q.L),!0;if(Q.FR==1||Q.FR==2||Q.L3>=(Q.m4?0:Q.cq))return!1;Q.j=jI((0,g.lL)(Q.xe,Q,z),qPs(Q,Q.L3));Q.L3++;return!0},tsm=function(Q,z){var H; z?H=z.EY:H=Q.uT++;var f=Q.jm.clone();g.Gn(f,"SID",Q.D);g.Gn(f,"RID",H);g.Gn(f,"AID",Q.iT);P$(Q,f);Q.Y&&Q.U&&g.xq(f,Q.Y,Q.U);H=new xX(Q,Q.D,H,Q.L3+1);Q.Y===null&&(H.jm=Q.U);z&&(Q.L=z.wh.concat(Q.L));z=ChL(Q,H,1E3);H.setTimeout(Math.round(Q.yR*.5)+Math.round(Q.yR*.5*Math.random()));kru(Q.B,H);Pvm(H,f,z)},P$=function(Q,z){Q.f3&&g.G2(Q.f3,function(H,f){g.Gn(z,f,H)}); Q.S&&Ecm({},function(H,f){g.Gn(z,f,H)})},ChL=function(Q,z,H){H=Math.min(Q.L.length,H); var f=Q.S?(0,g.lL)(Q.S.m9,Q.S,Q):null;a:{for(var b=Q.L,L=-1;;){var u=["count="+H];L==-1?H>0?(L=b[0].Z,u.push("ofs="+L)):L=0:u.push("ofs="+L);for(var X=!0,v=0;v=3)return!1; Q.KH++;Q.N=jI((0,g.lL)(Q.Ph,Q),qPs(Q,Q.wh));Q.wh++;return!0},vQu=function(Q){Q.De!=null&&(g.iL.clearTimeout(Q.De),Q.De=null)},EQm=function(Q){Q.Z=new xX(Q,Q.D,"rpc",Q.KH); Q.Y===null&&(Q.Z.jm=Q.U);Q.Z.C3=0;var z=Q.p5.clone();g.Gn(z,"RID","rpc");g.Gn(z,"SID",Q.D);g.Gn(z,"AID",Q.iT);g.Gn(z,"CI",Q.En?"0":"1");!Q.En&&Q.Vs&&g.Gn(z,"TO",Q.Vs);g.Gn(z,"TYPE","xmlhttp");P$(Q,z);Q.Y&&Q.U&&g.xq(z,Q.Y,Q.U);Q.C3&&Q.Z.setTimeout(Q.C3);var H=Q.Z;Q=Q.Xa;H.mq=1;H.N=Rp(z.clone());H.U=null;H.yl=!0;BRs(H,Q)},NE=function(Q){Q.Ze!=null&&(g.iL.clearTimeout(Q.Ze),Q.Ze=null)},VTu=function(Q,z){var H=null; if(Q.Z==z){NE(Q);vQu(Q);Q.Z=null;var f=2}else if(dnB(Q.B,z))H=z.wh,ezT(Q.B,z),f=1;else return;if(Q.FR!=0)if(z.j)if(f==1){H=z.U?z.U.length:0;z=Date.now()-z.L3;var b=Q.L3;f=IKO();f.dispatchEvent(new rFs(f,H,z,b));YX(Q)}else lKJ(Q);else{var L=z.ZJ;b=z.getLastError();if(b==3||b==0&&L>0||!(f==1&&Msu(Q,z)||f==2&&mnx(Q)))switch(H&&H.length>0&&(z=Q.B,z.L=z.L.concat(H)),b){case 1:Ay(Q,5);break;case 4:Ay(Q,10);break;case 3:Ay(Q,6);break;default:Ay(Q,2)}}},qPs=function(Q,z){var H=Q.D6+Math.floor(Math.random()* Q.sj); Q.isActive()||(H*=2);return H*z},Ay=function(Q,z){if(z==2){var H=(0,g.lL)(Q.uRh,Q),f=Q.Ci,b=!f; f=new g.M7(f||"//www.google.com/images/cleardot.gif");g.iL.location&&g.iL.location.protocol=="http"||g.C7(f,"https");Rp(f);b?bFs(f.toString(),H):L3R(f.toString(),H)}else $X(2);Q.FR=0;Q.S&&Q.S.Bh(z);pwu(Q);yqL(Q)},pwu=function(Q){Q.FR=0; Q.yE=[];if(Q.S){var z=fQx(Q.B);if(z.length!=0||Q.L.length!=0)g.z7(Q.yE,z),g.z7(Q.yE,Q.L),Q.B.L.length=0,g.Qi(Q.L),Q.L.length=0;Q.S.z5()}},nQT=function(Q){if(Q.FR==0)return Q.yE; var z=[];g.z7(z,fQx(Q.B));g.z7(z,Q.L);return z},TRs=function(Q,z,H){var f=g.$q(H); f.Z!=""?(z&&g.tk(f,z+"."+f.Z),g.Ea(f,f.L)):(f=g.iL.location,f=p5T(f.protocol,z?z+"."+f.hostname:f.hostname,+f.port,H));z=Q.yl;H=Q.Bc;z&&H&&g.Gn(f,z,H);g.Gn(f,"VER",Q.w3);P$(Q,f);return f},aK5=function(Q,z,H){if(z&&!Q.mq)throw Error("Can't create secondary domain capable XhrIo object."); z=Q.QN&&!Q.zx?new g.kr(new g.XA({Tg:H})):new g.kr(Q.zx);z.Y=Q.mq;return z},gQT=function(){},ZFs=function(){},Ut=function(Q,z){g.Qe.call(this); this.Z=new Xw5(z);this.S=Q;this.B=z&&z.NT3||null;Q=z&&z.IJm||null;z&&z.uS3&&(Q?Q["X-Client-Protocol"]="webchannel":Q={"X-Client-Protocol":"webchannel"});this.Z.U=Q;Q=z&&z.vQj||null;z&&z.wf&&(Q?Q["X-WebChannel-Content-Type"]=z.wf:Q={"X-WebChannel-Content-Type":z.wf});z&&z.iX&&(Q?Q["X-WebChannel-Client-Profile"]=z.iX:Q={"X-WebChannel-Client-Profile":z.iX});this.Z.ZJ=Q;(Q=z&&z.slv)&&!g.j5(Q)&&(this.Z.Y=Q);this.j=z&&z.pBT||!1;this.D=z&&z.mem||!1;(z=z&&z.Thh)&&!g.j5(z)&&(this.Z.yl=z,g.Nz(this.B,z)&&(Q= this.B,z in Q&&delete Q[z]));this.L=new a1(this)},Gdu=function(Q){o7x.call(this); Q.__headers__&&(this.headers=Q.__headers__,this.statusCode=Q.__status__,delete Q.__headers__,delete Q.__status__);var z=Q.__sm__;z?this.data=(this.Z=g.Or(z))?g.ra(z,this.Z):z:this.data=Q},$0Y=function(Q){JFu.call(this); this.status=1;this.errorCode=Q},a1=function(Q){this.Z=Q},j4u=function(Q,z){this.B=Q; this.Z=z},F3Y=function(Q){return nQT(Q.Z).map(function(z){var H=Q.B; z=z.map;"__data__"in z?(z=z.__data__,H=H.D?MyR(z):z):H=z;return H})},c$=function(Q,z){if(typeof Q!=="function")throw Error("Fn must not be null and must be a function"); return g.iL.setTimeout(function(){Q()},z)},hy=function(Q){iJ.dispatchEvent(new x0u(iJ,Q))},x0u=function(Q){g.Px.call(this,"statevent",Q)},W$=function(Q,z,H,f){this.Z=Q; this.D=z;this.Y=H;this.j=f||1;this.B=45E3;this.L=new g.Oa(this);this.S=new g.xr;this.S.setInterval(250)},oQO=function(Q,z,H){Q.lK=1; Q.Mr=Rp(z.clone());Q.u9=H;Q.yl=!0;OFu(Q,null)},Jqu=function(Q,z,H,f,b){Q.lK=1; Q.Mr=Rp(z.clone());Q.u9=null;Q.yl=H;b&&(Q.Gg=!1);OFu(Q,f)},OFu=function(Q,z){Q.yJ=Date.now(); NDB(Q);Q.jP=Q.Mr.clone();Q2(Q.jP,"t",Q.j);Q.fY=0;Q.Of=Q.Z.Xb(Q.Z.GK()?z:null);Q.pC>0&&(Q.KY=new g.ze((0,g.lL)(Q.ao,Q,Q.Of),Q.pC));Q.L.listen(Q.Of,"readystatechange",Q.YH);z=Q.C$?g.B3(Q.C$):{};Q.u9?(Q.SP="POST",z["Content-Type"]="application/x-www-form-urlencoded",Q.Of.send(Q.jP,Q.SP,Q.u9,z)):(Q.SP="GET",Q.Gg&&!g.lQ&&(z.Connection="close"),Q.Of.send(Q.jP,Q.SP,null,z));Q.Z.jE(1)},YPm=function(Q,z){var H=Q.fY,f=z.indexOf("\n",H); if(f==-1)return IQL;H=Number(z.substring(H,f));if(isNaN(H))return AqL;f+=1;if(f+H>z.length)return IQL;z=z.slice(f,f+H);Q.fY=f+H;return z},NDB=function(Q){Q.iq=Date.now()+Q.B; rqu(Q,Q.B)},rqu=function(Q,z){if(Q.wU!=null)throw Error("WatchDog timer not null"); Q.wU=c$((0,g.lL)(Q.nm,Q),z)},s4s=function(Q){Q.wU&&(g.iL.clearTimeout(Q.wU),Q.wU=null)},BDs=function(Q){Q.Z.eU()||Q.DH||Q.Z.hC(Q)},D8=function(Q){s4s(Q); g.S5(Q.KY);Q.KY=null;Q.S.stop();Q.L.removeAll();if(Q.Of){var z=Q.Of;Q.Of=null;z.abort();z.dispose()}Q.GH&&(Q.GH=null)},Phs=function(Q,z){try{Q.Z.ke(Q,z),Q.Z.jE(4)}catch(H){}},U0u=function(Q,z,H,f,b){if(f==0)H(!1); else{var L=b||0;f--;aQB(Q,z,function(u){u?H(!0):g.iL.setTimeout(function(){U0u(Q,z,H,f,L)},L)})}},aQB=function(Q,z,H){var f=new Image; f.onload=function(){try{Kd(f),H(!0)}catch(b){}}; f.onerror=function(){try{Kd(f),H(!1)}catch(b){}}; f.onabort=function(){try{Kd(f),H(!1)}catch(b){}}; f.ontimeout=function(){try{Kd(f),H(!1)}catch(b){}}; g.iL.setTimeout(function(){if(f.ontimeout)f.ontimeout()},z); f.src=Q},Kd=function(Q){Q.onload=null; Q.onerror=null;Q.onabort=null;Q.ontimeout=null},cqR=function(Q){this.Z=Q; this.B=new Z8},iF5=function(Q){var z=V2(Q.Z,Q.VY,"/mail/images/cleardot.gif"); Rp(z);U0u(z.toString(),5E3,(0,g.lL)(Q.Zn,Q),3,2E3);Q.jE(1)},hMs=function(Q){var z=Q.Z.j; z!=null?(hy(5),z?(hy(11),dy(Q.Z,Q,!1)):(hy(12),dy(Q.Z,Q,!0))):(Q.Hl=new W$(Q),Q.Hl.C$=Q.QI,z=Q.Z,z=V2(z,z.GK()?Q.Af:null,Q.CC),hy(5),Q2(z,"TYPE","xmlhttp"),Jqu(Q.Hl,z,!1,Q.Af,!1))},W3u=function(Q,z,H){this.Z=1; this.B=[];this.L=[];this.S=new Z8;this.U=Q||null;this.j=z!=null?z:null;this.N=H||!1},D0J=function(Q,z){this.Z=Q; this.map=z;this.context=null},K35=function(Q,z,H,f){g.Px.call(this,"timingevent",Q); this.size=z;this.rtt=H;this.retries=f},Vsu=function(Q){g.Px.call(this,"serverreachability",Q)},m0m=function(Q){Q.Jm(1,0); Q.VV=V2(Q,null,Q.uq);d0Y(Q)},wwB=function(Q){Q.s4&&(Q.s4.abort(),Q.s4=null); Q.xV&&(Q.xV.cancel(),Q.xV=null);Q.sU&&(g.iL.clearTimeout(Q.sU),Q.sU=null);m2(Q);Q.b7&&(Q.b7.cancel(),Q.b7=null);Q.L8&&(g.iL.clearTimeout(Q.L8),Q.L8=null)},kd5=function(Q,z){if(Q.Z==0)throw Error("Invalid operation: sending map when state is closed"); Q.B.push(new D0J(Q.El++,z));Q.Z!=2&&Q.Z!=3||d0Y(Q)},TDL=function(Q){var z=0; Q.xV&&z++;Q.b7&&z++;return z},d0Y=function(Q){Q.b7||Q.L8||(Q.L8=c$((0,g.lL)(Q.yv,Q),0),Q.xw=0)},RMY=function(Q,z){if(Q.Z==1){if(!z){Q.jS=Math.floor(Math.random()*1E5); z=Q.jS++;var H=new W$(Q,"",z);H.C$=Q.ZA;var f=eMJ(Q),b=Q.VV.clone();g.Gn(b,"RID",z);g.Gn(b,"CVER","1");wy(Q,b);oQO(H,b,f);Q.b7=H;Q.Z=2}}else Q.Z==3&&(z?lQx(Q,z):Q.B.length==0||Q.b7||lQx(Q))},lQx=function(Q,z){if(z)if(Q.I$>6){Q.B=Q.L.concat(Q.B); Q.L.length=0;var H=Q.jS-1;z=eMJ(Q)}else H=z.Y,z=z.u9;else H=Q.jS++,z=eMJ(Q);var f=Q.VV.clone();g.Gn(f,"SID",Q.D);g.Gn(f,"RID",H);g.Gn(f,"AID",Q.zJ);wy(Q,f);H=new W$(Q,Q.D,H,Q.xw+1);H.C$=Q.ZA;H.setTimeout(1E4+Math.round(1E4*Math.random()));Q.b7=H;oQO(H,f,z)},wy=function(Q,z){Q.Eq&&(Q=Q.Eq.Sp())&&g.G2(Q,function(H,f){g.Gn(z,f,H)})},eMJ=function(Q){var z=Math.min(Q.B.length,1E3),H=["count="+z]; if(Q.I$>6&&z>0){var f=Q.B[0].Z;H.push("ofs="+f)}else f=0;for(var b={},L=0;L=3)return!1; Q.Y++;Q.sU=c$((0,g.lL)(Q.bb,Q),zrx(Q,Q.P1));Q.P1++;return!0},dy=function(Q,z,H){Q.kB=Q.j==null?H:!Q.j; Q.pP=z.YR;Q.N||m0m(Q)},m2=function(Q){Q.Nu!=null&&(g.iL.clearTimeout(Q.Nu),Q.Nu=null)},zrx=function(Q,z){var H=5E3+Math.floor(Math.random()*1E4); Q.isActive()||(H*=2);return H*z},kX=function(Q,z){if(z==2||z==9){var H=null; Q.Eq&&(H=null);var f=(0,g.lL)(Q.dPT,Q);H||(H=new g.M7("//www.google.com/images/cleardot.gif"),Rp(H));aQB(H.toString(),1E4,f)}else hy(2);fEB(Q,z)},fEB=function(Q,z){Q.Z=0; Q.Eq&&Q.Eq.G5(z);bfR(Q);wwB(Q)},bfR=function(Q){Q.Z=0; Q.pP=-1;if(Q.Eq)if(Q.L.length==0&&Q.B.length==0)Q.Eq.IC();else{var z=g.Qi(Q.L),H=g.Qi(Q.B);Q.L.length=0;Q.B.length=0;Q.Eq.IC(z,H)}},V2=function(Q,z,H){var f=g.$q(H); if(f.Z!="")z&&g.tk(f,z+"."+f.Z),g.Ea(f,f.L);else{var b=window.location;f=p5T(b.protocol,z?z+"."+b.hostname:b.hostname,+b.port,H)}Q.Kc&&g.G2(Q.Kc,function(L,u){g.Gn(f,u,L)}); g.Gn(f,"VER",Q.I$);wy(Q,f);return f},Lxs=function(){},u8Y=function(){this.Z=[]; this.B=[]},SeL=function(Q){g.Px.call(this,"channelMessage"); this.message=Q},XHT=function(Q){g.Px.call(this,"channelError"); this.error=Q},vwm=function(Q,z){this.action=Q; this.params=z||{}},TV=function(Q,z){g.h.call(this); this.Z=new g.e_(this.Sjm,0,this);g.W(this,this.Z);this.I6=5E3;this.B=0;if(typeof Q==="function")z&&(Q=(0,g.lL)(Q,z));else if(Q&&typeof Q.handleEvent==="function")Q=(0,g.lL)(Q.handleEvent,Q);else throw Error("Invalid listener argument");this.L=Q},y1x=function(Q,z,H,f,b,L,u,X,v){H=H===void 0?!1:H; f=f===void 0?function(){return""}:f; b=b===void 0?!1:b;L=L===void 0?!1:L;u=u===void 0?!1:u;X=X===void 0?!0:X;v=v===void 0?function(){return g.Zl({})}:v; this.mq=Q;this.Ze=z;this.S=new g.JD;this.B=new TV(this.d8h,this);this.Z=null;this.Y=!1;this.U=null;this.L3="";this.wh=this.N=0;this.L=[];this.WI=H;this.yl=f;this.j=L;this.jm=v;this.rT=u;this.f3=X;this.De=null;this.D=g.Zl();this.gh=b;this.C3=new ncs;this.En=new gcs;this.uT=new ZT5;this.iT=new G5x;this.ZJ=new $Um;this.yE=new jfT},M9Y=function(Q,z,H,f,b){qes(Q); if(Q.Z){var L=g.T5("ID_TOKEN"),u=Q.Z.ZA||{};L?u["x-youtube-identity-token"]=L:delete u["x-youtube-identity-token"];Q.Z.ZA=u}f?(f.getState()!=3&&TDL(f)==0||f.getState(),Q.Z.connect(z,H,Q.Ze,f.D,f.zJ)):b?Q.Z.connect(z,H,Q.Ze,b.sessionId,b.arrayId):Q.Z.connect(z,H,Q.Ze)},t9x=function(Q){var z,H; g.B(function(f){if(f.Z==1)return g.jY(f,2),Q.f3?g.Y(f,eI(Q),2):(eI(Q),f.bT(2));g.OA(f);z=Q.L;Q.L=[];H=z.length;C0R(Q,z,H);lJ(Q);return g.oJ(f,0)})},C0R=function(Q,z,H){for(var f=0;f0?H=Object.assign({},H,z):delete H.Authorization;Q.Z.ZA=H}}).IN(function(){}),function(){Q.De=null})},R1=function(Q){this.scheme="https"; this.port=this.domain="";this.Z="/api/lounge";this.B=!0;Q=Q||document.location.href;var z=Number(g.UE(4,Q))||"";z&&(this.port=":"+z);this.domain=g.c4(Q)||"";Q=g.Ns();Q.search("MSIE")>=0&&(Q=Q.match(/MSIE ([\d.]+)/)[1],g.Jt(Q,"10.0")<0&&(this.B=!1))},QS=function(Q,z){var H=Q.Z; Q.B&&(H=Q.scheme+"://"+Q.domain+Q.port+Q.Z);return g.Ve(H+z,{})},pHJ=function(Q,z){g.Qe.call(this); var H=this;this.Hc=Q();this.Hc.subscribe("handlerOpened",this.iC,this);this.Hc.subscribe("handlerClosed",this.onClosed,this);this.Hc.subscribe("handlerError",function(f,b){H.onError(b)}); this.Hc.subscribe("handlerMessage",this.onMessage,this);this.Z=z},nwJ=function(Q,z,H){var f=this; H=H===void 0?function(){return""}:H; var b=b===void 0?new ZFs:b;var L=L===void 0?new g.JD:L;this.pathPrefix=Q;this.Z=z;this.L3=H;this.S=L;this.N=null;this.U=this.Y=0;this.channel=null;this.j=0;this.L=new TV(function(){f.L.isActive();var u;((u=f.channel)==null?void 0:w2O((new j4u(u,u.Z)).Z.B))===0&&f.connect(f.N,f.Y)}); this.D={};this.B={};this.Ze=!1;this.logger=null;this.wh=[];this.Yu=void 0;this.jm=new ncs;this.De=new gcs;this.f3=new ZT5;this.yl=new G5x},gw5=function(Q){g.Km(Q.channel,"m",function(){Q.j=3; Q.L.reset();Q.N=null;Q.Y=0;for(var z=g.n(Q.wh),H=z.next();!H.done;H=z.next())H=H.value,Q.channel&&Q.channel.send(H);Q.wh=[];Q.publish("webChannelOpened");Q.jm.Z("WEB_CHANNEL")}); g.Km(Q.channel,"n",function(){Q.j=0;Q.L.isActive()||Q.publish("webChannelClosed");var z,H=(z=Q.channel)==null?void 0:F3Y(new j4u(z,z.Z));H&&(Q.wh=[].concat(g.F(H)));Q.De.Z("WEB_CHANNEL")}); g.Km(Q.channel,"p",function(z){var H=z.data;H[0]==="gracefulReconnect"?(Q.L.start(),Q.channel&&Q.channel.close()):Q.publish("webChannelMessage",new vwm(H[0],H[1]));Q.Yu=z.statusCode;Q.f3.Z("WEB_CHANNEL")}); g.Km(Q.channel,"o",function(){Q.Yu===401||Q.L.start();Q.publish("webChannelError");Q.yl.Z("WEB_CHANNEL")})},ZfT=function(Q){var z=Q.L3(); z?Q.D["x-youtube-lounge-xsrf-token"]=z:delete Q.D["x-youtube-lounge-xsrf-token"]},Ga5=function(Q){g.Qe.call(this); this.Z=Q();this.Z.subscribe("webChannelOpened",this.X3,this);this.Z.subscribe("webChannelClosed",this.onClosed,this);this.Z.subscribe("webChannelError",this.onError,this);this.Z.subscribe("webChannelMessage",this.onMessage,this)},$Vm=function(Q,z,H,f,b){function L(){return new y1x(QS(Q,"/bc"),z,!1,H,f)} H=H===void 0?function(){return""}:H; return g.jT("enable_mdx_web_channel_desktop")?new Ga5(function(){return new nwJ(QS(Q,"/wc"),z,H)}):new pHJ(L,b)},Ofs=function(){var Q=jEs; FxL();z$.push(Q);xVt()},H1=function(Q,z){FxL(); var H=ows(Q,String(z));z$.length==0?J1u(H):(xVt(),g.qI(z$,function(f){f(H)}))},fk=function(Q){H1("CP",Q)},FxL=function(){z$||(z$=g.D6("yt.mdx.remote.debug.handlers_")||[],g.W_("yt.mdx.remote.debug.handlers_",z$))},J1u=function(Q){var z=(bi+1)%50; bi=z;Lk[z]=Q;ui||(ui=z==49)},xVt=function(){var Q=z$; if(Lk[0]){var z=ui?bi:-1,H={};do H={FG:void 0},z=(z+1)%50,H.FG=Lk[z],g.qI(Q,function(f){return function(b){b(f.FG)}}(H)); while(z!=bi);Lk=Array(50);bi=-1;ui=!1}},ows=function(Q,z){var H=(Date.now()-NGT)/1E3; H.toFixed&&(H=H.toFixed(3));var f=[];f.push("[",H+"s","] ");f.push("[","yt.mdx.remote","] ");f.push(Q+": "+z,"\n");return f.join("")},SD=function(Q){g.Xp.call(this); this.j=Q;this.screens=[]},IEm=function(Q,z){var H=Q.get(z.uuid)||Q.get(z.id); if(H)return Q=H.name,H.id=z.id||H.id,H.name=z.name,H.token=z.token,H.uuid=z.uuid||H.uuid,H.name!=Q;Q.screens.push(z);return!0},A1L=function(Q,z){var H=Q.screens.length!=z.length; Q.screens=g.yP(Q.screens,function(L){return!!zzt(z,L)}); for(var f=z.length,b=0;b0&&Q.D0&&G$(Q,H)},function(z){Q.S=function(){}; Q.sf(z)})},udu=function(Q){var z={}; z.pairingCode=Q.De;z.theme=Q.mq;MTR()&&(z.env_useStageMdx=1);return g.Kg(z)},S5O=function(Q){return new Promise(function(z){Q.De=R$u(); if(Q.jm){var H=new chrome.cast.DialLaunchResponse(!0,udu(Q));z(H);LuL(Q)}else Q.Ze=function(){g.ZK(Q.U);Q.Ze=function(){}; Q.U=NaN;var f=new chrome.cast.DialLaunchResponse(!0,udu(Q));z(f);LuL(Q)},Q.U=g.n1(function(){Q.Ze()},100)})},vCB=function(Q,z,H){Q.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(z)); var f=new SI(z);return(new Promise(function(b){XUB(Q,f,function(L){L?(Q.wh=!0,Ck(Q.D,f),EG(Q,f),G$(Q,H)):g.Rf(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(z)+" is not online."));b(L)},5)})).then(function(b){return b?new chrome.cast.DialLaunchResponse(!1):S5O(Q)})},y$s=function(Q,z){var H=Q.N.receiver.label,f=Q.B.friendlyName; return(new Promise(function(b){DVs(Q.D,H,z,f,function(L){L&&L.token&&EG(Q,L);b(L)},function(L){pk(Q,"Failed to get DIAL screen: "+L); b(null)})})).then(function(b){return b&&b.token?new chrome.cast.DialLaunchResponse(!1):S5O(Q)})},XUB=function(Q,z,H,f){g.ZK(Q.j); Q.j=0;V9t(Q.D,z,function(b){b||f<0?H(b):Q.j=g.n1(function(){XUB(Q,z,H,f-1)},300)})},G$=function(Q,z){Q.info("getDialAppInfoWithTimeout_ "+z); Zj(Q)&&(g.ZK(Q.Y),Q.Y=0,z==0?q5L(Q):Q.Y=g.n1(function(){q5L(Q)},z))},q5L=function(Q){Zj(Q)&&Q.L.getDialAppInfo(function(z){Q.info("getDialAppInfo dialLaunchData: "+JSON.stringify(z)); z=z.extraData||{};var H=null;if(z.loungeToken){var f;((f=Q.Z)==null?void 0:f.token)==z.loungeToken&&(H="staleLoungeToken")}else H="missingLoungeToken";H?(Q.L3=H,G$(Q,3E4)):(Q.wh=!1,Q.L3="unknown",kat(Q,z.loungeToken),G$(Q,z.loungeTokenRefreshIntervalMs))},function(z){Q.info("getDialAppInfo error: "+z); Q.L3="noLoungeTokenResponse";G$(Q,3E4)})},Mis=function(Q){g.ZK(Q.j); Q.j=0;g.ZK(Q.Y);Q.Y=0;Q.S();Q.S=function(){}; g.ZK(Q.U)},$V=function(Q,z){tR.call(this,Q,z,"ManualSession"); this.L=g.n1((0,g.lL)(this.eK,this,null),150)},jD=function(Q,z){g.Xp.call(this); this.config_=z;this.B=Q;this.N=z.appId||"233637DE";this.D=z.theme||"cl";this.U=z.disableCastApi||!1;this.j=z.forceMirroring||!1;this.Z=null;this.Y=!1;this.L=[];this.S=(0,g.lL)(this.pch,this)},CSs=function(Q,z){return z?g.mB(Q.L,function(H){return Xb(z,H.label)},Q):null},Fs=function(Q){H1("Controller",Q)},jEs=function(Q){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(Q)},xV=function(Q){return Q.Y||!!Q.L.length||!!Q.Z},OG=function(Q,z,H){z!=Q.Z&&(g.S5(Q.Z),(Q.Z=z)?(H?Q.publish("yt-remote-cast2-receiver-resumed", z.B):Q.publish("yt-remote-cast2-receiver-selected",z.B),z.subscribe("sessionScreen",(0,g.lL)(Q.oI,Q,z)),z.subscribe("sessionFailed",function(){return tiB(Q,z)}),z.Z?Q.publish("yt-remote-cast2-session-change",z.Z):H&&Q.Z.eK(null)):Q.publish("yt-remote-cast2-session-change",null))},tiB=function(Q,z){Q.Z==z&&Q.publish("yt-remote-cast2-session-failed")},ECR=function(Q){var z=Q.B.fL(),H=Q.Z&&Q.Z.B; Q=g.J5(z,function(f){H&&Xb(f,H.label)&&(H=null);var b=f.uuid?f.uuid:f.id,L=CSs(this,f);L?(L.label=b,L.friendlyName=f.name):(L=new chrome.cast.Receiver(b,f.name),L.receiverType=chrome.cast.ReceiverType.CUSTOM);return L},Q); H&&(H.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(H=new chrome.cast.Receiver(H.label,H.friendlyName),H.receiverType=chrome.cast.ReceiverType.CUSTOM),Q.push(H));return Q},jWB=function(Q,z,H,f){f.disableCastApi?oz("Cannot initialize because disabled by Mdx config."):pUs()?nCT(z,f)&&(gCt(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?ZcJ(Q,H):(window.__onGCastApiAvailable=function(b,L){b?ZcJ(Q,H):(JR("Failed to load cast API: "+L),GKs(!1),gCt(!1),g.a4("yt-remote-cast-available"),g.a4("yt-remote-cast-receiver"), $Rt(),H(!1))},f.loadCastApiSetupScript?g.vb("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?tTT()>=60&&FWu():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?g7R():tTT()>=89?O1t():(jnJ(),nd(xns.map(Z1s))))):oz("Cannot initialize because not running Chrome")},$Rt=function(){oz("dispose"); var Q=Nh();Q&&Q.dispose();g.W_("yt.mdx.remote.cloudview.instance_",null);Fum(!1);g.Sv(xRB);xRB.length=0},Iz=function(){return!!g.Pw("yt-remote-cast-installed")},OcY=function(){var Q=g.Pw("yt-remote-cast-receiver"); return Q?Q.friendlyName:null},oCO=function(){oz("clearCurrentReceiver"); g.a4("yt-remote-cast-receiver")},J$5=function(){return Iz()?Nh()?Nh().getCastSession():(JR("getCastSelector: Cast is not initialized."),null):(JR("getCastSelector: Cast API is not installed!"),null)},N2B=function(){Iz()?Nh()?AR()?(oz("Requesting cast selector."),Nh().requestSession()):(oz("Wait for cast API to be ready to request the session."),xRB.push(g.u8("yt-remote-cast2-api-ready",N2B))):JR("requestCastSelector: Cast is not initialized."):JR("requestCastSelector: Cast API is not installed!")}, YV=function(Q,z){AR()?Nh().setConnectedScreenStatus(Q,z):JR("setConnectedScreenStatus called before ready.")},pUs=function(){var Q=g.Ns().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.AI||Q},IgL=function(Q,z){Nh().init(Q,z)},nCT=function(Q,z){var H=!1; Nh()||(Q=new jD(Q,z),Q.subscribe("yt-remote-cast2-availability-change",function(f){g.Bw("yt-remote-cast-available",f);Et("yt-remote-cast2-availability-change",f)}),Q.subscribe("yt-remote-cast2-receiver-selected",function(f){oz("onReceiverSelected: "+f.friendlyName); g.Bw("yt-remote-cast-receiver",f);Et("yt-remote-cast2-receiver-selected",f)}),Q.subscribe("yt-remote-cast2-receiver-resumed",function(f){oz("onReceiverResumed: "+f.friendlyName); g.Bw("yt-remote-cast-receiver",f);Et("yt-remote-cast2-receiver-resumed",f)}),Q.subscribe("yt-remote-cast2-session-change",function(f){oz("onSessionChange: "+v$(f)); f||g.a4("yt-remote-cast-receiver");Et("yt-remote-cast2-session-change",f)}),g.W_("yt.mdx.remote.cloudview.instance_",Q),H=!0); oz("cloudview.createSingleton_: "+H);return H},Nh=function(){return g.D6("yt.mdx.remote.cloudview.instance_")},ZcJ=function(Q,z){GKs(!0); gCt(!1);IgL(Q,function(H){H?(Fum(!0),g.XN("yt-remote-cast2-api-ready")):(JR("Failed to initialize cast API."),GKs(!1),g.a4("yt-remote-cast-available"),g.a4("yt-remote-cast-receiver"),$Rt());z(H)})},oz=function(Q){H1("cloudview",Q)},JR=function(Q){H1("cloudview",Q)},GKs=function(Q){oz("setCastInstalled_ "+Q); g.Bw("yt-remote-cast-installed",Q)},AR=function(){return!!g.D6("yt.mdx.remote.cloudview.apiReady_")},Fum=function(Q){oz("setApiReady_ "+Q); g.W_("yt.mdx.remote.cloudview.apiReady_",Q)},gCt=function(Q){g.W_("yt.mdx.remote.cloudview.initializing_",Q)},r_=function(Q){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.j=this.Y=0;this.trackData=null;this.Yr=this.bz=!1;this.N=this.S=this.Z=this.D=0;this.L=NaN;this.B=!1;this.reset(Q)},A$s=function(Q){Q.audioTrackId=null; Q.trackData=null;Q.playerState=-1;Q.bz=!1;Q.Yr=!1;Q.Y=0;Q.j=g.Qs();Q.D=0;Q.Z=0;Q.S=0;Q.N=0;Q.L=NaN;Q.B=!1},sG=function(Q){return Q.isPlaying()?(g.Qs()-Q.j)/1E3:0},B1=function(Q,z){Q.Y=z; Q.j=g.Qs()},P1=function(Q){switch(Q.playerState){case 1:case 1081:return(g.Qs()-Q.j)/1E3+Q.Y; case -1E3:return 0}return Q.Y},az=function(Q,z,H){var f=Q.videoId; Q.videoId=z;Q.index=H;z!=f&&A$s(Q)},Y5u=function(Q){var z={}; z.index=Q.index;z.listId=Q.listId;z.videoId=Q.videoId;z.playerState=Q.playerState;z.volume=Q.volume;z.muted=Q.muted;z.audioTrackId=Q.audioTrackId;z.trackData=g.P3(Q.trackData);z.hasPrevious=Q.bz;z.hasNext=Q.Yr;z.playerTime=Q.Y;z.playerTimeAt=Q.j;z.seekableStart=Q.D;z.seekableEnd=Q.Z;z.duration=Q.S;z.loadedTime=Q.N;z.liveIngestionTime=Q.L;return z},c1=function(Q,z){g.Xp.call(this); var H=this;this.L=0;this.D=Q;this.j=[];this.S=new u8Y;this.B=this.Z=null;this.U=(0,g.lL)(this.SVe,this);this.Y=(0,g.lL)(this.HJ,this);this.N=(0,g.lL)(this.lSh,this);this.Ze=(0,g.lL)(this.A7T,this);var f=0;Q?(f=Q.getProxyState(),f!=3&&(Q.subscribe("proxyStateChange",this.cg,this),r$R(this))):f=3;f!=0&&(z?this.cg(f):g.n1(function(){H.cg(f)},0)); (Q=J$5())&&UG(this,Q);this.subscribe("yt-remote-cast2-session-change",this.Ze)},ii=function(Q){return new r_(Q.D.getPlayerContextData())},r$R=function(Q){g.qI("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(z){this.j.push(this.D.subscribe(z,g.RJ(this.vsl,z),this))},Q)},sWY=function(Q){g.qI(Q.j,function(z){this.D.unsubscribeByKey(z)},Q); Q.j.length=0},hR=function(Q){return Q.getState()==1},W1=function(Q,z){var H=Q.S; H.Z.length+H.B.length<50&&Q.S.enqueue(z)},B2s=function(Q,z,H){var f=ii(Q); B1(f,H);f.playerState!=-1E3&&(f.playerState=z);Dj(Q,f)},Kk=function(Q,z,H){Q.D.sendMessage(z,H)},Dj=function(Q,z){sWY(Q); Q.D.setPlayerContextData(Y5u(z));r$R(Q)},UG=function(Q,z){Q.B&&(Q.B.removeUpdateListener(Q.U),Q.B.removeMediaListener(Q.Y),Q.HJ(null)); Q.B=z;Q.B&&(fk("Setting cast session: "+Q.B.sessionId),Q.B.addUpdateListener(Q.U),Q.B.addMediaListener(Q.Y),Q.B.media.length&&Q.HJ(Q.B.media[0]))},PSO=function(Q){var z=Q.Z.media,H=Q.Z.customData; if(z&&H){var f=ii(Q);z.contentId!=f.videoId&&fk("Cast changing video to: "+z.contentId);f.videoId=z.contentId;f.playerState=H.playerState;B1(f,Q.Z.getEstimatedTime());Dj(Q,f)}else fk("No cast media video. Ignoring state update.")},VS=function(Q,z,H){return(0,g.lL)(function(f){this.K2("Failed to "+z+" with cast v2 channel. Error code: "+f.code); f.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.K2("Retrying "+z+" using MDx browser channel."),Kk(this,z,H))},Q)},w_=function(Q,z,H,f){f=f===void 0?!1:f; g.Xp.call(this);var b=this;this.j=NaN;this.De=!1;this.U=this.N=this.wh=this.L3=NaN;this.Ze=[];this.S=this.Y=this.D=this.Z=this.B=null;this.jm=Q;this.f3=f;this.Ze.push(g.FX(window,"beforeunload",function(){b.RW(2)})); this.L=[];this.Z=new r_;this.mq=z.id;this.yl=z.idType;this.B=$Vm(this.jm,H,this.Ye,this.yl=="shortLived",this.mq);this.B.listen("channelOpened",function(){agO(b)}); this.B.listen("channelClosed",function(){d_("Channel closed");isNaN(b.j)?Cd(!0):Cd();b.dispose()}); this.B.listen("channelError",function(L){Cd();isNaN(b.hJ())?(L==1&&b.yl=="shortLived"&&b.publish("browserChannelAuthError",L),d_("Channel error: "+L+" without reconnection"),b.dispose()):(b.De=!0,d_("Channel error: "+L+" with reconnection in "+b.hJ()+" ms"),mO(b,2))}); this.B.listen("channelMessage",function(L){URu(b,L)}); this.B.Il(z.token);this.subscribe("remoteQueueChange",function(){var L=b.Z.videoId;g.UP()&&g.Bw("yt-remote-session-video-id",L)})},c$s=function(Q){return g.mB(Q.L,function(z){return z.type=="LOUNGE_SCREEN"})},d_=function(Q){H1("conn",Q)},mO=function(Q,z){Q.publish("proxyStateChange",z)},icJ=function(Q){Q.j=g.n1(function(){d_("Connecting timeout"); Q.RW(1)},2E4)},hwT=function(Q){g.ZK(Q.j); Q.j=NaN},Wuu=function(Q){g.ZK(Q.L3); Q.L3=NaN},Kus=function(Q){DRu(Q); Q.wh=g.n1(function(){kV(Q,"getNowPlaying")},2E4)},DRu=function(Q){g.ZK(Q.wh); Q.wh=NaN},agO=function(Q){d_("Channel opened"); Q.De&&(Q.De=!1,Wuu(Q),Q.L3=g.n1(function(){d_("Timing out waiting for a screen.");Q.RW(1)},15E3))},dRs=function(Q,z){var H=null; if(z){var f=c$s(Q);f&&(H={clientName:f.clientName,deviceMake:f.brand,deviceModel:f.model,osVersion:f.osVersion})}g.W_("yt.mdx.remote.remoteClient_",H);z&&(hwT(Q),Wuu(Q));H=Q.B.Bk()&&isNaN(Q.j);z==H?z&&(mO(Q,1),kV(Q,"getSubtitlesTrack")):z?(Q.Fi()&&Q.Z.reset(),mO(Q,1),kV(Q,"getNowPlaying"),ViY(Q)):Q.RW(1)},mRJ=function(Q,z){var H=z.params.videoId; delete z.params.videoId;H==Q.Z.videoId&&(g.Ys(z.params)?Q.Z.trackData=null:Q.Z.trackData=z.params,Q.publish("remotePlayerChange"))},wUm=function(Q,z,H){var f=z.params.videoId||z.params.video_id,b=parseInt(z.params.currentIndex,10); Q.Z.listId=z.params.listId||Q.Z.listId;az(Q.Z,f,b);Q.publish("remoteQueueChange",H)},T2J=function(Q,z){z.params=z.params||{}; wUm(Q,z,"NOW_PLAYING_MAY_CHANGE");kKR(Q,z);Q.publish("autoplayDismissed")},kKR=function(Q,z){var H=parseInt(z.params.currentTime||z.params.current_time,10); B1(Q.Z,isNaN(H)?0:H);H=parseInt(z.params.state,10);H=isNaN(H)?-1:H;H==-1&&Q.Z.playerState==-1E3&&(H=-1E3);Q.Z.playerState=H;H=Number(z.params.loadedTime);Q.Z.N=isNaN(H)?0:H;Q.Z.wx(Number(z.params.duration));H=Q.Z;var f=Number(z.params.liveIngestionTime);H.L=f;H.B=isNaN(f)?!1:!0;H=Q.Z;f=Number(z.params.seekableStartTime);z=Number(z.params.seekableEndTime);H.D=isNaN(f)?0:f;H.Z=isNaN(z)?0:z;Q.Z.playerState==1?Kus(Q):DRu(Q);Q.publish("remotePlayerChange")},ews=function(Q,z){if(Q.Z.playerState!=-1E3){var H= 1085; switch(parseInt(z.params.adState,10)){case 1:H=1081;break;case 2:H=1084;break;case 0:H=1083}Q.Z.playerState=H;z=parseInt(z.params.currentTime,10);B1(Q.Z,isNaN(z)?0:z);Q.publish("remotePlayerChange")}},lgY=function(Q,z){var H=z.params.muted=="true"; Q.Z.volume=parseInt(z.params.volume,10);Q.Z.muted=H;Q.publish("remotePlayerChange")},Rws=function(Q,z){Q.Y=z.params.videoId; Q.publish("nowAutoplaying",parseInt(z.params.timeout,10))},Qws=function(Q,z){Q.Y=z.params.videoId||null; Q.publish("autoplayUpNext",Q.Y)},zSO=function(Q,z){Q.S=z.params.autoplayMode; Q.publish("autoplayModeChange",Q.S);Q.S=="DISABLED"&&Q.publish("autoplayDismissed")},Ht5=function(Q,z){var H=z.params.hasNext=="true"; Q.Z.bz=z.params.hasPrevious=="true";Q.Z.Yr=H;Q.publish("previousNextChange")},URu=function(Q,z){z=z.message; z.params?d_("Received: action="+z.action+", params="+g.IR(z.params)):d_("Received: action="+z.action+" {}");switch(z.action){case "loungeStatus":z=zV(z.params.devices);Q.L=g.J5(z,function(f){return new uJ(f)}); z=!!g.mB(Q.L,function(f){return f.type=="LOUNGE_SCREEN"}); dRs(Q,z);z=Q.Z2("mlm");Q.publish("multiStateLoopEnabled",z);break;case "loungeScreenDisconnected":g.lR(Q.L,function(f){return f.type=="LOUNGE_SCREEN"}); dRs(Q,!1);break;case "remoteConnected":var H=new uJ(zV(z.params.device));g.mB(Q.L,function(f){return f.jH(H)})||vcB(Q.L,H); break;case "remoteDisconnected":H=new uJ(zV(z.params.device));g.lR(Q.L,function(f){return f.jH(H)}); break;case "gracefulDisconnect":break;case "playlistModified":wUm(Q,z,"QUEUE_MODIFIED");break;case "nowPlaying":T2J(Q,z);break;case "onStateChange":kKR(Q,z);break;case "onAdStateChange":ews(Q,z);break;case "onVolumeChanged":lgY(Q,z);break;case "onSubtitlesTrackChanged":mRJ(Q,z);break;case "nowAutoplaying":Rws(Q,z);break;case "autoplayDismissed":Q.publish("autoplayDismissed");break;case "autoplayUpNext":Qws(Q,z);break;case "onAutoplayModeChanged":zSO(Q,z);break;case "onHasPreviousNextChanged":Ht5(Q, z);break;case "requestAssistedSignIn":Q.publish("assistedSignInRequested",z.params.authCode);break;case "onLoopModeChanged":Q.publish("loopModeChange",z.params.loopMode);break;default:d_("Unrecognized action: "+z.action)}},ViY=function(Q){g.ZK(Q.U); Q.U=g.n1(function(){Q.RW(1)},864E5)},kV=function(Q,z,H){H?d_("Sending: action="+z+", params="+g.IR(H)):d_("Sending: action="+z); Q.B.sendMessage(z,H)},f7R=function(Q){SD.call(this,"ScreenServiceProxy"); this.bW=Q;this.Z=[];this.Z.push(this.bW.$_s("screenChange",(0,g.lL)(this.Wv,this)));this.Z.push(this.bW.$_s("onlineScreenChange",(0,g.lL)(this.MA5,this)))},Xbx=function(Q,z){qMm(); if(!ty||!ty.get("yt-remote-disable-remote-module-for-dev")){z=g.T5("MDX_CONFIG")||z;H1u();uZY();T$||(T$=new R1(z?z.loungeApiHost:void 0),MTR()&&(T$.Z="/api/loungedev"));eD||(eD=g.D6("yt.mdx.remote.deferredProxies_")||[],g.W_("yt.mdx.remote.deferredProxies_",eD));btB();var H=li();if(!H){var f=new Mh(T$,z?z.disableAutomaticScreenCache||!1:!1);g.W_("yt.mdx.remote.screenService_",f);H=li();var b={};z&&(b={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.W_("yt.mdx.remote.enableConnectWithInitialState_",z?z.enableConnectWithInitialState||!1:!1);jWB(Q,f,function(L){L?Rz()&&YV(Rz(),"YouTube TV"):f.subscribe("onlineScreenChange",function(){Et("yt-remote-receiver-availability-change")})},b)}z&&!g.D6("yt.mdx.remote.initialized_")&&(g.W_("yt.mdx.remote.initialized_",!0),Q6("Initializing: "+g.IR(z)), zP.push(g.u8("yt-remote-cast2-api-ready",function(){Et("yt-remote-api-ready")})),zP.push(g.u8("yt-remote-cast2-availability-change",function(){Et("yt-remote-receiver-availability-change")})),zP.push(g.u8("yt-remote-cast2-receiver-selected",function(){Hd(null); Et("yt-remote-auto-connect","cast-selector-receiver")})),zP.push(g.u8("yt-remote-cast2-receiver-resumed",function(){Et("yt-remote-receiver-resumed","cast-selector-receiver")})),zP.push(g.u8("yt-remote-cast2-session-change",LCT)),zP.push(g.u8("yt-remote-connection-change",function(L){L?YV(Rz(),"YouTube TV"):fb()||(YV(null,null),oCO())})),zP.push(g.u8("yt-remote-cast2-session-failed",function(){Et("yt-remote-connection-failed")})),Q=uNY(),z.isAuto&&(Q.id+="#dial"),b=z.capabilities||[],g.jT("desktop_enable_autoplay")&& b.push("atp"),b.length>0&&(Q.capabilities=b),Q.name=z.device,Q.app=z.app,(z=z.theme)&&(Q.theme=z),Q6(" -- with channel params: "+g.IR(Q)),Q?(g.Bw("yt-remote-session-app",Q.app),g.Bw("yt-remote-session-name",Q.name)):(g.a4("yt-remote-session-app"),g.a4("yt-remote-session-name")),g.W_("yt.mdx.remote.channelParams_",Q),H.start(),Rz()||SbL())}},vkT=function(){var Q=li().bW.$_gos(); var z=bP();z&&Lb()&&(zzt(Q,z)||Q.push(z));return Qnx(Q)},qbu=function(){var Q=yLL(); !Q&&Iz()&&OcY()&&(Q={key:"cast-selector-receiver",name:OcY()});return Q},yLL=function(){var Q=vkT(),z=bP(); z||(z=fb());return g.mB(Q,function(H){return z&&Xb(z,H.key)?!0:!1})},bP=function(){var Q=Rz(); if(!Q)return null;var z=li().VF();return y2(z,Q)},LCT=function(Q){Q6("remote.onCastSessionChange_: "+v$(Q)); if(Q){var z=bP();if(z&&z.id==Q.id){if(YV(z.id,"YouTube TV"),Q.idType=="shortLived"&&(Q=Q.token))uP&&(uP.token=Q),(z=Lb())&&z.Il(Q)}else z&&Sq(),XH(Q,1)}else Lb()&&Sq()},Sq=function(){AR()?Nh().stopSession():JR("stopSession called before API ready."); var Q=Lb();Q&&(Q.disconnect(1),MvB(null))},C8Y=function(){var Q=Lb(); return!!Q&&Q.getProxyState()!=3},Q6=function(Q){H1("remote",Q)},li=function(){if(!tvt){var Q=g.D6("yt.mdx.remote.screenService_"); tvt=Q?new f7R(Q):null}return tvt},Rz=function(){return g.D6("yt.mdx.remote.currentScreenId_")},Eks=function(Q){g.W_("yt.mdx.remote.currentScreenId_",Q)},pbm=function(){return g.D6("yt.mdx.remote.connectData_")},Hd=function(Q){g.W_("yt.mdx.remote.connectData_",Q)},Lb=function(){return g.D6("yt.mdx.remote.connection_")},MvB=function(Q){var z=Lb(); Hd(null);Q||Eks("");g.W_("yt.mdx.remote.connection_",Q);eD&&(g.qI(eD,function(H){H(Q)}),eD.length=0); z&&!Q?Et("yt-remote-connection-change",!1):!z&&Q&&Et("yt-remote-connection-change",!0)},fb=function(){var Q=g.UP(); if(!Q)return null;var z=li();if(!z)return null;z=z.VF();return y2(z,Q)},XH=function(Q,z){Rz(); bP()&&bP();if(vd)uP=Q;else{Eks(Q.id);var H=g.D6("yt.mdx.remote.enableConnectWithInitialState_")||!1;Q=new w_(T$,Q,uNY(),H);Q.connect(z,pbm());Q.subscribe("beforeDisconnect",function(f){Et("yt-remote-before-disconnect",f)}); Q.subscribe("beforeDispose",function(){Lb()&&(Lb(),MvB(null))}); Q.subscribe("browserChannelAuthError",function(){var f=bP();f&&f.idType=="shortLived"&&(AR()?Nh().handleBrowserChannelAuthError():JR("refreshLoungeToken called before API ready."))}); MvB(Q)}},SbL=function(){var Q=fb(); Q?(Q6("Resume connection to: "+v$(Q)),XH(Q,0)):(Cd(),oCO(),Q6("Skipping connecting because no session screen found."))},btB=function(){var Q=uNY(); if(g.Ys(Q)){Q=ME();var z=g.Pw("yt-remote-session-name")||"",H=g.Pw("yt-remote-session-app")||"";Q={device:"REMOTE_CONTROL",id:Q,name:z,app:H,mdxVersion:3};Q.authuser=String(g.T5("SESSION_INDEX","0"));(z=g.T5("DELEGATED_SESSION_ID"))&&(Q.pageId=String(z));g.W_("yt.mdx.remote.channelParams_",Q)}},uNY=function(){return g.D6("yt.mdx.remote.channelParams_")||{}},Ztu=function(Q,z,H){g.h.call(this); var f=this;this.module=Q;this.K=z;this.Mi=H;this.events=new g.Bt(this);this.D=!1;this.S=new g.zE(64);this.Z=new g.e_(this.IF,500,this);this.B=new g.e_(this.N_,1E3,this);this.Y=new gy(this.qqI,0,this);this.L={};this.N=new g.e_(this.dl,1E3,this);this.j=new g.ze(this.seekTo,1E3,this);this.U=this.events.X(this.K,"onVolumeChange",function(b){nkJ(f,b)}); g.W(this,this.events);this.events.X(z,"onCaptionsTrackListChanged",this.rMe);this.events.X(z,"captionschanged",this.Kdv);this.events.X(z,"captionssettingschanged",this.Hb);this.events.X(z,"videoplayerreset",this.yC);this.events.X(z,"mdxautoplaycancel",function(){f.Mi.HT()}); z.V("enable_mdx_video_play_directly")&&this.events.X(z,"videodatachange",function(){gkm(f.module)||y6(f)||qy(f,0)}); Q=this.Mi;Q.Sm();Q.subscribe("proxyStateChange",this.Th,this);Q.subscribe("remotePlayerChange",this.a8,this);Q.subscribe("remoteQueueChange",this.yC,this);Q.subscribe("previousNextChange",this.NQ,this);Q.subscribe("nowAutoplaying",this.C1,this);Q.subscribe("autoplayDismissed",this.Sh,this);g.W(this,this.Z);g.W(this,this.B);g.W(this,this.Y);g.W(this,this.N);g.W(this,this.j);this.Hb();this.yC();this.a8()},nkJ=function(Q,z){if(y6(Q)){Q.Mi.unsubscribe("remotePlayerChange",Q.a8,Q); var H=Math.round(z.volume);z=!!z.muted;var f=ii(Q.Mi);if(H!==f.volume||z!==f.muted)Q.Mi.setVolume(H,z),Q.N.start();Q.Mi.subscribe("remotePlayerChange",Q.a8,Q)}},Gw5=function(Q){Q.A7(0); Q.Z.stop();Q.zq(new g.zE(64))},$As=function(Q,z){if(y6(Q)&&!Q.D){var H=null; z&&(H={style:Q.K.getSubtitlesUserSettings()},Object.assign(H,z));Q.Mi.nL(Q.K.getVideoData(1).videoId,H);Q.L=ii(Q.Mi).trackData}},qy=function(Q,z){var H=Q.K.getPlaylist(); if(H==null?0:H.listId){var f=H.index;var b=H.listId.toString()}H=Q.K.getVideoData(1);Q.Mi.playVideo(H.videoId,z,f,b,H.playerParams,H.yl,X5x(H));Q.zq(new g.zE(1))},jws=function(Q,z){if(z){var H=Q.K.getOption("captions","tracklist",{Q$:1}); H&&H.length?(Q.K.setOption("captions","track",z),Q.D=!1):(Q.K.loadModule("captions"),Q.D=!0)}else Q.K.setOption("captions","track",{})},y6=function(Q){return ii(Q.Mi).videoId===Q.K.getVideoData(1).videoId},FCs=function(Q){this.Z=Q},My=function(){g.m.call(this,{G:"div", J:"ytp-mdx-popup-dialog",T:{role:"dialog"},W:[{G:"div",J:"ytp-mdx-popup-dialog-inner-content",W:[{G:"div",J:"ytp-mdx-popup-title",BI:"You're signed out"},{G:"div",J:"ytp-mdx-popup-description",BI:"Videos that 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."},{G:"div",J:"ytp-mdx-privacy-popup-buttons",W:[{G:"button",lT:["ytp-button","ytp-mdx-privacy-popup-cancel"],BI:"Cancel"},{G:"button",lT:["ytp-button", "ytp-mdx-privacy-popup-confirm"],BI:"Confirm"}]}]}]});this.Z=new g.H6(this,250);this.cancelButton=this.Mc("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.Mc("ytp-mdx-privacy-popup-confirm");g.W(this,this.Z);this.X(this.cancelButton,"click",this.B);this.X(this.confirmButton,"click",this.L)},Cb=function(Q){g.m.call(this,{G:"div", J:"ytp-remote",W:[{G:"div",J:"ytp-remote-display-status",W:[{G:"div",J:"ytp-remote-display-status-icon",W:[g.$Vp()]},{G:"div",J:"ytp-remote-display-status-text",BI:"{{statustext}}"}]}]});this.api=Q;this.Z=new g.H6(this,250);g.W(this,this.Z);this.X(Q,"presentingplayerstatechange",this.onStateChange);this.Ni(Q.getPlayerStateObject())},tW=function(Q,z){g.hz.call(this,"Play on",1,Q,z); this.K=Q;this.TI={};this.X(Q,"onMdxReceiversChange",this.D);this.X(Q,"presentingplayerstatechange",this.D);this.D()},xAt=function(Q){g.g3.call(this,Q); this.Jp={key:R$u(),name:"This computer"};this.zi=null;this.subscriptions=[];this.Xy=this.Mi=null;this.TI=[this.Jp];this.Jv=this.Jp;this.oy=new g.zE(64);this.GG=0;this.xn=-1;this.vJ=!1;this.kQ=this.s_=this.WE=null;if(!g.Yh(this.player.C())&&!g.Ux(this.player.C())){Q=this.player;var z=g.EZ(Q);z&&(z=z.S0())&&(z=new tW(Q,z),g.W(this,z));z=new Cb(Q);g.W(this,z);g.sZ(Q,z.element,4);this.WE=new My;g.W(this,this.WE);g.sZ(Q,this.WE.element,4);this.vJ=!!fb()}},E_=function(Q){Q.s_&&(Q.player.removeEventListener("presentingplayerstatechange", Q.s_),Q.s_=null)},Ots=function(Q,z,H){Q.oy=H; Q.player.publish("presentingplayerstatechange",new g.Cp(H,z))},pb=function(Q,z){if(z.key!==Q.Jv.key)if(z.key===Q.Jp.key)Sq(); else if(gkm(Q)&&okO(Q),Q.Jv=z,!Q.player.C().V("disable_mdx_connection_in_mdx_module_for_music_web")||!g.Ux(Q.player.C())){var H=Q.player.getPlaylistId();var f=Q.player.getVideoData(1);var b=f.videoId;if(!H&&!b||(Q.player.getAppState()===2||Q.player.getAppState()===1)&&Q.player.C().V("should_clear_video_data_on_player_cued_unstarted"))f=null;else{var L=Q.player.getPlaylist();if(L){var u=[];for(var X=0;X2*this.size&&Ld(this),!0):!1}; g.S.get=function(Q,z){return fd(this.B,Q)?this.B[Q]:z}; g.S.set=function(Q,z){fd(this.B,Q)||(this.size+=1,this.Z.push(Q),this.n$++);this.B[Q]=z}; g.S.forEach=function(Q,z){for(var H=this.Im(),f=0;f=f.Z.length)return g.XQ;var L=f.Z[z++];return g.u2(Q?L:f.B[L])}; return b}; var mUT={Sfl:"atp",Wch:"ska",br5:"que",nMn:"mus",t8$:"sus",ZtI:"dsp",vcq:"seq",Gi5:"mic",y93:"dpa",Yfh:"cds",V0m:"mlm",DGq:"dsdtr",pGe:"ntb",J_v:"vsp",Yu$:"scn",Gje:"rpe",aCl:"dcn",klv:"dcp",gMT:"pas",M6m:"drq",CZ$:"opf",c95:"els",nFq:"isg",X5$:"svq",mK5:"mvp",Yql:"ads",jxq:"iat"},w5B={s43:"u",Cc$:"cl",Tzh:"k",l5m:"i",O4j:"cr",c8q:"m",Nt5:"g",f7:"up"};uJ.prototype.jH=function(Q){return Q?this.id==Q.id:!1}; var LWO="",ty=null;CvR.prototype.flush=function(Q,z){Q=Q===void 0?[]:Q;z=z===void 0?!1:z;if(g.jT("enable_client_streamz_web")){Q=g.n(Q);for(var H=Q.next();!H.done;H=Q.next())H=g.q7u(H.value),H={serializedIncrementBatch:g.nr(H.Z())},g.y5("streamzIncremented",H,{sendIsolatedPayload:z})}}; var pd,$nY=E7u("loadCastFramework")||E7u("loadCastApplicationFramework"),xns=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.zY(gy,g.h);g.S=gy.prototype;g.S.lC=function(Q){this.D=arguments;this.Z=!1;this.C5?this.L=g.Qs()+this.I6:this.C5=g.OE(this.S,this.I6)}; g.S.stop=function(){this.C5&&(g.iL.clearTimeout(this.C5),this.C5=null);this.L=null;this.Z=!1;this.D=[]}; g.S.pause=function(){++this.B}; g.S.resume=function(){this.B&&(--this.B,!this.B&&this.Z&&(this.Z=!1,this.j.apply(null,this.D)))}; g.S.zv=function(){this.stop();gy.xu.zv.call(this)}; g.S.Sw=function(){this.C5&&(g.iL.clearTimeout(this.C5),this.C5=null);this.L?(this.C5=g.OE(this.S,this.L-g.Qs()),this.L=null):this.B?this.Z=!0:(this.Z=!1,this.j.apply(null,this.D))};Z8.prototype.stringify=function(Q){return g.iL.JSON.stringify(Q,void 0)}; Z8.prototype.parse=function(Q){return g.iL.JSON.parse(Q,void 0)};g.zY(o7x,g.Px);g.zY(JFu,g.Px);var NRL=null;g.zY(AFu,g.Px);g.zY(YMR,g.Px);g.zY(rFs,g.Px);Fb.prototype.debug=function(){}; Fb.prototype.info=function(){}; Fb.prototype.warning=function(){};var hzs={},i1t={};g.S=xX.prototype;g.S.setTimeout=function(Q){this.WI=Q}; g.S.Am=function(Q){Q=Q.target;var z=this.iT;z&&g.ld(Q)==3?z.YL():this.Z8(Q)}; g.S.Z8=function(Q){try{if(Q==this.Z)a:{var z=g.ld(this.Z),H=this.Z.B,f=this.Z.getStatus();if(!(z<3)&&(z!=3||this.Z&&(this.B.B||g.Q$(this.Z)||g.zA(this.Z)))){this.f3||z!=4||H==7||(H==8||f<=0?GV(3):GV(2));KW5(this);var b=this.Z.getStatus();this.ZJ=b;var L=cFu(this);if(this.j=b==200){if(this.yE&&!this.En){b:{if(this.Z){var u=g.Hn(this.Z,"X-HTTP-Initial-Response");if(u&&!g.j5(u)){var X=u;break b}}X=null}if(Q=X)this.En=!0,RzT(this,Q);else{this.j=!1;this.S=3;$X(12);o1(this);Jy(this);break a}}if(this.yl){Q= !0;for(var v;!this.f3&&this.Y0&&!this.KH&&(this.KH=!0,this.L.dG(this)):(o1(this),Jy(this))}else RzT(this,L);z==4&&o1(this);this.j&&!this.f3&&(z==4?VTu(this.L,this):(this.j=!1,Ot(this)))}else g.sIp(this.Z),b==400&&L.indexOf("Unknown SID")> 0?(this.S=3,$X(12)):(this.S=0,$X(13)),o1(this),Jy(this)}}}catch(y){}finally{}}; g.S.cancel=function(){this.f3=!0;o1(this)}; g.S.fm=function(){this.Ze=null;var Q=Date.now();Q-this.rT>=0?(this.mq!=2&&(GV(3),$X(17)),o1(this),this.S=2,Jy(this)):Dnm(this,this.rT-Q)}; g.S.getLastError=function(){return this.S}; g.S.rH=function(){return this.Z};zMO.prototype.cancel=function(){this.L=fQx(this);if(this.B)this.B.cancel(),this.B=null;else if(this.Z&&this.Z.size!==0){for(var Q=g.n(this.Z.values()),z=Q.next();!z.done;z=Q.next())z.value.cancel();this.Z.clear()}};g.S=Xw5.prototype;g.S.w3=8;g.S.FR=1;g.S.connect=function(Q,z,H,f){$X(0);this.EY=Q;this.f3=z||{};H&&f!==void 0&&(this.f3.OSID=H,this.f3.OAID=f);this.En=this.Wz;this.jm=TRs(this,null,this.EY);YX(this)}; g.S.disconnect=function(){yqL(this);if(this.FR==3){var Q=this.uT++,z=this.jm.clone();g.Gn(z,"SID",this.D);g.Gn(z,"RID",Q);g.Gn(z,"TYPE","terminate");P$(this,z);Q=new xX(this,this.D,Q);Q.mq=2;Q.N=Rp(z.clone());z=!1;if(g.iL.navigator&&g.iL.navigator.sendBeacon)try{z=g.iL.navigator.sendBeacon(Q.N.toString(),"")}catch(H){}!z&&g.iL.Image&&((new Image).src=Q.N,z=!0);z||(Q.Z=aK5(Q.L,null),Q.Z.send(Q.N));Q.L3=Date.now();Ot(Q)}pwu(this)}; g.S.eU=function(){return this.FR==0}; g.S.getState=function(){return this.FR}; g.S.xe=function(Q){if(this.j)if(this.j=null,this.FR==1){if(!Q){this.uT=Math.floor(Math.random()*1E5);Q=this.uT++;var z=new xX(this,"",Q),H=this.U;this.ZJ&&(H?(H=g.B3(H),g.aI(H,this.ZJ)):H=this.ZJ);this.Y!==null||this.rT||(z.jm=H,H=null);var f;if(this.gh)a:{for(var b=f=0;b4096){f=b;break a}if(f===4096||b===this.L.length-1){f=b+1;break a}}f= 1E3}else f=1E3;f=ChL(this,z,f);b=this.jm.clone();g.Gn(b,"RID",Q);g.Gn(b,"CVER",22);this.yl&&g.Gn(b,"X-HTTP-Session-Id",this.yl);P$(this,b);H&&(this.rT?f="headers="+g.TU(g.wx_(H))+"&"+f:this.Y&&g.xq(b,this.Y,H));kru(this.B,z);this.h$&&g.Gn(b,"TYPE","init");this.gh?(g.Gn(b,"$req",f),g.Gn(b,"SID","null"),z.yE=!0,Pvm(z,b,null)):Pvm(z,b,f);this.FR=2}}else this.FR==3&&(Q?tsm(this,Q):this.L.length==0||HFu(this.B)||tsm(this))}; g.S.Ph=function(){this.N=null;EQm(this);if(this.UY&&!(this.WI||this.Z==null||this.ys<=0)){var Q=2*this.ys;this.De=jI((0,g.lL)(this.Gq5,this),Q)}}; g.S.Gq5=function(){this.De&&(this.De=null,this.En=!1,this.WI=!0,$X(10),I1(this),EQm(this))}; g.S.dG=function(Q){this.Z==Q&&this.UY&&!this.WI&&(vQu(this),this.WI=!0,$X(11))}; g.S.VG=function(){this.Ze!=null&&(this.Ze=null,I1(this),mnx(this),$X(19))}; g.S.uRh=function(Q){Q?$X(2):$X(1)}; g.S.isActive=function(){return!!this.S&&this.S.isActive(this)}; g.S=gQT.prototype;g.S.LL=function(){}; g.S.qh=function(){}; g.S.Bh=function(){}; g.S.z5=function(){}; g.S.isActive=function(){return!0}; g.S.m9=function(){};g.zY(Ut,g.Qe);Ut.prototype.open=function(){this.Z.S=this.L;this.j&&(this.Z.mq=!0);this.Z.connect(this.S,this.B||void 0)}; Ut.prototype.close=function(){this.Z.disconnect()}; Ut.prototype.send=function(Q){var z=this.Z;if(typeof Q==="string"){var H={};H.__data__=Q;Q=H}else this.D&&(H={},H.__data__=g.IR(Q),Q=H);z.L.push(new Q4J(z.YJ++,Q));z.FR==3&&YX(z)}; Ut.prototype.zv=function(){this.Z.S=null;delete this.L;this.Z.disconnect();delete this.Z;Ut.xu.zv.call(this)}; g.zY(Gdu,o7x);g.zY($0Y,JFu);g.zY(a1,gQT);a1.prototype.LL=function(){this.Z.dispatchEvent("m")}; a1.prototype.qh=function(Q){this.Z.dispatchEvent(new Gdu(Q))}; a1.prototype.Bh=function(Q){this.Z.dispatchEvent(new $0Y(Q))}; a1.prototype.z5=function(){this.Z.dispatchEvent("n")};var iJ=new g.Qe;g.p(x0u,g.Px);g.S=W$.prototype;g.S.C$=null;g.S.qe=!1;g.S.wU=null;g.S.iq=null;g.S.yJ=null;g.S.lK=null;g.S.Mr=null;g.S.jP=null;g.S.u9=null;g.S.Of=null;g.S.fY=0;g.S.GH=null;g.S.SP=null;g.S.dA=null;g.S.bN=-1;g.S.Gg=!0;g.S.DH=!1;g.S.pC=0;g.S.KY=null;var AqL={},IQL={};g.S=W$.prototype;g.S.setTimeout=function(Q){this.B=Q}; g.S.YH=function(Q){Q=Q.target;var z=this.KY;z&&g.ld(Q)==3?z.YL():this.ao(Q)}; g.S.ao=function(Q){try{if(Q==this.Of)a:{var z=g.ld(this.Of),H=this.Of.B,f=this.Of.getStatus();if(g.lQ&&!g.pr("420+")){if(z<4)break a}else if(z<3||z==3&&!g.Q$(this.Of))break a;this.DH||z!=4||H==7||(H==8||f<=0?this.Z.jE(3):this.Z.jE(2));s4s(this);var b=this.Of.getStatus();this.bN=b;var L=g.Q$(this.Of);if(this.qe=b==200){z==4&&D8(this);if(this.yl){for(Q=!0;!this.DH&&this.fY0?(this.dA=3,hy(13)):(this.dA=0,hy(14)),D8(this),BDs(this)}}catch(X){}finally{}}; g.S.cancel=function(){this.DH=!0;D8(this)}; g.S.nm=function(){this.wU=null;var Q=Date.now();Q-this.iq>=0?(this.lK!=2&&this.Z.jE(3),D8(this),this.dA=2,hy(18),BDs(this)):rqu(this,this.iq-Q)}; g.S.getLastError=function(){return this.dA};g.S=cqR.prototype;g.S.QI=null;g.S.Hl=null;g.S.Wm=!1;g.S.CC=null;g.S.O7=null;g.S.YR=-1;g.S.Af=null;g.S.VY=null;g.S.connect=function(Q){this.CC=Q;Q=V2(this.Z,null,this.CC);hy(3);Date.now();var z=this.Z.U;z!=null?(this.Af=z[0],(this.VY=z[1])?(this.O7=1,iF5(this)):(this.O7=2,hMs(this))):(Q2(Q,"MODE","init"),this.Hl=new W$(this),this.Hl.C$=this.QI,Jqu(this.Hl,Q,!1,null,!0),this.O7=0)}; g.S.Zn=function(Q){if(Q)this.O7=2,hMs(this);else{hy(4);var z=this.Z;z.pP=z.s4.YR;kX(z,9)}Q&&this.jE(2)}; g.S.Xb=function(Q){return this.Z.Xb(Q)}; g.S.abort=function(){this.Hl&&(this.Hl.cancel(),this.Hl=null);this.YR=-1}; g.S.eU=function(){return!1}; g.S.ke=function(Q,z){this.YR=Q.bN;if(this.O7==0)if(z){try{var H=this.B.parse(z)}catch(f){Q=this.Z;Q.pP=this.YR;kX(Q,2);return}this.Af=H[0];this.VY=H[1]}else Q=this.Z,Q.pP=this.YR,kX(Q,2);else this.O7==2&&(this.Wm?(hy(7),Date.now()):z=="11111"?(hy(6),this.Wm=!0,Date.now(),this.YR=200,this.Hl.cancel(),hy(12),dy(this.Z,this,!0)):(hy(8),Date.now(),this.Wm=!1))}; g.S.hC=function(){this.YR=this.Hl.bN;if(this.Hl.qe)this.O7==0?this.VY?(this.O7=1,iF5(this)):(this.O7=2,hMs(this)):this.O7==2&&(this.Wm?(hy(12),dy(this.Z,this,!0)):(hy(11),dy(this.Z,this,!1)));else{this.O7==0?hy(9):this.O7==2&&hy(10);var Q=this.Z;this.Hl.getLastError();Q.pP=this.YR;kX(Q,2)}}; g.S.GK=function(){return this.Z.GK()}; g.S.isActive=function(){return this.Z.isActive()}; g.S.jE=function(Q){this.Z.jE(Q)};g.S=W3u.prototype;g.S.ZA=null;g.S.Kc=null;g.S.b7=null;g.S.xV=null;g.S.uq=null;g.S.VV=null;g.S.Mh=null;g.S.d1=null;g.S.jS=0;g.S.El=0;g.S.Eq=null;g.S.L8=null;g.S.sU=null;g.S.Nu=null;g.S.s4=null;g.S.kB=null;g.S.zJ=-1;g.S.D8=-1;g.S.pP=-1;g.S.xw=0;g.S.P1=0;g.S.I$=8;g.zY(K35,g.Px);g.zY(Vsu,g.Px);g.S=W3u.prototype;g.S.connect=function(Q,z,H,f,b){hy(0);this.uq=z;this.Kc=H||{};f&&b!==void 0&&(this.Kc.OSID=f,this.Kc.OAID=b);this.N?(c$((0,g.lL)(this.QK,this,Q),100),m0m(this)):this.QK(Q)}; g.S.disconnect=function(){wwB(this);if(this.Z==3){var Q=this.jS++,z=this.VV.clone();g.Gn(z,"SID",this.D);g.Gn(z,"RID",Q);g.Gn(z,"TYPE","terminate");wy(this,z);Q=new W$(this,this.D,Q);Q.lK=2;Q.Mr=Rp(z.clone());(new Image).src=Q.Mr.toString();Q.yJ=Date.now();NDB(Q)}bfR(this)}; g.S.QK=function(Q){this.s4=new cqR(this);this.s4.QI=this.ZA;this.s4.B=this.S;this.s4.connect(Q)}; g.S.eU=function(){return this.Z==0}; g.S.getState=function(){return this.Z}; g.S.yv=function(Q){this.L8=null;RMY(this,Q)}; g.S.bb=function(){this.sU=null;this.xV=new W$(this,this.D,"rpc",this.Y);this.xV.C$=this.ZA;this.xV.pC=0;var Q=this.Mh.clone();g.Gn(Q,"RID","rpc");g.Gn(Q,"SID",this.D);g.Gn(Q,"CI",this.kB?"0":"1");g.Gn(Q,"AID",this.zJ);wy(this,Q);g.Gn(Q,"TYPE","xmlhttp");Jqu(this.xV,Q,!0,this.d1,!1)}; g.S.ke=function(Q,z){if(this.Z!=0&&(this.xV==Q||this.b7==Q))if(this.pP=Q.bN,this.b7==Q&&this.Z==3)if(this.I$>7){try{var H=this.S.parse(z)}catch(f){H=null}if(Array.isArray(H)&&H.length==3)if(Q=H,Q[0]==0)a:{if(!this.sU){if(this.xV)if(this.xV.yJ+3E30)){if(f=z==1)this.b7||this.L8||this.Z==1||this.xw>=2?f=!1:(this.L8=c$((0,g.lL)(this.yv,this,Q),zrx(this,this.xw)),this.xw++,f=!0);f=!(f||z==2&&HfR(this))}if(f)switch(H){case 1:kX(this, 5);break;case 4:kX(this,10);break;case 3:kX(this,6);break;case 7:kX(this,12);break;default:kX(this,2)}}}; g.S.Jm=function(Q){if(!g.kO(arguments,this.Z))throw Error("Unexpected channel state: "+this.Z);}; g.S.dPT=function(Q){Q?hy(2):(hy(1),fEB(this,8))}; g.S.Xb=function(Q){if(Q)throw Error("Can't create secondary domain capable XhrIo object.");Q=new g.kr;Q.Y=!1;return Q}; g.S.isActive=function(){return!!this.Eq&&this.Eq.isActive(this)}; g.S.jE=function(Q){var z=iJ;z.dispatchEvent(new Vsu(z,Q))}; g.S.GK=function(){return!1}; g.S=Lxs.prototype;g.S.jp=function(){}; g.S.KL=function(){}; g.S.G5=function(){}; g.S.IC=function(){}; g.S.Sp=function(){return{}}; g.S.isActive=function(){return!0};g.S=u8Y.prototype;g.S.enqueue=function(Q){this.B.push(Q)}; g.S.isEmpty=function(){return this.Z.length===0&&this.B.length===0}; g.S.clear=function(){this.Z=[];this.B=[]}; g.S.contains=function(Q){return g.kO(this.Z,Q)||g.kO(this.B,Q)}; g.S.remove=function(Q){var z=this.Z;var H=(0,g.vvt)(z,Q);H>=0?(g.TY(z,H),z=!0):z=!1;return z||g.e5(this.B,Q)}; g.S.fg=function(){for(var Q=[],z=this.Z.length-1;z>=0;--z)Q.push(this.Z[z]);z=this.B.length;for(var H=0;H=JLT.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(Q=JLT[this.B],this.C5=g.n1((0,g.lL)(this.pN,this),Q),this.B++):this.publish("pairingFailed",Error("Server error "+Q.status))}; g.S.Cm=function(){this.Z=null;this.publish("pairingFailed",Error("Server not responding"))}; var JLT=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.zY(v1,SD);g.S=v1.prototype;g.S.start=function(){Xs(this)&&this.publish("screenChange");!g.Pw("yt-remote-lounge-token-expiration")&&sEu(this);g.ZK(this.Z);this.Z=g.n1((0,g.lL)(this.start,this),1E4)}; g.S.add=function(Q,z){Xs(this);IEm(this,Q);yS(this,!1);this.publish("screenChange");z(Q);Q.token||sEu(this)}; g.S.remove=function(Q,z){var H=Xs(this);Yet(this,Q)&&(yS(this,!1),H=!0);z(Q);H&&this.publish("screenChange")}; g.S.LC=function(Q,z,H,f){var b=Xs(this),L=this.get(Q.id);L?(L.name!=z&&(L.name=z,yS(this,!1),b=!0),H(Q)):f(Error("no such local screen."));b&&this.publish("screenChange")}; g.S.zv=function(){g.ZK(this.Z);v1.xu.zv.call(this)}; g.S.fev=function(Q){Xs(this);var z=this.screens.length;Q=Q&&Q.screens||[];for(var H=Q.length,f=0;f20)break a;X=z(L,u)}L=X}b.name=L}H(Ck(this,b))},this), onError:(0,g.lL)(function(b){f(Error("pairing request failed: "+b.status))},this), onTimeout:(0,g.lL)(function(){f(Error("pairing request timed out."))},this)})}; g.S.zv=function(){g.S5(this.B);g.S5(this.Z);Mh.xu.zv.call(this)}; g.S.Evj=function(){dVB(this);this.publish("screenChange");this.Z.update()}; Mh.prototype.dispose=Mh.prototype.dispose;g.zY(tR,g.Xp);g.S=tR.prototype;g.S.sf=function(Q){this.Sm()||(Q&&(pk(this,""+Q),this.publish("sessionFailed")),this.Z=null,this.publish("sessionScreen",null))}; g.S.info=function(Q){H1(this.yl,Q)}; g.S.Vv=function(){return null}; g.S.fd=function(Q){var z=this.B;Q?(z.displayStatus=new chrome.cast.ReceiverDisplayStatus(Q,[]),z.displayStatus.showStop=!0):z.displayStatus=null;chrome.cast.setReceiverDisplayStatus(z,(0,g.lL)(function(){this.info("Updated receiver status for "+z.friendlyName+": "+Q)},this),(0,g.lL)(function(){pk(this,"Failed to update receiver status for: "+z.friendlyName)},this))}; g.S.zv=function(){this.fd("");tR.xu.zv.call(this)};g.p(nk,tR);g.S=nk.prototype;g.S.lP=function(Q){if(this.L){if(this.L==Q)return;pk(this,"Overriding cast session with new session object");bcB(this);this.L3=!1;this.U="unknown";this.L.removeUpdateListener(this.wh);this.L.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.De)}this.L=Q;this.L.addUpdateListener(this.wh);this.L.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.De);Rrt(this,"getMdxSessionStatus")}; g.S.eK=function(Q){this.info("launchWithParams no-op for Cast: "+g.IR(Q))}; g.S.stop=function(){this.L?this.L.stop((0,g.lL)(function(){this.sf()},this),(0,g.lL)(function(){this.sf(Error("Failed to stop receiver app."))},this)):this.sf(Error("Stopping cast device without session."))}; g.S.fd=function(){}; g.S.zv=function(){this.info("disposeInternal");bcB(this);this.L&&(this.L.removeUpdateListener(this.wh),this.L.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.De));this.L=null;tR.prototype.zv.call(this)}; g.S.Xqv=function(Q,z){if(!this.Sm())if(z)if(z=zV(z),g.wc(z))switch(Q=""+z.type,z=z.data||{},this.info("onYoutubeMessage_: "+Q+" "+g.IR(z)),Q){case "mdxSessionStatus":TGx(this,z);break;case "loungeToken":QWm(this,z);break;default:pk(this,"Unknown youtube message: "+Q)}else pk(this,"Unable to parse message.");else pk(this,"No data in message.")}; g.S.gO=function(Q,z,H,f){g.ZK(this.N);this.N=0;DVs(this.D,this.B.label,Q,this.B.friendlyName,(0,g.lL)(function(b){b?z(b):f>=0?(pk(this,"Screen "+Q+" appears to be offline. "+f+" retries left."),this.N=g.n1((0,g.lL)(this.gO,this,Q,z,H,f-1),300)):H(Error("Unable to fetch screen."))},this),H)}; g.S.Vv=function(){return this.L}; g.S.uC=function(Q){this.Sm()||Q||(pk(this,"Cast session died."),this.sf())};g.p(g_,tR);g.S=g_.prototype;g.S.lP=function(Q){this.L=Q;this.L.addUpdateListener(this.f3)}; g.S.eK=function(Q){this.jm=Q;this.Ze()}; g.S.stop=function(){Mis(this);this.L?this.L.stop((0,g.lL)(this.sf,this,null),(0,g.lL)(this.sf,this,"Failed to stop DIAL device.")):this.sf()}; g.S.zv=function(){Mis(this);this.L&&this.L.removeUpdateListener(this.f3);this.L=null;tR.prototype.zv.call(this)}; g.S.I1=function(Q){this.Sm()||Q||(pk(this,"DIAL session died."),this.S(),this.S=function(){},this.sf())};g.p($V,tR);$V.prototype.stop=function(){this.sf()}; $V.prototype.lP=function(){}; $V.prototype.eK=function(){g.ZK(this.L);this.L=NaN;var Q=y2(this.D.VF(),this.B.label);Q?EG(this,Q):this.sf(Error("No such screen"))}; $V.prototype.zv=function(){g.ZK(this.L);this.L=NaN;tR.prototype.zv.call(this)};g.p(jD,g.Xp);g.S=jD.prototype; g.S.init=function(Q,z){chrome.cast.timeout.requestSession=3E4;var H=new chrome.cast.SessionRequest(this.N,[chrome.cast.Capability.AUDIO_OUT]);g.jT("desktop_enable_cast_connect")&&(H.androidReceiverCompatible=!0);this.U||(H.dialRequest=new chrome.cast.DialRequest("YouTube"));var f=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;Q=Q||this.j?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var b=(0,g.lL)(this.QBh,this);H=new chrome.cast.ApiConfig(H,(0,g.lL)(this.gf, this),b,f,Q);H.customDialLaunchCallback=(0,g.lL)(this.J7c,this);chrome.cast.initialize(H,(0,g.lL)(function(){this.Sm()||(chrome.cast.addReceiverActionListener(this.S),Ofs(),this.B.subscribe("onlineScreenChange",(0,g.lL)(this.mw,this)),this.L=ECR(this),chrome.cast.setCustomReceivers(this.L,function(){},(0,g.lL)(function(L){this.K2("Failed to set initial custom receivers: "+g.IR(L))},this)),this.publish("yt-remote-cast2-availability-change",xV(this)),z(!0))},this),(0,g.lL)(function(L){this.K2("Failed to initialize API: "+ g.IR(L)); z(!1)},this))}; g.S.oVv=function(Q,z){Fs("Setting connected screen ID: "+Q+" -> "+z);if(this.Z){var H=this.Z.Z;if(!Q||H&&H.id!=Q)Fs("Unsetting old screen status: "+this.Z.B.friendlyName),OG(this,null)}if(Q&&z){if(!this.Z){Q=y2(this.B.VF(),Q);if(!Q){Fs("setConnectedScreenStatus: Unknown screen.");return}if(Q.idType=="shortLived"){Fs("setConnectedScreenStatus: Screen with id type to be short lived.");return}H=CSs(this,Q);H||(Fs("setConnectedScreenStatus: Connected receiver not custom..."),H=new chrome.cast.Receiver(Q.uuid? Q.uuid:Q.id,Q.name),H.receiverType=chrome.cast.ReceiverType.CUSTOM,this.L.push(H),chrome.cast.setCustomReceivers(this.L,function(){},(0,g.lL)(function(f){this.K2("Failed to set initial custom receivers: "+g.IR(f))},this))); Fs("setConnectedScreenStatus: new active receiver: "+H.friendlyName);OG(this,new $V(this.B,H),!0)}this.Z.fd(z)}else Fs("setConnectedScreenStatus: no screen.")}; g.S.ZA$=function(Q){this.Sm()?this.K2("Setting connection data on disposed cast v2"):this.Z?this.Z.eK(Q):this.K2("Setting connection data without a session")}; g.S.F3=function(){this.Sm()?this.K2("Stopping session on disposed cast v2"):this.Z?(this.Z.stop(),OG(this,null)):Fs("Stopping non-existing session")}; g.S.requestSession=function(){chrome.cast.requestSession((0,g.lL)(this.gf,this),(0,g.lL)(this.xB$,this))}; g.S.zv=function(){this.B.unsubscribe("onlineScreenChange",(0,g.lL)(this.mw,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.S);var Q=jEs,z=g.D6("yt.mdx.remote.debug.handlers_");g.e5(z||[],Q);g.S5(this.Z);g.Xp.prototype.zv.call(this)}; g.S.K2=function(Q){H1("Controller",Q)}; g.S.oI=function(Q,z){this.Z==Q&&(z||OG(this,null),this.publish("yt-remote-cast2-session-change",z))}; g.S.pch=function(Q,z){if(!this.Sm())if(Q)switch(Q.friendlyName=chrome.cast.unescape(Q.friendlyName),Fs("onReceiverAction_ "+Q.label+" / "+Q.friendlyName+"-- "+z),z){case chrome.cast.ReceiverAction.CAST:if(this.Z)if(this.Z.B.label!=Q.label)Fs("onReceiverAction_: Stopping active receiver: "+this.Z.B.friendlyName),this.Z.stop();else{Fs("onReceiverAction_: Casting to active receiver.");this.Z.Z&&this.publish("yt-remote-cast2-session-change",this.Z.Z);break}switch(Q.receiverType){case chrome.cast.ReceiverType.CUSTOM:OG(this, new $V(this.B,Q));break;case chrome.cast.ReceiverType.DIAL:OG(this,new g_(this.B,Q,this.D,this.config_));break;case chrome.cast.ReceiverType.CAST:OG(this,new nk(this.B,Q,this.config_));break;default:this.K2("Unknown receiver type: "+Q.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.Z&&this.Z.B.label==Q.label?this.Z.stop():this.K2("Stopping receiver w/o session: "+Q.friendlyName)}else this.K2("onReceiverAction_ called without receiver.")}; g.S.J7c=function(Q){if(this.Sm())return Promise.reject(Error("disposed"));var z=Q.receiver;z.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.K2("Not DIAL receiver: "+z.friendlyName),z.receiverType=chrome.cast.ReceiverType.DIAL);var H=this.Z?this.Z.B:null;if(!H||H.label!=z.label)return this.K2("Receiving DIAL launch request for non-clicked DIAL receiver: "+z.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(H&&H.label==z.label&&H.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.Z.Z)return Fs("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.Z.Z),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.K2('Changing CAST intent from "'+H.receiverType+'" to "dial" for '+z.friendlyName);OG(this,new g_(this.B,z,this.D,this.config_))}z=this.Z;z.N=Q;z.N.appState==chrome.cast.DialAppState.RUNNING?(Q=z.N.extraData||{},H=Q.screenId||null,Zj(z)&&Q.loungeToken?Q.loungeTokenRefreshIntervalMs?Q=vCB(z,{name:z.B.friendlyName,screenId:Q.screenId,loungeToken:Q.loungeToken,dialId:z.N.receiver.label, screenIdType:"shortLived"},Q.loungeTokenRefreshIntervalMs):(g.Rf(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(Q)+".")),Q=y$s(z,H)):Q=y$s(z,H)):Q=S5O(z);return Q}; g.S.gf=function(Q){var z=this;if(!this.Sm()&&!this.j){Fs("New cast session ID: "+Q.sessionId);var H=Q.receiver;if(H.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.Z)if(H.receiverType==chrome.cast.ReceiverType.CAST)Fs("Got resumed cast session before resumed mdx connection."),H.friendlyName=chrome.cast.unescape(H.friendlyName),OG(this,new nk(this.B,H,this.config_),!0);else{this.K2("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var f=this.Z.B,b=y2(this.B.VF(), f.label);b&&Xb(b,H.label)&&f.receiverType!=chrome.cast.ReceiverType.CAST&&H.receiverType==chrome.cast.ReceiverType.CAST&&(Fs("onSessionEstablished_: manual to cast session change "+H.friendlyName),g.S5(this.Z),this.Z=new nk(this.B,H,this.config_),this.Z.subscribe("sessionScreen",(0,g.lL)(this.oI,this,this.Z)),this.Z.subscribe("sessionFailed",function(){return tiB(z,z.Z)}),this.Z.eK(null)); this.Z.lP(Q)}}}; g.S.Nw=function(){return this.Z?this.Z.Vv():null}; g.S.xB$=function(Q){this.Sm()||(this.K2("Failed to estabilish a session: "+g.IR(Q)),Q.code!=chrome.cast.ErrorCode.CANCEL&&OG(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.S.QBh=function(Q){Fs("Receiver availability updated: "+Q);if(!this.Sm()){var z=xV(this);this.Y=Q==chrome.cast.ReceiverAvailability.AVAILABLE;xV(this)!=z&&this.publish("yt-remote-cast2-availability-change",xV(this))}}; g.S.mw=function(){this.Sm()||(this.L=ECR(this),Fs("Updating custom receivers: "+g.IR(this.L)),chrome.cast.setCustomReceivers(this.L,function(){},(0,g.lL)(function(){this.K2("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",xV(this)))}; jD.prototype.setLaunchParams=jD.prototype.ZA$;jD.prototype.setConnectedScreenStatus=jD.prototype.oVv;jD.prototype.stopSession=jD.prototype.F3;jD.prototype.getCastSession=jD.prototype.Nw;jD.prototype.requestSession=jD.prototype.requestSession;jD.prototype.init=jD.prototype.init;jD.prototype.dispose=jD.prototype.dispose;var xRB=[];g.S=r_.prototype; g.S.reset=function(Q){this.listId="";this.index=-1;this.videoId="";A$s(this);this.volume=-1;this.muted=!1;Q&&(this.index=Q.index,this.listId=Q.listId,this.videoId=Q.videoId,this.playerState=Q.playerState,this.volume=Q.volume,this.muted=Q.muted,this.audioTrackId=Q.audioTrackId,this.trackData=Q.trackData,this.bz=Q.hasPrevious,this.Yr=Q.hasNext,this.Y=Q.playerTime,this.j=Q.playerTimeAt,this.D=Q.seekableStart,this.Z=Q.seekableEnd,this.S=Q.duration,this.N=Q.loadedTime,this.L=Q.liveIngestionTime,this.B= !isNaN(this.L))}; g.S.isPlaying=function(){return this.playerState==1}; g.S.isBuffering=function(){return this.playerState==3}; g.S.f4=function(){return this.playerState==1081}; g.S.wx=function(Q){this.S=isNaN(Q)?0:Q}; g.S.getDuration=function(){return this.B?this.S+sG(this):this.S}; g.S.clone=function(){return new r_(Y5u(this))};g.p(c1,g.Xp);g.S=c1.prototype;g.S.getState=function(){return this.L}; g.S.U4=function(){return this.D.getReconnectTimeout()}; g.S.Df=function(){this.D.reconnect()}; g.S.play=function(){hR(this)?(this.Z?this.Z.play(null,g.Cg,VS(this,"play")):Kk(this,"play"),B2s(this,1,P1(ii(this))),this.publish("remotePlayerChange")):W1(this,this.play)}; g.S.pause=function(){hR(this)?(this.Z?this.Z.pause(null,g.Cg,VS(this,"pause")):Kk(this,"pause"),B2s(this,2,P1(ii(this))),this.publish("remotePlayerChange")):W1(this,this.pause)}; g.S.seekTo=function(Q){if(hR(this)){if(this.Z){var z=ii(this),H=new chrome.cast.media.SeekRequest;H.currentTime=Q;z.isPlaying()||z.isBuffering()?H.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:H.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.Z.seek(H,g.Cg,VS(this,"seekTo",{newTime:Q}))}else Kk(this,"seekTo",{newTime:Q});B2s(this,3,Q);this.publish("remotePlayerChange")}else W1(this,g.RJ(this.seekTo,Q))}; g.S.stop=function(){if(hR(this)){this.Z?this.Z.stop(null,g.Cg,VS(this,"stopVideo")):Kk(this,"stopVideo");var Q=ii(this);Q.index=-1;Q.videoId="";A$s(Q);Dj(this,Q);this.publish("remotePlayerChange")}else W1(this,this.stop)}; g.S.setVolume=function(Q,z){if(hR(this)){var H=ii(this);if(this.B){if(H.volume!=Q){var f=Math.round(Q)/100;this.B.setReceiverVolumeLevel(f,(0,g.lL)(function(){fk("set receiver volume: "+f)},this),(0,g.lL)(function(){this.K2("failed to set receiver volume.")},this))}H.muted!=z&&this.B.setReceiverMuted(z,(0,g.lL)(function(){fk("set receiver muted: "+z)},this),(0,g.lL)(function(){this.K2("failed to set receiver muted.")},this))}else{var b={volume:Q, muted:z};H.volume!=-1&&(b.delta=Q-H.volume);Kk(this,"setVolume",b)}H.muted=z;H.volume=Q;Dj(this,H)}else W1(this,g.RJ(this.setVolume,Q,z))}; g.S.nL=function(Q,z){if(hR(this)){var H=ii(this);Q={videoId:Q};z&&(H.trackData={trackName:z.name,languageCode:z.languageCode,sourceLanguageCode:z.translationLanguage?z.translationLanguage.languageCode:"",languageName:z.languageName,kind:z.kind},Q.style=g.IR(z.style),g.aI(Q,H.trackData));Kk(this,"setSubtitlesTrack",Q);Dj(this,H)}else W1(this,g.RJ(this.nL,Q,z))}; g.S.setAudioTrack=function(Q,z){hR(this)?(z=z.getLanguageInfo().getId(),Kk(this,"setAudioTrack",{videoId:Q,audioTrackId:z}),Q=ii(this),Q.audioTrackId=z,Dj(this,Q)):W1(this,g.RJ(this.setAudioTrack,Q,z))}; g.S.playVideo=function(Q,z,H,f,b,L,u){f=f===void 0?null:f;b=b===void 0?null:b;L=L===void 0?null:L;u=u===void 0?null:u;var X=ii(this),v={videoId:Q};H!==void 0&&(v.currentIndex=H);az(X,Q,H||0);z!==void 0&&(B1(X,z),v.currentTime=z);f&&(v.listId=f);b&&(v.playerParams=b);L&&(v.clickTrackingParams=L);u&&(v.locationInfo=g.IR(u));Kk(this,"setPlaylist",v);f||Dj(this,X)}; g.S.CX=function(Q,z){if(hR(this)){if(Q&&z){var H=ii(this);az(H,Q,z);Dj(this,H)}Kk(this,"previous")}else W1(this,g.RJ(this.CX,Q,z))}; g.S.nextVideo=function(Q,z){if(hR(this)){if(Q&&z){var H=ii(this);az(H,Q,z);Dj(this,H)}Kk(this,"next")}else W1(this,g.RJ(this.nextVideo,Q,z))}; g.S.qU=function(){if(hR(this)){Kk(this,"clearPlaylist");var Q=ii(this);Q.reset();Dj(this,Q);this.publish("remotePlayerChange")}else W1(this,this.qU)}; g.S.HT=function(){hR(this)?Kk(this,"dismissAutoplay"):W1(this,this.HT)}; g.S.dispose=function(){if(this.L!=3){var Q=this.L;this.L=3;this.publish("proxyStateChange",Q,this.L)}g.Xp.prototype.dispose.call(this)}; g.S.zv=function(){sWY(this);this.D=null;this.S.clear();UG(this,null);g.Xp.prototype.zv.call(this)}; g.S.cg=function(Q){if((Q!=this.L||Q==2)&&this.L!=3&&Q!=0){var z=this.L;this.L=Q;this.publish("proxyStateChange",z,Q);if(Q==1)for(;!this.S.isEmpty();)z=Q=this.S,z.Z.length===0&&(z.Z=z.B,z.Z.reverse(),z.B=[]),Q.Z.pop().apply(this);else Q==3&&this.dispose()}}; g.S.vsl=function(Q,z){this.publish(Q,z)}; g.S.SVe=function(Q){if(!Q)this.HJ(null),UG(this,null);else if(this.B.receiver.volume){Q=this.B.receiver.volume;var z=ii(this),H=Math.round(100*Q.level||0);if(z.volume!=H||z.muted!=Q.muted)fk("Cast volume update: "+Q.level+(Q.muted?" muted":"")),z.volume=H,z.muted=!!Q.muted,Dj(this,z)}}; g.S.HJ=function(Q){fk("Cast media: "+!!Q);this.Z&&this.Z.removeUpdateListener(this.N);if(this.Z=Q)this.Z.addUpdateListener(this.N),PSO(this),this.publish("remotePlayerChange")}; g.S.lSh=function(Q){Q?(PSO(this),this.publish("remotePlayerChange")):this.HJ(null)}; g.S.qE=function(){Kk(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.S.A7T=function(){var Q=J$5();Q&&UG(this,Q)}; g.S.K2=function(Q){H1("CP",Q)};g.p(w_,g.Xp);g.S=w_.prototype; g.S.connect=function(Q,z){if(z){var H=z.listId,f=z.videoId,b=z.videoIds,L=z.playerParams,u=z.clickTrackingParams,X=z.index,v={videoId:f},y=z.currentTime,q=z.locationInfo;z=z.loopMode;y!==void 0&&(v.currentTime=y<=5?0:y);L&&(v.playerParams=L);q&&(v.locationInfo=q);u&&(v.clickTrackingParams=u);H&&(v.listId=H);b&&b.length>0&&(v.videoIds=b.join(","));X!==void 0&&(v.currentIndex=X);this.f3&&(v.loopMode=z||"LOOP_MODE_OFF");H&&(this.Z.listId=H);this.Z.videoId=f;this.Z.index=X||0;this.Z.state=3;B1(this.Z, y);this.S="UNSUPPORTED";H=this.f3?"setInitialState":"setPlaylist";d_("Connecting with "+H+" and params: "+g.IR(v));this.B.connect({method:H,params:g.IR(v)},Q,SMB())}else d_("Connecting without params"),this.B.connect({},Q,SMB());icJ(this)}; g.S.Il=function(Q){this.B.Il(Q)}; g.S.dispose=function(){this.Sm()||(g.W_("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),mO(this,3));g.Xp.prototype.dispose.call(this)}; g.S.zv=function(){hwT(this);DRu(this);Wuu(this);g.ZK(this.N);this.N=NaN;g.ZK(this.U);this.U=NaN;this.D=null;g.xQ(this.Ze);this.Ze.length=0;this.B.dispose();g.Xp.prototype.zv.call(this);this.S=this.Y=this.L=this.Z=this.B=null}; g.S.Z2=function(Q){if(!this.L||this.L.length===0)return!1;for(var z=g.n(this.L),H=z.next();!H.done;H=z.next())if(!H.value.capabilities.has(Q))return!1;return!0}; g.S.Z3h=function(){var Q=3;this.Sm()||(Q=0,isNaN(this.hJ())?this.B.Bk()&&isNaN(this.j)&&(Q=1):Q=2);return Q}; g.S.RW=function(Q){d_("Disconnecting with "+Q);g.W_("yt.mdx.remote.remoteClient_",null);hwT(this);this.publish("beforeDisconnect",Q);Q==1&&Cd();this.B.disconnect(Q);this.dispose()}; g.S.gE=function(){var Q=this.Z;this.D&&(Q=this.Z.clone(),az(Q,this.D,Q.index));return Y5u(Q)}; g.S.xPv=function(Q){var z=this,H=new r_(Q);H.videoId&&H.videoId!=this.Z.videoId&&(this.D=H.videoId,g.ZK(this.N),this.N=g.n1(function(){if(z.D){var b=z.D;z.D=null;z.Z.videoId!=b&&kV(z,"getNowPlaying")}},5E3)); var f=[];this.Z.listId==H.listId&&this.Z.videoId==H.videoId&&this.Z.index==H.index||f.push("remoteQueueChange");this.Z.playerState==H.playerState&&this.Z.volume==H.volume&&this.Z.muted==H.muted&&P1(this.Z)==P1(H)&&g.IR(this.Z.trackData)==g.IR(H.trackData)||f.push("remotePlayerChange");this.Z.reset(Q);g.qI(f,function(b){this.publish(b)},this)}; g.S.Fi=function(){var Q=this.B.getDeviceId(),z=g.mB(this.L,function(H){return H.type=="REMOTE_CONTROL"&&H.id!=Q}); return z?z.id:""}; g.S.hJ=function(){return this.B.U4()}; g.S.Ey=function(){return this.S||"UNSUPPORTED"}; g.S.py=function(){return this.Y||""}; g.S.R1=function(){!isNaN(this.hJ())&&this.B.Df()}; g.S.U8I=function(Q,z){kV(this,Q,z);ViY(this)}; g.S.Ye=function(){var Q=g.c2("SAPISID","")||g.c2("__Secure-1PAPISID")||"",z=g.c2("__Secure-3PAPISID","")||"";if(!Q&&!z)return"";Q=g.nr(g.ZL(Q),2);z=g.nr(g.ZL(z),2);return g.nr(g.ZL(","+Q+","+z),2)}; w_.prototype.subscribe=w_.prototype.subscribe;w_.prototype.unsubscribeByKey=w_.prototype.NP;w_.prototype.getProxyState=w_.prototype.Z3h;w_.prototype.disconnect=w_.prototype.RW;w_.prototype.getPlayerContextData=w_.prototype.gE;w_.prototype.setPlayerContextData=w_.prototype.xPv;w_.prototype.getOtherConnectedRemoteId=w_.prototype.Fi;w_.prototype.getReconnectTimeout=w_.prototype.hJ;w_.prototype.getAutoplayMode=w_.prototype.Ey;w_.prototype.getAutoplayVideoId=w_.prototype.py;w_.prototype.reconnect=w_.prototype.R1; w_.prototype.sendMessage=w_.prototype.U8I;w_.prototype.getXsrfToken=w_.prototype.Ye;w_.prototype.isCapabilitySupportedOnConnectedDevices=w_.prototype.Z2;g.p(f7R,SD);g.S=f7R.prototype;g.S.VF=function(Q){return this.bW.$_gs(Q)}; g.S.contains=function(Q){return!!this.bW.$_c(Q)}; g.S.get=function(Q){return this.bW.$_g(Q)}; g.S.start=function(){this.bW.$_st()}; g.S.add=function(Q,z,H){this.bW.$_a(Q,z,H)}; g.S.remove=function(Q,z,H){this.bW.$_r(Q,z,H)}; g.S.LC=function(Q,z,H,f){this.bW.$_un(Q,z,H,f)}; g.S.zv=function(){for(var Q=this.Z.length,z=0;z1&&!this.K.getOption("remote","quickCast")?(this.TI=g.MI(Q,this.Z,this),this.wz(g.J5(Q,this.Z)),Q=this.K.getOption("remote","currentReceiver"),Q=this.Z(Q),this.options[Q]&&this.RJ(Q),this.enable(!0)):this.enable(!1)}; tW.prototype.Z=function(Q){return Q.key}; tW.prototype.Z5=function(Q){return Q==="cast-selector-receiver"?"Cast...":this.TI[Q].name}; tW.prototype.zZ=function(Q){g.hz.prototype.zZ.call(this,Q);this.K.setOption("remote","currentReceiver",this.TI[Q]);this.kt.fH()};g.p(xAt,g.g3);g.S=xAt.prototype; g.S.create=function(){var Q=this.player.C(),z=g.AE(Q);Q={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:Q.V("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:Q.V("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:Q.V("enable_cast_short_lived_lounge_token")};Xbx(z,Q);this.subscriptions.push(g.u8("yt-remote-before-disconnect",this.y7h,this));this.subscriptions.push(g.u8("yt-remote-connection-change",this.C8v,this));this.subscriptions.push(g.u8("yt-remote-receiver-availability-change",this.Wj, this));this.subscriptions.push(g.u8("yt-remote-auto-connect",this.Xc5,this));this.subscriptions.push(g.u8("yt-remote-receiver-resumed",this.iph,this));this.subscriptions.push(g.u8("mdx-privacy-popup-confirm",this.BQn,this));this.subscriptions.push(g.u8("mdx-privacy-popup-cancel",this.zX$,this));this.Wj()}; g.S.load=function(){this.player.cancelPlayback();g.g3.prototype.load.call(this);this.kQ=new FCs(this);this.player.Go(this.kQ);this.zi=new Ztu(this,this.player,this.Mi);var Q=(Q=pbm())?Q.currentTime:0;var z=C8Y()?new c1(Lb(),void 0):null;Q==0&&z&&(Q=P1(ii(z)));Q!==0&&this.A7(Q);Ots(this,this.oy,this.oy);this.player.Za(6)}; g.S.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.TQ();this.Jv=this.Jp;g.Xx(this.zi,this.Mi);this.Mi=this.kQ=this.zi=null;g.g3.prototype.unload.call(this);this.player.Za(5);E_(this)}; g.S.zv=function(){g.Sv(this.subscriptions);g.g3.prototype.zv.call(this)}; g.S.wM=function(Q){var z=g.A8.apply(1,arguments);this.loaded&&this.zi.j6.apply(this.zi,[Q].concat(g.F(z)))}; g.S.getAdState=function(){return this.xn}; g.S.bz=function(){return this.Mi?ii(this.Mi).bz:!1}; g.S.Yr=function(){return this.Mi?ii(this.Mi).Yr:!1}; g.S.A7=function(Q,z){this.GG=Q||0;this.player.publish("progresssync",Q,z);this.player.g4("onVideoProgress",Q||0)}; g.S.getCurrentTime=function(){return this.GG}; g.S.getProgressState=function(){var Q=ii(this.Mi),z=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!Q.f4()&&this.player.GZ(),clipEnd:z.clipEnd,clipStart:z.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:Q.getDuration(),ingestionTime:Q.B?Q.L+sG(Q):Q.L,isAtLiveHead:(Q.B?Q.Z+sG(Q):Q.Z)-this.getCurrentTime()<=1,loaded:Q.N,seekableEnd:Q.B?Q.Z+sG(Q):Q.Z,seekableStart:Q.D>0?Q.D+sG(Q):Q.D,offset:0,viewerLivestreamJoinMediaTime:0}}; g.S.nextVideo=function(){this.Mi&&this.Mi.nextVideo()}; g.S.CX=function(){this.Mi&&this.Mi.CX()}; g.S.y7h=function(Q){Q===1&&(this.Xy=this.Mi?ii(this.Mi):null)}; g.S.C8v=function(){var Q=C8Y()?new c1(Lb(),void 0):null;if(Q){var z=this.Jv;this.loaded&&this.unload();this.Mi=Q;this.Xy=null;z.key!==this.Jp.key&&(this.Jv=z,this.load())}else g.S5(this.Mi),this.Mi=null,this.loaded&&(this.unload(),(Q=this.Xy)&&Q.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(Q.videoId,P1(Q)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.S.Wj=function(){var Q=[this.Jp],z=Q.concat,H=vkT();Iz()&&g.Pw("yt-remote-cast-available")&&H.push({key:"cast-selector-receiver",name:"Cast..."});this.TI=z.call(Q,H);Q=qbu()||this.Jp;pb(this,Q);this.player.g4("onMdxReceiversChange")}; g.S.Xc5=function(){var Q=qbu();pb(this,Q)}; g.S.iph=function(){this.Jv=qbu()}; g.S.BQn=function(){this.vJ=!0;E_(this);vd=!1;uP&&XH(uP,1);uP=null}; g.S.zX$=function(){this.vJ=!1;E_(this);pb(this,this.Jp);this.Jv=this.Jp;vd=!1;uP=null;this.player.playVideo()}; g.S.TZ=function(Q,z){switch(Q){case "casting":return this.loaded;case "receivers":return this.TI;case "currentReceiver":return z&&(z.key==="cast-selector-receiver"?N2B():pb(this,z)),this.loaded?this.Jv:this.Jp;case "quickCast":return this.TI.length===2&&this.TI[1].key==="cast-selector-receiver"?(z&&N2B(),!0):!1}}; g.S.qE=function(){this.Mi.qE()}; g.S.Ti=function(){return!1}; g.S.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.S.isLoggedIn=function(){var Q,z;return((Q=g.T5("PLAYER_CONFIG"))==null?void 0:(z=Q.args)==null?void 0:z.authuser)!==void 0?!0:!(!g.T5("SESSION_INDEX")&&!g.T5("LOGGED_IN"))};g.nA("remote",xAt);})(_yt_player);