(function(g){var window=this;/* Copyright 2017 Google LLC SPDX-License-Identifier: BSD-3-Clause */ 'use strict';var Iib=function(a){a.mutedAutoplay=!1;a.endSeconds=NaN;a.limitedPlaybackDurationInSeconds=NaN;g.eR(a)},Jib=function(a){g.bp(a); for(var b=0;bb;)a.pop()},Kib=function(a){a=Array(a); t4(a,0);return a},Lib=function(a,b,c,d){(d[b]||d.__default)(a,b,c)},Mib=function(a,b){this.j=null; this.B=a;this.key=b;this.text=void 0},Nib=function(a,b,c){b=new Mib(b,c); return a.__incrementalDOMData=b},u4=function(a,b){if(a.__incrementalDOMData)return a.__incrementalDOMData; var c=a.nodeType===1?a.localName:a.nodeName,d=a.nodeType===1?a.getAttribute("key"):null;b=Nib(a,c,a.nodeType===1?d||b:null);if(a.nodeType===1&&(a=a.attributes,c=a.length)){d=b.j||(b.j=Kib(c*2));for(var e=0,f=0;e=0)for(b= g.jp,c=a.nextSibling,d=g.np;d!==null&&d!==a;)e=d.nextSibling,b.insertBefore(d,c),d=e;else g.jp.insertBefore(a,g.np);g.np=a}},Pib=function(a,b){Oib(a,b); g.jp=g.np;g.np=null;return g.jp},Qib=function(a,b,c,d){v4.push(Lib); v4.push(a);v4.push(b);v4.push(c);v4.push(d)},Rib=function(a){Oib("#text",null); var b=g.np;var c=u4(b);if(c.text!==a){c=c.text=a;for(var d=1;d0;){d=c.pop();try{d.pz()}finally{a.delete(d)}}}Vib.delete(a)},Yib=function(){var a; g.J(function(b){if(b.j==1)return a=Xib,Xib=new Set,g.G(b,Promise.resolve(),2);Wib(a);g.va(b)})},Zib=function(){return Array.from(Vib).map(function(a){return Array.from(a)})},$ib=function(a){var b=a.component; var c=a.debugInstance;a=a.Bx;var d,e=(d=b.du)!=null?d:b.name;y4.push({name:c?e+" ("+c+")":e,AR:b.componentType!==z4});b=a();y4.pop();return b},A4=function(){var a=y4[y4.length-1]; return a?a.AR||!1:!1},B4=function(a,b){b=b===void 0?{}:b; var c=y4.length;b.stack&&(y4=[].concat(g.x(b.stack)));try{return a()}catch(d){throw a=d,ajb(a),a!==bjb&&(cjb=y4.slice()),bjb=a,a;}finally{c=y4.length-c,c>0&&y4.splice(-c)}},ajb=function(a){var b=y4; if(b.length!==0&&!a.WE){var c=b.slice(-20).reverse().map(function(d){return d.name}).join(" > "); c=a.message+"\n\nComponent stack: "+c;try{a.WE=b.slice(),g.tp.H8&&(a.stack&&(a.stack=a.stack.replace(a.message,c)),a.message=c)}catch(d){}}},C4=function(a){var b=w4; if(b){var c=y4.slice();b.lF||(b.lF=[]);b.lF.push(function(){return void B4(function(){return void a()},{stack:c})})}},ejb=function(a){var b=w4; b&&!b.Ja&&(C4(function(){return void djb(a)}),a.parent=b)},gjb=function(a){if(a.lF){var b={stack:[], error:void 0,hasError:!1};try{g.cb(b,s4(fjb));for(var c=g.w(a.lF),d=c.next();!d.done;d=c.next()){var e=d.value;e()}}catch(f){b.error=f,b.hasError=!0}finally{g.eb(b)}a.lF.length=0}},djb=function(a){if(!a.Ja){a.Ja=!0; var b;(b=a[Symbol.dispose])==null||b.call(a);delete a.parent;gjb(a)}},hjb=function(){g.bp(this); if(g.$o(this))for(var a=0;a=0;d--)c.removeChild(a[d])}else c.textContent="",c.appendChild(b);return b},Fjb=function(a,b){if(a[0].parentElement)for(var c=a[0].parentElement,d=b.length,e=a.length,f=d,h=0,l=0,m=a[e-1].nextSibling,n=null;hp-l)for(q=a[h];l1)throw Error("Script tags can contain at most 1 child. Got "+c.length+": ["+c.map(Cjb).join(", ")+"]");c=c[0]}if(c!=null){if(!(c instanceof g.dg)){var f,h;if((f=window)==null?0:(h=f.trustedTypes)==null?0:h.isScript(c))throw Error("Do not use a TrustedScript instance in a script tag directly. Use a SafeScript instead.");if(String(c).trim().length=== 0)break a;throw Error("Script tags must only contain SafeScript or LegacyScript instances. Got: "+Cjb(c));}b.textContent=g.eg(c);g.fg(b)}}else{O4(a)&&(a=N4(a),d&&c&&(d[e]=a));P4(a)&&(a=N4(a.toString()),d&&c&&(d[e]=a));if(R4(a))return Kjb(b,a);if(Array.isArray(a)){for(f=0;f0&&(b.children=c.length===1?c[0]:c);var f=b;if(a.componentType!==z4)var h=!1;else{f||(f={});h=new X4(f);h.j=a;b:{var l={stack:[],error:void 0,hasError:!1};try{g.cb(l,s4(g.J1));var m=h.mz(f);break b}catch(n){l.error=n,l.hasError=!0}finally{g.eb(l)}m=void 0}f=m;f instanceof HTMLElement?(f.__instance=h,h.el=f,h.B=a,a.Nt=f.tagName.toLowerCase(),Y4.hF(h),h=f):h=f}return h=== !1?Rjb(a,b):h}}); var d=document.createElement(a),e;for(e in b)H4(d,e,b[e]);Pjb(d,b);U4(c,d);yjb(d,b,{AR:!0});return d},Tjb=function(a){if(a){var b; (b=a._disposeRef)==null||b.call(a);var c;(c=a._disposeEffects)==null||c.call(a);a.__instance&&a.__instance instanceof V4&&(b=a.__instance,Ojb(b,a),b instanceof X4&&b.G());for(b=0;b0&&(a.props.children=a.children);var d;(d=a.props).idomKey||(d.idomKey=b);if(c){var e=Pib(c,a.props.idomKey);a.Hr=!0;var f=e.__instance}f||(f=mkb(b,a.props),f.props=null,e&&(e.__instance=f,f.el=e));var h;c=((h=f.BO)!=null?h:{kS:f.state,k_:!1}).kS;f.BO=void 0;b.v9&&(c=b.v9(a.props,c));f.props=a.props;f.state=c;h=function(){var l=f;Y4.JX(l);var m=l.mz(l.props);m?(l.props.idomKey&&(m.props.idomKey=l.props.idomKey),l=m):l=void 0; if(m=l)if(m.Hr=a.Hr,l=c5(m),a.Hr=m.Hr,!b.Nt)if(l)b.Nt=l.tagName.toLowerCase(),l.__instance=f,f.el=l;else{var n;if((n=f.aB)==null?0:n.length){var p;(p=g.tp.handleError)==null||p.call.apply(p,[g.tp].concat(g.x(F4(Error("A component used hooks, but failed to return a host element")))))}}f.hF();Y4.hF(f)}; (c=f.j)?$ib({component:c,debugInstance:f.props.debugInstance,Bx:h}):h()}},jkb=function(a){var b=a.type; if(!lkb(b)||b===ekb||b.componentType===z4)return!1;a.props.children=a.children.length>1?a.children:a.children[0];var c,d=(c=a.props.idomKey)!=null?c:a.type,e;if(g.kp()&&((e=g.kp()[S4])==null?void 0:e.key)===d){b=g.kp();c=b[S4];if(!c)throw Error("Reactive data has been lost on node. Tag name: "+b.tagName);var f;(f=c.Eqa)==null||f.call(c,a.props);nkb(c);return!0}if(okb.has(b.name))throw Error(b.name+" can not be called from a IDOM component. See go/cow-errors#control-flow-component-called-from-Idom-Component"); (f=$ib({component:a.type,debugInstance:a.props.debugInstance,Bx:function(){return Rjb(a.type,a.props)}}))&&pkb(f); return!0},qkb=function(a){for(var b=0;b0&&h(g.U(y,4)&&!g.U(y,2)&&!g.U(y,1024))}} function c(){b(a.J.getPlayerStateObject())} function d(y){b(y.state)} var e=g.w(ykb(!1)),f=e.next().value,h=e.next().value,l=g.w(ykb(!1));e=l.next().value;var m=l.next().value,n=b5(),p=Bkb(a.J,a.Re),q=b5();l=tkb();var r=tkb();$4(function(){var y=a.J,A=y.fd()?157212:172777;r.value=new g.O;y.createClientVe(q.value,r.value,A);y.addEventListener("presentingplayerstatechange",d);y.addEventListener("videodatachange",c);A=y.U().controlsType==="0";g.Qp(y.getRootNode(),"ytp-pause-overlay-controls-hidden",A);return function(){y.removeEventListener("videodatachange",c);y.removeEventListener("presentingplayerstatechange", d);var C;(C=r.value)==null||C.dispose()}},[a.J]); $4(function(){var y;(y=p.value)==null||y.Ha(n.value)},[p]); var t=a.J;if(f)if(g.Qp(t.getRootNode(),"ytp-expand-pause-overlay",!e),e)l.value.focus();else{var u=p.value;g.t1(u);u.show();q.value.focus()}q.value&&t.logVisibility(q.value,f&&!e);return Z4("ytp-pause-overlay",{el:q,class:"ytp-pause-overlay","aria-hidden":!f},Z4(zkb,{J:a.J,Re:a.Re,action:function(){m(!0)}}),Z4(Akb,{J:a.J, Re:a.Re,action:function(){m(!1)}, QM:l}),Z4("div",{el:n,skip:!0}))},Dkb=function(a){g.S.call(this,{I:"div", S:"ytp-related-on-error-overlay"});var b=this;this.api=a;this.K=this.B=0;this.G=new g.kG(this);this.j=[];this.suggestionData=[];this.columns=this.containerWidth=0;this.title=new g.S({I:"h2",S:"ytp-related-title",va:"{{title}}"});this.previous=new g.S({I:"button",La:["ytp-button","ytp-previous"],X:{"aria-label":"Mostrar videos sugeridos anteriores"},V:[g.dy()]});this.oa=new g.r1(function(f){b.suggestions.element.scrollLeft=-f}); this.D=this.C=0;this.N=!0;this.next=new g.S({I:"button",La:["ytp-button","ytp-next"],X:{"aria-label":"Mostrar m\u00e1s videos sugeridos"},V:[g.ey()]});g.P(this,this.G);a=a.U();this.api.L("embeds_web_enable_pause_overlay_rounding")&&g.Mp(this.element,"ytp-error-overlay-round-corners");this.W=a.D;g.P(this,this.title);this.title.Ha(this.element);this.suggestions=new g.S({I:"div",S:"ytp-suggestions"});g.P(this,this.suggestions);this.suggestions.Ha(this.element);g.P(this,this.previous);this.previous.Ha(this.element); this.previous.listen("click",this.g5,this);g.P(this,this.oa);for(var c={eB:0};c.eB<16;c={eB:c.eB},c.eB++){var d=new g.S({I:"a",S:"ytp-suggestion-link",X:{href:"{{link}}",target:a.W,"aria-label":"{{aria_label}}"},V:[{I:"div",S:"ytp-suggestion-image",V:[{I:"div",X:{"data-is-live":"{{is_live}}"},S:"ytp-suggestion-duration",va:"{{duration}}"}]},{I:"div",S:"ytp-suggestion-title",X:{title:"{{hover_title}}"},va:"{{title}}"},{I:"div",S:"ytp-suggestion-author",va:"{{views_or_author}}"}]});g.P(this,d);d.Ha(this.suggestions.element); var e=d.Da("ytp-suggestion-link");g.Fm(e,"transitionDelay",c.eB/20+"s");this.G.T(e,"click",function(f){return function(h){var l=f.eB,m=b.suggestionData[l],n=m.sessionData;g.MP(b.api.U())&&b.api.L("web_player_log_click_before_generating_ve_conversion_params")?(b.api.logClick(b.j[l].element),l=m.Nl(),m={},g.iNa(b.api,m),l=g.gj(l,m),g.kT(l,b.api,h)):g.jT(h,b.api,b.W,n||void 0)&&b.api.Kp(m.videoId,n,m.playlistId)}}(c)); this.j.push(d)}g.P(this,this.next);this.next.Ha(this.element);this.next.listen("click",this.f5,this);this.G.T(this.api,"videodatachange",this.onVideoDataChange);this.resize(this.api.ob().getPlayerSize());this.onVideoDataChange();this.show()},Ekb=function(a,b){if(a.api.U().L("web_player_log_click_before_generating_ve_conversion_params"))for(var c=Math.floor(-a.C/(a.D+a.B)),d=Math.min(c+a.columns,a.suggestionData.length)-1;c<=d;c++)a.api.logVisibility(a.j[c].element,b)},Fkb=function(a){a.next.element.style.bottom= a.K+"px"; a.previous.element.style.bottom=a.K+"px";var b=a.C,c=a.containerWidth-a.suggestionData.length*(a.D+a.B);g.Qp(a.element,"ytp-scroll-min",b>=0);g.Qp(a.element,"ytp-scroll-max",b<=c)},Gkb=function(a){for(var b=0;b