(function(g){var window=this;'use strict';var knT=function(n){n.publish("autonavvisibility")},bqS=function(n,q){n.Km("onAutonavCoundownStarted",q)},d8F=function(n){var q,M,t; return n==null?void 0:(q=n.playerOverlays)==null?void 0:(M=q.playerOverlayRenderer)==null?void 0:(t=M.autoplay)==null?void 0:t.playerOverlayAutoplayRenderer},YU=function(n){var q=n.T(),M=q.J; g.w.call(this,{j:"a",Y:"ytp-autonav-suggestion-card",K:{href:"{{url}}",target:M?q.U:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},L:[{j:"div",aL:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],K:{style:"{{background}}"},L:[{j:"div",K:{"aria-label":"{{timestamp}}"},aL:["ytp-autonav-timestamp"],Wb:"{{duration}}"},{j:"div",aL:["ytp-autonav-live-stamp"],Wb:"En vivo"}, {j:"div",aL:["ytp-autonav-upcoming-stamp"],Wb:"Pr\u00f3ximamente"},{j:"div",Y:"ytp-autonav-list-overlay",L:[{j:"div",Y:"ytp-autonav-mix-text",Wb:"Mix"},{j:"div",Y:"ytp-autonav-mix-icon"}]}]},{j:"div",aL:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],Wb:"{{title}}"},{j:"div",aL:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],Wb:"{{author}}"},{j:"div",aL:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],Wb:"{{views_and_publish_time}}"}]});this.G= n;this.suggestion=null;this.X=M;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},GA=function(n,q){q=q===void 0?!1:q; g.w.call(this,{j:"div",Y:"ytp-autonav-endscreen-countdown-overlay"});var M=this;this.C=q;this.cancelCommand=this.S=void 0;this.Z=0;this.container=new g.w({j:"div",Y:"ytp-autonav-endscreen-countdown-container"});g.Z(this,this.container);this.container.dJ(this.element);q=n.T();var t=q.J;this.G=n;this.suggestion=null;this.onVideoDataChange("newdata",this.G.getVideoData());this.V(n,"videodatachange",this.onVideoDataChange);this.X=new g.w({j:"div",Y:"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}}"},L:[{j:"div",Y:"ytp-autonav-endscreen-upnext-header"},{j:"div",Y:"ytp-autonav-endscreen-upnext-alternative-header",Wb:"{{autoplayAlternativeHeader}}"},{j:"a",Y:"ytp-autonav-endscreen-link-container",K:{href:"{{url}}",target:t?q.U:""},L:[{j:"div",Y:"ytp-autonav-endscreen-upnext-thumbnail",K:{style:"{{background}}"},L:[{j:"div",K:{"aria-label":"{{timestamp}}"},aL:["ytp-autonav-timestamp"], Wb:"{{duration}}"},{j:"div",aL:["ytp-autonav-live-stamp"],Wb:"En vivo"},{j:"div",aL:["ytp-autonav-upcoming-stamp"],Wb:"Pr\u00f3ximamente"}]},{j:"div",Y:"ytp-autonav-endscreen-video-info",L:[{j:"div",Y:"ytp-autonav-endscreen-premium-badge"},{j:"div",Y:"ytp-autonav-endscreen-upnext-title",Wb:"{{title}}"},{j:"div",Y:"ytp-autonav-endscreen-upnext-author",Wb:"{{author}}"},{j:"div",Y:"ytp-autonav-view-and-date",Wb:"{{views_and_publish_time}}"},{j:"div",Y:"ytp-autonav-author-and-view",Wb:"{{author_and_views}}"}]}]}]}); g.Z(this,this.X);this.X.dJ(this.container.element);t||this.V(this.X.JE("ytp-autonav-endscreen-link-container"),"click",this.j1);this.G.createClientVe(this.container.element,this,115127);this.G.createClientVe(this.X.JE("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.w({j:"div",Y:"ytp-autonav-overlay"});g.Z(this,this.overlay);this.overlay.dJ(this.container.element);this.W=new g.w({j:"div",Y:"ytp-autonav-endscreen-button-container"});g.Z(this,this.W);this.W.dJ(this.container.element); this.cancelButton=new g.w({j:"button",aL:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",q.D("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],K:{"aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},Wb:"Cancelar"});g.Z(this,this.cancelButton);this.cancelButton.dJ(this.W.element);this.cancelButton.listen("click",this.gX,this);this.G.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.w({j:"a",aL:["ytp-autonav-endscreen-upnext-button", "ytp-autonav-endscreen-upnext-play-button",q.D("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],K:{href:"{{url}}",role:"button","aria-label":"Reproducir siguiente video"},Wb:"Reproducir ahora"});g.Z(this,this.playButton);this.playButton.dJ(this.W.element);this.playButton.listen("click",this.j1,this);this.G.createServerVe(this.playButton.element,this.playButton,!0);(q=this.G.getVideoData())&&N4O(this,q);this.J=new g.zw(function(){Oqn(M)},500); g.Z(this,this.J);this.F0();this.V(n,"autonavvisibility",this.F0);this.G.D("web_autonav_color_transition")&&(this.V(n,"autonavchange",this.dX),this.V(n,"onAutonavCoundownStarted",this.gim))},KR=function(n){var q=n.G.PR(!0,n.G.isFullscreen()); g.Yi(n.container.element,"ytp-autonav-endscreen-small-mode",n.Qr(q));g.Yi(n.container.element,"ytp-autonav-endscreen-is-premium",!!n.suggestion&&!!n.suggestion.VYt);g.Yi(n.G.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!n.G.G0());g.Yi(n.G.getRootNode(),"countdown-running",n.tP());g.Yi(n.container.element,"ytp-player-content",n.G.G0());g.wK(n.overlay.element,{width:q.width+"px"});if(!n.tP()){n.G.G0()?gFA(n,Math.round(eFS(n)/1E3)):gFA(n);q=!!n.suggestion&&!!n.suggestion.wR;var M=n.G.G0()|| !q;g.Yi(n.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!M&&q);g.Yi(n.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",M&&!q);n.W.VS(n.G.G0());g.Yi(n.element,"ytp-enable-w2w-color-transitions",EFL(n))}},Oqn=function(n){var q=eFS(n),M=Math,t=M.min; var c=n.Z?Date.now()-n.Z:0;M=t.call(M,c,q);gFA(n,Math.ceil((q-M)/1E3));q-M<=500&&n.tP()?n.select(!0):n.tP()&&n.J.start()},eFS=function(n){if(n.G.isFullscreen()){var q; n=(q=n.G.getVideoData())==null?void 0:q.eF;return n===-1||n===void 0?8E3:n}return n.G.oi()>=0?n.G.oi():g.ic(n.G.T().experiments,"autoplay_time")||1E4},N4O=function(n,q){q=q.getWatchNextResponse(); var M,t;q=(M=d8F(q))==null?void 0:(t=M.nextButton)==null?void 0:t.buttonRenderer;n.S=q==null?void 0:q.navigationEndpoint;M=q==null?void 0:q.trackingParams;n.playButton&&M&&n.G.setTrackingParams(n.playButton.element,M)},EFL=function(n){var q; return!((q=n.G.getVideoData())==null||!q.watchToWatchTransitionRenderer)},gFA=function(n,q){q=q===void 0?-1:q; n=n.X.JE("ytp-autonav-endscreen-upnext-header");g.WT(n);if(q>=0){q=String(q);var M="A continuaci\u00f3n, en $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],t="A continuaci\u00f3n, en $SECONDS".indexOf(M);if(t>=0){n.appendChild(g.ES("A continuaci\u00f3n, en $SECONDS".slice(0,t)));var c=g.eO("span");g.n4(c,"ytp-autonav-endscreen-upnext-header-countdown-number");g.jO(c,q);n.appendChild(c);n.appendChild(g.ES("A continuaci\u00f3n, en $SECONDS".slice(t+M.length)));return}}g.jO(n,"A continuaci\u00f3n")},kU= function(n,q){g.w.call(this,{j:"div", aL:["html5-endscreen","ytp-player-content",q||"base-endscreen"]});this.created=!1;this.player=n},bR=function(n){g.w.call(this,{j:"div", aL:["ytp-upnext","ytp-player-content"],K:{"aria-label":"{{aria_label}}"},L:[{j:"div",Y:"ytp-cued-thumbnail-overlay-image",K:{style:"{{background}}"}},{j:"span",Y:"ytp-upnext-top",L:[{j:"span",Y:"ytp-upnext-header",Wb:"A continuaci\u00f3n"},{j:"span",Y:"ytp-upnext-title",Wb:"{{title}}"},{j:"span",Y:"ytp-upnext-author",Wb:"{{author}}"}]},{j:"a",Y:"ytp-upnext-autoplay-icon",K:{role:"button",href:"{{url}}","aria-label":"Reproducir siguiente video"},L:[{j:"svg",K:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},L:[{j:"circle",Y:"ytp-svg-autoplay-circle",K:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{j:"circle",Y:"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)"}},{j:"path",Y:"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"}}]}]},{j:"span",Y:"ytp-upnext-bottom",L:[{j:"span",Y:"ytp-upnext-cancel"},{j:"span",Y:"ytp-upnext-paused", Wb:"La reproducci\u00f3n autom\u00e1tica est\u00e1 en pausa"}]}]});this.api=n;this.cancelButton=null;this.S=this.JE("ytp-svg-autoplay-ring");this.Z=this.notification=this.X=this.suggestion=null;this.J=new g.zw(this.fZ,5E3,this);this.W=0;var q=this.JE("ytp-upnext-cancel");this.cancelButton=new g.w({j:"button",aL:["ytp-upnext-cancel-button","ytp-button"],K:{tabindex:"0","aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},Wb:"Cancelar"});g.Z(this,this.cancelButton);this.cancelButton.listen("click", this.aW,this);this.cancelButton.dJ(q);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.Z(this,this.J);this.api.createClientVe(this.element,this,18788);q=this.JE("ytp-upnext-autoplay-icon");this.V(q,"click",this.SI);this.api.createClientVe(q,this,115130);this.d0();this.V(n,"autonavvisibility",this.d0);this.V(n,"mdxnowautoplaying",this.R9m);this.V(n,"mdxautoplaycanceled",this.Wib);g.Yi(this.element,"ytp-upnext-mobile",this.api.T().W)},hFs=function(n,q){if(q)return q; if(n.api.isFullscreen()){var M;n=(M=n.api.getVideoData())==null?void 0:M.eF;return n===-1||n===void 0?8E3:n}return n.api.oi()>=0?n.api.oi():g.ic(n.api.T().experiments,"autoplay_time")||1E4},W6Q=function(n,q){q=hFs(n,q); var M=Math,t=M.min;var c=(0,g.jt)()-n.W;M=t.call(M,c,q);q=q===0?1:Math.min(M/q,1);n.S.setAttribute("stroke-dashoffset",""+-211*(q+1));q>=1&&n.tP()&&n.api.getPresentingPlayerType()!==3?n.select(!0):n.tP()&&n.X.start()},ds=function(n){kU.call(this,n,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.w({j:"div",Y:"ytp-suggestion-panel",L:[{j:"div",aL:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],Wb:"M\u00e1s videos"}]});this.N=new g.w({j:"div",Y:"ytp-suggestions-container"});this.videos=[];this.Z=null;this.S=this.C=!1;this.W=new GA(this.player);g.Z(this,this.W);this.W.dJ(this.element);n.getVideoData().TX?this.X=this.W:(this.X=new bR(n),g.qW(this.player,this.X.element,4),g.Z(this,this.X));this.overlay=new g.w({j:"div", Y:"ytp-autonav-overlay-cancelled-state"});g.Z(this,this.overlay);this.overlay.dJ(this.element);this.J=new g.f8(this);g.Z(this,this.J);g.Z(this,this.table);this.table.dJ(this.element);this.table.show();g.Z(this,this.N);this.N.dJ(this.table.element);this.hide()},NC=function(n){var q=n.G0(); q!==n.S&&(n.S=q,knT(n.player),n.S?(n.W!==n.X&&n.W.hide(),n.table.hide()):(n.W!==n.X&&n.W.show(),n.table.show()))},yTw=function(n){kU.call(this,n,"videowall-endscreen"); var q=this;this.G=n;this.stills=[];this.Z=this.videoData=null;this.J=this.C=!1;this.N=null;g.MN(this.element,"modern-videowall-endscreen");this.W=new g.f8(this);g.Z(this,this.W);this.S=new g.zw(function(){g.MN(q.element,"ytp-show-tiles")},0); g.Z(this,this.S);this.table=new g.ta({j:"div",Y:"ytp-modern-endscreen-content"});g.Z(this,this.table);this.table.dJ(this.element);n.getVideoData().TX?this.X=new GA(n,!0):this.X=new bR(n);g.Z(this,this.X);g.qW(this.player,this.X.element,4);n.createClientVe(this.element,this,158789);this.hide()},Oe=function(n){return g.MW(n.player)&&n.RV()&&!n.Z},gs=function(n){var q=n.G0(); q!==n.C&&(n.C=q,knT(n.player))},syT=function(n){kU.call(this,n,"subscribecard-endscreen"); this.X=new g.w({j:"div",Y:"ytp-subscribe-card",L:[{j:"img",Y:"ytp-author-image",K:{src:"{{profilePicture}}"}},{j:"div",Y:"ytp-subscribe-card-right",L:[{j:"div",Y:"ytp-author-name",Wb:"{{author}}"},{j:"div",Y:"html5-subscribe-button-container"}]}]});g.Z(this,this.X);this.X.dJ(this.element);var q=n.getVideoData();this.subscribeButton=new g.t9("Suscribirse",null,"Anular suscripci\u00f3n",null,!0,!1,q.xp,q.subscribed,"trailer-endscreen",null,n,!1);g.Z(this,this.subscribeButton);this.subscribeButton.dJ(this.X.JE("html5-subscribe-button-container")); this.V(n,"videodatachange",this.Cm);this.Cm();this.hide()},eX=function(n){var q=n.T(),M=g.Xq||g.MU?{style:"will-change: opacity"}:void 0,t=q.J,c=["ytp-videowall-still"]; q.W&&c.push("ytp-videowall-show-text");g.w.call(this,{j:"a",aL:c,K:{href:"{{url}}",target:t?q.U:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},L:[{j:"div",Y:"ytp-videowall-still-image",K:{style:"{{background}}"}},{j:"span",Y:"ytp-videowall-still-info",K:{"aria-hidden":"true"},L:[{j:"span",Y:"ytp-videowall-still-info-bg",L:[{j:"span",Y:"ytp-videowall-still-info-content",K:M,L:[{j:"span",Y:"ytp-videowall-still-info-title",Wb:"{{title}}"}, {j:"span",Y:"ytp-videowall-still-info-author",Wb:"{{author_and_views}}"},{j:"span",Y:"ytp-videowall-still-info-live",Wb:"En vivo"},{j:"span",Y:"ytp-videowall-still-info-duration",Wb:"{{duration}}"}]}]}]},{j:"span",aL:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],K:{"aria-hidden":"true"},L:[{j:"span",Y:"ytp-videowall-still-listlabel-icon"},"Playlist",{j:"span",Y:"ytp-videowall-still-listlabel-length",L:[" (",{j:"span",Wb:"{{playlist_length}}"},")"]}]},{j:"span",aL:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],K:{"aria-hidden":"true"},L:[{j:"span",Y:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{j:"span",Y:"ytp-videowall-still-listlabel-length",Wb:" (50+)"}]}]});this.suggestion=null;this.W=t;this.api=n;this.X=new g.f8(this);g.Z(this,this.X);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.X.V(n,"videodatachange",this.onVideoDataChange);n.createServerVe(this.element,this);this.onVideoDataChange()},Ee=function(n){kU.call(this,n,"videowall-endscreen"); var q=this;this.G=n;this.Z=0;this.stills=[];this.J=this.videoData=null;this.S=this.N=!1;this.U=null;this.W=new g.f8(this);g.Z(this,this.W);this.C=new g.zw(function(){g.MN(q.element,"ytp-show-tiles")},0); g.Z(this,this.C);var M=new g.w({j:"button",aL:["ytp-button","ytp-endscreen-previous"],K:{"aria-label":"Anterior"},L:[g.Om()]});g.Z(this,M);M.dJ(this.element);M.listen("click",this.lx,this);this.table=new g.ta({j:"div",Y:"ytp-endscreen-content"});g.Z(this,this.table);this.table.dJ(this.element);M=new g.w({j:"button",aL:["ytp-button","ytp-endscreen-next"],K:{"aria-label":"Siguiente"},L:[g.gW()]});g.Z(this,M);M.dJ(this.element);M.listen("click",this.qA,this);n.getVideoData().TX?this.X=new GA(n,!0):this.X= new bR(n);g.Z(this,this.X);g.qW(this.player,this.X.element,4);n.createClientVe(this.element,this,158789);this.hide()},h7=function(n){return g.MW(n.player)&&n.RV()&&!n.J},WG=function(n){var q=n.G0(); q!==n.N&&(n.N=q,knT(n.player))},XmQ=function(n,q){g.w.call(this,{j:"button", aL:["ytp-watch-on-youtube-button","ytp-button"],Wb:"{{content}}"});this.G=n;this.buttonType=this.buttonType=q;this.YZ();this.buttonType===2&&g.MN(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.YZ);this.VS(!0)},yq=function(n){kU.call(this,n,"watch-again-on-youtube-endscreen"); this.watchButton=new XmQ(n,1);g.Z(this,this.watchButton);this.watchButton.dJ(this.element);g.i3s(n)&&(this.X=new g.pc(n),g.Z(this,this.X),this.W=new g.w({j:"div",aL:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],K:{tabIndex:"-1"},L:[this.X]}),g.Z(this,this.W),this.X.dJ(this.W.element),this.W.dJ(this.element));n.createClientVe(this.element,this,156914);this.hide()},fns=function(n){g.Ib.call(this,n); var q=this;this.endScreen=null;this.X=this.W=this.Z=!1;this.listeners=new g.f8(this);g.Z(this,this.listeners);var M=n.T();n.isEmbedsShortsMode()?this.endScreen=new yq(n):jyL(n)?(this.Z=!0,SOw(this),this.X?this.endScreen=new ds(n):M.D("delhi_modern_endscreen")?this.endScreen=new yTw(n):this.endScreen=new Ee(n)):M.ZU?this.endScreen=new syT(n):this.endScreen=new kU(n);g.Z(this,this.endScreen);g.qW(n,this.endScreen.element,4);InG(this);this.listeners.V(n,"videodatachange",this.onVideoDataChange,this); this.listeners.V(n,g.CK("endscreen"),function(t){q.onCueRangeEnter(t)}); this.listeners.V(n,g.rj("endscreen"),function(t){q.onCueRangeExit(t)})},SOw=function(n){var q=n.player.getVideoData(); if(!q||n.X===q.JI&&n.W===q.TX)return!1;n.X=q.JI;n.W=q.TX;return!0},jyL=function(n){n=n.T(); return n.TX&&!n.ZU&&!n.disableOrganicUi},InG=function(n){n.player.sT("endscreen"); var q=n.player.getVideoData();q=new g.Ji(Math.max((q.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var M=new g.Ji(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});n.player.y6([q,M])}; g.Jv.prototype.oi=g.cd(6,function(){return this.app.oi()}); g.hu.prototype.oi=g.cd(5,function(){return this.getVideoData().Kh}); g.Rm.prototype.bq=g.cd(4,function(n){this.lr().bq(n)}); g.xx.prototype.bq=g.cd(3,function(n){this.GG!==n&&(this.GG=n,this.Wl())}); g.y(YU,g.w);YU.prototype.select=function(){this.G.u4(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.Ky||void 0)&&this.G.logClick(this.element)}; YU.prototype.onClick=function(n){g.P8(n,this.G,this.X,this.suggestion.sessionData||void 0)&&this.select()}; YU.prototype.onKeyPress=function(n){switch(n.keyCode){case 13:case 32:n.defaultPrevented||(this.select(),n.preventDefault())}};g.y(GA,g.w);g.W=GA.prototype;g.W.BE=function(n){this.suggestion!==n&&(this.suggestion=n,g.kx(this.X,n),this.playButton.updateValue("url",this.suggestion.o9()),KR(this))}; g.W.tP=function(){return this.Z>0}; g.W.xu=function(){this.tP()||(this.Z=Date.now(),Oqn(this),bqS(this.G,eFS(this)),g.Yi(this.G.getRootNode(),"countdown-running",this.tP()))}; g.W.PO=function(){this.Fr();Oqn(this);var n=this.X.JE("ytp-autonav-endscreen-upnext-header");n&&g.jO(n,"A continuaci\u00f3n")}; g.W.Fr=function(){this.tP()&&(this.J.stop(),this.Z=0)}; g.W.select=function(n){this.G.nextVideo(!1,n===void 0?!1:n);this.Fr()}; g.W.j1=function(n){g.P8(n,this.G)&&(n.currentTarget===this.playButton.element?this.G.logClick(this.playButton.element):n.currentTarget===this.X.JE("ytp-autonav-endscreen-link-container")&&(n=this.X.JE("ytp-autonav-endscreen-link-container"),this.G.logVisibility(n,!0),this.G.logClick(n)),this.S?(this.G.Km("innertubeCommand",this.S),this.Fr()):this.select())}; g.W.gX=function(){this.G.logClick(this.cancelButton.element);g.Ci(this.G,!0);this.cancelCommand&&this.G.Km("innertubeCommand",this.cancelCommand)}; g.W.onVideoDataChange=function(n,q){N4O(this,q);n=q.getWatchNextResponse();var M,t;n=(M=d8F(n))==null?void 0:(t=M.cancelButton)==null?void 0:t.buttonRenderer;this.cancelCommand=n==null?void 0:n.command}; g.W.gim=function(n){if(EFL(this)){var q=this.G.getVideoData().watchToWatchTransitionRenderer,M=q==null?void 0:q.fromColorPaletteDark;q=q==null?void 0:q.toColorPaletteDark;if(M&&q){var t=this.element;t.style.setProperty("--w2w-start-background-color",g.Dq(M.surgeColor));t.style.setProperty("--w2w-start-primary-text-color",g.Dq(M.primaryTitleColor));t.style.setProperty("--w2w-start-secondary-text-color",g.Dq(M.secondaryTitleColor));t.style.setProperty("--w2w-end-background-color",g.Dq(q.surgeColor)); t.style.setProperty("--w2w-end-primary-text-color",g.Dq(q.primaryTitleColor));t.style.setProperty("--w2w-end-secondary-text-color",g.Dq(q.secondaryTitleColor));t.style.setProperty("--w2w-animation-duration",n+"ms")}g.Yi(this.element,"ytp-w2w-animate",!0)}}; g.W.dX=function(n){this.G.D("web_autonav_color_transition")&&n!==2&&g.Yi(this.element,"ytp-w2w-animate",!1)}; g.W.F0=function(){var n=this.G.G0();this.C&&this.Zn!==n&&this.VS(n);KR(this);this.G.logVisibility(this.container.element,n);this.G.logVisibility(this.cancelButton.element,n);this.G.logVisibility(this.X.JE("ytp-autonav-endscreen-link-container"),n);this.G.logVisibility(this.playButton.element,n)}; g.W.Qr=function(n){return n.width<400||n.height<459};g.y(kU,g.w);g.W=kU.prototype;g.W.create=function(){this.created=!0}; g.W.destroy=function(){this.created=!1}; g.W.RV=function(){return!1}; g.W.G0=function(){return!1}; g.W.VG=function(){return!1};g.y(bR,g.w);g.W=bR.prototype;g.W.fZ=function(){this.notification&&(this.J.stop(),this.AQ(this.Z),this.Z=null,this.notification.close(),this.notification=null)}; g.W.BE=function(n){this.suggestion=n;g.kx(this,n,"hqdefault.jpg")}; g.W.d0=function(){this.VS(this.api.G0());this.api.logVisibility(this.element,this.api.G0());this.api.logVisibility(this.JE("ytp-upnext-autoplay-icon"),this.api.G0());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.G0())}; g.W.Fi1=function(){window.focus();this.fZ()}; g.W.xu=function(n){var q=this;this.tP()||(g.nB("a11y-announce","A continuaci\u00f3n "+this.suggestion.title),this.W=(0,g.jt)(),this.X=new g.zw(function(){W6Q(q,n)},25),W6Q(this,n),bqS(this.api,hFs(this,n))); g.ts(this.element,"ytp-upnext-autoplay-paused")}; g.W.hide=function(){g.w.prototype.hide.call(this)}; g.W.tP=function(){return!!this.X}; g.W.PO=function(){this.Fr();this.W=(0,g.jt)();W6Q(this);g.MN(this.element,"ytp-upnext-autoplay-paused")}; g.W.Fr=function(){this.tP()&&(this.X.dispose(),this.X=null)}; g.W.select=function(n){n=n===void 0?!1:n;if(this.api.T().D("autonav_notifications")&&n&&window.Notification&&typeof document.hasFocus==="function"){var q=Notification.permission;q==="default"?Notification.requestPermission():q!=="granted"||document.hasFocus()||(this.fZ(),this.notification=new Notification("A continuaci\u00f3n",{body:this.suggestion.title,icon:this.suggestion.b7()}),this.Z=this.V(this.notification,"click",this.Fi1),this.J.start())}this.Fr();this.api.nextVideo(!1,n)}; g.W.SI=function(n){!g.XL(this.cancelButton.element,n.target)&&g.P8(n,this.api)&&(this.api.G0()&&this.api.logClick(this.JE("ytp-upnext-autoplay-icon")),this.select())}; g.W.aW=function(){this.api.G0()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.Ci(this.api,!0)}; g.W.R9m=function(n){this.api.getPresentingPlayerType();this.show();this.xu(n)}; g.W.Wib=function(){this.api.getPresentingPlayerType();this.Fr();this.hide()}; g.W.ut=function(){this.Fr();this.fZ();g.w.prototype.ut.call(this)};g.y(ds,kU);g.W=ds.prototype;g.W.create=function(){kU.prototype.create.call(this);this.J.V(this.player,"appresize",this.Uk);this.J.V(this.player,"onVideoAreaChange",this.Uk);this.J.V(this.player,"videodatachange",this.onVideoDataChange);this.J.V(this.player,"autonavchange",this.g0);this.J.V(this.player,"onAutonavCancelled",this.zl);this.onVideoDataChange()}; g.W.show=function(){kU.prototype.show.call(this);(this.C||this.Z&&this.Z!==this.videoData.clientPlaybackNonce)&&g.Ci(this.player,!1);g.MW(this.player)&&this.RV()&&!this.Z?(NC(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3?this.X.select(!0):this.X.xu():this.videoData.autonavState===3&&this.X.PO()):(g.Ci(this.player,!0),NC(this));this.Uk()}; g.W.hide=function(){kU.prototype.hide.call(this);this.X.PO();NC(this)}; g.W.Uk=function(){var n=this.player.PR(!0,this.player.isFullscreen());NC(this);KR(this.W);g.Yi(this.element,"ytp-autonav-cancelled-small-mode",this.Qr(n));g.Yi(this.element,"ytp-autonav-cancelled-tiny-mode",this.gs(n));g.Yi(this.element,"ytp-autonav-cancelled-mini-mode",n.width<=400||n.height<=360);this.overlay&&g.wK(this.overlay.element,{width:n.width+"px"});if(!this.S)for(n=0;n0&&(n= O*4,E=q<=b-2&&d>=N*4;if((N+1)/O*t/G>G/(N/(O+1)*t)&&E)d-=N*4,q+=2;else if(e)d-=O*4,n+=2;else if(E)d-=N*4,q+=2;else break}t=!1;d>=12&&M*4-d<=6&&(q>=4||n>=4)&&(t=!0);d=n*96;k=q*54;G=d/k=n-2&&N>=q-2?E=1:N%2===0&&b%2===0&&(N<2&&b<2?N===0&&b===0&&(E=2):E=2),O=g.RR(O+this.Z,M),E!==0){e=this.stills[G];e||(e=new eX(this.player),this.stills[G]=e,Y.appendChild(e.element));var h=Math.floor(k*N/q),I=Math.floor(d*b/n),L=Math.floor(k*(N+E)/q)-h-4,T=Math.floor(d*(b+E)/n)-I-4;g.xZ(e.element,I,h);g.qv(e.element,T,L);g.wK(e.element,"transitionDelay",(N+b)/20+"s");g.Yi(e.element,"ytp-videowall-still-mini", E===1);g.Yi(e.element,"ytp-videowall-still-large",E>2);E=Math.max(T,L);g.Yi(e.element,"ytp-videowall-still-round-large",E>=256);g.Yi(e.element,"ytp-videowall-still-round-medium",E>96&&E<256);g.Yi(e.element,"ytp-videowall-still-round-small",E<=96);O=c[O];e.suggestion!==O&&(e.suggestion=O,E=e.api.T(),h=g.qN(e.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",g.kx(e,O,h),g.t8(E)&&!e.api.D("web_player_log_click_before_generating_ve_conversion_params")&&(E=O.o9(),h={},g.U9(e.api,"addEmbedsConversionTrackingParams", [h]),E=g.hC(E,h),e.updateValue("url",E)),(O=(O=O.sessionData)&&O.itct)&&e.api.setTrackingParams(e.element,O));G++}Y.ariaBusy="false";g.Yi(this.element,"ytp-endscreen-paginate",G=G;c--)n=this.stills[c],g.sS(n.element),g.iz(n);this.stills.length=G}}; g.W.onVideoDataChange=function(){var n=this.player.getVideoData(1);this.videoData!==n&&(n!=null&&g.Lt(n)?(this.Z=0,this.videoData=n,this.Sa()):this.player.Xy("missg",{vid:(n==null?void 0:n.videoId)||"",cpn:(n==null?void 0:n.clientPlaybackNonce)||""}))}; g.W.qA=function(){this.Z+=this.stills.length;this.Sa()}; g.W.lx=function(){this.Z-=this.stills.length;this.Sa()}; g.W.VG=function(){return this.X.tP()}; g.W.Yh=function(n){n===1?(this.S=!1,this.J=this.videoData.clientPlaybackNonce,this.X.Fr(),this.Zn&&this.Sa()):(this.S=!0,this.Zn&&h7(this)&&(n===2?this.X.xu():n===3&&this.X.PO()))}; g.W.n$=function(n){if(n){for(n=0;n0||n.endSeconds>0||n.mutedAutoplayDurationMode!==2);if(this.player.isEmbedsShortsMode()&&!q)return!0;var M;var t=!!((n==null?0:g.Lt(n))||(n==null?0:(M=n.suggestions)==null?0:M.length));t=!jyL(this.player)||t;n=n.Es;M=this.player.mM();return t&&!n&&!M&&!q}; g.W.G0=function(){return this.endScreen.G0()}; g.W.MXd=function(){return this.G0()?this.endScreen.VG():!1}; g.W.ut=function(){this.player.sT("endscreen");g.Ib.prototype.ut.call(this)}; g.W.load=function(){var n=this.player.getVideoData();var q=n.transitionEndpointAtEndOfStream;if(q&&q.videoId){var M=this.player.zk().R1.get("heartbeat"),t=g.Lt(n);!t||q.videoId!==t.videoId||n.o5?(this.player.u4(q.videoId,void 0,void 0,!0,!0,q),M&&M.Ar("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),n=!0):n=!1}else n=!1;n||(g.Ib.prototype.load.call(this),this.endScreen.show())}; g.W.unload=function(){g.Ib.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.W.onCueRangeEnter=function(n){this.vt()&&(this.endScreen.created||this.endScreen.create(),n.getId()==="load"&&this.load())}; g.W.onCueRangeExit=function(n){n.getId()==="load"&&this.loaded&&this.unload()}; g.W.onVideoDataChange=function(){InG(this);this.Z&&SOw(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.X?this.endScreen=new ds(this.player):this.endScreen=new Ee(this.player),g.Z(this,this.endScreen),g.qW(this.player,this.endScreen.element,4))};g.SC("endscreen",fns);})(_yt_player);