2ceb8e767d7ecf1d9ebc3eed59f7ce609efba8519e21a58d9de1ba2ce14078b6

Source Code:

(function(g){var window=this;var nGa=function(a,b){a.ya("onAutonavCoundownStarted",b)},V4=function(a,b,c){var d=b.Na();
g.K(a.element,"ytp-suggestion-set",!!d.videoId);var e=b.getPlaylistId();c=b.he(c?c:"mqdefault.jpg");var f=null,h=null;b instanceof g.zH&&(b.lengthText?(f=b.lengthText||null,h=b.Bu||null):b.lengthSeconds&&(f=g.MO(b.lengthSeconds),h=g.MO(b.lengthSeconds,!0)));var l=!!e;e=l&&"RD"===(new g.OT(e.substr(0,2),e.substr(2))).type;var m=b instanceof g.zH?b.isLivePlayback:null,n=b instanceof g.zH?b.isUpcoming:null;d={title:b.title,author:b.author,author_and_views:d.shortViewCount?b.author+" \u2022 "+d.shortViewCount:
b.author,aria_label:b.Mp||g.HK("$TITLE \u3092\u518d\u751f",{TITLE:b.title}),duration:f,timestamp:h,url:b.Tk(),is_live:m,is_upcoming:n,is_list:l,is_mix:e,background:c?"background-image: url("+c+")":"",views_and_publish_time:d.shortViewCount?d.shortViewCount+" \u2022 "+d.publishedTimeText:d.publishedTimeText,autoplayAlternativeHeader:b.Qp};b instanceof g.PT&&(d.playlist_length=b.getLength());a.update(d)},W4=function(a){var b=a.T(),c=b.B;
g.U.call(this,{G:"a",L:"ytp-autonav-suggestion-card",U:{href:"{{url}}",target:c?b.F:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},R:[{G:"div",ka:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],U:{style:"{{background}}"},R:[{G:"div",U:{"aria-label":"{{timestamp}}"},ka:["ytp-autonav-timestamp"],Z:"{{duration}}"},{G:"div",ka:["ytp-autonav-live-stamp"],Z:"\u30e9\u30a4\u30d6"},
{G:"div",ka:["ytp-autonav-upcoming-stamp"],Z:"\u914d\u4fe1\u4e88\u5b9a"},{G:"div",L:"ytp-autonav-list-overlay",R:[{G:"div",L:"ytp-autonav-mix-text",Z:"\u30df\u30c3\u30af\u30b9\u30ea\u30b9\u30c8"},{G:"div",L:"ytp-autonav-mix-icon"}]}]},{G:"div",ka:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],Z:"{{title}}"},{G:"div",ka:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],Z:"{{author}}"},{G:"div",ka:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],
Z:"{{views_and_publish_time}}"}]});this.I=a;this.suggestion=null;this.u=c;this.xa("click",this.onClick);this.xa("keypress",this.B)},Y4=function(a,b){b=void 0===b?!1:b;
g.U.call(this,{G:"div",L:"ytp-autonav-endscreen-countdown-container"});var c=this;this.F=b;this.C=0;var d=a.T(),e=d.B;this.I=a;this.suggestion=null;this.u=new g.U({G:"div",L:"ytp-autonav-endscreen-upnext-container",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}}"},R:[{G:"div",L:"ytp-autonav-endscreen-upnext-header"},{G:"div",L:"ytp-autonav-endscreen-upnext-alternative-header",Z:"{{autoplayAlternativeHeader}}"},
{G:"a",L:"ytp-autonav-endscreen-link-container",U:{href:"{{url}}",target:e?d.F:""},R:[{G:"div",L:"ytp-autonav-endscreen-upnext-thumbnail",U:{style:"{{background}}"},R:[{G:"div",U:{"aria-label":"{{timestamp}}"},ka:["ytp-autonav-timestamp"],Z:"{{duration}}"},{G:"div",ka:["ytp-autonav-live-stamp"],Z:"\u30e9\u30a4\u30d6"},{G:"div",ka:["ytp-autonav-upcoming-stamp"],Z:"\u914d\u4fe1\u4e88\u5b9a"}]},{G:"div",L:"ytp-autonav-endscreen-video-info",R:[{G:"div",L:"ytp-autonav-endscreen-premium-badge"},{G:"div",
L:"ytp-autonav-endscreen-upnext-title",Z:"{{title}}"},{G:"div",L:"ytp-autonav-endscreen-upnext-author",Z:"{{author}}"},{G:"div",L:"ytp-autonav-view-and-date",Z:"{{views_and_publish_time}}"},{G:"div",L:"ytp-autonav-author-and-view",Z:"{{author_and_views}}"}]}]}]});g.C(this,this.u);this.u.ha(this.element);e||this.N(this.u.ia("ytp-autonav-endscreen-link-container"),"click",this.TE);g.IT(this.I,this.element,this,115127);g.IT(this.I,this.u.ia("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=
new g.U({G:"div",L:"ytp-autonav-overlay"});g.C(this,this.overlay);this.overlay.ha(this.element);this.B=new g.U({G:"div",L:"ytp-autonav-endscreen-button-container"});g.C(this,this.B);this.B.ha(this.element);this.cancelButton=new g.U({G:"button",ka:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button"],U:{"aria-label":"\u81ea\u52d5\u518d\u751f\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b"},Z:"\u30ad\u30e3\u30f3\u30bb\u30eb"});g.C(this,this.cancelButton);this.cancelButton.ha(this.B.element);
this.cancelButton.xa("click",this.vM,this);g.IT(this.I,this.cancelButton.element,this,115129);this.playButton=new g.U({G:"a",ka:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-play-button"],U:{href:"{{url}}",role:"button","aria-label":"\u6b21\u306e\u52d5\u753b\u3092\u518d\u751f"},Z:"\u4eca\u3059\u3050\u518d\u751f"});g.C(this,this.playButton);this.playButton.ha(this.B.element);this.playButton.xa("click",this.TE,this);g.IT(this.I,this.playButton.element,this,115130);this.D=new g.F(function(){X4(c)},
500);
g.C(this,this.D);this.SE();this.N(a,"autonavvisibility",this.SE)},X4=function(a){var b=Z4(a),c=Math.min(a.C?Date.now()-a.C:0,b);
$4(a,Math.ceil((b-c)/1E3));500>=b-c&&a.xg()?a.select(!0):a.xg()&&a.D.start()},Z4=function(a){var b=a.I.app.getVideoData().Xs;
return 0<=b?b:g.P(a.I.T().experiments,"autoplay_time")||1E4},$4=function(a,b){b=void 0===b?-1:b;
var c=a.u.ia("ytp-autonav-endscreen-upnext-header");g.Ee(c);if(0<=b){var d=String(b),e="$SECONDS \u79d2\u5f8c\u306b\u6b21\u306e\u52d5\u753b\u3092\u518d\u751f".match(RegExp("\\$SECONDS","gi"))[0],f="$SECONDS \u79d2\u5f8c\u306b\u6b21\u306e\u52d5\u753b\u3092\u518d\u751f".indexOf(e);if(0<=f){c.appendChild(g.De("$SECONDS \u79d2\u5f8c\u306b\u6b21\u306e\u52d5\u753b\u3092\u518d\u751f".slice(0,f)));var h=g.Ce("span");g.rn(h,"ytp-autonav-endscreen-upnext-header-countdown-number");g.Ke(h,d);c.appendChild(h);
c.appendChild(g.De("$SECONDS \u79d2\u5f8c\u306b\u6b21\u306e\u52d5\u753b\u3092\u518d\u751f".slice(f+e.length)));return}}g.Ke(c,"\u6b21\u306e\u52d5\u753b")},a5=function(a,b){g.U.call(this,{G:"div",
ka:["html5-endscreen","ytp-player-content",b||"base-endscreen"]});this.created=!1;this.player=a},c5=function(a){g.U.call(this,{G:"div",
ka:["ytp-upnext","ytp-player-content"],U:{"aria-label":"{{aria_label}}"},R:[{G:"div",L:"ytp-cued-thumbnail-overlay-image",U:{style:"{{background}}"}},{G:"span",L:"ytp-upnext-top",R:[{G:"span",L:"ytp-upnext-header",Z:"\u6b21\u306e\u52d5\u753b"},{G:"span",L:"ytp-upnext-title",Z:"{{title}}"},{G:"span",L:"ytp-upnext-author",Z:"{{author}}"}]},{G:"a",L:"ytp-upnext-autoplay-icon",U:{role:"button",href:"{{url}}","aria-label":"\u6b21\u306e\u52d5\u753b\u3092\u518d\u751f"},R:[{G:"svg",U:{height:"100%",version:"1.1",
viewBox:"0 0 72 72",width:"100%"},R:[{G:"circle",L:"ytp-svg-autoplay-circle",U:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{G:"circle",L:"ytp-svg-autoplay-ring",U:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{G:"path",L:"ytp-svg-fill",U:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{G:"span",L:"ytp-upnext-bottom",R:[{G:"span",L:"ytp-upnext-cancel"},
{G:"span",L:"ytp-upnext-paused",Z:"\u81ea\u52d5\u518d\u751f\u306f\u4e00\u6642\u505c\u6b62\u3055\u308c\u3066\u3044\u307e\u3059"}]}]});this.api=a;this.cancelButton=null;this.F=this.ia("ytp-svg-autoplay-ring");this.C=this.notification=this.u=this.suggestion=null;this.D=new g.F(this.ot,5E3,this);this.B=0;var b=this.ia("ytp-upnext-cancel");this.cancelButton=new g.U({G:"button",ka:["ytp-upnext-cancel-button","ytp-button"],U:{tabindex:"0","aria-label":"\u81ea\u52d5\u518d\u751f\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b"},
Z:"\u30ad\u30e3\u30f3\u30bb\u30eb"});g.C(this,this.cancelButton);this.cancelButton.xa("click",this.zN,this);this.cancelButton.ha(b);this.cancelButton&&g.IT(this.api,this.cancelButton.element,this,115129);g.C(this,this.D);g.IT(this.api,this.element,this,18788);b=this.ia("ytp-upnext-autoplay-icon");this.N(b,"click",this.AN);g.IT(this.api,b,this,115130);this.fF();this.N(a,"autonavvisibility",this.fF);this.N(a,"mdxnowautoplaying",this.zP);this.N(a,"mdxautoplaycanceled",this.AP);this.N(a,"mdxautoplayupnext",
this.wI);b5(this)&&(a=(a=g.wT(g.rT(this.api)))?a.EK():null)&&this.wI(a);g.K(this.element,"ytp-upnext-mobile",this.api.T().u)},b5=function(a){return 3===a.api.getPresentingPlayerType()},oGa=function(a,b){return b?b:0<=a.api.app.getVideoData().Xs?a.api.app.getVideoData().Xs:g.P(a.api.T().experiments,"autoplay_time")||1E4},d5=function(a,b){var c=oGa(a,b),d=Math,e=d.min;
var f=(0,g.N)()-a.B;d=e.call(d,f,c);c=0===c?1:Math.min(d/c,1);a.F.setAttribute("stroke-dashoffset",""+-211*(c+1));1<=c&&a.xg()&&!b5(a)?a.select(!0):a.xg()&&a.u.start()},e5=function(a){a5.call(this,a,"autonav-endscreen");
this.videoData=this.suggestions=null;this.table=new g.U({G:"div",L:"ytp-suggestion-panel",R:[{G:"div",ka:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],Z:"\u305d\u306e\u4ed6\u306e\u52d5\u753b"}]});this.K=new g.U({G:"div",L:"ytp-suggestions-container"});this.videos=[];this.C=null;this.F=this.J=!1;this.B=new Y4(this.player);g.C(this,this.B);this.B.ha(this.element);a.getVideoData().Ml?this.u=this.B:(this.u=new c5(a),g.lP(this.player,this.u.element,4),g.C(this,this.u));this.D=
new g.dR(this);g.C(this,this.D);g.C(this,this.table);this.table.ha(this.element);this.table.show();g.C(this,this.K);this.K.ha(this.table.element);this.hide()},pGa=function(a,b){return g.Mc(b.suggestions,function(c){c=g.dW(a.player.T(),c);
g.C(a,c);return c})},f5=function(a){var b=a.Ao();
b!==a.F&&(a.F=b,a.player.V("autonavvisibility"),a.F?(a.B!==a.u&&a.B.hide(),a.table.hide()):(a.B!==a.u&&a.B.show(),a.table.show()))},g5=function(a){return 400>=a.width||360>=a.height},h5=function(a){a5.call(this,a,"subscribecard-endscreen");
this.u=new g.U({G:"div",L:"ytp-subscribe-card",R:[{G:"img",L:"ytp-author-image",U:{src:"{{profilePicture}}"}},{G:"div",L:"ytp-subscribe-card-right",R:[{G:"div",L:"ytp-author-name",Z:"{{author}}"},{G:"div",L:"html5-subscribe-button-container"}]}]});g.C(this,this.u);this.u.ha(this.element);var b=a.getVideoData();this.subscribeButton=new g.SU("\u767b\u9332",null,"\u767b\u9332\u89e3\u9664",null,!0,!1,b.lg,b.subscribed,"trailer-endscreen",null,null,a);g.C(this,this.subscribeButton);this.subscribeButton.ha(this.u.ia("html5-subscribe-button-container"));
this.N(a,"videodatachange",this.oa);this.oa();this.hide()},i5=function(a){var b=a.T(),c=g.DB||g.rg?{style:"will-change: opacity"}:void 0,d=b.B,e=["ytp-videowall-still"];
b.u&&e.push("ytp-videowall-show-text");g.U.call(this,{G:"a",ka:e,U:{href:"{{url}}",target:d?b.F:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},R:[{G:"div",L:"ytp-videowall-still-image",U:{style:"{{background}}"}},{G:"span",L:"ytp-videowall-still-info",R:[{G:"span",L:"ytp-videowall-still-info-bg",R:[{G:"span",L:"ytp-videowall-still-info-content",U:c,R:[{G:"span",L:"ytp-videowall-still-info-title",Z:"{{title}}"},{G:"span",L:"ytp-videowall-still-info-author",
Z:"{{author_and_views}}"},{G:"span",L:"ytp-videowall-still-info-live",Z:"\u30e9\u30a4\u30d6"},{G:"span",L:"ytp-videowall-still-info-duration",Z:"{{duration}}"}]}]}]},{G:"span",ka:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],R:[{G:"span",L:"ytp-videowall-still-listlabel-icon"},"\u518d\u751f\u30ea\u30b9\u30c8",{G:"span",L:"ytp-videowall-still-listlabel-length",R:[" (",{G:"span",Z:"{{playlist_length}}"},")"]}]},{G:"span",ka:["ytp-videowall-still-listlabel-mix","ytp-videowall-still-listlabel"],
R:[{G:"span",L:"ytp-videowall-still-listlabel-mix-icon"},"\u30df\u30c3\u30af\u30b9\u30ea\u30b9\u30c8",{G:"span",L:"ytp-videowall-still-listlabel-length",Z:" (50+)"}]}]});this.suggestion=null;this.B=d;this.api=a;this.u=new g.dR(this);g.C(this,this.u);this.xa("click",this.onClick);this.xa("keypress",this.C);this.u.N(a,"videodatachange",this.Qa);g.yN(a,this.element,this);this.Qa()},j5=function(a){a5.call(this,a,"videowall-endscreen");
var b=this;this.I=a;this.C=0;this.stills=[];this.D=this.videoData=this.suggestions=null;this.F=this.S=!1;this.K=null;this.B=new g.dR(this);g.C(this,this.B);this.J=new g.F(function(){g.J(b.element,"ytp-show-tiles")},0);
g.C(this,this.J);var c=new g.U({G:"button",ka:["ytp-button","ytp-endscreen-previous"],U:{"aria-label":"\u524d\u3078"},R:[g.HN()]});g.C(this,c);c.ha(this.element);c.xa("click",this.yM,this);this.table=new g.sN({G:"div",L:"ytp-endscreen-content"});g.C(this,this.table);this.table.ha(this.element);c=new g.U({G:"button",ka:["ytp-button","ytp-endscreen-next"],U:{"aria-label":"\u6b21\u3078"},R:[g.IN()]});g.C(this,c);c.ha(this.element);c.xa("click",this.xM,this);a.getVideoData().Ml?this.u=new Y4(a,!0):this.u=
new c5(a);g.C(this,this.u);g.lP(this.player,this.u.element,4);this.hide()},k5=function(a){return g.HT(a.player)&&a.Pp()&&!a.D},qGa=function(a,b){return g.Mc(b.suggestions,function(c){c=g.dW(a.I.T(),c);
g.C(a,c);return c})},l5=function(a){var b=a.Ao();
b!==a.S&&(a.S=b,a.player.V("autonavvisibility"))},m5=function(a){g.tS.call(this,a);
var b=this;this.endScreen=null;this.u=this.B=this.C=!1;this.listeners=new g.dR(this);g.C(this,this.listeners);this.env=a.T();rGa(a)?(this.C=!0,sGa(this),this.u?this.endScreen=new e5(a):this.endScreen=new j5(this.player)):this.env.Qf?this.endScreen=new h5(this.player):this.endScreen=new a5(this.player);g.C(this,this.endScreen);g.lP(this.player,this.endScreen.element,4);tGa(this);this.listeners.N(a,"videodatachange",this.Qa,this);this.listeners.N(a,g.TF("endscreen"),function(c){b.JE()&&(b.endScreen.created||
b.endScreen.create(),"load"===c.getId()&&b.load())});
this.listeners.N(a,g.UF("endscreen"),function(c){"load"===c.getId()&&b.loaded&&b.unload()})},sGa=function(a){var b=a.player.getVideoData();
if(!b||a.u===b.jp&&a.B===b.Ml)return!1;a.u=b.jp;a.B=b.Ml;return!0},rGa=function(a){a=a.T();
return a.vb&&!a.Qf},tGa=function(a){g.GT(a.player,"endscreen");
var b=a.player.getVideoData();b=new g.QF(Math.max(1E3*(b.lengthSeconds-10),0),0x8000000000000,{id:"preload",namespace:"endscreen"});var c=new g.QF(0x8000000000000,0x8000000000000,{id:"load",priority:6,namespace:"endscreen"});g.lN(a.player,[b,c])};
g.u(W4,g.U);W4.prototype.select=function(){(g.qT(this.I,this.suggestion.Na().videoId,this.suggestion.wd,this.suggestion.getPlaylistId(),void 0,this.suggestion.Qx||void 0)||this.I.aa("web_player_endscreen_double_log_fix_killswitch"))&&g.JT(this.I,this.element)};
W4.prototype.onClick=function(a){g.kU(a,this.I,this.u,this.suggestion.wd||void 0)&&this.select()};
W4.prototype.B=function(a){switch(a.keyCode){case 13:case 32:g.lp(a)||(this.select(),g.jp(a))}};
W4.prototype.Od=function(a){g.K(this.element,"ytp-suggestion-card-with-margin",a)};g.u(Y4,g.U);g.k=Y4.prototype;g.k.fr=function(a){this.suggestion!==a&&(this.suggestion=a,V4(this.u,a),this.playButton.za("url",this.suggestion.Tk()),this.Od())};
g.k.Od=function(){var a=this.I.Ni(!0,this.I.isFullscreen());g.K(this.element,"ytp-autonav-endscreen-small-mode",this.De(a));g.K(this.element,"ytp-autonav-endscreen-is-premium",!!this.suggestion&&!!this.suggestion.jw);g.K(this.I.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!g.sT(this.I));g.K(this.I.getRootNode(),"countdown-running",this.xg());g.K(this.element,"ytp-player-content",g.sT(this.I));g.og(this.overlay.element,{width:a.width+"px"});if(!this.xg()){g.sT(this.I)?$4(this,Math.round(Z4(this)/
1E3)):$4(this);a=!!this.suggestion&&!!this.suggestion.Qp;var b=g.sT(this.I)||!a;g.K(this.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!b&&a);g.K(this.element,"ytp-autonav-endscreen-upnext-no-alternative-header",b&&!a);g.vN(this.B,g.sT(this.I))}};
g.k.xg=function(){return 0<this.C};
g.k.mp=function(){this.xg()||(this.C=Date.now(),X4(this),nGa(this.I,Z4(this)),g.K(this.I.getRootNode(),"countdown-running",this.xg()))};
g.k.Vm=function(){this.uk();X4(this)};
g.k.uk=function(){this.xg()&&(this.D.stop(),this.C=0)};
g.k.select=function(a){this.I.nextVideo(!1,void 0===a?!1:a);this.uk()};
g.k.TE=function(a){g.kU(a,this.I)&&(a.currentTarget===this.playButton.element?g.JT(this.I,this.playButton.element):a.currentTarget===this.u.ia("ytp-autonav-endscreen-link-container")&&(a=this.u.ia("ytp-autonav-endscreen-link-container"),g.CN(this.I,a,!0),g.JT(this.I,a)),this.select())};
g.k.vM=function(){g.JT(this.I,this.cancelButton.element);g.uT(this.I,!0)};
g.k.SE=function(){var a=g.sT(this.I);this.F&&this.bb!==a&&g.vN(this,a);this.Od();g.CN(this.I,this.element,a);g.CN(this.I,this.cancelButton.element,a);g.CN(this.I,this.u.ia("ytp-autonav-endscreen-link-container"),a);g.CN(this.I,this.playButton.element,a)};
g.k.De=function(a){return 400>a.width||459>a.height};g.u(a5,g.U);g.k=a5.prototype;g.k.create=function(){this.created=!0};
g.k.destroy=function(){this.created=!1};
g.k.Pp=function(){return!1};
g.k.Ao=function(){return!1};
g.k.gE=function(){return!1};g.u(c5,g.U);g.k=c5.prototype;g.k.ot=function(){this.notification&&(this.D.stop(),this.Kb(this.C),this.C=null,this.notification.close(),this.notification=null)};
g.k.fr=function(a){this.suggestion=a;V4(this,a,"hqdefault.jpg")};
g.k.fF=function(){g.vN(this,g.sT(this.api));g.CN(this.api,this.element,g.sT(this.api));g.CN(this.api,this.ia("ytp-upnext-autoplay-icon"),g.sT(this.api));this.cancelButton&&g.CN(this.api,this.cancelButton.element,g.sT(this.api))};
g.k.OP=function(){window.focus();this.ot()};
g.k.mp=function(a){var b=this;this.xg()||(g.Qo("a11y-announce","\u6b21\u306e\u52d5\u753b "+this.suggestion.title),this.B=(0,g.N)(),this.u=new g.F(function(){d5(b,a)},25),d5(this,a),nGa(this.api,oGa(this,a)));
g.un(this.element,"ytp-upnext-autoplay-paused")};
g.k.hide=function(){g.U.prototype.hide.call(this)};
g.k.xg=function(){return!!this.u};
g.k.Vm=function(){this.uk();this.B=(0,g.N)();d5(this);g.J(this.element,"ytp-upnext-autoplay-paused")};
g.k.uk=function(){this.xg()&&(this.u.dispose(),this.u=null)};
g.k.select=function(a){a=void 0===a?!1:a;if(g.Q(this.api.T().experiments,"autonav_notifications")&&a&&window.Notification&&document.hasFocus){var b=Notification.permission;"default"===b?Notification.requestPermission():"granted"!==b||document.hasFocus()||(b=this.suggestion.Na(),this.ot(),this.notification=new Notification("\u6b21\u306e\u52d5\u753b",{body:b.title,icon:b.he()}),this.C=this.N(this.notification,"click",this.OP),this.D.start())}this.uk();this.api.nextVideo(!1,a)};
g.k.AN=function(a){!g.Je(this.cancelButton.element,g.fp(a))&&g.kU(a,this.api)&&(g.sT(this.api)&&g.JT(this.api,this.ia("ytp-upnext-autoplay-icon")),this.select())};
g.k.zN=function(){g.sT(this.api)&&this.cancelButton&&g.JT(this.api,this.cancelButton.element);g.uT(this.api,!0)};
g.k.zP=function(a){b5(this);this.show();this.mp(a)};
g.k.wI=function(a){b5(this);this.suggestion&&this.suggestion.Na().videoId===a.Na().videoId||this.fr(a)};
g.k.AP=function(){b5(this);this.uk();this.hide()};
g.k.ca=function(){this.uk();this.ot();g.U.prototype.ca.call(this)};g.u(e5,a5);g.k=e5.prototype;g.k.create=function(){a5.prototype.create.call(this);this.D.N(this.player,"appresize",this.Od);this.D.N(this.player,"onVideoAreaChange",this.Od);this.D.N(this.player,"videodatachange",this.Qa);this.D.N(this.player,"autonavchange",this.RE);this.D.N(this.player,"autonavcancel",this.uM);this.Qa()};
g.k.show=function(){a5.prototype.show.call(this);(this.J||this.C&&this.C!==this.videoData.clientPlaybackNonce)&&g.uT(this.player,!1);g.HT(this.player)&&this.Pp()&&!this.C?(f5(this),2===this.videoData.autonavState?this.player.T().aa("fast_autonav_in_background")&&3===this.player.getVisibilityState()?this.u.select(!0):this.u.mp():3===this.videoData.autonavState&&this.u.Vm()):(g.uT(this.player,!0),f5(this));this.Od()};
g.k.hide=function(){a5.prototype.hide.call(this);this.u.Vm();f5(this)};
g.k.Od=function(){var a=this.player.Ni(!0,this.player.isFullscreen());f5(this);this.B.Od();g.K(this.element,"ytp-autonav-cancelled-small-mode",this.De(a));g.K(this.element,"ytp-autonav-cancelled-tiny-mode",800>a.width&&!g5(a));g.K(this.element,"ytp-autonav-cancelled-mini-mode",g5(a));if(!this.F){a=g.q(this.videos.entries());for(var b=a.next();!b.done;b=a.next()){b=g.q(b.value);var c=b.next().value;b.next().value.Od(1===c%2)}}};
g.k.Qa=function(){var a=this.player.getVideoData();if(this.videoData!==a&&a){this.videoData=a;if((this.suggestions=pGa(this,a))&&this.suggestions.length)for(this.u.fr(this.suggestions[0]),this.u!==this.B&&this.B.fr(this.suggestions[0]),a=0;a<uGa.length;++a){var b=uGa[a];if(this.suggestions&&this.suggestions[b]){this.videos[a]=new W4(this.player);var c=this.videos[a];b=this.suggestions[b];c.suggestion!==b&&(c.suggestion=b,V4(c,b));g.C(this,this.videos[a]);this.videos[a].ha(this.K.element)}}this.Od()}};
g.k.RE=function(a){1===a?(this.J=!1,this.C=this.videoData.clientPlaybackNonce,this.u.uk(),this.bb&&this.Od()):(this.J=!0,this.Ao()&&(2===a?this.u.mp():3===a&&this.u.Vm()))};
g.k.uM=function(a){a?this.RE(1):(this.C=null,this.J=!1)};
g.k.Pp=function(){return 1!==this.videoData.autonavState};
g.k.De=function(a){return(910>a.width||459>a.height)&&!(800>a.width&&!g5(a))&&!g5(a)};
g.k.Ao=function(){return this.bb&&g.HT(this.player)&&this.Pp()&&!this.C};
var uGa=[1,3,2,4];g.u(h5,a5);h5.prototype.oa=function(){var a=this.player.getVideoData();this.u.update({profilePicture:a.df,author:a.author});this.subscribeButton.channelId=a.lg;var b=this.subscribeButton;a.subscribed?b.B():b.C()};g.u(i5,g.U);i5.prototype.select=function(){(g.qT(this.api,this.suggestion.Na().videoId,this.suggestion.wd,this.suggestion.getPlaylistId(),void 0,this.suggestion.Qx||void 0)||this.api.aa("web_player_endscreen_double_log_fix_killswitch"))&&g.JT(this.api,this.element)};
i5.prototype.onClick=function(a){g.kU(a,this.api,this.B,this.suggestion.wd||void 0)&&this.select()};
i5.prototype.C=function(a){switch(a.keyCode){case 13:case 32:g.lp(a)||(this.select(),g.jp(a))}};
i5.prototype.Qa=function(){var a=this.api.getVideoData(),b=this.api.T();this.B=a.oc?!1:b.B};g.u(j5,a5);g.k=j5.prototype;g.k.create=function(){a5.prototype.create.call(this);var a=this.player.getVideoData();a&&(this.suggestions=qGa(this,a),this.videoData=a);this.Od();this.B.N(this.player,"appresize",this.Od);this.B.N(this.player,"onVideoAreaChange",this.Od);this.B.N(this.player,"videodatachange",this.Qa);this.B.N(this.player,"autonavchange",this.rz);this.B.N(this.player,"autonavcancel",this.wM);a=this.videoData.autonavState;a!==this.K&&this.rz(a);this.B.N(this.element,"transitionend",this.dR)};
g.k.destroy=function(){g.Dt(this.B);g.$f(this.stills);this.stills=[];this.suggestions=null;a5.prototype.destroy.call(this);g.un(this.element,"ytp-show-tiles");this.J.stop();this.K=this.videoData.autonavState};
g.k.Pp=function(){return 1!==this.videoData.autonavState};
g.k.show=function(){a5.prototype.show.call(this);g.un(this.element,"ytp-show-tiles");this.player.T().u?g.ln(this.J):this.J.start();(this.F||this.D&&this.D!==this.videoData.clientPlaybackNonce)&&g.uT(this.player,!1);k5(this)?(l5(this),2===this.videoData.autonavState?this.player.T().aa("fast_autonav_in_background")&&3===this.player.getVisibilityState()?this.u.select(!0):this.u.mp():3===this.videoData.autonavState&&this.u.Vm()):(g.uT(this.player,!0),l5(this))};
g.k.hide=function(){a5.prototype.hide.call(this);this.u.Vm();l5(this)};
g.k.dR=function(a){g.fp(a)===this.element&&this.Od()};
g.k.Od=function(){if(this.suggestions&&this.suggestions.length){g.J(this.element,"ytp-endscreen-paginate");var a=this.I.Ni(!0,this.I.isFullscreen()),b=g.lT(this.I);b&&(b=b.be()?48:32,a.width-=2*b);var c=a.width/a.height,d=96/54,e=b=2,f=Math.max(a.width/96,2),h=Math.max(a.height/54,2),l=this.suggestions.length,m=Math.pow(2,2);var n=l*m+(Math.pow(2,2)-m);n+=Math.pow(2,2)-m;for(n-=m;0<n&&(b<f||e<h);){var p=b/2,r=e/2,t=b<=f-2&&n>=r*m,w=e<=h-2&&n>=p*m;if((p+1)/r*d/c>c/(p/(r+1)*d)&&w)n-=p*m,e+=2;else if(t)n-=
r*m,b+=2;else if(w)n-=p*m,e+=2;else break}d=!1;n>=3*m&&6>=l*m-n&&(4<=e||4<=b)&&(d=!0);m=96*b;n=54*e;c=m/n<c?a.height/n:a.width/m;c=Math.min(c,2);m=Math.floor(Math.min(a.width,m*c));n=Math.floor(Math.min(a.height,n*c));a=this.table.element;g.Dg(a,m,n);g.og(a,{marginLeft:m/-2+"px",marginTop:n/-2+"px"});this.u.fr(this.suggestions[0]);this.u instanceof Y4&&this.u.Od();g.K(this.element,"ytp-endscreen-takeover",k5(this));l5(this);m+=4;n+=4;for(f=c=0;f<b;f++)for(h=0;h<e;h++)if(p=c,r=0,d&&f>=b-2&&h>=e-2?
r=1:0===h%2&&0===f%2&&(2>h&&2>f?0===h&&0===f&&(r=2):r=2),p=g.ae(p+this.C,l),0!==r){t=this.stills[c];t||(t=new i5(this.player),this.stills[c]=t,a.appendChild(t.element));w=Math.floor(n*h/e);var x=Math.floor(m*f/b),y=Math.floor(n*(h+r)/e)-w-4,E=Math.floor(m*(f+r)/b)-x-4;g.wg(t.element,x,w);g.Dg(t.element,E,y);g.og(t.element,"transitionDelay",(h+f)/20+"s");g.K(t.element,"ytp-videowall-still-mini",1===r);g.K(t.element,"ytp-videowall-still-large",2<r);r=t;p=this.suggestions[p];r.suggestion!==p&&(r.suggestion=
p,t=r.api.T(),w=g.sn(r.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",V4(r,p,w),g.wD(t)&&(t=p.Tk(),t=g.Id(t,g.OU("emb_rel_end")),r.za("url",t)),(p=(p=p.wd)&&p.itct)&&g.zN(r.api,r.element,p));c++}g.K(this.element,"ytp-endscreen-paginate",c<l);for(b=this.stills.length-1;b>=c;b--)e=this.stills[b],g.Ge(e.element),g.Zf(e);this.stills.length=c}};
g.k.Qa=function(){var a=this.player.getVideoData();this.videoData!==a&&(this.C=0,this.suggestions=qGa(this,a),this.videoData=a,this.Od())};
g.k.xM=function(){this.C+=this.stills.length;this.Od()};
g.k.yM=function(){this.C-=this.stills.length;this.Od()};
g.k.gE=function(){return this.u.xg()};
g.k.rz=function(a){1===a?(this.F=!1,this.D=this.videoData.clientPlaybackNonce,this.u.uk(),this.bb&&this.Od()):(this.F=!0,this.bb&&k5(this)&&(2===a?this.u.mp():3===a&&this.u.Vm()))};
g.k.wM=function(a){if(a){for(a=0;a<this.stills.length;a++)g.CN(this.I,this.stills[a].element,!0);this.rz(1)}else this.D=null,this.F=!1;this.Od()};
g.k.Ao=function(){return this.bb&&k5(this)};g.u(m5,g.tS);g.k=m5.prototype;g.k.JE=function(){var a=this.player.getVideoData(),b=!!(a&&a.suggestions&&a.suggestions.length);b=!rGa(this.player)||b;var c=a.qn||g.FD(a.Ra),d=g.Y0(this.player.app);a=a.mutedAutoplay;return b&&!c&&!d&&!a};
g.k.IE=function(){return this.endScreen.Ao()};
g.k.rL=function(){return this.IE()?this.endScreen.gE():!1};
g.k.ca=function(){g.GT(this.player,"endscreen");g.tS.prototype.ca.call(this)};
g.k.load=function(){var a=this.player.getVideoData();var b=a.hI;if(b&&b.videoId){var c=g.rT(this.player).Rc.get("heartbeat");a&&a.suggestions&&a.suggestions.length&&b.videoId===a.suggestions[0].id&&!a.OG?a=!1:(g.qT(this.player,b.videoId,void 0,void 0,!0,b),c&&c.Hu("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),a=!0)}else a=!1;a||(g.tS.prototype.load.call(this),this.endScreen.show())};
g.k.unload=function(){g.tS.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()};
g.k.Qa=function(){tGa(this);this.C&&sGa(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.u?this.endScreen=new e5(this.player):this.endScreen=new j5(this.player),g.C(this,this.endScreen),g.lP(this.player,this.endScreen.element,4))};g.aU.endscreen=m5;})(_yt_player);