(function(g){var window=this;'use strict';var ub0=function(E){E.publish("autonavvisibility")},AE$=function(E,e){E.MD("onAutonavCoundownStarted",e)},CN_=function(E){var e,l,k; return E==null?void 0:(e=E.playerOverlays)==null?void 0:(l=e.playerOverlayRenderer)==null?void 0:(k=l.autoplay)==null?void 0:k.playerOverlayAutoplayRenderer},AD=function(E){var e=E.Y(),l=e.S; g.Z.call(this,{X:"a",B:"ytp-autonav-suggestion-card",D:{href:"{{url}}",target:l?e.V:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},K:[{X:"div",s7:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],D:{style:"{{background}}"},K:[{X:"div",D:{"aria-label":"{{timestamp}}"},s7:["ytp-autonav-timestamp"],Tz:"{{duration}}"},{X:"div",s7:["ytp-autonav-live-stamp"],Tz:"Ao vivo"}, {X:"div",s7:["ytp-autonav-upcoming-stamp"],Tz:"Em breve"},{X:"div",B:"ytp-autonav-list-overlay",K:[{X:"div",B:"ytp-autonav-mix-text",Tz:"Mix"},{X:"div",B:"ytp-autonav-mix-icon"}]}]},{X:"div",s7:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],Tz:"{{title}}"},{X:"div",s7:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],Tz:"{{author}}"},{X:"div",s7:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],Tz:"{{views_and_publish_time}}"}]});this.U=E;this.suggestion= null;this.T=l;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},CH=function(E,e){e=e===void 0?!1:e; g.Z.call(this,{X:"div",B:"ytp-autonav-endscreen-countdown-overlay"});var l=this;this.j=e;this.cancelCommand=this.J=void 0;this.Z=0;this.container=new g.Z({X:"div",B:"ytp-autonav-endscreen-countdown-container"});g.L(this,this.container);this.container.u3(this.element);e=E.Y();var k=e.S;this.U=E;this.suggestion=null;this.onVideoDataChange("newdata",this.U.getVideoData());this.C(E,"videodatachange",this.onVideoDataChange);this.T=new g.Z({X:"div",B:"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}}"},K:[{X:"div",B:"ytp-autonav-endscreen-upnext-header"},{X:"div",B:"ytp-autonav-endscreen-upnext-alternative-header",Tz:"{{autoplayAlternativeHeader}}"},{X:"a",B:"ytp-autonav-endscreen-link-container",D:{href:"{{url}}",target:k?e.V:""},K:[{X:"div",B:"ytp-autonav-endscreen-upnext-thumbnail",D:{style:"{{background}}"},K:[{X:"div",D:{"aria-label":"{{timestamp}}"},s7:["ytp-autonav-timestamp"], Tz:"{{duration}}"},{X:"div",s7:["ytp-autonav-live-stamp"],Tz:"Ao vivo"},{X:"div",s7:["ytp-autonav-upcoming-stamp"],Tz:"Em breve"}]},{X:"div",B:"ytp-autonav-endscreen-video-info",K:[{X:"div",B:"ytp-autonav-endscreen-premium-badge"},{X:"div",B:"ytp-autonav-endscreen-upnext-title",Tz:"{{title}}"},{X:"div",B:"ytp-autonav-endscreen-upnext-author",Tz:"{{author}}"},{X:"div",B:"ytp-autonav-view-and-date",Tz:"{{views_and_publish_time}}"},{X:"div",B:"ytp-autonav-author-and-view",Tz:"{{author_and_views}}"}]}]}]}); g.L(this,this.T);this.T.u3(this.container.element);k||this.C(this.T.X6("ytp-autonav-endscreen-link-container"),"click",this.fE);this.U.createClientVe(this.container.element,this,115127);this.U.createClientVe(this.T.X6("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.Z({X:"div",B:"ytp-autonav-overlay"});g.L(this,this.overlay);this.overlay.u3(this.container.element);this.G=new g.Z({X:"div",B:"ytp-autonav-endscreen-button-container"});g.L(this,this.G);this.G.u3(this.container.element); this.cancelButton=new g.Z({X:"button",s7:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",e.L("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],D:{"aria-label":"Cancelar reprodu\u00e7\u00e3o autom\u00e1tica"},Tz:"Cancelar"});g.L(this,this.cancelButton);this.cancelButton.u3(this.G.element);this.cancelButton.listen("click",this.k9,this);this.U.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.Z({X:"a",s7:["ytp-autonav-endscreen-upnext-button", "ytp-autonav-endscreen-upnext-play-button",e.L("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],D:{href:"{{url}}",role:"button","aria-label":"Reproduzir pr\u00f3ximo v\u00eddeo"},Tz:"Assista agora"});g.L(this,this.playButton);this.playButton.u3(this.G.element);this.playButton.listen("click",this.fE,this);this.U.createServerVe(this.playButton.element,this.playButton,!0);(e=this.U.getVideoData())&&p40(this,e);this.S=new g.Nx(function(){xQ6(l)},500); g.L(this,this.S);this.lf();this.C(E,"autonavvisibility",this.lf);this.U.L("web_autonav_color_transition")&&(this.C(E,"autonavchange",this.nH),this.C(E,"onAutonavCoundownStarted",this.tRz))},pH=function(E){var e=E.U.uH(!0,E.U.isFullscreen()); g.k_(E.container.element,"ytp-autonav-endscreen-small-mode",E.fD(e));g.k_(E.container.element,"ytp-autonav-endscreen-is-premium",!!E.suggestion&&!!E.suggestion.VH3);g.k_(E.U.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!E.U.wR());g.k_(E.U.getRootNode(),"countdown-running",E.Qh());g.k_(E.container.element,"ytp-player-content",E.U.wR());g.MV(E.overlay.element,{width:e.width+"px"});if(!E.Qh()){E.U.wR()?Qxs(E,Math.round(Wbs(E)/1E3)):Qxs(E);e=!!E.suggestion&&!!E.suggestion.a5;var l=E.U.wR()|| !e;g.k_(E.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!l&&e);g.k_(E.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",l&&!e);E.G.Yw(E.U.wR());g.k_(E.element,"ytp-enable-w2w-color-transitions",BGs(E))}},xQ6=function(E){var e=Wbs(E),l=Math,k=l.min; var H=E.Z?Date.now()-E.Z:0;l=k.call(l,H,e);Qxs(E,Math.ceil((e-l)/1E3));e-l<=500&&E.Qh()?E.select(!0):E.Qh()&&E.S.start()},Wbs=function(E){if(E.U.isFullscreen()){var e; E=(e=E.U.getVideoData())==null?void 0:e.Qn;return E===-1||E===void 0?8E3:E}return E.U.It()>=0?E.U.It():g.tJ(E.U.Y().experiments,"autoplay_time")||1E4},p40=function(E,e){e=e.getWatchNextResponse(); var l,k;e=(l=CN_(e))==null?void 0:(k=l.nextButton)==null?void 0:k.buttonRenderer;E.J=e==null?void 0:e.navigationEndpoint;l=e==null?void 0:e.trackingParams;E.playButton&&l&&E.U.setTrackingParams(E.playButton.element,l)},BGs=function(E){var e; return!((e=E.U.getVideoData())==null||!e.watchToWatchTransitionRenderer)},Qxs=function(E,e){e=e===void 0?-1:e; E=E.T.X6("ytp-autonav-endscreen-upnext-header");g.ob(E);if(e>=0){e=String(e);var l="Pr\u00f3ximo v\u00eddeo em $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],k="Pr\u00f3ximo v\u00eddeo em $SECONDS".indexOf(l);if(k>=0){E.appendChild(g.Wb("Pr\u00f3ximo v\u00eddeo em $SECONDS".slice(0,k)));var H=g.Qz("span");g.sg(H,"ytp-autonav-endscreen-upnext-header-countdown-number");g.GD(H,e);E.appendChild(H);E.appendChild(g.Wb("Pr\u00f3ximo v\u00eddeo em $SECONDS".slice(k+l.length)));return}}g.GD(E,"Pr\u00f3ximo")}, xc=function(E,e){g.Z.call(this,{X:"div", s7:["html5-endscreen","ytp-player-content",e||"base-endscreen"]});this.created=!1;this.player=E},Qq=function(E){g.Z.call(this,{X:"div", s7:["ytp-upnext","ytp-player-content"],D:{"aria-label":"{{aria_label}}"},K:[{X:"div",B:"ytp-cued-thumbnail-overlay-image",D:{style:"{{background}}"}},{X:"span",B:"ytp-upnext-top",K:[{X:"span",B:"ytp-upnext-header",Tz:"Pr\u00f3ximo"},{X:"span",B:"ytp-upnext-title",Tz:"{{title}}"},{X:"span",B:"ytp-upnext-author",Tz:"{{author}}"}]},{X:"a",B:"ytp-upnext-autoplay-icon",D:{role:"button",href:"{{url}}","aria-label":"Reproduzir pr\u00f3ximo v\u00eddeo"},K:[{X:"svg",D:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},K:[{X:"circle",B:"ytp-svg-autoplay-circle",D:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{X:"circle",B:"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)"}},{X:"path",B:"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"}}]}]},{X:"span",B:"ytp-upnext-bottom",K:[{X:"span",B:"ytp-upnext-cancel"},{X:"span",B:"ytp-upnext-paused", Tz:"Reprodu\u00e7\u00e3o autom\u00e1tica pausada"}]}]});this.api=E;this.cancelButton=null;this.J=this.X6("ytp-svg-autoplay-ring");this.Z=this.notification=this.T=this.suggestion=null;this.S=new g.Nx(this.Tb,5E3,this);this.G=0;var e=this.X6("ytp-upnext-cancel");this.cancelButton=new g.Z({X:"button",s7:["ytp-upnext-cancel-button","ytp-button"],D:{tabindex:"0","aria-label":"Cancelar reprodu\u00e7\u00e3o autom\u00e1tica"},Tz:"Cancelar"});g.L(this,this.cancelButton);this.cancelButton.listen("click",this.wj, this);this.cancelButton.u3(e);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.L(this,this.S);this.api.createClientVe(this.element,this,18788);e=this.X6("ytp-upnext-autoplay-icon");this.C(e,"click",this.TJ);this.api.createClientVe(e,this,115130);this.UO();this.C(E,"autonavvisibility",this.UO);this.C(E,"mdxnowautoplaying",this.sn4);this.C(E,"mdxautoplaycanceled",this.cg6);g.k_(this.element,"ytp-upnext-mobile",this.api.Y().G)},oUH=function(E,e){if(e)return e; if(E.api.isFullscreen()){var l;E=(l=E.api.getVideoData())==null?void 0:l.Qn;return E===-1||E===void 0?8E3:E}return E.api.It()>=0?E.api.It():g.tJ(E.api.Y().experiments,"autoplay_time")||1E4},w4r=function(E,e){e=oUH(E,e); var l=Math,k=l.min;var H=(0,g.dE)()-E.G;l=k.call(l,H,e);e=e===0?1:Math.min(l/e,1);E.J.setAttribute("stroke-dashoffset",""+-211*(e+1));e>=1&&E.Qh()&&E.api.getPresentingPlayerType()!==3?E.select(!0):E.Qh()&&E.T.start()},WM=function(E){xc.call(this,E,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.Z({X:"div",B:"ytp-suggestion-panel",K:[{X:"div",s7:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],Tz:"Mais v\u00eddeos"}]});this.N=new g.Z({X:"div",B:"ytp-suggestions-container"});this.videos=[];this.Z=null;this.J=this.j=!1;this.G=new CH(this.player);g.L(this,this.G);this.G.u3(this.element);E.getVideoData().MM?this.T=this.G:(this.T=new Qq(E),g.sT(this.player,this.T.element,4),g.L(this,this.T));this.overlay=new g.Z({X:"div", B:"ytp-autonav-overlay-cancelled-state"});g.L(this,this.overlay);this.overlay.u3(this.element);this.S=new g.G_(this);g.L(this,this.S);g.L(this,this.table);this.table.u3(this.element);this.table.show();g.L(this,this.N);this.N.u3(this.table.element);this.hide()},BM=function(E){var e=E.wR(); e!==E.J&&(E.J=e,ub0(E.player),E.J?(E.G!==E.T&&E.G.hide(),E.table.hide()):(E.G!==E.T&&E.G.show(),E.table.show()))},zt_=function(E){xc.call(this,E,"videowall-endscreen"); var e=this;this.U=E;this.stills=[];this.Z=this.videoData=null;this.S=this.j=!1;this.N=null;g.qx(this.element,"modern-videowall-endscreen");this.G=new g.G_(this);g.L(this,this.G);this.J=new g.Nx(function(){g.qx(e.element,"ytp-show-tiles")},0); g.L(this,this.J);this.table=new g.qS({X:"div",B:"ytp-modern-endscreen-content"});g.L(this,this.table);this.table.u3(this.element);E.getVideoData().MM?this.T=new CH(E,!0):this.T=new Qq(E);g.L(this,this.T);g.sT(this.player,this.T.element,4);E.createClientVe(this.element,this,158789);this.hide()},oI=function(E){return g.tt(E.player)&&E.y0()&&!E.Z},wI=function(E){var e=E.wR(); e!==E.j&&(E.j=e,ub0(E.player))},dQt=function(E){xc.call(this,E,"subscribecard-endscreen"); this.T=new g.Z({X:"div",B:"ytp-subscribe-card",K:[{X:"img",B:"ytp-author-image",D:{src:"{{profilePicture}}"}},{X:"div",B:"ytp-subscribe-card-right",K:[{X:"div",B:"ytp-author-name",Tz:"{{author}}"},{X:"div",B:"html5-subscribe-button-container"}]}]});g.L(this,this.T);this.T.u3(this.element);var e=E.getVideoData();this.subscribeButton=new g.pQ("Inscreva-se",null,"Cancelar assinatura",null,!0,!1,e.Mb,e.subscribed,"trailer-endscreen",null,E,!1);g.L(this,this.subscribeButton);this.subscribeButton.u3(this.T.X6("html5-subscribe-button-container")); this.C(E,"videodatachange",this.qD);this.qD();this.hide()},ze=function(E){var e=E.Y(),l=g.oW||g.RU?{style:"will-change: opacity"}:void 0,k=e.S,H=["ytp-videowall-still"]; e.G&&H.push("ytp-videowall-show-text");g.Z.call(this,{X:"a",s7:H,D:{href:"{{url}}",target:k?e.V:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},K:[{X:"div",B:"ytp-videowall-still-image",D:{style:"{{background}}"}},{X:"span",B:"ytp-videowall-still-info",D:{"aria-hidden":"true"},K:[{X:"span",B:"ytp-videowall-still-info-bg",K:[{X:"span",B:"ytp-videowall-still-info-content",D:l,K:[{X:"span",B:"ytp-videowall-still-info-title",Tz:"{{title}}"}, {X:"span",B:"ytp-videowall-still-info-author",Tz:"{{author_and_views}}"},{X:"span",B:"ytp-videowall-still-info-live",Tz:"Ao vivo"},{X:"span",B:"ytp-videowall-still-info-duration",Tz:"{{duration}}"}]}]}]},{X:"span",s7:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],D:{"aria-hidden":"true"},K:[{X:"span",B:"ytp-videowall-still-listlabel-icon"},"Playlist",{X:"span",B:"ytp-videowall-still-listlabel-length",K:[" (",{X:"span",Tz:"{{playlist_length}}"},")"]}]},{X:"span",s7:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],D:{"aria-hidden":"true"},K:[{X:"span",B:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{X:"span",B:"ytp-videowall-still-listlabel-length",Tz:" (50+)"}]}]});this.suggestion=null;this.G=k;this.api=E;this.T=new g.G_(this);g.L(this,this.T);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.T.C(E,"videodatachange",this.onVideoDataChange);E.createServerVe(this.element,this);this.onVideoDataChange()},dI=function(E){xc.call(this,E,"videowall-endscreen"); var e=this;this.U=E;this.Z=0;this.stills=[];this.S=this.videoData=null;this.J=this.N=!1;this.V=null;this.G=new g.G_(this);g.L(this,this.G);this.j=new g.Nx(function(){g.qx(e.element,"ytp-show-tiles")},0); g.L(this,this.j);var l=new g.Z({X:"button",s7:["ytp-button","ytp-endscreen-previous"],D:{"aria-label":"Anterior"},K:[g.Aq()]});g.L(this,l);l.u3(this.element);l.listen("click",this.x9,this);this.table=new g.qS({X:"div",B:"ytp-endscreen-content"});g.L(this,this.table);this.table.u3(this.element);l=new g.Z({X:"button",s7:["ytp-button","ytp-endscreen-next"],D:{"aria-label":"Pr\u00f3ximo"},K:[g.CN()]});g.L(this,l);l.u3(this.element);l.listen("click",this.FQ,this);E.getVideoData().MM?this.T=new CH(E,!0): this.T=new Qq(E);g.L(this,this.T);g.sT(this.player,this.T.element,4);E.createClientVe(this.element,this,158789);this.hide()},Ge=function(E){return g.tt(E.player)&&E.y0()&&!E.S},Te=function(E){var e=E.wR(); e!==E.N&&(E.N=e,ub0(E.player))},GvS=function(E,e){g.Z.call(this,{X:"button", s7:["ytp-watch-on-youtube-button","ytp-button"],Tz:"{{content}}"});this.U=E;this.buttonType=this.buttonType=e;this.bd();this.buttonType===2&&g.qx(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.bd);this.Yw(!0)},iz=function(E){xc.call(this,E,"watch-again-on-youtube-endscreen"); this.watchButton=new GvS(E,1);g.L(this,this.watchButton);this.watchButton.u3(this.element);g.OWW(E)&&(this.T=new g.H5(E),g.L(this,this.T),this.G=new g.Z({X:"div",s7:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],D:{tabIndex:"-1"},K:[this.T]}),g.L(this,this.G),this.T.u3(this.G.element),this.G.u3(this.element));E.createClientVe(this.element,this,156914);this.hide()},UQ$=function(E){g.Fq.call(this,E); var e=this;this.endScreen=null;this.T=this.G=this.Z=!1;this.listeners=new g.G_(this);g.L(this,this.listeners);var l=E.Y();E.isEmbedsShortsMode()?this.endScreen=new iz(E):TGO(E)?(this.Z=!0,iCr(this),this.T?this.endScreen=new WM(E):l.L("delhi_modern_endscreen")?this.endScreen=new zt_(E):this.endScreen=new dI(E)):l.Dr?this.endScreen=new dQt(E):this.endScreen=new xc(E);g.L(this,this.endScreen);g.sT(E,this.endScreen.element,4);$Q_(this);this.listeners.C(E,"videodatachange",this.onVideoDataChange,this); this.listeners.C(E,g.Zj("endscreen"),function(k){e.onCueRangeEnter(k)}); this.listeners.C(E,g.Yk("endscreen"),function(k){e.onCueRangeExit(k)})},iCr=function(E){var e=E.player.getVideoData(); if(!e||E.T===e.KM&&E.G===e.MM)return!1;E.T=e.KM;E.G=e.MM;return!0},TGO=function(E){E=E.Y(); return E.yf&&!E.Dr&&!E.disableOrganicUi},$Q_=function(E){E.player.Qy("endscreen"); var e=E.player.getVideoData();e=new g.Mr(Math.max((e.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var l=new g.Mr(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});E.player.qQ([e,l])}; g.NX.prototype.It=g.He(6,function(){return this.app.It()}); g.U5.prototype.It=g.He(5,function(){return this.getVideoData().Ax}); g.aF.prototype.le=g.He(4,function(E){this.uP().le(E)}); g.k1.prototype.le=g.He(3,function(E){this.CQ!==E&&(this.CQ=E,this.Bd())}); g.d(AD,g.Z);AD.prototype.select=function(){this.U.MO(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.Gc||void 0)&&this.U.logClick(this.element)}; AD.prototype.onClick=function(E){g.Ub(E,this.U,this.T,this.suggestion.sessionData||void 0)&&this.select()}; AD.prototype.onKeyPress=function(E){switch(E.keyCode){case 13:case 32:E.defaultPrevented||(this.select(),E.preventDefault())}};g.d(CH,g.Z);g.z=CH.prototype;g.z.UN=function(E){this.suggestion!==E&&(this.suggestion=E,g.ou(this.T,E),this.playButton.updateValue("url",this.suggestion.f_()),pH(this))}; g.z.Qh=function(){return this.Z>0}; g.z.tC=function(){this.Qh()||(this.Z=Date.now(),xQ6(this),AE$(this.U,Wbs(this)),g.k_(this.U.getRootNode(),"countdown-running",this.Qh()))}; g.z.wY=function(){this.vV();xQ6(this);var E=this.T.X6("ytp-autonav-endscreen-upnext-header");E&&g.GD(E,"Pr\u00f3ximo")}; g.z.vV=function(){this.Qh()&&(this.S.stop(),this.Z=0)}; g.z.select=function(E){this.U.nextVideo(!1,E===void 0?!1:E);this.vV()}; g.z.fE=function(E){g.Ub(E,this.U)&&(E.currentTarget===this.playButton.element?this.U.logClick(this.playButton.element):E.currentTarget===this.T.X6("ytp-autonav-endscreen-link-container")&&(E=this.T.X6("ytp-autonav-endscreen-link-container"),this.U.logVisibility(E,!0),this.U.logClick(E)),this.J?(this.U.MD("innertubeCommand",this.J),this.vV()):this.select())}; g.z.k9=function(){this.U.logClick(this.cancelButton.element);g.YC(this.U,!0);this.cancelCommand&&this.U.MD("innertubeCommand",this.cancelCommand)}; g.z.onVideoDataChange=function(E,e){p40(this,e);E=e.getWatchNextResponse();var l,k;E=(l=CN_(E))==null?void 0:(k=l.cancelButton)==null?void 0:k.buttonRenderer;this.cancelCommand=E==null?void 0:E.command}; g.z.tRz=function(E){if(BGs(this)){var e=this.U.getVideoData().watchToWatchTransitionRenderer,l=e==null?void 0:e.fromColorPaletteDark;e=e==null?void 0:e.toColorPaletteDark;if(l&&e){var k=this.element;k.style.setProperty("--w2w-start-background-color",g.Fh(l.surgeColor));k.style.setProperty("--w2w-start-primary-text-color",g.Fh(l.primaryTitleColor));k.style.setProperty("--w2w-start-secondary-text-color",g.Fh(l.secondaryTitleColor));k.style.setProperty("--w2w-end-background-color",g.Fh(e.surgeColor)); k.style.setProperty("--w2w-end-primary-text-color",g.Fh(e.primaryTitleColor));k.style.setProperty("--w2w-end-secondary-text-color",g.Fh(e.secondaryTitleColor));k.style.setProperty("--w2w-animation-duration",E+"ms")}g.k_(this.element,"ytp-w2w-animate",!0)}}; g.z.nH=function(E){this.U.L("web_autonav_color_transition")&&E!==2&&g.k_(this.element,"ytp-w2w-animate",!1)}; g.z.lf=function(){var E=this.U.wR();this.j&&this.Vd!==E&&this.Yw(E);pH(this);this.U.logVisibility(this.container.element,E);this.U.logVisibility(this.cancelButton.element,E);this.U.logVisibility(this.T.X6("ytp-autonav-endscreen-link-container"),E);this.U.logVisibility(this.playButton.element,E)}; g.z.fD=function(E){return E.width<400||E.height<459};g.d(xc,g.Z);g.z=xc.prototype;g.z.create=function(){this.created=!0}; g.z.destroy=function(){this.created=!1}; g.z.y0=function(){return!1}; g.z.wR=function(){return!1}; g.z.S5=function(){return!1};g.d(Qq,g.Z);g.z=Qq.prototype;g.z.Tb=function(){this.notification&&(this.S.stop(),this.xN(this.Z),this.Z=null,this.notification.close(),this.notification=null)}; g.z.UN=function(E){this.suggestion=E;g.ou(this,E,"hqdefault.jpg")}; g.z.UO=function(){this.Yw(this.api.wR());this.api.logVisibility(this.element,this.api.wR());this.api.logVisibility(this.X6("ytp-upnext-autoplay-icon"),this.api.wR());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.wR())}; g.z.WM5=function(){window.focus();this.Tb()}; g.z.tC=function(E){var e=this;this.Qh()||(g.tx("a11y-announce","Pr\u00f3ximo "+this.suggestion.title),this.G=(0,g.dE)(),this.T=new g.Nx(function(){w4r(e,E)},25),w4r(this,E),AE$(this.api,oUH(this,E))); g.ed(this.element,"ytp-upnext-autoplay-paused")}; g.z.hide=function(){g.Z.prototype.hide.call(this)}; g.z.Qh=function(){return!!this.T}; g.z.wY=function(){this.vV();this.G=(0,g.dE)();w4r(this);g.qx(this.element,"ytp-upnext-autoplay-paused")}; g.z.vV=function(){this.Qh()&&(this.T.dispose(),this.T=null)}; g.z.select=function(E){E=E===void 0?!1:E;if(this.api.Y().L("autonav_notifications")&&E&&window.Notification&&typeof document.hasFocus==="function"){var e=Notification.permission;e==="default"?Notification.requestPermission():e!=="granted"||document.hasFocus()||(this.Tb(),this.notification=new Notification("Pr\u00f3ximo",{body:this.suggestion.title,icon:this.suggestion.Za()}),this.Z=this.C(this.notification,"click",this.WM5),this.S.start())}this.vV();this.api.nextVideo(!1,E)}; g.z.TJ=function(E){!g.dT(this.cancelButton.element,E.target)&&g.Ub(E,this.api)&&(this.api.wR()&&this.api.logClick(this.X6("ytp-upnext-autoplay-icon")),this.select())}; g.z.wj=function(){this.api.wR()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.YC(this.api,!0)}; g.z.sn4=function(E){this.api.getPresentingPlayerType();this.show();this.tC(E)}; g.z.cg6=function(){this.api.getPresentingPlayerType();this.vV();this.hide()}; g.z.Gz=function(){this.vV();this.Tb();g.Z.prototype.Gz.call(this)};g.d(WM,xc);g.z=WM.prototype;g.z.create=function(){xc.prototype.create.call(this);this.S.C(this.player,"appresize",this.fq);this.S.C(this.player,"onVideoAreaChange",this.fq);this.S.C(this.player,"videodatachange",this.onVideoDataChange);this.S.C(this.player,"autonavchange",this.J7);this.S.C(this.player,"onAutonavCancelled",this.GJ);this.onVideoDataChange()}; g.z.show=function(){xc.prototype.show.call(this);(this.j||this.Z&&this.Z!==this.videoData.clientPlaybackNonce)&&g.YC(this.player,!1);g.tt(this.player)&&this.y0()&&!this.Z?(BM(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3?this.T.select(!0):this.T.tC():this.videoData.autonavState===3&&this.T.wY()):(g.YC(this.player,!0),BM(this));this.fq()}; g.z.hide=function(){xc.prototype.hide.call(this);this.T.wY();BM(this)}; g.z.fq=function(){var E=this.player.uH(!0,this.player.isFullscreen());BM(this);pH(this.G);g.k_(this.element,"ytp-autonav-cancelled-small-mode",this.fD(E));g.k_(this.element,"ytp-autonav-cancelled-tiny-mode",this.y3(E));g.k_(this.element,"ytp-autonav-cancelled-mini-mode",E.width<=400||E.height<=360);this.overlay&&g.MV(this.overlay.element,{width:E.width+"px"});if(!this.J)for(E=0;E0&&(E= Q*4,B=e<=C-2&&p>=x*4;if((x+1)/Q*k/X>X/(x/(Q+1)*k)&&B)p-=x*4,e+=2;else if(W)p-=Q*4,E+=2;else if(B)p-=x*4,e+=2;else break}k=!1;p>=12&&l*4-p<=6&&(e>=4||E>=4)&&(k=!0);p=E*96;A=e*54;X=p/A=E-2&&x>=e-2?B=1:x%2===0&&C%2===0&&(x<2&&C<2?x===0&&C===0&&(B=2):B=2),Q=g.hu(Q+this.Z,l),B!==0){W=this.stills[X];W||(W=new ze(this.player),this.stills[X]=W,O.appendChild(W.element));var w=Math.floor(A*x/e),U=Math.floor(p*C/E),c=Math.floor(A*(x+B)/e)-w-4,V=Math.floor(p*(C+B)/E)-U-4;g.Kl(W.element,U,w);g.tV(W.element,V,c);g.MV(W.element,"transitionDelay",(x+C)/20+"s");g.k_(W.element,"ytp-videowall-still-mini", B===1);g.k_(W.element,"ytp-videowall-still-large",B>2);B=Math.max(V,c);g.k_(W.element,"ytp-videowall-still-round-large",B>=256);g.k_(W.element,"ytp-videowall-still-round-medium",B>96&&B<256);g.k_(W.element,"ytp-videowall-still-round-small",B<=96);Q=H[Q];W.suggestion!==Q&&(W.suggestion=Q,B=W.api.Y(),w=g.ti(W.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",g.ou(W,Q,w),g.qA(B)&&!W.api.L("web_player_log_click_before_generating_ve_conversion_params")&&(B=Q.f_(),w={},g.ju(W.api,"addEmbedsConversionTrackingParams", [w]),B=g.BJ(B,w),W.updateValue("url",B)),(Q=(Q=Q.sessionData)&&Q.itct)&&W.api.setTrackingParams(W.element,Q));X++}O.ariaBusy="false";g.k_(this.element,"ytp-endscreen-paginate",X=X;H--)E=this.stills[H],g.zD(E.element),g.qE(E);this.stills.length=X}}; g.z.onVideoDataChange=function(){var E=this.player.getVideoData(1);this.videoData!==E&&(E!=null&&g.$7(E)?(this.Z=0,this.videoData=E,this.M2()):this.player.wH("missg",{vid:(E==null?void 0:E.videoId)||"",cpn:(E==null?void 0:E.clientPlaybackNonce)||""}))}; g.z.FQ=function(){this.Z+=this.stills.length;this.M2()}; g.z.x9=function(){this.Z-=this.stills.length;this.M2()}; g.z.S5=function(){return this.T.Qh()}; g.z.pj=function(E){E===1?(this.J=!1,this.S=this.videoData.clientPlaybackNonce,this.T.vV(),this.Vd&&this.M2()):(this.J=!0,this.Vd&&Ge(this)&&(E===2?this.T.tC():E===3&&this.T.wY()))}; g.z.XQ=function(E){if(E){for(E=0;E0||E.endSeconds>0||E.mutedAutoplayDurationMode!==2);if(this.player.isEmbedsShortsMode()&&!e)return!0;var l;var k=!!((E==null?0:g.$7(E))||(E==null?0:(l=E.suggestions)==null?0:l.length));k=!TGO(this.player)||k;E=E.yS;l=this.player.TO();return k&&!E&&!l&&!e}; g.z.wR=function(){return this.endScreen.wR()}; g.z.xq=function(){return this.wR()?this.endScreen.S5():!1}; g.z.Gz=function(){this.player.Qy("endscreen");g.Fq.prototype.Gz.call(this)}; g.z.load=function(){var E=this.player.getVideoData();var e=E.transitionEndpointAtEndOfStream;if(e&&e.videoId){var l=this.player.SE().zN.get("heartbeat"),k=g.$7(E);!k||e.videoId!==k.videoId||E.Zn?(this.player.MO(e.videoId,void 0,void 0,!0,!0,e),l&&l.Ku("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),E=!0):E=!1}else E=!1;E||(g.Fq.prototype.load.call(this),this.endScreen.show())}; g.z.unload=function(){g.Fq.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.z.onCueRangeEnter=function(E){this.tY()&&(this.endScreen.created||this.endScreen.create(),E.getId()==="load"&&this.load())}; g.z.onCueRangeExit=function(E){E.getId()==="load"&&this.loaded&&this.unload()}; g.z.onVideoDataChange=function(){$Q_(this);this.Z&&iCr(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.T?this.endScreen=new WM(this.player):this.endScreen=new dI(this.player),g.L(this,this.endScreen),g.sT(this.player,this.endScreen.element,4))};g.Iu("endscreen",UQ$);})(_yt_player);