(function(g){var window=this;'use strict';var oeQ=function(n){if(n instanceof g.yL)return n;if(typeof n.Iw=="function")return n.Iw(!1);if(g.cs(n)){var q=0,M=new g.yL;M.next=function(){for(;;){if(q>=n.length)return g.bb;if(q in n)return g.Is(n[q++]);q++}}; return M}throw Error("Not implemented");},wkQ=function(n,q,M){if(g.cs(n))g.xw(n,q,M); else for(n=oeQ(n);;){var t=n.next();if(t.done)break;q.call(M,t.value,void 0,n)}},pG=function(n){g.bM(n,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.OF()).toString(36)); return n},nJ=function(n,q,M){Array.isArray(M)||(M=[String(M)]); g.D8s(n.J,q,M)},z_Q=function(n,q){var M=[]; wkQ(q,function(t){try{var c=g.HX.prototype.W.call(this,t,!0)}catch(Y){if(Y=="Storage: Invalid value was encountered")return;throw Y;}c===void 0?M.push(t):g.Jt1(c)&&M.push(t)},n); return M},JPd=function(n,q){z_Q(n,q).forEach(function(M){g.HX.prototype.remove.call(this,M)},n)},V6T=function(n){if(n.Wm){if(n.Wm.locationOverrideToken)return{locationOverrideToken:n.Wm.locationOverrideToken}; if(n.Wm.latitudeE7!=null&&n.Wm.longitudeE7!=null)return{latitudeE7:n.Wm.latitudeE7,longitudeE7:n.Wm.longitudeE7}}return null},ClA=function(n,q){g.SS(n,q)||n.push(q)},rPO=function(n){var q=0,M; for(M in n)q++;return q},xsO=function(n,q){return g.Nk(n,q)},QNG=function(n){try{return g.pa.JSON.parse(n)}catch(q){}n=String(n); if(/^\s*$/.test(n)?0:/^[\],:{}\s\u2028\u2029]*$/.test(n.replace(/\\["\\\/bfnrtu]/g,"@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+n+")")}catch(q){}throw Error("Invalid JSON string: "+n);},qz=function(n){if(g.pa.JSON)try{return g.pa.JSON.parse(n)}catch(q){}return QNG(n)},pkO=function(){var n=Mz(); this.X=n;n.dw("/client_streamz/youtube/living_room/mdx/channel/opened",g.tt("channel_type"))},njA=function(){var n=Mz(); this.X=n;n.dw("/client_streamz/youtube/living_room/mdx/channel/closed",g.tt("channel_type"))},qgF=function(){var n=Mz(); this.X=n;n.dw("/client_streamz/youtube/living_room/mdx/channel/message_received",g.tt("channel_type"))},Mod=function(){var n=Mz(); this.X=n;n.dw("/client_streamz/youtube/living_room/mdx/channel/success")},iLn=function(){var n=Mz(); this.X=n;n.dw("/client_streamz/youtube/living_room/mdx/channel/error",g.tt("channel_type"),g.tt("error_type"))},tos=function(){var n=Mz(); this.X=n;n.dw("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},cJs=function(){var n=Mz(); this.X=n;n.dw("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},Ygs=function(n,q,M,t){var c=new g.Mb(null); n&&g.iM(c,n);q&&g.td(c,q);M&&g.cC(c,M);t&&(c.W=t);return c},GJD=function(n,q){return new g.Qx(n,q)},iO=function(n,q){return Object.prototype.hasOwnProperty.call(n,q)},KAD=function(n,q){return n===q},tZ=function(n,q){this.W={}; this.X=[];this.gF=this.size=0;var M=arguments.length;if(M>1){if(M%2)throw Error("Uneven number of arguments");for(var t=0;t5&&(n=n.slice(n.length-5)); var q=g.Wn(JJA(),function(t){return t.loungeToken}),M=g.Wn(n,function(t){return t.loungeToken}); g.yD(M,function(t){return!g.SS(q,t)})&&VoK(); g.Pf("yt-remote-local-screens",n,31536E3)},On=function(n){n||(g.TJ("yt-remote-session-screen-id"),g.TJ("yt-remote-session-video-id")); wfw();n=dx();g.fQ(n,Nz());RlF(n)},rJL=function(){if(!gx){var n=g.UX(); n&&(gx=new g.SA(n))}},xyG=function(){rJL(); return gx?!!gx.get("yt-remote-use-staging-server"):!1},eu=function(n,q){g.rw[n]=!0; var M=g.Vd();M&&M.publish.apply(M,arguments);g.rw[n]=!1},QEF=function(){},Mz=function(){if(!En){En=new g.FG(new QEF); var n=g.hP("client_streamz_web_flush_count",-1);n!==-1&&(En.Z=n)}return En},pfG=function(){var n=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return n?parseInt(n[1],10):0},ncs=function(n){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+n)!=-1||document.currentScript.src.indexOf("&"+n)!=-1)},qlO=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},hZ=function(n){n.length?MtA(n.shift(),function(){hZ(n)}):iMn()},ttF=function(n){return"chrome-extension://"+n+"/cast_sender.js"},MtA=function(n,q,M){var t=document.createElement("script"); t.onerror=q;M&&(t.onload=M);g.XC(t,g.sk(n));(document.head||document.documentElement).appendChild(t)},cxd=function(){var n=pfG(),q=[]; if(n>1){var M=n-1;q.push("//www.gstatic.com/eureka/clank/"+n+"/cast_sender.js");q.push("//www.gstatic.com/eureka/clank/"+M+"/cast_sender.js")}return q},iMn=function(){var n=qlO(); n&&n(!1,"No cast extension found")},GYA=function(){if(YlF){var n=2,q=qlO(),M=function(){n--; n==0&&q&&q(!0)}; window.__onGCastApiAvailable=M;MtA("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",iMn,M)}},Kus=function(){GYA(); var n=cxd();n.push("//www.gstatic.com/eureka/clank/cast_sender.js");hZ(n)},bMT=function(){GYA(); var n=cxd();n.push.apply(n,g.EJ(kYs.map(ttF)));n.push("//www.gstatic.com/eureka/clank/cast_sender.js");hZ(n)},Wv=function(n,q,M){g.F.call(this); this.C=M!=null?(0,g.bn)(n,M):n;this.b$=q;this.S=(0,g.bn)(this.O8,this);this.X=!1;this.W=0;this.Z=this.Eq=null;this.J=[]},yH=function(){},dHs=function(){g.zv.call(this,"p")},NzT=function(){g.zv.call(this,"o")},gcQ=function(){return OMs=OMs||new g.Ne},eiQ=function(n){g.zv.call(this,"serverreachability",n)},sn=function(n){var q=gcQ(); q.dispatchEvent(new eiQ(q,n))},Ecd=function(n){g.zv.call(this,"statevent",n)},XI=function(n){var q=gcQ(); q.dispatchEvent(new Ecd(q,n))},hiT=function(n,q,M,t){g.zv.call(this,"timingevent",n); this.size=q;this.rtt=M;this.retries=t},ju=function(n,q){if(typeof n!=="function")throw Error("Fn must not be null and must be a function"); return g.pa.setTimeout(function(){n()},q)},Su=function(){},IH=function(n,q,M,t){this.Z=n; this.J=q;this.O9=M;this.Yi=t||1;this.QS=new g.ew(this);this.eX=45E3;this.SX=null;this.C=!1;this.U=this.hE=this.B=this.rJ=this.wJ=this.Ux=this.xl=null;this.RL=[];this.X=null;this.N=0;this.S=this.jX=null;this.Wg=-1;this.nm=!1;this.Yl=0;this.V1=null;this.Fh=this.AE=this.uG=this.IL=!1;this.W=new Wus},Wus=function(){this.W=null; this.X="";this.Z=!1},saF=function(n,q,M){n.rJ=1; n.B=pG(q.clone());n.U=M;n.IL=!0;yxO(n,null)},yxO=function(n,q){n.wJ=Date.now(); fJ(n);n.hE=n.B.clone();nJ(n.hE,"t",n.Yi);n.N=0;var M=n.Z.rJ;n.W=new Wus;n.X=X6d(n.Z,M?q:null,!n.U);n.Yl>0&&(n.V1=new g.rE((0,g.bn)(n.Ge,n,n.X),n.Yl));n.QS.listen(n.X,"readystatechange",n.NA);q=n.SX?g.hf(n.SX):{};n.U?(n.jX||(n.jX="POST"),q["Content-Type"]="application/x-www-form-urlencoded",n.X.send(n.hE,n.jX,n.U,q)):(n.jX="GET",n.X.send(n.hE,n.jX,null,q));sn(1)},Sld=function(n){if(!jaA(n))return g.rM(n.X); var q=g.x4(n.X);if(q==="")return"";var M="",t=q.length,c=g.Vc(n.X)==4;if(!n.W.W){if(typeof TextDecoder==="undefined")return Hv(n),LJ(n),"";n.W.W=new g.pa.TextDecoder}for(var Y=0;Yq.length)return IgA;q=q.slice(t,t+M);n.N=t+M;return q},fJ=function(n){n.Ux=Date.now()+n.eX; LuA(n,n.eX)},LuA=function(n,q){if(n.xl!=null)throw Error("WatchDog timer not null"); n.xl=ju((0,g.bn)(n.Yq,n),q)},PQT=function(n){n.xl&&(g.pa.clearTimeout(n.xl),n.xl=null)},LJ=function(n){n.Z.vI()||n.nm||vcK(n.Z,n)},Hv=function(n){PQT(n); g.iz(n.V1);n.V1=null;n.QS.removeAll();if(n.X){var q=n.X;n.X=null;q.abort();q.dispose()}},mHA=function(n,q){try{var M=n.Z; if(M.vH!=0&&(M.X==n||TzT(M.W,n)))if(!n.AE&&TzT(M.W,n)&&M.vH==3){try{var t=M.Z6.X.parse(q)}catch(I){t=null}if(Array.isArray(t)&&t.length==3){var c=t;if(c[0]==0)a:{if(!M.B){if(M.X)if(M.X.wJ+3E30&&(M.Yl=1.5*k);t=M;var b=n.BQ();if(b){var d=g.Qc(b,"X-Client-Wire-Protocol");if(d){var N=t.W;!N.X&&(g.B7(d,"spdy")||g.B7(d,"quic")||g.B7(d,"h2"))&&(N.J=N.S,N.X=new Set,N.W&&(u0Q(N,N.W),N.W=null))}if(t.IL){var O=g.Qc(b,"X-HTTP-Session-Id");O&&(t.K8=O,g.bM(t.SX,t.IL,O))}}M.vH=3;M.S&&M.S.Cr();M.JQ&&(M.o8=Date.now()-n.wJ);t=M;var e=n;t.TX=BzF(t,t.rJ?t.O9:null,t.Kd);if(e.AE){DHQ(t.W, e);var E=e,h=t.Yl;h&&E.setTimeout(h);E.xl&&(PQT(E),fJ(E));t.X=e}else AxS(t);M.Z.length>0&&lO(M)}else Y[0]!="stop"&&Y[0]!="close"||Tu(M,7);else M.vH==3&&(Y[0]=="stop"||Y[0]=="close"?Y[0]=="stop"?Tu(M,7):M.disconnect():Y[0]!="noop"&&M.S&&M.S.o4(Y),M.RL=0)}sn(4)}catch(I){}},$HQ=function(n,q){this.X=n; this.map=q;this.context=null},Fud=function(n){this.S=n||10; g.pa.PerformanceNavigationTiming?(n=g.pa.performance.getEntriesByType("navigation"),n=n.length>0&&(n[0].nextHopProtocol=="hq"||n[0].nextHopProtocol=="h2")):n=!!(g.pa.chrome&&g.pa.chrome.loadTimes&&g.pa.chrome.loadTimes()&&g.pa.chrome.loadTimes().wasFetchedViaSpdy);this.J=n?this.S:1;this.X=null;this.J>1&&(this.X=new Set);this.W=null;this.Z=[]},ZMs=function(n){return n.W?!0:n.X?n.X.size>=n.J:!1},UHd=function(n){return n.W?1:n.X?n.X.size:0},TzT=function(n,q){return n.W?n.W==q:n.X?n.X.has(q):!1},u0Q= function(n,q){n.X?n.X.add(q):n.W=q},DHQ=function(n,q){n.W&&n.W==q?n.W=null:n.X&&n.X.has(q)&&n.X.delete(q)},agw=function(n){if(n.W!=null)return n.Z.concat(n.W.RL); if(n.X!=null&&n.X.size!==0){var q=n.Z;n=g.S(n.X.values());for(var M=n.next();!M.done;M=n.next())q=q.concat(M.value.RL);return q}return g.un(n.Z)},RiS=function(n,q){var M=new Su; if(g.pa.Image){var t=new Image;t.onload=g.dT(Un,M,"TestLoadImage: loaded",!0,q,t);t.onerror=g.dT(Un,M,"TestLoadImage: error",!1,q,t);t.onabort=g.dT(Un,M,"TestLoadImage: abort",!1,q,t);t.ontimeout=g.dT(Un,M,"TestLoadImage: timeout",!1,q,t);g.pa.setTimeout(function(){if(t.ontimeout)t.ontimeout()},1E4); t.src=n}else q(!1)},ocS=function(n,q){var M=new Su,t=new AbortController,c=setTimeout(function(){t.abort(); Un(M,"TestPingServer: timeout",!1,q)},1E4); fetch(n,{signal:t.signal}).then(function(Y){clearTimeout(c);Y.ok?Un(M,"TestPingServer: ok",!0,q):Un(M,"TestPingServer: server error",!1,q)}).catch(function(){clearTimeout(c); Un(M,"TestPingServer: error",!1,q)})},Un=function(n,q,M,t,c){try{c&&(c.onload=null,c.onerror=null,c.onabort=null,c.ontimeout=null),t(M)}catch(Y){}},w6Q=function(){this.X=new yH},uO=function(n,q,M){return M&&M.bX?M.bX[n]||q:q},ziG=function(n){this.Z=[]; this.O9=this.TX=this.SX=this.Kd=this.X=this.K8=this.IL=this.nm=this.N=this.uG=this.U=null;this.L9=this.hE=0;this.YB=uO("failFast",!1,n);this.AE=this.xl=this.B=this.C=this.S=null;this.yS=!0;this.Wm=this.V1=-1;this.Yi=this.RL=this.wJ=0;this.SR=uO("baseRetryDelayMs",5E3,n);this.VA=uO("retryDelaySeedMs",1E4,n);this.NV=uO("forwardChannelMaxRetries",2,n);this.cn=uO("forwardChannelRequestTimeoutMs",2E4,n);this.rZ=n&&n.rvy||void 0;this.Ku=n&&n.SWy||void 0;this.uI=n&&n.ilE||!1;this.Yl=void 0;this.rJ=n&&n.MCs|| !1;this.J="";this.W=new Fud(n&&n.beJ);this.Z6=new w6Q;this.QS=n&&n.rzx||!1;this.Ux=n&&n.jFg||!1;this.QS&&this.Ux&&(this.Ux=!1);this.h1=n&&n.yim||!1;n&&n.Azd&&(this.yS=!1);this.JQ=!this.QS&&this.yS&&n&&n.Max||!1;this.Kn=void 0;n&&n.J8&&n.J8>0&&(this.Kn=n.J8);this.Wg=void 0;this.o8=0;this.eX=!1;this.Fh=this.jX=null},vv=function(n){n.X&&(JxL(n),n.X.cancel(),n.X=null)},VtD=function(n){vv(n); n.B&&(g.pa.clearTimeout(n.B),n.B=null);Pv(n);n.W.cancel();n.C&&(typeof n.C==="number"&&g.pa.clearTimeout(n.C),n.C=null)},lO=function(n){ZMs(n.W)||n.C||(n.C=!0,g.L1(n.r0,n),n.wJ=0)},rxw=function(n,q){if(UHd(n.W)>=n.W.J-(n.C?1:0))return!1; if(n.C)return n.Z=q.RL.concat(n.Z),!0;if(n.vH==1||n.vH==2||n.wJ>=(n.YB?0:n.NV))return!1;n.C=ju((0,g.bn)(n.r0,n,q),CQG(n,n.wJ));n.wJ++;return!0},Qan=function(n,q){var M; q?M=q.O9:M=n.hE++;var t=n.SX.clone();g.bM(t,"SID",n.J);g.bM(t,"RID",M);g.bM(t,"AID",n.V1);Bv(n,t);n.N&&n.U&&g.gE(t,n.N,n.U);M=new IH(n,n.J,M,n.wJ+1);n.N===null&&(M.SX=n.U);q&&(n.Z=q.RL.concat(n.Z));q=xHd(n,M,1E3);M.setTimeout(Math.round(n.cn*.5)+Math.round(n.cn*.5*Math.random()));u0Q(n.W,M);saF(M,t,q)},Bv=function(n,q){n.nm&&g.n3(n.nm,function(M,t){g.bM(q,t,M)}); n.S&&g.n3({},function(M,t){g.bM(q,t,M)})},xHd=function(n,q,M){M=Math.min(n.Z.length,M); var t=n.S?(0,g.bn)(n.S.V8,n.S,n):null;a:{for(var c=n.Z,Y=-1;;){var G=["count="+M];Y==-1?M>0?(Y=c[0].X,G.push("ofs="+Y)):Y=0:G.push("ofs="+Y);for(var k=!0,b=0;b=3)return!1; n.Yi++;n.B=ju((0,g.bn)(n.lc,n),CQG(n,n.RL));n.RL++;return!0},JxL=function(n){n.jX!=null&&(g.pa.clearTimeout(n.jX),n.jX=null)},p6d=function(n){n.X=new IH(n,n.J,"rpc",n.Yi); n.N===null&&(n.X.SX=n.U);n.X.Yl=0;var q=n.TX.clone();g.bM(q,"RID","rpc");g.bM(q,"SID",n.J);g.bM(q,"AID",n.V1);g.bM(q,"CI",n.AE?"0":"1");!n.AE&&n.Kn&&g.bM(q,"TO",n.Kn);g.bM(q,"TYPE","xmlhttp");Bv(n,q);n.N&&n.U&&g.gE(q,n.N,n.U);n.Yl&&n.X.setTimeout(n.Yl);var M=n.X;n=n.O9;M.rJ=1;M.B=pG(q.clone());M.U=null;M.IL=!0;yxO(M,n)},Pv=function(n){n.xl!=null&&(g.pa.clearTimeout(n.xl),n.xl=null)},vcK=function(n,q){var M=null; if(n.X==q){Pv(n);JxL(n);n.X=null;var t=2}else if(TzT(n.W,q))M=q.RL,DHQ(n.W,q),t=1;else return;if(n.vH!=0)if(q.C)if(t==1){M=q.U?q.U.length:0;q=Date.now()-q.wJ;var c=n.wJ;t=gcQ();t.dispatchEvent(new hiT(t,M,q,c));lO(n)}else AxS(n);else{var Y=q.Wg;c=q.getLastError();if(c==3||c==0&&Y>0||!(t==1&&rxw(n,q)||t==2&&lgL(n)))switch(M&&M.length>0&&(q=n.W,q.Z=q.Z.concat(M)),c){case 1:Tu(n,5);break;case 4:Tu(n,10);break;case 3:Tu(n,6);break;default:Tu(n,2)}}},CQG=function(n,q){var M=n.SR+Math.floor(Math.random()* n.VA); n.isActive()||(M*=2);return M*q},Tu=function(n,q){if(q==2){var M=(0,g.bn)(n.wHL,n),t=n.Ku,c=!t; t=new g.Mb(t||"//www.google.com/images/cleardot.gif");g.pa.location&&g.pa.location.protocol=="http"||g.iM(t,"https");pG(t);c?RiS(t.toString(),M):ocS(t.toString(),M)}else XI(2);n.vH=0;n.S&&n.S.Ab(q);nTF(n);VtD(n)},nTF=function(n){n.vH=0; n.Fh=[];if(n.S){var q=agw(n.W);if(q.length!=0||n.Z.length!=0)g.Bs(n.Fh,q),g.Bs(n.Fh,n.Z),n.W.Z.length=0,g.un(n.Z),n.Z.length=0;n.S.Dj()}},qYK=function(n){if(n.vH==0)return n.Fh; var q=[];g.Bs(q,agw(n.W));g.Bs(q,n.Z);return q},BzF=function(n,q,M){var t=g.dE(M); t.X!=""?(q&&g.td(t,q+"."+t.X),g.cC(t,t.Z)):(t=g.pa.location,t=Ygs(t.protocol,q?q+"."+t.hostname:t.hostname,+t.port,M));q=n.IL;M=n.K8;q&&M&&g.bM(t,q,M);g.bM(t,"VER",n.q5);Bv(n,t);return t},X6d=function(n,q,M){if(q&&!n.rJ)throw Error("Can't create secondary domain capable XhrIo object."); q=n.uI&&!n.rZ?new g.wM(new g.Qa({xA:M})):new g.wM(n.rZ);q.N=n.rJ;return q},M7Q=function(){},iEG=function(){},AZ=function(n,q){g.Ne.call(this); this.X=new ziG(q);this.S=n;this.W=q&&q.Ldt||null;n=q&&q.egk||null;q&&q.BCk&&(n?n["X-Client-Protocol"]="webchannel":n={"X-Client-Protocol":"webchannel"});this.X.U=n;n=q&&q.EzE||null;q&&q.n7&&(n?n["X-WebChannel-Content-Type"]=q.n7:n={"X-WebChannel-Content-Type":q.n7});q&&q.EF&&(n?n["X-WebChannel-Client-Profile"]=q.EF:n={"X-WebChannel-Client-Profile":q.EF});this.X.uG=n;(n=q&&q.Lrk)&&!g.UC(n)&&(this.X.N=n);this.C=q&&q.MCs||!1;this.J=q&&q.eok||!1;(q=q&&q.e4)&&!g.UC(q)&&(this.X.IL=q,g.d0(this.W,q)&&(n= this.W,q in n&&delete n[q]));this.Z=new Db(this)},t7K=function(n){dHs.call(this); n.__headers__&&(this.headers=n.__headers__,this.statusCode=n.__status__,delete n.__headers__,delete n.__status__);var q=n.__sm__;q?this.data=(this.X=g.tf(q))?g.eL(q,this.X):q:this.data=n},cWs=function(n){NzT.call(this); this.status=1;this.errorCode=n},Db=function(n){this.X=n},YYT=function(n,q){this.W=n; this.X=q},Gqd=function(n){return qYK(n.X).map(function(q){var M=n.W; q=q.map;"__data__"in q?(q=q.__data__,M=M.J?QNG(q):q):M=q;return M})},mn=function(n,q){if(typeof n!=="function")throw Error("Fn must not be null and must be a function"); return g.pa.setTimeout(function(){n()},q)},FI=function(n){$I.dispatchEvent(new K8F($I,n))},K8F=function(n){g.zv.call(this,"statevent",n)},Zb=function(n,q,M,t){this.X=n; this.J=q;this.N=M;this.C=t||1;this.W=45E3;this.Z=new g.ew(this);this.S=new g.Ab;this.S.setInterval(250)},bEA=function(n,q,M){n.jx=1; n.bE=pG(q.clone());n.o3=M;n.IL=!0;kqd(n,null)},d2O=function(n,q,M,t,c){n.jx=1; n.bE=pG(q.clone());n.o3=null;n.IL=M;c&&(n.fz=!1);kqd(n,t)},kqd=function(n,q){n.kK=Date.now(); Nws(n);n.FP=n.bE.clone();nJ(n.FP,"t",n.C);n.aY=0;n.a9=n.X.KV(n.X.Qj()?q:null);n.VY>0&&(n.IY=new g.rE((0,g.bn)(n.mQ,n,n.a9),n.VY));n.Z.listen(n.a9,"readystatechange",n.y8);q=n.DE?g.hf(n.DE):{};n.o3?(n.dc="POST",q["Content-Type"]="application/x-www-form-urlencoded",n.a9.send(n.FP,n.dc,n.o3,q)):(n.dc="GET",n.fz&&!g.dK&&(q.Connection="close"),n.a9.send(n.FP,n.dc,null,q));n.X.Jf(1)},eys=function(n,q){var M=n.aY,t=q.indexOf("\n",M); if(t==-1)return OET;M=Number(q.substring(M,t));if(isNaN(M))return gTG;t+=1;if(t+M>q.length)return OET;q=q.slice(t,t+M);n.aY=t+M;return q},Nws=function(n){n.hp=Date.now()+n.W; ETs(n,n.W)},ETs=function(n,q){if(n.XQ!=null)throw Error("WatchDog timer not null"); n.XQ=mn((0,g.bn)(n.K$,n),q)},hyF=function(n){n.XQ&&(g.pa.clearTimeout(n.XQ),n.XQ=null)},W8T=function(n){n.X.vI()||n.cE||n.X.HC(n)},aH=function(n){hyF(n); g.iz(n.IY);n.IY=null;n.S.stop();n.Z.removeAll();if(n.a9){var q=n.a9;n.a9=null;q.abort();q.dispose()}n.rD&&(n.rD=null)},yWd=function(n,q){try{n.X.P1(n,q),n.X.Jf(4)}catch(M){}},X9S=function(n,q,M,t,c){if(t==0)M(!1); else{var Y=c||0;t--;skF(n,q,function(G){G?M(!0):g.pa.setTimeout(function(){X9S(n,q,M,t,Y)},Y)})}},skF=function(n,q,M){var t=new Image; t.onload=function(){try{RH(t),M(!0)}catch(c){}}; t.onerror=function(){try{RH(t),M(!1)}catch(c){}}; t.onabort=function(){try{RH(t),M(!1)}catch(c){}}; t.ontimeout=function(){try{RH(t),M(!1)}catch(c){}}; g.pa.setTimeout(function(){if(t.ontimeout)t.ontimeout()},q); t.src=n},RH=function(n){n.onload=null; n.onerror=null;n.onabort=null;n.ontimeout=null},jkO=function(n){this.X=n; this.W=new yH},SYF=function(n){var q=oH(n.X,n.eh,"/mail/images/cleardot.gif"); pG(q);X9S(q.toString(),5E3,(0,g.bn)(n.kD,n),3,2E3);n.Jf(1)},IEd=function(n){var q=n.X.C; q!=null?(FI(5),q?(FI(11),wx(n.X,n,!1)):(FI(12),wx(n.X,n,!0))):(n.j_=new Zb(n),n.j_.DE=n.yY,q=n.X,q=oH(q,q.Qj()?n.Sx:null,n.e6),FI(5),nJ(q,"TYPE","xmlhttp"),d2O(n.j_,q,!1,n.Sx,!1))},fEK=function(n,q,M){this.X=1; this.W=[];this.Z=[];this.S=new yH;this.U=n||null;this.C=q!=null?q:null;this.B=M||!1},HEs=function(n,q){this.X=n; this.map=q;this.context=null},L8w=function(n,q,M,t){g.zv.call(this,"timingevent",n); this.size=q;this.rtt=M;this.retries=t},PxK=function(n){g.zv.call(this,"serverreachability",n)},TwD=function(n){n.HP(1,0); n.zJ=oH(n,null,n.Em);vTs(n)},lEL=function(n){n.gR&&(n.gR.abort(),n.gR=null); n.uS&&(n.uS.cancel(),n.uS=null);n.iM&&(g.pa.clearTimeout(n.iM),n.iM=null);zu(n);n.rT&&(n.rT.cancel(),n.rT=null);n.kz&&(g.pa.clearTimeout(n.kz),n.kz=null)},U2D=function(n,q){if(n.X==0)throw Error("Invalid operation: sending map when state is closed"); n.W.push(new HEs(n.eI++,q));n.X!=2&&n.X!=3||vTs(n)},utw=function(n){var q=0; n.uS&&q++;n.rT&&q++;return q},vTs=function(n){n.rT||n.kz||(n.kz=mn((0,g.bn)(n.N5,n),0),n.Wz=0)},AWO=function(n,q){if(n.X==1){if(!q){n.x7=Math.floor(Math.random()*1E5); q=n.x7++;var M=new Zb(n,"",q);M.DE=n.Wt;var t=BwG(n),c=n.zJ.clone();g.bM(c,"RID",q);g.bM(c,"CVER","1");JZ(n,c);bEA(M,c,t);n.rT=M;n.X=2}}else n.X==3&&(q?D2s(n,q):n.W.length==0||n.rT||D2s(n))},D2s=function(n,q){if(q)if(n.Co>6){n.W=n.Z.concat(n.W); n.Z.length=0;var M=n.x7-1;q=BwG(n)}else M=q.N,q=q.o3;else M=n.x7++,q=BwG(n);var t=n.zJ.clone();g.bM(t,"SID",n.J);g.bM(t,"RID",M);g.bM(t,"AID",n.uP);JZ(n,t);M=new Zb(n,n.J,M,n.Wz+1);M.DE=n.Wt;M.setTimeout(1E4+Math.round(1E4*Math.random()));n.rT=M;bEA(M,t,q)},JZ=function(n,q){n.QP&&(n=n.QP.H1())&&g.n3(n,function(M,t){g.bM(q,t,M)})},BwG=function(n){var q=Math.min(n.W.length,1E3),M=["count="+q]; if(n.Co>6&&q>0){var t=n.W[0].X;M.push("ofs="+t)}else t=0;for(var c={},Y=0;Y=3)return!1; n.N++;n.iM=mn((0,g.bn)(n.YU,n),$2F(n,n.R$));n.R$++;return!0},wx=function(n,q,M){n.FL=n.C==null?M:!n.C; n.rU=q.z9;n.B||TwD(n)},zu=function(n){n.mP!=null&&(g.pa.clearTimeout(n.mP),n.mP=null)},$2F=function(n,q){var M=5E3+Math.floor(Math.random()*1E4); n.isActive()||(M*=2);return M*q},VH=function(n,q){if(q==2||q==9){var M=null; n.QP&&(M=null);var t=(0,g.bn)(n.ZTX,n);M||(M=new g.Mb("//www.google.com/images/cleardot.gif"),pG(M));skF(M.toString(),1E4,t)}else FI(2);ZEA(n,q)},ZEA=function(n,q){n.X=0; n.QP&&n.QP.s4(q);aEF(n);lEL(n)},aEF=function(n){n.X=0; n.rU=-1;if(n.QP)if(n.Z.length==0&&n.W.length==0)n.QP.TH();else{var q=g.un(n.Z),M=g.un(n.W);n.Z.length=0;n.W.length=0;n.QP.TH(q,M)}},oH=function(n,q,M){var t=g.dE(M); if(t.X!="")q&&g.td(t,q+"."+t.X),g.cC(t,t.Z);else{var c=window.location;t=Ygs(c.protocol,q?q+"."+c.hostname:c.hostname,+c.port,M)}n.Mb&&g.n3(n.Mb,function(Y,G){g.bM(t,G,Y)}); g.bM(t,"VER",n.Co);JZ(n,t);return t},RyF=function(){},oTs=function(){this.X=[]; this.W=[]},w9s=function(n){g.zv.call(this,"channelMessage"); this.message=n},zyA=function(n){g.zv.call(this,"channelError"); this.error=n},JWD=function(n,q){this.action=n; this.params=q||{}},CJ=function(n,q){g.F.call(this); this.X=new g.zw(this.TZ1,0,this);g.Z(this,this.X);this.b$=5E3;this.W=0;if(typeof n==="function")q&&(n=(0,g.bn)(n,q));else if(n&&typeof n.handleEvent==="function")n=(0,g.bn)(n.handleEvent,n);else throw Error("Invalid listener argument");this.Z=n},V7K=function(n,q,M,t,c,Y,G,k,b,d,N,O,e,E){M=M===void 0?!1:M; t=t===void 0?function(){return""}:t; c=c===void 0?!1:c;Y=Y===void 0?!1:Y;G=G===void 0?!1:G;k=k===void 0?function(){return g.lg({})}:k; b=b===void 0?!1:b;N=N===void 0?!1:N;O=O===void 0?!1:O;e=e===void 0?!1:e;E=E===void 0?!1:E;this.rJ=n;this.xl=q;this.C=new g.jA;this.W=new CJ(this.IUx,this);this.X=null;this.N=!1;this.U=null;this.wJ="";this.RL=this.B=0;this.Z=[];this.Fh=M;this.IL=t;this.S=Y;this.SX=k;this.nm=d;this.Yi=G;this.jX=null;this.J=g.lg();this.O9=c;this.uG=b;this.QS=N;this.Ux=O;this.Kd=e;this.Wg=E;this.Yl=new pkO;this.AE=new njA;this.eX=new Mod;this.hE=new qgF;this.V1=new iLn;this.yS=new tos;this.JQ=new cJs},x2F=function(n, q,M,t,c){Cxd(n); if(n.X){var Y=g.RZ("ID_TOKEN"),G=n.X.Wt||{};Y?G["x-youtube-identity-token"]=Y:delete G["x-youtube-identity-token"];n.X.Wt=G}rWK(n);t?(t.getState()!=3&&utw(t)==0||t.getState(),n.X.connect(q,M,n.xl,t.J,t.uP)):c?n.X.connect(q,M,n.xl,c.sessionId,c.arrayId):n.X.connect(q,M,n.xl)},qcS=function(n,q){return n.Kd?!0:n.Ux?Object.values(QkL).includes(q):n.QS?!Object.values(p9n).includes(q):n.Wg?Object.values(nHn).includes(q):!1},tzQ=function(n){var q,M; g.u(function(t){if(t.X==1)return g.fa(t,2),g.U(t,MzF(n),2);g.Bd(t);q=n.Z;n.Z=[];M=q.length;iBK(n,q,M);rx(n);return g.Ds(t,0)})},iBK=function(n,q,M){for(var t=0;t0?M=Object.assign({},M,q):delete M.Authorization;n.X.Wt=M}},rWK=function(n){n.nm&&!n.S&&YcA(n,n.nm())},xI=function(n){this.scheme="https"; this.port=this.domain="";this.X="/api/lounge";this.W=!0;n=n||document.location.href;var q=Number(g.kO(n)[4]||null)||"";q&&(this.port=":"+q);this.domain=g.bm(n)||"";n=g.FV();n.search("MSIE")>=0&&(n=n.match(/MSIE ([\d.]+)/)[1],g.$u(n,"10.0")<0&&(this.W=!1))},QH=function(n,q){var M=n.X; n.W&&(M=n.scheme+"://"+n.domain+n.port+n.X);return g.hC(M+q,{})},GEw=function(n,q){g.Ne.call(this); var M=this;this.handler=n();this.handler.subscribe("handlerOpened",this.E8,this);this.handler.subscribe("handlerClosed",this.onClosed,this);this.handler.subscribe("handlerError",function(t,c){M.onError(c)}); this.handler.subscribe("handlerMessage",this.onMessage,this);this.X=q},KHK=function(n,q,M){var t=this; M=M===void 0?function(){return""}:M; var c=c===void 0?new iEG:c;var Y=Y===void 0?new g.jA:Y;this.pathPrefix=n;this.X=q;this.wJ=M;this.S=Y;this.B=null;this.U=this.N=0;this.channel=null;this.C=0;this.Z=new CJ(function(){t.Z.isActive();var G;((G=t.channel)==null?void 0:UHd((new YYT(G,G.X)).X.W))===0&&t.connect(t.B,t.N)}); this.J={};this.W={};this.xl=!1;this.logger=null;this.RL=[];this.YM=void 0;this.SX=new pkO;this.jX=new njA;this.nm=new qgF;this.IL=new iLn},kEF=function(n){g.n1(n.channel,"m",function(){n.C=3; n.Z.reset();n.B=null;n.N=0;for(var q=g.S(n.RL),M=q.next();!M.done;M=q.next())M=M.value,n.channel&&n.channel.send(M);n.RL=[];n.publish("webChannelOpened");n.SX.eR("WEB_CHANNEL")}); g.n1(n.channel,"n",function(){n.C=0;n.Z.isActive()||n.publish("webChannelClosed");var q,M=(q=n.channel)==null?void 0:Gqd(new YYT(q,q.X));M&&(n.RL=[].concat(g.EJ(M)));n.jX.eR("WEB_CHANNEL")}); g.n1(n.channel,"p",function(q){var M=q.data;M[0]==="gracefulReconnect"?(n.Z.start(),n.channel&&n.channel.close()):n.publish("webChannelMessage",new JWD(M[0],M[1]));n.YM=q.statusCode;n.nm.eR("WEB_CHANNEL")}); g.n1(n.channel,"o",function(){n.YM===401||n.Z.start();n.publish("webChannelError");n.IL.eR("WEB_CHANNEL","")})},bBn=function(n){var q=n.wJ(); q?n.J["x-youtube-lounge-xsrf-token"]=q:delete n.J["x-youtube-lounge-xsrf-token"]},diS=function(n){g.Ne.call(this); this.X=n();this.X.subscribe("webChannelOpened",this.Tl,this);this.X.subscribe("webChannelClosed",this.onClosed,this);this.X.subscribe("webChannelError",this.onError,this);this.X.subscribe("webChannelMessage",this.onMessage,this)},NBO=function(n,q,M,t,c){function Y(){return new V7K(QH(n,"/bc"),q,!1,M,t)} M=M===void 0?function(){return""}:M; return g.EH("enable_mdx_web_channel_desktop")?new diS(function(){return new KHK(QH(n,"/wc"),q,M)}):new GEw(Y,c)},EHO=function(){var n=OBd; gHQ();pJ.push(n);eIQ()},nZ=function(n,q){gHQ(); var M=hIn(n,String(q));pJ.length==0?WHK(M):(eIQ(),g.xw(pJ,function(t){t(M)}))},qr=function(n){nZ("CP",n)},gHQ=function(){pJ||(pJ=g.qD("yt.mdx.remote.debug.handlers_")||[],g.nQ("yt.mdx.remote.debug.handlers_",pJ))},WHK=function(n){var q=(Mr+1)%50; Mr=q;i5[q]=n;tR||(tR=q==49)},eIQ=function(){var n=pJ; if(i5[0]){var q=tR?Mr:-1,M={};do M={Q_:void 0},q=(q+1)%50,M.Q_=i5[q],g.xw(n,function(t){return function(c){c(t.Q_)}}(M)); while(q!=Mr);i5=Array(50);Mr=-1;tR=!1}},hIn=function(n,q){var M=(Date.now()-yYA)/1E3; M.toFixed&&(M=M.toFixed(3));var t=[];t.push("[",M+"s","] ");t.push("[","yt.mdx.remote","] ");t.push(n+": "+q,"\n");return t.join("")},cx=function(n){g.MB.call(this); this.C=n;this.screens=[]},srw=function(n,q){var M=n.get(q.uuid)||n.get(q.id); if(M)return n=M.name,M.id=q.id||M.id,M.name=q.name,M.token=q.token,M.uuid=q.uuid||M.uuid,M.name!=n;n.screens.push(q);return!0},XhK=function(n,q){var M=n.screens.length!=q.length; n.screens=g.Pl(n.screens,function(Y){return!!FAF(q,Y)}); for(var t=q.length,c=0;c0&&n.J0&&yk(n,M)},function(q){n.S=function(){}; n.VH(q)})},xid=function(n){var q={}; q.pairingCode=n.jX;q.theme=n.rJ;xyG()&&(q.env_useStageMdx=1);return g.Eu(q)},QrO=function(n){return new Promise(function(q){n.jX=myd(); if(n.SX){var M=new chrome.cast.DialLaunchResponse(!0,xid(n));q(M);rYT(n)}else n.xl=function(){g.Ns(n.U);n.xl=function(){}; n.U=NaN;var t=new chrome.cast.DialLaunchResponse(!0,xid(n));q(t);rYT(n)},n.U=g.bl(function(){n.xl()},100)})},n7K=function(n,q,M){n.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(q)); var t=new Gu(q);return(new Promise(function(c){phQ(n,t,function(Y){Y?(n.RL=!0,da(n.J,t),Os(n,t),yk(n,M)):g.z7(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(q)+" is not online."));c(Y)},5)})).then(function(c){return c?new chrome.cast.DialLaunchResponse(!1):QrO(n)})},qys=function(n,q){var M=n.B.receiver.label,t=n.W.friendlyName; return(new Promise(function(c){uvd(n.J,M,q,t,function(Y){Y&&Y.token&&Os(n,Y);c(Y)},function(Y){eM(n,"Failed to get DIAL screen: "+Y); c(null)})})).then(function(c){return c&&c.token?new chrome.cast.DialLaunchResponse(!1):QrO(n)})},phQ=function(n,q,M,t){g.Ns(n.C); n.C=0;Din(n.J,q,function(c){c||t<0?M(c):n.C=g.bl(function(){phQ(n,q,M,t-1)},300)})},yk=function(n,q){n.info("getDialAppInfoWithTimeout_ "+q); Wx(n)&&(g.Ns(n.N),n.N=0,q==0?MsG(n):n.N=g.bl(function(){MsG(n)},q))},MsG=function(n){Wx(n)&&n.Z.getDialAppInfo(function(q){n.info("getDialAppInfo dialLaunchData: "+JSON.stringify(q)); q=q.extraData||{};var M=null;if(q.loungeToken){var t;((t=n.X)==null?void 0:t.token)==q.loungeToken&&(M="staleLoungeToken")}else M="missingLoungeToken";M?(n.wJ=M,yk(n,3E4)):(n.RL=!1,n.wJ="unknown",FHF(n,q.loungeToken),yk(n,q.loungeTokenRefreshIntervalMs))},function(q){n.info("getDialAppInfo error: "+q); n.wJ="noLoungeTokenResponse";yk(n,3E4)})},iyD=function(n){g.Ns(n.C); n.C=0;g.Ns(n.N);n.N=0;n.S();n.S=function(){}; g.Ns(n.U)},Xo=function(n,q){Nr.call(this,n,q,"ManualSession"); this.Z=g.bl((0,g.bn)(this.TM,this,null),150)},jM=function(n,q){g.MB.call(this); this.config_=q;this.W=n;this.B=q.appId||"233637DE";this.J=q.theme||"cl";this.U=q.disableCastApi||!1;this.C=q.forceMirroring||!1;this.X=null;this.N=!1;this.Z=[];this.S=(0,g.bn)(this.Jgx,this)},tsd=function(n,q){return q?g.XO(n.Z,function(M){return KJ(q,M.label)},n):null},SM=function(n){nZ("Controller",n)},OBd=function(n){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(n)},I3=function(n){return n.N||!!n.Z.length||!!n.X},fZ=function(n,q,M){q!=n.X&&(g.iz(n.X),(n.X=q)?(M?n.publish("yt-remote-cast2-receiver-resumed", q.W):n.publish("yt-remote-cast2-receiver-selected",q.W),q.subscribe("sessionScreen",(0,g.bn)(n.zW,n,q)),q.subscribe("sessionFailed",function(){return cqn(n,q)}),q.X?n.publish("yt-remote-cast2-session-change",q.X):M&&n.X.TM(null)):n.publish("yt-remote-cast2-session-change",null))},cqn=function(n,q){n.X==q&&n.publish("yt-remote-cast2-session-failed")},YyD=function(n){var q=n.W.e1(),M=n.X&&n.X.W; n=g.Wn(q,function(t){M&&KJ(t,M.label)&&(M=null);var c=t.uuid?t.uuid:t.id,Y=tsd(this,t);Y?(Y.label=c,Y.friendlyName=t.name):(Y=new chrome.cast.Receiver(c,t.name),Y.receiverType=chrome.cast.ReceiverType.CUSTOM);return Y},n); M&&(M.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(M=new chrome.cast.Receiver(M.label,M.friendlyName),M.receiverType=chrome.cast.ReceiverType.CUSTOM),n.push(M));return n},g7n=function(n,q,M,t){t.disableCastApi?Hx("Cannot initialize because disabled by Mdx config."):GsS()?K9T(q,t)&&(ksD(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?bys(n,M):(window.__onGCastApiAvailable=function(c,Y){c?bys(n,M):(LZ("Failed to load cast API: "+Y),doL(!1),ksD(!1),g.TJ("yt-remote-cast-available"),g.TJ("yt-remote-cast-receiver"), New(),M(!1))},t.loadCastApiSetupScript?g.qi(Oys):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?pfG()>=60&&Kus():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?iMn():pfG()>=89?bMT():(GYA(),hZ(kYs.map(ttF))))):Hx("Cannot initialize because not running Chrome")},New=function(){Hx("dispose"); var n=Px();n&&n.dispose();g.nQ("yt.mdx.remote.cloudview.instance_",null);evQ(!1);g.pE(E7G);E7G.length=0},vx=function(){return!!g.vf("yt-remote-cast-installed")},hvT=function(){var n=g.vf("yt-remote-cast-receiver"); return n?n.friendlyName:null},W9s=function(){Hx("clearCurrentReceiver"); g.TJ("yt-remote-cast-receiver")},yqA=function(){return vx()?Px()?Px().getCastSession():(LZ("getCastSelector: Cast is not initialized."),null):(LZ("getCastSelector: Cast API is not installed!"),null)},s4Q=function(){vx()?Px()?TI()?(Hx("Requesting cast selector."),Px().requestSession()):(Hx("Wait for cast API to be ready to request the session."),E7G.push(g.Qd("yt-remote-cast2-api-ready",s4Q))):LZ("requestCastSelector: Cast is not initialized."):LZ("requestCastSelector: Cast API is not installed!")}, l5=function(n,q){TI()?Px().setConnectedScreenStatus(n,q):LZ("setConnectedScreenStatus called before ready.")},GsS=function(){var n=g.FV().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.Xq||n},XJF=function(n,q){Px().init(n,q)},K9T=function(n,q){var M=!1; Px()||(n=new jM(n,q),n.subscribe("yt-remote-cast2-availability-change",function(t){g.Pf("yt-remote-cast-available",t);eu("yt-remote-cast2-availability-change",t)}),n.subscribe("yt-remote-cast2-receiver-selected",function(t){Hx("onReceiverSelected: "+t.friendlyName); g.Pf("yt-remote-cast-receiver",t);eu("yt-remote-cast2-receiver-selected",t)}),n.subscribe("yt-remote-cast2-receiver-resumed",function(t){Hx("onReceiverResumed: "+t.friendlyName); g.Pf("yt-remote-cast-receiver",t);eu("yt-remote-cast2-receiver-resumed",t)}),n.subscribe("yt-remote-cast2-session-change",function(t){Hx("onSessionChange: "+kI(t)); t||g.TJ("yt-remote-cast-receiver");eu("yt-remote-cast2-session-change",t)}),g.nQ("yt.mdx.remote.cloudview.instance_",n),M=!0); Hx("cloudview.createSingleton_: "+M);return M},Px=function(){return g.qD("yt.mdx.remote.cloudview.instance_")},bys=function(n,q){doL(!0); ksD(!1);XJF(n,function(M){M?(evQ(!0),g.nB("yt-remote-cast2-api-ready")):(LZ("Failed to initialize cast API."),doL(!1),g.TJ("yt-remote-cast-available"),g.TJ("yt-remote-cast-receiver"),New());q(M)})},Hx=function(n){nZ("cloudview",n)},LZ=function(n){nZ("cloudview",n)},doL=function(n){Hx("setCastInstalled_ "+n); g.Pf("yt-remote-cast-installed",n)},TI=function(){return!!g.qD("yt.mdx.remote.cloudview.apiReady_")},evQ=function(n){Hx("setApiReady_ "+n); g.nQ("yt.mdx.remote.cloudview.apiReady_",n)},ksD=function(n){g.nQ("yt.mdx.remote.cloudview.initializing_",n)},Us=function(n){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.S=this.C=0;this.trackData=null;this.tI=this.Ra=!1;this.B=this.Z=this.N=this.W=0;this.X=NaN;this.J=!1;this.reset(n)},j4s=function(n){n.audioTrackId=null; n.trackData=null;n.playerState=-1;n.Ra=!1;n.tI=!1;n.C=0;n.S=g.OF();n.W=0;n.N=0;n.Z=0;n.B=0;n.X=NaN;n.J=!1},u5=function(n){return n.isPlaying()?(g.OF()-n.S)/1E3:0},Bx=function(n,q){n.C=q; n.S=g.OF()},DM=function(n){switch(n.playerState){case 1:case 1081:return(g.OF()-n.S)/1E3+n.C; case -1E3:return 0}return n.C},SyT=function(n){return n.J?n.N+u5(n):n.N},AR=function(n,q,M){var t=n.videoId; n.videoId=q;n.index=M;q!=t&&j4s(n)},INK=function(n){var q={}; q.index=n.index;q.listId=n.listId;q.videoId=n.videoId;q.playerState=n.playerState;q.volume=n.volume;q.muted=n.muted;q.audioTrackId=n.audioTrackId;q.trackData=g.W7(n.trackData);q.hasPrevious=n.Ra;q.hasNext=n.tI;q.playerTime=n.C;q.playerTimeAt=n.S;q.seekableStart=n.W;q.seekableEnd=n.N;q.duration=n.Z;q.loadedTime=n.B;q.liveIngestionTime=n.X;return q},$S=function(n,q){g.MB.call(this); var M=this;this.Z=0;this.J=n;this.C=[];this.S=new oTs;this.W=this.X=null;this.U=(0,g.bn)(this.nim,this);this.N=(0,g.bn)(this.Xa,this);this.B=(0,g.bn)(this.Gkm,this);this.xl=(0,g.bn)(this.lnm,this);var t=0;n?(t=n.getProxyState(),t!=3&&(n.subscribe("proxyStateChange",this.rf,this),fNw(this))):t=3;t!=0&&(q?this.rf(t):g.bl(function(){M.rf(t)},0)); (n=yqA())&&mL(this,n);this.subscribe("yt-remote-cast2-session-change",this.xl)},Fo=function(n){return new Us(n.J.getPlayerContextData())},fNw=function(n){g.xw("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(q){this.C.push(this.J.subscribe(q,g.dT(this.u_m,q),this))},n)},HyS=function(n){g.xw(n.C,function(q){this.J.unsubscribeByKey(q)},n); n.C.length=0},ZM=function(n){return n.getState()==1},a3=function(n,q){var M=n.S; M.X.length+M.W.length<50&&n.S.enqueue(q)},L9n=function(n,q,M){var t=Fo(n); Bx(t,M);t.playerState!=-1E3&&(t.playerState=q);R3(n,t)},o3=function(n,q,M){n.J.sendMessage(q,M)},R3=function(n,q){HyS(n); n.J.setPlayerContextData(INK(q));fNw(n)},mL=function(n,q){n.W&&(n.W.removeUpdateListener(n.U),n.W.removeMediaListener(n.N),n.Xa(null)); n.W=q;n.W&&(qr("Setting cast session: "+n.W.sessionId),n.W.addUpdateListener(n.U),n.W.addMediaListener(n.N),n.W.media.length&&n.Xa(n.W.media[0]))},PoO=function(n){var q=n.X.media,M=n.X.customData; if(q&&M){var t=Fo(n);q.contentId!=t.videoId&&qr("Cast changing video to: "+q.contentId);t.videoId=q.contentId;t.playerState=M.playerState;Bx(t,n.X.getEstimatedTime());R3(n,t)}else qr("No cast media video. Ignoring state update.")},wa=function(n,q,M){return(0,g.bn)(function(t){this.zy("Failed to "+q+" with cast v2 channel. Error code: "+t.code); t.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.zy("Retrying "+q+" using MDx browser channel."),o3(this,q,M))},n)},Vk=function(n,q,M,t){t=t===void 0?!1:t; g.MB.call(this);var c=this;this.C=NaN;this.jX=!1;this.U=this.B=this.RL=this.wJ=NaN;this.xl=[];this.S=this.N=this.J=this.X=this.W=null;this.SX=n;this.nm=t;this.xl.push(g.Wf(window,"beforeunload",function(){c.VR(2)})); this.Z=[];this.X=new Us;this.rJ=q.id;this.IL=q.idType;this.W=NBO(this.SX,M,this.B1,this.IL=="shortLived",this.rJ);this.W.listen("channelOpened",function(){v7S(c)}); this.W.listen("channelClosed",function(){zI("Channel closed");isNaN(c.C)?On(!0):On();c.dispose()}); this.W.listen("channelError",function(Y){On();isNaN(c.T2())?(Y==1&&c.IL=="shortLived"&&c.publish("browserChannelAuthError",Y),zI("Channel error: "+Y+" without reconnection"),c.dispose()):(c.jX=!0,zI("Channel error: "+Y+" with reconnection in "+c.T2()+" ms"),JR(c,2))}); this.W.listen("channelMessage",function(Y){TeL(c,Y)}); this.W.Yz(q.token);this.subscribe("remoteQueueChange",function(){var Y=c.X.videoId;g.lJ()&&g.Pf("yt-remote-session-video-id",Y)})},lNn=function(n){return g.XO(n.Z,function(q){return q.type=="LOUNGE_SCREEN"})},zI=function(n){nZ("conn",n)},JR=function(n,q){n.publish("proxyStateChange",q)},UoD=function(n){n.C=g.bl(function(){zI("Connecting timeout"); n.VR(1)},2E4)},u_Q=function(n){g.Ns(n.C); n.C=NaN},BeK=function(n){g.Ns(n.wJ); n.wJ=NaN},AqA=function(n){Dow(n); n.RL=g.bl(function(){CZ(n,"getNowPlaying")},2E4)},Dow=function(n){g.Ns(n.RL); n.RL=NaN},v7S=function(n){zI("Channel opened"); n.jX&&(n.jX=!1,BeK(n),n.wJ=g.bl(function(){zI("Timing out waiting for a screen.");n.VR(1)},15E3))},$oQ=function(n,q){var M=null; if(q){var t=lNn(n);t&&(M={clientName:t.clientName,deviceMake:t.brand,deviceModel:t.model,osVersion:t.osVersion})}g.nQ("yt.mdx.remote.remoteClient_",M);q&&(u_Q(n),BeK(n));M=n.W.XT()&&isNaN(n.C);q==M?q&&(JR(n,1),CZ(n,"getSubtitlesTrack")):q?(n.DS()&&n.X.reset(),JR(n,1),CZ(n,"getNowPlaying"),moG(n)):n.VR(1)},F9S=function(n,q){var M=q.params.videoId; delete q.params.videoId;M==n.X.videoId&&(g.g0(q.params)?n.X.trackData=null:n.X.trackData=q.params,n.publish("remotePlayerChange"))},ZyK=function(n,q,M){var t=q.params.videoId||q.params.video_id,c=parseInt(q.params.currentIndex,10); n.X.listId=q.params.listId||n.X.listId;AR(n.X,t,c);n.publish("remoteQueueChange",M)},Rvs=function(n,q){q.params=q.params||{}; ZyK(n,q,"NOW_PLAYING_MAY_CHANGE");aNs(n,q);n.publish("autoplayDismissed")},aNs=function(n,q){var M=parseInt(q.params.currentTime||q.params.current_time,10); Bx(n.X,isNaN(M)?0:M);M=parseInt(q.params.state,10);M=isNaN(M)?-1:M;M==-1&&n.X.playerState==-1E3&&(M=-1E3);n.X.playerState=M;M=Number(q.params.loadedTime);n.X.B=isNaN(M)?0:M;n.X.Bt(Number(q.params.duration));M=n.X;var t=Number(q.params.liveIngestionTime);M.X=t;M.J=isNaN(t)?!1:!0;M=n.X;t=Number(q.params.seekableStartTime);q=Number(q.params.seekableEndTime);M.W=isNaN(t)?0:t;M.N=isNaN(q)?0:q;n.X.playerState==1?AqA(n):Dow(n);n.publish("remotePlayerChange")},o7O=function(n,q){if(n.X.playerState!=-1E3){var M= 1085; switch(parseInt(q.params.adState,10)){case 1:M=1081;break;case 2:M=1084;break;case 0:M=1083}n.X.playerState=M;q=parseInt(q.params.currentTime,10);Bx(n.X,isNaN(q)?0:q);n.publish("remotePlayerChange")}},wJn=function(n,q){var M=q.params.muted=="true"; n.X.volume=parseInt(q.params.volume,10);n.X.muted=M;n.publish("remotePlayerChange")},zvw=function(n,q){n.N=q.params.videoId; n.publish("nowAutoplaying",parseInt(q.params.timeout,10))},Jqs=function(n,q){n.N=q.params.videoId||null; n.publish("autoplayUpNext",n.N)},VsG=function(n,q){n.S=q.params.autoplayMode; n.publish("autoplayModeChange",n.S);n.S=="DISABLED"&&n.publish("autoplayDismissed")},CoF=function(n,q){var M=q.params.hasNext=="true"; n.X.Ra=q.params.hasPrevious=="true";n.X.tI=M;n.publish("previousNextChange")},TeL=function(n,q){q=q.message; q.params?zI("Received: action="+q.action+", params="+g.a9(q.params)):zI("Received: action="+q.action+" {}");switch(q.action){case "loungeStatus":q=qz(q.params.devices);n.Z=g.Wn(q,function(t){return new YI(t)}); q=!!g.XO(n.Z,function(t){return t.type=="LOUNGE_SCREEN"}); $oQ(n,q);q=n.AT("mlm");n.publish("multiStateLoopEnabled",q);break;case "loungeScreenDisconnected":g.ln(n.Z,function(t){return t.type=="LOUNGE_SCREEN"}); $oQ(n,!1);break;case "remoteConnected":var M=new YI(qz(q.params.device));g.XO(n.Z,function(t){return t.equals(M)})||ClA(n.Z,M); break;case "remoteDisconnected":M=new YI(qz(q.params.device));g.ln(n.Z,function(t){return t.equals(M)}); break;case "gracefulDisconnect":break;case "playlistModified":ZyK(n,q,"QUEUE_MODIFIED");break;case "nowPlaying":Rvs(n,q);break;case "onStateChange":aNs(n,q);break;case "onAdStateChange":o7O(n,q);break;case "onVolumeChanged":wJn(n,q);break;case "onSubtitlesTrackChanged":F9S(n,q);break;case "nowAutoplaying":zvw(n,q);break;case "autoplayDismissed":n.publish("autoplayDismissed");break;case "autoplayUpNext":Jqs(n,q);break;case "onAutoplayModeChanged":VsG(n,q);break;case "onHasPreviousNextChanged":CoF(n, q);break;case "requestAssistedSignIn":n.publish("assistedSignInRequested",q.params.authCode);break;case "onLoopModeChanged":n.publish("loopModeChange",q.params.loopMode);break;default:zI("Unrecognized action: "+q.action)}},moG=function(n){g.Ns(n.U); n.U=g.bl(function(){n.VR(1)},864E5)},CZ=function(n,q,M){M?zI("Sending: action="+q+", params="+g.a9(M)):zI("Sending: action="+q); n.W.sendMessage(q,M)},rqs=function(n){cx.call(this,"ScreenServiceProxy"); this.SC=n;this.X=[];this.X.push(this.SC.$_s("screenChange",(0,g.bn)(this.XG,this)));this.X.push(this.SC.$_s("onlineScreenChange",(0,g.bn)(this.dnd,this)))},qms=function(n,q){rJL(); if(!gx||!gx.get("yt-remote-disable-remote-module-for-dev")){q=g.RZ("MDX_CONFIG")||q;ZLT();wfw();ra||(ra=new xI(q?q.loungeApiHost:void 0),xyG()&&(ra.X="/api/loungedev"));xS||(xS=g.qD("yt.mdx.remote.deferredProxies_")||[],g.nQ("yt.mdx.remote.deferredProxies_",xS));xoK();var M=Qk();if(!M){var t=new b5(ra,q?q.disableAutomaticScreenCache||!1:!1);g.nQ("yt.mdx.remote.screenService_",t);M=Qk();var c={};q&&(c={appId:q.appId,disableDial:q.disableDial,theme:q.theme,loadCastApiSetupScript:q.loadCastApiSetupScript, disableCastApi:q.disableCastApi,enableDialLoungeToken:q.enableDialLoungeToken,enableCastLoungeToken:q.enableCastLoungeToken,forceMirroring:q.forceMirroring});g.nQ("yt.mdx.remote.enableConnectWithInitialState_",q?q.enableConnectWithInitialState||!1:!1);g7n(n,t,function(Y){Y?pZ()&&l5(pZ(),"YouTube TV"):t.subscribe("onlineScreenChange",function(){eu("yt-remote-receiver-availability-change")})},c)}q&&!g.qD("yt.mdx.remote.initialized_")&&(g.nQ("yt.mdx.remote.initialized_",!0),n2("Initializing: "+g.a9(q)), qg.push(g.Qd("yt-remote-cast2-api-ready",function(){eu("yt-remote-api-ready")})),qg.push(g.Qd("yt-remote-cast2-availability-change",function(){eu("yt-remote-receiver-availability-change")})),qg.push(g.Qd("yt-remote-cast2-receiver-selected",function(){Mg(null); eu("yt-remote-auto-connect","cast-selector-receiver")})),qg.push(g.Qd("yt-remote-cast2-receiver-resumed",function(){eu("yt-remote-receiver-resumed","cast-selector-receiver")})),qg.push(g.Qd("yt-remote-cast2-session-change",Q4T)),qg.push(g.Qd("yt-remote-connection-change",function(Y){Y?l5(pZ(),"YouTube TV"):iF()||(l5(null,null),W9s())})),qg.push(g.Qd("yt-remote-cast2-session-failed",function(){eu("yt-remote-connection-failed")})),n=pJL(),q.isAuto&&(n.id+="#dial"),c=q.capabilities||[],c.length>0&&(n.capabilities= c),n.name=q.device,n.app=q.app,(q=q.theme)&&(n.theme=q),n2(" -- with channel params: "+g.a9(n)),n?(g.Pf("yt-remote-session-app",n.app),g.Pf("yt-remote-session-name",n.name)):(g.TJ("yt-remote-session-app"),g.TJ("yt-remote-session-name")),g.nQ("yt.mdx.remote.channelParams_",n),M.start(),pZ()||nRQ())}},Mds=function(){var n=Qk().SC.$_gos(); var q=tD();q&&cw()&&(FAF(n,q)||n.push(q));return $yK(n)},tds=function(){var n=i$K(); !n&&vx()&&hvT()&&(n={key:"cast-selector-receiver",name:hvT()});return n},i$K=function(){var n=Mds(),q=tD(); q||(q=iF());return g.XO(n,function(M){return q&&KJ(q,M.key)?!0:!1})},tD=function(){var n=pZ(); if(!n)return null;var q=Qk().m5();return bO(q,n)},Q4T=function(n){n2("remote.onCastSessionChange_: "+kI(n)); if(n){var q=tD();if(q&&q.id==n.id){if(l5(q.id,"YouTube TV"),n.idType=="shortLived"&&(n=n.token))Yf&&(Yf.token=n),(q=cw())&&q.Yz(n)}else q&&Gh(),K2(n,1)}else cw()&&Gh()},Gh=function(){TI()?Px().stopSession():LZ("stopSession called before API ready."); var n=cw();n&&(n.disconnect(1),caQ(null))},YmG=function(){var n=cw(); return!!n&&n.getProxyState()!=3},n2=function(n){nZ("remote",n)},Qk=function(){if(!G2A){var n=g.qD("yt.mdx.remote.screenService_"); G2A=n?new rqs(n):null}return G2A},pZ=function(){return g.qD("yt.mdx.remote.currentScreenId_")},KyT=function(n){g.nQ("yt.mdx.remote.currentScreenId_",n)},k2F=function(){return g.qD("yt.mdx.remote.connectData_")},Mg=function(n){g.nQ("yt.mdx.remote.connectData_",n)},cw=function(){return g.qD("yt.mdx.remote.connection_")},caQ=function(n){var q=cw(); Mg(null);n||KyT("");g.nQ("yt.mdx.remote.connection_",n);xS&&(g.xw(xS,function(M){M(n)}),xS.length=0); q&&!n?eu("yt-remote-connection-change",!1):!q&&n&&eu("yt-remote-connection-change",!0)},iF=function(){var n=g.lJ(); if(!n)return null;var q=Qk();if(!q)return null;q=q.m5();return bO(q,n)},K2=function(n,q){pZ(); tD()&&tD();if(kf)Yf=n;else{KyT(n.id);var M=g.qD("yt.mdx.remote.enableConnectWithInitialState_")||!1;n=new Vk(ra,n,pJL(),M);n.connect(q,k2F());n.subscribe("beforeDisconnect",function(t){eu("yt-remote-before-disconnect",t)}); n.subscribe("beforeDispose",function(){cw()&&(cw(),caQ(null))}); n.subscribe("browserChannelAuthError",function(){var t=tD();t&&t.idType=="shortLived"&&(TI()?Px().handleBrowserChannelAuthError():LZ("refreshLoungeToken called before API ready."))}); caQ(n)}},nRQ=function(){var n=iF(); n?(n2("Resume connection to: "+kI(n)),K2(n,0)):(On(),W9s(),n2("Skipping connecting because no session screen found."))},xoK=function(){var n=pJL(); if(g.g0(n)){n=Nz();var q=g.vf("yt-remote-session-name")||"",M=g.vf("yt-remote-session-app")||"";n={device:"REMOTE_CONTROL",id:n,name:q,app:M,mdxVersion:3};n.authuser=String(g.RZ("SESSION_INDEX","0"));(q=g.RZ("DELEGATED_SESSION_ID"))&&(n.pageId=String(q));g.nQ("yt.mdx.remote.channelParams_",n)}},pJL=function(){return g.qD("yt.mdx.remote.channelParams_")||{}},NWO=function(n,q,M){g.F.call(this); var t=this;this.X=n;this.G=q;this.bG=M;this.events=new g.f8(this);this.S=!1;this.C=new g.uN(64);this.W=new g.zw(this.UH,500,this);this.Z=new g.zw(this.BK,1E3,this);this.B=new Wv(this.OTs,0,this);this.J={};this.U=new g.zw(this.BY,1E3,this);this.N=new g.rE(this.seekTo,1E3,this);this.xl=this.events.V(this.G,"onVolumeChange",function(c){b$G(t,c)}); g.Z(this,this.events);this.events.V(q,"onCaptionsTrackListChanged",this.Q8t);this.events.V(q,"captionschanged",this.zHE);this.events.V(q,"captionssettingschanged",this.Z$);this.events.V(q,"videoplayerreset",this.lQ);this.events.V(q,"mdxautoplaycancel",function(){t.bG.qw()}); q.D("enable_mdx_video_play_directly")&&this.events.V(q,"videodatachange",function(){dBO(t.X)||bF(t)||d7(t,0)}); n=this.bG;n.qm();n.subscribe("proxyStateChange",this.dg,this);n.subscribe("remotePlayerChange",this.Jn,this);n.subscribe("remoteQueueChange",this.lQ,this);n.subscribe("previousNextChange",this.JJ,this);n.subscribe("nowAutoplaying",this.Xn,this);n.subscribe("autoplayDismissed",this.yN,this);g.Z(this,this.W);g.Z(this,this.Z);g.Z(this,this.B);g.Z(this,this.U);g.Z(this,this.N);this.Z$();this.lQ();this.Jn()},b$G=function(n,q){if(bF(n)){n.bG.unsubscribe("remotePlayerChange",n.Jn,n); var M=Math.round(q.volume);q=!!q.muted;var t=Fo(n.bG);if(M!==t.volume||q!==t.muted)n.bG.setVolume(M,q),n.U.start();n.bG.subscribe("remotePlayerChange",n.Jn,n)}},O$D=function(n){n.Oq(0); n.W.stop();n.Wn(new g.uN(64))},gRL=function(n,q){if(bF(n)&&!n.S){var M=null; q&&(M={style:n.G.getSubtitlesUserSettings()},Object.assign(M,q));n.bG.U4(n.G.getVideoData(1).videoId,M);n.J=Fo(n.bG).trackData}},d7=function(n,q){var M=n.G.getPlaylist(); if(M==null?0:M.listId){var t=M.index;var c=M.listId.toString()}M=n.G.getVideoData(1);n.bG.playVideo(M.videoId,q,t,c,M.playerParams,M.SX,V6T(M));n.Wn(new g.uN(1))},enF=function(n,q){if(q){var M=n.G.getOption("captions","tracklist",{dW:1}); M&&M.length?(n.G.setOption("captions","track",q),n.S=!1):(n.G.loadModule("captions"),n.S=!0)}else n.G.setOption("captions","track",{})},bF=function(n){return Fo(n.bG).videoId===n.G.getVideoData(1).videoId},ERK=function(n,q){g.zk.call(this,n); this.X=q},Ng=function(){g.w.call(this,{j:"div", Y:"ytp-mdx-popup-dialog",K:{role:"dialog"},L:[{j:"div",Y:"ytp-mdx-popup-dialog-inner-content",L:[{j:"div",Y:"ytp-mdx-popup-title",Wb:"Saliste de tu cuenta"},{j:"div",Y:"ytp-mdx-popup-description",Wb:"Es posible que los videos que mires se agreguen al historial de reproducciones de la TV, lo que puede influir en las recomendaciones. Para que esto no suceda, presiona \u201cCancelar\u201d y accede a YouTube desde tu computadora."},{j:"div",Y:"ytp-mdx-privacy-popup-buttons",L:[{j:"button",aL:["ytp-button", "ytp-mdx-privacy-popup-cancel"],Wb:"Cancelar"},{j:"button",aL:["ytp-button","ytp-mdx-privacy-popup-confirm"],Wb:"Confirmar"}]}]}]});this.fade=new g.QX(this,250);this.cancelButton=this.JE("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.JE("ytp-mdx-privacy-popup-confirm");g.Z(this,this.fade);this.V(this.cancelButton,"click",this.X);this.V(this.confirmButton,"click",this.W)},Oj=function(n){g.w.call(this,{j:"div", Y:"ytp-remote",L:[{j:"div",Y:"ytp-remote-display-status",L:[{j:"div",Y:"ytp-remote-display-status-icon",L:[g.NFk()]},{j:"div",Y:"ytp-remote-display-status-text",Wb:"{{statustext}}"}]}]});this.api=n;this.fade=new g.QX(this,250);g.Z(this,this.fade);this.V(n,"presentingplayerstatechange",this.onStateChange);this.Va(n.getPlayerStateObject())},g7=function(n,q){g.AH.call(this,"Reproducir en",1,n,q); this.G=n;this.sY={};this.V(n,"onMdxReceiversChange",this.W);this.V(n,"presentingplayerstatechange",this.W);this.W()},hnS=function(n){g.Ib.call(this,n); this.iT={key:myd(),name:"Esta computadora"};this.jK=null;this.subscriptions=[];this.m1=this.bG=null;this.sY=[this.iT];this.Sg=this.iT;this.TU=new g.uN(64);this.Vk=0;this.ag=-1;this.Da=!1;this.zp=this.fO=this.t$=null;if(!g.d1(this.player.T())&&!g.BD(this.player.T())){n=this.player;var q=g.mZ(n);q&&(q=q.Bk())&&(q=new g7(n,q),g.Z(this,q));q=new Oj(n);g.Z(this,q);g.qW(n,q.element,4);this.t$=new Ng;g.Z(this,this.t$);g.qW(n,this.t$.element,4);this.Da=!!iF()}},ev=function(n){n.fO&&(n.player.removeEventListener("presentingplayerstatechange", n.fO),n.fO=null)},Wys=function(n,q,M){n.TU=M; n.player.publish("presentingplayerstatechange",new g.kB(M,q))},Ej=function(n,q){if(q.key!==n.Sg.key)if(q.key===n.iT.key)Gh(); else if(dBO(n)&&yas(n),n.Sg=q,!g.BD(n.player.T())){var M=n.player.getPlaylistId();var t=n.player.getVideoData(1);var c=t.videoId;if(!M&&!c||(n.player.getAppState()===2||n.player.getAppState()===1)&&n.player.T().D("should_clear_video_data_on_player_cued_unstarted"))t=null;else{var Y=n.player.getPlaylist();if(Y){var G=[];for(var k=0;k2*this.size&&cv(this),!0):!1}; g.W.get=function(n,q){return iO(this.W,n)?this.W[n]:q}; g.W.set=function(n,q){iO(this.W,n)||(this.size+=1,this.X.push(n),this.gF++);this.W[n]=q}; g.W.forEach=function(n,q){for(var M=this.c$(),t=0;t=t.X.length)return g.bb;var Y=t.X[q++];return g.Is(n?Y:t.W[Y])}; return c}; var NFS={W4X:"atp",MbX:"ska",Gdb:"que",jw1:"mus",kdX:"sus",e7s:"dsp",szd:"seq",R$L:"mic",x91:"dpa",I81:"mlm",Qks:"dsdtr",npl:"ntb",y2s:"vsp",gbX:"scn",q2L:"rpe",biX:"dcn",c9g:"dcp",swm:"pas",krb:"drq",DK1:"opf",d9m:"els",jky:"isg",HxJ:"svq",FZk:"mvp",W8J:"ads",J2x:"stcp",ERd:"sads",vmE:"dloc",R7X:"dcw",Z_L:"asw",u7m:"apw",knJ:"pcw",C0t:"ipv"},OLQ={h_t:"u",r9d:"cl",YQ1:"k",uwg:"i",y9m:"cr",dKs:"m",Chk:"g",SW:"up"},QkL={aM:"adPlaying",ZK:"onAdStateChange"},p9n={l8m:"nowPlaying",opX:"onStateChange", aM:"adPlaying",ZK:"onAdStateChange",Wq:"nowPlayingShorts",wM:"onShortsStateChange"},nHn={Wq:"nowPlayingShorts",wM:"onShortsStateChange"};YI.prototype.equals=function(n){return n?this.id==n.id:!1}; var ojF="",gx=null;g.y(QEF,g.AB);var En,YlF=ncs("loadCastFramework")||ncs("loadCastApplicationFramework"),kYs=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.EF(Wv,g.F);g.W=Wv.prototype;g.W.PP=function(n){this.J=arguments;this.X=!1;this.Eq?this.Z=g.OF()+this.b$:this.Eq=g.m5(this.S,this.b$)}; g.W.stop=function(){this.Eq&&(g.pa.clearTimeout(this.Eq),this.Eq=null);this.Z=null;this.X=!1;this.J=[]}; g.W.pause=function(){++this.W}; g.W.resume=function(){this.W&&(--this.W,!this.W&&this.X&&(this.X=!1,this.C.apply(null,this.J)))}; g.W.ut=function(){this.stop();Wv.u7.ut.call(this)}; g.W.O8=function(){this.Eq&&(g.pa.clearTimeout(this.Eq),this.Eq=null);this.Z?(this.Eq=g.m5(this.S,this.Z-g.OF()),this.Z=null):this.W?this.X=!0:(this.X=!1,this.C.apply(null,this.J))};yH.prototype.stringify=function(n){return g.pa.JSON.stringify(n,void 0)}; yH.prototype.parse=function(n){return g.pa.JSON.parse(n,void 0)};g.EF(dHs,g.zv);g.EF(NzT,g.zv);var OMs=null;g.EF(eiQ,g.zv);g.EF(Ecd,g.zv);g.EF(hiT,g.zv);Su.prototype.debug=function(){}; Su.prototype.info=function(){}; Su.prototype.warning=function(){};var fgs={},IgA={};g.W=IH.prototype;g.W.setTimeout=function(n){this.eX=n}; g.W.NA=function(n){n=n.target;var q=this.V1;q&&g.Vc(n)==3?q.nh():this.Ge(n)}; g.W.Ge=function(n){try{if(n==this.X)a:{var q=g.Vc(this.X),M=this.X.W,t=this.X.getStatus();if(!(q<3)&&(q!=3||this.X&&(this.W.Z||g.rM(this.X)||g.x4(this.X)))){this.nm||q!=4||M==7||(M==8||t<=0?sn(3):sn(2));PQT(this);var c=this.X.getStatus();this.Wg=c;var Y=Sld(this);if(this.C=c==200){if(this.uG&&!this.AE){b:{if(this.X){var G=g.Qc(this.X,"X-HTTP-Initial-Response");if(G&&!g.UC(G)){var k=G;break b}}k=null}if(n=k)this.AE=!0,mHA(this,n);else{this.C=!1;this.S=3;XI(12);Hv(this);LJ(this);break a}}if(this.IL){n= !0;for(var b;!this.nm&&this.N0&&!this.Fh&&(this.Fh=!0,this.Z.sU(this)):(Hv(this),LJ(this))}else mHA(this,Y);q==4&&Hv(this);this.C&&!this.nm&&(q==4?vcK(this.Z,this):(this.C=!1,fJ(this)))}else g.Er_(this.X),c==400&&Y.indexOf("Unknown SID")> 0?(this.S=3,XI(12)):(this.S=0,XI(13)),Hv(this),LJ(this)}}}catch(d){}finally{}}; g.W.cancel=function(){this.nm=!0;Hv(this)}; g.W.Yq=function(){this.xl=null;var n=Date.now();n-this.Ux>=0?(this.rJ!=2&&(sn(3),XI(17)),Hv(this),this.S=2,LJ(this)):LuA(this,this.Ux-n)}; g.W.getLastError=function(){return this.S}; g.W.BQ=function(){return this.X};Fud.prototype.cancel=function(){this.Z=agw(this);if(this.W)this.W.cancel(),this.W=null;else if(this.X&&this.X.size!==0){for(var n=g.S(this.X.values()),q=n.next();!q.done;q=n.next())q.value.cancel();this.X.clear()}};g.W=ziG.prototype;g.W.q5=8;g.W.vH=1;g.W.connect=function(n,q,M,t){XI(0);this.Kd=n;this.nm=q||{};M&&t!==void 0&&(this.nm.OSID=M,this.nm.OAID=t);this.AE=this.yS;this.SX=BzF(this,null,this.Kd);lO(this)}; g.W.disconnect=function(){VtD(this);if(this.vH==3){var n=this.hE++,q=this.SX.clone();g.bM(q,"SID",this.J);g.bM(q,"RID",n);g.bM(q,"TYPE","terminate");Bv(this,q);n=new IH(this,this.J,n);n.rJ=2;n.B=pG(q.clone());q=!1;if(g.pa.navigator&&g.pa.navigator.sendBeacon)try{q=g.pa.navigator.sendBeacon(n.B.toString(),"")}catch(M){}!q&&g.pa.Image&&((new Image).src=n.B,q=!0);q||(n.X=X6d(n.Z,null),n.X.send(n.B));n.wJ=Date.now();fJ(n)}nTF(this)}; g.W.vI=function(){return this.vH==0}; g.W.getState=function(){return this.vH}; g.W.r0=function(n){if(this.C)if(this.C=null,this.vH==1){if(!n){this.hE=Math.floor(Math.random()*1E5);n=this.hE++;var q=new IH(this,"",n),M=this.U;this.uG&&(M?(M=g.hf(M),g.yn(M,this.uG)):M=this.uG);this.N!==null||this.Ux||(q.SX=M,M=null);var t;if(this.QS)a:{for(var c=t=0;c4096){t=c;break a}if(t===4096||c===this.Z.length-1){t=c+1;break a}}t= 1E3}else t=1E3;t=xHd(this,q,t);c=this.SX.clone();g.bM(c,"RID",n);g.bM(c,"CVER",22);this.IL&&g.bM(c,"X-HTTP-Session-Id",this.IL);Bv(this,c);M&&(this.Ux?t="headers="+g.Pg(g.ATd(M))+"&"+t:this.N&&g.gE(c,this.N,M));u0Q(this.W,q);this.h1&&g.bM(c,"TYPE","init");this.QS?(g.bM(c,"$req",t),g.bM(c,"SID","null"),q.uG=!0,saF(q,c,null)):saF(q,c,t);this.vH=2}}else this.vH==3&&(n?Qan(this,n):this.Z.length==0||ZMs(this.W)||Qan(this))}; g.W.lc=function(){this.B=null;p6d(this);if(this.JQ&&!(this.eX||this.X==null||this.o8<=0)){var n=4*this.o8;this.jX=ju((0,g.bn)(this.S9s,this),n)}}; g.W.S9s=function(){this.jX&&(this.jX=null,this.AE=!1,this.eX=!0,XI(10),vv(this),p6d(this))}; g.W.sU=function(n){this.X==n&&this.JQ&&!this.eX&&(JxL(this),this.eX=!0,XI(11))}; g.W.s8=function(){this.xl!=null&&(this.xl=null,vv(this),lgL(this),XI(19))}; g.W.wHL=function(n){n?XI(2):XI(1)}; g.W.isActive=function(){return!!this.S&&this.S.isActive(this)}; g.W=M7Q.prototype;g.W.Cr=function(){}; g.W.o4=function(){}; g.W.Ab=function(){}; g.W.Dj=function(){}; g.W.isActive=function(){return!0}; g.W.V8=function(){};g.EF(AZ,g.Ne);AZ.prototype.open=function(){this.X.S=this.Z;this.C&&(this.X.rJ=!0);this.X.connect(this.S,this.W||void 0)}; AZ.prototype.close=function(){this.X.disconnect()}; AZ.prototype.send=function(n){var q=this.X;if(typeof n==="string"){var M={};M.__data__=n;n=M}else this.J&&(M={},M.__data__=g.a9(n),n=M);q.Z.push(new $HQ(q.L9++,n));q.vH==3&&lO(q)}; AZ.prototype.ut=function(){this.X.S=null;delete this.Z;this.X.disconnect();delete this.X;AZ.u7.ut.call(this)}; g.EF(t7K,dHs);g.EF(cWs,NzT);g.EF(Db,M7Q);Db.prototype.Cr=function(){this.X.dispatchEvent("m")}; Db.prototype.o4=function(n){this.X.dispatchEvent(new t7K(n))}; Db.prototype.Ab=function(n){this.X.dispatchEvent(new cWs(n))}; Db.prototype.Dj=function(){this.X.dispatchEvent("n")}; YYT.prototype.commit=function(n){this.X.Wg=n};var $I=new g.Ne;g.y(K8F,g.zv);g.W=Zb.prototype;g.W.DE=null;g.W.vU=!1;g.W.XQ=null;g.W.hp=null;g.W.kK=null;g.W.jx=null;g.W.bE=null;g.W.FP=null;g.W.o3=null;g.W.a9=null;g.W.aY=0;g.W.rD=null;g.W.dc=null;g.W.Aj=null;g.W.vE=-1;g.W.fz=!0;g.W.cE=!1;g.W.VY=0;g.W.IY=null;var gTG={},OET={};g.W=Zb.prototype;g.W.setTimeout=function(n){this.W=n}; g.W.y8=function(n){n=n.target;var q=this.IY;q&&g.Vc(n)==3?q.nh():this.mQ(n)}; g.W.mQ=function(n){try{if(n==this.a9)a:{var q=g.Vc(this.a9),M=this.a9.W,t=this.a9.getStatus();if(g.dK&&!g.Zy("420+")){if(q<4)break a}else if(q<3||q==3&&!g.rM(this.a9))break a;this.cE||q!=4||M==7||(M==8||t<=0?this.X.Jf(3):this.X.Jf(2));hyF(this);var c=this.a9.getStatus();this.vE=c;var Y=g.rM(this.a9);if(this.vU=c==200){q==4&&aH(this);if(this.IL){for(n=!0;!this.cE&&this.aY0?(this.Aj=3,FI(13)):(this.Aj=0,FI(14)),aH(this),W8T(this)}}catch(k){}finally{}}; g.W.cancel=function(){this.cE=!0;aH(this)}; g.W.K$=function(){this.XQ=null;var n=Date.now();n-this.hp>=0?(this.jx!=2&&this.X.Jf(3),aH(this),this.Aj=2,FI(18),W8T(this)):ETs(this,this.hp-n)}; g.W.getLastError=function(){return this.Aj};g.W=jkO.prototype;g.W.yY=null;g.W.j_=null;g.W.kW=!1;g.W.e6=null;g.W.Rw=null;g.W.z9=-1;g.W.Sx=null;g.W.eh=null;g.W.connect=function(n){this.e6=n;n=oH(this.X,null,this.e6);FI(3);Date.now();var q=this.X.U;q!=null?(this.Sx=q[0],(this.eh=q[1])?(this.Rw=1,SYF(this)):(this.Rw=2,IEd(this))):(nJ(n,"MODE","init"),this.j_=new Zb(this),this.j_.DE=this.yY,d2O(this.j_,n,!1,null,!0),this.Rw=0)}; g.W.kD=function(n){if(n)this.Rw=2,IEd(this);else{FI(4);var q=this.X;q.rU=q.gR.z9;VH(q,9)}n&&this.Jf(2)}; g.W.KV=function(n){return this.X.KV(n)}; g.W.abort=function(){this.j_&&(this.j_.cancel(),this.j_=null);this.z9=-1}; g.W.vI=function(){return!1}; g.W.P1=function(n,q){this.z9=n.vE;if(this.Rw==0)if(q){try{var M=this.W.parse(q)}catch(t){n=this.X;n.rU=this.z9;VH(n,2);return}this.Sx=M[0];this.eh=M[1]}else n=this.X,n.rU=this.z9,VH(n,2);else this.Rw==2&&(this.kW?(FI(7),Date.now()):q=="11111"?(FI(6),this.kW=!0,Date.now(),this.z9=200,this.j_.cancel(),FI(12),wx(this.X,this,!0)):(FI(8),Date.now(),this.kW=!1))}; g.W.HC=function(){this.z9=this.j_.vE;if(this.j_.vU)this.Rw==0?this.eh?(this.Rw=1,SYF(this)):(this.Rw=2,IEd(this)):this.Rw==2&&(this.kW?(FI(12),wx(this.X,this,!0)):(FI(11),wx(this.X,this,!1)));else{this.Rw==0?FI(9):this.Rw==2&&FI(10);var n=this.X;this.j_.getLastError();n.rU=this.z9;VH(n,2)}}; g.W.Qj=function(){return this.X.Qj()}; g.W.isActive=function(){return this.X.isActive()}; g.W.Jf=function(n){this.X.Jf(n)};g.W=fEK.prototype;g.W.Wt=null;g.W.Mb=null;g.W.rT=null;g.W.uS=null;g.W.Em=null;g.W.zJ=null;g.W.O4=null;g.W.LV=null;g.W.x7=0;g.W.eI=0;g.W.QP=null;g.W.kz=null;g.W.iM=null;g.W.mP=null;g.W.gR=null;g.W.FL=null;g.W.uP=-1;g.W.tb=-1;g.W.rU=-1;g.W.Wz=0;g.W.R$=0;g.W.Co=8;var szK={OK:0,A4t:2,cI1:4,r_1:5,Vby:6,STOP:7,RE:8,J9s:9,u3t:10,weX:11,wkm:12};g.EF(L8w,g.zv);g.EF(PxK,g.zv);g.W=fEK.prototype; g.W.connect=function(n,q,M,t,c){FI(0);this.Em=q;this.Mb=M||{};t&&c!==void 0&&(this.Mb.OSID=t,this.Mb.OAID=c);this.B?(mn((0,g.bn)(this.kJ,this,n),100),TwD(this)):this.kJ(n)}; g.W.disconnect=function(){lEL(this);if(this.X==3){var n=this.x7++,q=this.zJ.clone();g.bM(q,"SID",this.J);g.bM(q,"RID",n);g.bM(q,"TYPE","terminate");JZ(this,q);n=new Zb(this,this.J,n);n.jx=2;n.bE=pG(q.clone());(new Image).src=n.bE.toString();n.kK=Date.now();Nws(n)}aEF(this)}; g.W.kJ=function(n){this.gR=new jkO(this);this.gR.yY=this.Wt;this.gR.W=this.S;this.gR.connect(n)}; g.W.vI=function(){return this.X==0}; g.W.getState=function(){return this.X}; g.W.N5=function(n){this.kz=null;AWO(this,n)}; g.W.YU=function(){this.iM=null;this.uS=new Zb(this,this.J,"rpc",this.N);this.uS.DE=this.Wt;this.uS.VY=0;var n=this.O4.clone();g.bM(n,"RID","rpc");g.bM(n,"SID",this.J);g.bM(n,"CI",this.FL?"0":"1");g.bM(n,"AID",this.uP);JZ(this,n);g.bM(n,"TYPE","xmlhttp");d2O(this.uS,n,!0,this.LV,!1)}; g.W.P1=function(n,q){if(this.X!=0&&(this.uS==n||this.rT==n))if(this.rU=n.vE,this.rT==n&&this.X==3)if(this.Co>7){try{var M=this.S.parse(q)}catch(t){M=null}if(Array.isArray(M)&&M.length==3)if(n=M,n[0]==0)a:{if(!this.iM){if(this.uS)if(this.uS.kK+3E30)){if(t=q==1)this.rT||this.kz||this.X==1||this.Wz>=2?t=!1:(this.kz=mn((0,g.bn)(this.N5,this,n),$2F(this,this.Wz)),this.Wz++, t=!0);t=!(t||q==2&&F8S(this))}if(t)switch(M){case 1:VH(this,5);break;case 4:VH(this,10);break;case 3:VH(this,6);break;case 7:VH(this,12);break;default:VH(this,2)}}}; g.W.HP=function(n){if(!g.SS(arguments,this.X))throw Error("Unexpected channel state: "+this.X);}; g.W.ZTX=function(n){n?FI(2):(FI(1),ZEA(this,8))}; g.W.KV=function(n){if(n)throw Error("Can't create secondary domain capable XhrIo object.");n=new g.wM;n.N=!1;return n}; g.W.isActive=function(){return!!this.QP&&this.QP.isActive(this)}; g.W.Jf=function(n){var q=$I;q.dispatchEvent(new PxK(q,n))}; g.W.Qj=function(){return!1}; g.W=RyF.prototype;g.W.Kr=function(){}; g.W.VT=function(){}; g.W.yT=function(){}; g.W.s4=function(){}; g.W.TH=function(){}; g.W.H1=function(){return{}}; g.W.isActive=function(){return!0};g.W=oTs.prototype;g.W.enqueue=function(n){this.W.push(n)}; g.W.isEmpty=function(){return this.X.length===0&&this.W.length===0}; g.W.clear=function(){this.X=[];this.W=[]}; g.W.contains=function(n){return g.SS(this.X,n)||g.SS(this.W,n)}; g.W.remove=function(n){var q=this.X;var M=(0,g.guG)(q,n);M>=0?(g.IG(q,M),q=!0):q=!1;return q||g.fQ(this.W,n)}; g.W.CL=function(){for(var n=[],q=this.X.length-1;q>=0;--q)n.push(this.X[q]);q=this.W.length;for(var M=0;M=X4s.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(n=X4s[this.W],this.Eq=g.bl((0,g.bn)(this.Lw,this),n),this.W++):this.publish("pairingFailed",Error("Server error "+n.status))}; g.W.bx=function(){this.X=null;this.publish("pairingFailed",Error("Server not responding"))}; var X4s=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.EF(GI,cx);g.W=GI.prototype;g.W.start=function(){YS(this)&&this.publish("screenChange");!g.vf("yt-remote-lounge-token-expiration")&&Idw(this);g.Ns(this.X);this.X=g.bl((0,g.bn)(this.start,this),1E4)}; g.W.add=function(n,q){YS(this);srw(this,n);KZ(this,!1);this.publish("screenChange");q(n);n.token||Idw(this)}; g.W.remove=function(n,q){var M=YS(this);jrw(this,n)&&(KZ(this,!1),M=!0);q(n);M&&this.publish("screenChange")}; g.W.pV=function(n,q,M,t){var c=YS(this),Y=this.get(n.id);Y?(Y.name!=q&&(Y.name=q,KZ(this,!1),c=!0),M(n)):t(Error("no such local screen."));c&&this.publish("screenChange")}; g.W.ut=function(){g.Ns(this.X);GI.u7.ut.call(this)}; g.W.gH=function(n){YS(this);var q=this.screens.length;n=n&&n.screens||[];for(var M=n.length,t=0;t20)break a;k=q(Y,G)}Y=k}c.name=Y}M(da(this,c))},this), onError:(0,g.bn)(function(c){t(Error("pairing request failed: "+c.status))},this), onTimeout:(0,g.bn)(function(){t(Error("pairing request timed out."))},this)})}; g.W.ut=function(){g.iz(this.W);g.iz(this.X);b5.u7.ut.call(this)}; g.W.fY=function(){AYn(this);this.publish("screenChange");this.X.update()}; b5.prototype.dispose=b5.prototype.dispose;g.EF(Nr,g.MB);g.W=Nr.prototype;g.W.VH=function(n){this.qm()||(n&&(eM(this,""+n),this.publish("sessionFailed")),this.X=null,this.publish("sessionScreen",null))}; g.W.info=function(n){nZ(this.IL,n)}; g.W.E4=function(){return null}; g.W.zN=function(n){var q=this.W;n?(q.displayStatus=new chrome.cast.ReceiverDisplayStatus(n,[]),q.displayStatus.showStop=!0):q.displayStatus=null;chrome.cast.setReceiverDisplayStatus(q,(0,g.bn)(function(){this.info("Updated receiver status for "+q.friendlyName+": "+n)},this),(0,g.bn)(function(){eM(this,"Failed to update receiver status for: "+q.friendlyName)},this))}; g.W.ut=function(){this.zN("");Nr.u7.ut.call(this)};g.y(Es,Nr);g.W=Es.prototype;g.W.aX=function(n){if(this.Z){if(this.Z==n)return;eM(this,"Overriding cast session with new session object");CaS(this);this.wJ=!1;this.U="unknown";this.Z.removeUpdateListener(this.RL);this.Z.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.jX)}this.Z=n;this.Z.addUpdateListener(this.RL);this.Z.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.jX);oHs(this,"getMdxSessionStatus")}; g.W.TM=function(n){this.info("launchWithParams no-op for Cast: "+g.a9(n))}; g.W.stop=function(){this.Z?this.Z.stop((0,g.bn)(function(){this.VH()},this),(0,g.bn)(function(){this.VH(Error("Failed to stop receiver app."))},this)):this.VH(Error("Stopping cast device without session."))}; g.W.zN=function(){}; g.W.ut=function(){this.info("disposeInternal");CaS(this);this.Z&&(this.Z.removeUpdateListener(this.RL),this.Z.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.jX));this.Z=null;Nr.prototype.ut.call(this)}; g.W.umm=function(n,q){if(!this.qm())if(q)if(q=qz(q),g.Yw(q))switch(n=""+q.type,q=q.data||{},this.info("onYoutubeMessage_: "+n+" "+g.a9(q)),n){case "mdxSessionStatus":ZBs(this,q);break;case "loungeToken":whS(this,q);break;default:eM(this,"Unknown youtube message: "+n)}else eM(this,"Unable to parse message.");else eM(this,"No data in message.")}; g.W.tW=function(n,q,M,t){g.Ns(this.B);this.B=0;uvd(this.J,this.W.label,n,this.W.friendlyName,(0,g.bn)(function(c){c?q(c):t>=0?(eM(this,"Screen "+n+" appears to be offline. "+t+" retries left."),this.B=g.bl((0,g.bn)(this.tW,this,n,q,M,t-1),300)):M(Error("Unable to fetch screen."))},this),M)}; g.W.E4=function(){return this.Z}; g.W.vP=function(n){this.qm()||n||(eM(this,"Cast session died."),this.VH())};g.y(hR,Nr);g.W=hR.prototype;g.W.aX=function(n){this.Z=n;this.Z.addUpdateListener(this.nm)}; g.W.TM=function(n){this.SX=n;this.xl()}; g.W.stop=function(){iyD(this);this.Z?this.Z.stop((0,g.bn)(this.VH,this,null),(0,g.bn)(this.VH,this,"Failed to stop DIAL device.")):this.VH()}; g.W.ut=function(){iyD(this);this.Z&&this.Z.removeUpdateListener(this.nm);this.Z=null;Nr.prototype.ut.call(this)}; g.W.kq=function(n){this.qm()||n||(eM(this,"DIAL session died."),this.S(),this.S=function(){},this.VH())};g.y(Xo,Nr);Xo.prototype.stop=function(){this.VH()}; Xo.prototype.aX=function(){}; Xo.prototype.TM=function(){g.Ns(this.Z);this.Z=NaN;var n=bO(this.J.m5(),this.W.label);n?Os(this,n):this.VH(Error("No such screen"))}; Xo.prototype.ut=function(){g.Ns(this.Z);this.Z=NaN;Nr.prototype.ut.call(this)};g.y(jM,g.MB);g.W=jM.prototype; g.W.init=function(n,q){chrome.cast.timeout.requestSession=3E4;var M=new chrome.cast.SessionRequest(this.B,[chrome.cast.Capability.AUDIO_OUT]);g.EH("desktop_enable_cast_connect")&&(M.androidReceiverCompatible=!0);this.U||(M.dialRequest=new chrome.cast.DialRequest("YouTube"));var t=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;n=n||this.C?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var c=(0,g.bn)(this.Fqg,this);M=new chrome.cast.ApiConfig(M,(0,g.bn)(this.aZ, this),c,t,n);M.customDialLaunchCallback=(0,g.bn)(this.Odk,this);chrome.cast.initialize(M,(0,g.bn)(function(){this.qm()||(chrome.cast.addReceiverActionListener(this.S),EHO(),this.W.subscribe("onlineScreenChange",(0,g.bn)(this.Te,this)),this.Z=YyD(this),chrome.cast.setCustomReceivers(this.Z,function(){},(0,g.bn)(function(Y){this.zy("Failed to set initial custom receivers: "+g.a9(Y))},this)),this.publish("yt-remote-cast2-availability-change",I3(this)),q(!0))},this),(0,g.bn)(function(Y){this.zy("Failed to initialize API: "+ g.a9(Y)); q(!1)},this))}; g.W.lUJ=function(n,q){SM("Setting connected screen ID: "+n+" -> "+q);if(this.X){var M=this.X.X;if(!n||M&&M.id!=n)SM("Unsetting old screen status: "+this.X.W.friendlyName),fZ(this,null)}if(n&&q){if(!this.X){n=bO(this.W.m5(),n);if(!n){SM("setConnectedScreenStatus: Unknown screen.");return}if(n.idType=="shortLived"){SM("setConnectedScreenStatus: Screen with id type to be short lived.");return}M=tsd(this,n);M||(SM("setConnectedScreenStatus: Connected receiver not custom..."),M=new chrome.cast.Receiver(n.uuid? n.uuid:n.id,n.name),M.receiverType=chrome.cast.ReceiverType.CUSTOM,this.Z.push(M),chrome.cast.setCustomReceivers(this.Z,function(){},(0,g.bn)(function(t){this.zy("Failed to set initial custom receivers: "+g.a9(t))},this))); SM("setConnectedScreenStatus: new active receiver: "+M.friendlyName);fZ(this,new Xo(this.W,M),!0)}this.X.zN(q)}else SM("setConnectedScreenStatus: no screen.")}; g.W.oMy=function(n){this.qm()?this.zy("Setting connection data on disposed cast v2"):this.X?this.X.TM(n):this.zy("Setting connection data without a session")}; g.W.Mt=function(){this.qm()?this.zy("Stopping session on disposed cast v2"):this.X?(this.X.stop(),fZ(this,null)):SM("Stopping non-existing session")}; g.W.requestSession=function(){chrome.cast.requestSession((0,g.bn)(this.aZ,this),(0,g.bn)(this.tGm,this))}; g.W.ut=function(){this.W.unsubscribe("onlineScreenChange",(0,g.bn)(this.Te,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.S);var n=OBd,q=g.qD("yt.mdx.remote.debug.handlers_");g.fQ(q||[],n);g.iz(this.X);g.MB.prototype.ut.call(this)}; g.W.zy=function(n){nZ("Controller",n)}; g.W.zW=function(n,q){this.X==n&&(q||fZ(this,null),this.publish("yt-remote-cast2-session-change",q))}; g.W.Jgx=function(n,q){if(!this.qm())if(n)switch(n.friendlyName=chrome.cast.unescape(n.friendlyName),SM("onReceiverAction_ "+n.label+" / "+n.friendlyName+"-- "+q),q){case chrome.cast.ReceiverAction.CAST:if(this.X)if(this.X.W.label!=n.label)SM("onReceiverAction_: Stopping active receiver: "+this.X.W.friendlyName),this.X.stop();else{SM("onReceiverAction_: Casting to active receiver.");this.X.X&&this.publish("yt-remote-cast2-session-change",this.X.X);break}switch(n.receiverType){case chrome.cast.ReceiverType.CUSTOM:fZ(this, new Xo(this.W,n));break;case chrome.cast.ReceiverType.DIAL:fZ(this,new hR(this.W,n,this.J,this.config_));break;case chrome.cast.ReceiverType.CAST:fZ(this,new Es(this.W,n,this.config_));break;default:this.zy("Unknown receiver type: "+n.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.X&&this.X.W.label==n.label?this.X.stop():this.zy("Stopping receiver w/o session: "+n.friendlyName)}else this.zy("onReceiverAction_ called without receiver.")}; g.W.Odk=function(n){if(this.qm())return Promise.reject(Error("disposed"));var q=n.receiver;q.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.zy("Not DIAL receiver: "+q.friendlyName),q.receiverType=chrome.cast.ReceiverType.DIAL);var M=this.X?this.X.W:null;if(!M||M.label!=q.label)return this.zy("Receiving DIAL launch request for non-clicked DIAL receiver: "+q.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(M&&M.label==q.label&&M.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.X.X)return SM("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.X.X),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.zy('Changing CAST intent from "'+M.receiverType+'" to "dial" for '+q.friendlyName);fZ(this,new hR(this.W,q,this.J,this.config_))}q=this.X;q.B=n;q.B.appState==chrome.cast.DialAppState.RUNNING?(n=q.B.extraData||{},M=n.screenId||null,Wx(q)&&n.loungeToken?n.loungeTokenRefreshIntervalMs?n=n7K(q,{name:q.W.friendlyName,screenId:n.screenId,loungeToken:n.loungeToken,dialId:q.B.receiver.label, screenIdType:"shortLived"},n.loungeTokenRefreshIntervalMs):(g.z7(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(n)+".")),n=qys(q,M)):n=qys(q,M)):n=QrO(q);return n}; g.W.aZ=function(n){var q=this;if(!this.qm()&&!this.C){SM("New cast session ID: "+n.sessionId);var M=n.receiver;if(M.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.X)if(M.receiverType==chrome.cast.ReceiverType.CAST)SM("Got resumed cast session before resumed mdx connection."),M.friendlyName=chrome.cast.unescape(M.friendlyName),fZ(this,new Es(this.W,M,this.config_),!0);else{this.zy("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var t=this.X.W,c=bO(this.W.m5(), t.label);c&&KJ(c,M.label)&&t.receiverType!=chrome.cast.ReceiverType.CAST&&M.receiverType==chrome.cast.ReceiverType.CAST&&(SM("onSessionEstablished_: manual to cast session change "+M.friendlyName),g.iz(this.X),this.X=new Es(this.W,M,this.config_),this.X.subscribe("sessionScreen",(0,g.bn)(this.zW,this,this.X)),this.X.subscribe("sessionFailed",function(){return cqn(q,q.X)}),this.X.TM(null)); this.X.aX(n)}}}; g.W.QX=function(){return this.X?this.X.E4():null}; g.W.tGm=function(n){this.qm()||(this.zy("Failed to estabilish a session: "+g.a9(n)),n.code!=chrome.cast.ErrorCode.CANCEL&&fZ(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.W.Fqg=function(n){SM("Receiver availability updated: "+n);if(!this.qm()){var q=I3(this);this.N=n==chrome.cast.ReceiverAvailability.AVAILABLE;I3(this)!=q&&this.publish("yt-remote-cast2-availability-change",I3(this))}}; g.W.Te=function(){this.qm()||(this.Z=YyD(this),SM("Updating custom receivers: "+g.a9(this.Z)),chrome.cast.setCustomReceivers(this.Z,function(){},(0,g.bn)(function(){this.zy("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",I3(this)))}; jM.prototype.setLaunchParams=jM.prototype.oMy;jM.prototype.setConnectedScreenStatus=jM.prototype.lUJ;jM.prototype.stopSession=jM.prototype.Mt;jM.prototype.getCastSession=jM.prototype.QX;jM.prototype.requestSession=jM.prototype.requestSession;jM.prototype.init=jM.prototype.init;jM.prototype.dispose=jM.prototype.dispose;var jzs=g.h_(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),E7G=[],Oys=g.p_(jzs);g.W=Us.prototype; g.W.reset=function(n){this.listId="";this.index=-1;this.videoId="";j4s(this);this.volume=-1;this.muted=!1;n&&(this.index=n.index,this.listId=n.listId,this.videoId=n.videoId,this.playerState=n.playerState,this.volume=n.volume,this.muted=n.muted,this.audioTrackId=n.audioTrackId,this.trackData=n.trackData,this.Ra=n.hasPrevious,this.tI=n.hasNext,this.C=n.playerTime,this.S=n.playerTimeAt,this.W=n.seekableStart,this.N=n.seekableEnd,this.Z=n.duration,this.B=n.loadedTime,this.X=n.liveIngestionTime,this.J= !isNaN(this.X))}; g.W.isPlaying=function(){return this.playerState==1}; g.W.isBuffering=function(){return this.playerState==3}; g.W.Bt=function(n){this.Z=isNaN(n)?0:n}; g.W.getDuration=function(){return this.J?this.Z+u5(this):this.Z}; g.W.clone=function(){return new Us(INK(this))};g.y($S,g.MB);g.W=$S.prototype;g.W.getState=function(){return this.Z}; g.W.sW=function(){return this.J.getReconnectTimeout()}; g.W.F2=function(){this.J.reconnect()}; g.W.play=function(){ZM(this)?(this.X?this.X.play(null,g.uP,wa(this,"play")):o3(this,"play"),L9n(this,1,DM(Fo(this))),this.publish("remotePlayerChange")):a3(this,this.play)}; g.W.pause=function(){ZM(this)?(this.X?this.X.pause(null,g.uP,wa(this,"pause")):o3(this,"pause"),L9n(this,2,DM(Fo(this))),this.publish("remotePlayerChange")):a3(this,this.pause)}; g.W.seekTo=function(n){if(ZM(this)){if(this.X){var q=Fo(this),M=new chrome.cast.media.SeekRequest;M.currentTime=n;q.isPlaying()||q.isBuffering()?M.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:M.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.X.seek(M,g.uP,wa(this,"seekTo",{newTime:n}))}else o3(this,"seekTo",{newTime:n});L9n(this,3,n);this.publish("remotePlayerChange")}else a3(this,g.dT(this.seekTo,n))}; g.W.stop=function(){if(ZM(this)){this.X?this.X.stop(null,g.uP,wa(this,"stopVideo")):o3(this,"stopVideo");var n=Fo(this);n.index=-1;n.videoId="";j4s(n);R3(this,n);this.publish("remotePlayerChange")}else a3(this,this.stop)}; g.W.setVolume=function(n,q){if(ZM(this)){var M=Fo(this);if(this.W){if(M.volume!=n){var t=Math.round(n)/100;this.W.setReceiverVolumeLevel(t,(0,g.bn)(function(){qr("set receiver volume: "+t)},this),(0,g.bn)(function(){this.zy("failed to set receiver volume.")},this))}M.muted!=q&&this.W.setReceiverMuted(q,(0,g.bn)(function(){qr("set receiver muted: "+q)},this),(0,g.bn)(function(){this.zy("failed to set receiver muted.")},this))}else{var c={volume:n, muted:q};M.volume!=-1&&(c.delta=n-M.volume);o3(this,"setVolume",c)}M.muted=q;M.volume=n;R3(this,M)}else a3(this,g.dT(this.setVolume,n,q))}; g.W.U4=function(n,q){if(ZM(this)){var M=Fo(this);n={videoId:n};q&&(M.trackData={trackName:q.name,languageCode:q.languageCode,sourceLanguageCode:q.translationLanguage?q.translationLanguage.languageCode:"",languageName:q.languageName,kind:q.kind},n.style=g.a9(q.style),g.yn(n,M.trackData));o3(this,"setSubtitlesTrack",n);R3(this,M)}else a3(this,g.dT(this.U4,n,q))}; g.W.setAudioTrack=function(n,q){ZM(this)?(q=q.getLanguageInfo().getId(),o3(this,"setAudioTrack",{videoId:n,audioTrackId:q}),n=Fo(this),n.audioTrackId=q,R3(this,n)):a3(this,g.dT(this.setAudioTrack,n,q))}; g.W.playVideo=function(n,q,M,t,c,Y,G){t=t===void 0?null:t;c=c===void 0?null:c;Y=Y===void 0?null:Y;G=G===void 0?null:G;var k=Fo(this),b={videoId:n};M!==void 0&&(b.currentIndex=M);AR(k,n,M||0);q!==void 0&&(Bx(k,q),b.currentTime=q);t&&(b.listId=t);c&&(b.playerParams=c);Y&&(b.clickTrackingParams=Y);G&&(b.locationInfo=g.a9(G));o3(this,"setPlaylist",b);t||R3(this,k)}; g.W.LS=function(n,q){if(ZM(this)){if(n&&q){var M=Fo(this);AR(M,n,q);R3(this,M)}o3(this,"previous")}else a3(this,g.dT(this.LS,n,q))}; g.W.nextVideo=function(n,q){if(ZM(this)){if(n&&q){var M=Fo(this);AR(M,n,q);R3(this,M)}o3(this,"next")}else a3(this,g.dT(this.nextVideo,n,q))}; g.W.Mf=function(){if(ZM(this)){o3(this,"clearPlaylist");var n=Fo(this);n.reset();R3(this,n);this.publish("remotePlayerChange")}else a3(this,this.Mf)}; g.W.qw=function(){ZM(this)?o3(this,"dismissAutoplay"):a3(this,this.qw)}; g.W.dispose=function(){if(this.Z!=3){var n=this.Z;this.Z=3;this.publish("proxyStateChange",n,this.Z)}g.MB.prototype.dispose.call(this)}; g.W.ut=function(){HyS(this);this.J=null;this.S.clear();mL(this,null);g.MB.prototype.ut.call(this)}; g.W.rf=function(n){if((n!=this.Z||n==2)&&this.Z!=3&&n!=0){var q=this.Z;this.Z=n;this.publish("proxyStateChange",q,n);if(n==1)for(;!this.S.isEmpty();)q=n=this.S,q.X.length===0&&(q.X=q.W,q.X.reverse(),q.W=[]),n.X.pop().apply(this);else n==3&&this.dispose()}}; g.W.u_m=function(n,q){this.publish(n,q)}; g.W.nim=function(n){if(!n)this.Xa(null),mL(this,null);else if(this.W.receiver.volume){n=this.W.receiver.volume;var q=Fo(this),M=Math.round(100*n.level||0);if(q.volume!=M||q.muted!=n.muted)qr("Cast volume update: "+n.level+(n.muted?" muted":"")),q.volume=M,q.muted=!!n.muted,R3(this,q)}}; g.W.Xa=function(n){qr("Cast media: "+!!n);this.X&&this.X.removeUpdateListener(this.B);if(this.X=n)this.X.addUpdateListener(this.B),PoO(this),this.publish("remotePlayerChange")}; g.W.Gkm=function(n){n?(PoO(this),this.publish("remotePlayerChange")):this.Xa(null)}; g.W.W3=function(){o3(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.W.lnm=function(){var n=yqA();n&&mL(this,n)}; g.W.zy=function(n){nZ("CP",n)};g.y(Vk,g.MB);g.W=Vk.prototype; g.W.connect=function(n,q){if(q){var M=q.listId,t=q.videoId,c=q.videoIds,Y=q.playerParams,G=q.clickTrackingParams,k=q.index,b={videoId:t},d=q.currentTime,N=q.locationInfo;q=q.loopMode;d!==void 0&&(b.currentTime=d<=5?0:d);Y&&(b.playerParams=Y);N&&(b.locationInfo=N);G&&(b.clickTrackingParams=G);M&&(b.listId=M);c&&c.length>0&&(b.videoIds=c.join(","));k!==void 0&&(b.currentIndex=k);this.nm&&(b.loopMode=q||"LOOP_MODE_OFF");M&&(this.X.listId=M);this.X.videoId=t;this.X.index=k||0;this.X.state=3;Bx(this.X, d);this.S="UNSUPPORTED";M=this.nm?"setInitialState":"setPlaylist";zI("Connecting with "+M+" and params: "+g.a9(b));this.W.connect({method:M,params:g.a9(b)},n,zlT())}else zI("Connecting without params"),this.W.connect({},n,zlT());UoD(this)}; g.W.Yz=function(n){this.W.Yz(n)}; g.W.dispose=function(){this.qm()||(g.nQ("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),JR(this,3));g.MB.prototype.dispose.call(this)}; g.W.ut=function(){u_Q(this);Dow(this);BeK(this);g.Ns(this.B);this.B=NaN;g.Ns(this.U);this.U=NaN;this.J=null;g.y9(this.xl);this.xl.length=0;this.W.dispose();g.MB.prototype.ut.call(this);this.S=this.N=this.Z=this.X=this.W=null}; g.W.AT=function(n){if(!this.Z||this.Z.length===0)return!1;for(var q=g.S(this.Z),M=q.next();!M.done;M=q.next())if(!M.value.capabilities.has(n))return!1;return!0}; g.W.TZ=function(){var n=3;this.qm()||(n=0,isNaN(this.T2())?this.W.XT()&&isNaN(this.C)&&(n=1):n=2);return n}; g.W.VR=function(n){zI("Disconnecting with "+n);g.nQ("yt.mdx.remote.remoteClient_",null);u_Q(this);this.publish("beforeDisconnect",n);n==1&&On();this.W.disconnect(n);this.dispose()}; g.W.KP=function(){var n=this.X;this.J&&(n=this.X.clone(),AR(n,this.J,n.index));return INK(n)}; g.W.P7x=function(n){var q=this,M=new Us(n);M.videoId&&M.videoId!=this.X.videoId&&(this.J=M.videoId,g.Ns(this.B),this.B=g.bl(function(){if(q.J){var c=q.J;q.J=null;q.X.videoId!=c&&CZ(q,"getNowPlaying")}},5E3)); var t=[];this.X.listId==M.listId&&this.X.videoId==M.videoId&&this.X.index==M.index||t.push("remoteQueueChange");this.X.playerState==M.playerState&&this.X.volume==M.volume&&this.X.muted==M.muted&&DM(this.X)==DM(M)&&g.a9(this.X.trackData)==g.a9(M.trackData)||t.push("remotePlayerChange");this.X.reset(n);g.xw(t,function(c){this.publish(c)},this)}; g.W.DS=function(){var n=this.W.getDeviceId(),q=g.XO(this.Z,function(M){return M.type=="REMOTE_CONTROL"&&M.id!=n}); return q?q.id:""}; g.W.T2=function(){return this.W.sW()}; g.W.qC=function(){return this.S||"UNSUPPORTED"}; g.W.rS=function(){return this.N||""}; g.W.xS=function(){!isNaN(this.T2())&&this.W.F2()}; g.W.i9t=function(n,q){CZ(this,n,q);moG(this)}; g.W.B1=function(){var n=g.UH("SAPISID","")||g.UH("__Secure-1PAPISID")||"",q=g.UH("__Secure-3PAPISID","")||"";if(!n&&!q)return"";n=g.Pn(g.LH(n),2);q=g.Pn(g.LH(q),2);return g.Pn(g.LH(","+n+","+q),2)}; Vk.prototype.subscribe=Vk.prototype.subscribe;Vk.prototype.unsubscribeByKey=Vk.prototype.cH;Vk.prototype.getProxyState=Vk.prototype.TZ;Vk.prototype.disconnect=Vk.prototype.VR;Vk.prototype.getPlayerContextData=Vk.prototype.KP;Vk.prototype.setPlayerContextData=Vk.prototype.P7x;Vk.prototype.getOtherConnectedRemoteId=Vk.prototype.DS;Vk.prototype.getReconnectTimeout=Vk.prototype.T2;Vk.prototype.getAutoplayMode=Vk.prototype.qC;Vk.prototype.getAutoplayVideoId=Vk.prototype.rS;Vk.prototype.reconnect=Vk.prototype.xS; Vk.prototype.sendMessage=Vk.prototype.i9t;Vk.prototype.getXsrfToken=Vk.prototype.B1;Vk.prototype.isCapabilitySupportedOnConnectedDevices=Vk.prototype.AT;g.y(rqs,cx);g.W=rqs.prototype;g.W.m5=function(n){return this.SC.$_gs(n)}; g.W.contains=function(n){return!!this.SC.$_c(n)}; g.W.get=function(n){return this.SC.$_g(n)}; g.W.start=function(){this.SC.$_st()}; g.W.add=function(n,q,M){this.SC.$_a(n,q,M)}; g.W.remove=function(n,q,M){this.SC.$_r(n,q,M)}; g.W.pV=function(n,q,M,t){this.SC.$_un(n,q,M,t)}; g.W.ut=function(){for(var n=this.X.length,q=0;q1&&!this.G.getOption("remote","quickCast")?(this.sY=g.Qs(n,this.X,this),this.gP(g.Wn(n,this.X)),n=this.G.getOption("remote","currentReceiver"),n=this.X(n),this.options[n]&&this.xe(n),this.enable(!0)):this.enable(!1)}; g7.prototype.X=function(n){return n.key}; g7.prototype.JP=function(n){return n==="cast-selector-receiver"?"Transmitir\u2026":this.sY[n].name}; g7.prototype.Zi=function(n){g.AH.prototype.Zi.call(this,n);this.G.setOption("remote","currentReceiver",this.sY[n]);this.xi.lG()};g.y(hnS,g.Ib);g.W=hnS.prototype; g.W.create=function(){var n=this.player.T(),q=g.b4(n);n={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:n.D("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:n.D("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:n.D("enable_cast_short_lived_lounge_token")};qms(q,n);this.subscriptions.push(g.Qd("yt-remote-before-disconnect",this.anm,this));this.subscriptions.push(g.Qd("yt-remote-connection-change",this.jI1,this));this.subscriptions.push(g.Qd("yt-remote-receiver-availability-change",this.Fn, this));this.subscriptions.push(g.Qd("yt-remote-auto-connect",this.Iyx,this));this.subscriptions.push(g.Qd("yt-remote-receiver-resumed",this.pmy,this));this.subscriptions.push(g.Qd("mdx-privacy-popup-confirm",this.Yhm,this));this.subscriptions.push(g.Qd("mdx-privacy-popup-cancel",this.tRs,this));this.Fn()}; g.W.load=function(){this.player.cancelPlayback();g.Ib.prototype.load.call(this);this.zp=new ERK(this.player.T(),this);this.player.Sj(this.zp);this.jK=new NWO(this,this.player,this.bG);var n=(n=k2F())?n.currentTime:0;var q=YmG()?new $S(cw(),void 0):null;n==0&&q&&(n=DM(Fo(q)));n!==0&&this.Oq(n);Wys(this,this.TU,this.TU);this.player.E5(6)}; g.W.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.Ud();this.Sg=this.iT;g.tg(this.jK,this.bG);this.bG=this.zp=this.jK=null;g.Ib.prototype.unload.call(this);this.player.E5(5);ev(this)}; g.W.ut=function(){g.pE(this.subscriptions);g.Ib.prototype.ut.call(this)}; g.W.uQ=function(n){var q=g.Fm.apply(1,arguments);this.loaded&&this.jK.P_.apply(this.jK,[n].concat(g.EJ(q)))}; g.W.getAdState=function(){return this.ag}; g.W.Ra=function(){return this.bG?Fo(this.bG).Ra:!1}; g.W.tI=function(){return this.bG?Fo(this.bG).tI:!1}; g.W.Oq=function(n,q){this.Vk=n||0;this.player.publish("progresssync",n,q);this.player.dZ("onVideoProgress",n||0)}; g.W.getCurrentTime=function(){return this.Vk}; g.W.getDuration=function(){return Fo(this.bG).getDuration()||0}; g.W.uY=function(){var n=Fo(this.bG);return n.J?n.X+u5(n):n.X}; g.W.D7=function(){return Fo(this.bG).B}; g.W.Df=function(){return SyT(Fo(this.bG))}; g.W.NH=function(){var n=Fo(this.bG);return n.W>0?n.W+u5(n):n.W}; g.W.getProgressState=function(){var n=Fo(this.bG),q=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:n.playerState!=1081&&this.player.kM(),clipEnd:q.clipEnd,clipStart:q.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.uY(),isAtLiveHead:this.isAtLiveHead(),loaded:this.D7(),seekableEnd:this.Df(),seekableStart:this.NH(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.W.isAtLiveHead=function(){return SyT(Fo(this.bG))-this.getCurrentTime()<=1}; g.W.nextVideo=function(){this.bG&&this.bG.nextVideo()}; g.W.LS=function(){this.bG&&this.bG.LS()}; g.W.anm=function(n){n===1&&(this.m1=this.bG?Fo(this.bG):null)}; g.W.jI1=function(){var n=YmG()?new $S(cw(),void 0):null;if(n){var q=this.Sg;this.loaded&&this.unload();this.bG=n;this.m1=null;q.key!==this.iT.key&&(this.Sg=q,this.load())}else g.iz(this.bG),this.bG=null,this.loaded&&(this.unload(),(n=this.m1)&&n.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(n.videoId,DM(n)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.W.Fn=function(){var n=[this.iT],q=n.concat,M=Mds();vx()&&g.vf("yt-remote-cast-available")&&M.push({key:"cast-selector-receiver",name:"Cast..."});this.sY=q.call(n,M);n=tds()||this.iT;Ej(this,n);this.player.dZ("onMdxReceiversChange")}; g.W.Iyx=function(){var n=tds();Ej(this,n)}; g.W.pmy=function(){this.Sg=tds()}; g.W.Yhm=function(){this.Da=!0;ev(this);kf=!1;Yf&&K2(Yf,1);Yf=null}; g.W.tRs=function(){this.Da=!1;ev(this);Ej(this,this.iT);this.Sg=this.iT;kf=!1;Yf=null;this.player.playVideo()}; g.W.X7=function(n,q){switch(n){case "casting":return this.loaded;case "receivers":return this.sY;case "currentReceiver":return q&&(q.key==="cast-selector-receiver"?s4Q():Ej(this,q)),this.loaded?this.Sg:this.iT;case "quickCast":return this.sY.length===2&&this.sY[1].key==="cast-selector-receiver"?(q&&s4Q(),!0):!1}}; g.W.W3=function(){this.bG.W3()}; g.W.b1=function(){return!1}; g.W.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.W.isLoggedIn=function(){var n,q;return((n=g.RZ("PLAYER_CONFIG"))==null?void 0:(q=n.args)==null?void 0:q.authuser)!==void 0?!0:!(!g.RZ("SESSION_INDEX")&&!g.RZ("LOGGED_IN"))};g.SC("remote",hnS);})(_yt_player);