(function(g){var window=this;'use strict';var Oh=function(D){g.vP(D,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.xw()).toString(36));return D},hC=function(D,O,h){Array.isArray(h)||(h=[String(h)]); g.i2k(D.W,O,h)},zax=function(D){if(D instanceof g.qw)return D; if(typeof D.WS=="function")return D.WS(!1);if(g.r2(D)){var O=0,h=new g.qw;h.next=function(){for(;;){if(O>=D.length)return g.qc;if(O in D)return g.ut(D[O++]);O++}}; return h}throw Error("Not implemented");},nFv=function(D,O,h){if(g.r2(D))g.Je(D,O,h); else for(D=zax(D);;){var V=D.next();if(V.done)break;O.call(h,V.value,void 0,D)}},Fy8=function(D,O){var h=[]; nFv(O,function(V){try{var k=g.Tc.prototype.K.call(this,V,!0)}catch(C){if(C=="Storage: Invalid value was encountered")return;throw C;}k===void 0?h.push(V):g.ITT(k)&&h.push(V)},D); return h},yX0=function(D,O){Fy8(D,O).forEach(function(h){g.Tc.prototype.remove.call(this,h)},D)},idR=function(D){if(D.Ew){if(D.Ew.locationOverrideToken)return{locationOverrideToken:D.Ew.locationOverrideToken}; if(D.Ew.latitudeE7!=null&&D.Ew.longitudeE7!=null)return{latitudeE7:D.Ew.latitudeE7,longitudeE7:D.Ew.longitudeE7}}return null},rXL=function(D,O){g.BJ(D,O)||D.push(O)},pk8=function(D){var O=0,h; for(h in D)O++;return O},NCR=function(D,O){return g.QJ(D,O)},oFJ=function(D){try{return g.zR.JSON.parse(D)}catch(O){}D=String(D); if(/^\s*$/.test(D)?0:/^[\],:{}\s\u2028\u2029]*$/.test(D.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("("+D+")")}catch(O){}throw Error("Invalid JSON string: "+D);},Vk=function(D){if(g.zR.JSON)try{return g.zR.JSON.parse(D)}catch(O){}return oFJ(D)},ZdU=function(D){if(D.yY&&typeof D.yY=="function")return D.yY(); if(typeof Map!=="undefined"&&D instanceof Map||typeof Set!=="undefined"&&D instanceof Set)return Array.from(D.values());if(typeof D==="string")return D.split("");if(g.r2(D)){for(var O=[],h=D.length,V=0;V<h;V++)O.push(D[V]);return O}return g.G_(D)},Xke=function(D){if(D.Li&&typeof D.Li=="function")return D.Li(); if(!D.yY||typeof D.yY!="function"){if(typeof Map!=="undefined"&&D instanceof Map)return Array.from(D.keys());if(!(typeof Set!=="undefined"&&D instanceof Set)){if(g.r2(D)||typeof D==="string"){var O=[];D=D.length;for(var h=0;h<D;h++)O.push(h);return O}return g.tp(D)}}},BCm=function(D,O){if(D.forEach&&typeof D.forEach=="function")D.forEach(O,void 0); else if(g.r2(D)||typeof D==="string")Array.prototype.forEach.call(D,O,void 0);else for(var h=Xke(D),V=ZdU(D),k=V.length,C=0;C<k;C++)O.call(void 0,V[C],h&&h[C],D)},lD_=function(D,O,h,V){var k=new g.fn(null); D&&g.Kn(k,D);O&&g.EF(k,O);h&&g.jJ(k,h);V&&(k.K=V);return k},xZc=function(){var D=kK(); this.K=D;D.Jm("/client_streamz/youtube/living_room/mdx/channel/opened",g.HJ("channel_type"))},$Z0=function(){var D=kK(); this.K=D;D.Jm("/client_streamz/youtube/living_room/mdx/channel/closed",g.HJ("channel_type"))},ID8=function(){var D=kK(); this.K=D;D.Jm("/client_streamz/youtube/living_room/mdx/channel/message_received",g.HJ("channel_type"))},DUx=function(){var D=kK(); this.K=D;D.Jm("/client_streamz/youtube/living_room/mdx/channel/error",g.HJ("channel_type"))},O0x=function(){var D=kK(); this.K=D;D.Jm("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},h4c=function(){var D=kK(); this.K=D;D.Jm("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},Vt9=function(D,O){return new g.bY(D,O)},CU=function(D,O){return Object.prototype.hasOwnProperty.call(D,O)},k6S=function(D,O){return D===O},M6=function(D,O){this.K={}; this.D=[];this.v5=this.size=0;var h=arguments.length;if(h>1){if(h%2)throw Error("Uneven number of arguments");for(var V=0;V<h;V+=2)this.set(arguments[V],arguments[V+1])}else if(D)if(D instanceof M6)for(h=D.Li(),V=0;V<h.length;V++)this.set(h[V],D.get(h[V]));else for(V in D)this.set(V,D[V])},bV=function(D){if(D.size!=D.D.length){for(var O=0,h=0;O<D.D.length;){var V=D.D[O]; CU(D.K,V)&&(D.D[h++]=V);O++}D.D.length=h}if(D.size!=D.D.length){O={};for(V=h=0;h<D.D.length;){var k=D.D[h];CU(O,k)||(D.D[V++]=k,O[k]=1);h++}D.D.length=V}},ca=function(D){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 M6;this.model=this.brand="";this.year=0;this.chipset=this.osVersion=this.os="";this.mdxDialServerType="MDX_DIAL_SERVER_TYPE_UNKNOWN";D&&(this.id=D.id||D.name,this.name=D.name,this.clientName=D.clientName?D.clientName.toUpperCase():"UNKNOWN_INTERFACE", this.app=D.app,this.type=D.type||"REMOTE_CONTROL",this.username=D.user||"",this.avatar=D.userAvatarUri||"",this.obfuscatedGaiaId=D.obfuscatedGaiaId||"",this.ownerObfuscatedGaiaId=D.ownerObfuscatedGaiaId||"",this.theme=D.theme||"u",C5U(this,D.capabilities||""),Mtm(this,D.compatibleSenderThemes||""),b0_(this,D.experiments||""),this.brand=D.brand||"",this.model=D.model||"",this.year=D.year||0,this.os=D.os||"",this.osVersion=D.osVersion||"",this.chipset=D.chipset||"",this.mdxDialServerType=D.mdxDialServerType|| "MDX_DIAL_SERVER_TYPE_UNKNOWN",D=D.deviceInfo)&&(D=JSON.parse(D),this.brand=D.brand||"",this.model=D.model||"",this.year=D.year||0,this.os=D.os||"",this.osVersion=D.osVersion||"",this.chipset=D.chipset||"",this.clientName=D.clientName?D.clientName.toUpperCase():"UNKNOWN_INTERFACE",this.mdxDialServerType=D.mdxDialServerType||"MDX_DIAL_SERVER_TYPE_UNKNOWN")},C5U=function(D,O){D.capabilities.clear(); g.LS(O.split(","),g.Bq(NCR,c2R)).forEach(function(h){D.capabilities.add(h)})},Mtm=function(D,O){D.compatibleSenderThemes.clear(); g.LS(O.split(","),g.Bq(NCR,SdU)).forEach(function(h){D.compatibleSenderThemes.add(h)})},b0_=function(D,O){D.experiments.clear(); O.split(",").forEach(function(h){D.experiments.add(h)})},SV=function(D){D=D||{}; this.name=D.name||"";this.id=D.id||D.screenId||"";this.token=D.token||D.loungeToken||"";this.uuid=D.uuid||D.dialId||"";this.idType=D.screenIdType||"normal"},YK=function(D,O){return!!O&&(D.id==O||D.uuid==O)},YdS=function(D){return{name:D.name, screenId:D.id,loungeToken:D.token,dialId:D.uuid,screenIdType:D.idType}},J2S=function(D){return new SV(D)},qdL=function(D){return Array.isArray(D)?g.WS(D,J2S):[]},JC=function(D){return D?'{name:"'+D.name+'",id:'+D.id.substr(0,6)+"..,token:"+((D.token?".."+D.token.slice(-6):"-")+",uuid:"+(D.uuid?".."+D.uuid.slice(-6):"-")+",idType:"+D.idType+"}"):"null"},ueL=function(D){return Array.isArray(D)?"["+g.WS(D,JC).join(",")+"]":"null"},H0x=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(D){var O=Math.random()*16|0; return(D=="x"?O:O&3|8).toString(16)})},mUS=function(D){return g.WS(D,function(O){return{key:O.id, name:O.name}})},e4S=function(D,O){return g.Zm(D,function(h){return h||O?!h!=!O?!1:h.id==O.id:!0})},q6=function(D,O){return g.Zm(D,function(h){return YK(h,O)})},LAJ=function(){var D=(0,g.zF)(); D&&yX0(D,D.D.WS(!0))},uV=function(){var D=g.yu("yt-remote-connected-devices")||[]; g.c6(D);return D},P5_=function(D){if(D.length==0)return[]; var O=D[0].indexOf("#"),h=O==-1?D[0]:D[0].substring(0,O);return g.WS(D,function(V,k){return k==0?V:V.substring(h.length)})},gjm=function(D){g.F4("yt-remote-connected-devices",D,86400)},Ha=function(){if(R49)return R49; var D=g.yu("yt-remote-device-id");D||(D=H0x(),g.F4("yt-remote-device-id",D,31536E3));for(var O=uV(),h=1,V=D;g.BJ(O,V);)h++,V=D+"#"+h;return R49=V},a_c=function(){var D=uV(),O=Ha(); g.r6()&&g.YO(D,O);D=P5_(D);if(D.length==0)try{g.pc("remote_sid")}catch(h){}else try{g.iw("remote_sid",D.join(","),-1)}catch(h){}},f__=function(){return g.yu("yt-remote-session-browser-channel")},KA9=function(){return g.yu("yt-remote-local-screens")||[]},EjJ=function(){g.F4("yt-remote-lounge-token-expiration",!0,86400)},jVm=function(D){D.length>5&&(D=D.slice(D.length-5)); var O=g.WS(KA9(),function(V){return V.loungeToken}),h=g.WS(D,function(V){return V.loungeToken}); g.Tp(h,function(V){return!g.BJ(O,V)})&&EjJ(); g.F4("yt-remote-local-screens",D,31536E3)},mj=function(D){D||(g.i0("yt-remote-session-screen-id"),g.i0("yt-remote-session-video-id")); a_c();D=uV();g.xC(D,Ha());gjm(D)},UUe=function(){if(!eV){var D=g.iY(); D&&(eV=new g.wC(D))}},A2U=function(){UUe(); return eV?!!eV.get("yt-remote-use-staging-server"):!1},LU=function(D,O){g.H9[D]=!0; var h=g.q7();h&&h.publish.apply(h,arguments);g.H9[D]=!1},G6C=function(){},kK=function(){if(!Pa){Pa=new g.w7(new G6C); var D=g.AO("client_streamz_web_flush_count",-1);D!==-1&&(Pa.j=D)}return Pa},ttS=function(){var D=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return D?parseInt(D[1],10):0},vjS=function(D){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+D)!=-1||document.currentScript.src.indexOf("&"+D)!=-1)},QV8=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},gp=function(D){D.length?wfC(D.shift(),function(){gp(D)}):sVJ()},WAe=function(D){return"chrome-extension://"+D+"/cast_sender.js"},wfC=function(D,O,h){var V=document.createElement("script"); V.onerror=O;h&&(V.onload=h);g.lO(V,g.t2(D));(document.head||document.documentElement).appendChild(V)},TB_=function(){var D=ttS(),O=[]; if(D>1){var h=D-1;O.push("//www.gstatic.com/eureka/clank/"+D+"/cast_sender.js");O.push("//www.gstatic.com/eureka/clank/"+h+"/cast_sender.js")}return O},sVJ=function(){var D=QV8(); D&&D(!1,"No cast extension found")},z4S=function(){if(dUU){var D=2,O=QV8(),h=function(){D--; D==0&&O&&O(!0)}; window.__onGCastApiAvailable=h;wfC("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",sVJ,h)}},njm=function(){z4S(); var D=TB_();D.push("//www.gstatic.com/eureka/clank/cast_sender.js");gp(D)},y2e=function(){z4S(); var D=TB_();D.push.apply(D,g.a(FAS.map(WAe)));D.push("//www.gstatic.com/eureka/clank/cast_sender.js");gp(D)},Rt=function(D,O,h){g.n.call(this); this.Z=h!=null?(0,g.Xk)(D,h):D;this.EU=O;this.J=(0,g.Xk)(this.YO,this);this.D=!1;this.K=0;this.j=this.YZ=null;this.W=[]},at=function(D,O,h){g.n.call(this); this.W=h!=null?D.bind(h):D;this.EU=O;this.j=null;this.D=!1;this.K=0;this.YZ=null},i0e=function(D){D.YZ=g.vg(function(){D.YZ=null; D.D&&!D.K&&(D.D=!1,i0e(D))},D.EU); var O=D.j;D.j=null;D.W.apply(null,O)},fU=function(){},r2_=function(){g.rj.call(this,"p")},pfL=function(){g.rj.call(this,"o")},ojS=function(){return NB8=NB8||new g.M4},Z0S=function(D){g.rj.call(this,"serverreachability",D)},KU=function(D){var O=ojS(); O.dispatchEvent(new Z0S(O,D))},Xfv=function(D){g.rj.call(this,"statevent",D)},Eh=function(D){var O=ojS(); O.dispatchEvent(new Xfv(O,D))},BBR=function(D,O,h,V){g.rj.call(this,"timingevent",D); this.size=O;this.rtt=h;this.retries=V},jV=function(D,O){if(typeof D!=="function")throw Error("Fn must not be null and must be a function"); return g.zR.setTimeout(function(){D()},O)},Uh=function(){},AC=function(D,O,h,V){this.j=D; this.W=O;this.Y5=h;this.RT=V||1;this.Uw=new g.T$(this);this.oW=45E3;this.ST=null;this.Z=!1;this.U=this.Ax=this.T=this.LF=this.lS=this.m5=this.Ew=null;this.jT=[];this.D=null;this.L=0;this.J=this.qE=null;this.yy=-1;this.ME=!1;this.T2=0;this.Vi=null;this.C1=this.G2=this.f1=this.X1=!1;this.K=new l_J},l_J=function(){this.j=null; this.D="";this.K=!1},$U0=function(D,O,h){D.LF=1; D.T=Oh(O.clone());D.U=h;D.X1=!0;xUc(D,null)},xUc=function(D,O){D.lS=Date.now(); Gt(D);D.Ax=D.T.clone();hC(D.Ax,"t",D.RT);D.L=0;var h=D.j.LF;D.K=new l_J;D.D=I_S(D.j,h?O:null,!D.U);D.T2>0&&(D.Vi=new at((0,g.Xk)(D.nL,D,D.D),D.T2));D.Uw.listen(D.D,"readystatechange",D.xO);O=D.ST?g.dZ(D.ST):{};D.U?(D.qE||(D.qE="POST"),O["Content-Type"]="application/x-www-form-urlencoded",D.D.send(D.Ax,D.qE,D.U,O)):(D.qE="GET",D.D.send(D.Ax,D.qE,null,O));KU(1)},Oce=function(D){if(!DB9(D))return g.M8(D.D); var O=g.bQ(D.D);if(O==="")return"";var h="",V=O.length,k=g.kZ(D.D)==4;if(!D.K.j){if(typeof TextDecoder==="undefined")return tC(D),va(D),"";D.K.j=new g.zR.TextDecoder}for(var C=0;C<V;C++)D.K.K=!0,h+=D.K.j.decode(O[C],{stream:!(k&&C==V-1)});O.length=0;D.K.D+=h;D.L=0;return D.K.D},DB9=function(D){return D.D?D.qE=="GET"&&D.LF!=2&&D.j.ze:!1},k7U=function(D,O){var h=D.L,V=O.indexOf("\n",h); if(V==-1)return hhe;h=Number(O.substring(h,V));if(isNaN(h))return VW_;V+=1;if(V+h>O.length)return hhe;O=O.slice(V,V+h);D.L=V+h;return O},Gt=function(D){D.m5=Date.now()+D.oW; CwR(D,D.oW)},CwR=function(D,O){if(D.Ew!=null)throw Error("WatchDog timer not null"); D.Ew=jV((0,g.Xk)(D.bM,D),O)},MWS=function(D){D.Ew&&(g.zR.clearTimeout(D.Ew),D.Ew=null)},va=function(D){D.j.rH()||D.ME||bcv(D.j,D)},tC=function(D){MWS(D); g.SR(D.Vi);D.Vi=null;D.Uw.removeAll();if(D.D){var O=D.D;D.D=null;O.abort();O.dispose()}},mBe=function(D,O){try{var h=D.j; if(h.rZ!=0&&(h.D==D||cOS(h.K,D)))if(!D.G2&&cOS(h.K,D)&&h.rZ==3){try{var V=h.QJ.D.parse(O)}catch(R){V=null}if(Array.isArray(V)&&V.length==3){var k=V;if(k[0]==0)a:{if(!h.T){if(h.D)if(h.D.lS+3E3<D.lS)Qk(h),wp(h);else break a;SP0(h);Eh(18)}}else h.PF=k[1],0<h.PF-h.Vi&&k[2]<37500&&h.G2&&h.jT==0&&!h.Ew&&(h.Ew=jV((0,g.Xk)(h.GT,h),6E3));if(YP0(h.K)<=1&&h.Kp){try{h.Kp()}catch(R){}h.Kp=void 0}}else sh(h,11)}else if((D.G2||h.D==D)&&Qk(h),!g.fR(O))for(k=h.QJ.D.parse(O),O=0;O<k.length;O++){var C=k[O];h.Vi=C[0]; C=C[1];if(h.rZ==2)if(C[0]=="c"){h.W=C[1];h.RT=C[2];var M=C[3];M!=null&&(h.U1=M);var c=C[5];c!=null&&typeof c==="number"&&c>0&&(h.T2=1.5*c);V=h;var S=D.Mt();if(S){var Y=g.cl(S,"X-Client-Wire-Protocol");if(Y){var J=V.K;!J.D&&(g.KR(Y,"spdy")||g.KR(Y,"quic")||g.KR(Y,"h2"))&&(J.W=J.J,J.D=new Set,J.K&&(JOS(J,J.K),J.K=null))}if(V.X1){var q=g.cl(S,"X-HTTP-Session-Id");q&&(V.DJ=q,g.vP(V.ST,V.X1,q))}}h.rZ=3;h.J&&h.J.IY();h.F2&&(h.ea=Date.now()-D.lS);V=h;var u=D;V.qR=qP9(V,V.LF?V.RT:null,V.Y5);if(u.G2){uOC(V.K, u);var H=u,m=V.T2;m&&H.setTimeout(m);H.Ew&&(MWS(H),Gt(H));V.D=u}else HcR(V);h.j.length>0&&Wa(h)}else C[0]!="stop"&&C[0]!="close"||sh(h,7);else h.rZ==3&&(C[0]=="stop"||C[0]=="close"?C[0]=="stop"?sh(h,7):h.disconnect():C[0]!="noop"&&h.J&&h.J.j$(C),h.jT=0)}KU(4)}catch(R){}},eh9=function(D,O){this.D=D; this.map=O;this.context=null},LMS=function(D){this.J=D||10; g.zR.PerformanceNavigationTiming?(D=g.zR.performance.getEntriesByType("navigation"),D=D.length>0&&(D[0].nextHopProtocol=="hq"||D[0].nextHopProtocol=="h2")):D=!!(g.zR.chrome&&g.zR.chrome.loadTimes&&g.zR.chrome.loadTimes()&&g.zR.chrome.loadTimes().wasFetchedViaSpdy);this.W=D?this.J:1;this.D=null;this.W>1&&(this.D=new Set);this.K=null;this.j=[]},Pw_=function(D){return D.K?!0:D.D?D.D.size>=D.W:!1},YP0=function(D){return D.K?1:D.D?D.D.size:0},cOS=function(D,O){return D.K?D.K==O:D.D?D.D.has(O):!1},JOS= function(D,O){D.D?D.D.add(O):D.K=O},uOC=function(D,O){D.K&&D.K==O?D.K=null:D.D&&D.D.has(O)&&D.D.delete(O)},gsv=function(D){if(D.K!=null)return D.j.concat(D.K.jT); if(D.D!=null&&D.D.size!==0){var O=D.j;D=g.P(D.D.values());for(var h=D.next();!h.done;h=D.next())O=O.concat(h.value.jT);return O}return g.Dv(D.j)},Rh0=function(D,O){var h=new Uh; if(g.zR.Image){var V=new Image;V.onload=g.Bq(Tt,h,"TestLoadImage: loaded",!0,O,V);V.onerror=g.Bq(Tt,h,"TestLoadImage: error",!1,O,V);V.onabort=g.Bq(Tt,h,"TestLoadImage: abort",!1,O,V);V.ontimeout=g.Bq(Tt,h,"TestLoadImage: timeout",!1,O,V);g.zR.setTimeout(function(){if(V.ontimeout)V.ontimeout()},1E4); V.src=D}else O(!1)},aES=function(D,O){var h=new Uh,V=new AbortController,k=setTimeout(function(){V.abort(); Tt(h,"TestPingServer: timeout",!1,O)},1E4); fetch(D,{signal:V.signal}).then(function(C){clearTimeout(k);C.ok?Tt(h,"TestPingServer: ok",!0,O):Tt(h,"TestPingServer: server error",!1,O)}).catch(function(){clearTimeout(k); Tt(h,"TestPingServer: error",!1,O)})},Tt=function(D,O,h,V,k){try{k&&(k.onload=null,k.onerror=null,k.onabort=null,k.ontimeout=null),V(h)}catch(C){}},fEv=function(){this.D=new fU},KMS=function(D,O,h){var V=h||""; try{BCm(D,function(k,C){var M=k;g.pT(k)&&(M=g.d7(k));O.push(V+C+"="+encodeURIComponent(M))})}catch(k){throw O.push(V+"type="+encodeURIComponent("_badmap")),k; }},dp=function(D,O,h){return h&&h.X35?h.X35[D]||O:O},EsJ=function(D){this.j=[]; this.RT=this.qR=this.ST=this.Y5=this.D=this.DJ=this.X1=this.ME=this.L=this.yy=this.U=null;this.bD=this.Ax=0;this.gU=dp("failFast",!1,D);this.G2=this.Ew=this.T=this.Z=this.J=null;this.oT=!0;this.PF=this.Vi=-1;this.C1=this.jT=this.lS=0;this.Mr=dp("baseRetryDelayMs",5E3,D);this.xG=dp("retryDelaySeedMs",1E4,D);this.dU=dp("forwardChannelMaxRetries",2,D);this.iT=dp("forwardChannelRequestTimeoutMs",2E4,D);this.BF=D&&D.XR5||void 0;this.t_=D&&D.lla||void 0;this.ze=D&&D.vur||!1;this.T2=void 0;this.LF=D&&D.r_i|| !1;this.W="";this.K=new LMS(D&&D.EKW);this.QJ=new fEv;this.Uw=D&&D.so2||!1;this.m5=D&&D.vK2||!1;this.Uw&&this.m5&&(this.m5=!1);this.I0=D&&D.rXW||!1;D&&D.dsi&&(this.oT=!1);this.F2=!this.Uw&&this.oT&&D&&D.uBx||!1;this.yH=void 0;D&&D.kT&&D.kT>0&&(this.yH=D.kT);this.Kp=void 0;this.ea=0;this.oW=!1;this.f1=this.qE=null},wp=function(D){D.D&&(j2J(D),D.D.cancel(),D.D=null)},UBe=function(D){wp(D); D.T&&(g.zR.clearTimeout(D.T),D.T=null);Qk(D);D.K.cancel();D.Z&&(typeof D.Z==="number"&&g.zR.clearTimeout(D.Z),D.Z=null)},Wa=function(D){Pw_(D.K)||D.Z||(D.Z=!0,g.ef(D.K7,D),D.lS=0)},G7R=function(D,O){if(YP0(D.K)>=D.K.W-(D.Z?1:0))return!1; if(D.Z)return D.j=O.jT.concat(D.j),!0;if(D.rZ==1||D.rZ==2||D.lS>=(D.gU?0:D.dU))return!1;D.Z=jV((0,g.Xk)(D.K7,D,O),AO0(D,D.lS));D.lS++;return!0},vsc=function(D,O){var h; O?h=O.Y5:h=D.Ax++;var V=D.ST.clone();g.vP(V,"SID",D.W);g.vP(V,"RID",h);g.vP(V,"AID",D.Vi);zt(D,V);D.L&&D.U&&g.WP(V,D.L,D.U);h=new AC(D,D.W,h,D.lS+1);D.L===null&&(h.ST=D.U);O&&(D.j=O.jT.concat(D.j));O=tWS(D,h,1E3);h.setTimeout(Math.round(D.iT*.5)+Math.round(D.iT*.5*Math.random()));JOS(D.K,h);$U0(h,V,O)},zt=function(D,O){D.ME&&g.K2(D.ME,function(h,V){g.vP(O,V,h)}); D.J&&BCm({},function(h,V){g.vP(O,V,h)})},tWS=function(D,O,h){h=Math.min(D.j.length,h); var V=D.J?(0,g.Xk)(D.J.Vg,D.J,D):null;a:{for(var k=D.j,C=-1;;){var M=["count="+h];C==-1?h>0?(C=k[0].D,M.push("ofs="+C)):C=0:M.push("ofs="+C);for(var c=!0,S=0;S<h;S++){var Y=k[S].D,J=k[S].map;Y-=C;if(Y<0)C=Math.max(0,k[S].D-100),c=!1;else try{KMS(J,M,"req"+Y+"_")}catch(q){V&&V(J)}}if(c){V=M.join("&");break a}}V=void 0}D=D.j.splice(0,h);O.jT=D;return V},HcR=function(D){D.D||D.T||(D.C1=1,g.ef(D.Dw,D),D.jT=0)},SP0=function(D){if(D.D||D.T||D.jT>=3)return!1; D.C1++;D.T=jV((0,g.Xk)(D.Dw,D),AO0(D,D.jT));D.jT++;return!0},j2J=function(D){D.qE!=null&&(g.zR.clearTimeout(D.qE),D.qE=null)},Q2x=function(D){D.D=new AC(D,D.W,"rpc",D.C1); D.L===null&&(D.D.ST=D.U);D.D.T2=0;var O=D.qR.clone();g.vP(O,"RID","rpc");g.vP(O,"SID",D.W);g.vP(O,"AID",D.Vi);g.vP(O,"CI",D.G2?"0":"1");!D.G2&&D.yH&&g.vP(O,"TO",D.yH);g.vP(O,"TYPE","xmlhttp");zt(D,O);D.L&&D.U&&g.WP(O,D.L,D.U);D.T2&&D.D.setTimeout(D.T2);var h=D.D;D=D.RT;h.LF=1;h.T=Oh(O.clone());h.U=null;h.X1=!0;xUc(h,D)},Qk=function(D){D.Ew!=null&&(g.zR.clearTimeout(D.Ew),D.Ew=null)},bcv=function(D,O){var h=null; if(D.D==O){Qk(D);j2J(D);D.D=null;var V=2}else if(cOS(D.K,O))h=O.jT,uOC(D.K,O),V=1;else return;if(D.rZ!=0)if(O.Z)if(V==1){h=O.U?O.U.length:0;O=Date.now()-O.lS;var k=D.lS;V=ojS();V.dispatchEvent(new BBR(V,h,O,k));Wa(D)}else HcR(D);else{var C=O.yy;k=O.getLastError();if(k==3||k==0&&C>0||!(V==1&&G7R(D,O)||V==2&&SP0(D)))switch(h&&h.length>0&&(O=D.K,O.j=O.j.concat(h)),k){case 1:sh(D,5);break;case 4:sh(D,10);break;case 3:sh(D,6);break;default:sh(D,2)}}},AO0=function(D,O){var h=D.Mr+Math.floor(Math.random()* D.xG); D.isActive()||(h*=2);return h*O},sh=function(D,O){if(O==2){var h=(0,g.Xk)(D.KGF,D),V=D.t_,k=!V; V=new g.fn(V||"//www.google.com/images/cleardot.gif");g.zR.location&&g.zR.location.protocol=="http"||g.Kn(V,"https");Oh(V);k?Rh0(V.toString(),h):aES(V.toString(),h)}else Eh(2);D.rZ=0;D.J&&D.J.Ei(O);wNC(D);UBe(D)},wNC=function(D){D.rZ=0; D.f1=[];if(D.J){var O=gsv(D.K);if(O.length!=0||D.j.length!=0)g.Ol(D.f1,O),g.Ol(D.f1,D.j),D.K.j.length=0,g.Dv(D.j),D.j.length=0;D.J.t5()}},s2S=function(D){if(D.rZ==0)return D.f1; var O=[];g.Ol(O,gsv(D.K));g.Ol(O,D.j);return O},qP9=function(D,O,h){var V=g.Qf(h); V.D!=""?(O&&g.EF(V,O+"."+V.D),g.jJ(V,V.j)):(V=g.zR.location,V=lD_(V.protocol,O?O+"."+V.hostname:V.hostname,+V.port,h));O=D.X1;h=D.DJ;O&&h&&g.vP(V,O,h);g.vP(V,"VER",D.U1);zt(D,V);return V},I_S=function(D,O,h){if(O&&!D.LF)throw Error("Can't create secondary domain capable XhrIo object."); O=D.ze&&!D.BF?new g.Dk(new g.PP({C9:h})):new g.Dk(D.BF);O.L=D.LF;return O},WMJ=function(){},Ttx=function(){},F$=function(D,O){g.M4.call(this); this.D=new EsJ(O);this.J=D;this.K=O&&O.jT5||null;D=O&&O.E5T||null;O&&O.K0a&&(D?D["X-Client-Protocol"]="webchannel":D={"X-Client-Protocol":"webchannel"});this.D.U=D;D=O&&O.VC7||null;O&&O.FF&&(D?D["X-WebChannel-Content-Type"]=O.FF:D={"X-WebChannel-Content-Type":O.FF});O&&O.b_&&(D?D["X-WebChannel-Client-Profile"]=O.b_:D={"X-WebChannel-Client-Profile":O.b_});this.D.yy=D;(D=O&&O.Gr8)&&!g.fR(D)&&(this.D.L=D);this.Z=O&&O.r_i||!1;this.W=O&&O.bK3||!1;(O=O&&O.qwF)&&!g.fR(O)&&(this.D.X1=O,g.vW(this.K,O)&&(D= this.K,O in D&&delete D[O]));this.j=new nU(this)},dB8=function(D){r2_.call(this); D.__headers__&&(this.headers=D.__headers__,this.statusCode=D.__status__,delete D.__headers__,delete D.__status__);var O=D.__sm__;O?this.data=(this.D=g.Ap(O))?g.WW(O,this.D):O:this.data=D},zhx=function(D){pfL.call(this); this.status=1;this.errorCode=D},nU=function(D){this.D=D},nse=function(D,O){this.K=D; this.D=O},FMS=function(D){return s2S(D.D).map(function(O){var h=D.K; O=O.map;"__data__"in O?(O=O.__data__,h=h.W?oFJ(O):O):h=O;return h})},yk=function(D,O){if(typeof D!=="function")throw Error("Fn must not be null and must be a function"); return g.zR.setTimeout(function(){D()},O)},rp=function(D){iV.dispatchEvent(new yOJ(iV,D))},yOJ=function(D){g.rj.call(this,"statevent",D)},pU=function(D,O,h,V){this.D=D; this.W=O;this.L=h;this.Z=V||1;this.K=45E3;this.j=new g.T$(this);this.J=new g.tq;this.J.setInterval(250)},rO8=function(D,O,h){D.tP=1; D.In=Oh(O.clone());D.kV=h;D.X1=!0;icU(D,null)},pNR=function(D,O,h,V,k){D.tP=1; D.In=Oh(O.clone());D.kV=null;D.X1=h;k&&(D.Pk=!1);icU(D,V)},icU=function(D,O){D.u9=Date.now(); Nt0(D);D.KR=D.In.clone();hC(D.KR,"t",D.Z);D.jN=0;D.S_=D.D.qy(D.D.l9()?O:null);D.lO>0&&(D.Dj=new at((0,g.Xk)(D.f7,D,D.S_),D.lO));D.j.listen(D.S_,"readystatechange",D.TT);O=D.RC?g.dZ(D.RC):{};D.kV?(D.E4="POST",O["Content-Type"]="application/x-www-form-urlencoded",D.S_.send(D.KR,D.E4,D.kV,O)):(D.E4="GET",D.Pk&&!g.OL&&(O.Connection="close"),D.S_.send(D.KR,D.E4,null,O));D.D.fK(1)},XNx=function(D,O){var h=D.jN,V=O.indexOf("\n",h); if(V==-1)return osx;h=Number(O.substring(h,V));if(isNaN(h))return ZcU;V+=1;if(V+h>O.length)return osx;O=O.slice(V,V+h);D.jN=V+h;return O},Nt0=function(D){D.JS=Date.now()+D.K; Bt9(D,D.K)},Bt9=function(D,O){if(D.uI!=null)throw Error("WatchDog timer not null"); D.uI=yk((0,g.Xk)(D.pP,D),O)},lEe=function(D){D.uI&&(g.zR.clearTimeout(D.uI),D.uI=null)},xB8=function(D){D.D.rH()||D.fB||D.D.vL(D)},N6=function(D){lEe(D); g.SR(D.Dj);D.Dj=null;D.J.stop();D.j.removeAll();if(D.S_){var O=D.S_;D.S_=null;O.abort();O.dispose()}D.Vx&&(D.Vx=null)},$Bx=function(D,O){try{D.D.Ww(D,O),D.D.fK(4)}catch(h){}},DmL=function(D,O,h,V,k){if(V==0)h(!1); else{var C=k||0;V--;IE0(D,O,function(M){M?h(!0):g.zR.setTimeout(function(){DmL(D,O,h,V,C)},C)})}},IE0=function(D,O,h){var V=new Image; V.onload=function(){try{ot(V),h(!0)}catch(k){}}; V.onerror=function(){try{ot(V),h(!1)}catch(k){}}; V.onabort=function(){try{ot(V),h(!1)}catch(k){}}; V.ontimeout=function(){try{ot(V),h(!1)}catch(k){}}; g.zR.setTimeout(function(){if(V.ontimeout)V.ontimeout()},O); V.src=D},ot=function(D){D.onload=null; D.onerror=null;D.onabort=null;D.ontimeout=null},OJC=function(D){this.D=D; this.K=new fU},h9C=function(D){var O=ZF(D.D,D.Zt,"/mail/images/cleardot.gif"); Oh(O);DmL(O.toString(),5E3,(0,g.Xk)(D.JY,D),3,2E3);D.fK(1)},VIc=function(D){var O=D.D.Z; O!=null?(rp(5),O?(rp(11),X$(D.D,D,!1)):(rp(12),X$(D.D,D,!0))):(D.IR=new pU(D),D.IR.RC=D.zM,O=D.D,O=ZF(O,O.l9()?D.Iy:null,D.cL),rp(5),hC(O,"TYPE","xmlhttp"),pNR(D.IR,O,!1,D.Iy,!1))},kFS=function(D,O,h){this.D=1; this.K=[];this.j=[];this.J=new fU;this.U=D||null;this.Z=O!=null?O:null;this.T=h||!1},C0_=function(D,O){this.D=D; this.map=O;this.context=null},MI_=function(D,O,h,V){g.rj.call(this,"timingevent",D); this.size=O;this.rtt=h;this.retries=V},bJc=function(D){g.rj.call(this,"serverreachability",D)},St0=function(D){D.iM(1,0); D.fR=ZF(D,null,D.Cq);caR(D)},YtU=function(D){D.Cw&&(D.Cw.abort(),D.Cw=null); D.E8&&(D.E8.cancel(),D.E8=null);D.SC&&(g.zR.clearTimeout(D.SC),D.SC=null);Ba(D);D.Zs&&(D.Zs.cancel(),D.Zs=null);D.DY&&(g.zR.clearTimeout(D.DY),D.DY=null)},Jax=function(D,O){if(D.D==0)throw Error("Invalid operation: sending map when state is closed"); D.K.push(new C0_(D.N$++,O));D.D!=2&&D.D!=3||caR(D)},qte=function(D){var O=0; D.E8&&O++;D.Zs&&O++;return O},caR=function(D){D.Zs||D.DY||(D.DY=yk((0,g.Xk)(D.qk,D),0),D.J8=0)},mmR=function(D,O){if(D.D==1){if(!O){D.qL=Math.floor(Math.random()*1E5); O=D.qL++;var h=new pU(D,"",O);h.RC=D.tQ;var V=u4e(D),k=D.fR.clone();g.vP(k,"RID",O);g.vP(k,"CVER","1");lV(D,k);rO8(h,k,V);D.Zs=h;D.D=2}}else D.D==3&&(O?HJJ(D,O):D.K.length==0||D.Zs||HJJ(D))},HJJ=function(D,O){if(O)if(D.aC>6){D.K=D.j.concat(D.K); D.j.length=0;var h=D.qL-1;O=u4e(D)}else h=O.L,O=O.kV;else h=D.qL++,O=u4e(D);var V=D.fR.clone();g.vP(V,"SID",D.W);g.vP(V,"RID",h);g.vP(V,"AID",D.qQ);lV(D,V);h=new pU(D,D.W,h,D.J8+1);h.RC=D.tQ;h.setTimeout(1E4+Math.round(1E4*Math.random()));D.Zs=h;rO8(h,V,O)},lV=function(D,O){D.N2&&(D=D.N2.C7())&&g.K2(D,function(h,V){g.vP(O,V,h)})},u4e=function(D){var O=Math.min(D.K.length,1E3),h=["count="+O]; if(D.aC>6&&O>0){var V=D.K[0].D;h.push("ofs="+V)}else V=0;for(var k={},C=0;C<O;k={sV:void 0},C++){k.sV=D.K[C].D;var M=D.K[C].map;k.sV=D.aC<=6?C:k.sV-V;try{g.K2(M,function(c){return function(S,Y){h.push("req"+c.sV+"_"+Y+"="+encodeURIComponent(S))}}(k))}catch(c){h.push("req"+k.sV+"_type="+encodeURIComponent("_badmap"))}}D.j=D.j.concat(D.K.splice(0,O)); return h.join("&")},e9R=function(D){D.E8||D.SC||(D.L=1,D.SC=yk((0,g.Xk)(D.J5,D),0),D.lI=0)},P0R=function(D){if(D.E8||D.SC||D.lI>=3)return!1; D.L++;D.SC=yk((0,g.Xk)(D.J5,D),LYC(D,D.lI));D.lI++;return!0},X$=function(D,O,h){D.Ak=D.Z==null?h:!D.Z; D.hX=O.H$;D.T||St0(D)},Ba=function(D){D.YV!=null&&(g.zR.clearTimeout(D.YV),D.YV=null)},LYC=function(D,O){var h=5E3+Math.floor(Math.random()*1E4); D.isActive()||(h*=2);return h*O},xK=function(D,O){if(O==2||O==9){var h=null; D.N2&&(h=null);var V=(0,g.Xk)(D.D38,D);h||(h=new g.fn("//www.google.com/images/cleardot.gif"),Oh(h));IE0(h.toString(),1E4,V)}else rp(2);gUU(D,O)},gUU=function(D,O){D.D=0; D.N2&&D.N2.zK(O);R9R(D);YtU(D)},R9R=function(D){D.D=0; D.hX=-1;if(D.N2)if(D.j.length==0&&D.K.length==0)D.N2.HL();else{var O=g.Dv(D.j),h=g.Dv(D.K);D.j.length=0;D.K.length=0;D.N2.HL(O,h)}},ZF=function(D,O,h){var V=g.Qf(h); if(V.D!="")O&&g.EF(V,O+"."+V.D),g.jJ(V,V.j);else{var k=window.location;V=lD_(k.protocol,O?O+"."+k.hostname:k.hostname,+k.port,h)}D.Jt&&g.K2(D.Jt,function(C,M){g.vP(V,M,C)}); g.vP(V,"VER",D.aC);lV(D,V);return V},aHR=function(){},fHe=function(){this.D=[]; this.K=[]},KY_=function(D){g.rj.call(this,"channelMessage"); this.message=D},EUv=function(D){g.rj.call(this,"channelError"); this.error=D},jye=function(D,O){this.action=D; this.params=O||{}},$K=function(D,O){g.n.call(this); this.D=new g.VQ(this.Yqi,0,this);g.F(this,this.D);this.EU=5E3;this.K=0;if(typeof D==="function")O&&(D=(0,g.Xk)(D,O));else if(D&&typeof D.handleEvent==="function")D=(0,g.Xk)(D.handleEvent,D);else throw Error("Invalid listener argument");this.j=D},Um_=function(D,O,h,V,k,C,M){h=h===void 0?!1:h; V=V===void 0?function(){return""}:V; k=k===void 0?!1:k;C=C===void 0?!1:C;M=M===void 0?function(){return g.EQ({})}:M; this.ME=D;this.Ew=O;this.J=new g.QQ;this.K=new $K(this.Ej3,this);this.D=null;this.L=!1;this.U=null;this.lS="";this.jT=this.T=0;this.j=[];this.Ax=h;this.qE=V;this.Z=C;this.X1=M;this.W=g.EQ();this.T2=k;this.Vi=new xZc;this.ST=new $Z0;this.G2=new ID8;this.LF=new DUx;this.oW=new O0x;this.m5=new h4c},GFL=function(D,O,h,V,k){AaC(D); if(D.D){var C=g.DE("ID_TOKEN"),M=D.D.tQ||{};C?M["x-youtube-identity-token"]=C:delete M["x-youtube-identity-token"];D.D.tQ=M}V?(V.getState()!=3&&qte(V)==0||V.getState(),D.D.connect(O,h,D.Ew,V.W,V.qQ)):k?D.D.connect(O,h,D.Ew,k.sessionId,k.arrayId):D.D.connect(O,h,D.Ew)},QyR=function(D){var O,h; g.Q(function(V){if(V.D==1)return g.Rd(V,2),g.t(V,tIR(D),2);g.KT(V);O=D.j;D.j=[];h=O.length;vUm(D,O,h);It(D);return g.Ee(V,0)})},vUm=function(D,O,h){for(var V=0;V<h;++V)Jax(D.D,O[V]); It(D)},It=function(D){D.publish("handlerOpened"); D.Vi.D("BROWSER_CHANNEL")},AaC=function(D){if(D.D){var O=D.qE(),h=D.D.tQ||{}; O?h["x-youtube-lounge-xsrf-token"]=O:delete h["x-youtube-lounge-xsrf-token"];D.D.tQ=h}},tIR=function(D){return D.X1().then(function(O){var h=D.D.tQ||{}; O&&Object.keys(O).length>0?h=Object.assign({},h,O):delete h.Authorization;D.D.tQ=h}).catch(function(){})},Dl=function(D){this.scheme="https"; this.port=this.domain="";this.D="/api/lounge";this.K=!0;D=D||document.location.href;var O=Number(g.r7(4,D))||"";O&&(this.port=":"+O);this.domain=g.pH(D)||"";D=g.Ge();D.search("MSIE")>=0&&(D=D.match(/MSIE ([\d.]+)/)[1],g.Ax(D,"10.0")<0&&(this.K=!1))},OH=function(D,O){var h=D.D; D.K&&(h=D.scheme+"://"+D.domain+D.port+D.D);return g.lF(h+O,{})},wU0=function(D,O){g.M4.call(this); var h=this;this.UW=D();this.UW.subscribe("handlerOpened",this.OO,this);this.UW.subscribe("handlerClosed",this.onClosed,this);this.UW.subscribe("handlerError",function(V,k){h.onError(k)}); this.UW.subscribe("handlerMessage",this.onMessage,this);this.D=O},syU=function(D,O,h){var V=this; h=h===void 0?function(){return""}:h; var k=k===void 0?new Ttx:k;var C=C===void 0?new g.QQ:C;this.pathPrefix=D;this.D=O;this.lS=h;this.J=C;this.T=null;this.U=this.L=0;this.channel=null;this.Z=0;this.j=new $K(function(){V.j.isActive();var M;((M=V.channel)==null?void 0:YP0((new nse(M,M.D)).D.K))===0&&V.connect(V.T,V.L)}); this.W={};this.K={};this.Ew=!1;this.logger=null;this.jT=[];this.gH=void 0;this.ST=new xZc;this.qE=new $Z0;this.ME=new ID8;this.X1=new DUx},WY8=function(D){g.Ir(D.channel,"m",function(){D.Z=3; D.j.reset();D.T=null;D.L=0;for(var O=g.P(D.jT),h=O.next();!h.done;h=O.next())h=h.value,D.channel&&D.channel.send(h);D.jT=[];D.publish("webChannelOpened");D.ST.D("WEB_CHANNEL")}); g.Ir(D.channel,"n",function(){D.Z=0;D.j.isActive()||D.publish("webChannelClosed");var O,h=(O=D.channel)==null?void 0:FMS(new nse(O,O.D));h&&(D.jT=[].concat(g.a(h)));D.qE.D("WEB_CHANNEL")}); g.Ir(D.channel,"p",function(O){var h=O.data;h[0]==="gracefulReconnect"?(D.j.start(),D.channel&&D.channel.close()):D.publish("webChannelMessage",new jye(h[0],h[1]));D.gH=O.statusCode;D.ME.D("WEB_CHANNEL")}); g.Ir(D.channel,"o",function(){D.gH===401||D.j.start();D.publish("webChannelError");D.X1.D("WEB_CHANNEL")})},T6m=function(D){var O=D.lS(); O?D.W["x-youtube-lounge-xsrf-token"]=O:delete D.W["x-youtube-lounge-xsrf-token"]},dm8=function(D){g.M4.call(this); this.D=D();this.D.subscribe("webChannelOpened",this.PV,this);this.D.subscribe("webChannelClosed",this.onClosed,this);this.D.subscribe("webChannelError",this.onError,this);this.D.subscribe("webChannelMessage",this.onMessage,this)},z98=function(D,O,h,V,k){function C(){return new Um_(OH(D,"/bc"),O,!1,h,V)} h=h===void 0?function(){return""}:h; return g.UP("enable_mdx_web_channel_desktop")?new dm8(function(){return new syU(OH(D,"/wc"),O,h)}):new wU0(C,k)},iJL=function(){var D=nUS; FYL();h7.push(D);yac()},V9=function(D,O){FYL(); var h=raR(D,String(O));h7.length==0?pUc(h):(yac(),g.Je(h7,function(V){V(h)}))},kp=function(D){V9("CP",D)},FYL=function(){h7||(h7=g.Fk("yt.mdx.remote.debug.handlers_")||[],g.nT("yt.mdx.remote.debug.handlers_",h7))},pUc=function(D){var O=(Cp+1)%50; Cp=O;MV[O]=D;by||(by=O==49)},yac=function(){var D=h7; if(MV[0]){var O=by?Cp:-1,h={};do h={yE:void 0},O=(O+1)%50,h.yE=MV[O],g.Je(D,function(V){return function(k){k(V.yE)}}(h)); while(O!=Cp);MV=Array(50);Cp=-1;by=!1}},raR=function(D,O){var h=(Date.now()-N6S)/1E3; h.toFixed&&(h=h.toFixed(3));var V=[];V.push("[",h+"s","] ");V.push("[","yt.mdx.remote","] ");V.push(D+": "+O,"\n");return V.join("")},cc=function(D){g.um.call(this); this.Z=D;this.screens=[]},oUc=function(D,O){var h=D.get(O.uuid)||D.get(O.id); if(h)return D=h.name,h.id=O.id||h.id,h.name=O.name,h.token=O.token,h.uuid=O.uuid||h.uuid,h.name!=D;D.screens.push(O);return!0},ZJ9=function(D,O){var h=D.screens.length!=O.length; D.screens=g.LS(D.screens,function(C){return!!e4S(O,C)}); for(var V=O.length,k=0;k<V;k++)h=oUc(D,O[k])||h;return h},XUv=function(D,O){var h=D.screens.length; D.screens=g.LS(D.screens,function(V){return!(V||O?!V!=!O?0:V.id==O.id:1)}); return D.screens.length<h},B68=function(D,O,h,V,k){g.um.call(this); this.j=D;this.L=O;this.W=h;this.Z=V;this.J=k;this.K=0;this.D=null;this.YZ=NaN},Yp=function(D){cc.call(this,"LocalScreenService"); this.K=D;this.D=NaN;SA(this);this.info("Initializing with "+ueL(this.screens))},lH8=function(D){if(D.screens.length){var O=g.WS(D.screens,function(V){return V.id}),h=OH(D.K,"/pairing/get_lounge_token_batch"); D.K.sendRequest("POST",h,{screen_ids:O.join(",")},(0,g.Xk)(D.VM,D),(0,g.Xk)(D.GW,D))}},SA=function(D){if(g.UP("deprecate_pair_servlet_enabled"))return ZJ9(D,[]); var O=qdL(KA9());O=g.LS(O,function(h){return!h.uuid}); return ZJ9(D,O)},J7=function(D,O){jVm(g.WS(D.screens,YdS)); O&&EjJ()},$mm=function(D,O){g.um.call(this); this.Z=O;O=(O=g.yu("yt-remote-online-screen-ids")||"")?O.split(","):[];for(var h={},V=this.Z(),k=V.length,C=0;C<k;++C){var M=V[C].id;h[M]=g.BJ(O,M)}this.D=h;this.J=D;this.j=this.W=NaN;this.K=null;xmC("Initialized with "+g.d7(this.D))},IHx=function(D,O,h){var V=OH(D.J,"/pairing/get_screen_availability"); D.J.sendRequest("POST",V,{lounge_token:O.token},(0,g.Xk)(function(k){k=k.screens||[];for(var C=k.length,M=0;M<C;++M)if(k[M].loungeToken==O.token){h(k[M].status=="online");return}h(!1)},D),(0,g.Xk)(function(){h(!1)},D))},OQL=function(D,O){a:if(pk8(O)!=pk8(D.D))var h=!1; else{h=g.tp(O);for(var V=h.length,k=0;k<V;++k)if(!D.D[h[k]]){h=!1;break a}h=!0}h||(xmC("Updated online screens: "+g.d7(D.D)),D.D=O,D.publish("screenChange"));DQ0(D)},qV=function(D){isNaN(D.j)||g.Kc(D.j); D.j=g.a2((0,g.Xk)(D.O7,D),D.W>0&&D.W<g.xw()?2E4:1E4)},xmC=function(D){V9("OnlineScreenService",D)},hfL=function(D){var O={}; g.Je(D.Z(),function(h){h.token?O[h.token]=h.id:this.vr("Requesting availability of screen w/o lounge token.")}); return O},DQ0=function(D){D=g.tp(g.EO(D.D,function(O){return O})); g.c6(D);D.length?g.F4("yt-remote-online-screen-ids",D.join(","),60):g.i0("yt-remote-online-screen-ids")},uy=function(D,O){O=O===void 0?!1:O; cc.call(this,"ScreenService");this.W=D;this.L=O;this.D=this.K=null;this.j=[];this.J={};VL0(this)},CC0=function(D,O,h,V,k,C){D.info("getAutomaticScreenByIds "+h+" / "+O); h||(h=D.J[O]);var M=D.MC(),c=h?q6(M,h):null;h&&(D.L||c)||(c=q6(M,O));if(c){c.uuid=O;var S=Hc(D,c);IHx(D.D,S,function(Y){k(Y?S:null)})}else h?k9x(D,h,(0,g.Xk)(function(Y){var J=Hc(this,new SV({name:V, screenId:h,loungeToken:Y,dialId:O||""}));IHx(this.D,J,function(q){k(q?J:null)})},D),C):k(null)},MLe=function(D,O){for(var h=D.screens.length,V=0;V<h;++V)if(D.screens[V].name==O)return D.screens[V]; return null},bQ9=function(D,O,h){IHx(D.D,O,h)},k9x=function(D,O,h,V){D.info("requestLoungeToken_ for "+O); var k={postParams:{screen_ids:O},method:"POST",context:D,onSuccess:function(C,M){C=M&&M.screens||[];C[0]&&C[0].screenId==O?h(C[0].loungeToken):V(Error("Missing lounge token in token response"))}, onError:function(){V(Error("Request screen lounge token failed"))}}; g.QR(OH(D.W,"/pairing/get_lounge_token_batch"),k)},clc=function(D){D.screens=D.K.MC(); var O=D.J,h={},V;for(V in O)h[O[V]]=V;O=D.screens.length;for(V=0;V<O;++V){var k=D.screens[V];k.uuid=h[k.id]||""}D.info("Updated manual screens: "+ueL(D.screens))},VL0=function(D){SkR(D); D.K=new Yp(D.W);D.K.subscribe("screenChange",(0,g.Xk)(D.Be,D));clc(D);D.L||(D.j=qdL(g.yu("yt-remote-automatic-screen-cache")||[]));SkR(D);D.info("Initializing automatic screens: "+ueL(D.j));D.D=new $mm(D.W,(0,g.Xk)(D.MC,D,!0));D.D.subscribe("screenChange",(0,g.Xk)(function(){this.publish("onlineScreenChange")},D))},Hc=function(D,O){var h=D.get(O.id); h?(h.uuid=O.uuid,O=h):((h=q6(D.j,O.uuid))?(h.id=O.id,h.token=O.token,O=h):D.j.push(O),D.L||Ykv(D));SkR(D);D.J[O.uuid]=O.id;g.F4("yt-remote-device-id-map",D.J,31536E3);return O},Ykv=function(D){D=g.LS(D.j,function(O){return O.idType!="shortLived"}); g.F4("yt-remote-automatic-screen-cache",g.WS(D,YdS))},SkR=function(D){D.J=g.yu("yt-remote-device-id-map")||{}},mz=function(D,O,h){g.um.call(this); this.X1=h;this.W=D;this.K=O;this.D=null},eA=function(D,O){D.D=O; D.publish("sessionScreen",D.D)},JlL=function(D,O){D.D&&(D.D.token=O,Hc(D.W,D.D)); D.publish("sessionScreen",D.D)},Lp=function(D,O){V9(D.X1,O)},Pc=function(D,O,h){mz.call(this,D,O,"CastSession"); var V=this;this.config_=h;this.j=null;this.jT=(0,g.Xk)(this.BV,this);this.qE=(0,g.Xk)(this.rHx,this);this.Ew=g.a2(function(){qkU(V,null)},12E4); this.L=this.J=this.Z=this.T=0;this.lS=!1;this.U="unknown"},HQS=function(D,O){g.Kc(D.L); D.L=0;O==0?uES(D):D.L=g.a2(function(){uES(D)},O)},uES=function(D){mQv(D,"getLoungeToken"); g.Kc(D.J);D.J=g.a2(function(){efx(D,null)},3E4)},mQv=function(D,O){D.info("sendYoutubeMessage_: "+O+" "+g.d7()); var h={};h.type=O;D.j?D.j.sendMessage("urn:x-cast:com.google.youtube.mdx",h,function(){},(0,g.Xk)(function(){Lp(this,"Failed to send message: "+O+".")},D)):Lp(D,"Sending yt message without session: "+g.d7(h))},LgS=function(D,O){O?(D.info("onConnectedScreenId_: Received screenId: "+O),D.D&&D.D.id==O||D.Bb(O,function(h){eA(D,h)},function(){return D.Gb()},5)):D.Gb(Error("Waiting for session status timed out."))},g9x=function(D,O,h){D.info("onConnectedScreenData_: Received screenData: "+JSON.stringify(O)); var V=new SV(O);PCC(D,V,function(k){k?(D.lS=!0,Hc(D.W,V),eA(D,V),D.U="unknown",HQS(D,h)):(g.VR(Error("CastSession, RemoteScreen from screenData: "+JSON.stringify(O)+" is not online.")),D.Gb())},5)},qkU=function(D,O){g.Kc(D.Ew); D.Ew=0;O?D.config_.enableCastLoungeToken&&O.loungeToken?O.deviceId?D.D&&D.D.uuid==O.deviceId||(O.loungeTokenRefreshIntervalMs?g9x(D,{name:D.K.friendlyName,screenId:O.screenId,loungeToken:O.loungeToken,dialId:O.deviceId,screenIdType:"shortLived"},O.loungeTokenRefreshIntervalMs):(g.VR(Error("No loungeTokenRefreshIntervalMs presents in mdxSessionStatusData: "+JSON.stringify(O)+".")),LgS(D,O.screenId))):(g.VR(Error("No device id presents in mdxSessionStatusData: "+JSON.stringify(O)+".")),LgS(D,O.screenId)): LgS(D,O.screenId):D.Gb(Error("Waiting for session status timed out."))},efx=function(D,O){g.Kc(D.J); D.J=0;var h=null;if(O)if(O.loungeToken){var V;((V=D.D)==null?void 0:V.token)==O.loungeToken&&(h="staleLoungeToken")}else h="missingLoungeToken";else h="noLoungeTokenResponse";h?(D.info("Did not receive a new lounge token in onLoungeToken_ with data: "+(JSON.stringify(O)+", error: "+h)),D.U=h,HQS(D,3E4)):(JlL(D,O.loungeToken),D.lS=!1,D.U="unknown",HQS(D,O.loungeTokenRefreshIntervalMs))},PCC=function(D,O,h,V){g.Kc(D.Z); D.Z=0;bQ9(D.W,O,function(k){k||V<0?h(k):D.Z=g.a2(function(){PCC(D,O,h,V-1)},300)})},RfL=function(D){g.Kc(D.T); D.T=0;g.Kc(D.Z);D.Z=0;g.Kc(D.Ew);D.Ew=0;g.Kc(D.J);D.J=0;g.Kc(D.L);D.L=0},gd=function(D,O,h,V){mz.call(this,D,O,"DialSession"); this.config_=V;this.j=this.T=null;this.qE="";this.LF=h;this.ST=null;this.Ew=function(){}; this.U=NaN;this.ME=(0,g.Xk)(this.nP,this);this.J=function(){}; this.L=this.Z=0;this.jT=!1;this.lS="unknown"},Rl=function(D){var O; return!!(D.config_.enableDialLoungeToken&&((O=D.j)==null?0:O.getDialAppInfo))},a3S=function(D){D.J=D.W.S$(D.qE,D.K.label,D.K.friendlyName,Rl(D),function(O,h){D.J=function(){}; D.jT=!0;eA(D,O);O.idType=="shortLived"&&h>0&&al(D,h)},function(O){D.J=function(){}; D.Gb(O)})},f3S=function(D){var O={}; O.pairingCode=D.qE;O.theme=D.LF;A2U()&&(O.env_useStageMdx=1);return g.Bg(O)},Kg_=function(D){return new Promise(function(O){D.qE=H0x(); if(D.ST){var h=new chrome.cast.DialLaunchResponse(!0,f3S(D));O(h);a3S(D)}else D.Ew=function(){g.Kc(D.U);D.Ew=function(){}; D.U=NaN;var V=new chrome.cast.DialLaunchResponse(!0,f3S(D));O(V);a3S(D)},D.U=g.a2(function(){D.Ew()},100)})},jTv=function(D,O,h){D.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(O)); var V=new SV(O);return(new Promise(function(k){E9e(D,V,function(C){C?(D.jT=!0,Hc(D.W,V),eA(D,V),al(D,h)):g.VR(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(O)+" is not online."));k(C)},5)})).then(function(k){return k?new chrome.cast.DialLaunchResponse(!1):Kg_(D)})},UQ9=function(D,O){var h=D.T.receiver.label,V=D.K.friendlyName; return(new Promise(function(k){CC0(D.W,h,O,V,function(C){C&&C.token&&eA(D,C);k(C)},function(C){Lp(D,"Failed to get DIAL screen: "+C); k(null)})})).then(function(k){return k&&k.token?new chrome.cast.DialLaunchResponse(!1):Kg_(D)})},E9e=function(D,O,h,V){g.Kc(D.Z); D.Z=0;bQ9(D.W,O,function(k){k||V<0?h(k):D.Z=g.a2(function(){E9e(D,O,h,V-1)},300)})},al=function(D,O){D.info("getDialAppInfoWithTimeout_ "+O); Rl(D)&&(g.Kc(D.L),D.L=0,O==0?AlJ(D):D.L=g.a2(function(){AlJ(D)},O))},AlJ=function(D){Rl(D)&&D.j.getDialAppInfo(function(O){D.info("getDialAppInfo dialLaunchData: "+JSON.stringify(O)); O=O.extraData||{};var h=null;if(O.loungeToken){var V;((V=D.D)==null?void 0:V.token)==O.loungeToken&&(h="staleLoungeToken")}else h="missingLoungeToken";h?(D.lS=h,al(D,3E4)):(D.jT=!1,D.lS="unknown",JlL(D,O.loungeToken),al(D,O.loungeTokenRefreshIntervalMs))},function(O){D.info("getDialAppInfo error: "+O); D.lS="noLoungeTokenResponse";al(D,3E4)})},G9S=function(D){g.Kc(D.Z); D.Z=0;g.Kc(D.L);D.L=0;D.J();D.J=function(){}; g.Kc(D.U)},fp=function(D,O){mz.call(this,D,O,"ManualSession"); this.j=g.a2((0,g.Xk)(this.DA,this,null),150)},Kp=function(D,O){g.um.call(this); this.config_=O;this.K=D;this.T=O.appId||"233637DE";this.W=O.theme||"cl";this.U=O.disableCastApi||!1;this.Z=O.forceMirroring||!1;this.D=null;this.L=!1;this.j=[];this.J=(0,g.Xk)(this.oZ1,this)},tL_=function(D,O){return O?g.Zm(D.j,function(h){return YK(O,h.label)},D):null},EH=function(D){V9("Controller",D)},nUS=function(D){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(D)},jA=function(D){return D.L||!!D.j.length||!!D.D},UH=function(D,O,h){O!=D.D&&(g.SR(D.D),(D.D=O)?(h?D.publish("yt-remote-cast2-receiver-resumed", O.K):D.publish("yt-remote-cast2-receiver-selected",O.K),O.subscribe("sessionScreen",(0,g.Xk)(D.NF,D,O)),O.subscribe("sessionFailed",function(){return v9C(D,O)}),O.D?D.publish("yt-remote-cast2-session-change",O.D):h&&D.D.DA(null)):D.publish("yt-remote-cast2-session-change",null))},v9C=function(D,O){D.D==O&&D.publish("yt-remote-cast2-session-failed")},QT8=function(D){var O=D.K.Hw(),h=D.D&&D.D.K; D=g.WS(O,function(V){h&&YK(V,h.label)&&(h=null);var k=V.uuid?V.uuid:V.id,C=tL_(this,V);C?(C.label=k,C.friendlyName=V.name):(C=new chrome.cast.Receiver(k,V.name),C.receiverType=chrome.cast.ReceiverType.CUSTOM);return C},D); h&&(h.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(h=new chrome.cast.Receiver(h.label,h.friendlyName),h.receiverType=chrome.cast.ReceiverType.CUSTOM),D.push(h));return D},n9S=function(D,O,h,V){V.disableCastApi?A7("Cannot initialize because disabled by Mdx config."):wsx()?sTe(O,V)&&(WgC(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?TNL(D,h):(window.__onGCastApiAvailable=function(k,C){k?TNL(D,h):(Gk("Failed to load cast API: "+C),dQJ(!1),WgC(!1),g.i0("yt-remote-cast-available"),g.i0("yt-remote-cast-receiver"), zfx(),h(!1))},V.loadCastApiSetupScript?g.gY("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?ttS()>=60&&njm():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?sVJ():ttS()>=89?y2e():(z4S(),gp(FAS.map(WAe))))):A7("Cannot initialize because not running Chrome")},zfx=function(){A7("dispose"); var D=t7();D&&D.dispose();g.nT("yt.mdx.remote.cloudview.instance_",null);Fge(!1);g.LY(ylx);ylx.length=0},vc=function(){return!!g.yu("yt-remote-cast-installed")},iQC=function(){var D=g.yu("yt-remote-cast-receiver"); return D?D.friendlyName:null},rlC=function(){A7("clearCurrentReceiver"); g.i0("yt-remote-cast-receiver")},psU=function(){return vc()?t7()?t7().getCastSession():(Gk("getCastSelector: Cast is not initialized."),null):(Gk("getCastSelector: Cast API is not installed!"),null)},NNS=function(){vc()?t7()?Q9()?(A7("Requesting cast selector."),t7().requestSession()):(A7("Wait for cast API to be ready to request the session."),ylx.push(g.ex("yt-remote-cast2-api-ready",NNS))):Gk("requestCastSelector: Cast is not initialized."):Gk("requestCastSelector: Cast API is not installed!")}, wd=function(D,O){Q9()?t7().setConnectedScreenStatus(D,O):Gk("setConnectedScreenStatus called before ready.")},wsx=function(){var D=g.Ge().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.Tr||D},o9c=function(D,O){t7().init(D,O)},sTe=function(D,O){var h=!1; t7()||(D=new Kp(D,O),D.subscribe("yt-remote-cast2-availability-change",function(V){g.F4("yt-remote-cast-available",V);LU("yt-remote-cast2-availability-change",V)}),D.subscribe("yt-remote-cast2-receiver-selected",function(V){A7("onReceiverSelected: "+V.friendlyName); g.F4("yt-remote-cast-receiver",V);LU("yt-remote-cast2-receiver-selected",V)}),D.subscribe("yt-remote-cast2-receiver-resumed",function(V){A7("onReceiverResumed: "+V.friendlyName); g.F4("yt-remote-cast-receiver",V);LU("yt-remote-cast2-receiver-resumed",V)}),D.subscribe("yt-remote-cast2-session-change",function(V){A7("onSessionChange: "+JC(V)); V||g.i0("yt-remote-cast-receiver");LU("yt-remote-cast2-session-change",V)}),g.nT("yt.mdx.remote.cloudview.instance_",D),h=!0); A7("cloudview.createSingleton_: "+h);return h},t7=function(){return g.Fk("yt.mdx.remote.cloudview.instance_")},TNL=function(D,O){dQJ(!0); WgC(!1);o9c(D,function(h){h?(Fge(!0),g.P9("yt-remote-cast2-api-ready")):(Gk("Failed to initialize cast API."),dQJ(!1),g.i0("yt-remote-cast-available"),g.i0("yt-remote-cast-receiver"),zfx());O(h)})},A7=function(D){V9("cloudview",D)},Gk=function(D){V9("cloudview",D)},dQJ=function(D){A7("setCastInstalled_ "+D); g.F4("yt-remote-cast-installed",D)},Q9=function(){return!!g.Fk("yt.mdx.remote.cloudview.apiReady_")},Fge=function(D){A7("setApiReady_ "+D); g.nT("yt.mdx.remote.cloudview.apiReady_",D)},WgC=function(D){g.nT("yt.mdx.remote.cloudview.initializing_",D)},sH=function(D){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.Z=this.L=0;this.trackData=null;this.gL=this.f_=!1;this.T=this.J=this.D=this.W=0;this.j=NaN;this.K=!1;this.reset(D)},ZQR=function(D){D.audioTrackId=null; D.trackData=null;D.playerState=-1;D.f_=!1;D.gL=!1;D.L=0;D.Z=g.xw();D.W=0;D.D=0;D.J=0;D.T=0;D.j=NaN;D.K=!1},Wc=function(D){return D.isPlaying()?(g.xw()-D.Z)/1E3:0},Tk=function(D,O){D.L=O; D.Z=g.xw()},dd=function(D){switch(D.playerState){case 1:case 1081:return(g.xw()-D.Z)/1E3+D.L; case -1E3:return 0}return D.L},zk=function(D,O,h){var V=D.videoId; D.videoId=O;D.index=h;O!=V&&ZQR(D)},Xs9=function(D){var O={}; O.index=D.index;O.listId=D.listId;O.videoId=D.videoId;O.playerState=D.playerState;O.volume=D.volume;O.muted=D.muted;O.audioTrackId=D.audioTrackId;O.trackData=g.z_(D.trackData);O.hasPrevious=D.f_;O.hasNext=D.gL;O.playerTime=D.L;O.playerTimeAt=D.Z;O.seekableStart=D.W;O.seekableEnd=D.D;O.duration=D.J;O.loadedTime=D.T;O.liveIngestionTime=D.j;return O},Fu=function(D,O){g.um.call(this); var h=this;this.j=0;this.W=D;this.Z=[];this.J=new fHe;this.K=this.D=null;this.U=(0,g.Xk)(this.xvT,this);this.L=(0,g.Xk)(this.Nb,this);this.T=(0,g.Xk)(this.b12,this);this.Ew=(0,g.Xk)(this.VJE,this);var V=0;D?(V=D.getProxyState(),V!=3&&(D.subscribe("proxyStateChange",this.e9,this),BNe(this))):V=3;V!=0&&(O?this.e9(V):g.a2(function(){h.e9(V)},0)); (D=psU())&&np(this,D);this.subscribe("yt-remote-cast2-session-change",this.Ew)},y9=function(D){return new sH(D.W.getPlayerContextData())},BNe=function(D){g.Je("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(O){this.Z.push(this.W.subscribe(O,g.Bq(this.OpE,O),this))},D)},l3C=function(D){g.Je(D.Z,function(O){this.W.unsubscribeByKey(O)},D); D.Z.length=0},iy=function(D){return D.getState()==1},rd=function(D,O){var h=D.J; h.D.length+h.K.length<50&&D.J.enqueue(O)},xQS=function(D,O,h){var V=y9(D); Tk(V,h);V.playerState!=-1E3&&(V.playerState=O);pp(D,V)},NV=function(D,O,h){D.W.sendMessage(O,h)},pp=function(D,O){l3C(D); D.W.setPlayerContextData(Xs9(O));BNe(D)},np=function(D,O){D.K&&(D.K.removeUpdateListener(D.U),D.K.removeMediaListener(D.L),D.Nb(null)); D.K=O;D.K&&(kp("Setting cast session: "+D.K.sessionId),D.K.addUpdateListener(D.U),D.K.addMediaListener(D.L),D.K.media.length&&D.Nb(D.K.media[0]))},$Q_=function(D){var O=D.D.media,h=D.D.customData; if(O&&h){var V=y9(D);O.contentId!=V.videoId&&kp("Cast changing video to: "+O.contentId);V.videoId=O.contentId;V.playerState=h.playerState;Tk(V,D.D.getEstimatedTime());pp(D,V)}else kp("No cast media video. Ignoring state update.")},ol=function(D,O,h){return(0,g.Xk)(function(V){this.vr("Failed to "+O+" with cast v2 channel. Error code: "+V.code); V.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.vr("Retrying "+O+" using MDx browser channel."),NV(this,O,h))},D)},Bc=function(D,O,h,V){V=V===void 0?!1:V; g.um.call(this);var k=this;this.Z=NaN;this.qE=!1;this.U=this.T=this.jT=this.lS=NaN;this.Ew=[];this.J=this.L=this.W=this.D=this.K=null;this.ST=D;this.ME=V;this.Ew.push(g.Aa(window,"beforeunload",function(){k.BX(2)})); this.j=[];this.D=new sH;this.LF=O.id;this.X1=O.idType;this.K=z98(this.ST,h,this.yV,this.X1=="shortLived",this.LF);this.K.listen("channelOpened",function(){I3U(k)}); this.K.listen("channelClosed",function(){Zl("Channel closed");isNaN(k.Z)?mj(!0):mj();k.dispose()}); this.K.listen("channelError",function(C){mj();isNaN(k.Rs())?(C==1&&k.X1=="shortLived"&&k.publish("browserChannelAuthError",C),Zl("Channel error: "+C+" without reconnection"),k.dispose()):(k.qE=!0,Zl("Channel error: "+C+" with reconnection in "+k.Rs()+" ms"),Xu(k,2))}); this.K.listen("channelMessage",function(C){Dee(k,C)}); this.K.LK(O.token);this.subscribe("remoteQueueChange",function(){var C=k.D.videoId;g.r6()&&g.F4("yt-remote-session-video-id",C)})},OLR=function(D){return g.Zm(D.j,function(O){return O.type=="LOUNGE_SCREEN"})},Zl=function(D){V9("conn",D)},Xu=function(D,O){D.publish("proxyStateChange",O)},hnR=function(D){D.Z=g.a2(function(){Zl("Connecting timeout"); D.BX(1)},2E4)},Vw0=function(D){g.Kc(D.Z); D.Z=NaN},kLL=function(D){g.Kc(D.lS); D.lS=NaN},Mw8=function(D){Cc8(D); D.jT=g.a2(function(){ly(D,"getNowPlaying")},2E4)},Cc8=function(D){g.Kc(D.jT); D.jT=NaN},I3U=function(D){Zl("Channel opened"); D.qE&&(D.qE=!1,kLL(D),D.lS=g.a2(function(){Zl("Timing out waiting for a screen.");D.BX(1)},15E3))},cNe=function(D,O){var h=null; if(O){var V=OLR(D);V&&(h={clientName:V.clientName,deviceMake:V.brand,deviceModel:V.model,osVersion:V.osVersion})}g.nT("yt.mdx.remote.remoteClient_",h);O&&(Vw0(D),kLL(D));h=D.K.lx()&&isNaN(D.Z);O==h?O&&(Xu(D,1),ly(D,"getSubtitlesTrack")):O?(D.AF()&&D.D.reset(),Xu(D,1),ly(D,"getNowPlaying"),bLv(D)):D.BX(1)},SMv=function(D,O){var h=O.params.videoId; delete O.params.videoId;h==D.D.videoId&&(g.sO(O.params)?D.D.trackData=null:D.D.trackData=O.params,D.publish("remotePlayerChange"))},YM_=function(D,O,h){var V=O.params.videoId||O.params.video_id,k=parseInt(O.params.currentIndex,10); D.D.listId=O.params.listId||D.D.listId;zk(D.D,V,k);D.publish("remoteQueueChange",h)},qM0=function(D,O){O.params=O.params||{}; YM_(D,O,"NOW_PLAYING_MAY_CHANGE");JN_(D,O);D.publish("autoplayDismissed")},JN_=function(D,O){var h=parseInt(O.params.currentTime||O.params.current_time,10); Tk(D.D,isNaN(h)?0:h);h=parseInt(O.params.state,10);h=isNaN(h)?-1:h;h==-1&&D.D.playerState==-1E3&&(h=-1E3);D.D.playerState=h;h=Number(O.params.loadedTime);D.D.T=isNaN(h)?0:h;D.D.Qj(Number(O.params.duration));h=D.D;var V=Number(O.params.liveIngestionTime);h.j=V;h.K=isNaN(V)?!1:!0;h=D.D;V=Number(O.params.seekableStartTime);O=Number(O.params.seekableEndTime);h.W=isNaN(V)?0:V;h.D=isNaN(O)?0:O;D.D.playerState==1?Mw8(D):Cc8(D);D.publish("remotePlayerChange")},uaR=function(D,O){if(D.D.playerState!=-1E3){var h= 1085; switch(parseInt(O.params.adState,10)){case 1:h=1081;break;case 2:h=1084;break;case 0:h=1083}D.D.playerState=h;O=parseInt(O.params.currentTime,10);Tk(D.D,isNaN(O)?0:O);D.publish("remotePlayerChange")}},HLS=function(D,O){var h=O.params.muted=="true"; D.D.volume=parseInt(O.params.volume,10);D.D.muted=h;D.publish("remotePlayerChange")},meR=function(D,O){D.L=O.params.videoId; D.publish("nowAutoplaying",parseInt(O.params.timeout,10))},enx=function(D,O){D.L=O.params.videoId||null; D.publish("autoplayUpNext",D.L)},L8C=function(D,O){D.J=O.params.autoplayMode; D.publish("autoplayModeChange",D.J);D.J=="DISABLED"&&D.publish("autoplayDismissed")},PcU=function(D,O){var h=O.params.hasNext=="true"; D.D.f_=O.params.hasPrevious=="true";D.D.gL=h;D.publish("previousNextChange")},Dee=function(D,O){O=O.message; O.params?Zl("Received: action="+O.action+", params="+g.d7(O.params)):Zl("Received: action="+O.action+" {}");switch(O.action){case "loungeStatus":O=Vk(O.params.devices);D.j=g.WS(O,function(V){return new ca(V)}); O=!!g.Zm(D.j,function(V){return V.type=="LOUNGE_SCREEN"}); cNe(D,O);O=D.m9("mlm");D.publish("multiStateLoopEnabled",O);break;case "loungeScreenDisconnected":g.$C(D.j,function(V){return V.type=="LOUNGE_SCREEN"}); cNe(D,!1);break;case "remoteConnected":var h=new ca(Vk(O.params.device));g.Zm(D.j,function(V){return V.C2(h)})||rXL(D.j,h); break;case "remoteDisconnected":h=new ca(Vk(O.params.device));g.$C(D.j,function(V){return V.C2(h)}); break;case "gracefulDisconnect":break;case "playlistModified":YM_(D,O,"QUEUE_MODIFIED");break;case "nowPlaying":qM0(D,O);break;case "onStateChange":JN_(D,O);break;case "onAdStateChange":uaR(D,O);break;case "onVolumeChanged":HLS(D,O);break;case "onSubtitlesTrackChanged":SMv(D,O);break;case "nowAutoplaying":meR(D,O);break;case "autoplayDismissed":D.publish("autoplayDismissed");break;case "autoplayUpNext":enx(D,O);break;case "onAutoplayModeChanged":L8C(D,O);break;case "onHasPreviousNextChanged":PcU(D, O);break;case "requestAssistedSignIn":D.publish("assistedSignInRequested",O.params.authCode);break;case "onLoopModeChanged":D.publish("loopModeChange",O.params.loopMode);break;default:Zl("Unrecognized action: "+O.action)}},bLv=function(D){g.Kc(D.U); D.U=g.a2(function(){D.BX(1)},864E5)},ly=function(D,O,h){h?Zl("Sending: action="+O+", params="+g.d7(h)):Zl("Sending: action="+O); D.K.sendMessage(O,h)},gnJ=function(D){cc.call(this,"ScreenServiceProxy"); this.cM=D;this.D=[];this.D.push(this.cM.$_s("screenChange",(0,g.Xk)(this.Ku,this)));this.D.push(this.cM.$_s("onlineScreenChange",(0,g.Xk)(this.gZa,this)))},EnC=function(D,O){UUe(); if(!eV||!eV.get("yt-remote-disable-remote-module-for-dev")){O=g.DE("MDX_CONFIG")||O;LAJ();a_c();xp||(xp=new Dl(O?O.loungeApiHost:void 0),A2U()&&(xp.D="/api/loungedev"));$p||($p=g.Fk("yt.mdx.remote.deferredProxies_")||[],g.nT("yt.mdx.remote.deferredProxies_",$p));Rnx();var h=Il();if(!h){var V=new uy(xp,O?O.disableAutomaticScreenCache||!1:!1);g.nT("yt.mdx.remote.screenService_",V);h=Il();var k={};O&&(k={appId:O.appId,disableDial:O.disableDial,theme:O.theme,loadCastApiSetupScript:O.loadCastApiSetupScript, disableCastApi:O.disableCastApi,enableDialLoungeToken:O.enableDialLoungeToken,enableCastLoungeToken:O.enableCastLoungeToken,forceMirroring:O.forceMirroring});g.nT("yt.mdx.remote.enableConnectWithInitialState_",O?O.enableConnectWithInitialState||!1:!1);n9S(D,V,function(C){C?Dh()&&wd(Dh(),"YouTube TV"):V.subscribe("onlineScreenChange",function(){LU("yt-remote-receiver-availability-change")})},k)}O&&!g.Fk("yt.mdx.remote.initialized_")&&(g.nT("yt.mdx.remote.initialized_",!0),OT("Initializing: "+g.d7(O)), h9.push(g.ex("yt-remote-cast2-api-ready",function(){LU("yt-remote-api-ready")})),h9.push(g.ex("yt-remote-cast2-availability-change",function(){LU("yt-remote-receiver-availability-change")})),h9.push(g.ex("yt-remote-cast2-receiver-selected",function(){VU(null); LU("yt-remote-auto-connect","cast-selector-receiver")})),h9.push(g.ex("yt-remote-cast2-receiver-resumed",function(){LU("yt-remote-receiver-resumed","cast-selector-receiver")})),h9.push(g.ex("yt-remote-cast2-session-change",aQv)),h9.push(g.ex("yt-remote-connection-change",function(C){C?wd(Dh(),"YouTube TV"):k1()||(wd(null,null),rlC())})),h9.push(g.ex("yt-remote-cast2-session-failed",function(){LU("yt-remote-connection-failed")})),D=fQ8(),O.isAuto&&(D.id+="#dial"),k=O.capabilities||[],g.UP("desktop_enable_autoplay")&& k.push("atp"),k.length>0&&(D.capabilities=k),D.name=O.device,D.app=O.app,(O=O.theme)&&(D.theme=O),OT(" -- with channel params: "+g.d7(D)),D?(g.F4("yt-remote-session-app",D.app),g.F4("yt-remote-session-name",D.name)):(g.i0("yt-remote-session-app"),g.i0("yt-remote-session-name")),g.nT("yt.mdx.remote.channelParams_",D),h.start(),Dh()||K8S())}},jBx=function(){var D=Il().cM.$_gos(); var O=CA();O&&Mr()&&(e4S(D,O)||D.push(O));return mUS(D)},ANL=function(){var D=Uec(); !D&&vc()&&iQC()&&(D={key:"cast-selector-receiver",name:iQC()});return D},Uec=function(){var D=jBx(),O=CA(); O||(O=k1());return g.Zm(D,function(h){return O&&YK(O,h.key)?!0:!1})},CA=function(){var D=Dh(); if(!D)return null;var O=Il().MC();return q6(O,D)},aQv=function(D){OT("remote.onCastSessionChange_: "+JC(D)); if(D){var O=CA();if(O&&O.id==D.id){if(wd(O.id,"YouTube TV"),D.idType=="shortLived"&&(D=D.token))bN&&(bN.token=D),(O=Mr())&&O.LK(D)}else O&&cQ(),SN(D,1)}else Mr()&&cQ()},cQ=function(){Q9()?t7().stopSession():Gk("stopSession called before API ready."); var D=Mr();D&&(D.disconnect(1),GLR(null))},tw0=function(){var D=Mr(); return!!D&&D.getProxyState()!=3},OT=function(D){V9("remote",D)},Il=function(){if(!vn0){var D=g.Fk("yt.mdx.remote.screenService_"); vn0=D?new gnJ(D):null}return vn0},Dh=function(){return g.Fk("yt.mdx.remote.currentScreenId_")},QBU=function(D){g.nT("yt.mdx.remote.currentScreenId_",D)},wdm=function(){return g.Fk("yt.mdx.remote.connectData_")},VU=function(D){g.nT("yt.mdx.remote.connectData_",D)},Mr=function(){return g.Fk("yt.mdx.remote.connection_")},GLR=function(D){var O=Mr(); VU(null);D||QBU("");g.nT("yt.mdx.remote.connection_",D);$p&&(g.Je($p,function(h){h(D)}),$p.length=0); O&&!D?LU("yt-remote-connection-change",!1):!O&&D&&LU("yt-remote-connection-change",!0)},k1=function(){var D=g.r6(); if(!D)return null;var O=Il();if(!O)return null;O=O.MC();return q6(O,D)},SN=function(D,O){Dh(); CA()&&CA();if(Y1)bN=D;else{QBU(D.id);var h=g.Fk("yt.mdx.remote.enableConnectWithInitialState_")||!1;D=new Bc(xp,D,fQ8(),h);D.connect(O,wdm());D.subscribe("beforeDisconnect",function(V){LU("yt-remote-before-disconnect",V)}); D.subscribe("beforeDispose",function(){Mr()&&(Mr(),GLR(null))}); D.subscribe("browserChannelAuthError",function(){var V=CA();V&&V.idType=="shortLived"&&(Q9()?t7().handleBrowserChannelAuthError():Gk("refreshLoungeToken called before API ready."))}); GLR(D)}},K8S=function(){var D=k1(); D?(OT("Resume connection to: "+JC(D)),SN(D,0)):(mj(),rlC(),OT("Skipping connecting because no session screen found."))},Rnx=function(){var D=fQ8(); if(g.sO(D)){D=Ha();var O=g.yu("yt-remote-session-name")||"",h=g.yu("yt-remote-session-app")||"";D={device:"REMOTE_CONTROL",id:D,name:O,app:h,mdxVersion:3};D.authuser=String(g.DE("SESSION_INDEX","0"));(O=g.DE("DELEGATED_SESSION_ID"))&&(D.pageId=String(O));g.nT("yt.mdx.remote.channelParams_",D)}},fQ8=function(){return g.Fk("yt.mdx.remote.channelParams_")||{}},TWC=function(D,O,h){g.n.call(this); var V=this;this.module=D;this.C=O;this.qA=h;this.events=new g.Fh(this);this.W=!1;this.J=new g.He(64);this.D=new g.VQ(this.qd,500,this);this.K=new g.VQ(this.z1,1E3,this);this.L=new Rt(this.yiF,0,this);this.j={};this.T=new g.VQ(this.jF,1E3,this);this.Z=new at(this.seekTo,1E3,this);this.U=this.events.G(this.C,"onVolumeChange",function(k){sB_(V,k)}); g.F(this,this.events);this.events.G(O,"onCaptionsTrackListChanged",this.JC1);this.events.G(O,"captionschanged",this.aT7);this.events.G(O,"captionssettingschanged",this.wW);this.events.G(O,"videoplayerreset",this.Dg);this.events.G(O,"mdxautoplaycancel",function(){V.qA.nJ()}); O.S("enable_mdx_video_play_directly")&&this.events.G(O,"videodatachange",function(){W8U(V.module)||J9(V)||qr(V,0)}); D=this.qA;D.eT();D.subscribe("proxyStateChange",this.Vw,this);D.subscribe("remotePlayerChange",this.mR,this);D.subscribe("remoteQueueChange",this.Dg,this);D.subscribe("previousNextChange",this.bP,this);D.subscribe("nowAutoplaying",this.Lz,this);D.subscribe("autoplayDismissed",this.qF,this);g.F(this,this.D);g.F(this,this.K);g.F(this,this.L);g.F(this,this.T);g.F(this,this.Z);this.wW();this.Dg();this.mR()},sB_=function(D,O){if(J9(D)){D.qA.unsubscribe("remotePlayerChange",D.mR,D); var h=Math.round(O.volume);O=!!O.muted;var V=y9(D.qA);if(h!==V.volume||O!==V.muted)D.qA.setVolume(h,O),D.T.start();D.qA.subscribe("remotePlayerChange",D.mR,D)}},de_=function(D){D.Zn(0); D.D.stop();D.WF(new g.He(64))},znR=function(D,O){if(J9(D)&&!D.W){var h=null; O&&(h={style:D.C.getSubtitlesUserSettings()},Object.assign(h,O));D.qA.Zw(D.C.getVideoData(1).videoId,h);D.j=y9(D.qA).trackData}},qr=function(D,O){var h=D.C.getPlaylist(); if(h==null?0:h.listId){var V=h.index;var k=h.listId.toString()}h=D.C.getVideoData(1);D.qA.playVideo(h.videoId,O,V,k,h.playerParams,h.X1,idR(h));D.WF(new g.He(1))},nnm=function(D,O){if(O){var h=D.C.getOption("captions","tracklist",{xp:1}); h&&h.length?(D.C.setOption("captions","track",O),D.W=!1):(D.C.loadModule("captions"),D.W=!0)}else D.C.setOption("captions","track",{})},J9=function(D){return y9(D.qA).videoId===D.C.getVideoData(1).videoId},uN=function(){g.N.call(this,{X:"div", Y:"ytp-mdx-popup-dialog",B:{role:"dialog"},N:[{X:"div",Y:"ytp-mdx-popup-dialog-inner-content",N:[{X:"div",Y:"ytp-mdx-popup-title",W3:"Voc\u00ea n\u00e3o fez login"},{X:"div",Y:"ytp-mdx-popup-description",W3:"Os v\u00eddeos que voc\u00ea assistir poder\u00e3o ser adicionados ao hist\u00f3rico de visualiza\u00e7\u00e3o da TV e influenciar\u00e3o as recomenda\u00e7\u00f5es dela. Para evitar isso, cancele e fa\u00e7a login no YouTube em um computador."},{X:"div",Y:"ytp-mdx-privacy-popup-buttons",N:[{X:"button", Z8:["ytp-button","ytp-mdx-privacy-popup-cancel"],W3:"Cancelar"},{X:"button",Z8:["ytp-button","ytp-mdx-privacy-popup-confirm"],W3:"Confirmar"}]}]}]});this.D=new g.MT(this,250);this.cancelButton=this.z2("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.z2("ytp-mdx-privacy-popup-confirm");g.F(this,this.D);this.G(this.cancelButton,"click",this.K);this.G(this.confirmButton,"click",this.j)},JS=function(D){g.N.call(this,{X:"div", Y:"ytp-remote",N:[{X:"div",Y:"ytp-remote-display-status",N:[{X:"div",Y:"ytp-remote-display-status-icon",N:[g.mmB()]},{X:"div",Y:"ytp-remote-display-status-text",W3:"{{statustext}}"}]}]});this.api=D;this.D=new g.MT(this,250);g.F(this,this.D);this.G(D,"presentingplayerstatechange",this.onStateChange);this.pp(D.getPlayerStateObject())},uP=function(D,O){g.MI.call(this,"Reproduzir em",1,D,O); this.C=D;this.pY={};this.G(D,"onMdxReceiversChange",this.W);this.G(D,"presentingplayerstatechange",this.W);this.W()},F8R=function(D){g.dX.call(this,D); this.L_={key:H0x(),name:"Este computador"};this.l7=null;this.subscriptions=[];this.eI=this.qA=null;this.pY=[this.L_];this.SZ=this.L_;this.Oq=new g.He(64);this.qm=0;this.I4=-1;this.X6=!1;this.vx=this.F3=null;if(!g.Q3(this.player.V())&&!g.ry(this.player.V())){D=this.player;var O=g.G3(D);O&&(O=O.Zo())&&(O=new uP(D,O),g.F(this,O));O=new JS(D);g.F(this,O);g.X7(D,O.element,4);this.F3=new uN;g.F(this,this.F3);g.X7(D,this.F3.element,4);this.X6=!!k1()}},Ho=function(D){D.vx&&(D.player.removeEventListener("presentingplayerstatechange", D.vx),D.vx=null)},yNR=function(D,O,h){D.Oq=h; D.player.publish("presentingplayerstatechange",new g.Pi(h,O))},m$=function(D,O){if(O.key!==D.SZ.key)if(O.key===D.L_.key)cQ(); else if(W8U(D)&&iL_(D),D.SZ=O,!D.player.V().S("disable_mdx_connection_in_mdx_module_for_music_web")||!g.ry(D.player.V())){var h=D.player.getPlaylistId();var V=D.player.getVideoData(1);var k=V.videoId;if(!h&&!k||(D.player.getAppState()===2||D.player.getAppState()===1)&&D.player.V().S("should_clear_video_data_on_player_cued_unstarted"))V=null;else{var C=D.player.getPlaylist();if(C){var M=[];for(var c=0;c<C.getLength();c++)M[c]=g.s7(C,c).videoId}else M=[k];C=D.player.getCurrentTime(1);D={videoIds:M, listId:h,videoId:k,playerParams:V.playerParams,clickTrackingParams:V.X1,index:Math.max(D.player.getPlaylistIndex(),0),currentTime:C===0?void 0:C};(V=idR(V))&&(D.locationInfo=V);V=D}OT("Connecting to: "+g.d7(O));O.key=="cast-selector-receiver"?(VU(V||null),O=V||null,Q9()?t7().setLaunchParams(O):Gk("setLaunchParams called before ready.")):!V&&tw0()&&Dh()==O.key?LU("yt-remote-connection-change",!0):(cQ(),VU(V||null),V=Il().MC(),(O=q6(V,O.key))&&SN(O,1))}},W8U=function(D){var O=D.player.V(); return!O.S("mdx_enable_privacy_disclosure_ui")||D.isLoggedIn()||D.X6||!D.F3?!1:g.oG(O)||g.XW(O)},iL_=function(D){D.player.getPlayerStateObject().isPlaying()?D.player.pauseVideo():(D.vx=function(O){!D.X6&&g.Rs(O,8)&&(D.player.pauseVideo(),Ho(D))},D.player.addEventListener("presentingplayerstatechange",D.vx)); D.F3&&D.F3.kZ();Mr()||(Y1=!0)}; xZc.prototype.D=function(D){this.K.n$("/client_streamz/youtube/living_room/mdx/channel/opened",D)}; $Z0.prototype.D=function(D){this.K.n$("/client_streamz/youtube/living_room/mdx/channel/closed",D)}; ID8.prototype.D=function(D){this.K.n$("/client_streamz/youtube/living_room/mdx/channel/message_received",D)}; DUx.prototype.D=function(D){this.K.n$("/client_streamz/youtube/living_room/mdx/channel/error",D)}; O0x.prototype.D=function(){this.K.n$("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")}; h4c.prototype.D=function(){this.K.n$("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")}; g.b=M6.prototype;g.b.yY=function(){bV(this);for(var D=[],O=0;O<this.D.length;O++)D.push(this.K[this.D[O]]);return D}; g.b.Li=function(){bV(this);return this.D.concat()}; g.b.has=function(D){return CU(this.K,D)}; g.b.C2=function(D,O){if(this===D)return!0;if(this.size!=D.size)return!1;O=O||k6S;bV(this);for(var h,V=0;h=this.D[V];V++)if(!O(this.get(h),D.get(h)))return!1;return!0}; g.b.isEmpty=function(){return this.size==0}; g.b.clear=function(){this.K={};this.v5=this.size=this.D.length=0}; g.b.remove=function(D){return this.delete(D)}; g.b.delete=function(D){return CU(this.K,D)?(delete this.K[D],--this.size,this.v5++,this.D.length>2*this.size&&bV(this),!0):!1}; g.b.get=function(D,O){return CU(this.K,D)?this.K[D]:O}; g.b.set=function(D,O){CU(this.K,D)||(this.size+=1,this.D.push(D),this.v5++);this.K[D]=O}; g.b.forEach=function(D,O){for(var h=this.Li(),V=0;V<h.length;V++){var k=h[V],C=this.get(k);D.call(O,C,k,this)}}; g.b.clone=function(){return new M6(this)}; g.b.keys=function(){return g.jX(this.WS(!0)).D()}; g.b.values=function(){return g.jX(this.WS(!1)).D()}; g.b.entries=function(){var D=this;return Vt9(this.keys(),function(O){return[O,D.get(O)]})}; g.b.WS=function(D){bV(this);var O=0,h=this.v5,V=this,k=new g.qw;k.next=function(){if(h!=V.v5)throw Error("The map has changed since the iterator was created");if(O>=V.D.length)return g.qc;var C=V.D[O++];return g.ut(D?C:V.K[C])}; return k}; var c2R={G3W:"atp",Wbr:"ska",RUx:"que",NLF:"mus",IpW:"sus",CX1:"dsp",P7w:"seq",aka:"mic",LkW:"dpa",OU1:"cds",TLw:"mlm",h97:"dsdtr",QRr:"ntb",oF3:"vsp",ARr:"scn",koa:"rpe",se8:"dcn",gWF:"dcp",qY5:"pas",dPS:"drq",K_7:"opf",NX1:"els",iO8:"isg",B61:"svq",idF:"mvp",Om7:"ads",by3:"iat"},SdU={OiS:"u",DP8:"cl",Jf2:"k",xza:"i",Xp1:"cr",Af5:"m",E_T:"g",V5:"up"};ca.prototype.C2=function(D){return D?this.id==D.id:!1}; var R49="",eV=null;G6C.prototype.flush=function(D,O){D=D===void 0?[]:D;O=O===void 0?!1:O;if(g.UP("enable_client_streamz_web")){D=g.P(D);for(var h=D.next();!h.done;h=D.next())h=g.uGR(h.value),h={serializedIncrementBatch:g.LW(h.D())},g.mg("streamzIncremented",h,{sendIsolatedPayload:O})}}; var Pa,dUU=vjS("loadCastFramework")||vjS("loadCastApplicationFramework"),FAS=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.$w(Rt,g.n);g.b=Rt.prototype;g.b.a5=function(D){this.W=arguments;this.D=!1;this.YZ?this.j=g.xw()+this.EU:this.YZ=g.vg(this.J,this.EU)}; g.b.stop=function(){this.YZ&&(g.zR.clearTimeout(this.YZ),this.YZ=null);this.j=null;this.D=!1;this.W=[]}; g.b.pause=function(){++this.K}; g.b.resume=function(){this.K&&(--this.K,!this.K&&this.D&&(this.D=!1,this.Z.apply(null,this.W)))}; g.b.fF=function(){this.stop();Rt.K2.fF.call(this)}; g.b.YO=function(){this.YZ&&(g.zR.clearTimeout(this.YZ),this.YZ=null);this.j?(this.YZ=g.vg(this.J,this.j-g.xw()),this.j=null):this.K?this.D=!0:(this.D=!1,this.Z.apply(null,this.W))};g.e(at,g.n);g.b=at.prototype;g.b.uO=function(D){this.j=arguments;this.YZ||this.K?this.D=!0:i0e(this)}; g.b.stop=function(){this.YZ&&(g.zR.clearTimeout(this.YZ),this.YZ=null,this.D=!1,this.j=null)}; g.b.pause=function(){this.K++}; g.b.resume=function(){this.K--;this.K||!this.D||this.YZ||(this.D=!1,i0e(this))}; g.b.fF=function(){g.n.prototype.fF.call(this);this.stop()};fU.prototype.stringify=function(D){return g.zR.JSON.stringify(D,void 0)}; fU.prototype.parse=function(D){return g.zR.JSON.parse(D,void 0)};g.$w(r2_,g.rj);g.$w(pfL,g.rj);var NB8=null;g.$w(Z0S,g.rj);g.$w(Xfv,g.rj);g.$w(BBR,g.rj);Uh.prototype.debug=function(){}; Uh.prototype.info=function(){}; Uh.prototype.warning=function(){};var VW_={},hhe={};g.b=AC.prototype;g.b.setTimeout=function(D){this.oW=D}; g.b.xO=function(D){D=D.target;var O=this.Vi;O&&g.kZ(D)==3?O.uO():this.nL(D)}; g.b.nL=function(D){try{if(D==this.D)a:{var O=g.kZ(this.D),h=this.D.K,V=this.D.getStatus();if(!(O<3)&&(O!=3||this.D&&(this.K.K||g.M8(this.D)||g.bQ(this.D)))){this.ME||O!=4||h==7||(h==8||V<=0?KU(3):KU(2));MWS(this);var k=this.D.getStatus();this.yy=k;var C=Oce(this);if(this.Z=k==200){if(this.f1&&!this.G2){b:{if(this.D){var M=g.cl(this.D,"X-HTTP-Initial-Response");if(M&&!g.fR(M)){var c=M;break b}}c=null}if(D=c)this.G2=!0,mBe(this,D);else{this.Z=!1;this.J=3;Eh(12);tC(this);va(this);break a}}if(this.X1){D= !0;for(var S;!this.ME&&this.L<C.length;)if(S=k7U(this,C),S==hhe){O==4&&(this.J=4,Eh(14),D=!1);break}else if(S==VW_){this.J=4;Eh(15);D=!1;break}else mBe(this,S);DB9(this)&&this.L!=0&&(this.K.D=this.K.D.slice(this.L),this.L=0);O!=4||C.length!=0||this.K.K||(this.J=1,Eh(16),D=!1);this.Z=this.Z&&D;D?C.length>0&&!this.C1&&(this.C1=!0,this.j.ZL(this)):(tC(this),va(this))}else mBe(this,C);O==4&&tC(this);this.Z&&!this.ME&&(O==4?bcv(this.j,this):(this.Z=!1,Gt(this)))}else g.zPB(this.D),k==400&&C.indexOf("Unknown SID")> 0?(this.J=3,Eh(12)):(this.J=0,Eh(13)),tC(this),va(this)}}}catch(Y){}finally{}}; g.b.cancel=function(){this.ME=!0;tC(this)}; g.b.bM=function(){this.Ew=null;var D=Date.now();D-this.m5>=0?(this.LF!=2&&(KU(3),Eh(17)),tC(this),this.J=2,va(this)):CwR(this,this.m5-D)}; g.b.getLastError=function(){return this.J}; g.b.Mt=function(){return this.D};LMS.prototype.cancel=function(){this.j=gsv(this);if(this.K)this.K.cancel(),this.K=null;else if(this.D&&this.D.size!==0){for(var D=g.P(this.D.values()),O=D.next();!O.done;O=D.next())O.value.cancel();this.D.clear()}};g.b=EsJ.prototype;g.b.U1=8;g.b.rZ=1;g.b.connect=function(D,O,h,V){Eh(0);this.Y5=D;this.ME=O||{};h&&V!==void 0&&(this.ME.OSID=h,this.ME.OAID=V);this.G2=this.oT;this.ST=qP9(this,null,this.Y5);Wa(this)}; g.b.disconnect=function(){UBe(this);if(this.rZ==3){var D=this.Ax++,O=this.ST.clone();g.vP(O,"SID",this.W);g.vP(O,"RID",D);g.vP(O,"TYPE","terminate");zt(this,O);D=new AC(this,this.W,D);D.LF=2;D.T=Oh(O.clone());O=!1;if(g.zR.navigator&&g.zR.navigator.sendBeacon)try{O=g.zR.navigator.sendBeacon(D.T.toString(),"")}catch(h){}!O&&g.zR.Image&&((new Image).src=D.T,O=!0);O||(D.D=I_S(D.j,null),D.D.send(D.T));D.lS=Date.now();Gt(D)}wNC(this)}; g.b.rH=function(){return this.rZ==0}; g.b.getState=function(){return this.rZ}; g.b.K7=function(D){if(this.Z)if(this.Z=null,this.rZ==1){if(!D){this.Ax=Math.floor(Math.random()*1E5);D=this.Ax++;var O=new AC(this,"",D),h=this.U;this.yy&&(h?(h=g.dZ(h),g.n2(h,this.yy)):h=this.yy);this.L!==null||this.m5||(O.ST=h,h=null);var V;if(this.Uw)a:{for(var k=V=0;k<this.j.length;k++){b:{var C=this.j[k];if("__data__"in C.map&&(C=C.map.__data__,typeof C==="string")){C=C.length;break b}C=void 0}if(C===void 0)break;V+=C;if(V>4096){V=k;break a}if(V===4096||k===this.j.length-1){V=k+1;break a}}V= 1E3}else V=1E3;V=tWS(this,O,V);k=this.ST.clone();g.vP(k,"RID",D);g.vP(k,"CVER",22);this.X1&&g.vP(k,"X-HTTP-Session-Id",this.X1);zt(this,k);h&&(this.m5?V="headers="+g.OO(g.rpT(h))+"&"+V:this.L&&g.WP(k,this.L,h));JOS(this.K,O);this.I0&&g.vP(k,"TYPE","init");this.Uw?(g.vP(k,"$req",V),g.vP(k,"SID","null"),O.f1=!0,$U0(O,k,null)):$U0(O,k,V);this.rZ=2}}else this.rZ==3&&(D?vsc(this,D):this.j.length==0||Pw_(this.K)||vsc(this))}; g.b.Dw=function(){this.T=null;Q2x(this);if(this.F2&&!(this.oW||this.D==null||this.ea<=0)){var D=2*this.ea;this.qE=jV((0,g.Xk)(this.kqr,this),D)}}; g.b.kqr=function(){this.qE&&(this.qE=null,this.G2=!1,this.oW=!0,Eh(10),wp(this),Q2x(this))}; g.b.ZL=function(D){this.D==D&&this.F2&&!this.oW&&(j2J(this),this.oW=!0,Eh(11))}; g.b.GT=function(){this.Ew!=null&&(this.Ew=null,wp(this),SP0(this),Eh(19))}; g.b.KGF=function(D){D?Eh(2):Eh(1)}; g.b.isActive=function(){return!!this.J&&this.J.isActive(this)}; g.b=WMJ.prototype;g.b.IY=function(){}; g.b.j$=function(){}; g.b.Ei=function(){}; g.b.t5=function(){}; g.b.isActive=function(){return!0}; g.b.Vg=function(){};g.$w(F$,g.M4);F$.prototype.open=function(){this.D.J=this.j;this.Z&&(this.D.LF=!0);this.D.connect(this.J,this.K||void 0)}; F$.prototype.close=function(){this.D.disconnect()}; F$.prototype.send=function(D){var O=this.D;if(typeof D==="string"){var h={};h.__data__=D;D=h}else this.W&&(h={},h.__data__=g.d7(D),D=h);O.j.push(new eh9(O.bD++,D));O.rZ==3&&Wa(O)}; F$.prototype.fF=function(){this.D.J=null;delete this.j;this.D.disconnect();delete this.D;F$.K2.fF.call(this)}; g.$w(dB8,r2_);g.$w(zhx,pfL);g.$w(nU,WMJ);nU.prototype.IY=function(){this.D.dispatchEvent("m")}; nU.prototype.j$=function(D){this.D.dispatchEvent(new dB8(D))}; nU.prototype.Ei=function(D){this.D.dispatchEvent(new zhx(D))}; nU.prototype.t5=function(){this.D.dispatchEvent("n")};var iV=new g.M4;g.e(yOJ,g.rj);g.b=pU.prototype;g.b.RC=null;g.b.Ub=!1;g.b.uI=null;g.b.JS=null;g.b.u9=null;g.b.tP=null;g.b.In=null;g.b.KR=null;g.b.kV=null;g.b.S_=null;g.b.jN=0;g.b.Vx=null;g.b.E4=null;g.b.Ls=null;g.b.WO=-1;g.b.Pk=!0;g.b.fB=!1;g.b.lO=0;g.b.Dj=null;var ZcU={},osx={};g.b=pU.prototype;g.b.setTimeout=function(D){this.K=D}; g.b.TT=function(D){D=D.target;var O=this.Dj;O&&g.kZ(D)==3?O.uO():this.f7(D)}; g.b.f7=function(D){try{if(D==this.S_)a:{var O=g.kZ(this.S_),h=this.S_.K,V=this.S_.getStatus();if(g.OL&&!g.ei("420+")){if(O<4)break a}else if(O<3||O==3&&!g.M8(this.S_))break a;this.fB||O!=4||h==7||(h==8||V<=0?this.D.fK(3):this.D.fK(2));lEe(this);var k=this.S_.getStatus();this.WO=k;var C=g.M8(this.S_);if(this.Ub=k==200){O==4&&N6(this);if(this.X1){for(D=!0;!this.fB&&this.jN<C.length;){var M=XNx(this,C);if(M==osx){O==4&&(this.Ls=4,rp(15),D=!1);break}else if(M==ZcU){this.Ls=4;rp(16);D=!1;break}else $Bx(this, M)}O==4&&C.length==0&&(this.Ls=1,rp(17),D=!1);this.Ub=this.Ub&&D;D||(N6(this),xB8(this))}else $Bx(this,C);this.Ub&&!this.fB&&(O==4?this.D.vL(this):(this.Ub=!1,Nt0(this)))}else k==400&&C.indexOf("Unknown SID")>0?(this.Ls=3,rp(13)):(this.Ls=0,rp(14)),N6(this),xB8(this)}}catch(c){}finally{}}; g.b.cancel=function(){this.fB=!0;N6(this)}; g.b.pP=function(){this.uI=null;var D=Date.now();D-this.JS>=0?(this.tP!=2&&this.D.fK(3),N6(this),this.Ls=2,rp(18),xB8(this)):Bt9(this,this.JS-D)}; g.b.getLastError=function(){return this.Ls};g.b=OJC.prototype;g.b.zM=null;g.b.IR=null;g.b.bJ=!1;g.b.cL=null;g.b.K$=null;g.b.H$=-1;g.b.Iy=null;g.b.Zt=null;g.b.connect=function(D){this.cL=D;D=ZF(this.D,null,this.cL);rp(3);Date.now();var O=this.D.U;O!=null?(this.Iy=O[0],(this.Zt=O[1])?(this.K$=1,h9C(this)):(this.K$=2,VIc(this))):(hC(D,"MODE","init"),this.IR=new pU(this),this.IR.RC=this.zM,pNR(this.IR,D,!1,null,!0),this.K$=0)}; g.b.JY=function(D){if(D)this.K$=2,VIc(this);else{rp(4);var O=this.D;O.hX=O.Cw.H$;xK(O,9)}D&&this.fK(2)}; g.b.qy=function(D){return this.D.qy(D)}; g.b.abort=function(){this.IR&&(this.IR.cancel(),this.IR=null);this.H$=-1}; g.b.rH=function(){return!1}; g.b.Ww=function(D,O){this.H$=D.WO;if(this.K$==0)if(O){try{var h=this.K.parse(O)}catch(V){D=this.D;D.hX=this.H$;xK(D,2);return}this.Iy=h[0];this.Zt=h[1]}else D=this.D,D.hX=this.H$,xK(D,2);else this.K$==2&&(this.bJ?(rp(7),Date.now()):O=="11111"?(rp(6),this.bJ=!0,Date.now(),this.H$=200,this.IR.cancel(),rp(12),X$(this.D,this,!0)):(rp(8),Date.now(),this.bJ=!1))}; g.b.vL=function(){this.H$=this.IR.WO;if(this.IR.Ub)this.K$==0?this.Zt?(this.K$=1,h9C(this)):(this.K$=2,VIc(this)):this.K$==2&&(this.bJ?(rp(12),X$(this.D,this,!0)):(rp(11),X$(this.D,this,!1)));else{this.K$==0?rp(9):this.K$==2&&rp(10);var D=this.D;this.IR.getLastError();D.hX=this.H$;xK(D,2)}}; g.b.l9=function(){return this.D.l9()}; g.b.isActive=function(){return this.D.isActive()}; g.b.fK=function(D){this.D.fK(D)};g.b=kFS.prototype;g.b.tQ=null;g.b.Jt=null;g.b.Zs=null;g.b.E8=null;g.b.Cq=null;g.b.fR=null;g.b.uY=null;g.b.Xg=null;g.b.qL=0;g.b.N$=0;g.b.N2=null;g.b.DY=null;g.b.SC=null;g.b.YV=null;g.b.Cw=null;g.b.Ak=null;g.b.qQ=-1;g.b.lY=-1;g.b.hX=-1;g.b.J8=0;g.b.lI=0;g.b.aC=8;g.$w(MI_,g.rj);g.$w(bJc,g.rj);g.b=kFS.prototype;g.b.connect=function(D,O,h,V,k){rp(0);this.Cq=O;this.Jt=h||{};V&&k!==void 0&&(this.Jt.OSID=V,this.Jt.OAID=k);this.T?(yk((0,g.Xk)(this.Gh,this,D),100),St0(this)):this.Gh(D)}; g.b.disconnect=function(){YtU(this);if(this.D==3){var D=this.qL++,O=this.fR.clone();g.vP(O,"SID",this.W);g.vP(O,"RID",D);g.vP(O,"TYPE","terminate");lV(this,O);D=new pU(this,this.W,D);D.tP=2;D.In=Oh(O.clone());(new Image).src=D.In.toString();D.u9=Date.now();Nt0(D)}R9R(this)}; g.b.Gh=function(D){this.Cw=new OJC(this);this.Cw.zM=this.tQ;this.Cw.K=this.J;this.Cw.connect(D)}; g.b.rH=function(){return this.D==0}; g.b.getState=function(){return this.D}; g.b.qk=function(D){this.DY=null;mmR(this,D)}; g.b.J5=function(){this.SC=null;this.E8=new pU(this,this.W,"rpc",this.L);this.E8.RC=this.tQ;this.E8.lO=0;var D=this.uY.clone();g.vP(D,"RID","rpc");g.vP(D,"SID",this.W);g.vP(D,"CI",this.Ak?"0":"1");g.vP(D,"AID",this.qQ);lV(this,D);g.vP(D,"TYPE","xmlhttp");pNR(this.E8,D,!0,this.Xg,!1)}; g.b.Ww=function(D,O){if(this.D!=0&&(this.E8==D||this.Zs==D))if(this.hX=D.WO,this.Zs==D&&this.D==3)if(this.aC>7){try{var h=this.J.parse(O)}catch(V){h=null}if(Array.isArray(h)&&h.length==3)if(D=h,D[0]==0)a:{if(!this.SC){if(this.E8)if(this.E8.u9+3E3<this.Zs.u9)Ba(this),this.E8.cancel(),this.E8=null;else break a;P0R(this);rp(19)}}else this.lY=D[1],0<this.lY-this.qQ&&D[2]<37500&&this.Ak&&this.lI==0&&!this.YV&&(this.YV=yk((0,g.Xk)(this.AL,this),6E3));else xK(this,11)}else O!="y2f%"&&xK(this,11);else if(this.E8== D&&Ba(this),!g.fR(O))for(D=this.J.parse(O),O=0;O<D.length;O++)h=D[O],this.qQ=h[0],h=h[1],this.D==2?h[0]=="c"?(this.W=h[1],this.Xg=h[2],h=h[3],h!=null?this.aC=h:this.aC=6,this.D=3,this.N2&&this.N2.XR(),this.uY=ZF(this,this.l9()?this.Xg:null,this.Cq),e9R(this)):h[0]=="stop"&&xK(this,7):this.D==3&&(h[0]=="stop"?xK(this,7):h[0]!="noop"&&this.N2&&this.N2.cw(h),this.lI=0)}; g.b.AL=function(){this.YV!=null&&(this.YV=null,this.E8.cancel(),this.E8=null,P0R(this),rp(20))}; g.b.vL=function(D){if(this.E8==D){Ba(this);this.E8=null;var O=2}else if(this.Zs==D)this.Zs=null,O=1;else return;this.hX=D.WO;if(this.D!=0)if(D.Ub)if(O==1){O=D.kV?D.kV.length:0;D=Date.now()-D.u9;var h=iV;h.dispatchEvent(new MI_(h,O,D,this.J8));caR(this);this.j.length=0}else e9R(this);else{h=D.getLastError();var V;if(!(V=h==3||h==7||h==0&&this.hX>0)){if(V=O==1)this.Zs||this.DY||this.D==1||this.J8>=2?V=!1:(this.DY=yk((0,g.Xk)(this.qk,this,D),LYC(this,this.J8)),this.J8++,V=!0);V=!(V||O==2&&P0R(this))}if(V)switch(h){case 1:xK(this, 5);break;case 4:xK(this,10);break;case 3:xK(this,6);break;case 7:xK(this,12);break;default:xK(this,2)}}}; g.b.iM=function(D){if(!g.BJ(arguments,this.D))throw Error("Unexpected channel state: "+this.D);}; g.b.D38=function(D){D?rp(2):(rp(1),gUU(this,8))}; g.b.qy=function(D){if(D)throw Error("Can't create secondary domain capable XhrIo object.");D=new g.Dk;D.L=!1;return D}; g.b.isActive=function(){return!!this.N2&&this.N2.isActive(this)}; g.b.fK=function(D){var O=iV;O.dispatchEvent(new bJc(O,D))}; g.b.l9=function(){return!1}; g.b=aHR.prototype;g.b.XR=function(){}; g.b.cw=function(){}; g.b.zK=function(){}; g.b.HL=function(){}; g.b.C7=function(){return{}}; g.b.isActive=function(){return!0};g.b=fHe.prototype;g.b.enqueue=function(D){this.K.push(D)}; g.b.isEmpty=function(){return this.D.length===0&&this.K.length===0}; g.b.clear=function(){this.D=[];this.K=[]}; g.b.contains=function(D){return g.BJ(this.D,D)||g.BJ(this.K,D)}; g.b.remove=function(D){var O=this.D;var h=(0,g.vke)(O,D);h>=0?(g.l_(O,h),O=!0):O=!1;return O||g.xC(this.K,D)}; g.b.yY=function(){for(var D=[],O=this.D.length-1;O>=0;--O)D.push(this.D[O]);O=this.K.length;for(var h=0;h<O;++h)D.push(this.K[h]);return D};g.e(KY_,g.rj);g.e(EUv,g.rj);g.$w($K,g.n);g.b=$K.prototype;g.b.Yqi=function(){this.EU=Math.min(3E5,this.EU*2);this.j();this.K&&this.start()}; g.b.start=function(){var D=this.EU+15E3*Math.random();g.kF(this.D,D);this.K=Date.now()+D}; g.b.stop=function(){this.D.stop();this.K=0}; g.b.isActive=function(){return this.D.isActive()}; g.b.reset=function(){this.D.stop();this.EU=5E3};g.$w(Um_,aHR);g.b=Um_.prototype;g.b.subscribe=function(D,O,h){return this.J.subscribe(D,O,h)}; g.b.unsubscribe=function(D,O,h){return this.J.unsubscribe(D,O,h)}; g.b.bW=function(D){return this.J.bW(D)}; g.b.publish=function(D,O){return this.J.publish.apply(this.J,arguments)}; g.b.dispose=function(){this.L||(this.L=!0,g.SR(this.J),this.disconnect(),g.SR(this.K),this.K=null,this.qE=function(){return""},this.X1=function(){return g.EQ({})})}; g.b.eT=function(){return this.L}; g.b.connect=function(D,O,h){var V=this,k,C,M,c;return g.Q(function(S){if(S.D==1)return g.Rd(S,2),V.Z?g.t(S,V.W,2):S.v3(2);g.KT(S);if(V.L||V.D&&V.D.getState()==2)return S.return();V.lS="";V.K.stop();V.U=D||null;V.T=O||0;k=V.ME+"/test";C=V.ME+"/bind";M=new kFS(h?h.firstTestResults:null,h?h.secondTestResults:null,V.Ax);if(c=V.D)c.N2=null;M.N2=V;V.D=M;if(V.Z)return V.W=tIR(V).then(function(){return GFL(V,k,C,c,h)}),S.return(V.W.then(function(){V.W=g.EQ()})); GFL(V,k,C,c,h);return g.Ee(S,0)})}; g.b.disconnect=function(D){try{this.Z&&(this.W.cancel(),this.W=g.EQ())}finally{this.jT=D||0,this.K&&this.K.stop(),AaC(this),this.D&&(this.D.getState()==3&&mmR(this.D),this.D.disconnect()),this.jT=0}}; g.b.sendMessage=function(D,O){var h=this,V;return g.Q(function(k){switch(k.D){case 1:g.Rd(k,2);if(!h.Z){k.v3(2);break}return g.t(k,h.W,2);case 2:g.KT(k);if(h.L)return k.return();V={_sc:D};O&&g.n2(V,O);if(h.K.isActive()||(h.D?h.D.getState():0)==2){h.j.push(V);k.v3(6);break}if(!h.lx()){k.v3(6);break}g.Rd(k,8);if(!h.Z){k.v3(8);break}return g.t(k,tIR(h),8);case 8:g.KT(k,0,0,1);h.lx()&&(AaC(h),Jax(h.D,V));g.Ee(k,6,1);break;case 6:g.Ee(k,0)}})}; g.b.XR=function(){this.K.reset();this.U=null;this.T=0;if(this.j.length)if(this.Z)QyR(this);else{var D=this.j;this.j=[];vUm(this,D,D.length);It(this)}else It(this)}; g.b.zK=function(D){var O=D==2&&this.D.hX==401;D==4||O||this.K.start();this.publish("handlerError",D,O);this.LF.D("BROWSER_CHANNEL")}; g.b.HL=function(D,O){if(!this.K.isActive())this.publish("handlerClosed");else if(O)for(var h=O.length,V=0;V<h;++V){var k=O[V].map;k&&this.j.push(k)}this.ST.D("BROWSER_CHANNEL");D&&this.oW.K.eW("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps",D.length);O&&this.m5.K.eW("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps",O.length)}; g.b.C7=function(){var D={v:2};this.lS&&(D.gsessionid=this.lS);this.T!=0&&(D.ui=""+this.T);this.jT!=0&&(D.ui=""+this.jT);this.U&&g.n2(D,this.U);return D}; g.b.cw=function(D){D[0]=="S"?this.lS=D[1]:D[0]=="gracefulReconnect"?(this.K.start(),this.D.disconnect()):this.publish("handlerMessage",new jye(D[0],D[1]));this.G2.D("BROWSER_CHANNEL")}; g.b.lx=function(){return!!this.D&&this.D.getState()==3}; g.b.LK=function(D){(this.Ew.loungeIdToken=D)||this.K.stop();if(this.T2&&this.D){var O=this.D.tQ||{};D?O["X-YouTube-LoungeId-Token"]=D:delete O["X-YouTube-LoungeId-Token"];this.D.tQ=O}}; g.b.getDeviceId=function(){return this.Ew.id}; g.b.ND=function(){return this.K.isActive()?this.K.K-Date.now():NaN}; g.b.c9=function(){var D=this.K;g.Cd(D.D);D.start()}; g.b.Ej3=function(){this.K.isActive();qte(this.D)==0&&this.connect(this.U,this.T)};Dl.prototype.sendRequest=function(D,O,h,V,k,C,M){D={format:C?"RAW":"JSON",method:D,context:this,timeout:5E3,withCredentials:!!M,onSuccess:g.Bq(this.W,V,!C),onError:g.Bq(this.j,k),onTimeout:g.Bq(this.J,k)};h&&(D.postParams=h,D.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.QR(O,D)}; Dl.prototype.W=function(D,O,h,V){O?D(V):D({text:h.responseText})}; Dl.prototype.j=function(D,O){D(Error("Request error: "+O.status))}; Dl.prototype.J=function(D){D(Error("request timed out"))};g.e(wU0,g.M4);g.b=wU0.prototype;g.b.connect=function(D,O,h){this.UW.connect(D,O,h)}; g.b.disconnect=function(D){this.UW.disconnect(D)}; g.b.c9=function(){this.UW.c9()}; g.b.getDeviceId=function(){return this.UW.getDeviceId()}; g.b.ND=function(){return this.UW.ND()}; g.b.lx=function(){return this.UW.lx()}; g.b.OO=function(){this.dispatchEvent("channelOpened");var D=this.UW,O=this.D;g.F4("yt-remote-session-browser-channel",{firstTestResults:[""],secondTestResults:!D.D.Ak,sessionId:D.D.W,arrayId:D.D.qQ});g.F4("yt-remote-session-screen-id",O);D=uV();O=Ha();g.BJ(D,O)||D.push(O);gjm(D);a_c()}; g.b.onClosed=function(){this.dispatchEvent("channelClosed")}; g.b.onMessage=function(D){this.dispatchEvent(new KY_(D))}; g.b.onError=function(D){this.dispatchEvent(new EUv(D?1:0))}; g.b.sendMessage=function(D,O){this.UW.sendMessage(D,O)}; g.b.LK=function(D){this.UW.LK(D)}; g.b.dispose=function(){this.UW.dispose()};g.b=syU.prototype; g.b.connect=function(D,O){D=D===void 0?{}:D;O=O===void 0?0:O;this.Z!==2&&(this.j.stop(),this.T=D,this.L=O,T6m(this),(D=g.DE("ID_TOKEN"))?this.W["x-youtube-identity-token"]=D:delete this.W["x-youtube-identity-token"],this.D&&(this.K.device=this.D.device,this.K.name=this.D.name,this.K.app=this.D.app,this.K.id=this.D.id,this.D.UEw&&(this.K.mdxVersion=""+this.D.UEw),this.D.theme&&(this.K.theme=this.D.theme),this.D.capabilities&&(this.K.capabilities=this.D.capabilities),this.D.aj&&(this.K.cst=this.D.aj), this.D.authuser&&(this.K.authuser=this.D.authuser),this.D.pageId&&(this.K.pageId=this.D.pageId)),this.L!==0?this.K.ui=""+this.L:delete this.K.ui,Object.assign(this.K,this.T),this.channel=new F$(this.pathPrefix,{qwF:"gsessionid",E5T:this.W,jT5:this.K}),this.channel.open(),this.Z=2,WY8(this))}; g.b.disconnect=function(D){this.U=D===void 0?0:D;this.j.stop();T6m(this);this.channel&&(this.U!==0?this.K.ui=""+this.U:delete this.K.ui,this.channel.close());this.U=0}; g.b.ND=function(){return this.j.isActive()?this.j.K-Date.now():NaN}; g.b.c9=function(){var D=this.j;g.Cd(D.D);D.start()}; g.b.sendMessage=function(D,O){this.channel&&(T6m(this),D=Object.assign({},{_sc:D},O),this.channel.send(D))}; g.b.LK=function(D){D||this.j.stop();D?this.W["X-YouTube-LoungeId-Token"]=D:delete this.W["X-YouTube-LoungeId-Token"]}; g.b.getDeviceId=function(){return this.D?this.D.id:""}; g.b.publish=function(D){return this.J.publish.apply(this.J,[D].concat(g.a(g.GR.apply(1,arguments))))}; g.b.subscribe=function(D,O,h){return this.J.subscribe(D,O,h)}; g.b.unsubscribe=function(D,O,h){return this.J.unsubscribe(D,O,h)}; g.b.bW=function(D){return this.J.bW(D)}; g.b.dispose=function(){this.Ew||(this.Ew=!0,g.SR(this.J),this.disconnect(),g.SR(this.j),this.lS=function(){return""})}; g.b.eT=function(){return this.Ew};g.e(dm8,g.M4);g.b=dm8.prototype;g.b.connect=function(D,O){this.D.connect(D,O)}; g.b.disconnect=function(D){this.D.disconnect(D)}; g.b.c9=function(){this.D.c9()}; g.b.getDeviceId=function(){return this.D.getDeviceId()}; g.b.ND=function(){return this.D.ND()}; g.b.lx=function(){return this.D.Z===3}; g.b.PV=function(){this.dispatchEvent("channelOpened")}; g.b.onClosed=function(){this.dispatchEvent("channelClosed")}; g.b.onMessage=function(D){this.dispatchEvent(new KY_(D))}; g.b.onError=function(){this.dispatchEvent(new EUv(this.D.gH===401?1:0))}; g.b.sendMessage=function(D,O){this.D.sendMessage(D,O)}; g.b.LK=function(D){this.D.LK(D)}; g.b.dispose=function(){this.D.dispose()};var N6S=Date.now(),h7=null,MV=Array(50),Cp=-1,by=!1;g.$w(cc,g.um);cc.prototype.MC=function(){return this.screens}; cc.prototype.contains=function(D){return!!e4S(this.screens,D)}; cc.prototype.get=function(D){return D?q6(this.screens,D):null}; cc.prototype.info=function(D){V9(this.Z,D)};g.e(B68,g.um);g.b=B68.prototype;g.b.start=function(){!this.D&&isNaN(this.YZ)&&this.vk()}; g.b.stop=function(){this.D&&(this.D.abort(),this.D=null);isNaN(this.YZ)||(g.Kc(this.YZ),this.YZ=NaN)}; g.b.fF=function(){this.stop();g.um.prototype.fF.call(this)}; g.b.vk=function(){this.YZ=NaN;this.D=g.QR(OH(this.j,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:this.L},timeout:5E3,onSuccess:(0,g.Xk)(this.FA,this),onError:(0,g.Xk)(this.o5,this),onTimeout:(0,g.Xk)(this.rM,this)})}; g.b.FA=function(D,O){this.D=null;D=O.screen||{};D.dialId=this.W;D.name=this.Z;O=-1;this.J&&D.shortLivedLoungeToken&&D.shortLivedLoungeToken.value&&D.shortLivedLoungeToken.refreshIntervalMs&&(D.screenIdType="shortLived",D.loungeToken=D.shortLivedLoungeToken.value,O=D.shortLivedLoungeToken.refreshIntervalMs);this.publish("pairingComplete",new SV(D),O)}; g.b.o5=function(D){this.D=null;D.status&&D.status==404?this.K>=rN_.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(D=rN_[this.K],this.YZ=g.a2((0,g.Xk)(this.vk,this),D),this.K++):this.publish("pairingFailed",Error("Server error "+D.status))}; g.b.rM=function(){this.D=null;this.publish("pairingFailed",Error("Server not responding"))}; var rN_=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.$w(Yp,cc);g.b=Yp.prototype;g.b.start=function(){SA(this)&&this.publish("screenChange");!g.yu("yt-remote-lounge-token-expiration")&&lH8(this);g.Kc(this.D);this.D=g.a2((0,g.Xk)(this.start,this),1E4)}; g.b.add=function(D,O){SA(this);oUc(this,D);J7(this,!1);this.publish("screenChange");O(D);D.token||lH8(this)}; g.b.remove=function(D,O){var h=SA(this);XUv(this,D)&&(J7(this,!1),h=!0);O(D);h&&this.publish("screenChange")}; g.b.N7=function(D,O,h,V){var k=SA(this),C=this.get(D.id);C?(C.name!=O&&(C.name=O,J7(this,!1),k=!0),h(D)):V(Error("no such local screen."));k&&this.publish("screenChange")}; g.b.fF=function(){g.Kc(this.D);Yp.K2.fF.call(this)}; g.b.VM=function(D){SA(this);var O=this.screens.length;D=D&&D.screens||[];for(var h=D.length,V=0;V<h;++V){var k=D[V],C=this.get(k.screenId);C&&(C.token=k.loungeToken,--O)}J7(this,!O);O&&V9(this.Z,"Missed "+O+" lounge tokens.")}; g.b.GW=function(D){V9(this.Z,"Requesting lounge tokens failed: "+D)};g.e($mm,g.um);g.b=$mm.prototype;g.b.start=function(){var D=parseInt(g.yu("yt-remote-fast-check-period")||"0",10);(this.W=g.xw()-144E5<D?0:D)?qV(this):(this.W=g.xw()+3E5,g.F4("yt-remote-fast-check-period",this.W),this.O7())}; g.b.isEmpty=function(){return g.sO(this.D)}; g.b.update=function(){xmC("Updating availability on schedule.");var D=this.Z(),O=g.EO(this.D,function(h,V){return h&&!!q6(D,V)},this); OQL(this,O)}; g.b.fF=function(){g.Kc(this.j);this.j=NaN;this.K&&(this.K.abort(),this.K=null);g.um.prototype.fF.call(this)}; g.b.O7=function(){g.Kc(this.j);this.j=NaN;this.K&&this.K.abort();var D=hfL(this);if(pk8(D)){var O=OH(this.J,"/pairing/get_screen_availability");this.K=this.J.sendRequest("POST",O,{lounge_token:g.tp(D).join(",")},(0,g.Xk)(this.cHi,this,D),(0,g.Xk)(this.v83,this))}else OQL(this,{}),qV(this)}; g.b.cHi=function(D,O){this.K=null;var h=g.tp(hfL(this));if(g.Si(h,g.tp(D))){O=O.screens||[];h={};for(var V=O.length,k=0;k<V;++k)h[D[O[k].loungeToken]]=O[k].status=="online";OQL(this,h);qV(this)}else this.vr("Changing Screen set during request."),this.O7()}; g.b.v83=function(D){this.vr("Screen availability failed: "+D);this.K=null;qV(this)}; g.b.vr=function(D){V9("OnlineScreenService",D)};g.$w(uy,cc);g.b=uy.prototype;g.b.start=function(){this.K.start();this.D.start();this.screens.length&&(this.publish("screenChange"),this.D.isEmpty()||this.publish("onlineScreenChange"))}; g.b.add=function(D,O,h){this.K.add(D,O,h)}; g.b.remove=function(D,O,h){this.K.remove(D,O,h);this.D.update()}; g.b.N7=function(D,O,h,V){this.K.contains(D)?this.K.N7(D,O,h,V):(D="Updating name of unknown screen: "+D.name,V9(this.Z,D),V(Error(D)))}; g.b.MC=function(D){return D?this.screens:g.IL(this.screens,g.LS(this.j,function(O){return!this.contains(O)},this))}; g.b.Hw=function(){return g.LS(this.MC(!0),function(D){return!!this.D.D[D.id]},this)}; g.b.S$=function(D,O,h,V,k,C){var M=this;this.info("getDialScreenByPairingCode "+D+" / "+O);var c=new B68(this.W,D,O,h,V);c.subscribe("pairingComplete",function(S,Y){g.SR(c);k(Hc(M,S),Y)}); c.subscribe("pairingFailed",function(S){g.SR(c);C(S)}); c.start();return(0,g.Xk)(c.stop,c)}; g.b.Qg=function(D,O,h,V){g.QR(OH(this.W,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:D},timeout:5E3,onSuccess:(0,g.Xk)(function(k,C){k=new SV(C.screen||{});if(!k.name||MLe(this,k.name)){a:{C=k.name;for(var M=2,c=O(C,M);MLe(this,c);){M++;if(M>20)break a;c=O(C,M)}C=c}k.name=C}h(Hc(this,k))},this), onError:(0,g.Xk)(function(k){V(Error("pairing request failed: "+k.status))},this), onTimeout:(0,g.Xk)(function(){V(Error("pairing request timed out."))},this)})}; g.b.fF=function(){g.SR(this.K);g.SR(this.D);uy.K2.fF.call(this)}; g.b.Be=function(){clc(this);this.publish("screenChange");this.D.update()}; uy.prototype.dispose=uy.prototype.dispose;g.$w(mz,g.um);g.b=mz.prototype;g.b.Gb=function(D){this.eT()||(D&&(Lp(this,""+D),this.publish("sessionFailed")),this.D=null,this.publish("sessionScreen",null))}; g.b.info=function(D){V9(this.X1,D)}; g.b.e$=function(){return null}; g.b.zl=function(D){var O=this.K;D?(O.displayStatus=new chrome.cast.ReceiverDisplayStatus(D,[]),O.displayStatus.showStop=!0):O.displayStatus=null;chrome.cast.setReceiverDisplayStatus(O,(0,g.Xk)(function(){this.info("Updated receiver status for "+O.friendlyName+": "+D)},this),(0,g.Xk)(function(){Lp(this,"Failed to update receiver status for: "+O.friendlyName)},this))}; g.b.fF=function(){this.zl("");mz.K2.fF.call(this)};g.e(Pc,mz);g.b=Pc.prototype;g.b.Js=function(D){if(this.j){if(this.j==D)return;Lp(this,"Overriding cast session with new session object");RfL(this);this.lS=!1;this.U="unknown";this.j.removeUpdateListener(this.jT);this.j.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.qE)}this.j=D;this.j.addUpdateListener(this.jT);this.j.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.qE);mQv(this,"getMdxSessionStatus")}; g.b.DA=function(D){this.info("launchWithParams no-op for Cast: "+g.d7(D))}; g.b.stop=function(){this.j?this.j.stop((0,g.Xk)(function(){this.Gb()},this),(0,g.Xk)(function(){this.Gb(Error("Failed to stop receiver app."))},this)):this.Gb(Error("Stopping cast device without session."))}; g.b.zl=function(){}; g.b.fF=function(){this.info("disposeInternal");RfL(this);this.j&&(this.j.removeUpdateListener(this.jT),this.j.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.qE));this.j=null;mz.prototype.fF.call(this)}; g.b.rHx=function(D,O){if(!this.eT())if(O)if(O=Vk(O),g.pT(O))switch(D=""+O.type,O=O.data||{},this.info("onYoutubeMessage_: "+D+" "+g.d7(O)),D){case "mdxSessionStatus":qkU(this,O);break;case "loungeToken":efx(this,O);break;default:Lp(this,"Unknown youtube message: "+D)}else Lp(this,"Unable to parse message.");else Lp(this,"No data in message.")}; g.b.Bb=function(D,O,h,V){g.Kc(this.T);this.T=0;CC0(this.W,this.K.label,D,this.K.friendlyName,(0,g.Xk)(function(k){k?O(k):V>=0?(Lp(this,"Screen "+D+" appears to be offline. "+V+" retries left."),this.T=g.a2((0,g.Xk)(this.Bb,this,D,O,h,V-1),300)):h(Error("Unable to fetch screen."))},this),h)}; g.b.e$=function(){return this.j}; g.b.BV=function(D){this.eT()||D||(Lp(this,"Cast session died."),this.Gb())};g.e(gd,mz);g.b=gd.prototype;g.b.Js=function(D){this.j=D;this.j.addUpdateListener(this.ME)}; g.b.DA=function(D){this.ST=D;this.Ew()}; g.b.stop=function(){G9S(this);this.j?this.j.stop((0,g.Xk)(this.Gb,this,null),(0,g.Xk)(this.Gb,this,"Failed to stop DIAL device.")):this.Gb()}; g.b.fF=function(){G9S(this);this.j&&this.j.removeUpdateListener(this.ME);this.j=null;mz.prototype.fF.call(this)}; g.b.nP=function(D){this.eT()||D||(Lp(this,"DIAL session died."),this.J(),this.J=function(){},this.Gb())};g.e(fp,mz);fp.prototype.stop=function(){this.Gb()}; fp.prototype.Js=function(){}; fp.prototype.DA=function(){g.Kc(this.j);this.j=NaN;var D=q6(this.W.MC(),this.K.label);D?eA(this,D):this.Gb(Error("No such screen"))}; fp.prototype.fF=function(){g.Kc(this.j);this.j=NaN;mz.prototype.fF.call(this)};g.e(Kp,g.um);g.b=Kp.prototype; g.b.init=function(D,O){chrome.cast.timeout.requestSession=3E4;var h=new chrome.cast.SessionRequest(this.T,[chrome.cast.Capability.AUDIO_OUT]);g.UP("desktop_enable_cast_connect")&&(h.androidReceiverCompatible=!0);this.U||(h.dialRequest=new chrome.cast.DialRequest("YouTube"));var V=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;D=D||this.Z?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var k=(0,g.Xk)(this.QMT,this);h=new chrome.cast.ApiConfig(h,(0,g.Xk)(this.T8, this),k,V,D);h.customDialLaunchCallback=(0,g.Xk)(this.PbT,this);chrome.cast.initialize(h,(0,g.Xk)(function(){this.eT()||(chrome.cast.addReceiverActionListener(this.J),iJL(),this.K.subscribe("onlineScreenChange",(0,g.Xk)(this.w_,this)),this.j=QT8(this),chrome.cast.setCustomReceivers(this.j,function(){},(0,g.Xk)(function(C){this.vr("Failed to set initial custom receivers: "+g.d7(C))},this)),this.publish("yt-remote-cast2-availability-change",jA(this)),O(!0))},this),(0,g.Xk)(function(C){this.vr("Failed to initialize API: "+ g.d7(C)); O(!1)},this))}; g.b.XrW=function(D,O){EH("Setting connected screen ID: "+D+" -> "+O);if(this.D){var h=this.D.D;if(!D||h&&h.id!=D)EH("Unsetting old screen status: "+this.D.K.friendlyName),UH(this,null)}if(D&&O){if(!this.D){D=q6(this.K.MC(),D);if(!D){EH("setConnectedScreenStatus: Unknown screen.");return}if(D.idType=="shortLived"){EH("setConnectedScreenStatus: Screen with id type to be short lived.");return}h=tL_(this,D);h||(EH("setConnectedScreenStatus: Connected receiver not custom..."),h=new chrome.cast.Receiver(D.uuid? D.uuid:D.id,D.name),h.receiverType=chrome.cast.ReceiverType.CUSTOM,this.j.push(h),chrome.cast.setCustomReceivers(this.j,function(){},(0,g.Xk)(function(V){this.vr("Failed to set initial custom receivers: "+g.d7(V))},this))); EH("setConnectedScreenStatus: new active receiver: "+h.friendlyName);UH(this,new fp(this.K,h),!0)}this.D.zl(O)}else EH("setConnectedScreenStatus: no screen.")}; g.b.eOa=function(D){this.eT()?this.vr("Setting connection data on disposed cast v2"):this.D?this.D.DA(D):this.vr("Setting connection data without a session")}; g.b.UO=function(){this.eT()?this.vr("Stopping session on disposed cast v2"):this.D?(this.D.stop(),UH(this,null)):EH("Stopping non-existing session")}; g.b.requestSession=function(){chrome.cast.requestSession((0,g.Xk)(this.T8,this),(0,g.Xk)(this.HWF,this))}; g.b.fF=function(){this.K.unsubscribe("onlineScreenChange",(0,g.Xk)(this.w_,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.J);var D=nUS,O=g.Fk("yt.mdx.remote.debug.handlers_");g.xC(O||[],D);g.SR(this.D);g.um.prototype.fF.call(this)}; g.b.vr=function(D){V9("Controller",D)}; g.b.NF=function(D,O){this.D==D&&(O||UH(this,null),this.publish("yt-remote-cast2-session-change",O))}; g.b.oZ1=function(D,O){if(!this.eT())if(D)switch(D.friendlyName=chrome.cast.unescape(D.friendlyName),EH("onReceiverAction_ "+D.label+" / "+D.friendlyName+"-- "+O),O){case chrome.cast.ReceiverAction.CAST:if(this.D)if(this.D.K.label!=D.label)EH("onReceiverAction_: Stopping active receiver: "+this.D.K.friendlyName),this.D.stop();else{EH("onReceiverAction_: Casting to active receiver.");this.D.D&&this.publish("yt-remote-cast2-session-change",this.D.D);break}switch(D.receiverType){case chrome.cast.ReceiverType.CUSTOM:UH(this, new fp(this.K,D));break;case chrome.cast.ReceiverType.DIAL:UH(this,new gd(this.K,D,this.W,this.config_));break;case chrome.cast.ReceiverType.CAST:UH(this,new Pc(this.K,D,this.config_));break;default:this.vr("Unknown receiver type: "+D.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.D&&this.D.K.label==D.label?this.D.stop():this.vr("Stopping receiver w/o session: "+D.friendlyName)}else this.vr("onReceiverAction_ called without receiver.")}; g.b.PbT=function(D){if(this.eT())return Promise.reject(Error("disposed"));var O=D.receiver;O.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.vr("Not DIAL receiver: "+O.friendlyName),O.receiverType=chrome.cast.ReceiverType.DIAL);var h=this.D?this.D.K:null;if(!h||h.label!=O.label)return this.vr("Receiving DIAL launch request for non-clicked DIAL receiver: "+O.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(h&&h.label==O.label&&h.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.D.D)return EH("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.D.D),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.vr('Changing CAST intent from "'+h.receiverType+'" to "dial" for '+O.friendlyName);UH(this,new gd(this.K,O,this.W,this.config_))}O=this.D;O.T=D;O.T.appState==chrome.cast.DialAppState.RUNNING?(D=O.T.extraData||{},h=D.screenId||null,Rl(O)&&D.loungeToken?D.loungeTokenRefreshIntervalMs?D=jTv(O,{name:O.K.friendlyName,screenId:D.screenId,loungeToken:D.loungeToken,dialId:O.T.receiver.label, screenIdType:"shortLived"},D.loungeTokenRefreshIntervalMs):(g.VR(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(D)+".")),D=UQ9(O,h)):D=UQ9(O,h)):D=Kg_(O);return D}; g.b.T8=function(D){var O=this;if(!this.eT()&&!this.Z){EH("New cast session ID: "+D.sessionId);var h=D.receiver;if(h.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.D)if(h.receiverType==chrome.cast.ReceiverType.CAST)EH("Got resumed cast session before resumed mdx connection."),h.friendlyName=chrome.cast.unescape(h.friendlyName),UH(this,new Pc(this.K,h,this.config_),!0);else{this.vr("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var V=this.D.K,k=q6(this.K.MC(), V.label);k&&YK(k,h.label)&&V.receiverType!=chrome.cast.ReceiverType.CAST&&h.receiverType==chrome.cast.ReceiverType.CAST&&(EH("onSessionEstablished_: manual to cast session change "+h.friendlyName),g.SR(this.D),this.D=new Pc(this.K,h,this.config_),this.D.subscribe("sessionScreen",(0,g.Xk)(this.NF,this,this.D)),this.D.subscribe("sessionFailed",function(){return v9C(O,O.D)}),this.D.DA(null)); this.D.Js(D)}}}; g.b.mZ=function(){return this.D?this.D.e$():null}; g.b.HWF=function(D){this.eT()||(this.vr("Failed to estabilish a session: "+g.d7(D)),D.code!=chrome.cast.ErrorCode.CANCEL&&UH(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.b.QMT=function(D){EH("Receiver availability updated: "+D);if(!this.eT()){var O=jA(this);this.L=D==chrome.cast.ReceiverAvailability.AVAILABLE;jA(this)!=O&&this.publish("yt-remote-cast2-availability-change",jA(this))}}; g.b.w_=function(){this.eT()||(this.j=QT8(this),EH("Updating custom receivers: "+g.d7(this.j)),chrome.cast.setCustomReceivers(this.j,function(){},(0,g.Xk)(function(){this.vr("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",jA(this)))}; Kp.prototype.setLaunchParams=Kp.prototype.eOa;Kp.prototype.setConnectedScreenStatus=Kp.prototype.XrW;Kp.prototype.stopSession=Kp.prototype.UO;Kp.prototype.getCastSession=Kp.prototype.mZ;Kp.prototype.requestSession=Kp.prototype.requestSession;Kp.prototype.init=Kp.prototype.init;Kp.prototype.dispose=Kp.prototype.dispose;var ylx=[];g.b=sH.prototype; g.b.reset=function(D){this.listId="";this.index=-1;this.videoId="";ZQR(this);this.volume=-1;this.muted=!1;D&&(this.index=D.index,this.listId=D.listId,this.videoId=D.videoId,this.playerState=D.playerState,this.volume=D.volume,this.muted=D.muted,this.audioTrackId=D.audioTrackId,this.trackData=D.trackData,this.f_=D.hasPrevious,this.gL=D.hasNext,this.L=D.playerTime,this.Z=D.playerTimeAt,this.W=D.seekableStart,this.D=D.seekableEnd,this.J=D.duration,this.T=D.loadedTime,this.j=D.liveIngestionTime,this.K= !isNaN(this.j))}; g.b.isPlaying=function(){return this.playerState==1}; g.b.isBuffering=function(){return this.playerState==3}; g.b.dj=function(){return this.playerState==1081}; g.b.Qj=function(D){this.J=isNaN(D)?0:D}; g.b.getDuration=function(){return this.K?this.J+Wc(this):this.J}; g.b.clone=function(){return new sH(Xs9(this))};g.e(Fu,g.um);g.b=Fu.prototype;g.b.getState=function(){return this.j}; g.b.ND=function(){return this.W.getReconnectTimeout()}; g.b.c9=function(){this.W.reconnect()}; g.b.play=function(){iy(this)?(this.D?this.D.play(null,g.Pg,ol(this,"play")):NV(this,"play"),xQS(this,1,dd(y9(this))),this.publish("remotePlayerChange")):rd(this,this.play)}; g.b.pause=function(){iy(this)?(this.D?this.D.pause(null,g.Pg,ol(this,"pause")):NV(this,"pause"),xQS(this,2,dd(y9(this))),this.publish("remotePlayerChange")):rd(this,this.pause)}; g.b.seekTo=function(D){if(iy(this)){if(this.D){var O=y9(this),h=new chrome.cast.media.SeekRequest;h.currentTime=D;O.isPlaying()||O.isBuffering()?h.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:h.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.D.seek(h,g.Pg,ol(this,"seekTo",{newTime:D}))}else NV(this,"seekTo",{newTime:D});xQS(this,3,D);this.publish("remotePlayerChange")}else rd(this,g.Bq(this.seekTo,D))}; g.b.stop=function(){if(iy(this)){this.D?this.D.stop(null,g.Pg,ol(this,"stopVideo")):NV(this,"stopVideo");var D=y9(this);D.index=-1;D.videoId="";ZQR(D);pp(this,D);this.publish("remotePlayerChange")}else rd(this,this.stop)}; g.b.setVolume=function(D,O){if(iy(this)){var h=y9(this);if(this.K){if(h.volume!=D){var V=Math.round(D)/100;this.K.setReceiverVolumeLevel(V,(0,g.Xk)(function(){kp("set receiver volume: "+V)},this),(0,g.Xk)(function(){this.vr("failed to set receiver volume.")},this))}h.muted!=O&&this.K.setReceiverMuted(O,(0,g.Xk)(function(){kp("set receiver muted: "+O)},this),(0,g.Xk)(function(){this.vr("failed to set receiver muted.")},this))}else{var k={volume:D, muted:O};h.volume!=-1&&(k.delta=D-h.volume);NV(this,"setVolume",k)}h.muted=O;h.volume=D;pp(this,h)}else rd(this,g.Bq(this.setVolume,D,O))}; g.b.Zw=function(D,O){if(iy(this)){var h=y9(this);D={videoId:D};O&&(h.trackData={trackName:O.name,languageCode:O.languageCode,sourceLanguageCode:O.translationLanguage?O.translationLanguage.languageCode:"",languageName:O.languageName,kind:O.kind},D.style=g.d7(O.style),g.n2(D,h.trackData));NV(this,"setSubtitlesTrack",D);pp(this,h)}else rd(this,g.Bq(this.Zw,D,O))}; g.b.setAudioTrack=function(D,O){iy(this)?(O=O.getLanguageInfo().getId(),NV(this,"setAudioTrack",{videoId:D,audioTrackId:O}),D=y9(this),D.audioTrackId=O,pp(this,D)):rd(this,g.Bq(this.setAudioTrack,D,O))}; g.b.playVideo=function(D,O,h,V,k,C,M){V=V===void 0?null:V;k=k===void 0?null:k;C=C===void 0?null:C;M=M===void 0?null:M;var c=y9(this),S={videoId:D};h!==void 0&&(S.currentIndex=h);zk(c,D,h||0);O!==void 0&&(Tk(c,O),S.currentTime=O);V&&(S.listId=V);k&&(S.playerParams=k);C&&(S.clickTrackingParams=C);M&&(S.locationInfo=g.d7(M));NV(this,"setPlaylist",S);V||pp(this,c)}; g.b.yn=function(D,O){if(iy(this)){if(D&&O){var h=y9(this);zk(h,D,O);pp(this,h)}NV(this,"previous")}else rd(this,g.Bq(this.yn,D,O))}; g.b.nextVideo=function(D,O){if(iy(this)){if(D&&O){var h=y9(this);zk(h,D,O);pp(this,h)}NV(this,"next")}else rd(this,g.Bq(this.nextVideo,D,O))}; g.b.xs=function(){if(iy(this)){NV(this,"clearPlaylist");var D=y9(this);D.reset();pp(this,D);this.publish("remotePlayerChange")}else rd(this,this.xs)}; g.b.nJ=function(){iy(this)?NV(this,"dismissAutoplay"):rd(this,this.nJ)}; g.b.dispose=function(){if(this.j!=3){var D=this.j;this.j=3;this.publish("proxyStateChange",D,this.j)}g.um.prototype.dispose.call(this)}; g.b.fF=function(){l3C(this);this.W=null;this.J.clear();np(this,null);g.um.prototype.fF.call(this)}; g.b.e9=function(D){if((D!=this.j||D==2)&&this.j!=3&&D!=0){var O=this.j;this.j=D;this.publish("proxyStateChange",O,D);if(D==1)for(;!this.J.isEmpty();)O=D=this.J,O.D.length===0&&(O.D=O.K,O.D.reverse(),O.K=[]),D.D.pop().apply(this);else D==3&&this.dispose()}}; g.b.OpE=function(D,O){this.publish(D,O)}; g.b.xvT=function(D){if(!D)this.Nb(null),np(this,null);else if(this.K.receiver.volume){D=this.K.receiver.volume;var O=y9(this),h=Math.round(100*D.level||0);if(O.volume!=h||O.muted!=D.muted)kp("Cast volume update: "+D.level+(D.muted?" muted":"")),O.volume=h,O.muted=!!D.muted,pp(this,O)}}; g.b.Nb=function(D){kp("Cast media: "+!!D);this.D&&this.D.removeUpdateListener(this.T);if(this.D=D)this.D.addUpdateListener(this.T),$Q_(this),this.publish("remotePlayerChange")}; g.b.b12=function(D){D?($Q_(this),this.publish("remotePlayerChange")):this.Nb(null)}; g.b.tJ=function(){NV(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.b.VJE=function(){var D=psU();D&&np(this,D)}; g.b.vr=function(D){V9("CP",D)};g.e(Bc,g.um);g.b=Bc.prototype; g.b.connect=function(D,O){if(O){var h=O.listId,V=O.videoId,k=O.videoIds,C=O.playerParams,M=O.clickTrackingParams,c=O.index,S={videoId:V},Y=O.currentTime,J=O.locationInfo;O=O.loopMode;Y!==void 0&&(S.currentTime=Y<=5?0:Y);C&&(S.playerParams=C);J&&(S.locationInfo=J);M&&(S.clickTrackingParams=M);h&&(S.listId=h);k&&k.length>0&&(S.videoIds=k.join(","));c!==void 0&&(S.currentIndex=c);this.ME&&(S.loopMode=O||"LOOP_MODE_OFF");h&&(this.D.listId=h);this.D.videoId=V;this.D.index=c||0;this.D.state=3;Tk(this.D, Y);this.J="UNSUPPORTED";h=this.ME?"setInitialState":"setPlaylist";Zl("Connecting with "+h+" and params: "+g.d7(S));this.K.connect({method:h,params:g.d7(S)},D,f__())}else Zl("Connecting without params"),this.K.connect({},D,f__());hnR(this)}; g.b.LK=function(D){this.K.LK(D)}; g.b.dispose=function(){this.eT()||(g.nT("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),Xu(this,3));g.um.prototype.dispose.call(this)}; g.b.fF=function(){Vw0(this);Cc8(this);kLL(this);g.Kc(this.T);this.T=NaN;g.Kc(this.U);this.U=NaN;this.W=null;g.GF(this.Ew);this.Ew.length=0;this.K.dispose();g.um.prototype.fF.call(this);this.J=this.L=this.j=this.D=this.K=null}; g.b.m9=function(D){if(!this.j||this.j.length===0)return!1;for(var O=g.P(this.j),h=O.next();!h.done;h=O.next())if(!h.value.capabilities.has(D))return!1;return!0}; g.b.zW=function(){var D=3;this.eT()||(D=0,isNaN(this.Rs())?this.K.lx()&&isNaN(this.Z)&&(D=1):D=2);return D}; g.b.BX=function(D){Zl("Disconnecting with "+D);g.nT("yt.mdx.remote.remoteClient_",null);Vw0(this);this.publish("beforeDisconnect",D);D==1&&mj();this.K.disconnect(D);this.dispose()}; g.b.fN=function(){var D=this.D;this.W&&(D=this.D.clone(),zk(D,this.W,D.index));return Xs9(D)}; g.b.y_a=function(D){var O=this,h=new sH(D);h.videoId&&h.videoId!=this.D.videoId&&(this.W=h.videoId,g.Kc(this.T),this.T=g.a2(function(){if(O.W){var k=O.W;O.W=null;O.D.videoId!=k&&ly(O,"getNowPlaying")}},5E3)); var V=[];this.D.listId==h.listId&&this.D.videoId==h.videoId&&this.D.index==h.index||V.push("remoteQueueChange");this.D.playerState==h.playerState&&this.D.volume==h.volume&&this.D.muted==h.muted&&dd(this.D)==dd(h)&&g.d7(this.D.trackData)==g.d7(h.trackData)||V.push("remotePlayerChange");this.D.reset(D);g.Je(V,function(k){this.publish(k)},this)}; g.b.AF=function(){var D=this.K.getDeviceId(),O=g.Zm(this.j,function(h){return h.type=="REMOTE_CONTROL"&&h.id!=D}); return O?O.id:""}; g.b.Rs=function(){return this.K.ND()}; g.b.OQ=function(){return this.J||"UNSUPPORTED"}; g.b.PE=function(){return this.L||""}; g.b.Dq=function(){!isNaN(this.Rs())&&this.K.c9()}; g.b.zOw=function(D,O){ly(this,D,O);bLv(this)}; g.b.yV=function(){var D=g.rt("SAPISID","")||g.rt("__Secure-1PAPISID")||"",O=g.rt("__Secure-3PAPISID","")||"";if(!D&&!O)return"";D=g.LW(g.gU(D),2);O=g.LW(g.gU(O),2);return g.LW(g.gU(","+D+","+O),2)}; Bc.prototype.subscribe=Bc.prototype.subscribe;Bc.prototype.unsubscribeByKey=Bc.prototype.bW;Bc.prototype.getProxyState=Bc.prototype.zW;Bc.prototype.disconnect=Bc.prototype.BX;Bc.prototype.getPlayerContextData=Bc.prototype.fN;Bc.prototype.setPlayerContextData=Bc.prototype.y_a;Bc.prototype.getOtherConnectedRemoteId=Bc.prototype.AF;Bc.prototype.getReconnectTimeout=Bc.prototype.Rs;Bc.prototype.getAutoplayMode=Bc.prototype.OQ;Bc.prototype.getAutoplayVideoId=Bc.prototype.PE;Bc.prototype.reconnect=Bc.prototype.Dq; Bc.prototype.sendMessage=Bc.prototype.zOw;Bc.prototype.getXsrfToken=Bc.prototype.yV;Bc.prototype.isCapabilitySupportedOnConnectedDevices=Bc.prototype.m9;g.e(gnJ,cc);g.b=gnJ.prototype;g.b.MC=function(D){return this.cM.$_gs(D)}; g.b.contains=function(D){return!!this.cM.$_c(D)}; g.b.get=function(D){return this.cM.$_g(D)}; g.b.start=function(){this.cM.$_st()}; g.b.add=function(D,O,h){this.cM.$_a(D,O,h)}; g.b.remove=function(D,O,h){this.cM.$_r(D,O,h)}; g.b.N7=function(D,O,h,V){this.cM.$_un(D,O,h,V)}; g.b.fF=function(){for(var D=this.D.length,O=0;O<D;++O)this.cM.$_ubk(this.D[O]);this.D.length=0;this.cM=null;cc.prototype.fF.call(this)}; g.b.Ku=function(){this.publish("screenChange")}; g.b.gZa=function(){this.publish("onlineScreenChange")}; uy.prototype.$_st=uy.prototype.start;uy.prototype.$_gspc=uy.prototype.Qg;uy.prototype.$_gsppc=uy.prototype.S$;uy.prototype.$_c=uy.prototype.contains;uy.prototype.$_g=uy.prototype.get;uy.prototype.$_a=uy.prototype.add;uy.prototype.$_un=uy.prototype.N7;uy.prototype.$_r=uy.prototype.remove;uy.prototype.$_gs=uy.prototype.MC;uy.prototype.$_gos=uy.prototype.Hw;uy.prototype.$_s=uy.prototype.subscribe;uy.prototype.$_ubk=uy.prototype.bW;var bN=null,Y1=!1,xp=null,$p=null,vn0=null,h9=[];g.e(TWC,g.n);g.b=TWC.prototype;g.b.fF=function(){g.n.prototype.fF.call(this);this.D.stop();this.K.stop();this.L.stop();var D=this.qA;D.unsubscribe("proxyStateChange",this.Vw,this);D.unsubscribe("remotePlayerChange",this.mR,this);D.unsubscribe("remoteQueueChange",this.Dg,this);D.unsubscribe("previousNextChange",this.bP,this);D.unsubscribe("nowAutoplaying",this.Lz,this);D.unsubscribe("autoplayDismissed",this.qF,this);this.qA=this.module=null}; g.b.sf=function(D){var O=g.GR.apply(1,arguments);if(this.qA.j!=2)if(J9(this)){if(!y9(this.qA).dj()||D!=="control_seek")switch(D){case "control_toggle_play_pause":y9(this.qA).isPlaying()?this.qA.pause():this.qA.play();break;case "control_play":this.qA.play();break;case "control_pause":this.qA.pause();break;case "control_seek":this.Z.uO(O[0],O[1]);break;case "control_subtitles_set_track":znR(this,O[0]);break;case "control_set_audio_track":this.setAudioTrack(O[0])}}else switch(D){case "control_toggle_play_pause":case "control_play":case "control_pause":O= this.C.getCurrentTime();qr(this,O===0?void 0:O);break;case "control_seek":qr(this,O[0]);break;case "control_subtitles_set_track":znR(this,O[0]);break;case "control_set_audio_track":this.setAudioTrack(O[0])}}; g.b.aT7=function(D){this.L.a5(D)}; g.b.yiF=function(D){this.sf("control_subtitles_set_track",g.sO(D)?null:D)}; g.b.wW=function(){var D=this.C.getOption("captions","track");g.sO(D)||znR(this,D)}; g.b.Zn=function(D){this.module.Zn(D,this.C.getVideoData().lengthSeconds)}; g.b.JC1=function(){g.sO(this.j)||nnm(this,this.j);this.W=!1}; g.b.Vw=function(D,O){this.K.stop();O===2&&this.z1()}; g.b.mR=function(){if(J9(this)){this.D.stop();var D=y9(this.qA);switch(D.playerState){case 1080:case 1081:case 1084:case 1085:this.module.I4=1;break;case 1082:case 1083:this.module.I4=0;break;default:this.module.I4=-1}switch(D.playerState){case 1081:case 1:this.WF(new g.He(8));this.qd();break;case 1085:case 3:this.WF(new g.He(9));break;case 1083:case 0:this.WF(new g.He(2));this.Z.stop();this.Zn(this.C.getVideoData().lengthSeconds);break;case 1084:this.WF(new g.He(4));break;case 2:this.WF(new g.He(4)); this.Zn(dd(D));break;case -1:this.WF(new g.He(64));break;case -1E3:this.WF(new g.He(128,{errorCode:"mdx.remoteerror",errorMessage:"Este v\u00eddeo n\u00e3o est\u00e1 dispon\u00edvel para reprodu\u00e7\u00e3o remota.",Ex:2}))}D=y9(this.qA).trackData;var O=this.j;(D||O?D&&O&&D.trackName==O.trackName&&D.languageCode==O.languageCode&&D.languageName==O.languageName&&D.kind==O.kind:1)||(this.j=D,nnm(this,D));D=y9(this.qA);D.volume===-1||Math.round(this.C.getVolume())===D.volume&&this.C.isMuted()===D.muted|| this.T.isActive()||this.jF()}else de_(this)}; g.b.bP=function(){this.C.publish("mdxpreviousnextchange")}; g.b.Dg=function(){J9(this)||de_(this)}; g.b.Lz=function(D){isNaN(D)||this.C.publish("mdxnowautoplaying",D)}; g.b.qF=function(){this.C.publish("mdxautoplaycanceled")}; g.b.setAudioTrack=function(D){J9(this)&&this.qA.setAudioTrack(this.C.getVideoData(1).videoId,D)}; g.b.seekTo=function(D,O){y9(this.qA).playerState===-1?qr(this,D):O&&this.qA.seekTo(D)}; g.b.jF=function(){var D=this;if(J9(this)){var O=y9(this.qA);this.events.XT(this.U);O.muted?this.C.mute():this.C.unMute();this.C.setVolume(O.volume);this.U=this.events.G(this.C,"onVolumeChange",function(h){sB_(D,h)})}}; g.b.qd=function(){this.D.stop();if(!this.qA.eT()){var D=y9(this.qA);D.isPlaying()&&this.WF(new g.He(8));this.Zn(dd(D));this.D.start()}}; g.b.z1=function(){this.K.stop();this.D.stop();var D=this.qA.ND();this.qA.j==2&&!isNaN(D)&&this.K.start()}; g.b.WF=function(D){this.K.stop();var O=this.J;if(!g.R7(O,D)){var h=g.l(D,2);h!==g.l(this.J,2)&&this.C.qq(h);this.J=D;yNR(this.module,O,D)}};g.e(uN,g.N);uN.prototype.kZ=function(){this.D.show()}; uN.prototype.ZT=function(){this.D.hide()}; uN.prototype.K=function(){LU("mdx-privacy-popup-cancel");this.ZT()}; uN.prototype.j=function(){LU("mdx-privacy-popup-confirm");this.ZT()};g.e(JS,g.N);JS.prototype.onStateChange=function(D){this.pp(D.state)}; JS.prototype.pp=function(D){if(this.api.getPresentingPlayerType()===3){var O={RECEIVER_NAME:this.api.getOption("remote","currentReceiver").name};D=g.l(D,128)?g.a6("Erro em $RECEIVER_NAME",O):D.isPlaying()||D.isPaused()?g.a6("Reproduzindo em $RECEIVER_NAME",O):g.a6("Conectado a $RECEIVER_NAME",O);this.updateValue("statustext",D);this.D.show()}else this.D.hide()};g.e(uP,g.MI);uP.prototype.W=function(){var D=this.C.getOption("remote","receivers");D&&D.length>1&&!this.C.getOption("remote","quickCast")?(this.pY=g.qt(D,this.D,this),this.lk(g.WS(D,this.D)),D=this.C.getOption("remote","currentReceiver"),D=this.D(D),this.options[D]&&this.CU(D),this.enable(!0)):this.enable(!1)}; uP.prototype.D=function(D){return D.key}; uP.prototype.W8=function(D){return D==="cast-selector-receiver"?"Elenco...":this.pY[D].name}; uP.prototype.jf=function(D){g.MI.prototype.jf.call(this,D);this.C.setOption("remote","currentReceiver",this.pY[D]);this.qv.ZT()};g.e(F8R,g.dX);g.b=F8R.prototype; g.b.create=function(){var D=this.player.V(),O=g.v_(D);D={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:D.S("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:D.S("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:D.S("enable_cast_short_lived_lounge_token")};EnC(O,D);this.subscriptions.push(g.ex("yt-remote-before-disconnect",this.Lr8,this));this.subscriptions.push(g.ex("yt-remote-connection-change",this.nZ1,this));this.subscriptions.push(g.ex("yt-remote-receiver-availability-change",this.G8, this));this.subscriptions.push(g.ex("yt-remote-auto-connect",this.rC5,this));this.subscriptions.push(g.ex("yt-remote-receiver-resumed",this.Fn3,this));this.subscriptions.push(g.ex("mdx-privacy-popup-confirm",this.yr1,this));this.subscriptions.push(g.ex("mdx-privacy-popup-cancel",this.ZG3,this));this.G8()}; g.b.load=function(){this.player.cancelPlayback();g.dX.prototype.load.call(this);this.l7=new TWC(this,this.player,this.qA);var D=(D=wdm())?D.currentTime:0;var O=tw0()?new Fu(Mr(),void 0):null;D==0&&O&&(D=dd(y9(O)));D!==0&&this.Zn(D);yNR(this,this.Oq,this.Oq);this.player.rI(6)}; g.b.unload=function(){this.player.publish("mdxautoplaycanceled");this.SZ=this.L_;g.YC(this.l7,this.qA);this.qA=this.l7=null;g.dX.prototype.unload.call(this);this.player.rI(5);Ho(this)}; g.b.fF=function(){g.LY(this.subscriptions);g.dX.prototype.fF.call(this)}; g.b.PY=function(D){var O=g.GR.apply(1,arguments);this.loaded&&this.l7.sf.apply(this.l7,[D].concat(g.a(O)))}; g.b.getAdState=function(){return this.I4}; g.b.f_=function(){return this.qA?y9(this.qA).f_:!1}; g.b.gL=function(){return this.qA?y9(this.qA).gL:!1}; g.b.Zn=function(D,O){this.qm=D||0;this.player.publish("progresssync",D,O);this.player.Gx("onVideoProgress",D||0)}; g.b.getCurrentTime=function(){return this.qm}; g.b.getProgressState=function(){var D=y9(this.qA),O=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!D.dj()&&this.player.HM(),clipEnd:O.clipEnd,clipStart:O.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:D.getDuration(),ingestionTime:D.K?D.j+Wc(D):D.j,isAtLiveHead:(D.K?D.D+Wc(D):D.D)-this.getCurrentTime()<=1,loaded:D.T,seekableEnd:D.K?D.D+Wc(D):D.D,seekableStart:D.W>0?D.W+Wc(D):D.W,offset:0,viewerLivestreamJoinMediaTime:0}}; g.b.nextVideo=function(){this.qA&&this.qA.nextVideo()}; g.b.yn=function(){this.qA&&this.qA.yn()}; g.b.Lr8=function(D){D===1&&(this.eI=this.qA?y9(this.qA):null)}; g.b.nZ1=function(){var D=tw0()?new Fu(Mr(),void 0):null;if(D){var O=this.SZ;this.loaded&&this.unload();this.qA=D;this.eI=null;O.key!==this.L_.key&&(this.SZ=O,this.load())}else g.SR(this.qA),this.qA=null,this.loaded&&(this.unload(),(D=this.eI)&&D.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(D.videoId,dd(D)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.b.G8=function(){var D=[this.L_],O=D.concat,h=jBx();vc()&&g.yu("yt-remote-cast-available")&&h.push({key:"cast-selector-receiver",name:"Cast..."});this.pY=O.call(D,h);D=ANL()||this.L_;m$(this,D);this.player.Gx("onMdxReceiversChange")}; g.b.rC5=function(){var D=ANL();m$(this,D)}; g.b.Fn3=function(){this.SZ=ANL()}; g.b.yr1=function(){this.X6=!0;Ho(this);Y1=!1;bN&&SN(bN,1);bN=null}; g.b.ZG3=function(){this.X6=!1;Ho(this);m$(this,this.L_);this.SZ=this.L_;Y1=!1;bN=null;this.player.playVideo()}; g.b.nm=function(D,O){switch(D){case "casting":return this.loaded;case "receivers":return this.pY;case "currentReceiver":return O&&(O.key==="cast-selector-receiver"?NNS():m$(this,O)),this.loaded?this.SZ:this.L_;case "quickCast":return this.pY.length===2&&this.pY[1].key==="cast-selector-receiver"?(O&&NNS(),!0):!1}}; g.b.tJ=function(){this.qA.tJ()}; g.b.PS=function(){return!1}; g.b.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.b.isLoggedIn=function(){var D,O;return((D=g.DE("PLAYER_CONFIG"))==null?void 0:(O=D.args)==null?void 0:O.authuser)!==void 0?!0:!(!g.DE("SESSION_INDEX")&&!g.DE("LOGGED_IN"))};g.TP("remote",F8R);})(_yt_player);