(function(g){var window=this;/* SPDX-License-Identifier: Apache-2.0 */ /* Copyright 2017 Google LLC SPDX-License-Identifier: BSD-3-Clause */ 'use strict';var Fgb=function(a){a.mutedAutoplay=!1;a.endSeconds=NaN;a.limitedPlaybackDurationInSeconds=NaN;g.XP(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()},Ggb=function(a){g.Ho(a); for(var b=0;bb;)a.pop()},Kgb=function(a){a=Array(a); c4(a,0);return a},Lgb=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)}},Ngb=function(a,b,c){a=a.style; if(typeof c==="string")a.cssText=c;else{a.cssText="";for(var d in c)if(Mgb.call(c,d)){b=a;var e=d,f=c[d];e.indexOf("-")>=0?b.setProperty(e,f):b[e]=f}}},Ogb=function(a,b,c){var d=typeof c; d==="object"||d==="function"?a[b]=c:Lgb(a,b,c)},Pgb=function(){var a=new Jgb; a.__default=Ogb;a.style=Ngb;return a},Qgb=function(a,b,c,d){(d[b]||d.__default)(a,b,c)},Rgb=function(a){this.created=[]; this.j=[];this.node=a},Sgb=function(a,b){this.j=null; this.B=a;this.key=b;this.text=void 0},Tgb=function(a,b,c){b=new Sgb(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=Tgb(a,c,a.nodeType===1?d||b:null);if(a.nodeType===1&&(a=a.attributes,c=a.length)){d=b.j||(b.j=Kgb(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}},Wgb=function(a,b){Vgb(a,b); e4=i4;i4=null;return e4},Ygb=function(a,b){b=b===void 0?{}:b; var c=b.matches===void 0?Ugb: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 Rgb(d);j4=c;m4=[];i4=null;var t=e4=d.parentNode,u,y=Xgb.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}}},Zgb=function(a,b,c,d){o4.push(Qgb); o4.push(a);o4.push(b);o4.push(c);o4.push(d)},$gb=function(a){Vgb("#text",null); var b=i4;var c=d4(b);if(c.text!==a){c=c.text=a;for(var d=1;d0;){d=c.pop();try{d.Bv()}finally{a.delete(d)}}}chb.delete(a)}else for(b=g.w(a),c=b.next();!c.done;c=b.next())c=c.value,a.delete(c),c.Bv()},fhb=function(){var a; g.J(function(b){if(b.j==1)return a=ehb,ehb=new Set,g.F(b,Promise.resolve(),2);dhb(a);g.va(b)})},ghb=function(){return Array.from(chb).map(function(a){return Array.from(a)})},ihb=function(a){var b=a.component; var c=a.debugInstance;a=a.mx;var d,e=(d=b.Ak)!=null?d:b.name;q4.push({name:c?e+" ("+c+")":e,xR:b.componentType===hhb});b=a();q4.pop();return b},r4=function(){var a=q4[q4.length-1]; return a?a.xR||!1:!1},s4=function(a,b){b=b===void 0?{}:b; var c=q4.length;b.stack&&(q4=[].concat(g.x(b.stack)));try{return a()}catch(d){throw a=d,jhb(a),a!==khb&&(lhb=q4.slice()),khb=a,a;}finally{c=q4.length-c,c>0&&q4.splice(-c)}},jhb=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[mhb]){var c=q4.slice();b.cF||(b.cF=[]);b.cF.push(function(){return void s4(function(){return void a()},{stack:c})})}},ohb=function(a){var b=t4; b&&!b.Ja&&(u4(function(){return void nhb(a)}),a.parent=b)},qhb=function(a){if(a.cF){var b={stack:[], error:void 0,hasError:!1};try{$3(b,b4(phb));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}},nhb=function(a){if(!a.Ja){a.Ja=!0; var b;(b=a[Symbol.dispose])==null||b.call(a);delete a.parent;qhb(a)}},rhb=function(){g.Ho(this); if(g.Fo(this))for(var a=0;a=0;d--)c.removeChild(a[d])}else c.textContent="",c.appendChild(b);return b},Nhb=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];l0&&(b.children=c.length===1?c[0]:c);var f=b;if(a.componentType===hhb)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.Zy(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?Yhb(a,b):h}}); var d=document.createElement(a),e;for(e in b)A4(d,e,b[e]);Whb(d,b);O4(c,d);Ihb(d,b,{xR:!0});return d},$hb=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,Vhb(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=Wgb(c,a.props.idomKey);a.Hr=!0;var f=e.__instance}f||(f=vib(b,a.props),f.props=null,e&&(e.__instance=f,f.el=e));var h;c=((h=f.xO)!=null?h:{hS:f.state,i_:!1}).hS;f.xO=void 0;b.r9&&(c=b.r9(a.props,c));f.props=a.props;f.state=c;h=function(){var l=f;S4.FX(l);var m=l.Zy(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=X4(m),a.Hr=m.Hr,!b.Ft)if(l)b.Ft=l.tagName.toLowerCase(),l.__instance=f,f.el=l;else{var n;if((n=f.QA)==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)?ihb({component:c,debugInstance:f.props.debugInstance,mx:h}):h()}},tib=function(a){var b=a.type; if(b.componentType!==hhb)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.V3){var f;(f=c.wqa)==null||f.call(c,a.props);wib(c);return!0}f=t4;b=b.V3(a.props,c.props,f!==null?f:c.context,c.u$);f=xib(b);yib(a.props,c.props);f>0?X4(b):i4=f4();return!0}if(zib.has(b.name)&&a.props.allowIdomInterop!== Aib)throw Error(b.name+" can not be called from a IDOM component. See go/cow-errors#control-flow-component-called-from-Idom-Component");(b=ihb({component:a.type,debugInstance:a.props.debugInstance,mx:function(){return Yhb(a.type,a.props)}}))&&Bib(b); return!0},xib=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},yib=function(a,b){b&&(b.children=a.children,b.C8=a.C8,b.fallback=a.fallback)},Cib=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(Kib(!1)),f=e.next().value,h=e.next().value,l=g.w(Kib(!1));e=l.next().value;var m=l.next().value,n=W4(),p=Nib(a.J,a.Ne),q=W4();l=Fib();var r=Fib();U4(function(){var y=a.J,B=y.fd()?157212:172777;r.value=new g.O;y.createClientVe(q.value,r.value,B);y.addEventListener("presentingplayerstatechange",d);y.addEventListener("videodatachange",c);B=y.U().controlsType==="0";g.gp(y.getRootNode(),"ytp-pause-overlay-controls-hidden",B);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.gp(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(Lib,{J:a.J,Ne:a.Ne,action:function(){m(!0)}}),T4(Mib,{J:a.J, Ne:a.Ne,action:function(){m(!1)}, HM:l}),T4("div",{el:n,skip:!0}))},Pib=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.wE(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":"Show previous suggested videos"},V:[g.qx()]});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":"Show more suggested videos"},V:[g.rx()]});g.P(this,this.G);a=a.U();this.api.L("embeds_web_enable_pause_overlay_rounding")&&g.cp(this.element,"ytp-error-overlay-round-corners");this.Y=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.g5,this);g.P(this,this.oa);for(var c={UA:0};c.UA<16;c={UA:c.UA},c.UA++){var d=new g.T({I:"a",S:"ytp-suggestion-link",W:{href:"{{link}}",target:a.Y,"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.jm(e,"transitionDelay",c.UA/20+"s");this.G.T(e,"click",function(f){return function(h){var l=f.UA,m=b.suggestionData[l],n=m.sessionData;g.EO(b.api.U())&&b.api.L("web_player_log_click_before_generating_ve_conversion_params")?(b.api.logClick(b.j[l].element),l=m.Pl(),m={},g.AR(b.api,m),l=g.Oi(l,m),g.yS(l,b.api,h)):g.xS(h,b.api,b.Y,n||void 0)&&b.api.Fp(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.f5,this);this.G.T(this.api,"videodatachange",this.onVideoDataChange);this.resize(this.api.ob().getPlayerSize());this.onVideoDataChange();this.show()},Qib=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)},Rib=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.gp(a.element,"ytp-scroll-min",b>=0);g.gp(a.element,"ytp-scroll-max",b<=c)},Sib=function(a){for(var b=0;b