(function(g){var window=this;'use strict';var JTA=function(R){R.publish("autonavvisibility")},gmU=function(R,l){R.KX("onAutonavCoundownStarted",l)},VjX=function(R){var l,y,f; return R==null?void 0:(l=R.playerOverlays)==null?void 0:(y=l.playerOverlayRenderer)==null?void 0:(f=y.autoplay)==null?void 0:f.playerOverlayAutoplayRenderer},Gh=function(R){var l=R.U(),y=l.Y; g.Z.call(this,{T:"a",j:"ytp-autonav-suggestion-card",K:{href:"{{url}}",target:y?l.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}}"},S:[{T:"div",QL:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],K:{style:"{{background}}"},S:[{T:"div",K:{"aria-label":"{{timestamp}}"},QL:["ytp-autonav-timestamp"],IE:"{{duration}}"},{T:"div",QL:["ytp-autonav-live-stamp"],IE:"En vivo"}, {T:"div",QL:["ytp-autonav-upcoming-stamp"],IE:"Pr\u00f3ximamente"},{T:"div",j:"ytp-autonav-list-overlay",S:[{T:"div",j:"ytp-autonav-mix-text",IE:"Mix"},{T:"div",j:"ytp-autonav-mix-icon"}]}]},{T:"div",QL:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],IE:"{{title}}"},{T:"div",QL:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],IE:"{{author}}"},{T:"div",QL:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],IE:"{{views_and_publish_time}}"}]});this.G= R;this.suggestion=null;this.Z=y;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},aO=function(R,l){l=l===void 0?!1:l; g.Z.call(this,{T:"div",j:"ytp-autonav-endscreen-countdown-overlay"});var y=this;this.V=l;this.cancelCommand=this.D=void 0;this.L=0;this.container=new g.Z({T:"div",j:"ytp-autonav-endscreen-countdown-container"});g.U(this,this.container);this.container.JU(this.element);l=R.U();var f=l.Y;this.G=R;this.suggestion=null;this.onVideoDataChange("newdata",this.G.getVideoData());this.N(R,"videodatachange",this.onVideoDataChange);this.Z=new g.Z({T:"div",j:"ytp-autonav-endscreen-upnext-container",K:{"aria-label":"{{aria_label}}", "data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},S:[{T:"div",j:"ytp-autonav-endscreen-upnext-header"},{T:"div",j:"ytp-autonav-endscreen-upnext-alternative-header",IE:"{{autoplayAlternativeHeader}}"},{T:"a",j:"ytp-autonav-endscreen-link-container",K:{href:"{{url}}",target:f?l.B:""},S:[{T:"div",j:"ytp-autonav-endscreen-upnext-thumbnail",K:{style:"{{background}}"},S:[{T:"div",K:{"aria-label":"{{timestamp}}"},QL:["ytp-autonav-timestamp"], IE:"{{duration}}"},{T:"div",QL:["ytp-autonav-live-stamp"],IE:"En vivo"},{T:"div",QL:["ytp-autonav-upcoming-stamp"],IE:"Pr\u00f3ximamente"}]},{T:"div",j:"ytp-autonav-endscreen-video-info",S:[{T:"div",j:"ytp-autonav-endscreen-premium-badge"},{T:"div",j:"ytp-autonav-endscreen-upnext-title",IE:"{{title}}"},{T:"div",j:"ytp-autonav-endscreen-upnext-author",IE:"{{author}}"},{T:"div",j:"ytp-autonav-view-and-date",IE:"{{views_and_publish_time}}"},{T:"div",j:"ytp-autonav-author-and-view",IE:"{{author_and_views}}"}]}]}]}); g.U(this,this.Z);this.Z.JU(this.container.element);f||this.N(this.Z.pX("ytp-autonav-endscreen-link-container"),"click",this.CO);this.G.createClientVe(this.container.element,this,115127);this.G.createClientVe(this.Z.pX("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.Z({T:"div",j:"ytp-autonav-overlay"});g.U(this,this.overlay);this.overlay.JU(this.container.element);this.X=new g.Z({T:"div",j:"ytp-autonav-endscreen-button-container"});g.U(this,this.X);this.X.JU(this.container.element); this.cancelButton=new g.Z({T:"button",QL:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",l.C("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],K:{"aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},IE:"Cancelar"});g.U(this,this.cancelButton);this.cancelButton.JU(this.X.element);this.cancelButton.listen("click",this.qm,this);this.G.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.Z({T:"a",QL:["ytp-autonav-endscreen-upnext-button", "ytp-autonav-endscreen-upnext-play-button",l.C("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],K:{href:"{{url}}",role:"button","aria-label":"Reproducir siguiente video"},IE:"Reproducir ahora"});g.U(this,this.playButton);this.playButton.JU(this.X.element);this.playButton.listen("click",this.CO,this);this.G.createServerVe(this.playButton.element,this.playButton,!0);(l=this.G.getVideoData())&&Cy8(this,l);this.Y=new g.Vg(function(){qQr(y)},500); g.U(this,this.Y);this.QH();this.N(R,"autonavvisibility",this.QH);this.G.C("web_autonav_color_transition")&&(this.N(R,"autonavchange",this.wb),this.N(R,"onAutonavCoundownStarted",this.dU7))},sL=function(R){var l=R.G.vQ(!0,R.G.isFullscreen()); g.BJ(R.container.element,"ytp-autonav-endscreen-small-mode",R.cf(l));g.BJ(R.container.element,"ytp-autonav-endscreen-is-premium",!!R.suggestion&&!!R.suggestion.r7x);g.BJ(R.G.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!R.G.pJ());g.BJ(R.G.getRootNode(),"countdown-running",R.FM());g.BJ(R.container.element,"ytp-player-content",R.G.pJ());g.Df(R.overlay.element,{width:l.width+"px"});if(!R.FM()){R.G.pJ()?tjd(R,Math.round(YQr(R)/1E3)):tjd(R);l=!!R.suggestion&&!!R.suggestion.LQ;var y=R.G.pJ()|| !l;g.BJ(R.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!y&&l);g.BJ(R.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",y&&!l);R.X.UF(R.G.pJ());g.BJ(R.element,"ytp-enable-w2w-color-transitions",Mj8(R))}},qQr=function(R){var l=YQr(R),y=Math,f=y.min; var A=R.L?Date.now()-R.L:0;y=f.call(y,A,l);tjd(R,Math.ceil((l-y)/1E3));l-y<=500&&R.FM()?R.select(!0):R.FM()&&R.Y.start()},YQr=function(R){if(R.G.isFullscreen()){var l; R=(l=R.G.getVideoData())==null?void 0:l.wJ;return R===-1||R===void 0?8E3:R}return R.G.g$()>=0?R.G.g$():g.yx(R.G.U().experiments,"autoplay_time")||1E4},Cy8=function(R,l){l=l.getWatchNextResponse(); var y,f;l=(y=VjX(l))==null?void 0:(f=y.nextButton)==null?void 0:f.buttonRenderer;R.D=l==null?void 0:l.navigationEndpoint;y=l==null?void 0:l.trackingParams;R.playButton&&y&&R.G.setTrackingParams(R.playButton.element,y)},Mj8=function(R){var l; return!((l=R.G.getVideoData())==null||!l.watchToWatchTransitionRenderer)},tjd=function(R,l){l=l===void 0?-1:l; R=R.Z.pX("ytp-autonav-endscreen-upnext-header");g.W0(R);if(l>=0){l=String(l);var y="A continuaci\u00f3n, en $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],f="A continuaci\u00f3n, en $SECONDS".indexOf(y);if(f>=0){R.appendChild(g.c0("A continuaci\u00f3n, en $SECONDS".slice(0,f)));var A=g.ho("span");g.yD(A,"ytp-autonav-endscreen-upnext-header-countdown-number");g.Qa(A,l);R.appendChild(A);R.appendChild(g.c0("A continuaci\u00f3n, en $SECONDS".slice(f+y.length)));return}}g.Qa(R,"A continuaci\u00f3n")},B1= function(R,l){g.Z.call(this,{T:"div", QL:["html5-endscreen","ytp-player-content",l||"base-endscreen"]});this.created=!1;this.player=R},H1=function(R){g.Z.call(this,{T:"div", QL:["ytp-upnext","ytp-player-content"],K:{"aria-label":"{{aria_label}}"},S:[{T:"div",j:"ytp-cued-thumbnail-overlay-image",K:{style:"{{background}}"}},{T:"span",j:"ytp-upnext-top",S:[{T:"span",j:"ytp-upnext-header",IE:"A continuaci\u00f3n"},{T:"span",j:"ytp-upnext-title",IE:"{{title}}"},{T:"span",j:"ytp-upnext-author",IE:"{{author}}"}]},{T:"a",j:"ytp-upnext-autoplay-icon",K:{role:"button",href:"{{url}}","aria-label":"Reproducir siguiente video"},S:[{T:"svg",K:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},S:[{T:"circle",j:"ytp-svg-autoplay-circle",K:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{T:"circle",j:"ytp-svg-autoplay-ring",K:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{T:"path",j:"ytp-svg-fill",K:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{T:"span",j:"ytp-upnext-bottom",S:[{T:"span",j:"ytp-upnext-cancel"},{T:"span",j:"ytp-upnext-paused", IE:"La reproducci\u00f3n autom\u00e1tica est\u00e1 en pausa"}]}]});this.api=R;this.cancelButton=null;this.D=this.pX("ytp-svg-autoplay-ring");this.L=this.notification=this.Z=this.suggestion=null;this.Y=new g.Vg(this.ZI,5E3,this);this.X=0;var l=this.pX("ytp-upnext-cancel");this.cancelButton=new g.Z({T:"button",QL:["ytp-upnext-cancel-button","ytp-button"],K:{tabindex:"0","aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},IE:"Cancelar"});g.U(this,this.cancelButton);this.cancelButton.listen("click", this.Zg,this);this.cancelButton.JU(l);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.U(this,this.Y);this.api.createClientVe(this.element,this,18788);l=this.pX("ytp-upnext-autoplay-icon");this.N(l,"click",this.XV);this.api.createClientVe(l,this,115130);this.eE();this.N(R,"autonavvisibility",this.eE);this.N(R,"mdxnowautoplaying",this.eoq);this.N(R,"mdxautoplaycanceled",this.FjL);g.BJ(this.element,"ytp-upnext-mobile",this.api.U().X)},RlK=function(R,l){if(l)return l; if(R.api.isFullscreen()){var y;R=(y=R.api.getVideoData())==null?void 0:y.wJ;return R===-1||R===void 0?8E3:R}return R.api.g$()>=0?R.api.g$():g.yx(R.api.U().experiments,"autoplay_time")||1E4},lQS=function(R,l){l=RlK(R,l); var y=Math,f=y.min;var A=(0,g.eY)()-R.X;y=f.call(y,A,l);l=l===0?1:Math.min(y/l,1);R.D.setAttribute("stroke-dashoffset",""+-211*(l+1));l>=1&&R.FM()&&R.api.getPresentingPlayerType()!==3?R.select(!0):R.FM()&&R.Z.start()},nt=function(R){B1.call(this,R,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.Z({T:"div",j:"ytp-suggestion-panel",S:[{T:"div",QL:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],IE:"M\u00e1s videos"}]});this.W=new g.Z({T:"div",j:"ytp-suggestions-container"});this.videos=[];this.L=null;this.D=this.V=!1;this.X=new aO(this.player);g.U(this,this.X);this.X.JU(this.element);R.getVideoData().Ms?this.Z=this.X:(this.Z=new H1(R),g.kT(this.player,this.Z.element,4),g.U(this,this.Z));this.overlay=new g.Z({T:"div", j:"ytp-autonav-overlay-cancelled-state"});g.U(this,this.overlay);this.overlay.JU(this.element);this.Y=new g.QW(this);g.U(this,this.Y);g.U(this,this.table);this.table.JU(this.element);this.table.show();g.U(this,this.W);this.W.JU(this.table.element);this.hide()},mq=function(R){var l=R.pJ(); l!==R.D&&(R.D=l,JTA(R.player),R.D?(R.X!==R.Z&&R.X.hide(),R.table.hide()):(R.X!==R.Z&&R.X.show(),R.table.show()))},y4U=function(R){B1.call(this,R,"videowall-endscreen"); var l=this;this.G=R;this.stills=[];this.L=this.videoData=null;this.Y=this.V=!1;this.W=null;g.AU(this.element,"modern-videowall-endscreen");this.X=new g.QW(this);g.U(this,this.X);this.D=new g.Vg(function(){g.AU(l.element,"ytp-show-tiles")},0); g.U(this,this.D);this.table=new g.GG({T:"div",j:"ytp-modern-endscreen-content"});g.U(this,this.table);this.table.JU(this.element);R.getVideoData().Ms?this.Z=new aO(R,!0):this.Z=new H1(R);g.U(this,this.Z);g.kT(this.player,this.Z.element,4);R.createClientVe(this.element,this,158789);this.hide()},oO=function(R){return g.DN(R.player)&&R.l3()&&!R.L},h3=function(R){var l=R.pJ(); l!==R.V&&(R.V=l,JTA(R.player))},fQS=function(R){B1.call(this,R,"subscribecard-endscreen"); this.Z=new g.Z({T:"div",j:"ytp-subscribe-card",S:[{T:"img",j:"ytp-author-image",K:{src:"{{profilePicture}}"}},{T:"div",j:"ytp-subscribe-card-right",S:[{T:"div",j:"ytp-author-name",IE:"{{author}}"},{T:"div",j:"html5-subscribe-button-container"}]}]});g.U(this,this.Z);this.Z.JU(this.element);var l=R.getVideoData();this.subscribeButton=new g.yA("Suscribirse",null,"Anular suscripci\u00f3n",null,!0,!1,l.BQ,l.subscribed,"trailer-endscreen",null,R,!1);g.U(this,this.subscribeButton);this.subscribeButton.JU(this.Z.pX("html5-subscribe-button-container")); this.N(R,"videodatachange",this.oE);this.oE();this.hide()},c1=function(R){var l=R.U(),y=g.iz||g.Sr?{style:"will-change: opacity"}:void 0,f=l.Y,A=["ytp-videowall-still"]; l.X&&A.push("ytp-videowall-show-text");g.Z.call(this,{T:"a",QL:A,K:{href:"{{url}}",target:f?l.B:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},S:[{T:"div",j:"ytp-videowall-still-image",K:{style:"{{background}}"}},{T:"span",j:"ytp-videowall-still-info",K:{"aria-hidden":"true"},S:[{T:"span",j:"ytp-videowall-still-info-bg",S:[{T:"span",j:"ytp-videowall-still-info-content",K:y,S:[{T:"span",j:"ytp-videowall-still-info-title",IE:"{{title}}"}, {T:"span",j:"ytp-videowall-still-info-author",IE:"{{author_and_views}}"},{T:"span",j:"ytp-videowall-still-info-live",IE:"En vivo"},{T:"span",j:"ytp-videowall-still-info-duration",IE:"{{duration}}"}]}]}]},{T:"span",QL:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],K:{"aria-hidden":"true"},S:[{T:"span",j:"ytp-videowall-still-listlabel-icon"},"Playlist",{T:"span",j:"ytp-videowall-still-listlabel-length",S:[" (",{T:"span",IE:"{{playlist_length}}"},")"]}]},{T:"span",QL:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],K:{"aria-hidden":"true"},S:[{T:"span",j:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{T:"span",j:"ytp-videowall-still-listlabel-length",IE:" (50+)"}]}]});this.suggestion=null;this.X=f;this.api=R;this.Z=new g.QW(this);g.U(this,this.Z);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.Z.N(R,"videodatachange",this.onVideoDataChange);R.createServerVe(this.element,this);this.onVideoDataChange()},EL=function(R){B1.call(this,R,"videowall-endscreen"); var l=this;this.G=R;this.L=0;this.stills=[];this.Y=this.videoData=null;this.D=this.W=!1;this.B=null;this.X=new g.QW(this);g.U(this,this.X);this.V=new g.Vg(function(){g.AU(l.element,"ytp-show-tiles")},0); g.U(this,this.V);var y=new g.Z({T:"button",QL:["ytp-button","ytp-endscreen-previous"],K:{"aria-label":"Anterior"},S:[g.cB()]});g.U(this,y);y.JU(this.element);y.listen("click",this.xR,this);this.table=new g.GG({T:"div",j:"ytp-endscreen-content"});g.U(this,this.table);this.table.JU(this.element);y=new g.Z({T:"button",QL:["ytp-button","ytp-endscreen-next"],K:{"aria-label":"Siguiente"},S:[g.E_()]});g.U(this,y);y.JU(this.element);y.listen("click",this.GE,this);R.getVideoData().Ms?this.Z=new aO(R,!0):this.Z= new H1(R);g.U(this,this.Z);g.kT(this.player,this.Z.element,4);R.createClientVe(this.element,this,158789);this.hide()},W1=function(R){return g.DN(R.player)&&R.l3()&&!R.Y},Lt=function(R){var l=R.pJ(); l!==R.W&&(R.W=l,JTA(R.player))},A4A=function(R,l){g.Z.call(this,{T:"button", QL:["ytp-watch-on-youtube-button","ytp-button"],IE:"{{content}}"});this.G=R;this.buttonType=this.buttonType=l;this.Qz();this.buttonType===2&&g.AU(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.Qz);this.UF(!0)},OL=function(R){B1.call(this,R,"watch-again-on-youtube-endscreen"); this.watchButton=new A4A(R,1);g.U(this,this.watchButton);this.watchButton.JU(this.element);g.CjU(R)&&(this.Z=new g.yn(R),g.U(this,this.Z),this.X=new g.Z({T:"div",QL:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],K:{tabIndex:"-1"},S:[this.Z]}),g.U(this,this.X),this.Z.JU(this.X.element),this.X.JU(this.element));R.createClientVe(this.element,this,156914);this.hide()},sRd=function(R){g.Fc.call(this,R); var l=this;this.endScreen=null;this.Z=this.X=this.L=!1;this.listeners=new g.QW(this);g.U(this,this.listeners);var y=R.U();R.isEmbedsShortsMode()?this.endScreen=new OL(R):Kzt(R)?(this.L=!0,GlX(this),this.Z?this.endScreen=new nt(R):y.C("delhi_modern_endscreen")?this.endScreen=new y4U(R):this.endScreen=new EL(R)):y.BA?this.endScreen=new fQS(R):this.endScreen=new B1(R);g.U(this,this.endScreen);g.kT(R,this.endScreen.element,4);aQU(this);this.listeners.N(R,"videodatachange",this.onVideoDataChange,this); this.listeners.N(R,g.Vx("endscreen"),function(f){l.onCueRangeEnter(f)}); this.listeners.N(R,g.Cd("endscreen"),function(f){l.onCueRangeExit(f)})},GlX=function(R){var l=R.player.getVideoData(); if(!l||R.Z===l.ZT&&R.X===l.Ms)return!1;R.Z=l.ZT;R.X=l.Ms;return!0},Kzt=function(R){R=R.U(); return R.Vu&&!R.BA&&!R.disableOrganicUi},aQU=function(R){R.player.yb("endscreen"); var l=R.player.getVideoData();l=new g.Jq(Math.max((l.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var y=new g.Jq(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});R.player.OS([l,y])}; g.wn.prototype.g$=g.Kk(6,function(){return this.app.g$()}); g.i_.prototype.g$=g.Kk(5,function(){return this.getVideoData().b_}); g.dn.prototype.b2=g.Kk(4,function(R){this.Cf().b2(R)}); g.Cq.prototype.b2=g.Kk(3,function(R){this.dR!==R&&(this.dR=R,this.ra())}); g.O(Gh,g.Z);Gh.prototype.select=function(){this.G.MA(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.Tk||void 0)&&this.G.logClick(this.element)}; Gh.prototype.onClick=function(R){g.cV(R,this.G,this.Z,this.suggestion.sessionData||void 0)&&this.select()}; Gh.prototype.onKeyPress=function(R){switch(R.keyCode){case 13:case 32:R.defaultPrevented||(this.select(),R.preventDefault())}};g.O(aO,g.Z);g.L=aO.prototype;g.L.xp=function(R){this.suggestion!==R&&(this.suggestion=R,g.nq(this.Z,R),this.playButton.updateValue("url",this.suggestion.v6()),sL(this))}; g.L.FM=function(){return this.L>0}; g.L.Bi=function(){this.FM()||(this.L=Date.now(),qQr(this),gmU(this.G,YQr(this)),g.BJ(this.G.getRootNode(),"countdown-running",this.FM()))}; g.L.eT=function(){this.aA();qQr(this);var R=this.Z.pX("ytp-autonav-endscreen-upnext-header");R&&g.Qa(R,"A continuaci\u00f3n")}; g.L.aA=function(){this.FM()&&(this.Y.stop(),this.L=0)}; g.L.select=function(R){this.G.nextVideo(!1,R===void 0?!1:R);this.aA()}; g.L.CO=function(R){g.cV(R,this.G)&&(R.currentTarget===this.playButton.element?this.G.logClick(this.playButton.element):R.currentTarget===this.Z.pX("ytp-autonav-endscreen-link-container")&&(R=this.Z.pX("ytp-autonav-endscreen-link-container"),this.G.logVisibility(R,!0),this.G.logClick(R)),this.D?(this.G.KX("innertubeCommand",this.D),this.aA()):this.select())}; g.L.qm=function(){this.G.logClick(this.cancelButton.element);g.IE(this.G,!0);this.cancelCommand&&this.G.KX("innertubeCommand",this.cancelCommand)}; g.L.onVideoDataChange=function(R,l){Cy8(this,l);R=l.getWatchNextResponse();var y,f;R=(y=VjX(R))==null?void 0:(f=y.cancelButton)==null?void 0:f.buttonRenderer;this.cancelCommand=R==null?void 0:R.command}; g.L.dU7=function(R){if(Mj8(this)){var l=this.G.getVideoData().watchToWatchTransitionRenderer,y=l==null?void 0:l.fromColorPaletteDark;l=l==null?void 0:l.toColorPaletteDark;if(y&&l){var f=this.element;f.style.setProperty("--w2w-start-background-color",g.Il(y.surgeColor));f.style.setProperty("--w2w-start-primary-text-color",g.Il(y.primaryTitleColor));f.style.setProperty("--w2w-start-secondary-text-color",g.Il(y.secondaryTitleColor));f.style.setProperty("--w2w-end-background-color",g.Il(l.surgeColor)); f.style.setProperty("--w2w-end-primary-text-color",g.Il(l.primaryTitleColor));f.style.setProperty("--w2w-end-secondary-text-color",g.Il(l.secondaryTitleColor));f.style.setProperty("--w2w-animation-duration",R+"ms")}g.BJ(this.element,"ytp-w2w-animate",!0)}}; g.L.wb=function(R){this.G.C("web_autonav_color_transition")&&R!==2&&g.BJ(this.element,"ytp-w2w-animate",!1)}; g.L.QH=function(){var R=this.G.pJ();this.V&&this.m$!==R&&this.UF(R);sL(this);this.G.logVisibility(this.container.element,R);this.G.logVisibility(this.cancelButton.element,R);this.G.logVisibility(this.Z.pX("ytp-autonav-endscreen-link-container"),R);this.G.logVisibility(this.playButton.element,R)}; g.L.cf=function(R){return R.width<400||R.height<459};g.O(B1,g.Z);g.L=B1.prototype;g.L.create=function(){this.created=!0}; g.L.destroy=function(){this.created=!1}; g.L.l3=function(){return!1}; g.L.pJ=function(){return!1}; g.L.I1=function(){return!1};g.O(H1,g.Z);g.L=H1.prototype;g.L.ZI=function(){this.notification&&(this.Y.stop(),this.p_(this.L),this.L=null,this.notification.close(),this.notification=null)}; g.L.xp=function(R){this.suggestion=R;g.nq(this,R,"hqdefault.jpg")}; g.L.eE=function(){this.UF(this.api.pJ());this.api.logVisibility(this.element,this.api.pJ());this.api.logVisibility(this.pX("ytp-upnext-autoplay-icon"),this.api.pJ());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.pJ())}; g.L.V1S=function(){window.focus();this.ZI()}; g.L.Bi=function(R){var l=this;this.FM()||(g.yK("a11y-announce","A continuaci\u00f3n "+this.suggestion.title),this.X=(0,g.eY)(),this.Z=new g.Vg(function(){lQS(l,R)},25),lQS(this,R),gmU(this.api,RlK(this,R))); g.G8(this.element,"ytp-upnext-autoplay-paused")}; g.L.hide=function(){g.Z.prototype.hide.call(this)}; g.L.FM=function(){return!!this.Z}; g.L.eT=function(){this.aA();this.X=(0,g.eY)();lQS(this);g.AU(this.element,"ytp-upnext-autoplay-paused")}; g.L.aA=function(){this.FM()&&(this.Z.dispose(),this.Z=null)}; g.L.select=function(R){R=R===void 0?!1:R;if(this.api.U().C("autonav_notifications")&&R&&window.Notification&&typeof document.hasFocus==="function"){var l=Notification.permission;l==="default"?Notification.requestPermission():l!=="granted"||document.hasFocus()||(this.ZI(),this.notification=new Notification("A continuaci\u00f3n",{body:this.suggestion.title,icon:this.suggestion.I9()}),this.L=this.N(this.notification,"click",this.V1S),this.Y.start())}this.aA();this.api.nextVideo(!1,R)}; g.L.XV=function(R){!g.io(this.cancelButton.element,R.target)&&g.cV(R,this.api)&&(this.api.pJ()&&this.api.logClick(this.pX("ytp-upnext-autoplay-icon")),this.select())}; g.L.Zg=function(){this.api.pJ()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.IE(this.api,!0)}; g.L.eoq=function(R){this.api.getPresentingPlayerType();this.show();this.Bi(R)}; g.L.FjL=function(){this.api.getPresentingPlayerType();this.aA();this.hide()}; g.L.G4=function(){this.aA();this.ZI();g.Z.prototype.G4.call(this)};g.O(nt,B1);g.L=nt.prototype;g.L.create=function(){B1.prototype.create.call(this);this.Y.N(this.player,"appresize",this.aG);this.Y.N(this.player,"onVideoAreaChange",this.aG);this.Y.N(this.player,"videodatachange",this.onVideoDataChange);this.Y.N(this.player,"autonavchange",this.Fb);this.Y.N(this.player,"onAutonavCancelled",this.Lq);this.onVideoDataChange()}; g.L.show=function(){B1.prototype.show.call(this);(this.V||this.L&&this.L!==this.videoData.clientPlaybackNonce)&&g.IE(this.player,!1);g.DN(this.player)&&this.l3()&&!this.L?(mq(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3?this.Z.select(!0):this.Z.Bi():this.videoData.autonavState===3&&this.Z.eT()):(g.IE(this.player,!0),mq(this));this.aG()}; g.L.hide=function(){B1.prototype.hide.call(this);this.Z.eT();mq(this)}; g.L.aG=function(){var R=this.player.vQ(!0,this.player.isFullscreen());mq(this);sL(this.X);g.BJ(this.element,"ytp-autonav-cancelled-small-mode",this.cf(R));g.BJ(this.element,"ytp-autonav-cancelled-tiny-mode",this.j5(R));g.BJ(this.element,"ytp-autonav-cancelled-mini-mode",R.width<=400||R.height<=360);this.overlay&&g.Df(this.overlay.element,{width:R.width+"px"});if(!this.D)for(R=0;R0&&(R= h*4,E=l<=H-2&&n>=m*4;if((m+1)/h*f/G>G/(m/(h+1)*f)&&E)n-=m*4,l+=2;else if(c)n-=h*4,R+=2;else if(E)n-=m*4,l+=2;else break}f=!1;n>=12&&y*4-n<=6&&(l>=4||R>=4)&&(f=!0);n=R*96;B=l*54;G=n/B=R-2&&m>=l-2?E=1:m%2===0&&H%2===0&&(m<2&&H<2?m===0&&H===0&&(E=2):E=2),h=g.jq(h+this.L,y),E!==0){c=this.stills[G];c||(c=new c1(this.player),this.stills[G]=c,K.appendChild(c.element));var W=Math.floor(B*m/l),Q=Math.floor(n*H/R),e=Math.floor(B*(m+E)/l)-W-4,r=Math.floor(n*(H+E)/R)-Q-4;g.qh(c.element,Q,W);g.Rm(c.element,r,e);g.Df(c.element,"transitionDelay",(m+H)/20+"s");g.BJ(c.element,"ytp-videowall-still-mini", E===1);g.BJ(c.element,"ytp-videowall-still-large",E>2);E=Math.max(r,e);g.BJ(c.element,"ytp-videowall-still-round-large",E>=256);g.BJ(c.element,"ytp-videowall-still-round-medium",E>96&&E<256);g.BJ(c.element,"ytp-videowall-still-round-small",E<=96);h=A[h];c.suggestion!==h&&(c.suggestion=h,E=c.api.U(),W=g.fg(c.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",g.nq(c,h,W),g.kh(E)&&!c.api.C("web_player_log_click_before_generating_ve_conversion_params")&&(E=h.v6(),W={},g.OW(c.api,"addEmbedsConversionTrackingParams", [W]),E=g.L4(E,W),c.updateValue("url",E)),(h=(h=h.sessionData)&&h.itct)&&c.api.setTrackingParams(c.element,h));G++}K.ariaBusy="false";g.BJ(this.element,"ytp-endscreen-paginate",G=G;A--)R=this.stills[A],g.Ot(R.element),g.f_(R);this.stills.length=G}}; g.L.onVideoDataChange=function(){var R=this.player.getVideoData(1);this.videoData!==R&&(R!=null&&g.oY(R)?(this.L=0,this.videoData=R,this.pN()):this.player.T4("missg",{vid:(R==null?void 0:R.videoId)||"",cpn:(R==null?void 0:R.clientPlaybackNonce)||""}))}; g.L.GE=function(){this.L+=this.stills.length;this.pN()}; g.L.xR=function(){this.L-=this.stills.length;this.pN()}; g.L.I1=function(){return this.Z.FM()}; g.L.wM=function(R){R===1?(this.D=!1,this.Y=this.videoData.clientPlaybackNonce,this.Z.aA(),this.m$&&this.pN()):(this.D=!0,this.m$&&W1(this)&&(R===2?this.Z.Bi():R===3&&this.Z.eT()))}; g.L.Iy=function(R){if(R){for(R=0;R0||R.endSeconds>0||R.mutedAutoplayDurationMode!==2);if(this.player.isEmbedsShortsMode()&&!l)return!0;var y;var f=!!((R==null?0:g.oY(R))||(R==null?0:(y=R.suggestions)==null?0:y.length));f=!Kzt(this.player)||f;R=R.c6;y=this.player.q0();return f&&!R&&!y&&!l}; g.L.pJ=function(){return this.endScreen.pJ()}; g.L.DB=function(){return this.pJ()?this.endScreen.I1():!1}; g.L.G4=function(){this.player.yb("endscreen");g.Fc.prototype.G4.call(this)}; g.L.load=function(){var R=this.player.getVideoData();var l=R.transitionEndpointAtEndOfStream;if(l&&l.videoId){var y=this.player.Il().S_.get("heartbeat"),f=g.oY(R);!f||l.videoId!==f.videoId||R.TX?(this.player.MA(l.videoId,void 0,void 0,!0,!0,l),y&&y.kT("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),R=!0):R=!1}else R=!1;R||(g.Fc.prototype.load.call(this),this.endScreen.show())}; g.L.unload=function(){g.Fc.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.L.onCueRangeEnter=function(R){this.S9()&&(this.endScreen.created||this.endScreen.create(),R.getId()==="load"&&this.load())}; g.L.onCueRangeExit=function(R){R.getId()==="load"&&this.loaded&&this.unload()}; g.L.onVideoDataChange=function(){aQU(this);this.L&&GlX(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.Z?this.endScreen=new nt(this.player):this.endScreen=new EL(this.player),g.U(this,this.endScreen),g.kT(this.player,this.endScreen.element,4))};g.uR("endscreen",sRd);})(_yt_player);