(function(g){var window=this;'use strict';var BH5=function(R){if(R instanceof g.xn)return R;if(typeof R.YC=="function")return R.YC(!1);if(g.gq(R)){var F=0,n=new g.xn;n.next=function(){for(;;){if(F>=R.length)return g.q$;if(F in R)return g.kn(R[F++]);F++}};
return n}throw Error("Not implemented");},m17=function(R,F,n){if(g.gq(R))g.az(R,F,n);
else for(R=BH5(R);;){var V=R.next();if(V.done)break;F.call(n,V.value,void 0,R)}},e$=function(R){g.sB(R,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.J7()).toString(36));
return R},R_=function(R,F,n){Array.isArray(n)||(n=[String(n)]);
g.co_(R.J,F,n)},gxq=function(R,F){var n=[];
m17(F,function(V){try{var r=g.gs.prototype.qU.call(this,V,!0)}catch(v){if(v=="Storage: Invalid value was encountered")return;throw v;}r===void 0?n.push(V):g.uER(r)&&n.push(V)},R);
return n},ODU=function(R,F){gxq(R,F).forEach(function(n){g.gs.prototype.remove.call(this,n)},R)},IK$=function(R){if(R.on){if(R.on.locationOverrideToken)return{locationOverrideToken:R.on.locationOverrideToken};
if(R.on.latitudeE7!=null&&R.on.longitudeE7!=null)return{latitudeE7:R.on.latitudeE7,longitudeE7:R.on.longitudeE7}}return null},Kk7=function(R,F){g.Rz(R,F)||R.push(F)},D1q=function(R){var F=0,n;
for(n in R)F++;return F},iDh=function(R,F){return g.Wo(R,F)},x17=function(R){try{return g.HM.JSON.parse(R)}catch(F){}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(F){}throw Error("Invalid JSON string: "+R);},Fh=function(R){if(g.HM.JSON)try{return g.HM.JSON.parse(R)}catch(F){}return x17(R)},kG5=function(){var R=g.Mv();
this.T=R;R.Ds("/client_streamz/youtube/living_room/mdx/channel/opened",g.XE("channel_type"))},YBs=function(){var R=g.Mv();
this.T=R;R.Ds("/client_streamz/youtube/living_room/mdx/channel/closed",g.XE("channel_type"))},JmU=function(){var R=g.Mv();
this.T=R;R.Ds("/client_streamz/youtube/living_room/mdx/channel/message_received",g.XE("channel_type"))},GGU=function(){var R=g.Mv();
this.T=R;R.Ds("/client_streamz/youtube/living_room/mdx/channel/success")},d1$=function(){var R=g.Mv();
this.T=R;R.Ds("/client_streamz/youtube/living_room/mdx/channel/error",g.XE("channel_type"),g.XE("error_type"))},MIU=function(){var R=g.Mv();
this.T=R;R.Ds("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},lKq=function(){var R=g.Mv();
this.T=R;R.Ds("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},NHD=function(R,F,n,V){var r=new g.c_(null);
R&&g.q1(r,R);F&&g.we(r,F);n&&g.QG(r,n);V&&(r.U=V);return r},Ex7=function(R,F){return new g.rs(R,F)},n8=function(R,F){return Object.prototype.hasOwnProperty.call(R,F)},$1D=function(R,F){return R===F},VZ=function(R,F){this.U={};
this.T=[];this.QT=this.size=0;var n=arguments.length;if(n>1){if(n%2)throw Error("Uneven number of arguments");for(var V=0;V<n;V+=2)this.set(arguments[V],arguments[V+1])}else if(R)if(R instanceof VZ)for(n=R.V8(),V=0;V<n.length;V++)this.set(n[V],R.get(n[V]));else for(V in R)this.set(V,R[V])},r0=function(R){if(R.size!=R.T.length){for(var F=0,n=0;F<R.T.length;){var V=R.T[F];
n8(R.U,V)&&(R.T[n++]=V);F++}R.T.length=n}if(R.size!=R.T.length){F={};for(V=n=0;n<R.T.length;){var r=R.T[n];n8(F,r)||(R.T[V++]=r,F[r]=1);n++}R.T.length=V}},vO=function(R){this.name=this.id="";
this.clientName="UNKNOWN_INTERFACE";this.app="";this.type="REMOTE_CONTROL";this.ownerObfuscatedGaiaId=this.obfuscatedGaiaId=this.avatar=this.username="";this.capabilities=new Set;this.compatibleSenderThemes=new Set;this.experiments=new Set;this.theme="u";new VZ;this.model=this.brand="";this.year=0;this.chipset=this.osVersion=this.os="";this.mdxDialServerType="MDX_DIAL_SERVER_TYPE_UNKNOWN";R&&(this.id=R.id||R.name,this.name=R.name,this.clientName=R.clientName?R.clientName.toUpperCase():"UNKNOWN_INTERFACE",
this.app=R.app,this.type=R.type||"REMOTE_CONTROL",this.username=R.user||"",this.avatar=R.userAvatarUri||"",this.obfuscatedGaiaId=R.obfuscatedGaiaId||"",this.ownerObfuscatedGaiaId=R.ownerObfuscatedGaiaId||"",this.theme=R.theme||"u",PMz(this,R.capabilities||""),bDD(this,R.compatibleSenderThemes||""),ZDO(this,R.experiments||""),this.brand=R.brand||"",this.model=R.model||"",this.year=R.year||0,this.os=R.os||"",this.osVersion=R.osVersion||"",this.chipset=R.chipset||"",this.mdxDialServerType=R.mdxDialServerType||
"MDX_DIAL_SERVER_TYPE_UNKNOWN",R=R.deviceInfo)&&(R=JSON.parse(R),this.brand=R.brand||"",this.model=R.model||"",this.year=R.year||0,this.os=R.os||"",this.osVersion=R.osVersion||"",this.chipset=R.chipset||"",this.clientName=R.clientName?R.clientName.toUpperCase():"UNKNOWN_INTERFACE",this.mdxDialServerType=R.mdxDialServerType||"MDX_DIAL_SERVER_TYPE_UNKNOWN")},PMz=function(R,F){R.capabilities.clear();
g.dk(F.split(","),g.Y$(iDh,eDv)).forEach(function(n){R.capabilities.add(n)})},bDD=function(R,F){R.compatibleSenderThemes.clear();
g.dk(F.split(","),g.Y$(iDh,Roh)).forEach(function(n){R.compatibleSenderThemes.add(n)})},ZDO=function(R,F){R.experiments.clear();
F.split(",").forEach(function(n){R.experiments.add(n)})},f8=function(R){R=R||{};
this.name=R.name||"";this.id=R.id||R.screenId||"";this.token=R.token||R.loungeToken||"";this.uuid=R.uuid||R.dialId||"";this.idType=R.screenIdType||"normal";this.secret=R.screenIdSecret||""},tk=function(R,F){return!!F&&(R.id==F||R.uuid==F)},F97=function(R){return{name:R.name,
screenId:R.id,loungeToken:R.token,dialId:R.uuid,screenIdType:R.idType,screenIdSecret:R.secret}},neh=function(R){return new f8(R)},VC$=function(R){return Array.isArray(R)?g.OM(R,neh):[]},zD=function(R){return R?'{name:"'+R.name+'",id:'+R.id.substr(0,6)+"..,token:"+((R.token?".."+R.token.slice(-6):"-")+",uuid:"+(R.uuid?".."+R.uuid.slice(-6):"-")+",idType:"+R.idType+",secret:")+((R.secret?".."+R.secret.slice(-6):"-")+"}"):"null"},r$U=function(R){return Array.isArray(R)?"["+g.OM(R,zD).join(",")+"]":"null"},
ves=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(R){var F=Math.random()*16|0;
return(R=="x"?F:F&3|8).toString(16)})},fAq=function(R){return g.OM(R,function(F){return{key:F.id,
name:F.name}})},tC5=function(R,F){return g.$$(R,function(n){return n||F?!n!=!F?!1:n.id==F.id:!0})},qo=function(R,F){return g.$$(R,function(n){return tk(n,F)})},zo7=function(){var R=g.Dg.ow();
R&&ODU(R,R.pS.YC(!0))},QZ=function(){var R=g.xh("yt-remote-connected-devices")||[];
g.p4(R);return R},qAq=function(R){if(R.length==0)return[];
var F=R[0].indexOf("#"),n=F==-1?R[0]:R[0].substring(0,F);return g.OM(R,function(V,r){return r==0?V:V.substring(n.length)})},Qp7=function(R){g.i6("yt-remote-connected-devices",R,86400)},cO=function(){if(c$q)return c$q;
var R=g.xh("yt-remote-device-id");R||(R=ves(),g.i6("yt-remote-device-id",R,31536E3));for(var F=QZ(),n=1,V=R;g.Rz(F,V);)n++,V=R+"#"+n;return c$q=V},wtv=function(){var R=QZ(),F=cO();
g.Yh()&&g.Ax(R,F);R=qAq(R);if(R.length==0)try{g.Jj("remote_sid")}catch(n){}else try{g.ki("remote_sid",R.join(","),-1)}catch(n){}},SAr=function(){return g.xh("yt-remote-session-browser-channel")},L9U=function(){return g.xh("yt-remote-local-screens")||[]},sp7=function(){g.i6("yt-remote-lounge-token-expiration",!0,86400)},pt$=function(R){R.length>5&&(R=R.slice(R.length-5));
var F=g.OM(L9U(),function(V){return V.loungeToken}),n=g.OM(R,function(V){return V.loungeToken});
g.Iv(n,function(V){return!g.Rz(F,V)})&&sp7();
g.i6("yt-remote-local-screens",R,31536E3)},w0=function(R){R||(g.kh("yt-remote-session-screen-id"),g.kh("yt-remote-session-video-id"));
wtv();R=QZ();g.VK(R,cO());Qp7(R)},Xt7=function(){if(!Sd){var R=g.xe();
R&&(Sd=new g.ua(R))}},A$s=function(){Xt7();
return Sd?!!Sd.get("yt-remote-use-staging-server"):!1},L8=function(R,F){g.ef[R]=!0;
var n=g.br();n&&n.publish.apply(n,arguments);g.ef[R]=!1},aAv=function(){var R=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);
return R?parseInt(R[1],10):0},Ca7=function(R){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+R)!=-1||document.currentScript.src.indexOf("&"+R)!=-1)},Tsq=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},s9=function(R){R.length?oeq(R.shift(),function(){s9(R)}):y$z()},UXM=function(R){return"chrome-extension://"+R+"/cast_sender.js"},oeq=function(R,F,n){var V=document.createElement("script");
V.onerror=F;n&&(V.onload=n);g.k6(V,g.m3(R));(document.head||document.documentElement).appendChild(V)},jp7=function(){var R=aAv(),F=[];
if(R>1){var n=R-1;F.push("//www.gstatic.com/eureka/clank/"+R+"/cast_sender.js");F.push("//www.gstatic.com/eureka/clank/"+n+"/cast_sender.js")}return F},y$z=function(){var R=Tsq();
R&&R(!1,"No cast extension found")},hov=function(){if(HOq){var R=2,F=Tsq(),n=function(){R--;
R==0&&F&&F(!0)};
window.__onGCastApiAvailable=n;oeq("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",y$z,n)}},W9M=function(){hov();
var R=jp7();R.push("//www.gstatic.com/eureka/clank/cast_sender.js");s9(R)},Bsq=function(){hov();
var R=jp7();R.push.apply(R,g.I(uK7.map(UXM)));R.push("//www.gstatic.com/eureka/clank/cast_sender.js");s9(R)},p8=function(R,F,n){g.G.call(this);
this.Z=n!=null?(0,g.k$)(R,n):R;this.uI=F;this.W=(0,g.k$)(this.n_,this);this.T=!1;this.U=0;this.N=this.q5=null;this.J=[]},Xh=function(){this.T=g.J7()},mXv=function(){Ak||(Ak=new Xh)},ge5=function(){Ak||(Ak=new Xh)},a_=function(){},OOq=function(){g.v2.call(this,"p")},IA5=function(){g.v2.call(this,"o")},DX$=function(){return K9q=K9q||new g.TC},iOr=function(R){g.v2.call(this,"serverreachability",R)},C8=function(R){var F=DX$();
F.dispatchEvent(new iOr(F,R))},xXD=function(R){g.v2.call(this,"statevent",R)},TD=function(R){var F=DX$();
F.dispatchEvent(new xXD(F,R))},k0z=function(R,F,n,V){g.v2.call(this,"timingevent",R);
this.size=F;this.rtt=n;this.retries=V},o_=function(R,F){if(typeof R!=="function")throw Error("Fn must not be null and must be a function");
return g.HM.setTimeout(function(){R()},F)},yZ=function(){},U9=function(R,F,n,V){this.N=R;
this.J=F;this.HI=n;this.YF=V||1;this.aG=new g.aC(this);this.h1=45E3;this.bS=null;this.Z=!1;this.UZ=this.SQ=this.V=this.Y5=this.jQ=this.k5=this.Nq=null;this.J1=[];this.T=null;this.X=0;this.W=this.lS=null;this.mQ=-1;this.Mq=!1;this.uS=0;this.dX=null;this.KC=this.gX=this.on=this.PG=!1;this.U=new YAr},YAr=function(){this.N=null;
this.T="";this.U=!1},G0z=function(R,F,n){R.Y5=1;
R.V=e$(F.clone());R.UZ=n;R.PG=!0;J$7(R,null)},J$7=function(R,F){R.jQ=Date.now();
jd(R);R.SQ=R.V.clone();R_(R.SQ,"t",R.YF);R.X=0;var n=R.N.gX;R.U=new YAr;R.T=dXO(R.N,n?F:null,!R.UZ);R.uS>0&&(R.dX=new g.nO((0,g.k$)(R.oW,R,R.T),R.uS));R.aG.listen(R.T,"readystatechange",R.Xx);F=R.bS?g.Di(R.bS):{};R.UZ?(R.lS||(R.lS="POST"),F["Content-Type"]="application/x-www-form-urlencoded",R.T.send(R.SQ,R.lS,R.UZ,F)):(R.lS="GET",R.T.send(R.SQ,R.lS,null,F));C8(1)},lAq=function(R){if(!MCv(R))return g.RF(R.T);
var F=g.Fo(R.T);if(F==="")return"";var n="",V=F.length,r=g.ZB(R.T)==4;if(!R.U.N){if(typeof TextDecoder==="undefined")return HO(R),hk(R),"";R.U.N=new g.HM.TextDecoder}for(var v=0;v<V;v++)R.U.U=!0,n+=R.U.N.decode(F[v],{stream:!(r&&v==V-1)});F.length=0;R.U.T+=n;R.X=0;return R.U.T},MCv=function(R){return R.T?R.lS=="GET"&&R.Y5!=2&&R.N.Ra:!1},$Xr=function(R,F){var n=R.X,V=F.indexOf("\n",n);
if(V==-1)return Nsv;n=Number(F.substring(n,V));if(isNaN(n))return Ee7;V+=1;if(V+n>F.length)return Nsv;F=F.slice(V,V+n);R.X=V+n;return F},jd=function(R){R.k5=Date.now()+R.h1;
PaU(R,R.h1)},PaU=function(R,F){if(R.Nq!=null)throw Error("WatchDog timer not null");
R.Nq=o_((0,g.k$)(R.Yf,R),F)},bOD=function(R){R.Nq&&(g.HM.clearTimeout(R.Nq),R.Nq=null)},hk=function(R){R.N.D7()||R.Mq||ZOr(R.N,R)},HO=function(R){bOD(R);
g.Cv(R.dX);R.dX=null;R.aG.removeAll();if(R.T){var F=R.T;R.T=null;F.abort();F.dispose()}},fJ7=function(R,F){try{var n=R.N;
if(n.L5!=0&&(n.T==R||eor(n.U,R)))if(!R.gX&&eor(n.U,R)&&n.L5==3){try{var V=n.fl.T.parse(F)}catch(y){V=null}if(Array.isArray(V)&&V.length==3){var r=V;if(r[0]==0)a:{if(!n.V){if(n.T)if(n.T.jQ+3E3<R.jQ)WO(n),uu(n);else break a;RLq(n);TD(18)}}else n.uZ=r[1],0<n.uZ-n.Y5&&r[2]<37500&&n.dX&&n.J1==0&&!n.Nq&&(n.Nq=o_((0,g.k$)(n.eL,n),6E3));if(F3v(n.U)<=1&&n.mQ){try{n.mQ()}catch(y){}n.mQ=void 0}}else BO(n,11)}else if((R.gX||n.T==R)&&WO(n),!g.Re(F))for(r=n.fl.T.parse(F),F=0;F<r.length;F++){var v=r[F],f=v[0];if(!(f<=
n.Y5))if(n.Y5=f,v=v[1],n.L5==2)if(v[0]=="c"){n.J=v[1];n.HI=v[2];var z=v[3];z!=null&&(n.jN=z);var q=v[5];q!=null&&typeof q==="number"&&q>0&&(n.uS=1.5*q);V=n;var Q=R.Bz();if(Q){var c=g.na(Q,"X-Client-Wire-Protocol");if(c){var w=V.U;!w.T&&(g.Fg(c,"spdy")||g.Fg(c,"quic")||g.Fg(c,"h2"))&&(w.J=w.W,w.T=new Set,w.U&&(nL7(w,w.U),w.U=null))}if(V.PG){var L=g.na(Q,"X-HTTP-Session-Id");L&&(V.t0=L,g.sB(V.bS,V.PG,L))}}n.L5=3;n.W&&n.W.P2();n.pC&&(n.oC=Date.now()-R.jQ);V=n;var S=R;V.HT=VwO(V,V.gX?V.HI:null,V.QZ);
if(S.gX){rt7(V.U,S);var p=S,C=V.uS;C&&p.setTimeout(C);p.Nq&&(bOD(p),jd(p));V.T=S}else vLh(V);n.N.length>0&&ms(n)}else v[0]!="stop"&&v[0]!="close"||BO(n,7);else n.L5==3&&(v[0]=="stop"||v[0]=="close"?v[0]=="stop"?BO(n,7):n.disconnect():v[0]!="noop"&&n.W&&n.W.ws(v),n.J1=0)}C8(4)}catch(y){}},twO=function(R,F){this.T=R;
this.map=F;this.context=null},zLM=function(R){this.W=R||10;
g.HM.PerformanceNavigationTiming?(R=g.HM.performance.getEntriesByType("navigation"),R=R.length>0&&(R[0].nextHopProtocol=="hq"||R[0].nextHopProtocol=="h2")):R=!!(g.HM.chrome&&g.HM.chrome.loadTimes&&g.HM.chrome.loadTimes()&&g.HM.chrome.loadTimes().wasFetchedViaSpdy);this.J=R?this.W:1;this.T=null;this.J>1&&(this.T=new Set);this.U=null;this.N=[]},q3M=function(R){return R.U?!0:R.T?R.T.size>=R.J:!1},F3v=function(R){return R.U?1:R.T?R.T.size:0},eor=function(R,F){return R.U?R.U==F:R.T?R.T.has(F):!1},nL7=
function(R,F){R.T?R.T.add(F):R.U=F},rt7=function(R,F){R.U&&R.U==F?R.U=null:R.T&&R.T.has(F)&&R.T.delete(F)},QH5=function(R){if(R.U!=null)return R.N.concat(R.U.J1);
if(R.T!=null&&R.T.size!==0){var F=R.N;R=g.m(R.T.values());for(var n=R.next();!n.done;n=R.next())F=F.concat(n.value.J1);return F}return g.f4(R.N)},ctM=function(R,F){var n=new yZ;
if(g.HM.Image){var V=new Image;V.onload=g.Y$(g0,n,"TestLoadImage: loaded",!0,F,V);V.onerror=g.Y$(g0,n,"TestLoadImage: error",!1,F,V);V.onabort=g.Y$(g0,n,"TestLoadImage: abort",!1,F,V);V.ontimeout=g.Y$(g0,n,"TestLoadImage: timeout",!1,F,V);g.HM.setTimeout(function(){if(V.ontimeout)V.ontimeout()},1E4);
V.src=R}else F(!1)},wUO=function(R,F){var n=new yZ,V=new AbortController,r=setTimeout(function(){V.abort();
g0(n,"TestPingServer: timeout",!1,F)},1E4);
fetch(R,{signal:V.signal}).then(function(v){clearTimeout(r);v.ok?g0(n,"TestPingServer: ok",!0,F):g0(n,"TestPingServer: server error",!1,F)}).catch(function(){clearTimeout(r);
g0(n,"TestPingServer: error",!1,F)})},g0=function(R,F,n,V,r){try{r&&(r.onload=null,r.onerror=null,r.onabort=null,r.ontimeout=null),V(n)}catch(v){}},S3r=function(){this.T=new a_},O9=function(R,F,n){return n&&n.kHX?n.kHX[R]||F:F},L3U=function(R){this.N=[];
this.HI=this.HT=this.bS=this.QZ=this.T=this.t0=this.PG=this.Mq=this.X=this.on=this.UZ=null;this.H_=this.SQ=0;this.FG=O9("failFast",!1,R);this.dX=this.Nq=this.V=this.Z=this.W=null;this.us=!0;this.uZ=this.Y5=-1;this.YF=this.J1=this.jQ=0;this.lX=O9("baseRetryDelayMs",5E3,R);this.h7=O9("retryDelaySeedMs",1E4,R);this.Kk=O9("forwardChannelMaxRetries",2,R);this.fm=O9("forwardChannelRequestTimeoutMs",2E4,R);this.A0=R&&R.i$2||void 0;this.NP=R&&R.hnQ||void 0;this.Ra=R&&R.O$q||!1;this.uS=void 0;this.gX=R&&R.JDQ||
!1;this.J="";this.U=new zLM(R&&R.c_G);this.eB=Math.min(R&&R.d0H||1E3,1E3);this.fl=new S3r;this.aG=R&&R.Lxq||!1;this.k5=R&&R.XU2||!1;this.aG&&this.k5&&(this.k5=!1);this.Ru=R&&R.kfZ||!1;R&&R.RCQ&&(this.us=!1);this.pC=!this.aG&&this.us&&R&&R.PPo||!1;this.Yy=void 0;R&&R.wq&&R.wq>0&&(this.Yy=R.wq);this.mQ=void 0;this.oC=0;this.h1=!1;this.KC=this.lS=null},uu=function(R){R.T&&(sH5(R),R.T.cancel(),R.T=null)},pUz=function(R){uu(R);
R.V&&(g.HM.clearTimeout(R.V),R.V=null);WO(R);R.U.cancel();R.Z&&(typeof R.Z==="number"&&g.HM.clearTimeout(R.Z),R.Z=null)},ms=function(R){q3M(R.U)||R.Z||(R.Z=!0,g.mt(R.A4,R),R.jQ=0)},AtO=function(R,F){if(F3v(R.U)>=R.U.J-(R.Z?1:0))return!1;
if(R.Z)return R.N=F.J1.concat(R.N),!0;if(R.L5==1||R.L5==2||R.jQ>=(R.FG?0:R.Kk))return!1;R.Z=o_((0,g.k$)(R.A4,R,F),XUh(R,R.jQ));R.jQ++;return!0},Cgq=function(R,F){var n;
F?n=F.HI:n=R.SQ++;var V=R.bS.clone();g.sB(V,"SID",R.J);g.sB(V,"RID",n);g.sB(V,"AID",R.Y5);I_(R,V);R.X&&R.UZ&&g.Am(V,R.X,R.UZ);n=new U9(R,R.J,n,R.jQ+1);R.X===null&&(n.bS=R.UZ);F&&(R.N=F.J1.concat(R.N));F=aJv(R,n,R.eB);n.setTimeout(Math.round(R.fm*.5)+Math.round(R.fm*.5*Math.random()));nL7(R.U,n);G0z(n,V,F)},I_=function(R,F){R.Mq&&g.DN(R.Mq,function(n,V){g.sB(F,V,n)});
R.W&&g.DN({},function(n,V){g.sB(F,V,n)})},aJv=function(R,F,n){n=Math.min(R.N.length,n);
var V=R.W?(0,g.k$)(R.W.gQ,R.W,R):null;a:{for(var r=R.N,v=-1;;){var f=["count="+n];v==-1?n>0?(v=r[0].T,f.push("ofs="+v)):v=0:f.push("ofs="+v);for(var z=!0,q=0;q<n;q++){var Q=r[q].T,c=r[q].map;Q-=v;if(Q<0)v=Math.max(0,r[q].T-100),z=!1;else try{Q="req"+Q+"_"||"";try{var w=c instanceof Map?c:Object.entries(c);for(var L=g.m(w),S=L.next();!S.done;S=L.next()){var p=g.m(S.value),C=p.next().value,y=p.next().value,u=y;g.ID(y)&&(u=g.lh(y));f.push(Q+C+"="+encodeURIComponent(u))}}catch(B){throw f.push(Q+"type="+
encodeURIComponent("_badmap")),B;}}catch(B){V&&V(c)}}if(z){w=f.join("&");break a}}w=void 0}R=R.N.splice(0,n);F.J1=R;return w},vLh=function(R){R.T||R.V||(R.YF=1,g.mt(R.sB,R),R.J1=0)},RLq=function(R){if(R.T||R.V||R.J1>=3)return!1;
R.YF++;R.V=o_((0,g.k$)(R.sB,R),XUh(R,R.J1));R.J1++;return!0},sH5=function(R){R.lS!=null&&(g.HM.clearTimeout(R.lS),R.lS=null)},TBU=function(R){R.T=new U9(R,R.J,"rpc",R.YF);
R.X===null&&(R.T.bS=R.UZ);R.T.uS=0;var F=R.HT.clone();g.sB(F,"RID","rpc");g.sB(F,"SID",R.J);g.sB(F,"AID",R.Y5);g.sB(F,"CI",R.dX?"0":"1");!R.dX&&R.Yy&&g.sB(F,"TO",R.Yy);g.sB(F,"TYPE","xmlhttp");I_(R,F);R.X&&R.UZ&&g.Am(F,R.X,R.UZ);R.uS&&R.T.setTimeout(R.uS);var n=R.T;R=R.HI;n.Y5=1;n.V=e$(F.clone());n.UZ=null;n.PG=!0;J$7(n,R)},WO=function(R){R.Nq!=null&&(g.HM.clearTimeout(R.Nq),R.Nq=null)},ZOr=function(R,F){var n=null;
if(R.T==F){WO(R);sH5(R);R.T=null;var V=2}else if(eor(R.U,F))n=F.J1,rt7(R.U,F),V=1;else return;if(R.L5!=0)if(F.Z)if(V==1){n=F.UZ?F.UZ.length:0;F=Date.now()-F.jQ;var r=R.jQ;V=DX$();V.dispatchEvent(new k0z(V,n,F,r));ms(R)}else vLh(R);else{var v=F.mQ;r=F.getLastError();if(r==3||r==0&&v>0||!(V==1&&AtO(R,F)||V==2&&RLq(R)))switch(n&&n.length>0&&(F=R.U,F.N=F.N.concat(n)),r){case 1:BO(R,5);break;case 4:BO(R,10);break;case 3:BO(R,6);break;default:BO(R,2)}}},XUh=function(R,F){var n=R.lX+Math.floor(Math.random()*
R.h7);
R.isActive()||(n*=2);return n*F},BO=function(R,F){if(F==2){var n=(0,g.k$)(R.QV2,R),V=R.NP,r=!V;
V=new g.c_(V||"//www.google.com/images/cleardot.gif");g.HM.location&&g.HM.location.protocol=="http"||g.q1(V,"https");e$(V);r?ctM(V.toString(),n):wUO(V.toString(),n)}else TD(2);R.L5=0;R.W&&R.W.W2(F);oLD(R);pUz(R)},oLD=function(R){R.L5=0;
R.KC=[];if(R.W){var F=QH5(R.U);if(F.length!=0||R.N.length!=0)g.qN(R.KC,F),g.qN(R.KC,R.N),R.U.N.length=0,g.f4(R.N),R.N.length=0;R.W.Qe()}},yt5=function(R){if(R.L5==0)return R.KC;
var F=[];g.qN(F,QH5(R.U));g.qN(F,R.N);return F},VwO=function(R,F,n){var V=g.H_(n);
V.T!=""?(F&&g.we(V,F+"."+V.T),g.QG(V,V.N)):(V=g.HM.location,V=NHD(V.protocol,F?F+"."+V.hostname:V.hostname,+V.port,n));F=R.PG;n=R.t0;F&&n&&g.sB(V,F,n);g.sB(V,"VER",R.jN);I_(R,V);return V},dXO=function(R,F,n){if(F&&!R.gX)throw Error("Can't create secondary domain capable XhrIo object.");
F=R.Ra&&!R.A0?new g.$v(new g.rH({bB:n})):new g.$v(R.A0);F.X=R.gX;return F},Uq7=function(){},jH7=function(){},Dc=function(R,F){g.TC.call(this);
this.T=new L3U(F);this.W=R;this.U=F&&F.hp2||null;R=F&&F.HC5||null;F&&F.J_5&&(R?R["X-Client-Protocol"]="webchannel":R={"X-Client-Protocol":"webchannel"});this.T.UZ=R;R=F&&F.WEq||null;F&&F.Ml&&(R?R["X-WebChannel-Content-Type"]=F.Ml:R={"X-WebChannel-Content-Type":F.Ml});F&&F.Ar&&(R?R["X-WebChannel-Client-Profile"]=F.Ar:R={"X-WebChannel-Client-Profile":F.Ar});this.T.on=R;(R=F&&F.Anz)&&!g.Re(R)&&(this.T.X=R);this.Z=F&&F.JDQ||!1;this.J=F&&F.PgS||!1;(F=F&&F.GHH)&&!g.Re(F)&&(this.T.PG=F,g.hx(this.U,F)&&(R=
this.U,F in R&&delete R[F]));this.N=new K8(this)},HAq=function(R){OOq.call(this);
R.__headers__&&(this.headers=R.__headers__,this.statusCode=R.__status__,delete R.__headers__,delete R.__status__);var F=R.__sm__;F?this.data=(this.T=g.Um(F))?g.Om(F,this.T):F:this.data=R},hLM=function(R){IA5.call(this);
this.status=1;this.errorCode=R},K8=function(R){this.T=R},W3M=function(R,F){this.U=R;
this.T=F},u4v=function(R){return yt5(R.T).map(function(F){var n=R.U;
F=F.map;"__data__"in F?(F=F.__data__,n=n.J?x17(F):F):n=F;return n})},iu=function(R,F){if(typeof R!=="function")throw Error("Fn must not be null and must be a function");
return g.HM.setTimeout(function(){R()},F)},kP=function(R){xP.dispatchEvent(new BBq(xP,R))},BBq=function(R){g.v2.call(this,"statevent",R)},YP=function(R,F,n,V){this.T=R;
this.J=F;this.X=n;this.Z=V||1;this.U=45E3;this.N=new g.aC(this);this.W=new g.Yv;this.W.setInterval(250)},gLM=function(R,F,n){R.cf=1;
R.Ah=e$(F.clone());R.gy=n;R.PG=!0;mq$(R,null)},OAz=function(R,F,n,V,r){R.cf=1;
R.Ah=e$(F.clone());R.gy=null;R.PG=n;r&&(R.rB=!1);mq$(R,V)},mq$=function(R,F){R.wR=Date.now();
IJ7(R);R.Jc=R.Ah.clone();R_(R.Jc,"t",R.Z);R.jH=0;R.wG=R.T.Px(R.T.PF()?F:null);R.Qy>0&&(R.NA=new g.nO((0,g.k$)(R.lz,R,R.wG),R.Qy));R.N.listen(R.wG,"readystatechange",R.IQ);F=R.Ya?g.Di(R.Ya):{};R.gy?(R.oS="POST",F["Content-Type"]="application/x-www-form-urlencoded",R.wG.send(R.Jc,R.oS,R.gy,F)):(R.oS="GET",R.rB&&!g.WI&&(F.Connection="close"),R.wG.send(R.Jc,R.oS,null,F));R.T.gY(1)},iAv=function(R,F){var n=R.jH,V=F.indexOf("\n",n);
if(V==-1)return K37;n=Number(F.substring(n,V));if(isNaN(n))return DqD;V+=1;if(V+n>F.length)return K37;F=F.slice(V,V+n);R.jH=V+n;return F},IJ7=function(R){R.Wx=Date.now()+R.U;
xq7(R,R.U)},xq7=function(R,F){if(R.XJ!=null)throw Error("WatchDog timer not null");
R.XJ=iu((0,g.k$)(R.C_,R),F)},kwv=function(R){R.XJ&&(g.HM.clearTimeout(R.XJ),R.XJ=null)},Y3D=function(R){R.T.D7()||R.QV||R.T.KO(R)},Jk=function(R){kwv(R);
g.Cv(R.NA);R.NA=null;R.W.stop();R.N.removeAll();if(R.wG){var F=R.wG;R.wG=null;F.abort();F.dispose()}R.x$&&(R.x$=null)},Jtz=function(R,F){try{R.T.Fz(R,F),R.T.gY(4)}catch(n){}},dqq=function(R,F,n,V,r){if(V==0)n(!1);
else{var v=r||0;V--;Gw7(R,F,function(f){f?n(!0):g.HM.setTimeout(function(){dqq(R,F,n,V,v)},v)})}},Gw7=function(R,F,n){var V=new Image;
V.onload=function(){try{GD(V),n(!0)}catch(r){}};
V.onerror=function(){try{GD(V),n(!1)}catch(r){}};
V.onabort=function(){try{GD(V),n(!1)}catch(r){}};
V.ontimeout=function(){try{GD(V),n(!1)}catch(r){}};
g.HM.setTimeout(function(){if(V.ontimeout)V.ontimeout()},F);
V.src=R},GD=function(R){R.onload=null;
R.onerror=null;R.onabort=null;R.ontimeout=null},Mw5=function(R){this.T=R;
this.U=new a_},lJ$=function(R){var F=d0(R.T,R.pY,"/mail/images/cleardot.gif");
e$(F);dqq(F.toString(),5E3,(0,g.k$)(R.uN,R),3,2E3);R.gY(1)},NB5=function(R){var F=R.T.Z;
F!=null?(kP(5),F?(kP(11),Mo(R.T,R,!1)):(kP(12),Mo(R.T,R,!0))):(R.gp=new YP(R),R.gp.Ya=R.FV,F=R.T,F=d0(F,F.PF()?R.Ac:null,R.Bx),kP(5),R_(F,"TYPE","xmlhttp"),OAz(R.gp,F,!1,R.Ac,!1))},EL5=function(R,F,n){this.T=1;
this.U=[];this.N=[];this.W=new a_;this.UZ=R||null;this.Z=F!=null?F:null;this.V=n||!1},$q7=function(R,F){this.T=R;
this.map=F;this.context=null},PgU=function(R,F,n,V){g.v2.call(this,"timingevent",R);
this.size=F;this.rtt=n;this.retries=V},bAD=function(R){g.v2.call(this,"serverreachability",R)},eL5=function(R){R.DM(1,0);
R.QP=d0(R,null,R.tC);ZA5(R)},Rq$=function(R){R.Rg&&(R.Rg.abort(),R.Rg=null);
R.uo&&(R.uo.cancel(),R.uo=null);R.vY&&(g.HM.clearTimeout(R.vY),R.vY=null);lu(R);R.TP&&(R.TP.cancel(),R.TP=null);R.KZ&&(g.HM.clearTimeout(R.KZ),R.KZ=null)},FHv=function(R,F){if(R.T==0)throw Error("Invalid operation: sending map when state is closed");
R.U.push(new $q7(R.dQ++,F));R.T!=2&&R.T!=3||ZA5(R)},niq=function(R){var F=0;
R.uo&&F++;R.TP&&F++;return F},ZA5=function(R){R.TP||R.KZ||(R.KZ=iu((0,g.k$)(R.ZL,R),0),R.gP=0)},viq=function(R,F){if(R.T==1){if(!F){R.Fq=Math.floor(Math.random()*1E5);
F=R.Fq++;var n=new YP(R,"",F);n.Ya=R.Z8;var V=VP7(R),r=R.QP.clone();g.sB(r,"RID",F);g.sB(r,"CVER","1");No(R,r);gLM(n,r,V);R.TP=n;R.T=2}}else R.T==3&&(F?rjz(R,F):R.U.length==0||R.TP||rjz(R))},rjz=function(R,F){if(F)if(R.vk>6){R.U=R.N.concat(R.U);
R.N.length=0;var n=R.Fq-1;F=VP7(R)}else n=F.X,F=F.gy;else n=R.Fq++,F=VP7(R);var V=R.QP.clone();g.sB(V,"SID",R.J);g.sB(V,"RID",n);g.sB(V,"AID",R.Ct);No(R,V);n=new YP(R,R.J,n,R.gP+1);n.Ya=R.Z8;n.setTimeout(1E4+Math.round(1E4*Math.random()));R.TP=n;gLM(n,V,F)},No=function(R,F){R.Ht&&(R=R.Ht.Xz())&&g.DN(R,function(n,V){g.sB(F,V,n)})},VP7=function(R){var F=Math.min(R.U.length,1E3),n=["count="+F];
if(R.vk>6&&F>0){var V=R.U[0].T;n.push("ofs="+V)}else V=0;for(var r={},v=0;v<F;r={Qq:void 0},v++){r.Qq=R.U[v].T;var f=R.U[v].map;r.Qq=R.vk<=6?v:r.Qq-V;try{g.DN(f,function(z){return function(q,Q){n.push("req"+z.Qq+"_"+Q+"="+encodeURIComponent(q))}}(r))}catch(z){n.push("req"+r.Qq+"_type="+encodeURIComponent("_badmap"))}}R.N=R.N.concat(R.U.splice(0,F));
return n.join("&")},f_U=function(R){R.uo||R.vY||(R.X=1,R.vY=iu((0,g.k$)(R.bz,R),0),R.e5=0)},zqv=function(R){if(R.uo||R.vY||R.e5>=3)return!1;
R.X++;R.vY=iu((0,g.k$)(R.bz,R),tP7(R,R.e5));R.e5++;return!0},Mo=function(R,F,n){R.Y1=R.Z==null?n:!R.Z;
R.iG=F.g8;R.V||eL5(R)},lu=function(R){R.C$!=null&&(g.HM.clearTimeout(R.C$),R.C$=null)},tP7=function(R,F){var n=5E3+Math.floor(Math.random()*1E4);
R.isActive()||(n*=2);return n*F},E9=function(R,F){if(F==2||F==9){var n=null;
R.Ht&&(n=null);var V=(0,g.k$)(R.ADG,R);n||(n=new g.c_("//www.google.com/images/cleardot.gif"),e$(n));Gw7(n.toString(),1E4,V)}else kP(2);q2D(R,F)},q2D=function(R,F){R.T=0;
R.Ht&&R.Ht.ze(F);Qkv(R);Rq$(R)},Qkv=function(R){R.T=0;
R.iG=-1;if(R.Ht)if(R.N.length==0&&R.U.length==0)R.Ht.z1();else{var F=g.f4(R.N),n=g.f4(R.U);R.N.length=0;R.U.length=0;R.Ht.z1(F,n)}},d0=function(R,F,n){var V=g.H_(n);
if(V.T!="")F&&g.we(V,F+"."+V.T),g.QG(V,V.N);else{var r=window.location;V=NHD(r.protocol,F?F+"."+r.hostname:r.hostname,+r.port,n)}R.lc&&g.DN(R.lc,function(v,f){g.sB(V,f,v)});
g.sB(V,"VER",R.vk);No(R,V);return V},cjU=function(){},wC7=function(){this.T=[];
this.U=[]},S2v=function(R){g.v2.call(this,"channelMessage");
this.message=R},LHq=function(R){g.v2.call(this,"channelError");
this.error=R},skv=function(R,F){this.action=R;
this.params=F||{}},$P=function(R,F){g.G.call(this);
this.T=new g.ZK(this.y71,0,this);g.d(this,this.T);this.uI=5E3;this.retryCount=this.tH=0;if(typeof R==="function")F&&(R=(0,g.k$)(R,F));else if(R&&typeof R.handleEvent==="function")R=(0,g.k$)(R.handleEvent,R);else throw Error("Invalid listener argument");this.U=R},pCv=function(R,F,n,V,r,v,f,z,q,Q,c,w,L,S,p){var C=this;
n=n===void 0?!1:n;V=V===void 0?function(){return""}:V;
r=r===void 0?!1:r;v=v===void 0?!1:v;f=f===void 0?!1:f;z=z===void 0?function(){return g.KT({})}:z;
Q=Q===void 0?!1:Q;c=c===void 0?!1:c;w=w===void 0?!1:w;L=L===void 0?!1:L;this.dX=R;this.jQ=F;this.V=new g.Wt;this.Z=p;this.U=(this.N=!!S)?S(function(){C.IL()}):new $P(this.IL,this);
this.T=null;this.UZ=!1;this.J1=null;this.PG="";this.lS=this.Nq=0;this.J=[];this.YF=n;this.bS=V;this.X=v;this.gX=z;this.Y5=q;this.HI=f;this.Mq=null;this.W=g.KT();this.QZ=r;this.on=Q;this.mQ=c;this.us=w;this.KC=L;this.k5=new kG5;this.SQ=new YBs;this.aG=new GGU;this.h1=new JmU;this.uS=new d1$;this.pC=new MIU;this.oC=new lKq},a_z=function(R,F,n,V,r){XCh(R);
if(R.T){var v=g.ew("ID_TOKEN"),f=R.T.Z8||{};v?f["x-youtube-identity-token"]=v:delete f["x-youtube-identity-token"];R.T.Z8=f}AjO(R);V?(V.getState()!=3&&niq(V)==0||V.getState(),R.T.connect(F,n,R.jQ,V.J,V.Ct)):r?R.T.connect(F,n,R.jQ,r.sessionId,r.arrayId):R.T.connect(F,n,R.jQ);R.N&&!R.U.isActive()&&R.U.start();R.Z&&R.Z.r3G()},yjz=function(R,F){return R.us?!0:R.mQ?Object.values(CxO).includes(F):R.on?!Object.values(Tzq).includes(F):R.KC?Object.values(oiU).includes(F):!1},H$5=function(R){var F,n;
g.Y(function(V){if(V.T==1)return g.qs(V,2),g.k(V,UlD(R),2);g.wq(V);F=R.J;R.J=[];n=F.length;jk5(R,F,n);PO(R);return g.S7(V,0)})},jk5=function(R,F,n){for(var V=0;V<n;++V)FHv(R.T,F[V]);
PO(R)},PO=function(R){R.publish("handlerOpened");
R.k5.Yq("BROWSER_CHANNEL")},XCh=function(R){if(R.T){var F=R.bS(),n=R.T.Z8||{};
F?n["x-youtube-lounge-xsrf-token"]=F:delete n["x-youtube-lounge-xsrf-token"];R.T.Z8=n}},UlD=function(R){if(!R.HI)return hq5(R);
R.Mq===null&&(R.Mq=hq5(R));return R.Mq},hq5=function(R){return g.xv(R.gX().then(function(F){WHh(R,F)}).h5(function(){}),function(){R.Mq=null})},WHh=function(R,F){if(R.T){var n=R.T.Z8||{};
F&&Object.keys(F).length>0?n=Object.assign({},n,F):delete n.Authorization;R.T.Z8=n}},AjO=function(R){R.Y5&&!R.X&&WHh(R,R.Y5())},bu=function(R){this.scheme="https";
this.port=this.domain="";this.T="/api/lounge";this.U=!0;R=R||document.location.href;var F=Number(g.Wa(R)[4]||null)||"";F&&(this.port=":"+F);this.domain=g.u5(R)||"";R=g.ft();R.search("MSIE")>=0&&(R=R.match(/MSIE ([\d.]+)/)[1],g.v$(R,"10.0")<0&&(this.U=!1))},Zc=function(R,F){var n=R.T;
R.U&&(n=R.scheme+"://"+R.domain+R.port+R.T);return g.DI(n+F,{})},ulD=function(R,F){g.TC.call(this);
var n=this;this.handler=R();this.handler.subscribe("handlerOpened",this.qw,this);this.handler.subscribe("handlerClosed",this.onClosed,this);this.handler.subscribe("handlerError",function(V,r){n.onError(r)});
this.handler.subscribe("handlerMessage",this.onMessage,this);this.T=F},Bz7=function(R,F,n){var V=this;
n=n===void 0?function(){return""}:n;
var r=r===void 0?new jH7:r;var v=v===void 0?new g.Wt:v;this.pathPrefix=R;this.T=F;this.jQ=n;this.W=v;this.V=null;this.UZ=this.X=0;this.channel=null;this.Z=0;this.N=new $P(function(){V.N.isActive();var f;((f=V.channel)==null?void 0:F3v((new W3M(f,f.T)).T.U))===0&&V.connect(V.V,V.X)});
this.J={};this.U={};this.Nq=!1;this.logger=null;this.J1=[];this.zt=void 0;this.bS=new kG5;this.lS=new YBs;this.Mq=new JmU;this.PG=new d1$},mls=function(R){g.LT(R.channel,"m",function(){R.Z=3;
R.N.reset();R.V=null;R.X=0;for(var F=g.m(R.J1),n=F.next();!n.done;n=F.next())n=n.value,R.channel&&R.channel.send(n);R.J1=[];R.publish("webChannelOpened");R.bS.Yq("WEB_CHANNEL")});
g.LT(R.channel,"n",function(){R.Z=0;R.N.isActive()||R.publish("webChannelClosed");var F,n=(F=R.channel)==null?void 0:u4v(new W3M(F,F.T));n&&(R.J1=[].concat(g.I(n)));R.lS.Yq("WEB_CHANNEL")});
g.LT(R.channel,"p",function(F){var n=F.data;n[0]==="gracefulReconnect"?(R.N.start(),R.channel&&R.channel.close()):R.publish("webChannelMessage",new skv(n[0],n[1]));R.zt=F.statusCode;R.Mq.Yq("WEB_CHANNEL")});
g.LT(R.channel,"o",function(){R.zt===401||R.N.start();R.publish("webChannelError");R.PG.Yq("WEB_CHANNEL","")})},giq=function(R){var F=R.jQ();
F?R.J["x-youtube-lounge-xsrf-token"]=F:delete R.J["x-youtube-lounge-xsrf-token"]},O$s=function(R){g.TC.call(this);
this.T=R();this.T.subscribe("webChannelOpened",this.rQ,this);this.T.subscribe("webChannelClosed",this.onClosed,this);this.T.subscribe("webChannelError",this.onError,this);this.T.subscribe("webChannelMessage",this.onMessage,this)},I_v=function(R,F,n,V,r){function v(){return new pCv(Zc(R,"/bc"),F,!1,n,V)}
n=n===void 0?function(){return""}:n;
return g.U2("enable_mdx_web_channel_desktop")?new O$s(function(){return new Bz7(Zc(R,"/wc"),F,n)}):new ulD(v,r)},xlO=function(){var R=KHh;
Dl7();ed.push(R);i$h()},nX=function(R,F){Dl7();
var n=kgv(R,String(F));ed.length==0?Y2h(n):(i$h(),g.az(ed,function(V){V(n)}))},VS=function(R){nX("CP",R)},Dl7=function(){ed||(ed=g.WM("yt.mdx.remote.debug.handlers_")||[],g.h7("yt.mdx.remote.debug.handlers_",ed))},Y2h=function(R){var F=(r4+1)%50;
r4=F;vZ[F]=R;fX||(fX=F==49)},i$h=function(){var R=ed;
if(vZ[0]){var F=fX?r4:-1,n={};do n={PN:void 0},F=(F+1)%50,n.PN=vZ[F],g.az(R,function(V){return function(r){r(V.PN)}}(n));
while(F!=r4);vZ=Array(50);r4=-1;fX=!1}},kgv=function(R,F){var n=(Date.now()-Jj$)/1E3;
n.toFixed&&(n=n.toFixed(3));var V=[];V.push("[",n+"s","] ");V.push("[","yt.mdx.remote","] ");V.push(R+": "+F,"\n");return V.join("")},tl=function(R){g.fG.call(this);
this.Z=R;this.screens=[]},GgO=function(R,F){var n=R.get(F.uuid)||R.get(F.id);
if(n)return R=n.name,n.id=F.id||n.id,n.name=F.name,n.token=F.token,n.uuid=F.uuid||n.uuid,n.name!=R;R.screens.push(F);return!0},dlM=function(R,F){var n=R.screens.length!=F.length;
R.screens=g.dk(R.screens,function(v){return!!tC5(F,v)});
for(var V=F.length,r=0;r<V;r++)n=GgO(R,F[r])||n;return n},MPv=function(R,F){var n=R.screens.length;
R.screens=g.dk(R.screens,function(V){return!(V||F?!V!=!F?0:V.id==F.id:1)});
return R.screens.length<n},l_M=function(R,F,n,V,r){g.fG.call(this);
this.N=R;this.X=F;this.J=n;this.Z=V;this.W=r;this.U=0;this.T=null;this.q5=NaN},qh=function(R){tl.call(this,"LocalScreenService");
this.U=R;this.T=NaN;zU(this);this.info("Initializing with "+r$U(this.screens))},Nzq=function(R){if(R.screens.length){var F=g.OM(R.screens,function(V){return V.id}),n=Zc(R.U,"/pairing/get_lounge_token_batch");
R.U.sendRequest("POST",n,{screen_ids:F.join(",")},(0,g.k$)(R.BXH,R),(0,g.k$)(R.K2Q,R))}},zU=function(R){if(g.U2("deprecate_pair_servlet_enabled"))return dlM(R,[]);
var F=VC$(L9U());F=g.dk(F,function(n){return!n.uuid});
return dlM(R,F)},QS=function(R,F){pt$(g.OM(R.screens,F97));
F&&sp7()},$lz=function(R,F){g.fG.call(this);
this.Z=F;F=(F=g.xh("yt-remote-online-screen-ids")||"")?F.split(","):[];for(var n={},V=this.Z(),r=V.length,v=0;v<r;++v){var f=V[v].id;n[f]=g.Rz(F,f)}this.T=n;this.W=R;this.N=this.J=NaN;this.U=null;EiM("Initialized with "+g.lh(this.T))},Pxh=function(R,F,n){var V=Zc(R.W,"/pairing/get_screen_availability");
R.W.sendRequest("POST",V,{lounge_token:F.token},(0,g.k$)(function(r){r=r.screens||[];for(var v=r.length,f=0;f<v;++f)if(r[f].loungeToken==F.token){n(r[f].status=="online");return}n(!1)},R),(0,g.k$)(function(){n(!1)},R))},Z$7=function(R,F){a:if(D1q(F)!=D1q(R.T))var n=!1;
else{n=g.Ho(F);for(var V=n.length,r=0;r<V;++r)if(!R.T[n[r]]){n=!1;break a}n=!0}n||(EiM("Updated online screens: "+g.lh(R.T)),R.T=F,R.publish("screenChange"));b$D(R)},cZ=function(R){isNaN(R.N)||g.Tg(R.N);
R.N=g.ak((0,g.k$)(R.Tc,R),R.J>0&&R.J<g.J7()?2E4:1E4)},EiM=function(R){nX("OnlineScreenService",R)},eqr=function(R){var F={};
g.az(R.Z(),function(n){n.token?F[n.token]=n.id:this.Uw("Requesting availability of screen w/o lounge token.")});
return F},b$D=function(R){R=g.Ho(g.oz(R.T,function(F){return F}));
g.p4(R);R.length?g.i6("yt-remote-online-screen-ids",R.join(","),60):g.kh("yt-remote-online-screen-ids")},w4=function(R,F){F=F===void 0?!1:F;
tl.call(this,"ScreenService");this.J=R;this.X=F;this.T=this.U=null;this.N=[];this.W={};RXq(this)},nh7=function(R,F,n,V,r,v){R.info("getAutomaticScreenByIds "+n+" / "+F);
n||(n=R.W[F]);var f=R.h8(),z=n?qo(f,n):null;n&&(R.X||z)||(z=qo(f,F));if(z){z.uuid=F;var q=SY(R,z);Pxh(R.T,q,function(Q){r(Q?q:null)})}else n?FlU(R,n,(0,g.k$)(function(Q){var c=SY(this,new f8({name:V,
screenId:n,loungeToken:Q,dialId:F||""}));Pxh(this.T,c,function(w){r(w?c:null)})},R),v):r(null)},V3z=function(R,F){for(var n=R.screens.length,V=0;V<n;++V)if(R.screens[V].name==F)return R.screens[V];
return null},rLv=function(R,F,n){Pxh(R.T,F,n)},FlU=function(R,F,n,V){R.info("requestLoungeToken_ for "+F);
var r={postParams:{screen_ids:F},method:"POST",context:R,onSuccess:function(v,f){v=f&&f.screens||[];v[0]&&v[0].screenId==F?n(v[0].loungeToken):V(Error("Missing lounge token in token response"))},
onError:function(){V(Error("Request screen lounge token failed"))}};
g.ux(Zc(R.J,"/pairing/get_lounge_token_batch"),r)},vhv=function(R){R.screens=R.U.h8();
var F=R.W,n={},V;for(V in F)n[F[V]]=V;F=R.screens.length;for(V=0;V<F;++V){var r=R.screens[V];r.uuid=n[r.id]||""}R.info("Updated manual screens: "+r$U(R.screens))},RXq=function(R){fgM(R);
R.U=new qh(R.J);R.U.subscribe("screenChange",(0,g.k$)(R.XGQ,R));vhv(R);R.X||(R.N=VC$(g.xh("yt-remote-automatic-screen-cache")||[]));fgM(R);R.info("Initializing automatic screens: "+r$U(R.N));R.T=new $lz(R.J,(0,g.k$)(R.h8,R,!0));R.T.subscribe("screenChange",(0,g.k$)(function(){this.publish("onlineScreenChange")},R))},SY=function(R,F){var n=R.get(F.id);
n?(n.uuid=F.uuid,F=n):((n=qo(R.N,F.uuid))?(n.id=F.id,n.token=F.token,F=n):R.N.push(F),R.X||t3D(R));fgM(R);R.W[F.uuid]=F.id;g.i6("yt-remote-device-id-map",R.W,31536E3);return F},t3D=function(R){R=g.dk(R.N,function(F){return F.idType!="shortLived"});
g.i6("yt-remote-automatic-screen-cache",g.OM(R,F97))},fgM=function(R){R.W=g.xh("yt-remote-device-id-map")||{}},LX=function(R,F,n){g.fG.call(this);
this.PG=n;this.J=R;this.U=F;this.T=null},sN=function(R,F){R.T=F;
R.publish("sessionScreen",R.T)},zX5=function(R,F){R.T&&(R.T.token=F,SY(R.J,R.T));
R.publish("sessionScreen",R.T)},pX=function(R,F){nX(R.PG,F)},X2=function(R,F,n){LX.call(this,R,F,"CastSession");
var V=this;this.config_=n;this.N=null;this.J1=(0,g.k$)(this.RQ,this);this.lS=(0,g.k$)(this.Po2,this);this.Nq=g.ak(function(){qwq(V,null)},12E4);
this.X=this.W=this.Z=this.V=0;this.jQ=!1;this.UZ="unknown"},cLs=function(R,F){g.Tg(R.X);
R.X=0;F==0?QxO(R):R.X=g.ak(function(){QxO(R)},F)},QxO=function(R){wcD(R,"getLoungeToken");
g.Tg(R.W);R.W=g.ak(function(){Sw5(R,null)},3E4)},wcD=function(R,F){R.info("sendYoutubeMessage_: "+F+" "+g.lh());
var n={};n.type=F;R.N?R.N.sendMessage("urn:x-cast:com.google.youtube.mdx",n,function(){},(0,g.k$)(function(){pX(this,"Failed to send message: "+F+".")},R)):pX(R,"Sending yt message without session: "+g.lh(n))},Ll$=function(R,F){F?(R.info("onConnectedScreenId_: Received screenId: "+F),R.T&&R.T.id==F||R.Dk(F,function(n){sN(R,n)},function(){return R.C6()},5)):R.C6(Error("Waiting for session status timed out."))},pcq=function(R,F,n){R.info("onConnectedScreenData_: Received screenData: "+JSON.stringify(F));
var V=new f8(F);sxq(R,V,function(r){r?(R.jQ=!0,SY(R.J,V),sN(R,V),R.UZ="unknown",cLs(R,n)):(g.n$(Error("CastSession, RemoteScreen from screenData: "+JSON.stringify(F)+" is not online.")),R.C6())},5)},qwq=function(R,F){g.Tg(R.Nq);
R.Nq=0;F?R.config_.enableCastLoungeToken&&F.loungeToken?F.deviceId?R.T&&R.T.uuid==F.deviceId||(F.loungeTokenRefreshIntervalMs?pcq(R,{name:R.U.friendlyName,screenId:F.screenId,loungeToken:F.loungeToken,dialId:F.deviceId,screenIdType:"shortLived"},F.loungeTokenRefreshIntervalMs):(g.n$(Error("No loungeTokenRefreshIntervalMs presents in mdxSessionStatusData: "+JSON.stringify(F)+".")),Ll$(R,F.screenId))):(g.n$(Error("No device id presents in mdxSessionStatusData: "+JSON.stringify(F)+".")),Ll$(R,F.screenId)):
Ll$(R,F.screenId):R.C6(Error("Waiting for session status timed out."))},Sw5=function(R,F){g.Tg(R.W);
R.W=0;var n=null;if(F)if(F.loungeToken){var V;((V=R.T)==null?void 0:V.token)==F.loungeToken&&(n="staleLoungeToken")}else n="missingLoungeToken";else n="noLoungeTokenResponse";n?(R.info("Did not receive a new lounge token in onLoungeToken_ with data: "+(JSON.stringify(F)+", error: "+n)),R.UZ=n,cLs(R,3E4)):(zX5(R,F.loungeToken),R.jQ=!1,R.UZ="unknown",cLs(R,F.loungeTokenRefreshIntervalMs))},sxq=function(R,F,n,V){g.Tg(R.Z);
R.Z=0;rLv(R.J,F,function(r){r||V<0?n(r):R.Z=g.ak(function(){sxq(R,F,n,V-1)},300)})},XcO=function(R){g.Tg(R.V);
R.V=0;g.Tg(R.Z);R.Z=0;g.Tg(R.Nq);R.Nq=0;g.Tg(R.W);R.W=0;g.Tg(R.X);R.X=0},Al=function(R,F,n,V){LX.call(this,R,F,"DialSession");
this.config_=V;this.N=this.V=null;this.lS="";this.Y5=n;this.bS=null;this.Nq=function(){};
this.UZ=NaN;this.Mq=(0,g.k$)(this.GK,this);this.W=function(){};
this.X=this.Z=0;this.J1=!1;this.jQ="unknown"},aj=function(R){var F;
return!!(R.config_.enableDialLoungeToken&&((F=R.N)==null?0:F.getDialAppInfo))},ALD=function(R){R.W=R.J.gs(R.lS,R.U.label,R.U.friendlyName,aj(R),function(F,n){R.W=function(){};
R.J1=!0;sN(R,F);F.idType=="shortLived"&&n>0&&CX(R,n)},function(F){R.W=function(){};
R.C6(F)})},ag$=function(R){var F={};
F.pairingCode=R.lS;F.theme=R.Y5;A$s()&&(F.env_useStageMdx=1);return g.KS(F)},C67=function(R){return new Promise(function(F){R.lS=ves();
if(R.bS){var n=new chrome.cast.DialLaunchResponse(!0,ag$(R));F(n);ALD(R)}else R.Nq=function(){g.Tg(R.UZ);R.Nq=function(){};
R.UZ=NaN;var V=new chrome.cast.DialLaunchResponse(!0,ag$(R));F(V);ALD(R)},R.UZ=g.ak(function(){R.Nq()},100)})},ohv=function(R,F,n){R.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(F));
var V=new f8(F);return(new Promise(function(r){TfD(R,V,function(v){v?(R.J1=!0,SY(R.J,V),sN(R,V),CX(R,n)):g.n$(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(F)+" is not online."));r(v)},5)})).then(function(r){return r?new chrome.cast.DialLaunchResponse(!1):C67(R)})},yLr=function(R,F){var n=R.V.receiver.label,V=R.U.friendlyName;
return(new Promise(function(r){nh7(R.J,n,F,V,function(v){v&&v.token&&sN(R,v);r(v)},function(v){pX(R,"Failed to get DIAL screen: "+v);
r(null)})})).then(function(r){return r&&r.token?new chrome.cast.DialLaunchResponse(!1):C67(R)})},TfD=function(R,F,n,V){g.Tg(R.Z);
R.Z=0;rLv(R.J,F,function(r){r||V<0?n(r):R.Z=g.ak(function(){TfD(R,F,n,V-1)},300)})},CX=function(R,F){R.info("getDialAppInfoWithTimeout_ "+F);
aj(R)&&(g.Tg(R.X),R.X=0,F==0?U8M(R):R.X=g.ak(function(){U8M(R)},F))},U8M=function(R){aj(R)&&R.N.getDialAppInfo(function(F){R.info("getDialAppInfo dialLaunchData: "+JSON.stringify(F));
F=F.extraData||{};var n=null;if(F.loungeToken){var V;((V=R.T)==null?void 0:V.token)==F.loungeToken&&(n="staleLoungeToken")}else n="missingLoungeToken";n?(R.jQ=n,CX(R,3E4)):(R.J1=!1,R.jQ="unknown",zX5(R,F.loungeToken),CX(R,F.loungeTokenRefreshIntervalMs))},function(F){R.info("getDialAppInfo error: "+F);
R.jQ="noLoungeTokenResponse";CX(R,3E4)})},jxh=function(R){g.Tg(R.Z);
R.Z=0;g.Tg(R.X);R.X=0;R.W();R.W=function(){};
g.Tg(R.UZ)},TU=function(R,F){LX.call(this,R,F,"ManualSession");
this.N=g.ak((0,g.k$)(this.FR,this,null),150)},oj=function(R,F){g.fG.call(this);
this.config_=F;this.U=R;this.V=F.appId||"233637DE";this.J=F.theme||"cl";this.UZ=F.disableCastApi||!1;this.Z=F.forceMirroring||!1;this.T=null;this.X=!1;this.N=[];this.W=(0,g.k$)(this.w_G,this)},Hwv=function(R,F){return F?g.$$(R.N,function(n){return tk(F,n.label)},R):null},yS=function(R){nX("Controller",R)},KHh=function(R){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(R)},UN=function(R){return R.X||!!R.N.length||!!R.T},jY=function(R,F,n){F!=R.T&&(g.Cv(R.T),(R.T=F)?(n?R.publish("yt-remote-cast2-receiver-resumed",
F.U):R.publish("yt-remote-cast2-receiver-selected",F.U),F.subscribe("sessionScreen",(0,g.k$)(R.eR,R,F)),F.subscribe("sessionFailed",function(){return hXv(R,F)}),F.T?R.publish("yt-remote-cast2-session-change",F.T):n&&R.T.FR(null)):R.publish("yt-remote-cast2-session-change",null))},hXv=function(R,F){R.T==F&&R.publish("yt-remote-cast2-session-failed")},Wlq=function(R){var F=R.U.eN(),n=R.T&&R.T.U;
R=g.OM(F,function(V){n&&tk(V,n.label)&&(n=null);var r=V.uuid?V.uuid:V.id,v=Hwv(this,V);v?(v.label=r,v.friendlyName=V.name):(v=new chrome.cast.Receiver(r,V.name),v.receiverType=chrome.cast.ReceiverType.CUSTOM);return v},R);
n&&(n.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(n=new chrome.cast.Receiver(n.label,n.friendlyName),n.receiverType=chrome.cast.ReceiverType.CUSTOM),R.push(n));return R},D8$=function(R,F,n,V){V.disableCastApi?HZ("Cannot initialize because disabled by Mdx config."):uAq()?Bf$(F,V)&&(m8q(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?ghM(R,n):(window.__onGCastApiAvailable=function(r,v){r?ghM(R,n):(hl("Failed to load cast API: "+v),Owq(!1),m8q(!1),g.kh("yt-remote-cast-available"),g.kh("yt-remote-cast-receiver"),
Igr(),n(!1))},V.loadCastApiSetupScript?g.rG(Kl7):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?aAv()>=60&&W9M():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?y$z():aAv()>=89?Bsq():(hov(),s9(uK7.map(UXM))))):HZ("Cannot initialize because not running Chrome")},Igr=function(){HZ("dispose");
var R=WZ();R&&R.dispose();g.h7("yt.mdx.remote.cloudview.instance_",null);iwh(!1);g.nr(x8z);x8z.length=0},uc=function(){return!!g.xh("yt-remote-cast-installed")},kQv=function(){var R=g.xh("yt-remote-cast-receiver");
return R?R.friendlyName:null},Yws=function(){HZ("clearCurrentReceiver");
g.kh("yt-remote-cast-receiver")},JLv=function(){return uc()?WZ()?WZ().getCastSession():(hl("getCastSelector: Cast is not initialized."),null):(hl("getCastSelector: Cast API is not installed!"),null)},GQv=function(){uc()?WZ()?BZ()?(HZ("Requesting cast selector."),WZ().requestSession()):(HZ("Wait for cast API to be ready to request the session."),x8z.push(g.Fm("yt-remote-cast2-api-ready",GQv))):hl("requestCastSelector: Cast is not initialized."):hl("requestCastSelector: Cast API is not installed!")},
mv=function(R,F){BZ()?WZ().setConnectedScreenStatus(R,F):hl("setConnectedScreenStatus called before ready.")},uAq=function(){var R=g.ft().search(/ (CrMo|Chrome|CriOS)\//)>=0;
return g.Sl||R},d87=function(R,F){WZ().init(R,F)},Bf$=function(R,F){var n=!1;
WZ()||(R=new oj(R,F),R.subscribe("yt-remote-cast2-availability-change",function(V){g.i6("yt-remote-cast-available",V);L8("yt-remote-cast2-availability-change",V)}),R.subscribe("yt-remote-cast2-receiver-selected",function(V){HZ("onReceiverSelected: "+V.friendlyName);
g.i6("yt-remote-cast-receiver",V);L8("yt-remote-cast2-receiver-selected",V)}),R.subscribe("yt-remote-cast2-receiver-resumed",function(V){HZ("onReceiverResumed: "+V.friendlyName);
g.i6("yt-remote-cast-receiver",V);L8("yt-remote-cast2-receiver-resumed",V)}),R.subscribe("yt-remote-cast2-session-change",function(V){HZ("onSessionChange: "+zD(V));
V||g.kh("yt-remote-cast-receiver");L8("yt-remote-cast2-session-change",V)}),g.h7("yt.mdx.remote.cloudview.instance_",R),n=!0);
HZ("cloudview.createSingleton_: "+n);return n},WZ=function(){return g.WM("yt.mdx.remote.cloudview.instance_")},ghM=function(R,F){Owq(!0);
m8q(!1);d87(R,function(n){n?(iwh(!0),g.V9("yt-remote-cast2-api-ready")):(hl("Failed to initialize cast API."),Owq(!1),g.kh("yt-remote-cast-available"),g.kh("yt-remote-cast-receiver"),Igr());F(n)})},HZ=function(R){nX("cloudview",R)},hl=function(R){nX("cloudview",R)},Owq=function(R){HZ("setCastInstalled_ "+R);
g.i6("yt-remote-cast-installed",R)},BZ=function(){return!!g.WM("yt.mdx.remote.cloudview.apiReady_")},iwh=function(R){HZ("setApiReady_ "+R);
g.h7("yt.mdx.remote.cloudview.apiReady_",R)},m8q=function(R){g.h7("yt.mdx.remote.cloudview.initializing_",R)},g4=function(R){this.index=-1;
this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.W=this.Z=0;this.trackData=null;this.hasNext=this.hasPrevious=!1;this.loadedTime=this.N=this.X=this.U=0;this.T=NaN;this.J=!1;this.reset(R)},M3U=function(R){R.audioTrackId=null;
R.trackData=null;R.playerState=-1;R.hasPrevious=!1;R.hasNext=!1;R.Z=0;R.W=g.J7();R.U=0;R.X=0;R.N=0;R.loadedTime=0;R.T=NaN;R.J=!1},ON=function(R){return R.isPlaying()?(g.J7()-R.W)/1E3:0},Ij=function(R,F){R.Z=F;
R.W=g.J7()},KX=function(R){switch(R.playerState){case 1:case 1081:return(g.J7()-R.W)/1E3+R.Z;
case -1E3:return 0}return R.Z},lgv=function(R){return R.J?R.X+ON(R):R.X},Dp=function(R,F,n){var V=R.videoId;
R.videoId=F;R.index=n;F!=V&&M3U(R)},Nf7=function(R){var F={};
F.index=R.index;F.listId=R.listId;F.videoId=R.videoId;F.playerState=R.playerState;F.volume=R.volume;F.muted=R.muted;F.audioTrackId=R.audioTrackId;F.trackData=g.ie(R.trackData);F.hasPrevious=R.hasPrevious;F.hasNext=R.hasNext;F.playerTime=R.Z;F.playerTimeAt=R.W;F.seekableStart=R.U;F.seekableEnd=R.X;F.duration=R.N;F.loadedTime=R.loadedTime;F.liveIngestionTime=R.T;return F},xX=function(R,F){g.fG.call(this);
var n=this;this.N=0;this.J=R;this.Z=[];this.W=new wC7;this.U=this.T=null;this.UZ=(0,g.k$)(this.zeS,this);this.X=(0,g.k$)(this.eb,this);this.V=(0,g.k$)(this.tBX,this);this.Nq=(0,g.k$)(this.YnG,this);var V=0;R?(V=R.getProxyState(),V!=3&&(R.subscribe("proxyStateChange",this.CV,this),EhO(this))):V=3;V!=0&&(F?this.CV(V):g.ak(function(){n.CV(V)},0));
(R=JLv())&&ic(this,R);this.subscribe("yt-remote-cast2-session-change",this.Nq)},kX=function(R){return new g4(R.J.getPlayerContextData())},EhO=function(R){g.az("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(F){this.Z.push(this.J.subscribe(F,g.Y$(this.A7S,F),this))},R)},$8U=function(R){g.az(R.Z,function(F){this.J.unsubscribeByKey(F)},R);
R.Z.length=0},YX=function(R){return R.getState()==1},Jl=function(R,F){var n=R.W;
n.T.length+n.U.length<50&&R.W.enqueue(F)},P6h=function(R,F,n){var V=kX(R);
Ij(V,n);V.playerState!=-1E3&&(V.playerState=F);GU(R,V)},d4=function(R,F,n){R.J.sendMessage(F,n)},GU=function(R,F){$8U(R);
R.J.setPlayerContextData(Nf7(F));EhO(R)},ic=function(R,F){R.U&&(R.U.removeUpdateListener(R.UZ),R.U.removeMediaListener(R.X),R.eb(null));
R.U=F;R.U&&(VS("Setting cast session: "+R.U.sessionId),R.U.addUpdateListener(R.UZ),R.U.addMediaListener(R.X),R.U.media.length&&R.eb(R.U.media[0]))},bwD=function(R){var F=R.T.media,n=R.T.customData;
if(F&&n){var V=kX(R);F.contentId!=V.videoId&&VS("Cast changing video to: "+F.contentId);V.videoId=F.contentId;V.playerState=n.playerState;Ij(V,R.T.getEstimatedTime());GU(R,V)}else VS("No cast media video. Ignoring state update.")},Mh=function(R,F,n){return(0,g.k$)(function(V){this.Uw("Failed to "+F+" with cast v2 channel. Error code: "+V.code);
V.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.Uw("Retrying "+F+" using MDx browser channel."),d4(this,F,n))},R)},EN=function(R,F,n,V){V=V===void 0?!1:V;
g.fG.call(this);var r=this;this.Z=NaN;this.lS=!1;this.UZ=this.V=this.J1=this.jQ=NaN;this.Nq=[];this.W=this.X=this.J=this.T=this.U=null;this.bS=R;this.Mq=V;this.Nq.push(g.Wc(window,"beforeunload",function(){r.QX(2)}));
this.N=[];this.T=new g4;this.Y5=F.id;this.PG=F.idType;this.U=I_v(this.bS,n,this.DL,this.PG=="shortLived",this.Y5);this.U.listen("channelOpened",function(){Zwv(r)});
this.U.listen("channelClosed",function(){lc("Channel closed");isNaN(r.Z)?w0(!0):w0();r.dispose()});
this.U.listen("channelError",function(v){w0();isNaN(r.wF())?(v==1&&r.PG=="shortLived"&&r.publish("browserChannelAuthError",v),lc("Channel error: "+v+" without reconnection"),r.dispose()):(r.lS=!0,lc("Channel error: "+v+" with reconnection in "+r.wF()+" ms"),Nh(r,2))});
this.U.listen("channelMessage",function(v){eXM(r,v)});
this.U.kO(F.token);this.subscribe("remoteQueueChange",function(){var v=r.T.videoId;g.Yh()&&g.i6("yt-remote-session-video-id",v)})},R8D=function(R){return g.$$(R.N,function(F){return F.type=="LOUNGE_SCREEN"})},lc=function(R){nX("conn",R)},Nh=function(R,F){R.publish("proxyStateChange",F)},F2M=function(R){R.Z=g.ak(function(){lc("Connecting timeout");
R.QX(1)},2E4)},nsv=function(R){g.Tg(R.Z);
R.Z=NaN},VaU=function(R){g.Tg(R.jQ);
R.jQ=NaN},vsz=function(R){r1q(R);
R.J1=g.ak(function(){$X(R,"getNowPlaying")},2E4)},r1q=function(R){g.Tg(R.J1);
R.J1=NaN},Zwv=function(R){lc("Channel opened");
R.lS&&(R.lS=!1,VaU(R),R.jQ=g.ak(function(){lc("Timing out waiting for a screen.");R.QX(1)},15E3))},taD=function(R,F){var n=null;
if(F){var V=R8D(R);V&&(n={clientName:V.clientName,deviceMake:V.brand,deviceModel:V.model,osVersion:V.osVersion})}g.h7("yt.mdx.remote.remoteClient_",n);F&&(nsv(R),VaU(R));n=R.U.IN()&&isNaN(R.Z);F==n?F&&(Nh(R,1),$X(R,"getSubtitlesTrack")):F?(R.Xe()&&R.T.reset(),Nh(R,1),$X(R,"getNowPlaying"),fY5(R)):R.QX(1)},z8$=function(R,F){var n=F.params.videoId;
delete F.params.videoId;n==R.T.videoId&&(g.g7(F.params)?R.T.trackData=null:R.T.trackData=F.params,R.publish("remotePlayerChange"))},qgv=function(R,F,n){var V=F.params.videoId||F.params.video_id,r=parseInt(F.params.currentIndex,10);
R.T.listId=F.params.listId||R.T.listId;Dp(R.T,V,r);R.publish("remoteQueueChange",n)},c1D=function(R,F){F.params=F.params||{};
qgv(R,F,"NOW_PLAYING_MAY_CHANGE");Q8U(R,F);R.publish("autoplayDismissed")},Q8U=function(R,F){var n=parseInt(F.params.currentTime||F.params.current_time,10);
Ij(R.T,isNaN(n)?0:n);n=parseInt(F.params.state,10);n=isNaN(n)?-1:n;n==-1&&R.T.playerState==-1E3&&(n=-1E3);R.T.playerState=n;n=Number(F.params.loadedTime);R.T.loadedTime=isNaN(n)?0:n;R.T.sU(Number(F.params.duration));n=R.T;var V=Number(F.params.liveIngestionTime);n.T=V;n.J=isNaN(V)?!1:!0;n=R.T;V=Number(F.params.seekableStartTime);F=Number(F.params.seekableEndTime);n.U=isNaN(V)?0:V;n.X=isNaN(F)?0:F;R.T.playerState==1?vsz(R):r1q(R);R.publish("remotePlayerChange")},wmq=function(R,F){if(R.T.playerState!=
-1E3){var n=1085;
switch(parseInt(F.params.adState,10)){case 1:n=1081;break;case 2:n=1084;break;case 0:n=1083}R.T.playerState=n;F=parseInt(F.params.currentTime,10);Ij(R.T,isNaN(F)?0:F);R.publish("remotePlayerChange")}},Sg$=function(R,F){var n=F.params.muted=="true";
R.T.volume=parseInt(F.params.volume,10);R.T.muted=n;R.publish("remotePlayerChange")},L2O=function(R,F){R.X=F.params.videoId;
R.publish("nowAutoplaying",parseInt(F.params.timeout,10))},s8q=function(R,F){R.X=F.params.videoId||null;
R.publish("autoplayUpNext",R.X)},pm5=function(R,F){R.W=F.params.autoplayMode;
R.publish("autoplayModeChange",R.W);R.W=="DISABLED"&&R.publish("autoplayDismissed")},Xmq=function(R,F){var n=F.params.hasNext=="true";
R.T.hasPrevious=F.params.hasPrevious=="true";R.T.hasNext=n;R.publish("previousNextChange")},eXM=function(R,F){F=F.message;
F.params?lc("Received: action="+F.action+", params="+g.lh(F.params)):lc("Received: action="+F.action+" {}");switch(F.action){case "loungeStatus":F=Fh(F.params.devices);R.N=g.OM(F,function(V){return new vO(V)});
F=!!g.$$(R.N,function(V){return V.type=="LOUNGE_SCREEN"});
taD(R,F);F=R.eX("mlm");R.publish("multiStateLoopEnabled",F);break;case "loungeScreenDisconnected":g.r7(R.N,function(V){return V.type=="LOUNGE_SCREEN"});
taD(R,!1);break;case "remoteConnected":var n=new vO(Fh(F.params.device));g.$$(R.N,function(V){return V.equals(n)})||Kk7(R.N,n);
break;case "remoteDisconnected":n=new vO(Fh(F.params.device));g.r7(R.N,function(V){return V.equals(n)});
break;case "gracefulDisconnect":break;case "playlistModified":qgv(R,F,"QUEUE_MODIFIED");break;case "nowPlaying":c1D(R,F);break;case "onStateChange":Q8U(R,F);break;case "onAdStateChange":wmq(R,F);break;case "onVolumeChanged":Sg$(R,F);break;case "onSubtitlesTrackChanged":z8$(R,F);break;case "nowAutoplaying":L2O(R,F);break;case "autoplayDismissed":R.publish("autoplayDismissed");break;case "autoplayUpNext":s8q(R,F);break;case "onAutoplayModeChanged":pm5(R,F);break;case "onHasPreviousNextChanged":Xmq(R,
F);break;case "requestAssistedSignIn":R.publish("assistedSignInRequested",F.params.authCode);break;case "onLoopModeChanged":R.publish("loopModeChange",F.params.loopMode);break;default:lc("Unrecognized action: "+F.action)}},fY5=function(R){g.Tg(R.UZ);
R.UZ=g.ak(function(){R.QX(1)},864E5)},$X=function(R,F,n){n?lc("Sending: action="+F+", params="+g.lh(n)):lc("Sending: action="+F);
R.U.sendMessage(F,n)},A1r=function(R){tl.call(this,"ScreenServiceProxy");
this.Nc=R;this.T=[];this.T.push(this.Nc.$_s("screenChange",(0,g.k$)(this.Oh,this)));this.T.push(this.Nc.$_s("onlineScreenChange",(0,g.k$)(this.FvS,this)))},y15=function(R,F){Xt7();
if(!Sd||!Sd.get("yt-remote-disable-remote-module-for-dev")){F=g.ew("MDX_CONFIG")||F;zo7();wtv();PZ||(PZ=new bu(F?F.loungeApiHost:void 0),A$s()&&(PZ.T="/api/loungedev"));bc||(bc=g.WM("yt.mdx.remote.deferredProxies_")||[],g.h7("yt.mdx.remote.deferredProxies_",bc));aYU();var n=Zp();if(!n){var V=new w4(PZ,F?F.disableAutomaticScreenCache||!1:!1);g.h7("yt.mdx.remote.screenService_",V);n=Zp();var r={};F&&(r={appId:F.appId,disableDial:F.disableDial,theme:F.theme,loadCastApiSetupScript:F.loadCastApiSetupScript,
disableCastApi:F.disableCastApi,enableDialLoungeToken:F.enableDialLoungeToken,enableCastLoungeToken:F.enableCastLoungeToken,forceMirroring:F.forceMirroring});g.h7("yt.mdx.remote.enableConnectWithInitialState_",F?F.enableConnectWithInitialState||!1:!1);D8$(R,V,function(v){v?eY()&&mv(eY(),"YouTube TV"):V.subscribe("onlineScreenChange",function(){L8("yt-remote-receiver-availability-change")})},r)}F&&!g.WM("yt.mdx.remote.initialized_")&&(g.h7("yt.mdx.remote.initialized_",!0),Rf("Initializing: "+g.lh(F)),
Ft.push(g.Fm("yt-remote-cast2-api-ready",function(){L8("yt-remote-api-ready")})),Ft.push(g.Fm("yt-remote-cast2-availability-change",function(){L8("yt-remote-receiver-availability-change")})),Ft.push(g.Fm("yt-remote-cast2-receiver-selected",function(){n1(null);
L8("yt-remote-auto-connect","cast-selector-receiver")})),Ft.push(g.Fm("yt-remote-cast2-receiver-resumed",function(){L8("yt-remote-receiver-resumed","cast-selector-receiver")})),Ft.push(g.Fm("yt-remote-cast2-session-change",CVM)),Ft.push(g.Fm("yt-remote-connection-change",function(v){v?mv(eY(),"YouTube TV"):V6()||(mv(null,null),Yws())})),Ft.push(g.Fm("yt-remote-cast2-session-failed",function(){L8("yt-remote-connection-failed")})),R=TSv(),F.isAuto&&(R.id+="#dial"),r=F.capabilities||[],r.length>0&&(R.capabilities=
r),R.name=F.device,R.app=F.app,(F=F.theme)&&(R.theme=F),Rf(" -- with channel params: "+g.lh(R)),R?(g.i6("yt-remote-session-app",R.app),g.i6("yt-remote-session-name",R.name)):(g.kh("yt-remote-session-app"),g.kh("yt-remote-session-name")),g.h7("yt.mdx.remote.channelParams_",R),n.start(),eY()||os7())}},Uxz=function(){var R=Zp().Nc.$_gos();
var F=rP();F&&vr()&&(tC5(R,F)||R.push(F));return fAq(R)},H3D=function(){var R=j8$();
!R&&uc()&&kQv()&&(R={key:"cast-selector-receiver",name:kQv()});return R},j8$=function(){var R=Uxz(),F=rP();
F||(F=V6());return g.$$(R,function(n){return F&&tk(F,n.key)?!0:!1})},rP=function(){var R=eY();
if(!R)return null;var F=Zp().h8();return qo(F,R)},CVM=function(R){Rf("remote.onCastSessionChange_: "+zD(R));
if(R){var F=rP();if(F&&F.id==R.id){if(mv(F.id,"YouTube TV"),R.idType=="shortLived"&&(R=R.token))f1&&(f1.token=R),(F=vr())&&F.kO(R)}else F&&tR(),zq(R,1)}else vr()&&tR()},tR=function(){BZ()?WZ().stopSession():hl("stopSession called before API ready.");
var R=vr();R&&(R.disconnect(1),h8O(null))},W2v=function(){var R=vr();
return!!R&&R.getProxyState()!=3},Rf=function(R){nX("remote",R)},Zp=function(){if(!u_q){var R=g.WM("yt.mdx.remote.screenService_");
u_q=R?new A1r(R):null}return u_q},eY=function(){return g.WM("yt.mdx.remote.currentScreenId_")},BSr=function(R){g.h7("yt.mdx.remote.currentScreenId_",R)},mxz=function(){return g.WM("yt.mdx.remote.connectData_")},n1=function(R){g.h7("yt.mdx.remote.connectData_",R)},vr=function(){return g.WM("yt.mdx.remote.connection_")},h8O=function(R){var F=vr();
n1(null);R||BSr("");g.h7("yt.mdx.remote.connection_",R);bc&&(g.az(bc,function(n){n(R)}),bc.length=0);
F&&!R?L8("yt-remote-connection-change",!1):!F&&R&&L8("yt-remote-connection-change",!0)},V6=function(){var R=g.Yh();
if(!R)return null;var F=Zp();if(!F)return null;F=F.h8();return qo(F,R)},zq=function(R,F){eY();
rP()&&rP();if(qK)f1=R;else{BSr(R.id);var n=g.WM("yt.mdx.remote.enableConnectWithInitialState_")||!1;R=new EN(PZ,R,TSv(),n);R.connect(F,mxz());R.subscribe("beforeDisconnect",function(V){L8("yt-remote-before-disconnect",V)});
R.subscribe("beforeDispose",function(){vr()&&(vr(),h8O(null))});
R.subscribe("browserChannelAuthError",function(){var V=rP();V&&V.idType=="shortLived"&&(BZ()?WZ().handleBrowserChannelAuthError():hl("refreshLoungeToken called before API ready."))});
h8O(R)}},os7=function(){var R=V6();
R?(Rf("Resume connection to: "+zD(R)),zq(R,0)):(w0(),Yws(),Rf("Skipping connecting because no session screen found."))},aYU=function(){var R=TSv();
if(g.g7(R)){R=cO();var F=g.xh("yt-remote-session-name")||"",n=g.xh("yt-remote-session-app")||"";R={device:"REMOTE_CONTROL",id:R,name:F,app:n,mdxVersion:3};R.authuser=String(g.ew("SESSION_INDEX","0"));(F=g.ew("DELEGATED_SESSION_ID"))&&(R.pageId=String(F));g.h7("yt.mdx.remote.channelParams_",R)}},TSv=function(){return g.WM("yt.mdx.remote.channelParams_")||{}},IY7=function(R,F,n){g.G.call(this);
var V=this;this.T=R;this.K=F;this.EN=n;this.events=new g.AQ(this);this.W=!1;this.Z=new g.Wz(64);this.U=new g.ZK(this.Wg,500,this);this.N=new g.ZK(this.wd,1E3,this);this.V=new p8(this.rDG,0,this);this.J={};this.UZ=new g.ZK(this.PJ,1E3,this);this.X=new g.nO(this.seekTo,1E3,this);this.Nq=this.events.C(this.K,"onVolumeChange",function(r){gsh(V,r)});
g.d(this,this.events);this.events.C(F,"onCaptionsTrackListChanged",this.U8G);this.events.C(F,"captionschanged",this.bXH);this.events.C(F,"captionssettingschanged",this.Y$);this.events.C(F,"videoplayerreset",this.Xf);this.events.C(F,"mdxautoplaycancel",function(){V.EN.Ic()});
F.B("enable_mdx_video_play_directly")&&this.events.C(F,"videodatachange",function(){O3O(V.T)||Q6(V)||cr(V,0)});
R=this.EN;R.Zo();R.subscribe("proxyStateChange",this.zG,this);R.subscribe("remotePlayerChange",this.dM,this);R.subscribe("remoteQueueChange",this.Xf,this);R.subscribe("previousNextChange",this.FT,this);R.subscribe("nowAutoplaying",this.s$,this);R.subscribe("autoplayDismissed",this.uM,this);g.d(this,this.U);g.d(this,this.N);g.d(this,this.V);g.d(this,this.UZ);g.d(this,this.X);this.Y$();this.Xf();this.dM()},gsh=function(R,F){if(Q6(R)){R.EN.unsubscribe("remotePlayerChange",R.dM,R);
var n=Math.round(F.volume);F=!!F.muted;var V=kX(R.EN);if(n!==V.volume||F!==V.muted)R.EN.setVolume(n,F),R.UZ.start();R.EN.subscribe("remotePlayerChange",R.dM,R)}},K27=function(R){R.M5(0);
R.U.stop();R.md(new g.Wz(64))},Dxh=function(R,F){if(Q6(R)&&!R.W){var n=null;
F&&(n={style:R.K.getSubtitlesUserSettings()},Object.assign(n,F));R.EN.IW(wP(R).videoId,n);R.J=kX(R.EN).trackData}},cr=function(R,F){var n=R.K.getPlaylist();
if(n==null?0:n.listId){var V=n.index;var r=n.listId.toString()}n=wP(R);R.EN.playVideo(n.videoId,F,V,r,n.playerParams,n.Nq,IK$(n));R.md(new g.Wz(1))},i3M=function(R,F){if(F){var n=R.K.getOption("captions","tracklist",{Kz:1});
n&&n.length?(R.K.setOption("captions","track",F),R.W=!1):(R.K.loadModule("captions"),R.W=!0)}else R.K.setOption("captions","track",{})},Q6=function(R){return kX(R.EN).videoId===wP(R).videoId},wP=function(R){return R.K.getVideoData({playerType:1})},xxz=function(R,F){g.iP.call(this,R);
this.T=F},Sn=function(){g.N.call(this,{j:"div",
Y:"ytp-mdx-popup-dialog",S:{role:"dialog"},L:[{j:"div",Y:"ytp-mdx-popup-dialog-inner-content",L:[{j:"div",Y:"ytp-mdx-popup-title",cG:"You're signed out"},{j:"div",Y:"ytp-mdx-popup-description",cG:"Videos you watch may be added to the TV's watch history and influence TV recommendations. To avoid this, cancel and sign in to YouTube on your computer."},{j:"div",Y:"ytp-mdx-privacy-popup-buttons",L:[{j:"button",BG:["ytp-button","ytp-mdx-privacy-popup-cancel"],cG:"Cancel"},{j:"button",BG:["ytp-button",
"ytp-mdx-privacy-popup-confirm"],cG:"Confirm"}]}]}]});this.fade=new g.n5(this,250);this.cancelButton=this.sZ("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.sZ("ytp-mdx-privacy-popup-confirm");g.d(this,this.fade);this.C(this.cancelButton,"click",this.T);this.C(this.confirmButton,"click",this.U)},L1=function(R){g.N.call(this,{j:"div",
Y:"ytp-remote",L:[{j:"div",Y:"ytp-remote-display-status",L:[{j:"div",Y:"ytp-remote-display-status-icon",L:[g.dl_()]},{j:"div",Y:"ytp-remote-display-status-text",cG:"{{statustext}}"}]}]});this.api=R;this.fade=new g.n5(this,250);g.d(this,this.fade);this.C(R,"presentingplayerstatechange",this.onStateChange);this.nX(R.getPlayerStateObject())},sU=function(R,F){g.j6.call(this,"Play on",1,R,F);
this.K=R;this.z2={};this.C(R,"onMdxReceiversChange",this.U);this.C(R,"presentingplayerstatechange",this.U);this.U()},kRh=function(R){g.Lz.call(this,R);
this.rT={key:ves(),name:"This computer"};this.gr=null;this.subscriptions=[];this.MQ=this.EN=null;this.z2=[this.rT];this.xI=this.rT;this.Ll=new g.Wz(64);this.Rd=0;this.m8=-1;this.ph=!1;this.c6=this.aZ=this.k9=null;if(!g.Vw(this.player.D())&&!g.Dz(this.player.D())){R=this.player;var F=g.KK(R);F&&(F=F.MX())&&(F=new sU(R,F),g.d(this,F));F=new L1(R);g.d(this,F);g.RL(R,F.element,4);this.k9=new Sn;g.d(this,this.k9);g.RL(R,this.k9.element,4);this.ph=!!V6()}},p1=function(R){R.aZ&&(R.player.removeEventListener("presentingplayerstatechange",
R.aZ),R.aZ=null)},Ygz=function(R,F,n){R.Ll=n;
R.player.publish("presentingplayerstatechange",new g.cP(n,F))},Xt=function(R,F){if(F.key!==R.xI.key)if(F.key===R.rT.key)tR();
else if(O3O(R)&&J1M(R),R.xI=F,!g.Dz(R.player.D())){var n=R.player.getPlaylistId();var V=R.player.getVideoData({playerType:1});var r=V.videoId;if(!n&&!r||(R.player.getAppState()===2||R.player.getAppState()===1)&&R.player.D().B("should_clear_video_data_on_player_cued_unstarted"))V=null;else{var v=R.player.getPlaylist();if(v){var f=[];for(var z=0;z<v.length;z++)f[z]=g.cR(v,z).videoId}else f=[r];v=R.player.getCurrentTime(1);R={videoIds:f,listId:n,videoId:r,playerParams:V.playerParams,clickTrackingParams:V.Nq,
index:Math.max(R.player.getPlaylistIndex(),0),currentTime:v===0?void 0:v};(V=IK$(V))&&(R.locationInfo=V);V=R}Rf("Connecting to: "+g.lh(F));F.key=="cast-selector-receiver"?(n1(V||null),F=V||null,BZ()?WZ().setLaunchParams(F):hl("setLaunchParams called before ready.")):!V&&W2v()&&eY()==F.key?L8("yt-remote-connection-change",!0):(tR(),n1(V||null),V=Zp().h8(),(F=qo(V,F.key))&&zq(F,1))}},O3O=function(R){var F=R.player.D();
return!F.B("mdx_enable_privacy_disclosure_ui")||R.isLoggedIn()||R.ph||!R.k9?!1:g.Xk(F)||g.C9(F)},J1M=function(R){R.player.getPlayerStateObject().isPlaying()?R.player.pauseVideo():(R.aZ=function(F){!R.ph&&g.Sx(F,8)&&(R.player.pauseVideo(),p1(R))},R.player.addEventListener("presentingplayerstatechange",R.aZ));
R.k9&&R.k9.rW();vr()||(qK=!0)};
g.l4.prototype.bd=g.xN(45,function(){this.app.I9().bd()});
g.dX.prototype.bd=g.xN(44,function(){this.c6=null});
g.l4.prototype.Gq=g.xN(43,function(R){this.app.I9().Gq(R)});
g.dX.prototype.Gq=g.xN(42,function(R){this.c6=R});
g.OH.prototype.It=g.xN(1,function(){return g.Pb(this,3)});
g.PU.prototype.It=g.xN(0,function(){return g.Pb(this,11)});
kG5.prototype.Yq=function(R){this.T.vE("/client_streamz/youtube/living_room/mdx/channel/opened",R)};
YBs.prototype.Yq=function(R){this.T.vE("/client_streamz/youtube/living_room/mdx/channel/closed",R)};
JmU.prototype.Yq=function(R){this.T.vE("/client_streamz/youtube/living_room/mdx/channel/message_received",R)};
GGU.prototype.Yq=function(){this.T.vE("/client_streamz/youtube/living_room/mdx/channel/success")};
d1$.prototype.Yq=function(R,F){this.T.vE("/client_streamz/youtube/living_room/mdx/channel/error",R,F)};
MIU.prototype.Yq=function(){this.T.vE("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")};
lKq.prototype.Yq=function(){this.T.vE("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")};
g.X=VZ.prototype;g.X.GU=function(){r0(this);for(var R=[],F=0;F<this.T.length;F++)R.push(this.U[this.T[F]]);return R};
g.X.V8=function(){r0(this);return this.T.concat()};
g.X.has=function(R){return n8(this.U,R)};
g.X.equals=function(R,F){if(this===R)return!0;if(this.size!=R.size)return!1;F=F||$1D;r0(this);for(var n,V=0;n=this.T[V];V++)if(!F(this.get(n),R.get(n)))return!1;return!0};
g.X.isEmpty=function(){return this.size==0};
g.X.clear=function(){this.U={};this.QT=this.size=this.T.length=0};
g.X.remove=function(R){return this.delete(R)};
g.X.delete=function(R){return n8(this.U,R)?(delete this.U[R],--this.size,this.QT++,this.T.length>2*this.size&&r0(this),!0):!1};
g.X.get=function(R,F){return n8(this.U,R)?this.U[R]:F};
g.X.set=function(R,F){n8(this.U,R)||(this.size+=1,this.T.push(R),this.QT++);this.U[R]=F};
g.X.forEach=function(R,F){for(var n=this.V8(),V=0;V<n.length;V++){var r=n[V],v=this.get(r);R.call(F,v,r,this)}};
g.X.clone=function(){return new VZ(this)};
g.X.keys=function(){return g.op(this.YC(!0)).T()};
g.X.values=function(){return g.op(this.YC(!1)).T()};
g.X.entries=function(){var R=this;return Ex7(this.keys(),function(F){return[F,R.get(F)]})};
g.X.YC=function(R){r0(this);var F=0,n=this.QT,V=this,r=new g.xn;r.next=function(){if(n!=V.QT)throw Error("The map has changed since the iterator was created");if(F>=V.T.length)return g.q$;var v=V.T[F++];return g.kn(R?v:V.U[v])};
return r};
var eDv={Npz:"atp",jeS:"ska",eQz:"que",bx2:"mus",csX:"sus",O2H:"dsp",uk2:"seq",Apz:"mic",Nr2:"dpa",K1Q:"mlm",UTZ:"dsdtr",e9H:"ntb",kvG:"vsp",Br2:"scn",vE2:"rpe",asG:"dcn",pEG:"dcp",uiz:"pas",TrZ:"drq",d7S:"opf",Kp1:"els",Fp2:"isg",klH:"svq",B$S:"mvp",c5G:"ads",Fm2:"stcp",p8Z:"sads",y8Z:"dloc",cxG:"dcw",jIz:"asw",oYG:"apw",sIG:"wrc",clz:"pcw",dDH:"ipv",IBq:"ndt",qf2:"ctops",H2X:"gsrm"},Roh={O7o:"u",Yf1:"cl",HfS:"k",AG2:"i",GPG:"cr",Zxz:"m",DT5:"g",m6:"up"},CxO={St:"adPlaying",HR:"onAdStateChange"},
Tzq={vr2:"nowPlaying",q8G:"onStateChange",St:"adPlaying",HR:"onAdStateChange",VI:"nowPlayingShorts",hU:"onShortsStateChange"},oiU={VI:"nowPlayingShorts",hU:"onShortsStateChange"};vO.prototype.equals=function(R){return R?this.id==R.id:!1};
var c$q="",Sd=null,HOq=Ca7("loadCastFramework")||Ca7("loadCastApplicationFramework"),uK7=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.Ms(p8,g.G);g.X=p8.prototype;g.X.Mw=function(R){this.J=arguments;this.T=!1;this.q5?this.N=g.J7()+this.uI:this.q5=g.JD(this.W,this.uI)};
g.X.stop=function(){this.q5&&(g.HM.clearTimeout(this.q5),this.q5=null);this.N=null;this.T=!1;this.J=[]};
g.X.pause=function(){++this.U};
g.X.resume=function(){this.U&&(--this.U,!this.U&&this.T&&(this.T=!1,this.Z.apply(null,this.J)))};
g.X.oG=function(){this.stop();p8.Lk.oG.call(this)};
g.X.n_=function(){this.q5&&(g.HM.clearTimeout(this.q5),this.q5=null);this.N?(this.q5=g.JD(this.W,this.N-g.J7()),this.N=null):this.U?this.T=!0:(this.T=!1,this.Z.apply(null,this.J))};var Ak=null;Xh.prototype.set=function(R){this.T=R};
Xh.prototype.reset=function(){this.set(g.J7())};
Xh.prototype.get=function(){return this.T};g.Ms(ge5,mXv);a_.prototype.stringify=function(R){return g.HM.JSON.stringify(R,void 0)};
a_.prototype.parse=function(R){return g.HM.JSON.parse(R,void 0)};g.Ms(OOq,g.v2);g.Ms(IA5,g.v2);var K9q=null;g.Ms(iOr,g.v2);g.Ms(xXD,g.v2);g.Ms(k0z,g.v2);yZ.prototype.debug=function(){};
yZ.prototype.info=function(){};
yZ.prototype.warning=function(){};var Ee7={},Nsv={};g.X=U9.prototype;g.X.setTimeout=function(R){this.h1=R};
g.X.Xx=function(R){R=R.target;var F=this.dX;F&&g.ZB(R)==3?F.lU():this.oW(R)};
g.X.oW=function(R){try{if(R==this.T)a:{var F=g.ZB(this.T),n=this.T.U,V=this.T.getStatus();if(!(F<3)&&(F!=3||this.T&&(this.U.U||g.RF(this.T)||g.Fo(this.T)))){this.Mq||F!=4||n==7||(n==8||V<=0?C8(3):C8(2));bOD(this);var r=this.T.getStatus();this.mQ=r;var v=lAq(this);if(this.Z=r==200){if(this.on&&!this.gX){b:{if(this.T){var f=g.na(this.T,"X-HTTP-Initial-Response");if(f&&!g.Re(f)){var z=f;break b}}z=null}if(R=z)this.gX=!0,fJ7(this,R);else{this.Z=!1;this.W=3;TD(12);HO(this);hk(this);break a}}if(this.PG){R=
!0;for(var q;!this.Mq&&this.X<v.length;)if(q=$Xr(this,v),q==Nsv){F==4&&(this.W=4,TD(14),R=!1);break}else if(q==Ee7){this.W=4;TD(15);R=!1;break}else fJ7(this,q);MCv(this)&&this.X!=0&&(this.U.T=this.U.T.slice(this.X),this.X=0);F!=4||v.length!=0||this.U.U||(this.W=1,TD(16),R=!1);this.Z=this.Z&&R;R?v.length>0&&!this.KC&&(this.KC=!0,this.N.MB(this)):(HO(this),hk(this))}else fJ7(this,v);F==4&&HO(this);this.Z&&!this.Mq&&(F==4?ZOr(this.N,this):(this.Z=!1,jd(this)))}else g.GYN(this.T),r==400&&v.indexOf("Unknown SID")>
0?(this.W=3,TD(12)):(this.W=0,TD(13)),HO(this),hk(this)}}}catch(Q){}finally{}};
g.X.cancel=function(){this.Mq=!0;HO(this)};
g.X.Yf=function(){this.Nq=null;var R=Date.now();R-this.k5>=0?(this.Y5!=2&&(C8(3),TD(17)),HO(this),this.W=2,hk(this)):PaU(this,this.k5-R)};
g.X.getLastError=function(){return this.W};
g.X.Bz=function(){return this.T};zLM.prototype.cancel=function(){this.N=QH5(this);if(this.U)this.U.cancel(),this.U=null;else if(this.T&&this.T.size!==0){for(var R=g.m(this.T.values()),F=R.next();!F.done;F=R.next())F.value.cancel();this.T.clear()}};g.X=L3U.prototype;g.X.jN=8;g.X.L5=1;g.X.connect=function(R,F,n,V){TD(0);this.QZ=R;this.Mq=F||{};n&&V!==void 0&&(this.Mq.OSID=n,this.Mq.OAID=V);this.dX=this.us;this.bS=VwO(this,null,this.QZ);ms(this)};
g.X.disconnect=function(){pUz(this);if(this.L5==3){var R=this.SQ++,F=this.bS.clone();g.sB(F,"SID",this.J);g.sB(F,"RID",R);g.sB(F,"TYPE","terminate");I_(this,F);R=new U9(this,this.J,R);R.Y5=2;R.V=e$(F.clone());F=!1;if(g.HM.navigator&&g.HM.navigator.sendBeacon)try{F=g.HM.navigator.sendBeacon(R.V.toString(),"")}catch(n){}!F&&g.HM.Image&&((new Image).src=R.V,F=!0);F||(R.T=dXO(R.N,null),R.T.send(R.V));R.jQ=Date.now();jd(R)}oLD(this)};
g.X.D7=function(){return this.L5==0};
g.X.getState=function(){return this.L5};
g.X.A4=function(R){if(this.Z)if(this.Z=null,this.L5==1){if(!R){this.SQ=Math.floor(Math.random()*1E5);R=this.SQ++;var F=new U9(this,"",R),n=this.UZ;this.on&&(n?(n=g.Di(n),g.xc(n,this.on)):n=this.on);this.X!==null||this.k5||(F.bS=n,n=null);var V;if(this.aG)a:{for(var r=V=0;r<this.N.length;r++){b:{var v=this.N[r];if("__data__"in v.map&&(v=v.map.__data__,typeof v==="string")){v=v.length;break b}v=void 0}if(v===void 0)break;V+=v;if(V>4096){V=r;break a}if(V===4096||r===this.N.length-1){V=r+1;break a}}V=
this.eB}else V=this.eB;V=aJv(this,F,V);r=this.bS.clone();g.sB(r,"RID",R);g.sB(r,"CVER",22);this.PG&&g.sB(r,"X-HTTP-Session-Id",this.PG);I_(this,r);n&&(this.k5?V="headers="+g.N3(g.wdN(n))+"&"+V:this.X&&g.Am(r,this.X,n));nL7(this.U,F);this.Ru&&g.sB(r,"TYPE","init");this.aG?(g.sB(r,"$req",V),g.sB(r,"SID","null"),F.on=!0,G0z(F,r,null)):G0z(F,r,V);this.L5=2}}else this.L5==3&&(R?Cgq(this,R):this.N.length==0||q3M(this.U)||Cgq(this))};
g.X.sB=function(){this.V=null;TBU(this);if(this.pC&&!(this.h1||this.T==null||this.oC<=0)){var R=4*this.oC;this.lS=o_((0,g.k$)(this.BWz,this),R)}};
g.X.BWz=function(){this.lS&&(this.lS=null,this.dX=!1,this.h1=!0,TD(10),uu(this),TBU(this))};
g.X.MB=function(R){this.T==R&&this.pC&&!this.h1&&(sH5(this),this.h1=!0,TD(11))};
g.X.eL=function(){this.Nq!=null&&(this.Nq=null,uu(this),RLq(this),TD(19))};
g.X.QV2=function(R){R?TD(2):TD(1)};
g.X.isActive=function(){return!!this.W&&this.W.isActive(this)};
g.X=Uq7.prototype;g.X.P2=function(){};
g.X.ws=function(){};
g.X.W2=function(){};
g.X.Qe=function(){};
g.X.isActive=function(){return!0};
g.X.gQ=function(){};g.Ms(Dc,g.TC);Dc.prototype.open=function(){this.T.W=this.N;this.Z&&(this.T.gX=!0);this.T.connect(this.W,this.U||void 0)};
Dc.prototype.close=function(){this.T.disconnect()};
Dc.prototype.send=function(R){var F=this.T;if(typeof R==="string"){var n={};n.__data__=R;R=n}else this.J&&(n={},n.__data__=g.lh(R),R=n);F.N.push(new twO(F.H_++,R));F.L5==3&&ms(F)};
Dc.prototype.oG=function(){this.T.W=null;delete this.N;this.T.disconnect();delete this.T;Dc.Lk.oG.call(this)};
g.Ms(HAq,OOq);g.Ms(hLM,IA5);g.Ms(K8,Uq7);K8.prototype.P2=function(){this.T.dispatchEvent("m")};
K8.prototype.ws=function(R){this.T.dispatchEvent(new HAq(R))};
K8.prototype.W2=function(R){this.T.dispatchEvent(new hLM(R))};
K8.prototype.Qe=function(){this.T.dispatchEvent("n")};
W3M.prototype.commit=function(R){this.T.mQ=R};var xP=new g.TC;g.a(BBq,g.v2);g.X=YP.prototype;g.X.Ya=null;g.X.Fn=!1;g.X.XJ=null;g.X.Wx=null;g.X.wR=null;g.X.cf=null;g.X.Ah=null;g.X.Jc=null;g.X.gy=null;g.X.wG=null;g.X.jH=0;g.X.x$=null;g.X.oS=null;g.X.XL=null;g.X.WF=-1;g.X.rB=!0;g.X.QV=!1;g.X.Qy=0;g.X.NA=null;var DqD={},K37={};g.X=YP.prototype;g.X.setTimeout=function(R){this.U=R};
g.X.IQ=function(R){R=R.target;var F=this.NA;F&&g.ZB(R)==3?F.lU():this.lz(R)};
g.X.lz=function(R){try{if(R==this.wG)a:{var F=g.ZB(this.wG),n=this.wG.U,V=this.wG.getStatus();if(g.WI&&!g.ru("420+")){if(F<4)break a}else if(F<3||F==3&&!g.RF(this.wG))break a;this.QV||F!=4||n==7||(n==8||V<=0?this.T.gY(3):this.T.gY(2));kwv(this);var r=this.wG.getStatus();this.WF=r;var v=g.RF(this.wG);if(this.Fn=r==200){F==4&&Jk(this);if(this.PG){for(R=!0;!this.QV&&this.jH<v.length;){var f=iAv(this,v);if(f==K37){F==4&&(this.XL=4,kP(15),R=!1);break}else if(f==DqD){this.XL=4;kP(16);R=!1;break}else Jtz(this,
f)}F==4&&v.length==0&&(this.XL=1,kP(17),R=!1);this.Fn=this.Fn&&R;R||(Jk(this),Y3D(this))}else Jtz(this,v);this.Fn&&!this.QV&&(F==4?this.T.KO(this):(this.Fn=!1,IJ7(this)))}else r==400&&v.indexOf("Unknown SID")>0?(this.XL=3,kP(13)):(this.XL=0,kP(14)),Jk(this),Y3D(this)}}catch(z){}finally{}};
g.X.cancel=function(){this.QV=!0;Jk(this)};
g.X.C_=function(){this.XJ=null;var R=Date.now();R-this.Wx>=0?(this.cf!=2&&this.T.gY(3),Jk(this),this.XL=2,kP(18),Y3D(this)):xq7(this,this.Wx-R)};
g.X.getLastError=function(){return this.XL};g.X=Mw5.prototype;g.X.FV=null;g.X.gp=null;g.X.Wh=!1;g.X.Bx=null;g.X.b4=null;g.X.g8=-1;g.X.Ac=null;g.X.pY=null;g.X.connect=function(R){this.Bx=R;R=d0(this.T,null,this.Bx);kP(3);Date.now();var F=this.T.UZ;F!=null?(this.Ac=F[0],(this.pY=F[1])?(this.b4=1,lJ$(this)):(this.b4=2,NB5(this))):(R_(R,"MODE","init"),this.gp=new YP(this),this.gp.Ya=this.FV,OAz(this.gp,R,!1,null,!0),this.b4=0)};
g.X.uN=function(R){if(R)this.b4=2,NB5(this);else{kP(4);var F=this.T;F.iG=F.Rg.g8;E9(F,9)}R&&this.gY(2)};
g.X.Px=function(R){return this.T.Px(R)};
g.X.abort=function(){this.gp&&(this.gp.cancel(),this.gp=null);this.g8=-1};
g.X.D7=function(){return!1};
g.X.Fz=function(R,F){this.g8=R.WF;if(this.b4==0)if(F){try{var n=this.U.parse(F)}catch(V){R=this.T;R.iG=this.g8;E9(R,2);return}this.Ac=n[0];this.pY=n[1]}else R=this.T,R.iG=this.g8,E9(R,2);else this.b4==2&&(this.Wh?(kP(7),Date.now()):F=="11111"?(kP(6),this.Wh=!0,Date.now(),this.g8=200,this.gp.cancel(),kP(12),Mo(this.T,this,!0)):(kP(8),Date.now(),this.Wh=!1))};
g.X.KO=function(){this.g8=this.gp.WF;if(this.gp.Fn)this.b4==0?this.pY?(this.b4=1,lJ$(this)):(this.b4=2,NB5(this)):this.b4==2&&(this.Wh?(kP(12),Mo(this.T,this,!0)):(kP(11),Mo(this.T,this,!1)));else{this.b4==0?kP(9):this.b4==2&&kP(10);var R=this.T;this.gp.getLastError();R.iG=this.g8;E9(R,2)}};
g.X.PF=function(){return this.T.PF()};
g.X.isActive=function(){return this.T.isActive()};
g.X.gY=function(R){this.T.gY(R)};g.X=EL5.prototype;g.X.Z8=null;g.X.lc=null;g.X.TP=null;g.X.uo=null;g.X.tC=null;g.X.QP=null;g.X.K8=null;g.X.Zq=null;g.X.Fq=0;g.X.dQ=0;g.X.Ht=null;g.X.KZ=null;g.X.vY=null;g.X.C$=null;g.X.Rg=null;g.X.Y1=null;g.X.Ct=-1;g.X.B2=-1;g.X.iG=-1;g.X.gP=0;g.X.e5=0;g.X.vk=8;var GRD={OK:0,SM2:2,m7G:4,CGH:5,f12:6,STOP:7,qz:8,ssG:9,c82:10,jsG:11,A5S:12};g.Ms(PgU,g.v2);g.Ms(bAD,g.v2);g.X=EL5.prototype;
g.X.connect=function(R,F,n,V,r){kP(0);this.tC=F;this.lc=n||{};V&&r!==void 0&&(this.lc.OSID=V,this.lc.OAID=r);this.V?(iu((0,g.k$)(this.P0,this,R),100),eL5(this)):this.P0(R)};
g.X.disconnect=function(){Rq$(this);if(this.T==3){var R=this.Fq++,F=this.QP.clone();g.sB(F,"SID",this.J);g.sB(F,"RID",R);g.sB(F,"TYPE","terminate");No(this,F);R=new YP(this,this.J,R);R.cf=2;R.Ah=e$(F.clone());(new Image).src=R.Ah.toString();R.wR=Date.now();IJ7(R)}Qkv(this)};
g.X.P0=function(R){this.Rg=new Mw5(this);this.Rg.FV=this.Z8;this.Rg.U=this.W;this.Rg.connect(R)};
g.X.D7=function(){return this.T==0};
g.X.getState=function(){return this.T};
g.X.ZL=function(R){this.KZ=null;viq(this,R)};
g.X.bz=function(){this.vY=null;this.uo=new YP(this,this.J,"rpc",this.X);this.uo.Ya=this.Z8;this.uo.Qy=0;var R=this.K8.clone();g.sB(R,"RID","rpc");g.sB(R,"SID",this.J);g.sB(R,"CI",this.Y1?"0":"1");g.sB(R,"AID",this.Ct);No(this,R);g.sB(R,"TYPE","xmlhttp");OAz(this.uo,R,!0,this.Zq,!1)};
g.X.Fz=function(R,F){if(this.T!=0&&(this.uo==R||this.TP==R))if(this.iG=R.WF,this.TP==R&&this.T==3)if(this.vk>7){try{var n=this.W.parse(F)}catch(V){n=null}if(Array.isArray(n)&&n.length==3)if(R=n,R[0]==0)a:{if(!this.vY){if(this.uo)if(this.uo.wR+3E3<this.TP.wR)lu(this),this.uo.cancel(),this.uo=null;else break a;zqv(this);kP(19)}}else this.B2=R[1],0<this.B2-this.Ct&&R[2]<37500&&this.Y1&&this.e5==0&&!this.C$&&(this.C$=iu((0,g.k$)(this.SL,this),6E3));else E9(this,11)}else F!="y2f%"&&E9(this,11);else if(this.uo==
R&&lu(this),!g.Re(F))for(R=this.W.parse(F),F=0;F<R.length;F++)n=R[F],this.Ct=n[0],n=n[1],this.T==2?n[0]=="c"?(this.J=n[1],this.Zq=n[2],n=n[3],n!=null?this.vk=n:this.vk=6,this.T=3,this.Ht&&this.Ht.n8(),this.K8=d0(this,this.PF()?this.Zq:null,this.tC),f_U(this)):n[0]=="stop"&&E9(this,7):this.T==3&&(n[0]=="stop"?E9(this,7):n[0]!="noop"&&this.Ht&&this.Ht.Mg(n),this.e5=0)};
g.X.SL=function(){this.C$!=null&&(this.C$=null,this.uo.cancel(),this.uo=null,zqv(this),kP(20))};
g.X.KO=function(R){if(this.uo==R){lu(this);this.uo=null;var F=2}else if(this.TP==R)this.TP=null,F=1;else return;this.iG=R.WF;if(this.T!=0)if(R.Fn)if(F==1){F=R.gy?R.gy.length:0;R=Date.now()-R.wR;var n=xP;n.dispatchEvent(new PgU(n,F,R,this.gP));ZA5(this);this.Ht&&this.Ht.Y3(this,this.N);this.N.length=0}else f_U(this);else{n=R.getLastError();var V;if(!(V=n==3||n==7||n==0&&this.iG>0)){if(V=F==1)this.TP||this.KZ||this.T==1||this.gP>=2?V=!1:(this.KZ=iu((0,g.k$)(this.ZL,this,R),tP7(this,this.gP)),this.gP++,
V=!0);V=!(V||F==2&&zqv(this))}if(V)switch(n){case 1:E9(this,5);break;case 4:E9(this,10);break;case 3:E9(this,6);break;case 7:E9(this,12);break;default:E9(this,2)}}};
g.X.DM=function(R){if(!g.Rz(arguments,this.T))throw Error("Unexpected channel state: "+this.T);};
g.X.ADG=function(R){R?kP(2):(kP(1),q2D(this,8))};
g.X.Px=function(R){if(R)throw Error("Can't create secondary domain capable XhrIo object.");R=new g.$v;R.X=!1;return R};
g.X.isActive=function(){return!!this.Ht&&this.Ht.isActive(this)};
g.X.gY=function(R){var F=xP;F.dispatchEvent(new bAD(F,R))};
g.X.PF=function(){return!1};
new ge5;g.X=cjU.prototype;g.X.n8=function(){};
g.X.Mg=function(){};
g.X.Y3=function(){};
g.X.ze=function(){};
g.X.z1=function(){};
g.X.Xz=function(){return{}};
g.X.isActive=function(){return!0};g.X=wC7.prototype;g.X.enqueue=function(R){this.U.push(R)};
g.X.isEmpty=function(){return this.T.length===0&&this.U.length===0};
g.X.clear=function(){this.T=[];this.U=[]};
g.X.contains=function(R){return g.Rz(this.T,R)||g.Rz(this.U,R)};
g.X.remove=function(R){var F=this.T;var n=(0,g.Pce)(F,R);n>=0?(g.n4(F,n),F=!0):F=!1;return F||g.VK(this.U,R)};
g.X.GU=function(){for(var R=[],F=this.T.length-1;F>=0;--F)R.push(this.T[F]);F=this.U.length;for(var n=0;n<F;++n)R.push(this.U[n]);return R};g.a(S2v,g.v2);g.a(LHq,g.v2);g.Ms($P,g.G);g.X=$P.prototype;g.X.y71=function(){this.retryCount++;this.uI=Math.min(3E5,this.uI*2);this.U();this.tH&&this.start()};
g.X.It=function(){return this.retryCount};
g.X.start=function(){var R=this.uI+15E3*Math.random();g.eI(this.T,R);this.tH=Date.now()+R};
g.X.stop=function(){this.T.stop();this.tH=0};
g.X.isActive=function(){return this.T.isActive()};
g.X.reset=function(){this.T.stop();this.retryCount=0;this.uI=5E3};g.Ms(pCv,cjU);g.X=pCv.prototype;g.X.subscribe=function(R,F,n){return this.V.subscribe(R,F,n)};
g.X.unsubscribe=function(R,F,n){return this.V.unsubscribe(R,F,n)};
g.X.V6=function(R){return this.V.V6(R)};
g.X.publish=function(R,F){return this.V.publish.apply(this.V,arguments)};
g.X.dispose=function(){this.UZ||(this.UZ=!0,g.Cv(this.V),this.disconnect(),g.Cv(this.U),this.U=null,this.bS=function(){return""},this.gX=function(){return g.KT({})})};
g.X.Zo=function(){return this.UZ};
g.X.connect=function(R,F,n){var V=this,r,v,f,z;return g.Y(function(q){if(q.T==1)return g.qs(q,2),V.X?g.k(q,V.W,2):q.wX(2);g.wq(q);if(V.UZ||V.T&&V.T.getState()==2&&!V.N)return q.return();V.PG="";V.N||V.U.stop();V.J1=R||null;V.Nq=F||0;r=V.dX+"/test";v=V.dX+"/bind";f=new EL5(n?n.firstTestResults:null,n?n.secondTestResults:null,V.YF);if(z=V.T)z.Ht=null;f.Ht=V;V.T=f;if(V.X)return V.W=UlD(V).then(function(){return a_z(V,r,v,z,n)}),q.return(V.W.then(function(){V.W=g.KT()}));
a_z(V,r,v,z,n);return g.S7(q,0)})};
g.X.disconnect=function(R){try{this.X&&(this.W.cancel(),this.W=g.KT())}finally{this.lS=R||0,this.U&&this.U.stop(),XCh(this),this.T&&(this.T.getState()==3&&viq(this.T),this.T.disconnect()),this.lS=0}};
g.X.sendMessage=function(R,F){var n=this,V;return g.Y(function(r){switch(r.T){case 1:g.qs(r,2);if(!n.X){r.wX(2);break}return g.k(r,n.W,2);case 2:g.wq(r);if(n.UZ)return r.return();V={_sc:R};F&&g.xc(V,F);if(n.U.isActive()||(n.T?n.T.getState():0)==2){n.J.push(V);r.wX(6);break}if(!n.IN()){r.wX(6);break}g.qs(r,8);if(!n.X||yjz(n,R)){r.wX(8);break}return g.k(r,UlD(n),8);case 8:g.wq(r,0,0,1);n.IN()&&(yjz(n,R)||AjO(n),XCh(n),FHv(n.T,V));g.S7(r,6,1);break;case 6:g.S7(r,0)}})};
g.X.n8=function(){this.Z&&this.U&&this.U.It()>0&&(this.Z.C7G(this.U.It(),this.N,!0),this.Z.IEG());this.Z&&this.Z.pOq();this.N?(this.U.stop(),g.Cv(this.U),this.U=new $P(this.IL,this),this.N=!1):this.U.reset();this.J1=null;this.Nq=0;if(this.J.length)if(this.X)H$5(this);else{var R=this.J;this.J=[];var F=R.length;AjO(this);jk5(this,R,F);PO(this)}else PO(this)};
g.X.ze=function(R){var F=R==2&&this.T.iG==401;R==4||F||(this.N&&!this.U.isActive()&&(g.Cv(this.U),this.U=new $P(this.IL,this),this.N=!1),this.U.start());this.publish("handlerError",R,F);F=Object.keys(GRD).find(function(n){return GRD[n]===R});
this.uS.Yq("BROWSER_CHANNEL",F!=null?F:"UNKNOWN")};
g.X.z1=function(R,F){if(!this.U.isActive())this.publish("handlerClosed");else if(F)for(var n=F.length,V=0;V<n;++V){var r=F[V].map;r&&this.J.push(r)}this.SQ.Yq("BROWSER_CHANNEL");R&&this.pC.T.nO("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps",R.length);F&&this.oC.T.nO("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps",F.length)};
g.X.Y3=function(R,F){F!=null&&R!=null&&this.aG.Yq()};
g.X.Xz=function(){var R={v:2};this.PG&&(R.gsessionid=this.PG);this.Nq!=0&&(R.ui=""+this.Nq);this.lS!=0&&(R.ui=""+this.lS);this.J1&&g.xc(R,this.J1);return R};
g.X.Mg=function(R){R[0]=="S"?this.PG=R[1]:R[0]=="gracefulReconnect"?(this.U.start(),this.T.disconnect()):this.publish("handlerMessage",new skv(R[0],R[1]));this.h1.Yq("BROWSER_CHANNEL")};
g.X.IN=function(){return!!this.T&&this.T.getState()==3};
g.X.kO=function(R){(this.jQ.loungeIdToken=R)||this.U.stop();if(this.QZ&&this.T){var F=this.T.Z8||{};R?F["X-YouTube-LoungeId-Token"]=R:delete F["X-YouTube-LoungeId-Token"];this.T.Z8=F}};
g.X.getDeviceId=function(){return this.jQ.id};
g.X.FA=function(){return this.U.isActive()?this.U.tH-Date.now():NaN};
g.X.Lv=function(){var R=this.U;g.Rp(R.T);R.start()};
g.X.IL=function(){this.U.isActive();niq(this.T)==0&&this.connect(this.J1,this.Nq)};bu.prototype.sendRequest=function(R,F,n,V,r,v,f){R={format:v?"RAW":"JSON",method:R,context:this,timeout:5E3,withCredentials:!!f,onSuccess:g.Y$(this.J,V,!v),onError:g.Y$(this.N,r),onTimeout:g.Y$(this.W,r)};n&&(R.postParams=n,R.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.ux(F,R)};
bu.prototype.J=function(R,F,n,V){F?R(V):R({text:n.responseText})};
bu.prototype.N=function(R,F){R(Error("Request error: "+F.status))};
bu.prototype.W=function(R){R(Error("request timed out"))};g.a(ulD,g.TC);g.X=ulD.prototype;g.X.connect=function(R,F,n){this.handler.connect(R,F,n)};
g.X.disconnect=function(R){this.handler.disconnect(R)};
g.X.Lv=function(){this.handler.Lv()};
g.X.getDeviceId=function(){return this.handler.getDeviceId()};
g.X.FA=function(){return this.handler.FA()};
g.X.IN=function(){return this.handler.IN()};
g.X.qw=function(){this.dispatchEvent("channelOpened");var R=this.handler,F=this.T;g.i6("yt-remote-session-browser-channel",{firstTestResults:[""],secondTestResults:!R.T.Y1,sessionId:R.T.J,arrayId:R.T.Ct});g.i6("yt-remote-session-screen-id",F);R=QZ();F=cO();g.Rz(R,F)||R.push(F);Qp7(R);wtv()};
g.X.onClosed=function(){this.dispatchEvent("channelClosed")};
g.X.onMessage=function(R){this.dispatchEvent(new S2v(R))};
g.X.onError=function(R){this.dispatchEvent(new LHq(R?1:0))};
g.X.sendMessage=function(R,F){this.handler.sendMessage(R,F)};
g.X.kO=function(R){this.handler.kO(R)};
g.X.dispose=function(){this.handler.dispose()};g.X=Bz7.prototype;
g.X.connect=function(R,F){R=R===void 0?{}:R;F=F===void 0?0:F;this.Z!==2&&(this.N.stop(),this.V=R,this.X=F,giq(this),(R=g.ew("ID_TOKEN"))?this.J["x-youtube-identity-token"]=R:delete this.J["x-youtube-identity-token"],this.T&&(this.U.device=this.T.device,this.U.name=this.T.name,this.U.app=this.T.app,this.U.id=this.T.id,this.T.qNG&&(this.U.mdxVersion=""+this.T.qNG),this.T.theme&&(this.U.theme=this.T.theme),this.T.capabilities&&(this.U.capabilities=this.T.capabilities),this.T.lx&&(this.U.cst=this.T.lx),
this.T.authuser&&(this.U.authuser=this.T.authuser),this.T.pageId&&(this.U.pageId=this.T.pageId)),this.X!==0?this.U.ui=""+this.X:delete this.U.ui,Object.assign(this.U,this.V),this.channel=new Dc(this.pathPrefix,{GHH:"gsessionid",HC5:this.J,hp2:this.U}),this.channel.open(),this.Z=2,mls(this))};
g.X.disconnect=function(R){this.UZ=R===void 0?0:R;this.N.stop();giq(this);this.channel&&(this.UZ!==0?this.U.ui=""+this.UZ:delete this.U.ui,this.channel.close());this.UZ=0};
g.X.FA=function(){return this.N.isActive()?this.N.tH-Date.now():NaN};
g.X.Lv=function(){var R=this.N;g.Rp(R.T);R.start()};
g.X.sendMessage=function(R,F){this.channel&&(giq(this),R=Object.assign({},{_sc:R},F),this.channel.send(R))};
g.X.kO=function(R){R||this.N.stop();R?this.J["X-YouTube-LoungeId-Token"]=R:delete this.J["X-YouTube-LoungeId-Token"]};
g.X.getDeviceId=function(){return this.T?this.T.id:""};
g.X.publish=function(R){return this.W.publish.apply(this.W,[R].concat(g.I(g.Cq.apply(1,arguments))))};
g.X.subscribe=function(R,F,n){return this.W.subscribe(R,F,n)};
g.X.unsubscribe=function(R,F,n){return this.W.unsubscribe(R,F,n)};
g.X.V6=function(R){return this.W.V6(R)};
g.X.dispose=function(){this.Nq||(this.Nq=!0,g.Cv(this.W),this.disconnect(),g.Cv(this.N),this.jQ=function(){return""})};
g.X.Zo=function(){return this.Nq};g.a(O$s,g.TC);g.X=O$s.prototype;g.X.connect=function(R,F){this.T.connect(R,F)};
g.X.disconnect=function(R){this.T.disconnect(R)};
g.X.Lv=function(){this.T.Lv()};
g.X.getDeviceId=function(){return this.T.getDeviceId()};
g.X.FA=function(){return this.T.FA()};
g.X.IN=function(){return this.T.Z===3};
g.X.rQ=function(){this.dispatchEvent("channelOpened")};
g.X.onClosed=function(){this.dispatchEvent("channelClosed")};
g.X.onMessage=function(R){this.dispatchEvent(new S2v(R))};
g.X.onError=function(){this.dispatchEvent(new LHq(this.T.zt===401?1:0))};
g.X.sendMessage=function(R,F){this.T.sendMessage(R,F)};
g.X.kO=function(R){this.T.kO(R)};
g.X.dispose=function(){this.T.dispose()};var Jj$=Date.now(),ed=null,vZ=Array(50),r4=-1,fX=!1;g.Ms(tl,g.fG);tl.prototype.h8=function(){return this.screens};
tl.prototype.contains=function(R){return!!tC5(this.screens,R)};
tl.prototype.get=function(R){return R?qo(this.screens,R):null};
tl.prototype.info=function(R){nX(this.Z,R)};g.a(l_M,g.fG);g.X=l_M.prototype;g.X.start=function(){!this.T&&isNaN(this.q5)&&this.Uj()};
g.X.stop=function(){this.T&&(this.T.abort(),this.T=null);isNaN(this.q5)||(g.Tg(this.q5),this.q5=NaN)};
g.X.oG=function(){this.stop();g.fG.prototype.oG.call(this)};
g.X.Uj=function(){this.q5=NaN;this.T=g.ux(Zc(this.N,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:this.X},timeout:5E3,onSuccess:(0,g.k$)(this.L_,this),onError:(0,g.k$)(this.Vh,this),onTimeout:(0,g.k$)(this.Hi,this)})};
g.X.L_=function(R,F){this.T=null;R=F.screen||{};R.dialId=this.J;R.name=this.Z;F=-1;this.W&&R.shortLivedLoungeToken&&R.shortLivedLoungeToken.value&&R.shortLivedLoungeToken.refreshIntervalMs&&(R.screenIdType="shortLived",R.loungeToken=R.shortLivedLoungeToken.value,F=R.shortLivedLoungeToken.refreshIntervalMs);this.publish("pairingComplete",new f8(R),F)};
g.X.Vh=function(R){this.T=null;R.status&&R.status==404?this.U>=dxs.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(R=dxs[this.U],this.q5=g.ak((0,g.k$)(this.Uj,this),R),this.U++):this.publish("pairingFailed",Error("Server error "+R.status))};
g.X.Hi=function(){this.T=null;this.publish("pairingFailed",Error("Server not responding"))};
var dxs=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.Ms(qh,tl);g.X=qh.prototype;g.X.start=function(){zU(this)&&this.publish("screenChange");!g.xh("yt-remote-lounge-token-expiration")&&Nzq(this);g.Tg(this.T);this.T=g.ak((0,g.k$)(this.start,this),1E4)};
g.X.add=function(R,F){zU(this);GgO(this,R);QS(this,!1);this.publish("screenChange");F(R);R.token||Nzq(this)};
g.X.remove=function(R,F){var n=zU(this);MPv(this,R)&&(QS(this,!1),n=!0);F(R);n&&this.publish("screenChange")};
g.X.My=function(R,F,n,V){var r=zU(this),v=this.get(R.id);v?(v.name!=F&&(v.name=F,QS(this,!1),r=!0),n(R)):V(Error("no such local screen."));r&&this.publish("screenChange")};
g.X.oG=function(){g.Tg(this.T);qh.Lk.oG.call(this)};
g.X.BXH=function(R){zU(this);var F=this.screens.length;R=R&&R.screens||[];for(var n=R.length,V=0;V<n;++V){var r=R[V],v=this.get(r.screenId);v&&(v.token=r.loungeToken,--F)}QS(this,!F);F&&nX(this.Z,"Missed "+F+" lounge tokens.")};
g.X.K2Q=function(R){nX(this.Z,"Requesting lounge tokens failed: "+R)};g.a($lz,g.fG);g.X=$lz.prototype;g.X.start=function(){var R=parseInt(g.xh("yt-remote-fast-check-period")||"0",10);(this.J=g.J7()-144E5<R?0:R)?cZ(this):(this.J=g.J7()+3E5,g.i6("yt-remote-fast-check-period",this.J),this.Tc())};
g.X.isEmpty=function(){return g.g7(this.T)};
g.X.update=function(){EiM("Updating availability on schedule.");var R=this.Z(),F=g.oz(this.T,function(n,V){return n&&!!qo(R,V)},this);
Z$7(this,F)};
g.X.oG=function(){g.Tg(this.N);this.N=NaN;this.U&&(this.U.abort(),this.U=null);g.fG.prototype.oG.call(this)};
g.X.Tc=function(){g.Tg(this.N);this.N=NaN;this.U&&this.U.abort();var R=eqr(this);if(D1q(R)){var F=Zc(this.W,"/pairing/get_screen_availability");this.U=this.W.sendRequest("POST",F,{lounge_token:g.Ho(R).join(",")},(0,g.k$)(this.qY2,this,R),(0,g.k$)(this.SYZ,this))}else Z$7(this,{}),cZ(this)};
g.X.qY2=function(R,F){this.U=null;var n=g.Ho(eqr(this));if(g.Xu(n,g.Ho(R))){F=F.screens||[];n={};for(var V=F.length,r=0;r<V;++r)n[R[F[r].loungeToken]]=F[r].status=="online";Z$7(this,n);cZ(this)}else this.Uw("Changing Screen set during request."),this.Tc()};
g.X.SYZ=function(R){this.Uw("Screen availability failed: "+R);this.U=null;cZ(this)};
g.X.Uw=function(R){nX("OnlineScreenService",R)};g.Ms(w4,tl);g.X=w4.prototype;g.X.start=function(){this.U.start();this.T.start();this.screens.length&&(this.publish("screenChange"),this.T.isEmpty()||this.publish("onlineScreenChange"))};
g.X.add=function(R,F,n){this.U.add(R,F,n)};
g.X.remove=function(R,F,n){this.U.remove(R,F,n);this.T.update()};
g.X.My=function(R,F,n,V){this.U.contains(R)?this.U.My(R,F,n,V):(R="Updating name of unknown screen: "+R.name,nX(this.Z,R),V(Error(R)))};
g.X.h8=function(R){return R?this.screens:g.vo(this.screens,g.dk(this.N,function(F){return!this.contains(F)},this))};
g.X.eN=function(){return g.dk(this.h8(!0),function(R){return!!this.T.T[R.id]},this)};
g.X.gs=function(R,F,n,V,r,v){var f=this;this.info("getDialScreenByPairingCode "+R+" / "+F);var z=new l_M(this.J,R,F,n,V);z.subscribe("pairingComplete",function(q,Q){g.Cv(z);r(SY(f,q),Q)});
z.subscribe("pairingFailed",function(q){g.Cv(z);v(q)});
z.start();return(0,g.k$)(z.stop,z)};
g.X.h9=function(R,F,n,V){g.ux(Zc(this.J,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:R},timeout:5E3,onSuccess:(0,g.k$)(function(r,v){r=new f8(v.screen||{});if(!r.name||V3z(this,r.name)){a:{v=r.name;for(var f=2,z=F(v,f);V3z(this,z);){f++;if(f>20)break a;z=F(v,f)}v=z}r.name=v}n(SY(this,r))},this),
onError:(0,g.k$)(function(r){V(Error("pairing request failed: "+r.status))},this),
onTimeout:(0,g.k$)(function(){V(Error("pairing request timed out."))},this)})};
g.X.oG=function(){g.Cv(this.U);g.Cv(this.T);w4.Lk.oG.call(this)};
g.X.XGQ=function(){vhv(this);this.publish("screenChange");this.T.update()};
w4.prototype.dispose=w4.prototype.dispose;g.Ms(LX,g.fG);g.X=LX.prototype;g.X.C6=function(R){this.Zo()||(R&&(pX(this,""+R),this.publish("sessionFailed")),this.T=null,this.publish("sessionScreen",null))};
g.X.info=function(R){nX(this.PG,R)};
g.X.v2=function(){return null};
g.X.X4=function(R){var F=this.U;R?(F.displayStatus=new chrome.cast.ReceiverDisplayStatus(R,[]),F.displayStatus.showStop=!0):F.displayStatus=null;chrome.cast.setReceiverDisplayStatus(F,(0,g.k$)(function(){this.info("Updated receiver status for "+F.friendlyName+": "+R)},this),(0,g.k$)(function(){pX(this,"Failed to update receiver status for: "+F.friendlyName)},this))};
g.X.oG=function(){this.X4("");LX.Lk.oG.call(this)};g.a(X2,LX);g.X=X2.prototype;g.X.nV=function(R){if(this.N){if(this.N==R)return;pX(this,"Overriding cast session with new session object");XcO(this);this.jQ=!1;this.UZ="unknown";this.N.removeUpdateListener(this.J1);this.N.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.lS)}this.N=R;this.N.addUpdateListener(this.J1);this.N.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.lS);wcD(this,"getMdxSessionStatus")};
g.X.FR=function(R){this.info("launchWithParams no-op for Cast: "+g.lh(R))};
g.X.stop=function(){this.N?this.N.stop((0,g.k$)(function(){this.C6()},this),(0,g.k$)(function(){this.C6(Error("Failed to stop receiver app."))},this)):this.C6(Error("Stopping cast device without session."))};
g.X.X4=function(){};
g.X.oG=function(){this.info("disposeInternal");XcO(this);this.N&&(this.N.removeUpdateListener(this.J1),this.N.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.lS));this.N=null;LX.prototype.oG.call(this)};
g.X.Po2=function(R,F){if(!this.Zo())if(F)if(F=Fh(F),g.ID(F))switch(R=""+F.type,F=F.data||{},this.info("onYoutubeMessage_: "+R+" "+g.lh(F)),R){case "mdxSessionStatus":qwq(this,F);break;case "loungeToken":Sw5(this,F);break;default:pX(this,"Unknown youtube message: "+R)}else pX(this,"Unable to parse message.");else pX(this,"No data in message.")};
g.X.Dk=function(R,F,n,V){g.Tg(this.V);this.V=0;nh7(this.J,this.U.label,R,this.U.friendlyName,(0,g.k$)(function(r){r?F(r):V>=0?(pX(this,"Screen "+R+" appears to be offline. "+V+" retries left."),this.V=g.ak((0,g.k$)(this.Dk,this,R,F,n,V-1),300)):n(Error("Unable to fetch screen."))},this),n)};
g.X.v2=function(){return this.N};
g.X.RQ=function(R){this.Zo()||R||(pX(this,"Cast session died."),this.C6())};g.a(Al,LX);g.X=Al.prototype;g.X.nV=function(R){this.N=R;this.N.addUpdateListener(this.Mq)};
g.X.FR=function(R){this.bS=R;this.Nq()};
g.X.stop=function(){jxh(this);this.N?this.N.stop((0,g.k$)(this.C6,this,null),(0,g.k$)(this.C6,this,"Failed to stop DIAL device.")):this.C6()};
g.X.oG=function(){jxh(this);this.N&&this.N.removeUpdateListener(this.Mq);this.N=null;LX.prototype.oG.call(this)};
g.X.GK=function(R){this.Zo()||R||(pX(this,"DIAL session died."),this.W(),this.W=function(){},this.C6())};g.a(TU,LX);TU.prototype.stop=function(){this.C6()};
TU.prototype.nV=function(){};
TU.prototype.FR=function(){g.Tg(this.N);this.N=NaN;var R=qo(this.J.h8(),this.U.label);R?sN(this,R):this.C6(Error("No such screen"))};
TU.prototype.oG=function(){g.Tg(this.N);this.N=NaN;LX.prototype.oG.call(this)};g.a(oj,g.fG);g.X=oj.prototype;
g.X.init=function(R,F){chrome.cast.timeout.requestSession=3E4;var n=new chrome.cast.SessionRequest(this.V,[chrome.cast.Capability.AUDIO_OUT]);g.U2("desktop_enable_cast_connect")&&(n.androidReceiverCompatible=!0);this.UZ||(n.dialRequest=new chrome.cast.DialRequest("YouTube"));var V=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;R=R||this.Z?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var r=(0,g.k$)(this.FgH,this);n=new chrome.cast.ApiConfig(n,(0,g.k$)(this.Y4,
this),r,V,R);n.customDialLaunchCallback=(0,g.k$)(this.d5Z,this);chrome.cast.initialize(n,(0,g.k$)(function(){this.Zo()||(chrome.cast.addReceiverActionListener(this.W),xlO(),this.U.subscribe("onlineScreenChange",(0,g.k$)(this.C8,this)),this.N=Wlq(this),chrome.cast.setCustomReceivers(this.N,function(){},(0,g.k$)(function(v){this.Uw("Failed to set initial custom receivers: "+g.lh(v))},this)),this.publish("yt-remote-cast2-availability-change",UN(this)),F(!0))},this),(0,g.k$)(function(v){this.Uw("Failed to initialize API: "+
g.lh(v));
F(!1)},this))};
g.X.vc2=function(R,F){yS("Setting connected screen ID: "+R+" -> "+F);if(this.T){var n=this.T.T;if(!R||n&&n.id!=R)yS("Unsetting old screen status: "+this.T.U.friendlyName),jY(this,null)}if(R&&F){if(!this.T){R=qo(this.U.h8(),R);if(!R){yS("setConnectedScreenStatus: Unknown screen.");return}if(R.idType=="shortLived"){yS("setConnectedScreenStatus: Screen with id type to be short lived.");return}n=Hwv(this,R);n||(yS("setConnectedScreenStatus: Connected receiver not custom..."),n=new chrome.cast.Receiver(R.uuid?
R.uuid:R.id,R.name),n.receiverType=chrome.cast.ReceiverType.CUSTOM,this.N.push(n),chrome.cast.setCustomReceivers(this.N,function(){},(0,g.k$)(function(V){this.Uw("Failed to set initial custom receivers: "+g.lh(V))},this)));
yS("setConnectedScreenStatus: new active receiver: "+n.friendlyName);jY(this,new TU(this.U,n),!0)}this.T.X4(F)}else yS("setConnectedScreenStatus: no screen.")};
g.X.dcH=function(R){this.Zo()?this.Uw("Setting connection data on disposed cast v2"):this.T?this.T.FR(R):this.Uw("Setting connection data without a session")};
g.X.xf=function(){this.Zo()?this.Uw("Stopping session on disposed cast v2"):this.T?(this.T.stop(),jY(this,null)):yS("Stopping non-existing session")};
g.X.requestSession=function(){chrome.cast.requestSession((0,g.k$)(this.Y4,this),(0,g.k$)(this.VJq,this))};
g.X.oG=function(){this.U.unsubscribe("onlineScreenChange",(0,g.k$)(this.C8,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.W);var R=KHh,F=g.WM("yt.mdx.remote.debug.handlers_");g.VK(F||[],R);g.Cv(this.T);g.fG.prototype.oG.call(this)};
g.X.Uw=function(R){nX("Controller",R)};
g.X.eR=function(R,F){this.T==R&&(F||jY(this,null),this.publish("yt-remote-cast2-session-change",F))};
g.X.w_G=function(R,F){if(!this.Zo())if(R)switch(R.friendlyName=chrome.cast.unescape(R.friendlyName),yS("onReceiverAction_ "+R.label+" / "+R.friendlyName+"-- "+F),F){case chrome.cast.ReceiverAction.CAST:if(this.T)if(this.T.U.label!=R.label)yS("onReceiverAction_: Stopping active receiver: "+this.T.U.friendlyName),this.T.stop();else{yS("onReceiverAction_: Casting to active receiver.");this.T.T&&this.publish("yt-remote-cast2-session-change",this.T.T);break}switch(R.receiverType){case chrome.cast.ReceiverType.CUSTOM:jY(this,
new TU(this.U,R));break;case chrome.cast.ReceiverType.DIAL:jY(this,new Al(this.U,R,this.J,this.config_));break;case chrome.cast.ReceiverType.CAST:jY(this,new X2(this.U,R,this.config_));break;default:this.Uw("Unknown receiver type: "+R.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.T&&this.T.U.label==R.label?this.T.stop():this.Uw("Stopping receiver w/o session: "+R.friendlyName)}else this.Uw("onReceiverAction_ called without receiver.")};
g.X.d5Z=function(R){if(this.Zo())return Promise.reject(Error("disposed"));var F=R.receiver;F.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.Uw("Not DIAL receiver: "+F.friendlyName),F.receiverType=chrome.cast.ReceiverType.DIAL);var n=this.T?this.T.U:null;if(!n||n.label!=F.label)return this.Uw("Receiving DIAL launch request for non-clicked DIAL receiver: "+F.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(n&&n.label==F.label&&n.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.T.T)return yS("Reselecting dial screen."),
this.publish("yt-remote-cast2-session-change",this.T.T),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.Uw('Changing CAST intent from "'+n.receiverType+'" to "dial" for '+F.friendlyName);jY(this,new Al(this.U,F,this.J,this.config_))}F=this.T;F.V=R;F.V.appState==chrome.cast.DialAppState.RUNNING?(R=F.V.extraData||{},n=R.screenId||null,aj(F)&&R.loungeToken?R.loungeTokenRefreshIntervalMs?R=ohv(F,{name:F.U.friendlyName,screenId:R.screenId,loungeToken:R.loungeToken,dialId:F.V.receiver.label,
screenIdType:"shortLived"},R.loungeTokenRefreshIntervalMs):(g.n$(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(R)+".")),R=yLr(F,n)):R=yLr(F,n)):R=C67(F);return R};
g.X.Y4=function(R){var F=this;if(!this.Zo()&&!this.Z){yS("New cast session ID: "+R.sessionId);var n=R.receiver;if(n.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.T)if(n.receiverType==chrome.cast.ReceiverType.CAST)yS("Got resumed cast session before resumed mdx connection."),n.friendlyName=chrome.cast.unescape(n.friendlyName),jY(this,new X2(this.U,n,this.config_),!0);else{this.Uw("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var V=this.T.U,r=qo(this.U.h8(),
V.label);r&&tk(r,n.label)&&V.receiverType!=chrome.cast.ReceiverType.CAST&&n.receiverType==chrome.cast.ReceiverType.CAST&&(yS("onSessionEstablished_: manual to cast session change "+n.friendlyName),g.Cv(this.T),this.T=new X2(this.U,n,this.config_),this.T.subscribe("sessionScreen",(0,g.k$)(this.eR,this,this.T)),this.T.subscribe("sessionFailed",function(){return hXv(F,F.T)}),this.T.FR(null));
this.T.nV(R)}}};
g.X.ub=function(){return this.T?this.T.v2():null};
g.X.VJq=function(R){this.Zo()||(this.Uw("Failed to estabilish a session: "+g.lh(R)),R.code!=chrome.cast.ErrorCode.CANCEL&&jY(this,null),this.publish("yt-remote-cast2-session-failed"))};
g.X.FgH=function(R){yS("Receiver availability updated: "+R);if(!this.Zo()){var F=UN(this);this.X=R==chrome.cast.ReceiverAvailability.AVAILABLE;UN(this)!=F&&this.publish("yt-remote-cast2-availability-change",UN(this))}};
g.X.C8=function(){this.Zo()||(this.N=Wlq(this),yS("Updating custom receivers: "+g.lh(this.N)),chrome.cast.setCustomReceivers(this.N,function(){},(0,g.k$)(function(){this.Uw("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",UN(this)))};
oj.prototype.setLaunchParams=oj.prototype.dcH;oj.prototype.setConnectedScreenStatus=oj.prototype.vc2;oj.prototype.stopSession=oj.prototype.xf;oj.prototype.getCastSession=oj.prototype.ub;oj.prototype.requestSession=oj.prototype.requestSession;oj.prototype.init=oj.prototype.init;oj.prototype.dispose=oj.prototype.dispose;var Mav=g.ER(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),x8z=[],Kl7=g.Xr(Mav);g.X=g4.prototype;
g.X.reset=function(R){this.listId="";this.index=-1;this.videoId="";M3U(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.hasPrevious=R.hasPrevious,this.hasNext=R.hasNext,this.Z=R.playerTime,this.W=R.playerTimeAt,this.U=R.seekableStart,this.X=R.seekableEnd,this.N=R.duration,this.loadedTime=R.loadedTime,this.T=R.liveIngestionTime,
this.J=!isNaN(this.T))};
g.X.isPlaying=function(){return this.playerState==1};
g.X.isBuffering=function(){return this.playerState==3};
g.X.sU=function(R){this.N=isNaN(R)?0:R};
g.X.getDuration=function(){return this.J?this.N+ON(this):this.N};
g.X.clone=function(){return new g4(Nf7(this))};g.a(xX,g.fG);g.X=xX.prototype;g.X.getState=function(){return this.N};
g.X.FA=function(){return this.J.getReconnectTimeout()};
g.X.Lv=function(){this.J.reconnect()};
g.X.play=function(){YX(this)?(this.T?this.T.play(null,g.$W,Mh(this,"play")):d4(this,"play"),P6h(this,1,KX(kX(this))),this.publish("remotePlayerChange")):Jl(this,this.play)};
g.X.pause=function(){YX(this)?(this.T?this.T.pause(null,g.$W,Mh(this,"pause")):d4(this,"pause"),P6h(this,2,KX(kX(this))),this.publish("remotePlayerChange")):Jl(this,this.pause)};
g.X.seekTo=function(R){if(YX(this)){if(this.T){var F=kX(this),n=new chrome.cast.media.SeekRequest;n.currentTime=R;F.isPlaying()||F.isBuffering()?n.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:n.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.T.seek(n,g.$W,Mh(this,"seekTo",{newTime:R}))}else d4(this,"seekTo",{newTime:R});P6h(this,3,R);this.publish("remotePlayerChange")}else Jl(this,g.Y$(this.seekTo,R))};
g.X.stop=function(){if(YX(this)){this.T?this.T.stop(null,g.$W,Mh(this,"stopVideo")):d4(this,"stopVideo");var R=kX(this);R.index=-1;R.videoId="";M3U(R);GU(this,R);this.publish("remotePlayerChange")}else Jl(this,this.stop)};
g.X.setVolume=function(R,F){if(YX(this)){var n=kX(this);if(this.U){if(n.volume!=R){var V=Math.round(R)/100;this.U.setReceiverVolumeLevel(V,(0,g.k$)(function(){VS("set receiver volume: "+V)},this),(0,g.k$)(function(){this.Uw("failed to set receiver volume.")},this))}n.muted!=F&&this.U.setReceiverMuted(F,(0,g.k$)(function(){VS("set receiver muted: "+F)},this),(0,g.k$)(function(){this.Uw("failed to set receiver muted.")},this))}else{var r={volume:R,
muted:F};n.volume!=-1&&(r.delta=R-n.volume);d4(this,"setVolume",r)}n.muted=F;n.volume=R;GU(this,n)}else Jl(this,g.Y$(this.setVolume,R,F))};
g.X.IW=function(R,F){if(YX(this)){var n=kX(this);R={videoId:R};F&&(n.trackData={trackName:F.name,languageCode:F.languageCode,sourceLanguageCode:F.translationLanguage?F.translationLanguage.languageCode:"",languageName:F.languageName,kind:F.kind},R.style=g.lh(F.style),g.xc(R,n.trackData));d4(this,"setSubtitlesTrack",R);GU(this,n)}else Jl(this,g.Y$(this.IW,R,F))};
g.X.setAudioTrack=function(R,F){YX(this)?(F=F.getLanguageInfo().getId(),d4(this,"setAudioTrack",{videoId:R,audioTrackId:F}),R=kX(this),R.audioTrackId=F,GU(this,R)):Jl(this,g.Y$(this.setAudioTrack,R,F))};
g.X.playVideo=function(R,F,n,V,r,v,f){V=V===void 0?null:V;r=r===void 0?null:r;v=v===void 0?null:v;f=f===void 0?null:f;var z=kX(this),q={videoId:R};n!==void 0&&(q.currentIndex=n);Dp(z,R,n||0);F!==void 0&&(Ij(z,F),q.currentTime=F);V&&(q.listId=V);r&&(q.playerParams=r);v&&(q.clickTrackingParams=v);f&&(q.locationInfo=g.lh(f));d4(this,"setPlaylist",q);V||GU(this,z)};
g.X.Tz=function(R,F){if(YX(this)){if(R&&F){var n=kX(this);Dp(n,R,F);GU(this,n)}d4(this,"previous")}else Jl(this,g.Y$(this.Tz,R,F))};
g.X.nextVideo=function(R,F){if(YX(this)){if(R&&F){var n=kX(this);Dp(n,R,F);GU(this,n)}d4(this,"next")}else Jl(this,g.Y$(this.nextVideo,R,F))};
g.X.IE=function(){if(YX(this)){d4(this,"clearPlaylist");var R=kX(this);R.reset();GU(this,R);this.publish("remotePlayerChange")}else Jl(this,this.IE)};
g.X.Ic=function(){YX(this)?d4(this,"dismissAutoplay"):Jl(this,this.Ic)};
g.X.dispose=function(){if(this.N!=3){var R=this.N;this.N=3;this.publish("proxyStateChange",R,this.N)}g.fG.prototype.dispose.call(this)};
g.X.oG=function(){$8U(this);this.J=null;this.W.clear();ic(this,null);g.fG.prototype.oG.call(this)};
g.X.CV=function(R){if((R!=this.N||R==2)&&this.N!=3&&R!=0){var F=this.N;this.N=R;this.publish("proxyStateChange",F,R);if(R==1)for(;!this.W.isEmpty();)F=R=this.W,F.T.length===0&&(F.T=F.U,F.T.reverse(),F.U=[]),R.T.pop().apply(this);else R==3&&this.dispose()}};
g.X.A7S=function(R,F){this.publish(R,F)};
g.X.zeS=function(R){if(!R)this.eb(null),ic(this,null);else if(this.U.receiver.volume){R=this.U.receiver.volume;var F=kX(this),n=Math.round(100*R.level||0);if(F.volume!=n||F.muted!=R.muted)VS("Cast volume update: "+R.level+(R.muted?" muted":"")),F.volume=n,F.muted=!!R.muted,GU(this,F)}};
g.X.eb=function(R){VS("Cast media: "+!!R);this.T&&this.T.removeUpdateListener(this.V);if(this.T=R)this.T.addUpdateListener(this.V),bwD(this),this.publish("remotePlayerChange")};
g.X.tBX=function(R){R?(bwD(this),this.publish("remotePlayerChange")):this.eb(null)};
g.X.jG=function(){d4(this,"sendDebugCommand",{debugCommand:"stats4nerds "})};
g.X.YnG=function(){var R=JLv();R&&ic(this,R)};
g.X.Uw=function(R){nX("CP",R)};g.a(EN,g.fG);g.X=EN.prototype;
g.X.connect=function(R,F){if(F){var n=F.listId,V=F.videoId,r=F.videoIds,v=F.playerParams,f=F.clickTrackingParams,z=F.index,q={videoId:V},Q=F.currentTime,c=F.locationInfo;F=F.loopMode;Q!==void 0&&(q.currentTime=Q<=5?0:Q);v&&(q.playerParams=v);c&&(q.locationInfo=c);f&&(q.clickTrackingParams=f);n&&(q.listId=n);r&&r.length>0&&(q.videoIds=r.join(","));z!==void 0&&(q.currentIndex=z);this.Mq&&(q.loopMode=F||"LOOP_MODE_OFF");n&&(this.T.listId=n);this.T.videoId=V;this.T.index=z||0;this.T.state=3;Ij(this.T,
Q);this.W="UNSUPPORTED";n=this.Mq?"setInitialState":"setPlaylist";lc("Connecting with "+n+" and params: "+g.lh(q));this.U.connect({method:n,params:g.lh(q)},R,SAr())}else lc("Connecting without params"),this.U.connect({},R,SAr());F2M(this)};
g.X.kO=function(R){this.U.kO(R)};
g.X.dispose=function(){this.Zo()||(g.h7("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),Nh(this,3));g.fG.prototype.dispose.call(this)};
g.X.oG=function(){nsv(this);r1q(this);VaU(this);g.Tg(this.V);this.V=NaN;g.Tg(this.UZ);this.UZ=NaN;this.J=null;g.u6(this.Nq);this.Nq.length=0;this.U.dispose();g.fG.prototype.oG.call(this);this.W=this.X=this.N=this.T=this.U=null};
g.X.eX=function(R){if(!this.N||this.N.length===0)return!1;for(var F=g.m(this.N),n=F.next();!n.done;n=F.next())if(!n.value.capabilities.has(R))return!1;return!0};
g.X.O7=function(){var R=3;this.Zo()||(R=0,isNaN(this.wF())?this.U.IN()&&isNaN(this.Z)&&(R=1):R=2);return R};
g.X.QX=function(R){lc("Disconnecting with "+R);g.h7("yt.mdx.remote.remoteClient_",null);nsv(this);this.publish("beforeDisconnect",R);R==1&&w0();this.U.disconnect(R);this.dispose()};
g.X.Ha=function(){var R=this.T;this.J&&(R=this.T.clone(),Dp(R,this.J,R.index));return Nf7(R)};
g.X.rO2=function(R){var F=this,n=new g4(R);n.videoId&&n.videoId!=this.T.videoId&&(this.J=n.videoId,g.Tg(this.V),this.V=g.ak(function(){if(F.J){var r=F.J;F.J=null;F.T.videoId!=r&&$X(F,"getNowPlaying")}},5E3));
var V=[];this.T.listId==n.listId&&this.T.videoId==n.videoId&&this.T.index==n.index||V.push("remoteQueueChange");this.T.playerState==n.playerState&&this.T.volume==n.volume&&this.T.muted==n.muted&&KX(this.T)==KX(n)&&g.lh(this.T.trackData)==g.lh(n.trackData)||V.push("remotePlayerChange");this.T.reset(R);g.az(V,function(r){this.publish(r)},this)};
g.X.Xe=function(){var R=this.U.getDeviceId(),F=g.$$(this.N,function(n){return n.type=="REMOTE_CONTROL"&&n.id!=R});
return F?F.id:""};
g.X.wF=function(){return this.U.FA()};
g.X.Mh=function(){return this.W||"UNSUPPORTED"};
g.X.nP=function(){return this.X||""};
g.X.f_=function(){!isNaN(this.wF())&&this.U.Lv()};
g.X.Yqz=function(R,F){$X(this,R,F);fY5(this)};
g.X.DL=function(){var R=g.Yi("SAPISID","")||g.Yi("__Secure-1PAPISID")||"",F=g.Yi("__Secure-3PAPISID","")||"";if(!R&&!F)return"";R=g.dQ(g.Gl(R),2);F=g.dQ(g.Gl(F),2);return g.dQ(g.Gl(","+R+","+F),2)};
EN.prototype.subscribe=EN.prototype.subscribe;EN.prototype.unsubscribeByKey=EN.prototype.V6;EN.prototype.getProxyState=EN.prototype.O7;EN.prototype.disconnect=EN.prototype.QX;EN.prototype.getPlayerContextData=EN.prototype.Ha;EN.prototype.setPlayerContextData=EN.prototype.rO2;EN.prototype.getOtherConnectedRemoteId=EN.prototype.Xe;EN.prototype.getReconnectTimeout=EN.prototype.wF;EN.prototype.getAutoplayMode=EN.prototype.Mh;EN.prototype.getAutoplayVideoId=EN.prototype.nP;EN.prototype.reconnect=EN.prototype.f_;
EN.prototype.sendMessage=EN.prototype.Yqz;EN.prototype.getXsrfToken=EN.prototype.DL;EN.prototype.isCapabilitySupportedOnConnectedDevices=EN.prototype.eX;g.a(A1r,tl);g.X=A1r.prototype;g.X.h8=function(R){return this.Nc.$_gs(R)};
g.X.contains=function(R){return!!this.Nc.$_c(R)};
g.X.get=function(R){return this.Nc.$_g(R)};
g.X.start=function(){this.Nc.$_st()};
g.X.add=function(R,F,n){this.Nc.$_a(R,F,n)};
g.X.remove=function(R,F,n){this.Nc.$_r(R,F,n)};
g.X.My=function(R,F,n,V){this.Nc.$_un(R,F,n,V)};
g.X.oG=function(){for(var R=this.T.length,F=0;F<R;++F)this.Nc.$_ubk(this.T[F]);this.T.length=0;this.Nc=null;tl.prototype.oG.call(this)};
g.X.Oh=function(){this.publish("screenChange")};
g.X.FvS=function(){this.publish("onlineScreenChange")};
w4.prototype.$_st=w4.prototype.start;w4.prototype.$_gspc=w4.prototype.h9;w4.prototype.$_gsppc=w4.prototype.gs;w4.prototype.$_c=w4.prototype.contains;w4.prototype.$_g=w4.prototype.get;w4.prototype.$_a=w4.prototype.add;w4.prototype.$_un=w4.prototype.My;w4.prototype.$_r=w4.prototype.remove;w4.prototype.$_gs=w4.prototype.h8;w4.prototype.$_gos=w4.prototype.eN;w4.prototype.$_s=w4.prototype.subscribe;w4.prototype.$_ubk=w4.prototype.V6;var f1=null,qK=!1,PZ=null,bc=null,u_q=null,Ft=[];g.a(IY7,g.G);g.X=IY7.prototype;g.X.oG=function(){g.G.prototype.oG.call(this);this.U.stop();this.N.stop();this.V.stop();var R=this.EN;R.unsubscribe("proxyStateChange",this.zG,this);R.unsubscribe("remotePlayerChange",this.dM,this);R.unsubscribe("remoteQueueChange",this.Xf,this);R.unsubscribe("previousNextChange",this.FT,this);R.unsubscribe("nowAutoplaying",this.s$,this);R.unsubscribe("autoplayDismissed",this.uM,this);this.EN=this.T=null};
g.X.xC=function(R){var F=g.Cq.apply(1,arguments);if(this.EN.N!=2)if(Q6(this)){if(kX(this.EN).playerState!=1081||R!=="control_seek")switch(R){case "control_toggle_play_pause":kX(this.EN).isPlaying()?this.EN.pause():this.EN.play();break;case "control_play":this.EN.play();break;case "control_pause":this.EN.pause();break;case "control_seek":this.X.lU(F[0],F[1]);break;case "control_subtitles_set_track":Dxh(this,F[0]);break;case "control_set_audio_track":this.setAudioTrack(F[0])}}else switch(R){case "control_toggle_play_pause":case "control_play":case "control_pause":F=
this.K.getCurrentTime();cr(this,F===0?void 0:F);break;case "control_seek":cr(this,F[0]);break;case "control_subtitles_set_track":Dxh(this,F[0]);break;case "control_set_audio_track":this.setAudioTrack(F[0])}};
g.X.bXH=function(R){this.V.Mw(R)};
g.X.rDG=function(R){this.xC("control_subtitles_set_track",g.g7(R)?null:R)};
g.X.Y$=function(){var R=this.K.getOption("captions","track");g.g7(R)||Dxh(this,R)};
g.X.M5=function(R){this.T.M5(R,this.K.getVideoData().lengthSeconds)};
g.X.U8G=function(){g.g7(this.J)||i3M(this,this.J);this.W=!1};
g.X.zG=function(R,F){this.N.stop();F===2&&this.wd()};
g.X.dM=function(){if(Q6(this)){this.U.stop();var R=kX(this.EN);switch(R.playerState){case 1080:case 1081:case 1084:case 1085:this.T.m8=1;break;case 1082:case 1083:this.T.m8=0;break;default:this.T.m8=-1}switch(R.playerState){case 1081:case 1:this.md(new g.Wz(8));this.Wg();break;case 1085:case 3:this.md(new g.Wz(9));break;case 1083:case 0:this.md(new g.Wz(2));this.X.stop();this.M5(this.K.getVideoData().lengthSeconds);break;case 1084:this.md(new g.Wz(4));break;case 2:this.md(new g.Wz(4));this.M5(KX(R));
break;case -1:this.md(new g.Wz(64));break;case -1E3:this.md(new g.Wz(128,{errorCode:"mdx.remoteerror",errorMessage:"This video is not available for remote playback.",mP:2}))}R=kX(this.EN).trackData;var F=this.J;(R||F?R&&F&&R.trackName==F.trackName&&R.languageCode==F.languageCode&&R.languageName==F.languageName&&R.kind==F.kind:1)||(this.J=R,i3M(this,R));R=kX(this.EN);R.volume===-1||Math.round(this.K.getVolume())===R.volume&&this.K.isMuted()===R.muted||this.UZ.isActive()||this.PJ()}else K27(this)};
g.X.FT=function(){this.K.publish("mdxpreviousnextchange")};
g.X.Xf=function(){Q6(this)||K27(this)};
g.X.s$=function(R){isNaN(R)||this.K.publish("mdxnowautoplaying",R)};
g.X.uM=function(){this.K.publish("mdxautoplaycanceled")};
g.X.setAudioTrack=function(R){Q6(this)&&this.EN.setAudioTrack(wP(this).videoId,R)};
g.X.seekTo=function(R,F){kX(this.EN).playerState===-1?cr(this,R):F&&this.EN.seekTo(R)};
g.X.PJ=function(){var R=this;if(Q6(this)){var F=kX(this.EN);this.events.ZO(this.Nq);F.muted?this.K.mute():this.K.unMute();this.K.setVolume(F.volume);this.Nq=this.events.C(this.K,"onVolumeChange",function(n){gsh(R,n)})}};
g.X.Wg=function(){this.U.stop();if(!this.EN.Zo()){var R=kX(this.EN);R.isPlaying()&&this.md(new g.Wz(8));this.M5(KX(R));this.U.start()}};
g.X.wd=function(){this.N.stop();this.U.stop();var R=this.EN.FA();this.EN.N==2&&!isNaN(R)&&this.N.start()};
g.X.md=function(R){this.N.stop();var F=this.Z;if(!g.Ii(F,R)){var n=g.E(R,2);n!==g.E(this.Z,2)&&this.K.Ft(n);this.Z=R;Ygz(this.T,F,R)}};g.a(xxz,g.iP);g.X=xxz.prototype;g.X.getCurrentTime=function(){return this.T.getCurrentTime()};
g.X.getDuration=function(){return this.T.getDuration()};
g.X.wD=function(){return this.T.wD()};
g.X.LW=function(){return this.T.LW()};
g.X.Uf=function(){return this.T.Uf()};
g.X.AQ=function(){return this.T.AQ()};
g.X.getPlayerState=function(){return this.T.Ll};
g.X.isAtLiveHead=function(){return this.T.isAtLiveHead()};
g.X.pauseVideo=function(){this.T.jo("control_pause")};
g.X.playVideo=function(){var R=this;return g.Y(function(F){R.T.jo("control_play");return F.return()})};
g.X.seekTo=function(R,F){this.T.jo("control_seek",R,!(F==null?0:F.VH))};
g.X.QY=function(R){this.T.jo("control_set_audio_track",R);return!0};g.a(Sn,g.N);Sn.prototype.rW=function(){this.fade.show()};
Sn.prototype.nC=function(){this.fade.hide()};
Sn.prototype.T=function(){L8("mdx-privacy-popup-cancel");this.nC()};
Sn.prototype.U=function(){L8("mdx-privacy-popup-confirm");this.nC()};g.a(L1,g.N);L1.prototype.onStateChange=function(R){this.nX(R.state)};
L1.prototype.nX=function(R){if(this.api.getPresentingPlayerType()===3){var F={RECEIVER_NAME:this.api.getOption("remote","currentReceiver").name};R=g.E(R,128)?g.fy("Error on $RECEIVER_NAME",F):R.isPlaying()||R.isPaused()?g.fy("Playing on $RECEIVER_NAME",F):g.fy("Connected to $RECEIVER_NAME",F);this.updateValue("statustext",R);this.fade.show()}else this.fade.hide()};g.a(sU,g.j6);sU.prototype.U=function(){var R=this.K.getOption("remote","receivers");R&&R.length>1&&!this.K.getOption("remote","quickCast")?(this.z2=g.C4(R,this.T,this),this.n2(g.OM(R,this.T)),R=this.K.getOption("remote","currentReceiver"),R=this.T(R),this.options[R]&&this.hO(R),this.enable(!0)):this.enable(!1)};
sU.prototype.T=function(R){return R.key};
sU.prototype.lq=function(R){return R==="cast-selector-receiver"?"Cast...":this.z2[R].name};
sU.prototype.xS=function(R){g.j6.prototype.xS.call(this,R);this.K.setOption("remote","currentReceiver",this.z2[R]);this.T9.nC()};g.a(kRh,g.Lz);g.X=kRh.prototype;
g.X.create=function(){var R=this.player.D(),F=g.n9(R);R={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:R.B("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:R.B("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:R.B("enable_cast_short_lived_lounge_token")};y15(F,R);this.subscriptions.push(g.Fm("yt-remote-before-disconnect",this.Kd5,this));this.subscriptions.push(g.Fm("yt-remote-connection-change",this.KgS,this));this.subscriptions.push(g.Fm("yt-remote-receiver-availability-change",this.Z6,
this));this.subscriptions.push(g.Fm("yt-remote-auto-connect",this.lj2,this));this.subscriptions.push(g.Fm("yt-remote-receiver-resumed",this.PXZ,this));this.subscriptions.push(g.Fm("mdx-privacy-popup-confirm",this.Gtq,this));this.subscriptions.push(g.Fm("mdx-privacy-popup-cancel",this.RLH,this));this.Z6()};
g.X.load=function(){this.player.cancelPlayback();g.Lz.prototype.load.call(this);this.c6=new xxz(this.player.D(),this);this.player.Gq(this.c6);this.gr=new IY7(this,this.player,this.EN);var R=(R=mxz())?R.currentTime:0;var F=W2v()?new xX(vr(),void 0):null;R==0&&F&&(R=KX(kX(F)));R!==0&&this.M5(R);Ygz(this,this.Ll,this.Ll);this.player.sJ(6)};
g.X.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.bd();this.xI=this.rT;g.TW(this.gr,this.EN);this.EN=this.c6=this.gr=null;g.Lz.prototype.unload.call(this);this.player.sJ(5);p1(this)};
g.X.oG=function(){g.nr(this.subscriptions);g.Lz.prototype.oG.call(this)};
g.X.jo=function(R){var F=g.Cq.apply(1,arguments);this.loaded&&this.gr.xC.apply(this.gr,[R].concat(g.I(F)))};
g.X.getAdState=function(){return this.m8};
g.X.hasPrevious=function(){return this.EN?kX(this.EN).hasPrevious:!1};
g.X.hasNext=function(){return this.EN?kX(this.EN).hasNext:!1};
g.X.M5=function(R,F){this.Rd=R||0;this.player.publish("progresssync",R,F);this.player.yZ("onVideoProgress",R||0)};
g.X.getCurrentTime=function(){return this.Rd};
g.X.getDuration=function(){return kX(this.EN).getDuration()||0};
g.X.wD=function(){var R=kX(this.EN);return R.J?R.T+ON(R):R.T};
g.X.LW=function(){return kX(this.EN).loadedTime};
g.X.Uf=function(){return lgv(kX(this.EN))};
g.X.AQ=function(){var R=kX(this.EN);return R.U>0?R.U+ON(R):R.U};
g.X.getProgressState=function(){var R=kX(this.EN),F=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:R.playerState!=1081&&this.player.dV(),clipEnd:F.clipEnd,clipStart:F.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.wD(),isAtLiveHead:this.isAtLiveHead(),loaded:this.LW(),seekableEnd:this.Uf(),seekableStart:this.AQ(),offset:0,viewerLivestreamJoinMediaTime:0}};
g.X.isAtLiveHead=function(){return lgv(kX(this.EN))-this.getCurrentTime()<=1};
g.X.nextVideo=function(){this.EN&&this.EN.nextVideo()};
g.X.Tz=function(){this.EN&&this.EN.Tz()};
g.X.Kd5=function(R){R===1&&(this.MQ=this.EN?kX(this.EN):null)};
g.X.KgS=function(){var R=W2v()?new xX(vr(),void 0):null;if(R){var F=this.xI;this.loaded&&this.unload();this.EN=R;this.MQ=null;F.key!==this.rT.key&&(this.xI=F,this.load())}else g.Cv(this.EN),this.EN=null,this.loaded&&(this.unload(),(R=this.MQ)&&R.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(R.videoId,KX(R)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)};
g.X.Z6=function(){var R=[this.rT],F=R.concat,n=Uxz();uc()&&g.xh("yt-remote-cast-available")&&n.push({key:"cast-selector-receiver",name:"Cast..."});this.z2=F.call(R,n);R=H3D()||this.rT;Xt(this,R);this.player.yZ("onMdxReceiversChange")};
g.X.lj2=function(){var R=H3D();Xt(this,R)};
g.X.PXZ=function(){this.xI=H3D()};
g.X.Gtq=function(){this.ph=!0;p1(this);qK=!1;f1&&zq(f1,1);f1=null};
g.X.RLH=function(){this.ph=!1;p1(this);Xt(this,this.rT);this.xI=this.rT;qK=!1;f1=null;this.player.playVideo()};
g.X.xc=function(R,F){switch(R){case "casting":return this.loaded;case "receivers":return this.z2;case "currentReceiver":return F&&(F.key==="cast-selector-receiver"?GQv():Xt(this,F)),this.loaded?this.xI:this.rT;case "quickCast":return this.z2.length===2&&this.z2[1].key==="cast-selector-receiver"?(F&&GQv(),!0):!1}};
g.X.jG=function(){this.EN.jG()};
g.X.yu=function(){return!1};
g.X.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};
g.X.isLoggedIn=function(){var R,F;return((R=g.ew("PLAYER_CONFIG"))==null?void 0:(F=R.args)==null?void 0:F.authuser)!==void 0?!0:!(!g.ew("SESSION_INDEX")&&!g.ew("LOGGED_IN"))};g.Sk("remote",kRh);})(_yt_player);
