(function(g){var window=this;'use strict';var Tmb=function(a,b){a.Ua("onAutonavCoundownStarted",b)},l6=function(a,b,c){g.gu(a.element,"ytp-suggestion-set",!!b.videoId); var d=b.playlistId;c=b.Kg(c?c:"mqdefault.jpg");var e=null,f=null;b instanceof g.hT&&(b.lengthText?(e=b.lengthText||null,f=b.cw||null):b.lengthSeconds&&(e=g.BH(b.lengthSeconds),f=g.BH(b.lengthSeconds,!0)));var h=!!d;d=h&&"RD"===g.SOa(d).type;var l=b instanceof g.hT?b.isLivePlayback:null,m=b instanceof g.hT?b.isUpcoming:null,n=b.author,p=b.shortViewCount,q=b.publishedTimeText,r=[],t=[];n&&r.push(n);p&&(r.push(p),t.push(p));q&&t.push(q);c={title:b.title,author:n,author_and_views:r.join(" \u2022 "),aria_label:b.ariaLabel|| g.NK("Watch $TITLE",{TITLE:b.title}),duration:e,timestamp:f,url:b.Nk(),is_live:l,is_upcoming:m,is_list:h,is_mix:d,background:c?"background-image: url("+c+")":"",views_and_publish_time:t.join(" \u2022 "),autoplayAlternativeHeader:b.Bs};b instanceof g.gT&&(c.playlist_length=b.playlistLength);a.update(c)},m6=function(a){var b=a.W(),c=b.D; g.U.call(this,{I:"a",T:"ytp-autonav-suggestion-card",Y:{href:"{{url}}",target:c?b.ea:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},X:[{I:"div",Na:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],Y:{style:"{{background}}"},X:[{I:"div",Y:{"aria-label":"{{timestamp}}"},Na:["ytp-autonav-timestamp"],Aa:"{{duration}}"},{I:"div",Na:["ytp-autonav-live-stamp"],Aa:"Live"},{I:"div", Na:["ytp-autonav-upcoming-stamp"],Aa:"Upcoming"},{I:"div",T:"ytp-autonav-list-overlay",X:[{I:"div",T:"ytp-autonav-mix-text",Aa:"Mix"},{I:"div",T:"ytp-autonav-mix-icon"}]}]},{I:"div",Na:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],Aa:"{{title}}"},{I:"div",Na:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],Aa:"{{author}}"},{I:"div",Na:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],Aa:"{{views_and_publish_time}}"}]});this.J=a;this.suggestion= null;this.j=c;this.Ta("click",this.onClick);this.Ta("keypress",this.onKeyPress)},n6=function(a,b){b=void 0===b?!1:b; g.U.call(this,{I:"div",T:"ytp-autonav-endscreen-countdown-overlay"});var c=this;this.K=b;this.G=void 0;this.C=0;this.container=new g.U({I:"div",T:"ytp-autonav-endscreen-countdown-container"});g.L(this,this.container);this.container.Ga(this.element);b=a.W();var d=b.D;this.J=a;this.suggestion=null;this.onVideoDataChange("newdata",this.J.getVideoData());this.V(a,"videodatachange",this.onVideoDataChange);this.j=new g.U({I:"div",T:"ytp-autonav-endscreen-upnext-container",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}}"},X:[{I:"div",T:"ytp-autonav-endscreen-upnext-header"},{I:"div",T:"ytp-autonav-endscreen-upnext-alternative-header",Aa:"{{autoplayAlternativeHeader}}"},{I:"a",T:"ytp-autonav-endscreen-link-container",Y:{href:"{{url}}",target:d?b.ea:""},X:[{I:"div",T:"ytp-autonav-endscreen-upnext-thumbnail",Y:{style:"{{background}}"},X:[{I:"div",Y:{"aria-label":"{{timestamp}}"},Na:["ytp-autonav-timestamp"], Aa:"{{duration}}"},{I:"div",Na:["ytp-autonav-live-stamp"],Aa:"Live"},{I:"div",Na:["ytp-autonav-upcoming-stamp"],Aa:"Upcoming"}]},{I:"div",T:"ytp-autonav-endscreen-video-info",X:[{I:"div",T:"ytp-autonav-endscreen-premium-badge"},{I:"div",T:"ytp-autonav-endscreen-upnext-title",Aa:"{{title}}"},{I:"div",T:"ytp-autonav-endscreen-upnext-author",Aa:"{{author}}"},{I:"div",T:"ytp-autonav-view-and-date",Aa:"{{views_and_publish_time}}"},{I:"div",T:"ytp-autonav-author-and-view",Aa:"{{author_and_views}}"}]}]}]}); g.L(this,this.j);this.j.Ga(this.container.element);d||this.V(this.j.Ha("ytp-autonav-endscreen-link-container"),"click",this.eS);this.J.xb(this.container.element,this,115127);this.J.xb(this.j.Ha("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.U({I:"div",T:"ytp-autonav-overlay"});g.L(this,this.overlay);this.overlay.Ga(this.container.element);this.B=new g.U({I:"div",T:"ytp-autonav-endscreen-button-container"});g.L(this,this.B);this.B.Ga(this.container.element);this.cancelButton= new g.U({I:"button",Na:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",b.N("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],Y:{"aria-label":"Cancel autoplay"},Aa:"Cancel"});g.L(this,this.cancelButton);this.cancelButton.Ga(this.B.element);this.cancelButton.Ta("click",this.D0,this);this.J.xb(this.cancelButton.element,this,115129);this.playButton=new g.U({I:"a",Na:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-play-button", b.N("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],Y:{href:"{{url}}",role:"button","aria-label":"Play next video"},Aa:"Play Now"});g.L(this,this.playButton);this.playButton.Ga(this.B.element);this.playButton.Ta("click",this.eS,this);this.J.xb(this.playButton.element,this,115130);this.D=new g.Vt(function(){Umb(c)},500); g.L(this,this.D);this.dS();this.V(a,"autonavvisibility",this.dS);this.J.N("web_autonav_color_transition")&&(this.V(a,"autonavchange",this.C0),this.V(a,"onAutonavCoundownStarted",this.c7))},o6=function(a){var b=a.J.Mk(!0,a.J.isFullscreen()); g.gu(a.container.element,"ytp-autonav-endscreen-small-mode",a.xg(b));g.gu(a.container.element,"ytp-autonav-endscreen-is-premium",!!a.suggestion&&!!a.suggestion.NJ);g.gu(a.J.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!a.J.Bf());g.gu(a.J.getRootNode(),"countdown-running",a.Qk());g.gu(a.container.element,"ytp-player-content",a.J.Bf());g.sr(a.overlay.element,{width:b.width+"px"});if(!a.Qk()){a.J.Bf()?Vmb(a,Math.round(Wmb(a)/1E3)):Vmb(a);b=!!a.suggestion&&!!a.suggestion.Bs;var c=a.J.Bf()||!b; g.gu(a.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!c&&b);g.gu(a.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",c&&!b);g.KG(a.B,a.J.Bf());g.gu(a.element,"ytp-enable-w2w-color-transitions",Xmb(a))}},Umb=function(a){var b=Wmb(a),c=Math,d=c.min; var e=a.C?Date.now()-a.C:0;c=d.call(c,e,b);Vmb(a,Math.ceil((b-c)/1E3));500>=b-c&&a.Qk()?a.select(!0):a.Qk()&&a.D.start()},Wmb=function(a){if(a.J.isFullscreen()){var b; a=null==(b=a.J.getVideoData())?void 0:b.BB;return-1===a||void 0===a?8E3:a}return 0<=a.J.Ss()?a.J.Ss():g.aK(a.J.W().experiments,"autoplay_time")||1E4},Xmb=function(a){var b; return!(null==(b=a.J.getVideoData())||!b.watchToWatchTransitionRenderer)},Vmb=function(a,b){b=void 0===b?-1:b; a=a.j.Ha("ytp-autonav-endscreen-upnext-header");g.of(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.mf("Up next in $SECONDS".slice(0,d)));var e=g.lf("span");g.au(e,"ytp-autonav-endscreen-upnext-header-countdown-number");g.Cf(e,b);a.appendChild(e);a.appendChild(g.mf("Up next in $SECONDS".slice(d+c.length)));return}}g.Cf(a,"Up next")},p6=function(a,b){g.U.call(this,{I:"div", Na:["html5-endscreen","ytp-player-content",b||"base-endscreen"]});this.created=!1;this.player=a},q6=function(a){g.U.call(this,{I:"div", Na:["ytp-upnext","ytp-player-content"],Y:{"aria-label":"{{aria_label}}"},X:[{I:"div",T:"ytp-cued-thumbnail-overlay-image",Y:{style:"{{background}}"}},{I:"span",T:"ytp-upnext-top",X:[{I:"span",T:"ytp-upnext-header",Aa:"Up Next"},{I:"span",T:"ytp-upnext-title",Aa:"{{title}}"},{I:"span",T:"ytp-upnext-author",Aa:"{{author}}"}]},{I:"a",T:"ytp-upnext-autoplay-icon",Y:{role:"button",href:"{{url}}","aria-label":"Play next video"},X:[{I:"svg",Y:{height:"100%",version:"1.1",viewBox:"0 0 72 72",width:"100%"}, X:[{I:"circle",T:"ytp-svg-autoplay-circle",Y:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{I:"circle",T:"ytp-svg-autoplay-ring",Y:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{I:"path",T:"ytp-svg-fill",Y:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{I:"span",T:"ytp-upnext-bottom",X:[{I:"span",T:"ytp-upnext-cancel"},{I:"span",T:"ytp-upnext-paused", Aa:"Autoplay is paused"}]}]});this.api=a;this.cancelButton=null;this.G=this.Ha("ytp-svg-autoplay-ring");this.C=this.notification=this.j=this.suggestion=null;this.D=new g.Vt(this.tG,5E3,this);this.B=0;var b=this.Ha("ytp-upnext-cancel");this.cancelButton=new g.U({I:"button",Na:["ytp-upnext-cancel-button","ytp-button"],Y:{tabindex:"0","aria-label":"Cancel autoplay"},Aa:"Cancel"});g.L(this,this.cancelButton);this.cancelButton.Ta("click",this.E0,this);this.cancelButton.Ga(b);this.cancelButton&&this.api.xb(this.cancelButton.element, this,115129);g.L(this,this.D);this.api.xb(this.element,this,18788);b=this.Ha("ytp-upnext-autoplay-icon");this.V(b,"click",this.F0);this.api.xb(b,this,115130);this.fS();this.V(a,"autonavvisibility",this.fS);this.V(a,"mdxnowautoplaying",this.L7);this.V(a,"mdxautoplaycanceled",this.M7);g.gu(this.element,"ytp-upnext-mobile",this.api.W().B)},Ymb=function(a,b){if(b)return b; if(a.api.isFullscreen()){var c;a=null==(c=a.api.getVideoData())?void 0:c.BB;return-1===a||void 0===a?8E3:a}return 0<=a.api.Ss()?a.api.Ss():g.aK(a.api.W().experiments,"autoplay_time")||1E4},Zmb=function(a,b){b=Ymb(a,b); var c=Math,d=c.min;var e=(0,g.fE)()-a.B;c=d.call(c,e,b);b=0===b?1:Math.min(c/b,1);a.G.setAttribute("stroke-dashoffset",""+-211*(b+1));1<=b&&a.Qk()&&3!==a.api.getPresentingPlayerType()?a.select(!0):a.Qk()&&a.j.start()},r6=function(a){p6.call(this,a,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.U({I:"div",T:"ytp-suggestion-panel",X:[{I:"div",Na:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],Aa:"More videos"}]});this.S=new g.U({I:"div",T:"ytp-suggestions-container"});this.videos=[];this.C=null;this.G=this.K=!1;this.B=new n6(this.player);g.L(this,this.B);this.B.Ga(this.element);a.getVideoData().We?this.j=this.B:(this.j=new q6(a),g.MU(this.player,this.j.element,4),g.L(this,this.j));this.overlay=new g.U({I:"div", T:"ytp-autonav-overlay-cancelled-state"});g.L(this,this.overlay);this.overlay.Ga(this.element);this.D=new g.qL(this);g.L(this,this.D);g.L(this,this.table);this.table.Ga(this.element);this.table.show();g.L(this,this.S);this.S.Ga(this.table.element);this.hide()},s6=function(a){var b=a.Bf(); b!==a.G&&(a.G=b,a.player.ra("autonavvisibility"),a.G?(a.B!==a.j&&a.B.hide(),a.table.hide()):(a.B!==a.j&&a.B.show(),a.table.show()))},t6=function(a,b){g.U.call(this,{I:"button", Na:["ytp-watch-on-youtube-button","ytp-button"],Aa:"{{content}}"});this.J=a;this.buttonType=this.buttonType=b;this.rZ();2===this.buttonType&&g.cu(this.element,"ytp-continue-watching-button");this.Ta("click",this.onClick);this.Ta("videodatachange",this.rZ);g.KG(this,!0)},u6=function(a,b){p6.call(this,a,"embeds-lite-endscreen"); this.J=a;this.ub=b;this.J.xb(this.element,this,156943);this.watchButton=new t6(a,2);g.L(this,this.watchButton);this.watchButton.Ga(this.element);this.hide()},$mb=function(a){p6.call(this,a,"subscribecard-endscreen"); this.j=new g.U({I:"div",T:"ytp-subscribe-card",X:[{I:"img",T:"ytp-author-image",Y:{src:"{{profilePicture}}"}},{I:"div",T:"ytp-subscribe-card-right",X:[{I:"div",T:"ytp-author-name",Aa:"{{author}}"},{I:"div",T:"html5-subscribe-button-container"}]}]});g.L(this,this.j);this.j.Ga(this.element);var b=a.getVideoData();this.subscribeButton=new g.yW("Subscribe",null,"Unsubscribe",null,!0,!1,b.Gl,b.subscribed,"trailer-endscreen",null,a);g.L(this,this.subscribeButton);this.subscribeButton.Ga(this.j.Ha("html5-subscribe-button-container")); this.V(a,"videodatachange",this.Sa);this.Sa();this.hide()},v6=function(a){var b=a.W(),c=g.KL||g.sS?{style:"will-change: opacity"}:void 0,d=b.D,e=["ytp-videowall-still"]; b.B&&e.push("ytp-videowall-show-text");g.U.call(this,{I:"a",Na:e,Y:{href:"{{url}}",target:d?b.ea:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},X:[{I:"div",T:"ytp-videowall-still-image",Y:{style:"{{background}}"}},{I:"span",T:"ytp-videowall-still-info",Y:{"aria-hidden":"true"},X:[{I:"span",T:"ytp-videowall-still-info-bg",X:[{I:"span",T:"ytp-videowall-still-info-content",Y:c,X:[{I:"span",T:"ytp-videowall-still-info-title",Aa:"{{title}}"}, {I:"span",T:"ytp-videowall-still-info-author",Aa:"{{author_and_views}}"},{I:"span",T:"ytp-videowall-still-info-live",Aa:"Live"},{I:"span",T:"ytp-videowall-still-info-duration",Aa:"{{duration}}"}]}]}]},{I:"span",Na:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],Y:{"aria-hidden":"true"},X:[{I:"span",T:"ytp-videowall-still-listlabel-icon"},"Playlist",{I:"span",T:"ytp-videowall-still-listlabel-length",X:[" (",{I:"span",Aa:"{{playlist_length}}"},")"]}]},{I:"span",Na:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],Y:{"aria-hidden":"true"},X:[{I:"span",T:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{I:"span",T:"ytp-videowall-still-listlabel-length",Aa:" (50+)"}]}]});this.suggestion=null;this.B=d;this.api=a;this.j=new g.qL(this);g.L(this,this.j);this.Ta("click",this.onClick);this.Ta("keypress",this.onKeyPress);this.j.V(a,"videodatachange",this.onVideoDataChange);a.og(this.element,this);this.onVideoDataChange()},w6=function(a){p6.call(this,a,"videowall-endscreen"); var b=this;this.J=a;this.C=0;this.stills=[];this.D=this.videoData=null;this.G=this.S=!1;this.ea=null;this.B=new g.qL(this);g.L(this,this.B);this.K=new g.Vt(function(){g.cu(b.element,"ytp-show-tiles")},0); g.L(this,this.K);var c=new g.U({I:"button",Na:["ytp-button","ytp-endscreen-previous"],Y:{"aria-label":"Previous"},X:[g.QG()]});g.L(this,c);c.Ga(this.element);c.Ta("click",this.J0,this);this.table=new g.HG({I:"div",T:"ytp-endscreen-content"});g.L(this,this.table);this.table.Ga(this.element);c=new g.U({I:"button",Na:["ytp-button","ytp-endscreen-next"],Y:{"aria-label":"Next"},X:[g.RG()]});g.L(this,c);c.Ga(this.element);c.Ta("click",this.I0,this);a.getVideoData().We?this.j=new n6(a,!0):this.j=new q6(a); g.L(this,this.j);g.MU(this.player,this.j.element,4);a.xb(this.element,this,158789);this.hide()},x6=function(a){return g.NU(a.player)&&a.dC()&&!a.D},y6=function(a){var b=a.Bf(); b!==a.S&&(a.S=b,a.player.ra("autonavvisibility"))},z6=function(a){p6.call(this,a,"watch-again-on-youtube-endscreen"); this.watchButton=new t6(a,1);g.L(this,this.watchButton);this.watchButton.Ga(this.element);g.Dbb(a)&&(this.j=new g.B2(a,g.uU(a)),g.L(this,this.j),this.B=new g.U({I:"div",Na:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],Y:{tabIndex:"-1"},X:[this.j]}),g.L(this,this.B),this.j.Ga(this.B.element),this.B.Ga(this.element));a.xb(this.element,this,156914);this.hide()},dnb=function(a){g.MV.call(this,a); var b=this;this.endScreen=null;this.B=this.j=this.C=this.D=!1;this.listeners=new g.qL(this);g.L(this,this.listeners);var c=a.W(),d=a.getVideoData();d=d&&0!==d.limitedPlaybackDurationInSeconds;g.fD(g.CS(c))&&d&&!g.IU(a)?(this.B=!0,this.endScreen=new u6(a,g.uU(a))):g.JU(a)?this.endScreen=new z6(a):anb(a)?(this.D=!0,bnb(this),this.j?this.endScreen=new r6(a):this.endScreen=new w6(a)):c.dh?this.endScreen=new $mb(a):this.endScreen=new p6(a);g.L(this,this.endScreen);g.MU(a,this.endScreen.element,4);cnb(this); this.listeners.V(a,"videodatachange",this.onVideoDataChange,this);this.listeners.V(a,g.HK("endscreen"),function(e){b.onCueRangeEnter(e)}); this.listeners.V(a,g.IK("endscreen"),function(e){b.onCueRangeExit(e)})},bnb=function(a){var b=a.player.getVideoData(); if(!b||a.j===b.Ol&&a.C===b.We)return!1;a.j=b.Ol;a.C=b.We;return!0},anb=function(a){a=a.W(); return a.Td&&!a.dh},cnb=function(a){a.player.lf("endscreen"); var b=a.player.getVideoData();b=new g.GK(Math.max(1E3*(b.lengthSeconds-10),0),0x8000000000000,{id:"preload",namespace:"endscreen"});var c=new g.GK(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});a.player.xf([b,c])}; g.mY.prototype.PA=g.ea(37,function(a){this.LP!==a&&(this.LP=a,this.Fl())}); g.cX.prototype.Gr=g.ea(36,function(a){this.j!==a&&(this.j=a,this.Sa())}); g.mY.prototype.Gr=g.ea(35,function(a){this.shareButton&&this.shareButton.Gr(a)}); g.YW.prototype.Fr=g.ea(34,function(a){this.j!==a&&(this.j=a,this.Sa())}); g.mY.prototype.Fr=g.ea(33,function(a){this.overflowButton&&this.overflowButton.Fr(a)}); g.pW.prototype.ZE=g.ea(32,function(a){this.MP!==a&&(this.MP=a,this.Xp())}); g.EU.prototype.Ss=g.ea(6,function(){return this.app.Ss()}); g.e1.prototype.Ss=g.ea(5,function(){return this.getVideoData().RT});g.v(m6,g.U);m6.prototype.select=function(){this.J.uo(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.yC||void 0)&&this.J.wb(this.element)}; m6.prototype.onClick=function(a){g.dV(a,this.J,this.j,this.suggestion.sessionData||void 0)&&this.select()}; m6.prototype.onKeyPress=function(a){switch(a.keyCode){case 13:case 32:a.defaultPrevented||(this.select(),a.preventDefault())}};g.v(n6,g.U);g.k=n6.prototype;g.k.CF=function(a){this.suggestion!==a&&(this.suggestion=a,l6(this.j,a),this.playButton.updateValue("url",this.suggestion.Nk()),o6(this))}; g.k.Qk=function(){return 0a.width||459>a.height};g.v(p6,g.U);g.k=p6.prototype;g.k.create=function(){this.created=!0}; g.k.destroy=function(){this.created=!1}; g.k.dC=function(){return!1}; g.k.Bf=function(){return!1}; g.k.QW=function(){return!1};g.v(q6,g.U);g.k=q6.prototype;g.k.tG=function(){this.notification&&(this.D.stop(),this.Qc(this.C),this.C=null,this.notification.close(),this.notification=null)}; g.k.CF=function(a){this.suggestion=a;l6(this,a,"hqdefault.jpg")}; g.k.fS=function(){g.KG(this,this.api.Bf());this.api.Xa(this.element,this.api.Bf());this.api.Xa(this.Ha("ytp-upnext-autoplay-icon"),this.api.Bf());this.cancelButton&&this.api.Xa(this.cancelButton.element,this.api.Bf())}; g.k.U7=function(){window.focus();this.tG()}; g.k.WA=function(a){var b=this;this.Qk()||(g.pF("a11y-announce","Up Next "+this.suggestion.title),this.B=(0,g.fE)(),this.j=new g.Vt(function(){Zmb(b,a)},25),Zmb(this,a),Tmb(this.api,Ymb(this,a))); g.eu(this.element,"ytp-upnext-autoplay-paused")}; g.k.hide=function(){g.U.prototype.hide.call(this)}; g.k.Qk=function(){return!!this.j}; g.k.Bw=function(){this.Or();this.B=(0,g.fE)();Zmb(this);g.cu(this.element,"ytp-upnext-autoplay-paused")}; g.k.Or=function(){this.Qk()&&(this.j.dispose(),this.j=null)}; g.k.select=function(a){a=void 0===a?!1:a;if(this.api.W().N("autonav_notifications")&&a&&window.Notification&&"function"===typeof document.hasFocus){var b=Notification.permission;"default"===b?Notification.requestPermission():"granted"!==b||document.hasFocus()||(this.tG(),this.notification=new Notification("Up Next",{body:this.suggestion.title,icon:this.suggestion.Kg()}),this.C=this.V(this.notification,"click",this.U7),this.D.start())}this.Or();this.api.nextVideo(!1,a)}; g.k.F0=function(a){!g.Bf(this.cancelButton.element,a.target)&&g.dV(a,this.api)&&(this.api.Bf()&&this.api.wb(this.Ha("ytp-upnext-autoplay-icon")),this.select())}; g.k.E0=function(){this.api.Bf()&&this.cancelButton&&this.api.wb(this.cancelButton.element);g.GU(this.api,!0)}; g.k.L7=function(a){this.api.getPresentingPlayerType();this.show();this.WA(a)}; g.k.M7=function(){this.api.getPresentingPlayerType();this.Or();this.hide()}; g.k.Ba=function(){this.Or();this.tG();g.U.prototype.Ba.call(this)};g.v(r6,p6);g.k=r6.prototype;g.k.create=function(){p6.prototype.create.call(this);this.D.V(this.player,"appresize",this.EB);this.D.V(this.player,"onVideoAreaChange",this.EB);this.D.V(this.player,"videodatachange",this.onVideoDataChange);this.D.V(this.player,"autonavchange",this.gS);this.D.V(this.player,"autonavcancel",this.G0);this.onVideoDataChange()}; g.k.show=function(){p6.prototype.show.call(this);(this.K||this.C&&this.C!==this.videoData.clientPlaybackNonce)&&g.GU(this.player,!1);g.NU(this.player)&&this.dC()&&!this.C?(s6(this),2===this.videoData.autonavState?3===this.player.getVisibilityState()?this.j.select(!0):this.j.WA():3===this.videoData.autonavState&&this.j.Bw()):(g.GU(this.player,!0),s6(this));this.EB()}; g.k.hide=function(){p6.prototype.hide.call(this);this.j.Bw();s6(this)}; g.k.EB=function(){var a=this.player.Mk(!0,this.player.isFullscreen());s6(this);o6(this.B);g.gu(this.element,"ytp-autonav-cancelled-small-mode",this.xg(a));g.gu(this.element,"ytp-autonav-cancelled-tiny-mode",this.QH(a));g.gu(this.element,"ytp-autonav-cancelled-mini-mode",400>=a.width||360>=a.height);this.overlay&&g.sr(this.overlay.element,{width:a.width+"px"});if(!this.G)for(a=0;aa.width||459>a.height)&&!this.QH(a)&&!(400>=a.width||360>=a.height)}; g.k.QH=function(a){return 800>a.width&&!(400>=a.width||360>=a.height)}; g.k.Bf=function(){return this.Hb&&g.NU(this.player)&&this.dC()&&!this.C}; var enb=[1,3,2,4];g.v(t6,g.U);g.k=t6.prototype;g.k.rZ=function(){switch(this.buttonType){case 1:var a="Watch again on YouTube";var b=156915;break;case 2:a="Continue watching on YouTube";b=156942;break;default:a="Continue watching on YouTube",b=156942}this.update({content:a});this.J.Vj(this.element)&&this.J.oC(this.element);this.J.xb(this.element,this,b)}; g.k.onClick=function(a){this.J.N("web_player_log_click_before_generating_ve_conversion_params")&&this.J.wb(this.element);g.eV(this.getVideoUrl(),this.J,a);this.J.N("web_player_log_click_before_generating_ve_conversion_params")||this.J.wb(this.element)}; g.k.getVideoUrl=function(){var a=!0;switch(this.buttonType){case 1:a=!0;break;case 2:a=!1}a=this.J.getVideoUrl(a,!1,!1,!0);var b=this.J.W();if(g.tS(b)||g.BS(b)){var c={};g.tS(b)&&g.sU(this.J,"addEmbedsConversionTrackingParams",[c]);a:{switch(this.buttonType){case 2:b="emb_ytp_continue_watching";break a}b="emb_ytp_watch_again"}g.VP(c,b);a=g.yl(a,c)}return a}; g.k.Xa=function(){this.J.Xa(this.element,this.Hb&&this.ma)}; g.k.show=function(){g.U.prototype.show.call(this);this.Xa()}; g.k.hide=function(){g.U.prototype.hide.call(this);this.Xa()}; g.k.lc=function(a){g.U.prototype.lc.call(this,a);this.Xa()};g.v(u6,p6);u6.prototype.show=function(){3!==this.player.getPlayerState()&&(p6.prototype.show.call(this),this.ub.PA(!0),this.ub.Gr(!0),this.J.W().Sd||this.ub.Fr(!0),this.J.Xa(this.element,!0),this.watchButton.lc(!0))}; u6.prototype.hide=function(){p6.prototype.hide.call(this);this.ub.PA(!1);this.ub.Gr(!1);this.ub.Fr(!1);this.J.Xa(this.element,!1);this.watchButton.lc(!1)};g.v($mb,p6);$mb.prototype.Sa=function(){var a=this.player.getVideoData();this.j.update({profilePicture:a.profilePicture,author:a.author});this.subscribeButton.channelId=a.Gl;var b=this.subscribeButton;a.subscribed?b.j():b.B()};g.v(v6,g.U);v6.prototype.select=function(){this.api.uo(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.yC||void 0)&&this.api.wb(this.element)}; v6.prototype.onClick=function(a){if(g.tS(this.api.W())&&this.api.N("web_player_log_click_before_generating_ve_conversion_params")){this.api.wb(this.element);var b=this.suggestion.Nk(),c={};g.qRa(this.api,c,"emb_rel_end");b=g.yl(b,c);g.eV(b,this.api,a)}else g.dV(a,this.api,this.B,this.suggestion.sessionData||void 0)&&this.select()}; v6.prototype.onKeyPress=function(a){switch(a.keyCode){case 13:case 32:a.defaultPrevented||(this.select(),a.preventDefault())}}; v6.prototype.onVideoDataChange=function(){var a=this.api.getVideoData(),b=this.api.W();this.B=a.Qd?!1:b.D};g.v(w6,p6);g.k=w6.prototype;g.k.create=function(){p6.prototype.create.call(this);var a=this.player.getVideoData();a&&(this.videoData=a);this.aq();this.B.V(this.player,"appresize",this.aq);this.B.V(this.player,"onVideoAreaChange",this.aq);this.B.V(this.player,"videodatachange",this.onVideoDataChange);this.B.V(this.player,"autonavchange",this.vK);this.B.V(this.player,"autonavcancel",this.H0);a=this.videoData.autonavState;a!==this.ea&&this.vK(a);this.B.V(this.element,"transitionend",this.j9)}; g.k.destroy=function(){g.uD(this.B);g.tb(this.stills);this.stills=[];p6.prototype.destroy.call(this);g.eu(this.element,"ytp-show-tiles");this.K.stop();this.ea=this.videoData.autonavState}; g.k.dC=function(){return 1!==this.videoData.autonavState}; g.k.show=function(){var a=this.Hb;p6.prototype.show.call(this);g.eu(this.element,"ytp-show-tiles");this.player.W().B?g.Xt(this.K):this.K.start();(this.G||this.D&&this.D!==this.videoData.clientPlaybackNonce)&&g.GU(this.player,!1);x6(this)?(y6(this),2===this.videoData.autonavState?3===this.player.getVisibilityState()?this.j.select(!0):this.j.WA():3===this.videoData.autonavState&&this.j.Bw()):(g.GU(this.player,!0),y6(this));a!==this.Hb&&this.player.Xa(this.element,!0)}; g.k.hide=function(){var a=this.Hb;p6.prototype.hide.call(this);this.j.Bw();y6(this);a!==this.Hb&&this.player.Xa(this.element,!1)}; g.k.j9=function(a){a.target===this.element&&this.aq()}; g.k.aq=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.IT(d)];if(e.length){g.cu(this.element,"ytp-endscreen-paginate");var f=this.J.Mk(!0,this.J.isFullscreen());if(a=g.uU(this.J))a=a.Mg()?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,w=b<=m-2&&p>=q*n;if((q+1)/r*d/h>h/(q/(r+1)*d)&&w)p-=q*n,b+=2;else if(t)p-=r*n,a+=2;else if(w)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?t=1:0===m%2&&0===l%2&&(2>m&&2>l?0===m&&0===l&&(t=2):t=2),q=g.re(q+this.C,c),0!==t){r=this.stills[h];r||(r=new v6(this.player),this.stills[h]=r,f.appendChild(r.element));w=Math.floor(p*m/b);var z=Math.floor(n*l/a),C=Math.floor(p*(m+t)/b)-w-4,I=Math.floor(n*(l+t)/a)-z-4;g.yr(r.element,z,w);g.Cr(r.element,I,C);g.sr(r.element,"transitionDelay", (m+l)/20+"s");g.gu(r.element,"ytp-videowall-still-mini",1===t);g.gu(r.element,"ytp-videowall-still-large",2t);g.gu(r.element,"ytp-videowall-still-round-small",96>=t);q=e[q];r.suggestion!==q&&(r.suggestion=q,t=r.api.W(),w=g.bu(r.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",l6(r,q,w),g.tS(t)&&!r.api.N("web_player_log_click_before_generating_ve_conversion_params")&& (t=q.Nk(),w={},g.sU(r.api,"addEmbedsConversionTrackingParams",[w]),t=g.yl(t,g.VP(w,"emb_rel_end")),r.updateValue("url",t)),(q=(q=q.sessionData)&&q.itct)&&r.api.Fg(r.element,q));h++}f.ariaBusy="false";g.gu(this.element,"ytp-endscreen-paginate",h=h;e--)a=this.stills[e],g.zf(a.element),g.sb(a);this.stills.length=h}}; g.k.onVideoDataChange=function(){var a=this.player.getVideoData();this.videoData!==a&&(this.C=0,this.videoData=a,this.aq())}; g.k.I0=function(){this.C+=this.stills.length;this.aq()}; g.k.J0=function(){this.C-=this.stills.length;this.aq()}; g.k.QW=function(){return this.j.Qk()}; g.k.vK=function(a){1===a?(this.G=!1,this.D=this.videoData.clientPlaybackNonce,this.j.Or(),this.Hb&&this.aq()):(this.G=!0,this.Hb&&x6(this)&&(2===a?this.j.WA():3===a&&this.j.Bw()))}; g.k.H0=function(a){if(a){for(a=0;a