(function(g){var window=this;'use strict';var WoG=function(p,C){p.Jk("onAutonavCoundownStarted",C)},Qb1=function(p){var C,V,N; return p==null?void 0:(C=p.playerOverlays)==null?void 0:(V=C.playerOverlayRenderer)==null?void 0:(N=V.autoplay)==null?void 0:N.playerOverlayAutoplayRenderer},H9=function(p,C,V){g.Tz(p.element,"ytp-suggestion-set",!!C.videoId); var N=C.playlistId;V=C.TW(V?V:"mqdefault.jpg");var H=null,X=null;C instanceof g.mx&&(C.lengthText?(H=C.lengthText||null,X=C.Bj||null):C.lengthSeconds&&(H=g.A7(C.lengthSeconds),X=g.A7(C.lengthSeconds,!0)));var d=!!N;N=d&&g.MF(N).type==="RD";var a=C instanceof g.mx?C.isLivePlayback:null,E=C instanceof g.mx?C.isUpcoming:null,l=C.author,t=C.shortViewCount,c=C.publishedTimeText,T=[],M=[];l&&T.push(l);t&&(T.push(t),M.push(t));c&&M.push(c);V={title:C.title,author:l,author_and_views:T.join(" \u2022 "),aria_label:C.ariaLabel|| g.Ks("Assistir a $TITLE",{TITLE:C.title}),duration:H,timestamp:X,url:C.a8(),is_live:a,is_upcoming:E,is_list:d,is_mix:N,background:V?"background-image: url("+V+")":"",views_and_publish_time:M.join(" \u2022 "),autoplayAlternativeHeader:C.B8};C instanceof g.JA&&(V.playlist_length=C.playlistLength);p.update(V)},Xb=function(p){var C=p.K(),V=C.S; g.L.call(this,{L:"a",B:"ytp-autonav-suggestion-card",X:{href:"{{url}}",target:V?C.Z:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},j:[{L:"div",i_:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],X:{style:"{{background}}"},j:[{L:"div",X:{"aria-label":"{{timestamp}}"},i_:["ytp-autonav-timestamp"],Ak:"{{duration}}"},{L:"div",i_:["ytp-autonav-live-stamp"],Ak:"Ao vivo"}, {L:"div",i_:["ytp-autonav-upcoming-stamp"],Ak:"Em breve"},{L:"div",B:"ytp-autonav-list-overlay",j:[{L:"div",B:"ytp-autonav-mix-text",Ak:"Mix"},{L:"div",B:"ytp-autonav-mix-icon"}]}]},{L:"div",i_:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],Ak:"{{title}}"},{L:"div",i_:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],Ak:"{{author}}"},{L:"div",i_:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],Ak:"{{views_and_publish_time}}"}]});this.N=p;this.suggestion= null;this.T=V;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},dp=function(p,C){C=C===void 0?!1:C; g.L.call(this,{L:"div",B:"ytp-autonav-endscreen-countdown-overlay"});var V=this;this.D=C;this.cancelCommand=this.W=void 0;this.V=0;this.container=new g.L({L:"div",B:"ytp-autonav-endscreen-countdown-container"});g.R(this,this.container);this.container.u_(this.element);C=p.K();var N=C.S;this.N=p;this.suggestion=null;this.onVideoDataChange("newdata",this.N.getVideoData());this.U(p,"videodatachange",this.onVideoDataChange);this.T=new g.L({L:"div",B:"ytp-autonav-endscreen-upnext-container",X:{"aria-label":"{{aria_label}}", "data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},j:[{L:"div",B:"ytp-autonav-endscreen-upnext-header"},{L:"div",B:"ytp-autonav-endscreen-upnext-alternative-header",Ak:"{{autoplayAlternativeHeader}}"},{L:"a",B:"ytp-autonav-endscreen-link-container",X:{href:"{{url}}",target:N?C.Z:""},j:[{L:"div",B:"ytp-autonav-endscreen-upnext-thumbnail",X:{style:"{{background}}"},j:[{L:"div",X:{"aria-label":"{{timestamp}}"},i_:["ytp-autonav-timestamp"], Ak:"{{duration}}"},{L:"div",i_:["ytp-autonav-live-stamp"],Ak:"Ao vivo"},{L:"div",i_:["ytp-autonav-upcoming-stamp"],Ak:"Em breve"}]},{L:"div",B:"ytp-autonav-endscreen-video-info",j:[{L:"div",B:"ytp-autonav-endscreen-premium-badge"},{L:"div",B:"ytp-autonav-endscreen-upnext-title",Ak:"{{title}}"},{L:"div",B:"ytp-autonav-endscreen-upnext-author",Ak:"{{author}}"},{L:"div",B:"ytp-autonav-view-and-date",Ak:"{{views_and_publish_time}}"},{L:"div",B:"ytp-autonav-author-and-view",Ak:"{{author_and_views}}"}]}]}]}); g.R(this,this.T);this.T.u_(this.container.element);N||this.U(this.T.rV("ytp-autonav-endscreen-link-container"),"click",this.X1);this.N.createClientVe(this.container.element,this,115127);this.N.createClientVe(this.T.rV("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.L({L:"div",B:"ytp-autonav-overlay"});g.R(this,this.overlay);this.overlay.u_(this.container.element);this.C=new g.L({L:"div",B:"ytp-autonav-endscreen-button-container"});g.R(this,this.C);this.C.u_(this.container.element); this.cancelButton=new g.L({L:"button",i_:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",C.G("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],X:{"aria-label":"Cancelar reprodu\u00e7\u00e3o autom\u00e1tica"},Ak:"Cancelar"});g.R(this,this.cancelButton);this.cancelButton.u_(this.C.element);this.cancelButton.listen("click",this.EF,this);this.N.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.L({L:"a",i_:["ytp-autonav-endscreen-upnext-button", "ytp-autonav-endscreen-upnext-play-button",C.G("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],X:{href:"{{url}}",role:"button","aria-label":"Reproduzir pr\u00f3ximo v\u00eddeo"},Ak:"Assista agora"});g.R(this,this.playButton);this.playButton.u_(this.C.element);this.playButton.listen("click",this.X1,this);this.N.createServerVe(this.playButton.element,this.playButton,!0);(C=this.N.getVideoData())&&r80(this,C);this.S=new g.N8(function(){BAy(V)},500); g.R(this,this.S);this.jJ();this.U(p,"autonavvisibility",this.jJ);this.N.G("web_autonav_color_transition")&&(this.U(p,"autonavchange",this.Sy),this.U(p,"onAutonavCoundownStarted",this.Wx$))},iA=function(p){var C=p.N.ai(!0,p.N.isFullscreen()); g.Tz(p.container.element,"ytp-autonav-endscreen-small-mode",p.OE(C));g.Tz(p.container.element,"ytp-autonav-endscreen-is-premium",!!p.suggestion&&!!p.suggestion.WcV);g.Tz(p.N.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!p.N.B1());g.Tz(p.N.getRootNode(),"countdown-running",p.xb());g.Tz(p.container.element,"ytp-player-content",p.N.B1());g.K2(p.overlay.element,{width:C.width+"px"});if(!p.xb()){p.N.B1()?GDp(p,Math.round(pi5(p)/1E3)):GDp(p);C=!!p.suggestion&&!!p.suggestion.B8;var V=p.N.B1()|| !C;g.Tz(p.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!V&&C);g.Tz(p.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",V&&!C);p.C.jb(p.N.B1());g.Tz(p.element,"ytp-enable-w2w-color-transitions",C3Y(p))}},BAy=function(p){var C=pi5(p),V=Math,N=V.min; var H=p.V?Date.now()-p.V:0;V=N.call(V,H,C);GDp(p,Math.ceil((C-V)/1E3));C-V<=500&&p.xb()?p.select(!0):p.xb()&&p.S.start()},pi5=function(p){if(p.N.isFullscreen()){var C; p=(C=p.N.getVideoData())==null?void 0:C.SP;return p===-1||p===void 0?8E3:p}return p.N.ZO()>=0?p.N.ZO():g.mi(p.N.K().experiments,"autoplay_time")||1E4},r80=function(p,C){C=C.getWatchNextResponse(); var V,N;C=(V=Qb1(C))==null?void 0:(N=V.nextButton)==null?void 0:N.buttonRenderer;p.W=C==null?void 0:C.navigationEndpoint;V=C==null?void 0:C.trackingParams;p.playButton&&V&&p.N.setTrackingParams(p.playButton.element,V)},C3Y=function(p){var C; return!((C=p.N.getVideoData())==null||!C.watchToWatchTransitionRenderer)},GDp=function(p,C){C=C===void 0?-1:C; p=p.T.rV("ytp-autonav-endscreen-upnext-header");g.aN(p);if(C>=0){C=String(C);var V="Pr\u00f3ximo v\u00eddeo em $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],N="Pr\u00f3ximo v\u00eddeo em $SECONDS".indexOf(V);if(N>=0){p.appendChild(g.h2("Pr\u00f3ximo v\u00eddeo em $SECONDS".slice(0,N)));var H=g.iK("span");g.sd(H,"ytp-autonav-endscreen-upnext-header-countdown-number");g.ce(H,C);p.appendChild(H);p.appendChild(g.h2("Pr\u00f3ximo v\u00eddeo em $SECONDS".slice(N+V.length)));return}}g.ce(p,"Pr\u00f3ximo")}, hi=function(p,C){g.L.call(this,{L:"div", i_:["html5-endscreen","ytp-player-content",C||"base-endscreen"]});this.created=!1;this.player=p},sP=function(p){g.L.call(this,{L:"div", i_:["ytp-upnext","ytp-player-content"],X:{"aria-label":"{{aria_label}}"},j:[{L:"div",B:"ytp-cued-thumbnail-overlay-image",X:{style:"{{background}}"}},{L:"span",B:"ytp-upnext-top",j:[{L:"span",B:"ytp-upnext-header",Ak:"Pr\u00f3ximo"},{L:"span",B:"ytp-upnext-title",Ak:"{{title}}"},{L:"span",B:"ytp-upnext-author",Ak:"{{author}}"}]},{L:"a",B:"ytp-upnext-autoplay-icon",X:{role:"button",href:"{{url}}","aria-label":"Reproduzir pr\u00f3ximo v\u00eddeo"},j:[{L:"svg",X:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},j:[{L:"circle",B:"ytp-svg-autoplay-circle",X:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{L:"circle",B:"ytp-svg-autoplay-ring",X:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{L:"path",B:"ytp-svg-fill",X:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{L:"span",B:"ytp-upnext-bottom",j:[{L:"span",B:"ytp-upnext-cancel"},{L:"span",B:"ytp-upnext-paused", Ak:"Reprodu\u00e7\u00e3o autom\u00e1tica pausada"}]}]});this.api=p;this.cancelButton=null;this.W=this.rV("ytp-svg-autoplay-ring");this.V=this.notification=this.T=this.suggestion=null;this.S=new g.N8(this.Se,5E3,this);this.C=0;var C=this.rV("ytp-upnext-cancel");this.cancelButton=new g.L({L:"button",i_:["ytp-upnext-cancel-button","ytp-button"],X:{tabindex:"0","aria-label":"Cancelar reprodu\u00e7\u00e3o autom\u00e1tica"},Ak:"Cancelar"});g.R(this,this.cancelButton);this.cancelButton.listen("click",this.ul, this);this.cancelButton.u_(C);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.R(this,this.S);this.api.createClientVe(this.element,this,18788);C=this.rV("ytp-upnext-autoplay-icon");this.U(C,"click",this.mz);this.api.createClientVe(C,this,115130);this.F1();this.U(p,"autonavvisibility",this.F1);this.U(p,"mdxnowautoplaying",this.xWo);this.U(p,"mdxautoplaycanceled",this.sH$);g.Tz(this.element,"ytp-upnext-mobile",this.api.K().C)},jXF=function(p,C){if(C)return C; if(p.api.isFullscreen()){var V;p=(V=p.api.getVideoData())==null?void 0:V.SP;return p===-1||p===void 0?8E3:p}return p.api.ZO()>=0?p.api.ZO():g.mi(p.api.K().experiments,"autoplay_time")||1E4},VE2=function(p,C){C=jXF(p,C); var V=Math,N=V.min;var H=(0,g.Ip)()-p.C;V=N.call(V,H,C);C=C===0?1:Math.min(V/C,1);p.W.setAttribute("stroke-dashoffset",""+-211*(C+1));C>=1&&p.xb()&&p.api.getPresentingPlayerType()!==3?p.select(!0):p.xb()&&p.T.start()},aU=function(p){hi.call(this,p,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.L({L:"div",B:"ytp-suggestion-panel",j:[{L:"div",i_:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],Ak:"Mais v\u00eddeos"}]});this.J=new g.L({L:"div",B:"ytp-suggestions-container"});this.videos=[];this.V=null;this.W=this.D=!1;this.C=new dp(this.player);g.R(this,this.C);this.C.u_(this.element);p.getVideoData().d6?this.T=this.C:(this.T=new sP(p),g.LT(this.player,this.T.element,4),g.R(this,this.T));this.overlay=new g.L({L:"div", B:"ytp-autonav-overlay-cancelled-state"});g.R(this,this.overlay);this.overlay.u_(this.element);this.S=new g.Rr(this);g.R(this,this.S);g.R(this,this.table);this.table.u_(this.element);this.table.show();g.R(this,this.J);this.J.u_(this.table.element);this.hide()},EP=function(p){var C=p.B1(); C!==p.W&&(p.W=C,p.player.publish("autonavvisibility"),p.W?(p.C!==p.T&&p.C.hide(),p.table.hide()):(p.C!==p.T&&p.C.show(),p.table.show()))},lA=function(p,C){g.L.call(this,{L:"button", i_:["ytp-watch-on-youtube-button","ytp-button"],Ak:"{{content}}"});this.N=p;this.buttonType=this.buttonType=C;this.MN();this.buttonType===2&&g.Ed(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.MN);this.jb(!0)},ti=function(p,C){hi.call(this,p,"embeds-lite-endscreen"); this.N=p;this.T=C;this.N.createClientVe(this.element,this,156943);this.watchButton=new lA(p,2);g.R(this,this.watchButton);this.watchButton.u_(this.element);this.hide()},NUy=function(p){hi.call(this,p,"subscribecard-endscreen"); this.T=new g.L({L:"div",B:"ytp-subscribe-card",j:[{L:"img",B:"ytp-author-image",X:{src:"{{profilePicture}}"}},{L:"div",B:"ytp-subscribe-card-right",j:[{L:"div",B:"ytp-author-name",Ak:"{{author}}"},{L:"div",B:"html5-subscribe-button-container"}]}]});g.R(this,this.T);this.T.u_(this.element);var C=p.getVideoData();this.subscribeButton=new g.ER("Inscreva-se",null,"Cancelar assinatura",null,!0,!1,C.eI,C.subscribed,"trailer-endscreen",null,p,!1);g.R(this,this.subscribeButton);this.subscribeButton.u_(this.T.rV("html5-subscribe-button-container")); this.U(p,"videodatachange",this.Pr);this.Pr();this.hide()},c9=function(p){var C=p.K(),V=g.kZ||g.Fs?{style:"will-change: opacity"}:void 0,N=C.S,H=["ytp-videowall-still"]; C.C&&H.push("ytp-videowall-show-text");g.L.call(this,{L:"a",i_:H,X:{href:"{{url}}",target:N?C.Z:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},j:[{L:"div",B:"ytp-videowall-still-image",X:{style:"{{background}}"}},{L:"span",B:"ytp-videowall-still-info",X:{"aria-hidden":"true"},j:[{L:"span",B:"ytp-videowall-still-info-bg",j:[{L:"span",B:"ytp-videowall-still-info-content",X:V,j:[{L:"span",B:"ytp-videowall-still-info-title",Ak:"{{title}}"}, {L:"span",B:"ytp-videowall-still-info-author",Ak:"{{author_and_views}}"},{L:"span",B:"ytp-videowall-still-info-live",Ak:"Ao vivo"},{L:"span",B:"ytp-videowall-still-info-duration",Ak:"{{duration}}"}]}]}]},{L:"span",i_:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],X:{"aria-hidden":"true"},j:[{L:"span",B:"ytp-videowall-still-listlabel-icon"},"Playlist",{L:"span",B:"ytp-videowall-still-listlabel-length",j:[" (",{L:"span",Ak:"{{playlist_length}}"},")"]}]},{L:"span",i_:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],X:{"aria-hidden":"true"},j:[{L:"span",B:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{L:"span",B:"ytp-videowall-still-listlabel-length",Ak:" (50+)"}]}]});this.suggestion=null;this.C=N;this.api=p;this.T=new g.Rr(this);g.R(this,this.T);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.T.U(p,"videodatachange",this.onVideoDataChange);p.createServerVe(this.element,this);this.onVideoDataChange()},Ta=function(p){hi.call(this,p,"videowall-endscreen"); var C=this;this.N=p;this.V=0;this.stills=[];this.S=this.videoData=null;this.W=this.J=!1;this.Z=null;this.C=new g.Rr(this);g.R(this,this.C);this.D=new g.N8(function(){g.Ed(C.element,"ytp-show-tiles")},0); g.R(this,this.D);var V=new g.L({L:"button",i_:["ytp-button","ytp-endscreen-previous"],X:{"aria-label":"Anterior"},j:[g.fq()]});g.R(this,V);V.u_(this.element);V.listen("click",this.fH,this);this.table=new g.mz({L:"div",B:"ytp-endscreen-content"});g.R(this,this.table);this.table.u_(this.element);V=new g.L({L:"button",i_:["ytp-button","ytp-endscreen-next"],X:{"aria-label":"Pr\u00f3ximo"},j:[g.Oy()]});g.R(this,V);V.u_(this.element);V.listen("click",this.il,this);p.getVideoData().d6?this.T=new dp(p,!0): this.T=new sP(p);g.R(this,this.T);g.LT(this.player,this.T.element,4);p.createClientVe(this.element,this,158789);this.hide()},M0=function(p){return g.gb(p.player)&&p.Xs()&&!p.S},Ji=function(p){var C=p.B1(); C!==p.J&&(p.J=C,p.player.publish("autonavvisibility"))},m7=function(p){hi.call(this,p,"watch-again-on-youtube-endscreen"); this.watchButton=new lA(p,1);g.R(this,this.watchButton);this.watchButton.u_(this.element);g.QGv(p)&&(this.T=new g.GS(p),g.R(this,this.T),this.C=new g.L({L:"div",i_:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],X:{tabIndex:"-1"},j:[this.T]}),g.R(this,this.C),this.T.u_(this.C.element),this.C.u_(this.element));p.createClientVe(this.element,this,156914);this.hide()},iNP=function(p){g.IT.call(this,p); var C=this;this.endScreen=null;this.C=this.T=this.V=this.S=!1;this.listeners=new g.Rr(this);g.R(this,this.listeners);var V=p.K(),N=p.getVideoData();N=N&&N.limitedPlaybackDurationInSeconds!==0;g.cw(g.Ig(V))&&N&&!g.nT(p)?(this.C=!0,this.endScreen=new ti(p,g.Zg(p))):p.isEmbedsShortsMode()?this.endScreen=new m7(p):HN5(p)?(this.S=!0,Xif(this),this.T?this.endScreen=new aU(p):this.endScreen=new Ta(p)):V.FT?this.endScreen=new NUy(p):this.endScreen=new hi(p);g.R(this,this.endScreen);g.LT(p,this.endScreen.element, 4);djY(this);this.listeners.U(p,"videodatachange",this.onVideoDataChange,this);this.listeners.U(p,g.Ez("endscreen"),function(H){C.onCueRangeEnter(H)}); this.listeners.U(p,g.lG("endscreen"),function(H){C.onCueRangeExit(H)})},Xif=function(p){var C=p.player.getVideoData(); if(!C||p.T===C.JB&&p.V===C.d6)return!1;p.T=C.JB;p.V=C.d6;return!0},HN5=function(p){p=p.K(); return p.QZ&&!p.FT},djY=function(p){p.player.qt("endscreen"); var C=p.player.getVideoData();C=new g.sz(Math.max((C.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var V=new g.sz(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});p.player.d7([C,V])}; g.xj.prototype.ZO=g.Ns(14,function(){return this.app.ZO()}); g.vN.prototype.ZO=g.Ns(13,function(){return this.getVideoData().JT}); g.bx.prototype.nw=g.Ns(12,function(p){this.Cx().nw(p)}); g.fZ.prototype.nw=g.Ns(11,function(p){this.T!==p&&(this.T=p,this.Pr())}); g.ov.prototype.nw=g.Ns(10,function(p){this.overflowButton&&this.overflowButton.nw(p)}); g.bx.prototype.Cw=g.Ns(9,function(p){this.Cx().Cw(p)}); g.bW.prototype.Cw=g.Ns(8,function(p){this.C!==p&&(this.C=p,this.Pr())}); g.ov.prototype.Cw=g.Ns(7,function(p){this.shareButton&&this.shareButton.Cw(p)}); g.bx.prototype.Ur=g.Ns(6,function(p){this.Cx().Ur(p)}); g.Hz.prototype.Ur=g.Ns(5,function(p){this.rD!==p&&(this.rD=p,this.Uc())}); g.bx.prototype.tv=g.Ns(4,function(p){this.Cx().tv(p)}); g.ov.prototype.tv=g.Ns(3,function(p){this.IM!==p&&(this.IM=p,this.tF())});g.m(Xb,g.L);Xb.prototype.select=function(){this.N.Ce(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.HO||void 0)&&this.N.logClick(this.element)}; Xb.prototype.onClick=function(p){g.Ml(p,this.N,this.T,this.suggestion.sessionData||void 0)&&this.select()}; Xb.prototype.onKeyPress=function(p){switch(p.keyCode){case 13:case 32:p.defaultPrevented||(this.select(),p.preventDefault())}};g.m(dp,g.L);g.h=dp.prototype;g.h.zn=function(p){this.suggestion!==p&&(this.suggestion=p,H9(this.T,p),this.playButton.updateValue("url",this.suggestion.a8()),iA(this))}; g.h.xb=function(){return this.V>0}; g.h.oW=function(){this.xb()||(this.V=Date.now(),BAy(this),WoG(this.N,pi5(this)),g.Tz(this.N.getRootNode(),"countdown-running",this.xb()))}; g.h.iN=function(){this.hF();BAy(this);var p=this.T.rV("ytp-autonav-endscreen-upnext-header");p&&g.ce(p,"Pr\u00f3ximo")}; g.h.hF=function(){this.xb()&&(this.S.stop(),this.V=0)}; g.h.select=function(p){this.N.nextVideo(!1,p===void 0?!1:p);this.hF()}; g.h.X1=function(p){g.Ml(p,this.N)&&(p.currentTarget===this.playButton.element?this.N.logClick(this.playButton.element):p.currentTarget===this.T.rV("ytp-autonav-endscreen-link-container")&&(p=this.T.rV("ytp-autonav-endscreen-link-container"),this.N.logVisibility(p,!0),this.N.logClick(p)),this.W?(this.N.Jk("innertubeCommand",this.W),this.hF()):this.select())}; g.h.EF=function(){this.N.logClick(this.cancelButton.element);g.zC(this.N,!0);this.cancelCommand&&this.N.Jk("innertubeCommand",this.cancelCommand)}; g.h.onVideoDataChange=function(p,C){r80(this,C);p=C.getWatchNextResponse();var V,N;p=(V=Qb1(p))==null?void 0:(N=V.cancelButton)==null?void 0:N.buttonRenderer;this.cancelCommand=p==null?void 0:p.command}; g.h.Wx$=function(p){if(C3Y(this)){var C=this.N.getVideoData().watchToWatchTransitionRenderer,V=C==null?void 0:C.fromColorPaletteDark;C=C==null?void 0:C.toColorPaletteDark;if(V&&C){var N=this.element;N.style.setProperty("--w2w-start-background-color",g.Q_(V.surgeColor));N.style.setProperty("--w2w-start-primary-text-color",g.Q_(V.primaryTitleColor));N.style.setProperty("--w2w-start-secondary-text-color",g.Q_(V.secondaryTitleColor));N.style.setProperty("--w2w-end-background-color",g.Q_(C.surgeColor)); N.style.setProperty("--w2w-end-primary-text-color",g.Q_(C.primaryTitleColor));N.style.setProperty("--w2w-end-secondary-text-color",g.Q_(C.secondaryTitleColor));N.style.setProperty("--w2w-animation-duration",p+"ms")}g.Tz(this.element,"ytp-w2w-animate",!0)}}; g.h.Sy=function(p){this.N.G("web_autonav_color_transition")&&p!==2&&g.Tz(this.element,"ytp-w2w-animate",!1)}; g.h.jJ=function(){var p=this.N.B1();this.D&&this.C4!==p&&this.jb(p);iA(this);this.N.logVisibility(this.container.element,p);this.N.logVisibility(this.cancelButton.element,p);this.N.logVisibility(this.T.rV("ytp-autonav-endscreen-link-container"),p);this.N.logVisibility(this.playButton.element,p)}; g.h.OE=function(p){return p.width<400||p.height<459};g.m(hi,g.L);g.h=hi.prototype;g.h.create=function(){this.created=!0}; g.h.destroy=function(){this.created=!1}; g.h.Xs=function(){return!1}; g.h.B1=function(){return!1}; g.h.Ca=function(){return!1};g.m(sP,g.L);g.h=sP.prototype;g.h.Se=function(){this.notification&&(this.S.stop(),this.rY(this.V),this.V=null,this.notification.close(),this.notification=null)}; g.h.zn=function(p){this.suggestion=p;H9(this,p,"hqdefault.jpg")}; g.h.F1=function(){this.jb(this.api.B1());this.api.logVisibility(this.element,this.api.B1());this.api.logVisibility(this.rV("ytp-upnext-autoplay-icon"),this.api.B1());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.B1())}; g.h.vMx=function(){window.focus();this.Se()}; g.h.oW=function(p){var C=this;this.xb()||(g.J3("a11y-announce","Pr\u00f3ximo "+this.suggestion.title),this.C=(0,g.Ip)(),this.T=new g.N8(function(){VE2(C,p)},25),VE2(this,p),WoG(this.api,jXF(this,p))); g.tk(this.element,"ytp-upnext-autoplay-paused")}; g.h.hide=function(){g.L.prototype.hide.call(this)}; g.h.xb=function(){return!!this.T}; g.h.iN=function(){this.hF();this.C=(0,g.Ip)();VE2(this);g.Ed(this.element,"ytp-upnext-autoplay-paused")}; g.h.hF=function(){this.xb()&&(this.T.dispose(),this.T=null)}; g.h.select=function(p){p=p===void 0?!1:p;if(this.api.K().G("autonav_notifications")&&p&&window.Notification&&typeof document.hasFocus==="function"){var C=Notification.permission;C==="default"?Notification.requestPermission():C!=="granted"||document.hasFocus()||(this.Se(),this.notification=new Notification("Pr\u00f3ximo",{body:this.suggestion.title,icon:this.suggestion.TW()}),this.V=this.U(this.notification,"click",this.vMx),this.S.start())}this.hF();this.api.nextVideo(!1,p)}; g.h.mz=function(p){!g.t2(this.cancelButton.element,p.target)&&g.Ml(p,this.api)&&(this.api.B1()&&this.api.logClick(this.rV("ytp-upnext-autoplay-icon")),this.select())}; g.h.ul=function(){this.api.B1()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.zC(this.api,!0)}; g.h.xWo=function(p){this.api.getPresentingPlayerType();this.show();this.oW(p)}; g.h.sH$=function(){this.api.getPresentingPlayerType();this.hF();this.hide()}; g.h.CS=function(){this.hF();this.Se();g.L.prototype.CS.call(this)};g.m(aU,hi);g.h=aU.prototype;g.h.create=function(){hi.prototype.create.call(this);this.S.U(this.player,"appresize",this.Hx);this.S.U(this.player,"onVideoAreaChange",this.Hx);this.S.U(this.player,"videodatachange",this.onVideoDataChange);this.S.U(this.player,"autonavchange",this.qK);this.S.U(this.player,"onAutonavCancelled",this.v7);this.onVideoDataChange()}; g.h.show=function(){hi.prototype.show.call(this);(this.D||this.V&&this.V!==this.videoData.clientPlaybackNonce)&&g.zC(this.player,!1);g.gb(this.player)&&this.Xs()&&!this.V?(EP(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3?this.T.select(!0):this.T.oW():this.videoData.autonavState===3&&this.T.iN()):(g.zC(this.player,!0),EP(this));this.Hx()}; g.h.hide=function(){hi.prototype.hide.call(this);this.T.iN();EP(this)}; g.h.Hx=function(){var p=this.player.ai(!0,this.player.isFullscreen());EP(this);iA(this.C);g.Tz(this.element,"ytp-autonav-cancelled-small-mode",this.OE(p));g.Tz(this.element,"ytp-autonav-cancelled-tiny-mode",this.jQ(p));g.Tz(this.element,"ytp-autonav-cancelled-mini-mode",p.width<=400||p.height<=360);this.overlay&&g.K2(this.overlay.element,{width:p.width+"px"});if(!this.W)for(p=0;p0&&(p= c*4,M=C<=E-2&&l>=t*4;if((t+1)/c*N/d>d/(t/(c+1)*N)&&M)l-=t*4,C+=2;else if(T)l-=c*4,p+=2;else if(M)l-=t*4,C+=2;else break}N=!1;l>=12&&V*4-l<=6&&(C>=4||p>=4)&&(N=!0);l=p*96;a=C*54;d=l/a=p-2&&t>=C-2?M=1:t%2===0&&E%2===0&&(t<2&&E<2?t===0&&E===0&&(M=2):M=2),c=g.m9(c+this.V,V),M!==0){T=this.stills[d];T||(T=new c9(this.player),this.stills[d]=T,X.appendChild(T.element));var J=Math.floor(a*t/C),S=Math.floor(l*E/p),D=Math.floor(a*(t+M)/C)-J-4,Z=Math.floor(l*(E+M)/p)-S-4;g.OE(T.element,S,J);g.b4(T.element,Z,D);g.K2(T.element,"transitionDelay",(t+E)/20+"s");g.Tz(T.element,"ytp-videowall-still-mini", M===1);g.Tz(T.element,"ytp-videowall-still-large",M>2);M=Math.max(Z,D);g.Tz(T.element,"ytp-videowall-still-round-large",M>=256);g.Tz(T.element,"ytp-videowall-still-round-medium",M>96&&M<256);g.Tz(T.element,"ytp-videowall-still-round-small",M<=96);c=H[c];T.suggestion!==c&&(T.suggestion=c,M=T.api.K(),J=g.aL(T.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",H9(T,c,J),g.KI(M)&&!T.api.G("web_player_log_click_before_generating_ve_conversion_params")&&(M=c.a8(),J={},g.FE(T.api,"addEmbedsConversionTrackingParams", [J]),M=g.GD(M,J),T.updateValue("url",M)),(c=(c=c.sessionData)&&c.itct)&&T.api.setTrackingParams(T.element,c));d++}X.ariaBusy="false";g.Tz(this.element,"ytp-endscreen-paginate",d=d;H--)p=this.stills[H],g.lK(p.element),g.iP(p);this.stills.length=d}}; g.h.onVideoDataChange=function(){var p=this.player.getVideoData(1);this.videoData!==p&&(p!=null&&g.NI(p)?(this.V=0,this.videoData=p,this.j6()):this.player.k_("missg",{vid:(p==null?void 0:p.videoId)||"",cpn:(p==null?void 0:p.clientPlaybackNonce)||""}))}; g.h.il=function(){this.V+=this.stills.length;this.j6()}; g.h.fH=function(){this.V-=this.stills.length;this.j6()}; g.h.Ca=function(){return this.T.xb()}; g.h.uu=function(p){p===1?(this.W=!1,this.S=this.videoData.clientPlaybackNonce,this.T.hF(),this.C4&&this.j6()):(this.W=!0,this.C4&&M0(this)&&(p===2?this.T.oW():p===3&&this.T.iN()))}; g.h.zt=function(p){if(p){for(p=0;p0||p.endSeconds>0):p.mutedAutoplay;if((this.player.isEmbedsShortsMode()||this.C)&&!C)return!0;var V;var N=!!((p==null?0:g.NI(p))||(p==null?0:(V=p.suggestions)==null?0:V.length));N=!HN5(this.player)||N;p=p.Pz;V=this.player.oF();return N&&!p&&!V&&!C}; g.h.B1=function(){return this.endScreen.B1()}; g.h.nD=function(){return this.B1()?this.endScreen.Ca():!1}; g.h.CS=function(){this.player.qt("endscreen");g.IT.prototype.CS.call(this)}; g.h.load=function(){var p=this.player.getVideoData();var C=p.transitionEndpointAtEndOfStream;if(C&&C.videoId){var V=this.player.Tk().Ji.get("heartbeat"),N=g.NI(p);!N||C.videoId!==N.videoId||p.Rg?(this.player.Ce(C.videoId,void 0,void 0,!0,!0,C),V&&V.VK("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),p=!0):p=!1}else p=!1;p||(g.IT.prototype.load.call(this),this.endScreen.show())}; g.h.unload=function(){g.IT.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.h.onCueRangeEnter=function(p){this.zE()&&(this.endScreen.created||this.endScreen.create(),p.getId()==="load"&&this.load())}; g.h.onCueRangeExit=function(p){p.getId()==="load"&&this.loaded&&this.unload()}; g.h.onVideoDataChange=function(){djY(this);this.S&&Xif(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.T?this.endScreen=new aU(this.player):this.endScreen=new Ta(this.player),g.R(this,this.endScreen),g.LT(this.player,this.endScreen.element,4))};g.qA("endscreen",iNP);})(_yt_player);