project-totopia/w-demo.com_capture/html_sources/유저1/user_메인페이지_files/remote.js.다운로드
2019-07-21 06:39:16 +09:00

524 lines
87 KiB
Plaintext

(function(g){var window=this;var jqa=function(a,b){return g.Ub(a,b)},Y5=function(){},kqa=function(a){if(a.Bc&&"function"==typeof a.Bc)return a.Bc();
if(g.Da(a))return a.split("");if(g.La(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return g.Qb(a)},lqa=function(a,b){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,void 0);
else if(g.La(a)||g.Da(a))(0,g.y)(a,b,void 0);else{if(a.Pd&&"function"==typeof a.Pd)var c=a.Pd();else if(a.Bc&&"function"==typeof a.Bc)c=void 0;else if(g.La(a)||g.Da(a)){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e)}else c=g.Rb(a);d=kqa(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)}},Z5=function(a){g.sn(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^(0,g.D)()).toString(36));
return a},$5=function(a,b,c){g.Ka(c)||(c=[String(c)]);
g.xn(a.l,b,c)},a6=function(a){return(a=g.Qo(a))?new ActiveXObject(a):new XMLHttpRequest},b6=function(a,b){return b+" ["+a.Y+" "+a.D+" "+a.getStatus()+"]"},mqa=function(a){return"content-type"==a.toLowerCase()},c6=function(a){a.g&&a.I&&(a.g.ontimeout=null);
a.F&&(g.u.clearTimeout(a.F),a.F=null)},nqa=function(a){return g.Ld&&g.ld(9)&&g.Fa(a.timeout)&&g.Ca(a.ontimeout)},d6=function(a){a.P||(a.P=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))},e6=function(a,b){if(a.g){c6(a);
var c=a.g,d=a.R[0]?g.Ha:null;a.g=null;a.R=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){}}},f6=function(a,b){a.i=!1;
a.g&&(a.o=!0,a.g.abort(),a.o=!1);a.l=b;a.u=5;d6(a);e6(a)},g6=function(a){return a.g?a.g.readyState:0},h6=function(a){if(a.i&&"undefined"!=typeof g.XY)if(a.R[1]&&4==g6(a)&&2==a.getStatus())b6(a,"Local request error detected and ignored");
else if(a.B&&4==g6(a))g.Gg(a.Fw,0,a);else if(a.dispatchEvent("readystatechange"),4==g6(a)){b6(a,"Request complete");a.i=!1;try{var b=a.getStatus();a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var c=!0;break a;default:c=!1}var d;if(!(d=c)){var e;if(e=0===b){var f=g.Sg(1,String(a.D));if(!f&&g.u.self&&g.u.self.location){var k=g.u.self.location.protocol;f=k.substr(0,k.length-1)}e=!oqa.test(f?f.toLowerCase():"")}d=e}if(d)a.dispatchEvent("complete"),a.dispatchEvent("success");
else{a.u=6;try{var l=2<g6(a)?a.g.statusText:""}catch(m){l=""}a.l=l+" ["+a.getStatus()+"]";d6(a)}}finally{e6(a)}}},i6=function(a){g.Qf.call(this);
this.headers=new g.gn;this.M=a||null;this.i=!1;this.R=this.g=null;this.Y=this.D="";this.u=0;this.l="";this.o=this.aa=this.B=this.P=!1;this.A=0;this.F=null;this.X="";this.I=this.T=!1},j6=function(a){try{return a.g?a.g.responseText:""}catch(b){return""}},pqa=function(a,b){var c=[];
g.Rk(b,function(d){try{var e=g.ep.prototype.i.call(this,d,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}g.Ca(e)?g.dp(e)&&c.push(d):c.push(d)},a);
return c},qqa=function(a,b){var c=pqa(a,b);
(0,g.y)(c,function(d){g.ep.prototype.remove.call(this,d)},a)},k6=function(a){if(a.gd){if(a.gd.locationOverrideToken)return{locationOverrideToken:a.gd.locationOverrideToken};
if(null!=a.gd.latitudeE7&&null!=a.gd.longitudeE7)return{latitudeE7:a.gd.latitudeE7,longitudeE7:a.gd.longitudeE7}}return null},rqa=function(a,b){g.$a(a,b)||a.push(b)},l6=function(a){var b=0,c;
for(c in a)b++;return b},m6=function(a,b){var c=b instanceof g.xc?b:g.Dc(b,/^data:image\//i.test(b));
a.src=g.yc(c)},sqa=function(a){try{return g.u.JSON.parse(a)}catch(b){}a=String(a);
if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.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("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);},tqa=function(a,b,c,d){var e=new g.kn(null,void 0);
a&&g.ln(e,a);b&&g.mn(e,b);c&&g.nn(e,c);d&&(e.i=d);return e},n6=function(a){if(g.u.JSON)try{return g.u.JSON.parse(a)}catch(b){}return sqa(a)},o6=function(){this.g=[];
this.i=[]},p6=function(a,b){g.jq[a]=!0;
var c=g.hq();c&&c.publish.apply(c,arguments);g.jq[a]=!1},q6=function(a){this.app=this.name=this.id="";
this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.l=!1;this.capabilities=new Set;this.experiments=new Set;this.theme="u";new g.gn;this.g=this.i="";a&&(this.id=a.id||a.name,this.name=a.name,this.app=a.app,this.type=a.type||"REMOTE_CONTROL",this.username=a.user||"",this.avatar=a.userAvatarUri||"",this.obfuscatedGaiaId=a.obfuscatedGaiaId||"",this.theme=a.theme||"u",uqa(this,a.capabilities||""),vqa(this,a.experiments||""),this.i=a.remoteControllerUrl||"",this.g=a.localChannelEncryptionKey||
"")},uqa=function(a,b){a.capabilities.clear();
(0,g.Xd)(b.split(","),g.Qa(jqa,wqa)).forEach(function(c){a.capabilities.add(c)})},vqa=function(a,b){a.experiments.clear();
b.split(",").forEach(function(c){a.experiments.add(c)})},r6=function(a){a=a||{};
this.name=a.name||"";this.id=a.id||a.screenId||"";this.token=a.token||a.loungeToken||"";this.uuid=a.uuid||a.dialId||""},s6=function(a,b){return!!b&&(a.id==b||a.uuid==b)},t6=function(a){return{name:a.name,
screenId:a.id,loungeToken:a.token,dialId:a.uuid}},xqa=function(a){return new r6(a)},u6=function(a){return g.Ka(a)?(0,g.ge)(a,xqa):[]},v6=function(a){return a?'{name:"'+a.name+'",id:'+a.id.substr(0,6)+"..,token:"+(a.token?".."+a.token.slice(-6):"-")+",uuid:"+(a.uuid?".."+a.uuid.slice(-6):"-")+"}":"null"},w6=function(a){return g.Ka(a)?"["+(0,g.ge)(a,v6).join(",")+"]":"null"},x6=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0;
return("x"==a?b:b&3|8).toString(16)})},yqa=function(a){return(0,g.ge)(a,function(b){return{key:b.id,
name:b.name}})},y6=function(a,b){return g.Xa(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},z6=function(a,b){return g.Xa(a,function(c){return s6(c,b)})},A6=function(a){try{var b=(0,g.Gt)(),c=(0,g.Ft)();
b&&b.remove(a);c&&c.remove(a)}catch(d){}},zqa=function(){var a=(0,g.Ft)();
a&&qqa(a,a.g.nf(!0))},B6=function(){var a=g.It("yt-remote-connected-devices")||[];
g.qb(a);return a},Aqa=function(a){if(0==a.length)return[];
var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return(0,g.ge)(a,function(d,e){return 0==e?d:d.substring(c.length)})},C6=function(a){g.Ht("yt-remote-connected-devices",a,86400)},E6=function(){if(D6)return D6;
var a=g.It("yt-remote-device-id");a||(a=x6(),g.Ht("yt-remote-device-id",a,31536E3));for(var b=B6(),c=1,d=a;g.$a(b,d);)c++,d=a+"#"+c;return D6=d},F6=function(){var a=B6(),b=E6();
g.$a(a,b);g.Jt()&&g.sb(a,b);a=Aqa(a);if(0==a.length)try{g.Ks("remote_sid")}catch(c){}else try{g.Js("remote_sid",a.join(","),-1)}catch(c){}},G6=function(){return g.It("yt-remote-session-browser-channel")},H6=function(){return g.It("yt-remote-local-screens")||[]},I6=function(){g.Ht("yt-remote-lounge-token-expiration",!0,86400)},Bqa=function(a){5<a.length&&(a=a.slice(a.length-5));
var b=(0,g.ge)(H6(),function(d){return d.loungeToken}),c=(0,g.ge)(a,function(d){return d.loungeToken});
(0,g.mj)(c,function(d){return!g.$a(b,d)})&&I6();
g.Ht("yt-remote-local-screens",a,31536E3)},Cqa=function(a,b){g.Ht("yt-remote-session-browser-channel",a);
g.Ht("yt-remote-session-screen-id",b);var c=B6(),d=E6();g.$a(c,d)||c.push(d);C6(c);F6()},J6=function(a){a||(A6("yt-remote-session-screen-id"),A6("yt-remote-session-video-id"));
F6();a=B6();g.cb(a,E6());C6(a)},L6=function(){if(!K6){var a=g.op();
a&&(K6=new g.Zo(a))}return K6?!!K6.get("yt-remote-use-staging-server"):!1},M6=function(a){return!!document.currentScript&&(-1!=document.currentScript.src.indexOf("?"+a)||-1!=document.currentScript.src.indexOf("&"+a))},N6=function(){return"function"==typeof window.__onGCastApiAvailable?window.__onGCastApiAvailable:null},P6=function(a){a.length?O6(a.shift(),function(){P6(a)}):Q6()},Dqa=function(a){return"chrome-extension://"+a+"/cast_sender.js"},O6=function(a,b,c){var d=document.createElement("script");
d.onerror=b;c&&(d.onload=c);d.src=a;(document.head||document.documentElement).appendChild(d)},Q6=function(){var a=N6();
a&&a(!1,"No cast extension found")},R6=function(){if(Eqa){var a=2,b=N6(),c=function(){a--;
0==a&&b&&b(!0)};
window.__onGCastApiAvailable=c;O6("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",Q6,c)}},Fqa=function(){R6();
var a=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);P6(["//www.gstatic.com/eureka/clank/"+(a?parseInt(a[1],10):0)+"/cast_sender.js","//www.gstatic.com/eureka/clank/cast_sender.js"])},S6=function(a,b,c){g.A.call(this);
this.A=null!=c?(0,g.x)(a,c):a;this.Zc=b;this.u=(0,g.x)(this.ED,this);this.g=!1;this.i=0;this.l=this.Aa=null;this.o=[]},T6=function(){},U6=function(a,b,c,d){this.g=a;
this.l=b;this.B=c;this.A=d||1;this.o=45E3;this.ca=new g.yn(this);this.i=new g.Fg;this.i.setInterval(250)},W6=function(a,b,c){a.Yh=1;
a.ag=Z5(b.clone());a.sh=c;a.u=!0;V6(a,null)},X6=function(a,b,c,d,e){a.Yh=1;
a.ag=Z5(b.clone());a.sh=null;a.u=c;e&&(a.wA=!1);V6(a,d)},V6=function(a,b){a.Hi=(0,g.D)();
Y6(a);a.Eg=a.ag.clone();$5(a.Eg,"t",a.A);a.ql=0;a.wc=a.g.Up(a.g.Yk()?b:null);0<a.Cq&&(a.co=new g.Jl((0,g.x)(a.CB,a,a.wc),a.Cq));a.ca.da(a.wc,"readystatechange",a.yM);var c=a.Zg?g.bc(a.Zg):{};a.sh?(a.Lo="POST",c["Content-Type"]="application/x-www-form-urlencoded",a.wc.send(a.Eg,a.Lo,a.sh,c)):(a.Lo="GET",a.wA&&!g.Nd&&(c.Connection="close"),a.wc.send(a.Eg,a.Lo,null,c));a.g.Ae(1)},e7=function(a,b,c){for(var d=!0;!a.Og&&a.ql<c.length;){var e=Gqa(a,c);
if(e==Z6){4==b&&(a.rg=4,$6(15),d=!1);break}else if(e==a7){a.rg=4;$6(16);d=!1;break}else b7(a,e)}4==b&&0==c.length&&(a.rg=1,$6(17),d=!1);a.De=a.De&&d;d||(c7(a),d7(a))},Gqa=function(a,b){var c=a.ql,d=b.indexOf("\n",c);
if(-1==d)return Z6;c=Number(b.substring(c,d));if(isNaN(c))return a7;d+=1;if(d+c>b.length)return Z6;var e=b.substr(d,c);a.ql=d+c;return e},h7=function(a,b){a.Hi=(0,g.D)();
Y6(a);var c=b?window.location.hostname:"";a.Eg=a.ag.clone();g.sn(a.Eg,"DOMAIN",c);g.sn(a.Eg,"t",a.A);try{a.He=new ActiveXObject("htmlfile")}catch(n){c7(a);a.rg=7;$6(22);d7(a);return}var d="<html><body>";if(b){for(var e="",f=0;f<c.length;f++){var k=c.charAt(f);if("<"==k)e+="\\x3c";else if(">"==k)e+="\\x3e";else{var l=k;if(l in f7)k=f7[l];else if(l in g7)k=f7[l]=g7[l];else{var m=l.charCodeAt(0);if(31<m&&127>m)k=l;else{if(256>m){if(k="\\x",16>m||256<m)k+="0"}else k="\\u",4096>m&&(k+="0");k+=m.toString(16).toUpperCase()}k=
f7[l]=k}e+=k}}d+='<script>document.domain="'+e+'"\x3c/script>'}c=g.Rc(g.qc("b/12014412"),d+"</body></html>");a.He.open();a.He.write(g.Mc(c));a.He.close();a.He.parentWindow.m=(0,g.x)(a.NL,a);a.He.parentWindow.d=(0,g.x)(a.Dz,a,!0);a.He.parentWindow.rpcClose=(0,g.x)(a.Dz,a,!1);c=a.He.createElement("DIV");a.He.parentWindow.document.body.appendChild(c);d=g.Cc(a.Eg.toString());d=g.Yc(g.zc(d));d=g.Rc(g.qc("b/12014412"),'<iframe src="'+d+'"></iframe>');g.Sc(c,d);a.g.Ae(1)},Y6=function(a){a.Lt=(0,g.D)()+a.o;
i7(a,a.o)},i7=function(a,b){if(null!=a.Zi)throw Error("WatchDog timer not null");
a.Zi=j7((0,g.x)(a.XL,a),b)},k7=function(a){a.Zi&&(g.u.clearTimeout(a.Zi),a.Zi=null)},d7=function(a){a.g.Dw()||a.Og||a.g.Pn(a)},c7=function(a){k7(a);
g.qf(a.co);a.co=null;a.i.stop();g.An(a.ca);if(a.wc){var b=a.wc;a.wc=null;b.abort();b.dispose()}a.He&&(a.He=null)},b7=function(a,b){try{a.g.xz(a,b),a.g.Ae(4)}catch(c){}},m7=function(a,b,c,d,e){if(0==d)c(!1);
else{var f=e||0;d--;l7(a,b,function(k){k?c(!0):g.u.setTimeout(function(){m7(a,b,c,d,f)},f)})}},l7=function(a,b,c){var d=new Image;
d.onload=function(){try{n7(d),c(!0)}catch(e){}};
d.onerror=function(){try{n7(d),c(!1)}catch(e){}};
d.onabort=function(){try{n7(d),c(!1)}catch(e){}};
d.ontimeout=function(){try{n7(d),c(!1)}catch(e){}};
g.u.setTimeout(function(){if(d.ontimeout)d.ontimeout()},b);
m6(d,a)},n7=function(a){a.onload=null;
a.onerror=null;a.onabort=null;a.ontimeout=null},o7=function(a){this.g=a;
this.i=new T6},q7=function(a){var b=p7(a.g,a.oj,"/mail/images/cleardot.gif");
Z5(b);m7(b.toString(),5E3,(0,g.x)(a.LC,a),3,2E3);a.Ae(1)},s7=function(a){var b=a.g.F;
if(null!=b)$6(5),b?($6(11),r7(a.g,a,!1)):($6(12),r7(a.g,a,!0));else if(a.Hd=new U6(a,void 0,void 0,void 0),a.Hd.Zg=a.Aq,b=a.g,b=p7(b,b.Yk()?a.Vj:null,a.Bq),$6(5),!g.Ld||g.od(10))$5(b,"TYPE","xmlhttp"),X6(a.Hd,b,!1,a.Vj,!1);else{$5(b,"TYPE","html");var c=a.Hd;a=!!a.Vj;c.Yh=3;c.ag=Z5(b.clone());h7(c,a)}},t7=function(a,b,c){this.g=1;
this.i=[];this.o=[];this.u=new T6;this.D=a||null;this.F=null!=b?b:null;this.A=c||!1},Hqa=function(a,b){this.g=a;
this.map=b;this.context=null},u7=function(a){g.sf.call(this,"statevent",a)},v7=function(a,b){g.sf.call(this,"timingevent",a);
this.size=b},w7=function(a){g.sf.call(this,"serverreachability",a)},A7=function(a){x7(a);
if(3==a.g){var b=a.Dk++,c=a.rm.clone();g.sn(c,"SID",a.l);g.sn(c,"RID",b);g.sn(c,"TYPE","terminate");y7(a,c);b=new U6(a,a.l,b,void 0);b.Yh=2;b.ag=Z5(c.clone());m6(new Image,b.ag.toString());b.Hi=(0,g.D)();Y6(b)}z7(a)},Iqa=function(a){a.eD(1,0);
a.rm=p7(a,null,a.zq);B7(a)},x7=function(a){a.hg&&(a.hg.abort(),a.hg=null);
a.Ub&&(a.Ub.cancel(),a.Ub=null);a.qf&&(g.u.clearTimeout(a.qf),a.qf=null);C7(a);a.Ed&&(a.Ed.cancel(),a.Ed=null);a.og&&(g.u.clearTimeout(a.og),a.og=null)},Jqa=function(a,b){if(0==a.g)throw Error("Invalid operation: sending map when state is closed");
a.i.push(new Hqa(a.bI++,b));2!=a.g&&3!=a.g||B7(a)},B7=function(a){a.Ed||a.og||(a.og=j7((0,g.x)(a.Cz,a),0),a.Rh=0)},Lqa=function(a,b){if(1==a.g){if(!b){a.Dk=Math.floor(1E5*Math.random());
var c=a.Dk++,d=new U6(a,"",c,void 0);d.Zg=null;var e=D7(a),f=a.rm.clone();g.sn(f,"RID",c);g.sn(f,"CVER","1");y7(a,f);W6(d,f,e);a.Ed=d;a.g=2}}else 3==a.g&&(b?Kqa(a,b):0==a.i.length||a.Ed||Kqa(a))},Kqa=function(a,b){if(b)if(6<a.Pg){a.i=a.o.concat(a.i);
a.o.length=0;var c=a.Dk-1;var d=D7(a)}else c=b.B,d=b.sh;else c=a.Dk++,d=D7(a);var e=a.rm.clone();g.sn(e,"SID",a.l);g.sn(e,"RID",c);g.sn(e,"AID",a.ki);y7(a,e);c=new U6(a,a.l,c,a.Rh+1);c.Zg=null;c.setTimeout(1E4+Math.round(1E4*Math.random()));a.Ed=c;W6(c,e,d)},y7=function(a,b){if(a.Wc){var c=a.Wc.cw();
c&&g.Kb(c,function(d,e){g.sn(b,e,d)})}},D7=function(a){var b=Math.min(a.i.length,1E3),c=["count="+b];
if(6<a.Pg&&0<b){var d=a.i[0].g;c.push("ofs="+d)}else d=0;for(var e=0;e<b;e++){var f=a.i[e].g,k=a.i[e].map;f=6>=a.Pg?e:f-d;try{g.Kb(k,function(l,m){c.push("req"+f+"_"+m+"="+encodeURIComponent(l))})}catch(l){c.push("req"+f+"_type="+encodeURIComponent("_badmap"))}}a.o=a.o.concat(a.i.splice(0,b));
return c.join("&")},Mqa=function(a){a.Ub||a.qf||(a.B=1,a.qf=j7((0,g.x)(a.Bz,a),0),a.Kh=0)},E7=function(a){if(a.Ub||a.qf||3<=a.Kh)return!1;
a.B++;a.qf=j7((0,g.x)(a.Bz,a),Nqa(a,a.Kh));a.Kh++;return!0},r7=function(a,b,c){a.Jo=c;
a.Ne=b.Bf;a.A||Iqa(a)},C7=function(a){null!=a.Tg&&(g.u.clearTimeout(a.Tg),a.Tg=null)},Nqa=function(a,b){var c=5E3+Math.floor(1E4*Math.random());
a.isActive()||(c*=2);return c*b},F7=function(a,b){if(2==b||9==b){var c=null;
a.Wc&&(c=null);var d=(0,g.x)(a.eN,a);c||(c=new g.kn("//www.google.com/images/cleardot.gif"),Z5(c));l7(c.toString(),1E4,d)}else $6(2);Oqa(a,b)},Oqa=function(a,b){a.g=0;
a.Wc&&a.Wc.dv(b);z7(a);x7(a)},z7=function(a){a.g=0;
a.Ne=-1;if(a.Wc)if(0==a.o.length&&0==a.i.length)a.Wc.Ip();else{g.gb(a.o);var b=g.gb(a.i);a.o.length=0;a.i.length=0;a.Wc.Ip(b)}},p7=function(a,b,c){var d=g.tn(c);
if(""!=d.g)b&&g.mn(d,b+"."+d.g),g.nn(d,d.u);else{var e=window.location;d=tqa(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.Dj&&g.Kb(a.Dj,function(f,k){g.sn(d,k,f)});
g.sn(d,"VER",a.Pg);y7(a,d);return d},j7=function(a,b){if(!g.Ma(a))throw Error("Fn must not be null and must be a function");
return g.u.setTimeout(function(){a()},b)},$6=function(a){G7.dispatchEvent(new u7(G7,a))},Pqa=function(){},Qqa=function(a,b){this.action=a;
this.params=b||{}},H7=function(a,b){g.A.call(this);
this.g=new g.J(this.FL,0,this);g.B(this,this.g);this.Zc=5E3;this.i=0;if(g.Ma(a))b&&(a=(0,g.x)(a,b));else if(a&&g.Ma(a.handleEvent))a=(0,g.x)(a.handleEvent,a);else throw Error("Invalid listener argument");this.l=a},I7=function(a,b,c){this.H=a;
this.A=b;this.l=new g.Yo;this.i=new H7(this.IM,this);this.g=null;this.ib=!1;this.u=null;this.F="";this.D=this.o=0;this.B=[];this.I=c||!1},Rqa=function(a){return{firstTestResults:[""],
secondTestResults:!a.g.Jo,sessionId:a.g.l,arrayId:a.g.ki}},Sqa=function(a,b){a.D=b||0;
a.i.stop();a.g&&(3==a.g.g&&Lqa(a.g),A7(a.g));a.D=0},J7=function(a){return!!a.g&&3==a.g.g},Tqa=function(a,b){(a.A.loungeIdToken=b)||a.i.stop()},K7=function(a){this.port=this.domain="";
this.g="/api/lounge";this.i=!0;a=a||document.location.href;var b=Number(g.Sg(4,a))||"";b&&(this.port=":"+b);this.domain=g.Tg(a)||"";a=g.Ib;0<=a.search("MSIE")&&(a=a.match(/MSIE ([\d.]+)/)[1],0>g.Hb(a,"10.0")&&(this.i=!1))},L7=function(a,b){var c=a.g;
if(g.Ca(void 0)?0:a.i)c="https://"+a.domain+a.port+a.g;return g.bh(c+b,{})},M7=function(a,b,c,d,e){a={format:"JSON",
method:"POST",context:a,timeout:5E3,withCredentials:!1,onSuccess:g.Qa(a.o,d,!0),onError:g.Qa(a.l,e),ne:g.Qa(a.u,e)};c&&(a.wb=c,a.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.br(b,a)},Xqa=function(){var a=Uqa;
Vqa();N7.push(a);Wqa(N7)},O7=function(a,b){Vqa();
var c=N7,d=Yqa(a,String(b));0==c.length?Zqa(d):(Wqa(c),(0,g.y)(c,function(e){e(d)}))},Vqa=function(){N7||(N7=g.w("yt.mdx.remote.debug.handlers_")||[],g.Ga("yt.mdx.remote.debug.handlers_",N7,void 0))},Zqa=function(a){var b=(P7+1)%50;
P7=b;Q7[b]=a;R7||(R7=49==b)},Wqa=function(a){var b=Q7;
if(b[0]){var c=P7,d=R7?c:-1;do{d=(d+1)%50;var e=b[d];(0,g.y)(a,function(f){f(e)})}while(d!=c);
Q7=Array(50);P7=-1;R7=!1}},Yqa=function(a,b){var c=((0,g.D)()-$qa)/1E3;
c.toFixed&&(c=c.toFixed(3));var d=[];d.push("[",c+"s","] ");d.push("[","yt.mdx.remote","] ");d.push(a+": "+b,"\n");return d.join("")},S7=function(a){g.N.call(this);
this.B=a;this.g=[]},ara=function(a,b){var c=a.get(b.uuid)||a.get(b.id);
if(c){var d=c.name;c.id=b.id||c.id;c.name=b.name;c.token=b.token;c.uuid=b.uuid||c.uuid;return c.name!=d}a.g.push(b);return!0},bra=function(a,b){var c=a.g.length!=b.length;
a.g=(0,g.Xd)(a.g,function(f){return!!y6(b,f)});
for(var d=0,e=b.length;d<e;d++)c=ara(a,b[d])||c;return c},cra=function(a,b){var c=a.g.length;
a.g=(0,g.Xd)(a.g,function(d){return!(d||b?!d!=!b?0:d.id==b.id:1)});
return a.g.length<c},T7=function(a,b,c,d){g.N.call(this);
this.A=a;this.u=b;this.l=c;this.o=d;this.i=0;this.g=null;this.Aa=NaN},V7=function(a){S7.call(this,"LocalScreenService");
this.l=a;this.i=NaN;U7(this);this.info("Initializing with "+w6(this.g))},dra=function(a){if(a.g.length){var b=(0,g.ge)(a.g,function(d){return d.id}),c=L7(a.l,"/pairing/get_lounge_token_batch");
M7(a.l,c,{screen_ids:b.join(",")},(0,g.x)(a.OD,a),(0,g.x)(a.ND,a))}},U7=function(a){var b=u6(H6());
b=(0,g.Xd)(b,function(c){return!c.uuid});
return bra(a,b)},W7=function(a,b){Bqa((0,g.ge)(a.g,t6));
b&&I6()},Y7=function(a,b){g.N.call(this);
this.A=b;var c=g.It("yt-remote-online-screen-ids")||"";c=c?c.split(","):[];for(var d={},e=this.A(),f=0,k=e.length;f<k;++f){var l=e[f].id;d[l]=g.$a(c,l)}this.g=d;this.u=a;this.l=this.o=NaN;this.i=null;X7("Initialized with "+g.Kg(this.g))},era=function(a,b,c){var d=L7(a.u,"/pairing/get_screen_availability");
M7(a.u,d,{lounge_token:b.token},(0,g.x)(function(e){e=e.screens||[];for(var f=0,k=e.length;f<k;++f)if(e[f].loungeToken==b.token){c("online"==e[f].status);return}c(!1)},a),(0,g.x)(function(){c(!1)},a))},Z7=function(a,b){a:if(l6(b)!=l6(a.g))var c=!1;
else{c=g.Rb(b);for(var d=0,e=c.length;d<e;++d)if(!a.g[c[d]]){c=!1;break a}c=!0}c||(X7("Updated online screens: "+g.Kg(a.g)),a.g=b,a.N("screenChange"));fra(a)},$7=function(a){isNaN(a.l)||g.gq(a.l);
a.l=g.eq((0,g.x)(a.Ps,a),0<a.o&&a.o<(0,g.D)()?2E4:1E4)},X7=function(a){O7("OnlineScreenService",a)},gra=function(a){var b={};
(0,g.y)(a.A(),function(c){c.token?b[c.token]=c.id:this.Hb("Requesting availability of screen w/o lounge token.")});
return b},fra=function(a){a=g.Rb(g.Lb(a.g,function(b){return b}));
g.qb(a);a.length?g.Ht("yt-remote-online-screen-ids",a.join(","),60):A6("yt-remote-online-screen-ids")},a8=function(a){S7.call(this,"ScreenService");
this.A=a;this.i=this.l=null;this.o=[];this.u={};hra(this)},jra=function(a,b,c,d,e,f){a.info("getAutomaticScreenByIds "+c+" / "+b);
c||(c=a.u[b]);var k=a.Rd();if(k=(c?z6(k,c):null)||z6(k,b)){k.uuid=b;var l=b8(a,k);era(a.i,l,function(m){e(m?l:null)})}else c?ira(a,c,(0,g.x)(function(m){var n=b8(this,new r6({name:d,
screenId:c,loungeToken:m,dialId:b||""}));era(this.i,n,function(p){e(p?n:null)})},a),f):e(null)},kra=function(a,b){for(var c=0,d=a.g.length;c<d;++c)if(a.g[c].name==b)return a.g[c];
return null},ira=function(a,b,c,d){a.info("requestLoungeToken_ for "+b);
var e={wb:{screen_ids:b},method:"POST",context:a,onSuccess:function(f,k){var l=k&&k.screens||[];l[0]&&l[0].screenId==b?c(l[0].loungeToken):d(Error("Missing lounge token in token response"))},
onError:function(){d(Error("Request screen lounge token failed"))}};
g.br(L7(a.A,"/pairing/get_lounge_token_batch"),e)},lra=function(a){a.g=a.l.Rd();
var b=a.u,c={},d;for(d in b)c[b[d]]=d;b=0;for(d=a.g.length;b<d;++b){var e=a.g[b];e.uuid=c[e.id]||""}a.info("Updated manual screens: "+w6(a.g))},hra=function(a){c8(a);
a.l=new V7(a.A);a.l.subscribe("screenChange",(0,g.x)(a.WD,a));lra(a);a.o=u6(g.It("yt-remote-automatic-screen-cache")||[]);c8(a);a.info("Initializing automatic screens: "+w6(a.o));a.i=new Y7(a.A,(0,g.x)(a.Rd,a,!0));a.i.subscribe("screenChange",(0,g.x)(function(){this.N("onlineScreenChange")},a))},b8=function(a,b){var c=a.get(b.id);
c?(c.uuid=b.uuid,b=c):((c=z6(a.o,b.uuid))?(c.id=b.id,c.token=b.token,b=c):a.o.push(b),g.Ht("yt-remote-automatic-screen-cache",(0,g.ge)(a.o,t6)));c8(a);a.u[b.uuid]=b.id;g.Ht("yt-remote-device-id-map",a.u,31536E3);return b},c8=function(a){a.u=g.It("yt-remote-device-id-map")||{}},d8=function(a,b,c){g.N.call(this);
this.R=c;this.F=a;this.i=b;this.l=null},e8=function(a,b){O7(a.R,b)},f8=function(a,b){d8.call(this,a,b,"CastSession");
this.g=null;this.o=0;this.A=(0,g.x)(this.JN,this);this.u=(0,g.x)(this.iM,this);this.o=g.eq((0,g.x)(function(){mra(this,null)},this),12E4)},nra=function(a){a.info("sendYoutubeMessage_: getMdxSessionStatus "+g.Kg(void 0));
var b={type:"getMdxSessionStatus"};a.g?a.g.sendMessage("urn:x-cast:com.google.youtube.mdx",b,g.Ha,(0,g.x)(function(){e8(this,"Failed to send message: getMdxSessionStatus.")},a)):e8(a,"Sending yt message without session: "+g.Kg(b))},mra=function(a,b){g.gq(a.o);
if(b){if(a.info("onConnectedScreenId_: Received screenId: "+b),!a.l||a.l.id!=b){var c=(0,g.x)(a.Rn,a),d=(0,g.x)(a.Ud,a);a.uw(b,c,d,5)}}else a.Ud(Error("Waiting for session status timed out."))},g8=function(a,b,c){d8.call(this,a,b,"DialSession");
this.o=this.D=null;this.H="";this.M=c;this.u=null;this.B=g.Ha;this.A=NaN;this.I=(0,g.x)(this.MN,this);this.g=g.Ha},ora=function(a){a.g=a.F.HB(a.H,a.i.label,a.i.friendlyName,(0,g.x)(function(b){this.g=g.Ha;
this.Rn(b)},a),(0,g.x)(function(b){this.g=g.Ha;
this.Ud(b)},a))},pra=function(a){var b={};
b.pairingCode=a.H;b.theme=a.M;if(a.u){var c=a.u.currentTime||0;b.v=a.u.videoId;b.t=c}L6()&&(b.env_useStageMdx=1);return g.$g(b)},h8=function(a,b){d8.call(this,a,b,"ManualSession");
this.g=g.eq((0,g.x)(this.mi,this,null),150)},i8=function(a,b,c,d){g.N.call(this);
this.i=a;this.B=b||"233637DE";this.A=c||"cl";this.D=d||!1;this.g=null;this.u=!1;this.l=[];this.o=(0,g.x)(this.NK,this)},qra=function(a,b){return b?g.Xa(a.l,function(c){return s6(b,c.label)},a):null},j8=function(a){O7("Controller",a)},Uqa=function(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)},k8=function(a){return a.u||!!a.l.length||!!a.g},l8=function(a,b,c){b!=a.g&&(g.qf(a.g),(a.g=b)?(c?a.N("yt-remote-cast2-receiver-resumed",b.i):a.N("yt-remote-cast2-receiver-selected",
b.i),b.subscribe("sessionScreen",(0,g.x)(a.Az,a,b)),b.l?a.N("yt-remote-cast2-session-change",b.l):c&&a.g.mi(null)):a.N("yt-remote-cast2-session-change",null))},rra=function(a){var b=a.i.GB(),c=a.g&&a.g.i;
a=(0,g.ge)(b,function(d){c&&s6(d,c.label)&&(c=null);var e=d.uuid?d.uuid:d.id,f=qra(this,d);f?(f.label=e,f.friendlyName=d.name):(f=new chrome.cast.Receiver(e,d.name),f.receiverType=chrome.cast.ReceiverType.CUSTOM);return f},a);
c&&(c.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(c=new chrome.cast.Receiver(c.label,c.friendlyName),c.receiverType=chrome.cast.ReceiverType.CUSTOM),a.push(c));return a},xra=function(a,b,c,d,e,f,k){sra()?tra(b,e,f,k)&&(n8(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?ura(a,c):(window.__onGCastApiAvailable=function(l,m){l?ura(a,c):(o8("Failed to load cast API: "+m),p8(!1),n8(!1),A6("yt-remote-cast-available"),A6("yt-remote-cast-receiver"),vra(),c(!1))},d?g.rq("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"):
0<=window.navigator.userAgent.indexOf("Android")&&0<=window.navigator.userAgent.indexOf("Chrome/")&&window.navigator.presentation?Fqa():!window.chrome||!window.navigator.presentation||0<=window.navigator.userAgent.indexOf("Edge")?Q6():(R6(),P6(wra.map(Dqa))))):m8("Cannot initialize because not running Chrome")},vra=function(){m8("dispose");
var a=q8();a&&a.dispose();g.Ga("yt.mdx.remote.cloudview.instance_",null,void 0);yra(!1);g.mq(r8);r8.length=0},s8=function(){return!!g.It("yt-remote-cast-installed")},zra=function(){var a=g.It("yt-remote-cast-receiver");
return a?a.friendlyName:null},Ara=function(){m8("clearCurrentReceiver");
A6("yt-remote-cast-receiver")},Bra=function(){return s8()?q8()?q8().getCastSession():(o8("getCastSelector: Cast is not initialized."),null):(o8("getCastSelector: Cast API is not installed!"),null)},u8=function(){s8()?q8()?t8()?(m8("Requesting cast selector."),q8().requestSession()):(m8("Wait for cast API to be ready to request the session."),r8.push(g.lq("yt-remote-cast2-api-ready",u8))):o8("requestCastSelector: Cast is not initialized."):o8("requestCastSelector: Cast API is not installed!")},v8=
function(a,b){t8()?q8().setConnectedScreenStatus(a,b):o8("setConnectedScreenStatus called before ready.")},sra=function(){var a=0<=g.Ib.search(/ (CrMo|Chrome|CriOS)\//);
return g.qx||a},Cra=function(a,b){q8().init(a,b)},tra=function(a,b,c,d){var e=!1;
q8()||(a=new i8(a,b,c,d),a.subscribe("yt-remote-cast2-availability-change",function(f){g.Ht("yt-remote-cast-available",f);p6("yt-remote-cast2-availability-change",f)}),a.subscribe("yt-remote-cast2-receiver-selected",function(f){m8("onReceiverSelected: "+f.friendlyName);
g.Ht("yt-remote-cast-receiver",f);p6("yt-remote-cast2-receiver-selected",f)}),a.subscribe("yt-remote-cast2-receiver-resumed",function(f){m8("onReceiverResumed: "+f.friendlyName);
g.Ht("yt-remote-cast-receiver",f)}),a.subscribe("yt-remote-cast2-session-change",function(f){m8("onSessionChange: "+v6(f));
f||A6("yt-remote-cast-receiver");p6("yt-remote-cast2-session-change",f)}),g.Ga("yt.mdx.remote.cloudview.instance_",a,void 0),e=!0);
m8("cloudview.createSingleton_: "+e);return e},q8=function(){return g.w("yt.mdx.remote.cloudview.instance_")},ura=function(a,b){p8(!0);
n8(!1);Cra(a,function(c){c?(yra(!0),g.oq("yt-remote-cast2-api-ready")):(o8("Failed to initialize cast API."),p8(!1),A6("yt-remote-cast-available"),A6("yt-remote-cast-receiver"),vra());b(c)})},m8=function(a){O7("cloudview",a)},o8=function(a){O7("cloudview",a)},p8=function(a){m8("setCastInstalled_ "+a);
g.Ht("yt-remote-cast-installed",a)},t8=function(){return!!g.w("yt.mdx.remote.cloudview.apiReady_")},yra=function(a){m8("setApiReady_ "+a);
g.Ga("yt.mdx.remote.cloudview.apiReady_",a,void 0)},n8=function(a){g.Ga("yt.mdx.remote.cloudview.initializing_",a,void 0)},w8=function(a){this.index=-1;
this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.A=this.B=0;this.g=null;this.hasNext=this.Oe=!1;this.F=this.D=this.i=this.o=0;this.l=NaN;this.u=!1;this.reset(a)},x8=function(a){a.audioTrackId=null;
a.g=null;a.playerState=-1;a.Oe=!1;a.hasNext=!1;a.B=0;a.A=(0,g.D)();a.o=0;a.i=0;a.D=0;a.F=0;a.l=NaN;a.u=!1},y8=function(a){return 1==a.playerState?((0,g.D)()-a.A)/1E3:0},z8=function(a,b){a.B=b;
a.A=(0,g.D)()},A8=function(a){switch(a.playerState){case 1:case 1081:return((0,g.D)()-a.A)/1E3+a.B;
case -1E3:return 0}return a.B},B8=function(a,b,c){var d=a.videoId;
a.videoId=b;a.index=c;b!=d&&x8(a)},C8=function(a){var b={};
b.index=a.index;b.listId=a.listId;b.videoId=a.videoId;b.playerState=a.playerState;b.volume=a.volume;b.muted=a.muted;b.audioTrackId=a.audioTrackId;b.trackData=g.cc(a.g);b.hasPrevious=a.Oe;b.hasNext=a.hasNext;b.playerTime=a.B;b.playerTimeAt=a.A;b.seekableStart=a.o;b.seekableEnd=a.i;b.duration=a.D;b.loadedTime=a.F;b.liveIngestionTime=a.l;return b},E8=function(a,b){g.N.call(this);
this.g=0;this.o=a;this.A=[];this.u=new o6;this.l=this.i=null;this.F=(0,g.x)(this.KI,this);this.B=(0,g.x)(this.Gk,this);this.D=(0,g.x)(this.JI,this);this.H=(0,g.x)(this.YI,this);var c=0;a?(c=a.getProxyState(),3!=c&&(a.subscribe("proxyStateChange",this.Ot,this),Dra(this))):c=3;0!=c&&(b?this.Ot(c):g.eq((0,g.x)(function(){this.Ot(c)},this),0));
var d=Bra();d&&D8(this,d);this.subscribe("yt-remote-cast2-session-change",this.H)},F8=function(a){return new w8(a.o.getPlayerContextData())},Dra=function(a){(0,g.y)("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange".split(" "),function(b){this.A.push(this.o.subscribe(b,g.Qa(this.KK,b),this))},a)},Era=function(a){(0,g.y)(a.A,function(b){this.o.unsubscribeByKey(b)},a);
a.A.length=0},G8=function(a,b){var c=a.u;
50>c.g.length+c.i.length&&a.u.i.push(b)},I8=function(a,b,c){var d=F8(a);
z8(d,c);-1E3!=d.playerState&&(d.playerState=b);H8(a,d)},J8=function(a,b,c){a.o.sendMessage(b,c)},H8=function(a,b){Era(a);
a.o.setPlayerContextData(C8(b));Dra(a)},D8=function(a,b){a.l&&(a.l.removeUpdateListener(a.F),a.l.removeMediaListener(a.B),a.Gk(null));
a.l=b;a.l&&(O7("CP","Setting cast session: "+a.l.sessionId),a.l.addUpdateListener(a.F),a.l.addMediaListener(a.B),a.l.media.length&&a.Gk(a.l.media[0]))},Fra=function(a){var b=a.i.media,c=a.i.customData;
if(b&&c){var d=F8(a);b.contentId!=d.videoId&&O7("CP","Cast changing video to: "+b.contentId);d.videoId=b.contentId;d.playerState=c.playerState;z8(d,a.i.getEstimatedTime());H8(a,d)}else O7("CP","No cast media video. Ignoring state update.")},K8=function(a,b,c){return(0,g.x)(function(d){this.Hb("Failed to "+b+" with cast v2 channel. Error code: "+d.code);
d.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.Hb("Retrying "+b+" using MDx browser channel."),J8(this,b,c))},a)},L8=function(a,b,c){g.N.call(this);
this.u=NaN;this.I=!1;this.D=this.B=this.F=this.H=NaN;this.R=[];this.o=this.A=this.l=this.Pa=this.g=null;this.P=a;this.R.push(g.ks(window,"beforeunload",(0,g.x)(this.HD,this)));this.i=[];this.Pa=new w8;this.M=b.id;this.g=Gra(this,c);this.g.subscribe("handlerOpened",this.OI,this);this.g.subscribe("handlerClosed",this.LI,this);this.g.subscribe("handlerError",this.MI,this);this.g.subscribe("handlerMessage",this.NI,this);Tqa(this.g,b.token);this.subscribe("remoteQueueChange",function(){var d=this.Pa.videoId;
g.Jt()&&g.Ht("yt-remote-session-video-id",d)},this)},M8=function(a){O7("conn",a)},Gra=function(a,b){return new I7(L7(a.P,"/bc"),b)},N8=function(a,b){a.N("proxyStateChange",b)},Hra=function(a){a.u=g.eq((0,g.x)(function(){M8("Connecting timeout");
this.Oh(1)},a),2E4)},O8=function(a){g.gq(a.u);
a.u=NaN},P8=function(a){g.gq(a.H);
a.H=NaN},Ira=function(a){Q8(a);
a.F=g.eq((0,g.x)(function(){R8(this,"getNowPlaying")},a),2E4)},Q8=function(a){g.gq(a.F);
a.F=NaN},Kra=function(a,b){b&&(O8(a),P8(a));
b==(J7(a.g)&&isNaN(a.u))?b&&(N8(a,1),R8(a,"getSubtitlesTrack")):b?(a.rw()&&a.Pa.reset(),N8(a,1),R8(a,"getNowPlaying"),Jra(a)):a.Oh(1)},Lra=function(a,b){var c=b.params.videoId;
delete b.params.videoId;c==a.Pa.videoId&&(g.Xb(b.params)?a.Pa.g=null:a.Pa.g=b.params,a.N("remotePlayerChange"))},Mra=function(a,b){var c=b.params.videoId||b.params.video_id,d=parseInt(b.params.currentIndex,10);
a.Pa.listId=b.params.listId||a.Pa.listId;B8(a.Pa,c,d);a.N("remoteQueueChange")},Ora=function(a,b){b.params=b.params||{};
Mra(a,b);Nra(a,b);a.N("autoplayDismissed")},Nra=function(a,b){var c=parseInt(b.params.currentTime||b.params.current_time,10);
z8(a.Pa,isNaN(c)?0:c);c=parseInt(b.params.state,10);c=isNaN(c)?-1:c;-1==c&&-1E3==a.Pa.playerState&&(c=-1E3);a.Pa.playerState=c;c=Number(b.params.loadedTime);a.Pa.F=isNaN(c)?0:c;c=Number(b.params.duration);a.Pa.D=isNaN(c)?0:c;c=a.Pa;var d=Number(b.params.liveIngestionTime);c.l=d;c.u=isNaN(d)?!1:!0;c=a.Pa;d=Number(b.params.seekableStartTime);var e=Number(b.params.seekableEndTime);c.o=isNaN(d)?0:d;c.i=isNaN(e)?0:e;1==a.Pa.playerState?Ira(a):Q8(a);a.N("remotePlayerChange")},Pra=function(a,b){if(-1E3!=
a.Pa.playerState){var c=1085;
switch(parseInt(b.params.adState,10)){case 1:c=1081;break;case 2:c=1084;break;case 0:c=1083}a.Pa.playerState=c;c=parseInt(b.params.currentTime,10);z8(a.Pa,isNaN(c)?0:c);a.N("remotePlayerChange")}},Qra=function(a,b){var c="true"==b.params.muted;
a.Pa.volume=parseInt(b.params.volume,10);a.Pa.muted=c;a.N("remotePlayerChange")},Rra=function(a,b){a.A=b.params.videoId;
a.N("nowAutoplaying",parseInt(b.params.timeout,10))},Sra=function(a,b){var c="true"==b.params.hasNext;
a.Pa.Oe="true"==b.params.hasPrevious;a.Pa.hasNext=c;a.N("previousNextChange")},Jra=function(a){g.gq(a.D);
a.D=g.eq((0,g.x)(a.Oh,a,1),864E5)},R8=function(a,b,c){c?M8("Sending: action="+b+", params="+g.Kg(c)):M8("Sending: action="+b);
a.g.sendMessage(b,c)},S8=function(a){S7.call(this,"ScreenServiceProxy");
this.Yc=a;this.i=[];this.i.push(this.Yc.$_s("screenChange",(0,g.x)(this.HN,this)));this.i.push(this.Yc.$_s("onlineScreenChange",(0,g.x)(this.pK,this)))},Xra=function(a){var b={device:"Desktop",
app:"youtube-desktop"};b=g.Xp("MDX_CONFIG")||b;zqa();F6();T8||(T8=new K7(b?b.loungeApiHost:void 0),L6()&&(T8.g="/api/loungedev"));U8||(U8=g.w("yt.mdx.remote.deferredProxies_")||[],g.Ga("yt.mdx.remote.deferredProxies_",U8,void 0));Tra();var c=V8();if(!c){var d=new a8(T8);g.Ga("yt.mdx.remote.screenService_",d,void 0);c=V8();var e=!1,f=void 0,k=void 0,l=!1;b&&(e=!!b.loadCastApiSetupScript,f=b.appId,k=b.theme,l=!!b.disableDial);xra(a,d,function(m){m?W8()&&v8(W8(),"YouTube TV"):d.subscribe("onlineScreenChange",
function(){p6("yt-remote-receiver-availability-change")})},e,f,k,l)}b&&!g.w("yt.mdx.remote.initialized_")&&(g.Ga("yt.mdx.remote.initialized_",!0,void 0),X8("Initializing: "+g.Kg(b)),Y8.push(g.lq("yt-remote-cast2-availability-change",function(){p6("yt-remote-receiver-availability-change")})),Y8.push(g.lq("yt-remote-cast2-receiver-selected",function(){Z8(null);
p6("yt-remote-auto-connect","cast-selector-receiver")})),Y8.push(g.lq("yt-remote-cast2-receiver-resumed",function(){p6("yt-remote-receiver-resumed","cast-selector-receiver")})),Y8.push(g.lq("yt-remote-cast2-session-change",Ura)),Y8.push(g.lq("yt-remote-connection-change",function(m){m?v8(W8(),"YouTube TV"):$8()||(v8(null,null),Ara())})),a=a9(),b.isAuto&&(a.id+="#dial"),g.Tq("desktop_enable_autoplay")&&(a.capabilities=["atp"]),a.name=b.device,a.app=b.app,(k=b.theme)&&(a.theme=k),X8(" -- with channel params: "+
g.Kg(a)),Vra(a),c.start(),W8()||Wra())},Zra=function(){var a=Yra();
s8()&&g.It("yt-remote-cast-available")&&a.push({key:"cast-selector-receiver",name:"Cast..."});return a},Yra=function(){var a=V8().Yc.$_gos();
var b=b9();b&&c9()&&(y6(a,b)||a.push(b));return yqa(a)},d9=function(){var a=$ra();
!a&&s8()&&zra()&&(a={key:"cast-selector-receiver",name:zra()});return a},$ra=function(){var a=Yra(),b=b9();
b||(b=$8());return g.Xa(a,function(c){return b&&s6(b,c.key)?!0:!1})},b9=function(){var a=W8();
if(!a)return null;var b=V8().Rd();return z6(b,a)},Ura=function(a){X8("remote.onCastSessionChange_: "+v6(a));
if(a){var b=b9();b&&b.id==a.id?v8(b.id,"YouTube TV"):(b&&e9(),f9(a,1))}else c9()&&e9()},e9=function(){t8()?q8().stopSession():o8("stopSession called before API ready.");
var a=c9();a&&(a.disconnect(1),g9(null))},h9=function(){var a=c9();
return!!a&&3!=a.getProxyState()},X8=function(a){O7("remote",a)},V8=function(){if(!i9){var a=g.w("yt.mdx.remote.screenService_");
i9=a?new S8(a):null}return i9},W8=function(){return g.w("yt.mdx.remote.currentScreenId_")},asa=function(a){g.Ga("yt.mdx.remote.currentScreenId_",a,void 0)},bsa=function(){return g.w("yt.mdx.remote.connectData_")},Z8=function(a){g.Ga("yt.mdx.remote.connectData_",a,void 0)},c9=function(){return g.w("yt.mdx.remote.connection_")},g9=function(a){var b=c9();
Z8(null);a||asa("");g.Ga("yt.mdx.remote.connection_",a,void 0);U8&&((0,g.y)(U8,function(c){c(a)}),U8.length=0);
b&&!a?p6("yt-remote-connection-change",!1):!b&&a&&p6("yt-remote-connection-change",!0)},$8=function(){var a=g.Jt();
if(!a)return null;var b=V8().Rd();return z6(b,a)},f9=function(a,b){b9()&&b9();
if(j9)k9=a;else{asa(a.id);var c=new L8(T8,a,a9());c.connect(b,bsa());c.subscribe("beforeDisconnect",function(d){p6("yt-remote-before-disconnect",d)});
c.subscribe("beforeDispose",function(){c9()&&g9(null)});
g9(c)}},Wra=function(){var a=$8();
a?(X8("Resume connection to: "+v6(a)),f9(a,0)):(J6(),Ara(),X8("Skipping connecting because no session screen found."))},Tra=function(){var a=a9();
if(g.Xb(a)){a=E6();var b=g.It("yt-remote-session-name")||"",c=g.It("yt-remote-session-app")||"";a={device:"REMOTE_CONTROL",id:a,name:b,app:c,mdxVersion:3};g.Ga("yt.mdx.remote.channelParams_",a,void 0)}},a9=function(){return g.w("yt.mdx.remote.channelParams_")||{}},Vra=function(a){a?(g.Ht("yt-remote-session-app",a.app),g.Ht("yt-remote-session-name",a.name)):(A6("yt-remote-session-app"),A6("yt-remote-session-name"));
g.Ga("yt.mdx.remote.channelParams_",a,void 0)},l9=function(a,b,c){g.A.call(this);
this.u=a;this.i=b;this.l=new g.Us(this);g.B(this,this.l);this.l.K(b,"onCaptionsTrackListChanged",this.KJ);this.l.K(b,"captionschanged",this.II);this.l.K(b,"captionssettingschanged",this.UA);this.l.K(b,"videoplayerreset",this.Sn);this.l.K(b,"mdxautoplaycancel",this.KC);this.P=this.l.K(b,"onVolumeChange",this.jz);this.D=!1;this.g=c;c.subscribe("proxyStateChange",this.wz,this);c.subscribe("remotePlayerChange",this.Ik,this);c.subscribe("remoteQueueChange",this.Sn,this);c.subscribe("autoplayUpNext",this.Yy,
this);c.subscribe("previousNextChange",this.sz,this);c.subscribe("nowAutoplaying",this.oz,this);c.subscribe("autoplayDismissed",this.Xy,this);this.suggestion=null;this.F=new g.PC(64);this.o=new g.J(this.SA,500,this);g.B(this,this.o);this.A=new g.J(this.TA,1E3,this);g.B(this,this.A);this.I=new S6(this.nN,0,this);g.B(this,this.I);this.B={};this.R=new g.J(this.uB,1E3,this);g.B(this,this.R);this.H=new g.Jl(this.fG,1E3,this);g.B(this,this.H);this.M=g.Ha;this.UA();this.Sn();this.Ik()},m9=function(a,b){a.u.Nc(b,
a.i.getVideoData().lengthSeconds)},csa=function(a){m9(a,0);
a.o.stop();n9(a,new g.PC(64))},p9=function(a,b){if(o9(a)&&!a.D){var c=null;
b&&(c={style:a.i.getSubtitlesUserSettings()},g.ec(c,b));a.g.JA(a.i.getVideoData(1).videoId,c);a.B=F8(a.g).g}},q9=function(a,b){var c=a.i.getPlaylist();
if(c){var d=c.Ta;var e=c.listId.toString()}c=a.i.getVideoData(1);a.g.playVideo(c.videoId,b,d,e,c.playerParams,c.Gf,k6(c));n9(a,new g.PC(1))},dsa=function(a,b){if(b){var c=a.i.getOption("captions","tracklist",{kR:1});
c&&c.length?(a.i.setOption("captions","track",b),a.D=!1):(a.i.loadModule("captions"),a.D=!0)}else a.i.setOption("captions","track",{})},o9=function(a){return F8(a.g).videoId==a.i.getVideoData(1).videoId},n9=function(a,b){a.A.stop();
var c=a.F;if(!g.VC(c,b)){var d=g.T(b,2);d!=g.T(a.F,2)&&g.MK(a.i,d);a.F=b;esa(a.u,c,b)}},r9=function(){g.W.call(this,{C:"div",
G:"ytp-mdx-popup-dialog",L:{role:"dialog"},J:[{C:"div",G:"ytp-mdx-popup-dialog-inner-content",J:[{C:"div",G:"ytp-mdx-popup-title",V:"\ub85c\uadf8\uc544\uc6c3\ub418\uc5c8\uc2b5\ub2c8\ub2e4"},{C:"div",G:"ytp-mdx-popup-description",V:"\uc2dc\uccad\ud55c \ub3d9\uc601\uc0c1\uc774 TV\uc758 \uc2dc\uccad \uae30\ub85d\uc5d0 \ucd94\uac00\ub418\uc5b4 TV \ub9de\ucda4 \ub3d9\uc601\uc0c1\uc5d0 \uc601\ud5a5\uc744 \ubbf8\uce60 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc6d0\ud558\uc9c0 \uc54a\uc73c\uba74 \ucde8\uc18c\ud558\uace0 \ucef4\ud4e8\ud130\uc5d0\uc11c YouTube\uc5d0 \ub85c\uadf8\uc778\ud558\uc138\uc694."},
{C:"div",G:"ytp-mdx-privacy-popup-buttons",J:[{C:"button",W:["ytp-button","ytp-mdx-privacy-popup-cancel"],V:"\ucde8\uc18c"},{C:"button",W:["ytp-button","ytp-mdx-privacy-popup-confirm"],V:"\ud655\uc778"}]}]}]});this.l=new g.GQ(this,250);g.B(this,this.l);this.B=this.i["ytp-mdx-privacy-popup-cancel"];this.K(this.B,"click",this.o);this.u=this.i["ytp-mdx-privacy-popup-confirm"];this.K(this.u,"click",this.A)},s9=function(a){g.W.call(this,{C:"div",
G:"ytp-remote",J:[{C:"div",G:"ytp-remote-display-status",J:[{C:"div",G:"ytp-remote-display-status-icon",J:[g.VP()]},{C:"div",G:"ytp-remote-display-status-text",V:"{{statustext}}"}]}]});this.l=new g.GQ(this,250);g.B(this,this.l);this.o=a;this.K(a,"presentingplayerstatechange",this.u);fsa(this,g.IK(a))},fsa=function(a,b){if(3==a.o.getPresentingPlayerType()){var c={RECEIVER_NAME:a.o.getOption("remote","currentReceiver").name};
c=g.T(b,128)?g.UN("$RECEIVER_NAME\uc5d0\uc11c \uc624\ub958 \ubc1c\uc0dd",c):g.WC(b)||g.T(b,4)?g.UN("$RECEIVER_NAME\uc5d0\uc11c \uc7ac\uc0dd \uc911",c):g.UN("$RECEIVER_NAME\uc5d0 \uc5f0\uacb0\ub428",c);a.updateValue("statustext",c);a.l.show()}else a.l.hide()},t9=function(a,b){g.rU.call(this,"\uc7ac\uc0dd\ud560 \ud654\uba74:",0,a,b);
this.l=a;this.B={};this.K(a,"onMdxReceiversChange",this.I);this.K(a,"presentingplayerstatechange",this.I);this.I()},u9=function(a){g.mL.call(this,a);
this.i={key:x6(),name:"\uc774 \ucef4\ud4e8\ud130"};this.u=null;this.o=[];this.F=this.g=null;this.B=[this.i];this.l=this.i;this.rk=new g.PC(64);this.I=0;this.Wm=-1;if(!g.vz(g.X(this.player))){a=this.player;var b=g.ID(a);b&&(b=b.An())&&(b=new t9(a,b),g.B(this,b));b=new s9(a);g.B(this,b);g.XK(a,b.element,4);this.H=new r9;g.B(this,this.H);g.XK(a,this.H.element,4);this.D=!!$8()}this.A=null},v9=function(a){a.A&&(a.player.removeEventListener("presentingplayerstatechange",a.A),a.A=null)},esa=function(a,b,
c){a.rk=c;
a.player.N("presentingplayerstatechange",new g.ZD(c,b))},w9=function(a,b){if(b.key!=a.l.key)if(b.key==a.i.key)e9();
else{var c;if(c=g.O(g.X(a.player).experiments,"mdx_enable_privacy_disclosure_ui"))c=g.Xp("PLAYER_CONFIG"),c=!(c&&c.args&&void 0!==c.args.authuser||g.Xp("SESSION_INDEX")||g.Xp("LOGGED_IN"));c&&!a.D&&(g.WC(g.IK(a.player))||(a.A=(0,g.x)(a.pM,a),a.player.addEventListener("presentingplayerstatechange",a.A)),a.player.pauseVideo(),a.H.l.show(),c9()||(j9=!0));a.l=b;var d=a.player.getPlaylistId();c=a.player.getVideoData(1);var e=c.videoId;if(d||e){var f=a.player.getPlaylist();if(f){var k=[];for(var l=0;l<
f.getLength();l++)k[l]=f.ua(l).videoId}else k=[e];f=a.player.getCurrentTime(1);d={videoIds:k,listId:d,videoId:e,playerParams:c.playerParams,clickTrackingParams:c.Gf,index:Math.max(a.player.getPlaylistIndex(),0),currentTime:0==f?void 0:f};(c=k6(c))&&(d.locationInfo=c);c=d}else c=null;X8("Connecting to: "+g.Kg(b));"cast-selector-receiver"==b.key?(Z8(c||null),t8()?q8().setLaunchParams(c||null):o8("setLaunchParams called before ready.")):!c&&h9()&&W8()==b.key?p6("yt-remote-connection-change",!0):(e9(),
Z8(c||null),c=V8().Rd(),(c=z6(c,b.key))&&f9(c,1))}},oqa=/^https?$/i,gsa=["POST",
"PUT"];g.Sa(i6,g.Qf);g.h=i6.prototype;
g.h.send=function(a,b,c,d){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+a);b=b?b.toUpperCase():"GET";this.D=a;this.l="";this.u=0;this.Y=b;this.P=!1;this.i=!0;this.g=this.M?a6(this.M):a6(g.tZ);this.R=this.M?this.M.getOptions():g.tZ.getOptions();this.g.onreadystatechange=(0,g.x)(this.Fw,this);try{Y5(b6(this,"Opening Xhr")),this.aa=!0,this.g.open(b,String(a),!0),this.aa=!1}catch(f){Y5(b6(this,"Error opening Xhr: "+f.message));f6(this,f);return}a=
c||"";var e=this.headers.clone();d&&lqa(d,function(f,k){e.set(k,f)});
d=g.Xa(e.Pd(),mqa);c=g.u.FormData&&a instanceof g.u.FormData;!g.$a(gsa,b)||d||c||e.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");e.forEach(function(f,k){this.g.setRequestHeader(k,f)},this);
this.X&&(this.g.responseType=this.X);"withCredentials"in this.g&&this.g.withCredentials!==this.T&&(this.g.withCredentials=this.T);try{c6(this),0<this.A&&(this.I=nqa(this.g),Y5(b6(this,"Will abort after "+this.A+"ms if incomplete, xhr2 "+this.I)),this.I?(this.g.timeout=this.A,this.g.ontimeout=(0,g.x)(this.Gw,this)):this.F=g.Gg(this.Gw,this.A,this)),Y5(b6(this,"Sending request")),this.B=!0,this.g.send(a),this.B=!1}catch(f){Y5(b6(this,"Send error: "+f.message)),f6(this,f)}};
g.h.Gw=function(){"undefined"!=typeof g.XY&&this.g&&(this.l="Timed out after "+this.A+"ms, aborting",this.u=8,b6(this,this.l),this.dispatchEvent("timeout"),this.abort(8))};
g.h.abort=function(a){this.g&&this.i&&(b6(this,"Aborting"),this.i=!1,this.o=!0,this.g.abort(),this.o=!1,this.u=a||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),e6(this))};
g.h.U=function(){this.g&&(this.i&&(this.i=!1,this.o=!0,this.g.abort(),this.o=!1),e6(this,!0));i6.bb.U.call(this)};
g.h.Fw=function(){this.fa()||(this.aa||this.B||this.o?h6(this):this.MK())};
g.h.MK=function(){h6(this)};
g.h.isActive=function(){return!!this.g};
g.h.getStatus=function(){try{return 2<g6(this)?this.g.status:-1}catch(a){return-1}};
g.h.getLastError=function(){return g.Da(this.l)?this.l:String(this.l)};
var g7={"\x00":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},f7={"'":"\\'"},hsa={};g.h=o6.prototype;g.h.isEmpty=function(){return 0==this.g.length&&0==this.i.length};
g.h.clear=function(){this.g=[];this.i=[]};
g.h.contains=function(a){return g.$a(this.g,a)||g.$a(this.i,a)};
g.h.remove=function(a){var b=this.g;var c=(0,g.Wma)(b,a);0<=c?(g.bb(b,c),b=!0):b=!1;return b||g.cb(this.i,a)};
g.h.Bc=function(){for(var a=[],b=this.g.length-1;0<=b;--b)a.push(this.g[b]);var c=this.i.length;for(b=0;b<c;++b)a.push(this.i[b]);return a};
var wqa={gO:"atp",vQ:"ska",kQ:"que",LP:"mus",uQ:"sus",cP:"dsp",rQ:"seq"};q6.prototype.jg=function(){var a=new q6({id:this.id,name:this.name,app:this.app,type:this.type,user:this.username,userAvatarUri:this.avatar,obfuscatedGaiaId:this.obfuscatedGaiaId,theme:this.theme,capabilities:Array.from(this.capabilities.values()).join(","),experiments:Array.from(this.experiments.values()).join(",")});a.l=this.l;a.i=this.i;a.g=this.g};
var K6,D6="",Eqa=M6("loadCastFramework")||M6("loadCastApplicationFramework"),wra=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.Sa(S6,g.A);g.h=S6.prototype;g.h.DD=function(a){this.o=arguments;this.g=!1;this.Aa?this.l=(0,g.D)()+this.Zc:this.Aa=g.Gg(this.u,this.Zc)};
g.h.stop=function(){this.Aa&&(g.u.clearTimeout(this.Aa),this.Aa=null);this.l=null;this.g=!1;this.o=[]};
g.h.pause=function(){++this.i};
g.h.resume=function(){this.i&&(--this.i,!this.i&&this.g&&(this.g=!1,this.A.apply(null,this.o)))};
g.h.U=function(){this.stop();S6.bb.U.call(this)};
g.h.ED=function(){this.l?(this.Aa=g.Gg(this.u,this.l-(0,g.D)()),this.l=null):(this.Aa=null,this.i?this.g=!0:(this.g=!1,this.A.apply(null,this.o)))};T6.prototype.stringify=function(a){return g.u.JSON.stringify(a,void 0)};
T6.prototype.parse=function(a){return g.u.JSON.parse(a,void 0)};g.h=U6.prototype;g.h.Zg=null;g.h.De=!1;g.h.Zi=null;g.h.Lt=null;g.h.Hi=null;g.h.Yh=null;g.h.ag=null;g.h.Eg=null;g.h.sh=null;g.h.wc=null;g.h.ql=0;g.h.He=null;g.h.Lo=null;g.h.rg=null;g.h.Wj=-1;g.h.wA=!0;g.h.Og=!1;g.h.Cq=0;g.h.co=null;var a7={},Z6={};g.h=U6.prototype;g.h.setTimeout=function(a){this.o=a};
g.h.yM=function(a){a=a.target;var b=this.co;b&&3==g6(a)?b.Sj():this.CB(a)};
g.h.CB=function(a){try{if(a==this.wc)a:{var b=g6(this.wc),c=this.wc.u,d=this.wc.getStatus();if(g.Ld&&!g.od(10)||g.Nd&&!g.ld("420+")){if(4>b)break a}else if(3>b||3==b&&!g.Ch&&!j6(this.wc))break a;this.Og||4!=b||7==c||(8==c||0>=d?this.g.Ae(3):this.g.Ae(2));k7(this);var e=this.wc.getStatus();this.Wj=e;var f=j6(this.wc);(this.De=200==e)?(4==b&&c7(this),this.u?(e7(this,b,f),g.Ch&&this.De&&3==b&&(this.ca.da(this.i,"tick",this.sM),this.i.start())):b7(this,f),this.De&&!this.Og&&(4==b?this.g.Pn(this):(this.De=
!1,Y6(this)))):(400==e&&0<f.indexOf("Unknown SID")?(this.rg=3,$6(13)):(this.rg=0,$6(14)),c7(this),d7(this))}}catch(k){this.wc&&j6(this.wc)}finally{}};
g.h.sM=function(){var a=g6(this.wc),b=j6(this.wc);this.ql<b.length&&(k7(this),e7(this,a,b),this.De&&4!=a&&Y6(this))};
g.h.NL=function(a){j7((0,g.x)(this.ML,this,a),0)};
g.h.ML=function(a){this.Og||(k7(this),b7(this,a),Y6(this))};
g.h.Dz=function(a){j7((0,g.x)(this.LL,this,a),0)};
g.h.LL=function(a){this.Og||(c7(this),this.De=a,this.g.Pn(this),this.g.Ae(4))};
g.h.cancel=function(){this.Og=!0;c7(this)};
g.h.XL=function(){this.Zi=null;var a=(0,g.D)();0<=a-this.Lt?(2!=this.Yh&&this.g.Ae(3),c7(this),this.rg=2,$6(18),d7(this)):i7(this,this.Lt-a)};
g.h.getLastError=function(){return this.rg};g.h=o7.prototype;g.h.Aq=null;g.h.Hd=null;g.h.eo=!1;g.h.Ew=null;g.h.pm=null;g.h.lr=null;g.h.Bq=null;g.h.ge=null;g.h.Bf=-1;g.h.Vj=null;g.h.oj=null;g.h.connect=function(a){this.Bq=a;a=p7(this.g,null,this.Bq);$6(3);this.Ew=(0,g.D)();var b=this.g.D;null!=b?(this.Vj=b[0],(this.oj=b[1])?(this.ge=1,q7(this)):(this.ge=2,s7(this))):($5(a,"MODE","init"),this.Hd=new U6(this,void 0,void 0,void 0),this.Hd.Zg=this.Aq,X6(this.Hd,a,!1,null,!0),this.ge=0)};
g.h.LC=function(a){if(a)this.ge=2,s7(this);else{$6(4);var b=this.g;b.Ne=b.hg.Bf;F7(b,9)}a&&this.Ae(2)};
g.h.Up=function(a){return this.g.Up(a)};
g.h.abort=function(){this.Hd&&(this.Hd.cancel(),this.Hd=null);this.Bf=-1};
g.h.Dw=function(){return!1};
g.h.xz=function(a,b){this.Bf=a.Wj;if(0==this.ge)if(b){try{var c=this.i.parse(b)}catch(d){c=this.g;c.Ne=this.Bf;F7(c,2);return}this.Vj=c[0];this.oj=c[1]}else c=this.g,c.Ne=this.Bf,F7(c,2);else if(2==this.ge)if(this.eo)$6(7),this.lr=(0,g.D)();else if("11111"==b){if($6(6),this.eo=!0,this.pm=(0,g.D)(),c=this.pm-this.Ew,!g.Ld||g.od(10)||500>c)this.Bf=200,this.Hd.cancel(),$6(12),r7(this.g,this,!0)}else $6(8),this.pm=this.lr=(0,g.D)(),this.eo=!1};
g.h.Pn=function(){this.Bf=this.Hd.Wj;if(this.Hd.De)0==this.ge?this.oj?(this.ge=1,q7(this)):(this.ge=2,s7(this)):2==this.ge&&((!g.Ld||g.od(10)?!this.eo:200>this.lr-this.pm)?($6(11),r7(this.g,this,!1)):($6(12),r7(this.g,this,!0)));else{0==this.ge?$6(9):2==this.ge&&$6(10);var a=this.g;this.Hd.getLastError();a.Ne=this.Bf;F7(a,2)}};
g.h.Yk=function(){return this.g.Yk()};
g.h.isActive=function(){return this.g.isActive()};
g.h.Ae=function(a){this.g.Ae(a)};g.h=t7.prototype;g.h.Dj=null;g.h.Ed=null;g.h.Ub=null;g.h.zq=null;g.h.rm=null;g.h.Ru=null;g.h.Fm=null;g.h.Dk=0;g.h.bI=0;g.h.Wc=null;g.h.og=null;g.h.qf=null;g.h.Tg=null;g.h.hg=null;g.h.Jo=null;g.h.ki=-1;g.h.ox=-1;g.h.Ne=-1;g.h.Rh=0;g.h.Kh=0;g.h.Pg=8;var G7=new g.Qf;g.Sa(u7,g.sf);g.Sa(v7,g.sf);g.Sa(w7,g.sf);g.h=t7.prototype;g.h.connect=function(a,b,c,d,e){$6(0);this.zq=b;this.Dj=c||{};d&&g.Ca(e)&&(this.Dj.OSID=d,this.Dj.OAID=e);this.A?(j7((0,g.x)(this.ov,this,a),100),Iqa(this)):this.ov(a)};
g.h.ov=function(a){this.hg=new o7(this);this.hg.Aq=null;this.hg.i=this.u;this.hg.connect(a)};
g.h.Dw=function(){return 0==this.g};
g.h.Cz=function(a){this.og=null;Lqa(this,a)};
g.h.Bz=function(){this.qf=null;this.Ub=new U6(this,this.l,"rpc",this.B);this.Ub.Zg=null;this.Ub.Cq=0;var a=this.Ru.clone();g.sn(a,"RID","rpc");g.sn(a,"SID",this.l);g.sn(a,"CI",this.Jo?"0":"1");g.sn(a,"AID",this.ki);y7(this,a);if(!g.Ld||g.od(10))g.sn(a,"TYPE","xmlhttp"),X6(this.Ub,a,!0,this.Fm,!1);else{g.sn(a,"TYPE","html");var b=this.Ub,c=!!this.Fm;b.Yh=3;b.ag=Z5(a.clone());h7(b,c)}};
g.h.xz=function(a,b){if(0!=this.g&&(this.Ub==a||this.Ed==a))if(this.Ne=a.Wj,this.Ed==a&&3==this.g)if(7<this.Pg){try{var c=this.u.parse(b)}catch(f){c=null}if(g.Ka(c)&&3==c.length)if(0==c[0])a:{if(!this.qf){if(this.Ub)if(this.Ub.Hi+3E3<this.Ed.Hi)C7(this),this.Ub.cancel(),this.Ub=null;else break a;E7(this);$6(19)}}else this.ox=c[1],0<this.ox-this.ki&&37500>c[2]&&this.Jo&&0==this.Kh&&!this.Tg&&(this.Tg=j7((0,g.x)(this.DI,this),6E3));else F7(this,11)}else b!=hsa.DO.g&&F7(this,11);else if(this.Ub==a&&
C7(this),!g.wb(b)){c=this.u.parse(b);g.Ka(c);for(var d=0;d<c.length;d++){var e=c[d];this.ki=e[0];e=e[1];2==this.g?"c"==e[0]?(this.l=e[1],this.Fm=e[2],e=e[3],null!=e?this.Pg=e:this.Pg=6,this.g=3,this.Wc&&this.Wc.fv(),this.Ru=p7(this,this.Yk()?this.Fm:null,this.zq),Mqa(this)):"stop"==e[0]&&F7(this,7):3==this.g&&("stop"==e[0]?F7(this,7):"noop"!=e[0]&&this.Wc&&this.Wc.ev(e),this.Kh=0)}}};
g.h.DI=function(){null!=this.Tg&&(this.Tg=null,this.Ub.cancel(),this.Ub=null,E7(this),$6(20))};
g.h.Pn=function(a){if(this.Ub==a){C7(this);this.Ub=null;var b=2}else if(this.Ed==a)this.Ed=null,b=1;else return;this.Ne=a.Wj;if(0!=this.g)if(a.De)1==b?(b=(0,g.D)()-a.Hi,G7.dispatchEvent(new v7(G7,a.sh?a.sh.length:0,b,this.Rh)),B7(this),this.o.length=0):Mqa(this);else{var c=a.getLastError(),d;if(!(d=3==c||7==c||0==c&&0<this.Ne)){if(d=1==b)this.Ed||this.og||1==this.g||2<=this.Rh?d=!1:(this.og=j7((0,g.x)(this.Cz,this,a),Nqa(this,this.Rh)),this.Rh++,d=!0);d=!(d||2==b&&E7(this))}if(d)switch(c){case 1:F7(this,
5);break;case 4:F7(this,10);break;case 3:F7(this,6);break;case 7:F7(this,12);break;default:F7(this,2)}}};
g.h.eD=function(a){if(!g.$a(arguments,this.g))throw Error("Unexpected channel state: "+this.g);};
g.h.eN=function(a){a?$6(2):($6(1),Oqa(this,8))};
g.h.Up=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new i6;a.T=!1;return a};
g.h.isActive=function(){return!!this.Wc&&this.Wc.isActive(this)};
g.h.Ae=function(a){G7.dispatchEvent(new w7(G7,a))};
g.h.Yk=function(){return!(!g.Ld||g.od(10))};
g.h=Pqa.prototype;g.h.fv=function(){};
g.h.ev=function(){};
g.h.dv=function(){};
g.h.Ip=function(){};
g.h.cw=function(){return{}};
g.h.isActive=function(){return!0};g.Sa(H7,g.A);g.h=H7.prototype;g.h.FL=function(){this.Zc=Math.min(3E5,2*this.Zc);this.l();this.i&&this.start()};
g.h.start=function(){var a=this.Zc+15E3*Math.random();g.Do(this.g,a);this.i=(0,g.D)()+a};
g.h.stop=function(){this.g.stop();this.i=0};
g.h.isActive=function(){return this.g.isActive()};
g.h.reset=function(){this.g.stop();this.Zc=5E3};g.Sa(I7,Pqa);g.h=I7.prototype;g.h.subscribe=function(a,b,c){return this.l.subscribe(a,b,c)};
g.h.unsubscribe=function(a,b,c){return this.l.unsubscribe(a,b,c)};
g.h.Mf=function(a){return this.l.ah(a)};
g.h.N=function(a,b){return this.l.N.apply(this.l,arguments)};
g.h.dispose=function(){this.ib||(this.ib=!0,g.qf(this.l),Sqa(this),g.qf(this.i),this.i=null)};
g.h.fa=function(){return this.ib};
g.h.connect=function(a,b,c){if(!this.g||2!=this.g.g){this.F="";this.i.stop();this.u=a||null;this.o=b||0;a=this.H+"/test";b=this.H+"/bind";var d=new t7(c?c.firstTestResults:null,c?c.secondTestResults:null,this.I),e=this.g;e&&(e.Wc=null);d.Wc=this;this.g=d;e?this.g.connect(a,b,this.A,e.l,e.ki):c?this.g.connect(a,b,this.A,c.sessionId,c.arrayId):this.g.connect(a,b,this.A)}};
g.h.sendMessage=function(a,b){var c={_sc:a};b&&g.ec(c,b);this.i.isActive()||2==(this.g?this.g.g:0)?this.B.push(c):J7(this)&&Jqa(this.g,c)};
g.h.fv=function(){this.i.reset();this.u=null;this.o=0;if(this.B.length){var a=this.B;this.B=[];for(var b=0,c=a.length;b<c;++b)Jqa(this.g,a[b])}this.N("handlerOpened")};
g.h.dv=function(a){var b=2==a&&401==this.g.Ne;4==a||b||this.i.start();this.N("handlerError",a)};
g.h.Ip=function(a){if(!this.i.isActive())this.N("handlerClosed");else if(a)for(var b=0,c=a.length;b<c;++b){var d=a[b].map;d&&this.B.push(d)}};
g.h.cw=function(){var a={v:2};this.F&&(a.gsessionid=this.F);0!=this.o&&(a.ui=""+this.o);0!=this.D&&(a.ui=""+this.D);this.u&&g.ec(a,this.u);return a};
g.h.ev=function(a){"S"==a[0]?this.F=a[1]:"gracefulReconnect"==a[0]?(this.i.start(),A7(this.g)):this.N("handlerMessage",new Qqa(a[0],a[1]))};
g.h.IM=function(){this.i.isActive();var a=this.g,b=0;a.Ub&&b++;a.Ed&&b++;0==b&&this.connect(this.u,this.o)};K7.prototype.o=function(a,b,c,d){b?a(d):a({text:c.responseText})};
K7.prototype.l=function(a,b){a(Error("Request error: "+b.status))};
K7.prototype.u=function(a){a(Error("request timed out"))};var $qa=(0,g.D)(),N7=null,Q7=Array(50),P7=-1,R7=!1;g.Sa(S7,g.N);S7.prototype.Rd=function(){return this.g};
S7.prototype.contains=function(a){return!!y6(this.g,a)};
S7.prototype.get=function(a){return a?z6(this.g,a):null};
S7.prototype.info=function(a){O7(this.B,a)};g.t(T7,g.N);g.h=T7.prototype;g.h.start=function(){!this.g&&isNaN(this.Aa)&&this.FB()};
g.h.stop=function(){this.g&&(this.g.abort(),this.g=null);isNaN(this.Aa)||(g.gq(this.Aa),this.Aa=NaN)};
g.h.U=function(){this.stop();g.N.prototype.U.call(this)};
g.h.FB=function(){this.Aa=NaN;this.g=g.br(L7(this.A,"/pairing/get_screen"),{method:"POST",wb:{pairing_code:this.u},timeout:5E3,onSuccess:(0,g.x)(this.FN,this),onError:(0,g.x)(this.EN,this),ne:(0,g.x)(this.GN,this)})};
g.h.FN=function(a,b){this.g=null;var c=b.screen||{};c.dialId=this.l;c.name=this.o;this.N("pairingComplete",new r6(c))};
g.h.EN=function(a){this.g=null;a.status&&404==a.status?this.i>=isa.length?this.N("pairingFailed",Error("DIAL polling timed out")):(a=isa[this.i],this.Aa=g.eq((0,g.x)(this.FB,this),a),this.i++):this.N("pairingFailed",Error("Server error "+a.status))};
g.h.GN=function(){this.g=null;this.N("pairingFailed",Error("Server not responding"))};
var isa=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.Sa(V7,S7);g.h=V7.prototype;g.h.start=function(){U7(this)&&this.N("screenChange");!g.It("yt-remote-lounge-token-expiration")&&dra(this);g.gq(this.i);this.i=g.eq((0,g.x)(this.start,this),1E4)};
g.h.add=function(a,b){U7(this);ara(this,a);W7(this,!1);this.N("screenChange");b(a);a.token||dra(this)};
g.h.remove=function(a,b){var c=U7(this);cra(this,a)&&(W7(this,!1),c=!0);b(a);c&&this.N("screenChange")};
g.h.Fo=function(a,b,c,d){var e=U7(this),f=this.get(a.id);f?(f.name!=b&&(f.name=b,W7(this,!1),e=!0),c(a)):d(Error("no such local screen."));e&&this.N("screenChange")};
g.h.U=function(){g.gq(this.i);V7.bb.U.call(this)};
g.h.OD=function(a){U7(this);var b=this.g.length;a=a&&a.screens||[];for(var c=0,d=a.length;c<d;++c){var e=a[c],f=this.get(e.screenId);f&&(f.token=e.loungeToken,--b)}W7(this,!b);b&&O7(this.B,"Missed "+b+" lounge tokens.")};
g.h.ND=function(a){O7(this.B,"Requesting lounge tokens failed: "+a)};g.t(Y7,g.N);g.h=Y7.prototype;g.h.start=function(){var a=parseInt(g.It("yt-remote-fast-check-period")||"0",10);(this.o=(0,g.D)()-144E5<a?0:a)?$7(this):(this.o=(0,g.D)()+3E5,g.Ht("yt-remote-fast-check-period",this.o),this.Ps())};
g.h.isEmpty=function(){return g.Xb(this.g)};
g.h.update=function(){X7("Updating availability on schedule.");var a=this.A(),b=g.Lb(this.g,function(c,d){return c&&!!z6(a,d)},this);
Z7(this,b)};
g.h.U=function(){g.gq(this.l);this.l=NaN;this.i&&(this.i.abort(),this.i=null);g.N.prototype.U.call(this)};
g.h.Ps=function(){g.gq(this.l);this.l=NaN;this.i&&this.i.abort();var a=gra(this);if(l6(a)){var b=L7(this.u,"/pairing/get_screen_availability");this.i=M7(this.u,b,{lounge_token:g.Rb(a).join(",")},(0,g.x)(this.iL,this,a),(0,g.x)(this.hL,this))}else Z7(this,{}),$7(this)};
g.h.iL=function(a,b){this.i=null;var c=g.Rb(gra(this));if(g.rb(c,g.Rb(a))){c=b.screens||[];for(var d={},e=0,f=c.length;e<f;++e)d[a[c[e].loungeToken]]="online"==c[e].status;Z7(this,d);$7(this)}else this.Hb("Changing Screen set during request."),this.Ps()};
g.h.hL=function(a){this.Hb("Screen availability failed: "+a);this.i=null;$7(this)};
g.h.Hb=function(a){O7("OnlineScreenService",a)};g.Sa(a8,S7);g.h=a8.prototype;g.h.start=function(){this.l.start();this.i.start();this.g.length&&(this.N("screenChange"),this.i.isEmpty()||this.N("onlineScreenChange"))};
g.h.add=function(a,b,c){this.l.add(a,b,c)};
g.h.remove=function(a,b,c){this.l.remove(a,b,c);this.i.update()};
g.h.Fo=function(a,b,c,d){this.l.contains(a)?this.l.Fo(a,b,c,d):(a="Updating name of unknown screen: "+a.name,O7(this.B,a),d(Error(a)))};
g.h.Rd=function(a){return a?this.g:g.fb(this.g,(0,g.Xd)(this.o,function(b){return!this.contains(b)},this))};
g.h.GB=function(){return(0,g.Xd)(this.Rd(!0),function(a){return!!this.i.g[a.id]},this)};
g.h.HB=function(a,b,c,d,e){this.info("getDialScreenByPairingCode "+a+" / "+b);var f=new T7(this.A,a,b,c);f.subscribe("pairingComplete",(0,g.x)(function(k){g.qf(f);d(b8(this,k))},this));
f.subscribe("pairingFailed",function(k){g.qf(f);e(k)});
f.start();return(0,g.x)(f.stop,f)};
g.h.IN=function(a,b,c,d){g.br(L7(this.A,"/pairing/get_screen"),{method:"POST",wb:{pairing_code:a},timeout:5E3,onSuccess:(0,g.x)(function(e,f){var k=new r6(f.screen||{});if(!k.name||kra(this,k.name)){a:{var l=k.name;for(var m=2,n=b(l,m);kra(this,n);){m++;if(20<m)break a;n=b(l,m)}l=n}k.name=l}c(b8(this,k))},this),
onError:(0,g.x)(function(e){d(Error("pairing request failed: "+e.status))},this),
ne:(0,g.x)(function(){d(Error("pairing request timed out."))},this)})};
g.h.U=function(){g.qf(this.l);g.qf(this.i);a8.bb.U.call(this)};
g.h.WD=function(){lra(this);this.N("screenChange");this.i.update()};
a8.prototype.dispose=a8.prototype.dispose;g.Sa(d8,g.N);g.h=d8.prototype;g.h.Rn=function(a){this.l=a;this.N("sessionScreen",this.l)};
g.h.Ud=function(a){this.fa()||(a&&e8(this,""+a),this.l=null,this.N("sessionScreen",null))};
g.h.info=function(a){O7(this.R,a)};
g.h.JB=function(){return null};
g.h.Ys=function(a){var b=this.i;a?(b.displayStatus=new chrome.cast.ReceiverDisplayStatus(a,[]),b.displayStatus.showStop=!0):b.displayStatus=null;chrome.cast.setReceiverDisplayStatus(b,(0,g.x)(function(){this.info("Updated receiver status for "+b.friendlyName+": "+a)},this),(0,g.x)(function(){e8(this,"Failed to update receiver status for: "+b.friendlyName)},this))};
g.h.U=function(){this.Ys("");d8.bb.U.call(this)};g.Sa(f8,d8);g.h=f8.prototype;g.h.Xs=function(a){if(this.g){if(this.g==a)return;e8(this,"Overriding cast sesison with new session object");this.g.removeUpdateListener(this.A);this.g.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.u)}this.g=a;this.g.addUpdateListener(this.A);this.g.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.u);nra(this)};
g.h.mi=function(a){this.info("launchWithParams no-op for Cast: "+g.Kg(a))};
g.h.stop=function(){this.g?this.g.stop((0,g.x)(function(){this.Ud()},this),(0,g.x)(function(){this.Ud(Error("Failed to stop receiver app."))},this)):this.Ud(Error("Stopping cast device witout session."))};
g.h.Ys=g.Ha;g.h.U=function(){this.info("disposeInternal");g.gq(this.o);this.o=0;this.g&&(this.g.removeUpdateListener(this.A),this.g.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.u));this.g=null;f8.bb.U.call(this)};
g.h.iM=function(a,b){if(!this.fa())if(b){var c=n6(b);if(g.Na(c)){var d=""+c.type;c=c.data||{};this.info("onYoutubeMessage_: "+d+" "+g.Kg(c));switch(d){case "mdxSessionStatus":mra(this,c.screenId);break;default:e8(this,"Unknown youtube message: "+d)}}else e8(this,"Unable to parse message.")}else e8(this,"No data in message.")};
g.h.uw=function(a,b,c,d){jra(this.F,this.i.label,a,this.i.friendlyName,(0,g.x)(function(e){e?b(e):0<=d?(e8(this,"Screen "+a+" appears to be offline. "+d+" retries left."),g.eq((0,g.x)(this.uw,this,a,b,c,d-1),300)):c(Error("Unable to fetch screen."))},this),c)};
g.h.JB=function(){return this.g};
g.h.JN=function(a){this.fa()||a||(e8(this,"Cast session died."),this.Ud())};g.Sa(g8,d8);g.h=g8.prototype;g.h.Xs=function(a){this.o=a;this.o.addUpdateListener(this.I)};
g.h.mi=function(a){this.u=a;this.B()};
g.h.stop=function(){this.g();this.g=g.Ha;g.gq(this.A);this.o?this.o.stop((0,g.x)(this.Ud,this,null),(0,g.x)(this.Ud,this,"Failed to stop DIAL device.")):this.Ud()};
g.h.U=function(){this.g();this.g=g.Ha;g.gq(this.A);this.o&&this.o.removeUpdateListener(this.I);this.o=null;g8.bb.U.call(this)};
g.h.MN=function(a){this.fa()||a||(e8(this,"DIAL session died."),this.g(),this.g=g.Ha,this.Ud())};
g.h.Oq=function(a){this.H=x6();if(this.u){var b=new chrome.cast.DialLaunchResponse(!0,pra(this));a(b);ora(this)}else this.B=(0,g.x)(function(){g.gq(this.A);this.B=g.Ha;this.A=NaN;var c=new chrome.cast.DialLaunchResponse(!0,pra(this));a(c);ora(this)},this),this.A=g.eq((0,g.x)(function(){this.B()},this),100)};
g.h.rE=function(a,b,c){jra(this.F,this.D.receiver.label,a,this.i.friendlyName,(0,g.x)(function(d){d&&d.token?(this.Rn(d),b(new chrome.cast.DialLaunchResponse(!1))):this.Oq(b,c)},this),(0,g.x)(function(d){e8(this,"Failed to get DIAL screen: "+d);
this.Oq(b,c)},this))};g.Sa(h8,d8);h8.prototype.stop=function(){this.Ud()};
h8.prototype.Xs=g.Ha;h8.prototype.mi=function(){g.gq(this.g);this.g=NaN;var a=z6(this.F.Rd(),this.i.label);a?this.Rn(a):this.Ud(Error("No such screen"))};
h8.prototype.U=function(){g.gq(this.g);this.g=NaN;h8.bb.U.call(this)};g.Sa(i8,g.N);g.h=i8.prototype;
g.h.init=function(a,b){chrome.cast.timeout.requestSession=3E4;var c=new chrome.cast.SessionRequest(this.B);this.D||(c.dialRequest=new chrome.cast.DialRequest("YouTube"));var d=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED,e=a?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION,f=(0,g.x)(this.RK,this);c=new chrome.cast.ApiConfig(c,(0,g.x)(this.zz,this),f,d,e);c.customDialLaunchCallback=(0,g.x)(this.fJ,this);chrome.cast.initialize(c,(0,g.x)(function(){this.fa()||
(chrome.cast.addReceiverActionListener(this.o),Xqa(),this.i.subscribe("onlineScreenChange",(0,g.x)(this.IB,this)),this.l=rra(this),chrome.cast.setCustomReceivers(this.l,g.Ha,(0,g.x)(function(k){this.Hb("Failed to set initial custom receivers: "+g.Kg(k))},this)),this.N("yt-remote-cast2-availability-change",k8(this)),b(!0))},this),(0,g.x)(function(k){this.Hb("Failed to initialize API: "+g.Kg(k));
b(!1)},this))};
g.h.SM=function(a,b){j8("Setting connected screen ID: "+a+" -> "+b);if(this.g){var c=this.g.l;if(!a||c&&c.id!=a)j8("Unsetting old screen status: "+this.g.i.friendlyName),l8(this,null)}if(a&&b){if(!this.g){c=z6(this.i.Rd(),a);if(!c){j8("setConnectedScreenStatus: Unknown screen.");return}var d=qra(this,c);d||(j8("setConnectedScreenStatus: Connected receiver not custom..."),d=new chrome.cast.Receiver(c.uuid?c.uuid:c.id,c.name),d.receiverType=chrome.cast.ReceiverType.CUSTOM,this.l.push(d),chrome.cast.setCustomReceivers(this.l,
g.Ha,(0,g.x)(function(e){this.Hb("Failed to set initial custom receivers: "+g.Kg(e))},this)));
j8("setConnectedScreenStatus: new active receiver: "+d.friendlyName);l8(this,new h8(this.i,d),!0)}this.g.Ys(b)}else j8("setConnectedScreenStatus: no screen.")};
g.h.TM=function(a){this.fa()?this.Hb("Setting connection data on disposed cast v2"):this.g?this.g.mi(a):this.Hb("Setting connection data without a session")};
g.h.LN=function(){this.fa()?this.Hb("Stopping session on disposed cast v2"):this.g?(this.g.stop(),l8(this,null)):j8("Stopping non-existing session")};
g.h.requestSession=function(){chrome.cast.requestSession((0,g.x)(this.zz,this),(0,g.x)(this.oL,this))};
g.h.U=function(){this.i.unsubscribe("onlineScreenChange",(0,g.x)(this.IB,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.o);g.cb(g.w("yt.mdx.remote.debug.handlers_")||[],Uqa);g.qf(this.g);i8.bb.U.call(this)};
g.h.Hb=function(a){O7("Controller",a)};
g.h.Az=function(a,b){this.g==a&&(b||l8(this,null),this.N("yt-remote-cast2-session-change",b))};
g.h.NK=function(a,b){if(!this.fa())if(a)switch(a.friendlyName=chrome.cast.unescape(a.friendlyName),j8("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+b),b){case chrome.cast.ReceiverAction.CAST:if(this.g)if(this.g.i.label!=a.label)j8("onReceiverAction_: Stopping active receiver: "+this.g.i.friendlyName),this.g.stop();else{j8("onReceiverAction_: Casting to active receiver.");this.g.l&&this.N("yt-remote-cast2-session-change",this.g.l);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:l8(this,
new h8(this.i,a));break;case chrome.cast.ReceiverType.DIAL:l8(this,new g8(this.i,a,this.A));break;case chrome.cast.ReceiverType.CAST:l8(this,new f8(this.i,a));break;default:this.Hb("Unknown receiver type: "+a.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.g&&this.g.i.label==a.label?this.g.stop():this.Hb("Stopping receiver w/o session: "+a.friendlyName)}else this.Hb("onReceiverAction_ called without receiver.")};
g.h.fJ=function(a){if(this.fa())return Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.Hb("Not DIAL receiver: "+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.g?this.g.i:null;if(!c||c.label!=b.label)return this.Hb("Receiving DIAL launch request for non-clicked DIAL receiver: "+b.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(c&&c.label==b.label&&c.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.g.l)return j8("Reselecting dial screen."),
this.N("yt-remote-cast2-session-change",this.g.l),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.Hb('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+b.friendlyName);l8(this,new g8(this.i,b,this.A))}b=this.g;b.D=a;return b.D.appState==chrome.cast.DialAppState.RUNNING?new Promise((0,g.x)(b.rE,b,(b.D.extraData||{}).screenId||null)):new Promise((0,g.x)(b.Oq,b))};
g.h.zz=function(a){if(!this.fa()){j8("New cast session ID: "+a.sessionId);var b=a.receiver;if(b.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.g)if(b.receiverType==chrome.cast.ReceiverType.CAST)j8("Got resumed cast session before resumed mdx connection."),b.friendlyName=chrome.cast.unescape(b.friendlyName),l8(this,new f8(this.i,b),!0);else{this.Hb("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var c=this.g.i,d=z6(this.i.Rd(),c.label);d&&s6(d,b.label)&&
c.receiverType!=chrome.cast.ReceiverType.CAST&&b.receiverType==chrome.cast.ReceiverType.CAST&&(j8("onSessionEstablished_: manual to cast session change "+b.friendlyName),g.qf(this.g),this.g=new f8(this.i,b),this.g.subscribe("sessionScreen",(0,g.x)(this.Az,this,this.g)),this.g.mi(null));this.g.Xs(a)}}};
g.h.KN=function(){return this.g?this.g.JB():null};
g.h.oL=function(a){this.fa()||(this.Hb("Failed to estabilish a session: "+g.Kg(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&l8(this,null))};
g.h.RK=function(a){j8("Receiver availability updated: "+a);if(!this.fa()){var b=k8(this);this.u=a==chrome.cast.ReceiverAvailability.AVAILABLE;k8(this)!=b&&this.N("yt-remote-cast2-availability-change",k8(this))}};
g.h.IB=function(){this.fa()||(this.l=rra(this),j8("Updating custom receivers: "+g.Kg(this.l)),chrome.cast.setCustomReceivers(this.l,g.Ha,(0,g.x)(function(){this.Hb("Failed to set custom receivers.")},this)),this.N("yt-remote-cast2-availability-change",k8(this)))};
i8.prototype.setLaunchParams=i8.prototype.TM;i8.prototype.setConnectedScreenStatus=i8.prototype.SM;i8.prototype.stopSession=i8.prototype.LN;i8.prototype.getCastSession=i8.prototype.KN;i8.prototype.requestSession=i8.prototype.requestSession;i8.prototype.init=i8.prototype.init;i8.prototype.dispose=i8.prototype.dispose;var r8=[];w8.prototype.reset=function(a){this.listId="";this.index=-1;this.videoId="";x8(this);this.volume=-1;this.muted=!1;a&&(this.index=a.index,this.listId=a.listId,this.videoId=a.videoId,this.playerState=a.playerState,this.volume=a.volume,this.muted=a.muted,this.audioTrackId=a.audioTrackId,this.g=a.trackData,this.Oe=a.hasPrevious,this.hasNext=a.hasNext,this.B=a.playerTime,this.A=a.playerTimeAt,this.o=a.seekableStart,this.i=a.seekableEnd,this.D=a.duration,this.F=a.loadedTime,this.l=a.liveIngestionTime,this.u=
!isNaN(this.l))};
w8.prototype.isAdPlaying=function(){return 1081==this.playerState};
w8.prototype.getDuration=function(){return this.u?this.D+y8(this):this.D};
w8.prototype.clone=function(){return new w8(C8(this))};g.t(E8,g.N);g.h=E8.prototype;g.h.play=function(){1==this.g?(this.i?this.i.play(null,g.Ha,K8(this,"play")):J8(this,"play"),I8(this,1,A8(F8(this))),this.N("remotePlayerChange")):G8(this,this.play)};
g.h.pause=function(){1==this.g?(this.i?this.i.pause(null,g.Ha,K8(this,"pause")):J8(this,"pause"),I8(this,2,A8(F8(this))),this.N("remotePlayerChange")):G8(this,this.pause)};
g.h.seekTo=function(a){if(1==this.g){if(this.i){var b=F8(this),c=new chrome.cast.media.SeekRequest;c.currentTime=a;c.resumeState=1==b.playerState||3==b.playerState?chrome.cast.media.ResumeState.PLAYBACK_START:chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.i.seek(c,g.Ha,K8(this,"seekTo",{newTime:a}))}else J8(this,"seekTo",{newTime:a});I8(this,3,a);this.N("remotePlayerChange")}else G8(this,g.Qa(this.seekTo,a))};
g.h.stop=function(){if(1==this.g){this.i?this.i.stop(null,g.Ha,K8(this,"stopVideo")):J8(this,"stopVideo");var a=F8(this);a.index=-1;a.videoId="";x8(a);H8(this,a);this.N("remotePlayerChange")}else G8(this,this.stop)};
g.h.setVolume=function(a,b){if(1==this.g){var c=F8(this);if(this.l){if(c.volume!=a){var d=Math.round(a)/100;this.l.setReceiverVolumeLevel(d,(0,g.x)(function(){O7("CP","set receiver volume: "+d)},this),(0,g.x)(function(){this.Hb("failed to set receiver volume.")},this))}c.muted!=b&&this.l.setReceiverMuted(b,(0,g.x)(function(){O7("CP","set receiver muted: "+b)},this),(0,g.x)(function(){this.Hb("failed to set receiver muted.")},this))}else{var e={volume:a,
muted:b};-1!=c.volume&&(e.delta=a-c.volume);J8(this,"setVolume",e)}c.muted=b;c.volume=a;H8(this,c)}else G8(this,g.Qa(this.setVolume,a,b))};
g.h.JA=function(a,b){if(1==this.g){var c=F8(this),d={videoId:a};b&&(c.g={trackName:b.name,languageCode:b.languageCode,sourceLanguageCode:b.translationLanguage?b.translationLanguage.languageCode:"",languageName:b.languageName,kind:b.kind},d.style=g.Kg(b.style),g.ec(d,c.g));J8(this,"setSubtitlesTrack",d);H8(this,c)}else G8(this,g.Qa(this.JA,a,b))};
g.h.setAudioTrack=function(a,b){if(1==this.g){var c=b.getLanguageInfo().getId();J8(this,"setAudioTrack",{videoId:a,audioTrackId:c});var d=F8(this);d.audioTrackId=c;H8(this,d)}else G8(this,g.Qa(this.setAudioTrack,a,b))};
g.h.playVideo=function(a,b,c,d,e,f,k){var l=F8(this);c=c||0;var m={videoId:a,currentIndex:c};B8(l,a,c);g.Ca(b)&&(z8(l,b),m.currentTime=b);g.Ca(d)&&(m.listId=d);null!=e&&(m.playerParams=e);null!=f&&(m.clickTrackingParams=f);null!=k&&(m.locationInfo=g.Kg(k));J8(this,"setPlaylist",m);d||H8(this,l)};
g.h.Xn=function(a,b){if(1==this.g){if(a&&b){var c=F8(this);B8(c,a,b);H8(this,c)}J8(this,"previous")}else G8(this,g.Qa(this.Xn,a,b))};
g.h.nextVideo=function(a,b){if(1==this.g){if(a&&b){var c=F8(this);B8(c,a,b);H8(this,c)}J8(this,"next")}else G8(this,g.Qa(this.nextVideo,a,b))};
g.h.Jv=function(){1==this.g?J8(this,"dismissAutoplay"):G8(this,this.Jv)};
g.h.dispose=function(){if(3!=this.g){var a=this.g;this.g=3;this.N("proxyStateChange",a,this.g)}g.N.prototype.dispose.call(this)};
g.h.U=function(){Era(this);this.o=null;this.u.clear();D8(this,null);g.N.prototype.U.call(this)};
g.h.Ot=function(a){if((a!=this.g||2==a)&&3!=this.g&&0!=a){var b=this.g;this.g=a;this.N("proxyStateChange",b,a);if(1==a)for(;!this.u.isEmpty();)b=a=this.u,0==b.g.length&&(b.g=b.i,b.g.reverse(),b.i=[]),a.g.pop().apply(this);else 3==a&&this.dispose()}};
g.h.KK=function(a,b){this.N(a,b)};
g.h.KI=function(a){if(!a)this.Gk(null),D8(this,null);else if(this.l.receiver.volume){a=this.l.receiver.volume;var b=F8(this),c=Math.round(100*a.level||0);if(b.volume!=c||b.muted!=a.muted)O7("CP","Cast volume update: "+a.level+(a.muted?" muted":"")),b.volume=c,b.muted=!!a.muted,H8(this,b)}};
g.h.Gk=function(a){O7("CP","Cast media: "+!!a);this.i&&this.i.removeUpdateListener(this.D);if(this.i=a)this.i.addUpdateListener(this.D),Fra(this),this.N("remotePlayerChange")};
g.h.JI=function(a){a?(Fra(this),this.N("remotePlayerChange")):this.Gk(null)};
g.h.zt=function(){J8(this,"sendDebugCommand",{debugCommand:"stats4nerds "})};
g.h.YI=function(){var a=Bra();a&&D8(this,a)};
g.h.Hb=function(a){O7("CP",a)};g.t(L8,g.N);g.h=L8.prototype;
g.h.connect=function(a,b){if(b){var c=b.listId,d=b.videoId,e=b.playerParams,f=b.clickTrackingParams,k=b.index,l={videoId:d},m=b.currentTime,n=b.locationInfo;g.Ca(m)&&(l.currentTime=5>=m?0:m);e&&(l.playerParams=e);n&&(l.locationInfo=n);f&&(l.clickTrackingParams=f);c&&(l.listId=c);g.Ca(k)&&(l.currentIndex=k);c&&(this.Pa.listId=c);this.Pa.videoId=d;this.Pa.index=k||0;this.Pa.state=3;z8(this.Pa,m);this.o="UNSUPPORTED";M8("Connecting with setPlaylist and params: "+g.Kg(l));this.g.connect({method:"setPlaylist",
params:g.Kg(l)},a,G6())}else M8("Connecting without params"),this.g.connect({},a,G6());Hra(this)};
g.h.dispose=function(){this.fa()||(this.N("beforeDispose"),N8(this,3));g.N.prototype.dispose.call(this)};
g.h.U=function(){O8(this);Q8(this);P8(this);g.gq(this.B);this.B=NaN;g.gq(this.D);this.D=NaN;this.l=null;g.ls(this.R);this.R.length=0;this.g.dispose();g.N.prototype.U.call(this);this.o=this.A=this.i=this.Pa=this.g=null};
g.h.HD=function(){this.Oh(2)};
g.h.OI=function(){M8("Channel opened");this.I&&(this.I=!1,P8(this),this.H=g.eq((0,g.x)(function(){M8("Timing out waiting for a screen.");this.Oh(1)},this),15E3));
Cqa(Rqa(this.g),this.M)};
g.h.LI=function(){M8("Channel closed");isNaN(this.u)?J6(!0):J6();this.dispose()};
g.h.MI=function(a){J6();isNaN(this.Lj())?(M8("Channel error: "+a+" without reconnection"),this.dispose()):(this.I=!0,M8("Channel error: "+a+" with reconnection in "+this.Lj()+" ms"),N8(this,2))};
g.h.NI=function(a){a.params?M8("Received: action="+a.action+", params="+g.Kg(a.params)):M8("Received: action="+a.action+" {}");switch(a.action){case "loungeStatus":a=n6(a.params.devices);this.i=(0,g.ge)(a,function(c){return new q6(c)});
a=!!g.Xa(this.i,function(c){return"LOUNGE_SCREEN"==c.type});
Kra(this,a);break;case "loungeScreenDisconnected":g.eb(this.i,function(c){return"LOUNGE_SCREEN"==c.type});
Kra(this,!1);break;case "remoteConnected":var b=new q6(n6(a.params.device));g.Xa(this.i,function(c){return b?c.id==b.id:!1})||rqa(this.i,b);
break;case "remoteDisconnected":b=new q6(n6(a.params.device));g.eb(this.i,function(c){return b?c.id==b.id:!1});
break;case "gracefulDisconnect":break;case "playlistModified":Mra(this,a);break;case "nowPlaying":Ora(this,a);break;case "onStateChange":Nra(this,a);break;case "onAdStateChange":Pra(this,a);break;case "onVolumeChanged":Qra(this,a);break;case "onSubtitlesTrackChanged":Lra(this,a);break;case "nowAutoplaying":Rra(this,a);break;case "autoplayDismissed":this.N("autoplayDismissed");break;case "autoplayUpNext":this.A=a.params.videoId||null;this.N("autoplayUpNext",this.A);break;case "onAutoplayModeChanged":this.o=
a.params.autoplayMode;this.N("autoplayModeChange",this.o);"DISABLED"==this.o&&this.N("autoplayDismissed");break;case "onHasPreviousNextChanged":Sra(this,a);break;case "requestAssistedSignIn":this.N("assistedSignInRequested",a.params.authCode);break;default:M8("Unrecognized action: "+a.action)}};
g.h.FM=function(){if(this.l){var a=this.l;this.l=null;this.Pa.videoId!=a&&R8(this,"getNowPlaying")}};
g.h.xD=function(){var a=3;this.fa()||(a=0,isNaN(this.Lj())?J7(this.g)&&isNaN(this.u)&&(a=1):a=2);return a};
g.h.Oh=function(a){M8("Disconnecting with "+a);O8(this);this.N("beforeDisconnect",a);1==a&&J6();Sqa(this.g,a);this.dispose()};
g.h.wD=function(){var a=this.Pa;this.l&&(a=this.Pa.clone(),B8(a,this.l,a.index));return C8(a)};
g.h.UM=function(a){var b=new w8(a);b.videoId&&b.videoId!=this.Pa.videoId&&(this.l=b.videoId,g.gq(this.B),this.B=g.eq((0,g.x)(this.FM,this),5E3));var c=[];this.Pa.listId==b.listId&&this.Pa.videoId==b.videoId&&this.Pa.index==b.index||c.push("remoteQueueChange");this.Pa.playerState==b.playerState&&this.Pa.volume==b.volume&&this.Pa.muted==b.muted&&A8(this.Pa)==A8(b)&&g.Kg(this.Pa.g)==g.Kg(b.g)||c.push("remotePlayerChange");this.Pa.reset(a);(0,g.y)(c,function(d){this.N(d)},this)};
g.h.rw=function(){var a=this.g.A.id,b=g.Xa(this.i,function(c){return"REMOTE_CONTROL"==c.type&&c.id!=a});
return b?b.id:""};
g.h.Lj=function(){var a=this.g;return a.i.isActive()?a.i.i-(0,g.D)():NaN};
g.h.pD=function(){return this.o||"UNSUPPORTED"};
g.h.qD=function(){return this.A||""};
g.h.DN=function(){if(!isNaN(this.Lj())){var a=this.g.i;g.Eo(a.g);a.start()}};
g.h.MM=function(a,b){R8(this,a,b);Jra(this)};
L8.prototype.subscribe=L8.prototype.subscribe;L8.prototype.unsubscribeByKey=L8.prototype.Mf;L8.prototype.getProxyState=L8.prototype.xD;L8.prototype.disconnect=L8.prototype.Oh;L8.prototype.getPlayerContextData=L8.prototype.wD;L8.prototype.setPlayerContextData=L8.prototype.UM;L8.prototype.getOtherConnectedRemoteId=L8.prototype.rw;L8.prototype.getReconnectTimeout=L8.prototype.Lj;L8.prototype.getAutoplayMode=L8.prototype.pD;L8.prototype.getAutoplayVideoId=L8.prototype.qD;L8.prototype.reconnect=L8.prototype.DN;
L8.prototype.sendMessage=L8.prototype.MM;g.t(S8,S7);g.h=S8.prototype;g.h.Rd=function(a){return this.Yc.$_gs(a)};
g.h.contains=function(a){return!!this.Yc.$_c(a)};
g.h.get=function(a){return this.Yc.$_g(a)};
g.h.start=function(){this.Yc.$_st()};
g.h.add=function(a,b,c){this.Yc.$_a(a,b,c)};
g.h.remove=function(a,b,c){this.Yc.$_r(a,b,c)};
g.h.Fo=function(a,b,c,d){this.Yc.$_un(a,b,c,d)};
g.h.U=function(){for(var a=0,b=this.i.length;a<b;++a)this.Yc.$_ubk(this.i[a]);this.i.length=0;this.Yc=null;S7.prototype.U.call(this)};
g.h.HN=function(){this.N("screenChange")};
g.h.pK=function(){this.N("onlineScreenChange")};
a8.prototype.$_st=a8.prototype.start;a8.prototype.$_gspc=a8.prototype.IN;a8.prototype.$_gsppc=a8.prototype.HB;a8.prototype.$_c=a8.prototype.contains;a8.prototype.$_g=a8.prototype.get;a8.prototype.$_a=a8.prototype.add;a8.prototype.$_un=a8.prototype.Fo;a8.prototype.$_r=a8.prototype.remove;a8.prototype.$_gs=a8.prototype.Rd;a8.prototype.$_gos=a8.prototype.GB;a8.prototype.$_s=a8.prototype.subscribe;a8.prototype.$_ubk=a8.prototype.Mf;var k9=null,j9=!1,T8=null,U8=null,i9=null,Y8=[];g.t(l9,g.A);g.h=l9.prototype;
g.h.U=function(){g.A.prototype.U.call(this);this.o.stop();this.A.stop();this.I.stop();this.M();this.g.unsubscribe("proxyStateChange",this.wz,this);this.g.unsubscribe("remotePlayerChange",this.Ik,this);this.g.unsubscribe("remoteQueueChange",this.Sn,this);this.g.unsubscribe("autoplayUpNext",this.Yy,this);this.g.unsubscribe("previousNextChange",this.sz,this);this.g.unsubscribe("nowAutoplaying",this.oz,this);this.g.unsubscribe("autoplayDismissed",this.Xy,this);this.g=this.u=null};
g.h.Ux=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];if(2!=this.g.g)if(o9(this)){if(!F8(this.g).isAdPlaying()||"control_seek"!=a)switch(a){case "control_toggle_play_pause":1==F8(this.g).playerState?this.g.pause():this.g.play();break;case "control_play":this.g.play();break;case "control_pause":this.g.pause();break;case "control_seek":this.H.Sj(c[0],c[1]);break;case "control_subtitles_set_track":p9(this,c[0]);break;case "control_set_audio_track":c=c[0],o9(this)&&this.g.setAudioTrack(this.i.getVideoData(1).videoId,
c)}}else switch(a){case "control_toggle_play_pause":case "control_play":case "control_pause":c=this.i.getCurrentTime();q9(this,0==c?void 0:c);break;case "control_seek":q9(this,c[0]);break;case "control_subtitles_set_track":p9(this,c[0]);break;case "control_set_audio_track":c=c[0],o9(this)&&this.g.setAudioTrack(this.i.getVideoData(1).videoId,c)}};
g.h.II=function(a){this.I.DD(a)};
g.h.nN=function(a){this.Ux("control_subtitles_set_track",g.Xb(a)?null:a)};
g.h.UA=function(){var a=this.i.getOption("captions","track");g.Xb(a)||p9(this,a)};
g.h.jz=function(a){if(o9(this)){this.g.unsubscribe("remotePlayerChange",this.Ik,this);var b=Math.round(a.volume);a=!!a.muted;var c=F8(this.g);if(b!=c.volume||a!=c.muted)this.g.setVolume(b,a),this.R.start();this.g.subscribe("remotePlayerChange",this.Ik,this)}};
g.h.KJ=function(){g.Xb(this.B)||dsa(this,this.B);this.D=!1};
g.h.wz=function(a,b){this.A.stop();2==b&&this.TA()};
g.h.Ik=function(){if(o9(this)){this.o.stop();var a=F8(this.g);switch(a.playerState){case 1080:case 1081:case 1084:case 1085:this.u.Wm=1;break;case 1082:case 1083:this.u.Wm=0;break;default:this.u.Wm=-1}switch(a.playerState){case 1081:case 1:n9(this,new g.PC(8));this.SA();break;case 1085:case 3:n9(this,new g.PC(9));break;case 1083:case 0:n9(this,new g.PC(2));this.H.stop();m9(this,this.i.getVideoData().lengthSeconds);break;case 1084:n9(this,new g.PC(4));break;case 2:n9(this,new g.PC(4));m9(this,A8(a));
break;case -1:n9(this,new g.PC(64));break;case -1E3:n9(this,new g.PC(128,{errorCode:"mdx.remoteerror",errorMessage:"\uc774 \ub3d9\uc601\uc0c1\uc740 \uc6d0\uaca9\uc73c\ub85c \uc7ac\uc0dd\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."}))}a=F8(this.g).g;var b=this.B;(a||b?a&&b&&a.trackName==b.trackName&&a.languageCode==b.languageCode&&a.languageName==b.languageName&&a.kind==b.kind:1)||(this.B=a,dsa(this,a));a=F8(this.g);-1==a.volume||Math.round(this.i.getVolume())==a.volume&&this.i.isMuted()==a.muted||this.R.isActive()||
this.uB()}else csa(this)};
g.h.sz=function(){this.i.N("mdxpreviousnextchange")};
g.h.Sn=function(){o9(this)||csa(this)};
g.h.KC=function(){this.g.Jv()};
g.h.Yy=function(a){a&&(a=g.br("/watch_queue_ajax",{method:"GET",ud:{action_get_watch_queue_item:1,video_id:a},onSuccess:(0,g.x)(this.QL,this)}))&&(this.M=(0,g.x)(a.abort,a))};
g.h.QL=function(a,b){var c=new g.zB(g.X(this.i),{videoId:b.videoId,title:b.title,author:b.author,murlmq_webp:b.url});this.suggestion=c;this.i.N("mdxautoplayupnext",c)};
g.h.oz=function(a){isNaN(a)||this.i.N("mdxnowautoplaying",a)};
g.h.Xy=function(){this.i.N("mdxautoplaycanceled")};
g.h.fG=function(a,b){-1==F8(this.g).playerState?q9(this,a):b&&this.g.seekTo(a)};
g.h.uB=function(){if(o9(this)){var a=F8(this.g);this.l.Na(this.P);a.muted?this.i.mute():this.i.unMute();this.i.setVolume(a.volume);this.P=this.l.K(this.i,"onVolumeChange",this.jz)}};
g.h.SA=function(){this.o.stop();if(!this.g.fa()){var a=F8(this.g);1==a.playerState&&n9(this,new g.PC(8));m9(this,A8(a));this.o.start()}};
g.h.TA=function(){this.A.stop();this.o.stop();var a=this.g.o.getReconnectTimeout();2==this.g.g&&!isNaN(a)&&this.A.start()};g.t(r9,g.W);r9.prototype.o=function(){p6("mdx-privacy-popup-cancel");this.l.hide()};
r9.prototype.A=function(){p6("mdx-privacy-popup-confirm");this.l.hide()};g.t(s9,g.W);s9.prototype.u=function(a){fsa(this,a.state)};g.t(t9,g.rU);t9.prototype.I=function(){var a=this.l.getOption("remote","receivers");a&&1<a.length&&!this.l.getOption("remote","quickCast")?(this.B=g.tb(a,this.A,this),g.tU(this,(0,g.ge)(a,this.A)),a=this.l.getOption("remote","currentReceiver"),this.le(this.A(a)),this.enable(!0)):this.enable(!1)};
t9.prototype.A=function(a){return a.key};
t9.prototype.ze=function(a){return"cast-selector-receiver"==a?"\uc804\uc1a1...":this.B[a].name};
t9.prototype.Lc=function(a){g.rU.prototype.Lc.call(this,a);this.l.setOption("remote","currentReceiver",this.B[a]);this.o.nb()};g.t(u9,g.mL);g.h=u9.prototype;
g.h.create=function(){Xra(g.fz(g.X(this.player)));this.o.push(g.lq("yt-remote-before-disconnect",this.FI,this));this.o.push(g.lq("yt-remote-connection-change",this.SK,this));this.o.push(g.lq("yt-remote-receiver-availability-change",this.uz,this));this.o.push(g.lq("yt-remote-auto-connect",this.QK,this));this.o.push(g.lq("yt-remote-receiver-resumed",this.PK,this));this.o.push(g.lq("mdx-privacy-popup-confirm",this.vM,this));this.o.push(g.lq("mdx-privacy-popup-cancel",this.uM,this));this.uz()};
g.h.load=function(){this.player.cancelPlayback();g.mL.prototype.load.call(this);this.u=new l9(this,this.player,this.g);var a=(a=bsa())?a.currentTime:0;var b=h9()?new E8(c9(),void 0):null;0==a&&b&&(a=A8(F8(b)));0!=a&&this.Nc(a);esa(this,this.rk,this.rk);g.tY(this.player.app,6)};
g.h.unload=function(){this.player.N("mdxautoplaycanceled");this.l=this.i;g.rf(this.u,this.g);this.g=this.u=null;g.mL.prototype.unload.call(this);g.tY(this.player.app,5);v9(this)};
g.h.U=function(){g.mq(this.o);g.mL.prototype.U.call(this)};
g.h.bf=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];this.loaded&&this.u.Ux.apply(this.u,[a].concat(g.ea(c)))};
g.h.getAdState=function(){return this.Wm};
g.h.zD=function(){return this.loaded?this.u.suggestion:null};
g.h.Oe=function(){return this.g?F8(this.g).Oe:!1};
g.h.hasNext=function(){return this.g?F8(this.g).hasNext:!1};
g.h.Nc=function(a,b){this.I=a||0;this.player.N("progresssync",a,b)};
g.h.getCurrentTime=function(){return this.I};
g.h.getProgressState=function(){var a=F8(this.g),b=this.player.getVideoData();return{allowSeeking:g.O(g.X(this.player).experiments,"web_player_mdx_allow_seeking_change_killswitch")?this.player.fc():!a.isAdPlaying()&&this.player.fc(),clipEnd:b.clipEnd,clipStart:b.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:a.getDuration(),ingestionTime:a.u?a.l+y8(a):a.l,isAtLiveHead:1>=(a.u?a.i+y8(a):a.i)-this.getCurrentTime(),loaded:a.F,seekableEnd:a.u?a.i+y8(a):a.i,seekableStart:0<a.o?a.o+
y8(a):a.o}};
g.h.nextVideo=function(){this.g&&this.g.nextVideo()};
g.h.Xn=function(){this.g&&this.g.Xn()};
g.h.FI=function(a){1==a&&(this.F=this.g?F8(this.g):null)};
g.h.SK=function(){var a=h9()?new E8(c9(),void 0):null;if(a){var b=this.l;this.loaded&&this.unload();this.g=a;this.F=null;b.key!=this.i.key&&(this.l=b,this.load())}else g.qf(this.g),this.g=null,this.loaded&&(this.unload(),(a=this.F)&&a.videoId==this.player.getVideoData().videoId&&this.player.cueVideoById(a.videoId,A8(a)));this.player.N("videodatachange","newdata",this.player.getVideoData(),3)};
g.h.uz=function(){this.B=[this.i].concat(Zra());var a=d9()||this.i;w9(this,a);this.player.la("onMdxReceiversChange")};
g.h.pM=function(a){!this.D&&g.aE(a,8)&&(this.player.pauseVideo(),v9(this))};
g.h.QK=function(){var a=d9();w9(this,a)};
g.h.PK=function(){this.l=d9()};
g.h.vM=function(){this.D=!0;v9(this);j9=!1;k9&&f9(k9,1);k9=null};
g.h.uM=function(){this.D=!1;v9(this);w9(this,this.i);this.l=this.i;j9=!1;k9=null;this.player.playVideo()};
g.h.zc=function(a,b){switch(a){case "casting":return this.loaded;case "receivers":return this.B;case "currentReceiver":return b&&("cast-selector-receiver"==b.key?u8():w9(this,b)),this.loaded?this.l:this.i;case "quickCast":return 2==this.B.length&&"cast-selector-receiver"==this.B[1].key?(b&&u8(),!0):!1}};
g.h.zt=function(){this.g.zt()};
g.h.Gb=function(){return!1};
g.h.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};g.IV.remote=u9;})(_yt_player);