(function(g){var window=this;'use strict';var vp=function(l){g.Tf(l,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.l1()).toString(36));return l},lH=function(l,n,O){Array.isArray(O)||(O=[String(O)]); g.Vwf(l.L,n,O)},fWi=function(l){if(l instanceof g.oJ)return l; if(typeof l.LL=="function")return l.LL(!1);if(g.fv(l)){var n=0,O=new g.oJ;O.next=function(){for(;;){if(n>=l.length)return g.xl;if(n in l)return g.FB(l[n++]);n++}}; return O}throw Error("Not implemented");},Kt1=function(l,n,O){if(g.fv(l))g.ba(l,n,O); else for(l=fWi(l);;){var L=l.next();if(L.done)break;n.call(O,L.value,void 0,l)}},aWD=function(l,n){var O=[]; Kt1(n,function(L){try{var X=g.jW.prototype.W.call(this,L,!0)}catch(F){if(F=="Storage: Invalid value was encountered")return;throw F;}X===void 0?O.push(L):g.tzv(X)&&O.push(L)},l); return O},Rc0=function(l,n){aWD(l,n).forEach(function(O){g.jW.prototype.remove.call(this,O)},l)},Cxi=function(l){if(l.Wm){if(l.Wm.locationOverrideToken)return{locationOverrideToken:l.Wm.locationOverrideToken}; if(l.Wm.latitudeE7!=null&&l.Wm.longitudeE7!=null)return{latitudeE7:l.Wm.latitudeE7,longitudeE7:l.Wm.longitudeE7}}return null},tWF=function(l,n){g.CO(l,n)||l.push(n)},vyi=function(l){var n=0,O; for(O in l)n++;return n},lwR=function(l,n){return g.yj(l,n)},n$i=function(l){try{return g.Be.JSON.parse(l)}catch(n){}l=String(l); if(/^\s*$/.test(l)?0:/^[\],:{}\s\u2028\u2029]*$/.test(l.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("("+l+")")}catch(n){}throw Error("Invalid JSON string: "+l);},nq=function(l){if(g.Be.JSON)try{return g.Be.JSON.parse(l)}catch(n){}return n$i(l)},Oxc=function(l){if(l.yW&&typeof l.yW=="function")return l.yW(); if(typeof Map!=="undefined"&&l instanceof Map||typeof Set!=="undefined"&&l instanceof Set)return Array.from(l.values());if(typeof l==="string")return l.split("");if(g.fv(l)){for(var n=[],O=l.length,L=0;L1){if(O%2)throw Error("Uneven number of arguments");for(var L=0;L5&&(l=l.slice(l.length-5)); var n=g.M9(Ce6(),function(L){return L.loungeToken}),O=g.M9(l,function(L){return L.loungeToken}); g.Qv(O,function(L){return!g.CO(n,L)})&&tgu(); g.It("yt-remote-local-screens",l,31536E3)},HX=function(l){l||(g.$T("yt-remote-session-screen-id"),g.$T("yt-remote-session-video-id")); awD();l=JU();g.vR(l,w6());fws(l)},lEc=function(){if(!AU){var l=g.V8(); l&&(AU=new g.Q8(l))}},npq=function(){lEc(); return AU?!!AU.get("yt-remote-use-staging-server"):!1},bH=function(l,n){g.Xx[l]=!0; var O=g.gz();O&&O.publish.apply(O,arguments);g.Xx[l]=!1},OhD=function(){},OQ=function(){if(!r6){r6=new g.yM(new OhD); var l=g.NY("client_streamz_web_flush_count",-1);l!==-1&&(r6.N=l)}return r6},gpF=function(){var l=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return l?parseInt(l[1],10):0},LAR=function(l){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+l)!=-1||document.currentScript.src.indexOf("&"+l)!=-1)},Xus=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},UQ=function(l){l.length?op6(l.shift(),function(){UQ(l)}):FAF()},xYc=function(l){return"chrome-extension://"+l+"/cast_sender.js"},op6=function(l,n,O){var L=document.createElement("script"); L.onerror=n;O&&(L.onload=O);g.S8(L,g.k$(l));(document.head||document.documentElement).appendChild(L)},hRs=function(){var l=gpF(),n=[]; if(l>1){var O=l-1;n.push("//www.gstatic.com/eureka/clank/"+l+"/cast_sender.js");n.push("//www.gstatic.com/eureka/clank/"+O+"/cast_sender.js")}return n},FAF=function(){var l=Xus(); l&&l(!1,"No cast extension found")},JPi=function(){if(ZhO){var l=2,n=Xus(),O=function(){l--; l==0&&n&&n(!0)}; window.__onGCastApiAvailable=O;op6("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",FAF,O)}},wu1=function(){JPi(); var l=hRs();l.push("//www.gstatic.com/eureka/clank/cast_sender.js");UQ(l)},APq=function(){JPi(); var l=hRs();l.push.apply(l,g.E(HhF.map(xYc)));l.push("//www.gstatic.com/eureka/clank/cast_sender.js");UQ(l)},uH=function(l,n,O){g.V.call(this); this.V=O!=null?(0,g.tg)(l,O):l;this.vQ=n;this.B=(0,g.tg)(this.kJ,this);this.S=!1;this.W=0;this.N=this.Kp=null;this.L=[]},PX=function(l,n,O){g.V.call(this); this.L=O!=null?l.bind(O):l;this.vQ=n;this.N=null;this.S=!1;this.W=0;this.Kp=null},bhL=function(l){l.Kp=g.qv(function(){l.Kp=null; l.S&&!l.W&&(l.S=!1,bhL(l))},l.vQ); var n=l.N;l.N=null;l.L.apply(null,n)},TX=function(){},rPu=function(){g.mi.call(this,"p")},UYu=function(){g.mi.call(this,"o")},Pkk=function(){return uXc=uXc||new g.vE},Tc0=function(l){g.mi.call(this,"serverreachability",l)},WX=function(l){var n=Pkk(); n.dispatchEvent(new Tc0(n,l))},WAc=function(l){g.mi.call(this,"statevent",l)},EQ=function(l){var n=Pkk(); n.dispatchEvent(new WAc(n,l))},Epi=function(l,n,O,L){g.mi.call(this,"timingevent",l); this.size=n;this.rtt=O;this.retries=L},Nj=function(l,n){if(typeof l!=="function")throw Error("Fn must not be null and must be a function"); return g.Be.setTimeout(function(){l()},n)},DV=function(){},qj=function(l,n,O,L){this.N=l; this.L=n;this.n5=O;this.K5=L||1;this.uv=new g.qJ(this);this.Of=45E3;this.Hm=null;this.V=!1;this.Y=this.G3=this.G=this.wq=this.Q5=this.Yo=this.Wm=null;this.NQ=[];this.S=null;this.T=0;this.B=this.Lf=null;this.oO=-1;this.z3=!1;this.nf=0;this.Pm=null;this.JA=this.Fi=this.Fp=this.Cf=!1;this.W=new Nci},Nci=function(){this.N=null; this.S="";this.W=!1},q0c=function(l,n,O){l.wq=1; l.G=vp(n.clone());l.Y=O;l.Cf=!0;DYD(l,null)},DYD=function(l,n){l.Q5=Date.now(); kI(l);l.G3=l.G.clone();lH(l.G3,"t",l.K5);l.T=0;var O=l.N.wq;l.W=new Nci;l.S=kji(l.N,O?n:null,!l.Y);l.nf>0&&(l.Pm=new PX((0,g.tg)(l.XG,l,l.S),l.nf));l.uv.listen(l.S,"readystatechange",l.ZI);n=l.Hm?g.jY(l.Hm):{};l.Y?(l.Lf||(l.Lf="POST"),n["Content-Type"]="application/x-www-form-urlencoded",l.S.send(l.G3,l.Lf,l.Y,n)):(l.Lf="GET",l.S.send(l.G3,l.Lf,null,n));WX(1)},M_F=function(l){if(!yPs(l))return g.l2(l.S); var n=g.nV(l.S);if(n==="")return"";var O="",L=n.length,X=g.to(l.S)==4;if(!l.W.N){if(typeof TextDecoder==="undefined")return yL(l),Mj(l),"";l.W.N=new g.Be.TextDecoder}for(var F=0;Fn.length)return QTu;n=n.slice(L,L+O);l.T=L+O;return n},kI=function(l){l.Yo=Date.now()+l.Of; jTD(l,l.Of)},jTD=function(l,n){if(l.Wm!=null)throw Error("WatchDog timer not null"); l.Wm=Nj((0,g.tg)(l.O2,l),n)},GjL=function(l){l.Wm&&(g.Be.clearTimeout(l.Wm),l.Wm=null)},Mj=function(l){l.N.h7()||l.z3||mYF(l.N,l)},yL=function(l){GjL(l); g.h0(l.Pm);l.Pm=null;l.uv.removeAll();if(l.S){var n=l.S;l.S=null;n.abort();n.dispose()}},zRq=function(l,n){try{var O=l.N; if(O.Sa!=0&&(O.S==l||IEi(O.W,l)))if(!l.Fi&&IEi(O.W,l)&&O.Sa==3){try{var L=O.oA.S.parse(n)}catch(W){L=null}if(Array.isArray(L)&&L.length==3){var X=L;if(X[0]==0)a:{if(!O.G){if(O.S)if(O.S.Q5+3E30&&(O.nf=1.5*Z);L=O;var J=l.SM();if(J){var w=g.O_(J,"X-Client-Wire-Protocol");if(w){var H=L.W;!H.S&&(g.qQ(w,"spdy")||g.qQ(w,"quic")||g.qQ(w,"h2"))&&(H.L=H.B,H.S=new Set,H.W&&(V_q(H,H.W),H.W=null))}if(L.Cf){var A=g.O_(J,"X-HTTP-Session-Id");A&&(L.j3=A,g.Tf(L.Hm,L.Cf,A))}}O.Sa=3;O.B&&O.B.IQ();O.Wk&&(O.q5=Date.now()-l.Q5);L=O;var b=l;L.M5=BcL(L,L.wq?L.K5:null,L.n5);if(b.Fi){cPc(L.W, b);var r=b,U=L.nf;U&&r.setTimeout(U);r.Wm&&(GjL(r),kI(r));L.S=b}else ihk(L);O.N.length>0&&jB(O)}else F[0]!="stop"&&F[0]!="close"||YI(O,7);else O.Sa==3&&(F[0]=="stop"||F[0]=="close"?F[0]=="stop"?YI(O,7):O.disconnect():F[0]!="noop"&&O.B&&O.B.jo(F),O.NQ=0)}WX(4)}catch(W){}},S0F=function(l,n){this.S=l; this.map=n;this.context=null},pus=function(l){this.B=l||10; g.Be.PerformanceNavigationTiming?(l=g.Be.performance.getEntriesByType("navigation"),l=l.length>0&&(l[0].nextHopProtocol=="hq"||l[0].nextHopProtocol=="h2")):l=!!(g.Be.chrome&&g.Be.chrome.loadTimes&&g.Be.chrome.loadTimes()&&g.Be.chrome.loadTimes().wasFetchedViaSpdy);this.L=l?this.B:1;this.S=null;this.L>1&&(this.S=new Set);this.W=null;this.N=[]},sTc=function(l){return l.W?!0:l.S?l.S.size>=l.L:!1},$Ys=function(l){return l.W?1:l.S?l.S.size:0},IEi=function(l,n){return l.W?l.W==n:l.S?l.S.has(n):!1},V_q= function(l,n){l.S?l.S.add(n):l.W=n},cPc=function(l,n){l.W&&l.W==n?l.W=null:l.S&&l.S.has(n)&&l.S.delete(n)},fED=function(l){if(l.W!=null)return l.N.concat(l.W.NQ); if(l.S!=null&&l.S.size!==0){var n=l.N;l=g.P(l.S.values());for(var O=l.next();!O.done;O=l.next())n=n.concat(O.value.NQ);return n}return g.Ot(l.N)},KAQ=function(l,n){var O=new DV; if(g.Be.Image){var L=new Image;L.onload=g.ve(GX,O,"TestLoadImage: loaded",!0,n,L);L.onerror=g.ve(GX,O,"TestLoadImage: error",!1,n,L);L.onabort=g.ve(GX,O,"TestLoadImage: abort",!1,n,L);L.ontimeout=g.ve(GX,O,"TestLoadImage: timeout",!1,n,L);g.Be.setTimeout(function(){if(L.ontimeout)L.ontimeout()},1E4); L.src=l}else n(!1)},aEF=function(l,n){var O=new DV,L=new AbortController,X=setTimeout(function(){L.abort(); GX(O,"TestPingServer: timeout",!1,n)},1E4); fetch(l,{signal:L.signal}).then(function(F){clearTimeout(X);F.ok?GX(O,"TestPingServer: ok",!0,n):GX(O,"TestPingServer: server error",!1,n)}).catch(function(){clearTimeout(X); GX(O,"TestPingServer: error",!1,n)})},GX=function(l,n,O,L,X){try{X&&(X.onload=null,X.onerror=null,X.onabort=null,X.ontimeout=null),L(O)}catch(F){}},RRD=function(){this.S=new TX},Ck1=function(l,n,O){var L=O||""; try{Lqk(l,function(X,F){var x=X;g.Kv(X)&&(x=g.QM(X));n.push(L+F+"="+encodeURIComponent(x))})}catch(X){throw n.push(L+"type="+encodeURIComponent("_badmap")),X; }},me=function(l,n,O){return O&&O.a2o?O.a2o[l]||n:n},t_u=function(l){this.N=[]; this.K5=this.M5=this.Hm=this.n5=this.S=this.j3=this.Cf=this.z3=this.T=this.oO=this.Y=null;this.j7=this.G3=0;this.UU=me("failFast",!1,l);this.Fi=this.Wm=this.G=this.V=this.B=null;this.Sz=!0;this.Y4=this.Pm=-1;this.JA=this.NQ=this.Q5=0;this.q_=me("baseRetryDelayMs",5E3,l);this.IA=me("retryDelaySeedMs",1E4,l);this.At=me("forwardChannelMaxRetries",2,l);this.z$=me("forwardChannelRequestTimeoutMs",2E4,l);this.d8=l&&l.pXq||void 0;this.Zx=l&&l.XfJ||void 0;this.lf=l&&l.PGF||!1;this.nf=void 0;this.wq=l&&l.LFQ|| !1;this.L="";this.W=new pus(l&&l.gcf);this.oA=new RRD;this.uv=l&&l.K3p||!1;this.Yo=l&&l.XO3||!1;this.uv&&this.Yo&&(this.Yo=!1);this.OU=l&&l.rSi||!1;l&&l.fEJ&&(this.Sz=!1);this.Wk=!this.uv&&this.Sz&&l&&l.wOm||!1;this.Xg=void 0;l&&l.Vt&&l.Vt>0&&(this.Xg=l.Vt);this.hC=void 0;this.q5=0;this.Of=!1;this.Fp=this.Lf=null},eB=function(l){l.S&&(vps(l),l.S.cancel(),l.S=null)},lM6=function(l){eB(l); l.G&&(g.Be.clearTimeout(l.G),l.G=null);QL(l);l.W.cancel();l.V&&(typeof l.V==="number"&&g.Be.clearTimeout(l.V),l.V=null)},jB=function(l){sTc(l.W)||l.V||(l.V=!0,g.Jo(l.P3,l),l.Q5=0)},Oi1=function(l,n){if($Ys(l.W)>=l.W.L-(l.V?1:0))return!1; if(l.V)return l.N=n.NQ.concat(l.N),!0;if(l.Sa==1||l.Sa==2||l.Q5>=(l.UU?0:l.At))return!1;l.V=Nj((0,g.tg)(l.P3,l,n),nTF(l,l.Q5));l.Q5++;return!0},LQq=function(l,n){var O; n?O=n.n5:O=l.G3++;var L=l.Hm.clone();g.Tf(L,"SID",l.L);g.Tf(L,"RID",O);g.Tf(L,"AID",l.Pm);IE(l,L);l.T&&l.Y&&g.Do(L,l.T,l.Y);O=new qj(l,l.L,O,l.Q5+1);l.T===null&&(O.Hm=l.Y);n&&(l.N=n.NQ.concat(l.N));n=gTk(l,O,1E3);O.setTimeout(Math.round(l.z$*.5)+Math.round(l.z$*.5*Math.random()));V_q(l.W,O);q0c(O,L,n)},IE=function(l,n){l.z3&&g.PM(l.z3,function(O,L){g.Tf(n,L,O)}); l.B&&Lqk({},function(O,L){g.Tf(n,L,O)})},gTk=function(l,n,O){O=Math.min(l.N.length,O); var L=l.B?(0,g.tg)(l.B.xi,l.B,l):null;a:{for(var X=l.N,F=-1;;){var x=["count="+O];F==-1?O>0?(F=X[0].S,x.push("ofs="+F)):F=0:x.push("ofs="+F);for(var Z=!0,J=0;J=3)return!1; l.JA++;l.G=Nj((0,g.tg)(l.FG,l),nTF(l,l.NQ));l.NQ++;return!0},vps=function(l){l.Lf!=null&&(g.Be.clearTimeout(l.Lf),l.Lf=null)},Xkc=function(l){l.S=new qj(l,l.L,"rpc",l.JA); l.T===null&&(l.S.Hm=l.Y);l.S.nf=0;var n=l.M5.clone();g.Tf(n,"RID","rpc");g.Tf(n,"SID",l.L);g.Tf(n,"AID",l.Pm);g.Tf(n,"CI",l.Fi?"0":"1");!l.Fi&&l.Xg&&g.Tf(n,"TO",l.Xg);g.Tf(n,"TYPE","xmlhttp");IE(l,n);l.T&&l.Y&&g.Do(n,l.T,l.Y);l.nf&&l.S.setTimeout(l.nf);var O=l.S;l=l.K5;O.wq=1;O.G=vp(n.clone());O.Y=null;O.Cf=!0;DYD(O,l)},QL=function(l){l.Wm!=null&&(g.Be.clearTimeout(l.Wm),l.Wm=null)},mYF=function(l,n){var O=null; if(l.S==n){QL(l);vps(l);l.S=null;var L=2}else if(IEi(l.W,n))O=n.NQ,cPc(l.W,n),L=1;else return;if(l.Sa!=0)if(n.V)if(L==1){O=n.Y?n.Y.length:0;n=Date.now()-n.Q5;var X=l.Q5;L=Pkk();L.dispatchEvent(new Epi(L,O,n,X));jB(l)}else ihk(l);else{var F=n.oO;X=n.getLastError();if(X==3||X==0&&F>0||!(L==1&&Oi1(l,n)||L==2&&dYi(l)))switch(O&&O.length>0&&(n=l.W,n.N=n.N.concat(O)),X){case 1:YI(l,5);break;case 4:YI(l,10);break;case 3:YI(l,6);break;default:YI(l,2)}}},nTF=function(l,n){var O=l.q_+Math.floor(Math.random()* l.IA); l.isActive()||(O*=2);return O*n},YI=function(l,n){if(n==2){var O=(0,g.tg)(l.J7Q,l),L=l.Zx,X=!L; L=new g.wM(L||"//www.google.com/images/cleardot.gif");g.Be.location&&g.Be.location.protocol=="http"||g.H1(L,"https");vp(L);X?KAQ(L.toString(),O):aEF(L.toString(),O)}else EQ(2);l.Sa=0;l.B&&l.B.Ap(n);oTs(l);lM6(l)},oTs=function(l){l.Sa=0; l.Fp=[];if(l.B){var n=fED(l.W);if(n.length!=0||l.N.length!=0)g.Lm(l.Fp,n),g.Lm(l.Fp,l.N),l.W.N.length=0,g.Ot(l.N),l.N.length=0;l.B.U0()}},FQc=function(l){if(l.Sa==0)return l.Fp; var n=[];g.Lm(n,fED(l.W));g.Lm(n,l.N);return n},BcL=function(l,n,O){var L=g.W1(O); L.S!=""?(n&&g.An(L,n+"."+L.S),g.bs(L,L.N)):(L=g.Be.location,L=XKq(L.protocol,n?n+"."+L.hostname:L.hostname,+L.port,O));n=l.Cf;O=l.j3;n&&O&&g.Tf(L,n,O);g.Tf(L,"VER",l.yX);IE(l,L);return L},kji=function(l,n,O){if(n&&!l.wq)throw Error("Can't create secondary domain capable XhrIo object."); n=l.lf&&!l.d8?new g.ah(new g.xU({Jv:O})):new g.ah(l.d8);n.T=l.wq;return n},xV0=function(){},hpD=function(){},$I=function(l,n){g.vE.call(this); this.S=new t_u(n);this.B=l;this.W=n&&n.H5F||null;l=n&&n.Bc2||null;n&&n.HXo&&(l?l["X-Client-Protocol"]="webchannel":l={"X-Client-Protocol":"webchannel"});this.S.Y=l;l=n&&n.oko||null;n&&n.aV&&(l?l["X-WebChannel-Content-Type"]=n.aV:l={"X-WebChannel-Content-Type":n.aV});n&&n.Q_&&(l?l["X-WebChannel-Client-Profile"]=n.Q_:l={"X-WebChannel-Client-Profile":n.Q_});this.S.oO=l;(l=n&&n.vkf)&&!g.DL(l)&&(this.S.T=l);this.V=n&&n.LFQ||!1;this.L=n&&n.Sm1||!1;(n=n&&n.qfJ)&&!g.DL(n)&&(this.S.Cf=n,g.kw(this.W,n)&&(l= this.W,n in l&&delete l[n]));this.N=new d6(this)},Zi1=function(l){rPu.call(this); l.__headers__&&(this.headers=l.__headers__,this.statusCode=l.__status__,delete l.__headers__,delete l.__status__);var n=l.__sm__;n?this.data=(this.S=g.NX(n))?g.eY(n,this.S):n:this.data=l},JBO=function(l){UYu.call(this); this.status=1;this.errorCode=l},d6=function(l){this.S=l},wkO=function(l,n){this.W=l; this.S=n},HiF=function(l){return FQc(l.S).map(function(n){var O=l.W; n=n.map;"__data__"in n?(n=n.__data__,O=O.L?n$i(n):n):O=n;return O})},VL=function(l,n){if(typeof l!=="function")throw Error("Fn must not be null and must be a function"); return g.Be.setTimeout(function(){l()},n)},cX=function(l){BX.dispatchEvent(new ABc(BX,l))},ABc=function(l){g.mi.call(this,"statevent",l)},iH=function(l,n,O,L){this.S=l; this.L=n;this.T=O;this.V=L||1;this.W=45E3;this.N=new g.qJ(this);this.B=new g.DG;this.B.setInterval(250)},rBD=function(l,n,O){l.Mc=1; l.P6=vp(n.clone());l.Vh=O;l.Cf=!0;bi6(l,null)},UVk=function(l,n,O,L,X){l.Mc=1; l.P6=vp(n.clone());l.Vh=null;l.Cf=O;X&&(l.Ix=!1);bi6(l,L)},bi6=function(l,n){l.j2=Date.now(); u1D(l);l.K9=l.P6.clone();lH(l.K9,"t",l.V);l.lm=0;l.BQ=l.S.xL(l.S.pS()?n:null);l.Za>0&&(l.Gq=new PX((0,g.tg)(l.GZ,l,l.BQ),l.Za));l.N.listen(l.BQ,"readystatechange",l.S9);n=l.DB?g.jY(l.DB):{};l.Vh?(l.f9="POST",n["Content-Type"]="application/x-www-form-urlencoded",l.BQ.send(l.K9,l.f9,l.Vh,n)):(l.f9="GET",l.Ix&&!g.CJ&&(n.Connection="close"),l.BQ.send(l.K9,l.f9,null,n));l.S.rP(1)},WQL=function(l,n){var O=l.lm,L=n.indexOf("\n",O); if(L==-1)return PG1;O=Number(n.substring(O,L));if(isNaN(O))return TU6;L+=1;if(L+O>n.length)return PG1;n=n.slice(L,L+O);l.lm=L+O;return n},u1D=function(l){l.YX=Date.now()+l.W; ETs(l,l.W)},ETs=function(l,n){if(l.jW!=null)throw Error("WatchDog timer not null"); l.jW=VL((0,g.tg)(l.uw,l),n)},NU6=function(l){l.jW&&(g.Be.clearTimeout(l.jW),l.jW=null)},DVQ=function(l){l.S.h7()||l.UH||l.S.S_(l)},zX=function(l){NU6(l); g.h0(l.Gq);l.Gq=null;l.B.stop();l.N.removeAll();if(l.BQ){var n=l.BQ;l.BQ=null;n.abort();n.dispose()}l.bD&&(l.bD=null)},qhD=function(l,n){try{l.S.Kv(l,n),l.S.rP(4)}catch(O){}},yBs=function(l,n,O,L,X){if(L==0)O(!1); else{var F=X||0;L--;kK1(l,n,function(x){x?O(!0):g.Be.setTimeout(function(){yBs(l,n,O,L,F)},F)})}},kK1=function(l,n,O){var L=new Image; L.onload=function(){try{SB(L),O(!0)}catch(X){}}; L.onerror=function(){try{SB(L),O(!1)}catch(X){}}; L.onabort=function(){try{SB(L),O(!1)}catch(X){}}; L.ontimeout=function(){try{SB(L),O(!1)}catch(X){}}; g.Be.setTimeout(function(){if(L.ontimeout)L.ontimeout()},n); L.src=l},SB=function(l){l.onload=null; l.onerror=null;l.onabort=null;l.ontimeout=null},MUQ=function(l){this.S=l; this.W=new TX},Qtc=function(l){var n=pq(l.S,l.bY,"/mail/images/cleardot.gif"); vp(n);yBs(n.toString(),5E3,(0,g.tg)(l.TG,l),3,2E3);l.rP(1)},epR=function(l){var n=l.S.V; n!=null?(cX(5),n?(cX(11),sQ(l.S,l,!1)):(cX(12),sQ(l.S,l,!0))):(l.hd=new iH(l),l.hd.DB=l.uZ,n=l.S,n=pq(n,n.pS()?l.cq:null,l.Wx),cX(5),lH(n,"TYPE","xmlhttp"),UVk(l.hd,n,!1,l.cq,!1))},YhQ=function(l,n,O){this.S=1; this.W=[];this.N=[];this.B=new TX;this.Y=l||null;this.V=n!=null?n:null;this.G=O||!1},jtQ=function(l,n){this.S=l; this.map=n;this.context=null},GKO=function(l,n,O,L){g.mi.call(this,"timingevent",l); this.size=n;this.rtt=O;this.retries=L},mVD=function(l){g.mi.call(this,"serverreachability",l)},dVD=function(l){l.We(1,0); l.kI=pq(l,null,l.sy);IMq(l)},$Vi=function(l){l.CP&&(l.CP.abort(),l.CP=null); l.mF&&(l.mF.cancel(),l.mF=null);l.Jn&&(g.Be.clearTimeout(l.Jn),l.Jn=null);fq(l);l.E9&&(l.E9.cancel(),l.E9=null);l.Sk&&(g.Be.clearTimeout(l.Sk),l.Sk=null)},VUD=function(l,n){if(l.S==0)throw Error("Invalid operation: sending map when state is closed"); l.W.push(new jtQ(l.NS++,n));l.S!=2&&l.S!=3||IMq(l)},BUD=function(l){var n=0; l.mF&&n++;l.E9&&n++;return n},IMq=function(l){l.E9||l.Sk||(l.Sk=VL((0,g.tg)(l.lP,l),0),l.I$=0)},zp0=function(l,n){if(l.S==1){if(!n){l.nS=Math.floor(Math.random()*1E5); n=l.nS++;var O=new iH(l,"",n);O.DB=l.R7;var L=cBQ(l),X=l.kI.clone();g.Tf(X,"RID",n);g.Tf(X,"CVER","1");Kq(l,X);rBD(O,X,L);l.E9=O;l.S=2}}else l.S==3&&(n?ii1(l,n):l.W.length==0||l.E9||ii1(l))},ii1=function(l,n){if(n)if(l.B0>6){l.W=l.N.concat(l.W); l.N.length=0;var O=l.nS-1;n=cBQ(l)}else O=n.T,n=n.Vh;else O=l.nS++,n=cBQ(l);var L=l.kI.clone();g.Tf(L,"SID",l.L);g.Tf(L,"RID",O);g.Tf(L,"AID",l.nm);Kq(l,L);O=new iH(l,l.L,O,l.I$+1);O.DB=l.R7;O.setTimeout(1E4+Math.round(1E4*Math.random()));l.E9=O;rBD(O,L,n)},Kq=function(l,n){l.kt&&(l=l.kt.Y$())&&g.PM(l,function(O,L){g.Tf(n,L,O)})},cBQ=function(l){var n=Math.min(l.W.length,1E3),O=["count="+n]; if(l.B0>6&&n>0){var L=l.W[0].S;O.push("ofs="+L)}else L=0;for(var X={},F=0;F=3)return!1; l.T++;l.Jn=VL((0,g.tg)(l.bP,l),pku(l,l.pm));l.pm++;return!0},sQ=function(l,n,O){l.TA=l.V==null?O:!l.V; l.P$=n.gE;l.G||dVD(l)},fq=function(l){l.H0!=null&&(g.Be.clearTimeout(l.H0),l.H0=null)},pku=function(l,n){var O=5E3+Math.floor(Math.random()*1E4); l.isActive()||(O*=2);return O*n},aE=function(l,n){if(n==2||n==9){var O=null; l.kt&&(O=null);var L=(0,g.tg)(l.gTz,l);O||(O=new g.wM("//www.google.com/images/cleardot.gif"),vp(O));kK1(O.toString(),1E4,L)}else cX(2);fML(l,n)},fML=function(l,n){l.S=0; l.kt&&l.kt.k$(n);KQq(l);$Vi(l)},KQq=function(l){l.S=0; l.P$=-1;if(l.kt)if(l.N.length==0&&l.W.length==0)l.kt.vx();else{var n=g.Ot(l.N),O=g.Ot(l.W);l.N.length=0;l.W.length=0;l.kt.vx(n,O)}},pq=function(l,n,O){var L=g.W1(O); if(L.S!="")n&&g.An(L,n+"."+L.S),g.bs(L,L.N);else{var X=window.location;L=XKq(X.protocol,n?n+"."+X.hostname:X.hostname,+X.port,O)}l.IZ&&g.PM(l.IZ,function(F,x){g.Tf(L,x,F)}); g.Tf(L,"VER",l.B0);Kq(l,L);return L},aM6=function(){},Rp6=function(){this.S=[]; this.W=[]},CGc=function(l){g.mi.call(this,"channelMessage"); this.message=l},tUu=function(l){g.mi.call(this,"channelError"); this.error=l},vTR=function(l,n){this.action=l; this.params=n||{}},RE=function(l,n){g.V.call(this); this.S=new g.vs(this.x_z,0,this);g.c(this,this.S);this.vQ=5E3;this.W=0;if(typeof l==="function")n&&(l=(0,g.tg)(l,n));else if(l&&typeof l.handleEvent==="function")l=(0,g.tg)(l.handleEvent,l);else throw Error("Invalid listener argument");this.N=l},l7D=function(l,n,O,L,X,F,x){O=O===void 0?!1:O; L=L===void 0?function(){return""}:L; X=X===void 0?!1:X;F=F===void 0?!1:F;x=x===void 0?function(){return g.P$({})}:x; this.z3=l;this.Wm=n;this.B=new g.Mo;this.W=new RE(this.Jhq,this);this.S=null;this.T=!1;this.Y=null;this.Q5="";this.NQ=this.G=0;this.N=[];this.G3=O;this.Lf=L;this.V=F;this.Cf=x;this.L=g.P$();this.nf=X;this.Pm=new o$6;this.Hm=new Fqi;this.Fi=new xHi;this.wq=new h9q;this.Of=new Zxs;this.Yo=new Jzk},O10=function(l,n,O,L,X){ntq(l); if(l.S){var F=g.R3("ID_TOKEN"),x=l.S.R7||{};F?x["x-youtube-identity-token"]=F:delete x["x-youtube-identity-token"];l.S.R7=x}L?(L.getState()!=3&&BUD(L)==0||L.getState(),l.S.connect(n,O,l.Wm,L.L,L.nm)):X?l.S.connect(n,O,l.Wm,X.sessionId,X.arrayId):l.S.connect(n,O,l.Wm)},Xoc=function(l){var n,O; g.Y(function(L){if(L.S==1)return g.Ei(L,2),g.Q(L,gts(l),2);g.q7(L);n=l.N;l.N=[];O=n.length;LIk(l,n,O);Cq(l);return g.ki(L,0)})},LIk=function(l,n,O){for(var L=0;L0?O=Object.assign({},O,n):delete O.Authorization;l.S.R7=O}).catch(function(){})},tU=function(l){this.scheme="https"; this.port=this.domain="";this.S="/api/lounge";this.W=!0;l=l||document.location.href;var n=Number(g.$o(4,l))||"";n&&(this.port=":"+n);this.domain=g.VM(l)||"";l=g.e6();l.search("MSIE")>=0&&(l=l.match(/MSIE ([\d.]+)/)[1],g.Qs(l,"10.0")<0&&(this.W=!1))},vX=function(l,n){var O=l.S; l.W&&(O=l.scheme+"://"+l.domain+l.port+l.S);return g.pr(O+n,{})},otO=function(l,n){g.vE.call(this); var O=this;this.RI=l();this.RI.subscribe("handlerOpened",this.Rs,this);this.RI.subscribe("handlerClosed",this.onClosed,this);this.RI.subscribe("handlerError",function(L,X){O.onError(X)}); this.RI.subscribe("handlerMessage",this.onMessage,this);this.S=n},FIL=function(l,n,O){var L=this; O=O===void 0?function(){return""}:O; var X=X===void 0?new hpD:X;var F=F===void 0?new g.Mo:F;this.pathPrefix=l;this.S=n;this.Q5=O;this.B=F;this.G=null;this.Y=this.T=0;this.channel=null;this.V=0;this.N=new RE(function(){L.N.isActive();var x;((x=L.channel)==null?void 0:$Ys((new wkO(x,x.S)).S.W))===0&&L.connect(L.G,L.T)}); this.L={};this.W={};this.Wm=!1;this.logger=null;this.NQ=[];this.IR=void 0;this.Hm=new o$6;this.Lf=new Fqi;this.z3=new xHi;this.Cf=new h9q},x3c=function(l){g.z1(l.channel,"m",function(){l.V=3; l.N.reset();l.G=null;l.T=0;for(var n=g.P(l.NQ),O=n.next();!O.done;O=n.next())O=O.value,l.channel&&l.channel.send(O);l.NQ=[];l.publish("webChannelOpened");l.Hm.S("WEB_CHANNEL")}); g.z1(l.channel,"n",function(){l.V=0;l.N.isActive()||l.publish("webChannelClosed");var n,O=(n=l.channel)==null?void 0:HiF(new wkO(n,n.S));O&&(l.NQ=[].concat(g.E(O)));l.Lf.S("WEB_CHANNEL")}); g.z1(l.channel,"p",function(n){var O=n.data;O[0]==="gracefulReconnect"?(l.N.start(),l.channel&&l.channel.close()):l.publish("webChannelMessage",new vTR(O[0],O[1]));l.IR=n.statusCode;l.z3.S("WEB_CHANNEL")}); g.z1(l.channel,"o",function(){l.IR===401||l.N.start();l.publish("webChannelError");l.Cf.S("WEB_CHANNEL")})},hPs=function(l){var n=l.Q5(); n?l.L["x-youtube-lounge-xsrf-token"]=n:delete l.L["x-youtube-lounge-xsrf-token"]},Z1s=function(l){g.vE.call(this); this.S=l();this.S.subscribe("webChannelOpened",this.e9,this);this.S.subscribe("webChannelClosed",this.onClosed,this);this.S.subscribe("webChannelError",this.onError,this);this.S.subscribe("webChannelMessage",this.onMessage,this)},JG1=function(l,n,O,L,X){function F(){return new l7D(vX(l,"/bc"),n,!1,O,L)} O=O===void 0?function(){return""}:O; return g.E0("enable_mdx_web_channel_desktop")?new Z1s(function(){return new FIL(vX(l,"/wc"),n,O)}):new otO(F,X)},b1c=function(){var l=woD; H1k();l7.push(l);AGu()},n_=function(l,n){H1k(); var O=rGq(l,String(n));l7.length==0?U3O(O):(AGu(),g.ba(l7,function(L){L(O)}))},OB=function(l){n_("CP",l)},H1k=function(){l7||(l7=g.zk("yt.mdx.remote.debug.handlers_")||[],g.i9("yt.mdx.remote.debug.handlers_",l7))},U3O=function(l){var n=(gJ+1)%50; gJ=n;L_[n]=l;Xk||(Xk=n==49)},AGu=function(){var l=l7; if(L_[0]){var n=Xk?gJ:-1,O={};do O={Dn:void 0},n=(n+1)%50,O.Dn=L_[n],g.ba(l,function(L){return function(X){X(L.Dn)}}(O)); while(n!=gJ);L_=Array(50);gJ=-1;Xk=!1}},rGq=function(l,n){var O=(Date.now()-umO)/1E3; O.toFixed&&(O=O.toFixed(3));var L=[];L.push("[",O+"s","] ");L.push("[","yt.mdx.remote","] ");L.push(l+": "+n,"\n");return L.join("")},ow=function(l){g.hj.call(this); this.V=l;this.screens=[]},PXF=function(l,n){var O=l.get(n.uuid)||l.get(n.id); if(O)return l=O.name,O.id=n.id||O.id,O.name=n.name,O.token=n.token,O.uuid=n.uuid||O.uuid,O.name!=l;l.screens.push(n);return!0},TFD=function(l,n){var O=l.screens.length!=n.length; l.screens=g.Jq(l.screens,function(F){return!!Sli(n,F)}); for(var L=n.length,X=0;X0&&l.L0&&Pb(l,O)},function(n){l.B=function(){}; l.bl(n)})},RP0=function(l){var n={}; n.pairingCode=l.Lf;n.theme=l.wq;npq()&&(n.env_useStageMdx=1);return g.Sj(n)},CXu=function(l){return new Promise(function(n){l.Lf=ixD(); if(l.Hm){var O=new chrome.cast.DialLaunchResponse(!0,RP0(l));n(O);a7O(l)}else l.Wm=function(){g.Pu(l.Y);l.Wm=function(){}; l.Y=NaN;var L=new chrome.cast.DialLaunchResponse(!0,RP0(l));n(L);a7O(l)},l.Y=g.U0(function(){l.Wm()},100)})},vtk=function(l,n,O){l.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(n)); var L=new FK(n);return(new Promise(function(X){tHu(l,L,function(F){F?(l.NQ=!0,wJ(l.L,L),Au(l,L),Pb(l,O)):g.vK(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(n)+" is not online."));X(F)},5)})).then(function(X){return X?new chrome.cast.DialLaunchResponse(!1):CXu(l)})},lgc=function(l,n){var O=l.G.receiver.label,L=l.W.friendlyName; return(new Promise(function(X){jZs(l.L,O,n,L,function(F){F&&F.token&&Au(l,F);X(F)},function(F){b7(l,"Failed to get DIAL screen: "+F); X(null)})})).then(function(X){return X&&X.token?new chrome.cast.DialLaunchResponse(!1):CXu(l)})},tHu=function(l,n,O,L){g.Pu(l.V); l.V=0;m3F(l.L,n,function(X){X||L<0?O(X):l.V=g.U0(function(){tHu(l,n,O,L-1)},300)})},Pb=function(l,n){l.info("getDialAppInfoWithTimeout_ "+n); u7(l)&&(g.Pu(l.T),l.T=0,n==0?nOi(l):l.T=g.U0(function(){nOi(l)},n))},nOi=function(l){u7(l)&&l.N.getDialAppInfo(function(n){l.info("getDialAppInfo dialLaunchData: "+JSON.stringify(n)); n=n.extraData||{};var O=null;if(n.loungeToken){var L;((L=l.S)==null?void 0:L.token)==n.loungeToken&&(O="staleLoungeToken")}else O="missingLoungeToken";O?(l.Q5=O,Pb(l,3E4)):(l.NQ=!1,l.Q5="unknown",VH1(l,n.loungeToken),Pb(l,n.loungeTokenRefreshIntervalMs))},function(n){l.info("getDialAppInfo error: "+n); l.Q5="noLoungeTokenResponse";Pb(l,3E4)})},OKO=function(l){g.Pu(l.V); l.V=0;g.Pu(l.T);l.T=0;l.B();l.B=function(){}; g.Pu(l.Y)},TY=function(l,n){Hb.call(this,l,n,"ManualSession"); this.N=g.U0((0,g.tg)(this.Jw,this,null),150)},Wb=function(l,n){g.hj.call(this); this.config_=n;this.W=l;this.G=n.appId||"233637DE";this.L=n.theme||"cl";this.Y=n.disableCastApi||!1;this.V=n.forceMirroring||!1;this.S=null;this.T=!1;this.N=[];this.B=(0,g.tg)(this.eto,this)},gOk=function(l,n){return n?g.ak(l.N,function(O){return xI(n,O.label)},l):null},EB=function(l){n_("Controller",l)},woD=function(l){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(l)},NM=function(l){return l.T||!!l.N.length||!!l.S},Di=function(l,n,O){n!=l.S&&(g.h0(l.S),(l.S=n)?(O?l.publish("yt-remote-cast2-receiver-resumed", n.W):l.publish("yt-remote-cast2-receiver-selected",n.W),n.subscribe("sessionScreen",(0,g.tg)(l.iN,l,n)),n.subscribe("sessionFailed",function(){return LB6(l,n)}),n.S?l.publish("yt-remote-cast2-session-change",n.S):O&&l.S.Jw(null)):l.publish("yt-remote-cast2-session-change",null))},LB6=function(l,n){l.S==n&&l.publish("yt-remote-cast2-session-failed")},X2D=function(l){var n=l.W.xB(),O=l.S&&l.S.W; l=g.M9(n,function(L){O&&xI(L,O.label)&&(O=null);var X=L.uuid?L.uuid:L.id,F=gOk(this,L);F?(F.label=X,F.friendlyName=L.name):(F=new chrome.cast.Receiver(X,L.name),F.receiverType=chrome.cast.ReceiverType.CUSTOM);return F},l); O&&(O.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(O=new chrome.cast.Receiver(O.label,O.friendlyName),O.receiverType=chrome.cast.ReceiverType.CUSTOM),l.push(O));return l},w2q=function(l,n,O,L){L.disableCastApi?qM("Cannot initialize because disabled by Mdx config."):oO1()?FB6(n,L)&&(xzD(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?hED(l,O):(window.__onGCastApiAvailable=function(X,F){X?hED(l,O):(k9("Failed to load cast API: "+F),ZKR(!1),xzD(!1),g.$T("yt-remote-cast-available"),g.$T("yt-remote-cast-receiver"), Jcc(),O(!1))},L.loadCastApiSetupScript?g.Z0("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?gpF()>=60&&wu1():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?FAF():gpF()>=89?APq():(JPi(),UQ(HhF.map(xYc))))):qM("Cannot initialize because not running Chrome")},Jcc=function(){qM("dispose"); var l=MM();l&&l.dispose();g.i9("yt.mdx.remote.cloudview.instance_",null);HK0(!1);g.xj(AcR);AcR.length=0},Qt=function(){return!!g.dU("yt-remote-cast-installed")},bKR=function(){var l=g.dU("yt-remote-cast-receiver"); return l?l.friendlyName:null},rcq=function(){qM("clearCurrentReceiver"); g.$T("yt-remote-cast-receiver")},Uz1=function(){return Qt()?MM()?MM().getCastSession():(k9("getCastSelector: Cast is not initialized."),null):(k9("getCastSelector: Cast API is not installed!"),null)},ulk=function(){Qt()?MM()?ey()?(qM("Requesting cast selector."),MM().requestSession()):(qM("Wait for cast API to be ready to request the session."),AcR.push(g.Fx("yt-remote-cast2-api-ready",ulk))):k9("requestCastSelector: Cast is not initialized."):k9("requestCastSelector: Cast API is not installed!")}, Y9=function(l,n){ey()?MM().setConnectedScreenStatus(l,n):k9("setConnectedScreenStatus called before ready.")},oO1=function(){var l=g.e6().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.G2||l},PIk=function(l,n){MM().init(l,n)},FB6=function(l,n){var O=!1; MM()||(l=new Wb(l,n),l.subscribe("yt-remote-cast2-availability-change",function(L){g.It("yt-remote-cast-available",L);bH("yt-remote-cast2-availability-change",L)}),l.subscribe("yt-remote-cast2-receiver-selected",function(L){qM("onReceiverSelected: "+L.friendlyName); g.It("yt-remote-cast-receiver",L);bH("yt-remote-cast2-receiver-selected",L)}),l.subscribe("yt-remote-cast2-receiver-resumed",function(L){qM("onReceiverResumed: "+L.friendlyName); g.It("yt-remote-cast-receiver",L);bH("yt-remote-cast2-receiver-resumed",L)}),l.subscribe("yt-remote-cast2-session-change",function(L){qM("onSessionChange: "+hU(L)); L||g.$T("yt-remote-cast-receiver");bH("yt-remote-cast2-session-change",L)}),g.i9("yt.mdx.remote.cloudview.instance_",l),O=!0); qM("cloudview.createSingleton_: "+O);return O},MM=function(){return g.zk("yt.mdx.remote.cloudview.instance_")},hED=function(l,n){ZKR(!0); xzD(!1);PIk(l,function(O){O?(HK0(!0),g.hs("yt-remote-cast2-api-ready")):(k9("Failed to initialize cast API."),ZKR(!1),g.$T("yt-remote-cast-available"),g.$T("yt-remote-cast-receiver"),Jcc());n(O)})},qM=function(l){n_("cloudview",l)},k9=function(l){n_("cloudview",l)},ZKR=function(l){qM("setCastInstalled_ "+l); g.It("yt-remote-cast-installed",l)},ey=function(){return!!g.zk("yt.mdx.remote.cloudview.apiReady_")},HK0=function(l){qM("setApiReady_ "+l); g.i9("yt.mdx.remote.cloudview.apiReady_",l)},xzD=function(l){g.i9("yt.mdx.remote.cloudview.initializing_",l)},jy=function(l){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.V=this.T=0;this.trackData=null;this.FK=this.DE=!1;this.G=this.B=this.S=this.L=0;this.N=NaN;this.W=!1;this.reset(l)},TxO=function(l){l.audioTrackId=null; l.trackData=null;l.playerState=-1;l.DE=!1;l.FK=!1;l.T=0;l.V=g.l1();l.L=0;l.S=0;l.B=0;l.G=0;l.N=NaN;l.W=!1},GY=function(l){return l.isPlaying()?(g.l1()-l.V)/1E3:0},mu=function(l,n){l.T=n; l.V=g.l1()},Iw=function(l){switch(l.playerState){case 1:case 1081:return(g.l1()-l.V)/1E3+l.T; case -1E3:return 0}return l.T},dJ=function(l,n,O){var L=l.videoId; l.videoId=n;l.index=O;n!=L&&TxO(l)},WBs=function(l){var n={}; n.index=l.index;n.listId=l.listId;n.videoId=l.videoId;n.playerState=l.playerState;n.volume=l.volume;n.muted=l.muted;n.audioTrackId=l.audioTrackId;n.trackData=g.GB(l.trackData);n.hasPrevious=l.DE;n.hasNext=l.FK;n.playerTime=l.T;n.playerTimeAt=l.V;n.seekableStart=l.L;n.seekableEnd=l.S;n.duration=l.B;n.loadedTime=l.G;n.liveIngestionTime=l.N;return n},Vt=function(l,n){g.hj.call(this); var O=this;this.N=0;this.L=l;this.V=[];this.B=new Rp6;this.W=this.S=null;this.Y=(0,g.tg)(this.Z5z,this);this.T=(0,g.tg)(this.DY,this);this.G=(0,g.tg)(this.O5f,this);this.Wm=(0,g.tg)(this.x5q,this);var L=0;l?(L=l.getProxyState(),L!=3&&(l.subscribe("proxyStateChange",this.xd,this),EOu(this))):L=3;L!=0&&(n?this.xd(L):g.U0(function(){O.xd(L)},0)); (l=Uz1())&&$9(this,l);this.subscribe("yt-remote-cast2-session-change",this.Wm)},Bb=function(l){return new jy(l.L.getPlayerContextData())},EOu=function(l){g.ba("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(n){this.V.push(this.L.subscribe(n,g.ve(this.dPF,n),this))},l)},Nx1=function(l){g.ba(l.V,function(n){this.L.unsubscribeByKey(n)},l); l.V.length=0},cb=function(l){return l.getState()==1},i7=function(l,n){var O=l.B; O.S.length+O.W.length<50&&l.B.enqueue(n)},DzL=function(l,n,O){var L=Bb(l); mu(L,O);L.playerState!=-1E3&&(L.playerState=n);zY(l,L)},Sy=function(l,n,O){l.L.sendMessage(n,O)},zY=function(l,n){Nx1(l); l.L.setPlayerContextData(WBs(n));EOu(l)},$9=function(l,n){l.W&&(l.W.removeUpdateListener(l.Y),l.W.removeMediaListener(l.T),l.DY(null)); l.W=n;l.W&&(OB("Setting cast session: "+l.W.sessionId),l.W.addUpdateListener(l.Y),l.W.addMediaListener(l.T),l.W.media.length&&l.DY(l.W.media[0]))},qxu=function(l){var n=l.S.media,O=l.S.customData; if(n&&O){var L=Bb(l);n.contentId!=L.videoId&&OB("Cast changing video to: "+n.contentId);L.videoId=n.contentId;L.playerState=O.playerState;mu(L,l.S.getEstimatedTime());zY(l,L)}else OB("No cast media video. Ignoring state update.")},p_=function(l,n,O){return(0,g.tg)(function(L){this.aR("Failed to "+n+" with cast v2 channel. Error code: "+L.code); L.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.aR("Retrying "+n+" using MDx browser channel."),Sy(this,n,O))},l)},K_=function(l,n,O,L){L=L===void 0?!1:L; g.hj.call(this);var X=this;this.V=NaN;this.Lf=!1;this.Y=this.G=this.NQ=this.Q5=NaN;this.Wm=[];this.B=this.T=this.L=this.S=this.W=null;this.Hm=l;this.z3=L;this.Wm.push(g.NV(window,"beforeunload",function(){X.JT(2)})); this.N=[];this.S=new jy;this.wq=n.id;this.Cf=n.idType;this.W=JG1(this.Hm,O,this.oa,this.Cf=="shortLived",this.wq);this.W.listen("channelOpened",function(){ku1(X)}); this.W.listen("channelClosed",function(){sB("Channel closed");isNaN(X.V)?HX(!0):HX();X.dispose()}); this.W.listen("channelError",function(F){HX();isNaN(X.Wt())?(F==1&&X.Cf=="shortLived"&&X.publish("browserChannelAuthError",F),sB("Channel error: "+F+" without reconnection"),X.dispose()):(X.Lf=!0,sB("Channel error: "+F+" with reconnection in "+X.Wt()+" ms"),f_(X,2))}); this.W.listen("channelMessage",function(F){ycq(X,F)}); this.W.A5(n.token);this.subscribe("remoteQueueChange",function(){var F=X.S.videoId;g.Vd()&&g.It("yt-remote-session-video-id",F)})},M31=function(l){return g.ak(l.N,function(n){return n.type=="LOUNGE_SCREEN"})},sB=function(l){n_("conn",l)},f_=function(l,n){l.publish("proxyStateChange",n)},QHu=function(l){l.V=g.U0(function(){sB("Connecting timeout"); l.JT(1)},2E4)},eEQ=function(l){g.Pu(l.V); l.V=NaN},YxD=function(l){g.Pu(l.Q5); l.Q5=NaN},GuR=function(l){jH0(l); l.NQ=g.U0(function(){aw(l,"getNowPlaying")},2E4)},jH0=function(l){g.Pu(l.NQ); l.NQ=NaN},ku1=function(l){sB("Channel opened"); l.Lf&&(l.Lf=!1,YxD(l),l.Q5=g.U0(function(){sB("Timing out waiting for a screen.");l.JT(1)},15E3))},IgL=function(l,n){var O=null; if(n){var L=M31(l);L&&(O={clientName:L.clientName,deviceMake:L.brand,deviceModel:L.model,osVersion:L.osVersion})}g.i9("yt.mdx.remote.remoteClient_",O);n&&(eEQ(l),YxD(l));O=l.W.IS()&&isNaN(l.V);n==O?n&&(f_(l,1),aw(l,"getSubtitlesTrack")):n?(l.T8()&&l.S.reset(),f_(l,1),aw(l,"getNowPlaying"),mzc(l)):l.JT(1)},dz0=function(l,n){var O=n.params.videoId; delete n.params.videoId;O==l.S.videoId&&(g.Qj(n.params)?l.S.trackData=null:l.S.trackData=n.params,l.publish("remotePlayerChange"))},$zq=function(l,n,O){var L=n.params.videoId||n.params.video_id,X=parseInt(n.params.currentIndex,10); l.S.listId=n.params.listId||l.S.listId;dJ(l.S,L,X);l.publish("remoteQueueChange",O)},Bx6=function(l,n){n.params=n.params||{}; $zq(l,n,"NOW_PLAYING_MAY_CHANGE");V3s(l,n);l.publish("autoplayDismissed")},V3s=function(l,n){var O=parseInt(n.params.currentTime||n.params.current_time,10); mu(l.S,isNaN(O)?0:O);O=parseInt(n.params.state,10);O=isNaN(O)?-1:O;O==-1&&l.S.playerState==-1E3&&(O=-1E3);l.S.playerState=O;O=Number(n.params.loadedTime);l.S.G=isNaN(O)?0:O;l.S.O7(Number(n.params.duration));O=l.S;var L=Number(n.params.liveIngestionTime);O.N=L;O.W=isNaN(L)?!1:!0;O=l.S;L=Number(n.params.seekableStartTime);n=Number(n.params.seekableEndTime);O.L=isNaN(L)?0:L;O.S=isNaN(n)?0:n;l.S.playerState==1?GuR(l):jH0(l);l.publish("remotePlayerChange")},ccR=function(l,n){if(l.S.playerState!=-1E3){var O= 1085; switch(parseInt(n.params.adState,10)){case 1:O=1081;break;case 2:O=1084;break;case 0:O=1083}l.S.playerState=O;n=parseInt(n.params.currentTime,10);mu(l.S,isNaN(n)?0:n);l.publish("remotePlayerChange")}},iK6=function(l,n){var O=n.params.muted=="true"; l.S.volume=parseInt(n.params.volume,10);l.S.muted=O;l.publish("remotePlayerChange")},zEc=function(l,n){l.T=n.params.videoId; l.publish("nowAutoplaying",parseInt(n.params.timeout,10))},SxQ=function(l,n){l.T=n.params.videoId||null; l.publish("autoplayUpNext",l.T)},p2s=function(l,n){l.B=n.params.autoplayMode; l.publish("autoplayModeChange",l.B);l.B=="DISABLED"&&l.publish("autoplayDismissed")},sHu=function(l,n){var O=n.params.hasNext=="true"; l.S.DE=n.params.hasPrevious=="true";l.S.FK=O;l.publish("previousNextChange")},ycq=function(l,n){n=n.message; n.params?sB("Received: action="+n.action+", params="+g.QM(n.params)):sB("Received: action="+n.action+" {}");switch(n.action){case "loungeStatus":n=nq(n.params.devices);l.N=g.M9(n,function(L){return new oE(L)}); n=!!g.ak(l.N,function(L){return L.type=="LOUNGE_SCREEN"}); IgL(l,n);n=l.Ig("mlm");l.publish("multiStateLoopEnabled",n);break;case "loungeScreenDisconnected":g.la(l.N,function(L){return L.type=="LOUNGE_SCREEN"}); IgL(l,!1);break;case "remoteConnected":var O=new oE(nq(n.params.device));g.ak(l.N,function(L){return L.XT(O)})||tWF(l.N,O); break;case "remoteDisconnected":O=new oE(nq(n.params.device));g.la(l.N,function(L){return L.XT(O)}); break;case "gracefulDisconnect":break;case "playlistModified":$zq(l,n,"QUEUE_MODIFIED");break;case "nowPlaying":Bx6(l,n);break;case "onStateChange":V3s(l,n);break;case "onAdStateChange":ccR(l,n);break;case "onVolumeChanged":iK6(l,n);break;case "onSubtitlesTrackChanged":dz0(l,n);break;case "nowAutoplaying":zEc(l,n);break;case "autoplayDismissed":l.publish("autoplayDismissed");break;case "autoplayUpNext":SxQ(l,n);break;case "onAutoplayModeChanged":p2s(l,n);break;case "onHasPreviousNextChanged":sHu(l, n);break;case "requestAssistedSignIn":l.publish("assistedSignInRequested",n.params.authCode);break;case "onLoopModeChanged":l.publish("loopModeChange",n.params.loopMode);break;default:sB("Unrecognized action: "+n.action)}},mzc=function(l){g.Pu(l.Y); l.Y=g.U0(function(){l.JT(1)},864E5)},aw=function(l,n,O){O?sB("Sending: action="+n+", params="+g.QM(O)):sB("Sending: action="+n); l.W.sendMessage(n,O)},fgR=function(l){ow.call(this,"ScreenServiceProxy"); this.J7=l;this.S=[];this.S.push(this.J7.$_s("screenChange",(0,g.tg)(this.gQ,this)));this.S.push(this.J7.$_s("onlineScreenChange",(0,g.tg)(this.MzG,this)))},t3k=function(l,n){lEc(); if(!AU||!AU.get("yt-remote-disable-remote-module-for-dev")){n=g.R3("MDX_CONFIG")||n;pKD();awD();Rw||(Rw=new tU(n?n.loungeApiHost:void 0),npq()&&(Rw.S="/api/loungedev"));C_||(C_=g.zk("yt.mdx.remote.deferredProxies_")||[],g.i9("yt.mdx.remote.deferredProxies_",C_));KBi();var O=tu();if(!O){var L=new Ju(Rw,n?n.disableAutomaticScreenCache||!1:!1);g.i9("yt.mdx.remote.screenService_",L);O=tu();var X={};n&&(X={appId:n.appId,disableDial:n.disableDial,theme:n.theme,loadCastApiSetupScript:n.loadCastApiSetupScript, disableCastApi:n.disableCastApi,enableDialLoungeToken:n.enableDialLoungeToken,enableCastLoungeToken:n.enableCastLoungeToken,forceMirroring:n.forceMirroring});g.i9("yt.mdx.remote.enableConnectWithInitialState_",n?n.enableConnectWithInitialState||!1:!1);w2q(l,L,function(F){F?vb()&&Y9(vb(),"YouTube TV"):L.subscribe("onlineScreenChange",function(){bH("yt-remote-receiver-availability-change")})},X)}n&&!g.zk("yt.mdx.remote.initialized_")&&(g.i9("yt.mdx.remote.initialized_",!0),lp("Initializing: "+g.QM(n)), n8.push(g.Fx("yt-remote-cast2-api-ready",function(){bH("yt-remote-api-ready")})),n8.push(g.Fx("yt-remote-cast2-availability-change",function(){bH("yt-remote-receiver-availability-change")})),n8.push(g.Fx("yt-remote-cast2-receiver-selected",function(){On(null); bH("yt-remote-auto-connect","cast-selector-receiver")})),n8.push(g.Fx("yt-remote-cast2-receiver-resumed",function(){bH("yt-remote-receiver-resumed","cast-selector-receiver")})),n8.push(g.Fx("yt-remote-cast2-session-change",agq)),n8.push(g.Fx("yt-remote-connection-change",function(F){F?Y9(vb(),"YouTube TV"):gV()||(Y9(null,null),rcq())})),n8.push(g.Fx("yt-remote-cast2-session-failed",function(){bH("yt-remote-connection-failed")})),l=RE0(),n.isAuto&&(l.id+="#dial"),X=n.capabilities||[],g.E0("desktop_enable_autoplay")&& X.push("atp"),X.length>0&&(l.capabilities=X),l.name=n.device,l.app=n.app,(n=n.theme)&&(l.theme=n),lp(" -- with channel params: "+g.QM(l)),l?(g.It("yt-remote-session-app",l.app),g.It("yt-remote-session-name",l.name)):(g.$T("yt-remote-session-app"),g.$T("yt-remote-session-name")),g.i9("yt.mdx.remote.channelParams_",l),O.start(),vb()||CIR())}},vOq=function(){var l=tu().J7.$_gos(); var n=L8();n&&Xh()&&(Sli(l,n)||l.push(n));return z9u(l)},njL=function(){var l=l0u(); !l&&Qt()&&bKR()&&(l={key:"cast-selector-receiver",name:bKR()});return l},l0u=function(){var l=vOq(),n=L8(); n||(n=gV());return g.ak(l,function(O){return n&&xI(n,O.key)?!0:!1})},L8=function(){var l=vb(); if(!l)return null;var n=tu().a_();return ZV(n,l)},agq=function(l){lp("remote.onCastSessionChange_: "+hU(l)); if(l){var n=L8();if(n&&n.id==l.id){if(Y9(n.id,"YouTube TV"),l.idType=="shortLived"&&(l=l.token))oV&&(oV.token=l),(n=Xh())&&n.A5(l)}else n&&Fh(),xn(l,1)}else Xh()&&Fh()},Fh=function(){ey()?MM().stopSession():k9("stopSession called before API ready."); var l=Xh();l&&(l.disconnect(1),OPq(null))},gjL=function(){var l=Xh(); return!!l&&l.getProxyState()!=3},lp=function(l){n_("remote",l)},tu=function(){if(!L_Q){var l=g.zk("yt.mdx.remote.screenService_"); L_Q=l?new fgR(l):null}return L_Q},vb=function(){return g.zk("yt.mdx.remote.currentScreenId_")},XVL=function(l){g.i9("yt.mdx.remote.currentScreenId_",l)},ojF=function(){return g.zk("yt.mdx.remote.connectData_")},On=function(l){g.i9("yt.mdx.remote.connectData_",l)},Xh=function(){return g.zk("yt.mdx.remote.connection_")},OPq=function(l){var n=Xh(); On(null);l||XVL("");g.i9("yt.mdx.remote.connection_",l);C_&&(g.ba(C_,function(O){O(l)}),C_.length=0); n&&!l?bH("yt-remote-connection-change",!1):!n&&l&&bH("yt-remote-connection-change",!0)},gV=function(){var l=g.Vd(); if(!l)return null;var n=tu();if(!n)return null;n=n.a_();return ZV(n,l)},xn=function(l,n){vb(); L8()&&L8();if(hI)oV=l;else{XVL(l.id);var O=g.zk("yt.mdx.remote.enableConnectWithInitialState_")||!1;l=new K_(Rw,l,RE0(),O);l.connect(n,ojF());l.subscribe("beforeDisconnect",function(L){bH("yt-remote-before-disconnect",L)}); l.subscribe("beforeDispose",function(){Xh()&&(Xh(),OPq(null))}); l.subscribe("browserChannelAuthError",function(){var L=L8();L&&L.idType=="shortLived"&&(ey()?MM().handleBrowserChannelAuthError():k9("refreshLoungeToken called before API ready."))}); OPq(l)}},CIR=function(){var l=gV(); l?(lp("Resume connection to: "+hU(l)),xn(l,0)):(HX(),rcq(),lp("Skipping connecting because no session screen found."))},KBi=function(){var l=RE0(); if(g.Qj(l)){l=w6();var n=g.dU("yt-remote-session-name")||"",O=g.dU("yt-remote-session-app")||"";l={device:"REMOTE_CONTROL",id:l,name:n,app:O,mdxVersion:3};l.authuser=String(g.R3("SESSION_INDEX","0"));(n=g.R3("DELEGATED_SESSION_ID"))&&(l.pageId=String(n));g.i9("yt.mdx.remote.channelParams_",l)}},RE0=function(){return g.zk("yt.mdx.remote.channelParams_")||{}},hy0=function(l,n,O){g.V.call(this); var L=this;this.module=l;this.C=n;this.gK=O;this.events=new g.$B(this);this.L=!1;this.B=new g.XI(64);this.S=new g.vs(this.D3,500,this);this.W=new g.vs(this.Cd,1E3,this);this.T=new uH(this.MrQ,0,this);this.N={};this.G=new g.vs(this.DM,1E3,this);this.V=new PX(this.seekTo,1E3,this);this.Y=this.events.U(this.C,"onVolumeChange",function(X){F_6(L,X)}); g.c(this,this.events);this.events.U(n,"onCaptionsTrackListChanged",this.tzf);this.events.U(n,"captionschanged",this.cAp);this.events.U(n,"captionssettingschanged",this.wh);this.events.U(n,"videoplayerreset",this.IJ);this.events.U(n,"mdxautoplaycancel",function(){L.gK.Xy()}); n.J("enable_mdx_video_play_directly")&&this.events.U(n,"videodatachange",function(){xUs(L.module)||Zd(L)||JI(L,0)}); l=this.gK;l.JG();l.subscribe("proxyStateChange",this.q7,this);l.subscribe("remotePlayerChange",this.E1,this);l.subscribe("remoteQueueChange",this.IJ,this);l.subscribe("previousNextChange",this.JX,this);l.subscribe("nowAutoplaying",this.CJ,this);l.subscribe("autoplayDismissed",this.Z1,this);g.c(this,this.S);g.c(this,this.W);g.c(this,this.T);g.c(this,this.G);g.c(this,this.V);this.wh();this.IJ();this.E1()},F_6=function(l,n){if(Zd(l)){l.gK.unsubscribe("remotePlayerChange",l.E1,l); var O=Math.round(n.volume);n=!!n.muted;var L=Bb(l.gK);if(O!==L.volume||n!==L.muted)l.gK.setVolume(O,n),l.G.start();l.gK.subscribe("remotePlayerChange",l.E1,l)}},ZPs=function(l){l.tC(0); l.S.stop();l.Vu(new g.XI(64))},Jss=function(l,n){if(Zd(l)&&!l.L){var O=null; n&&(O={style:l.C.getSubtitlesUserSettings()},Object.assign(O,n));l.gK.vP(l.C.getVideoData(1).videoId,O);l.N=Bb(l.gK).trackData}},JI=function(l,n){var O=l.C.getPlaylist(); if(O==null?0:O.listId){var L=O.index;var X=O.listId.toString()}O=l.C.getVideoData(1);l.gK.playVideo(O.videoId,n,L,X,O.playerParams,O.Cf,Cxi(O));l.Vu(new g.XI(1))},wVR=function(l,n){if(n){var O=l.C.getOption("captions","tracklist",{zi:1}); O&&O.length?(l.C.setOption("captions","track",n),l.L=!1):(l.C.loadModule("captions"),l.L=!0)}else l.C.setOption("captions","track",{})},Zd=function(l){return Bb(l.gK).videoId===l.C.getVideoData(1).videoId},wV=function(){g.f.call(this,{D:"div", X:"ytp-mdx-popup-dialog",Z:{role:"dialog"},K:[{D:"div",X:"ytp-mdx-popup-dialog-inner-content",K:[{D:"div",X:"ytp-mdx-popup-title",hG:"Saliste de tu cuenta"},{D:"div",X:"ytp-mdx-popup-description",hG:"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."},{D:"div",X:"ytp-mdx-privacy-popup-buttons",K:[{D:"button",gq:["ytp-button", "ytp-mdx-privacy-popup-cancel"],hG:"Cancelar"},{D:"button",gq:["ytp-button","ytp-mdx-privacy-popup-confirm"],hG:"Confirmar"}]}]}]});this.fade=new g.gy(this,250);this.cancelButton=this.mJ("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.mJ("ytp-mdx-privacy-popup-confirm");g.c(this,this.fade);this.U(this.cancelButton,"click",this.S);this.U(this.confirmButton,"click",this.W)},HS=function(l){g.f.call(this,{D:"div", X:"ytp-remote",K:[{D:"div",X:"ytp-remote-display-status",K:[{D:"div",X:"ytp-remote-display-status-icon",K:[g.AGa()]},{D:"div",X:"ytp-remote-display-status-text",hG:"{{statustext}}"}]}]});this.api=l;this.fade=new g.gy(this,250);g.c(this,this.fade);this.U(l,"presentingplayerstatechange",this.onStateChange);this.OC(l.getPlayerStateObject())},AI=function(l,n){g.Ko.call(this,"Reproducir en",1,l,n); this.C=l;this.Ta={};this.U(l,"onMdxReceiversChange",this.L);this.U(l,"presentingplayerstatechange",this.L);this.L()},HPc=function(l){g.qq.call(this,l); this.XD={key:ixD(),name:"Esta computadora"};this.Dz=null;this.subscriptions=[];this.s3=this.gK=null;this.Ta=[this.XD];this.BX=this.XD;this.N_=new g.XI(64);this.Y0=0;this.BT=-1;this.bE=!1;this.ME=this.zJ=null;if(!g.mX(this.player.j())&&!g.Bt(this.player.j())){l=this.player;var n=g.AA(l);n&&(n=n.a7())&&(n=new AI(l,n),g.c(this,n));n=new HS(l);g.c(this,n);g.jR(l,n.element,4);this.zJ=new wV;g.c(this,this.zJ);g.jR(l,this.zJ.element,4);this.bE=!!gV()}},bp=function(l){l.ME&&(l.player.removeEventListener("presentingplayerstatechange", l.ME),l.ME=null)},As6=function(l,n,O){l.N_=O; l.player.publish("presentingplayerstatechange",new g.br(O,n))},rV=function(l,n){if(n.key!==l.BX.key)if(n.key===l.XD.key)Fh(); else if(xUs(l)&&bPD(l),l.BX=n,!l.player.j().J("disable_mdx_connection_in_mdx_module_for_music_web")||!g.Bt(l.player.j())){var O=l.player.getPlaylistId();var L=l.player.getVideoData(1);var X=L.videoId;if(!O&&!X||(l.player.getAppState()===2||l.player.getAppState()===1)&&l.player.j().J("should_clear_video_data_on_player_cued_unstarted"))L=null;else{var F=l.player.getPlaylist();if(F){var x=[];for(var Z=0;Z2*this.size&&XK(this),!0):!1}; g.h.get=function(l,n){return g6(this.W,l)?this.W[l]:n}; g.h.set=function(l,n){g6(this.W,l)||(this.size+=1,this.S.push(l),this.SS++);this.W[l]=n}; g.h.forEach=function(l,n){for(var O=this.pT(),L=0;L=L.S.length)return g.xl;var F=L.S[n++];return g.FB(l?F:L.W[F])}; return X}; var Iw1={Na3:"atp",TH2:"ska",koq:"que",dqf:"mus",qSf:"sus",pRf:"dsp",eLi:"seq",Y8o:"mic",YX1:"dpa",edJ:"cds",v6J:"mlm",OeQ:"dsdtr",LNz:"ntb",QPJ:"vsp",eD3:"scn",ZLq:"rpe",l$p:"dcn",cP3:"dcp",azz:"pas",kxi:"drq",HLf:"opf",RD5:"els",hD2:"isg",DRm:"svq",o6f:"mvp",e8f:"ads",S8Q:"iat"},dHs={RKf:"u",gVi:"cl",a0f:"k",WDz:"i",j0F:"cr",hXf:"m",q92:"g",xU:"up"};oE.prototype.XT=function(l){return l?this.id==l.id:!1}; var KqD="",AU=null;OhD.prototype.flush=function(l,n){l=l===void 0?[]:l;n=n===void 0?!1:n;if(g.E0("enable_client_streamz_web")){l=g.P(l);for(var O=l.next();!O.done;O=l.next())O=g.Zja(O.value),O={serializedIncrementBatch:g.Pd(O.S())},g.JG("streamzIncremented",O,{sendIsolatedPayload:n})}}; var r6,ZhO=LAR("loadCastFramework")||LAR("loadCastApplicationFramework"),HhF=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.nO(uH,g.V);g.h=uH.prototype;g.h.lz=function(l){this.L=arguments;this.S=!1;this.Kp?this.N=g.l1()+this.vQ:this.Kp=g.qv(this.B,this.vQ)}; g.h.stop=function(){this.Kp&&(g.Be.clearTimeout(this.Kp),this.Kp=null);this.N=null;this.S=!1;this.L=[]}; g.h.pause=function(){++this.W}; g.h.resume=function(){this.W&&(--this.W,!this.W&&this.S&&(this.S=!1,this.V.apply(null,this.L)))}; g.h.oz=function(){this.stop();uH.CN.oz.call(this)}; g.h.kJ=function(){this.Kp&&(g.Be.clearTimeout(this.Kp),this.Kp=null);this.N?(this.Kp=g.qv(this.B,this.N-g.l1()),this.N=null):this.W?this.S=!0:(this.S=!1,this.V.apply(null,this.L))};g.u(PX,g.V);g.h=PX.prototype;g.h.Oa=function(l){this.N=arguments;this.Kp||this.W?this.S=!0:bhL(this)}; g.h.stop=function(){this.Kp&&(g.Be.clearTimeout(this.Kp),this.Kp=null,this.S=!1,this.N=null)}; g.h.pause=function(){this.W++}; g.h.resume=function(){this.W--;this.W||!this.S||this.Kp||(this.S=!1,bhL(this))}; g.h.oz=function(){g.V.prototype.oz.call(this);this.stop()};TX.prototype.stringify=function(l){return g.Be.JSON.stringify(l,void 0)}; TX.prototype.parse=function(l){return g.Be.JSON.parse(l,void 0)};g.nO(rPu,g.mi);g.nO(UYu,g.mi);var uXc=null;g.nO(Tc0,g.mi);g.nO(WAc,g.mi);g.nO(Epi,g.mi);DV.prototype.debug=function(){}; DV.prototype.info=function(){}; DV.prototype.warning=function(){};var eRR={},QTu={};g.h=qj.prototype;g.h.setTimeout=function(l){this.Of=l}; g.h.ZI=function(l){l=l.target;var n=this.Pm;n&&g.to(l)==3?n.Oa():this.XG(l)}; g.h.XG=function(l){try{if(l==this.S)a:{var n=g.to(this.S),O=this.S.W,L=this.S.getStatus();if(!(n<3)&&(n!=3||this.S&&(this.W.W||g.l2(this.S)||g.nV(this.S)))){this.z3||n!=4||O==7||(O==8||L<=0?WX(3):WX(2));GjL(this);var X=this.S.getStatus();this.oO=X;var F=M_F(this);if(this.V=X==200){if(this.Fp&&!this.Fi){b:{if(this.S){var x=g.O_(this.S,"X-HTTP-Initial-Response");if(x&&!g.DL(x)){var Z=x;break b}}Z=null}if(l=Z)this.Fi=!0,zRq(this,l);else{this.V=!1;this.B=3;EQ(12);yL(this);Mj(this);break a}}if(this.Cf){l= !0;for(var J;!this.z3&&this.T0&&!this.JA&&(this.JA=!0,this.N.Wu(this)):(yL(this),Mj(this))}else zRq(this,F);n==4&&yL(this);this.V&&!this.z3&&(n==4?mYF(this.N,this):(this.V=!1,kI(this)))}else g.GBk(this.S),X==400&&F.indexOf("Unknown SID")> 0?(this.B=3,EQ(12)):(this.B=0,EQ(13)),yL(this),Mj(this)}}}catch(w){}finally{}}; g.h.cancel=function(){this.z3=!0;yL(this)}; g.h.O2=function(){this.Wm=null;var l=Date.now();l-this.Yo>=0?(this.wq!=2&&(WX(3),EQ(17)),yL(this),this.B=2,Mj(this)):jTD(this,this.Yo-l)}; g.h.getLastError=function(){return this.B}; g.h.SM=function(){return this.S};pus.prototype.cancel=function(){this.N=fED(this);if(this.W)this.W.cancel(),this.W=null;else if(this.S&&this.S.size!==0){for(var l=g.P(this.S.values()),n=l.next();!n.done;n=l.next())n.value.cancel();this.S.clear()}};g.h=t_u.prototype;g.h.yX=8;g.h.Sa=1;g.h.connect=function(l,n,O,L){EQ(0);this.n5=l;this.z3=n||{};O&&L!==void 0&&(this.z3.OSID=O,this.z3.OAID=L);this.Fi=this.Sz;this.Hm=BcL(this,null,this.n5);jB(this)}; g.h.disconnect=function(){lM6(this);if(this.Sa==3){var l=this.G3++,n=this.Hm.clone();g.Tf(n,"SID",this.L);g.Tf(n,"RID",l);g.Tf(n,"TYPE","terminate");IE(this,n);l=new qj(this,this.L,l);l.wq=2;l.G=vp(n.clone());n=!1;if(g.Be.navigator&&g.Be.navigator.sendBeacon)try{n=g.Be.navigator.sendBeacon(l.G.toString(),"")}catch(O){}!n&&g.Be.Image&&((new Image).src=l.G,n=!0);n||(l.S=kji(l.N,null),l.S.send(l.G));l.Q5=Date.now();kI(l)}oTs(this)}; g.h.h7=function(){return this.Sa==0}; g.h.getState=function(){return this.Sa}; g.h.P3=function(l){if(this.V)if(this.V=null,this.Sa==1){if(!l){this.G3=Math.floor(Math.random()*1E5);l=this.G3++;var n=new qj(this,"",l),O=this.Y;this.oO&&(O?(O=g.jY(O),g.mf(O,this.oO)):O=this.oO);this.T!==null||this.Yo||(n.Hm=O,O=null);var L;if(this.uv)a:{for(var X=L=0;X4096){L=X;break a}if(L===4096||X===this.N.length-1){L=X+1;break a}}L= 1E3}else L=1E3;L=gTk(this,n,L);X=this.Hm.clone();g.Tf(X,"RID",l);g.Tf(X,"CVER",22);this.Cf&&g.Tf(X,"X-HTTP-Session-Id",this.Cf);IE(this,X);O&&(this.Yo?L="headers="+g.RW(g.BTv(O))+"&"+L:this.T&&g.Do(X,this.T,O));V_q(this.W,n);this.OU&&g.Tf(X,"TYPE","init");this.uv?(g.Tf(X,"$req",L),g.Tf(X,"SID","null"),n.Fp=!0,q0c(n,X,null)):q0c(n,X,L);this.Sa=2}}else this.Sa==3&&(l?LQq(this,l):this.N.length==0||sTc(this.W)||LQq(this))}; g.h.FG=function(){this.G=null;Xkc(this);if(this.Wk&&!(this.Of||this.S==null||this.q5<=0)){var l=2*this.q5;this.Lf=Nj((0,g.tg)(this.leJ,this),l)}}; g.h.leJ=function(){this.Lf&&(this.Lf=null,this.Fi=!1,this.Of=!0,EQ(10),eB(this),Xkc(this))}; g.h.Wu=function(l){this.S==l&&this.Wk&&!this.Of&&(vps(this),this.Of=!0,EQ(11))}; g.h.YJ=function(){this.Wm!=null&&(this.Wm=null,eB(this),dYi(this),EQ(19))}; g.h.J7Q=function(l){l?EQ(2):EQ(1)}; g.h.isActive=function(){return!!this.B&&this.B.isActive(this)}; g.h=xV0.prototype;g.h.IQ=function(){}; g.h.jo=function(){}; g.h.Ap=function(){}; g.h.U0=function(){}; g.h.isActive=function(){return!0}; g.h.xi=function(){};g.nO($I,g.vE);$I.prototype.open=function(){this.S.B=this.N;this.V&&(this.S.wq=!0);this.S.connect(this.B,this.W||void 0)}; $I.prototype.close=function(){this.S.disconnect()}; $I.prototype.send=function(l){var n=this.S;if(typeof l==="string"){var O={};O.__data__=l;l=O}else this.L&&(O={},O.__data__=g.QM(l),l=O);n.N.push(new S0F(n.j7++,l));n.Sa==3&&jB(n)}; $I.prototype.oz=function(){this.S.B=null;delete this.N;this.S.disconnect();delete this.S;$I.CN.oz.call(this)}; g.nO(Zi1,rPu);g.nO(JBO,UYu);g.nO(d6,xV0);d6.prototype.IQ=function(){this.S.dispatchEvent("m")}; d6.prototype.jo=function(l){this.S.dispatchEvent(new Zi1(l))}; d6.prototype.Ap=function(l){this.S.dispatchEvent(new JBO(l))}; d6.prototype.U0=function(){this.S.dispatchEvent("n")};var BX=new g.vE;g.u(ABc,g.mi);g.h=iH.prototype;g.h.DB=null;g.h.uG=!1;g.h.jW=null;g.h.YX=null;g.h.j2=null;g.h.Mc=null;g.h.P6=null;g.h.K9=null;g.h.Vh=null;g.h.BQ=null;g.h.lm=0;g.h.bD=null;g.h.f9=null;g.h.Cg=null;g.h.Ao=-1;g.h.Ix=!0;g.h.UH=!1;g.h.Za=0;g.h.Gq=null;var TU6={},PG1={};g.h=iH.prototype;g.h.setTimeout=function(l){this.W=l}; g.h.S9=function(l){l=l.target;var n=this.Gq;n&&g.to(l)==3?n.Oa():this.GZ(l)}; g.h.GZ=function(l){try{if(l==this.BQ)a:{var n=g.to(this.BQ),O=this.BQ.W,L=this.BQ.getStatus();if(g.CJ&&!g.ua("420+")){if(n<4)break a}else if(n<3||n==3&&!g.l2(this.BQ))break a;this.UH||n!=4||O==7||(O==8||L<=0?this.S.rP(3):this.S.rP(2));NU6(this);var X=this.BQ.getStatus();this.Ao=X;var F=g.l2(this.BQ);if(this.uG=X==200){n==4&&zX(this);if(this.Cf){for(l=!0;!this.UH&&this.lm0?(this.Cg=3,cX(13)):(this.Cg=0,cX(14)),zX(this),DVQ(this)}}catch(Z){}finally{}}; g.h.cancel=function(){this.UH=!0;zX(this)}; g.h.uw=function(){this.jW=null;var l=Date.now();l-this.YX>=0?(this.Mc!=2&&this.S.rP(3),zX(this),this.Cg=2,cX(18),DVQ(this)):ETs(this,this.YX-l)}; g.h.getLastError=function(){return this.Cg};g.h=MUQ.prototype;g.h.uZ=null;g.h.hd=null;g.h.Vl=!1;g.h.Wx=null;g.h.hQ=null;g.h.gE=-1;g.h.cq=null;g.h.bY=null;g.h.connect=function(l){this.Wx=l;l=pq(this.S,null,this.Wx);cX(3);Date.now();var n=this.S.Y;n!=null?(this.cq=n[0],(this.bY=n[1])?(this.hQ=1,Qtc(this)):(this.hQ=2,epR(this))):(lH(l,"MODE","init"),this.hd=new iH(this),this.hd.DB=this.uZ,UVk(this.hd,l,!1,null,!0),this.hQ=0)}; g.h.TG=function(l){if(l)this.hQ=2,epR(this);else{cX(4);var n=this.S;n.P$=n.CP.gE;aE(n,9)}l&&this.rP(2)}; g.h.xL=function(l){return this.S.xL(l)}; g.h.abort=function(){this.hd&&(this.hd.cancel(),this.hd=null);this.gE=-1}; g.h.h7=function(){return!1}; g.h.Kv=function(l,n){this.gE=l.Ao;if(this.hQ==0)if(n){try{var O=this.W.parse(n)}catch(L){l=this.S;l.P$=this.gE;aE(l,2);return}this.cq=O[0];this.bY=O[1]}else l=this.S,l.P$=this.gE,aE(l,2);else this.hQ==2&&(this.Vl?(cX(7),Date.now()):n=="11111"?(cX(6),this.Vl=!0,Date.now(),this.gE=200,this.hd.cancel(),cX(12),sQ(this.S,this,!0)):(cX(8),Date.now(),this.Vl=!1))}; g.h.S_=function(){this.gE=this.hd.Ao;if(this.hd.uG)this.hQ==0?this.bY?(this.hQ=1,Qtc(this)):(this.hQ=2,epR(this)):this.hQ==2&&(this.Vl?(cX(12),sQ(this.S,this,!0)):(cX(11),sQ(this.S,this,!1)));else{this.hQ==0?cX(9):this.hQ==2&&cX(10);var l=this.S;this.hd.getLastError();l.P$=this.gE;aE(l,2)}}; g.h.pS=function(){return this.S.pS()}; g.h.isActive=function(){return this.S.isActive()}; g.h.rP=function(l){this.S.rP(l)};g.h=YhQ.prototype;g.h.R7=null;g.h.IZ=null;g.h.E9=null;g.h.mF=null;g.h.sy=null;g.h.kI=null;g.h.Mu=null;g.h.NV=null;g.h.nS=0;g.h.NS=0;g.h.kt=null;g.h.Sk=null;g.h.Jn=null;g.h.H0=null;g.h.CP=null;g.h.TA=null;g.h.nm=-1;g.h.fv=-1;g.h.P$=-1;g.h.I$=0;g.h.pm=0;g.h.B0=8;g.nO(GKO,g.mi);g.nO(mVD,g.mi);g.h=YhQ.prototype;g.h.connect=function(l,n,O,L,X){cX(0);this.sy=n;this.IZ=O||{};L&&X!==void 0&&(this.IZ.OSID=L,this.IZ.OAID=X);this.G?(VL((0,g.tg)(this.mQ,this,l),100),dVD(this)):this.mQ(l)}; g.h.disconnect=function(){$Vi(this);if(this.S==3){var l=this.nS++,n=this.kI.clone();g.Tf(n,"SID",this.L);g.Tf(n,"RID",l);g.Tf(n,"TYPE","terminate");Kq(this,n);l=new iH(this,this.L,l);l.Mc=2;l.P6=vp(n.clone());(new Image).src=l.P6.toString();l.j2=Date.now();u1D(l)}KQq(this)}; g.h.mQ=function(l){this.CP=new MUQ(this);this.CP.uZ=this.R7;this.CP.W=this.B;this.CP.connect(l)}; g.h.h7=function(){return this.S==0}; g.h.getState=function(){return this.S}; g.h.lP=function(l){this.Sk=null;zp0(this,l)}; g.h.bP=function(){this.Jn=null;this.mF=new iH(this,this.L,"rpc",this.T);this.mF.DB=this.R7;this.mF.Za=0;var l=this.Mu.clone();g.Tf(l,"RID","rpc");g.Tf(l,"SID",this.L);g.Tf(l,"CI",this.TA?"0":"1");g.Tf(l,"AID",this.nm);Kq(this,l);g.Tf(l,"TYPE","xmlhttp");UVk(this.mF,l,!0,this.NV,!1)}; g.h.Kv=function(l,n){if(this.S!=0&&(this.mF==l||this.E9==l))if(this.P$=l.Ao,this.E9==l&&this.S==3)if(this.B0>7){try{var O=this.B.parse(n)}catch(L){O=null}if(Array.isArray(O)&&O.length==3)if(l=O,l[0]==0)a:{if(!this.Jn){if(this.mF)if(this.mF.j2+3E30)){if(L=n==1)this.E9||this.Sk||this.S==1||this.I$>=2?L=!1:(this.Sk=VL((0,g.tg)(this.lP,this,l),pku(this,this.I$)),this.I$++,L=!0);L=!(L||n==2&&st1(this))}if(L)switch(O){case 1:aE(this, 5);break;case 4:aE(this,10);break;case 3:aE(this,6);break;case 7:aE(this,12);break;default:aE(this,2)}}}; g.h.We=function(l){if(!g.CO(arguments,this.S))throw Error("Unexpected channel state: "+this.S);}; g.h.gTz=function(l){l?cX(2):(cX(1),fML(this,8))}; g.h.xL=function(l){if(l)throw Error("Can't create secondary domain capable XhrIo object.");l=new g.ah;l.T=!1;return l}; g.h.isActive=function(){return!!this.kt&&this.kt.isActive(this)}; g.h.rP=function(l){var n=BX;n.dispatchEvent(new mVD(n,l))}; g.h.pS=function(){return!1}; g.h=aM6.prototype;g.h.Zt=function(){}; g.h.O0=function(){}; g.h.k$=function(){}; g.h.vx=function(){}; g.h.Y$=function(){return{}}; g.h.isActive=function(){return!0};g.h=Rp6.prototype;g.h.enqueue=function(l){this.W.push(l)}; g.h.isEmpty=function(){return this.S.length===0&&this.W.length===0}; g.h.clear=function(){this.S=[];this.W=[]}; g.h.contains=function(l){return g.CO(this.S,l)||g.CO(this.W,l)}; g.h.remove=function(l){var n=this.S;var O=(0,g.Rzi)(n,l);O>=0?(g.t0(n,O),n=!0):n=!1;return n||g.vR(this.W,l)}; g.h.yW=function(){for(var l=[],n=this.S.length-1;n>=0;--n)l.push(this.S[n]);n=this.W.length;for(var O=0;O=rsF.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(l=rsF[this.W],this.Kp=g.U0((0,g.tg)(this.N$,this),l),this.W++):this.publish("pairingFailed",Error("Server error "+l.status))}; g.h.mO=function(){this.S=null;this.publish("pairingFailed",Error("Server not responding"))}; var rsF=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.nO(x9,ow);g.h=x9.prototype;g.h.start=function(){Fk(this)&&this.publish("screenChange");!g.dU("yt-remote-lounge-token-expiration")&&NF6(this);g.Pu(this.S);this.S=g.U0((0,g.tg)(this.start,this),1E4)}; g.h.add=function(l,n){Fk(this);PXF(this,l);hu(this,!1);this.publish("screenChange");n(l);l.token||NF6(this)}; g.h.remove=function(l,n){var O=Fk(this);WIi(this,l)&&(hu(this,!1),O=!0);n(l);O&&this.publish("screenChange")}; g.h.wM=function(l,n,O,L){var X=Fk(this),F=this.get(l.id);F?(F.name!=n&&(F.name=n,hu(this,!1),X=!0),O(l)):L(Error("no such local screen."));X&&this.publish("screenChange")}; g.h.oz=function(){g.Pu(this.S);x9.CN.oz.call(this)}; g.h.xQf=function(l){Fk(this);var n=this.screens.length;l=l&&l.screens||[];for(var O=l.length,L=0;L20)break a;Z=n(F,x)}F=Z}X.name=F}O(wJ(this,X))},this), onError:(0,g.tg)(function(X){L(Error("pairing request failed: "+X.status))},this), onTimeout:(0,g.tg)(function(){L(Error("pairing request timed out."))},this)})}; g.h.oz=function(){g.h0(this.W);g.h0(this.S);Ju.CN.oz.call(this)}; g.h.R1m=function(){I7q(this);this.publish("screenChange");this.S.update()}; Ju.prototype.dispose=Ju.prototype.dispose;g.nO(Hb,g.hj);g.h=Hb.prototype;g.h.bl=function(l){this.JG()||(l&&(b7(this,""+l),this.publish("sessionFailed")),this.S=null,this.publish("sessionScreen",null))}; g.h.info=function(l){n_(this.Cf,l)}; g.h.WP=function(){return null}; g.h.cW=function(l){var n=this.W;l?(n.displayStatus=new chrome.cast.ReceiverDisplayStatus(l,[]),n.displayStatus.showStop=!0):n.displayStatus=null;chrome.cast.setReceiverDisplayStatus(n,(0,g.tg)(function(){this.info("Updated receiver status for "+n.friendlyName+": "+l)},this),(0,g.tg)(function(){b7(this,"Failed to update receiver status for: "+n.friendlyName)},this))}; g.h.oz=function(){this.cW("");Hb.CN.oz.call(this)};g.u(rJ,Hb);g.h=rJ.prototype;g.h.b7=function(l){if(this.N){if(this.N==l)return;b7(this,"Overriding cast session with new session object");KIL(this);this.Q5=!1;this.Y="unknown";this.N.removeUpdateListener(this.NQ);this.N.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Lf)}this.N=l;this.N.addUpdateListener(this.NQ);this.N.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.Lf);zP6(this,"getMdxSessionStatus")}; g.h.Jw=function(l){this.info("launchWithParams no-op for Cast: "+g.QM(l))}; g.h.stop=function(){this.N?this.N.stop((0,g.tg)(function(){this.bl()},this),(0,g.tg)(function(){this.bl(Error("Failed to stop receiver app."))},this)):this.bl(Error("Stopping cast device without session."))}; g.h.cW=function(){}; g.h.oz=function(){this.info("disposeInternal");KIL(this);this.N&&(this.N.removeUpdateListener(this.NQ),this.N.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Lf));this.N=null;Hb.prototype.oz.call(this)}; g.h.m_G=function(l,n){if(!this.JG())if(n)if(n=nq(n),g.Kv(n))switch(l=""+n.type,n=n.data||{},this.info("onYoutubeMessage_: "+l+" "+g.QM(n)),l){case "mdxSessionStatus":BFO(this,n);break;case "loungeToken":SyD(this,n);break;default:b7(this,"Unknown youtube message: "+l)}else b7(this,"Unable to parse message.");else b7(this,"No data in message.")}; g.h.ye=function(l,n,O,L){g.Pu(this.G);this.G=0;jZs(this.L,this.W.label,l,this.W.friendlyName,(0,g.tg)(function(X){X?n(X):L>=0?(b7(this,"Screen "+l+" appears to be offline. "+L+" retries left."),this.G=g.U0((0,g.tg)(this.ye,this,l,n,O,L-1),300)):O(Error("Unable to fetch screen."))},this),O)}; g.h.WP=function(){return this.N}; g.h.DT=function(l){this.JG()||l||(b7(this,"Cast session died."),this.bl())};g.u(UB,Hb);g.h=UB.prototype;g.h.b7=function(l){this.N=l;this.N.addUpdateListener(this.z3)}; g.h.Jw=function(l){this.Hm=l;this.Wm()}; g.h.stop=function(){OKO(this);this.N?this.N.stop((0,g.tg)(this.bl,this,null),(0,g.tg)(this.bl,this,"Failed to stop DIAL device.")):this.bl()}; g.h.oz=function(){OKO(this);this.N&&this.N.removeUpdateListener(this.z3);this.N=null;Hb.prototype.oz.call(this)}; g.h.C$=function(l){this.JG()||l||(b7(this,"DIAL session died."),this.B(),this.B=function(){},this.bl())};g.u(TY,Hb);TY.prototype.stop=function(){this.bl()}; TY.prototype.b7=function(){}; TY.prototype.Jw=function(){g.Pu(this.N);this.N=NaN;var l=ZV(this.L.a_(),this.W.label);l?Au(this,l):this.bl(Error("No such screen"))}; TY.prototype.oz=function(){g.Pu(this.N);this.N=NaN;Hb.prototype.oz.call(this)};g.u(Wb,g.hj);g.h=Wb.prototype; g.h.init=function(l,n){chrome.cast.timeout.requestSession=3E4;var O=new chrome.cast.SessionRequest(this.G,[chrome.cast.Capability.AUDIO_OUT]);g.E0("desktop_enable_cast_connect")&&(O.androidReceiverCompatible=!0);this.Y||(O.dialRequest=new chrome.cast.DialRequest("YouTube"));var L=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;l=l||this.V?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var X=(0,g.tg)(this.mPo,this);O=new chrome.cast.ApiConfig(O,(0,g.tg)(this.TQ, this),X,L,l);O.customDialLaunchCallback=(0,g.tg)(this.d5f,this);chrome.cast.initialize(O,(0,g.tg)(function(){this.JG()||(chrome.cast.addReceiverActionListener(this.B),b1c(),this.W.subscribe("onlineScreenChange",(0,g.tg)(this.Nr,this)),this.N=X2D(this),chrome.cast.setCustomReceivers(this.N,function(){},(0,g.tg)(function(F){this.aR("Failed to set initial custom receivers: "+g.QM(F))},this)),this.publish("yt-remote-cast2-availability-change",NM(this)),n(!0))},this),(0,g.tg)(function(F){this.aR("Failed to initialize API: "+ g.QM(F)); n(!1)},this))}; g.h.PQq=function(l,n){EB("Setting connected screen ID: "+l+" -> "+n);if(this.S){var O=this.S.S;if(!l||O&&O.id!=l)EB("Unsetting old screen status: "+this.S.W.friendlyName),Di(this,null)}if(l&&n){if(!this.S){l=ZV(this.W.a_(),l);if(!l){EB("setConnectedScreenStatus: Unknown screen.");return}if(l.idType=="shortLived"){EB("setConnectedScreenStatus: Screen with id type to be short lived.");return}O=gOk(this,l);O||(EB("setConnectedScreenStatus: Connected receiver not custom..."),O=new chrome.cast.Receiver(l.uuid? l.uuid:l.id,l.name),O.receiverType=chrome.cast.ReceiverType.CUSTOM,this.N.push(O),chrome.cast.setCustomReceivers(this.N,function(){},(0,g.tg)(function(L){this.aR("Failed to set initial custom receivers: "+g.QM(L))},this))); EB("setConnectedScreenStatus: new active receiver: "+O.friendlyName);Di(this,new TY(this.W,O),!0)}this.S.cW(n)}else EB("setConnectedScreenStatus: no screen.")}; g.h.pMF=function(l){this.JG()?this.aR("Setting connection data on disposed cast v2"):this.S?this.S.Jw(l):this.aR("Setting connection data without a session")}; g.h.Be=function(){this.JG()?this.aR("Stopping session on disposed cast v2"):this.S?(this.S.stop(),Di(this,null)):EB("Stopping non-existing session")}; g.h.requestSession=function(){chrome.cast.requestSession((0,g.tg)(this.TQ,this),(0,g.tg)(this.jI5,this))}; g.h.oz=function(){this.W.unsubscribe("onlineScreenChange",(0,g.tg)(this.Nr,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.B);var l=woD,n=g.zk("yt.mdx.remote.debug.handlers_");g.vR(n||[],l);g.h0(this.S);g.hj.prototype.oz.call(this)}; g.h.aR=function(l){n_("Controller",l)}; g.h.iN=function(l,n){this.S==l&&(n||Di(this,null),this.publish("yt-remote-cast2-session-change",n))}; g.h.eto=function(l,n){if(!this.JG())if(l)switch(l.friendlyName=chrome.cast.unescape(l.friendlyName),EB("onReceiverAction_ "+l.label+" / "+l.friendlyName+"-- "+n),n){case chrome.cast.ReceiverAction.CAST:if(this.S)if(this.S.W.label!=l.label)EB("onReceiverAction_: Stopping active receiver: "+this.S.W.friendlyName),this.S.stop();else{EB("onReceiverAction_: Casting to active receiver.");this.S.S&&this.publish("yt-remote-cast2-session-change",this.S.S);break}switch(l.receiverType){case chrome.cast.ReceiverType.CUSTOM:Di(this, new TY(this.W,l));break;case chrome.cast.ReceiverType.DIAL:Di(this,new UB(this.W,l,this.L,this.config_));break;case chrome.cast.ReceiverType.CAST:Di(this,new rJ(this.W,l,this.config_));break;default:this.aR("Unknown receiver type: "+l.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.S&&this.S.W.label==l.label?this.S.stop():this.aR("Stopping receiver w/o session: "+l.friendlyName)}else this.aR("onReceiverAction_ called without receiver.")}; g.h.d5f=function(l){if(this.JG())return Promise.reject(Error("disposed"));var n=l.receiver;n.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.aR("Not DIAL receiver: "+n.friendlyName),n.receiverType=chrome.cast.ReceiverType.DIAL);var O=this.S?this.S.W:null;if(!O||O.label!=n.label)return this.aR("Receiving DIAL launch request for non-clicked DIAL receiver: "+n.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(O&&O.label==n.label&&O.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.S.S)return EB("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.S.S),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.aR('Changing CAST intent from "'+O.receiverType+'" to "dial" for '+n.friendlyName);Di(this,new UB(this.W,n,this.L,this.config_))}n=this.S;n.G=l;n.G.appState==chrome.cast.DialAppState.RUNNING?(l=n.G.extraData||{},O=l.screenId||null,u7(n)&&l.loungeToken?l.loungeTokenRefreshIntervalMs?l=vtk(n,{name:n.W.friendlyName,screenId:l.screenId,loungeToken:l.loungeToken,dialId:n.G.receiver.label, screenIdType:"shortLived"},l.loungeTokenRefreshIntervalMs):(g.vK(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(l)+".")),l=lgc(n,O)):l=lgc(n,O)):l=CXu(n);return l}; g.h.TQ=function(l){var n=this;if(!this.JG()&&!this.V){EB("New cast session ID: "+l.sessionId);var O=l.receiver;if(O.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.S)if(O.receiverType==chrome.cast.ReceiverType.CAST)EB("Got resumed cast session before resumed mdx connection."),O.friendlyName=chrome.cast.unescape(O.friendlyName),Di(this,new rJ(this.W,O,this.config_),!0);else{this.aR("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var L=this.S.W,X=ZV(this.W.a_(), L.label);X&&xI(X,O.label)&&L.receiverType!=chrome.cast.ReceiverType.CAST&&O.receiverType==chrome.cast.ReceiverType.CAST&&(EB("onSessionEstablished_: manual to cast session change "+O.friendlyName),g.h0(this.S),this.S=new rJ(this.W,O,this.config_),this.S.subscribe("sessionScreen",(0,g.tg)(this.iN,this,this.S)),this.S.subscribe("sessionFailed",function(){return LB6(n,n.S)}),this.S.Jw(null)); this.S.b7(l)}}}; g.h.VP=function(){return this.S?this.S.WP():null}; g.h.jI5=function(l){this.JG()||(this.aR("Failed to estabilish a session: "+g.QM(l)),l.code!=chrome.cast.ErrorCode.CANCEL&&Di(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.h.mPo=function(l){EB("Receiver availability updated: "+l);if(!this.JG()){var n=NM(this);this.T=l==chrome.cast.ReceiverAvailability.AVAILABLE;NM(this)!=n&&this.publish("yt-remote-cast2-availability-change",NM(this))}}; g.h.Nr=function(){this.JG()||(this.N=X2D(this),EB("Updating custom receivers: "+g.QM(this.N)),chrome.cast.setCustomReceivers(this.N,function(){},(0,g.tg)(function(){this.aR("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",NM(this)))}; Wb.prototype.setLaunchParams=Wb.prototype.pMF;Wb.prototype.setConnectedScreenStatus=Wb.prototype.PQq;Wb.prototype.stopSession=Wb.prototype.Be;Wb.prototype.getCastSession=Wb.prototype.VP;Wb.prototype.requestSession=Wb.prototype.requestSession;Wb.prototype.init=Wb.prototype.init;Wb.prototype.dispose=Wb.prototype.dispose;var AcR=[];g.h=jy.prototype; g.h.reset=function(l){this.listId="";this.index=-1;this.videoId="";TxO(this);this.volume=-1;this.muted=!1;l&&(this.index=l.index,this.listId=l.listId,this.videoId=l.videoId,this.playerState=l.playerState,this.volume=l.volume,this.muted=l.muted,this.audioTrackId=l.audioTrackId,this.trackData=l.trackData,this.DE=l.hasPrevious,this.FK=l.hasNext,this.T=l.playerTime,this.V=l.playerTimeAt,this.L=l.seekableStart,this.S=l.seekableEnd,this.B=l.duration,this.G=l.loadedTime,this.N=l.liveIngestionTime,this.W= !isNaN(this.N))}; g.h.isPlaying=function(){return this.playerState==1}; g.h.isBuffering=function(){return this.playerState==3}; g.h.tZ=function(){return this.playerState==1081}; g.h.O7=function(l){this.B=isNaN(l)?0:l}; g.h.getDuration=function(){return this.W?this.B+GY(this):this.B}; g.h.clone=function(){return new jy(WBs(this))};g.u(Vt,g.hj);g.h=Vt.prototype;g.h.getState=function(){return this.N}; g.h.Um=function(){return this.L.getReconnectTimeout()}; g.h.nV=function(){this.L.reconnect()}; g.h.play=function(){cb(this)?(this.S?this.S.play(null,g.H$,p_(this,"play")):Sy(this,"play"),DzL(this,1,Iw(Bb(this))),this.publish("remotePlayerChange")):i7(this,this.play)}; g.h.pause=function(){cb(this)?(this.S?this.S.pause(null,g.H$,p_(this,"pause")):Sy(this,"pause"),DzL(this,2,Iw(Bb(this))),this.publish("remotePlayerChange")):i7(this,this.pause)}; g.h.seekTo=function(l){if(cb(this)){if(this.S){var n=Bb(this),O=new chrome.cast.media.SeekRequest;O.currentTime=l;n.isPlaying()||n.isBuffering()?O.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:O.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.S.seek(O,g.H$,p_(this,"seekTo",{newTime:l}))}else Sy(this,"seekTo",{newTime:l});DzL(this,3,l);this.publish("remotePlayerChange")}else i7(this,g.ve(this.seekTo,l))}; g.h.stop=function(){if(cb(this)){this.S?this.S.stop(null,g.H$,p_(this,"stopVideo")):Sy(this,"stopVideo");var l=Bb(this);l.index=-1;l.videoId="";TxO(l);zY(this,l);this.publish("remotePlayerChange")}else i7(this,this.stop)}; g.h.setVolume=function(l,n){if(cb(this)){var O=Bb(this);if(this.W){if(O.volume!=l){var L=Math.round(l)/100;this.W.setReceiverVolumeLevel(L,(0,g.tg)(function(){OB("set receiver volume: "+L)},this),(0,g.tg)(function(){this.aR("failed to set receiver volume.")},this))}O.muted!=n&&this.W.setReceiverMuted(n,(0,g.tg)(function(){OB("set receiver muted: "+n)},this),(0,g.tg)(function(){this.aR("failed to set receiver muted.")},this))}else{var X={volume:l, muted:n};O.volume!=-1&&(X.delta=l-O.volume);Sy(this,"setVolume",X)}O.muted=n;O.volume=l;zY(this,O)}else i7(this,g.ve(this.setVolume,l,n))}; g.h.vP=function(l,n){if(cb(this)){var O=Bb(this);l={videoId:l};n&&(O.trackData={trackName:n.name,languageCode:n.languageCode,sourceLanguageCode:n.translationLanguage?n.translationLanguage.languageCode:"",languageName:n.languageName,kind:n.kind},l.style=g.QM(n.style),g.mf(l,O.trackData));Sy(this,"setSubtitlesTrack",l);zY(this,O)}else i7(this,g.ve(this.vP,l,n))}; g.h.setAudioTrack=function(l,n){cb(this)?(n=n.getLanguageInfo().getId(),Sy(this,"setAudioTrack",{videoId:l,audioTrackId:n}),l=Bb(this),l.audioTrackId=n,zY(this,l)):i7(this,g.ve(this.setAudioTrack,l,n))}; g.h.playVideo=function(l,n,O,L,X,F,x){L=L===void 0?null:L;X=X===void 0?null:X;F=F===void 0?null:F;x=x===void 0?null:x;var Z=Bb(this),J={videoId:l};O!==void 0&&(J.currentIndex=O);dJ(Z,l,O||0);n!==void 0&&(mu(Z,n),J.currentTime=n);L&&(J.listId=L);X&&(J.playerParams=X);F&&(J.clickTrackingParams=F);x&&(J.locationInfo=g.QM(x));Sy(this,"setPlaylist",J);L||zY(this,Z)}; g.h.e6=function(l,n){if(cb(this)){if(l&&n){var O=Bb(this);dJ(O,l,n);zY(this,O)}Sy(this,"previous")}else i7(this,g.ve(this.e6,l,n))}; g.h.nextVideo=function(l,n){if(cb(this)){if(l&&n){var O=Bb(this);dJ(O,l,n);zY(this,O)}Sy(this,"next")}else i7(this,g.ve(this.nextVideo,l,n))}; g.h.Bn=function(){if(cb(this)){Sy(this,"clearPlaylist");var l=Bb(this);l.reset();zY(this,l);this.publish("remotePlayerChange")}else i7(this,this.Bn)}; g.h.Xy=function(){cb(this)?Sy(this,"dismissAutoplay"):i7(this,this.Xy)}; g.h.dispose=function(){if(this.N!=3){var l=this.N;this.N=3;this.publish("proxyStateChange",l,this.N)}g.hj.prototype.dispose.call(this)}; g.h.oz=function(){Nx1(this);this.L=null;this.B.clear();$9(this,null);g.hj.prototype.oz.call(this)}; g.h.xd=function(l){if((l!=this.N||l==2)&&this.N!=3&&l!=0){var n=this.N;this.N=l;this.publish("proxyStateChange",n,l);if(l==1)for(;!this.B.isEmpty();)n=l=this.B,n.S.length===0&&(n.S=n.W,n.S.reverse(),n.W=[]),l.S.pop().apply(this);else l==3&&this.dispose()}}; g.h.dPF=function(l,n){this.publish(l,n)}; g.h.Z5z=function(l){if(!l)this.DY(null),$9(this,null);else if(this.W.receiver.volume){l=this.W.receiver.volume;var n=Bb(this),O=Math.round(100*l.level||0);if(n.volume!=O||n.muted!=l.muted)OB("Cast volume update: "+l.level+(l.muted?" muted":"")),n.volume=O,n.muted=!!l.muted,zY(this,n)}}; g.h.DY=function(l){OB("Cast media: "+!!l);this.S&&this.S.removeUpdateListener(this.G);if(this.S=l)this.S.addUpdateListener(this.G),qxu(this),this.publish("remotePlayerChange")}; g.h.O5f=function(l){l?(qxu(this),this.publish("remotePlayerChange")):this.DY(null)}; g.h.P4=function(){Sy(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.h.x5q=function(){var l=Uz1();l&&$9(this,l)}; g.h.aR=function(l){n_("CP",l)};g.u(K_,g.hj);g.h=K_.prototype; g.h.connect=function(l,n){if(n){var O=n.listId,L=n.videoId,X=n.videoIds,F=n.playerParams,x=n.clickTrackingParams,Z=n.index,J={videoId:L},w=n.currentTime,H=n.locationInfo;n=n.loopMode;w!==void 0&&(J.currentTime=w<=5?0:w);F&&(J.playerParams=F);H&&(J.locationInfo=H);x&&(J.clickTrackingParams=x);O&&(J.listId=O);X&&X.length>0&&(J.videoIds=X.join(","));Z!==void 0&&(J.currentIndex=Z);this.z3&&(J.loopMode=n||"LOOP_MODE_OFF");O&&(this.S.listId=O);this.S.videoId=L;this.S.index=Z||0;this.S.state=3;mu(this.S, w);this.B="UNSUPPORTED";O=this.z3?"setInitialState":"setPlaylist";sB("Connecting with "+O+" and params: "+g.QM(J));this.W.connect({method:O,params:g.QM(J)},l,R9O())}else sB("Connecting without params"),this.W.connect({},l,R9O());QHu(this)}; g.h.A5=function(l){this.W.A5(l)}; g.h.dispose=function(){this.JG()||(g.i9("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),f_(this,3));g.hj.prototype.dispose.call(this)}; g.h.oz=function(){eEQ(this);jH0(this);YxD(this);g.Pu(this.G);this.G=NaN;g.Pu(this.Y);this.Y=NaN;this.L=null;g.DM(this.Wm);this.Wm.length=0;this.W.dispose();g.hj.prototype.oz.call(this);this.B=this.T=this.N=this.S=this.W=null}; g.h.Ig=function(l){if(!this.N||this.N.length===0)return!1;for(var n=g.P(this.N),O=n.next();!O.done;O=n.next())if(!O.value.capabilities.has(l))return!1;return!0}; g.h.y7=function(){var l=3;this.JG()||(l=0,isNaN(this.Wt())?this.W.IS()&&isNaN(this.V)&&(l=1):l=2);return l}; g.h.JT=function(l){sB("Disconnecting with "+l);g.i9("yt.mdx.remote.remoteClient_",null);eEQ(this);this.publish("beforeDisconnect",l);l==1&&HX();this.W.disconnect(l);this.dispose()}; g.h.q6=function(){var l=this.S;this.L&&(l=this.S.clone(),dJ(l,this.L,l.index));return WBs(l)}; g.h.G1J=function(l){var n=this,O=new jy(l);O.videoId&&O.videoId!=this.S.videoId&&(this.L=O.videoId,g.Pu(this.G),this.G=g.U0(function(){if(n.L){var X=n.L;n.L=null;n.S.videoId!=X&&aw(n,"getNowPlaying")}},5E3)); var L=[];this.S.listId==O.listId&&this.S.videoId==O.videoId&&this.S.index==O.index||L.push("remoteQueueChange");this.S.playerState==O.playerState&&this.S.volume==O.volume&&this.S.muted==O.muted&&Iw(this.S)==Iw(O)&&g.QM(this.S.trackData)==g.QM(O.trackData)||L.push("remotePlayerChange");this.S.reset(l);g.ba(L,function(X){this.publish(X)},this)}; g.h.T8=function(){var l=this.W.getDeviceId(),n=g.ak(this.N,function(O){return O.type=="REMOTE_CONTROL"&&O.id!=l}); return n?n.id:""}; g.h.Wt=function(){return this.W.Um()}; g.h.oG=function(){return this.B||"UNSUPPORTED"}; g.h.dw=function(){return this.T||""}; g.h.He=function(){!isNaN(this.Wt())&&this.W.nV()}; g.h.XMG=function(l,n){aw(this,l,n);mzc(this)}; g.h.oa=function(){var l=g.VA("SAPISID","")||g.VA("__Secure-1PAPISID")||"",n=g.VA("__Secure-3PAPISID","")||"";if(!l&&!n)return"";l=g.Pd(g.EF(l),2);n=g.Pd(g.EF(n),2);return g.Pd(g.EF(","+l+","+n),2)}; K_.prototype.subscribe=K_.prototype.subscribe;K_.prototype.unsubscribeByKey=K_.prototype.uJ;K_.prototype.getProxyState=K_.prototype.y7;K_.prototype.disconnect=K_.prototype.JT;K_.prototype.getPlayerContextData=K_.prototype.q6;K_.prototype.setPlayerContextData=K_.prototype.G1J;K_.prototype.getOtherConnectedRemoteId=K_.prototype.T8;K_.prototype.getReconnectTimeout=K_.prototype.Wt;K_.prototype.getAutoplayMode=K_.prototype.oG;K_.prototype.getAutoplayVideoId=K_.prototype.dw;K_.prototype.reconnect=K_.prototype.He; K_.prototype.sendMessage=K_.prototype.XMG;K_.prototype.getXsrfToken=K_.prototype.oa;K_.prototype.isCapabilitySupportedOnConnectedDevices=K_.prototype.Ig;g.u(fgR,ow);g.h=fgR.prototype;g.h.a_=function(l){return this.J7.$_gs(l)}; g.h.contains=function(l){return!!this.J7.$_c(l)}; g.h.get=function(l){return this.J7.$_g(l)}; g.h.start=function(){this.J7.$_st()}; g.h.add=function(l,n,O){this.J7.$_a(l,n,O)}; g.h.remove=function(l,n,O){this.J7.$_r(l,n,O)}; g.h.wM=function(l,n,O,L){this.J7.$_un(l,n,O,L)}; g.h.oz=function(){for(var l=this.S.length,n=0;n1&&!this.C.getOption("remote","quickCast")?(this.Ta=g.rQ(l,this.S,this),this.Qr(g.M9(l,this.S)),l=this.C.getOption("remote","currentReceiver"),l=this.S(l),this.options[l]&&this.aN(l),this.enable(!0)):this.enable(!1)}; AI.prototype.S=function(l){return l.key}; AI.prototype.e0=function(l){return l==="cast-selector-receiver"?"Transmitir\u2026":this.Ta[l].name}; AI.prototype.L2=function(l){g.Ko.prototype.L2.call(this,l);this.C.setOption("remote","currentReceiver",this.Ta[l]);this.C5.Te()};g.u(HPc,g.qq);g.h=HPc.prototype; g.h.create=function(){var l=this.player.j(),n=g.GH(l);l={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:l.J("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:l.J("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:l.J("enable_cast_short_lived_lounge_token")};t3k(n,l);this.subscriptions.push(g.Fx("yt-remote-before-disconnect",this.b5f,this));this.subscriptions.push(g.Fx("yt-remote-connection-change",this.DP2,this));this.subscriptions.push(g.Fx("yt-remote-receiver-availability-change",this.EZ, this));this.subscriptions.push(g.Fx("yt-remote-auto-connect",this.reJ,this));this.subscriptions.push(g.Fx("yt-remote-receiver-resumed",this.QIJ,this));this.subscriptions.push(g.Fx("mdx-privacy-popup-confirm",this.K1p,this));this.subscriptions.push(g.Fx("mdx-privacy-popup-cancel",this.G7p,this));this.EZ()}; g.h.load=function(){this.player.cancelPlayback();g.qq.prototype.load.call(this);this.Dz=new hy0(this,this.player,this.gK);var l=(l=ojF())?l.currentTime:0;var n=gjL()?new Vt(Xh(),void 0):null;l==0&&n&&(l=Iw(Bb(n)));l!==0&&this.tC(l);As6(this,this.N_,this.N_);this.player.kc(6)}; g.h.unload=function(){this.player.publish("mdxautoplaycanceled");this.BX=this.XD;g.ZL(this.Dz,this.gK);this.gK=this.Dz=null;g.qq.prototype.unload.call(this);this.player.kc(5);bp(this)}; g.h.oz=function(){g.xj(this.subscriptions);g.qq.prototype.oz.call(this)}; g.h.BB=function(l){var n=g.eq.apply(1,arguments);this.loaded&&this.Dz.wb.apply(this.Dz,[l].concat(g.E(n)))}; g.h.getAdState=function(){return this.BT}; g.h.DE=function(){return this.gK?Bb(this.gK).DE:!1}; g.h.FK=function(){return this.gK?Bb(this.gK).FK:!1}; g.h.tC=function(l,n){this.Y0=l||0;this.player.publish("progresssync",l,n);this.player.S3("onVideoProgress",l||0)}; g.h.getCurrentTime=function(){return this.Y0}; g.h.getProgressState=function(){var l=Bb(this.gK),n=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!l.tZ()&&this.player.qJ(),clipEnd:n.clipEnd,clipStart:n.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:l.getDuration(),ingestionTime:l.W?l.N+GY(l):l.N,isAtLiveHead:(l.W?l.S+GY(l):l.S)-this.getCurrentTime()<=1,loaded:l.G,seekableEnd:l.W?l.S+GY(l):l.S,seekableStart:l.L>0?l.L+GY(l):l.L,offset:0,viewerLivestreamJoinMediaTime:0}}; g.h.nextVideo=function(){this.gK&&this.gK.nextVideo()}; g.h.e6=function(){this.gK&&this.gK.e6()}; g.h.b5f=function(l){l===1&&(this.s3=this.gK?Bb(this.gK):null)}; g.h.DP2=function(){var l=gjL()?new Vt(Xh(),void 0):null;if(l){var n=this.BX;this.loaded&&this.unload();this.gK=l;this.s3=null;n.key!==this.XD.key&&(this.BX=n,this.load())}else g.h0(this.gK),this.gK=null,this.loaded&&(this.unload(),(l=this.s3)&&l.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(l.videoId,Iw(l)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.h.EZ=function(){var l=[this.XD],n=l.concat,O=vOq();Qt()&&g.dU("yt-remote-cast-available")&&O.push({key:"cast-selector-receiver",name:"Cast..."});this.Ta=n.call(l,O);l=njL()||this.XD;rV(this,l);this.player.S3("onMdxReceiversChange")}; g.h.reJ=function(){var l=njL();rV(this,l)}; g.h.QIJ=function(){this.BX=njL()}; g.h.K1p=function(){this.bE=!0;bp(this);hI=!1;oV&&xn(oV,1);oV=null}; g.h.G7p=function(){this.bE=!1;bp(this);rV(this,this.XD);this.BX=this.XD;hI=!1;oV=null;this.player.playVideo()}; g.h.oN=function(l,n){switch(l){case "casting":return this.loaded;case "receivers":return this.Ta;case "currentReceiver":return n&&(n.key==="cast-selector-receiver"?ulk():rV(this,n)),this.loaded?this.BX:this.XD;case "quickCast":return this.Ta.length===2&&this.Ta[1].key==="cast-selector-receiver"?(n&&ulk(),!0):!1}}; g.h.P4=function(){this.gK.P4()}; g.h.NR=function(){return!1}; g.h.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.h.isLoggedIn=function(){var l,n;return((l=g.R3("PLAYER_CONFIG"))==null?void 0:(n=l.args)==null?void 0:n.authuser)!==void 0?!0:!(!g.R3("SESSION_INDEX")&&!g.R3("LOGGED_IN"))};g.Dq("remote",HPc);})(_yt_player);