(function(g){var window=this;'use strict';var Dv0=function(l,n){l.lF("onAutonavCoundownStarted",n)},q61=function(l){var n,O,L; return l==null?void 0:(n=l.playerOverlays)==null?void 0:(O=n.playerOverlayRenderer)==null?void 0:(L=O.autoplay)==null?void 0:L.playerOverlayAutoplayRenderer},od=function(l,n,O){g.wP(l.element,"ytp-suggestion-set",!!n.videoId); var L=n.playlistId;O=n.HG(O?O:"mqdefault.jpg");var X=null,F=null;n instanceof g.NW&&(n.lengthText?(X=n.lengthText||null,F=n.ub||null):n.lengthSeconds&&(X=g.k7(n.lengthSeconds),F=g.k7(n.lengthSeconds,!0)));var x=!!L;L=x&&g.Wy(L).type==="RD";var Z=n instanceof g.NW?n.isLivePlayback:null,J=n instanceof g.NW?n.isUpcoming:null,w=n.author,H=n.shortViewCount,A=n.publishedTimeText,b=[],r=[];w&&b.push(w);H&&(b.push(H),r.push(H));A&&r.push(A);O={title:n.title,author:w,author_and_views:b.join(" \u2022 "),aria_label:n.ariaLabel|| g.uN("Ver $TITLE",{TITLE:n.title}),duration:X,timestamp:F,url:n.XK(),is_live:Z,is_upcoming:J,is_list:x,is_mix:L,background:O?"background-image: url("+O+")":"",views_and_publish_time:r.join(" \u2022 "),autoplayAlternativeHeader:n.ek};n instanceof g.E7&&(O.playlist_length=n.playlistLength);l.update(O)},FM=function(l){var n=l.j(),O=n.L; g.f.call(this,{D:"a",X:"ytp-autonav-suggestion-card",Z:{href:"{{url}}",target:O?n.Y:"","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:[{D:"div",gq:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],Z:{style:"{{background}}"},K:[{D:"div",Z:{"aria-label":"{{timestamp}}"},gq:["ytp-autonav-timestamp"],hG:"{{duration}}"},{D:"div",gq:["ytp-autonav-live-stamp"],hG:"En vivo"}, {D:"div",gq:["ytp-autonav-upcoming-stamp"],hG:"Pr\u00f3ximamente"},{D:"div",X:"ytp-autonav-list-overlay",K:[{D:"div",X:"ytp-autonav-mix-text",hG:"Mix"},{D:"div",X:"ytp-autonav-mix-icon"}]}]},{D:"div",gq:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],hG:"{{title}}"},{D:"div",gq:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],hG:"{{author}}"},{D:"div",gq:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],hG:"{{views_and_publish_time}}"}]});this.C= l;this.suggestion=null;this.S=O;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},xh=function(l,n){n=n===void 0?!1:n; g.f.call(this,{D:"div",X:"ytp-autonav-endscreen-countdown-overlay"});var O=this;this.T=n;this.cancelCommand=this.V=void 0;this.N=0;this.container=new g.f({D:"div",X:"ytp-autonav-endscreen-countdown-container"});g.c(this,this.container);this.container.V5(this.element);n=l.j();var L=n.L;this.C=l;this.suggestion=null;this.onVideoDataChange("newdata",this.C.getVideoData());this.U(l,"videodatachange",this.onVideoDataChange);this.S=new g.f({D:"div",X:"ytp-autonav-endscreen-upnext-container",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}}"},K:[{D:"div",X:"ytp-autonav-endscreen-upnext-header"},{D:"div",X:"ytp-autonav-endscreen-upnext-alternative-header",hG:"{{autoplayAlternativeHeader}}"},{D:"a",X:"ytp-autonav-endscreen-link-container",Z:{href:"{{url}}",target:L?n.Y:""},K:[{D:"div",X:"ytp-autonav-endscreen-upnext-thumbnail",Z:{style:"{{background}}"},K:[{D:"div",Z:{"aria-label":"{{timestamp}}"},gq:["ytp-autonav-timestamp"], hG:"{{duration}}"},{D:"div",gq:["ytp-autonav-live-stamp"],hG:"En vivo"},{D:"div",gq:["ytp-autonav-upcoming-stamp"],hG:"Pr\u00f3ximamente"}]},{D:"div",X:"ytp-autonav-endscreen-video-info",K:[{D:"div",X:"ytp-autonav-endscreen-premium-badge"},{D:"div",X:"ytp-autonav-endscreen-upnext-title",hG:"{{title}}"},{D:"div",X:"ytp-autonav-endscreen-upnext-author",hG:"{{author}}"},{D:"div",X:"ytp-autonav-view-and-date",hG:"{{views_and_publish_time}}"},{D:"div",X:"ytp-autonav-author-and-view",hG:"{{author_and_views}}"}]}]}]}); g.c(this,this.S);this.S.V5(this.container.element);L||this.U(this.S.mJ("ytp-autonav-endscreen-link-container"),"click",this.E0);this.C.createClientVe(this.container.element,this,115127);this.C.createClientVe(this.S.mJ("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.f({D:"div",X:"ytp-autonav-overlay"});g.c(this,this.overlay);this.overlay.V5(this.container.element);this.W=new g.f({D:"div",X:"ytp-autonav-endscreen-button-container"});g.c(this,this.W);this.W.V5(this.container.element); this.cancelButton=new g.f({D:"button",gq:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",n.J("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],Z:{"aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},hG:"Cancelar"});g.c(this,this.cancelButton);this.cancelButton.V5(this.W.element);this.cancelButton.listen("click",this.XZ,this);this.C.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.f({D:"a",gq:["ytp-autonav-endscreen-upnext-button", "ytp-autonav-endscreen-upnext-play-button",n.J("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],Z:{href:"{{url}}",role:"button","aria-label":"Reproducir siguiente video"},hG:"Reproducir ahora"});g.c(this,this.playButton);this.playButton.V5(this.W.element);this.playButton.listen("click",this.E0,this);this.C.createServerVe(this.playButton.element,this.playButton,!0);(n=this.C.getVideoData())&&ke1(this,n);this.L=new g.vs(function(){yoO(O)},500); g.c(this,this.L);this.zZ();this.U(l,"autonavvisibility",this.zZ);this.C.J("web_autonav_color_transition")&&(this.U(l,"autonavchange",this.iz),this.U(l,"onAutonavCoundownStarted",this.fe3))},hD=function(l){var n=l.C.FC(!0,l.C.isFullscreen()); g.wP(l.container.element,"ytp-autonav-endscreen-small-mode",l.Rp(n));g.wP(l.container.element,"ytp-autonav-endscreen-is-premium",!!l.suggestion&&!!l.suggestion.chG);g.wP(l.C.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!l.C.oR());g.wP(l.C.getRootNode(),"countdown-running",l.j0());g.wP(l.container.element,"ytp-player-content",l.C.oR());g.HH(l.overlay.element,{width:n.width+"px"});if(!l.j0()){l.C.oR()?MjR(l,Math.round(QhF(l)/1E3)):MjR(l);n=!!l.suggestion&&!!l.suggestion.ek;var O=l.C.oR()|| !n;g.wP(l.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!O&&n);g.wP(l.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",O&&!n);l.W.vk(l.C.oR());g.wP(l.element,"ytp-enable-w2w-color-transitions",e7c(l))}},yoO=function(l){var n=QhF(l),O=Math,L=O.min; var X=l.N?Date.now()-l.N:0;O=L.call(O,X,n);MjR(l,Math.ceil((n-O)/1E3));n-O<=500&&l.j0()?l.select(!0):l.j0()&&l.L.start()},QhF=function(l){if(l.C.isFullscreen()){var n; l=(n=l.C.getVideoData())==null?void 0:n.Q2;return l===-1||l===void 0?8E3:l}return l.C.iG()>=0?l.C.iG():g.HQ(l.C.j().experiments,"autoplay_time")||1E4},ke1=function(l,n){n=n.getWatchNextResponse(); var O,L;n=(O=q61(n))==null?void 0:(L=O.nextButton)==null?void 0:L.buttonRenderer;l.V=n==null?void 0:n.navigationEndpoint;O=n==null?void 0:n.trackingParams;l.playButton&&O&&l.C.setTrackingParams(l.playButton.element,O)},e7c=function(l){var n; return!((n=l.C.getVideoData())==null||!n.watchToWatchTransitionRenderer)},MjR=function(l,n){n=n===void 0?-1:n; l=l.S.mJ("ytp-autonav-endscreen-upnext-header");g.Lf(l);if(n>=0){n=String(n);var O="A continuaci\u00f3n, en $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],L="A continuaci\u00f3n, en $SECONDS".indexOf(O);if(L>=0){l.appendChild(g.ON("A continuaci\u00f3n, en $SECONDS".slice(0,L)));var X=g.nf("span");g.XW(X,"ytp-autonav-endscreen-upnext-header-countdown-number");g.xQ(X,n);l.appendChild(X);l.appendChild(g.ON("A continuaci\u00f3n, en $SECONDS".slice(L+O.length)));return}}g.xQ(l,"A continuaci\u00f3n")},Zm= function(l,n){g.f.call(this,{D:"div", gq:["html5-endscreen","ytp-player-content",n||"base-endscreen"]});this.created=!1;this.player=l},JD=function(l){g.f.call(this,{D:"div", gq:["ytp-upnext","ytp-player-content"],Z:{"aria-label":"{{aria_label}}"},K:[{D:"div",X:"ytp-cued-thumbnail-overlay-image",Z:{style:"{{background}}"}},{D:"span",X:"ytp-upnext-top",K:[{D:"span",X:"ytp-upnext-header",hG:"A continuaci\u00f3n"},{D:"span",X:"ytp-upnext-title",hG:"{{title}}"},{D:"span",X:"ytp-upnext-author",hG:"{{author}}"}]},{D:"a",X:"ytp-upnext-autoplay-icon",Z:{role:"button",href:"{{url}}","aria-label":"Reproducir siguiente video"},K:[{D:"svg",Z:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},K:[{D:"circle",X:"ytp-svg-autoplay-circle",Z:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{D:"circle",X:"ytp-svg-autoplay-ring",Z:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{D:"path",X:"ytp-svg-fill",Z:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{D:"span",X:"ytp-upnext-bottom",K:[{D:"span",X:"ytp-upnext-cancel"},{D:"span",X:"ytp-upnext-paused", hG:"La reproducci\u00f3n autom\u00e1tica est\u00e1 en pausa"}]}]});this.api=l;this.cancelButton=null;this.V=this.mJ("ytp-svg-autoplay-ring");this.N=this.notification=this.S=this.suggestion=null;this.L=new g.vs(this.Pr,5E3,this);this.W=0;var n=this.mJ("ytp-upnext-cancel");this.cancelButton=new g.f({D:"button",gq:["ytp-upnext-cancel-button","ytp-button"],Z:{tabindex:"0","aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},hG:"Cancelar"});g.c(this,this.cancelButton);this.cancelButton.listen("click", this.yv,this);this.cancelButton.V5(n);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.c(this,this.L);this.api.createClientVe(this.element,this,18788);n=this.mJ("ytp-upnext-autoplay-icon");this.U(n,"click",this.FZ);this.api.createClientVe(n,this,115130);this.w1();this.U(l,"autonavvisibility",this.w1);this.U(l,"mdxnowautoplaying",this.yCi);this.U(l,"mdxautoplaycanceled",this.FeF);g.wP(this.element,"ytp-upnext-mobile",this.api.j().W)},Y6q=function(l,n){if(n)return n; if(l.api.isFullscreen()){var O;l=(O=l.api.getVideoData())==null?void 0:O.Q2;return l===-1||l===void 0?8E3:l}return l.api.iG()>=0?l.api.iG():g.HQ(l.api.j().experiments,"autoplay_time")||1E4},jhi=function(l,n){n=Y6q(l,n); var O=Math,L=O.min;var X=(0,g.Q_)()-l.W;O=L.call(O,X,n);n=n===0?1:Math.min(O/n,1);l.V.setAttribute("stroke-dashoffset",""+-211*(n+1));n>=1&&l.j0()&&l.api.getPresentingPlayerType()!==3?l.select(!0):l.j0()&&l.S.start()},wp=function(l){Zm.call(this,l,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.f({D:"div",X:"ytp-suggestion-panel",K:[{D:"div",gq:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],hG:"M\u00e1s videos"}]});this.G=new g.f({D:"div",X:"ytp-suggestions-container"});this.videos=[];this.N=null;this.V=this.T=!1;this.W=new xh(this.player);g.c(this,this.W);this.W.V5(this.element);l.getVideoData().Zx?this.S=this.W:(this.S=new JD(l),g.jR(this.player,this.S.element,4),g.c(this,this.S));this.overlay=new g.f({D:"div", X:"ytp-autonav-overlay-cancelled-state"});g.c(this,this.overlay);this.overlay.V5(this.element);this.L=new g.$B(this);g.c(this,this.L);g.c(this,this.table);this.table.V5(this.element);this.table.show();g.c(this,this.G);this.G.V5(this.table.element);this.hide()},Hc=function(l){var n=l.oR(); n!==l.V&&(l.V=n,l.player.publish("autonavvisibility"),l.V?(l.W!==l.S&&l.W.hide(),l.table.hide()):(l.W!==l.S&&l.W.show(),l.table.show()))},AD=function(l,n){g.f.call(this,{D:"button", gq:["ytp-watch-on-youtube-button","ytp-button"],hG:"{{content}}"});this.C=l;this.buttonType=this.buttonType=n;this.WC();this.buttonType===2&&g.FW(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.WC);this.vk(!0)},bS=function(l,n){Zm.call(this,l,"embeds-lite-endscreen"); this.C=l;this.S=n;this.C.createClientVe(this.element,this,156943);this.watchButton=new AD(l,2);g.c(this,this.watchButton);this.watchButton.V5(this.element);this.hide()},Geq=function(l){Zm.call(this,l,"subscribecard-endscreen"); this.S=new g.f({D:"div",X:"ytp-subscribe-card",K:[{D:"img",X:"ytp-author-image",Z:{src:"{{profilePicture}}"}},{D:"div",X:"ytp-subscribe-card-right",K:[{D:"div",X:"ytp-author-name",hG:"{{author}}"},{D:"div",X:"html5-subscribe-button-container"}]}]});g.c(this,this.S);this.S.V5(this.element);var n=l.getVideoData();this.subscribeButton=new g.oX("Suscribirse",null,"Anular suscripci\u00f3n",null,!0,!1,n.dJ,n.subscribed,"trailer-endscreen",null,l,!1);g.c(this,this.subscribeButton);this.subscribeButton.V5(this.S.mJ("html5-subscribe-button-container")); this.U(l,"videodatachange",this.y5);this.y5();this.hide()},rp=function(l){var n=l.j(),O=g.G2||g.qt?{style:"will-change: opacity"}:void 0,L=n.L,X=["ytp-videowall-still"]; n.W&&X.push("ytp-videowall-show-text");g.f.call(this,{D:"a",gq:X,Z:{href:"{{url}}",target:L?n.Y:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},K:[{D:"div",X:"ytp-videowall-still-image",Z:{style:"{{background}}"}},{D:"span",X:"ytp-videowall-still-info",Z:{"aria-hidden":"true"},K:[{D:"span",X:"ytp-videowall-still-info-bg",K:[{D:"span",X:"ytp-videowall-still-info-content",Z:O,K:[{D:"span",X:"ytp-videowall-still-info-title",hG:"{{title}}"}, {D:"span",X:"ytp-videowall-still-info-author",hG:"{{author_and_views}}"},{D:"span",X:"ytp-videowall-still-info-live",hG:"En vivo"},{D:"span",X:"ytp-videowall-still-info-duration",hG:"{{duration}}"}]}]}]},{D:"span",gq:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],Z:{"aria-hidden":"true"},K:[{D:"span",X:"ytp-videowall-still-listlabel-icon"},"Playlist",{D:"span",X:"ytp-videowall-still-listlabel-length",K:[" (",{D:"span",hG:"{{playlist_length}}"},")"]}]},{D:"span",gq:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],Z:{"aria-hidden":"true"},K:[{D:"span",X:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{D:"span",X:"ytp-videowall-still-listlabel-length",hG:" (50+)"}]}]});this.suggestion=null;this.W=L;this.api=l;this.S=new g.$B(this);g.c(this,this.S);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.S.U(l,"videodatachange",this.onVideoDataChange);l.createServerVe(this.element,this);this.onVideoDataChange()},Uq=function(l){Zm.call(this,l,"videowall-endscreen"); var n=this;this.C=l;this.N=0;this.stills=[];this.L=this.videoData=null;this.V=this.G=!1;this.Y=null;this.W=new g.$B(this);g.c(this,this.W);this.T=new g.vs(function(){g.FW(n.element,"ytp-show-tiles")},0); g.c(this,this.T);var O=new g.f({D:"button",gq:["ytp-button","ytp-endscreen-previous"],Z:{"aria-label":"Anterior"},K:[g.T5()]});g.c(this,O);O.V5(this.element);O.listen("click",this.je,this);this.table=new g.Jj({D:"div",X:"ytp-endscreen-content"});g.c(this,this.table);this.table.V5(this.element);O=new g.f({D:"button",gq:["ytp-button","ytp-endscreen-next"],Z:{"aria-label":"Siguiente"},K:[g.Wr()]});g.c(this,O);O.V5(this.element);O.listen("click",this.A_,this);l.getVideoData().Zx?this.S=new xh(l,!0):this.S= new JD(l);g.c(this,this.S);g.jR(this.player,this.S.element,4);l.createClientVe(this.element,this,158789);this.hide()},uS=function(l){return g.GM(l.player)&&l.fh()&&!l.L},Pc=function(l){var n=l.oR(); n!==l.G&&(l.G=n,l.player.publish("autonavvisibility"))},TD=function(l){Zm.call(this,l,"watch-again-on-youtube-endscreen"); this.watchButton=new AD(l,1);g.c(this,this.watchButton);this.watchButton.V5(this.element);g.Idi(l)&&(this.S=new g.Rs(l),g.c(this,this.S),this.W=new g.f({D:"div",gq:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],Z:{tabIndex:"-1"},K:[this.S]}),g.c(this,this.W),this.S.V5(this.W.element),this.W.V5(this.element));l.createClientVe(this.element,this,156914);this.hide()},$vL=function(l){g.qq.call(this,l); var n=this;this.endScreen=null;this.W=this.S=this.N=this.L=!1;this.listeners=new g.$B(this);g.c(this,this.listeners);var O=l.j(),L=l.getVideoData();L=L&&L.limitedPlaybackDurationInSeconds!==0;g.JB(g.dn(O))&&L&&!g.Mc(l)?(this.W=!0,this.endScreen=new bS(l,g.AA(l))):l.isEmbedsShortsMode()?this.endScreen=new TD(l):mvs(l)?(this.L=!0,IGF(this),this.S?this.endScreen=new wp(l):this.endScreen=new Uq(l)):O.Zx?this.endScreen=new Geq(l):this.endScreen=new Zm(l);g.c(this,this.endScreen);g.jR(l,this.endScreen.element, 4);dvQ(this);this.listeners.U(l,"videodatachange",this.onVideoDataChange,this);this.listeners.U(l,g.F4("endscreen"),function(X){n.onCueRangeEnter(X)}); this.listeners.U(l,g.xx("endscreen"),function(X){n.onCueRangeExit(X)})},IGF=function(l){var n=l.player.getVideoData(); if(!n||l.S===n.dA&&l.N===n.Zx)return!1;l.S=n.dA;l.N=n.Zx;return!0},mvs=function(l){l=l.j(); return l.M5&&!l.Zx&&!l.disableOrganicUi},dvQ=function(l){l.player.cS("endscreen"); var n=l.player.getVideoData();n=new g.X4(Math.max((n.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var O=new g.X4(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});l.player.RA([n,O])}; g.DQ.prototype.iG=g.g9(14,function(){return this.app.iG()}); g.PB.prototype.iG=g.g9(13,function(){return this.getVideoData().eL}); g.TM.prototype.jC=g.g9(12,function(l){this.Fx().jC(l)}); g.N2.prototype.jC=g.g9(11,function(l){this.S!==l&&(this.S=l,this.y5())}); g.mm.prototype.jC=g.g9(10,function(l){this.overflowButton&&this.overflowButton.jC(l)}); g.TM.prototype.p8=g.g9(9,function(l){this.Fx().p8(l)}); g.M2.prototype.p8=g.g9(8,function(l){this.W!==l&&(this.W=l,this.y5())}); g.mm.prototype.p8=g.g9(7,function(l){this.shareButton&&this.shareButton.p8(l)}); g.TM.prototype.GJ=g.g9(6,function(l){this.Fx().GJ(l)}); g.tx.prototype.GJ=g.g9(5,function(l){this.Mh!==l&&(this.Mh=l,this.Qz())}); g.TM.prototype.Iv=g.g9(4,function(l){this.Fx().Iv(l)}); g.mm.prototype.Iv=g.g9(3,function(l){this.K_!==l&&(this.K_=l,this.eN())});g.u(FM,g.f);FM.prototype.select=function(){this.C.iI(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.EF||void 0)&&this.C.logClick(this.element)}; FM.prototype.onClick=function(l){g.gk(l,this.C,this.S,this.suggestion.sessionData||void 0)&&this.select()}; FM.prototype.onKeyPress=function(l){switch(l.keyCode){case 13:case 32:l.defaultPrevented||(this.select(),l.preventDefault())}};g.u(xh,g.f);g.h=xh.prototype;g.h.IY=function(l){this.suggestion!==l&&(this.suggestion=l,od(this.S,l),this.playButton.updateValue("url",this.suggestion.XK()),hD(this))}; g.h.j0=function(){return this.N>0}; g.h.YK=function(){this.j0()||(this.N=Date.now(),yoO(this),Dv0(this.C,QhF(this)),g.wP(this.C.getRootNode(),"countdown-running",this.j0()))}; g.h.yJ=function(){this.uS();yoO(this);var l=this.S.mJ("ytp-autonav-endscreen-upnext-header");l&&g.xQ(l,"A continuaci\u00f3n")}; g.h.uS=function(){this.j0()&&(this.L.stop(),this.N=0)}; g.h.select=function(l){this.C.nextVideo(!1,l===void 0?!1:l);this.uS()}; g.h.E0=function(l){g.gk(l,this.C)&&(l.currentTarget===this.playButton.element?this.C.logClick(this.playButton.element):l.currentTarget===this.S.mJ("ytp-autonav-endscreen-link-container")&&(l=this.S.mJ("ytp-autonav-endscreen-link-container"),this.C.logVisibility(l,!0),this.C.logClick(l)),this.V?(this.C.lF("innertubeCommand",this.V),this.uS()):this.select())}; g.h.XZ=function(){this.C.logClick(this.cancelButton.element);g.kA(this.C,!0);this.cancelCommand&&this.C.lF("innertubeCommand",this.cancelCommand)}; g.h.onVideoDataChange=function(l,n){ke1(this,n);l=n.getWatchNextResponse();var O,L;l=(O=q61(l))==null?void 0:(L=O.cancelButton)==null?void 0:L.buttonRenderer;this.cancelCommand=l==null?void 0:l.command}; g.h.fe3=function(l){if(e7c(this)){var n=this.C.getVideoData().watchToWatchTransitionRenderer,O=n==null?void 0:n.fromColorPaletteDark;n=n==null?void 0:n.toColorPaletteDark;if(O&&n){var L=this.element;L.style.setProperty("--w2w-start-background-color",g.ir(O.surgeColor));L.style.setProperty("--w2w-start-primary-text-color",g.ir(O.primaryTitleColor));L.style.setProperty("--w2w-start-secondary-text-color",g.ir(O.secondaryTitleColor));L.style.setProperty("--w2w-end-background-color",g.ir(n.surgeColor)); L.style.setProperty("--w2w-end-primary-text-color",g.ir(n.primaryTitleColor));L.style.setProperty("--w2w-end-secondary-text-color",g.ir(n.secondaryTitleColor));L.style.setProperty("--w2w-animation-duration",l+"ms")}g.wP(this.element,"ytp-w2w-animate",!0)}}; g.h.iz=function(l){this.C.J("web_autonav_color_transition")&&l!==2&&g.wP(this.element,"ytp-w2w-animate",!1)}; g.h.zZ=function(){var l=this.C.oR();this.T&&this.Qp!==l&&this.vk(l);hD(this);this.C.logVisibility(this.container.element,l);this.C.logVisibility(this.cancelButton.element,l);this.C.logVisibility(this.S.mJ("ytp-autonav-endscreen-link-container"),l);this.C.logVisibility(this.playButton.element,l)}; g.h.Rp=function(l){return l.width<400||l.height<459};g.u(Zm,g.f);g.h=Zm.prototype;g.h.create=function(){this.created=!0}; g.h.destroy=function(){this.created=!1}; g.h.fh=function(){return!1}; g.h.oR=function(){return!1}; g.h.b6=function(){return!1};g.u(JD,g.f);g.h=JD.prototype;g.h.Pr=function(){this.notification&&(this.L.stop(),this.EC(this.N),this.N=null,this.notification.close(),this.notification=null)}; g.h.IY=function(l){this.suggestion=l;od(this,l,"hqdefault.jpg")}; g.h.w1=function(){this.vk(this.api.oR());this.api.logVisibility(this.element,this.api.oR());this.api.logVisibility(this.mJ("ytp-upnext-autoplay-icon"),this.api.oR());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.oR())}; g.h.G22=function(){window.focus();this.Pr()}; g.h.YK=function(l){var n=this;this.j0()||(g.hs("a11y-announce","A continuaci\u00f3n "+this.suggestion.title),this.W=(0,g.Q_)(),this.S=new g.vs(function(){jhi(n,l)},25),jhi(this,l),Dv0(this.api,Y6q(this,l))); g.ZW(this.element,"ytp-upnext-autoplay-paused")}; g.h.hide=function(){g.f.prototype.hide.call(this)}; g.h.j0=function(){return!!this.S}; g.h.yJ=function(){this.uS();this.W=(0,g.Q_)();jhi(this);g.FW(this.element,"ytp-upnext-autoplay-paused")}; g.h.uS=function(){this.j0()&&(this.S.dispose(),this.S=null)}; g.h.select=function(l){l=l===void 0?!1:l;if(this.api.j().J("autonav_notifications")&&l&&window.Notification&&typeof document.hasFocus==="function"){var n=Notification.permission;n==="default"?Notification.requestPermission():n!=="granted"||document.hasFocus()||(this.Pr(),this.notification=new Notification("A continuaci\u00f3n",{body:this.suggestion.title,icon:this.suggestion.HG()}),this.N=this.U(this.notification,"click",this.G22),this.L.start())}this.uS();this.api.nextVideo(!1,l)}; g.h.FZ=function(l){!g.Fg(this.cancelButton.element,l.target)&&g.gk(l,this.api)&&(this.api.oR()&&this.api.logClick(this.mJ("ytp-upnext-autoplay-icon")),this.select())}; g.h.yv=function(){this.api.oR()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.kA(this.api,!0)}; g.h.yCi=function(l){this.api.getPresentingPlayerType();this.show();this.YK(l)}; g.h.FeF=function(){this.api.getPresentingPlayerType();this.uS();this.hide()}; g.h.oz=function(){this.uS();this.Pr();g.f.prototype.oz.call(this)};g.u(wp,Zm);g.h=wp.prototype;g.h.create=function(){Zm.prototype.create.call(this);this.L.U(this.player,"appresize",this.Fh);this.L.U(this.player,"onVideoAreaChange",this.Fh);this.L.U(this.player,"videodatachange",this.onVideoDataChange);this.L.U(this.player,"autonavchange",this.TZ);this.L.U(this.player,"onAutonavCancelled",this.P2);this.onVideoDataChange()}; g.h.show=function(){Zm.prototype.show.call(this);(this.T||this.N&&this.N!==this.videoData.clientPlaybackNonce)&&g.kA(this.player,!1);g.GM(this.player)&&this.fh()&&!this.N?(Hc(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3?this.S.select(!0):this.S.YK():this.videoData.autonavState===3&&this.S.yJ()):(g.kA(this.player,!0),Hc(this));this.Fh()}; g.h.hide=function(){Zm.prototype.hide.call(this);this.S.yJ();Hc(this)}; g.h.Fh=function(){var l=this.player.FC(!0,this.player.isFullscreen());Hc(this);hD(this.W);g.wP(this.element,"ytp-autonav-cancelled-small-mode",this.Rp(l));g.wP(this.element,"ytp-autonav-cancelled-tiny-mode",this.Ju(l));g.wP(this.element,"ytp-autonav-cancelled-mini-mode",l.width<=400||l.height<=360);this.overlay&&g.HH(this.overlay.element,{width:l.width+"px"});if(!this.V)for(l=0;l0&&(l= A*4,r=n<=J-2&&w>=H*4;if((H+1)/A*L/x>x/(H/(A+1)*L)&&r)w-=H*4,n+=2;else if(b)w-=A*4,l+=2;else if(r)w-=H*4,n+=2;else break}L=!1;w>=12&&O*4-w<=6&&(n>=4||l>=4)&&(L=!0);w=l*96;Z=n*54;x=w/Z=l-2&&H>=n-2?r=1:H%2===0&&J%2===0&&(H<2&&J<2?H===0&&J===0&&(r=2):r=2),A=g.ZF(A+this.N,O),r!==0){b=this.stills[x];b||(b=new rp(this.player),this.stills[x]=b,F.appendChild(b.element));var U=Math.floor(Z*H/n),W=Math.floor(w*J/l),N=Math.floor(Z*(H+r)/n)-U-4,q=Math.floor(w*(J+r)/l)-W-4;g.PH(b.element,W,U);g.N4(b.element,q,N);g.HH(b.element,"transitionDelay",(H+J)/20+"s");g.wP(b.element,"ytp-videowall-still-mini", r===1);g.wP(b.element,"ytp-videowall-still-large",r>2);r=Math.max(q,N);g.wP(b.element,"ytp-videowall-still-round-large",r>=256);g.wP(b.element,"ytp-videowall-still-round-medium",r>96&&r<256);g.wP(b.element,"ytp-videowall-still-round-small",r<=96);A=X[A];b.suggestion!==A&&(b.suggestion=A,r=b.api.j(),U=g.oK(b.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",od(b,A,U),g.yG(r)&&!b.api.J("web_player_log_click_before_generating_ve_conversion_params")&&(r=A.XK(),U={},g.hA(b.api,"addEmbedsConversionTrackingParams", [U]),r=g.pr(r,U),b.updateValue("url",r)),(A=(A=A.sessionData)&&A.itct)&&b.api.setTrackingParams(b.element,A));x++}F.ariaBusy="false";g.wP(this.element,"ytp-endscreen-paginate",x=x;X--)l=this.stills[X],g.og(l.element),g.h0(l);this.stills.length=x}}; g.h.onVideoDataChange=function(){var l=this.player.getVideoData(1);this.videoData!==l&&(l!=null&&g.t2(l)?(this.N=0,this.videoData=l,this.Hd()):this.player.Sp("missg",{vid:(l==null?void 0:l.videoId)||"",cpn:(l==null?void 0:l.clientPlaybackNonce)||""}))}; g.h.A_=function(){this.N+=this.stills.length;this.Hd()}; g.h.je=function(){this.N-=this.stills.length;this.Hd()}; g.h.b6=function(){return this.S.j0()}; g.h.c7=function(l){l===1?(this.V=!1,this.L=this.videoData.clientPlaybackNonce,this.S.uS(),this.Qp&&this.Hd()):(this.V=!0,this.Qp&&uS(this)&&(l===2?this.S.YK():l===3&&this.S.yJ()))}; g.h.U2=function(l){if(l){for(l=0;l0||l.endSeconds>0||l.mutedAutoplayDurationMode!==2):l.mutedAutoplay;if((this.player.isEmbedsShortsMode()||this.W)&&!n)return!0;var O;var L=!!((l==null?0:g.t2(l))||(l==null?0:(O=l.suggestions)==null?0:O.length));L=!mvs(this.player)||L;l=l.S5;O=this.player.IT();return L&&!l&&!O&&!n}; g.h.oR=function(){return this.endScreen.oR()}; g.h.FJf=function(){return this.oR()?this.endScreen.b6():!1}; g.h.oz=function(){this.player.cS("endscreen");g.qq.prototype.oz.call(this)}; g.h.load=function(){var l=this.player.getVideoData();var n=l.transitionEndpointAtEndOfStream;if(n&&n.videoId){var O=this.player.dc().ri.get("heartbeat"),L=g.t2(l);!L||n.videoId!==L.videoId||l.Q3?(this.player.iI(n.videoId,void 0,void 0,!0,!0,n),O&&O.j8("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),l=!0):l=!1}else l=!1;l||(g.qq.prototype.load.call(this),this.endScreen.show())}; g.h.unload=function(){g.qq.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.h.onCueRangeEnter=function(l){this.AD()&&(this.endScreen.created||this.endScreen.create(),l.getId()==="load"&&this.load())}; g.h.onCueRangeExit=function(l){l.getId()==="load"&&this.loaded&&this.unload()}; g.h.onVideoDataChange=function(){dvQ(this);this.L&&IGF(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.S?this.endScreen=new wp(this.player):this.endScreen=new Uq(this.player),g.c(this,this.endScreen),g.jR(this.player,this.endScreen.element,4))};g.Dq("endscreen",$vL);})(_yt_player);