(function(g){var window=this;'use strict';var tgb=function(a,b){a.Ma("onAutonavCoundownStarted",b)},$5=function(a,b,c){g.Vp(a.element,"ytp-suggestion-set",!!b.videoId); var d=b.playlistId;c=b.qg(c?c:"mqdefault.jpg");var e=null,f=null;b instanceof g.DL&&(b.lengthText?(e=b.lengthText||null,f=b.uv||null):b.lengthSeconds&&(e=g.ZQ(b.lengthSeconds),f=g.ZQ(b.lengthSeconds,!0)));var h=!!d;d=h&&"RD"===g.BL(d).type;var l=b instanceof g.DL?b.isLivePlayback:null,m=b instanceof g.DL?b.isUpcoming:null,n=b.author,p=b.shortViewCount,q=b.publishedTimeText,r=[],u=[];n&&r.push(n);p&&(r.push(p),u.push(p));q&&u.push(q);c={title:b.title,author:n,author_and_views:r.join(" \u2022 "),aria_label:b.ariaLabel|| g.hO("Watch $TITLE",{TITLE:b.title}),duration:e,timestamp:f,url:b.xk(),is_live:l,is_upcoming:m,is_list:h,is_mix:d,background:c?"background-image: url("+c+")":"",views_and_publish_time:u.join(" \u2022 "),autoplayAlternativeHeader:b.Dr};b instanceof g.CL&&(c.playlist_length=b.playlistLength);a.update(c)},a6=function(a){var b=a.T(),c=b.C; g.T.call(this,{G:"a",N:"ytp-autonav-suggestion-card",X:{href:"{{url}}",target:c?b.Y:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},W:[{G:"div",Ia:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],X:{style:"{{background}}"},W:[{G:"div",X:{"aria-label":"{{timestamp}}"},Ia:["ytp-autonav-timestamp"],qa:"{{duration}}"},{G:"div",Ia:["ytp-autonav-live-stamp"],qa:"Live"},{G:"div", Ia:["ytp-autonav-upcoming-stamp"],qa:"Upcoming"},{G:"div",N:"ytp-autonav-list-overlay",W:[{G:"div",N:"ytp-autonav-mix-text",qa:"Mix"},{G:"div",N:"ytp-autonav-mix-icon"}]}]},{G:"div",Ia:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],qa:"{{title}}"},{G:"div",Ia:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],qa:"{{author}}"},{G:"div",Ia:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],qa:"{{views_and_publish_time}}"}]});this.F=a;this.suggestion= null;this.j=c;this.Qa("click",this.onClick);this.Qa("keypress",this.onKeyPress)},b6=function(a,b){b=void 0===b?!1:b; g.T.call(this,{G:"div",N:"ytp-autonav-endscreen-countdown-overlay"});var c=this;this.I=b;this.D=void 0;this.B=0;this.container=new g.T({G:"div",N:"ytp-autonav-endscreen-countdown-container"});g.D(this,this.container);this.container.Ea(this.element);b=a.T();var d=b.C;this.F=a;this.suggestion=null;this.onVideoDataChange("newdata",this.F.getVideoData());this.S(a,"videodatachange",this.onVideoDataChange);this.j=new g.T({G:"div",N:"ytp-autonav-endscreen-upnext-container",X:{"aria-label":"{{aria_label}}", "data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},W:[{G:"div",N:"ytp-autonav-endscreen-upnext-header"},{G:"div",N:"ytp-autonav-endscreen-upnext-alternative-header",qa:"{{autoplayAlternativeHeader}}"},{G:"a",N:"ytp-autonav-endscreen-link-container",X:{href:"{{url}}",target:d?b.Y:""},W:[{G:"div",N:"ytp-autonav-endscreen-upnext-thumbnail",X:{style:"{{background}}"},W:[{G:"div",X:{"aria-label":"{{timestamp}}"},Ia:["ytp-autonav-timestamp"], qa:"{{duration}}"},{G:"div",Ia:["ytp-autonav-live-stamp"],qa:"Live"},{G:"div",Ia:["ytp-autonav-upcoming-stamp"],qa:"Upcoming"}]},{G:"div",N:"ytp-autonav-endscreen-video-info",W:[{G:"div",N:"ytp-autonav-endscreen-premium-badge"},{G:"div",N:"ytp-autonav-endscreen-upnext-title",qa:"{{title}}"},{G:"div",N:"ytp-autonav-endscreen-upnext-author",qa:"{{author}}"},{G:"div",N:"ytp-autonav-view-and-date",qa:"{{views_and_publish_time}}"},{G:"div",N:"ytp-autonav-author-and-view",qa:"{{author_and_views}}"}]}]}]}); g.D(this,this.j);this.j.Ea(this.container.element);d||this.S(this.j.Da("ytp-autonav-endscreen-link-container"),"click",this.rQ);this.F.sb(this.container.element,this,115127);this.F.sb(this.j.Da("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.T({G:"div",N:"ytp-autonav-overlay"});g.D(this,this.overlay);this.overlay.Ea(this.container.element);this.u=new g.T({G:"div",N:"ytp-autonav-endscreen-button-container"});g.D(this,this.u);this.u.Ea(this.container.element);this.cancelButton= new g.T({G:"button",Ia:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",b.K("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],X:{"aria-label":"Cancel autoplay"},qa:"Cancel"});g.D(this,this.cancelButton);this.cancelButton.Ea(this.u.element);this.cancelButton.Qa("click",this.BZ,this);this.F.sb(this.cancelButton.element,this,115129);this.playButton=new g.T({G:"a",Ia:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-play-button", b.K("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],X:{href:"{{url}}",role:"button","aria-label":"Play next video"},qa:"Play Now"});g.D(this,this.playButton);this.playButton.Ea(this.u.element);this.playButton.Qa("click",this.rQ,this);this.F.sb(this.playButton.element,this,115130);this.C=new g.Jp(function(){ugb(c)},500); g.D(this,this.C);this.qQ();this.S(a,"autonavvisibility",this.qQ);this.F.K("web_autonav_color_transition")&&(this.S(a,"autonavchange",this.AZ),this.S(a,"onAutonavCoundownStarted",this.m5))},c6=function(a){var b=a.F.wk(!0,a.F.isFullscreen()); g.Vp(a.container.element,"ytp-autonav-endscreen-small-mode",a.gh(b));g.Vp(a.container.element,"ytp-autonav-endscreen-is-premium",!!a.suggestion&&!!a.suggestion.UH);g.Vp(a.F.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!a.F.Of());g.Vp(a.F.getRootNode(),"countdown-running",a.Dk());g.Vp(a.container.element,"ytp-player-content",a.F.Of());g.Rm(a.overlay.element,{width:b.width+"px"});if(!a.Dk()){a.F.Of()?vgb(a,Math.round(wgb(a)/1E3)):vgb(a);b=!!a.suggestion&&!!a.suggestion.Dr;var c=a.F.Of()||!b; g.Vp(a.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!c&&b);g.Vp(a.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",c&&!b);g.WP(a.u,a.F.Of());g.Vp(a.element,"ytp-enable-w2w-color-transitions",xgb(a))}},ugb=function(a){var b=wgb(a),c=Math,d=c.min; var e=a.B?Date.now()-a.B:0;c=d.call(c,e,b);vgb(a,Math.ceil((b-c)/1E3));500>=b-c&&a.Dk()?a.select(!0):a.Dk()&&a.C.start()},wgb=function(a){if(a.F.isFullscreen()){var b; a=null==(b=a.F.getVideoData())?void 0:b.AI;return-1===a||void 0===a?8E3:a}return 0<=a.F.Vr()?a.F.Vr():g.fJ(a.F.T().experiments,"autoplay_time")||1E4},xgb=function(a){var b; return!(null==(b=a.F.getVideoData())||!b.watchToWatchTransitionRenderer)},vgb=function(a,b){b=void 0===b?-1:b; a=a.j.Da("ytp-autonav-endscreen-upnext-header");g.sf(a);if(0<=b){b=String(b);var c="Up next in $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],d="Up next in $SECONDS".indexOf(c);if(0<=d){a.appendChild(g.nf("Up next in $SECONDS".slice(0,d)));var e=g.mf("span");g.Pp(e,"ytp-autonav-endscreen-upnext-header-countdown-number");g.xf(e,b);a.appendChild(e);a.appendChild(g.nf("Up next in $SECONDS".slice(d+c.length)));return}}g.xf(a,"Up next")},d6=function(a,b){g.T.call(this,{G:"div", Ia:["html5-endscreen","ytp-player-content",b||"base-endscreen"]});this.created=!1;this.player=a},e6=function(a){g.T.call(this,{G:"div", Ia:["ytp-upnext","ytp-player-content"],X:{"aria-label":"{{aria_label}}"},W:[{G:"div",N:"ytp-cued-thumbnail-overlay-image",X:{style:"{{background}}"}},{G:"span",N:"ytp-upnext-top",W:[{G:"span",N:"ytp-upnext-header",qa:"Up Next"},{G:"span",N:"ytp-upnext-title",qa:"{{title}}"},{G:"span",N:"ytp-upnext-author",qa:"{{author}}"}]},{G:"a",N:"ytp-upnext-autoplay-icon",X:{role:"button",href:"{{url}}","aria-label":"Play next video"},W:[{G:"svg",X:{height:"100%",version:"1.1",viewBox:"0 0 72 72",width:"100%"}, W:[{G:"circle",N:"ytp-svg-autoplay-circle",X:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{G:"circle",N:"ytp-svg-autoplay-ring",X:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{G:"path",N:"ytp-svg-fill",X:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{G:"span",N:"ytp-upnext-bottom",W:[{G:"span",N:"ytp-upnext-cancel"},{G:"span",N:"ytp-upnext-paused", qa:"Autoplay is paused"}]}]});this.api=a;this.cancelButton=null;this.D=this.Da("ytp-svg-autoplay-ring");this.B=this.notification=this.j=this.suggestion=null;this.C=new g.Jp(this.YE,5E3,this);this.u=0;var b=this.Da("ytp-upnext-cancel");this.cancelButton=new g.T({G:"button",Ia:["ytp-upnext-cancel-button","ytp-button"],X:{tabindex:"0","aria-label":"Cancel autoplay"},qa:"Cancel"});g.D(this,this.cancelButton);this.cancelButton.Qa("click",this.CZ,this);this.cancelButton.Ea(b);this.cancelButton&&this.api.sb(this.cancelButton.element, this,115129);g.D(this,this.C);this.api.sb(this.element,this,18788);b=this.Da("ytp-upnext-autoplay-icon");this.S(b,"click",this.DZ);this.api.sb(b,this,115130);this.sQ();this.S(a,"autonavvisibility",this.sQ);this.S(a,"mdxnowautoplaying",this.Z5);this.S(a,"mdxautoplaycanceled",this.a6);g.Vp(this.element,"ytp-upnext-mobile",this.api.T().u)},ygb=function(a,b){if(b)return b; if(a.api.isFullscreen()){var c;a=null==(c=a.api.getVideoData())?void 0:c.AI;return-1===a||void 0===a?8E3:a}return 0<=a.api.Vr()?a.api.Vr():g.fJ(a.api.T().experiments,"autoplay_time")||1E4},zgb=function(a,b){b=ygb(a,b); var c=Math,d=c.min;var e=(0,g.M)()-a.u;c=d.call(c,e,b);b=0===b?1:Math.min(c/b,1);a.D.setAttribute("stroke-dashoffset",""+-211*(b+1));1<=b&&a.Dk()&&3!==a.api.getPresentingPlayerType()?a.select(!0):a.Dk()&&a.j.start()},f6=function(a){d6.call(this,a,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.T({G:"div",N:"ytp-suggestion-panel",W:[{G:"div",Ia:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],qa:"More videos"}]});this.J=new g.T({G:"div",N:"ytp-suggestions-container"});this.videos=[];this.B=null;this.D=this.I=!1;this.u=new b6(this.player);g.D(this,this.u);this.u.Ea(this.element);a.getVideoData().vf?this.j=this.u:(this.j=new e6(a),g.MS(this.player,this.j.element,4),g.D(this,this.j));this.overlay=new g.T({G:"div", N:"ytp-autonav-overlay-cancelled-state"});g.D(this,this.overlay);this.overlay.Ea(this.element);this.C=new g.bI(this);g.D(this,this.C);g.D(this,this.table);this.table.Ea(this.element);this.table.show();g.D(this,this.J);this.J.Ea(this.table.element);this.hide()},g6=function(a){var b=a.Of(); b!==a.D&&(a.D=b,a.player.ma("autonavvisibility"),a.D?(a.u!==a.j&&a.u.hide(),a.table.hide()):(a.u!==a.j&&a.u.show(),a.table.show()))},h6=function(a,b){g.T.call(this,{G:"button", Ia:["ytp-watch-on-youtube-button","ytp-button"],qa:"{{content}}"});this.F=a;this.buttonType=this.buttonType=b;b=this.F.getVideoData();if(a.K("embeds_enable_server_driven_watch_again_on_youtube")){var c,d;if(c=(a=null==(c=b.kd)?void 0:null==(d=c.playerOverlays)?void 0:d.playerOverlayRenderer)&&g.K(a.watchOnYoutubeButton,g.zKa))this.j=c}if(this.j)this.update({content:this.j.title}),this.F.Wf(this.element,this),this.F.gg(this.element,this.j.trackingParams||null);else{switch(this.buttonType){case 1:c= "Watch again on YouTube";d=156915;break;case 2:c="Continue watching on YouTube";d=156942;break;default:c="Continue watching on YouTube",d=156942}this.update({content:c});this.F.sb(this.element,this,d)}2===this.buttonType&&g.Rp(this.element,"ytp-continue-watching-button");this.Qa("click",this.onClick);g.WP(this,!0)},i6=function(a,b){d6.call(this,a,"embeds-lite-endscreen"); this.F=a;this.j=b;this.F.sb(this.element,this,156943);this.watchButton=new h6(a,2);g.D(this,this.watchButton);this.watchButton.Ea(this.element);this.hide()},Agb=function(a){d6.call(this,a,"subscribecard-endscreen"); this.j=new g.T({G:"div",N:"ytp-subscribe-card",W:[{G:"img",N:"ytp-author-image",X:{src:"{{profilePicture}}"}},{G:"div",N:"ytp-subscribe-card-right",W:[{G:"div",N:"ytp-author-name",qa:"{{author}}"},{G:"div",N:"html5-subscribe-button-container"}]}]});g.D(this,this.j);this.j.Ea(this.element);var b=a.getVideoData();this.subscribeButton=new g.iU("Subscribe",null,"Unsubscribe",null,!0,!1,b.Wj,b.subscribed,"trailer-endscreen",null,null,a);g.D(this,this.subscribeButton);this.subscribeButton.Ea(this.j.Da("html5-subscribe-button-container")); this.S(a,"videodatachange",this.Pa);this.Pa();this.hide()},j6=function(a){var b=a.T(),c=g.eI||g.bK?{style:"will-change: opacity"}:void 0,d=b.C,e=["ytp-videowall-still"]; b.u&&e.push("ytp-videowall-show-text");g.T.call(this,{G:"a",Ia:e,X:{href:"{{url}}",target:d?b.Y:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},W:[{G:"div",N:"ytp-videowall-still-image",X:{style:"{{background}}"}},{G:"span",N:"ytp-videowall-still-info",X:{"aria-hidden":"true"},W:[{G:"span",N:"ytp-videowall-still-info-bg",W:[{G:"span",N:"ytp-videowall-still-info-content",X:c,W:[{G:"span",N:"ytp-videowall-still-info-title",qa:"{{title}}"}, {G:"span",N:"ytp-videowall-still-info-author",qa:"{{author_and_views}}"},{G:"span",N:"ytp-videowall-still-info-live",qa:"Live"},{G:"span",N:"ytp-videowall-still-info-duration",qa:"{{duration}}"}]}]}]},{G:"span",Ia:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],X:{"aria-hidden":"true"},W:[{G:"span",N:"ytp-videowall-still-listlabel-icon"},"Playlist",{G:"span",N:"ytp-videowall-still-listlabel-length",W:[" (",{G:"span",qa:"{{playlist_length}}"},")"]}]},{G:"span",Ia:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],X:{"aria-hidden":"true"},W:[{G:"span",N:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{G:"span",N:"ytp-videowall-still-listlabel-length",qa:" (50+)"}]}]});this.suggestion=null;this.u=d;this.api=a;this.j=new g.bI(this);g.D(this,this.j);this.Qa("click",this.onClick);this.Qa("keypress",this.onKeyPress);this.j.S(a,"videodatachange",this.onVideoDataChange);a.Wf(this.element,this);this.onVideoDataChange()},k6=function(a){d6.call(this,a,"videowall-endscreen"); var b=this;this.F=a;this.B=0;this.stills=[];this.C=this.videoData=null;this.D=this.J=!1;this.V=null;this.u=new g.bI(this);g.D(this,this.u);this.I=new g.Jp(function(){g.Rp(b.element,"ytp-show-tiles")},0); g.D(this,this.I);var c=new g.T({G:"button",Ia:["ytp-button","ytp-endscreen-previous"],X:{"aria-label":"Previous"},W:[g.bQ()]});g.D(this,c);c.Ea(this.element);c.Qa("click",this.HZ,this);this.table=new g.TP({G:"div",N:"ytp-endscreen-content"});g.D(this,this.table);this.table.Ea(this.element);c=new g.T({G:"button",Ia:["ytp-button","ytp-endscreen-next"],X:{"aria-label":"Next"},W:[g.cQ()]});g.D(this,c);c.Ea(this.element);c.Qa("click",this.GZ,this);a.getVideoData().vf?this.j=new b6(a,!0):this.j=new e6(a); g.D(this,this.j);g.MS(this.player,this.j.element,4);a.sb(this.element,this,158789);this.hide()},l6=function(a){return g.NS(a.player)&&a.WA()&&!a.C},m6=function(a){var b=a.Of(); b!==a.J&&(a.J=b,a.player.ma("autonavvisibility"))},n6=function(a){d6.call(this,a,"watch-again-on-youtube-endscreen"); this.watchButton=new h6(a,1);g.D(this,this.watchButton);this.watchButton.Ea(this.element);g.a8a(a)&&(this.j=new g.$2(a,g.qS(a)),g.D(this,this.j),this.u=new g.T({G:"div",Ia:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],X:{tabIndex:"-1"},W:[this.j]}),g.D(this,this.u),this.j.Ea(this.u.element),this.u.Ea(this.element));a.sb(this.element,this,156914);this.hide()},Egb=function(a){g.xT.call(this,a); var b=this;this.endScreen=null;this.u=this.j=this.B=this.C=!1;this.listeners=new g.bI(this);g.D(this,this.listeners);var c=a.T(),d=a.getVideoData();d=d&&0!==d.endSeconds;if(g.uz(g.uK(c))&&d&&!g.JS(a))this.u=!0,this.endScreen=new i6(a,g.qS(a));else{var e;(c.K("shorts_mode_to_player_api")?a.Sb():null==(e=g.qS(a))?0:e.Sb())?this.endScreen=new n6(a):Bgb(a)?(this.C=!0,Cgb(this),this.j?this.endScreen=new f6(a):this.endScreen=new k6(a)):c.Sf?this.endScreen=new Agb(a):this.endScreen=new d6(a)}g.D(this,this.endScreen); g.MS(a,this.endScreen.element,4);Dgb(this);this.listeners.S(a,"videodatachange",this.onVideoDataChange,this);this.listeners.S(a,g.ZD("endscreen"),function(f){b.onCueRangeEnter(f)}); this.listeners.S(a,g.$D("endscreen"),function(f){b.onCueRangeExit(f)})},Cgb=function(a){var b=a.player.getVideoData(); if(!b||a.j===b.fl&&a.B===b.vf)return!1;a.j=b.fl;a.B=b.vf;return!0},Bgb=function(a){a=a.T(); return a.Vc&&!a.Sf},Dgb=function(a){a.player.Gf("endscreen"); var b=a.player.getVideoData();b=new g.XD(Math.max(1E3*(b.lengthSeconds-10),0),0x8000000000000,{id:"preload",namespace:"endscreen"});var c=new g.XD(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});a.player.ye([b,c])}; g.YV.prototype.Jz=g.ca(36,function(a){this.VN!==a&&(this.VN=a,this.bl())}); g.LU.prototype.Sq=g.ca(35,function(a){this.u!==a&&(this.u=a,this.Pa())}); g.YV.prototype.Sq=g.ca(34,function(a){this.shareButton&&this.shareButton.Sq(a)}); g.HU.prototype.Rq=g.ca(33,function(a){this.u!==a&&(this.u=a,this.Pa())}); g.YV.prototype.Rq=g.ca(32,function(a){this.overflowButton&&this.overflowButton.Rq(a)}); g.aU.prototype.HD=g.ca(31,function(a){this.WN!==a&&(this.WN=a,this.tp())}); g.FS.prototype.Vr=g.ca(5,function(){return this.app.Vr()}); g.CZ.prototype.Vr=g.ca(4,function(){return this.getVideoData().ER});g.w(a6,g.T);a6.prototype.select=function(){this.F.In(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.rB||void 0)&&this.F.ob(this.element)}; a6.prototype.onClick=function(a){g.QT(a,this.F,this.j,this.suggestion.sessionData||void 0)&&this.select()}; a6.prototype.onKeyPress=function(a){switch(a.keyCode){case 13:case 32:g.zO(a)||(this.select(),g.AO(a))}};g.w(b6,g.T);g.k=b6.prototype;g.k.qE=function(a){this.suggestion!==a&&(this.suggestion=a,$5(this.j,a),this.playButton.updateValue("url",this.suggestion.xk()),c6(this))}; g.k.Dk=function(){return 0a.width||459>a.height};g.w(d6,g.T);g.k=d6.prototype;g.k.create=function(){this.created=!0}; g.k.destroy=function(){this.created=!1}; g.k.WA=function(){return!1}; g.k.Of=function(){return!1}; g.k.KU=function(){return!1};g.w(e6,g.T);g.k=e6.prototype;g.k.YE=function(){this.notification&&(this.C.stop(),this.Gc(this.B),this.B=null,this.notification.close(),this.notification=null)}; g.k.qE=function(a){this.suggestion=a;$5(this,a,"hqdefault.jpg")}; g.k.sQ=function(){g.WP(this,this.api.Of());this.api.Ua(this.element,this.api.Of());this.api.Ua(this.Da("ytp-upnext-autoplay-icon"),this.api.Of());this.cancelButton&&this.api.Ua(this.cancelButton.element,this.api.Of())}; g.k.i6=function(){window.focus();this.YE()}; g.k.Rz=function(a){var b=this;this.Dk()||(g.sC("a11y-announce","Up Next "+this.suggestion.title),this.u=(0,g.M)(),this.j=new g.Jp(function(){zgb(b,a)},25),zgb(this,a),tgb(this.api,ygb(this,a))); g.Tp(this.element,"ytp-upnext-autoplay-paused")}; g.k.hide=function(){g.T.prototype.hide.call(this)}; g.k.Dk=function(){return!!this.j}; g.k.Kv=function(){this.Xq();this.u=(0,g.M)();zgb(this);g.Rp(this.element,"ytp-upnext-autoplay-paused")}; g.k.Xq=function(){this.Dk()&&(this.j.dispose(),this.j=null)}; g.k.select=function(a){a=void 0===a?!1:a;if(this.api.T().K("autonav_notifications")&&a&&window.Notification&&"function"===typeof document.hasFocus){var b=Notification.permission;"default"===b?Notification.requestPermission():"granted"!==b||document.hasFocus()||(this.YE(),this.notification=new Notification("Up Next",{body:this.suggestion.title,icon:this.suggestion.qg()}),this.B=this.S(this.notification,"click",this.i6),this.C.start())}this.Xq();this.api.nextVideo(!1,a)}; g.k.DZ=function(a){!g.wf(this.cancelButton.element,g.xO(a))&&g.QT(a,this.api)&&(this.api.Of()&&this.api.ob(this.Da("ytp-upnext-autoplay-icon")),this.select())}; g.k.CZ=function(){this.api.Of()&&this.cancelButton&&this.api.ob(this.cancelButton.element);g.HS(this.api,!0)}; g.k.Z5=function(a){this.api.getPresentingPlayerType();this.show();this.Rz(a)}; g.k.a6=function(){this.api.getPresentingPlayerType();this.Xq();this.hide()}; g.k.oa=function(){this.Xq();this.YE();g.T.prototype.oa.call(this)};g.w(f6,d6);g.k=f6.prototype;g.k.create=function(){d6.prototype.create.call(this);this.C.S(this.player,"appresize",this.xA);this.C.S(this.player,"onVideoAreaChange",this.xA);this.C.S(this.player,"videodatachange",this.onVideoDataChange);this.C.S(this.player,"autonavchange",this.tQ);this.C.S(this.player,"autonavcancel",this.EZ);this.onVideoDataChange()}; g.k.show=function(){d6.prototype.show.call(this);(this.I||this.B&&this.B!==this.videoData.clientPlaybackNonce)&&g.HS(this.player,!1);g.NS(this.player)&&this.WA()&&!this.B?(g6(this),2===this.videoData.autonavState?this.player.T().K("fast_autonav_in_background")&&3===this.player.getVisibilityState()?this.j.select(!0):this.j.Rz():3===this.videoData.autonavState&&this.j.Kv()):(g.HS(this.player,!0),g6(this));this.xA()}; g.k.hide=function(){d6.prototype.hide.call(this);this.j.Kv();g6(this)}; g.k.xA=function(){var a=this.player.wk(!0,this.player.isFullscreen());g6(this);c6(this.u);g.Vp(this.element,"ytp-autonav-cancelled-small-mode",this.gh(a));g.Vp(this.element,"ytp-autonav-cancelled-tiny-mode",this.kG(a));g.Vp(this.element,"ytp-autonav-cancelled-mini-mode",400>=a.width||360>=a.height);this.overlay&&g.Rm(this.overlay.element,{width:a.width+"px"});if(!this.D)for(a=0;aa.width||459>a.height)&&!this.kG(a)&&!(400>=a.width||360>=a.height)}; g.k.kG=function(a){return 800>a.width&&!(400>=a.width||360>=a.height)}; g.k.Of=function(){return this.yb&&g.NS(this.player)&&this.WA()&&!this.B}; var Fgb=[1,3,2,4];g.w(h6,g.T);g.k=h6.prototype;g.k.onClick=function(a){this.F.K("web_player_log_click_before_generating_ve_conversion_params")&&this.F.ob(this.element);this.j?this.F.Ma("innertubeCommand",this.j.onTap):g.RT(this.getVideoUrl(),this.F,a);this.F.K("web_player_log_click_before_generating_ve_conversion_params")||this.F.ob(this.element)}; g.k.getVideoUrl=function(){var a=!0;switch(this.buttonType){case 1:a=!0;break;case 2:a=!1}a=this.F.getVideoUrl(a,!1,!1,!0);var b=this.F.T();if(g.dK(b)||g.mK(b)){var c={};b.ya&&g.dK(b)&&g.hS(c,b.loaderUrl);g.dK(b)&&g.oS(this.F,"addEmbedsConversionTrackingParams",[c]);a:{switch(this.buttonType){case 2:b="emb_ytp_continue_watching";break a}b="emb_ytp_watch_again"}g.gS(c,b);a=g.qj(a,c)}return a}; g.k.Ua=function(){this.F.Ua(this.element,this.yb&&this.va)}; g.k.show=function(){g.T.prototype.show.call(this);this.Ua()}; g.k.hide=function(){g.T.prototype.hide.call(this);this.Ua()}; g.k.jc=function(a){g.T.prototype.jc.call(this,a);this.Ua()};g.w(i6,d6);i6.prototype.show=function(){3!==this.player.getPlayerState()&&(d6.prototype.show.call(this),this.j.Jz(!0),this.j.Sq(!0),this.F.T().Yl||this.j.Rq(!0),this.F.Ua(this.element,!0),this.watchButton.jc(!0))}; i6.prototype.hide=function(){d6.prototype.hide.call(this);this.j.Jz(!1);this.j.Sq(!1);this.j.Rq(!1);this.F.Ua(this.element,!1);this.watchButton.jc(!1)};g.w(Agb,d6);Agb.prototype.Pa=function(){var a=this.player.getVideoData();this.j.update({profilePicture:a.profilePicture,author:a.author});this.subscribeButton.channelId=a.Wj;var b=this.subscribeButton;a.subscribed?b.j():b.u()};g.w(j6,g.T);j6.prototype.select=function(){this.api.In(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.rB||void 0)&&this.api.ob(this.element)}; j6.prototype.onClick=function(a){if(g.dK(this.api.T())&&this.api.K("web_player_log_click_before_generating_ve_conversion_params")){this.api.ob(this.element);var b=this.suggestion.xk(),c={};g.bKa(this.api,c,"emb_rel_end");b=g.qj(b,c);g.RT(b,this.api,a)}else g.QT(a,this.api,this.u,this.suggestion.sessionData||void 0)&&this.select()}; j6.prototype.onKeyPress=function(a){switch(a.keyCode){case 13:case 32:g.zO(a)||(this.select(),g.AO(a))}}; j6.prototype.onVideoDataChange=function(){var a=this.api.getVideoData(),b=this.api.T();this.u=a.D?!1:b.C};g.w(k6,d6);g.k=k6.prototype;g.k.create=function(){d6.prototype.create.call(this);var a=this.player.getVideoData();a&&(this.videoData=a);this.Bp();this.u.S(this.player,"appresize",this.Bp);this.u.S(this.player,"onVideoAreaChange",this.Bp);this.u.S(this.player,"videodatachange",this.onVideoDataChange);this.u.S(this.player,"autonavchange",this.UI);this.u.S(this.player,"autonavcancel",this.FZ);a=this.videoData.autonavState;a!==this.V&&this.UI(a);this.u.S(this.element,"transitionend",this.v7)}; g.k.destroy=function(){g.Pz(this.u);g.Za(this.stills);this.stills=[];d6.prototype.destroy.call(this);g.Tp(this.element,"ytp-show-tiles");this.I.stop();this.V=this.videoData.autonavState}; g.k.WA=function(){return 1!==this.videoData.autonavState}; g.k.show=function(){var a=this.yb;d6.prototype.show.call(this);g.Tp(this.element,"ytp-show-tiles");this.player.T().u?g.Lp(this.I):this.I.start();(this.D||this.C&&this.C!==this.videoData.clientPlaybackNonce)&&g.HS(this.player,!1);l6(this)?(m6(this),2===this.videoData.autonavState?this.player.T().K("fast_autonav_in_background")&&3===this.player.getVisibilityState()?this.j.select(!0):this.j.Rz():3===this.videoData.autonavState&&this.j.Kv()):(g.HS(this.player,!0),m6(this));a!==this.yb&&this.player.Ua(this.element, !0)}; g.k.hide=function(){var a=this.yb;d6.prototype.hide.call(this);this.j.Kv();m6(this);a!==this.yb&&this.player.Ua(this.element,!1)}; g.k.v7=function(a){g.xO(a)===this.element&&this.Bp()}; g.k.Bp=function(){var a,b,c,d;var e=(null==(a=this.videoData)?0:null==(b=a.suggestions)?0:b.length)?null==(c=this.videoData)?void 0:c.suggestions:[null==(d=this.videoData)?void 0:g.nM(d)];if(e.length){g.Rp(this.element,"ytp-endscreen-paginate");var f=this.F.wk(!0,this.F.isFullscreen());if(a=g.qS(this.F))a=a.vg()?48:32,f.width-=2*a;var h=f.width/f.height;d=96/54;b=a=2;var l=Math.max(f.width/96,2),m=Math.max(f.height/54,2);c=e.length;var n=Math.pow(2,2);var p=c*n+(Math.pow(2,2)-n);p+=Math.pow(2,2)- n;for(p-=n;0=r*n,x=b<=m-2&&p>=q*n;if((q+1)/r*d/h>h/(q/(r+1)*d)&&x)p-=q*n,b+=2;else if(u)p-=r*n,a+=2;else if(x)p-=q*n,b+=2;else break}d=!1;p>=3*n&&6>=c*n-p&&(4<=b||4<=a)&&(d=!0);n=96*a;p=54*b;h=n/p=a-2&&m>=b-2?u=1:0===m%2&&0===l%2&&(2>m&&2>l?0===m&&0===l&&(u=2):u=2),q=g.ze(q+this.B,c),0!==u){r=this.stills[h];r||(r=new j6(this.player),this.stills[h]=r,f.appendChild(r.element));x=Math.floor(p*m/b);var z=Math.floor(n*l/a),B=Math.floor(p*(m+u)/b)-x-4,F=Math.floor(n*(l+u)/a)-z-4;g.Xm(r.element,z,x);g.an(r.element,F,B);g.Rm(r.element,"transitionDelay", (m+l)/20+"s");g.Vp(r.element,"ytp-videowall-still-mini",1===u);g.Vp(r.element,"ytp-videowall-still-large",2u);g.Vp(r.element,"ytp-videowall-still-round-small",96>=u);q=e[q];r.suggestion!==q&&(r.suggestion=q,u=r.api.T(),x=g.Qp(r.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",$5(r,q,x),g.dK(u)&&!r.api.K("web_player_log_click_before_generating_ve_conversion_params")&& (x=q.xk(),z={},u.ya&&g.hS(z,u.loaderUrl),g.oS(r.api,"addEmbedsConversionTrackingParams",[z]),x=g.qj(x,g.gS(z,"emb_rel_end")),r.updateValue("url",x)),(q=(q=q.sessionData)&&q.itct)&&r.api.gg(r.element,q));h++}f.ariaBusy="false";g.Vp(this.element,"ytp-endscreen-paginate",h=h;e--)a=this.stills[e],g.uf(a.element),g.Ya(a);this.stills.length=h}}; g.k.onVideoDataChange=function(){var a=this.player.getVideoData();this.videoData!==a&&(this.B=0,this.videoData=a,this.Bp())}; g.k.GZ=function(){this.B+=this.stills.length;this.Bp()}; g.k.HZ=function(){this.B-=this.stills.length;this.Bp()}; g.k.KU=function(){return this.j.Dk()}; g.k.UI=function(a){1===a?(this.D=!1,this.C=this.videoData.clientPlaybackNonce,this.j.Xq(),this.yb&&this.Bp()):(this.D=!0,this.yb&&l6(this)&&(2===a?this.j.Rz():3===a&&this.j.Kv()))}; g.k.FZ=function(a){if(a){for(a=0;a