(function(g){var window=this;/* SPDX-License-Identifier: Apache-2.0 */ /* Copyright 2017 Google LLC SPDX-License-Identifier: BSD-3-Clause */ 'use strict';var Wgb=function(a){a.mutedAutoplay=!1;a.endSeconds=NaN;a.limitedPlaybackDurationInSeconds=NaN;g.vQ(a)},$3=function(a,b){if(b!==null&&b!==void 0){if(typeof b!=="object"&&typeof b!=="function")throw new TypeError("Object expected."); if(c===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");var c=b[Symbol.dispose]}if(typeof c!=="function")throw new TypeError("Object not disposable.");a.stack.push({value:b,dispose:c,async:!1})}},a4=function(a){function b(d){a.error=a.hasError?new SuppressedError(d,a.error,"An error was suppressed during disposal."):d; a.hasError=!0} function c(){for(;a.stack.length;){var d=a.stack.pop();try{var e=d.dispose&&d.dispose.call(d.value);if(d.async)return Promise.resolve(e).then(c,function(f){b(f);return c()})}catch(f){b(f)}}if(a.hasError)throw a.error; } c()},Xgb=function(a){g.Ro(a); for(var b=0;b0;){d=c.pop();try{d.bz()}finally{a.delete(d)}}}$gb.delete(a)},chb=function(){var a; g.J(function(b){if(b.j==1)return a=bhb,bhb=new Set,g.F(b,Promise.resolve(),2);ahb(a);g.va(b)})},dhb=function(){return Array.from($gb).map(function(a){return Array.from(a)})},ehb=function(){},c4=function(a,b){for(;a.length>b;)a.pop()},fhb=function(a){a=Array(a); c4(a,0);return a},ghb=function(a,b,c){if(c==null)a.removeAttribute(b); else{var d=b.lastIndexOf("xml:",0)===0?"http://www.w3.org/XML/1998/namespace":b.lastIndexOf("xlink:",0)===0?"http://www.w3.org/1999/xlink":null;d?a.setAttributeNS(d,b,c):a.setAttribute(b,c)}},ihb=function(a,b,c){a=a.style; if(typeof c==="string")a.cssText=c;else{a.cssText="";for(var d in c)if(hhb.call(c,d)){b=a;var e=d,f=c[d];e.indexOf("-")>=0?b.setProperty(e,f):b[e]=f}}},jhb=function(a,b,c){var d=typeof c; d==="object"||d==="function"?a[b]=c:ghb(a,b,c)},khb=function(){var a=new ehb; a.__default=jhb;a.style=ihb;return a},lhb=function(a,b,c,d){(d[b]||d.__default)(a,b,c)},mhb=function(a){this.created=[]; this.j=[];this.node=a},nhb=function(a,b){this.j=null; this.B=a;this.key=b;this.text=void 0},ohb=function(a,b,c){b=new nhb(b,c); return a.__incrementalDOMData=b},d4=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=ohb(a,c,a.nodeType===1?d||b:null);if(a.nodeType===1&&(a=a.attributes,c=a.length)){d=b.j||(b.j=fhb(c*2));for(var e=0,f=0;e=0)for(b=e4,c=a.nextSibling, d=i4;d!==null&&d!==a;)e=d.nextSibling,b.insertBefore(d,c),d=e;else e4.insertBefore(a,i4);i4=a}},rhb=function(a,b){qhb(a,b); e4=i4;i4=null;return e4},thb=function(a,b){b=b===void 0?{}:b; var c=b.matches===void 0?phb:b.matches;return function(d,e,f){var h=g4,l=k4,m=l4,n=m4,p=i4,q=e4,r=j4;k4=d.ownerDocument;g4=new mhb(d);j4=c;m4=[];i4=null;var t=e4=d.parentNode,u,y=shb.call(d);if((u=y.nodeType===11||y.nodeType===9?y.activeElement:null)&&d.contains(u)){for(y=[];u!==t;)y.push(u),u=u.parentNode||(t?u.host:null);t=y}else t=[];l4=t;try{return a(d,e,f)}finally{d=g4,n4&&d.j.length>0&&n4(d.j),k4=l,g4=h,j4=r,m4=n,i4=p,e4=q,l4=m}}},uhb=function(a,b,c,d){o4.push(lhb); o4.push(a);o4.push(b);o4.push(c);o4.push(d)},vhb=function(a){qhb("#text",null); var b=i4;var c=d4(b);if(c.text!==a){c=c.text=a;for(var d=1;d0&&q4.splice(-c)}},Ahb=function(a){var b=q4; if(b.length!==0&&!a.OE){var c=b.slice(-20).reverse().map(function(d){return d.name}).join(" > "); c=a.message+"\n\nComponent stack: "+c;try{a.OE=b.slice(),p4.E8&&(a.stack&&(a.stack=a.stack.replace(a.message,c)),a.message=c)}catch(d){}}},u4=function(a){var b=t4; if(b&&!b[Dhb]){var c=q4.slice();b.cF||(b.cF=[]);b.cF.push(function(){return void s4(function(){return void a()},{stack:c})})}},Fhb=function(a){var b=t4; b&&!b.Ja&&(u4(function(){return void Ehb(a)}),a.parent=b)},Hhb=function(a){if(a.cF){var b={stack:[], error:void 0,hasError:!1};try{$3(b,b4(Ghb));for(var c=g.w(a.cF),d=c.next();!d.done;d=c.next()){var e=d.value;e()}}catch(f){b.error=f,b.hasError=!0}finally{a4(b)}a.cF.length=0}},Ehb=function(a){if(!a.Ja){a.Ja=!0; var b;(b=a[Symbol.dispose])==null||b.call(a);delete a.parent;Hhb(a)}},Ihb=function(){g.Ro(this); if(g.Po(this))for(var a=0;a=0;d--)c.removeChild(a[d])}else c.textContent="",c.appendChild(b);return b},dib=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(iib).join(", ")+"]");c=c[0]}if(c!=null){if(!(c instanceof g.Yf)){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: "+iib(c));}b.textContent=g.Zf(c);g.$f(b)}}else{I4(a)&&(a=H4(a),d&&c&&(d[e]=a));J4(a)&&(a=H4(a.toString()),d&&c&&(d[e]=a));if(L4(a))return jib(b,a);if(Array.isArray(a)){for(f=0;f0&&(b.children=c.length===1?c[0]:c);var f=b;if(a.componentType===yhb)var h=!1;else{f||(f={});h=new R4(f);h.B=a;b:{var l={stack:[],error:void 0,hasError:!1};try{$3(l,b4(g.t1));var m=h.Wy(f);break b}catch(n){l.error=n,l.hasError=!0}finally{a4(l)}m=void 0}f=m;f instanceof HTMLElement?(f.__instance=h,h.el=f,h.j=a,a.Ft=f.tagName.toLowerCase(),S4.YE(h),h=f):h=f}return h=== !1?pib(a,b):h}}); var d=document.createElement(a),e;for(e in b)A4(d,e,b[e]);nib(d,b);O4(c,d);Zhb(d,b,{qR:!0});return d},rib=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 P4&&(b=a.__instance,mib(b,a),b instanceof R4&&b.G());for(b=0;b0&&(a.props.children=a.children);var d;(d=a.props).idomKey||(d.idomKey=b);if(c){var e=rhb(c,a.props.idomKey);a.Jr=!0;var f=e.__instance}f||(f=Nib(b,a.props),f.props=null,e&&(e.__instance=f,f.el=e));var h;c=((h=f.sO)!=null?h:{aS:f.state,c_:!1}).aS;f.sO=void 0;b.t9&&(c=b.t9(a.props,c));f.props=a.props;f.state=c;h=function(){var l=f;S4.zX(l);var m=l.Wy(l.props);m?(l.props.idomKey&&(m.props.idomKey=l.props.idomKey),l=m):l=void 0; if(m=l)if(m.Jr=a.Jr,l=X4(m),a.Jr=m.Jr,!b.Ft)if(l)b.Ft=l.tagName.toLowerCase(),l.__instance=f,f.el=l;else{var n;if((n=f.OA)==null?0:n.length){var p;(p=p4.handleError)==null||p.call.apply(p,[p4].concat(g.x(x4(Error("A component used hooks, but failed to return a host element")))))}}f.YE();S4.YE(f)}; (c=f.B)?zhb({component:c,debugInstance:f.props.debugInstance,mx:h}):h()}},Lib=function(a){var b=a.type; if(b.componentType!==yhb)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(f4()&&((e=f4()[M4])==null?void 0:e.key)===d){d=f4();c=d[M4];if(!c)throw Error("Reactive data has been lost on node. Tag name: "+d.tagName);if(!b.R3){var f;(f=c.Dqa)==null||f.call(c,a.props);Oib(c);return!0}f=t4;b=b.R3(a.props,c.props,f!==null?f:c.context,c.x$);f=Pib(b);Qib(a.props,c.props);f>0?X4(b):i4=f4();return!0}if(Rib.has(b.name)&&a.props.allowIdomInterop!== Sib)throw Error(b.name+" can not be called from a IDOM component. See go/cow-errors#control-flow-component-called-from-Idom-Component");(b=zhb({component:a.type,debugInstance:a.props.debugInstance,mx:function(){return pib(a.type,a.props)}}))&&Tib(b); return!0},Pib=function(a){if(a){if(Array.isArray(a)){var b=0; a=g.w(a);for(var c=a.next();!c.done;c=a.next())(c=c.value)&&(b=c.type===D4?b+c.children.length:b+1);return b}if(a.type===D4)return a.children.length}else return 0;return 1},Qib=function(a,b){b&&(b.children=a.children,b.C8=a.C8,b.fallback=a.fallback)},Uib=function(a){for(var b=0;b0&&h(g.Z(y,4)&&!g.Z(y,2)&&!g.Z(y,1024))}} function c(){b(a.J.getPlayerStateObject())} function d(y){b(y.state)} var e=g.w(bjb(!1)),f=e.next().value,h=e.next().value,l=g.w(bjb(!1));e=l.next().value;var m=l.next().value,n=W4(),p=ejb(a.J,a.Oe),q=W4();l=Xib();var r=Xib();U4(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.rp(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]); U4(function(){var y;(y=p.value)==null||y.Ia(n.value)},[p]); var t=a.J;if(f)if(g.rp(t.getRootNode(),"ytp-expand-pause-overlay",!e),e)l.value.focus();else{var u=p.value;g.e1(u);u.show();q.value.focus()}q.value&&t.logVisibility(q.value,f&&!e);return T4("ytp-pause-overlay",{el:q,class:"ytp-pause-overlay","aria-hidden":!f},T4(cjb,{J:a.J,Oe:a.Oe,action:function(){m(!0)}}),T4(djb,{J:a.J, Oe:a.Oe,action:function(){m(!1)}, CM:l}),T4("div",{el:n,skip:!0}))},gjb=function(a){g.T.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.JE(this);this.j=[];this.suggestionData=[];this.columns=this.containerWidth=0;this.title=new g.T({I:"h2",S:"ytp-related-title",va:"{{title}}"});this.previous=new g.T({I:"button",La:["ytp-button","ytp-previous"],W:{"aria-label":"Mostrar v\u00eddeos sugeridos anteriores"},V:[g.Dx()]});this.oa=new g.c1(function(f){b.suggestions.element.scrollLeft=-f}); this.D=this.C=0;this.N=!0;this.next=new g.T({I:"button",La:["ytp-button","ytp-next"],W:{"aria-label":"Mostrar mais v\u00eddeos sugeridos"},V:[g.Ex()]});g.P(this,this.G);a=a.U();this.api.L("embeds_web_enable_pause_overlay_rounding")&&g.np(this.element,"ytp-error-overlay-round-corners");this.X=a.D;g.P(this,this.title);this.title.Ia(this.element);this.suggestions=new g.T({I:"div",S:"ytp-suggestions"});g.P(this,this.suggestions);this.suggestions.Ia(this.element);g.P(this,this.previous);this.previous.Ia(this.element); this.previous.listen("click",this.d5,this);g.P(this,this.oa);for(var c={SA:0};c.SA<16;c={SA:c.SA},c.SA++){var d=new g.T({I:"a",S:"ytp-suggestion-link",W:{href:"{{link}}",target:a.X,"aria-label":"{{aria_label}}"},V:[{I:"div",S:"ytp-suggestion-image",V:[{I:"div",W:{"data-is-live":"{{is_live}}"},S:"ytp-suggestion-duration",va:"{{duration}}"}]},{I:"div",S:"ytp-suggestion-title",W:{title:"{{hover_title}}"},va:"{{title}}"},{I:"div",S:"ytp-suggestion-author",va:"{{views_or_author}}"}]});g.P(this,d);d.Ia(this.suggestions.element); var e=d.Ea("ytp-suggestion-link");g.um(e,"transitionDelay",c.SA/20+"s");this.G.T(e,"click",function(f){return function(h){var l=f.SA,m=b.suggestionData[l],n=m.sessionData;g.cP(b.api.U())&&b.api.L("web_player_log_click_before_generating_ve_conversion_params")?(b.api.logClick(b.j[l].element),l=m.Ol(),m={},g.$R(b.api,m),l=g.Yi(l,m),g.WS(l,b.api,h)):g.VS(h,b.api,b.X,n||void 0)&&b.api.Ip(m.videoId,n,m.playlistId)}}(c)); this.j.push(d)}g.P(this,this.next);this.next.Ia(this.element);this.next.listen("click",this.c5,this);this.G.T(this.api,"videodatachange",this.onVideoDataChange);this.resize(this.api.qb().getPlayerSize());this.onVideoDataChange();this.show()},hjb=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)},ijb=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.rp(a.element,"ytp-scroll-min",b>=0);g.rp(a.element,"ytp-scroll-max",b<=c)},jjb=function(a){for(var b=0;b