(function(g){var window=this;'use strict';var YRB=function(M){M.publish("autonavvisibility")},Ixe=function(M,f){M.T0("onAutonavCoundownStarted",f)},Tv6=function(M){var f,A,Q; return M==null?void 0:(f=M.playerOverlays)==null?void 0:(A=f.playerOverlayRenderer)==null?void 0:(Q=A.autoplay)==null?void 0:Q.playerOverlayAutoplayRenderer},YN=function(M,f,A){g.Sb(M.element,"ytp-suggestion-set",!!f.videoId); var Q=f.playlistId;A=f.PK(A?A:"mqdefault.jpg");var N=null,Y=null;f instanceof g.Zm&&(f.lengthText?(N=f.lengthText||null,Y=f.Bb||null):f.lengthSeconds&&(N=g.B2(f.lengthSeconds),Y=g.B2(f.lengthSeconds,!0)));var I=!!Q;Q=I&&g.iS(Q).type==="RD";var D=f instanceof g.Zm?f.isLivePlayback:null,E=f instanceof g.Zm?f.isUpcoming:null,t=f.author,v=f.shortViewCount,p=f.publishedTimeText,h=[],S=[];t&&h.push(t);v&&(h.push(v),S.push(v));p&&S.push(p);A={title:f.title,author:t,author_and_views:h.join(" \u2022 "),aria_label:f.ariaLabel|| g.aC("Watch $TITLE",{TITLE:f.title}),duration:N,timestamp:Y,url:f.Rq(),is_live:D,is_upcoming:E,is_list:I,is_mix:Q,background:A?"background-image: url("+A+")":"",views_and_publish_time:S.join(" \u2022 "),autoplayAlternativeHeader:f.EK};f instanceof g.xs&&(A.playlist_length=f.playlistLength);M.update(A)},I4=function(M){var f=M.T(),A=f.C; g.O.call(this,{S:"a",Y:"ytp-autonav-suggestion-card",D:{href:"{{url}}",target:A?f.B:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},L:[{S:"div",Ai:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],D:{style:"{{background}}"},L:[{S:"div",D:{"aria-label":"{{timestamp}}"},Ai:["ytp-autonav-timestamp"],Ix:"{{duration}}"},{S:"div",Ai:["ytp-autonav-live-stamp"],Ix:"Live"},{S:"div", Ai:["ytp-autonav-upcoming-stamp"],Ix:"Upcoming"},{S:"div",Y:"ytp-autonav-list-overlay",L:[{S:"div",Y:"ytp-autonav-mix-text",Ix:"Mix"},{S:"div",Y:"ytp-autonav-mix-icon"}]}]},{S:"div",Ai:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],Ix:"{{title}}"},{S:"div",Ai:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],Ix:"{{author}}"},{S:"div",Ai:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],Ix:"{{views_and_publish_time}}"}]});this.U=M;this.suggestion= null;this.K=A;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},Tx=function(M,f){f=f===void 0?!1:f; g.O.call(this,{S:"div",Y:"ytp-autonav-endscreen-countdown-overlay"});var A=this;this.W=f;this.cancelCommand=this.G=void 0;this.j=0;this.container=new g.O({S:"div",Y:"ytp-autonav-endscreen-countdown-container"});g.d(this,this.container);this.container.pJ(this.element);f=M.T();var Q=f.C;this.U=M;this.suggestion=null;this.onVideoDataChange("newdata",g.F(this.U.getVideoData()));this.J(M,"videodatachange",this.onVideoDataChange);this.K=new g.O({S:"div",Y:"ytp-autonav-endscreen-upnext-container",D:{"aria-label":"{{aria_label}}", "data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},L:[{S:"div",Y:"ytp-autonav-endscreen-upnext-header"},{S:"div",Y:"ytp-autonav-endscreen-upnext-alternative-header",Ix:"{{autoplayAlternativeHeader}}"},{S:"a",Y:"ytp-autonav-endscreen-link-container",D:{href:"{{url}}",target:Q?f.B:""},L:[{S:"div",Y:"ytp-autonav-endscreen-upnext-thumbnail",D:{style:"{{background}}"},L:[{S:"div",D:{"aria-label":"{{timestamp}}"},Ai:["ytp-autonav-timestamp"], Ix:"{{duration}}"},{S:"div",Ai:["ytp-autonav-live-stamp"],Ix:"Live"},{S:"div",Ai:["ytp-autonav-upcoming-stamp"],Ix:"Upcoming"}]},{S:"div",Y:"ytp-autonav-endscreen-video-info",L:[{S:"div",Y:"ytp-autonav-endscreen-premium-badge"},{S:"div",Y:"ytp-autonav-endscreen-upnext-title",Ix:"{{title}}"},{S:"div",Y:"ytp-autonav-endscreen-upnext-author",Ix:"{{author}}"},{S:"div",Y:"ytp-autonav-view-and-date",Ix:"{{views_and_publish_time}}"},{S:"div",Y:"ytp-autonav-author-and-view",Ix:"{{author_and_views}}"}]}]}]}); g.d(this,this.K);this.K.pJ(this.container.element);Q||this.J(this.K.H7("ytp-autonav-endscreen-link-container"),"click",this.e2);this.U.createClientVe(this.container.element,this,115127);this.U.createClientVe(this.K.H7("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.O({S:"div",Y:"ytp-autonav-overlay"});g.d(this,this.overlay);this.overlay.pJ(this.container.element);this.Z=new g.O({S:"div",Y:"ytp-autonav-endscreen-button-container"});g.d(this,this.Z);this.Z.pJ(this.container.element); this.cancelButton=new g.O({S:"button",Ai:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",f.V("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],D:{"aria-label":"Cancel autoplay"},Ix:"Cancel"});g.d(this,this.cancelButton);this.cancelButton.pJ(this.Z.element);this.cancelButton.listen("click",this.HL,this);this.U.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.O({S:"a",Ai:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-play-button", f.V("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],D:{href:"{{url}}",role:"button","aria-label":"Play next video"},Ix:"Play Now"});g.d(this,this.playButton);this.playButton.pJ(this.Z.element);this.playButton.listen("click",this.e2,this);this.U.createServerVe(this.playButton.element,this.playButton,!0);(f=this.U.getVideoData())&&D9B(this,f);this.C=new g.MY(function(){ET9(A)},500); g.d(this,this.C);this.gt();this.J(M,"autonavvisibility",this.gt);this.U.V("web_autonav_color_transition")&&(this.J(M,"autonavchange",this.jR),this.J(M,"onAutonavCoundownStarted",this.X7$))},Dw=function(M){var f=M.U.GH(!0,M.U.isFullscreen()); g.Sb(M.container.element,"ytp-autonav-endscreen-small-mode",M.Qi(f));g.Sb(M.container.element,"ytp-autonav-endscreen-is-premium",!!M.suggestion&&!!M.suggestion.EZY);g.Sb(M.U.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!M.U.yU());g.Sb(M.U.getRootNode(),"countdown-running",M.nS());g.Sb(M.container.element,"ytp-player-content",M.U.yU());g.ji(M.overlay.element,{width:f.width+"px"});if(!M.nS()){M.U.yU()?tye(M,Math.round(vTK(M)/1E3)):tye(M);f=!!M.suggestion&&!!M.suggestion.EK;var A=M.U.yU()|| !f;g.Sb(M.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!A&&f);g.Sb(M.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",A&&!f);M.Z.aE(M.U.yU());g.Sb(M.element,"ytp-enable-w2w-color-transitions",pwR(M))}},ET9=function(M){var f=vTK(M),A=Math,Q=A.min; var N=M.j?Date.now()-M.j:0;A=Q.call(A,N,f);tye(M,Math.ceil((f-A)/1E3));f-A<=500&&M.nS()?M.select(!0):M.nS()&&M.C.start()},vTK=function(M){if(M.U.isFullscreen()){var f; M=(f=M.U.getVideoData())==null?void 0:f.AZ;return M===-1||M===void 0?8E3:M}return M.U.n1()>=0?M.U.n1():g.CE(M.U.T().experiments,"autoplay_time")||1E4},D9B=function(M,f){f=f.getWatchNextResponse(); var A,Q;f=(A=Tv6(f))==null?void 0:(Q=A.nextButton)==null?void 0:Q.buttonRenderer;M.G=f==null?void 0:f.navigationEndpoint;A=f==null?void 0:f.trackingParams;M.playButton&&A&&M.U.setTrackingParams(M.playButton.element,A)},pwR=function(M){var f; return!((f=M.U.getVideoData())==null||!f.watchToWatchTransitionRenderer)},tye=function(M,f){f=f===void 0?-1:f; M=M.K.H7("ytp-autonav-endscreen-upnext-header");g.Qw(M);if(f>=0){f=String(f);var A="Up next in $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],Q="Up next in $SECONDS".indexOf(A);if(Q>=0){M.appendChild(g.f$("Up next in $SECONDS".slice(0,Q)));var N=g.MQ("span");g.Dg(N,"ytp-autonav-endscreen-upnext-header-countdown-number");g.TD(N,f);M.appendChild(N);M.appendChild(g.f$("Up next in $SECONDS".slice(Q+A.length)));return}}g.TD(M,"Up next")},E4=function(M,f){g.O.call(this,{S:"div", Ai:["html5-endscreen","ytp-player-content",f||"base-endscreen"]});this.created=!1;this.player=M},t1=function(M){g.O.call(this,{S:"div", Ai:["ytp-upnext","ytp-player-content"],D:{"aria-label":"{{aria_label}}"},L:[{S:"div",Y:"ytp-cued-thumbnail-overlay-image",D:{style:"{{background}}"}},{S:"span",Y:"ytp-upnext-top",L:[{S:"span",Y:"ytp-upnext-header",Ix:"Up Next"},{S:"span",Y:"ytp-upnext-title",Ix:"{{title}}"},{S:"span",Y:"ytp-upnext-author",Ix:"{{author}}"}]},{S:"a",Y:"ytp-upnext-autoplay-icon",D:{role:"button",href:"{{url}}","aria-label":"Play next video"},L:[{S:"svg",D:{height:"100%",version:"1.1",viewBox:"0 0 72 72",width:"100%"}, L:[{S:"circle",Y:"ytp-svg-autoplay-circle",D:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{S:"circle",Y:"ytp-svg-autoplay-ring",D:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{S:"path",Y:"ytp-svg-fill",D:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{S:"span",Y:"ytp-upnext-bottom",L:[{S:"span",Y:"ytp-upnext-cancel"},{S:"span",Y:"ytp-upnext-paused", Ix:"Autoplay is paused"}]}]});this.api=M;this.cancelButton=null;this.G=this.H7("ytp-svg-autoplay-ring");this.j=this.notification=this.K=this.suggestion=null;this.C=new g.MY(this.HG,5E3,this);this.Z=0;var f=this.H7("ytp-upnext-cancel");this.cancelButton=new g.O({S:"button",Ai:["ytp-upnext-cancel-button","ytp-button"],D:{tabindex:"0","aria-label":"Cancel autoplay"},Ix:"Cancel"});g.d(this,this.cancelButton);this.cancelButton.listen("click",this.CV,this);this.cancelButton.pJ(f);this.cancelButton&&this.api.createClientVe(this.cancelButton.element, this,115129);g.d(this,this.C);this.api.createClientVe(this.element,this,18788);f=this.H7("ytp-upnext-autoplay-icon");this.J(f,"click",this.PL);this.api.createClientVe(f,this,115130);this.yf();this.J(M,"autonavvisibility",this.yf);this.J(M,"mdxnowautoplaying",this.opk);this.J(M,"mdxautoplaycanceled",this.Gtu);g.Sb(this.element,"ytp-upnext-mobile",this.api.T().Z)},htB=function(M,f){if(f)return f; if(M.api.isFullscreen()){var A;M=(A=M.api.getVideoData())==null?void 0:A.AZ;return M===-1||M===void 0?8E3:M}return M.api.n1()>=0?M.api.n1():g.CE(M.api.T().experiments,"autoplay_time")||1E4},SRm=function(M,f){f=htB(M,f); var A=Math,Q=A.min;var N=(0,g.W)()-M.Z;A=Q.call(A,N,f);f=f===0?1:Math.min(A/f,1);M.G.setAttribute("stroke-dashoffset",""+-211*(f+1));f>=1&&M.nS()&&M.api.getPresentingPlayerType()!==3?M.select(!0):M.nS()&&M.K.start()},v3=function(M){E4.call(this,M,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.O({S:"div",Y:"ytp-suggestion-panel",L:[{S:"div",Ai:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],Ix:"More videos"}]});this.X=new g.O({S:"div",Y:"ytp-suggestions-container"});this.videos=[];this.j=null;this.G=this.W=!1;this.Z=new Tx(this.player);g.d(this,this.Z);this.Z.pJ(this.element);M.getVideoData().N5?this.K=this.Z:(this.K=new t1(M),g.$X(this.player,this.K.element,4),g.d(this,this.K));this.overlay=new g.O({S:"div", Y:"ytp-autonav-overlay-cancelled-state"});g.d(this,this.overlay);this.overlay.pJ(this.element);this.C=new g.yK(this);g.d(this,this.C);g.d(this,this.table);this.table.pJ(this.element);this.table.show();g.d(this,this.X);this.X.pJ(this.table.element);this.hide()},p9=function(M){var f=M.yU(); f!==M.G&&(M.G=f,YRB(M.player),M.G?(M.Z!==M.K&&M.Z.hide(),M.table.hide()):(M.Z!==M.K&&M.Z.show(),M.table.show()))},h1=function(M,f){g.O.call(this,{S:"button", Ai:["ytp-watch-on-youtube-button","ytp-button"],Ix:"{{content}}"});this.U=M;this.buttonType=this.buttonType=f;this.Yl();this.buttonType===2&&g.tZ(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.Yl);this.aE(!0)},Sm=function(M,f){E4.call(this,M,"embeds-lite-endscreen"); this.U=M;this.K=f;this.U.createClientVe(this.element,this,156943);this.watchButton=new h1(M,2);g.d(this,this.watchButton);this.watchButton.pJ(this.element);this.hide()},L9=function(M){var f=M.T(),A=g.nU||g.uc?{style:"will-change: opacity"}:void 0,Q=f.C,N=["ytp-modern-videowall-still"]; f.Z&&N.push("ytp-videowall-show-text");g.O.call(this,{S:"a",Ai:N,D:{href:"{{url}}",target:Q?f.B:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},L:[{S:"div",Y:"ytp-modern-videowall-still-image",D:{style:"{{background}}"},L:[{S:"span",Y:"ytp-modern-videowall-still-info-duration",Ix:"{{duration}}"}]},{S:"span",Y:"ytp-modern-videowall-still-info",D:{"aria-hidden":"true"},L:[{S:"span",Y:"ytp-modern-videowall-still-info-bg",L:[{S:"span", Y:"ytp-modern-videowall-still-info-content",D:A,L:[{S:"span",Y:"ytp-modern-videowall-still-info-title",Ix:"{{title}}"},{S:"span",Y:"ytp-modern-videowall-still-info-author",Ix:"{{author_and_views}}"},{S:"span",Y:"ytp-modern-videowall-still-info-live",Ix:"Live"}]}]}]},{S:"span",Ai:["ytp-modern-videowall-still-listlabel-regular","ytp-modern-videowall-still-listlabel"],D:{"aria-hidden":"true"},L:[{S:"span",Y:"ytp-modern-videowall-still-listlabel-icon"},"Playlist",{S:"span",Y:"ytp-modern-videowall-still-listlabel-length", L:[" (",{S:"span",Ix:"{{playlist_length}}"},")"]}]},{S:"span",Ai:["ytp-modern-videowall-still-listlabel-mix","ytp-modern-videowall-still-listlabel"],D:{"aria-hidden":"true"},L:[{S:"span",Y:"ytp-modern-videowall-still-listlabel-mix-icon"},"Mix",{S:"span",Y:"ytp-modern-videowall-still-listlabel-length",Ix:" (50+)"}]}]});this.suggestion=null;this.Z=Q;this.api=M;this.K=new g.yK(this);g.d(this,this.K);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.K.J(M,"videodatachange", this.onVideoDataChange);M.createServerVe(this.element,this);this.onVideoDataChange()},LX7=function(M){E4.call(this,M,"videowall-endscreen"); var f=this;this.U=M;this.stills=[];this.j=this.videoData=null;this.C=this.W=!1;this.X=null;g.tZ(this.element,"modern-videowall-endscreen");this.Z=new g.yK(this);g.d(this,this.Z);this.G=new g.MY(function(){g.tZ(f.element,"ytp-show-tiles")},0); g.d(this,this.G);this.table=new g.SK({S:"div",Y:"ytp-modern-endscreen-content"});g.d(this,this.table);this.table.pJ(this.element);M.getVideoData().N5?this.K=new Tx(M,!0):this.K=new t1(M);g.d(this,this.K);g.$X(this.player,this.K.element,4);M.createClientVe(this.element,this,158789);this.hide()},o4=function(M){return g.Ff(M.player)&&M.bd()&&!M.j},C9=function(M){var f=M.yU(); f!==M.W&&(M.W=f,YRB(M.player))},oT9=function(M){E4.call(this,M,"subscribecard-endscreen"); this.K=new g.O({S:"div",Y:"ytp-subscribe-card",L:[{S:"img",Y:"ytp-author-image",D:{src:"{{profilePicture}}"}},{S:"div",Y:"ytp-subscribe-card-right",L:[{S:"div",Y:"ytp-author-name",Ix:"{{author}}"},{S:"div",Y:"html5-subscribe-button-container"}]}]});g.d(this,this.K);this.K.pJ(this.element);var f=M.getVideoData();this.subscribeButton=new g.wT("Subscribe",null,"Unsubscribe",null,!0,!1,f.QM,f.subscribed,"trailer-endscreen",null,M,!1);g.d(this,this.subscribeButton);this.subscribeButton.pJ(this.K.H7("html5-subscribe-button-container")); this.J(M,"videodatachange",this.Nu);this.Nu();this.hide()},U4=function(M){var f=M.T(),A=g.nU||g.uc?{style:"will-change: opacity"}:void 0,Q=f.C,N=["ytp-videowall-still"]; f.Z&&N.push("ytp-videowall-show-text");g.O.call(this,{S:"a",Ai:N,D:{href:"{{url}}",target:Q?f.B:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},L:[{S:"div",Y:"ytp-videowall-still-image",D:{style:"{{background}}"}},{S:"span",Y:"ytp-videowall-still-info",D:{"aria-hidden":"true"},L:[{S:"span",Y:"ytp-videowall-still-info-bg",L:[{S:"span",Y:"ytp-videowall-still-info-content",D:A,L:[{S:"span",Y:"ytp-videowall-still-info-title",Ix:"{{title}}"}, {S:"span",Y:"ytp-videowall-still-info-author",Ix:"{{author_and_views}}"},{S:"span",Y:"ytp-videowall-still-info-live",Ix:"Live"},{S:"span",Y:"ytp-videowall-still-info-duration",Ix:"{{duration}}"}]}]}]},{S:"span",Ai:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],D:{"aria-hidden":"true"},L:[{S:"span",Y:"ytp-videowall-still-listlabel-icon"},"Playlist",{S:"span",Y:"ytp-videowall-still-listlabel-length",L:[" (",{S:"span",Ix:"{{playlist_length}}"},")"]}]},{S:"span",Ai:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],D:{"aria-hidden":"true"},L:[{S:"span",Y:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{S:"span",Y:"ytp-videowall-still-listlabel-length",Ix:" (50+)"}]}]});this.suggestion=null;this.Z=Q;this.api=M;this.K=new g.yK(this);g.d(this,this.K);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.K.J(M,"videodatachange",this.onVideoDataChange);M.createServerVe(this.element,this);this.onVideoDataChange()},Vg=function(M){E4.call(this,M,"videowall-endscreen"); var f=this;this.U=M;this.j=0;this.stills=[];this.C=this.videoData=null;this.G=this.X=!1;this.B=null;this.Z=new g.yK(this);g.d(this,this.Z);this.W=new g.MY(function(){g.tZ(f.element,"ytp-show-tiles")},0); g.d(this,this.W);var A=new g.O({S:"button",Ai:["ytp-button","ytp-endscreen-previous"],D:{"aria-label":"Previous"},L:[g.mj()]});g.d(this,A);A.pJ(this.element);A.listen("click",this.Uz,this);this.table=new g.SK({S:"div",Y:"ytp-endscreen-content"});g.d(this,this.table);this.table.pJ(this.element);A=new g.O({S:"button",Ai:["ytp-button","ytp-endscreen-next"],D:{"aria-label":"Next"},L:[g.cO()]});g.d(this,A);A.pJ(this.element);A.listen("click",this.fV,this);M.getVideoData().N5?this.K=new Tx(M,!0):this.K= new t1(M);g.d(this,this.K);g.$X(this.player,this.K.element,4);M.createClientVe(this.element,this,158789);this.hide()},a4=function(M){return g.Ff(M.player)&&M.bd()&&!M.C},qo=function(M){var f=M.yU(); f!==M.X&&(M.X=f,YRB(M.player))},H3=function(M){E4.call(this,M,"watch-again-on-youtube-endscreen"); this.watchButton=new h1(M,1);g.d(this,this.watchButton);this.watchButton.pJ(this.element);g.pX7(M)&&(this.K=new g.wj(M),g.d(this,this.K),this.Z=new g.O({S:"div",Ai:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],D:{tabIndex:"-1"},L:[this.K]}),g.d(this,this.Z),this.K.pJ(this.Z.element),this.Z.pJ(this.element));M.createClientVe(this.element,this,156914);this.hide()},ax9=function(M){g.CV.call(this,M); var f=this;this.endScreen=null;this.Z=this.K=this.j=this.C=!1;this.listeners=new g.yK(this);g.d(this,this.listeners);var A=M.T(),Q=M.getVideoData();Q=Q&&Q.limitedPlaybackDurationInSeconds!==0;g.SA(g.kI(A))&&Q&&!g.zt(M)?(this.Z=!0,this.endScreen=new Sm(M,g.al(M))):M.isEmbedsShortsMode()?this.endScreen=new H3(M):C8C(M)?(this.C=!0,U9W(this),this.K?this.endScreen=new v3(M):A.V("delhi_modern_endscreen")?this.endScreen=new LX7(M):this.endScreen=new Vg(M)):A.o9?this.endScreen=new oT9(M):this.endScreen=new E4(M); g.d(this,this.endScreen);g.$X(M,this.endScreen.element,4);Vyw(this);this.listeners.J(M,"videodatachange",this.onVideoDataChange,this);this.listeners.J(M,g.EW("endscreen"),function(N){f.onCueRangeEnter(N)}); this.listeners.J(M,g.tf("endscreen"),function(N){f.onCueRangeExit(N)})},U9W=function(M){var f=M.player.getVideoData(); if(!f||M.K===f.d5&&M.j===f.N5)return!1;M.K=f.d5;M.j=f.N5;return!0},C8C=function(M){M=M.T(); return M.N5&&!M.o9&&!M.disableOrganicUi},Vyw=function(M){M.player.GU("endscreen"); var f=M.player.getVideoData();f=new g.T1(Math.max((f.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var A=new g.T1(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});M.player.L3([f,A])}; g.xX.prototype.n1=g.If(14,function(){return this.app.n1()}); g.oO.prototype.n1=g.If(13,function(){return this.getVideoData().qx}); g.Rl.prototype.n_=g.If(12,function(M){this.v2().n_(M)}); g.p1.prototype.n_=g.If(11,function(M){this.K!==M&&(this.K=M,this.Nu())}); g.iJ.prototype.n_=g.If(10,function(M){this.overflowButton&&this.overflowButton.n_(M)}); g.Rl.prototype.oG=g.If(9,function(M){this.v2().oG(M)}); g.Uq.prototype.oG=g.If(8,function(M){this.Z!==M&&(this.Z=M,this.Nu())}); g.iJ.prototype.oG=g.If(7,function(M){this.shareButton&&this.shareButton.oG(M)}); g.Rl.prototype.yT=g.If(6,function(M){this.v2().yT(M)}); g.ki.prototype.yT=g.If(5,function(M){this.lB!==M&&(this.lB=M,this.bX())}); g.Rl.prototype.eJ=g.If(4,function(M){this.v2().eJ(M)}); g.iJ.prototype.eJ=g.If(3,function(M){this.hc!==M&&(this.hc=M,this.J5())});g.U(I4,g.O);I4.prototype.select=function(){this.U.x7(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.iY||void 0)&&this.U.logClick(this.element)}; I4.prototype.onClick=function(M){g.t$(M,this.U,this.K,this.suggestion.sessionData||void 0)&&this.select()}; I4.prototype.onKeyPress=function(M){switch(M.keyCode){case 13:case 32:M.defaultPrevented||(this.select(),M.preventDefault())}};g.U(Tx,g.O);g.C=Tx.prototype;g.C.vA=function(M){this.suggestion!==M&&(this.suggestion=M,YN(this.K,M),this.playButton.updateValue("url",this.suggestion.Rq()),Dw(this))}; g.C.nS=function(){return this.j>0}; g.C.xR=function(){this.nS()||(this.j=Date.now(),ET9(this),Ixe(this.U,vTK(this)),g.Sb(this.U.getRootNode(),"countdown-running",this.nS()))}; g.C.gR=function(){this.z$();ET9(this);var M=this.K.H7("ytp-autonav-endscreen-upnext-header");M&&g.TD(M,"Up next")}; g.C.z$=function(){this.nS()&&(this.C.stop(),this.j=0)}; g.C.select=function(M){this.U.nextVideo(!1,M===void 0?!1:M);this.z$()}; g.C.e2=function(M){g.t$(M,this.U)&&(M.currentTarget===this.playButton.element?this.U.logClick(this.playButton.element):M.currentTarget===this.K.H7("ytp-autonav-endscreen-link-container")&&(M=this.K.H7("ytp-autonav-endscreen-link-container"),this.U.logVisibility(M,!0),this.U.logClick(M)),this.G?(this.U.T0("innertubeCommand",this.G),this.z$()):this.select())}; g.C.HL=function(){this.U.logClick(this.cancelButton.element);g.rx(this.U,!0);this.cancelCommand&&this.U.T0("innertubeCommand",this.cancelCommand)}; g.C.onVideoDataChange=function(M,f){D9B(this,f);M=f.getWatchNextResponse();var A,Q;M=(A=Tv6(M))==null?void 0:(Q=A.cancelButton)==null?void 0:Q.buttonRenderer;this.cancelCommand=M==null?void 0:M.command}; g.C.X7$=function(M){if(pwR(this)){var f=this.U.getVideoData().watchToWatchTransitionRenderer,A=f==null?void 0:f.fromColorPaletteDark;f=f==null?void 0:f.toColorPaletteDark;if(A&&f){var Q=this.element;Q.style.setProperty("--w2w-start-background-color",g.eI(A.surgeColor));Q.style.setProperty("--w2w-start-primary-text-color",g.eI(A.primaryTitleColor));Q.style.setProperty("--w2w-start-secondary-text-color",g.eI(A.secondaryTitleColor));Q.style.setProperty("--w2w-end-background-color",g.eI(f.surgeColor)); Q.style.setProperty("--w2w-end-primary-text-color",g.eI(f.primaryTitleColor));Q.style.setProperty("--w2w-end-secondary-text-color",g.eI(f.secondaryTitleColor));Q.style.setProperty("--w2w-animation-duration",M+"ms")}g.Sb(this.element,"ytp-w2w-animate",!0)}}; g.C.jR=function(M){this.U.V("web_autonav_color_transition")&&M!==2&&g.Sb(this.element,"ytp-w2w-animate",!1)}; g.C.gt=function(){var M=this.U.yU();this.W&&this.B7!==M&&this.aE(M);Dw(this);this.U.logVisibility(this.container.element,M);this.U.logVisibility(this.cancelButton.element,M);this.U.logVisibility(this.K.H7("ytp-autonav-endscreen-link-container"),M);this.U.logVisibility(this.playButton.element,M)}; g.C.Qi=function(M){return M.width<400||M.height<459};g.U(E4,g.O);g.C=E4.prototype;g.C.create=function(){this.created=!0}; g.C.destroy=function(){this.created=!1}; g.C.bd=function(){return!1}; g.C.yU=function(){return!1}; g.C.SS=function(){return!1};g.U(t1,g.O);g.C=t1.prototype;g.C.HG=function(){this.notification&&(this.C.stop(),this.Hv(this.j),this.j=null,this.notification.close(),this.notification=null)}; g.C.vA=function(M){this.suggestion=M;YN(this,M,"hqdefault.jpg")}; g.C.yf=function(){this.aE(this.api.yU());this.api.logVisibility(this.element,this.api.yU());this.api.logVisibility(this.H7("ytp-upnext-autoplay-icon"),this.api.yU());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.yU())}; g.C.Okk=function(){window.focus();this.HG()}; g.C.xR=function(M){var f=this;this.nS()||(g.tJ("a11y-announce","Up Next "+this.suggestion.title),this.Z=(0,g.W)(),this.K=new g.MY(function(){SRm(f,M)},25),SRm(this,M),Ixe(this.api,htB(this,M))); g.p5(this.element,"ytp-upnext-autoplay-paused")}; g.C.hide=function(){g.O.prototype.hide.call(this)}; g.C.nS=function(){return!!this.K}; g.C.gR=function(){this.z$();this.Z=(0,g.W)();SRm(this);g.tZ(this.element,"ytp-upnext-autoplay-paused")}; g.C.z$=function(){this.nS()&&(this.K.dispose(),this.K=null)}; g.C.select=function(M){M=M===void 0?!1:M;if(this.api.T().V("autonav_notifications")&&M&&window.Notification&&typeof document.hasFocus==="function"){var f=Notification.permission;f==="default"?Notification.requestPermission():f!=="granted"||document.hasFocus()||(this.HG(),this.notification=new Notification("Up Next",{body:this.suggestion.title,icon:this.suggestion.PK()}),this.j=this.J(this.notification,"click",this.Okk),this.C.start())}this.z$();this.api.nextVideo(!1,M)}; g.C.PL=function(M){!g.IH(this.cancelButton.element,M.target)&&g.t$(M,this.api)&&(this.api.yU()&&this.api.logClick(this.H7("ytp-upnext-autoplay-icon")),this.select())}; g.C.CV=function(){this.api.yU()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.rx(this.api,!0)}; g.C.opk=function(M){this.api.getPresentingPlayerType();this.show();this.xR(M)}; g.C.Gtu=function(){this.api.getPresentingPlayerType();this.z$();this.hide()}; g.C.u8=function(){this.z$();this.HG();g.O.prototype.u8.call(this)};g.U(v3,E4);g.C=v3.prototype;g.C.create=function(){E4.prototype.create.call(this);this.C.J(this.player,"appresize",this.Ol);this.C.J(this.player,"onVideoAreaChange",this.Ol);this.C.J(this.player,"videodatachange",this.onVideoDataChange);this.C.J(this.player,"autonavchange",this.nB);this.C.J(this.player,"onAutonavCancelled",this.ze);this.onVideoDataChange()}; g.C.show=function(){E4.prototype.show.call(this);(this.W||this.j&&this.j!==this.videoData.clientPlaybackNonce)&&g.rx(this.player,!1);g.Ff(this.player)&&this.bd()&&!this.j?(p9(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3?this.K.select(!0):this.K.xR():this.videoData.autonavState===3&&this.K.gR()):(g.rx(this.player,!0),p9(this));this.Ol()}; g.C.hide=function(){E4.prototype.hide.call(this);this.K.gR();p9(this)}; g.C.Ol=function(){var M=this.player.GH(!0,this.player.isFullscreen());p9(this);Dw(this.Z);g.Sb(this.element,"ytp-autonav-cancelled-small-mode",this.Qi(M));g.Sb(this.element,"ytp-autonav-cancelled-tiny-mode",this.lA(M));g.Sb(this.element,"ytp-autonav-cancelled-mini-mode",M.width<=400||M.height<=360);this.overlay&&g.ji(this.overlay.element,{width:M.width+"px"});if(!this.G)for(M=0;M0&&(M= p*4,S=f<=E-2&&t>=v*4;if((v+1)/p*Q/I>I/(v/(p+1)*Q)&&S)t-=v*4,f+=2;else if(h)t-=p*4,M+=2;else if(S)t-=v*4,f+=2;else break}Q=!1;t>=12&&A*4-t<=6&&(f>=4||M>=4)&&(Q=!0);t=M*96;D=f*54;I=t/D=M-2&&v>=f-2?S=1:v%2===0&&E%2===0&&(v<2&&E<2?v===0&&E===0&&(S=2):S=2),p=g.xR(p+this.j,A),S!==0){h=this.stills[I];h||(h=new U4(this.player),this.stills[I]=h,Y.appendChild(h.element));var L=Math.floor(D*v/f),a=Math.floor(t*E/M),q=Math.floor(D*(v+S)/f)-L-4,m=Math.floor(t*(E+S)/M)-a-4;g.bW(h.element,a,L);g.Xo(h.element,m,q);g.ji(h.element,"transitionDelay",(v+E)/20+"s");g.Sb(h.element,"ytp-videowall-still-mini", S===1);g.Sb(h.element,"ytp-videowall-still-large",S>2);S=Math.max(m,q);g.Sb(h.element,"ytp-videowall-still-round-large",S>=256);g.Sb(h.element,"ytp-videowall-still-round-medium",S>96&&S<256);g.Sb(h.element,"ytp-videowall-still-round-small",S<=96);p=N[p];h.suggestion!==p&&(h.suggestion=p,S=h.api.T(),L=g.ED(h.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",YN(h,p,L),g.Ps(S)&&!h.api.V("web_player_log_click_before_generating_ve_conversion_params")&&(S=p.Rq(),L={},g.Lv(h.api,"addEmbedsConversionTrackingParams", [L]),S=g.uj(S,L),h.updateValue("url",S)),(p=(p=p.sessionData)&&p.itct)&&h.api.setTrackingParams(h.element,p));I++}Y.ariaBusy="false";g.Sb(this.element,"ytp-endscreen-paginate",I=I;N--)M=this.stills[N],g.Ya(M.element),g.hW(M);this.stills.length=I}}; g.C.onVideoDataChange=function(){var M=this.player.getVideoData(1);this.videoData!==M&&(M!=null&&g.Y_(M)?(this.j=0,this.videoData=M,this.tR()):this.player.ZB("missg",{vid:(M==null?void 0:M.videoId)||"",cpn:(M==null?void 0:M.clientPlaybackNonce)||""}))}; g.C.fV=function(){this.j+=this.stills.length;this.tR()}; g.C.Uz=function(){this.j-=this.stills.length;this.tR()}; g.C.SS=function(){return this.K.nS()}; g.C.PF=function(M){M===1?(this.G=!1,this.C=this.videoData.clientPlaybackNonce,this.K.z$(),this.B7&&this.tR()):(this.G=!0,this.B7&&a4(this)&&(M===2?this.K.xR():M===3&&this.K.gR()))}; g.C.Ay=function(M){if(M){for(M=0;M0||M.endSeconds>0||M.mutedAutoplayDurationMode!==2);if((this.player.isEmbedsShortsMode()||this.Z)&&!f)return!0;var A;var Q=!!((M==null?0:g.Y_(M))||(M==null?0:(A=M.suggestions)==null?0:A.length));Q=!C8C(this.player)||Q;M=M.lr;A=this.player.GI();return Q&&!M&&!A&&!f}; g.C.yU=function(){return this.endScreen.yU()}; g.C.mm=function(){return this.yU()?this.endScreen.SS():!1}; g.C.u8=function(){this.player.GU("endscreen");g.CV.prototype.u8.call(this)}; g.C.load=function(){var M=this.player.getVideoData();var f=M.transitionEndpointAtEndOfStream;if(f&&f.videoId){var A=this.player.kp().Bu.get("heartbeat"),Q=g.Y_(M);!Q||f.videoId!==Q.videoId||M.tp?(this.player.x7(f.videoId,void 0,void 0,!0,!0,f),A&&A.Ex("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),M=!0):M=!1}else M=!1;M||(g.CV.prototype.load.call(this),this.endScreen.show())}; g.C.unload=function(){g.CV.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.C.onCueRangeEnter=function(M){this.rA()&&(this.endScreen.created||this.endScreen.create(),M.getId()==="load"&&this.load())}; g.C.onCueRangeExit=function(M){M.getId()==="load"&&this.loaded&&this.unload()}; g.C.onVideoDataChange=function(){Vyw(this);this.C&&U9W(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.K?this.endScreen=new v3(this.player):this.endScreen=new Vg(this.player),g.d(this,this.endScreen),g.$X(this.player,this.endScreen.element,4))};g.oW("endscreen",ax9);})(_yt_player);