(function(){var g,ba=ba||{},l=this;function p(a){return void 0!==a}function q(a,b,c){a=a.split(".");c=c||l;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&p(b)?c[d]=b:c[d]?c=c[d]:c=c[d]={}}function r(a,b){for(var c=a.split("."),d=b||l,e;e=c.shift();)if(null!=d[e])d=d[e];else return null;return d}function t(){}function ca(a){a.getInstance=function(){return a.Y?a.Y:a.Y=new a}}
function da(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ea(a){return"array"==da(a)}function fa(a){var b=da(a);return"array"==b||"object"==b&&"number"==typeof a.length}function u(a){return"string"==typeof a}function ga(a){return"number"==typeof a}function ha(a){return"function"==da(a)}function ia(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ja(a){return a[ka]||(a[ka]=++la)}var ka="closure_uid_"+(1E9*Math.random()>>>0),la=0;
function ma(a,b,c){return a.call.apply(a.bind,arguments)}function na(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function v(a,b,c){v=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ma:na;return v.apply(null,arguments)}
function oa(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var w=Date.now||function(){return+new Date};function y(a,b){function c(){}c.prototype=b.prototype;a.L=b.prototype;a.prototype=new c;a.base=function(a,c,f){for(var h=Array(arguments.length-2),k=2;k<arguments.length;k++)h[k-2]=arguments[k];return b.prototype[c].apply(a,h)}}
Function.prototype.bind=Function.prototype.bind||function(a,b){if(1<arguments.length){var c=Array.prototype.slice.call(arguments,1);c.unshift(this,a);return v.apply(null,c)}return v(this,a)};function pa(a){if(Error.captureStackTrace)Error.captureStackTrace(this,pa);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))}y(pa,Error);pa.prototype.name="CustomError";var qa;var ra=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};function sa(a){return decodeURIComponent(a.replace(/\+/g," "))}
function ta(a){var b={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"'},c;c=l.document.createElement("div");return a.replace(ua,function(a,e){var f=b[a];if(f)return f;if("#"==e.charAt(0)){var h=Number("0"+e.substr(1));isNaN(h)||(f=String.fromCharCode(h))}f||(c.innerHTML=a+" ",f=c.firstChild.nodeValue.slice(0,-1));return b[a]=f})}
function va(a){return a.replace(/&([^;]+);/g,function(a,c){switch(c){case "amp":return"&";case "lt":return"<";case "gt":return">";case "quot":return'"';default:if("#"==c.charAt(0)){var d=Number("0"+c.substr(1));if(!isNaN(d))return String.fromCharCode(d)}return a}})}var ua=/&([^;\s<&]+);?/g;function wa(a,b){return-1!=a.indexOf(b)}
function xa(a,b){for(var c=0,d=ra(String(a)).split("."),e=ra(String(b)).split("."),f=Math.max(d.length,e.length),h=0;0==c&&h<f;h++){var k=d[h]||"",m=e[h]||"",n=RegExp("(\\d*)(\\D*)","g"),x=RegExp("(\\d*)(\\D*)","g");do{var aa=n.exec(k)||["","",""],Pc=x.exec(m)||["","",""];if(0==aa[0].length&&0==Pc[0].length)break;c=ya(0==aa[1].length?0:parseInt(aa[1],10),0==Pc[1].length?0:parseInt(Pc[1],10))||ya(0==aa[2].length,0==Pc[2].length)||ya(aa[2],Pc[2])}while(0==c)}return c}
function ya(a,b){return a<b?-1:a>b?1:0}function za(a){for(var b=0,c=0;c<a.length;++c)b=31*b+a.charCodeAt(c),b%=4294967296;return b};function Aa(){};var z=Array.prototype,Ba=z.indexOf?function(a,b,c){return z.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(u(a))return u(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},A=z.forEach?function(a,b,c){z.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=u(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},Ca=z.filter?function(a,b,c){return z.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],f=0,h=u(a)?
a.split(""):a,k=0;k<d;k++)if(k in h){var m=h[k];b.call(c,m,k,a)&&(e[f++]=m)}return e},B=z.map?function(a,b,c){return z.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=Array(d),f=u(a)?a.split(""):a,h=0;h<d;h++)h in f&&(e[h]=b.call(c,f[h],h,a));return e},Da=z.some?function(a,b,c){return z.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=u(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return!0;return!1},Ea=z.every?function(a,b,c){return z.every.call(a,b,c)}:function(a,b,c){for(var d=
a.length,e=u(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&!b.call(c,e[f],f,a))return!1;return!0};function Fa(a,b,c){b=Ga(a,b,c);return 0>b?null:u(a)?a.charAt(b):a[b]}function Ga(a,b,c){for(var d=a.length,e=u(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return f;return-1}function Ha(a,b){return 0<=Ba(a,b)}function Ia(){var a=Ja;if(!ea(a))for(var b=a.length-1;0<=b;b--)delete a[b];a.length=0}function Ka(a,b){Ha(a,b)||a.push(b)}
function La(a,b){var c=Ba(a,b),d;(d=0<=c)&&z.splice.call(a,c,1);return d}function Ma(a,b){var c=Ga(a,b,void 0);0<=c&&z.splice.call(a,c,1)}function Na(a){return z.concat.apply(z,arguments)}function Oa(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]}function Pa(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(fa(d)){var e=a.length||0,f=d.length||0;a.length=e+f;for(var h=0;h<f;h++)a[e+h]=d[h]}else a.push(d)}}
function Qa(a,b,c,d){return z.splice.apply(a,Ra(arguments,1))}function Ra(a,b,c){return 2>=arguments.length?z.slice.call(a,b):z.slice.call(a,b,c)}function Sa(a,b,c){if(!fa(a)||!fa(b)||a.length!=b.length)return!1;var d=a.length;c=c||Ta;for(var e=0;e<d;e++)if(!c(a[e],b[e]))return!1;return!0}function Ua(a,b){return a>b?1:a<b?-1:0}function Ta(a,b){return a===b};function Va(a,b){for(var c in a)b.call(void 0,a[c],c,a)}function Wa(a,b,c){var d={},e;for(e in a)b.call(c,a[e],e,a)&&(d[e]=a[e]);return d}function Xa(a){var b=0,c;for(c in a)b++;return b}function Ya(a,b){return Za(a,b)}function $a(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function ab(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b}function Za(a,b){for(var c in a)if(a[c]==b)return!0;return!1}function bb(a){var b=cb,c;for(c in b)if(a.call(void 0,b[c],c,b))return c}
function db(a){for(var b in a)return!1;return!0}function eb(a,b){if(b in a)throw Error('The object already contains the key "'+b+'"');a[b]=!0}function fb(a){var b={},c;for(c in a)b[c]=a[c];return b}function gb(a){var b=da(a);if("object"==b||"array"==b){if(a.clone)return a.clone();var b="array"==b?[]:{},c;for(c in a)b[c]=gb(a[c]);return b}return a}var hb="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
function ib(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<hb.length;f++)c=hb[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}}function jb(a){var b=arguments.length;if(1==b&&ea(arguments[0]))return jb.apply(null,arguments[0]);for(var c={},d=0;d<b;d++)c[arguments[d]]=!0;return c};function kb(a,b,c){a&&(a.dataset?a.dataset[lb(b)]=c:a.setAttribute("data-"+b,c))}function C(a,b){return a?a.dataset?a.dataset[lb(b)]:a.getAttribute("data-"+b):null}var mb={};function lb(a){return mb[a]||(mb[a]=String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()}))};function D(){this.N=this.N;this.J=this.J}D.prototype.N=!1;D.prototype.K=function(){return this.N};D.prototype.dispose=function(){this.N||(this.N=!0,this.G())};function nb(a,b){a.N?b.call(void 0):(a.J||(a.J=[]),a.J.push(p(void 0)?v(b,void 0):b))}D.prototype.G=function(){if(this.J)for(;this.J.length;)this.J.shift()()};function ob(a){a&&"function"==typeof a.dispose&&a.dispose()}function pb(a){for(var b=0,c=arguments.length;b<c;++b){var d=arguments[b];fa(d)?pb.apply(null,d):ob(d)}};function E(){D.call(this);this.j=[];this.ha={}}y(E,D);g=E.prototype;g.Lc=1;g.Db=0;g.subscribe=function(a,b,c){var d=this.ha[a];d||(d=this.ha[a]=[]);var e=this.Lc;this.j[e]=a;this.j[e+1]=b;this.j[e+2]=c;this.Lc=e+3;d.push(e);return e};g.unsubscribe=function(a,b,c){if(a=this.ha[a]){var d=this.j;if(a=Fa(a,function(a){return d[a+1]==b&&d[a+2]==c}))return this.pa(a)}return!1};
g.pa=function(a){if(0!=this.Db)return this.k||(this.k=[]),this.k.push(a),!1;var b=this.j[a];if(b){var c=this.ha[b];c&&La(c,a);delete this.j[a];delete this.j[a+1];delete this.j[a+2]}return!!b};g.publish=function(a,b){var c=this.ha[a];if(c){this.Db++;for(var d=Array(arguments.length-1),e=1,f=arguments.length;e<f;e++)d[e-1]=arguments[e];e=0;for(f=c.length;e<f;e++){var h=c[e];this.j[h+1].apply(this.j[h+2],d)}this.Db--;if(this.k&&0==this.Db)for(;c=this.k.pop();)this.pa(c);return 0!=e}return!1};
g.clear=function(a){if(a){var b=this.ha[a];b&&(A(b,this.pa,this),delete this.ha[a])}else this.j.length=0,this.ha={}};g.ia=function(a){if(a){var b=this.ha[a];return b?b.length:0}a=0;for(b in this.ha)a+=this.ia(b);return a};g.G=function(){E.L.G.call(this);delete this.j;delete this.ha;delete this.k};var qb=window.yt&&window.yt.config_||{};q("yt.config_",qb,void 0);q("yt.tokens_",window.yt&&window.yt.tokens_||{},void 0);var rb=window.yt&&window.yt.msgs_||{};q("yt.msgs_",rb,void 0);function sb(a){tb(qb,arguments)}function F(a,b){return a in qb?qb[a]:b}function G(a,b){ha(a)&&(a=ub(a));return window.setTimeout(a,b)}function vb(a,b){ha(a)&&(a=ub(a));window.setInterval(a,b)}function H(a){window.clearTimeout(a)}
function ub(a){return a&&window.yterr?function(){try{return a.apply(this,arguments)}catch(b){throw wb(b),b;}}:a}function wb(a,b){var c=r("yt.www.errors.log");c?c(a,b):(c=F("ERRORS")||[],c.push([a,b]),sb("ERRORS",c))}
function xb(){var a={},b="FLASH_UPGRADE"in rb?rb.FLASH_UPGRADE:'You need to upgrade your Adobe Flash Player to watchthis video. <br> <a href="http://get.adobe.com/flashplayer/">Download it from Adobe.</a>';if(b)for(var c in a)b=b.replace(new RegExp("\\$"+c,"gi"),function(){return a[c]});return b}function tb(a,b){if(1<b.length){var c=b[0];a[c]=b[1]}else{var d=b[0];for(c in d)a[c]=d[c]}}var yb="Microsoft Internet Explorer"==navigator.appName;var zb=r("yt.pubsub.instance_")||new E;E.prototype.subscribe=E.prototype.subscribe;E.prototype.unsubscribeByKey=E.prototype.pa;E.prototype.publish=E.prototype.publish;E.prototype.clear=E.prototype.clear;q("yt.pubsub.instance_",zb,void 0);var Ab=r("yt.pubsub.subscribedKeys_")||{};q("yt.pubsub.subscribedKeys_",Ab,void 0);var Bb=r("yt.pubsub.topicToKeys_")||{};q("yt.pubsub.topicToKeys_",Bb,void 0);var Cb=r("yt.pubsub.isSynchronous_")||{};q("yt.pubsub.isSynchronous_",Cb,void 0);
var Db=r("yt.pubsub.skipSubId_")||null;q("yt.pubsub.skipSubId_",Db,void 0);function I(a,b,c){var d=Eb();if(d){var e=d.subscribe(a,function(){if(!Db||Db!=e){var d=arguments,h=function(){Ab[e]&&b.apply(c||window,d)};try{Cb[a]?h():G(h,0)}catch(k){wb(k)}}},c);Ab[e]=!0;Bb[a]||(Bb[a]=[]);Bb[a].push(e);return e}return 0}function Fb(a){var b=Eb();b&&("number"==typeof a?a=[a]:"string"==typeof a&&(a=[parseInt(a,10)]),A(a,function(a){b.unsubscribeByKey(a);delete Ab[a]}))}
function J(a,b){var c=Eb();return c?c.publish.apply(c,arguments):!1}function Gb(a,b){Cb[a]=!0;var c=Eb();c&&c.publish.apply(c,arguments);Cb[a]=!1}function Hb(a){Bb[a]&&(a=Bb[a],A(a,function(a){Ab[a]&&delete Ab[a]}),a.length=0)}function Ib(a){var b=Eb();if(b)if(b.clear(a),a)Hb(a);else for(var c in Bb)Hb(c)}function Eb(){return r("yt.pubsub.instance_")};function Jb(a,b){if(window.spf){var c="";if(a){var d=a.indexOf("jsbin/"),e=a.lastIndexOf(".js"),f=d+6;-1<d&&-1<e&&e>f&&(c=a.substring(f,e),c=c.replace(Kb,""),c=c.replace(Lb,""),c=c.replace("debug-",""),c=c.replace("tracing-",""))}spf.script.load(a,c,b)}else Mb(a,b)}function Mb(a,b){var c=Nb(a),d=document.getElementById(c),e=d&&C(d,"loaded"),f=d&&!e;if(e)b&&b();else{if(b){var e=I(c,b),h=""+ja(b);Ob[h]=e}f||(d=Pb(a,c,function(){C(d,"loaded")||(kb(d,"loaded","true"),J(c),G(oa(Ib,c),0))}))}}
function Pb(a,b,c){var d=document.createElement("script");d.id=b;d.onload=function(){c&&setTimeout(c,0)};d.onreadystatechange=function(){switch(d.readyState){case "loaded":case "complete":d.onload()}};d.src=a;a=document.getElementsByTagName("head")[0]||document.body;a.insertBefore(d,a.firstChild);return d}function Nb(a){var b=document.createElement("a");b.href=a;a=b.href.replace(/^[a-zA-Z]+:\/\//,"//");return"js-"+za(a)}
var Kb=/\.vflset|-vfl[a-zA-Z0-9_+=-]+/,Lb=/-[a-zA-Z]{2,3}_[a-zA-Z]{2,3}(?=(\/|$))/,Ob={};var Qb=null;function Rb(){var a=F("BG_I",null),b=F("BG_IU",null),c=F("BG_P");b?Jb(b,function(){Qb=new botguard.bg(c)}):a&&(eval(a),Qb=new botguard.bg(c))}function Sb(){return null!=Qb}function Tb(){return Qb?Qb.invoke():null};function Ub(a){if(a.classList)return a.classList;a=a.className;return u(a)&&a.match(/\S+/g)||[]}function Vb(a,b){return a.classList?a.classList.contains(b):Ha(Ub(a),b)}function Wb(a,b){a.classList?a.classList.add(b):Vb(a,b)||(a.className+=0<a.className.length?" "+b:b)}function Xb(a,b){a.classList?a.classList.remove(b):Vb(a,b)&&(a.className=Ca(Ub(a),function(a){return a!=b}).join(" "))}function Yb(a,b,c){c?Wb(a,b):Xb(a,b)};jb("area base br col command embed hr img input keygen link meta param source track wbr".split(" "));jb("action","cite","data","formaction","href","manifest","poster","src");jb("embed","iframe","link","object","script","style","template");function Zb(a,b){this.x=p(a)?a:0;this.y=p(b)?b:0}Zb.prototype.clone=function(){return new Zb(this.x,this.y)};Zb.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};Zb.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function $b(a,b){this.width=a;this.height=b}$b.prototype.clone=function(){return new $b(this.width,this.height)};$b.prototype.isEmpty=function(){return!(this.width*this.height)};$b.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};$b.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};var K;t:{var ac=l.navigator;if(ac){var bc=ac.userAgent;if(bc){K=bc;break t}}K=""};var cc=wa(K,"Opera")||wa(K,"OPR"),L=wa(K,"Trident")||wa(K,"MSIE"),dc=wa(K,"Gecko")&&!wa(K.toLowerCase(),"webkit")&&!(wa(K,"Trident")||wa(K,"MSIE")),ec=wa(K.toLowerCase(),"webkit"),fc=wa(K,"Macintosh"),gc=wa(K,"Windows");function hc(){var a=l.document;return a?a.documentMode:void 0}
var ic=function(){var a="",b;if(cc&&l.opera)return a=l.opera.version,ha(a)?a():a;dc?b=/rv\:([^\);]+)(\)|;)/:L?b=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:ec&&(b=/WebKit\/(\S+)/);b&&(a=(a=b.exec(K))?a[1]:"");return L&&(b=hc(),b>parseFloat(a))?String(b):a}(),jc={};function kc(a){return jc[a]||(jc[a]=0<=xa(ic,a))}function lc(a){return L&&mc>=a}var nc=l.document,mc=nc&&L?hc()||("CSS1Compat"==nc.compatMode?parseInt(ic,10):5):void 0;!dc&&!L||L&&lc(9)||dc&&kc("1.9.1");L&&kc("9");function oc(a){return a?new pc(qc(a)):qa||(qa=new pc)}function rc(a){return u(a)?document.getElementById(a):a}function sc(a){var b=document;return u(a)?b.getElementById(a):a}function tc(a){var b=document;return b.querySelectorAll&&b.querySelector?b.querySelectorAll("."+a):uc(a,void 0)}
function uc(a,b){var c,d,e,f;c=document;c=b||c;if(c.querySelectorAll&&c.querySelector&&a)return c.querySelectorAll(""+(a?"."+a:""));if(a&&c.getElementsByClassName){var h=c.getElementsByClassName(a);return h}h=c.getElementsByTagName("*");if(a){f={};for(d=e=0;c=h[d];d++){var k=c.className;"function"==typeof k.split&&Ha(k.split(/\s+/),a)&&(f[e++]=c)}f.length=e;return f}return h}function vc(a){return"CSS1Compat"==a.compatMode}
function wc(a){if(!a)return null;if(a.firstChild)return a.firstChild;for(;a&&!a.nextSibling;)a=a.parentNode;return a?a.nextSibling:null}function xc(a){if(!a)return null;if(!a.previousSibling)return a.parentNode;for(a=a.previousSibling;a&&a.lastChild;)a=a.lastChild;return a}function qc(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function yc(a){var b=zc.Oe;return b?Ac(a,function(a){return!b||u(a.className)&&Ha(a.className.split(/\s+/),b)},!0,void 0):null}
function Ac(a,b,c,d){c||(a=a.parentNode);c=null==d;for(var e=0;a&&(c||e<=d);){if(b(a))return a;a=a.parentNode;e++}return null}function pc(a){this.j=a||l.document||document}pc.prototype.createElement=function(a){return this.j.createElement(a)};pc.prototype.appendChild=function(a,b){a.appendChild(b)};
pc.prototype.contains=function(a,b){if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a};var Bc=ec?"webkit":dc?"moz":L?"ms":cc?"o":"",Cc=r("yt.dom.getNextId_");if(!Cc){Cc=function(){return++Dc};q("yt.dom.getNextId_",Cc,void 0);var Dc=0}function Ec(){var a=document,b;Da(["fullscreenElement","fullScreenElement"],function(c){c in a?b=a[c]:(c=Bc+c.charAt(0).toUpperCase()+c.substr(1),b=c in a?a[c]:void 0);return!!b});return b};function Fc(a){if(a=a||window.event){for(var b in a)b in Gc||(this[b]=a[b]);this.Nb=a;(b=a.target||a.srcElement)&&3==b.nodeType&&(b=b.parentNode);this.target=b;if(b=a.relatedTarget)try{b=b.nodeName?b:null}catch(c){b=null}else"mouseover"==this.type?b=a.fromElement:"mouseout"==this.type&&(b=a.toElement);this.relatedTarget=b;this.clientX=void 0!=a.clientX?a.clientX:a.pageX;this.clientY=void 0!=a.clientY?a.clientY:a.pageY;this.keyCode=a.keyCode?a.keyCode:a.which;this.charCode=a.charCode||("keypress"==
this.type?this.keyCode:0);this.altKey=a.altKey;this.ctrlKey=a.ctrlKey;this.shiftKey=a.shiftKey;"MozMousePixelScroll"==this.type?(this.wheelDeltaX=a.axis==a.HORIZONTAL_AXIS?a.detail:0,this.wheelDeltaY=a.axis==a.HORIZONTAL_AXIS?0:a.detail):window.opera?(this.wheelDeltaX=0,this.wheelDeltaY=a.detail):0==a.wheelDelta%120?"WebkitTransform"in document.documentElement.style?window.chrome&&0==navigator.platform.indexOf("Mac")?(this.wheelDeltaX=a.wheelDeltaX/-30,this.wheelDeltaY=a.wheelDeltaY/-30):(this.wheelDeltaX=
a.wheelDeltaX/-1.2,this.wheelDeltaY=a.wheelDeltaY/-1.2):(this.wheelDeltaX=0,this.wheelDeltaY=a.wheelDelta/-1.6):(this.wheelDeltaX=a.wheelDeltaX/-3,this.wheelDeltaY=a.wheelDeltaY/-3)}}g=Fc.prototype;g.Nb=null;g.type="";g.target=null;g.relatedTarget=null;g.currentTarget=null;g.data=null;g.source=null;g.state=null;g.keyCode=0;g.charCode=0;g.altKey=!1;g.ctrlKey=!1;g.shiftKey=!1;g.clientX=0;g.clientY=0;g.wheelDeltaX=0;g.wheelDeltaY=0;
g.preventDefault=function(){this.Nb.returnValue=!1;this.Nb.preventDefault&&this.Nb.preventDefault()};var Gc={stopImmediatePropagation:1,stopPropagation:1,preventMouseEvent:1,preventManipulation:1,preventDefault:1,layerX:1,layerY:1,scale:1,rotation:1};var cb=r("yt.events.listeners_")||{};q("yt.events.listeners_",cb,void 0);var Hc=r("yt.events.counter_")||{count:0};q("yt.events.counter_",Hc,void 0);function Ic(a,b,c,d){return bb(function(e){return e[0]==a&&e[1]==b&&e[2]==c&&e[4]==!!d})}
function M(a,b,c,d){if(!a||!a.addEventListener&&!a.attachEvent)return"";d=!!d;var e=Ic(a,b,c,d);if(e)return e;var e=++Hc.count+"",f=!("mouseenter"!=b&&"mouseleave"!=b||!a.addEventListener||"onmouseenter"in document),h;h=f?function(d){d=new Fc(d);if(!Ac(d.relatedTarget,function(b){return b==a},!0))return d.currentTarget=a,d.type=b,c.call(a,d)}:function(b){b=new Fc(b);b.currentTarget=a;return c.call(a,b)};h=ub(h);cb[e]=[a,b,c,h,d];a.addEventListener?"mouseenter"==b&&f?a.addEventListener("mouseover",
h,d):"mouseleave"==b&&f?a.addEventListener("mouseout",h,d):"mousewheel"==b&&"MozBoxSizing"in document.documentElement.style?a.addEventListener("MozMousePixelScroll",h,d):a.addEventListener(b,h,d):a.attachEvent("on"+b,h);return e}function Jc(a){a&&("string"==typeof a&&(a=[a]),A(a,function(a){if(a in cb){var c=cb[a],d=c[0],e=c[1],f=c[3],c=c[4];d.removeEventListener?d.removeEventListener(e,f,c):d.detachEvent&&d.detachEvent("on"+e,f);delete cb[a]}}))};function Kc(a){this.j=a}var Lc=/\s*;\s*/;g=Kc.prototype;g.isEnabled=function(){return navigator.cookieEnabled};g.set=function(a,b,c,d,e,f){if(/[;=\s]/.test(a))throw Error('Invalid cookie name "'+a+'"');if(/[;\r\n]/.test(b))throw Error('Invalid cookie value "'+b+'"');p(c)||(c=-1);e=e?";domain="+e:"";d=d?";path="+d:"";f=f?";secure":"";c=0>c?"":0==c?";expires="+(new Date(1970,1,1)).toUTCString():";expires="+(new Date(w()+1E3*c)).toUTCString();this.j.cookie=a+"="+b+e+d+c+f};
g.get=function(a,b){for(var c=a+"=",d=(this.j.cookie||"").split(Lc),e=0,f;f=d[e];e++){if(0==f.lastIndexOf(c,0))return f.substr(c.length);if(f==a)return""}return b};g.remove=function(a,b,c){var d=p(this.get(a));this.set(a,"",0,b,c);return d};g.va=function(){return Mc(this).keys};g.ga=function(){return Mc(this).values};g.isEmpty=function(){return!this.j.cookie};g.ia=function(){return this.j.cookie?(this.j.cookie||"").split(Lc).length:0};
g.Mb=function(a){for(var b=Mc(this).values,c=0;c<b.length;c++)if(b[c]==a)return!0;return!1};g.clear=function(){for(var a=Mc(this).keys,b=a.length-1;0<=b;b--)this.remove(a[b])};function Mc(a){a=(a.j.cookie||"").split(Lc);for(var b=[],c=[],d,e,f=0;e=a[f];f++)d=e.indexOf("="),-1==d?(b.push(""),c.push(e)):(b.push(e.substring(0,d)),c.push(e.substring(d+1)));return{keys:b,values:c}}var Nc=new Kc(document);Nc.k=3950;function Oc(a,b,c){Nc.set(""+a,b,c,"/","youtube.com")}function Qc(a,b){return Nc.get(""+a,b)};function Rc(a,b){a=!!a;q("_lactCookie",a,window);if(null==r("_lact",window)){if(a&&b){var c=Qc("ACTIVITY","-1");q("_lact",parseInt(c,10),window)}else q("_lact",-1,window),Sc();M(document,"keypress",Sc);M(document,"mousedown",Sc);M(document,"mouseup",Sc)}}function Sc(){var a=r("_lact",window);null==a&&(Rc(),a=r("_lact",window));var b=w();q("_lact",b,window);r("_lactCookie",window)&&1E3<=b-a&&Oc("ACTIVITY",""+b)}function Tc(){var a=r("_lact",window);return null==a?-1:Math.max(w()-a,0)};var Uc=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function Vc(a){if(Wc){Wc=!1;var b=l.location;if(b){var c=b.href;if(c&&(c=Xc(c))&&c!=b.hostname)throw Wc=!0,Error();}}return a.match(Uc)}var Wc=ec;function Xc(a){return(a=Vc(a)[3]||null)?decodeURI(a):a}function Yc(a){if(a[1]){var b=a[0],c=b.indexOf("#");0<=c&&(a.push(b.substr(c)),a[0]=b=b.substr(0,c));c=b.indexOf("?");0>c?a[1]="?":c==b.length-1&&(a[1]=void 0)}return a.join("")}
function Zc(a,b,c){if(ea(b))for(var d=0;d<b.length;d++)Zc(a,String(b[d]),c);else null!=b&&c.push("&",a,""===b?"":"=",encodeURIComponent(String(b)))}function $c(a,b,c){Math.max(b.length-(c||0),0);for(c=c||0;c<b.length;c+=2)Zc(b[c],b[c+1],a);return a}function ad(a,b){for(var c in b)Zc(c,b[c],a);return a}function bd(a){a=ad([],a);a[0]="";return a.join("")}function cd(a,b){return Yc(2==arguments.length?$c([a],arguments[1],0):$c([a],arguments,1))}function dd(a,b){return Yc(ad([a],b))};function ed(a){"?"==a.charAt(0)&&(a=a.substr(1));a=a.split("&");for(var b={},c=0,d=a.length;c<d;c++){var e=a[c].split("=");if(1==e.length&&e[0]||2==e.length){var f=sa(e[0]||""),e=sa(e[1]||"");f in b?ea(b[f])?Pa(b[f],e):b[f]=[b[f],e]:b[f]=e}}return b}var fd=Xc;function gd(a,b){var c=a.split("#",2);a=c[0];var c=1<c.length?"#"+c[1]:"",d=a.split("?",2);a=d[0];var d=ed(d[1]||""),e;for(e in b)d[e]=b[e];return dd(a,d)+c}
function hd(a){a=fd(a);a=null===a?null:a.split(".").reverse();return(null===a?!1:"com"==a[0]&&a[1].match(/^youtube(?:-nocookie)?$/)?!0:!1)||(null===a?!1:"google"==a[1]?!0:"google"==a[2]?"au"==a[0]&&"com"==a[1]?!0:"uk"==a[0]&&"co"==a[1]?!0:!1:!1)};function id(a,b){var c=Xc(a);if(c==Xc(window.location.href)||!c&&0==a.lastIndexOf("/",0)){var d=Vc(a),c=d[5],e=d[6],d=d[7],f="";c&&(f+=c);e&&(f+="?"+e);d&&(f+="#"+d);c=f;e=c.indexOf("#");if(c=0>e?c:c.substr(0,e))c="s_tempdata-"+za(c),e=b?bd(b):"",Oc(c,e,5)}};function jd(a,b,c){var d=F("EVENT_ID");d&&(b||(b={}),b.ei||(b.ei=d));b&&id(a,b);if(c)return!1;(window.ytspf||{}).enabled?spf.navigate(a):window.location=dd(a,{})+"";return!0};var kd="StopIteration"in l?l.StopIteration:Error("StopIteration");function ld(){}ld.prototype.next=function(){throw kd;};ld.prototype.za=function(){return this};function md(a){if(a instanceof ld)return a;if("function"==typeof a.za)return a.za(!1);if(fa(a)){var b=0,c=new ld;c.next=function(){for(;;){if(b>=a.length)throw kd;if(b in a)return a[b++];b++}};return c}throw Error("Not implemented");}
function nd(a,b,c){if(fa(a))try{A(a,b,c)}catch(d){if(d!==kd)throw d;}else{a=md(a);try{for(;;)b.call(c,a.next(),void 0,a)}catch(e){if(e!==kd)throw e;}}}function od(a){if(fa(a))return Oa(a);a=md(a);var b=[];nd(a,function(a){b.push(a)});return b};function pd(a,b){this.k={};this.j=[];this.Da=this.o=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a){a instanceof pd?(c=a.va(),d=a.ga()):(c=ab(a),d=$a(a));for(var e=0;e<c.length;e++)this.set(c[e],d[e])}}g=pd.prototype;g.ia=function(){return this.o};g.ga=function(){qd(this);for(var a=[],b=0;b<this.j.length;b++)a.push(this.k[this.j[b]]);return a};g.va=function(){qd(this);return this.j.concat()};
g.Mb=function(a){for(var b=0;b<this.j.length;b++){var c=this.j[b];if(rd(this.k,c)&&this.k[c]==a)return!0}return!1};g.equals=function(a,b){if(this===a)return!0;if(this.o!=a.ia())return!1;var c=b||sd;qd(this);for(var d,e=0;d=this.j[e];e++)if(!c(this.get(d),a.get(d)))return!1;return!0};function sd(a,b){return a===b}g.isEmpty=function(){return 0==this.o};g.clear=function(){this.k={};this.Da=this.o=this.j.length=0};
g.remove=function(a){return rd(this.k,a)?(delete this.k[a],this.o--,this.Da++,this.j.length>2*this.o&&qd(this),!0):!1};function qd(a){if(a.o!=a.j.length){for(var b=0,c=0;b<a.j.length;){var d=a.j[b];rd(a.k,d)&&(a.j[c++]=d);b++}a.j.length=c}if(a.o!=a.j.length){for(var e={},c=b=0;b<a.j.length;)d=a.j[b],rd(e,d)||(a.j[c++]=d,e[d]=1),b++;a.j.length=c}}g.get=function(a,b){return rd(this.k,a)?this.k[a]:b};g.set=function(a,b){rd(this.k,a)||(this.o++,this.j.push(a),this.Da++);this.k[a]=b};
g.forEach=function(a,b){for(var c=this.va(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};g.clone=function(){return new pd(this)};g.za=function(a){qd(this);var b=0,c=this.j,d=this.k,e=this.Da,f=this,h=new ld;h.next=function(){for(;;){if(e!=f.Da)throw Error("The map has changed since the iterator was created");if(b>=c.length)throw kd;var h=c[b++];return a?h:d[h]}};return h};function rd(a,b){return Object.prototype.hasOwnProperty.call(a,b)};function td(a){return"function"==typeof a.ia?a.ia():fa(a)||u(a)?a.length:Xa(a)}function ud(a){if("function"==typeof a.ga)return a.ga();if(u(a))return a.split("");if(fa(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return $a(a)}function vd(a){if("function"==typeof a.va)return a.va();if("function"!=typeof a.ga){if(fa(a)||u(a)){var b=[];a=a.length;for(var c=0;c<a;c++)b.push(c);return b}return ab(a)}}
function wd(a,b){if("function"==typeof a.forEach)a.forEach(b,void 0);else if(fa(a)||u(a))A(a,b,void 0);else for(var c=vd(a),d=ud(a),e=d.length,f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)}function xd(a,b){if("function"==typeof a.every)return a.every(b,void 0);if(fa(a)||u(a))return Ea(a,b,void 0);for(var c=vd(a),d=ud(a),e=d.length,f=0;f<e;f++)if(!b.call(void 0,d[f],c&&c[f],a))return!1;return!0};function yd(a){this.j=new pd;if(a){a=ud(a);for(var b=a.length,c=0;c<b;c++)this.add(a[c])}}function zd(a){var b=typeof a;return"object"==b&&a||"function"==b?"o"+ja(a):b.substr(0,1)+a}g=yd.prototype;g.ia=function(){return this.j.ia()};g.add=function(a){this.j.set(zd(a),a)};g.removeAll=function(a){a=ud(a);for(var b=a.length,c=0;c<b;c++)this.remove(a[c])};g.remove=function(a){return this.j.remove(zd(a))};g.clear=function(){this.j.clear()};g.isEmpty=function(){return this.j.isEmpty()};
g.contains=function(a){a=zd(a);return rd(this.j.k,a)};g.ga=function(){return this.j.ga()};g.clone=function(){return new yd(this)};g.equals=function(a){return this.ia()==td(a)&&Ad(this,a)};function Ad(a,b){var c=td(b);if(a.ia()>c)return!1;!(b instanceof yd)&&5<c&&(b=new yd(b));return xd(a,function(a){var c=b;return"function"==typeof c.contains?c.contains(a):"function"==typeof c.Mb?c.Mb(a):fa(c)||u(c)?Ha(c,a):Za(c,a)})}g.za=function(){return this.j.za(!1)};function Bd(){};function Cd(a){l.setTimeout(function(){throw a;},0)}var Dd;
function Ed(){var a=l.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&(a=function(){var a=document.createElement("iframe");a.style.display="none";a.src="";document.documentElement.appendChild(a);var b=a.contentWindow,a=b.document;a.open();a.write("");a.close();var c="callImmediate"+Math.random(),d="file:"==b.location.protocol?"*":b.location.protocol+"//"+b.location.host,a=v(function(a){if(("*"==d||a.origin==d)&&a.data==c)this.port1.onmessage()},
this);b.addEventListener("message",a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,d)}}});if("undefined"!==typeof a&&!wa(K,"Trident")&&!wa(K,"MSIE")){var b=new a,c={},d=c;b.port1.onmessage=function(){if(p(c.next)){c=c.next;var a=c.hd;c.hd=null;a()}};return function(a){d.next={hd:a};d=d.next;b.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("script")?function(a){var b=document.createElement("script");b.onreadystatechange=
function(){b.onreadystatechange=null;b.parentNode.removeChild(b);b=null;a();a=null};document.documentElement.appendChild(b)}:function(a){l.setTimeout(a,0)}};function Fd(a,b){Gd||Hd();Id||(Gd(),Id=!0);Jd.push(new Kd(a,b))}var Gd;function Hd(){if(l.Promise&&l.Promise.resolve){var a=l.Promise.resolve();Gd=function(){a.then(Ld)}}else Gd=function(){var a=Ld;!ha(l.setImmediate)||l.Window&&l.Window.prototype.setImmediate==l.setImmediate?(Dd||(Dd=Ed()),Dd(a)):l.setImmediate(a)}}var Id=!1,Jd=[];function Ld(){for(;Jd.length;){var a=Jd;Jd=[];for(var b=0;b<a.length;b++){var c=a[b];try{c.j.call(c.scope)}catch(d){Cd(d)}}}Id=!1}
function Kd(a,b){this.j=a;this.scope=b};function Md(a,b){this.k=0;this.C=void 0;this.j=this.o=null;this.B=this.A=!1;try{var c=this;a.call(b,function(a){Nd(c,2,a)},function(a){Nd(c,3,a)})}catch(d){Nd(this,3,d)}}function Od(a){return new Md(function(b){b(a)})}Md.prototype.then=function(a,b,c){return Pd(this,ha(a)?a:null,ha(b)?b:null,c)};Md.prototype.then=Md.prototype.then;Md.prototype.$goog_Thenable=!0;Md.prototype.cancel=function(a){0==this.k&&Fd(function(){var b=new Qd(a);Rd(this,b)},this)};
function Rd(a,b){if(0==a.k)if(a.o){var c=a.o;if(c.j){for(var d=0,e=-1,f=0,h;h=c.j[f];f++)if(h=h.jb)if(d++,h==a&&(e=f),0<=e&&1<d)break;0<=e&&(0==c.k&&1==d?Rd(c,b):(d=c.j.splice(e,1)[0],Sd(c,d,3,b)))}}else Nd(a,3,b)}function Td(a,b){a.j&&a.j.length||2!=a.k&&3!=a.k||Ud(a);a.j||(a.j=[]);a.j.push(b)}
function Pd(a,b,c,d){var e={jb:null,Uc:null,Vc:null};e.jb=new Md(function(a,h){e.Uc=b?function(c){try{var e=b.call(d,c);a(e)}catch(n){h(n)}}:a;e.Vc=c?function(b){try{var e=c.call(d,b);!p(e)&&b instanceof Qd?h(b):a(e)}catch(n){h(n)}}:h});e.jb.o=a;Td(a,e);return e.jb}Md.prototype.J=function(a){this.k=0;Nd(this,2,a)};Md.prototype.N=function(a){this.k=0;Nd(this,3,a)};
function Nd(a,b,c){if(0==a.k){if(a==c)b=3,c=new TypeError("Promise cannot resolve to itself");else{var d;if(c)try{d=!!c.$goog_Thenable}catch(e){d=!1}else d=!1;if(d){a.k=1;c.then(a.J,a.N,a);return}if(ia(c))try{var f=c.then;if(ha(f)){Vd(a,c,f);return}}catch(h){b=3,c=h}}a.C=c;a.k=b;Ud(a);3!=b||c instanceof Qd||Wd(a,c)}}function Vd(a,b,c){function d(b){f||(f=!0,a.N(b))}function e(b){f||(f=!0,a.J(b))}a.k=1;var f=!1;try{c.call(b,e,d)}catch(h){d(h)}}function Ud(a){a.A||(a.A=!0,Fd(a.F,a))}
Md.prototype.F=function(){for(;this.j&&this.j.length;){var a=this.j;this.j=[];for(var b=0;b<a.length;b++)Sd(this,a[b],this.k,this.C)}this.A=!1};function Sd(a,b,c,d){if(2==c)b.Uc(d);else{if(b.jb)for(;a&&a.B;a=a.o)a.B=!1;b.Vc(d)}}function Wd(a,b){a.B=!0;Fd(function(){a.B&&Xd.call(null,b)})}var Xd=Cd;function Qd(a){pa.call(this,a)}y(Qd,pa);Qd.prototype.name="cancel";function Yd(a){this.k=a;this.j=null;var b=this;a.then(function(a){b.j=a})}function Zd(a,b){var c=b||{},d=$d().then(function(b){return b(a,{apiKey:c.af||c.apiKey,environment:c.bf||c.environment,helpCenterPath:c.cf||c.helpCenterPath,locale:c.locale||c.locale,productData:c.df||c.productData,receiverUri:c.ef||c.receiverUri,theme:c.theme||c.theme,window:c.window||c.window})});return new Yd(d)}var ae=null;
function $d(){if(ae)return ae;var a=r("help.service.Lazy.create");return a?ae=Od(a):ae=(new Md(function(a,c){var d=document.createElement("script");d.async=!0;d.src="https://www.gstatic.com/inproduct_help/service/lazy.min.js";d.onload=d.onreadystatechange=function(){d.readyState&&"loaded"!=d.readyState&&"complete"!=d.readyState||a(null)};d.onerror=c;(document.head||document.getElementsByTagName("head")[0]).appendChild(d)})).then(function(){var a=r("help.service.Lazy.create");if(!a)throw Error("Failed to load help.service.Lazy.create from https://www.gstatic.com/inproduct_help/service/lazy.min.js");
return a})}Yd.prototype.o=function(a){be(this,"startFeedback",arguments)};Yd.prototype.B=function(a){be(this,"startHelp",arguments)};function be(a,b,c){a.k.then(function(a){a[b].apply(a,c)})};var ce=!1;function de(a){if(a=a.match(/[\d]+/g))a.length=3,a.join(".")}
if(navigator.plugins&&navigator.plugins.length){var ee=navigator.plugins["Shockwave Flash"];ee&&(ce=!0,ee.description&&de(ee.description));navigator.plugins["Shockwave Flash 2.0"]&&(ce=!0)}else if(navigator.mimeTypes&&navigator.mimeTypes.length){var fe=navigator.mimeTypes["application/x-shockwave-flash"];(ce=fe&&fe.enabledPlugin)&&de(fe.enabledPlugin.description)}else try{var ge=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"),ce=!0;de(ge.GetVariable("$version"))}catch(he){try{ge=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),
ce=!0}catch(ie){try{ge=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),ce=!0,de(ge.GetVariable("$version"))}catch(je){}}};var ke,le,me,ne,oe,pe,qe;qe=pe=oe=ne=me=le=ke=!1;var re=K;re&&(-1!=re.indexOf("Firefox")?ke=!0:-1!=re.indexOf("Camino")?le=!0:-1!=re.indexOf("iPad")?ne=!0:-1!=re.indexOf("iPhone")||-1!=re.indexOf("iPod")?me=!0:-1!=re.indexOf("Chrome")?pe=!0:-1!=re.indexOf("Android")?oe=!0:-1!=re.indexOf("Safari")&&(qe=!0));var se=ke,te=le,ue=me,ve=ne,we=oe,xe=pe,ye=qe;function ze(a){return(a=a.exec(K))?a[1]:""}(function(){if(se)return ze(/Firefox\/([0-9.]+)/);if(L||cc)return ic;if(xe)return ze(/Chrome\/([0-9.]+)/);if(ye)return ze(/Version\/([0-9.]+)/);if(ue||ve){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(K))return a[1]+"."+a[2]}else{if(we)return(a=ze(/Android\s+([0-9.]+)/))?a:ze(/Version\/([0-9.]+)/);if(te)return ze(/Camino\/([0-9.]+)/)}return""})();function Ae(){this.o=this.k=this.j=0;this.B="";var a=r("window.navigator.plugins"),b=r("window.navigator.mimeTypes"),a=a&&a["Shockwave Flash"],b=b&&b["application/x-shockwave-flash"],b=a&&b&&b.enabledPlugin&&a.description||"";if(a=b){var c=a.indexOf("Shockwave Flash");0<=c&&(a=a.substr(c+15));for(var c=a.split(" "),d="",a="",e=0,f=c.length;e<f;e++)if(d)if(a)break;else a=c[e];else d=c[e];d=d.split(".");c=parseInt(d[0],10)||0;d=parseInt(d[1],10)||0;e=0;if("r"==a.charAt(0)||"d"==a.charAt(0))e=parseInt(a.substr(1),
10)||0;a=[c,d,e]}else a=[0,0,0];this.B=b;b=a;this.j=b[0];this.k=b[1];this.o=b[2];if(0>=this.j){var h,k,m,n;if(yb)try{h=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(x){h=null}else m=document.body,n=document.createElement("object"),n.setAttribute("type","application/x-shockwave-flash"),h=m.appendChild(n);if(h&&"GetVariable"in h)try{k=h.GetVariable("$version")}catch(aa){k=""}m&&n&&m.removeChild(n);(h=k||"")?(h=h.split(" ")[1].split(","),h=[parseInt(h[0],10)||0,parseInt(h[1],10)||0,parseInt(h[2],
10)||0]):h=[0,0,0];this.j=h[0];this.k=h[1];this.o=h[2]}}ca(Ae);Ae.prototype.getVersion=function(){return[this.j,this.k,this.o]};function Be(a,b,c,d){b="string"==typeof b?b.split("."):[b,c,d];b[0]=parseInt(b[0],10)||0;b[1]=parseInt(b[1],10)||0;b[2]=parseInt(b[2],10)||0;return a.j>b[0]||a.j==b[0]&&a.k>b[1]||a.j==b[0]&&a.k==b[1]&&a.o>=b[2]}function Ce(a){return-1<a.B.indexOf("Gnash")&&-1==a.B.indexOf("AVM2")||9==a.j&&1==a.k||9==a.j&&0==a.k&&1==a.o?!1:9<=a.j}
function De(a){return gc?!Be(a,11,2):fc?!Be(a,11,3):!Ce(a)};function Ee(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}Ee.prototype.clone=function(){return new Ee(this.top,this.right,this.bottom,this.left)};Ee.prototype.contains=function(a){return this&&a?a instanceof Ee?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1};
Ee.prototype.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};Ee.prototype.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this};function Fe(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}Fe.prototype.clone=function(){return new Fe(this.left,this.top,this.width,this.height)};Fe.prototype.contains=function(a){return a instanceof Fe?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};
Fe.prototype.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};Fe.prototype.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function Ge(a,b){var c=qc(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""}function He(a,b){return Ge(a,b)||(a.currentStyle?a.currentStyle[b]:null)||a.style&&a.style[b]}
function Ie(a){var b;try{b=a.getBoundingClientRect()}catch(c){return{left:0,top:0,right:0,bottom:0}}L&&a.ownerDocument.body&&(a=a.ownerDocument,b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b}function Je(a,b){"number"==typeof a&&(a=(b?Math.round(a):a)+"px");return a}
function Ke(a){var b=Le;if("none"!=He(a,"display"))return b(a);var c=a.style,d=c.display,e=c.visibility,f=c.position;c.visibility="hidden";c.position="absolute";c.display="inline";a=b(a);c.display=d;c.position=f;c.visibility=e;return a}function Le(a){var b=a.offsetWidth,c=a.offsetHeight,d=ec&&!b&&!c;return p(b)&&!d||!a.getBoundingClientRect?new $b(b,c):(a=Ie(a),new $b(a.right-a.left,a.bottom-a.top))}
function Me(a,b){if(/^\d+px?$/.test(b))return parseInt(b,10);var c=a.style.left,d=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=b;var e=a.style.pixelLeft;a.style.left=c;a.runtimeStyle.left=d;return e}function Ne(a,b){var c=a.currentStyle?a.currentStyle[b]:null;return c?Me(a,c):0}var Oe={thin:2,medium:4,thick:6};
function Pe(a,b){if("none"==(a.currentStyle?a.currentStyle[b+"Style"]:null))return 0;var c=a.currentStyle?a.currentStyle[b+"Width"]:null;return c in Oe?Oe[c]:Me(a,c)};function Qe(a,b){(a=rc(a))&&a.style&&(a.style.display=b?"":"none",Yb(a,"hid",!b))}function Re(a){A(arguments,function(a){Qe(a,!0)})}function Se(a){A(arguments,function(a){Qe(a,!1)})};var Te={};function Ue(a,b){var c=F("FEEDBACK_LOCALE_LANGUAGE"),d=F("FEEDBACK_LOCALE_EXTRAS",{});a?ib(Te,a):ib(Te,d);try{var e,f=r("yt.player.getPlayerByElement");(e=f?f("player-api"):null)&&e.pauseVideo&&e.pauseVideo();var h=Ae.getInstance();Te.flashVersion=h.getVersion().join(".");e&&(Te.playback_id=e.getVideoData().cpn)}catch(k){}b&&ib(Te,{trackingParam:b});return{helpCenterPath:"/youtube",locale:c,productData:Te}}
function Ve(){var a=F("SESSION_INDEX"),b=F("FEEDBACK_BUCKET_ID"),c={abuseLink:"https://support.google.com/youtube/bin/answer.py?answer=140536",customZIndex:"2000000005"};a&&(c.authuser=a+"");b&&(c.bucket=b);return c}function We(a,b){try{var c=(a||"59")+"",d=Ue(b),e=Ve();Zd(c,d).o(e);return!1}catch(f){return!0}}function Xe(a,b,c,d){var e;d=(d||"59")+"";c=Ue(c,void 0);a={context:b,anchor:void 0,enableSendFeedback:!0,defaultHelpArticleId:a};ib(a,Ve());try{Zd(d,c).B(a),e=!1}catch(f){e=!0}return e};function Ye(a){a=a||{};this.url=a.url||"";this.urlV8=a.url_v8||"";this.urlV9As2=a.url_v9as2||"";this.args=a.args||fb(Ze);this.assets=a.assets||{};this.attrs=a.attrs||fb($e);this.params=a.params||fb(af);this.minVersion=a.min_version||"8.0.0";this.fallback=a.fallback||null;this.fallbackMessage=a.fallbackMessage||null;this.html5=!!a.html5;this.disable=a.disable||{};this.loaded=!!a.loaded;this.messages=a.messages||{}}var Ze={enablejsapi:1},$e={},af={allowscriptaccess:"always",allowfullscreen:"true",bgcolor:"#000000"};
function bf(a){a instanceof Ye||(a=new Ye(a));return a}Ye.prototype.clone=function(){var a=new Ye,b;for(b in this){var c=this[b];"object"==da(c)?a[b]=fb(c):a[b]=c}return a};function cf(){var a=Qc("PREF");if(a)for(var a=unescape(a).split("&"),b=0;b<a.length;b++){var c=a[b].split("="),d=c[0];(c=c[1])&&(df[d]=c.toString())}}ca(cf);var df=r("yt.prefs.UserPrefs.prefs_")||{};q("yt.prefs.UserPrefs.prefs_",df,void 0);function ef(a){if(/^f([1-9][0-9]*)$/.test(a))throw"ExpectedRegexMatch: "+a;}function ff(a){if(!/^\w+$/.test(a))throw"ExpectedRegexMismatch: "+a;}function gf(a){return void 0!==df[a]?df[a].toString():null}
cf.prototype.get=function(a,b){ff(a);ef(a);var c=gf(a);return null!=c?c:b?b:""};cf.prototype.set=function(a,b){ff(a);ef(a);if(null==b)throw"ExpectedNotNull";df[a]=b.toString()};cf.prototype.remove=function(a){ff(a);ef(a);delete df[a]};cf.prototype.clear=function(){df={}};function hf(a,b,c){if(b){a=u(a)?sc(a):a;c=bf(c);var d=fb(c.attrs);d.tabindex=0;var e=fb(c.params);e.flashvars=bd(c.args);if(yb){d.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";e.movie=b;b=document.createElement("object");for(var f in d)b.setAttribute(f,d[f]);for(f in e)d=document.createElement("param"),d.setAttribute("name",f),d.setAttribute("value",e[f]),b.appendChild(d)}else{d.type="application/x-shockwave-flash";d.src=b;b=document.createElement("embed");b.setAttribute("name",d.id);for(f in d)b.setAttribute(f,
d[f]);for(f in e)b.setAttribute(f,e[f])}e=document.createElement("div");e.appendChild(b);a.innerHTML=e.innerHTML}}
function jf(a,b,c){if(a&&a.attrs&&a.attrs.id){a=bf(a);var d=!!b,e=rc(a.attrs.id),f=e?e.parentNode:null;if(e&&f){if(window!=window.top){var h=null;if(document.referrer){var k=document.referrer.substring(0,128);hd(k)||(h=k)}else h="unknown";h&&(d=!0,a.args.framer=h)}h=Ae.getInstance();if(Be(h,a.minVersion)){var k=kf(a,h),m="";-1<navigator.userAgent.indexOf("Sony/COM2")||(m=e.getAttribute("src")||e.movie);(m!=k||d)&&hf(f,k,a);De(h)&&lf()}else mf(f,a,h);c&&c()}else G(function(){jf(a,b,c)},50)}}
function mf(a,b,c){0==c.j&&b.fallback?b.fallback():0==c.j&&b.fallbackMessage?b.fallbackMessage():a.innerHTML='<div id="flash-upgrade">'+xb()+"</div>"}function kf(a,b){return Ce(b)&&a.url||(-1<navigator.userAgent.indexOf("Sony/COM2")&&!Be(b,9,1,58)?!1:!0)&&a.urlV9As2||a.urlV8||a.url}function lf(){var a=rc("flash10-promo-div"),b;cf.getInstance();b=gf("f"+(Math.floor(107/31)+1));b=!!(((null!=b&&/^[A-Fa-f0-9]+$/.test(b)?parseInt(b,16):null)||0)&16384);a&&!b&&Re(a)};function nf(a){if(window.spf){var b=a.match(of);spf.style.load(a,b?b[1]:"",void 0)}else pf(a)}function pf(a){var b=qf(a),c=document.getElementById(b),d=c&&C(c,"loaded");d||c&&!d||(c=rf(a,b,function(){C(c,"loaded")||(kb(c,"loaded","true"),J(b),G(oa(Ib,b),0))}))}function rf(a,b,c){var d=document.createElement("link");d.id=b;d.rel="stylesheet";d.onload=function(){c&&setTimeout(c,0)};d.href=a;(document.getElementsByTagName("head")[0]||document.body).appendChild(d);return d}
function qf(a){var b=document.createElement("a");b.href=a;a=b.href.replace(/^[a-zA-Z]+:\/\//,"//");return"css-"+za(a)}var of=/cssbin\/(?:debug-)?([a-zA-Z0-9_-]+?)(?:-2x|-web|-rtl|-vfl|.css)/;var sf;var tf=K,tf=tf.toLowerCase();if(wa(tf,"android")){var uf=tf.match(/android\D*(\d\.\d)[^\;|\)]*[\;\)]/);if(uf)sf=Number(uf[1]);else{var vf={cupcake:1.5,donut:1.6,eclair:2,froyo:2.2,gingerbread:2.3,honeycomb:3,"ice cream sandwich":4,jellybean:4.1},wf=tf.match("("+ab(vf).join("|")+")");sf=wf?vf[wf[0]]:0}}else sf=void 0;function xf(){if(2.2==sf)return!0;var a;a=r("yt.player.utils.videoElement_");a||(a=document.createElement("video"),q("yt.player.utils.videoElement_",a,void 0));try{return!(!a||!a.canPlayType||!a.canPlayType('video/mp4; codecs="avc1.42001E, mp4a.40.2"')&&!a.canPlayType('video/webm; codecs="vp8.0, vorbis"'))}catch(b){return!1}};function yf(a,b){var c;a instanceof yf?(this.Ra=p(b)?b:a.Ra,zf(this,a.Ha),this.Qa=a.Qa,Af(this,a.ya),Bf(this,a.Oa),this.ra=a.ra,Cf(this,a.j.clone()),this.Pa=a.Pa):a&&(c=Vc(String(a)))?(this.Ra=!!b,zf(this,c[1]||"",!0),this.Qa=Df(c[2]||""),Af(this,c[3]||"",!0),Bf(this,c[4]),this.ra=Df(c[5]||"",!0),Cf(this,c[6]||"",!0),this.Pa=Df(c[7]||"")):(this.Ra=!!b,this.j=new Ef(null,0,this.Ra))}g=yf.prototype;g.Ha="";g.Qa="";g.ya="";g.Oa=null;g.ra="";g.Pa="";g.Ra=!1;
g.toString=function(){var a=[],b=this.Ha;b&&a.push(Ff(b,Gf,!0),":");if(b=this.ya){a.push("//");var c=this.Qa;c&&a.push(Ff(c,Gf,!0),"@");a.push(encodeURIComponent(String(b)).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.Oa;null!=b&&a.push(":",String(b))}if(b=this.ra)this.ya&&"/"!=b.charAt(0)&&a.push("/"),a.push(Ff(b,"/"==b.charAt(0)?Hf:If,!0));(b=this.j.toString())&&a.push("?",b);(b=this.Pa)&&a.push("#",Ff(b,Jf));return a.join("")};
g.resolve=function(a){var b=this.clone(),c=!!a.Ha;c?zf(b,a.Ha):c=!!a.Qa;c?b.Qa=a.Qa:c=!!a.ya;c?Af(b,a.ya):c=null!=a.Oa;var d=a.ra;if(c)Bf(b,a.Oa);else if(c=!!a.ra){if("/"!=d.charAt(0))if(this.ya&&!this.ra)d="/"+d;else{var e=b.ra.lastIndexOf("/");-1!=e&&(d=b.ra.substr(0,e+1)+d)}e=d;if(".."==e||"."==e)d="";else if(wa(e,"./")||wa(e,"/.")){for(var d=0==e.lastIndexOf("/",0),e=e.split("/"),f=[],h=0;h<e.length;){var k=e[h++];"."==k?d&&h==e.length&&f.push(""):".."==k?((1<f.length||1==f.length&&""!=f[0])&&
f.pop(),d&&h==e.length&&f.push("")):(f.push(k),d=!0)}d=f.join("/")}else d=e}c?b.ra=d:c=""!==a.j.toString();c?Cf(b,Df(a.j.toString())):c=!!a.Pa;c&&(b.Pa=a.Pa);return b};g.clone=function(){return new yf(this)};function zf(a,b,c){a.Ha=c?Df(b,!0):b;a.Ha&&(a.Ha=a.Ha.replace(/:$/,""))}function Af(a,b,c){a.ya=c?Df(b,!0):b}function Bf(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.Oa=b}else a.Oa=null}
function Cf(a,b,c){b instanceof Ef?(a.j=b,Kf(a.j,a.Ra)):(c||(b=Ff(b,Lf)),a.j=new Ef(b,0,a.Ra))}function N(a,b,c){a.j.set(b,c)}function Mf(a,b,c){ea(c)||(c=[String(c)]);Nf(a.j,b,c)}function Of(a){N(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^w()).toString(36));return a}function Pf(a){return a instanceof yf?a.clone():new yf(a,void 0)}function Qf(a,b,c,d){var e=new yf(null,void 0);a&&zf(e,a);b&&Af(e,b);c&&Bf(e,c);d&&(e.ra=d);return e}
function Df(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function Ff(a,b,c){return u(a)?(a=encodeURI(a).replace(b,Rf),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Rf(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var Gf=/[#\/\?@]/g,If=/[\#\?:]/g,Hf=/[\#\?]/g,Lf=/[\#\?@]/g,Jf=/#/g;function Ef(a,b,c){this.j=a||null;this.k=!!c}
function Sf(a){if(!a.P&&(a.P=new pd,a.ba=0,a.j)){var b=v(a.add,a);a=a.j.split("&");for(var c=0;c<a.length;c++){var d=a[c].indexOf("="),e=null,f=null;0<=d?(e=a[c].substring(0,d),f=a[c].substring(d+1)):e=a[c];b(sa(e),f?sa(f):"")}}}g=Ef.prototype;g.P=null;g.ba=null;g.ia=function(){Sf(this);return this.ba};g.add=function(a,b){Sf(this);this.j=null;a=Tf(this,a);var c=this.P.get(a);c||this.P.set(a,c=[]);c.push(b);this.ba++;return this};
g.remove=function(a){Sf(this);a=Tf(this,a);return rd(this.P.k,a)?(this.j=null,this.ba-=this.P.get(a).length,this.P.remove(a)):!1};g.clear=function(){this.P=this.j=null;this.ba=0};g.isEmpty=function(){Sf(this);return 0==this.ba};function Uf(a,b){Sf(a);b=Tf(a,b);return rd(a.P.k,b)}g.Mb=function(a){var b=this.ga();return Ha(b,a)};g.va=function(){Sf(this);for(var a=this.P.ga(),b=this.P.va(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};
g.ga=function(a){Sf(this);var b=[];if(u(a))Uf(this,a)&&(b=Na(b,this.P.get(Tf(this,a))));else{a=this.P.ga();for(var c=0;c<a.length;c++)b=Na(b,a[c])}return b};g.set=function(a,b){Sf(this);this.j=null;a=Tf(this,a);Uf(this,a)&&(this.ba-=this.P.get(a).length);this.P.set(a,[b]);this.ba++;return this};g.get=function(a,b){var c=a?this.ga(a):[];return 0<c.length?String(c[0]):b};function Nf(a,b,c){a.remove(b);0<c.length&&(a.j=null,a.P.set(Tf(a,b),Oa(c)),a.ba+=c.length)}
g.toString=function(){if(this.j)return this.j;if(!this.P)return"";for(var a=[],b=this.P.va(),c=0;c<b.length;c++)for(var d=b[c],e=encodeURIComponent(String(d)),d=this.ga(d),f=0;f<d.length;f++){var h=e;""!==d[f]&&(h+="="+encodeURIComponent(String(d[f])));a.push(h)}return this.j=a.join("&")};g.clone=function(){var a=new Ef;a.j=this.j;this.P&&(a.P=this.P.clone(),a.ba=this.ba);return a};function Tf(a,b){var c=String(b);a.k&&(c=c.toLowerCase());return c}
function Kf(a,b){b&&!a.k&&(Sf(a),a.j=null,a.P.forEach(function(a,b){var e=b.toLowerCase();b!=e&&(this.remove(b),Nf(this,e,a))},a));a.k=b};var Vf=/^https?:\/\/([A-Za-z0-9-]{1,63}\.)*(corp\.google\.com|borg\.google\.com|prod\.google\.com|video\.google\.com|youtube\.com|youtube\.googleapis\.com|youtube-nocookie\.com|youtubeeducation\.com)(:[0-9]+)?\/+embed\/+/;var Wf="corp.google.com googleplex.com youtube.com youtube-nocookie.com youtubeeducation.com borg.google.com prod.google.com sandbox.google.com docs.google.com drive.google.com mail.google.com photos.google.com plus.google.com play.google.com googlevideo.com talkgadget.google.com survey.g.doubleclick.net youtube.googleapis.com vevo.com".split(" "),Xf="";
function Yf(a){return a&&a==Xf?!0:(new RegExp("^(https?:)?//([a-z0-9-]{1,63}\\.)*("+Wf.join("|").replace(/\./g,".")+")(:[0-9]+)?([/?#]|$)","i")).test(a)?(Xf=a,!0):!1};var Zf={},$f=0,ag=r("yt.net.ping.workerUrl_")||null;q("yt.net.ping.workerUrl_",ag,void 0);function bg(a){var b=new Image,c=""+$f++;Zf[c]=b;b.onload=b.onerror=function(){delete Zf[c]};b.src=a;b=eval("null")};var cg,dg,eg;var O=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{},fg=v(O.clearResourceTimings||O.webkitClearResourceTimings||O.mozClearResourceTimings||O.msClearResourceTimings||O.oClearResourceTimings||t,O),gg=O.mark?function(a){O.mark(a)}:t;function hg(a){ig().tick[a]=w();gg(a);F("CSI_LOG_ON_TICK")&&jg()}function kg(){var a=ig().tick;if(a.aft)return a.aft;for(var b=F("TIMING_AFT_KEYS",["ol"]),c=b.length,d=0;d<c;d++){var e=a[b[d]];if(e)return e}return NaN}
function lg(a){return Math.round(O.timing.navigationStart+a)}
function mg(a){var b=window.location.protocol,c=O.getEntriesByType("resource"),d=c.filter(function(a){return 0==a.name.indexOf(b+"//fonts.googleapis.com/css?family=")})[0],c=c.filter(function(a){return 0==a.name.indexOf(b+"//fonts.gstatic.com/s/")}).reduce(function(a,b){return b.duration>a.duration?b:a},{duration:0});d&&0<d.startTime&&0<d.responseEnd&&(a.wfcs=lg(d.startTime),a.wfce=lg(d.responseEnd));c&&0<c.startTime&&0<c.responseEnd&&(a.wffs=lg(c.startTime),a.wffe=lg(c.responseEnd))}
function jg(){var a=F("TIMING_ACTION"),b=ig().tick;if(a&&b._start&&kg()){var a=!0,c=F("TIMING_WAIT",[]);if(c.length)for(var d=0,e=c.length;d<e;++d)if(!(c[d]in b)){a=!1;break}if(a)if(c=ig().tick,b=ig().span,d=ig().info,a=r("yt.timing.reportbuilder_")){if(a=a(c,b,d,void 0))ng(a),og(),fg()}else{a={v:2,s:"youtube",action:F("TIMING_ACTION")};O.now&&O.timing&&(e=O.timing.navigationStart+O.now(),e=Math.round(w()-e),d.yt_hrd=e);var e=F("TIMING_INFO")||{},f;for(f in e)d[f]=e[f];f=d.srt;delete d.srt;var h;
f||0===f||(h=O.timing||{},f=Math.max(0,h.responseStart-h.navigationStart),isNaN(f)&&d.pt&&(f=d.pt));if(f||0===f)d.srt=f;d.h5jse&&(f=window.location.protocol+r("ytplayer.config.assets.js"),(f=O.getEntriesByName?O.getEntriesByName(f)[0]:null)?d.h5jse=Math.round(d.h5jse-f.responseEnd):delete d.h5jse);c.aft=kg();f=c._start;if(!cg){h||(h=O.timing||{});i:if(e=h,e.msFirstPaint)e=Math.max(0,e.msFirstPaint);else{var k=window.chrome;if(k&&(k=k.loadTimes,ha(k))){var k=k(),m=1E3*Math.min(k.requestTime||Infinity,
k.startLoadTime||Infinity),m=Infinity===m?0:e.navigationStart-m,e=Math.max(0,Math.round(1E3*k.firstPaintTime+m)||0);break i}e=0}0<e&&e>f&&(c.fpt=e);e=h.redirectEnd-h.redirectStart;0<e&&(b.rtime_=e);e=h.domainLookupEnd-h.domainLookupStart;0<e&&(b.dns_=e);e=h.connectEnd-h.connectStart;0<e&&(b.tcp_=e);e=h.connectEnd-h.secureConnectionStart;h.secureConnectionStart&&0<e&&(b.stcp_=e);e=h.responseStart-h.requestStart;0<e&&(b.req_=e);e=h.responseEnd-h.responseStart;0<e&&(b.rcv_=e);F("EXP_WEBFONT_ENABLED")&&
O.getEntriesByType&&mg(c);cg=!0}F("CSI_MORE")&&(d.p=F("CLIENT_PROTOCOL")||"unknown",d.t=F("CLIENT_TRANSPORT")||"unknown");for(var n in d)"_"!=n.charAt(0)&&(a[n]=d[n]);n={};h=[];for(var x in c)"_"!=x.charAt(0)&&(e=Math.max(Math.round(c[x]-f),0),n[x]=e,h.push(x+"."+e));a.rt=h.join(",");x={};h=[];for(var aa in b)"_"!=aa.charAt(0)&&(x[aa]=b[aa],h.push(aa+"."+b[aa]));a.it=h.join(",");(aa=r("ytdebug.logTiming"))&&aa(a,n,x);og();fg();F("EXP_DEFER_CSI_PING")?(pg(),dg=a,eg=G(pg,0)):ng(a)}}}
function ng(a){F("EXP_DEFER_CSI_PING")&&(H(eg),dg=null);var b="https:"==window.location.protocol?"https://gg.google.com/csi":"http://csi.gstatic.com/csi",c="",d;for(d in a)c+="&"+d+"="+a[d];(a=b+"?"+c.substring(1))&&bg(a)}function pg(a){dg&&(a&&(dg.yt_fss=a),ng(dg))}function ig(){return r("ytcsi.data_")||og()}function og(){var a={tick:{},span:{},info:{}};q("ytcsi.data_",a,void 0);return a};function qg(){};function rg(){}y(rg,qg);rg.prototype.ia=function(){var a=0;nd(this.za(!0),function(){a++});return a};rg.prototype.clear=function(){var a=od(this.za(!0)),b=this;A(a,function(a){b.remove(a)})};function sg(a){this.j=a}y(sg,rg);g=sg.prototype;g.isAvailable=function(){if(!this.j)return!1;try{return this.j.setItem("__sak","1"),this.j.removeItem("__sak"),!0}catch(a){return!1}};g.set=function(a,b){try{this.j.setItem(a,b)}catch(c){if(0==this.j.length)throw"Storage mechanism: Storage disabled";throw"Storage mechanism: Quota exceeded";}};g.get=function(a){a=this.j.getItem(a);if(!u(a)&&null!==a)throw"Storage mechanism: Invalid value was encountered";return a};g.remove=function(a){this.j.removeItem(a)};
g.ia=function(){return this.j.length};g.za=function(a){var b=0,c=this.j,d=new ld;d.next=function(){if(b>=c.length)throw kd;var d;d=c.key(b++);if(a)return d;d=c.getItem(d);if(!u(d))throw"Storage mechanism: Invalid value was encountered";return d};return d};g.clear=function(){this.j.clear()};g.key=function(a){return this.j.key(a)};function tg(){var a=null;try{a=window.localStorage||null}catch(b){}this.j=a}y(tg,sg);function ug(){var a=null;try{a=window.sessionStorage||null}catch(b){}this.j=a}y(ug,sg);function vg(a){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+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);}function wg(a){return eval("("+a+")")}function P(a){return xg(new yg(void 0),a)}function yg(a){this.j=a}
function xg(a,b){var c=[];zg(a,b,c);return c.join("")}
function zg(a,b,c){switch(typeof b){case "string":Ag(b,c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?b:"null");break;case "boolean":c.push(b);break;case "undefined":c.push("null");break;case "object":if(null==b){c.push("null");break}if(ea(b)){var d=b.length;c.push("[");for(var e="",f=0;f<d;f++)c.push(e),e=b[f],zg(a,a.j?a.j.call(b,String(f),e):e,c),e=",";c.push("]");break}c.push("{");d="";for(f in b)Object.prototype.hasOwnProperty.call(b,f)&&(e=b[f],"function"!=typeof e&&(c.push(d),Ag(f,c),
c.push(":"),zg(a,a.j?a.j.call(b,f,e):e,c),d=","));c.push("}");break;case "function":break;default:throw Error("Unknown type: "+typeof b);}}var Bg={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Cg=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
function Ag(a,b){b.push('"',a.replace(Cg,function(a){if(a in Bg)return Bg[a];var b=a.charCodeAt(0),e="\\u";16>b?e+="000":256>b?e+="00":4096>b&&(e+="0");return Bg[a]=e+b.toString(16)}),'"')};function Dg(a){this.j=a}Dg.prototype.set=function(a,b){p(b)?this.j.set(a,P(b)):this.j.remove(a)};Dg.prototype.get=function(a){var b;try{b=this.j.get(a)}catch(c){return}if(null!==b)try{return vg(b)}catch(d){throw"Storage: Invalid value was encountered";}};Dg.prototype.remove=function(a){this.j.remove(a)};function Eg(a){this.j=a}y(Eg,Dg);function Fg(a){this.data=a}function Gg(a){return!p(a)||a instanceof Fg?a:new Fg(a)}Eg.prototype.set=function(a,b){Eg.L.set.call(this,a,Gg(b))};Eg.prototype.k=function(a){a=Eg.L.get.call(this,a);if(!p(a)||a instanceof Object)return a;throw"Storage: Invalid value was encountered";};Eg.prototype.get=function(a){if(a=this.k(a)){if(a=a.data,!p(a))throw"Storage: Invalid value was encountered";}else a=void 0;return a};function Hg(a){this.j=a}y(Hg,Eg);function Ig(a){var b=a.creation;a=a.expiration;return!!a&&a<w()||!!b&&b>w()}Hg.prototype.set=function(a,b,c){if(b=Gg(b)){if(c){if(c<w()){Hg.prototype.remove.call(this,a);return}b.expiration=c}b.creation=w()}Hg.L.set.call(this,a,b)};Hg.prototype.k=function(a,b){var c=Hg.L.k.call(this,a);if(c)if(!b&&Ig(c))Hg.prototype.remove.call(this,a);else return c};function Jg(a){this.j=a}y(Jg,Hg);function Kg(a,b){var c=[];nd(b,function(a){var b;try{b=Jg.prototype.k.call(this,a,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}p(b)?Ig(b)&&c.push(a):c.push(a)},a);return c}function Lg(a,b){var c=Kg(a,b);A(c,function(a){Jg.prototype.remove.call(this,a)},a)}function Mg(){var a=Ng;Lg(a,a.j.za(!0))};function Q(a,b,c){var d=c&&0<c?c:0;c=d?w()+1E3*d:0;if((d=d?Ng:Og)&&window.JSON){u(b)||(b=JSON.stringify(b,void 0));try{d.set(a,b,c)}catch(e){d.remove(a)}}}function R(a){if(!Og&&!Ng||!window.JSON)return null;var b;try{b=Og.get(a)}catch(c){}if(!u(b))try{b=Ng.get(a)}catch(d){}if(!u(b))return null;try{b=JSON.parse(b,void 0)}catch(e){}return b}function Pg(a){Og&&Og.remove(a);Ng&&Ng.remove(a)}var Ng,Qg=new tg;Ng=Qg.isAvailable()?new Jg(Qg):null;var Og,Rg=new ug;Og=Rg.isAvailable()?new Jg(Rg):null;function Sg(){var a={volume:100,muted:!1},b=R("yt-player-volume")||{};a.volume=isNaN(b.volume)?100:Math.min(Math.max(b.volume,0),100);a.muted=void 0==b.muted?!1:b.muted;return a};function Tg(a,b){D.call(this);this.o=this.cb=a;this.O=b;this.C=!1;this.j={};this.ca=this.M=null;this.U=new E;nb(this,oa(ob,this.U));this.B={};this.A=this.ua=this.k=this.Sa=this.H=null;this.X=!1;this.Aa=this.F=null;this.ta={};this.jd=["onReady"];this.Ta=null;this.qb=0;this.Z={};Ug(this);this.Va("onVolumeChange",v(this.md,this));this.Va("onError",v(this.ld,this));this.Va("onTabOrderChange",v(this.kd,this));this.Va("WATCH_LATER_VIDEO_ADDED",v(this.nd,this));this.Va("WATCH_LATER_VIDEO_REMOVED",v(this.od,
this))}y(Tg,D);g=Tg.prototype;g.Zb=function(a,b){this.K()||(Vg(this,a),Wg(this,b),this.C&&Xg(this))};
function Vg(a,b){a.Sa=b;a.H=b.clone();a.k=a.H.attrs.id||a.k;"video-player"==a.k&&(a.k=a.O,a.H.attrs.id=a.O);a.o.id==a.k&&(a.k=a.k+"-player",a.H.attrs.id=a.k);var c=a.H.args,d;(d=a.H.args.eurl)||(d=(d=document.location.toString())&&-1!=d.search(Vf)?document.referrer&&document.referrer.substring(0,128)||"unknown":d);c.eurl=d;a.H.args.enablejsapi="1";a.H.args.playerapiid=a.O;a.ua||(a.ua=Yg(a,a.H.args.jsapicallback||"onYouTubePlayerReady"));a.H.args.jsapicallback=null;if(c=a.H.attrs.width)a.o.style.width=
Je(Number(c)||c,!0);if(c=a.H.attrs.height)a.o.style.height=Je(Number(c)||c,!0);a.o.style.overflow="hidden"}g.Pd=function(){return this.Sa};function Xg(a){a.H.loaded||(a.H.loaded=!0,"0"!=a.H.args.autoplay?a.j.loadVideoByPlayerVars(a.H.args):a.j.cueVideoByPlayerVars(a.H.args))}function Zg(a){if(!p(a.H.disable.flash)){var b=a.H.disable,c;c=Be(Ae.getInstance(),a.H.minVersion);b.flash=!c}return!a.H.disable.flash}
function $g(a){var b=ah(a);b&&b.stopVideo&&b.stopVideo();if(Zg(a)){var c=a.H;b&&b.getUpdatedConfigurationData&&(b=bf(b.getUpdatedConfigurationData()),r("ytplayer.REFACTOR")||b.args.video_id==c.args.video_id)&&(c=b);c.args.autoplay=1;c.args.html5_unavailable="1";Vg(a,c);Wg(a,"flash")}}
function Wg(a,b){if(!a.K()){if(!b){var c;if(!(c=!a.H.html5&&Zg(a))){if(!p(a.H.disable.html5)){if(c=xf())c=bh(a)||a.H.assets.js;a.H.disable.html5=!c;c||(a.H.args.html5_unavailable="1")}c=!!a.H.disable.html5}b=c?Zg(a)?"flash":"unsupported":"html5"}("flash"==b?a.xe:"html5"==b?a.ye:a.ze).call(a)}}function bh(a){var b=!0,c=ah(a);c&&a.H&&(a=a.H,b=C(c,"version")==a.assets.js);return b&&!!r("yt.player.Application.create")}
g.ye=function(){if(!this.X){var a=bh(this);a&&"html5"==ch(this)?(this.A="html5",this.C||this.Za()):(dh(this),this.A="html5",a&&this.Aa?(this.cb.appendChild(this.Aa),this.Za()):(this.H.loaded=!0,this.F=v(function(){var a=this.cb,c=this.H.clone();r("yt.player.Application.create")(a,c);this.Za()},this),this.X=!0,a?this.F():(Jb(this.H.assets.js,this.F),nf(this.H.assets.css))))}};
g.xe=function(){var a=this.H.clone();a.attrs.width=a.attrs.width||"100%";a.attrs.height=a.attrs.height||"100%";if("flash"==ch(this))this.A="flash",this.C||jf(a,!1,v(this.Za,this));else{dh(this);this.A="flash";this.H.loaded=!0;var b=this.cb,b=u(b)?sc(b):b,a=bf(a);if(window!=window.top){var c=null;document.referrer&&(c=document.referrer.substring(0,128));a.args.framer=c}c=Ae.getInstance();Be(c,a.minVersion)?(c=kf(a,c),hf(b,c,a)):mf(b,a,c);this.Za()}};
function ah(a){var b=rc(a.k);!b&&a.o&&a.o.querySelector&&(b=a.o.querySelector("#"+a.k));return b}
g.Za=function(){var a=ah(this),b=!1;try{a&&a.getApiInterface&&a.getApiInterface()&&(b=!0)}catch(c){}if(b)if(this.X=!1,a.isNotServable&&a.isNotServable(this.H.args.video_id))$g(this);else{Ug(this);this.C=!0;a=ah(this);a.addEventListener&&(this.M=eh(this,a,"addEventListener"));a.removeEventListener&&(this.ca=eh(this,a,"removeEventListener"));for(var b=a.getApiInterface(),b=b.concat(a.getInternalApiInterface()),d=0;d<b.length;d++){var e=b[d];this.j[e]||(this.j[e]=eh(this,a,e))}for(var f in this.B)this.M(f,
this.B[f]);Xg(this);this.ua&&this.ua(this.j);this.U.publish("onReady",this.j)}else this.qb=G(v(this.Za,this),50)};function eh(a,b,c){var d=b[c];return function(){try{return a.Ta=null,d.apply(b,arguments)}catch(e){"Bad NPObject as private data!"!=e.message&&(e.message+=" ("+c+")",a.Ta=e,wb(e,"WARNING"))}}}
function Ug(a){a.C=!1;if(a.ca)for(var b in a.B)a.ca(b,a.B[b]);for(var c in a.Z)H(parseInt(c,10));a.Z={};a.M=null;a.ca=null;for(var d in a.j)a.j[d]=null;a.j.addEventListener=v(a.Va,a);a.j.removeEventListener=v(a.Sd,a);a.j.destroy=v(a.dispose,a);a.j.getLastError=v(a.Qd,a);a.j.getPlayerType=v(a.Rd,a);a.j.getCurrentVideoConfig=v(a.Pd,a);a.j.loadNewVideoConfig=v(a.Zb,a);a.j.isReady=v(a.Td,a)}g.Td=function(){return this.C};
g.Va=function(a,b){if(!this.K()){var c=Yg(this,b);if(c){if(!Ha(this.jd,a)&&!this.B[a]){var d=fh(this,a);this.M&&this.M(a,d)}this.U.subscribe(a,c);"onReady"==a&&this.C&&G(oa(c,this.j),0)}}};g.Sd=function(a,b){if(!this.K()){var c=Yg(this,b);c&&this.U.unsubscribe(a,c)}};function Yg(a,b){var c=b;if("string"==typeof b){if(a.ta[b])return a.ta[b];c=function(){var a=r(b);a&&a.apply(l,arguments)};a.ta[b]=c}return c?c:null}
function fh(a,b){var c="ytPlayer"+b+a.O;a.B[b]=c;l[c]=function(c){var e=G(function(){if(!a.K()){a.U.publish(b,c);var f=a.Z,h=e.toString();h in f&&delete f[h]}},0);eb(a.Z,e.toString())};return c}g.kd=function(a){a=a?xc:wc;for(var b=a(document.activeElement);b&&(1!=b.nodeType||(b.focus(),b!=document.activeElement));)b=a(b)};g.md=function(a){var b={};b.volume=isNaN(a.volume)?Sg().volume:Math.min(Math.max(a.volume,0),100);b.muted=void 0==a.muted?Sg().muted:a.muted;Q("yt-player-volume",b,2592E3)};
g.ld=function(a){5==a&&$g(this)};g.nd=function(a){J("WATCH_LATER_VIDEO_ADDED",a)};g.od=function(a){J("WATCH_LATER_VIDEO_REMOVED",a)};
g.ze=function(){dh(this);this.A="unsupported";var a='Adobe Flash Player or an HTML5 supported browser is required for video playback. <br> <a href="http://get.adobe.com/flashplayer/">Get the latest Flash Player</a> <br> <a href="/html5">Learn more about upgrading to an HTML5 browser</a>',b=navigator.userAgent.match(/Version\/(\d).*Safari/);b&&5<=parseInt(b[1],10)&&(a='Adobe Flash Player or QuickTime is required for video playback. <br> <a href="http://get.adobe.com/flashplayer/"> Get the latest Flash Player</a> <br> <a href="http://www.apple.com/quicktime/download/">Get the latest version of QuickTime</a>');
b=this.H.messages.player_fallback||a;a=rc("player-unavailable");if(rc("unavailable-submessage")&&a){rc("unavailable-submessage").innerHTML=b;var b=a||document,c=null;b.querySelectorAll&&b.querySelector?c=b.querySelector(".icon"):c=uc("icon",a)[0];if(c=b=c||null)c=b?b.dataset?lb("icon")in b.dataset:b.hasAttribute?!!b.hasAttribute("data-icon"):!!b.getAttribute("data-icon"):!1;c&&(b.src=C(b,"icon"));Xb(a,"hid");Wb(rc("player"),"off-screen-trigger")}};g.Rd=function(){return this.A||ch(this)};g.Qd=function(){return this.Ta};
function ch(a){return(a=ah(a))?"div"==a.tagName.toLowerCase()?"html5":"flash":null}function dh(a){hg("dcp");a.cancel();Ug(a);a.A=null;a.H&&(a.H.loaded=!1);var b=ah(a);"html5"==ch(a)?a.Aa=b:b&&b.destroy&&b.destroy();for(a=a.cb;b=a.firstChild;)a.removeChild(b)}g.cancel=function(){if(this.F){var a=this.F;this.H.assets.js&&a&&(a=""+ja(a),(a=Ob[a])&&Fb(a))}H(this.qb);this.X=!1};
g.G=function(){dh(this);this.ta=null;for(var a in this.B)l[this.B[a]]=null;this.j=null;delete this.cb;delete this.o;this.H&&(this.Sa=this.H=this.H.fallback=null);Tg.L.G.call(this)};var gh={},hh="player_uid_"+(1E9*Math.random()>>>0);function ih(a,b){a=u(a)?sc(a):a;b=bf(b);var c=hh+"_"+ja(a),d=gh[c];if(d)return d.Zb(b),d.j;d=new Tg(a,c);gh[c]=d;J("player-added",d.j);nb(d,oa(jh,d));G(function(){d.Zb(b)},0);return d.j}function kh(){for(var a in gh){var b=gh[a];b&&b.cancel()}}function lh(a){if(a=rc(a))a=hh+"_"+ja(a),(a=gh[a])&&a.dispose()}function jh(a){gh[a.O]=null}function mh(a){a=rc(a);if(!a)return null;var b=hh+"_"+ja(a),c=gh[b];c||(c=new Tg(a,b),gh[b]=c);return c.j};var nh=r("yt.abuse.botguardInitialized")||Sb;q("yt.abuse.botguardInitialized",nh,void 0);var oh=r("yt.abuse.invokeBotguard")||Tb;q("yt.abuse.invokeBotguard",oh,void 0);var ph=r("yt.player.exports.navigate")||jd;q("yt.player.exports.navigate",ph,void 0);var qh=r("yt.player.embed")||ih;q("yt.player.embed",qh,void 0);var rh=r("yt.player.destroy")||lh;q("yt.player.destroy",rh,void 0);var sh=r("yt.player.cancelAll")||kh;q("yt.player.cancelAll",sh,void 0);var th=r("yt.player.getPlayerByElement")||mh;
q("yt.player.getPlayerByElement",th,void 0);var uh=r("yt.player.exports.feedbackStart")||We;q("yt.player.exports.feedbackStart",uh,void 0);var vh=r("yt.player.exports.feedbackShowArticle")||Xe;q("yt.player.exports.feedbackShowArticle",vh,void 0);var wh=r("yt.util.activity.init")||Rc;q("yt.util.activity.init",wh,void 0);var xh=r("yt.util.activity.getTimeSinceActive")||Tc;q("yt.util.activity.getTimeSinceActive",xh,void 0);var yh=r("yt.util.activity.setTimestamp")||Sc;
q("yt.util.activity.setTimestamp",yh,void 0);function zh(a){var b=void 0;void 0===b&&(b=NaN);var c=r("yt.scheduler.instance.addJob");c?(isNaN(b)&&(b=0),c(a,0,b)):isNaN(b)?a():G(a,b||0)};function S(a,b){this.version=a;this.args=b}function Ah(a){if(!a.Da){var b={};a.call(b);a.Da=b.version}return a.Da}
function Bh(a,b){function c(){a.apply(this,b.args)}if(!b.args||!b.version)throw Error("yt.pubsub2.Data.deserialize(): serializedData is incomplete.");var d;try{d=Ah(a)}catch(e){}if(!d||b.version!=d)throw Error("yt.pubsub2.Data.deserialize(): serializedData version is incompatible.");c.prototype=a.prototype;try{return new c}catch(f){throw f.message="yt.pubsub2.Data.deserialize(): "+f.message,f;}}function T(a,b){this.k=a;this.j=b}T.prototype.toString=function(){return this.k};var Ch=r("yt.pubsub2.instance_")||new E;E.prototype.subscribe=E.prototype.subscribe;E.prototype.unsubscribeByKey=E.prototype.pa;E.prototype.publish=E.prototype.publish;E.prototype.clear=E.prototype.clear;q("yt.pubsub2.instance_",Ch,void 0);var Dh=r("yt.pubsub2.subscribedKeys_")||{};q("yt.pubsub2.subscribedKeys_",Dh,void 0);var Eh=r("yt.pubsub2.topicToKeys_")||{};q("yt.pubsub2.topicToKeys_",Eh,void 0);var Fh=r("yt.pubsub2.isAsync_")||{};q("yt.pubsub2.isAsync_",Fh,void 0);
q("yt.pubsub2.skipSubKey_",null,void 0);function U(a,b){var c=Gh();c&&c.publish.call(c,a.toString(),a,b)}
function Hh(a,b,c){var d=Gh();if(!d)return 0;var e=d.subscribe(a.toString(),function(d,h){if(!window.yt.pubsub2.skipSubKey_||window.yt.pubsub2.skipSubKey_!=e){var k=function(){if(Dh[e])try{if(h&&a instanceof T&&a!=d)try{h=Bh(a.j,h)}catch(k){throw k.message="yt.pubsub2 cross-binary conversion error for "+a.toString()+": "+k.message,k;}b.call(c||window,h)}catch(n){wb(n)}};Fh[a.toString()]?r("yt.scheduler.instance")?zh(k):G(k,0):k()}});Dh[e]=!0;Eh[a.toString()]||(Eh[a.toString()]=[]);Eh[a.toString()].push(e);
return e}function Ih(){var a=Jh,b=Gh();b&&(ga(a)&&(a=[a]),A(a,function(a){b.unsubscribeByKey(a);delete Dh[a]}))}function Gh(){return r("yt.pubsub2.instance_")};function Kh(a){S.call(this,1,arguments);this.j=a}y(Kh,S);function Lh(a){S.call(this,1,arguments);this.j=a}y(Lh,S);function Mh(a,b,c){S.call(this,1,arguments);this.k=a;this.isEnabled=b;this.j=c||null}y(Mh,S);function Nh(a,b){S.call(this,1,arguments);this.j=a;this.isEnabled=b}y(Nh,S);function Oh(a,b,c,d,e,f){S.call(this,1,arguments);this.k=a;this.j=b;this.A=c||null;this.B=d||null;this.o=e||null;this.source=f||null}y(Oh,S);
function Ph(a,b,c,d,e,f,h){S.call(this,1,arguments);this.k=a;this.Qb=b;this.j=c;this.A=d||null;this.B=e||null;this.o=f||null;this.source=h||null}y(Ph,S);
var Qh=new T("subscription-batch-pref-email",Mh),Rh=new T("subscription-batch-pref-uploads",Mh),Sh=new T("subscription-batch-subscribe",Kh),Th=new T("subscription-batch-unsubscribe",Kh),Uh=new T("subscription-pref-email",Nh),Vh=new T("subscription-pref-uploads",Nh),Wh=new T("subscription-subscribe",Oh),Xh=new T("subscription-subscribe-loading",Lh),Yh=new T("subscription-subscribe-loaded",Lh),Zh=new T("subscription-subscribe-external",Oh),$h=new T("subscription-unsubscribe",Ph),ai=new T("subscription-unsubscirbe-loading",
Lh),bi=new T("subscription-unsubscribe-loaded",Lh),ci=new T("subscription-external-unsubscribe",Ph);function di(a,b,c){var d=document.location.protocol+"//"+document.domain+"/post_login";b&&(d=cd(d,"mode",b));b=cd("/signin?context=popup","next",d);c&&(b=cd(b,"feature",c));if(c=window.open(b,"loginPopup","width=375,height=440,resizable=yes,scrollbars=yes",!0))b=I("LOGGED_IN",function(b){Fb(F("LOGGED_IN_PUBSUB_KEY"));sb("LOGGED_IN",!0);a(b)}),sb("LOGGED_IN_PUBSUB_KEY",b),c.moveTo((screen.width-375)/2,(screen.height-440)/2)}q("yt.pubsub.publish",J,void 0);var ei=null;"undefined"!=typeof XMLHttpRequest?ei=function(){return new XMLHttpRequest}:"undefined"!=typeof ActiveXObject&&(ei=function(){return new ActiveXObject("Microsoft.XMLHTTP")});function fi(a,b,c,d,e,f,h){function k(){4==(m&&"readyState"in m?m.readyState:0)&&b&&ub(b)(m)}var m=ei&&ei();if(!("open"in m))return null;"onloadend"in m?m.addEventListener("loadend",k,!1):m.onreadystatechange=k;c=(c||"GET").toUpperCase();d=d||"";m.open(c,a,!0);f&&(m.responseType=f);h&&(m.withCredentials=!0);f="POST"==c;if(e=gi(a,e))for(var n in e)m.setRequestHeader(n,e[n]),"content-type"==n.toLowerCase()&&(f=!1);f&&m.setRequestHeader("Content-Type","application/x-www-form-urlencoded");m.send(d);return m}
function gi(a,b){b=b||{};for(var c in hi){var d=F(hi[c]),e;if(e=d){e=a;var f=void 0;f=window.location.href;var h=Vc(e)[1]||null,k=fd(e);h&&k?(e=Vc(e),f=Vc(f),e=e[3]==f[3]&&e[1]==f[1]&&e[4]==f[4]):e=k?fd(f)==k&&(Number(Vc(f)[4]||null)||null)==(Number(Vc(e)[4]||null)||null):!0;e||(e=c,f=F("CORS_HEADER_WHITELIST")||{},e=(h=fd(a))?(f=f[h])?Ha(f,e):!1:!0)}e&&(b[c]=d)}return b}
function ii(a,b){var c=F("XSRF_FIELD_NAME"),d;b.headers&&(d=b.headers["Content-Type"]);return!b.$e&&(!fd(a)||fd(a)==document.location.hostname)&&"POST"==b.method&&(!d||"application/x-www-form-urlencoded"==d)&&!(b.V&&b.V[c])}
function ji(a,b){var c=b.format||"JSON";b.Ye&&(a=document.location.protocol+"//"+document.location.hostname+(document.location.port?":"+document.location.port:"")+a);var d=F("XSRF_FIELD_NAME"),e=F("XSRF_TOKEN"),f=b.jc;f&&(f[d]&&delete f[d],a=gd(a,f));var h=b.Ze||"",f=b.V;ii(a,b)&&(f||(f={}),f[d]=e);f&&u(h)&&(d=ed(h),ib(d,f),h=bd(d));var k=!1,m,n=fi(a,function(a){if(!k){k=!0;m&&H(m);var d;t:switch(a&&"status"in a?a.status:-1){case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 304:d=
!0;break t;default:d=!1}var e=null;if(d||400<=a.status&&500>a.status)e=ki(c,a);if(d)t:{switch(c){case "XML":d=0==parseInt(e&&e.return_code,10);break t;case "RAW":d=!0;break t}d=!!e}var e=e||{},f=b.context||l;d?b.da&&b.da.call(f,a,e):b.onError&&b.onError.call(f,a,e);b.kc&&b.kc.call(f,a,e)}},b.method,h,b.headers,b.responseType,b.withCredentials);b.ub&&0<b.timeout&&(m=G(function(){k||(k=!0,n.abort(),H(m),b.ub.call(b.context||l,n))},b.timeout));return n}
function ki(a,b){var c=null;switch(a){case "JSON":var d=b.responseText,e=b.getResponseHeader("Content-Type")||"";d&&0<=e.indexOf("json")&&(c=wg(d));break;case "XML":if(d=(d=b.responseXML)?li(d):null)c={},A(d.getElementsByTagName("*"),function(a){c[a.tagName]=mi(a)})}return c}function li(a){return a?(a=("responseXML"in a?a.responseXML:a).getElementsByTagName("root"))&&0<a.length?a[0]:null:null}function mi(a){var b="";A(a.childNodes,function(a){b+=a.nodeValue});return b}
var hi={"X-YouTube-Page-CL":"PAGE_CL","X-YouTube-Page-Timestamp":"PAGE_BUILD_TIMESTAMP","X-YouTube-Variants-Checksum":"VARIANTS_CHECKSUM"};function ni(){var a=F("PLAYER_CONFIG");return a&&a.args&&void 0!==a.args.authuser?!0:!(!F("SESSION_INDEX")&&!F("LOGGED_IN"))};var oi={},pi="ontouchstart"in document;function qi(a,b,c){var d;switch(a){case "mouseover":case "mouseout":d=3;break;case "mouseenter":case "mouseleave":d=9}return Ac(c,function(a){return Vb(a,b)},!0,d)}
function ri(a){var b="mouseover"==a.type&&"mouseenter"in oi||"mouseout"==a.type&&"mouseleave"in oi,c=a.type in oi||b;if("HTML"!=a.target.tagName&&c){if(b){var b="mouseover"==a.type?"mouseenter":"mouseleave",c=oi[b],d;for(d in c.ha){var e=qi(b,d,a.target);e&&!Ac(a.relatedTarget,function(a){return a==e},!0)&&c.publish(d,e,b,a)}}if(b=oi[a.type])for(d in b.ha)(e=qi(a.type,d,a.target))&&b.publish(d,e,a.type,a)}}M(document,"blur",ri,!0);M(document,"change",ri,!0);M(document,"click",ri);
M(document,"focus",ri,!0);M(document,"mouseover",ri);M(document,"mouseout",ri);M(document,"mousedown",ri);M(document,"keydown",ri);M(document,"keyup",ri);M(document,"keypress",ri);M(document,"cut",ri);M(document,"paste",ri);pi&&(M(document,"touchstart",ri),M(document,"touchend",ri),M(document,"touchcancel",ri));function si(){this.o={};this.B=[];this.k=[]}function ti(a,b){return"yt-uix"+(a.lc?"-"+a.lc:"")+(b?"-"+b:"")}si.prototype.init=t;si.prototype.dispose=t;function ui(a,b,c){a.B.push(I(b,c,a))}function vi(a,b,c){var d=ti(a,void 0),e=v(c,a);b in oi||(oi[b]=new E);oi[b].subscribe(d,e);a.o[c]=e}function wi(a,b){kb(a,"tooltip-text",b)}si.prototype.removeData=function(a,b){a&&(a.dataset?delete a.dataset[lb(b)]:a.removeAttribute("data-"+b))};function xi(){si.call(this);this.j={}}y(xi,si);ca(xi);g=xi.prototype;g.lc="tooltip";g.Ib=0;g.register=function(){vi(this,"mouseover",this.$c);vi(this,"mouseout",this.Hb);vi(this,"click",this.Hb);vi(this,"touchstart",this.Ie);vi(this,"touchend",this.cd);vi(this,"touchcancel",this.cd)};g.dispose=function(){for(var a in this.j)this.Hb(this.j[a]);this.j={}};
g.$c=function(a){if(!(this.Ib&&1E3>w()-this.Ib)){var b=parseInt(C(a,"tooltip-hide-timer"),10);b&&(this.removeData(a,"tooltip-hide-timer"),H(b));var b=v(function(){yi(this,a);this.removeData(a,"tooltip-show-timer")},this),c=parseInt(C(a,"tooltip-show-delay"),10)||0,b=G(b,c);kb(a,"tooltip-show-timer",b.toString());a.title&&(wi(a,zi(a)),a.title="");b=ja(a).toString();this.j[b]=a}};
g.Hb=function(a){var b=parseInt(C(a,"tooltip-show-timer"),10);b&&(H(b),this.removeData(a,"tooltip-show-timer"));b=v(function(){if(a){var b=rc(Ai(this,a));b&&(Bi(b),b&&b.parentNode&&b.parentNode.removeChild(b),this.removeData(a,"content-id"))}this.removeData(a,"tooltip-hide-timer")},this);b=G(b,50);kb(a,"tooltip-hide-timer",b.toString());if(b=C(a,"tooltip-text"))a.title=b;b=ja(a).toString();delete this.j[b]};g.Ie=function(a,b){this.Ib=0;var c=qi(b,ti(this),null[0].target);this.$c(c)};
g.cd=function(a,b){this.Ib=w();var c=qi(b,ti(this),null[0].target);this.Hb(c)};function Ci(a,b){wi(a,b);var c=C(a,"content-id");if(c=rc(c))c.innerHTML=b}function zi(a){return C(a,"tooltip-text")||a.title}
function yi(a,b){if(b){var c=zi(b);if(c){var d=rc(Ai(a,b));if(!d){d=document.createElement("div");d.id=Ai(a,b);d.className=ti(a,"tip");var e=document.createElement("div");e.className=ti(a,"tip-body");var f=document.createElement("div");f.className=ti(a,"tip-arrow");var h=document.createElement("div");h.className=ti(a,"tip-content");var k=Di(a,b),m=Ai(a,b,"content");h.id=m;kb(b,"content-id",m);e.appendChild(h);k&&d.appendChild(k);d.appendChild(e);d.appendChild(f);(Ec()||document.body).appendChild(d);
Ci(b,c);(c=parseInt(C(b,"tooltip-max-width"),10))&&e.offsetWidth>c&&(e.style.width=c+"px",Wb(h,ti(a,"normal-wrap")));h=Vb(b,ti(a,"reverse"));Ei(a,b,d,e,k,h)||Ei(a,b,d,e,k,!h);var n=ti(a,"tip-visible");G(function(){Wb(d,n)},0)}}}}
function Ei(a,b,c,d,e,f){Yb(c,ti(a,"tip-reverse"),f);var h=0;f&&(h=1);a=Ke(b);f=new Zb((a.width-10)/2,f?a.height:0);var k=qc(b);He(b,"position");var m=new Zb(0,0),n;n=k?qc(k):document;var x;(x=!L||lc(9))||(x=oc(n),x=vc(x.j));b!=(x?n.documentElement:n.body)&&(n=Ie(b),x=oc(k).j,k=!ec&&vc(x)?x.documentElement:x.body||x.documentElement,x=x.parentWindow||x.defaultView,k=L&&kc("10")&&x.pageYOffset!=k.scrollTop?new Zb(k.scrollLeft,k.scrollTop):new Zb(x.pageXOffset||k.scrollLeft,x.pageYOffset||k.scrollTop),
m.x=n.left+k.x,m.y=n.top+k.y);f=new Zb(m.x+f.x,m.y+f.y);f=f.clone();m=(h&4&&"rtl"==He(c,"direction")?h^2:h)&-5;h=Ke(c);n=h.clone();k=f.clone();n=n.clone();0!=m&&(m&2&&(k.x-=n.width+0),m&1&&(k.y-=n.height+0));f=new Fe(0,0,0,0);f.left=k.x;f.top=k.y;f.width=n.width;f.height=n.height;n=new Zb(f.left,f.top);n instanceof Zb?(m=n.x,n=n.y):(m=n,n=void 0);c.style.left=Je(m,!1);c.style.top=Je(n,!1);n=new $b(f.width,f.height);if(!(h==n||h&&n&&h.width==n.width&&h.height==n.height))if(h=n,f=qc(c),f=oc(f),m=vc(f.j),
!L||kc("10")||m&&kc("8"))f=c.style,dc?f.MozBoxSizing="border-box":ec?f.WebkitBoxSizing="border-box":f.boxSizing="border-box",f.width=Math.max(h.width,0)+"px",f.height=Math.max(h.height,0)+"px";else if(f=c.style,m){L?(m=Ne(c,"paddingLeft"),n=Ne(c,"paddingRight"),k=Ne(c,"paddingTop"),x=Ne(c,"paddingBottom"),m=new Ee(k,n,x,m)):(m=Ge(c,"paddingLeft"),n=Ge(c,"paddingRight"),k=Ge(c,"paddingTop"),x=Ge(c,"paddingBottom"),m=new Ee(parseFloat(k),parseFloat(n),parseFloat(x),parseFloat(m)));if(L&&!lc(9)){n=Pe(c,
"borderLeft");k=Pe(c,"borderRight");x=Pe(c,"borderTop");var aa=Pe(c,"borderBottom");n=new Ee(x,k,aa,n)}else n=Ge(c,"borderLeftWidth"),k=Ge(c,"borderRightWidth"),x=Ge(c,"borderTopWidth"),aa=Ge(c,"borderBottomWidth"),n=new Ee(parseFloat(x),parseFloat(k),parseFloat(aa),parseFloat(n));f.pixelWidth=h.width-n.left-m.left-m.right-n.right;f.pixelHeight=h.height-n.top-m.top-m.bottom-n.bottom}else f.pixelWidth=h.width,f.pixelHeight=h.height;h=window.document;h=vc(h)?h.documentElement:h.body;h=new $b(h.clientWidth,
h.clientHeight);1==c.nodeType?(c=Ie(c),n=new Zb(c.left,c.top)):(f=ha(c.le),m=c,c.targetTouches&&c.targetTouches.length?m=c.targetTouches[0]:f&&c.j.targetTouches&&c.j.targetTouches.length&&(m=c.j.targetTouches[0]),n=new Zb(m.clientX,m.clientY));c=Ke(d);k=Math.floor(c.width/2);f=!!(h.height<n.y+a.height);a=!!(n.y<a.height);m=!!(n.x<k);h=!!(h.width<n.x+k);n=(c.width+3)/-2- -5;b=C(b,"force-tooltip-direction");if("left"==b||m)n=-5;else if("right"==b||h)n=20-c.width-3;b=Math.floor(n)+"px";d.style.left=
b;e&&(e.style.left=b,e.style.height=c.height+"px",e.style.width=c.width+"px");return!(f||a)}function Ai(a,b,c){a=ti(a);var d=b.__yt_uid_key;d||(d=Cc(),b.__yt_uid_key=d);b=a+d;c&&(b+="-"+c);return b}function Di(a,b){var c=null;gc&&Vb(b,ti(a,"masked"))&&((c=rc("yt-uix-tooltip-shared-mask"))?(c.parentNode.removeChild(c),Re(c)):(c=document.createElement("iframe"),c.src='javascript:""',c.id="yt-uix-tooltip-shared-mask",c.className=ti(a,"tip-mask")));return c}
function Bi(a){var b=rc("yt-uix-tooltip-shared-mask"),c=b&&Ac(b,function(b){return b==a},!1,2);b&&c&&(b.parentNode.removeChild(b),Se(b),document.body.appendChild(b))};function Fi(){si.call(this)}y(Fi,si);ca(Fi);Fi.prototype.lc="subscription-button";Fi.prototype.register=function(){vi(this,"click",this.Rc);this.k.push(Hh(Xh,this.Tc,this));this.k.push(Hh(Yh,this.Sc,this));this.k.push(Hh(ai,this.Tc,this));this.k.push(Hh(bi,this.Sc,this));ui(this,"subscription-subscribe-success",this.re);ui(this,"subscription-unsubscribe-success",this.se);ui(this,"subscription-enable-ypc",this.qe);ui(this,"subscription-disable-ypc",this.pe)};
var zc={ad:"hover-enabled",Be:"yt-uix-button-subscribe",Ce:"yt-uix-button-subscribed",ff:"ypc-enabled",Oe:"yt-uix-button-subscription-container",Pe:"yt-subscription-button-disabled-mask-container"},Gi={gf:"channel-external-id",De:"subscriber-count-show-when-subscribed",Ee:"subscriber-count-tooltip",Fe:"subscriber-count-title",hf:"href",fd:"is-subscribed",kf:"parent-url",mf:"sessionlink",Ge:"style-type",gd:"subscription-id",pf:"target",Qe:"ypc-enabled"};g=Fi.prototype;
g.Rc=function(a){var b=C(a,"href"),c=ni();if(b)a=C(a,"target")||"_self",window.open(b,a);else if(c){var b=C(a,"channel-external-id"),c=C(a,"sessionlink"),d;if(C(a,"ypc-enabled")){d=C(a,"ypc-item-type");var e=C(a,"ypc-item-id");d={itemType:d,itemId:e,subscriptionElement:a}}else d=null;e=C(a,"parent-url");if(C(a,"is-subscribed")){var f=C(a,"subscription-id");U($h,new Ph(b,f,d,a,c,e))}else U(Wh,new Oh(b,d,a,c,e))}else Hi(this,a)};g.Tc=function(a){this.bb(a.j,this.Nc,!0)};
g.Sc=function(a){this.bb(a.j,this.Nc,!1)};g.re=function(a,b){this.bb(a,this.ed,!0,b)};g.se=function(a){this.bb(a,this.ed,!1)};g.qe=function(a){this.bb(a,this.Ke)};g.pe=function(a){this.bb(a,this.Je)};g.ed=function(a,b,c){b?(kb(a,Gi.fd,"true"),c&&kb(a,Gi.gd,c)):(this.removeData(a,Gi.fd),this.removeData(a,Gi.gd));Ii(a)};g.Nc=function(a,b){var c;c=yc(a);Yb(c,zc.Pe,b);a.setAttribute("aria-busy",b?"true":"false");a.disabled=b};
function Ii(a){var b=C(a,Gi.Ge),c=!!C(a,"is-subscribed"),b="-"+b,d=zc.Ce+b;Yb(a,zc.Be+b,!c);Yb(a,d,c);C(a,Gi.Ee)&&!C(a,Gi.De)&&(b=ti(xi.getInstance()),Yb(a,b,!c),a.title=c?"":C(a,Gi.Fe));c?G(function(){Wb(a,zc.ad)},1E3):Xb(a,zc.ad)}g.Ke=function(a){var b=!!C(a,"ypc-item-type"),c=!!C(a,"ypc-item-id");!C(a,"ypc-enabled")&&b&&c&&(Wb(a,"ypc-enabled"),kb(a,Gi.Qe,"true"))};g.Je=function(a){C(a,"ypc-enabled")&&(Xb(a,"ypc-enabled"),this.removeData(a,"ypc-enabled"))};
function Ji(a,b){var c=tc(ti(a));return Ca(c,function(a){return b==C(a,"channel-external-id")},a)}g.Re=function(a,b,c){var d=Ra(arguments,2);A(a,function(a){b.apply(this,Na(a,d))},this)};g.bb=function(a,b,c){var d=Ji(this,a),d=Na([d],Ra(arguments,1));this.Re.apply(this,d)};function Hi(a,b){var c=v(function(a){a.discoverable_subscriptions&&sb("SUBSCRIBE_EMBED_DISCOVERABLE_SUBSCRIPTIONS",a.discoverable_subscriptions);this.Rc(b)},a);di(c,"subscribe","sub_button")};var Ki=window.yt&&window.yt.uix&&window.yt.uix.widgets_||{};q("yt.uix.widgets_",Ki,void 0);function Li(a){return(0==a.search("cue")||0==a.search("load"))&&"loadModule"!=a}function Mi(a,b,c){u(a)&&(a={mediaContentUrl:a,startSeconds:b,suggestedQuality:c});b=a;c=/\/([ve]|embed)\/([^#?]+)/.exec(a.mediaContentUrl);b.videoId=c&&c[2]?c[2]:null;return Ni(a)}
function Ni(a,b,c){if(ia(a)){b="endSeconds startSeconds mediaContentUrl suggestedQuality videoId two_stage_token".split(" ");c={};for(var d=0;d<b.length;d++){var e=b[d];a[e]&&(c[e]=a[e])}return c}return{videoId:a,startSeconds:b,suggestedQuality:c}}
function Oi(a,b,c,d){if(ia(a)&&!ea(a)){b="playlist list listType index startSeconds suggestedQuality".split(" ");c={};for(d=0;d<b.length;d++){var e=b[d];a[e]&&(c[e]=a[e])}return c}c={index:b,startSeconds:c,suggestedQuality:d};u(a)&&16==a.length?c.list="PL"+a:c.playlist=a;return c}
function Pi(a){var b=a.video_id||a.videoId;if(u(b)){var c=R("yt-player-two-stage-token")||{},d=R("yt-player-two-stage-token")||{};p(void 0)?d[b]=void 0:delete d[b];Q("yt-player-two-stage-token",d,300);(b=c[b])&&(a.two_stage_token=b)}};var Qi=w(),Ri=null,Si=Array(50),Ti=-1,Ui=!1;function Vi(a){Wi();Ri.push(a);Xi(Ri)}function Yi(a){var b=r("yt.mdx.remote.debug.handlers_");La(b||[],a)}function Zi(a,b){Wi();var c=Ri,d=$i(a,String(b));0==c.length?aj(d):(Xi(c),A(c,function(a){a(d)}))}function Wi(){Ri||(Ri=r("yt.mdx.remote.debug.handlers_")||[],q("yt.mdx.remote.debug.handlers_",Ri,void 0))}function aj(a){var b=(Ti+1)%50;Ti=b;Si[b]=a;Ui||(Ui=49==b)}
function Xi(a){var b=Si;if(b[0]){var c=Ti,d=Ui?c:-1;do{var d=(d+1)%50,e=b[d];A(a,function(a){a(e)})}while(d!=c);Si=Array(50);Ti=-1;Ui=!1}}function $i(a,b){var c=(w()-Qi)/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("")};function bj(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||""}function cj(a,b){return!!b&&(a.id==b||a.uuid==b)}function dj(a,b){return a||b?!a!=!b?!1:a.id==b.id:!0}function ej(a,b){return a||b?!a!=!b?!1:a.id==b.id&&a.token==b.token&&a.name==b.name&&a.uuid==b.uuid:!0}function fj(a){return{name:a.name,screenId:a.id,loungeToken:a.token,dialId:a.uuid}}function gj(a){return new bj(a)}
function hj(a){return ea(a)?B(a,gj):[]}function ij(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"}function jj(a){return ea(a)?"["+B(a,ij).join(",")+"]":"null"};var kj=["boadgeojelhgndaghljhdicfkmllpafd","dliochdbjfkdbacpmhlcpmleaejidimm","hfaagokkkhdbgiakmmlclaapfelnkoah","fmfcbgogabcbclcofgocippekhfcmgfj","enhhojjnijigcajfphajepfemndkmdlo"];function lj(a,b){a==kj.length?b(null):mj(kj[a],function(c){c?(c=kj[a],Q("yt-remote-cast-last-extension",c),b(c)):lj(a+1,b)})}function nj(a){return"chrome-extension://"+a+"/cast_sender.js"}
function mj(a,b){var c=new XMLHttpRequest;c.onreadystatechange=function(){4==c.readyState&&200==c.status&&b(!0)};c.onerror=function(){b(!1)};try{c.open("GET",nj(a),!0),c.send()}catch(d){b(!1)}}
function oj(a){window.__onGCastApiAvailable=a;pj(function(b){if(b){Zi("bootstrap","Found cast extension: "+b);q("chrome.cast.extensionId",b,void 0);var c=document.createElement("script");c.src=nj(b);c.onerror=function(){qj();Pg("yt-remote-cast-last-extension");a(!1,"Extension JS failed to load.")};(document.head||document.documentElement).appendChild(c)}else Zi("bootstrap","No cast extension found"),a(!1,"No cast extension found")})}
function qj(){window.__onGCastApiAvailable&&delete window.__onGCastApiAvailable}function pj(a){var b=R("yt-remote-cast-last-extension");b?a(b):lj(0,a)};var rj={of:"ska",lf:"que",jf:"mus",nf:"sus"};function sj(a){this.port=this.o="";this.j="/api/lounge";this.k=!0;a=a||document.location.href;var b=Number(Vc(a)[4]||null)||null||"";b&&(this.port=":"+b);this.o=Xc(a)||"";a=K;0<=a.search("MSIE")&&(a=a.match(/MSIE ([\d.]+)/)[1],0>xa(a,"10.0")&&(this.k=!1))}function tj(a,b,c,d){var e=a.j;if(p(d)?d:a.k)e="https://"+a.o+a.port+a.j;return dd(e+b,c||{})}
sj.prototype.sendRequest=function(a,b,c,d,e,f,h){a={format:f?"RAW":"JSON",method:a,context:this,timeout:5E3,withCredentials:!!h,da:oa(this.A,d,!f),onError:oa(this.B,e),ub:oa(this.C,e)};c&&(a.V=c,a.headers={"Content-Type":"application/x-www-form-urlencoded"});return ji(b,a)};sj.prototype.A=function(a,b,c,d){b?a(d):a({text:c.responseText})};sj.prototype.B=function(a,b){a(Error("Request error: "+b.status))};sj.prototype.C=function(a){a(Error("request timed out"))};function uj(a){a&&(this.id=a.id||"",this.name=a.name||"",this.activityId=a.activityId||"",this.status=a.status||"UNKNOWN")}uj.prototype.id="";uj.prototype.name="";uj.prototype.activityId="";uj.prototype.status="UNKNOWN";function vj(a){return{id:a.id,name:a.name,activityId:a.activityId,status:a.status}}uj.prototype.toString=function(){return"{id:"+this.id+",name:"+this.name+",activityId:"+this.activityId+",status:"+this.status+"}"};
function wj(a){a=a||[];return"["+B(a,function(a){return a?a.toString():"null"}).join(",")+"]"};function xj(){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)})}function yj(a,b){return Fa(a,function(a){return a.key==b})}function zj(a){return B(a,function(a){return{key:a.id,name:a.name}})}function Aj(a){return B(a,function(a){return vj(a)})}function Bj(a){return B(a,function(a){return new uj(a)})}function Cj(a,b){return a||b?a&&b?a.id==b.id&&a.name==b.name:!1:!0}
function Dj(a,b){return Fa(a,function(a){return a.id==b})}function Ej(a,b){return Fa(a,function(a){return dj(a,b)})}function Fj(a,b){return Fa(a,function(a){return cj(a,b)})};function Gj(a){Gj[" "](a);return a}Gj[" "]=t;function V(){D.call(this);this.B=new E;nb(this,oa(ob,this.B))}y(V,D);V.prototype.subscribe=function(a,b,c){return this.K()?0:this.B.subscribe(a,b,c)};V.prototype.unsubscribe=function(a,b,c){return this.K()?!1:this.B.unsubscribe(a,b,c)};V.prototype.pa=function(a){return this.K()?!1:this.B.pa(a)};V.prototype.publish=function(a,b){return this.K()?!1:this.B.publish.apply(this.B,arguments)};function Hj(a){V.call(this);this.F=a;this.screens=[]}y(Hj,V);g=Hj.prototype;g.ea=function(){return this.screens};g.contains=function(a){return!!Ej(this.screens,a)};g.get=function(a){return a?Fj(this.screens,a):null};function Ij(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.screens.push(b);return!0}
function Jj(a,b){var c=a.screens.length!=b.length;a.screens=Ca(a.screens,function(a){return!!Ej(b,a)});for(var d=0,e=b.length;d<e;d++)c=Ij(a,b[d])||c;return c}function Kj(a,b){var c=a.screens.length;a.screens=Ca(a.screens,function(a){return!dj(a,b)});return a.screens.length<c}g.info=function(a){Zi(this.F,a)};g.warn=function(a){Zi(this.F,a)};function Lj(a,b,c,d){V.call(this);this.M=a;this.F=b;this.A=c;this.C=d;this.o=0;this.j=null;this.k=NaN}y(Lj,V);var Mj=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g=Lj.prototype;g.start=function(){!this.j&&isNaN(this.k)&&this.tc()};g.stop=function(){this.j&&(this.j.abort(),this.j=null);isNaN(this.k)||(H(this.k),this.k=NaN)};g.G=function(){this.stop();Lj.L.G.call(this)};
g.tc=function(){this.k=NaN;this.j=ji(tj(this.M,"/pairing/get_screen"),{method:"POST",V:{pairing_code:this.F},timeout:5E3,da:v(this.Id,this),onError:v(this.Hd,this),ub:v(this.Jd,this)})};g.Id=function(a,b){this.j=null;var c=b.screen||{};c.dialId=this.A;c.name=this.C;this.publish("pairingComplete",new bj(c))};
g.Hd=function(a){this.j=null;a.status&&404==a.status?this.o>=Mj.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(a=Mj[this.o],this.k=G(v(this.tc,this),a),this.o++):this.publish("pairingFailed",Error("Server error "+a.status))};g.Jd=function(){this.j=null;this.publish("pairingFailed",Error("Server not responding"))};function Nj(a){a&&(this.id=a.id||a.name,this.name=a.name,this.app=a.app,this.type=a.type||"REMOTE_CONTROL",this.avatar=a.userAvatarUri||"",this.theme=a.theme||"u",this.capabilities=new yd(Ca((a.capabilities||"").split(","),oa(Ya,rj))))}Nj.prototype.id="";Nj.prototype.name="";g=Nj.prototype;g.app="";g.type="REMOTE_CONTROL";g.avatar="";g.theme="u";g.equals=function(a){return a?this.id==a.id:!1};var Oj;function Pj(){var a=Qj(),b=Rj();Ha(a,b);if(Sj()){var c=a,d;d=0;for(var e=c.length,f;d<e;){var h=d+e>>1,k;k=Ua(b,c[h]);0<k?d=h+1:(e=h,f=!k)}d=f?d:~d;0>d&&Qa(c,-(d+1),0,b)}a=Tj(a);if(0==a.length)try{a="remote_sid",Nc.remove(""+a,"/","youtube.com")}catch(m){}else try{Oc("remote_sid",a.join(","))}catch(n){}}function Qj(){var a=R("yt-remote-connected-devices")||[];a.sort(Ua);return a}
function Tj(a){if(0==a.length)return[];var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return B(a,function(a,b){return 0==b?a:a.substring(c.length)})}function Uj(a){Q("yt-remote-connected-devices",a,86400)}function Rj(){if(Vj)return Vj;var a=R("yt-remote-device-id");a||(a=xj(),Q("yt-remote-device-id",a,31536E3));for(var b=Qj(),c=1,d=a;Ha(b,d);)c++,d=a+"#"+c;return Vj=d}function Wj(){return R("yt-remote-session-browser-channel")}function Sj(){return R("yt-remote-session-screen-id")}
function Xj(a){5<a.length&&(a=a.slice(a.length-5));var b=B(Yj(),function(a){return a.loungeToken}),c=B(a,function(a){return a.loungeToken});Ea(c,function(a){return!Ha(b,a)})&&Zj();Q("yt-remote-local-screens",a,31536E3)}function Yj(){return R("yt-remote-local-screens")||[]}function Zj(){Q("yt-remote-lounge-token-expiration",!0,86400)}function ak(){return!R("yt-remote-lounge-token-expiration")}function bk(a){Q("yt-remote-online-screens",a,60)}function ck(){return R("yt-remote-online-screens")||[]}
function dk(a){Q("yt-remote-online-dial-devices",a,30)}function ek(){return R("yt-remote-online-dial-devices")||[]}function fk(a,b){Q("yt-remote-session-browser-channel",a);Q("yt-remote-session-screen-id",b);var c=Qj(),d=Rj();Ha(c,d)||c.push(d);Uj(c);Pj()}function gk(a){a||(Pg("yt-remote-session-screen-id"),Pg("yt-remote-session-video-id"));Pj();a=Qj();La(a,Rj());Uj(a)}
function hk(){if(!Oj){var a;a=new tg;(a=a.isAvailable()?a:null)&&(Oj=new Dg(a))}return Oj?!!Oj.get("yt-remote-use-staging-server"):!1}var Vj="";function ik(a){Hj.call(this,"LocalScreenService");this.k=a;this.j=NaN;jk(this);this.info("Initializing with "+jj(this.screens))}y(ik,Hj);g=ik.prototype;g.start=function(){jk(this)&&this.publish("screenChange");ak()&&kk(this);H(this.j);this.j=G(v(this.start,this),1E4)};g.add=function(a,b){jk(this);Ij(this,a);lk(this,!1);this.publish("screenChange");b(a);a.token||kk(this)};g.remove=function(a,b){var c=jk(this);Kj(this,a)&&(lk(this,!1),c=!0);b(a);c&&this.publish("screenChange")};
g.Kb=function(a,b,c,d){var e=jk(this),f=this.get(a.id);f?(f.name!=b&&(f.name=b,lk(this,!1),e=!0),c(a)):d(Error("no such local screen."));e&&this.publish("screenChange")};g.G=function(){H(this.j);ik.L.G.call(this)};function kk(a){if(a.screens.length){var b=B(a.screens,function(a){return a.id}),c=tj(a.k,"/pairing/get_lounge_token_batch");a.k.sendRequest("POST",c,{screen_ids:b.join(",")},v(a.ue,a),v(a.te,a))}}
g.ue=function(a){jk(this);var b=this.screens.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)}lk(this,!b);b&&this.warn("Missed "+b+" lounge tokens.")};g.te=function(a){this.warn("Requesting lounge tokens failed: "+a)};function jk(a){var b=hj(Yj()),b=Ca(b,function(a){return!a.uuid});return Jj(a,b)}function lk(a,b){Xj(B(a.screens,fj));b&&Zj()};function mk(a,b){V.call(this);this.C=b;for(var c=R("yt-remote-online-screen-ids")||"",c=c?c.split(","):[],d={},e=this.C(),f=0,h=e.length;f<h;++f){var k=e[f].id;d[k]=Ha(c,k)}this.j=d;this.F=a;this.o=this.A=NaN;this.k=null;nk("Initialized with "+P(this.j))}y(mk,V);g=mk.prototype;g.start=function(){var a=parseInt(R("yt-remote-fast-check-period")||"0",10);(this.A=w()-144E5<a?0:a)?ok(this):(this.A=w()+3E5,Q("yt-remote-fast-check-period",this.A),this.gc())};g.isEmpty=function(){return db(this.j)};
g.update=function(){nk("Updating availability on schedule.");var a=this.C(),b=Wa(this.j,function(b,d){return b&&!!Fj(a,d)},this);pk(this,b)};function qk(a,b,c){var d=tj(a.F,"/pairing/get_screen_availability");a.F.sendRequest("POST",d,{lounge_token:b.token},v(function(a){a=a.screens||[];for(var d=0,h=a.length;d<h;++d)if(a[d].loungeToken==b.token){c("online"==a[d].status);return}c(!1)},a),v(function(){c(!1)},a))}g.G=function(){H(this.o);this.o=NaN;this.k&&(this.k.abort(),this.k=null);mk.L.G.call(this)};
function pk(a,b){var c;t:if(Xa(b)!=Xa(a.j))c=!1;else{c=ab(b);for(var d=0,e=c.length;d<e;++d)if(!a.j[c[d]]){c=!1;break t}c=!0}c||(nk("Updated online screens: "+P(a.j)),a.j=b,a.publish("screenChange"));rk(a)}function ok(a){isNaN(a.o)||H(a.o);a.o=G(v(a.gc,a),0<a.A&&a.A<w()?2E4:1E4)}
g.gc=function(){H(this.o);this.o=NaN;this.k&&this.k.abort();var a=sk(this);if(Xa(a)){var b=tj(this.F,"/pairing/get_screen_availability"),c={lounge_token:ab(a).join(",")};this.k=this.F.sendRequest("POST",b,c,v(this.oe,this,a),v(this.ne,this))}else pk(this,{}),ok(this)};
g.oe=function(a,b){this.k=null;var c=ab(sk(this));if(Sa(c,ab(a))){for(var c=b.screens||[],d={},e=0,f=c.length;e<f;++e)d[a[c[e].loungeToken]]="online"==c[e].status;pk(this,d);ok(this)}else this.S("Changing Screen set during request."),this.gc()};g.ne=function(a){this.S("Screen availability failed: "+a);this.k=null;ok(this)};function nk(a){Zi("OnlineScreenService",a)}g.S=function(a){Zi("OnlineScreenService",a)};
function sk(a){var b={};A(a.C(),function(a){a.token?b[a.token]=a.id:this.S("Requesting availability of screen w/o lounge token.")});return b}function rk(a){var b=ab(Wa(a.j,function(a){return a}));b.sort(Ua);b.length?Q("yt-remote-online-screen-ids",b.join(","),60):Pg("yt-remote-online-screen-ids");a=Ca(a.C(),function(a){return!!this.j[a.id]},a);bk(B(a,fj))};function W(a){Hj.call(this,"ScreenService");this.C=a;this.j=this.k=null;this.o=[];this.A={};tk(this)}y(W,Hj);g=W.prototype;g.start=function(){this.k.start();this.j.start();this.screens.length&&(this.publish("screenChange"),this.j.isEmpty()||this.publish("onlineScreenChange"))};g.add=function(a,b,c){this.k.add(a,b,c)};g.remove=function(a,b,c){this.k.remove(a,b,c);this.j.update()};
g.Kb=function(a,b,c,d){this.k.contains(a)?this.k.Kb(a,b,c,d):(a="Updating name of unknown screen: "+a.name,this.warn(a),d(Error(a)))};g.ea=function(a){return a?this.screens:Na(this.screens,Ca(this.o,function(a){return!this.contains(a)},this))};g.Ac=function(){return Ca(this.ea(!0),function(a){return!!this.j.j[a.id]},this)};
function uk(a,b,c,d,e,f){a.info("getAutomaticScreenByIds "+c+" / "+b);c||(c=a.A[b]);var h=a.ea();if(h=(c?Fj(h,c):null)||Fj(h,b)){h.uuid=b;var k=vk(a,h);qk(a.j,k,function(a){e(a?k:null)})}else c?wk(a,c,v(function(a){var f=vk(this,new bj({name:d,screenId:c,loungeToken:a,dialId:b||""}));qk(this.j,f,function(a){e(a?f:null)})},a),f):e(null)}
g.zc=function(a,b,c,d,e){this.info("getDialScreenByPairingCode "+a+" / "+b);var f=new Lj(this.C,a,b,c);f.subscribe("pairingComplete",v(function(a){ob(f);d(vk(this,a))},this));f.subscribe("pairingFailed",function(a){ob(f);e(a)});f.start();return v(f.stop,f)};function xk(a,b){for(var c=0,d=a.screens.length;c<d;++c)if(a.screens[c].name==b)return a.screens[c];return null}g.Yc=function(a,b){for(var c=2,d=b(a,c);xk(this,d);){c++;if(20<c)return a;d=b(a,c)}return d};
g.We=function(a,b,c,d){ji(tj(this.C,"/pairing/get_screen"),{method:"POST",V:{pairing_code:a},timeout:5E3,da:v(function(a,d){var h=new bj(d.screen||{});if(!h.name||xk(this,h.name))h.name=this.Yc(h.name,b);c(vk(this,h))},this),onError:v(function(a){d(Error("pairing request failed: "+a.status))},this),ub:v(function(){d(Error("pairing request timed out."))},this)})};g.G=function(){ob(this.k);ob(this.j);W.L.G.call(this)};
function wk(a,b,c,d){a.info("requestLoungeToken_ for "+b);var e={V:{screen_ids:b},method:"POST",context:a,da:function(a,e){var k=e&&e.screens||[];k[0]&&k[0].screenId==b?c(k[0].loungeToken):d(Error("Missing lounge token in token response"))},onError:function(){d(Error("Request screen lounge token failed"))}};ji(tj(a.C,"/pairing/get_lounge_token_batch"),e)}
function yk(a){a.screens=a.k.ea();var b=a.A,c={},d;for(d in b)c[b[d]]=d;b=0;for(d=a.screens.length;b<d;++b){var e=a.screens[b];e.uuid=c[e.id]||""}a.info("Updated manual screens: "+jj(a.screens))}g.ud=function(){yk(this);this.publish("screenChange");this.j.update()};
function tk(a){zk(a);a.k=new ik(a.C);a.k.subscribe("screenChange",v(a.ud,a));yk(a);a.o=hj(R("yt-remote-automatic-screen-cache")||[]);zk(a);a.info("Initializing automatic screens: "+jj(a.o));a.j=new mk(a.C,v(a.ea,a,!0));a.j.subscribe("screenChange",v(function(){this.publish("onlineScreenChange")},a))}
function vk(a,b){var c=a.get(b.id);c?(c.uuid=b.uuid,b=c):((c=Fj(a.o,b.uuid))?(c.id=b.id,c.token=b.token,b=c):a.o.push(b),Q("yt-remote-automatic-screen-cache",B(a.o,fj)));zk(a);a.A[b.uuid]=b.id;Q("yt-remote-device-id-map",a.A,31536E3);return b}function zk(a){a.A=R("yt-remote-device-id-map")||{}}W.prototype.dispose=W.prototype.dispose;function Ak(a,b,c){V.call(this);this.ca=c;this.U=a;this.k=b;this.o=null}y(Ak,V);function Bk(a,b){a.o=b;a.publish("sessionScreen",a.o)}g=Ak.prototype;g.aa=function(a){this.K()||(a&&this.warn(""+a),this.o=null,this.publish("sessionScreen",null))};g.info=function(a){Zi(this.ca,a)};g.warn=function(a){Zi(this.ca,a)};g.Oc=function(){return null};
g.Tb=function(a){var b=this.k;a?(b.displayStatus=new chrome.cast.ReceiverDisplayStatus(a,[]),b.displayStatus.showStop=!0):b.displayStatus=null;chrome.cast.setReceiverDisplayStatus(b,v(function(){this.info("Updated receiver status for "+b.friendlyName+": "+a)},this),v(function(){this.warn("Failed to update receiver status for: "+b.friendlyName)},this))};g.G=function(){this.Tb("");Ak.L.G.call(this)};function Ck(a,b){Ak.call(this,a,b,"CastSession");this.j=null;this.C=0;this.A=null;this.M=v(this.Od,this);this.F=v(this.Nd,this);this.C=G(v(function(){Dk(this,null)},this),12E4)}y(Ck,Ak);g=Ck.prototype;
g.Xb=function(a){if(this.j){if(this.j==a)return;this.warn("Overriding cast sesison with new session object");this.j.removeUpdateListener(this.M);this.j.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.F)}this.j=a;this.j.addUpdateListener(this.M);this.j.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.F);this.A&&Ek(this);Fk(this,"getMdxSessionStatus")};g.Xa=function(a){this.info("launchWithParams: "+P(a));this.A=a;this.j&&Ek(this)};
g.stop=function(){this.j?this.j.stop(v(function(){this.aa()},this),v(function(){this.aa(Error("Failed to stop receiver app."))},this)):this.aa(Error("Stopping cast device witout session."))};g.Tb=t;g.G=function(){this.info("disposeInternal");H(this.C);this.C=0;this.j&&(this.j.removeUpdateListener(this.M),this.j.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.F));this.j=null;Ck.L.G.call(this)};
function Ek(a){var b=a.A.videoId||a.A.videoIds[a.A.index];b&&Fk(a,"flingVideo",{videoId:b,currentTime:a.A.currentTime||0});a.A=null}function Fk(a,b,c){a.info("sendYoutubeMessage_: "+b+" "+P(c));var d={};d.type=b;c&&(d.data=c);a.j?a.j.sendMessage("urn:x-cast:com.google.youtube.mdx",d,t,v(function(){this.warn("Failed to send message: "+b+".")},a)):a.warn("Sending yt message without session: "+P(d))}
g.Nd=function(a,b){if(!this.K())if(b){var c=wg(b);if(c){var d=""+c.type,c=c.data||{};this.info("onYoutubeMessage_: "+d+" "+P(c));switch(d){case "mdxSessionStatus":Dk(this,c.screenId);break;default:this.warn("Unknown youtube message: "+d)}}else this.warn("Unable to parse message.")}else this.warn("No data in message.")};
function Dk(a,b){H(a.C);b?(a.info("onConnectedScreenId_: Received screenId: "+b),a.o&&a.o.id==b||uk(a.U,a.k.label,b,a.k.friendlyName,v(function(a){a?Bk(this,a):this.aa(Error("Unable to fetch screen."))},a),v(a.aa,a))):a.aa(Error("Waiting for session status timed out."))}g.Oc=function(){return this.j};g.Od=function(a){this.K()||a||(this.warn("Cast session died."),this.aa())};function Gk(a,b){Ak.call(this,a,b,"DialSession");this.C=this.O=null;this.X="";this.A=null;this.M=t;this.F=NaN;this.Z=v(this.Kd,this);this.j=t}y(Gk,Ak);g=Gk.prototype;g.Xb=function(a){this.C=a;this.C.addUpdateListener(this.Z)};g.Xa=function(a){this.A=a;this.M()};g.stop=function(){this.j();this.j=t;H(this.F);this.C?this.C.stop(v(this.aa,this,null),v(this.aa,this,"Failed to stop DIAL device.")):this.aa()};
g.G=function(){this.j();this.j=t;H(this.F);this.C&&this.C.removeUpdateListener(this.Z);this.C=null;Gk.L.G.call(this)};function Hk(a){a.j=a.U.zc(a.X,a.k.label,a.k.friendlyName,v(function(a){this.j=t;Bk(this,a)},a),v(function(a){this.j=t;this.aa(a)},a))}g.Kd=function(a){this.K()||a||(this.warn("DIAL session died."),this.j(),this.j=t,this.aa())};
function Ik(a){var b={};b.pairingCode=a.X;if(a.A){var c=a.A.index||0,d=a.A.currentTime||0;b.v=a.A.videoId||a.A.videoIds[c];b.t=d}hk()&&(b.env_useStageMdx=1);return bd(b)}g.Ub=function(a){this.X=xj();if(this.A){var b=new chrome.cast.DialLaunchResponse(!0,Ik(this));a(b);Hk(this)}else this.M=v(function(){H(this.F);this.M=t;this.F=NaN;var b=new chrome.cast.DialLaunchResponse(!0,Ik(this));a(b);Hk(this)},this),this.F=G(v(function(){this.M()},this),100)};
g.yd=function(a,b){uk(this.U,this.O.receiver.label,a,this.k.friendlyName,v(function(a){a&&a.token?(Bk(this,a),b(new chrome.cast.DialLaunchResponse(!1))):this.Ub(b)},this),v(function(a){this.warn("Failed to get DIAL screen: "+a);this.Ub(b)},this))};function Jk(a,b){Ak.call(this,a,b,"ManualSession");this.j=G(v(this.Xa,this,null),150)}y(Jk,Ak);Jk.prototype.stop=function(){this.aa()};Jk.prototype.Xb=t;Jk.prototype.Xa=function(){H(this.j);this.j=NaN;var a=Fj(this.U.ea(),this.k.label);a?Bk(this,a):this.aa(Error("No such screen"))};Jk.prototype.G=function(){H(this.j);this.j=NaN;Jk.L.G.call(this)};function Kk(a){V.call(this);this.k=a;this.j=null;this.C=!1;this.o=[];this.A=v(this.rd,this)}y(Kk,V);g=Kk.prototype;
g.init=function(a,b){chrome.cast.timeout.requestSession=3E4;var c=new chrome.cast.SessionRequest("233637DE");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,c=new chrome.cast.ApiConfig(c,v(this.Fc,this),v(this.fe,this),d,e);c.customDialLaunchCallback=v(this.ee,this);chrome.cast.initialize(c,v(function(){this.K()||(chrome.cast.addReceiverActionListener(this.A),
Vi(Lk),this.k.subscribe("onlineScreenChange",v(this.oc,this)),this.o=Mk(this),chrome.cast.setCustomReceivers(this.o,t,v(function(a){this.S("Failed to set initial custom receivers: "+P(a))},this)),this.publish("yt-remote-cast2-availability-change",Nk(this)),b(!0))},this),function(a){this.S("Failed to initialize API: "+P(a));b(!1)})};
g.Ue=function(a,b){Ok("Setting connected screen ID: "+a+" -> "+b);if(this.j){var c=this.j.o;if(!a||c&&c.id!=a)Ok("Unsetting old screen status: "+this.j.k.friendlyName),ob(this.j),this.j=null}if(a&&b){if(!this.j){c=Fj(this.k.ea(),a);if(!c){Ok("setConnectedScreenStatus: Unknown screen.");return}var d=Pk(this,c);d||(Ok("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.o.push(d),chrome.cast.setCustomReceivers(this.o,
t,v(function(a){this.S("Failed to set initial custom receivers: "+P(a))},this)));Ok("setConnectedScreenStatus: new active receiver: "+d.friendlyName);Qk(this,new Jk(this.k,d),!0)}this.j.Tb(b)}else Ok("setConnectedScreenStatus: no screen.")};function Pk(a,b){return b?Fa(a.o,function(a){return cj(b,a.label)},a):null}g.Ve=function(a){this.K()?this.S("Setting connection data on disposed cast v2"):this.j?this.j.Xa(a):this.S("Setting connection data without a session")};
g.stopSession=function(){this.K()?this.S("Stopping session on disposed cast v2"):this.j?(this.j.stop(),ob(this.j),this.j=null):Ok("Stopping non-existing session")};g.requestSession=function(){chrome.cast.requestSession(v(this.Fc,this),v(this.Ne,this))};g.G=function(){this.k.unsubscribe("onlineScreenChange",v(this.oc,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.A);Yi(Lk);ob(this.j);Kk.L.G.call(this)};function Ok(a){Zi("Controller",a)}
g.S=function(a){Zi("Controller",a)};function Lk(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)}function Nk(a){return a.C||!!a.o.length||!!a.j}function Qk(a,b,c){ob(a.j);(a.j=b)?(c?a.publish("yt-remote-cast2-receiver-resumed",b.k):a.publish("yt-remote-cast2-receiver-selected",b.k),b.subscribe("sessionScreen",v(a.sc,a,b)),b.o?a.publish("yt-remote-cast2-session-change",b.o):c&&a.j.Xa(null)):a.publish("yt-remote-cast2-session-change",null)}
g.sc=function(a,b){this.j==a&&(b||Qk(this,null),this.publish("yt-remote-cast2-session-change",b))};
g.rd=function(a,b){if(!this.K())if(a)switch(Ok("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+b),b){case chrome.cast.ReceiverAction.CAST:if(this.j)if(this.j.k.label!=a.label)Ok("onReceiverAction_: Stopping active receiver: "+this.j.k.friendlyName),this.j.stop();else{Ok("onReceiverAction_: Casting to active receiver.");this.j.o&&this.publish("yt-remote-cast2-session-change",this.j.o);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:Qk(this,new Jk(this.k,a));break;case chrome.cast.ReceiverType.DIAL:Qk(this,
new Gk(this.k,a));break;case chrome.cast.ReceiverType.CAST:Qk(this,new Ck(this.k,a));break;default:this.S("Unknown receiver type: "+a.receiverType);return}break;case chrome.cast.ReceiverAction.STOP:this.j&&this.j.k.label==a.label?this.j.stop():this.S("Stopping receiver w/o session: "+a.friendlyName)}else this.S("onReceiverAction_ called without receiver.")};
g.ee=function(a){if(this.K())return Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.S("Not DIAL receiver: "+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.j?this.j.k:null;if(!c||c.label!=b.label)return this.S("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.j.o)return Ok("Reselecting dial screen."),
this.publish("yt-remote-cast2-session-change",this.j.o),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.S('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+b.friendlyName);Qk(this,new Gk(this.k,b))}b=this.j;b.O=a;return b.O.appState==chrome.cast.DialAppState.RUNNING?new Promise(v(b.yd,b,(b.O.extraData||{}).screenId||null)):new Promise(v(b.Ub,b))};
g.Fc=function(a){if(!this.K()){Ok("New cast session ID: "+a.sessionId);var b=a.receiver;if(b.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.j)if(b.receiverType==chrome.cast.ReceiverType.CAST)Ok("Got resumed cast session before resumed mdx connection."),Qk(this,new Ck(this.k,b),!0);else{this.S("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var c=this.j.k,d=Fj(this.k.ea(),c.label);d&&cj(d,b.label)&&c.receiverType!=chrome.cast.ReceiverType.CAST&&b.receiverType==
chrome.cast.ReceiverType.CAST&&(Ok("onSessionEstablished_: manual to cast session change "+b.friendlyName),ob(this.j),this.j=new Ck(this.k,b),this.j.subscribe("sessionScreen",v(this.sc,this,this.j)),this.j.Xa(null));this.j.Xb(a)}}};g.Xe=function(){return this.j?this.j.Oc():null};g.Ne=function(a){this.K()||(this.S("Failed to estabilish a session: "+P(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&Qk(this,null))};
g.fe=function(a){Ok("Receiver availability updated: "+a);if(!this.K()){var b=Nk(this);this.C=a==chrome.cast.ReceiverAvailability.AVAILABLE;Nk(this)!=b&&this.publish("yt-remote-cast2-availability-change",Nk(this))}};
function Mk(a){var b=a.k.Ac(),c=a.j&&a.j.k;a=B(b,function(a){c&&cj(a,c.label)&&(c=null);var b=a.uuid?a.uuid:a.id,f=Pk(this,a);f?(f.label=b,f.friendlyName=a.name):(f=new chrome.cast.Receiver(b,a.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}
g.oc=function(){if(!this.K()){var a=Nk(this);this.o=Mk(this);Ok("Updating custom receivers: "+P(this.o));chrome.cast.setCustomReceivers(this.o,t,v(function(){this.S("Failed to set custom receivers.")},this));var b=Nk(this);b!=a&&this.publish("yt-remote-cast2-availability-change",b)}};Kk.prototype.setLaunchParams=Kk.prototype.Ve;Kk.prototype.setConnectedScreenStatus=Kk.prototype.Ue;Kk.prototype.stopSession=Kk.prototype.stopSession;Kk.prototype.getCastSession=Kk.prototype.Xe;
Kk.prototype.requestSession=Kk.prototype.requestSession;Kk.prototype.init=Kk.prototype.init;Kk.prototype.dispose=Kk.prototype.dispose;function Rk(a,b){xe?Tk(a)&&(Uk(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?Vk(b):oj(function(a,d){a?Vk(b):(Wk("Failed to load cast API: "+d),Xk(!1),Uk(!1),Pg("yt-remote-cast-available"),Pg("yt-remote-cast-receiver"),Yk(),b(!1))})):Sk("Cannot initialize because not running Chrome")}function Yk(){Sk("dispose");qj();var a=Zk();a&&a.dispose();$k=null;q("yt.mdx.remote.cloudview.instance_",null,void 0);al(!1);Fb(bl);bl.length=0}function cl(){return!!R("yt-remote-cast-installed")}
function dl(){var a=R("yt-remote-cast-receiver");return a?a.friendlyName:null}function el(){Sk("clearCurrentReciever");Pg("yt-remote-cast-receiver")}function fl(){cl()?Zk()?gl()?(Sk("Requesting cast selector."),$k.requestSession()):(Sk("Wait for cast API to be ready to request the session."),bl.push(I("yt-remote-cast2-api-ready",fl))):Wk("requestCastSelector: Cast is not initialized."):Wk("requestCastSelector: Cast API is not installed!")}
function hl(a){gl()?Zk().setLaunchParams(a):Wk("setLaunchParams called before ready.")}function il(a,b){gl()?Zk().setConnectedScreenStatus(a,b):Wk("setConnectedScreenStatus called before ready.")}var $k=null;function jl(a){$k.init(!0,a)}
function Tk(a){var b=!1;if(!$k){var c=r("yt.mdx.remote.cloudview.instance_");c||(c=new Kk(a),c.subscribe("yt-remote-cast2-availability-change",function(a){Q("yt-remote-cast-available",a);J("yt-remote-cast2-availability-change",a)}),c.subscribe("yt-remote-cast2-receiver-selected",function(a){Sk("onReceiverSelected: "+a.friendlyName);Q("yt-remote-cast-receiver",a);J("yt-remote-cast2-receiver-selected",a)}),c.subscribe("yt-remote-cast2-receiver-resumed",function(a){Sk("onReceiverResumed: "+a.friendlyName);
Q("yt-remote-cast-receiver",a)}),c.subscribe("yt-remote-cast2-session-change",function(a){Sk("onSessionChange: "+ij(a));a||Pg("yt-remote-cast-receiver");J("yt-remote-cast2-session-change",a)}),q("yt.mdx.remote.cloudview.instance_",c,void 0),b=!0);$k=c}Sk("cloudview.createSingleton_: "+b);return b}function Zk(){$k||($k=r("yt.mdx.remote.cloudview.instance_"));return $k}
function Vk(a){Xk(!0);Uk(!1);jl(function(b){b?(al(!0),J("yt-remote-cast2-api-ready")):(Wk("Failed to initialize cast API."),Xk(!1),Pg("yt-remote-cast-available"),Pg("yt-remote-cast-receiver"),Yk());a(b)})}function Sk(a){Zi("cloudview",a)}function Wk(a){Zi("cloudview",a)}function Xk(a){Sk("setCastInstalled_ "+a);Q("yt-remote-cast-installed",a)}function gl(){return!!r("yt.mdx.remote.cloudview.apiReady_")}function al(a){Sk("setApiReady_ "+a);q("yt.mdx.remote.cloudview.apiReady_",a,void 0)}
function Uk(a){q("yt.mdx.remote.cloudview.initializing_",a,void 0)}var bl=[];function kl(){if(!("cast"in window))return!1;var a=window.cast||{};return"ActivityStatus"in a&&"Api"in a&&"LaunchRequest"in a&&"Receiver"in a}function ll(a){Zi("CAST",a)}function ml(a){var b=nl();b&&b.logMessage&&b.logMessage(a)}function ol(a){if(a.source==window&&a.data&&"CastApi"==a.data.source&&"Hello"==a.data.event)for(;pl.length;)pl.shift()()}
function ql(){if(!r("yt.mdx.remote.castv2_")&&!rl&&(0==Ja.length&&Pa(Ja,ek()),kl())){var a=nl();a?(a.removeReceiverListener("YouTube",sl),a.addReceiverListener("YouTube",sl),ll("API initialized in the other binary")):(a=new cast.Api,tl(a),a.addReceiverListener("YouTube",sl),a.setReloadTabRequestHandler&&a.setReloadTabRequestHandler(function(){G(function(){window.location.reload(!0)},1E3)}),Vi(ml),ll("API initialized"));rl=!0}}
function ul(){var a=nl();a&&(ll("API disposed"),Yi(ml),a.setReloadTabRequestHandler&&a.setReloadTabRequestHandler(t),a.removeReceiverListener("YouTube",sl),tl(null));rl=!1;pl=null;(a=Ic(window,"message",ol,!1))&&Jc(a)}function vl(a){var b=Ga(Ja,function(b){return b.id==a.id});0<=b&&(Ja[b]=vj(a))}
function sl(a){a.length&&ll("Updating receivers: "+P(a));wl(a);J("yt-remote-cast-device-list-update");A(xl(),function(a){yl(a.id)});A(a,function(a){if(a.isTabProjected){var c=zl(a.id);ll("Detected device: "+c.id+" is tab projected. Firing DEVICE_TAB_PROJECTED event.");G(function(){J("yt-remote-cast-device-tab-projected",c.id)},1E3)}})}
function Al(a,b){ll("Updating "+a+" activity status: "+P(b));var c=zl(a);c?(b.activityId&&(c.activityId=b.activityId),c.status="running"==b.status?"RUNNING":"stopped"==b.status?"STOPPED":"error"==b.status?"ERROR":"UNKNOWN","RUNNING"!=c.status&&(c.activityId=""),vl(c),J("yt-remote-cast-device-status-update",c)):ll("Device not found")}function xl(){ql();return Bj(Ja)}
function wl(a){a=B(a,function(a){var c=a.id,d;d=a.name;d=wa(d,"&")?"document"in l?ta(d):va(d):d;c={id:c,name:d};if(a=zl(a.id))c.activityId=a.activityId,c.status=a.status;return c});Ia();Pa(Ja,a)}function zl(a){var b=xl();return Fa(b,function(b){return b.id==a})||null}function yl(a){var b=zl(a),c=nl();c&&b&&b.activityId&&c.getActivityStatus(b.activityId,function(b){"error"==b.status&&(b.status="stopped");Al(a,b)})}
function Bl(a){ql();var b=zl(a),c=nl();c&&b&&b.activityId?(ll("Stopping cast activity"),c.stopActivity(b.activityId,oa(Al,a))):ll("Dropping cast activity stop")}function nl(){return r("yt.mdx.remote.castapi.api_")}function tl(a){q("yt.mdx.remote.castapi.api_",a,void 0)}var rl=!1,pl=null,Ja=r("yt.mdx.remote.castapi.devices_")||[];q("yt.mdx.remote.castapi.devices_",Ja,void 0);function Cl(a,b){this.action=a;this.params=b||null};function Dl(){this.j=w()}new Dl;Dl.prototype.set=function(a){this.j=a};Dl.prototype.get=function(){return this.j};function El(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=!1;this.Gc=!0}El.prototype.dispose=function(){};El.prototype.preventDefault=function(){this.defaultPrevented=!0;this.Gc=!1};var Fl=!L||lc(9),Gl=L&&!kc("9");!ec||kc("528");dc&&kc("1.9b")||L&&kc("8")||cc&&kc("9.5")||ec&&kc("528");dc&&!kc("8")||L&&kc("9");function Hl(a,b){El.call(this,a?a.type:"");this.relatedTarget=this.currentTarget=this.target=null;this.charCode=this.keyCode=this.button=this.clientY=this.clientX=this.fc=this.ec=0;this.shiftKey=this.altKey=this.ctrlKey=!1;this.j=this.state=null;a&&this.init(a,b)}y(Hl,El);g=Hl.prototype;
g.init=function(a,b){this.j=a;var c=this.type=a.type;this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d){if(dc){var e;t:{try{Gj(d.nodeName);e=!0;break t}catch(f){}e=!1}e||(d=null)}}else"mouseover"==c?d=a.fromElement:"mouseout"==c&&(d=a.toElement);this.relatedTarget=d;Object.defineProperties?Object.defineProperties(this,{ec:{configurable:!0,enumerable:!0,get:this.Hc,set:this.ge},fc:{configurable:!0,enumerable:!0,get:this.Ic,set:this.he}}):(this.ec=this.Hc(),this.fc=
this.Ic());this.clientX=void 0!==a.clientX?a.clientX:a.pageX;this.clientY=void 0!==a.clientY?a.clientY:a.pageY;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.state=a.state;a.defaultPrevented&&this.preventDefault()};
g.preventDefault=function(){Hl.L.preventDefault.call(this);var a=this.j;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,Gl)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};g.le=function(){return this.j};g.Hc=function(){return ec||void 0!==this.j.offsetX?this.j.offsetX:this.j.layerX};g.ge=function(a){Object.defineProperties(this,{ec:{writable:!0,enumerable:!0,configurable:!0,value:a}})};g.Ic=function(){return ec||void 0!==this.j.offsetY?this.j.offsetY:this.j.layerY};
g.he=function(a){Object.defineProperties(this,{fc:{writable:!0,enumerable:!0,configurable:!0,value:a}})};var Il="closure_listenable_"+(1E6*Math.random()|0),Jl=0;function Kl(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.Cb=!!d;this.Gb=e;this.key=++Jl;this.removed=this.Eb=!1}function Ll(a){a.removed=!0;a.listener=null;a.proxy=null;a.src=null;a.Gb=null};function Ml(a){this.src=a;this.j={};this.k=0}Ml.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.j[f];a||(a=this.j[f]=[],this.k++);var h=Nl(a,b,d,e);-1<h?(b=a[h],c||(b.Eb=!1)):(b=new Kl(b,this.src,f,!!d,e),b.Eb=c,a.push(b));return b};Ml.prototype.remove=function(a,b,c,d){a=a.toString();if(!(a in this.j))return!1;var e=this.j[a];b=Nl(e,b,c,d);return-1<b?(Ll(e[b]),z.splice.call(e,b,1),0==e.length&&(delete this.j[a],this.k--),!0):!1};
function Ol(a,b){var c=b.type;if(!(c in a.j))return!1;var d=La(a.j[c],b);d&&(Ll(b),0==a.j[c].length&&(delete a.j[c],a.k--));return d}Ml.prototype.removeAll=function(a){a=a&&a.toString();var b=0,c;for(c in this.j)if(!a||c==a){for(var d=this.j[c],e=0;e<d.length;e++)++b,Ll(d[e]);delete this.j[c];this.k--}return b};function Pl(a,b,c,d,e){a=a.j[b.toString()];b=-1;a&&(b=Nl(a,c,d,e));return-1<b?a[b]:null}
function Nl(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.removed&&f.listener==b&&f.Cb==!!c&&f.Gb==d)return e}return-1};var Ql="closure_lm_"+(1E6*Math.random()|0),Rl={},Sl=0;function Tl(a,b,c,d,e){if(ea(b)){for(var f=0;f<b.length;f++)Tl(a,b[f],c,d,e);return null}c=Ul(c);if(a&&a[Il])a=a.listen(b,c,d,e);else{if(!b)throw Error("Invalid event type");var f=!!d,h=Vl(a);h||(a[Ql]=h=new Ml(a));c=h.add(b,c,!1,d,e);c.proxy||(d=Wl(),c.proxy=d,d.src=a,d.listener=c,a.addEventListener?a.addEventListener(b.toString(),d,f):a.attachEvent(Xl(b.toString()),d),Sl++);a=c}return a}
function Wl(){var a=Yl,b=Fl?function(c){return a.call(b.src,b.listener,c)}:function(c){c=a.call(b.src,b.listener,c);if(!c)return c};return b}function Zl(a,b,c,d,e){if(ea(b))for(var f=0;f<b.length;f++)Zl(a,b[f],c,d,e);else c=Ul(c),a&&a[Il]?a.Yb(b,c,d,e):a&&(a=Vl(a))&&(b=Pl(a,b,c,!!d,e))&&$l(b)}
function $l(a){if(ga(a)||!a||a.removed)return!1;var b=a.src;if(b&&b[Il])return Ol(b.Ea,a);var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.Cb):b.detachEvent&&b.detachEvent(Xl(c),d);Sl--;(c=Vl(b))?(Ol(c,a),0==c.k&&(c.src=null,b[Ql]=null)):Ll(a);return!0}function Xl(a){return a in Rl?Rl[a]:Rl[a]="on"+a}function am(a,b,c,d){var e=!0;if(a=Vl(a))if(b=a.j[b.toString()])for(b=b.concat(),a=0;a<b.length;a++){var f=b[a];f&&f.Cb==c&&!f.removed&&(f=bm(f,d),e=e&&!1!==f)}return e}
function bm(a,b){var c=a.listener,d=a.Gb||a.src;a.Eb&&$l(a);return c.call(d,b)}
function Yl(a,b){if(a.removed)return!0;if(!Fl){var c=b||r("window.event"),d=new Hl(c,this),e=!0;if(!(0>c.keyCode||void 0!=c.returnValue)){t:{var f=!1;if(0==c.keyCode)try{c.keyCode=-1;break t}catch(h){f=!0}if(f||void 0==c.returnValue)c.returnValue=!0}c=[];for(f=d.currentTarget;f;f=f.parentNode)c.push(f);for(var f=a.type,k=c.length-1;0<=k;k--){d.currentTarget=c[k];var m=am(c[k],f,!0,d),e=e&&m}for(k=0;k<c.length;k++)d.currentTarget=c[k],m=am(c[k],f,!1,d),e=e&&m}return e}return bm(a,new Hl(b,this))}
function Vl(a){a=a[Ql];return a instanceof Ml?a:null}var cm="__closure_events_fn_"+(1E9*Math.random()>>>0);function Ul(a){if(ha(a))return a;a[cm]||(a[cm]=function(b){return a.handleEvent(b)});return a[cm]};function dm(){D.call(this);this.Ea=new Ml(this);this.qb=this;this.ta=null}y(dm,D);dm.prototype[Il]=!0;g=dm.prototype;g.addEventListener=function(a,b,c,d){Tl(this,a,b,c,d)};g.removeEventListener=function(a,b,c,d){Zl(this,a,b,c,d)};
function em(a,b){var c,d=a.ta;if(d){c=[];for(var e=1;d;d=d.ta)c.push(d),++e}var d=a.qb,e=b,f=e.type||e;if(u(e))e=new El(e,d);else if(e instanceof El)e.target=e.target||d;else{var h=e,e=new El(f,d);ib(e,h)}var h=!0,k;if(c)for(var m=c.length-1;0<=m;m--)k=e.currentTarget=c[m],h=fm(k,f,!0,e)&&h;k=e.currentTarget=d;h=fm(k,f,!0,e)&&h;h=fm(k,f,!1,e)&&h;if(c)for(m=0;m<c.length;m++)k=e.currentTarget=c[m],h=fm(k,f,!1,e)&&h}g.G=function(){dm.L.G.call(this);this.removeAllListeners();this.ta=null};
g.listen=function(a,b,c,d){return this.Ea.add(String(a),b,!1,c,d)};g.Yb=function(a,b,c,d){return this.Ea.remove(String(a),b,c,d)};g.removeAllListeners=function(a){return this.Ea?this.Ea.removeAll(a):0};function fm(a,b,c,d){b=a.Ea.j[String(b)];if(!b)return!0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var h=b[f];if(h&&!h.removed&&h.Cb==c){var k=h.listener,m=h.Gb||h.src;h.Eb&&Ol(a.Ea,h);e=!1!==k.call(m,d)&&e}}return e&&0!=d.Gc};function gm(a,b){this.k=new yg(a);this.j=b?wg:vg}gm.prototype.stringify=function(a){return xg(this.k,a)};gm.prototype.parse=function(a){return this.j(a)};function hm(a,b){dm.call(this);this.j=a||1;this.k=b||l;this.o=v(this.xd,this);this.B=w()}y(hm,dm);g=hm.prototype;g.enabled=!1;g.ja=null;function im(a,b){a.j=b;a.ja&&a.enabled?(a.stop(),a.start()):a.ja&&a.stop()}g.xd=function(){if(this.enabled){var a=w()-this.B;0<a&&a<.8*this.j?this.ja=this.k.setTimeout(this.o,this.j-a):(this.ja&&(this.k.clearTimeout(this.ja),this.ja=null),em(this,"tick"),this.enabled&&(this.ja=this.k.setTimeout(this.o,this.j),this.B=w()))}};
g.start=function(){this.enabled=!0;this.ja||(this.ja=this.k.setTimeout(this.o,this.j),this.B=w())};g.stop=function(){this.enabled=!1;this.ja&&(this.k.clearTimeout(this.ja),this.ja=null)};g.G=function(){hm.L.G.call(this);this.stop();delete this.k};function jm(a,b,c){if(ha(a))c&&(a=v(a,c));else if(a&&"function"==typeof a.handleEvent)a=v(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<b?-1:l.setTimeout(a,b||0)};function km(a,b,c){D.call(this);this.B=a;this.o=b;this.k=c;this.j=v(this.wd,this)}y(km,D);g=km.prototype;g.Lb=!1;g.Wa=null;g.stop=function(){this.Wa&&(l.clearTimeout(this.Wa),this.Wa=null,this.Lb=!1)};g.G=function(){km.L.G.call(this);this.stop()};g.wd=function(){this.Wa=null;this.Lb&&(this.Lb=!1,lm(this))};function lm(a){a.Wa=jm(a.j,a.o);a.B.call(a.k)};function mm(a){D.call(this);this.k=a;this.j={}}y(mm,D);var nm=[];g=mm.prototype;g.listen=function(a,b,c,d){ea(b)||(b&&(nm[0]=b.toString()),b=nm);for(var e=0;e<b.length;e++){var f=Tl(a,b[e],c||this.handleEvent,d||!1,this.k||this);if(!f)break;this.j[f.key]=f}return this};
g.Yb=function(a,b,c,d,e){if(ea(b))for(var f=0;f<b.length;f++)this.Yb(a,b[f],c,d,e);else c=c||this.handleEvent,e=e||this.k||this,c=Ul(c),d=!!d,b=a&&a[Il]?Pl(a.Ea,String(b),c,d,e):a?(a=Vl(a))?Pl(a,b,c,d,e):null:null,b&&($l(b),delete this.j[b.key]);return this};g.removeAll=function(){Va(this.j,$l);this.j={}};g.G=function(){mm.L.G.call(this);this.removeAll()};g.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented");};function om(){}om.prototype.j=null;function pm(a){var b;(b=a.j)||(b={},qm(a)&&(b[0]=!0,b[1]=!0),b=a.j=b);return b};var rm;function sm(){}y(sm,om);function tm(a){return(a=qm(a))?new ActiveXObject(a):new XMLHttpRequest}function qm(a){if(!a.k&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.k=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.k}rm=new sm;function um(a,b,c,d,e){this.j=a;this.o=c;this.N=d;this.J=e||1;this.A=45E3;this.B=new mm(this);this.k=new hm;im(this.k,250)}g=um.prototype;g.Ia=null;g.oa=!1;g.ab=null;g.cc=null;g.gb=null;g.$a=null;g.Ba=null;g.Fa=null;g.Ja=null;g.T=null;g.mb=0;g.qa=null;g.Fb=null;g.La=null;g.eb=-1;g.yc=!0;g.Ma=!1;g.Sb=0;g.xb=null;var vm={},wm={};g=um.prototype;g.setTimeout=function(a){this.A=a};function xm(a,b,c){a.$a=1;a.Ba=Of(b.clone());a.Ja=c;a.C=!0;ym(a,null)}
function zm(a,b,c,d,e){a.$a=1;a.Ba=Of(b.clone());a.Ja=null;a.C=c;e&&(a.yc=!1);ym(a,d)}function ym(a,b){a.gb=w();Am(a);a.Fa=a.Ba.clone();Mf(a.Fa,"t",a.J);a.mb=0;a.T=a.j.$b(a.j.fb()?b:null);0<a.Sb&&(a.xb=new km(v(a.Bc,a,a.T),a.Sb));a.B.listen(a.T,"readystatechange",a.Ud);var c=a.Ia?fb(a.Ia):{};a.Ja?(a.Fb="POST",c["Content-Type"]="application/x-www-form-urlencoded",a.T.send(a.Fa,a.Fb,a.Ja,c)):(a.Fb="GET",a.yc&&!ec&&(c.Connection="close"),a.T.send(a.Fa,a.Fb,null,c));a.j.ma(1)}
g.Ud=function(a){a=a.target;var b=this.xb;b&&3==Bm(a)?b.Wa?b.Lb=!0:lm(b):this.Bc(a)};
g.Bc=function(a){try{if(a==this.T)t:{var b=Bm(this.T),c=this.T.B,d=this.T.getStatus();if(L&&!lc(10)||ec&&!kc("420+")){if(4>b)break t}else if(3>b||3==b&&!cc&&!Cm(this.T))break t;this.Ma||4!=b||7==c||(8==c||0>=d?this.j.ma(3):this.j.ma(2));Dm(this);var e=this.T.getStatus();this.eb=e;var f=Cm(this.T);(this.oa=200==e)?(4==b&&Em(this),this.C?(Fm(this,b,f),cc&&this.oa&&3==b&&(this.B.listen(this.k,"tick",this.vd),this.k.start())):Gm(this,f),this.oa&&!this.Ma&&(4==b?this.j.zb(this):(this.oa=!1,Am(this)))):
(this.La=400==e&&0<f.indexOf("Unknown SID")?3:0,X(),Em(this),Hm(this))}}catch(h){this.T&&Cm(this.T)}finally{}};function Fm(a,b,c){for(var d=!0;!a.Ma&&a.mb<c.length;){var e=Im(a,c);if(e==wm){4==b&&(a.La=4,X(),d=!1);break}else if(e==vm){a.La=4;X();d=!1;break}else Gm(a,e)}4==b&&0==c.length&&(a.La=1,X(),d=!1);a.oa=a.oa&&d;d||(Em(a),Hm(a))}g.vd=function(){var a=Bm(this.T),b=Cm(this.T);this.mb<b.length&&(Dm(this),Fm(this,a,b),this.oa&&4!=a&&Am(this))};
function Im(a,b){var c=a.mb,d=b.indexOf("\n",c);if(-1==d)return wm;c=Number(b.substring(c,d));if(isNaN(c))return vm;d+=1;if(d+c>b.length)return wm;var e=b.substr(d,c);a.mb=d+c;return e}
function Jm(a,b){a.gb=w();Am(a);var c=b?window.location.hostname:"";a.Fa=a.Ba.clone();N(a.Fa,"DOMAIN",c);N(a.Fa,"t",a.J);try{a.qa=new ActiveXObject("htmlfile")}catch(d){Em(a);a.La=7;X();Hm(a);return}var e="<html><body>";b&&(e+='<script>document.domain="'+c+'"\x3c/script>');e+="</body></html>";a.qa.open();a.qa.write(e);a.qa.close();a.qa.parentWindow.m=v(a.de,a);a.qa.parentWindow.d=v(a.Dc,a,!0);a.qa.parentWindow.rpcClose=v(a.Dc,a,!1);c=a.qa.createElement("div");a.qa.parentWindow.document.body.appendChild(c);
c.innerHTML='<iframe src="'+a.Fa+'"></iframe>';a.j.ma(1)}g.de=function(a){Km(v(this.Te,this,a),0)};g.Te=function(a){this.Ma||(Dm(this),Gm(this,a),Am(this))};g.Dc=function(a){Km(v(this.Se,this,a),0)};g.Se=function(a){this.Ma||(Em(this),this.oa=a,this.j.zb(this),this.j.ma(4))};g.cancel=function(){this.Ma=!0;Em(this)};function Am(a){a.cc=w()+a.A;Lm(a,a.A)}function Lm(a,b){if(null!=a.ab)throw Error("WatchDog timer not null");a.ab=Km(v(a.Le,a),b)}function Dm(a){a.ab&&(l.clearTimeout(a.ab),a.ab=null)}
g.Le=function(){this.ab=null;var a=w();0<=a-this.cc?(2!=this.$a&&this.j.ma(3),Em(this),this.La=2,X(),Hm(this)):Lm(this,this.cc-a)};function Hm(a){a.j.Kc()||a.Ma||a.j.zb(a)}function Em(a){Dm(a);ob(a.xb);a.xb=null;a.k.stop();a.B.removeAll();if(a.T){var b=a.T;a.T=null;Mm(b);b.dispose()}a.qa&&(a.qa=null)}function Gm(a,b){try{a.j.Mc(a,b),a.j.ma(4)}catch(c){}};function Nm(a,b,c,d,e){if(0==d)c(!1);else{var f=e||0;d--;Om(a,b,function(e){e?c(!0):l.setTimeout(function(){Nm(a,b,c,d,f)},f)})}}function Om(a,b,c){var d=new Image;d.onload=function(){try{Pm(d),c(!0)}catch(a){}};d.onerror=function(){try{Pm(d),c(!1)}catch(a){}};d.onabort=function(){try{Pm(d),c(!1)}catch(a){}};d.ontimeout=function(){try{Pm(d),c(!1)}catch(a){}};l.setTimeout(function(){if(d.ontimeout)d.ontimeout()},b);d.src=a}
function Pm(a){a.onload=null;a.onerror=null;a.onabort=null;a.ontimeout=null};function Qm(a){this.j=a;this.k=new gm(null,!0)}g=Qm.prototype;g.Rb=null;g.fa=null;g.Bb=!1;g.xc=null;g.Ab=null;g.Wb=null;g.bc=null;g.ka=null;g.xa=-1;g.kb=null;g.lb=null;g.connect=function(a){this.bc=a;a=Rm(this.j,null,this.bc);X();this.xc=w();var b=this.j.N;null!=b?(this.kb=b[0],(this.lb=b[1])?(this.ka=1,Sm(this)):(this.ka=2,Tm(this))):(Mf(a,"MODE","init"),this.fa=new um(this,0,void 0,void 0,void 0),this.fa.Ia=this.Rb,zm(this.fa,a,!1,null,!0),this.ka=0)};
function Sm(a){var b=Rm(a.j,a.lb,"/mail/images/cleardot.gif");Of(b);Nm(b.toString(),5E3,v(a.ie,a),3,2E3);a.ma(1)}g.ie=function(a){if(a)this.ka=2,Tm(this);else{X();var b=this.j;b.la=b.Ca.xa;Um(b,9)}a&&this.ma(2)};
function Tm(a){var b=a.j.F;if(null!=b)X(),b?(X(),Vm(a.j,a,!1)):(X(),Vm(a.j,a,!0));else if(a.fa=new um(a,0,void 0,void 0,void 0),a.fa.Ia=a.Rb,b=a.j,b=Rm(b,b.fb()?a.kb:null,a.bc),X(),!L||lc(10))Mf(b,"TYPE","xmlhttp"),zm(a.fa,b,!1,a.kb,!1);else{Mf(b,"TYPE","html");var c=a.fa;a=Boolean(a.kb);c.$a=3;c.Ba=Of(b.clone());Jm(c,a)}}g.$b=function(a){return this.j.$b(a)};g.Kc=function(){return!1};
g.Mc=function(a,b){this.xa=a.eb;if(0==this.ka)if(b){try{var c=this.k.parse(b)}catch(d){c=this.j;c.la=this.xa;Um(c,2);return}this.kb=c[0];this.lb=c[1]}else c=this.j,c.la=this.xa,Um(c,2);else if(2==this.ka)if(this.Bb)X(),this.Wb=w();else if("11111"==b){if(X(),this.Bb=!0,this.Ab=w(),c=this.Ab-this.xc,!L||lc(10)||500>c)this.xa=200,this.fa.cancel(),X(),Vm(this.j,this,!0)}else X(),this.Ab=this.Wb=w(),this.Bb=!1};
g.zb=function(){this.xa=this.fa.eb;if(this.fa.oa)0==this.ka?this.lb?(this.ka=1,Sm(this)):(this.ka=2,Tm(this)):2==this.ka&&(a=!1,(a=!L||lc(10)?this.Bb:200>this.Wb-this.Ab?!1:!0)?(X(),Vm(this.j,this,!0)):(X(),Vm(this.j,this,!1)));else{0==this.ka?X():2==this.ka&&X();var a=this.j;a.la=this.xa;Um(a,2)}};g.fb=function(){return this.j.fb()};g.isActive=function(){return this.j.isActive()};g.ma=function(a){this.j.ma(a)};function Wm(a){dm.call(this);this.headers=new pd;this.Z=a||null;this.k=!1;this.X=this.j=null;this.Aa=this.M="";this.B=0;this.A="";this.o=this.ua=this.F=this.ca=!1;this.C=0;this.O=null;this.Sa="";this.U=this.Ta=!1}y(Wm,dm);var Xm=/^https?$/i,Ym=["POST","PUT"];g=Wm.prototype;
g.send=function(a,b,c,d){if(this.j)throw Error("[goog.net.XhrIo] Object is active with another request="+this.M+"; newUri="+a);b=b?b.toUpperCase():"GET";this.M=a;this.A="";this.B=0;this.Aa=b;this.ca=!1;this.k=!0;this.j=this.Z?tm(this.Z):tm(rm);this.X=this.Z?pm(this.Z):pm(rm);this.j.onreadystatechange=v(this.mc,this);try{Bd(Zm(this,"Opening Xhr")),this.ua=!0,this.j.open(b,String(a),!0),this.ua=!1}catch(e){Bd(Zm(this,"Error opening Xhr: "+e.message));$m(this,e);return}a=c||"";var f=this.headers.clone();
d&&wd(d,function(a,b){f.set(b,a)});d=Fa(f.va(),an);c=l.FormData&&a instanceof l.FormData;!Ha(Ym,b)||d||c||f.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");f.forEach(function(a,b){this.j.setRequestHeader(b,a)},this);this.Sa&&(this.j.responseType=this.Sa);"withCredentials"in this.j&&(this.j.withCredentials=this.Ta);try{bn(this),0<this.C&&(this.U=cn(this.j),Bd(Zm(this,"Will abort after "+this.C+"ms if incomplete, xhr2 "+this.U)),this.U?(this.j.timeout=this.C,this.j.ontimeout=v(this.nc,
this)):this.O=jm(this.nc,this.C,this)),Bd(Zm(this,"Sending request")),this.F=!0,this.j.send(a),this.F=!1}catch(h){Bd(Zm(this,"Send error: "+h.message)),$m(this,h)}};function cn(a){return L&&kc(9)&&ga(a.timeout)&&p(a.ontimeout)}function an(a){return"content-type"==a.toLowerCase()}g.nc=function(){"undefined"!=typeof ba&&this.j&&(this.A="Timed out after "+this.C+"ms, aborting",this.B=8,Zm(this,this.A),em(this,"timeout"),Mm(this,8))};
function $m(a,b){a.k=!1;a.j&&(a.o=!0,a.j.abort(),a.o=!1);a.A=b;a.B=5;dn(a);en(a)}function dn(a){a.ca||(a.ca=!0,em(a,"complete"),em(a,"error"))}function Mm(a,b){a.j&&a.k&&(Zm(a,"Aborting"),a.k=!1,a.o=!0,a.j.abort(),a.o=!1,a.B=b||7,em(a,"complete"),em(a,"abort"),en(a))}g.G=function(){this.j&&(this.k&&(this.k=!1,this.o=!0,this.j.abort(),this.o=!1),en(this,!0));Wm.L.G.call(this)};g.mc=function(){this.K()||(this.ua||this.F||this.o?fn(this):this.ve())};g.ve=function(){fn(this)};
function fn(a){if(a.k&&"undefined"!=typeof ba)if(a.X[1]&&4==Bm(a)&&2==a.getStatus())Zm(a,"Local request error detected and ignored");else if(a.F&&4==Bm(a))jm(a.mc,0,a);else if(em(a,"readystatechange"),4==Bm(a)){Zm(a,"Request complete");a.k=!1;try{var b=a.getStatus(),c;t:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:c=!0;break t;default:c=!1}var d;if(!(d=c)){var e;if(e=0===b){var f=Vc(String(a.M))[1]||null;if(!f&&self.location)var h=self.location.protocol,f=h.substr(0,h.length-
1);e=!Xm.test(f?f.toLowerCase():"")}d=e}if(d)em(a,"complete"),em(a,"success");else{a.B=6;var k;try{k=2<Bm(a)?a.j.statusText:""}catch(m){k=""}a.A=k+" ["+a.getStatus()+"]";dn(a)}}finally{en(a)}}}function en(a,b){if(a.j){bn(a);var c=a.j,d=a.X[0]?t:null;a.j=null;a.X=null;b||em(a,"ready");try{c.onreadystatechange=d}catch(e){}}}function bn(a){a.j&&a.U&&(a.j.ontimeout=null);ga(a.O)&&(l.clearTimeout(a.O),a.O=null)}g.isActive=function(){return!!this.j};function Bm(a){return a.j?a.j.readyState:0}
g.getStatus=function(){try{return 2<Bm(this)?this.j.status:-1}catch(a){return-1}};function Cm(a){try{return a.j?a.j.responseText:""}catch(b){return""}}function Zm(a,b){return b+" ["+a.Aa+" "+a.M+" "+a.getStatus()+"]"};function gn(a,b,c){this.J=a||null;this.j=1;this.k=[];this.B=[];this.A=new gm(null,!0);this.N=b||null;this.F=null!=c?c:null}function hn(a,b){this.j=a;this.map=b;this.context=null}g=gn.prototype;g.pb=null;g.$=null;g.R=null;g.Ob=null;g.tb=null;g.qc=null;g.yb=null;g.ib=0;g.Md=0;g.W=null;g.Ga=null;g.wa=null;g.Na=null;g.Ca=null;g.wb=null;g.Ua=-1;g.wc=-1;g.la=-1;g.hb=0;g.Ya=0;g.Ka=8;var jn=new dm;function kn(a){El.call(this,"statevent",a)}y(kn,El);
function ln(a,b){El.call(this,"timingevent",a);this.size=b}y(ln,El);function mn(a){El.call(this,"serverreachability",a)}y(mn,El);g=gn.prototype;g.connect=function(a,b,c,d,e){X();this.Ob=b;this.pb=c||{};d&&p(e)&&(this.pb.OSID=d,this.pb.OAID=e);this.Ca=new Qm(this);this.Ca.Rb=null;this.Ca.k=this.A;this.Ca.connect(a)};
g.disconnect=function(){nn(this);if(3==this.j){var a=this.ib++,b=this.tb.clone();N(b,"SID",this.o);N(b,"RID",a);N(b,"TYPE","terminate");on(this,b);a=new um(this,0,this.o,a,void 0);a.$a=2;a.Ba=Of(b.clone());(new Image).src=a.Ba;a.gb=w();Am(a)}pn(this)};function nn(a){if(a.Ca){var b=a.Ca;b.fa&&(b.fa.cancel(),b.fa=null);b.xa=-1;a.Ca=null}a.R&&(a.R.cancel(),a.R=null);a.wa&&(l.clearTimeout(a.wa),a.wa=null);qn(a);a.$&&(a.$.cancel(),a.$=null);a.Ga&&(l.clearTimeout(a.Ga),a.Ga=null)}
function rn(a,b){if(0==a.j)throw Error("Invalid operation: sending map when state is closed");a.k.push(new hn(a.Md++,b));2!=a.j&&3!=a.j||sn(a)}g.Kc=function(){return 0==this.j};g.getState=function(){return this.j};function tn(a){var b=0;a.R&&b++;a.$&&b++;return b}function sn(a){a.$||a.Ga||(a.Ga=Km(v(a.Cc,a),0),a.hb=0)}g.Cc=function(a){this.Ga=null;un(this,a)};
function un(a,b){if(1==a.j){if(!b){a.ib=Math.floor(1E5*Math.random());var c=a.ib++,d=new um(a,0,"",c,void 0);d.Ia=null;var e=vn(a),f=a.tb.clone();N(f,"RID",c);a.J&&N(f,"CVER",a.J);on(a,f);xm(d,f,e);a.$=d;a.j=2}}else 3==a.j&&(b?wn(a,b):0!=a.k.length&&(a.$||wn(a)))}
function wn(a,b){var c,d;b?6<a.Ka?(a.k=a.B.concat(a.k),a.B.length=0,c=a.ib-1,d=vn(a)):(c=b.N,d=b.Ja):(c=a.ib++,d=vn(a));var e=a.tb.clone();N(e,"SID",a.o);N(e,"RID",c);N(e,"AID",a.Ua);on(a,e);c=new um(a,0,a.o,c,a.hb+1);c.Ia=null;c.setTimeout(Math.round(1E4)+Math.round(1E4*Math.random()));a.$=c;xm(c,e,d)}function on(a,b){if(a.W){var c=a.W.bd(a);c&&Va(c,function(a,c){N(b,c,a)})}}
function vn(a){var b=Math.min(a.k.length,1E3),c=["count="+b],d;6<a.Ka&&0<b?(d=a.k[0].j,c.push("ofs="+d)):d=0;for(var e=0;e<b;e++){var f=a.k[e].j,h=a.k[e].map,f=6>=a.Ka?e:f-d;try{wd(h,function(a,b){c.push("req"+f+"_"+b+"="+encodeURIComponent(a))})}catch(k){c.push("req"+f+"_type="+encodeURIComponent("_badmap"))}}a.B=a.B.concat(a.k.splice(0,b));return c.join("&")}function xn(a){a.R||a.wa||(a.C=1,a.wa=Km(v(a.Xc,a),0),a.Ya=0)}
function yn(a){if(a.R||a.wa||3<=a.Ya)return!1;a.C++;a.wa=Km(v(a.Xc,a),zn(a,a.Ya));a.Ya++;return!0}g.Xc=function(){this.wa=null;this.R=new um(this,0,this.o,"rpc",this.C);this.R.Ia=null;this.R.Sb=0;var a=this.qc.clone();N(a,"RID","rpc");N(a,"SID",this.o);N(a,"CI",this.wb?"0":"1");N(a,"AID",this.Ua);on(this,a);if(!L||lc(10))N(a,"TYPE","xmlhttp"),zm(this.R,a,!0,this.yb,!1);else{N(a,"TYPE","html");var b=this.R,c=Boolean(this.yb);b.$a=3;b.Ba=Of(a.clone());Jm(b,c)}};
function Vm(a,b,c){a.wb=c;a.la=b.xa;a.Ae(1,0);a.tb=Rm(a,null,a.Ob);sn(a)}
g.Mc=function(a,b){if(0!=this.j&&(this.R==a||this.$==a))if(this.la=a.eb,this.$==a&&3==this.j)if(7<this.Ka){var c;try{c=this.A.parse(b)}catch(d){c=null}if(ea(c)&&3==c.length)if(0==c[0])t:{if(!this.wa){if(this.R)if(this.R.gb+3E3<this.$.gb)qn(this),this.R.cancel(),this.R=null;else break t;yn(this);X()}}else this.wc=c[1],0<this.wc-this.Ua&&37500>c[2]&&this.wb&&0==this.Ya&&!this.Na&&(this.Na=Km(v(this.zd,this),6E3));else Um(this,11)}else"y2f%"!=b&&Um(this,11);else if(this.R==a&&qn(this),!/^[\s\xa0]*$/.test(b)){c=
this.A.parse(b);ea(c);for(var e=0;e<c.length;e++){var f=c[e];this.Ua=f[0];f=f[1];2==this.j?"c"==f[0]?(this.o=f[1],this.yb=f[2],f=f[3],null!=f?this.Ka=f:this.Ka=6,this.j=3,this.W&&this.W.vc(this),this.qc=Rm(this,this.fb()?this.yb:null,this.Ob),xn(this)):"stop"==f[0]&&Um(this,7):3==this.j&&("stop"==f[0]?Um(this,7):"noop"!=f[0]&&this.W&&this.W.uc(this,f),this.Ya=0)}}};g.zd=function(){null!=this.Na&&(this.Na=null,this.R.cancel(),this.R=null,yn(this),X())};
function qn(a){null!=a.Na&&(l.clearTimeout(a.Na),a.Na=null)}
g.zb=function(a){var b;if(this.R==a)qn(this),this.R=null,b=2;else if(this.$==a)this.$=null,b=1;else return;this.la=a.eb;if(0!=this.j)if(a.oa)1==b?(w(),em(jn,new ln(jn,a.Ja?a.Ja.length:0)),sn(this),this.B.length=0):xn(this);else{var c=a.La,d;if(!(d=3==c||7==c||0==c&&0<this.la)){if(d=1==b)this.$||this.Ga||1==this.j||2<=this.hb?d=!1:(this.Ga=Km(v(this.Cc,this,a),zn(this,this.hb)),this.hb++,d=!0);d=!(d||2==b&&yn(this))}if(d)switch(c){case 1:Um(this,5);break;case 4:Um(this,10);break;case 3:Um(this,6);
break;case 7:Um(this,12);break;default:Um(this,2)}}};function zn(a,b){var c=5E3+Math.floor(1E4*Math.random());a.isActive()||(c*=2);return c*b}g.Ae=function(a){if(!Ha(arguments,this.j))throw Error("Unexpected channel state: "+this.j);};function Um(a,b){if(2==b||9==b){var c=null;a.W&&(c=null);var d=v(a.He,a);c||(c=new yf("//www.google.com/images/cleardot.gif"),Of(c));Om(c.toString(),1E4,d)}else X();An(a,b)}g.He=function(a){a?X():(X(),An(this,8))};
function An(a,b){a.j=0;a.W&&a.W.Jc(a,b);pn(a);nn(a)}function pn(a){a.j=0;a.la=-1;if(a.W)if(0==a.B.length&&0==a.k.length)a.W.Vb(a);else{var b=Oa(a.B),c=Oa(a.k);a.B.length=0;a.k.length=0;a.W.Vb(a,b,c)}}function Rm(a,b,c){var d=Pf(c);if(""!=d.ya)b&&Af(d,b+"."+d.ya),Bf(d,d.Oa);else var e=window.location,d=Qf(e.protocol,b?b+"."+e.hostname:e.hostname,e.port,c);a.pb&&Va(a.pb,function(a,b){N(d,b,a)});N(d,"VER",a.Ka);on(a,d);return d}
g.$b=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new Wm;a.Ta=!1;return a};g.isActive=function(){return!!this.W&&this.W.isActive(this)};function Km(a,b){if(!ha(a))throw Error("Fn must not be null and must be a function");return l.setTimeout(function(){a()},b)}g.ma=function(){em(jn,new mn(jn))};function X(){em(jn,new kn(jn))}g.fb=function(){return!(!L||lc(10))};function Bn(){}g=Bn.prototype;g.vc=function(){};g.uc=function(){};g.Jc=function(){};g.Vb=function(){};
g.bd=function(){return{}};g.isActive=function(){return!0};function Cn(a,b){hm.call(this);if(ha(a))b&&(a=v(a,b));else if(a&&ha(a.handleEvent))a=v(a.handleEvent,a);else throw Error("Invalid listener argument");this.F=a;Tl(this,"tick",v(this.C,this));this.stop();im(this,5E3+2E4*Math.random())}y(Cn,hm);Cn.prototype.A=0;Cn.prototype.C=function(){if(500<this.j){var a=this.j;24E4>2*a&&(a*=2);im(this,a)}this.F()};Cn.prototype.start=function(){Cn.L.start.call(this);this.A=w()+this.j};Cn.prototype.stop=function(){this.A=0;Cn.L.stop.call(this)};function Dn(a,b){this.O=a;this.B=b;this.o=new E;this.k=new Cn(this.pd,this);this.j=null;this.M=!1;this.C=null;this.F="";this.N=this.A=0;this.J=[]}y(Dn,Bn);g=Dn.prototype;g.subscribe=function(a,b,c){return this.o.subscribe(a,b,c)};g.unsubscribe=function(a,b,c){return this.o.unsubscribe(a,b,c)};g.pa=function(a){return this.o.pa(a)};g.publish=function(a,b){return this.o.publish.apply(this.o,arguments)};g.dispose=function(){this.M||(this.M=!0,this.o.clear(),this.disconnect(),ob(this.o))};g.K=function(){return this.M};
function En(a){return{firstTestResults:[""],secondTestResults:!a.j.wb,sessionId:a.j.o,arrayId:a.j.Ua}}
g.connect=function(a,b,c){if(!this.j||2!=this.j.getState()){this.F="";this.k.stop();this.C=a||null;this.A=b||0;a=this.O+"/test";b=this.O+"/bind";var d=new gn("1",c?c.firstTestResults:null,c?c.secondTestResults:null),e=this.j;e&&(e.W=null);d.W=this;this.j=d;e?(3!=e.getState()&&0==tn(e)||e.getState(),this.j.connect(a,b,this.B,e.o,e.Ua)):c?this.j.connect(a,b,this.B,c.sessionId,c.arrayId):this.j.connect(a,b,this.B)}};
g.disconnect=function(a){this.N=a||0;this.k.stop();this.j&&(3==this.j.getState()&&un(this.j),this.j.disconnect());this.N=0};g.sendMessage=function(a,b){var c={_sc:a};b&&ib(c,b);this.k.enabled||2==(this.j?this.j.getState():0)?this.J.push(c):this.j&&3==this.j.getState()&&rn(this.j,c)};g.vc=function(){var a=this.k;a.stop();im(a,5E3+2E4*Math.random());this.C=null;this.A=0;if(this.J.length){a=this.J;this.J=[];for(var b=0,c=a.length;b<c;++b)rn(this.j,a[b])}this.publish("handlerOpened")};
g.Jc=function(a,b){var c=2==b&&401==this.j.la;if(4!=b&&!c){if(6==b||410==this.j.la)c=this.k,c.stop(),im(c,500);this.k.start()}this.publish("handlerError",b)};g.Vb=function(a,b,c){if(!this.k.enabled)this.publish("handlerClosed");else if(c)for(a=0,b=c.length;a<b;++a)this.J.push(c[a].map)};g.bd=function(){var a={v:2};this.F&&(a.gsessionid=this.F);0!=this.A&&(a.ui=""+this.A);0!=this.N&&(a.ui=""+this.N);this.C&&ib(a,this.C);return a};
g.uc=function(a,b){if("S"==b[0])this.F=b[1];else if("gracefulReconnect"==b[0]){var c=this.k;c.stop();im(c,500);this.k.start();this.j.disconnect()}else this.publish("handlerMessage",new Cl(b[0],b[1]))};function Fn(a,b){(a.B.loungeIdToken=b)||a.k.stop()}g.getDeviceId=function(){return this.B.id};g.pd=function(){this.k.stop();0!=tn(this.j)?this.k.start():this.connect(this.C,this.A)};function Gn(a){Hn(this,a)}function In(a,b){if(a.k)throw Error(b+" is not allowed in V3.");}function Jn(a){a.J=-1;a.C=!1;a.B=null;a.j=-1;a.o=null;a.A=0;a.N=w()}function Hn(a,b){a.videoIds=[];a.k="";a.index=-1;a.videoId="";Jn(a);b&&(a.videoIds=b.videoIds,a.index=b.index,a.k=b.listId,a.videoId=b.videoId,a.j=b.playerState,a.o=b.errorReason,a.J=b.volume,a.C=b.muted,a.B=b.trackData,a.A=b.playerTime,a.N=b.playerTimeAt)}function Kn(a){return a.k?a.videoId:a.videoIds[a.index]}
function Ln(a){switch(a.j){case 1:return(w()-a.N)/1E3+a.A;case -1E3:return 0}return a.A}Gn.prototype.setVideoId=function(a){In(this,"setVideoId");var b=this.index;this.index=Ba(this.videoIds,a);b!=this.index&&Jn(this);return-1!=b};function Mn(a,b,c){In(a,"setPlaylist");c=c||Kn(a);Sa(a.videoIds,b)&&c==Kn(a)||(a.videoIds=Oa(b),a.setVideoId(c))}Gn.prototype.add=function(a){In(this,"add");return a&&!Ha(this.videoIds,a)?(this.videoIds.push(a),!0):!1};
Gn.prototype.remove=function(a){In(this,"remove");var b=Kn(this);return La(this.videoIds,a)?(this.index=Ba(this.videoIds,b),!0):!1};function Nn(a){var b={};b.videoIds=Oa(a.videoIds);b.index=a.index;b.listId=a.k;b.videoId=a.videoId;b.playerState=a.j;b.errorReason=a.o;b.volume=a.J;b.muted=a.C;b.trackData=gb(a.B);b.playerTime=a.A;b.playerTimeAt=a.N;return b}Gn.prototype.clone=function(){return new Gn(Nn(this))};function Y(a,b,c){V.call(this);this.ta=a;this.O=[];this.O.push(M(window,"beforeunload",v(this.Bd,this)));this.k=[];this.D=new Gn;3==c["mdx-version"]&&(this.D.k="RQ"+b.token);this.U=b.id;this.j=On(this,c);this.j.subscribe("handlerOpened",this.Gd,this);this.j.subscribe("handlerClosed",this.Cd,this);this.j.subscribe("handlerError",this.Dd,this);this.D.k?this.j.subscribe("handlerMessage",this.Ed,this):this.j.subscribe("handlerMessage",this.Fd,this);Fn(this.j,b.token);this.subscribe("remoteQueueChange",
function(){var a=this.D.videoId;Sj()&&Q("yt-remote-session-video-id",a)},this)}y(Y,V);g=Y.prototype;g.nb=NaN;g.ac=!1;g.vb=NaN;g.ic=NaN;g.rb=NaN;
g.connect=function(a,b){if(b){if(this.D.k){var c=b.listId,d=b.videoId,e=b.index,f=b.currentTime||0;5>=f&&(f=0);h={videoId:d,currentTime:f};c&&(h.listId=c);p(e)&&(h.currentIndex=e);c&&(this.D.k=c);this.D.videoId=d;this.D.index=e||0}else{var d=b.videoIds[b.index],f=b.currentTime||0;5>=f&&(f=0);var h={videoIds:d,videoId:d,currentTime:f};this.D.videoIds=[d];this.D.index=0}this.D.state=3;c=this.D;c.A=f;c.N=w();this.I("Connecting with setPlaylist and params: "+P(h));this.j.connect({method:"setPlaylist",
params:P(h)},a,Wj())}else this.I("Connecting without params"),this.j.connect({},a,Wj());Pn(this)};g.dispose=function(){this.K()||(this.publish("beforeDispose"),Qn(this,3));Y.L.dispose.call(this)};g.G=function(){Rn(this);Sn(this);Tn(this);H(this.rb);this.rb=NaN;this.A=null;Jc(this.O);this.O.length=0;this.j.dispose();Y.L.G.call(this);this.k=this.D=this.j=null};g.I=function(a){Zi("conn",a)};g.Bd=function(){this.C(2)};function On(a,b){return new Dn(tj(a.ta,"/bc",void 0,!1),b)}
function Qn(a,b){a.publish("proxyStateChange",b)}function Pn(a){a.nb=G(v(function(){this.I("Connecting timeout");this.C(1)},a),2E4)}function Rn(a){H(a.nb);a.nb=NaN}function Tn(a){H(a.vb);a.vb=NaN}function Un(a){Sn(a);a.ic=G(v(function(){this.o("getNowPlaying")},a),2E4)}function Sn(a){H(a.ic);a.ic=NaN}function Vn(a){var b=a.j;return!!b.j&&3==b.j.getState()&&isNaN(a.nb)}
g.Gd=function(){this.I("Channel opened");this.ac&&(this.ac=!1,Tn(this),this.vb=G(v(function(){this.I("Timing out waiting for a screen.");this.C(1)},this),15E3));fk(En(this.j),this.U)};g.Cd=function(){this.I("Channel closed");isNaN(this.nb)?gk(!0):gk();this.dispose()};g.Dd=function(a){gk();isNaN(this.F())?(this.I("Channel error: "+a+" without reconnection"),this.dispose()):(this.ac=!0,this.I("Channel error: "+a+" with reconnection in "+this.F()+" ms"),Qn(this,2))};
function Wn(a,b){b&&(Rn(a),Tn(a));b==Vn(a)?b&&(Qn(a,1),a.o("getSubtitlesTrack")):b?(a.M()&&Hn(a.D),Qn(a,1),a.o("getNowPlaying")):a.C(1)}function Xn(a,b){var c=b.params.videoId;delete b.params.videoId;c==a.D.videoId&&(db(b.params)?a.D.B=null:a.D.B=b.params,a.publish("remotePlayerChange"))}
function Yn(a,b){var c=b.params.videoId||b.params.video_id,d=parseInt(b.params.currentIndex,10);a.D.k=b.params.listId||a.D.k;var e=a.D,f=e.videoId;e.videoId=c;e.index=d;c!=f&&Jn(e);a.publish("remoteQueueChange")}function Zn(a,b){b.params=b.params||{};Yn(a,b);$n(a,b)}
function $n(a,b){var c=parseInt(b.params.currentTime||b.params.current_time,10),d=a.D;d.A=isNaN(c)?0:c;d.N=w();c=parseInt(b.params.state,10);c=isNaN(c)?-1:c;-1==c&&-1E3==a.D.j&&(c=-1E3);a.D.j=c;d=null;-1E3==c&&(d=a.D.o||"unknown",p(b.params.currentError)&&(d=vg(b.params.currentError).reason||d));a.D.o=d;1==a.D.j?Un(a):Sn(a);a.publish("remotePlayerChange")}function ao(a,b){var c="true"==b.params.muted;a.D.J=parseInt(b.params.volume,10);a.D.C=c;a.publish("remotePlayerChange")}
g.Ed=function(a){a.params?this.I("Received: action="+a.action+", params="+P(a.params)):this.I("Received: action="+a.action+" {}");switch(a.action){case "loungeStatus":a=vg(a.params.devices);this.k=B(a,function(a){return new Nj(a)});a=!!Fa(this.k,function(a){return"LOUNGE_SCREEN"==a.type});Wn(this,a);break;case "loungeScreenConnected":Wn(this,!0);break;case "loungeScreenDisconnected":Ma(this.k,function(a){return"LOUNGE_SCREEN"==a.type});Wn(this,!1);break;case "remoteConnected":var b=new Nj(vg(a.params.device));
Fa(this.k,function(a){return a.equals(b)})||Ka(this.k,b);break;case "remoteDisconnected":b=new Nj(vg(a.params.device));Ma(this.k,function(a){return a.equals(b)});break;case "gracefulDisconnect":break;case "playlistModified":Yn(this,a);break;case "nowPlaying":Zn(this,a);break;case "onStateChange":$n(this,a);break;case "onVolumeChanged":ao(this,a);break;case "onSubtitlesTrackChanged":Xn(this,a);break;default:this.I("Unrecognized action: "+a.action)}};
g.Fd=function(a){a.params?this.I("Received: action="+a.action+", params="+P(a.params)):this.I("Received: action="+a.action);bo(this,a);co(this,a);if(Vn(this)){var b=this.D.clone(),c=!1,d,e,f,h,k,m,n;a.params&&(d=a.params.videoId||a.params.video_id,e=a.params.videoIds||a.params.video_ids,f=a.params.state,h=a.params.currentTime||a.params.current_time,k=a.params.volume,m=a.params.muted,p(a.params.currentError)&&(n=vg(a.params.currentError)));if("onSubtitlesTrackChanged"==a.action)d==Kn(this.D)&&(delete a.params.videoId,
db(a.params)?this.D.B=null:this.D.B=a.params,this.publish("remotePlayerChange"));else if(Kn(this.D)||"onStateChange"!=a.action)"playlistModified"!=a.action&&"nowPlayingPlaylist"!=a.action||e?(d||"nowPlaying"!=a.action&&"nowPlayingPlaylist"!=a.action?d||(d=Kn(this.D)):this.D.setVideoId(""),e&&(e=e.split(","),Mn(this.D,e,d))):Mn(this.D,[]),this.D.add(d)&&this.o("getPlaylist"),d&&this.D.setVideoId(d),b.index==this.D.index&&Sa(b.videoIds,this.D.videoIds)||this.publish("remoteQueueChange"),p(f)&&(b=parseInt(f,
10),b=isNaN(b)?-1:b,-1==b&&-1E3==this.D.j&&(b=-1E3),0==b&&"0"==h&&(b=-1),c=c||b!=this.D.j,this.D.j=b,d=null,-1E3==b&&(d=this.D.o||"unknown",n&&(d=n.reason||d)),c=c||this.D.o!=d,this.D.o=d,1==this.D.j?Un(this):Sn(this)),"onError"!=a.action||-1!=this.D.j&&-1E3!=this.D.j||(a=vg(a.params.errors)||[],1==a.length&&"PLAYER_ERROR"==a[0].error&&a[0].videoId==Kn(this.D)&&(this.D.j=-1E3,this.D.o=a[0].reason||"unknown",c=!0)),h&&(b=parseInt(h,10),c=this.D,c.A=isNaN(b)?0:b,c.N=w(),c=!0),p(k)&&(b=parseInt(k,10),
isNaN(b)||(c=c||this.D.J!=b,this.D.J=b),p(m)&&(m="true"==m,c=c||this.D.C!=m,this.D.C=m)),c&&this.publish("remotePlayerChange")}};
function bo(a,b){switch(b.action){case "loungeStatus":var c=vg(b.params.devices);a.k=B(c,function(a){return new Nj(a)});break;case "loungeScreenDisconnected":Ma(a.k,function(a){return"LOUNGE_SCREEN"==a.type});break;case "remoteConnected":var d=new Nj(vg(b.params.device));Fa(a.k,function(a){return a.equals(d)})||Ka(a.k,d);break;case "remoteDisconnected":d=new Nj(vg(b.params.device)),Ma(a.k,function(a){return a.equals(d)})}}
function co(a,b){var c=!1;if("loungeStatus"==b.action)c=!!Fa(a.k,function(a){return"LOUNGE_SCREEN"==a.type});else if("loungeScreenConnected"==b.action)c=!0;else if("loungeScreenDisconnected"==b.action)c=!1;else return;if(!isNaN(a.vb))if(c)Tn(a);else return;c==Vn(a)?c&&Qn(a,1):c?(Rn(a),a.M()&&Hn(a.D),Qn(a,1),a.o("getNowPlaying")):a.C(1)}g.qd=function(){if(this.A){var a=this.A;this.A=null;this.D.videoId!=a&&this.o("getNowPlaying")}};Y.prototype.subscribe=Y.prototype.subscribe;
Y.prototype.unsubscribeByKey=Y.prototype.pa;Y.prototype.ca=function(){var a=3;this.K()||(a=0,isNaN(this.F())?Vn(this)&&(a=1):a=2);return a};Y.prototype.getProxyState=Y.prototype.ca;Y.prototype.C=function(a){this.I("Disconnecting with "+a);Rn(this);this.publish("beforeDisconnect",a);1==a&&gk();this.j.disconnect(a);this.dispose()};Y.prototype.disconnect=Y.prototype.C;Y.prototype.Z=function(){var a=this.D;if(this.A){var b=a=this.D.clone(),c=this.A,d=a.index,e=b.videoId;b.videoId=c;b.index=d;c!=e&&Jn(b)}return Nn(a)};
Y.prototype.getPlayerContextData=Y.prototype.Z;Y.prototype.ua=function(a){var b=new Gn(a);b.videoId&&b.videoId!=this.D.videoId&&(this.A=b.videoId,H(this.rb),this.rb=G(v(this.qd,this),5E3));var c=[];this.D.k==b.k&&this.D.videoId==b.videoId&&this.D.index==b.index&&Sa(this.D.videoIds,b.videoIds)||c.push("remoteQueueChange");this.D.j==b.j&&this.D.J==b.J&&this.D.C==b.C&&Ln(this.D)==Ln(b)&&P(this.D.B)==P(b.B)||c.push("remotePlayerChange");Hn(this.D,a);A(c,function(a){this.publish(a)},this)};
Y.prototype.setPlayerContextData=Y.prototype.ua;Y.prototype.X=function(){return this.j.B.loungeIdToken};Y.prototype.getLoungeToken=Y.prototype.X;Y.prototype.M=function(){var a=this.j.getDeviceId(),b=Fa(this.k,function(b){return"REMOTE_CONTROL"==b.type&&b.id!=a});return b?b.id:""};Y.prototype.getOtherConnectedRemoteId=Y.prototype.M;Y.prototype.F=function(){var a=this.j;return a.k.enabled?a.k.A-w():NaN};Y.prototype.getReconnectTimeout=Y.prototype.F;
Y.prototype.Aa=function(){if(!isNaN(this.F())){var a=this.j.k;a.enabled&&(a.stop(),a.start(),a.C())}};Y.prototype.reconnect=Y.prototype.Aa;Y.prototype.o=function(a,b){b?this.I("Sending: action="+a+", params="+P(b)):this.I("Sending: action="+a);this.j.sendMessage(a,b)};Y.prototype.sendMessage=Y.prototype.o;function eo(a){V.call(this);this.A=a;this.na=fo();this.I("Initializing local screens: "+jj(this.na));this.o=go();this.I("Initializing account screens: "+jj(this.o));this.Pb=null;this.j=[];this.k=[];ho(this,xl()||[]);this.I("Initializing DIAL devices: "+wj(this.k));a=hj(ck());io(this,a);this.I("Initializing online screens: "+jj(this.j));this.C=w()+3E5;jo(this)}y(eo,V);var ko=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g=eo.prototype;g.ob=NaN;g.Jb="";g.I=function(a){Zi("RM",a)};
g.S=function(a){Zi("RM",a)};function go(){var a=fo(),b=hj(ck());return Ca(b,function(b){return!Ej(a,b)})}function fo(){var a=hj(Yj());return Ca(a,function(a){return!a.uuid})}function jo(a){I("yt-remote-cast-device-list-update",function(){var a=xl();ho(this,a||[])},a);I("yt-remote-cast-device-status-update",a.we,a);a.Zc();var b=w()>a.C?2E4:1E4;vb(v(a.Zc,a),b)}g.publish=function(a,b){if(this.K())return!1;this.I("Firing "+a);return this.B.publish.apply(this.B,arguments)};
g.Zc=function(){var a=xl()||[];0==a.length||ho(this,a);a=lo(this);0==a.length||(Da(a,function(a){return!Ej(this.o,a)},this)&&ak()?mo(this):no(this,a))};function oo(a,b){var c=lo(a);return Ca(b,function(a){return a.uuid?(a=Dj(this.k,a.uuid),!!a&&"RUNNING"==a.status):!!Ej(c,a)},a)}
function ho(a,b){var c=!1;A(b,function(a){var b=Fj(this.na,a.id);b&&b.name!=a.name&&(this.I("Renaming screen id "+b.id+" from "+b.name+" to "+a.name),b.name=a.name,c=!0)},a);c&&(a.I("Renaming due to DIAL."),po(a));dk(Aj(b));var d=!Sa(a.k,b,Cj);d&&a.I("Updating DIAL devices: "+wj(a.k)+" to "+wj(b));a.k=b;io(a,a.j);d&&a.publish("onlineReceiverChange")}
g.we=function(a){var b=Dj(this.k,a.id);b&&(this.I("Updating DIAL device: "+b.id+"("+b.name+") from status: "+b.status+" to status: "+a.status+" and from activityId: "+b.activityId+" to activityId: "+a.activityId),b.activityId=a.activityId,b.status=a.status,dk(Aj(this.k)));io(this,this.j)};function io(a,b,c){var d=oo(a,b),e=!Sa(a.j,d,ej);if(e||c)0==b.length||bk(B(d,fj));e&&(a.I("Updating online screens: "+jj(a.j)+" -> "+jj(d)),a.j=d,a.publish("onlineReceiverChange"))}
function no(a,b){var c=[],d={};A(b,function(a){a.token&&(d[a.token]=a,c.push(a.token))});var e={method:"POST",V:{lounge_token:c.join(",")},context:a,da:function(a,b){var c=[];A(b.screens||[],function(a){"online"==a.status&&c.push(d[a.loungeToken])});var e=this.Pb?qo(this,this.Pb):null;e&&!Ej(c,e)&&c.push(e);io(this,c,!0)}};ji(tj(a.A,"/pairing/get_screen_availability"),e)}
function mo(a){var b=lo(a),c=B(b,function(a){return a.id});0!=c.length&&(a.I("Updating lounge tokens for: "+P(c)),ji(tj(a.A,"/pairing/get_lounge_token_batch"),{V:{screen_ids:c.join(",")},method:"POST",context:a,da:function(a,c){ro(this,c.screens||[]);this.na=Ca(this.na,function(a){return!!a.token});po(this);no(this,b)}}))}function ro(a,b){A(Na(a.na,a.o),function(a){var d=Fa(b,function(b){return a.id==b.screenId});d&&(a.token=d.loungeToken)})}
function po(a){var b=fo();Sa(a.na,b,ej)||(a.I("Saving local screens: "+jj(b)+" to "+jj(a.na)),Xj(B(a.na,fj)),io(a,a.j,!0),ho(a,xl()||[]),a.publish("managedScreenChange",lo(a)))}function so(a,b,c){var d=Ga(b,function(a){return dj(c,a)}),e=0>d;0>d?b.push(c):b[d]=c;Ej(a.j,c)||a.j.push(c);return e}g.Yc=function(a,b){for(var c=lo(this),c=B(c,function(a){return a.name}),d=a,e=2;Ha(c,d);)d=b.call(l,e),e++;return d};
g.Pc=function(a,b,c){var d=!1;b>=ko.length&&(this.I("Pairing DIAL device "+a+" with "+c+" timed out."),d=!0);var e=Dj(this.k,a);if(!e)this.I("Pairing DIAL device "+a+" with "+c+" failed: no device for "+a),d=!0;else if("ERROR"==e.status||"STOPPED"==e.status)this.I("Pairing DIAL device "+a+" with "+c+" failed: launch error on "+a),d=!0;d?(to(this),this.publish("screenPair",null)):ji(tj(this.A,"/pairing/get_screen"),{method:"POST",V:{pairing_code:c},context:this,da:function(a,b){if(c==this.Jb){to(this);
var d=new bj(b.screen);d.name=e.name;d.uuid=e.id;this.I("Pairing "+c+" succeeded.");var m=so(this,this.na,d);this.I("Paired with "+(m?"a new":"an old")+" local screen:"+ij(d));po(this);this.publish("screenPair",d)}},onError:function(){c==this.Jb&&(this.I("Polling pairing code: "+c),H(this.ob),this.ob=G(v(this.Pc,this,a,b+1,c),ko[b]))}})};
function uo(a,b,c){var d=Z,e="";to(d);if(Dj(d.k,a)){if(!e){var f=e=xj();ql();var h=zl(a),k=nl();if(k&&h){var m=new cast.Receiver(h.id,h.name),m=new cast.LaunchRequest("YouTube",m);m.parameters="pairingCode="+f;m.description=new cast.LaunchDescription;m.description.text=document.title;b&&(m.parameters+="&v="+b,c&&(m.parameters+="&t="+Math.round(c)),m.description.url="http://i.ytimg.com/vi/"+b+"/default.jpg");"UNKNOWN"!=h.status&&(h.status="UNKNOWN",vl(h),J("yt-remote-cast-device-status-update",h));
ll("Sending a cast launch request with params: "+m.parameters);k.launch(m,oa(Al,a))}else ll("No cast API or no cast device. Dropping cast launch.")}d.Jb=e;d.ob=G(v(d.Pc,d,a,0,e),ko[0])}else d.I("No DIAL device with id: "+a)}function to(a){H(a.ob);a.ob=NaN;a.Jb=""}function qo(a,b){var c=Fj(lo(a),b);a.I("Found screen: "+ij(c)+" with key: "+b);return c}function vo(a){var b=Z,c=Fj(b.j,a);b.I("Found online screen: "+ij(c)+" with key: "+a);return c}
function wo(a){var b=Z,c=Dj(b.k,a);if(!c){var d=Fj(b.na,a);d&&(c=Dj(b.k,d.uuid))}b.I("Found DIAL: "+(c?c.toString():"null")+" with key: "+a);return c}function lo(a){return Na(a.o,Ca(a.na,function(a){return!Ej(this.o,a)},a))};function xo(a){Hj.call(this,"ScreenServiceProxy");this.Y=a;this.j=[];this.j.push(this.Y.$_s("screenChange",v(this.ke,this)));this.j.push(this.Y.$_s("onlineScreenChange",v(this.je,this)))}y(xo,Hj);g=xo.prototype;g.ea=function(a){return this.Y.$_gs(a)};g.contains=function(a){return!!this.Y.$_c(a)};g.get=function(a){return this.Y.$_g(a)};g.start=function(){this.Y.$_st()};g.add=function(a,b,c){this.Y.$_a(a,b,c)};g.remove=function(a,b,c){this.Y.$_r(a,b,c)};g.Kb=function(a,b,c,d){this.Y.$_un(a,b,c,d)};
g.G=function(){for(var a=0,b=this.j.length;a<b;++a)this.Y.$_ubk(this.j[a]);this.j.length=0;this.Y=null;xo.L.G.call(this)};g.ke=function(){this.publish("screenChange")};g.je=function(){this.publish("onlineScreenChange")};W.prototype.$_st=W.prototype.start;W.prototype.$_gspc=W.prototype.We;W.prototype.$_gsppc=W.prototype.zc;W.prototype.$_c=W.prototype.contains;W.prototype.$_g=W.prototype.get;W.prototype.$_a=W.prototype.add;W.prototype.$_un=W.prototype.Kb;W.prototype.$_r=W.prototype.remove;
W.prototype.$_gs=W.prototype.ea;W.prototype.$_gos=W.prototype.Ac;W.prototype.$_s=W.prototype.subscribe;W.prototype.$_ubk=W.prototype.pa;function yo(){var a=!!F("MDX_ENABLE_CASTV2"),b=!!F("MDX_ENABLE_QUEUE"),c={device:"Desktop",app:"youtube-desktop"};a?q("yt.mdx.remote.castv2_",!0,void 0):ql();Ng&&Mg();Pj();zo||(zo=new sj,hk()&&(zo.j="/api/loungedev"));Z||a||(Z=new eo(zo),Z.subscribe("screenPair",Ao),Z.subscribe("managedScreenChange",Bo),Z.subscribe("onlineReceiverChange",function(){J("yt-remote-receiver-availability-change")}));Co||(Co=r("yt.mdx.remote.deferredProxies_")||[],q("yt.mdx.remote.deferredProxies_",Co,void 0));Do(b);b=
Eo();if(a&&!b){var d=new W(zo);q("yt.mdx.remote.screenService_",d,void 0);b=Eo();Rk(d,function(a){a?Fo()&&il(Fo(),"YouTube TV"):d.subscribe("onlineScreenChange",function(){J("yt-remote-receiver-availability-change")})})}if(c&&!r("yt.mdx.remote.initialized_")){q("yt.mdx.remote.initialized_",!0,void 0);Go("Initializing: "+P(c));Ho.push(I("yt-remote-cast2-availability-change",function(){J("yt-remote-receiver-availability-change")}));Ho.push(I("yt-remote-cast2-receiver-selected",function(){Io(null);J("yt-remote-auto-connect",
"cast-selector-receiver")}));Ho.push(I("yt-remote-cast2-session-change",Jo));Ho.push(I("yt-remote-connection-change",function(a){a?il(Fo(),"YouTube TV"):Ko()||(il(null,null),el())}));var e=Lo();c.isAuto&&(e.id+="#dial");e.name=c.device;e.app=c.app;Go(" -- with channel params: "+P(e));Mo(e);a&&b.start();Fo()||No()}}function Oo(){Fb(Ho);Ho.length=0;ob(Po);Po=null;Co&&(A(Co,function(a){a(null)}),Co.length=0,Co=null,q("yt.mdx.remote.deferredProxies_",null,void 0));Z&&(ob(Z),Z=null);zo=null;ul()}
function Qo(){if(Ro()&&cl()){var a=[];if(R("yt-remote-cast-available")||r("yt.mdx.remote.cloudview.castButtonShown_")||So())a.push({key:"cast-selector-receiver",name:To()}),q("yt.mdx.remote.cloudview.castButtonShown_",!0,void 0);return a}if(r("yt.mdx.remote.cloudview.initializing_"))return[];var b=[],b=Uo()?Eo().Y.$_gos():hj(ck());(a=Vo())&&So()&&(Ej(b,a)||b.push(a));Uo()||(a=Bj(ek()),a=Ca(a,function(a){return!Fj(b,a.id)}),b=Na(b,a));return zj(b)}
function Wo(){if(Ro()&&cl()){var a=dl();return a?{key:"cast-selector-receiver",name:a}:null}var a=Qo(),b=Xo(),c=Vo();c||(c=Ko());return Fa(a,function(a){return c&&cj(c,a.key)||b&&(a=wo(a.key))&&a.id==b?!0:!1})}function To(){if(Ro()&&cl())return dl();var a=Vo();return a?a.name:null}function Vo(){var a=Fo();if(!a)return null;if(!Z){var b=Eo().ea();return Fj(b,a)}return qo(Z,a)}
function Jo(a){Go("remote.onCastSessionChange_: "+ij(a));if(a){var b=Vo();b&&b.id==a.id?il(b.id,"YouTube TV"):(b&&Yo(),Zo(a,1))}else Yo()}function $o(a,b){Go("Connecting to: "+P(a));if("cast-selector-receiver"==a.key)Io(b||null),hl(b||null);else{Yo();Io(b||null);var c=null;Z?c=vo(a.key):(c=Eo().ea(),c=Fj(c,a.key));if(c)Zo(c,1);else{if(Z&&(c=wo(a.key))){ap(c);return}G(function(){bp(null)},0)}}}
function Yo(){Z&&to(Z);t:{var a=So();if(a&&(a=a.getOtherConnectedRemoteId())){Go("Do not stop DIAL due to "+a);cp("");break t}(a=Xo())?(Go("Stopping DIAL: "+a),Bl(a),cp("")):(a=Vo())&&a.uuid&&(Go("Stopping DIAL: "+a.uuid),Bl(a.uuid))}gl()?Zk().stopSession():Wk("stopSession called before API ready.");(a=So())?a.disconnect(1):(Gb("yt-remote-before-disconnect",1),Gb("yt-remote-connection-change",!1));bp(null)}function Go(a){Zi("remote",a)}function Ro(){return!!r("yt.mdx.remote.castv2_")}
function Uo(){return r("yt.mdx.remote.screenService_")}function Eo(){if(!Po){var a=Uo();Po=a?new xo(a):null}return Po}function Fo(){return r("yt.mdx.remote.currentScreenId_")}function dp(a){q("yt.mdx.remote.currentScreenId_",a,void 0);if(Z){var b=Z;b.C=w()+3E5;if((b.Pb=a)&&(a=qo(b,a))&&!Ej(b.j,a)){var c=Oa(b.j);c.push(a);io(b,c,!0)}}}function Xo(){return r("yt.mdx.remote.currentDialId_")}function cp(a){q("yt.mdx.remote.currentDialId_",a,void 0)}
function ep(){return r("yt.mdx.remote.connectData_")}function Io(a){q("yt.mdx.remote.connectData_",a,void 0)}function So(){return r("yt.mdx.remote.connection_")}function bp(a){var b=So();Io(null);a?Aa(!So()):(dp(""),cp(""));q("yt.mdx.remote.connection_",a,void 0);Co&&(A(Co,function(b){b(a)}),Co.length=0);b&&!a?Gb("yt-remote-connection-change",!1):!b&&a&&J("yt-remote-connection-change",!0)}function Ko(){var a=Sj();if(!a)return null;if(Uo()){var b=Eo().ea();return Fj(b,a)}return Z?qo(Z,a):null}
function Zo(a,b){Aa(!Fo());dp(a.id);var c=new Y(zo,a,Lo());c.connect(b,ep());c.subscribe("beforeDisconnect",function(a){Gb("yt-remote-before-disconnect",a)});c.subscribe("beforeDispose",function(){So()&&(So(),bp(null))});bp(c)}function ap(a){Xo();Go("Connecting to: "+(a?a.toString():"null"));cp(a.id);var b=ep();b?uo(a.id,b.videoIds[b.index],b.currentTime):uo(a.id)}
function No(){var a=Ko();a?(Go("Resume connection to: "+ij(a)),Zo(a,0)):(gk(),el(),Go("Skipping connecting because no session screen found."))}function Ao(a){Go("Paired with: "+ij(a));a?Zo(a,1):bp(null)}function Bo(){var a=Fo();a&&!Vo()&&(Go("Dropping current screen with id: "+a),Yo());Ko()||gk()}var zo=null,Co=null,Po=null,Z=null;
function Do(a){var b=Lo();if(db(b)){var b=Rj(),c=R("yt-remote-session-name")||"",d=R("yt-remote-session-app")||"",b={device:"REMOTE_CONTROL",id:b,name:c,app:d};a&&(b["mdx-version"]=3);q("yt.mdx.remote.channelParams_",b,void 0)}}function Lo(){return r("yt.mdx.remote.channelParams_")||{}}function Mo(a){a?(Q("yt-remote-session-app",a.app),Q("yt-remote-session-name",a.name)):(Pg("yt-remote-session-app"),Pg("yt-remote-session-name"));q("yt.mdx.remote.channelParams_",a,void 0)}var Ho=[];var fp=null,gp=[];function hp(){ip();if(Wo()){var a=fp;"html5"!=a.getPlayerType()&&a.loadNewVideoConfig(a.getCurrentVideoConfig(),"html5")}}function jp(a){"cast-selector-receiver"==a?fl():kp(a)}
function kp(a){var b=Qo();if(a=yj(b,a)){var c=fp,d=c.getVideoData().video_id,e=c.getVideoData().list,f=c.getCurrentTime();$o(a,{videoIds:[d],listId:e,videoId:d,index:0,currentTime:f});"html5"!=c.getPlayerType()?c.loadNewVideoConfig(c.getCurrentVideoConfig(),"html5"):c.updateRemoteReceivers&&c.updateRemoteReceivers(b,a)}}function ip(){var a=fp;a&&a.updateRemoteReceivers&&a.updateRemoteReceivers(Qo(),Wo())};var lp=null,mp=[];function np(a){return{externalChannelId:a.externalChannelId,Me:!!a.isChannelPaid,source:a.source,Qb:a.subscriptionId}}function op(a){pp(np(a))}function pp(a){ni()?(U(Wh,new Oh(a.externalChannelId,a.Me?{itemType:"U",itemId:a.externalChannelId}:null)),(a="/gen_204?"+bd({event:"subscribe",source:a.source}))&&bg(a)):qp(a)}function qp(a){di(function(b){b.subscription_ajax&&pp(a)},null,"sub_button")}
function rp(a){a=np(a);U($h,new Ph(a.externalChannelId,a.Qb,null));(a="/gen_204?"+bd({event:"unsubscribe",source:a.source}))&&bg(a)}function sp(a,b){lp&&lp.channelSubscribed(a,b)}function tp(a){lp&&lp.channelUnsubscribed(a)};function up(a){D.call(this);this.k=a;this.k.subscribe("command",this.Ec,this);this.o={};this.B=!1}y(up,D);g=up.prototype;g.start=function(){this.B||this.K()||(this.B=!0,vp(this.k,"RECEIVING"))};
g.Ec=function(a,b){if(this.B&&!this.K()){var c=b||{};switch(a){case "addEventListener":if(u(c.event)&&(c=c.event,!(c in this.o))){var d=v(this.sd,this,c);this.o[c]=d;this.addEventListener(c,d)}break;case "removeEventListener":u(c.event)&&wp(this,c.event);break;default:this.j.isReady()&&this.j[a]&&(c=xp(a,b||{}),c=this.j[a].apply(this.j,c),(c=yp(a,c))&&this.B&&!this.K()&&vp(this.k,a,c))}}};g.sd=function(a,b){this.B&&!this.K()&&vp(this.k,a,this.hc(a,b))};g.hc=function(a,b){if(null!=b)return{value:b}};
function wp(a,b){b in a.o&&(a.removeEventListener(b,a.o[b]),delete a.o[b])}g.G=function(){this.k.unsubscribe("command",this.Ec,this);this.k=null;for(var a in this.o)wp(this,a);up.L.G.call(this)};function zp(a,b){up.call(this,b);this.j=a;this.start()}y(zp,up);zp.prototype.addEventListener=function(a,b){this.j.addEventListener(a,b)};zp.prototype.removeEventListener=function(a,b){this.j.removeEventListener(a,b)};
function xp(a,b){switch(a){case "loadVideoById":return b=Ni(b),Pi(b),[b];case "cueVideoById":return b=Ni(b),Pi(b),[b];case "loadVideoByPlayerVars":return Pi(b),[b];case "cueVideoByPlayerVars":return Pi(b),[b];case "loadPlaylist":return b=Oi(b),Pi(b),[b];case "cuePlaylist":return b=Oi(b),Pi(b),[b];case "seekTo":return[b.seconds,b.allowSeekAhead];case "playVideoAt":return[b.index];case "setVolume":return[b.volume];case "setPlaybackQuality":return[b.suggestedQuality];case "setPlaybackRate":return[b.suggestedRate];
case "setLoop":return[b.loopPlaylists];case "setShuffle":return[b.shufflePlaylist];case "getOptions":return[b.module];case "getOption":return[b.module,b.option];case "setOption":return[b.module,b.option,b.value]}return[]}
function yp(a,b){switch(a){case "isMuted":return{muted:b};case "getVolume":return{volume:b};case "getPlaybackRate":return{playbackRate:b};case "getAvailablePlaybackRates":return{availablePlaybackRates:b};case "getVideoLoadedFraction":return{videoLoadedFraction:b};case "getPlayerState":return{playerState:b};case "getCurrentTime":return{currentTime:b};case "getPlaybackQuality":return{playbackQuality:b};case "getAvailableQualityLevels":return{availableQualityLevels:b};case "getDuration":return{duration:b};
case "getVideoUrl":return{videoUrl:b};case "getVideoEmbedCode":return{videoEmbedCode:b};case "getPlaylist":return{playlist:b};case "getPlaylistIndex":return{playlistIndex:b};case "getOptions":return{options:b};case "getOption":return{option:b}}}
zp.prototype.hc=function(a,b){switch(a){case "onReady":return;case "onStateChange":return{playerState:b};case "onPlaybackQualityChange":return{playbackQuality:b};case "onPlaybackRateChange":return{playbackRate:b};case "onError":return{errorCode:b}}return zp.L.hc.call(this,a,b)};zp.prototype.G=function(){zp.L.G.call(this);delete this.j};function Ap(a,b){this.source=null;this.B=a||null;this.origin="*";this.N=window.document.location.protocol+"//"+window.document.location.hostname;this.C=b;this.o=this.j=this.k=this.A=null;M(window,"message",v(this.J,this))}
Ap.prototype.J=function(a){var b=this.C||F("POST_MESSAGE_ORIGIN")||this.N;if("*"!=b&&a.origin!=b)window.console&&window.console.warn("Untrusted origin: "+a.origin);else if(!this.B||a.source==this.B)if(this.source=a.source,this.origin="null"==a.origin?this.origin:a.origin,a=a.data,u(a)){try{a=vg(a)}catch(c){return}this.A=a.id;switch(a.event){case "listening":this.j&&(this.j(),this.j=null);break;case "command":this.k&&(this.o&&!Ha(this.o,a.func)||this.k(a.func,a.args))}}};
Ap.prototype.sendMessage=function(a){this.source&&(a.id=this.A,a=P(a),this.source.postMessage(a,this.origin))};function Bp(){var a=this.k=new Ap,b=v(this.ce,this);a.k=b;a.o=null;this.B=[];this.J=!1;this.A=(a=F("POST_MESSAGE_ORIGIN"))&&Yf(a)?a:null;this.C={}}g=Bp.prototype;g.ce=function(a,b){if(this.A&&this.A!=this.k.origin)this.dispose();else if("addEventListener"==a&&b){var c=b[0];this.C[c]||"onReady"==c||(this.addEventListener(c,Cp(this,c)),this.C[c]=!0)}else this.Qc(a,b)};g.Qc=function(){};function Cp(a,b){return v(function(a){this.sendMessage(b,a)},a)}g.addEventListener=function(){};
g.Ld=function(){this.J=!0;this.sendMessage("initialDelivery",this.dc());this.sendMessage("onReady");A(this.B,this.Wc,this);this.B=[]};g.dc=function(){return null};function Dp(a,b){a.sendMessage("infoDelivery",b)}g.Wc=function(a){this.J?this.k.sendMessage(a):this.B.push(a)};g.sendMessage=function(a,b){this.Wc({event:a,info:void 0==b?null:b})};g.dispose=function(){this.k=null};function Ep(a){Bp.call(this);this.j=a;this.o=[];this.addEventListener("onReady",v(this.Wd,this));this.addEventListener("onVideoProgress",v(this.ae,this));this.addEventListener("onVolumeChange",v(this.be,this));this.addEventListener("onApiChange",v(this.Xd,this));this.addEventListener("onPlaybackQualityChange",v(this.Yd,this));this.addEventListener("onPlaybackRateChange",v(this.Zd,this));this.addEventListener("onStateChange",v(this.$d,this))}y(Ep,Bp);g=Ep.prototype;
g.Qc=function(a,b){if(this.j[a]){b=b||[];if(0<b.length&&Li(a)){var c;c=b;if(ia(c[0])&&!ea(c[0]))c=c[0];else{var d={};switch(a){case "loadVideoById":case "cueVideoById":d=Ni.apply(window,c);break;case "loadVideoByUrl":case "cueVideoByUrl":d=Mi.apply(window,c);break;case "loadPlaylist":case "cuePlaylist":d=Oi.apply(window,c)}c=d}Pi(c);b.length=1;b[0]=c}this.j[a].apply(this.j,b);Li(a)&&Dp(this,this.dc())}};g.Wd=function(){var a=v(this.Ld,this);this.k.j=a};
g.addEventListener=function(a,b){this.o.push({Vd:a,listener:b});this.j.addEventListener(a,b)};g.dc=function(){if(!this.j)return null;var a=this.j.getApiInterface();La(a,"getVideoData");for(var b={apiInterface:a},c=0,d=a.length;c<d;c++){var e=a[c],f=e;if(0==f.search("get")||0==f.search("is")){var f=e,h=0;0==f.search("get")?h=3:0==f.search("is")&&(h=2);f=f.charAt(h).toLowerCase()+f.substr(h+1);try{var k=this.j[e]();b[f]=k}catch(m){}}}b.videoData=this.j.getVideoData();return b};
g.$d=function(a){a={playerState:a,currentTime:this.j.getCurrentTime(),duration:this.j.getDuration(),videoData:this.j.getVideoData(),videoStartBytes:0,videoBytesTotal:this.j.getVideoBytesTotal(),videoLoadedFraction:this.j.getVideoLoadedFraction(),playbackQuality:this.j.getPlaybackQuality(),availableQualityLevels:this.j.getAvailableQualityLevels(),videoUrl:this.j.getVideoUrl(),playlist:this.j.getPlaylist(),playlistIndex:this.j.getPlaylistIndex()};this.j.getProgressState&&(a.progressState=this.j.getProgressState());
this.j.getStoryboardFormat&&(a.storyboardFormat=this.j.getStoryboardFormat());Dp(this,a)};g.Yd=function(a){Dp(this,{playbackQuality:a})};g.Zd=function(a){Dp(this,{playbackRate:a})};g.Xd=function(){for(var a=this.j.getOptions(),b={namespaces:a},c=0,d=a.length;c<d;c++){var e=a[c],f=this.j.getOptions(e);b[e]={options:f};for(var h=0,k=f.length;h<k;h++){var m=f[h],n=this.j.getOption(e,m);b[e][m]=n}}this.sendMessage("apiInfoDelivery",b)};g.be=function(){Dp(this,{muted:this.j.isMuted(),volume:this.j.getVolume()})};
g.ae=function(a){a={currentTime:a,videoBytesLoaded:this.j.getVideoBytesLoaded(),videoLoadedFraction:this.j.getVideoLoadedFraction()};this.j.getProgressState&&(a.progressState=this.j.getProgressState());Dp(this,a)};g.dispose=function(){Ep.L.dispose.call(this);for(var a=0;a<this.o.length;a++){var b=this.o[a];this.j.removeEventListener(b.Vd,b.listener)}this.o=[]};function Fp(a,b,c){V.call(this);this.j=a;this.k=b;this.o=c}y(Fp,V);function vp(a,b,c){if(!a.K()){var d=a.j;d.K()||a.k!=d.j||(a={id:a.o,command:b},c&&(a.data=c),d.j.postMessage(P(a),d.o))}}Fp.prototype.G=function(){this.k=this.j=null;Fp.L.G.call(this)};function Gp(a,b,c){D.call(this);this.j=a;this.o=c;this.B=M(window,"message",v(this.A,this));this.k=new Fp(this,a,b);nb(this,oa(ob,this.k))}y(Gp,D);Gp.prototype.A=function(a){if(!this.K()&&a.origin==this.o&&a.source==this.j&&(a=a.data,u(a))){try{a=vg(a)}catch(b){return}if(a.command){var c=this.k;c.K()||c.publish("command",a.command,a.data)}}};Gp.prototype.G=function(){Jc(this.B);this.j=null;Gp.L.G.call(this)};var Hp={};function Ip(a){return a?24==a.length&&"UC"==a.slice(0,2)?a.substr(2):22==a.length?a:null:null};var Jp=[];
function Kp(a,b){if(!b){var c=F("CONVERSION_CONFIG_DICT");if(!c)return;b=c.uid||null;if(!b)return}if("subscribe"==a||"unsubscribe"==a){if(u(b)){var d=Ip(b);d&&(d={label:"followon_"+a,foc_id:d,r:Math.round(1E4*Math.random())},(d=dd("//googleads.g.doubleclick.net/pagead/viewthroughconversion/962985656/",d))&&d&&bg(d))}}else t:{c=F("CONVERSION_CONFIG_DICT");if(u(b)){var e=Ip(b);if(!c||c.uid!=e)if(c=Hp[e],!c||c.uid!=e)break t}if(a&&c&&c.baseUrl&&c.uid){var f=c.rmktEnabled,e=c.focEnabled&&(!c.isAd||"view"!=
a);if(f||e){var h={};if(f){f={utuid:c.uid,type:a,client_name:"html5"};"cvisit"==a&&(f.type="cview");c.vid&&(f.utvid=c.vid);c.eventLabel&&(f.el=c.eventLabel);c.playerStyle&&(f.ps=c.playerStyle);c.feature&&(f.feature=c.feature);c.ppe&&(f.ppe=c.ppe);c.subscribed&&(f.subscribed=c.subscribed);c.engaged&&(f.engaged=c.engaged);var k=[];for(d in f)k.push(encodeURIComponent(d)+"="+encodeURIComponent(f[d]));d=k.join(";");h.data=d}e&&(h.label="followon_"+a,h.foc_id=c.uid,h.r=Math.round(1E4*Math.random()));if("unsubscribe"==
a||"dislike"==a)h.r=Math.round(1E4*Math.random());d=dd(c.baseUrl,h)}else d=null}else d=null;d&&d&&bg(d)}};function Lp(a){S.call(this,1,arguments)}y(Lp,S);function Mp(a,b,c){S.call(this,1,arguments);this.o=a;this.k=b;this.j=c}y(Mp,S);function Np(a,b,c,d){S.call(this,1,arguments);this.o=a;this.j=b;this.B=c||null;this.k=d||null}y(Np,S);function Op(a,b){S.call(this,1,arguments);this.k=a;this.j=b||null}y(Op,S);function Pp(a){S.call(this,1,arguments)}y(Pp,S);
var Qp=new T("ypc-core-load",Lp),Rp=new T("ypc-guide-sync-success",Mp),Sp=new T("ypc-purchase-success",Np),Tp=new T("ypc-subscription-cancel",Pp),Up=new T("ypc-subscription-cancel-success",Op),Vp=new T("ypc-init-subscription",Pp);var Wp=!1,Xp=[],Jh=[];function Yp(a){a.j?Wp?U(Zh,a):U(Qp,new Lp(function(){U(Vp,new Pp(a.j))})):Zp(a.k,a.A,a.B,a.o,a.source)}function $p(a){a.j?Wp?U(ci,a):U(Qp,new Lp(function(){U(Tp,new Pp(a.j))})):aq(a.k,a.Qb,a.A,a.B,a.o,a.source)}function bq(a){cq(Oa(a.j))}function dq(a){eq(Oa(a.j))}function fq(a){gq(a.j,a.isEnabled,null,null)}function hq(a){gq(a.j,null,null,a.isEnabled)}function iq(a){jq(a.k,a.isEnabled,null,a.j)}function kq(a){jq(a.k,null,a.isEnabled,a.j)}
function lq(a,b,c,d,e){gq(a,b,c,d,e)}function mq(a){var b=a.o.subscriptionElement||null,c=a.j.subscriptionId,d=a.j.channelInfo;c&&J("subscription-subscribe-success",a.k,c,b,d)}function nq(a){var b=a.j;Va(a.o,function(a,d){J("subscription-subscribe-success",d,a,null,b[d])});J("guide-add-subscription",a.k)}function oq(a){J("subscription-unsubscribe-success",a.k.itemId,a.k.subscriptionElement||null);a.j&&(pq("subscription-unsubscribe-success",a.j),pq("subscription-enable-ypc",a.j))}
function Zp(a,b,c,d,e){var f=new Lh(a);U(Xh,f);var h={};h.c=a;d&&(h.eurl=d);e&&(h.source=e);d={};(e=F("PLAYBACK_ID"))&&(d.plid=e);c&&qq("/subscription_ajax?action_create_subscription_to_channel=1",h,c);ji("/subscription_ajax?action_create_subscription_to_channel=1",{method:"POST",jc:h,V:d,da:function(c,d){var e=d.response;J("subscription-subscribe-success",a,e.id,b,e.channel_info);e.show_feed_privacy_dialog&&J("SHOW-FEED-PRIVACY-SUBSCRIBE-DIALOG",a);(e=e.guide_notification_html_content)&&J("guide-add-subscription",
e)},onError:function(){J("subscription-subscribe-failure",a)},kc:function(){U(Yh,f)}})}
function aq(a,b,c,d,e,f){var h=new Lh(a);U(ai,h);var k={};e&&(k.eurl=e);f&&(k.source=f);e={};e.c=a;e.s=b;(b=F("PLAYBACK_ID"))&&(e.plid=b);d&&qq("/subscription_ajax?action_remove_subscriptions=1",{},d);ji("/subscription_ajax?action_remove_subscriptions=1",{method:"POST",jc:k,V:e,da:function(){J("subscription-unsubscribe-success",a,c)},onError:function(){J("subscription-unsubscribe-failure",a)},kc:function(){U(bi,h)}})}
function gq(a,b,c,d,e){if(null!==b||null!==c||null!==d){var f={};a&&(f.channel_id=a);null===b||(f.email_on_upload=b);null===c||(f.receive_no_updates=c);null===d||(f.uploads_only=d);ji("/subscription_ajax?action_update_subscription_preferences=1",{method:"POST",V:f,onError:function(){e&&e()}})}}
function cq(a){if(a.length){var b=Qa(a,0,40);U("subscription-batch-subscribe-loading");rq(b,Xh);var c={};c.a=b.join(",");var d=function(){U("subscription-batch-subscribe-loaded");rq(b,Yh)};ji("/subscription_ajax?action_create_subscription_to_all=1",{method:"POST",V:c,da:function(c,f){d();var h=f.response,k=h.id;if(ea(k)&&k.length==b.length){var m=h.channel_info_map;A(k,function(a,c){var d=b[c];J("subscription-subscribe-success",d,a,null,m[d])});(h=h.guide_notification_html_content)&&J("guide-add-subscription",
h);a.length?cq(a):U("subscription-batch-subscribe-finished")}},onError:function(){d();U("subscription-batch-subscribe-failure");pq("subscription-subscribe-failure",b)}})}}
function eq(a){if(a.length){var b=Qa(a,0,40);U("subscription-batch-unsubscribe-loading");rq(b,ai);var c={};c.c=b.join(",");var d=function(){U("subscription-batch-unsubscribe-loaded");rq(b,bi)};ji("/subscription_ajax?action_remove_subscriptions=1",{method:"POST",V:c,da:function(){d();pq("subscription-unsubscribe-success",b);a.length&&eq(a)},onError:function(){d();pq("subscription-unsubscribe-failure",b)}})}}
function jq(a,b,c,d){if(a.length&&(null!==b||null!==c)){var e=Qa(a,0,40);J("subscription-batch-prefs-loading",e);var f={};f.s=e.join(",");null!==b&&(f.email_on_upload=b,f.receive_no_updates=!b);null===c||(f.uploads_only=c);var h=function(){J("subscription-batch-prefs-loaded",e)};ji("/subscription_ajax?action_update_subscription_preferences_batch=1",{method:"POST",V:f,da:function(){h();J("subscription-batch-prefs-success",e);a.length&&jq(a,b,c,d)},onError:function(){h();d&&d();J("subscription-batch-prefs-failure",
e)}})}}function pq(a,b){A(b,function(b){J(a,b)})}function rq(a,b){A(a,function(a){U(b,new Lh(a))})}function qq(a,b,c){a=gd(a,b);c=ed(c);id(a,c)};var sq=null,tq=null,uq=null,vq=!1;var wq={},xq=0;q("yt.setConfig",sb,void 0);q("yt.setMsg",function(a){tb(rb,arguments)},void 0);
q("yt.www.errors.log",function(a,b){if(a&&window&&window.yterr&&!(5<=xq)){var c=a.stacktrace,d=a.columnNumber;var e=a,f=r("window.location.href");if(u(e))a={message:e,name:"Unknown error",lineNumber:"Not available",fileName:f,stack:"Not available"};else{var h,k,m=!1;try{h=e.lineNumber||e.line||"Not available"}catch(n){h="Not available",m=!0}try{k=e.fileName||e.filename||e.sourceURL||l.$googDebugFname||f}catch(x){k="Not available",m=!0}a=!m&&e.lineNumber&&e.fileName&&e.stack&&e.message&&e.name?e:{message:e.message||
"Not available",name:e.name||"UnknownError",lineNumber:h,fileName:k,stack:e.stack||"Not available"}}c=c||a.stack;e=a.lineNumber.toString();isNaN(e)||isNaN(d)||(e=e+":"+d);wq[a.message]||(d={jc:{a:"logerror",t:"jserror",type:a.name,msg:a.message.substr(0,1E3),line:e,level:b||"ERROR"},V:{url:window.location.href,file:a.fileName},method:"POST"},c&&(d.V.stack=c),ji("/gen_204",d),wq[a.message]=!0,xq++)}},void 0);
q("yt.embed.openLoginDialog",function(){di(function(a){if(sq.onLoginDialogSuccess)sq.onLoginDialogSuccess(a)})},void 0);
q("writeEmbed",function(){var a=new Ye(F("PLAYER_CONFIG")),b=document.referrer,c=F("POST_MESSAGE_ORIGIN"),d=!1;u(b)&&u(c)&&-1<b.indexOf(c)&&Yf(c)&&Yf(b)&&(d=!0);window!=window.top&&b&&b!=document.URL&&(a.args.loaderUrl=b);F("LIGHTWEIGHT_AUTOPLAY")&&(a.args.autoplay="1");a.args.autoplay&&Pi(a.args);sq=ih("player",a);b=F("POST_MESSAGE_ID","player");F("ENABLE_JS_API")?uq=new Ep(sq):F("ENABLE_POST_API")&&u(b)&&u(c)&&(tq=new Gp(window.parent,b,c),uq=new zp(sq,tq.k));(vq=d&&!F("ENABLE_CAST_API"))?a.args.disableCast=
"1":(a=sq,yo(),fp=a,fp.addEventListener("onReady",hp),fp.addEventListener("onRemoteReceiverSelected",jp),gp.push(I("yt-remote-receiver-availability-change",ip)),gp.push(I("yt-remote-auto-connect",kp)));F("BG_P")&&(F("BG_I")||F("BG_IU"))&&Rb();lp=sq;lp.addEventListener("SUBSCRIBE",op);lp.addEventListener("UNSUBSCRIBE",rp);mp.push(I("subscription-subscribe-success",sp));mp.push(I("subscription-unsubscribe-success",tp))},void 0);
q("yt.www.watch.ads.restrictioncookie.spr",function(a){(a=a+"mac_204?action_fcts=1")&&bg(a);return!0},void 0);
M(window,"load",function(){hg("ol");F("CSI_LOG_ON_TICK")||jg();Wp=!0;Jh.push(Hh(Wh,Yp),Hh($h,$p));Wp||(Jh.push(Hh(Zh,Yp),Hh(ci,$p),Hh(Sh,bq),Hh(Th,dq),Hh(Uh,fq),Hh(Vh,hq),Hh(Qh,iq),Hh(Rh,kq)),Xp.push(I("subscription-prefs",lq)),Jh.push(Hh(Sp,mq),Hh(Up,oq),Hh(Rp,nq)),Jp.push(I("subscription-subscribe-success",oa(Kp,"subscribe")),I("subscription-unsubscribe-success",oa(Kp,"unsubscribe")),I("player-subscribe",oa(Kp,"subscribe")),I("player-unsubscribe",oa(Kp,"unsubscribe"))))});
M(window,"unload",function(){var a=sq;a&&a.sendAbandonmentPing&&a.sendAbandonmentPing();F("PL_ATT")&&(Qb=null);Fb(Xp);Xp.length=0;Ih();Jh.length=0;Wp=!1;Fb(Jp);Jp.length=0;lp&&(lp.removeEventListener("SUBSCRIBE",pp),lp.removeEventListener("UNSUBSCRIBE",rp));lp=null;Fb(mp);vq||(Fb(gp),gp.length=0,fp&&(fp.removeEventListener("onRemoteReceiverSelected",jp),fp.removeEventListener("onReady",hp),fp=null),Oo());pb(uq,tq);sq.destroy()});var yq=Fi.getInstance(),zq=ti(yq);
zq in Ki||(yq.register(),ui(yq,"yt-uix-init-"+zq,yq.init),ui(yq,"yt-uix-dispose-"+zq,yq.dispose),Ki[zq]=yq);})();
