(function(g){var window=this;'use strict';var C4Y=function(r){if(r instanceof g.TD)return r;if(typeof r.gJ=="function")return r.gJ(!1);if(g.k$(r)){var l=0,U=new g.TD;U.next=function(){for(;;){if(l>=r.length)return g.vc;if(l in r)return g.yA(r[l++]);l++}}; return U}throw Error("Not implemented");},vc8=function(r,l,U){if(g.k$(r))g.yC(r,l,U); else for(r=C4Y(r);;){var F=r.next();if(F.done)break;l.call(U,F.value,void 0,r)}},rm=function(r){g.xa(r,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.Y0()).toString(36)); return r},$u=function(r,l,U){Array.isArray(U)||(U=[String(U)]); g.w03(r.K,l,U)},JZR=function(r,l){var U=[]; vc8(l,function(F){try{var Y=g.wQ.prototype.X.call(this,F,!0)}catch(e){if(e=="Storage: Invalid value was encountered")return;throw e;}Y===void 0?U.push(F):g.c4S(Y)&&U.push(F)},r); return U},m3Y=function(r,l){JZR(r,l).forEach(function(U){g.wQ.prototype.remove.call(this,U)},r)},P4$=function(r){if(r.IS){if(r.IS.locationOverrideToken)return{locationOverrideToken:r.IS.locationOverrideToken}; if(r.IS.latitudeE7!=null&&r.IS.longitudeE7!=null)return{latitudeE7:r.IS.latitudeE7,longitudeE7:r.IS.longitudeE7}}return null},AZb=function(r,l){g.Af(r,l)||r.push(l)},M7r=function(r){var l=0,U; for(U in r)l++;return l},sp8=function(r,l){return g.Lr(r,l)},x3p=function(r){try{return g.pP.JSON.parse(r)}catch(l){}r=String(r); if(/^\s*$/.test(r)?0:/^[\],:{}\s\u2028\u2029]*$/.test(r.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("("+r+")")}catch(l){}throw Error("Invalid JSON string: "+r);},lZ=function(r){if(g.pP.JSON)try{return g.pP.JSON.parse(r)}catch(l){}return x3p(r)},Wzp=function(){var r=Uz(); this.W=r;r.Hq("/client_streamz/youtube/living_room/mdx/channel/opened",g.Ag("channel_type"))},Qp8=function(){var r=Uz(); this.W=r;r.Hq("/client_streamz/youtube/living_room/mdx/channel/closed",g.Ag("channel_type"))},Ec$=function(){var r=Uz(); this.W=r;r.Hq("/client_streamz/youtube/living_room/mdx/channel/message_received",g.Ag("channel_type"))},Z1C=function(){var r=Uz(); this.W=r;r.Hq("/client_streamz/youtube/living_room/mdx/channel/success")},R_$=function(){var r=Uz(); this.W=r;r.Hq("/client_streamz/youtube/living_room/mdx/channel/error",g.Ag("channel_type"),g.Ag("error_type"))},h_C=function(){var r=Uz(); this.W=r;r.Hq("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},ncC=function(){var r=Uz(); this.W=r;r.Hq("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},GjG=function(r,l,U,F){var Y=new g.C0(null); r&&g.vs(Y,r);l&&g.Jz(Y,l);U&&g.mQ(Y,U);F&&(Y.X=F);return Y},Xxr=function(r,l){return new g.CJ(r,l)},Fc=function(r,l){return Object.prototype.hasOwnProperty.call(r,l)},i1f=function(r,l){return r===l},Yu=function(r,l){this.X={}; this.W=[];this.Kv=this.size=0;var U=arguments.length;if(U>1){if(U%2)throw Error("Uneven number of arguments");for(var F=0;F5&&(r=r.slice(r.length-5)); var l=g.aI(J1b(),function(F){return F.loungeToken}),U=g.aI(r,function(F){return F.loungeToken}); g.II(U,function(F){return!g.Af(l,F)})&&mOr(); g.fS("yt-remote-local-screens",r,31536E3)},PJ=function(r){r||(g.zq("yt-remote-session-screen-id"),g.zq("yt-remote-session-video-id")); C0C();r=J7();g.sY(r,mD());OSY(r)},A1G=function(){if(!A7){var r=g.pJ(); r&&(A7=new g.Bl(r))}},MX8=function(){A1G(); return A7?!!A7.get("yt-remote-use-staging-server"):!1},MM=function(r,l){g.v6[r]=!0; var U=g.Kn();U&&U.publish.apply(U,arguments);g.v6[r]=!1},sWp=function(){},Uz=function(){if(!sz){sz=new g.p9(new sWp); var r=g.b4("client_streamz_web_flush_count",-1);r!==-1&&(sz.L=r)}return sz},xOf=function(){var r=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return r?parseInt(r[1],10):0},Whb=function(r){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+r)!=-1||document.currentScript.src.indexOf("&"+r)!=-1)},QW$=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},xu=function(r){r.length?EHq(r.shift(),function(){xu(r)}):ZSp()},RbC=function(r){return"chrome-extension://"+r+"/cast_sender.js"},EHq=function(r,l,U){var F=document.createElement("script"); F.onerror=l;U&&(F.onload=U);g.dF(F,g.Tb(r));(document.head||document.documentElement).appendChild(F)},hbC=function(){var r=xOf(),l=[]; if(r>1){var U=r-1;l.push("//www.gstatic.com/eureka/clank/"+r+"/cast_sender.js");l.push("//www.gstatic.com/eureka/clank/"+U+"/cast_sender.js")}return l},ZSp=function(){var r=QW$(); r&&r(!1,"No cast extension found")},Gq$=function(){if(nHC){var r=2,l=QW$(),U=function(){r--; r==0&&l&&l(!0)}; window.__onGCastApiAvailable=U;EHq("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",ZSp,U)}},XL8=function(){Gq$(); var r=hbC();r.push("//www.gstatic.com/eureka/clank/cast_sender.js");xu(r)},bS8=function(){Gq$(); var r=hbC();r.push.apply(r,g.G(iSf.map(RbC)));r.push("//www.gstatic.com/eureka/clank/cast_sender.js");xu(r)},WJ=function(r,l,U){g.H.call(this); this.D=U!=null?(0,g.UY)(r,U):r;this.JF=l;this.U=(0,g.UY)(this.qn,this);this.W=!1;this.X=0;this.L=this.lI=null;this.K=[]},QU=function(){},Nlq=function(){g.lM.call(this,"p")},jW8=function(){g.lM.call(this,"o")},Tlf=function(){return qBf=qBf||new g.xn},ut0=function(r){g.lM.call(this,"serverreachability",r)},Ez=function(r){var l=Tlf(); l.dispatchEvent(new ut0(l,r))},y1q=function(r){g.lM.call(this,"statevent",r)},ZT=function(r){var l=Tlf(); l.dispatchEvent(new y1q(l,r))},BlG=function(r,l,U,F){g.lM.call(this,"timingevent",r); this.size=l;this.rtt=U;this.retries=F},RG=function(r,l){if(typeof r!=="function")throw Error("Fn must not be null and must be a function"); return g.pP.setTimeout(function(){r()},l)},h7=function(){},nt=function(r,l,U,F){this.L=r; this.K=l;this.SN=U;this.v5=F||1;this.kq=new g.RN(this);this.If=45E3;this.iG=null;this.D=!1;this.V=this.Nh=this.T=this.OF=this.KP=this.W5=this.kN=null;this.sF=[];this.W=null;this.j=0;this.U=this.rz=null;this.Rg=-1;this.YN=!1;this.lG=0;this.yT=null;this.xq=this.vQ=this.Kp=this.qh=!1;this.X=new HSY},HSY=function(){this.L=null; this.W="";this.X=!1},wL8=function(r,l,U){r.OF=1; r.T=rm(l.clone());r.V=U;r.qh=!0;gHr(r,null)},gHr=function(r,l){r.KP=Date.now(); Gr(r);r.Nh=r.T.clone();$u(r.Nh,"t",r.v5);r.j=0;var U=r.L.OF;r.X=new HSY;r.W=DOj(r.L,U?l:null,!r.V);r.lG>0&&(r.yT=new g.OS((0,g.UY)(r.Qc,r,r.W),r.lG));r.kq.listen(r.W,"readystatechange",r.w2);l=r.iG?g.oc(r.iG):{};r.V?(r.rz||(r.rz="POST"),l["Content-Type"]="application/x-www-form-urlencoded",r.W.send(r.Nh,r.rz,r.V,l)):(r.rz="GET",r.W.send(r.Nh,r.rz,null,l));Ez(1)},fIr=function(r){if(!VX0(r))return g.ll(r.W); var l=g.U2(r.W);if(l==="")return"";var U="",F=l.length,Y=g.rH(r.W)==4;if(!r.X.L){if(typeof TextDecoder==="undefined")return Xc(r),iZ(r),"";r.X.L=new g.pP.TextDecoder}for(var e=0;el.length)return SB0;l=l.slice(F,F+U);r.j=F+U;return l},Gr=function(r){r.W5=Date.now()+r.If; tX8(r,r.If)},tX8=function(r,l){if(r.kN!=null)throw Error("WatchDog timer not null"); r.kN=RG((0,g.UY)(r.CV,r),l)},Lhr=function(r){r.kN&&(g.pP.clearTimeout(r.kN),r.kN=null)},iZ=function(r){r.L.nx()||r.YN||c1Y(r.L,r)},Xc=function(r){Lhr(r); g.sV(r.yT);r.yT=null;r.kq.removeAll();if(r.W){var l=r.W;r.W=null;l.abort();l.dispose()}},UZY=function(r,l){try{var U=r.L; if(U.Jj!=0&&(U.W==r||aIb(U.X,r)))if(!r.vQ&&aIb(U.X,r)&&U.Jj==3){try{var F=U.wg.W.parse(l)}catch(E){F=null}if(Array.isArray(F)&&F.length==3){var Y=F;if(Y[0]==0)a:{if(!U.T){if(U.W)if(U.W.KP+3E30&&(U.lG=1.5*K);F=U;var C=r.pO();if(C){var v=g.Fz(C,"X-Client-Wire-Protocol");if(v){var J=F.X;!J.W&&(g.MI(v,"spdy")||g.MI(v,"quic")||g.MI(v,"h2"))&&(J.K=J.U,J.W=new Set,J.X&&(oC0(J,J.X),J.X=null))}if(F.qh){var m=g.Fz(C,"X-HTTP-Session-Id");m&&(F.IS=m,g.xa(F.iG,F.qh,m))}}U.Jj=3;U.U&&U.U.jY();U.JB&&(U.bI=Date.now()-r.KP);F=U;var P=r;F.Es=rPq(F,F.OF?F.v5:null,F.SN);if(P.vQ){$Z$(F.X, P);var A=P,M=F.lG;M&&A.setTimeout(M);A.kN&&(Lhr(A),Gr(A));F.W=P}else lzp(F);U.L.length>0&&qM(U)}else e[0]!="stop"&&e[0]!="close"||jP(U,7);else U.Jj==3&&(e[0]=="stop"||e[0]=="close"?e[0]=="stop"?jP(U,7):U.disconnect():e[0]!="noop"&&U.U&&U.U.Ma(e),U.sF=0)}Ez(4)}catch(E){}},F3p=function(r,l){this.W=r; this.map=l;this.context=null},Yff=function(r){this.U=r||10; g.pP.PerformanceNavigationTiming?(r=g.pP.performance.getEntriesByType("navigation"),r=r.length>0&&(r[0].nextHopProtocol=="hq"||r[0].nextHopProtocol=="h2")):r=!!(g.pP.chrome&&g.pP.chrome.loadTimes&&g.pP.chrome.loadTimes()&&g.pP.chrome.loadTimes().wasFetchedViaSpdy);this.K=r?this.U:1;this.W=null;this.K>1&&(this.W=new Set);this.X=null;this.L=[]},eRb=function(r){return r.X?!0:r.W?r.W.size>=r.K:!1},kq$=function(r){return r.X?1:r.W?r.W.size:0},aIb=function(r,l){return r.X?r.X==l:r.W?r.W.has(l):!1},oC0= function(r,l){r.W?r.W.add(l):r.X=l},$Z$=function(r,l){r.X&&r.X==l?r.X=null:r.W&&r.W.has(l)&&r.W.delete(l)},dZG=function(r){if(r.X!=null)return r.L.concat(r.X.sF); if(r.W!=null&&r.W.size!==0){var l=r.L;r=g.Q(r.W.values());for(var U=r.next();!U.done;U=r.next())l=l.concat(U.value.sF);return l}return g.QC(r.L)},Opj=function(r,l){var U=new h7; if(g.pP.Image){var F=new Image;F.onload=g.Fq(Tr,U,"TestLoadImage: loaded",!0,l,F);F.onerror=g.Fq(Tr,U,"TestLoadImage: error",!1,l,F);F.onabort=g.Fq(Tr,U,"TestLoadImage: abort",!1,l,F);F.ontimeout=g.Fq(Tr,U,"TestLoadImage: timeout",!1,l,F);g.pP.setTimeout(function(){if(F.ontimeout)F.ontimeout()},1E4); F.src=r}else l(!1)},K38=function(r,l){var U=new h7,F=new AbortController,Y=setTimeout(function(){F.abort(); Tr(U,"TestPingServer: timeout",!1,l)},1E4); fetch(r,{signal:F.signal}).then(function(e){clearTimeout(Y);e.ok?Tr(U,"TestPingServer: ok",!0,l):Tr(U,"TestPingServer: server error",!1,l)}).catch(function(){clearTimeout(Y); Tr(U,"TestPingServer: error",!1,l)})},Tr=function(r,l,U,F,Y){try{Y&&(Y.onload=null,Y.onerror=null,Y.onabort=null,Y.ontimeout=null),F(U)}catch(e){}},CYf=function(){this.W=new QU},vC8=function(r,l,U){var F=U||""; try{g.K0(r,function(Y,e){var d=Y;g.oY(Y)&&(d=g.L9(Y));l.push(F+e+"="+encodeURIComponent(d))})}catch(Y){throw l.push(F+"type="+encodeURIComponent("_badmap")),Y; }},uZ=function(r,l,U){return U&&U.HI?U.HI[r]||l:l},JP$=function(r){this.L=[]; this.v5=this.Es=this.iG=this.SN=this.W=this.IS=this.qh=this.YN=this.j=this.Rg=this.V=null;this.jS=this.Nh=0;this.Af=uZ("failFast",!1,r);this.vQ=this.kN=this.T=this.D=this.U=null;this.c5=!0;this.LJ=this.yT=-1;this.xq=this.sF=this.KP=0;this.ON=uZ("baseRetryDelayMs",5E3,r);this.o9=uZ("retryDelaySeedMs",1E4,r);this.Ms=uZ("forwardChannelMaxRetries",2,r);this.f1=uZ("forwardChannelRequestTimeoutMs",2E4,r);this.j5=r&&r.uAP||void 0;this.SS=r&&r.gTf||void 0;this.Wl=r&&r.poh||!1;this.lG=void 0;this.OF=r&&r.ZxT|| !1;this.K="";this.X=new Yff(r&&r.aSH);this.wg=new CYf;this.kq=r&&r.WaF||!1;this.W5=r&&r.Nsa||!1;this.kq&&this.W5&&(this.W5=!1);this.vl=r&&r.CYw||!1;r&&r.kbP&&(this.c5=!1);this.JB=!this.kq&&this.c5&&r&&r.Shc||!1;this.MS=void 0;r&&r.BA&&r.BA>0&&(this.MS=r.BA);this.P5=void 0;this.bI=0;this.If=!1;this.Kp=this.rz=null},NM=function(r){r.W&&(mZp(r),r.W.cancel(),r.W=null)},PY8=function(r){NM(r); r.T&&(g.pP.clearTimeout(r.T),r.T=null);bZ(r);r.X.cancel();r.D&&(typeof r.D==="number"&&g.pP.clearTimeout(r.D),r.D=null)},qM=function(r){eRb(r.X)||r.D||(r.D=!0,g.bM(r.aE,r),r.KP=0)},MNj=function(r,l){if(kq$(r.X)>=r.X.K-(r.D?1:0))return!1; if(r.D)return r.L=l.sF.concat(r.L),!0;if(r.Jj==1||r.Jj==2||r.KP>=(r.Af?0:r.Ms))return!1;r.D=RG((0,g.UY)(r.aE,r,l),AP0(r,r.KP));r.KP++;return!0},xZC=function(r,l){var U; l?U=l.SN:U=r.Nh++;var F=r.iG.clone();g.xa(F,"SID",r.K);g.xa(F,"RID",U);g.xa(F,"AID",r.yT);yU(r,F);r.j&&r.V&&g.ZF(F,r.j,r.V);U=new nt(r,r.K,U,r.KP+1);r.j===null&&(U.iG=r.V);l&&(r.L=l.sF.concat(r.L));l=smC(r,U,1E3);U.setTimeout(Math.round(r.f1*.5)+Math.round(r.f1*.5*Math.random()));oC0(r.X,U);wL8(U,F,l)},yU=function(r,l){r.YN&&g.gR(r.YN,function(U,F){g.xa(l,F,U)}); r.U&&g.K0({},function(U,F){g.xa(l,F,U)})},smC=function(r,l,U){U=Math.min(r.L.length,U); var F=r.U?(0,g.UY)(r.U.iH,r.U,r):null;a:{for(var Y=r.L,e=-1;;){var d=["count="+U];e==-1?U>0?(e=Y[0].W,d.push("ofs="+e)):e=0:d.push("ofs="+e);for(var K=!0,C=0;C=3)return!1; r.xq++;r.T=RG((0,g.UY)(r.Yn,r),AP0(r,r.sF));r.sF++;return!0},mZp=function(r){r.rz!=null&&(g.pP.clearTimeout(r.rz),r.rz=null)},W3b=function(r){r.W=new nt(r,r.K,"rpc",r.xq); r.j===null&&(r.W.iG=r.V);r.W.lG=0;var l=r.Es.clone();g.xa(l,"RID","rpc");g.xa(l,"SID",r.K);g.xa(l,"AID",r.yT);g.xa(l,"CI",r.vQ?"0":"1");!r.vQ&&r.MS&&g.xa(l,"TO",r.MS);g.xa(l,"TYPE","xmlhttp");yU(r,l);r.j&&r.V&&g.ZF(l,r.j,r.V);r.lG&&r.W.setTimeout(r.lG);var U=r.W;r=r.v5;U.OF=1;U.T=rm(l.clone());U.V=null;U.qh=!0;gHr(U,r)},bZ=function(r){r.kN!=null&&(g.pP.clearTimeout(r.kN),r.kN=null)},c1Y=function(r,l){var U=null; if(r.W==l){bZ(r);mZp(r);r.W=null;var F=2}else if(aIb(r.X,l))U=l.sF,$Z$(r.X,l),F=1;else return;if(r.Jj!=0)if(l.D)if(F==1){U=l.V?l.V.length:0;l=Date.now()-l.KP;var Y=r.KP;F=Tlf();F.dispatchEvent(new BlG(F,U,l,Y));qM(r)}else lzp(r);else{var e=l.Rg;Y=l.getLastError();if(Y==3||Y==0&&e>0||!(F==1&&MNj(r,l)||F==2&&IIp(r)))switch(U&&U.length>0&&(l=r.X,l.L=l.L.concat(U)),Y){case 1:jP(r,5);break;case 4:jP(r,10);break;case 3:jP(r,6);break;default:jP(r,2)}}},AP0=function(r,l){var U=r.ON+Math.floor(Math.random()* r.o9); r.isActive()||(U*=2);return U*l},jP=function(r,l){if(l==2){var U=(0,g.UY)(r.w$a,r),F=r.SS,Y=!F; F=new g.C0(F||"//www.google.com/images/cleardot.gif");g.pP.location&&g.pP.location.protocol=="http"||g.vs(F,"https");rm(F);Y?Opj(F.toString(),U):K38(F.toString(),U)}else ZT(2);r.Jj=0;r.U&&r.U.A0(l);Qm$(r);PY8(r)},Qm$=function(r){r.Jj=0; r.Kp=[];if(r.U){var l=dZG(r.X);if(l.length!=0||r.L.length!=0)g.ZG(r.Kp,l),g.ZG(r.Kp,r.L),r.X.L.length=0,g.QC(r.L),r.L.length=0;r.U.Om()}},ECC=function(r){if(r.Jj==0)return r.Kp; var l=[];g.ZG(l,dZG(r.X));g.ZG(l,r.L);return l},rPq=function(r,l,U){var F=g.Ws(U); F.W!=""?(l&&g.Jz(F,l+"."+F.W),g.mQ(F,F.L)):(F=g.pP.location,F=GjG(F.protocol,l?l+"."+F.hostname:F.hostname,+F.port,U));l=r.qh;U=r.IS;l&&U&&g.xa(F,l,U);g.xa(F,"VER",r.Um);yU(r,F);return F},DOj=function(r,l,U){if(l&&!r.OF)throw Error("Can't create secondary domain capable XhrIo object."); l=r.Wl&&!r.j5?new g.Ib(new g.Ya({JZ:U})):new g.Ib(r.j5);l.j=r.OF;return l},Zpr=function(){},RRR=function(){},HJ=function(r,l){g.xn.call(this); this.W=new JP$(l);this.U=r;this.X=l&&l.sfN||null;r=l&&l.HPa||null;l&&l.UNT&&(r?r["X-Client-Protocol"]="webchannel":r={"X-Client-Protocol":"webchannel"});this.W.V=r;r=l&&l.xqw||null;l&&l.XF&&(r?r["X-WebChannel-Content-Type"]=l.XF:r={"X-WebChannel-Content-Type":l.XF});l&&l.sS&&(r?r["X-WebChannel-Client-Profile"]=l.sS:r={"X-WebChannel-Client-Profile":l.sS});this.W.Rg=r;(r=l&&l.ilw)&&!g.Pi(r)&&(this.W.j=r);this.D=l&&l.ZxT||!1;this.K=l&&l.Oca||!1;(l=l&&l.Iq)&&!g.Pi(l)&&(this.W.qh=l,g.tf(this.X,l)&&(r= this.X,l in r&&delete r[l]));this.L=new BJ(this)},hRC=function(r){Nlq.call(this); r.__headers__&&(this.headers=r.__headers__,this.statusCode=r.__status__,delete r.__headers__,delete r.__status__);var l=r.__sm__;l?this.data=(this.W=g.fr(l))?g.IY(l,this.W):l:this.data=r},nCY=function(r){jW8.call(this); this.status=1;this.errorCode=r},BJ=function(r){this.W=r},Go$=function(r,l){this.X=r; this.W=l},XXq=function(r){return ECC(r.W).map(function(l){var U=r.X; l=l.map;"__data__"in l?(l=l.__data__,U=U.K?x3p(l):l):U=l;return U})},gm=function(r,l){if(typeof r!=="function")throw Error("Fn must not be null and must be a function"); return g.pP.setTimeout(function(){r()},l)},DT=function(r){wm.dispatchEvent(new ipR(wm,r))},ipR=function(r){g.lM.call(this,"statevent",r)},VU=function(r,l,U,F){this.W=r; this.K=l;this.j=U;this.D=F||1;this.X=45E3;this.L=new g.RN(this);this.U=new g.f9;this.U.setInterval(250)},Nd8=function(r,l,U){r.JX=1; r.Yl=rm(l.clone());r.Cv=U;r.qh=!0;bp$(r,null)},jmq=function(r,l,U,F,Y){r.JX=1; r.Yl=rm(l.clone());r.Cv=null;r.qh=U;Y&&(r.dO=!1);bp$(r,F)},bp$=function(r,l){r.AO=Date.now(); qf8(r);r.zX=r.Yl.clone();$u(r.zX,"t",r.D);r.Id=0;r.KI=r.W.KL(r.W.Mp()?l:null);r.RH>0&&(r.Ng=new g.OS((0,g.UY)(r.vN,r,r.KI),r.RH));r.L.listen(r.KI,"readystatechange",r.eA);l=r.rX?g.oc(r.rX):{};r.Cv?(r.Pa="POST",l["Content-Type"]="application/x-www-form-urlencoded",r.KI.send(r.zX,r.Pa,r.Cv,l)):(r.Pa="GET",r.dO&&!g.tM&&(l.Connection="close"),r.KI.send(r.zX,r.Pa,null,l));r.W.k7(1)},yPC=function(r,l){var U=r.Id,F=l.indexOf("\n",U); if(F==-1)return TdC;U=Number(l.substring(U,F));if(isNaN(U))return uiC;F+=1;if(F+U>l.length)return TdC;l=l.slice(F,F+U);r.Id=F+U;return l},qf8=function(r){r.LL=Date.now()+r.X; Bdr(r,r.X)},Bdr=function(r,l){if(r.je!=null)throw Error("WatchDog timer not null"); r.je=gm((0,g.UY)(r.xi,r),l)},Hpf=function(r){r.je&&(g.pP.clearTimeout(r.je),r.je=null)},gCf=function(r){r.W.nx()||r.aB||r.W.uD(r)},ft=function(r){Hpf(r); g.sV(r.Ng);r.Ng=null;r.U.stop();r.L.removeAll();if(r.KI){var l=r.KI;r.KI=null;l.abort();l.dispose()}r.qo&&(r.qo=null)},wX$=function(r,l){try{r.W.SY(r,l),r.W.k7(4)}catch(U){}},VNb=function(r,l,U,F,Y){if(F==0)U(!1); else{var e=Y||0;F--;DZY(r,l,function(d){d?U(!0):g.pP.setTimeout(function(){VNb(r,l,U,F,e)},e)})}},DZY=function(r,l,U){var F=new Image; F.onload=function(){try{SP(F),U(!0)}catch(Y){}}; F.onerror=function(){try{SP(F),U(!1)}catch(Y){}}; F.onabort=function(){try{SP(F),U(!1)}catch(Y){}}; F.ontimeout=function(){try{SP(F),U(!1)}catch(Y){}}; g.pP.setTimeout(function(){if(F.ontimeout)F.ontimeout()},l); F.src=r},SP=function(r){r.onload=null; r.onerror=null;r.onabort=null;r.ontimeout=null},fzY=function(r){this.W=r; this.X=new QU},SfC=function(r){var l=zr(r.W,r.ix,"/mail/images/cleardot.gif"); rm(l);VNb(l.toString(),5E3,(0,g.UY)(r.nj,r),3,2E3);r.k7(1)},zR0=function(r){var l=r.W.D; l!=null?(DT(5),l?(DT(11),pt(r.W,r,!1)):(DT(12),pt(r.W,r,!0))):(r.gU=new VU(r),r.gU.rX=r.ZC,l=r.W,l=zr(l,l.Mp()?r.Ba:null,r.Fz),DT(5),$u(l,"TYPE","xmlhttp"),jmq(r.gU,l,!1,r.Ba,!1))},pXR=function(r,l,U){this.W=1; this.X=[];this.L=[];this.U=new QU;this.V=r||null;this.D=l!=null?l:null;this.T=U||!1},tNC=function(r,l){this.W=r; this.map=l;this.context=null},L3C=function(r,l,U,F){g.lM.call(this,"timingevent",r); this.size=l;this.rtt=U;this.retries=F},cPp=function(r){g.lM.call(this,"serverreachability",r)},Izp=function(r){r.QP(1,0); r.hX=zr(r,null,r.rI);azY(r)},koR=function(r){r.uO&&(r.uO.abort(),r.uO=null); r.Kd&&(r.Kd.cancel(),r.Kd=null);r.Kl&&(g.pP.clearTimeout(r.Kl),r.Kl=null);t7(r);r.LS&&(r.LS.cancel(),r.LS=null);r.Px&&(g.pP.clearTimeout(r.Px),r.Px=null)},oDp=function(r,l){if(r.W==0)throw Error("Invalid operation: sending map when state is closed"); r.X.push(new tNC(r.U2++,l));r.W!=2&&r.W!=3||azY(r)},rwY=function(r){var l=0; r.Kd&&l++;r.LS&&l++;return l},azY=function(r){r.LS||r.Px||(r.Px=gm((0,g.UY)(r.Em,r),0),r.Se=0)},U1j=function(r,l){if(r.W==1){if(!l){r.v3=Math.floor(Math.random()*1E5); l=r.v3++;var U=new VU(r,"",l);U.rX=r.o2;var F=$1Y(r),Y=r.hX.clone();g.xa(Y,"RID",l);g.xa(Y,"CVER","1");Lt(r,Y);Nd8(U,Y,F);r.LS=U;r.W=2}}else r.W==3&&(l?lNC(r,l):r.X.length==0||r.LS||lNC(r))},lNC=function(r,l){if(l)if(r.wX>6){r.X=r.L.concat(r.X); r.L.length=0;var U=r.v3-1;l=$1Y(r)}else U=l.j,l=l.Cv;else U=r.v3++,l=$1Y(r);var F=r.hX.clone();g.xa(F,"SID",r.K);g.xa(F,"RID",U);g.xa(F,"AID",r.GV);Lt(r,F);U=new VU(r,r.K,U,r.Se+1);U.rX=r.o2;U.setTimeout(1E4+Math.round(1E4*Math.random()));r.LS=U;Nd8(U,F,l)},Lt=function(r,l){r.PZ&&(r=r.PZ.zd())&&g.gR(r,function(U,F){g.xa(l,F,U)})},$1Y=function(r){var l=Math.min(r.X.length,1E3),U=["count="+l]; if(r.wX>6&&l>0){var F=r.X[0].W;U.push("ofs="+F)}else F=0;for(var Y={},e=0;e=3)return!1; r.j++;r.Kl=gm((0,g.UY)(r.Td,r),Yyj(r,r.vC));r.vC++;return!0},pt=function(r,l,U){r.lz=r.D==null?U:!r.D; r.ws=l.Ll;r.T||Izp(r)},t7=function(r){r.Dt!=null&&(g.pP.clearTimeout(r.Dt),r.Dt=null)},Yyj=function(r,l){var U=5E3+Math.floor(Math.random()*1E4); r.isActive()||(U*=2);return U*l},cJ=function(r,l){if(l==2||l==9){var U=null; r.PZ&&(U=null);var F=(0,g.UY)(r.Cra,r);U||(U=new g.C0("//www.google.com/images/cleardot.gif"),rm(U));DZY(U.toString(),1E4,F)}else DT(2);d10(r,l)},d10=function(r,l){r.W=0; r.PZ&&r.PZ.yc(l);O8$(r);koR(r)},O8$=function(r){r.W=0; r.ws=-1;if(r.PZ)if(r.L.length==0&&r.X.length==0)r.PZ.qE();else{var l=g.QC(r.L),U=g.QC(r.X);r.L.length=0;r.X.length=0;r.PZ.qE(l,U)}},zr=function(r,l,U){var F=g.Ws(U); if(F.W!="")l&&g.Jz(F,l+"."+F.W),g.mQ(F,F.L);else{var Y=window.location;F=GjG(Y.protocol,l?l+"."+Y.hostname:Y.hostname,+Y.port,U)}r.jG&&g.gR(r.jG,function(e,d){g.xa(F,d,e)}); g.xa(F,"VER",r.wX);Lt(r,F);return F},K_0=function(){},CNC=function(){this.W=[]; this.X=[]},vDG=function(r){g.lM.call(this,"channelMessage"); this.message=r},Jwj=function(r){g.lM.call(this,"channelError"); this.error=r},m18=function(r,l){this.action=r; this.params=l||{}},aG=function(r,l){g.H.call(this); this.W=new g.F1(this.sSF,0,this);g.w(this,this.W);this.JF=5E3;this.X=0;if(typeof r==="function")l&&(r=(0,g.UY)(r,l));else if(r&&typeof r.handleEvent==="function")r=(0,g.UY)(r.handleEvent,r);else throw Error("Invalid listener argument");this.L=r},PN8=function(r,l,U,F,Y,e,d,K,C,v,J,m,P,A){U=U===void 0?!1:U; F=F===void 0?function(){return""}:F; Y=Y===void 0?!1:Y;e=e===void 0?!1:e;d=d===void 0?!1:d;K=K===void 0?function(){return g.Ho({})}:K; C=C===void 0?!1:C;J=J===void 0?!1:J;m=m===void 0?!1:m;P=P===void 0?!1:P;A=A===void 0?!1:A;this.OF=r;this.kN=l;this.D=new g.yH;this.X=new aG(this.eFc,this);this.W=null;this.j=!1;this.V=null;this.KP="";this.sF=this.T=0;this.L=[];this.xq=U;this.qh=F;this.U=e;this.iG=K;this.YN=v;this.v5=d;this.rz=null;this.K=g.Ho();this.SN=Y;this.Kp=C;this.kq=J;this.W5=m;this.c5=P;this.Rg=A;this.lG=new Wzp;this.vQ=new Qp8;this.If=new Z1C;this.Nh=new Ec$;this.yT=new R_$;this.JB=new h_C;this.P5=new ncC},sSY=function(r, l,U,F,Y){Aw8(r); if(r.W){var e=g.l4("ID_TOKEN"),d=r.W.o2||{};e?d["x-youtube-identity-token"]=e:delete d["x-youtube-identity-token"];r.W.o2=d}MJj(r);F?(F.getState()!=3&&rwY(F)==0||F.getState(),r.W.connect(l,U,r.kN,F.K,F.GV)):Y?r.W.connect(l,U,r.kN,Y.sessionId,Y.arrayId):r.W.connect(l,U,r.kN)},EDC=function(r,l){return r.c5?!0:r.W5?Object.values(x18).includes(l):r.kq?!Object.values(W_Y).includes(l):r.Rg?Object.values(QSC).includes(l):!1},hZR=function(r){var l,U; g.y(function(F){if(F.X==1)return g.E4(F,2),g.T(F,Z8G(r),2);g.iz(F);l=r.L;r.L=[];U=l.length;RZq(r,l,U);IG(r);return g.Nf(F,0)})},RZq=function(r,l,U){for(var F=0;F0?U=Object.assign({},U,l):delete U.Authorization;r.W.o2=U}},MJj=function(r){r.YN&&!r.U&&GnY(r,r.YN())},ku=function(r){this.scheme="https"; this.port=this.domain="";this.W="/api/lounge";this.X=!0;r=r||document.location.href;var l=Number(g.R9(r)[4]||null)||"";l&&(this.port=":"+l);this.domain=g.h2(r)||"";r=g.Rc();r.search("MSIE")>=0&&(r=r.match(/MSIE ([\d.]+)/)[1],g.Zr(r,"10.0")<0&&(this.X=!1))},oX=function(r,l){var U=r.W; r.X&&(U=r.scheme+"://"+r.domain+r.port+r.W);return g.jD(U+l,{})},Xgq=function(r,l){g.xn.call(this); var U=this;this.s4=r();this.s4.subscribe("handlerOpened",this.a4,this);this.s4.subscribe("handlerClosed",this.onClosed,this);this.s4.subscribe("handlerError",function(F,Y){U.onError(Y)}); this.s4.subscribe("handlerMessage",this.onMessage,this);this.W=l},i88=function(r,l,U){var F=this; U=U===void 0?function(){return""}:U; var Y=Y===void 0?new RRR:Y;var e=e===void 0?new g.yH:e;this.pathPrefix=r;this.W=l;this.KP=U;this.U=e;this.T=null;this.V=this.j=0;this.channel=null;this.D=0;this.L=new aG(function(){F.L.isActive();var d;((d=F.channel)==null?void 0:kq$((new Go$(d,d.W)).W.X))===0&&F.connect(F.T,F.j)}); this.K={};this.X={};this.kN=!1;this.logger=null;this.sF=[];this.MJ=void 0;this.iG=new Wzp;this.rz=new Qp8;this.YN=new Ec$;this.qh=new R_$},b8p=function(r){g.C9(r.channel,"m",function(){r.D=3; r.L.reset();r.T=null;r.j=0;for(var l=g.Q(r.sF),U=l.next();!U.done;U=l.next())U=U.value,r.channel&&r.channel.send(U);r.sF=[];r.publish("webChannelOpened");r.iG.EN("WEB_CHANNEL")}); g.C9(r.channel,"n",function(){r.D=0;r.L.isActive()||r.publish("webChannelClosed");var l,U=(l=r.channel)==null?void 0:XXq(new Go$(l,l.W));U&&(r.sF=[].concat(g.G(U)));r.rz.EN("WEB_CHANNEL")}); g.C9(r.channel,"p",function(l){var U=l.data;U[0]==="gracefulReconnect"?(r.L.start(),r.channel&&r.channel.close()):r.publish("webChannelMessage",new m18(U[0],U[1]));r.MJ=l.statusCode;r.YN.EN("WEB_CHANNEL")}); g.C9(r.channel,"o",function(){r.MJ===401||r.L.start();r.publish("webChannelError");r.qh.EN("WEB_CHANNEL","")})},NuY=function(r){var l=r.KP(); l?r.K["x-youtube-lounge-xsrf-token"]=l:delete r.K["x-youtube-lounge-xsrf-token"]},jSb=function(r){g.xn.call(this); this.W=r();this.W.subscribe("webChannelOpened",this.O2,this);this.W.subscribe("webChannelClosed",this.onClosed,this);this.W.subscribe("webChannelError",this.onError,this);this.W.subscribe("webChannelMessage",this.onMessage,this)},qyC=function(r,l,U,F,Y){function e(){return new PN8(oX(r,"/bc"),l,!1,U,F)} U=U===void 0?function(){return""}:U; return g.i4("enable_mdx_web_channel_desktop")?new jSb(function(){return new i88(oX(r,"/wc"),l,U)}):new Xgq(e,Y)},BuC=function(){var r=TuG; uob();rb.push(r);yw8()},$I=function(r,l){uob(); var U=H8R(r,String(l));rb.length==0?gDC(U):(yw8(),g.yC(rb,function(F){F(U)}))},la=function(r){$I("CP",r)},uob=function(){rb||(rb=g.LP("yt.mdx.remote.debug.handlers_")||[],g.te("yt.mdx.remote.debug.handlers_",rb))},gDC=function(r){var l=(UP+1)%50; UP=l;FZ[l]=r;YI||(YI=l==49)},yw8=function(){var r=rb; if(FZ[0]){var l=YI?UP:-1,U={};do U={oa:void 0},l=(l+1)%50,U.oa=FZ[l],g.yC(r,function(F){return function(Y){Y(F.oa)}}(U)); while(l!=UP);FZ=Array(50);UP=-1;YI=!1}},H8R=function(r,l){var U=(Date.now()-wg$)/1E3; U.toFixed&&(U=U.toFixed(3));var F=[];F.push("[",U+"s","] ");F.push("[","yt.mdx.remote","] ");F.push(r+": "+l,"\n");return F.join("")},ef=function(r){g.WV.call(this); this.D=r;this.screens=[]},D1r=function(r,l){var U=r.get(l.uuid)||r.get(l.id); if(U)return r=U.name,U.id=l.id||U.id,U.name=l.name,U.token=l.token,U.uuid=l.uuid||U.uuid,U.name!=r;r.screens.push(l);return!0},VJj=function(r,l){var U=r.screens.length!=l.length; r.screens=g.wV(r.screens,function(e){return!!YBj(l,e)}); for(var F=l.length,Y=0;Y0&&r.K0&&WS(r,U)},function(l){r.U=function(){}; r.SD(l)})},skY=function(r){var l={}; l.pairingCode=r.rz;l.theme=r.OF;MX8()&&(l.env_useStageMdx=1);return g.No(l)},xt$=function(r){return new Promise(function(l){r.rz=UOf(); if(r.iG){var U=new chrome.cast.DialLaunchResponse(!0,skY(r));l(U);MdC(r)}else r.kN=function(){g.n1(r.V);r.kN=function(){}; r.V=NaN;var F=new chrome.cast.DialLaunchResponse(!0,skY(r));l(F);MdC(r)},r.V=g.Rp(function(){r.kN()},100)})},Qkp=function(r,l,U){r.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(l)); var F=new Oz(l);return(new Promise(function(Y){WRC(r,F,function(e){e?(r.sF=!0,JJ(r.K,F),PS(r,F),WS(r,U)):g.Yc(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(l)+" is not online."));Y(e)},5)})).then(function(Y){return Y?new chrome.cast.DialLaunchResponse(!1):xt$(r)})},EmC=function(r,l){var U=r.T.receiver.label,F=r.X.friendlyName; return(new Promise(function(Y){rOq(r.K,U,l,F,function(e){e&&e.token&&PS(r,e);Y(e)},function(e){AJ(r,"Failed to get DIAL screen: "+e); Y(null)})})).then(function(Y){return Y&&Y.token?new chrome.cast.DialLaunchResponse(!1):xt$(r)})},WRC=function(r,l,U,F){g.n1(r.D); r.D=0;lHq(r.K,l,function(Y){Y||F<0?U(Y):r.D=g.Rp(function(){WRC(r,l,U,F-1)},300)})},WS=function(r,l){r.info("getDialAppInfoWithTimeout_ "+l); xI(r)&&(g.n1(r.j),r.j=0,l==0?Znj(r):r.j=g.Rp(function(){Znj(r)},l))},Znj=function(r){xI(r)&&r.L.getDialAppInfo(function(l){r.info("getDialAppInfo dialLaunchData: "+JSON.stringify(l)); l=l.extraData||{};var U=null;if(l.loungeToken){var F;((F=r.W)==null?void 0:F.token)==l.loungeToken&&(U="staleLoungeToken")}else U="missingLoungeToken";U?(r.KP=U,WS(r,3E4)):(r.sF=!1,r.KP="unknown",eV8(r,l.loungeToken),WS(r,l.loungeTokenRefreshIntervalMs))},function(l){r.info("getDialAppInfo error: "+l); r.KP="noLoungeTokenResponse";WS(r,3E4)})},RV8=function(r){g.n1(r.D); r.D=0;g.n1(r.j);r.j=0;r.U();r.U=function(){}; g.n1(r.V)},QJ=function(r,l){mi.call(this,r,l,"ManualSession"); this.L=g.Rp((0,g.UY)(this.DK,this,null),150)},EP=function(r,l){g.WV.call(this); this.config_=l;this.X=r;this.T=l.appId||"233637DE";this.K=l.theme||"cl";this.V=l.disableCastApi||!1;this.D=l.forceMirroring||!1;this.W=null;this.j=!1;this.L=[];this.U=(0,g.UY)(this.xSc,this)},hVY=function(r,l){return l?g.m8(r.L,function(U){return Kt(l,U.label)},r):null},Z7=function(r){$I("Controller",r)},TuG=function(r){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(r)},RX=function(r){return r.j||!!r.L.length||!!r.W},hJ=function(r,l,U){l!=r.W&&(g.sV(r.W),(r.W=l)?(U?r.publish("yt-remote-cast2-receiver-resumed", l.X):r.publish("yt-remote-cast2-receiver-selected",l.X),l.subscribe("sessionScreen",(0,g.UY)(r.sK,r,l)),l.subscribe("sessionFailed",function(){return nmq(r,l)}),l.W?r.publish("yt-remote-cast2-session-change",l.W):U&&r.W.DK(null)):r.publish("yt-remote-cast2-session-change",null))},nmq=function(r,l){r.W==l&&r.publish("yt-remote-cast2-session-failed")},G_R=function(r){var l=r.X.oE(),U=r.W&&r.W.X; r=g.aI(l,function(F){U&&Kt(F,U.label)&&(U=null);var Y=F.uuid?F.uuid:F.id,e=hVY(this,F);e?(e.label=Y,e.friendlyName=F.name):(e=new chrome.cast.Receiver(Y,F.name),e.receiverType=chrome.cast.ReceiverType.CUSTOM);return e},r); U&&(U.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(U=new chrome.cast.Receiver(U.label,U.friendlyName),U.receiverType=chrome.cast.ReceiverType.CUSTOM),r.push(U));return r},T5C=function(r,l,U,F){F.disableCastApi?ns("Cannot initialize because disabled by Mdx config."):X6$()?inY(l,F)&&(bn0(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?N5Y(r,U):(window.__onGCastApiAvailable=function(Y,e){Y?N5Y(r,U):(Gm("Failed to load cast API: "+e),jkq(!1),bn0(!1),g.zq("yt-remote-cast-available"),g.zq("yt-remote-cast-receiver"), qFj(),U(!1))},F.loadCastApiSetupScript?g.Mt("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?xOf()>=60&&XL8():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?ZSp():xOf()>=89?bS8():(Gq$(),xu(iSf.map(RbC))))):ns("Cannot initialize because not running Chrome")},qFj=function(){ns("dispose"); var r=XZ();r&&r.dispose();g.te("yt.mdx.remote.cloudview.instance_",null);uIq(!1);g.P6(yOb);yOb.length=0},ia=function(){return!!g.SX("yt-remote-cast-installed")},B58=function(){var r=g.SX("yt-remote-cast-receiver"); return r?r.friendlyName:null},HnR=function(){ns("clearCurrentReceiver"); g.zq("yt-remote-cast-receiver")},gm0=function(){return ia()?XZ()?XZ().getCastSession():(Gm("getCastSelector: Cast is not initialized."),null):(Gm("getCastSelector: Cast API is not installed!"),null)},w6r=function(){ia()?XZ()?ba()?(ns("Requesting cast selector."),XZ().requestSession()):(ns("Wait for cast API to be ready to request the session."),yOb.push(g.mR("yt-remote-cast2-api-ready",w6r))):Gm("requestCastSelector: Cast is not initialized."):Gm("requestCastSelector: Cast API is not installed!")}, Ng=function(r,l){ba()?XZ().setConnectedScreenStatus(r,l):Gm("setConnectedScreenStatus called before ready.")},X6$=function(){var r=g.Rc().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.SG||r},DtY=function(r,l){XZ().init(r,l)},inY=function(r,l){var U=!1; XZ()||(r=new EP(r,l),r.subscribe("yt-remote-cast2-availability-change",function(F){g.fS("yt-remote-cast-available",F);MM("yt-remote-cast2-availability-change",F)}),r.subscribe("yt-remote-cast2-receiver-selected",function(F){ns("onReceiverSelected: "+F.friendlyName); g.fS("yt-remote-cast-receiver",F);MM("yt-remote-cast2-receiver-selected",F)}),r.subscribe("yt-remote-cast2-receiver-resumed",function(F){ns("onReceiverResumed: "+F.friendlyName); g.fS("yt-remote-cast-receiver",F);MM("yt-remote-cast2-receiver-resumed",F)}),r.subscribe("yt-remote-cast2-session-change",function(F){ns("onSessionChange: "+Ct(F)); F||g.zq("yt-remote-cast-receiver");MM("yt-remote-cast2-session-change",F)}),g.te("yt.mdx.remote.cloudview.instance_",r),U=!0); ns("cloudview.createSingleton_: "+U);return U},XZ=function(){return g.LP("yt.mdx.remote.cloudview.instance_")},N5Y=function(r,l){jkq(!0); bn0(!1);DtY(r,function(U){U?(uIq(!0),g.AO("yt-remote-cast2-api-ready")):(Gm("Failed to initialize cast API."),jkq(!1),g.zq("yt-remote-cast-available"),g.zq("yt-remote-cast-receiver"),qFj());l(U)})},ns=function(r){$I("cloudview",r)},Gm=function(r){$I("cloudview",r)},jkq=function(r){ns("setCastInstalled_ "+r); g.fS("yt-remote-cast-installed",r)},ba=function(){return!!g.LP("yt.mdx.remote.cloudview.apiReady_")},uIq=function(r){ns("setApiReady_ "+r); g.te("yt.mdx.remote.cloudview.apiReady_",r)},bn0=function(r){g.te("yt.mdx.remote.cloudview.initializing_",r)},jf=function(r){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.U=this.D=0;this.trackData=null;this.Dr=this.J3=!1;this.T=this.L=this.j=this.X=0;this.W=NaN;this.K=!1;this.reset(r)},Vdr=function(r){r.audioTrackId=null; r.trackData=null;r.playerState=-1;r.J3=!1;r.Dr=!1;r.D=0;r.U=g.Y0();r.X=0;r.j=0;r.L=0;r.T=0;r.W=NaN;r.K=!1},qg=function(r){return r.isPlaying()?(g.Y0()-r.U)/1E3:0},Tm=function(r,l){r.D=l; r.U=g.Y0()},ua=function(r){switch(r.playerState){case 1:case 1081:return(g.Y0()-r.U)/1E3+r.D; case -1E3:return 0}return r.D},fHp=function(r){return r.K?r.j+qg(r):r.j},yJ=function(r,l,U){var F=r.videoId; r.videoId=l;r.index=U;l!=F&&Vdr(r)},SFG=function(r){var l={}; l.index=r.index;l.listId=r.listId;l.videoId=r.videoId;l.playerState=r.playerState;l.volume=r.volume;l.muted=r.muted;l.audioTrackId=r.audioTrackId;l.trackData=g.rT(r.trackData);l.hasPrevious=r.J3;l.hasNext=r.Dr;l.playerTime=r.D;l.playerTimeAt=r.U;l.seekableStart=r.X;l.seekableEnd=r.j;l.duration=r.L;l.loadedTime=r.T;l.liveIngestionTime=r.W;return l},HS=function(r,l){g.WV.call(this); var U=this;this.L=0;this.K=r;this.D=[];this.U=new CNC;this.X=this.W=null;this.V=(0,g.UY)(this.ENG,this);this.j=(0,g.UY)(this.TR,this);this.T=(0,g.UY)(this.Tzz,this);this.kN=(0,g.UY)(this.ywu,this);var F=0;r?(F=r.getProxyState(),F!=3&&(r.subscribe("proxyStateChange",this.Sy,this),zVj(this))):F=3;F!=0&&(l?this.Sy(F):g.Rp(function(){U.Sy(F)},0)); (r=gm0())&&BS(this,r);this.subscribe("yt-remote-cast2-session-change",this.kN)},gb=function(r){return new jf(r.K.getPlayerContextData())},zVj=function(r){g.yC("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(l){this.D.push(this.K.subscribe(l,g.Fq(this.wnN,l),this))},r)},p6$=function(r){g.yC(r.D,function(l){this.K.unsubscribeByKey(l)},r); r.D.length=0},wb=function(r){return r.getState()==1},D7=function(r,l){var U=r.U; U.W.length+U.X.length<50&&r.U.enqueue(l)},tdC=function(r,l,U){var F=gb(r); Tm(F,U);F.playerState!=-1E3&&(F.playerState=l);VJ(r,F)},fs=function(r,l,U){r.K.sendMessage(l,U)},VJ=function(r,l){p6$(r); r.K.setPlayerContextData(SFG(l));zVj(r)},BS=function(r,l){r.X&&(r.X.removeUpdateListener(r.V),r.X.removeMediaListener(r.j),r.TR(null)); r.X=l;r.X&&(la("Setting cast session: "+r.X.sessionId),r.X.addUpdateListener(r.V),r.X.addMediaListener(r.j),r.X.media.length&&r.TR(r.X.media[0]))},LR0=function(r){var l=r.W.media,U=r.W.customData; if(l&&U){var F=gb(r);l.contentId!=F.videoId&&la("Cast changing video to: "+l.contentId);F.videoId=l.contentId;F.playerState=U.playerState;Tm(F,r.W.getEstimatedTime());VJ(r,F)}else la("No cast media video. Ignoring state update.")},Sf=function(r,l,U){return(0,g.UY)(function(F){this.qJ("Failed to "+l+" with cast v2 channel. Error code: "+F.code); F.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.qJ("Retrying "+l+" using MDx browser channel."),fs(this,l,U))},r)},tJ=function(r,l,U,F){F=F===void 0?!1:F; g.WV.call(this);var Y=this;this.D=NaN;this.rz=!1;this.V=this.T=this.sF=this.KP=NaN;this.kN=[];this.U=this.j=this.K=this.W=this.X=null;this.iG=r;this.YN=F;this.kN.push(g.NO(window,"beforeunload",function(){Y.uc(2)})); this.L=[];this.W=new jf;this.OF=l.id;this.qh=l.idType;this.X=qyC(this.iG,U,this.h0,this.qh=="shortLived",this.OF);this.X.listen("channelOpened",function(){cOY(Y)}); this.X.listen("channelClosed",function(){zm("Channel closed");isNaN(Y.D)?PJ(!0):PJ();Y.dispose()}); this.X.listen("channelError",function(e){PJ();isNaN(Y.Y$())?(e==1&&Y.qh=="shortLived"&&Y.publish("browserChannelAuthError",e),zm("Channel error: "+e+" without reconnection"),Y.dispose()):(Y.rz=!0,zm("Channel error: "+e+" with reconnection in "+Y.Y$()+" ms"),ps(Y,2))}); this.X.listen("channelMessage",function(e){aH8(Y,e)}); this.X.OH(l.token);this.subscribe("remoteQueueChange",function(){var e=Y.W.videoId;g.pS()&&g.fS("yt-remote-session-video-id",e)})},IHf=function(r){return g.m8(r.L,function(l){return l.type=="LOUNGE_SCREEN"})},zm=function(r){$I("conn",r)},ps=function(r,l){r.publish("proxyStateChange",l)},k_f=function(r){r.D=g.Rp(function(){zm("Connecting timeout"); r.uc(1)},2E4)},orR=function(r){g.n1(r.D); r.D=NaN},r98=function(r){g.n1(r.KP); r.KP=NaN},lf0=function(r){$Ar(r); r.sF=g.Rp(function(){Ls(r,"getNowPlaying")},2E4)},$Ar=function(r){g.n1(r.sF); r.sF=NaN},cOY=function(r){zm("Channel opened"); r.rz&&(r.rz=!1,r98(r),r.KP=g.Rp(function(){zm("Timing out waiting for a screen.");r.uc(1)},15E3))},Fa$=function(r,l){var U=null; if(l){var F=IHf(r);F&&(U={clientName:F.clientName,deviceMake:F.brand,deviceModel:F.model,osVersion:F.osVersion})}g.te("yt.mdx.remote.remoteClient_",U);l&&(orR(r),r98(r));U=r.X.Eu()&&isNaN(r.D);l==U?l&&(ps(r,1),Ls(r,"getSubtitlesTrack")):l?(r.eC()&&r.W.reset(),ps(r,1),Ls(r,"getNowPlaying"),UAq(r)):r.uc(1)},Yuq=function(r,l){var U=l.params.videoId; delete l.params.videoId;U==r.W.videoId&&(g.aY(l.params)?r.W.trackData=null:r.W.trackData=l.params,r.publish("remotePlayerChange"))},egG=function(r,l,U){var F=l.params.videoId||l.params.video_id,Y=parseInt(l.params.currentIndex,10); r.W.listId=l.params.listId||r.W.listId;yJ(r.W,F,Y);r.publish("remoteQueueChange",U)},OZC=function(r,l){l.params=l.params||{}; egG(r,l,"NOW_PLAYING_MAY_CHANGE");dAq(r,l);r.publish("autoplayDismissed")},dAq=function(r,l){var U=parseInt(l.params.currentTime||l.params.current_time,10); Tm(r.W,isNaN(U)?0:U);U=parseInt(l.params.state,10);U=isNaN(U)?-1:U;U==-1&&r.W.playerState==-1E3&&(U=-1E3);r.W.playerState=U;U=Number(l.params.loadedTime);r.W.T=isNaN(U)?0:U;r.W.GI(Number(l.params.duration));U=r.W;var F=Number(l.params.liveIngestionTime);U.W=F;U.K=isNaN(F)?!1:!0;U=r.W;F=Number(l.params.seekableStartTime);l=Number(l.params.seekableEndTime);U.X=isNaN(F)?0:F;U.j=isNaN(l)?0:l;r.W.playerState==1?lf0(r):$Ar(r);r.publish("remotePlayerChange")},Ka0=function(r,l){if(r.W.playerState!=-1E3){var U= 1085; switch(parseInt(l.params.adState,10)){case 1:U=1081;break;case 2:U=1084;break;case 0:U=1083}r.W.playerState=U;l=parseInt(l.params.currentTime,10);Tm(r.W,isNaN(l)?0:l);r.publish("remotePlayerChange")}},C3R=function(r,l){var U=l.params.muted=="true"; r.W.volume=parseInt(l.params.volume,10);r.W.muted=U;r.publish("remotePlayerChange")},vr8=function(r,l){r.j=l.params.videoId; r.publish("nowAutoplaying",parseInt(l.params.timeout,10))},J9p=function(r,l){r.j=l.params.videoId||null; r.publish("autoplayUpNext",r.j)},mA8=function(r,l){r.U=l.params.autoplayMode; r.publish("autoplayModeChange",r.U);r.U=="DISABLED"&&r.publish("autoplayDismissed")},P3G=function(r,l){var U=l.params.hasNext=="true"; r.W.J3=l.params.hasPrevious=="true";r.W.Dr=U;r.publish("previousNextChange")},aH8=function(r,l){l=l.message; l.params?zm("Received: action="+l.action+", params="+g.L9(l.params)):zm("Received: action="+l.action+" {}");switch(l.action){case "loungeStatus":l=lZ(l.params.devices);r.L=g.aI(l,function(F){return new dm(F)}); l=!!g.m8(r.L,function(F){return F.type=="LOUNGE_SCREEN"}); Fa$(r,l);l=r.ij("mlm");r.publish("multiStateLoopEnabled",l);break;case "loungeScreenDisconnected":g.x0(r.L,function(F){return F.type=="LOUNGE_SCREEN"}); Fa$(r,!1);break;case "remoteConnected":var U=new dm(lZ(l.params.device));g.m8(r.L,function(F){return F.equals(U)})||AZb(r.L,U); break;case "remoteDisconnected":U=new dm(lZ(l.params.device));g.x0(r.L,function(F){return F.equals(U)}); break;case "gracefulDisconnect":break;case "playlistModified":egG(r,l,"QUEUE_MODIFIED");break;case "nowPlaying":OZC(r,l);break;case "onStateChange":dAq(r,l);break;case "onAdStateChange":Ka0(r,l);break;case "onVolumeChanged":C3R(r,l);break;case "onSubtitlesTrackChanged":Yuq(r,l);break;case "nowAutoplaying":vr8(r,l);break;case "autoplayDismissed":r.publish("autoplayDismissed");break;case "autoplayUpNext":J9p(r,l);break;case "onAutoplayModeChanged":mA8(r,l);break;case "onHasPreviousNextChanged":P3G(r, l);break;case "requestAssistedSignIn":r.publish("assistedSignInRequested",l.params.authCode);break;case "onLoopModeChanged":r.publish("loopModeChange",l.params.loopMode);break;default:zm("Unrecognized action: "+l.action)}},UAq=function(r){g.n1(r.V); r.V=g.Rp(function(){r.uc(1)},864E5)},Ls=function(r,l,U){U?zm("Sending: action="+l+", params="+g.L9(U)):zm("Sending: action="+l); r.X.sendMessage(l,U)},A98=function(r){ef.call(this,"ScreenServiceProxy"); this.Cd=r;this.W=[];this.W.push(this.Cd.$_s("screenChange",(0,g.UY)(this.yP,this)));this.W.push(this.Cd.$_s("onlineScreenChange",(0,g.UY)(this.aLu,this)))},Q3G=function(r,l){A1G(); if(!A7||!A7.get("yt-remote-disable-remote-module-for-dev")){l=g.l4("MDX_CONFIG")||l;ebR();C0C();cS||(cS=new ku(l?l.loungeApiHost:void 0),MX8()&&(cS.W="/api/loungedev"));aX||(aX=g.LP("yt.mdx.remote.deferredProxies_")||[],g.te("yt.mdx.remote.deferredProxies_",aX));MA$();var U=IX();if(!U){var F=new vS(cS,l?l.disableAutomaticScreenCache||!1:!1);g.te("yt.mdx.remote.screenService_",F);U=IX();var Y={};l&&(Y={appId:l.appId,disableDial:l.disableDial,theme:l.theme,loadCastApiSetupScript:l.loadCastApiSetupScript, disableCastApi:l.disableCastApi,enableDialLoungeToken:l.enableDialLoungeToken,enableCastLoungeToken:l.enableCastLoungeToken,forceMirroring:l.forceMirroring});g.te("yt.mdx.remote.enableConnectWithInitialState_",l?l.enableConnectWithInitialState||!1:!1);T5C(r,F,function(e){e?kI()&&Ng(kI(),"YouTube TV"):F.subscribe("onlineScreenChange",function(){MM("yt-remote-receiver-availability-change")})},Y)}l&&!g.LP("yt.mdx.remote.initialized_")&&(g.te("yt.mdx.remote.initialized_",!0),o2("Initializing: "+g.L9(l)), rP.push(g.mR("yt-remote-cast2-api-ready",function(){MM("yt-remote-api-ready")})),rP.push(g.mR("yt-remote-cast2-availability-change",function(){MM("yt-remote-receiver-availability-change")})),rP.push(g.mR("yt-remote-cast2-receiver-selected",function(){$o(null); MM("yt-remote-auto-connect","cast-selector-receiver")})),rP.push(g.mR("yt-remote-cast2-receiver-resumed",function(){MM("yt-remote-receiver-resumed","cast-selector-receiver")})),rP.push(g.mR("yt-remote-cast2-session-change",s3r)),rP.push(g.mR("yt-remote-connection-change",function(e){e?Ng(kI(),"YouTube TV"):lm()||(Ng(null,null),HnR())})),rP.push(g.mR("yt-remote-cast2-session-failed",function(){MM("yt-remote-connection-failed")})),r=xAf(),l.isAuto&&(r.id+="#dial"),Y=l.capabilities||[],Y.length>0&&(r.capabilities= Y),r.name=l.device,r.app=l.app,(l=l.theme)&&(r.theme=l),o2(" -- with channel params: "+g.L9(r)),r?(g.fS("yt-remote-session-app",r.app),g.fS("yt-remote-session-name",r.name)):(g.zq("yt-remote-session-app"),g.zq("yt-remote-session-name")),g.te("yt.mdx.remote.channelParams_",r),U.start(),kI()||WaY())}},Erf=function(){var r=IX().Cd.$_gos(); var l=Uk();l&&Fn()&&(YBj(r,l)||r.push(l));return Fhj(r)},Rg8=function(){var r=ZZR(); !r&&ia()&&B58()&&(r={key:"cast-selector-receiver",name:B58()});return r},ZZR=function(){var r=Erf(),l=Uk(); l||(l=lm());return g.m8(r,function(U){return l&&Kt(l,U.key)?!0:!1})},Uk=function(){var r=kI(); if(!r)return null;var l=IX().rJ();return vJ(l,r)},s3r=function(r){o2("remote.onCastSessionChange_: "+Ct(r)); if(r){var l=Uk();if(l&&l.id==r.id){if(Ng(l.id,"YouTube TV"),r.idType=="shortLived"&&(r=r.token))Yo&&(Yo.token=r),(l=Fn())&&l.OH(r)}else l&&e_(),dP(r,1)}else Fn()&&e_()},e_=function(){ba()?XZ().stopSession():Gm("stopSession called before API ready."); var r=Fn();r&&(r.disconnect(1),hg8(null))},nrY=function(){var r=Fn(); return!!r&&r.getProxyState()!=3},o2=function(r){$I("remote",r)},IX=function(){if(!Gzq){var r=g.LP("yt.mdx.remote.screenService_"); Gzq=r?new A98(r):null}return Gzq},kI=function(){return g.LP("yt.mdx.remote.currentScreenId_")},Xh8=function(r){g.te("yt.mdx.remote.currentScreenId_",r)},iZC=function(){return g.LP("yt.mdx.remote.connectData_")},$o=function(r){g.te("yt.mdx.remote.connectData_",r)},Fn=function(){return g.LP("yt.mdx.remote.connection_")},hg8=function(r){var l=Fn(); $o(null);r||Xh8("");g.te("yt.mdx.remote.connection_",r);aX&&(g.yC(aX,function(U){U(r)}),aX.length=0); l&&!r?MM("yt-remote-connection-change",!1):!l&&r&&MM("yt-remote-connection-change",!0)},lm=function(){var r=g.pS(); if(!r)return null;var l=IX();if(!l)return null;l=l.rJ();return vJ(l,r)},dP=function(r,l){kI(); Uk()&&Uk();if(Ok)Yo=r;else{Xh8(r.id);var U=g.LP("yt.mdx.remote.enableConnectWithInitialState_")||!1;r=new tJ(cS,r,xAf(),U);r.connect(l,iZC());r.subscribe("beforeDisconnect",function(F){MM("yt-remote-before-disconnect",F)}); r.subscribe("beforeDispose",function(){Fn()&&(Fn(),hg8(null))}); r.subscribe("browserChannelAuthError",function(){var F=Uk();F&&F.idType=="shortLived"&&(ba()?XZ().handleBrowserChannelAuthError():Gm("refreshLoungeToken called before API ready."))}); hg8(r)}},WaY=function(){var r=lm(); r?(o2("Resume connection to: "+Ct(r)),dP(r,0)):(PJ(),HnR(),o2("Skipping connecting because no session screen found."))},MA$=function(){var r=xAf(); if(g.aY(r)){r=mD();var l=g.SX("yt-remote-session-name")||"",U=g.SX("yt-remote-session-app")||"";r={device:"REMOTE_CONTROL",id:r,name:l,app:U,mdxVersion:3};r.authuser=String(g.l4("SESSION_INDEX","0"));(l=g.l4("DELEGATED_SESSION_ID"))&&(r.pageId=String(l));g.te("yt.mdx.remote.channelParams_",r)}},xAf=function(){return g.LP("yt.mdx.remote.channelParams_")||{}},j3R=function(r,l,U){g.H.call(this); var F=this;this.W=r;this.C=l;this.mC=U;this.events=new g.Lg(this);this.U=!1;this.D=new g.MU(64);this.X=new g.F1(this.y3,500,this);this.L=new g.F1(this.le,1E3,this);this.T=new WJ(this.lZw,0,this);this.K={};this.V=new g.F1(this.No,1E3,this);this.j=new g.OS(this.seekTo,1E3,this);this.kN=this.events.G(this.C,"onVolumeChange",function(Y){bZY(F,Y)}); g.w(this,this.events);this.events.G(l,"onCaptionsTrackListChanged",this.FCh);this.events.G(l,"captionschanged",this.Gac);this.events.G(l,"captionssettingschanged",this.gO);this.events.G(l,"videoplayerreset",this.mq);this.events.G(l,"mdxautoplaycancel",function(){F.mC.OS()}); l.Y("enable_mdx_video_play_directly")&&this.events.G(l,"videodatachange",function(){Nrq(F.W)||Ku(F)||Cu(F,0)}); r=this.mC;r.QT();r.subscribe("proxyStateChange",this.nY,this);r.subscribe("remotePlayerChange",this.t5,this);r.subscribe("remoteQueueChange",this.mq,this);r.subscribe("previousNextChange",this.Br,this);r.subscribe("nowAutoplaying",this.NH,this);r.subscribe("autoplayDismissed",this.aV,this);g.w(this,this.X);g.w(this,this.L);g.w(this,this.T);g.w(this,this.V);g.w(this,this.j);this.gO();this.mq();this.t5()},bZY=function(r,l){if(Ku(r)){r.mC.unsubscribe("remotePlayerChange",r.t5,r); var U=Math.round(l.volume);l=!!l.muted;var F=gb(r.mC);if(U!==F.volume||l!==F.muted)r.mC.setVolume(U,l),r.V.start();r.mC.subscribe("remotePlayerChange",r.t5,r)}},quC=function(r){r.aj(0); r.X.stop();r.Z0(new g.MU(64))},TrY=function(r,l){if(Ku(r)&&!r.U){var U=null; l&&(U={style:r.C.getSubtitlesUserSettings()},Object.assign(U,l));r.mC.BN(r.C.getVideoData(1).videoId,U);r.K=gb(r.mC).trackData}},Cu=function(r,l){var U=r.C.getPlaylist(); if(U==null?0:U.listId){var F=U.index;var Y=U.listId.toString()}U=r.C.getVideoData(1);r.mC.playVideo(U.videoId,l,F,Y,U.playerParams,U.iG,P4$(U));r.Z0(new g.MU(1))},uH$=function(r,l){if(l){var U=r.C.getOption("captions","tracklist",{RY:1}); U&&U.length?(r.C.setOption("captions","track",l),r.U=!1):(r.C.loadModule("captions"),r.U=!0)}else r.C.setOption("captions","track",{})},Ku=function(r){return gb(r.mC).videoId===r.C.getVideoData(1).videoId},y9r=function(r,l){g.SI.call(this,r); this.W=l},vQ=function(){g.p.call(this,{Z:"div", S:"ytp-mdx-popup-dialog",J:{role:"dialog"},B:[{Z:"div",S:"ytp-mdx-popup-dialog-inner-content",B:[{Z:"div",S:"ytp-mdx-popup-title",XT:"Voc\u00ea n\u00e3o fez login"},{Z:"div",S:"ytp-mdx-popup-description",XT:"Os v\u00eddeos que voc\u00ea assistir poder\u00e3o ser adicionados ao hist\u00f3rico de visualiza\u00e7\u00e3o da TV e influenciar\u00e3o as recomenda\u00e7\u00f5es dela. Para evitar isso, cancele e fa\u00e7a login no YouTube em um computador."},{Z:"div",S:"ytp-mdx-privacy-popup-buttons",B:[{Z:"button", Dz:["ytp-button","ytp-mdx-privacy-popup-cancel"],XT:"Cancelar"},{Z:"button",Dz:["ytp-button","ytp-mdx-privacy-popup-confirm"],XT:"Confirmar"}]}]}]});this.fade=new g.P5(this,250);this.cancelButton=this.Zz("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.Zz("ytp-mdx-privacy-popup-confirm");g.w(this,this.fade);this.G(this.cancelButton,"click",this.W);this.G(this.confirmButton,"click",this.X)},JA=function(r){g.p.call(this,{Z:"div", S:"ytp-remote",B:[{Z:"div",S:"ytp-remote-display-status",B:[{Z:"div",S:"ytp-remote-display-status-icon",B:[g.JPK()]},{Z:"div",S:"ytp-remote-display-status-text",XT:"{{statustext}}"}]}]});this.api=r;this.fade=new g.P5(this,250);g.w(this,this.fade);this.G(r,"presentingplayerstatechange",this.onStateChange);this.GO(r.getPlayerStateObject())},mX=function(r,l){g.H1.call(this,"Reproduzir em",1,r,l); this.C=r;this.G7={};this.G(r,"onMdxReceiversChange",this.K);this.G(r,"presentingplayerstatechange",this.K);this.K()},Brq=function(r){g.Rf.call(this,r); this.Li={key:UOf(),name:"Este computador"};this.Wq=null;this.subscriptions=[];this.Ge=this.mC=null;this.G7=[this.Li];this.dB=this.Li;this.zn=new g.MU(64);this.Mz=0;this.uy=-1;this.pZ=!1;this.di=this.HP=this.sf=null;if(!g.LA(this.player.N())&&!g.aL(this.player.N())){r=this.player;var l=g.nF(r);l&&(l=l.ut())&&(l=new mX(r,l),g.w(this,l));l=new JA(r);g.w(this,l);g.Sg(r,l.element,4);this.sf=new vQ;g.w(this,this.sf);g.Sg(r,this.sf.element,4);this.pZ=!!lm()}},PQ=function(r){r.HP&&(r.player.removeEventListener("presentingplayerstatechange", r.HP),r.HP=null)},HZq=function(r,l,U){r.zn=U; r.player.publish("presentingplayerstatechange",new g.nv(U,l))},AA=function(r,l){if(l.key!==r.dB.key)if(l.key===r.Li.key)e_(); else if(Nrq(r)&&grY(r),r.dB=l,!r.player.N().Y("disable_mdx_connection_in_mdx_module_for_music_web")||!g.aL(r.player.N())){var U=r.player.getPlaylistId();var F=r.player.getVideoData(1);var Y=F.videoId;if(!U&&!Y||(r.player.getAppState()===2||r.player.getAppState()===1)&&r.player.N().Y("should_clear_video_data_on_player_cued_unstarted"))F=null;else{var e=r.player.getPlaylist();if(e){var d=[];for(var K=0;K2*this.size&&eP(this),!0):!1}; g.x.get=function(r,l){return Fc(this.X,r)?this.X[r]:l}; g.x.set=function(r,l){Fc(this.X,r)||(this.size+=1,this.W.push(r),this.Kv++);this.X[r]=l}; g.x.forEach=function(r,l){for(var U=this.lY(),F=0;F=F.W.length)return g.vc;var e=F.W[l++];return g.yA(r?e:F.X[e])}; return Y}; var qmC={nBf:"atp",MwT:"ska",BJP:"que",XjG:"mus",OKP:"sus",fBc:"dsp",u7P:"seq",Vru:"mic",hzT:"dpa",s2F:"mlm",IFF:"dsdtr",rGN:"ntb",q5z:"vsp",KfH:"scn",Vua:"rpe",zzw:"dcn",ovP:"dcp",j2Q:"pas",Pyf:"drq",igP:"opf",LfG:"els",Rnw:"isg",CLh:"svq",pjQ:"mvp",pZF:"ads",fyc:"stcp",iKc:"sads",JFQ:"dloc",gvF:"dcw"},TkY={dWH:"u",Dyw:"cl",A2z:"k",mbH:"i",TiN:"cr",R1Q:"m",Ubu:"g",rq:"up"},x18={KG:"adPlaying",H4:"onAdStateChange"},W_Y={Clz:"nowPlaying",e1f:"onStateChange",KG:"adPlaying",H4:"onAdStateChange",mM:"nowPlayingShorts", kD:"onShortsStateChange"},QSC={mM:"nowPlayingShorts",kD:"onShortsStateChange"};dm.prototype.equals=function(r){return r?this.id==r.id:!1}; var Kh0="",A7=null;g.W(sWp,g.kQ);var sz,nHC=Whb("loadCastFramework")||Whb("loadCastApplicationFramework"),iSf=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.OY(WJ,g.H);g.x=WJ.prototype;g.x.d2=function(r){this.K=arguments;this.W=!1;this.lI?this.L=g.Y0()+this.JF:this.lI=g.SH(this.U,this.JF)}; g.x.stop=function(){this.lI&&(g.pP.clearTimeout(this.lI),this.lI=null);this.L=null;this.W=!1;this.K=[]}; g.x.pause=function(){++this.X}; g.x.resume=function(){this.X&&(--this.X,!this.X&&this.W&&(this.W=!1,this.D.apply(null,this.K)))}; g.x.Rf=function(){this.stop();WJ.Xe.Rf.call(this)}; g.x.qn=function(){this.lI&&(g.pP.clearTimeout(this.lI),this.lI=null);this.L?(this.lI=g.SH(this.U,this.L-g.Y0()),this.L=null):this.X?this.W=!0:(this.W=!1,this.D.apply(null,this.K))};QU.prototype.stringify=function(r){return g.pP.JSON.stringify(r,void 0)}; QU.prototype.parse=function(r){return g.pP.JSON.parse(r,void 0)};g.OY(Nlq,g.lM);g.OY(jW8,g.lM);var qBf=null;g.OY(ut0,g.lM);g.OY(y1q,g.lM);g.OY(BlG,g.lM);h7.prototype.debug=function(){}; h7.prototype.info=function(){}; h7.prototype.warning=function(){};var zbR={},SB0={};g.x=nt.prototype;g.x.setTimeout=function(r){this.If=r}; g.x.w2=function(r){r=r.target;var l=this.yT;l&&g.rH(r)==3?l.m0():this.Qc(r)}; g.x.Qc=function(r){try{if(r==this.W)a:{var l=g.rH(this.W),U=this.W.X,F=this.W.getStatus();if(!(l<3)&&(l!=3||this.W&&(this.X.X||g.ll(this.W)||g.U2(this.W)))){this.YN||l!=4||U==7||(U==8||F<=0?Ez(3):Ez(2));Lhr(this);var Y=this.W.getStatus();this.Rg=Y;var e=fIr(this);if(this.D=Y==200){if(this.Kp&&!this.vQ){b:{if(this.W){var d=g.Fz(this.W,"X-HTTP-Initial-Response");if(d&&!g.Pi(d)){var K=d;break b}}K=null}if(r=K)this.vQ=!0,UZY(this,r);else{this.D=!1;this.U=3;ZT(12);Xc(this);iZ(this);break a}}if(this.qh){r= !0;for(var C;!this.YN&&this.j0&&!this.xq&&(this.xq=!0,this.L.z5(this)):(Xc(this),iZ(this))}else UZY(this,e);l==4&&Xc(this);this.D&&!this.YN&&(l==4?c1Y(this.L,this):(this.D=!1,Gr(this)))}else g.Qi$(this.W),Y==400&&e.indexOf("Unknown SID")> 0?(this.U=3,ZT(12)):(this.U=0,ZT(13)),Xc(this),iZ(this)}}}catch(v){}finally{}}; g.x.cancel=function(){this.YN=!0;Xc(this)}; g.x.CV=function(){this.kN=null;var r=Date.now();r-this.W5>=0?(this.OF!=2&&(Ez(3),ZT(17)),Xc(this),this.U=2,iZ(this)):tX8(this,this.W5-r)}; g.x.getLastError=function(){return this.U}; g.x.pO=function(){return this.W};Yff.prototype.cancel=function(){this.L=dZG(this);if(this.X)this.X.cancel(),this.X=null;else if(this.W&&this.W.size!==0){for(var r=g.Q(this.W.values()),l=r.next();!l.done;l=r.next())l.value.cancel();this.W.clear()}};g.x=JP$.prototype;g.x.Um=8;g.x.Jj=1;g.x.connect=function(r,l,U,F){ZT(0);this.SN=r;this.YN=l||{};U&&F!==void 0&&(this.YN.OSID=U,this.YN.OAID=F);this.vQ=this.c5;this.iG=rPq(this,null,this.SN);qM(this)}; g.x.disconnect=function(){PY8(this);if(this.Jj==3){var r=this.Nh++,l=this.iG.clone();g.xa(l,"SID",this.K);g.xa(l,"RID",r);g.xa(l,"TYPE","terminate");yU(this,l);r=new nt(this,this.K,r);r.OF=2;r.T=rm(l.clone());l=!1;if(g.pP.navigator&&g.pP.navigator.sendBeacon)try{l=g.pP.navigator.sendBeacon(r.T.toString(),"")}catch(U){}!l&&g.pP.Image&&((new Image).src=r.T,l=!0);l||(r.W=DOj(r.L,null),r.W.send(r.T));r.KP=Date.now();Gr(r)}Qm$(this)}; g.x.nx=function(){return this.Jj==0}; g.x.getState=function(){return this.Jj}; g.x.aE=function(r){if(this.D)if(this.D=null,this.Jj==1){if(!r){this.Nh=Math.floor(Math.random()*1E5);r=this.Nh++;var l=new nt(this,"",r),U=this.V;this.Rg&&(U?(U=g.oc(U),g.$8(U,this.Rg)):U=this.Rg);this.j!==null||this.W5||(l.iG=U,U=null);var F;if(this.kq)a:{for(var Y=F=0;Y4096){F=Y;break a}if(F===4096||Y===this.L.length-1){F=Y+1;break a}}F= 1E3}else F=1E3;F=smC(this,l,F);Y=this.iG.clone();g.xa(Y,"RID",r);g.xa(Y,"CVER",22);this.qh&&g.xa(Y,"X-HTTP-Session-Id",this.qh);yU(this,Y);U&&(this.W5?F="headers="+g.mV(g.DdH(U))+"&"+F:this.j&&g.ZF(Y,this.j,U));oC0(this.X,l);this.vl&&g.xa(Y,"TYPE","init");this.kq?(g.xa(Y,"$req",F),g.xa(Y,"SID","null"),l.Kp=!0,wL8(l,Y,null)):wL8(l,Y,F);this.Jj=2}}else this.Jj==3&&(r?xZC(this,r):this.L.length==0||eRb(this.X)||xZC(this))}; g.x.Yn=function(){this.T=null;W3b(this);if(this.JB&&!(this.If||this.W==null||this.bI<=0)){var r=2*this.bI;this.rz=RG((0,g.UY)(this.SFz,this),r)}}; g.x.SFz=function(){this.rz&&(this.rz=null,this.vQ=!1,this.If=!0,ZT(10),NM(this),W3b(this))}; g.x.z5=function(r){this.W==r&&this.JB&&!this.If&&(mZp(this),this.If=!0,ZT(11))}; g.x.DG=function(){this.kN!=null&&(this.kN=null,NM(this),IIp(this),ZT(19))}; g.x.w$a=function(r){r?ZT(2):ZT(1)}; g.x.isActive=function(){return!!this.U&&this.U.isActive(this)}; g.x=Zpr.prototype;g.x.jY=function(){}; g.x.Ma=function(){}; g.x.A0=function(){}; g.x.Om=function(){}; g.x.isActive=function(){return!0}; g.x.iH=function(){};g.OY(HJ,g.xn);HJ.prototype.open=function(){this.W.U=this.L;this.D&&(this.W.OF=!0);this.W.connect(this.U,this.X||void 0)}; HJ.prototype.close=function(){this.W.disconnect()}; HJ.prototype.send=function(r){var l=this.W;if(typeof r==="string"){var U={};U.__data__=r;r=U}else this.K&&(U={},U.__data__=g.L9(r),r=U);l.L.push(new F3p(l.jS++,r));l.Jj==3&&qM(l)}; HJ.prototype.Rf=function(){this.W.U=null;delete this.L;this.W.disconnect();delete this.W;HJ.Xe.Rf.call(this)}; g.OY(hRC,Nlq);g.OY(nCY,jW8);g.OY(BJ,Zpr);BJ.prototype.jY=function(){this.W.dispatchEvent("m")}; BJ.prototype.Ma=function(r){this.W.dispatchEvent(new hRC(r))}; BJ.prototype.A0=function(r){this.W.dispatchEvent(new nCY(r))}; BJ.prototype.Om=function(){this.W.dispatchEvent("n")};var wm=new g.xn;g.W(ipR,g.lM);g.x=VU.prototype;g.x.rX=null;g.x.Jn=!1;g.x.je=null;g.x.LL=null;g.x.AO=null;g.x.JX=null;g.x.Yl=null;g.x.zX=null;g.x.Cv=null;g.x.KI=null;g.x.Id=0;g.x.qo=null;g.x.Pa=null;g.x.qd=null;g.x.Od=-1;g.x.dO=!0;g.x.aB=!1;g.x.RH=0;g.x.Ng=null;var uiC={},TdC={};g.x=VU.prototype;g.x.setTimeout=function(r){this.X=r}; g.x.eA=function(r){r=r.target;var l=this.Ng;l&&g.rH(r)==3?l.m0():this.vN(r)}; g.x.vN=function(r){try{if(r==this.KI)a:{var l=g.rH(this.KI),U=this.KI.X,F=this.KI.getStatus();if(g.tM&&!g.nR("420+")){if(l<4)break a}else if(l<3||l==3&&!g.ll(this.KI))break a;this.aB||l!=4||U==7||(U==8||F<=0?this.W.k7(3):this.W.k7(2));Hpf(this);var Y=this.KI.getStatus();this.Od=Y;var e=g.ll(this.KI);if(this.Jn=Y==200){l==4&&ft(this);if(this.qh){for(r=!0;!this.aB&&this.Id0?(this.qd=3,DT(13)):(this.qd=0,DT(14)),ft(this),gCf(this)}}catch(K){}finally{}}; g.x.cancel=function(){this.aB=!0;ft(this)}; g.x.xi=function(){this.je=null;var r=Date.now();r-this.LL>=0?(this.JX!=2&&this.W.k7(3),ft(this),this.qd=2,DT(18),gCf(this)):Bdr(this,this.LL-r)}; g.x.getLastError=function(){return this.qd};g.x=fzY.prototype;g.x.ZC=null;g.x.gU=null;g.x.A6=!1;g.x.Fz=null;g.x.zl=null;g.x.Ll=-1;g.x.Ba=null;g.x.ix=null;g.x.connect=function(r){this.Fz=r;r=zr(this.W,null,this.Fz);DT(3);Date.now();var l=this.W.V;l!=null?(this.Ba=l[0],(this.ix=l[1])?(this.zl=1,SfC(this)):(this.zl=2,zR0(this))):($u(r,"MODE","init"),this.gU=new VU(this),this.gU.rX=this.ZC,jmq(this.gU,r,!1,null,!0),this.zl=0)}; g.x.nj=function(r){if(r)this.zl=2,zR0(this);else{DT(4);var l=this.W;l.ws=l.uO.Ll;cJ(l,9)}r&&this.k7(2)}; g.x.KL=function(r){return this.W.KL(r)}; g.x.abort=function(){this.gU&&(this.gU.cancel(),this.gU=null);this.Ll=-1}; g.x.nx=function(){return!1}; g.x.SY=function(r,l){this.Ll=r.Od;if(this.zl==0)if(l){try{var U=this.X.parse(l)}catch(F){r=this.W;r.ws=this.Ll;cJ(r,2);return}this.Ba=U[0];this.ix=U[1]}else r=this.W,r.ws=this.Ll,cJ(r,2);else this.zl==2&&(this.A6?(DT(7),Date.now()):l=="11111"?(DT(6),this.A6=!0,Date.now(),this.Ll=200,this.gU.cancel(),DT(12),pt(this.W,this,!0)):(DT(8),Date.now(),this.A6=!1))}; g.x.uD=function(){this.Ll=this.gU.Od;if(this.gU.Jn)this.zl==0?this.ix?(this.zl=1,SfC(this)):(this.zl=2,zR0(this)):this.zl==2&&(this.A6?(DT(12),pt(this.W,this,!0)):(DT(11),pt(this.W,this,!1)));else{this.zl==0?DT(9):this.zl==2&&DT(10);var r=this.W;this.gU.getLastError();r.ws=this.Ll;cJ(r,2)}}; g.x.Mp=function(){return this.W.Mp()}; g.x.isActive=function(){return this.W.isActive()}; g.x.k7=function(r){this.W.k7(r)};g.x=pXR.prototype;g.x.o2=null;g.x.jG=null;g.x.LS=null;g.x.Kd=null;g.x.rI=null;g.x.hX=null;g.x.Gd=null;g.x.dI=null;g.x.v3=0;g.x.U2=0;g.x.PZ=null;g.x.Px=null;g.x.Kl=null;g.x.Dt=null;g.x.uO=null;g.x.lz=null;g.x.GV=-1;g.x.bd=-1;g.x.ws=-1;g.x.Se=0;g.x.vC=0;g.x.wX=8;var wh8={OK:0,HKw:2,z5N:4,wjH:5,FFh:6,STOP:7,n$:8,kJh:9,mMw:10,HHa:11,XZG:12};g.OY(L3C,g.lM);g.OY(cPp,g.lM);g.x=pXR.prototype; g.x.connect=function(r,l,U,F,Y){DT(0);this.rI=l;this.jG=U||{};F&&Y!==void 0&&(this.jG.OSID=F,this.jG.OAID=Y);this.T?(gm((0,g.UY)(this.XR,this,r),100),Izp(this)):this.XR(r)}; g.x.disconnect=function(){koR(this);if(this.W==3){var r=this.v3++,l=this.hX.clone();g.xa(l,"SID",this.K);g.xa(l,"RID",r);g.xa(l,"TYPE","terminate");Lt(this,l);r=new VU(this,this.K,r);r.JX=2;r.Yl=rm(l.clone());(new Image).src=r.Yl.toString();r.AO=Date.now();qf8(r)}O8$(this)}; g.x.XR=function(r){this.uO=new fzY(this);this.uO.ZC=this.o2;this.uO.X=this.U;this.uO.connect(r)}; g.x.nx=function(){return this.W==0}; g.x.getState=function(){return this.W}; g.x.Em=function(r){this.Px=null;U1j(this,r)}; g.x.Td=function(){this.Kl=null;this.Kd=new VU(this,this.K,"rpc",this.j);this.Kd.rX=this.o2;this.Kd.RH=0;var r=this.Gd.clone();g.xa(r,"RID","rpc");g.xa(r,"SID",this.K);g.xa(r,"CI",this.lz?"0":"1");g.xa(r,"AID",this.GV);Lt(this,r);g.xa(r,"TYPE","xmlhttp");jmq(this.Kd,r,!0,this.dI,!1)}; g.x.SY=function(r,l){if(this.W!=0&&(this.Kd==r||this.LS==r))if(this.ws=r.Od,this.LS==r&&this.W==3)if(this.wX>7){try{var U=this.U.parse(l)}catch(F){U=null}if(Array.isArray(U)&&U.length==3)if(r=U,r[0]==0)a:{if(!this.Kl){if(this.Kd)if(this.Kd.AO+3E30)){if(F=l==1)this.LS||this.Px||this.W==1||this.Se>=2?F=!1:(this.Px=gm((0,g.UY)(this.Em,this,r),Yyj(this,this.Se)),this.Se++, F=!0);F=!(F||l==2&&eZr(this))}if(F)switch(U){case 1:cJ(this,5);break;case 4:cJ(this,10);break;case 3:cJ(this,6);break;case 7:cJ(this,12);break;default:cJ(this,2)}}}; g.x.QP=function(r){if(!g.Af(arguments,this.W))throw Error("Unexpected channel state: "+this.W);}; g.x.Cra=function(r){r?DT(2):(DT(1),d10(this,8))}; g.x.KL=function(r){if(r)throw Error("Can't create secondary domain capable XhrIo object.");r=new g.Ib;r.j=!1;return r}; g.x.isActive=function(){return!!this.PZ&&this.PZ.isActive(this)}; g.x.k7=function(r){var l=wm;l.dispatchEvent(new cPp(l,r))}; g.x.Mp=function(){return!1}; g.x=K_0.prototype;g.x.t0=function(){}; g.x.cN=function(){}; g.x.Na=function(){}; g.x.yc=function(){}; g.x.qE=function(){}; g.x.zd=function(){return{}}; g.x.isActive=function(){return!0};g.x=CNC.prototype;g.x.enqueue=function(r){this.X.push(r)}; g.x.isEmpty=function(){return this.W.length===0&&this.X.length===0}; g.x.clear=function(){this.W=[];this.X=[]}; g.x.contains=function(r){return g.Af(this.W,r)||g.Af(this.X,r)}; g.x.remove=function(r){var l=this.W;var U=(0,g.tS0)(l,r);U>=0?(g.Mj(l,U),l=!0):l=!1;return l||g.sY(this.X,r)}; g.x.r8=function(){for(var r=[],l=this.W.length-1;l>=0;--l)r.push(this.W[l]);l=this.X.length;for(var U=0;U=DAG.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(r=DAG[this.X],this.lI=g.Rp((0,g.UY)(this.GC,this),r),this.X++):this.publish("pairingFailed",Error("Server error "+r.status))}; g.x.jA=function(){this.W=null;this.publish("pairingFailed",Error("Server not responding"))}; var DAG=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.OY(OP,ef);g.x=OP.prototype;g.x.start=function(){db(this)&&this.publish("screenChange");!g.SX("yt-remote-lounge-token-expiration")&&zZC(this);g.n1(this.W);this.W=g.Rp((0,g.UY)(this.start,this),1E4)}; g.x.add=function(r,l){db(this);D1r(this,r);Ks(this,!1);this.publish("screenChange");l(r);r.token||zZC(this)}; g.x.remove=function(r,l){var U=db(this);fN0(this,r)&&(Ks(this,!1),U=!0);l(r);U&&this.publish("screenChange")}; g.x.Ev=function(r,l,U,F){var Y=db(this),e=this.get(r.id);e?(e.name!=l&&(e.name=l,Ks(this,!1),Y=!0),U(r)):F(Error("no such local screen."));Y&&this.publish("screenChange")}; g.x.Rf=function(){g.n1(this.W);OP.Xe.Rf.call(this)}; g.x.DH=function(r){db(this);var l=this.screens.length;r=r&&r.screens||[];for(var U=r.length,F=0;F20)break a;K=l(e,d)}e=K}Y.name=e}U(JJ(this,Y))},this), onError:(0,g.UY)(function(Y){F(Error("pairing request failed: "+Y.status))},this), onTimeout:(0,g.UY)(function(){F(Error("pairing request timed out."))},this)})}; g.x.Rf=function(){g.sV(this.X);g.sV(this.W);vS.Xe.Rf.call(this)}; g.x.jl=function(){Ut$(this);this.publish("screenChange");this.W.update()}; vS.prototype.dispose=vS.prototype.dispose;g.OY(mi,g.WV);g.x=mi.prototype;g.x.SD=function(r){this.QT()||(r&&(AJ(this,""+r),this.publish("sessionFailed")),this.W=null,this.publish("sessionScreen",null))}; g.x.info=function(r){$I(this.qh,r)}; g.x.PN=function(){return null}; g.x.OB=function(r){var l=this.X;r?(l.displayStatus=new chrome.cast.ReceiverDisplayStatus(r,[]),l.displayStatus.showStop=!0):l.displayStatus=null;chrome.cast.setReceiverDisplayStatus(l,(0,g.UY)(function(){this.info("Updated receiver status for "+l.friendlyName+": "+r)},this),(0,g.UY)(function(){AJ(this,"Failed to update receiver status for: "+l.friendlyName)},this))}; g.x.Rf=function(){this.OB("");mi.Xe.Rf.call(this)};g.W(Mg,mi);g.x=Mg.prototype;g.x.UB=function(r){if(this.L){if(this.L==r)return;AJ(this,"Overriding cast session with new session object");AO$(this);this.KP=!1;this.V="unknown";this.L.removeUpdateListener(this.sF);this.L.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.rz)}this.L=r;this.L.addUpdateListener(this.sF);this.L.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.rz);CtC(this,"getMdxSessionStatus")}; g.x.DK=function(r){this.info("launchWithParams no-op for Cast: "+g.L9(r))}; g.x.stop=function(){this.L?this.L.stop((0,g.UY)(function(){this.SD()},this),(0,g.UY)(function(){this.SD(Error("Failed to stop receiver app."))},this)):this.SD(Error("Stopping cast device without session."))}; g.x.OB=function(){}; g.x.Rf=function(){this.info("disposeInternal");AO$(this);this.L&&(this.L.removeUpdateListener(this.sF),this.L.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.rz));this.L=null;mi.prototype.Rf.call(this)}; g.x.wHf=function(r,l){if(!this.QT())if(l)if(l=lZ(l),g.oY(l))switch(r=""+l.type,l=l.data||{},this.info("onYoutubeMessage_: "+r+" "+g.L9(l)),r){case "mdxSessionStatus":dtG(this,l);break;case "loungeToken":vmf(this,l);break;default:AJ(this,"Unknown youtube message: "+r)}else AJ(this,"Unable to parse message.");else AJ(this,"No data in message.")}; g.x.Ml=function(r,l,U,F){g.n1(this.T);this.T=0;rOq(this.K,this.X.label,r,this.X.friendlyName,(0,g.UY)(function(Y){Y?l(Y):F>=0?(AJ(this,"Screen "+r+" appears to be offline. "+F+" retries left."),this.T=g.Rp((0,g.UY)(this.Ml,this,r,l,U,F-1),300)):U(Error("Unable to fetch screen."))},this),U)}; g.x.PN=function(){return this.L}; g.x.SA=function(r){this.QT()||r||(AJ(this,"Cast session died."),this.SD())};g.W(sP,mi);g.x=sP.prototype;g.x.UB=function(r){this.L=r;this.L.addUpdateListener(this.YN)}; g.x.DK=function(r){this.iG=r;this.kN()}; g.x.stop=function(){RV8(this);this.L?this.L.stop((0,g.UY)(this.SD,this,null),(0,g.UY)(this.SD,this,"Failed to stop DIAL device.")):this.SD()}; g.x.Rf=function(){RV8(this);this.L&&this.L.removeUpdateListener(this.YN);this.L=null;mi.prototype.Rf.call(this)}; g.x.GS=function(r){this.QT()||r||(AJ(this,"DIAL session died."),this.U(),this.U=function(){},this.SD())};g.W(QJ,mi);QJ.prototype.stop=function(){this.SD()}; QJ.prototype.UB=function(){}; QJ.prototype.DK=function(){g.n1(this.L);this.L=NaN;var r=vJ(this.K.rJ(),this.X.label);r?PS(this,r):this.SD(Error("No such screen"))}; QJ.prototype.Rf=function(){g.n1(this.L);this.L=NaN;mi.prototype.Rf.call(this)};g.W(EP,g.WV);g.x=EP.prototype; g.x.init=function(r,l){chrome.cast.timeout.requestSession=3E4;var U=new chrome.cast.SessionRequest(this.T,[chrome.cast.Capability.AUDIO_OUT]);g.i4("desktop_enable_cast_connect")&&(U.androidReceiverCompatible=!0);this.V||(U.dialRequest=new chrome.cast.DialRequest("YouTube"));var F=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;r=r||this.D?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var Y=(0,g.UY)(this.UST,this);U=new chrome.cast.ApiConfig(U,(0,g.UY)(this.Hu, this),Y,F,r);U.customDialLaunchCallback=(0,g.UY)(this.PGG,this);chrome.cast.initialize(U,(0,g.UY)(function(){this.QT()||(chrome.cast.addReceiverActionListener(this.U),BuC(),this.X.subscribe("onlineScreenChange",(0,g.UY)(this.IE,this)),this.L=G_R(this),chrome.cast.setCustomReceivers(this.L,function(){},(0,g.UY)(function(e){this.qJ("Failed to set initial custom receivers: "+g.L9(e))},this)),this.publish("yt-remote-cast2-availability-change",RX(this)),l(!0))},this),(0,g.UY)(function(e){this.qJ("Failed to initialize API: "+ g.L9(e)); l(!1)},this))}; g.x.Gpa=function(r,l){Z7("Setting connected screen ID: "+r+" -> "+l);if(this.W){var U=this.W.W;if(!r||U&&U.id!=r)Z7("Unsetting old screen status: "+this.W.X.friendlyName),hJ(this,null)}if(r&&l){if(!this.W){r=vJ(this.X.rJ(),r);if(!r){Z7("setConnectedScreenStatus: Unknown screen.");return}if(r.idType=="shortLived"){Z7("setConnectedScreenStatus: Screen with id type to be short lived.");return}U=hVY(this,r);U||(Z7("setConnectedScreenStatus: Connected receiver not custom..."),U=new chrome.cast.Receiver(r.uuid? r.uuid:r.id,r.name),U.receiverType=chrome.cast.ReceiverType.CUSTOM,this.L.push(U),chrome.cast.setCustomReceivers(this.L,function(){},(0,g.UY)(function(F){this.qJ("Failed to set initial custom receivers: "+g.L9(F))},this))); Z7("setConnectedScreenStatus: new active receiver: "+U.friendlyName);hJ(this,new QJ(this.X,U),!0)}this.W.OB(l)}else Z7("setConnectedScreenStatus: no screen.")}; g.x.fRN=function(r){this.QT()?this.qJ("Setting connection data on disposed cast v2"):this.W?this.W.DK(r):this.qJ("Setting connection data without a session")}; g.x.E2=function(){this.QT()?this.qJ("Stopping session on disposed cast v2"):this.W?(this.W.stop(),hJ(this,null)):Z7("Stopping non-existing session")}; g.x.requestSession=function(){chrome.cast.requestSession((0,g.UY)(this.Hu,this),(0,g.UY)(this.JtT,this))}; g.x.Rf=function(){this.X.unsubscribe("onlineScreenChange",(0,g.UY)(this.IE,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.U);var r=TuG,l=g.LP("yt.mdx.remote.debug.handlers_");g.sY(l||[],r);g.sV(this.W);g.WV.prototype.Rf.call(this)}; g.x.qJ=function(r){$I("Controller",r)}; g.x.sK=function(r,l){this.W==r&&(l||hJ(this,null),this.publish("yt-remote-cast2-session-change",l))}; g.x.xSc=function(r,l){if(!this.QT())if(r)switch(r.friendlyName=chrome.cast.unescape(r.friendlyName),Z7("onReceiverAction_ "+r.label+" / "+r.friendlyName+"-- "+l),l){case chrome.cast.ReceiverAction.CAST:if(this.W)if(this.W.X.label!=r.label)Z7("onReceiverAction_: Stopping active receiver: "+this.W.X.friendlyName),this.W.stop();else{Z7("onReceiverAction_: Casting to active receiver.");this.W.W&&this.publish("yt-remote-cast2-session-change",this.W.W);break}switch(r.receiverType){case chrome.cast.ReceiverType.CUSTOM:hJ(this, new QJ(this.X,r));break;case chrome.cast.ReceiverType.DIAL:hJ(this,new sP(this.X,r,this.K,this.config_));break;case chrome.cast.ReceiverType.CAST:hJ(this,new Mg(this.X,r,this.config_));break;default:this.qJ("Unknown receiver type: "+r.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.W&&this.W.X.label==r.label?this.W.stop():this.qJ("Stopping receiver w/o session: "+r.friendlyName)}else this.qJ("onReceiverAction_ called without receiver.")}; g.x.PGG=function(r){if(this.QT())return Promise.reject(Error("disposed"));var l=r.receiver;l.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.qJ("Not DIAL receiver: "+l.friendlyName),l.receiverType=chrome.cast.ReceiverType.DIAL);var U=this.W?this.W.X:null;if(!U||U.label!=l.label)return this.qJ("Receiving DIAL launch request for non-clicked DIAL receiver: "+l.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(U&&U.label==l.label&&U.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.W.W)return Z7("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.W.W),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.qJ('Changing CAST intent from "'+U.receiverType+'" to "dial" for '+l.friendlyName);hJ(this,new sP(this.X,l,this.K,this.config_))}l=this.W;l.T=r;l.T.appState==chrome.cast.DialAppState.RUNNING?(r=l.T.extraData||{},U=r.screenId||null,xI(l)&&r.loungeToken?r.loungeTokenRefreshIntervalMs?r=Qkp(l,{name:l.X.friendlyName,screenId:r.screenId,loungeToken:r.loungeToken,dialId:l.T.receiver.label, screenIdType:"shortLived"},r.loungeTokenRefreshIntervalMs):(g.Yc(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(r)+".")),r=EmC(l,U)):r=EmC(l,U)):r=xt$(l);return r}; g.x.Hu=function(r){var l=this;if(!this.QT()&&!this.D){Z7("New cast session ID: "+r.sessionId);var U=r.receiver;if(U.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.W)if(U.receiverType==chrome.cast.ReceiverType.CAST)Z7("Got resumed cast session before resumed mdx connection."),U.friendlyName=chrome.cast.unescape(U.friendlyName),hJ(this,new Mg(this.X,U,this.config_),!0);else{this.qJ("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var F=this.W.X,Y=vJ(this.X.rJ(), F.label);Y&&Kt(Y,U.label)&&F.receiverType!=chrome.cast.ReceiverType.CAST&&U.receiverType==chrome.cast.ReceiverType.CAST&&(Z7("onSessionEstablished_: manual to cast session change "+U.friendlyName),g.sV(this.W),this.W=new Mg(this.X,U,this.config_),this.W.subscribe("sessionScreen",(0,g.UY)(this.sK,this,this.W)),this.W.subscribe("sessionFailed",function(){return nmq(l,l.W)}),this.W.DK(null)); this.W.UB(r)}}}; g.x.bH=function(){return this.W?this.W.PN():null}; g.x.JtT=function(r){this.QT()||(this.qJ("Failed to estabilish a session: "+g.L9(r)),r.code!=chrome.cast.ErrorCode.CANCEL&&hJ(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.x.UST=function(r){Z7("Receiver availability updated: "+r);if(!this.QT()){var l=RX(this);this.j=r==chrome.cast.ReceiverAvailability.AVAILABLE;RX(this)!=l&&this.publish("yt-remote-cast2-availability-change",RX(this))}}; g.x.IE=function(){this.QT()||(this.L=G_R(this),Z7("Updating custom receivers: "+g.L9(this.L)),chrome.cast.setCustomReceivers(this.L,function(){},(0,g.UY)(function(){this.qJ("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",RX(this)))}; EP.prototype.setLaunchParams=EP.prototype.fRN;EP.prototype.setConnectedScreenStatus=EP.prototype.Gpa;EP.prototype.stopSession=EP.prototype.E2;EP.prototype.getCastSession=EP.prototype.bH;EP.prototype.requestSession=EP.prototype.requestSession;EP.prototype.init=EP.prototype.init;EP.prototype.dispose=EP.prototype.dispose;var yOb=[];g.x=jf.prototype; g.x.reset=function(r){this.listId="";this.index=-1;this.videoId="";Vdr(this);this.volume=-1;this.muted=!1;r&&(this.index=r.index,this.listId=r.listId,this.videoId=r.videoId,this.playerState=r.playerState,this.volume=r.volume,this.muted=r.muted,this.audioTrackId=r.audioTrackId,this.trackData=r.trackData,this.J3=r.hasPrevious,this.Dr=r.hasNext,this.D=r.playerTime,this.U=r.playerTimeAt,this.X=r.seekableStart,this.j=r.seekableEnd,this.L=r.duration,this.T=r.loadedTime,this.W=r.liveIngestionTime,this.K= !isNaN(this.W))}; g.x.isPlaying=function(){return this.playerState==1}; g.x.isBuffering=function(){return this.playerState==3}; g.x.s3=function(){return this.playerState==1081}; g.x.GI=function(r){this.L=isNaN(r)?0:r}; g.x.getDuration=function(){return this.K?this.L+qg(this):this.L}; g.x.clone=function(){return new jf(SFG(this))};g.W(HS,g.WV);g.x=HS.prototype;g.x.getState=function(){return this.L}; g.x.SQ=function(){return this.K.getReconnectTimeout()}; g.x.ob=function(){this.K.reconnect()}; g.x.play=function(){wb(this)?(this.W?this.W.play(null,g.JW,Sf(this,"play")):fs(this,"play"),tdC(this,1,ua(gb(this))),this.publish("remotePlayerChange")):D7(this,this.play)}; g.x.pause=function(){wb(this)?(this.W?this.W.pause(null,g.JW,Sf(this,"pause")):fs(this,"pause"),tdC(this,2,ua(gb(this))),this.publish("remotePlayerChange")):D7(this,this.pause)}; g.x.seekTo=function(r){if(wb(this)){if(this.W){var l=gb(this),U=new chrome.cast.media.SeekRequest;U.currentTime=r;l.isPlaying()||l.isBuffering()?U.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:U.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.W.seek(U,g.JW,Sf(this,"seekTo",{newTime:r}))}else fs(this,"seekTo",{newTime:r});tdC(this,3,r);this.publish("remotePlayerChange")}else D7(this,g.Fq(this.seekTo,r))}; g.x.stop=function(){if(wb(this)){this.W?this.W.stop(null,g.JW,Sf(this,"stopVideo")):fs(this,"stopVideo");var r=gb(this);r.index=-1;r.videoId="";Vdr(r);VJ(this,r);this.publish("remotePlayerChange")}else D7(this,this.stop)}; g.x.setVolume=function(r,l){if(wb(this)){var U=gb(this);if(this.X){if(U.volume!=r){var F=Math.round(r)/100;this.X.setReceiverVolumeLevel(F,(0,g.UY)(function(){la("set receiver volume: "+F)},this),(0,g.UY)(function(){this.qJ("failed to set receiver volume.")},this))}U.muted!=l&&this.X.setReceiverMuted(l,(0,g.UY)(function(){la("set receiver muted: "+l)},this),(0,g.UY)(function(){this.qJ("failed to set receiver muted.")},this))}else{var Y={volume:r, muted:l};U.volume!=-1&&(Y.delta=r-U.volume);fs(this,"setVolume",Y)}U.muted=l;U.volume=r;VJ(this,U)}else D7(this,g.Fq(this.setVolume,r,l))}; g.x.BN=function(r,l){if(wb(this)){var U=gb(this);r={videoId:r};l&&(U.trackData={trackName:l.name,languageCode:l.languageCode,sourceLanguageCode:l.translationLanguage?l.translationLanguage.languageCode:"",languageName:l.languageName,kind:l.kind},r.style=g.L9(l.style),g.$8(r,U.trackData));fs(this,"setSubtitlesTrack",r);VJ(this,U)}else D7(this,g.Fq(this.BN,r,l))}; g.x.setAudioTrack=function(r,l){wb(this)?(l=l.getLanguageInfo().getId(),fs(this,"setAudioTrack",{videoId:r,audioTrackId:l}),r=gb(this),r.audioTrackId=l,VJ(this,r)):D7(this,g.Fq(this.setAudioTrack,r,l))}; g.x.playVideo=function(r,l,U,F,Y,e,d){F=F===void 0?null:F;Y=Y===void 0?null:Y;e=e===void 0?null:e;d=d===void 0?null:d;var K=gb(this),C={videoId:r};U!==void 0&&(C.currentIndex=U);yJ(K,r,U||0);l!==void 0&&(Tm(K,l),C.currentTime=l);F&&(C.listId=F);Y&&(C.playerParams=Y);e&&(C.clickTrackingParams=e);d&&(C.locationInfo=g.L9(d));fs(this,"setPlaylist",C);F||VJ(this,K)}; g.x.xA=function(r,l){if(wb(this)){if(r&&l){var U=gb(this);yJ(U,r,l);VJ(this,U)}fs(this,"previous")}else D7(this,g.Fq(this.xA,r,l))}; g.x.nextVideo=function(r,l){if(wb(this)){if(r&&l){var U=gb(this);yJ(U,r,l);VJ(this,U)}fs(this,"next")}else D7(this,g.Fq(this.nextVideo,r,l))}; g.x.eg=function(){if(wb(this)){fs(this,"clearPlaylist");var r=gb(this);r.reset();VJ(this,r);this.publish("remotePlayerChange")}else D7(this,this.eg)}; g.x.OS=function(){wb(this)?fs(this,"dismissAutoplay"):D7(this,this.OS)}; g.x.dispose=function(){if(this.L!=3){var r=this.L;this.L=3;this.publish("proxyStateChange",r,this.L)}g.WV.prototype.dispose.call(this)}; g.x.Rf=function(){p6$(this);this.K=null;this.U.clear();BS(this,null);g.WV.prototype.Rf.call(this)}; g.x.Sy=function(r){if((r!=this.L||r==2)&&this.L!=3&&r!=0){var l=this.L;this.L=r;this.publish("proxyStateChange",l,r);if(r==1)for(;!this.U.isEmpty();)l=r=this.U,l.W.length===0&&(l.W=l.X,l.W.reverse(),l.X=[]),r.W.pop().apply(this);else r==3&&this.dispose()}}; g.x.wnN=function(r,l){this.publish(r,l)}; g.x.ENG=function(r){if(!r)this.TR(null),BS(this,null);else if(this.X.receiver.volume){r=this.X.receiver.volume;var l=gb(this),U=Math.round(100*r.level||0);if(l.volume!=U||l.muted!=r.muted)la("Cast volume update: "+r.level+(r.muted?" muted":"")),l.volume=U,l.muted=!!r.muted,VJ(this,l)}}; g.x.TR=function(r){la("Cast media: "+!!r);this.W&&this.W.removeUpdateListener(this.T);if(this.W=r)this.W.addUpdateListener(this.T),LR0(this),this.publish("remotePlayerChange")}; g.x.Tzz=function(r){r?(LR0(this),this.publish("remotePlayerChange")):this.TR(null)}; g.x.ZE=function(){fs(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.x.ywu=function(){var r=gm0();r&&BS(this,r)}; g.x.qJ=function(r){$I("CP",r)};g.W(tJ,g.WV);g.x=tJ.prototype; g.x.connect=function(r,l){if(l){var U=l.listId,F=l.videoId,Y=l.videoIds,e=l.playerParams,d=l.clickTrackingParams,K=l.index,C={videoId:F},v=l.currentTime,J=l.locationInfo;l=l.loopMode;v!==void 0&&(C.currentTime=v<=5?0:v);e&&(C.playerParams=e);J&&(C.locationInfo=J);d&&(C.clickTrackingParams=d);U&&(C.listId=U);Y&&Y.length>0&&(C.videoIds=Y.join(","));K!==void 0&&(C.currentIndex=K);this.YN&&(C.loopMode=l||"LOOP_MODE_OFF");U&&(this.W.listId=U);this.W.videoId=F;this.W.index=K||0;this.W.state=3;Tm(this.W, v);this.U="UNSUPPORTED";U=this.YN?"setInitialState":"setPlaylist";zm("Connecting with "+U+" and params: "+g.L9(C));this.X.connect({method:U,params:g.L9(C)},r,vHp())}else zm("Connecting without params"),this.X.connect({},r,vHp());k_f(this)}; g.x.OH=function(r){this.X.OH(r)}; g.x.dispose=function(){this.QT()||(g.te("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),ps(this,3));g.WV.prototype.dispose.call(this)}; g.x.Rf=function(){orR(this);$Ar(this);r98(this);g.n1(this.T);this.T=NaN;g.n1(this.V);this.V=NaN;this.K=null;g.jX(this.kN);this.kN.length=0;this.X.dispose();g.WV.prototype.Rf.call(this);this.U=this.j=this.L=this.W=this.X=null}; g.x.ij=function(r){if(!this.L||this.L.length===0)return!1;for(var l=g.Q(this.L),U=l.next();!U.done;U=l.next())if(!U.value.capabilities.has(r))return!1;return!0}; g.x.By=function(){var r=3;this.QT()||(r=0,isNaN(this.Y$())?this.X.Eu()&&isNaN(this.D)&&(r=1):r=2);return r}; g.x.uc=function(r){zm("Disconnecting with "+r);g.te("yt.mdx.remote.remoteClient_",null);orR(this);this.publish("beforeDisconnect",r);r==1&&PJ();this.X.disconnect(r);this.dispose()}; g.x.t1=function(){var r=this.W;this.K&&(r=this.W.clone(),yJ(r,this.K,r.index));return SFG(r)}; g.x.cff=function(r){var l=this,U=new jf(r);U.videoId&&U.videoId!=this.W.videoId&&(this.K=U.videoId,g.n1(this.T),this.T=g.Rp(function(){if(l.K){var Y=l.K;l.K=null;l.W.videoId!=Y&&Ls(l,"getNowPlaying")}},5E3)); var F=[];this.W.listId==U.listId&&this.W.videoId==U.videoId&&this.W.index==U.index||F.push("remoteQueueChange");this.W.playerState==U.playerState&&this.W.volume==U.volume&&this.W.muted==U.muted&&ua(this.W)==ua(U)&&g.L9(this.W.trackData)==g.L9(U.trackData)||F.push("remotePlayerChange");this.W.reset(r);g.yC(F,function(Y){this.publish(Y)},this)}; g.x.eC=function(){var r=this.X.getDeviceId(),l=g.m8(this.L,function(U){return U.type=="REMOTE_CONTROL"&&U.id!=r}); return l?l.id:""}; g.x.Y$=function(){return this.X.SQ()}; g.x.Q2=function(){return this.U||"UNSUPPORTED"}; g.x.Ue=function(){return this.j||""}; g.x.fV=function(){!isNaN(this.Y$())&&this.X.ob()}; g.x.jTu=function(r,l){Ls(this,r,l);UAq(this)}; g.x.h0=function(){var r=g.zj("SAPISID","")||g.zj("__Secure-1PAPISID")||"",l=g.zj("__Secure-3PAPISID","")||"";if(!r&&!l)return"";r=g.Yy(g.FF(r),2);l=g.Yy(g.FF(l),2);return g.Yy(g.FF(","+r+","+l),2)}; tJ.prototype.subscribe=tJ.prototype.subscribe;tJ.prototype.unsubscribeByKey=tJ.prototype.oZ;tJ.prototype.getProxyState=tJ.prototype.By;tJ.prototype.disconnect=tJ.prototype.uc;tJ.prototype.getPlayerContextData=tJ.prototype.t1;tJ.prototype.setPlayerContextData=tJ.prototype.cff;tJ.prototype.getOtherConnectedRemoteId=tJ.prototype.eC;tJ.prototype.getReconnectTimeout=tJ.prototype.Y$;tJ.prototype.getAutoplayMode=tJ.prototype.Q2;tJ.prototype.getAutoplayVideoId=tJ.prototype.Ue;tJ.prototype.reconnect=tJ.prototype.fV; tJ.prototype.sendMessage=tJ.prototype.jTu;tJ.prototype.getXsrfToken=tJ.prototype.h0;tJ.prototype.isCapabilitySupportedOnConnectedDevices=tJ.prototype.ij;g.W(A98,ef);g.x=A98.prototype;g.x.rJ=function(r){return this.Cd.$_gs(r)}; g.x.contains=function(r){return!!this.Cd.$_c(r)}; g.x.get=function(r){return this.Cd.$_g(r)}; g.x.start=function(){this.Cd.$_st()}; g.x.add=function(r,l,U){this.Cd.$_a(r,l,U)}; g.x.remove=function(r,l,U){this.Cd.$_r(r,l,U)}; g.x.Ev=function(r,l,U,F){this.Cd.$_un(r,l,U,F)}; g.x.Rf=function(){for(var r=this.W.length,l=0;l1&&!this.C.getOption("remote","quickCast")?(this.G7=g.Bb(r,this.W,this),this.Wj(g.aI(r,this.W)),r=this.C.getOption("remote","currentReceiver"),r=this.W(r),this.options[r]&&this.BZ(r),this.enable(!0)):this.enable(!1)}; mX.prototype.W=function(r){return r.key}; mX.prototype.m$=function(r){return r==="cast-selector-receiver"?"Elenco...":this.G7[r].name}; mX.prototype.Zl=function(r){g.H1.prototype.Zl.call(this,r);this.C.setOption("remote","currentReceiver",this.G7[r]);this.u3.UL()};g.W(Brq,g.Rf);g.x=Brq.prototype; g.x.create=function(){var r=this.player.N(),l=g.th(r);r={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:r.Y("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:r.Y("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:r.Y("enable_cast_short_lived_lounge_token")};Q3G(l,r);this.subscriptions.push(g.mR("yt-remote-before-disconnect",this.vNP,this));this.subscriptions.push(g.mR("yt-remote-connection-change",this.YsH,this));this.subscriptions.push(g.mR("yt-remote-receiver-availability-change",this.g6, this));this.subscriptions.push(g.mR("yt-remote-auto-connect",this.QjQ,this));this.subscriptions.push(g.mR("yt-remote-receiver-resumed",this.e3z,this));this.subscriptions.push(g.mR("mdx-privacy-popup-confirm",this.JUH,this));this.subscriptions.push(g.mR("mdx-privacy-popup-cancel",this.ooG,this));this.g6()}; g.x.load=function(){this.player.cancelPlayback();g.Rf.prototype.load.call(this);this.di=new y9r(this.player.N(),this);this.player.l2(this.di);this.Wq=new j3R(this,this.player,this.mC);var r=(r=iZC())?r.currentTime:0;var l=nrY()?new HS(Fn(),void 0):null;r==0&&l&&(r=ua(gb(l)));r!==0&&this.aj(r);HZq(this,this.zn,this.zn);this.player.jn(6)}; g.x.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.Df();this.dB=this.Li;g.xY(this.Wq,this.mC);this.mC=this.di=this.Wq=null;g.Rf.prototype.unload.call(this);this.player.jn(5);PQ(this)}; g.x.Rf=function(){g.P6(this.subscriptions);g.Rf.prototype.Rf.call(this)}; g.x.bB=function(r){var l=g.uz.apply(1,arguments);this.loaded&&this.Wq.dU.apply(this.Wq,[r].concat(g.G(l)))}; g.x.getAdState=function(){return this.uy}; g.x.J3=function(){return this.mC?gb(this.mC).J3:!1}; g.x.Dr=function(){return this.mC?gb(this.mC).Dr:!1}; g.x.aj=function(r,l){this.Mz=r||0;this.player.publish("progresssync",r,l);this.player.mx("onVideoProgress",r||0)}; g.x.getCurrentTime=function(){return this.Mz}; g.x.getDuration=function(){return gb(this.mC).getDuration()||0}; g.x.uJ=function(){var r=gb(this.mC);return r.K?r.W+qg(r):r.W}; g.x.ZJ=function(){return gb(this.mC).T}; g.x.iZ=function(){return fHp(gb(this.mC))}; g.x.OA=function(){var r=gb(this.mC);return r.X>0?r.X+qg(r):r.X}; g.x.getProgressState=function(){var r=gb(this.mC),l=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!r.s3()&&this.player.mL(),clipEnd:l.clipEnd,clipStart:l.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.uJ(),isAtLiveHead:this.isAtLiveHead(),loaded:this.ZJ(),seekableEnd:this.iZ(),seekableStart:this.OA(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.x.isAtLiveHead=function(){return fHp(gb(this.mC))-this.getCurrentTime()<=1}; g.x.nextVideo=function(){this.mC&&this.mC.nextVideo()}; g.x.xA=function(){this.mC&&this.mC.xA()}; g.x.vNP=function(r){r===1&&(this.Ge=this.mC?gb(this.mC):null)}; g.x.YsH=function(){var r=nrY()?new HS(Fn(),void 0):null;if(r){var l=this.dB;this.loaded&&this.unload();this.mC=r;this.Ge=null;l.key!==this.Li.key&&(this.dB=l,this.load())}else g.sV(this.mC),this.mC=null,this.loaded&&(this.unload(),(r=this.Ge)&&r.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(r.videoId,ua(r)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.x.g6=function(){var r=[this.Li],l=r.concat,U=Erf();ia()&&g.SX("yt-remote-cast-available")&&U.push({key:"cast-selector-receiver",name:"Cast..."});this.G7=l.call(r,U);r=Rg8()||this.Li;AA(this,r);this.player.mx("onMdxReceiversChange")}; g.x.QjQ=function(){var r=Rg8();AA(this,r)}; g.x.e3z=function(){this.dB=Rg8()}; g.x.JUH=function(){this.pZ=!0;PQ(this);Ok=!1;Yo&&dP(Yo,1);Yo=null}; g.x.ooG=function(){this.pZ=!1;PQ(this);AA(this,this.Li);this.dB=this.Li;Ok=!1;Yo=null;this.player.playVideo()}; g.x.hj=function(r,l){switch(r){case "casting":return this.loaded;case "receivers":return this.G7;case "currentReceiver":return l&&(l.key==="cast-selector-receiver"?w6r():AA(this,l)),this.loaded?this.dB:this.Li;case "quickCast":return this.G7.length===2&&this.G7[1].key==="cast-selector-receiver"?(l&&w6r(),!0):!1}}; g.x.ZE=function(){this.mC.ZE()}; g.x.bL=function(){return!1}; g.x.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.x.isLoggedIn=function(){var r,l;return((r=g.l4("PLAYER_CONFIG"))==null?void 0:(l=r.args)==null?void 0:l.authuser)!==void 0?!0:!(!g.l4("SESSION_INDEX")&&!g.l4("LOGGED_IN"))};g.ZR("remote",Brq);})(_yt_player);