(function(g){var window=this;'use strict';var Qt=function(z){F0.call(this,z,"videowall-endscreen");var W=this;this.S=z;this.V=0;this.stills=[];this.L=this.videoData=null;this.K=this.W=!1;this.J=null;this.U=new g.eu(this);g.T(this,this.U);this.Z=new g.$k(function(){g.Mz(W.element,"ytp-show-tiles")},0); g.T(this,this.Z);var K=new g.n({B:"button",IC:["ytp-button","ytp-endscreen-previous"],j:{"aria-label":"Anterior"},N:[g.lX()]});g.T(this,K);K.mf(this.element);K.listen("click",this.eJ,this);this.table=new g.PX({B:"div",T:"ytp-endscreen-content"});g.T(this,this.table);this.table.mf(this.element);K=new g.n({B:"button",IC:["ytp-button","ytp-endscreen-next"],j:{"aria-label":"Pr\u00f3ximo"},N:[g.Af()]});g.T(this,K);K.mf(this.element);K.listen("click",this.A_,this);z.getVideoData().lJ?this.Y=new r4(z,!0): this.Y=new X0(z);g.T(this,this.Y);g.ZN(this.player,this.Y.element,4);z.createClientVe(this.element,this,158789);this.hide()},Sp=function(z){var W=z.D(),K=W.L; g.n.call(this,{B:"a",T:"ytp-autonav-suggestion-card",j:{href:"{{url}}",target:K?W.oC:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},N:[{B:"div",IC:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],j:{style:"{{background}}"},N:[{B:"div",j:{"aria-label":"{{timestamp}}"},IC:["ytp-autonav-timestamp"],rV:"{{duration}}"},{B:"div",IC:["ytp-autonav-live-stamp"],rV:"Ao vivo"}, {B:"div",IC:["ytp-autonav-upcoming-stamp"],rV:"Em breve"},{B:"div",T:"ytp-autonav-list-overlay",N:[{B:"div",T:"ytp-autonav-mix-text",rV:"Mix"},{B:"div",T:"ytp-autonav-mix-icon"}]}]},{B:"div",IC:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],rV:"{{title}}"},{B:"div",IC:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],rV:"{{author}}"},{B:"div",IC:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],rV:"{{views_and_publish_time}}"}]});this.S=z;this.suggestion= null;this.Y=K;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},d0_=function(z){return z.isBackground()&&z.F9()},gWR=function(z,W){z.Jz("onAutonavCoundownStarted",W)},IF=function(z){var W=z.S.Bd(!0,z.S.isFullscreen()); g.nj(z.container.element,"ytp-autonav-endscreen-small-mode",z.GG(W));g.nj(z.container.element,"ytp-autonav-endscreen-is-premium",!!z.suggestion&&!!z.suggestion.Pxf);g.nj(z.S.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!z.S.eh());g.nj(z.S.getRootNode(),"countdown-running",z.FX());g.nj(z.container.element,"ytp-player-content",z.S.eh());g.Uu(z.overlay.element,{width:W.width+"px"});if(!z.FX()){z.S.eh()?u8_(z,Math.round(yIn(z)/1E3)):u8_(z);W=!!z.suggestion&&!!z.suggestion.Ob;var K=z.S.eh()|| !W;g.nj(z.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!K&&W);g.nj(z.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",K&&!W);z.U.FS(z.S.eh());g.nj(z.element,"ytp-enable-w2w-color-transitions",R4G(z))}},R4G=function(z){var W; return!((W=z.S.getVideoData())==null||!W.watchToWatchTransitionRenderer)},DC=function(z){return g.fT(z.player)&&z.Rk()&&!z.L},t_s=function(z,W){W=W.getWatchNextResponse(); var K,B;W=(K=M_Q(W))==null?void 0:(B=K.nextButton)==null?void 0:B.buttonRenderer;z.K=W==null?void 0:W.navigationEndpoint;K=W==null?void 0:W.trackingParams;z.playButton&&K&&z.S.setTrackingParams(z.playButton.element,K)},Yus=function(z){var W=z.player.getVideoData(); if(!W||z.Y===W.lO&&z.U===W.lJ)return!1;z.Y=W.lO;z.U=W.lJ;return!0},JJ=function(z){return g.fT(z.player)&&z.Rk()&&!z.V},GkG=function(z){z=z.D(); return z.m9&&!z.mO&&!z.disableOrganicUi},wO0=function(z){var W=yIn(z),K=Math,B=K.min; var c=z.V?Date.now()-z.V:0;K=B.call(K,c,W);u8_(z,Math.ceil((W-K)/1E3));W-K<=500&&z.FX()?z.select(!0):z.FX()&&z.L.start()},W30=function(z,W){W=zgj(z,W); var K=Math,B=K.min;var c=(0,g.xk)()-z.U;K=B.call(K,c,W);W=W===0?1:Math.min(K/W,1);z.K.setAttribute("stroke-dashoffset",""+-211*(W+1));W>=1&&z.FX()&&z.api.getPresentingPlayerType()!==3?z.select(!0):z.FX()&&z.Y.start()},X0=function(z){g.n.call(this,{B:"div", IC:["ytp-upnext","ytp-player-content"],j:{"aria-label":"{{aria_label}}"},N:[{B:"div",T:"ytp-cued-thumbnail-overlay-image",j:{style:"{{background}}"}},{B:"span",T:"ytp-upnext-top",N:[{B:"span",T:"ytp-upnext-header",rV:"Pr\u00f3ximo"},{B:"span",T:"ytp-upnext-title",rV:"{{title}}"},{B:"span",T:"ytp-upnext-author",rV:"{{author}}"}]},{B:"a",T:"ytp-upnext-autoplay-icon",j:{role:"button",href:"{{url}}","aria-label":"Reproduzir pr\u00f3ximo v\u00eddeo"},N:[{B:"svg",j:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},N:[{B:"circle",T:"ytp-svg-autoplay-circle",j:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{B:"circle",T:"ytp-svg-autoplay-ring",j:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{B:"path",T:"ytp-svg-fill",j:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{B:"span",T:"ytp-upnext-bottom",N:[{B:"span",T:"ytp-upnext-cancel"},{B:"span",T:"ytp-upnext-paused", rV:"Reprodu\u00e7\u00e3o autom\u00e1tica pausada"}]}]});this.api=z;this.cancelButton=null;this.K=this.VH("ytp-svg-autoplay-ring");this.V=this.notification=this.Y=this.suggestion=null;this.L=new g.$k(this.vG,5E3,this);this.U=0;var W=this.VH("ytp-upnext-cancel");this.cancelButton=new g.n({B:"button",IC:["ytp-upnext-cancel-button","ytp-button"],j:{tabindex:"0","aria-label":"Cancelar reprodu\u00e7\u00e3o autom\u00e1tica"},rV:"Cancelar"});g.T(this,this.cancelButton);this.cancelButton.listen("click",this.fE, this);this.cancelButton.mf(W);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.T(this,this.L);this.api.createClientVe(this.element,this,18788);W=this.VH("ytp-upnext-autoplay-icon");this.C(W,"click",this.zi);this.api.createClientVe(W,this,115130);this.UQ();this.C(z,"autonavvisibility",this.UQ);this.C(z,"mdxnowautoplaying",this.Aff);this.C(z,"mdxautoplaycanceled",this.eKN);g.nj(this.element,"ytp-upnext-mobile",this.api.D().U)},HT=function(z){var W=z.D(),K=g.AD||g.aU? {style:"will-change: opacity"}:void 0,B=W.L,c=["ytp-videowall-still"]; W.U&&c.push("ytp-videowall-show-text");g.n.call(this,{B:"a",IC:c,j:{href:"{{url}}",target:B?W.oC:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},N:[{B:"div",T:"ytp-videowall-still-image",j:{style:"{{background}}"}},{B:"span",T:"ytp-videowall-still-info",j:{"aria-hidden":"true"},N:[{B:"span",T:"ytp-videowall-still-info-bg",N:[{B:"span",T:"ytp-videowall-still-info-content",j:K,N:[{B:"span",T:"ytp-videowall-still-info-title",rV:"{{title}}"}, {B:"span",T:"ytp-videowall-still-info-author",rV:"{{author_and_views}}"},{B:"span",T:"ytp-videowall-still-info-live",rV:"Ao vivo"},{B:"span",T:"ytp-videowall-still-info-duration",rV:"{{duration}}"}]}]}]},{B:"span",IC:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],j:{"aria-hidden":"true"},N:[{B:"span",T:"ytp-videowall-still-listlabel-icon"},"Playlist",{B:"span",T:"ytp-videowall-still-listlabel-length",N:[" (",{B:"span",rV:"{{playlist_length}}"},")"]}]},{B:"span",IC:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],j:{"aria-hidden":"true"},N:[{B:"span",T:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{B:"span",T:"ytp-videowall-still-listlabel-length",rV:" (50+)"}]}]});this.suggestion=null;this.U=B;this.api=z;this.Y=new g.eu(this);g.T(this,this.Y);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.Y.C(z,"videodatachange",this.onVideoDataChange);z.createServerVe(this.element,this);this.onVideoDataChange()},yIn=function(z){if(z.S.isFullscreen()){var W; z=(W=z.S.getVideoData())==null?void 0:W.dl;return z===-1||z===void 0?8E3:z}return z.S.Fg()>=0?z.S.Fg():g.VP(z.S.D().experiments,"autoplay_time")||1E4},K3L=function(z){F0.call(this,z,"videowall-endscreen"); var W=this;this.S=z;this.stills=[];this.V=this.videoData=null;this.L=this.Z=!1;this.W=null;g.Mz(this.element,"modern-videowall-endscreen");this.U=new g.eu(this);g.T(this,this.U);this.K=new g.$k(function(){g.Mz(W.element,"ytp-show-tiles")},0); g.T(this,this.K);this.table=new g.PX({B:"div",T:"ytp-modern-endscreen-content"});g.T(this,this.table);this.table.mf(this.element);z.getVideoData().lJ?this.Y=new r4(z,!0):this.Y=new X0(z);g.T(this,this.Y);g.ZN(this.player,this.Y.element,4);z.createClientVe(this.element,this,158789);this.hide()},sj=function(z){var W=z.eh(); W!==z.W&&(z.W=W,BjL(z.player))},r4=function(z,W){W=W===void 0?!1:W; g.n.call(this,{B:"div",T:"ytp-autonav-endscreen-countdown-overlay"});var K=this;this.Z=W;this.cancelCommand=this.K=void 0;this.V=0;this.container=new g.n({B:"div",T:"ytp-autonav-endscreen-countdown-container"});g.T(this,this.container);this.container.mf(this.element);W=z.D();var B=W.L;this.S=z;this.suggestion=null;this.onVideoDataChange("newdata",this.S.getVideoData());this.C(z,"videodatachange",this.onVideoDataChange);this.Y=new g.n({B:"div",T:"ytp-autonav-endscreen-upnext-container",j:{"aria-label":"{{aria_label}}", "data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},N:[{B:"div",T:"ytp-autonav-endscreen-upnext-header"},{B:"div",T:"ytp-autonav-endscreen-upnext-alternative-header",rV:"{{autoplayAlternativeHeader}}"},{B:"a",T:"ytp-autonav-endscreen-link-container",j:{href:"{{url}}",target:B?W.oC:""},N:[{B:"div",T:"ytp-autonav-endscreen-upnext-thumbnail",j:{style:"{{background}}"},N:[{B:"div",j:{"aria-label":"{{timestamp}}"},IC:["ytp-autonav-timestamp"], rV:"{{duration}}"},{B:"div",IC:["ytp-autonav-live-stamp"],rV:"Ao vivo"},{B:"div",IC:["ytp-autonav-upcoming-stamp"],rV:"Em breve"}]},{B:"div",T:"ytp-autonav-endscreen-video-info",N:[{B:"div",T:"ytp-autonav-endscreen-premium-badge"},{B:"div",T:"ytp-autonav-endscreen-upnext-title",rV:"{{title}}"},{B:"div",T:"ytp-autonav-endscreen-upnext-author",rV:"{{author}}"},{B:"div",T:"ytp-autonav-view-and-date",rV:"{{views_and_publish_time}}"},{B:"div",T:"ytp-autonav-author-and-view",rV:"{{author_and_views}}"}]}]}]}); g.T(this,this.Y);this.Y.mf(this.container.element);B||this.C(this.Y.VH("ytp-autonav-endscreen-link-container"),"click",this.Yj);this.S.createClientVe(this.container.element,this,115127);this.S.createClientVe(this.Y.VH("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.n({B:"div",T:"ytp-autonav-overlay"});g.T(this,this.overlay);this.overlay.mf(this.container.element);this.U=new g.n({B:"div",T:"ytp-autonav-endscreen-button-container"});g.T(this,this.U);this.U.mf(this.container.element); this.cancelButton=new g.n({B:"button",IC:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",W.X("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],j:{"aria-label":"Cancelar reprodu\u00e7\u00e3o autom\u00e1tica"},rV:"Cancelar"});g.T(this,this.cancelButton);this.cancelButton.mf(this.U.element);this.cancelButton.listen("click",this.UR,this);this.S.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.n({B:"a",IC:["ytp-autonav-endscreen-upnext-button", "ytp-autonav-endscreen-upnext-play-button",W.X("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],j:{href:"{{url}}",role:"button","aria-label":"Reproduzir pr\u00f3ximo v\u00eddeo"},rV:"Assista agora"});g.T(this,this.playButton);this.playButton.mf(this.U.element);this.playButton.listen("click",this.Yj,this);this.S.createServerVe(this.playButton.element,this.playButton,!0);(W=this.S.getVideoData())&&t_s(this,W);this.L=new g.$k(function(){wO0(K)},500); g.T(this,this.L);this.cN();this.C(z,"autonavvisibility",this.cN);this.S.X("web_autonav_color_transition")&&(this.C(z,"autonavchange",this.iN),this.C(z,"onAutonavCoundownStarted",this.uOa))},u8_=function(z,W){W=W===void 0?-1:W; z=z.Y.VH("ytp-autonav-endscreen-upnext-header");g.iS(z);if(W>=0){W=String(W);var K="Pr\u00f3ximo v\u00eddeo em $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],B="Pr\u00f3ximo v\u00eddeo em $SECONDS".indexOf(K);if(B>=0){z.appendChild(g.QH("Pr\u00f3ximo v\u00eddeo em $SECONDS".slice(0,B)));var c=g.mG("span");g.Vx(c,"ytp-autonav-endscreen-upnext-header-countdown-number");g.PG(c,W);z.appendChild(c);z.appendChild(g.QH("Pr\u00f3ximo v\u00eddeo em $SECONDS".slice(B+K.length)));return}}g.PG(z,"Pr\u00f3ximo")}, c9H=function(z){z.player.Sc("endscreen"); var W=z.player.getVideoData();W=new g.cO(Math.max((W.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var K=new g.cO(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});z.player.vk([W,K])},L3H=function(z,W){g.n.call(this,{B:"button", IC:["ytp-watch-on-youtube-button","ytp-button"],rV:"{{content}}"});this.S=z;this.buttonType=this.buttonType=W;this.I_();this.buttonType===2&&g.Mz(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.I_);this.FS(!0)},ep=function(z){var W=z.eh(); W!==z.K&&(z.K=W,BjL(z.player),z.K?(z.U!==z.Y&&z.U.hide(),z.table.hide()):(z.U!==z.Y&&z.U.show(),z.table.show()))},hJ=function(z){F0.call(this,z,"watch-again-on-youtube-endscreen"); this.watchButton=new L3H(z,1);g.T(this,this.watchButton);this.watchButton.mf(this.element);g.gVF(z)&&(this.Y=new g.xV(z),g.T(this,this.Y),this.U=new g.n({B:"div",IC:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],j:{tabIndex:"-1"},N:[this.Y]}),g.T(this,this.U),this.Y.mf(this.U.element),this.U.mf(this.element));z.createClientVe(this.element,this,156914);this.hide()},BjL=function(z){z.publish("autonavvisibility")},i__=function(z){F0.call(this,z,"subscribecard-endscreen"); this.Y=new g.n({B:"div",T:"ytp-subscribe-card",N:[{B:"img",T:"ytp-author-image",j:{src:"{{profilePicture}}"}},{B:"div",T:"ytp-subscribe-card-right",N:[{B:"div",T:"ytp-author-name",rV:"{{author}}"},{B:"div",T:"html5-subscribe-button-container"}]}]});g.T(this,this.Y);this.Y.mf(this.element);var W=z.getVideoData();this.subscribeButton=new g.pr("Inscreva-se",null,"Cancelar assinatura",null,!0,!1,W.Je,W.subscribed,"trailer-endscreen",null,z,!1);g.T(this,this.subscribeButton);this.subscribeButton.mf(this.Y.VH("html5-subscribe-button-container")); this.C(z,"videodatachange",this.yH);this.yH();this.hide()},TJ=function(z){F0.call(this,z,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.n({B:"div",T:"ytp-suggestion-panel",N:[{B:"div",IC:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],rV:"Mais v\u00eddeos"}]});this.W=new g.n({B:"div",T:"ytp-suggestions-container"});this.videos=[];this.V=null;this.K=this.Z=!1;this.U=new r4(this.player);g.T(this,this.U);this.U.mf(this.element);z.getVideoData().lJ?this.Y=this.U:(this.Y=new X0(z),g.ZN(this.player,this.Y.element,4),g.T(this,this.Y));this.overlay=new g.n({B:"div", T:"ytp-autonav-overlay-cancelled-state"});g.T(this,this.overlay);this.overlay.mf(this.element);this.L=new g.eu(this);g.T(this,this.L);g.T(this,this.table);this.table.mf(this.element);this.table.show();g.T(this,this.W);this.W.mf(this.table.element);this.hide()},F0=function(z,W){g.n.call(this,{B:"div", IC:["html5-endscreen","ytp-player-content",W||"base-endscreen"]});this.created=!1;this.player=z},M_Q=function(z){var W,K,B; return z==null?void 0:(W=z.playerOverlays)==null?void 0:(K=W.playerOverlayRenderer)==null?void 0:(B=K.autoplay)==null?void 0:B.playerOverlayAutoplayRenderer},qv=function(z){var W=z.eh(); W!==z.Z&&(z.Z=W,BjL(z.player))},F3_=function(z){g.Sl.call(this,z); var W=this;this.endScreen=null;this.Y=this.U=this.V=!1;this.listeners=new g.eu(this);g.T(this,this.listeners);var K=z.D();z.isEmbedsShortsMode()?this.endScreen=new hJ(z):GkG(z)?(this.V=!0,Yus(this),this.Y?this.endScreen=new TJ(z):K.X("delhi_modern_endscreen")?this.endScreen=new K3L(z):this.endScreen=new Qt(z)):K.mO?this.endScreen=new i__(z):this.endScreen=new F0(z);g.T(this,this.endScreen);g.ZN(z,this.endScreen.element,4);c9H(this);this.listeners.C(z,"videodatachange",this.onVideoDataChange,this); this.listeners.C(z,g.hG("endscreen"),function(B){W.onCueRangeEnter(B)}); this.listeners.C(z,g.Tw("endscreen"),function(B){W.onCueRangeExit(B)})},zgj=function(z,W){if(W)return W; if(z.api.isFullscreen()){var K;z=(K=z.api.getVideoData())==null?void 0:K.dl;return z===-1||z===void 0?8E3:z}return z.api.Fg()>=0?z.api.Fg():g.VP(z.api.D().experiments,"autoplay_time")||1E4}; g.to.prototype.Fg=g.rG(6,function(){return this.app.Fg()}); g.NP.prototype.Fg=g.rG(5,function(){return this.getVideoData().zq}); g.R1.prototype.tJ=g.rG(4,function(z){this.Fs().tJ(z)}); g.pW.prototype.tJ=g.rG(3,function(z){this.zB!==z&&(this.zB=z,this.cA())}); g.Y(Sp,g.n);Sp.prototype.select=function(){this.S.qT(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.kS||void 0)&&this.S.logClick(this.element)}; Sp.prototype.onClick=function(z){g.gu(z,this.S,this.Y,this.suggestion.sessionData||void 0)&&this.select()}; Sp.prototype.onKeyPress=function(z){switch(z.keyCode){case 13:case 32:z.defaultPrevented||(this.select(),z.preventDefault())}};g.Y(r4,g.n);g.h=r4.prototype;g.h.TM=function(z){this.suggestion!==z&&(this.suggestion=z,g.TY(this.Y,z),this.playButton.updateValue("url",this.suggestion.JO()),IF(this))}; g.h.FX=function(){return this.V>0}; g.h.BK=function(){this.FX()||(this.V=Date.now(),wO0(this),gWR(this.S,yIn(this)),g.nj(this.S.getRootNode(),"countdown-running",this.FX()))}; g.h.s0=function(){this.Ag();wO0(this);var z=this.Y.VH("ytp-autonav-endscreen-upnext-header");z&&g.PG(z,"Pr\u00f3ximo")}; g.h.Ag=function(){this.FX()&&(this.L.stop(),this.V=0)}; g.h.select=function(z){this.S.nextVideo(!1,z===void 0?!1:z);this.Ag()}; g.h.Yj=function(z){g.gu(z,this.S)&&(z.currentTarget===this.playButton.element?this.S.logClick(this.playButton.element):z.currentTarget===this.Y.VH("ytp-autonav-endscreen-link-container")&&(z=this.Y.VH("ytp-autonav-endscreen-link-container"),this.S.logVisibility(z,!0),this.S.logClick(z)),this.K?(this.S.Jz("innertubeCommand",this.K),this.Ag()):this.select())}; g.h.UR=function(){this.S.logClick(this.cancelButton.element);g.i0(this.S,!0);this.cancelCommand&&this.S.Jz("innertubeCommand",this.cancelCommand)}; g.h.onVideoDataChange=function(z,W){t_s(this,W);z=W.getWatchNextResponse();var K,B;z=(K=M_Q(z))==null?void 0:(B=K.cancelButton)==null?void 0:B.buttonRenderer;this.cancelCommand=z==null?void 0:z.command}; g.h.uOa=function(z){if(R4G(this)){var W=this.S.getVideoData().watchToWatchTransitionRenderer,K=W==null?void 0:W.fromColorPaletteDark;W=W==null?void 0:W.toColorPaletteDark;if(K&&W){var B=this.element;B.style.setProperty("--w2w-start-background-color",g.iF(K.surgeColor));B.style.setProperty("--w2w-start-primary-text-color",g.iF(K.primaryTitleColor));B.style.setProperty("--w2w-start-secondary-text-color",g.iF(K.secondaryTitleColor));B.style.setProperty("--w2w-end-background-color",g.iF(W.surgeColor)); B.style.setProperty("--w2w-end-primary-text-color",g.iF(W.primaryTitleColor));B.style.setProperty("--w2w-end-secondary-text-color",g.iF(W.secondaryTitleColor));B.style.setProperty("--w2w-animation-duration",z+"ms")}g.nj(this.element,"ytp-w2w-animate",!0)}}; g.h.iN=function(z){this.S.X("web_autonav_color_transition")&&z!==2&&g.nj(this.element,"ytp-w2w-animate",!1)}; g.h.cN=function(){var z=this.S.eh();this.Z&&this.pJ!==z&&this.FS(z);IF(this);this.S.logVisibility(this.container.element,z);this.S.logVisibility(this.cancelButton.element,z);this.S.logVisibility(this.Y.VH("ytp-autonav-endscreen-link-container"),z);this.S.logVisibility(this.playButton.element,z)}; g.h.GG=function(z){return z.width<400||z.height<459};g.Y(F0,g.n);g.h=F0.prototype;g.h.create=function(){this.created=!0}; g.h.destroy=function(){this.created=!1}; g.h.Rk=function(){return!1}; g.h.eh=function(){return!1}; g.h.O$=function(){return!1};g.Y(X0,g.n);g.h=X0.prototype;g.h.vG=function(){this.notification&&(this.L.stop(),this.sS(this.V),this.V=null,this.notification.close(),this.notification=null)}; g.h.TM=function(z){this.suggestion=z;g.TY(this,z,"hqdefault.jpg")}; g.h.UQ=function(){this.FS(this.api.eh());this.api.logVisibility(this.element,this.api.eh());this.api.logVisibility(this.VH("ytp-upnext-autoplay-icon"),this.api.eh());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.eh())}; g.h.n7f=function(){window.focus();this.vG()}; g.h.BK=function(z){var W=this;this.FX()||(g.ul("a11y-announce","Pr\u00f3ximo "+this.suggestion.title),this.U=(0,g.xk)(),this.Y=new g.$k(function(){W30(W,z)},25),W30(this,z),gWR(this.api,zgj(this,z))); g.OP(this.element,"ytp-upnext-autoplay-paused")}; g.h.hide=function(){g.n.prototype.hide.call(this)}; g.h.FX=function(){return!!this.Y}; g.h.s0=function(){this.Ag();this.U=(0,g.xk)();W30(this);g.Mz(this.element,"ytp-upnext-autoplay-paused")}; g.h.Ag=function(){this.FX()&&(this.Y.dispose(),this.Y=null)}; g.h.select=function(z){z=z===void 0?!1:z;if(this.api.D().X("autonav_notifications")&&z&&window.Notification&&typeof document.hasFocus==="function"){var W=Notification.permission;W==="default"?Notification.requestPermission():W!=="granted"||document.hasFocus()||(this.vG(),this.notification=new Notification("Pr\u00f3ximo",{body:this.suggestion.title,icon:this.suggestion.SK()}),this.V=this.C(this.notification,"click",this.n7f),this.L.start())}this.Ag();this.api.nextVideo(!1,z)}; g.h.zi=function(z){!g.m1(this.cancelButton.element,z.target)&&g.gu(z,this.api)&&(this.api.eh()&&this.api.logClick(this.VH("ytp-upnext-autoplay-icon")),this.select())}; g.h.fE=function(){this.api.eh()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.i0(this.api,!0)}; g.h.Aff=function(z){this.api.getPresentingPlayerType();this.show();this.BK(z)}; g.h.eKN=function(){this.api.getPresentingPlayerType();this.Ag();this.hide()}; g.h.zT=function(){this.Ag();this.vG();g.n.prototype.zT.call(this)};g.Y(TJ,F0);g.h=TJ.prototype;g.h.create=function(){F0.prototype.create.call(this);this.L.C(this.player,"appresize",this.kK);this.L.C(this.player,"onVideoAreaChange",this.kK);this.L.C(this.player,"videodatachange",this.onVideoDataChange);this.L.C(this.player,"autonavchange",this.rz);this.L.C(this.player,"onAutonavCancelled",this.Qj);this.onVideoDataChange()}; g.h.show=function(){F0.prototype.show.call(this);(this.Z||this.V&&this.V!==this.videoData.clientPlaybackNonce)&&g.i0(this.player,!1);g.fT(this.player)&&this.Rk()&&!this.V?(ep(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3||d0_(this.player.IN())&&this.player.X("web_player_pip_logging_fix")?this.Y.select(!0):this.Y.BK():this.videoData.autonavState===3&&this.Y.s0()):(g.i0(this.player,!0),ep(this));this.kK()}; g.h.hide=function(){F0.prototype.hide.call(this);this.Y.s0();ep(this)}; g.h.kK=function(){var z=this.player.Bd(!0,this.player.isFullscreen());ep(this);IF(this.U);g.nj(this.element,"ytp-autonav-cancelled-small-mode",this.GG(z));g.nj(this.element,"ytp-autonav-cancelled-tiny-mode",this.tb(z));g.nj(this.element,"ytp-autonav-cancelled-mini-mode",z.width<=400||z.height<=360);this.overlay&&g.Uu(this.overlay.element,{width:z.width+"px"});if(!this.K)for(z=0;z0&&(z= D*4,H=W<=Q-2&&S>=I*4;if((I+1)/D*B/F>F/(I/(D+1)*B)&&H)S-=I*4,W+=2;else if(J)S-=D*4,z+=2;else if(H)S-=I*4,W+=2;else break}B=!1;S>=12&&K*4-S<=6&&(W>=4||z>=4)&&(B=!0);S=z*96;X=W*54;F=S/X=z-2&&I>=W-2?H=1:I%2===0&&Q%2===0&&(I<2&&Q<2?I===0&&Q===0&&(H=2):H=2),D=g.dQo(D+this.V,K),H!==0){J=this.stills[F];J||(J=new HT(this.player),this.stills[F]=J,L.appendChild(J.element));var e=Math.floor(X*I/W),q=Math.floor(S*Q/z),C=Math.floor(X*(I+H)/W)-e-4,v=Math.floor(S*(Q+H)/z)-q-4;g.$7(J.element,q,e);g.OE(J.element,v,C);g.Uu(J.element,"transitionDelay",(I+Q)/20+"s");g.nj(J.element,"ytp-videowall-still-mini", H===1);g.nj(J.element,"ytp-videowall-still-large",H>2);H=Math.max(v,C);g.nj(J.element,"ytp-videowall-still-round-large",H>=256);g.nj(J.element,"ytp-videowall-still-round-medium",H>96&&H<256);g.nj(J.element,"ytp-videowall-still-round-small",H<=96);D=c[D];J.suggestion!==D&&(J.suggestion=D,H=J.api.D(),e=g.tb(J.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",g.TY(J,D,e),g.w6(H)&&!J.api.X("web_player_log_click_before_generating_ve_conversion_params")&&(H=D.JO(),e={},g.jN(J.api,"addEmbedsConversionTrackingParams", [e]),H=g.b6(H,e),J.updateValue("url",H)),(D=(D=D.sessionData)&&D.itct)&&J.api.setTrackingParams(J.element,D));F++}L.ariaBusy="false";g.nj(this.element,"ytp-endscreen-paginate",F=F;c--)z=this.stills[c],g.CQ(z.element),g.iP(z);this.stills.length=F}}; g.h.onVideoDataChange=function(){var z=this.player.getVideoData(1);this.videoData!==z&&(z!=null&&g.dQ(z)?(this.V=0,this.videoData=z,this.Ue()):this.player.Ya("missg",{vid:(z==null?void 0:z.videoId)||"",cpn:(z==null?void 0:z.clientPlaybackNonce)||""}))}; g.h.A_=function(){this.V+=this.stills.length;this.Ue()}; g.h.eJ=function(){this.V-=this.stills.length;this.Ue()}; g.h.O$=function(){return this.Y.FX()}; g.h.LI=function(z){z===1?(this.K=!1,this.L=this.videoData.clientPlaybackNonce,this.Y.Ag(),this.pJ&&this.Ue()):(this.K=!0,this.pJ&&DC(this)&&(z===2?this.Y.BK():z===3&&this.Y.s0()))}; g.h.Vj=function(z){if(z){for(z=0;z0||z.endSeconds>0||z.mutedAutoplayDurationMode!==2);if(this.player.isEmbedsShortsMode()&&!W)return!0;var K;var B=!!((z==null?0:g.dQ(z))||(z==null?0:(K=z.suggestions)==null?0:K.length));B=!GkG(this.player)||B;z=z.WW;K=this.player.M_();return B&&!z&&!K&&!W}; g.h.eh=function(){return this.endScreen.eh()}; g.h.iJC=function(){return this.eh()?this.endScreen.O$():!1}; g.h.zT=function(){this.player.Sc("endscreen");g.Sl.prototype.zT.call(this)}; g.h.load=function(){var z=this.player.getVideoData();var W=z.transitionEndpointAtEndOfStream;if(W&&W.videoId){var K=this.player.IM().mK.get("heartbeat"),B=g.dQ(z);!B||W.videoId!==B.videoId||z.Kv?(this.player.qT(W.videoId,void 0,void 0,!0,!0,W),K&&K.v3("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),z=!0):z=!1}else z=!1;z||(g.Sl.prototype.load.call(this),this.endScreen.show())}; g.h.unload=function(){g.Sl.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.h.onCueRangeEnter=function(z){this.tB()&&(this.endScreen.created||this.endScreen.create(),z.getId()==="load"&&this.load())}; g.h.onCueRangeExit=function(z){z.getId()==="load"&&this.loaded&&this.unload()}; g.h.onVideoDataChange=function(){c9H(this);this.V&&Yus(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.Y?this.endScreen=new TJ(this.player):this.endScreen=new Qt(this.player),g.T(this,this.endScreen),g.ZN(this.player,this.endScreen.element,4))};g.py("endscreen",F3_);})(_yt_player);