(function(g){var window=this;'use strict';var hd=function(X){X.publish("cardstatechange",X.AB()&&X.Ew()?1:0)},zZ=function(X,J){var L=g.i8(J),x=L?J:arguments; for(L=L?0:1;L1&&(X.progress=1);X.B=1E3/(J-X.T);X.T=J;j33(X,X.progress);X.progress==1?(X.L=0,rU(X),X.onFinish(),X.mS()):X.isPlaying()&&X.PT()},j33=function(X,J){typeof X.j==="function"&&(J=X.j(J)); X.coords=Array(X.K.length);for(var L=0;L0&&(X.S.forEach(function(D){D.dispose()}),X.S.length=0); X.L&&(g.Qd(X.L,"ytp-ce-element-show"),X.L.setAttribute("aria-hidden","true"));X.W=0;if((X.endscreen=J)&&J.elements){L&&Uz8(X);L=[];x=new g.Rw(J.startMs,0x7ffffffffffff,{id:"ytp-ce-in-endscreen",namespace:"creatorendscreen"});L.push(x);X.player.G().K||(X.N=new g.R({V:"div",U:"ytp-ce-shadow"}),g.l0(X.player,X.N.element,4),X.j=new g.kE(X.N,200));for(x=0;x0?(g.xq(J.element,"ytp-ce-force-expand"),RR(X,L.id,!0)):(g.Qd(J.element,"ytp-ce-force-expand"),g.Qd(J.element,"ytp-ce-element-hover"),RR(X,L.id,!1))} function K(){Q(1)} function q(){Q(-1)} J.listen("mouseenter",function(){AB0(X,J,L)}); J.listen("mouseleave",function(){XtI(X,J,L)}); X.player.G().K||J.listen("click",function(){g.xq(J.element,"ytp-ce-element-hover")}); J.listen("click",function(C){JaS(X,L,C)}); J.listen("keypress",function(C){JaS(X,L,C)}); J.listen("focus",function(){AB0(X,J,L)}); J.listen("blur",function(){XtI(X,J,L)}); J.listen("touchstart",function(){AB0(X,J,L)}); var D=g.qG("ytp-ce-expanding-overlay-hider",J.element);D&&J.J(D,"touchstart",function(C){C.stopPropagation();g.Qd(J.element,"ytp-ce-element-hover");g.Qd(J.element,"ytp-ce-force-expand")}); J.listen("keydown",function(C){X.Km=C.keyCode===9&&!C.shiftKey}); x(g.qG("ytp-sb-subscribe",J.element));x(g.qG("ytp-sb-unsubscribe",J.element));J.listen("focus",K);J.listen("blur",q)},JaS=function(X,J,L){if(J.targetUrl&&(!L||L.type!=="keypress"||L.keyCode===13)){for(var x=L.target;x&&!g.Ls(x,"ytp-ce-element");){g.Ls(x,"subscribe-label")&&Lf8(X,J); if(g.Ls(x,"ytp-ce-channel-subscribe"))return;x=x.parentElement||null}if(!x||g.Ls(x,"ytp-ce-element-hover")){L.preventDefault();L.stopPropagation();if(x=X.K[J.id])XtI(X,x,J),x.element.blur();if(L.ctrlKey||L.metaKey||J.vM9==="new")Lf8(X,J),X.player.sendVideoStatsEngageEvent(17,void 0),X.player.pauseVideo(),L=g.IQ(lC(X,J.targetUrl)),L=g.i$(L),g.Ge(L,void 0,J.sessionData);else{var Q=g.$3(X.player.G())||X.player.getVideoData().UM,K=function(){var q=lC(X,J.targetUrl),D=J.sessionData,C=J.watchEndpoint,M= g.XU(q);Q&&M&&(M.v||M.list)?X.player.G7(M.v,D,M.list,!1,void 0,C||void 0):g.Te(q,D)}; Lf8(X,J,function(){X.player.sendVideoStatsEngageEvent(17,K)})}}}},lC=function(X,J){X=X.player.G(); if(J){if(J.startsWith("//"))return X.protocol+":"+J;if(J.startsWith("/"))return g.ac(X)+J}else return"";return J},AB0=function(X,J,L){g.Ls(J.element,"ytp-ce-element-hover")||(L.type==="VIDEO"||L.type==="PLAYLIST"?g.xq(J.element,"ytp-ce-element-hover"):X.player.G().K?(new g.sn(function(){g.xq(J.element,"ytp-ce-element-hover")},200)).start():g.xq(J.element,"ytp-ce-element-hover"),BG(X,L.uN),RR(X,L.id,!0))},XtI=function(X,J,L){g.Qd(J.element,"ytp-ce-element-hover"); g.Qd(J.element,"ytp-ce-force-expand");RR(X,L.id,!1)},RR=function(X,J,L){X.N&&(L?X.j.show():X.j.hide()); for(var x=g.d(Object.keys(X.K)),Q=x.next();!Q.done;Q=x.next())Q=Q.value,Q!==J&&g.q8(X.K[Q].element,"ytp-ce-element-shadow-show",L)},BG=function(X,J,L){function x(){K||(Q++,Q===J.length&&(q.stop(),L&&L()))} if(!J||J.length===0||fK(X))L&&L();else{J=xOS(X,J);var Q=0,K=!1,q=new g.sn(function(){K=!0;L&&L()},1E3,X); q.start();for(X=0;X1?X.charAt(0)==="/"&&X.charAt(1)!=="/":X==="/")&&(J=X.replace(/^(https?:)?\/\//,"").split("/",1),J=!J||J.length<1||!J[0]?[]:J[0].toLowerCase().split(".").reverse(),J=J[0]==="com"&&J[1]==="youtube"||J[0]==="be"&&J[1]==="youtu");return J?X.indexOf("/redirect?")===-1:!1},wt0=function(X,J){return J?J:aev(X)?"current":"new"},Ad=function(X,J){g.G.call(this); var L=this;this.element=X;this.context=J;this.Cm=!1;this.bB=new Map;this.SC=new Map;this.context.Z.addEventListener(g.sq("annotations_module"),function(x){(x=L.bB.get(x))&&x.apply(L)}); this.context.Z.addEventListener(g.N2("annotations_module"),function(x){(x=L.SC.get(x))&&x.apply(L)})},Xx=function(X,J,L,x,Q,K,q){X.context.L.listen(J,"click",function(D){X.k9(L,x,Q,K||[],q||0,D)}); X.context.L.listen(J,"touchstart",function(){X.Cm=!1}); X.context.L.listen(J,"touchmove",function(){X.Cm=!0})},tB3=function(X){var J; return((J=g.F(X,g.z2))==null?0:J.url)?g.F(X,g.z2).url:(X=g.F(X,g.Md))&&X.videoId?(J="/watch?v="+X.videoId,X.playlistId&&(J+="&list="+X.playlistId),X.index&&(J+="&index="+X.index),X.startTimeSeconds&&(J+="&t="+X.startTimeSeconds),J):null},Jh=function(X,J,L){return{zM:(X.impressionLoggingUrlsV2s||[]).map(function(x){return x.baseUrl||""}), click:(L.loggingUrls||[]).map(function(x){return x.baseUrl||""}), close:(J.dismissLoggingUrlsV2s||[]).map(function(x){return x.baseUrl||""}), TU:(J.impressionLoggingUrlsV2s||[]).map(function(x){return x.baseUrl||""}), xg:(J.clickLoggingUrlsV2s||[]).map(function(x){return x.baseUrl||""})}},dO0=function(X,J,L){Ad.call(this,J,L); var x=this;this.Z=X;this.eventId=null;this.Nx=this.vl=this.z6=this.N=this.isInitialized=!1;this.cards=[];this.A0=this.S=this.Bl=this.j=this.Hl=this.L=null;this.Km=[];this.aB=this.W=this.tO=this.gI=null;this.B=0;this.FE=new g.sn(function(){},L.m9.Xb?4E3:3E3); g.f(this,this.FE);this.O6=new g.sn(function(){}); g.f(this,this.O6);this.Pl=new ya0(L,function(Q,K,q,D,C,M){Xx(x,Q,K,q,D,C,M)}); this.D=new g.R({V:"div",U:"iv-drawer",X:{id:"iv-drawer"},C:[{V:"div",U:"iv-drawer-header",X:{"aria-role":"heading"},C:[{V:"span",U:"iv-drawer-header-text"},{V:"button",Ql:["iv-drawer-close-button","ytp-button"],X:{"aria-label":"Hide cards",tabindex:"0"}}]},{V:"div",U:"iv-drawer-content"}]});g.f(this,this.D);this.T=this.D.element;this.J0=new g.kE(this.D,330);g.f(this,this.J0);this.Lp=g.qG("iv-drawer-header-text",this.T);this.K=g.qG("iv-drawer-content",this.T);this.addCueRange(0,L.videoData.lengthSeconds* 1E3,"",function(){x.z6&&Lc(x,"YOUTUBE_DRAWER_AUTO_OPEN")},function(){(x.z6=x.N)&&xl(x)}); this.jC=new g.dS(this);g.f(this,this.jC);this.Z.addEventListener("videodatachange",this.vK.bind(this))},ubS=function(X,J){J=J.data; J.autoOpenMs&&X.addCueRange(J.autoOpenMs,0x8000000000000,"",function(){Lc(X,"YOUTUBE_DRAWER_AUTO_OPEN")}); J.autoCloseMs&&X.addCueRange(J.autoCloseMs,0x8000000000000,"",function(){xl(X)}); var L=J.headerText;g.tw(X.Lp,L);X.S&&X.S.setAttribute("title",L);J.eventId&&(X.eventId=J.eventId);X.gI=g.nf(J.trackingParams);X.W=g.nf(J.closeTrackingParams);X.tO=g.nf(J.iconTrackingParams)},on3=function(X,J){var L=J.cardId?J.cardId:"cr:"+X.B,x=X.Z.G().experiments.Mi("enable_error_corrections_infocard_web_client"); if(!J.content&&J.teaser.simpleCardTeaserRenderer&&x){var Q=J.teaser.simpleCardTeaserRenderer,K=J.icon?J.icon.infoCardIconRenderer:null;if(Q.channelAvatar&&Q.channelAvatar.thumbnails&&Q.channelAvatar.thumbnails.length>0)var q=i_(Q.channelAvatar.thumbnails,22,22).url;J={id:L,timestamp:X.B,type:"simple",teaserText:g.Dn(Q.message),teaserDurationMs:Number(J.cueRanges[0].teaserDurationMs),startMs:Number(J.cueRanges[0].startCardActiveMs),autoOpen:!!J.autoOpen,sessionData:{},sponsored:!1,mU:{},qI:null,b6:Q.trackingParams? g.nf(Q.trackingParams):null,tO:K&&K.trackingParams?g.nf(K.trackingParams):null,imageUrl:"",displayDomain:null,showLinkIcon:!1,IJ:null,title:"",customMessage:"",url:null,onClickCommand:Q.onTapCommand||null,ZM:q};Qi(X,J)}else{var D;if((D=J.content)==null?0:D.simpleCardContentRenderer){if(!J.cueRanges.length)return;q=(Q=J.content)==null?void 0:Q.simpleCardContentRenderer;Q=J.teaser.simpleCardTeaserRenderer;K=J.icon?J.icon.infoCardIconRenderer:null;J={id:L,timestamp:X.B,type:"simple",teaserText:g.Dn(Q.message), teaserDurationMs:Number(J.cueRanges[0].teaserDurationMs),startMs:Number(J.cueRanges[0].startCardActiveMs),autoOpen:!!J.autoOpen,sessionData:Kc(X,L,J,q),sponsored:!1,mU:Jh(q,Q,q.command),qI:q.trackingParams?g.nf(q.trackingParams):null,b6:Q.trackingParams?g.nf(Q.trackingParams):null,tO:K&&K.trackingParams?g.nf(K.trackingParams):null,imageUrl:i_(q.image.thumbnails,290,290).url,displayDomain:q.displayDomain?g.Dn(q.displayDomain):null,showLinkIcon:!!q.showLinkIcon,IJ:null,title:q.title?g.Dn(q.title):"", customMessage:q.callToAction?g.Dn(q.callToAction):"",url:g.F(q.command,g.z2).url?UX({pause_on_navigation:!X.context.videoData.isLivePlayback,target:"new",value:g.F(q.command,g.z2).url}):null,onClickCommand:null};Qi(X,J)}else{var C;if((C=J.content)==null?0:C.collaboratorInfoCardContentRenderer){if(!J.cueRanges.length)return;q=(K=J.content)==null?void 0:K.collaboratorInfoCardContentRenderer;Q=J.teaser.simpleCardTeaserRenderer;K=J.icon?J.icon.infoCardIconRenderer:null;J={id:L,timestamp:X.B,type:"collaborator", teaserText:g.Dn(Q.message),teaserDurationMs:Number(J.cueRanges[0].teaserDurationMs),startMs:Number(J.cueRanges[0].startCardActiveMs),autoOpen:!!J.autoOpen,sessionData:Kc(X,L,J,q),sponsored:!1,mU:Jh(q,Q,q.endpoint),qI:q.trackingParams?g.nf(q.trackingParams):null,b6:Q.trackingParams?g.nf(Q.trackingParams):null,tO:K&&K.trackingParams?g.nf(K.trackingParams):null,channelId:g.F(q.endpoint,g.G$).browseId,customMessage:q.customText?g.Dn(q.customText):null,profileImageUrl:i_(q.channelAvatar.thumbnails,290, 290).url,title:q.channelName?g.Dn(q.channelName):"",metaInfo:[q.subscriberCountText?g.Dn(q.subscriberCountText):""],url:UX({pause_on_navigation:!X.context.videoData.isLivePlayback,target:"new",value:g.F(q.endpoint,g.G$).canonicalBaseUrl?g.F(q.endpoint,g.G$).canonicalBaseUrl:"/channel/"+g.F(q.endpoint,g.G$).browseId}),onClickCommand:null};Qi(X,J)}else{var M;if((M=J.content)==null?0:M.playlistInfoCardContentRenderer){if(!J.cueRanges.length)return;var y;q=(y=J.content)==null?void 0:y.playlistInfoCardContentRenderer; Q=J.teaser.simpleCardTeaserRenderer;K=J.icon?J.icon.infoCardIconRenderer:null;J={id:L,timestamp:X.B,type:"playlist",teaserText:g.Dn(Q.message),teaserDurationMs:Number(J.cueRanges[0].teaserDurationMs),startMs:Number(J.cueRanges[0].startCardActiveMs),autoOpen:!!J.autoOpen,sessionData:Kc(X,L,J,q),sponsored:!1,mU:Jh(q,Q,q.action),qI:q.trackingParams?g.nf(q.trackingParams):null,b6:Q.trackingParams?g.nf(Q.trackingParams):null,tO:K&&K.trackingParams?g.nf(K.trackingParams):null,BV:i_(q.playlistThumbnail.thumbnails, 258,290).url,customMessage:q.customMessage?g.Dn(q.customMessage):null,playlistVideoCount:g.Dn(q.playlistVideoCount),title:q.playlistTitle?g.Dn(q.playlistTitle):"",metaInfo:[q.channelName?g.Dn(q.channelName):"",q.videoCountText?g.Dn(q.videoCountText):""],url:UX({pause_on_navigation:!X.context.videoData.isLivePlayback,target:"new",value:tB3(q.action)}),onClickCommand:null};Qi(X,J)}else{var n;if((n=J.content)==null?0:n.videoInfoCardContentRenderer){if(!J.cueRanges.length)return;var V;q=(V=J.content)== null?void 0:V.videoInfoCardContentRenderer;Q=J.teaser.simpleCardTeaserRenderer;K=J.icon?J.icon.infoCardIconRenderer:null;J={id:L,timestamp:X.B,type:"video",teaserText:g.Dn(Q.message),teaserDurationMs:Number(J.cueRanges[0].teaserDurationMs),startMs:Number(J.cueRanges[0].startCardActiveMs),autoOpen:!!J.autoOpen,sessionData:Kc(X,L,J,q),sponsored:!1,mU:Jh(q,Q,q.action),qI:q.trackingParams?g.nf(q.trackingParams):null,b6:Q.trackingParams?g.nf(Q.trackingParams):null,tO:K&&K.trackingParams?g.nf(K.trackingParams): null,BV:i_(q.videoThumbnail.thumbnails,258,290).url,videoDuration:q.lengthString?g.Dn(q.lengthString):null,customMessage:q.customMessage?g.Dn(q.customMessage):null,title:q.videoTitle?g.Dn(q.videoTitle):"",metaInfo:[q.channelName?g.Dn(q.channelName):"",q.viewCountText?g.Dn(q.viewCountText):""],isLiveNow:!!q.badge,url:UX({pause_on_navigation:!X.context.videoData.isLivePlayback,target:"new",value:tB3(q.action)}),onClickCommand:null};Qi(X,J)}}}}}X.B++},i_=function(X,J,L){for(var x=-1,Q=-1,K=0;K=J||(X[K].width||0)>=L)&&(Q<0||(X[Q].height||0)>(X[K].height||0)||(X[Q].width||0)>(X[K].width||0))&&(Q=K)}return X[Q>=0?Q:x]},Kc=function(X,J,L,x){return{feature:L.feature?L.feature:"cards", src_vid:X.context.videoData.videoId,annotation_id:J,ei:X.context.videoData.eventId||"",itct:x.trackingParams||""}},SYu=function(X,J){if(J=bM3(X,J))J===X.L&&(X.L=null),X.Z.removeCueRange(J.WO.id),g.aW(J.xw),g.u8(X.cards,J),X.X_(),qI(X)},Lc=function(X,J,L){if(!X.N){X.J0.show(); X.Hl=new g.sn(function(){g.xq(X.context.Z.getRootNode(),g.wf.IV_DRAWER_OPEN)},0); X.Hl.start();X.jC.J(X.K,"mousewheel",function(q){X.FE.start();q.preventDefault();q=q||window.event;var D=0;q.type=="MozMousePixelScroll"?D=0==(q.axis==q.HORIZONTAL_AXIS)?q.detail:0:window.opera?D=q.detail:D=q.wheelDelta%120==0?"WebkitTransform"in document.documentElement.style?window.chrome&&navigator.platform.indexOf("Mac")==0?q.wheelDeltaY/-30:q.wheelDeltaY/-1.2:q.wheelDelta/-1.6:q.wheelDeltaY/-3;if(q=D)X.K.scrollTop+=q}); X.N=!0;var x=g.Ow();x&&X.gI&&X.W&&g.kO(x,[X.gI,X.W]);J={TRIGGER_TYPE:J};for(var Q=g.d(X.cards),K=Q.next();!K.done;K=Q.next())K=K.value,K.f8||(K.f8=!0,PtF(X.context.logger,K.WO.mU.zM,J)),x&&g.kO(x,[K.WO.qI]);hd(X.Z);L&&(X.j=new g.sn(function(){X.Bl=X.S;X.A0.focus()},330),X.j.start())}},xl=function(X){X.N&&(X.J0.hide(),g.Sf(X.jC),g.Qd(X.context.Z.getRootNode(),g.wf.IV_DRAWER_OPEN),X.N=!1,hd(X.Z),X.j&&X.j.stop(),X.j=new g.sn(function(){X.Bl&&(X.Bl.focus(),X.Bl=null)},330),X.j.start())},cad=function(X){g.ic(X.kH(), [g.wf.STOP_EVENT_PROPAGATION, "iv-drawer-manager"]);g.l0(X.Z,X.T,5);X.x$();X.S=g.qG("ytp-cards-button",X.Z.getRootNode());X.A0=g.qG("iv-drawer-close-button",X.T);X.isInitialized=!0},Enu=function(X){X.Km.push(g.kt("iv-teaser-shown",X.Cl,X)); X.Km.push(g.kt("iv-teaser-hidden",X.X0,X));X.Km.push(g.kt("iv-teaser-clicked",X.X1,X));X.Nx=!0},YY3=function(X,J){var L; return J.onClickCommand&&((L=g.F(J.onClickCommand,g.I33))==null?void 0:L.targetId)==="engagement-panel-error-corrections"?(X.aB=J,!0):!1},hAC=function(X,J){X.aB=J; var L=X.Z.getVideoData();if(!L)return!1;L=g.F_(L);if(L==null?0:L.markersMap)for(var x,Q=0;((x=L)==null?void 0:x.markersMap.length)>Q;Q++){var K=void 0,q=(K=L)==null?void 0:K.markersMap[Q];if(q.key==="ERROR_CORRECTION_MARKERS"&&(K=void 0,(q=(K=q.value)==null?void 0:K.markers)&&q.length>0))return x=void 0,J.startMs=((x=g.F(q[0],g.m5P))==null?void 0:x.timeRangeStartMillis)||0,X.aB=null,!0}return!1},Qi=function(X,J){if(!YY3(X,J)||hAC(X,J)){var L=zAu(X,J); if(L){var x={WO:J,xw:L.element,f8:!1};if(J.onClickCommand)X.Z.Y("web_infocards_teaser_show_logging_fix")&&(X.Nx||Enu(X),SYu(X,J.id),L=X.findLastIndex(x),g.jI(X.cards,L,0,x));else{X.isInitialized||cad(X);SYu(X,J.id);var Q=X.findLastIndex(x);g.jI(X.cards,Q,0,x);L.zH(X.K,Q);X.X_()}J.autoOpen?X.addCueRange(J.startMs,0x8000000000000,J.id,function(){X.N||(X.L=x,qI(X),WfF(X,x),Lc(X,"YOUTUBE_DRAWER_AUTO_OPEN",!1))}):(L=X.context.Z.getCurrentTime()*1E3,L<5E3&&L>J.startMs&&ptu(X,x),X.addCueRange(J.startMs, J.startMs+1,J.id,function(){ptu(X,x)}),qI(X))}}},zAu=function(X,J){switch(J.type){case "simple":X=X.Pl; var L=J.displayDomain?{V:"div",U:"iv-card-image-text",iB:J.displayDomain}:void 0;var x=HMd(J);L={V:"div",Ql:["iv-card"],C:[{V:"a",U:"iv-click-target",X:{href:J.url?N5(J.url)||"":""},C:[kV(J.imageUrl,L),{V:"div",U:"iv-card-content",C:[mN("h2",void 0,J.title),x]}]}]};L=new g.R(L);Zt(X,g.Qt("iv-click-target",L.element),J,J.url);J=L;break;case "collaborator":X=X.Pl;L={V:"div",Ql:["iv-card","iv-card-channel"],C:[{V:"a",Ql:["iv-click-target"],X:{href:N5(J.url)||"","data-ytid":J.channelId},C:[kV(J.profileImageUrl), {V:"div",U:"iv-card-content",C:[nnH(J),{V:"h2",U:"iv-card-primary-link",iB:J.title},VB0(J)]}]}]};L=new g.R(L);Zt(X,g.Qt("iv-click-target",L.element),J,J.url);J=L;break;case "playlist":X=X.Pl;L={V:"div",Ql:["iv-card","iv-card-playlist"],C:[{V:"a",U:"iv-click-target",X:{href:N5(J.url)||""},C:[kV(J.BV,{V:"div",U:"iv-card-image-overlay",C:[{V:"span",U:"iv-card-playlist-video-count",iB:J.playlistVideoCount}]}),{V:"div",U:"iv-card-content",C:[nnH(J),mN("h2","iv-card-primary-link",J.title),VB0(J)]}]}]}; L=new g.R(L);Zt(X,g.Qt("iv-click-target",L.element),J,J.url);J=L;break;case "productListing":X=X.Pl;var Q=J.offers.length!=0;L=["iv-card"];x="";var K=HMd(J);Q&&(L.push("iv-card-product-listing"),x="iv-card-primary-link",K=J.offers[0],Q=[],K.price&&Q.push({V:"div",U:"iv-card-offer-price",iB:K.price}),K.merchant&&Q.push({V:"div",U:"iv-card-offer-merchant",iB:K.merchant}),K={V:"div",C:Q});Q=J.url?N5(J.url)||"":"";L={V:"div",Ql:L,X:{tabindex:"0"},C:[{V:"a",Ql:["iv-card-image","iv-click-target"],X:{style:"background-image: url("+ J.imageUrl+");",href:Q,"aria-hidden":"true",tabindex:"-1"}},{V:"div",U:"iv-card-content",C:[J.sponsored?{V:"div",U:"iv-card-sponsored",C:["Sponsored",{V:"div",U:"iv-ad-info-container",C:[{V:"div",U:"iv-ad-info",iB:"{{adInfo}}"},{V:"div",U:"iv-ad-info-icon-container",C:[{V:"div",U:"iv-ad-info-icon"},{V:"div",U:"iv-ad-info-callout"}]}]}]}:"",{V:"a",U:"iv-click-target",X:{href:Q},C:[mN("h2",x,J.title),K]}]}]};L=new g.R(L);x=g.MG("span");g.tw(x,"You are seeing this product because we think it is relevant to the video. Google may be compensated by the merchant."); L.e7(x,"adInfo");Zt(X,g.Qt("iv-click-target",L.element),J,J.url);J=L;break;case "video":X=X.Pl;x=J.videoDuration?{V:"span",U:"iv-card-video-duration",iB:J.videoDuration}:void 0;K=J.isLiveNow?{V:"span",Ql:["yt-badge","yt-badge-live"],iB:"LIVE NOW"}:null;Q={V:"div",Ql:["iv-card","iv-card-video"],C:[{V:"a",U:"iv-click-target",X:{href:((L=J.url)==null?void 0:N5(L))||""},C:[kV(J.BV,x),{V:"div",U:"iv-card-content",C:[nnH(J),mN("h2","iv-card-primary-link",J.title),VB0(J),K]}]}]};L=new g.R(Q);Zt(X,g.Qt("iv-click-target", L.element),J,J.url);J=L;break;default:return null}return J},raI=function(X){if(X.L)return X.L.WO.type==="productListing"; if(X.Z.Y("enable_wn_infocards")){var J;return!((J=X.cards)==null||!J.length)&&g.Ot(X.cards,function(L){return L.WO.type==="productListing"})}return g.Ot(X.cards,function(L){return L.WO.type==="productListing"})},qI=function(X){g.q8(X.Z.getRootNode(),"ytp-cards-shopping-active",raI(X))},ptu=function(X,J){if(!g.Ls(X.Z.getRootNode(),"ytp-cards-teaser-shown")){if(X.L!==J){var L=g.Ow(),x=X.L?X.L.WO.tO:X.tO; L&&x&&g.Z4(L,[x]);X.L=J;qI(X)}(L=X.isInitialized&&X.kH().style.display=="none")||(L=X.context.Z.getPlayerState(),x=L===0&&X.context.Z.getCurrentTime()===0,L=!(L===1||L===3||x));if(!L&&J.WO.teaserDurationMs){var Q;L={teaserText:J.WO.teaserText,durationMs:J.WO.teaserDurationMs,onClickCommand:J.WO.onClickCommand,ZM:(Q=J.WO.ZM)!=null?Q:null};X.Z.B3(!0,L)}X.O6.isActive()||((!X.N||!X.FE.isActive()&&X.vl)&&WfF(X,J),X.O6.start(910+J.WO.teaserDurationMs))}},WfF=function(X,J){X.D.RB?(J=new vG([0, X.K.scrollTop],[0,J.xw.offsetTop],600,eWu),X.context.N.listen(J,"animate",function(L){X.K.scrollTop=L.y}),X.context.N.listen(J,"finish",function(L){X.K.scrollTop=L.y}),J.play()):(X.D.LO(!0),X.K.scrollTop=J.xw.offsetTop,X.D.LO(!1))},I5=function(X){return X.L&&X.L.WO?X.L.WO:X.cards[0]&&X.cards[0].WO?X.cards[0].WO:null},bM3=function(X,J){return g.Ou(X.cards,function(L){return L.WO.id===J})},g$=function(X,J,L){Ad.call(this,X,J); this.annotation=L;this.isActive=!1},vne=function(X){var J=X.annotation.data; "start_ms"in J&&"end_ms"in J&&X.addCueRange(Number(J.start_ms),Number(J.end_ms),X.annotation.id,function(){X.show()},function(){X.hide()})},DS=function(X,J,L){g$.call(this,X,J,L); this.K=null;this.W=!1;this.N=null;this.T=!1;this.L=this.B=this.j=null},juF=function(X,J){var L=L===void 0?0:L; var x=zWH(J).width;g.m9(J,x);L=new GtC(J,[x,J.offsetTop],[x-x-L,J.offsetTop],200,fxv);g.f(X,L);X.context.N.listen(L,"begin",function(){g.LQ(J,!0)}); L.play()},fe0=function(X,J){if(J.channel_name){var L=X.createElement({V:"div", Ql:["iv-branding-context-name"],iB:J.channel_name}),x=X.createElement({V:"div",Ql:["iv-branding-context-subscribe"]}),Q=J.standalone_subscribe_button_data;Q&&(X.L=new g.iQ(Q.subscribeText,Q.subscribeCount,Q.unsubscribeText,Q.unsubscribeCount,!!Q.enabled,!!Q.classic,J.channel_id,!!Q.subscribed,Q.feature,J.session_data.itct,X.context.Z,!1),X.L.zH(x));var K=X.createElement({V:"div",Ql:["iv-branding-context-subscribe-caret"]}),q=X.createElement({V:"div",Ql:["branding-context-container-inner"]});q.appendChild(K); q.appendChild(L);q.appendChild(x);g.LQ(q,!1);var D=X.createElement({V:"div",Ql:["branding-context-container-outer"]});D.appendChild(q);g.lF(D,"right",J.image_width+"px");g.Vt(X.kH(),D);X.N=new g.sn(function(){Tz3(X,q,D)},500); g.f(X,X.N);X.context.L.listen(X.kH(),"mouseover",function(){GRH(X,q,D,K,J.image_height)}); X.context.L.listen(X.kH(),"mouseout",function(){X.N.start()})}},GRH=function(X,J,L,x,Q){X.N.stop(); if(!X.T){var K=g.JB(J);X.L||(J.style.width=g.U9(K.width,!0),L.style.width=g.U9(K.width,!0));g.lF(x,"top",K.height-Math.max(Math.min(K.height,Q)/2+10,20)+"px");g.lF(x,"right","1px");X.T=!0;g.LQ(J,!0);X.j=new g.sn(function(){g.xq(this.kH(),"iv-branding-active")},0,X); X.j.start()}},Tz3=function(X,J,L){g.Qd(X.kH(),"iv-branding-active"); X.B=new g.sn(function(){g.LQ(J,!1);X.L||(L.style.width=g.U9(0,!0))},250); X.B.start();X.T=!1},eAV=function(X,J,L,x,Q,K,q){this.L=X; this.N=J;this.m9=L;this.videoData=x;this.logger=Q;this.Z=K;this.K=q},FfH=function(X,J,L){g$.call(this,X,J,L); var x=this;this.S=this.isCollapsed=this.D=!1;this.B=5E3;this.K=this.N=this.L=this.T=null;this.W=this.createElement({V:"div",Ql:["iv-promo-contents"]});this.j=new g.sn(function(){x.L.setAttribute("aria-hidden","true");g.LQ(x.N,!1);g.LQ(x.K,!0)},700,this); g.f(this,this.j)},RAF=function(X){var J=X.annotation.data; if(X.annotation.style==="cta")var L=6;else if(X.annotation.style==="video"||X.annotation.style==="playlist")L=7;X.B=J.collapsedelay_ms||X.B;var x=["iv-promo","iv-promo-inactive"];X.kH().setAttribute("aria-hidden","true");X.kH().setAttribute("aria-label","Promotion");X.kH().tabIndex=0;var Q=X.annotation.Eo(),K=J.image_url;if(K){var q=X.createElement({V:"div",Ql:["iv-promo-img","iv-click-target"]});K=X.createElement({V:"img",X:{src:K,"aria-hidden":"true"}});q.appendChild(K);J.video_duration&&!J.is_live? (K=X.createElement({V:"span",U:"iv-promo-video-duration",iB:J.video_duration}),q.appendChild(K)):J.playlist_length&&(K=X.createElement({V:"span",U:"iv-promo-playlist-length",iB:J.playlist_length.toString()}),q.appendChild(K));Q&&Xx(X,q,Q,X.annotation.id,J.session_data,void 0,L)}Q?(K=X.createElement({V:"a",U:"iv-promo-txt"}),g.D3(K,N5(Q)),X.L=K):X.L=X.createElement({V:"div",U:"iv-promo-txt"});switch(X.annotation.style){case "cta":case "website":var D=X.createElement({V:"p",C:[{V:"strong",iB:J.text_line_1}]}); var C=X.createElement({V:"p",C:[{V:"span",U:"iv-promo-link",iB:J.text_line_2}]});if(K=J.text_line_3){x.push("iv-promo-website-card-cta-redesign");var M=X.createElement({V:"button",Ql:["iv-promo-round-expand-icon","ytp-button"]});K=X.createElement({V:"button",Ql:["iv-button","iv-promo-button"],C:[{V:"span",U:"iv-button-content",iB:K}]});var y=X.createElement({V:"div",U:"iv-promo-button-container"});y.appendChild(K);Q&&Xx(X,X.kH(),Q,X.annotation.id,J.session_data,void 0,L)}g.xq(X.L,"iv-click-target"); Q&&Xx(X,X.L,Q,X.annotation.id,J.session_data,void 0,L);break;case "playlist":case "video":D=X.createElement({V:"p",C:[{V:"span",iB:J.text_line_1}]}),C=X.createElement({V:"p",C:[{V:"strong",iB:J.text_line_2}]}),J.is_live&&(D=C,C=X.createElement({V:"span",Ql:["yt-badge","iv-promo-badge-live"],iB:"LIVE NOW"})),g.xq(X.L,"iv-click-target"),Q&&Xx(X,X.L,Q,X.annotation.id,J.session_data,void 0,L),x.push("iv-promo-video")}D&&X.L.appendChild(D);C&&X.L.appendChild(C);X.W.appendChild(X.L);y&&X.W.appendChild(y); L=X.createElement({V:"div",U:"iv-promo-actions"});X.K=X.createElement({V:"button",Ql:["iv-promo-expand","ytp-button"]});X.K.title="Expand";X.context.L.listen(X.K,"click",function(n){leF(X,5E3,n)}); L.appendChild(X.K);g.LQ(X.K,!1);X.context.L.listen(X.kH(),"mouseover",X.ox,X);X.context.L.listen(X.kH(),"mouseout",X.J7,X);X.context.L.listen(X.kH(),"touchend",function(n){leF(X,5E3,n)}); X.N=X.createElement({V:"button",Ql:["iv-promo-close","ytp-button"]});X.N.title="Close";X.context.L.listen(X.N,"click",X.annotation.style==="cta"&&J.text_line_3?X.WF:X.HF,X);L.appendChild(X.N);g.ic(X.kH(),x);q&&(g.Vt(X.kH(),q),M&&q.appendChild(M));g.Vt(X.kH(),X.W);g.Vt(X.kH(),L)},leF=function(X,J,L){L.stopPropagation(); BzS(X);suH(X,J);X.L.focus()},Nz3=function(X){X.isCollapsed||X.S||X.T||(g.xq(X.kH(),"iv-promo-collapsed"),X.isCollapsed=!0,X.j.start())},BzS=function(X){X.j.stop(); X.isCollapsed&&(g.Ks(X.kH(),["iv-promo-collapsed","iv-promo-collapsed-no-delay"]),X.isCollapsed=!1,X.L&&X.L.removeAttribute("aria-hidden"),g.LQ(X.K,!1),g.LQ(X.N,!0))},suH=function(X,J){X.T||(X.T=g.v4(function(){UOS(this); Nz3(this)},J,X))},UOS=function(X){X.T&&(g.Ao.clearTimeout(X.T),X.T=null)},mOd=function(X){this.Z=X},PtF=function(X,J,L){J&&(L?$l(X,J.map(function(x){return g.cN(x,L)})):$l(X,J))},$l=function(X,J,L,x){var Q=1,K=void 0,q=-1; if(L){var D=!1;K=function(){Q--;Q||D||(clearTimeout(q),D=!0,L())}; q=setTimeout(function(){D=!0;L()},1E3)}J=g.d(J||[]); for(var C=J.next();!C.done;C=J.next())C=C.value,Q++,g.zp(C,K);x&&(Q++,x!==0&&X.Z.sendVideoStatsEngageEvent(x,K))},kRF=function(X){g.bf.call(this,X); var J=this;this.Km=this.S=!1;this.loadNumber=0;this.B={};this.logger=new mOd(this.player);this.T=new g.dS(this);this.j=this.W=null;this.events=new g.dS(this);this.ai=this.D=this.L=null;this.aB=[];g.f(this,this.T);this.T.J(this.player,"onVideoAreaChange",function(){J.publish("onVideoAreaChange")}); this.T.J(this.player,"onHideControls",function(){J.publish("onHideControls")}); this.T.J(this.player,"onShowControls",function(){J.publish("onShowControls")}); this.T.J(this.player,"resize",function(x){J.publish("resize",x)}); this.T.J(this.player,"presentingplayerstatechange",function(x){J.publish("presentingplayerstatechange",x)}); this.subscribe("presentingplayerstatechange",this.l7,this);this.subscribe("resize",this.L4,this);this.player.G().jC.subscribe("vast_info_card_add",this.q1,this);g.f(this,this.events);this.Pl=this.createElement({V:"div",U:"video-custom-annotations"});this.K=new g.R({V:"div",Ql:["ytp-player-content","ytp-iv-player-content"]});g.f(this,this.K);g.l0(this.player,this.K.element,4);this.K.hide();this.N=new g.R({V:"div",Ql:["ytp-iv-video-content"]});g.f(this,this.N);X=this.createElement({V:"div",U:"video-annotations"}); X.appendChild(this.Pl);this.N.element.appendChild(X);this.yX()&&this.load();var L=this.createElement({V:"style"});(g.iF("HEAD")[0]||document.body).appendChild(L);this.addOnDisposeCallback(function(){g.aW(L)}); if(X=L.sheet)X.insertRule(".iv-promo .iv-promo-contents .iv-promo-txt .iv-promo-link:after {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUBAMAAAB/pwA+AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAHlBMVEVMaXH////////////////////////////////////Z6AnKAAAACXRSTlMA+/A2IuI1mJIldm0CAAAAAWJLR0QB/wIt3gAAAEVJREFUCNdjYGCYCQUMBJlACOIzIDElIcyZkwxgojOVWWDMSQauMKYySySUOSnBdSaUOZ0lEsac2YqwYiZ+JhwgM7E5HACgzVCI/YJ59AAAAABJRU5ErkJggg==) no-repeat center;background-size:10px;width:10px;height:10px}", 0),X.insertRule(".iv-promo .iv-promo-actions .iv-promo-close:after {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJBAMAAAASvxsjAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAJFBMVEVMaXH///////////////////////////////////////////9tKdXLAAAAC3RSTlMAVaQDpaimqQbl5rjXUFUAAAABYktHRAH/Ai3eAAAAPUlEQVQI12MQMmAwEmDwDmaOTmAw39663YCBuXp2MQMDQ+fOBgYG5ujVwQwMptvbgeLaxczVCQwiBgxmAgBkXg1FN5iwiAAAAABJRU5ErkJggg==) no-repeat center;background-size:9px;width:9px;height:9px}", 0),X.insertRule(".iv-promo .iv-promo-actions .iv-promo-expand:after {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAJBAMAAADnQZCTAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAJFBMVEVMaXHMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMz////eMKB4AAAAC3RSTlMAOpE7k5Uvj5kpfRaQSaQAAAABYktHRAsf18TAAAAAHklEQVQI12MQYGBQZmBwTWCo0GSo6AKRQDZQRIABADXXA/UkIpvtAAAAAElFTkSuQmCC) no-repeat center;background-size:4px 9px;width:4px;height:9px}",0),X.insertRule(".iv-promo-website-card-cta-redesign .iv-promo-round-expand-icon:after {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfgCgUUEztsNfqrAAAAXklEQVRYw+3Uuw2AQAwEUUNXfBpDIvBRMhQwJJAScNrA0r4CdiQHjjAzK4NGKucPAFmCnZcmwcTphBNO9CTGH4VB+/Zm6YlYis9fhedXz38FNvFriCCl808iw8ysrBu65gCeuV/CfgAAAABJRU5ErkJggg==) no-repeat center;background-size:18px 18px;width:18px;height:18px}", 0),X.insertRule(".iv-card-link-icon {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASBAMAAACk4JNkAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAGFBMVEVMaXG7u7u7u7u7u7u7u7u7u7u7u7v///+WKTAlAAAABnRSTlMAFdQWbGj9GiOuAAAAAWJLR0QHFmGI6wAAAEhJREFUCNdjYACBNCBgQGMxMKrBWEJJaRAJRjVlKEsoSQDIAqtSZICwgEIQFkgIZBRECMxiBqsCsVjAqsCygQwwFgMeFgQgswBg2xjLrfC4mgAAAABJRU5ErkJggg==) no-repeat center;background-size:9px;width:9px;height:9px}",0),X.insertRule(".iv-card-playlist-video-count:after {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYBAMAAAASWSDLAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAJFBMVEVMaXH///////////////////////////////////////////9tKdXLAAAAC3RSTlMAvDeyLvxYtDK9Ogx4T1QAAAABYktHRAH/Ai3eAAAAK0lEQVQY02NgoBjshgO8HJoYwKiAMGAD92YHJM7uMCTO9gaEHs4FlPuZAQC8Fj8x/xHjxwAAAABJRU5ErkJggg==) no-repeat center;background-size:24px;width:24px;height:24px}", 0),X.insertRule(".iv-drawer-close-button:after {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAgMAAAArG7R0AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACVBMVEVMaXH////////OZTV/AAAAAnRSTlMAoKBFbtAAAAABYktHRAH/Ai3eAAAAKUlEQVQI12MIYGBlSGGQBMIUBjbHCQyM0xwYGDIZwBjEBomB5EBqgGoBolQGzYuy51cAAAAASUVORK5CYII=) no-repeat center;background-size:12px;width:12px;height:12px}",0),X.insertRule(".iv-ad-info-icon {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAMAAACecocUAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAVFBMVEVMaXGUlJSYmJiZmZmYmJiXl5eZmZmZmZmWlpaVlZWOjo6ZmZmSkpKXl5eYmJiYmJiZmZmZmZmZmZmZmZmYmJiJiYmXl5eZmZmYmJiWlpaZmZn///+81lbeAAAAGnRSTlMAE5DM80DliTMMEjccWIM5p1UjaTQNgB5cLlr5mgUAAAABYktHRBsCYNSkAAAAVElEQVQI102NRw7AIBADhw7ppIf/PzQLJ/ZgWSNrFlDaWKMVcs6HmGLwTqjEME6CFDrAXBYIGhNh3TJEg02wHydctvFc7sbrvnXZV8/zfs3T+7u/P7CrAso35YfPAAAAAElFTkSuQmCC) no-repeat center;background-size:11px;width:11px;height:11px}", 0),X.insertRule(".annotation-close-button {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAALVBMVEVMaXEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/Pz9aWloBAQGZmZlbW1v///+X9wUzAAAACHRSTlMANprf+g6lyRmB9hUAAAABYktHRA5vvTBPAAAAWUlEQVQI12NgYBAycVZkAIKwDiBIZWBgrQAx2gMY2DrAIIFBomPWju6VHY0MGh1rbu891dHEYNGx9+yd2x3NDB4d3XfO7uhoQTDgUnDFcO1wA+FWwC2FOQMAdKg6tUSAFEAAAAAASUVORK5CYII=) no-repeat center}",0),X.insertRule(".annotation-link-icon {background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAMAAAANmfvwAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAUVBMVEVMaXH////////////////////////////////////////////////////////////////////////////////////////////////////////JzkR1AAAAGnRSTlMAfXf+c3xsdGdv/GJoXPtXXflSVk5L7DBH9VeFfsQAAAABYktHRAH/Ai3eAAAAgElEQVQ4y93SSQ6AIAwFULSOOOJs739Qf9SF0VA2uNCu+psHaQJK7cVCqY+Rg92PXA++Q84KnCR03UIRJrFEKMEgZYFQhpyzQHSBWJJAdIVUENtJ3SC0mu3EdOh7zXZiBrRdzQLJ0Y1GfOlpVstD3HaZktX9X/gvRCxvxL6FR7IBS1RTM5xIpLoAAAAASUVORK5CYII=) no-repeat center}", 0)},ZM0=function(X){X=X.createElement({V:"div", Ql:["annotation","annotation-type-custom"]});g.LQ(X,!1);return X},Aau=function(X,J){J=!J.isCued()&&!g.N(J,1024); X.K.LO(J);X.N.LO(J)},XTu=function(X,J,L){X.S=!0; X.j=g.t8(J,L)},JK0=function(X,J){for(var L={},x=g.d(J.attributes),Q=x.next();!Q.done;Q=x.next())Q=Q.value,L[Q.name]=Q.nodeValue; for(x=0;x0&&(K=Q.childNodes[0].nodeValue,L[Q.tagName]=typeof K==="string"?K.trim():K);continue}else K=[],L[Q.tagName]=K;Q&&Q.tagName==="TEXT"?Q.childNodes.length===1&&Q.childNodes[0].nodeType===3?K.push(Q.childNodes[0].nodeValue):K.push(""):Q&&K.push(JK0(X,Q))}return L},Q6F=function(X){var J=X.player.getVideoData(); if(J.jC){var L=X.player.G().jC.get(J.videoId);if(L){var x={format:"XML",urlParams:{},method:"POST",withCredentials:!0,onFinish:function(Q,K,q){Q=X.loadNumber;K=J.videoId;X.loaded&&X.loadNumber===Q&&X.player.getVideoData().videoId===K&&(q=g.DE(q)&&q.responseXML?q.responseXML:null)&&Ld8(X,q)}}; g.k1()&&(x.onFinish=xwu(X,x.onFinish));x.postParams={ic_only:"1"};iHS(x,L);X.S=!0;g.t8(J.jC,x)}}},iHS=function(X,J){X.method="POST"; X.postParams=X.postParams||{};J.rb&&(X.postParams.ic_coll=J.rb);J.pH&&(X.postParams.ic_xml=J.pH);J.YD&&(X.postParams.ic_track=J.YD)},Kdu=function(X){var J=new g.R({V:"div"}); g.LQ(J.element,!1);var L=new dO0(X.player,J.element,Cc(X));g.f(L,J);J.zH(X.K.element);L.LR();return L},IDv=function(X,J){var L,x; if(J=(L=J.getWatchNextResponse())==null?void 0:(x=L.cards)==null?void 0:x.cardCollectionRenderer)X.Km=!0,qE8(X,J),J.headerText&&X.ai&&(L=g.Dn(J.headerText),X.ai.setAttribute("title",L))},Cc=function(X){if(!X.D){var J=new FQ0(X); g.f(X,J);var L=new g.Vj(X);g.f(X,L);X.D=new eAV(J,L,X.player.G(),X.player.getVideoData(),X.logger,X.player,X.iJ)}return X.D},Ld8=function(X,J){var L=!1,x=J.getElementsByTagName("annotations"); if(x&&!(x.length<1)&&(x=x[0].getAttribute("itct"))){var Q=g.Ow();if(Q){var K=g.HM();K&&g.ND(g.Tc)(void 0,Q,K,[g.nf(x)])}}J=J.getElementsByTagName("annotation");for(x=0;x=q)Q=K,x=q}x=yKH[Q];this.N&&g.lF(this.N.element,"outline-width",Math.max(J.width,J.height)+"px");for(J=0;J256||K>256?g.xq(Q.element,"ytp-ce-large-round"):C>96||K>96?g.xq(Q.element,"ytp-ce-medium-round"):g.xq(Q.element,"ytp-ce-small-round");g.Ks(Q.element,VpH);C=q.left+q.width/2;q=q.top+D/2;g.xq(Q.element,C<=.5&&q<=.5?"ytp-ce-top-left-quad":C>.5&&q<=.5?"ytp-ce-top-right-quad": C<=.5&&q>.5?"ytp-ce-bottom-left-quad":"ytp-ce-bottom-right-quad");g.Ks(Q.element,yKH);g.xq(Q.element,x);(Q=g.Kj(document,"div","ytp-ce-expanding-overlay-body",Q.element)[0])&&g.lF(Q,"height",K+"px")}}}}}; g.a.onCueRangeEnter=function(X){if(this.endscreen)if(X.getId()==="ytp-ce-in-endscreen")BG(this,this.endscreen.impressionUrls),(X=g.Ow())&&this.endscreen.visualElement&&g.mj(X,this.endscreen.visualElement),this.L&&(g.xq(this.L,"ytp-ce-element-show"),this.L.removeAttribute("aria-hidden"),this.player.AB()?g.xq(this.L,"ytp-ce-hide-button-lower"):g.Qd(this.L,"ytp-ce-hide-button-lower"));else{X=X.getId().substring(15);var J=this.K[X],L=this.B[X];g.xq(J.element,"ytp-ce-element-show");J.element.removeAttribute("aria-hidden"); J=this.player.getRootNode();g.xq(J,"ytp-ce-shown");BG(this,L.impressionUrls);(J=g.Ow())&&g.mj(J,L.visualElement);this.player.G().S&&this.player.GH("endscreenelementshown",X)}}; g.a.onCueRangeExit=function(X){if(X.getId()==="ytp-ce-in-endscreen")this.L&&(g.Qd(this.L,"ytp-ce-element-show"),this.L.setAttribute("aria-hidden","true"));else{X=X.getId().substring(15);var J=this.K[X];g.Qd(J.element,"ytp-ce-element-show");J.element.setAttribute("aria-hidden","true");J=this.player.getRootNode();g.Qd(J,"ytp-ce-shown");this.player.G().S&&this.player.GH("endscreenelementhidden",X)}}; g.a.Vk6=function(X){var J=this;X.target===window&&(new g.sn(function(){for(var L=g.d(Object.values(J.K)),x=L.next();!x.done;x=L.next())g.Ks(x.value.element,["ytp-ce-force-expand","ytp-ce-element-hover","ytp-ce-element-shadow-show"])},0)).start()}; g.a.LO=function(X){for(var J=g.d(Object.values(this.K)),L=J.next();!L.done;L=J.next())L=L.value,X?L.element.setAttribute("hidden",""):L.element.removeAttribute("hidden")}; g.a.GKm=function(X){this.L&&this.player.getRootNode().removeChild(this.L);X&&(g.xq(X,"ytp-ce-hide-button-container"),this.L=X,g.l0(this.player,this.L,4))}; var MpH=[346,426,470,506,570,640,853,1280,1920],yKH="ytp-ce-size-346 ytp-ce-size-426 ytp-ce-size-470 ytp-ce-size-506 ytp-ce-size-570 ytp-ce-size-640 ytp-ce-size-853 ytp-ce-size-1280 ytp-ce-size-1920".split(" "),VpH=["ytp-ce-top-left-quad","ytp-ce-top-right-quad","ytp-ce-bottom-left-quad","ytp-ce-bottom-right-quad"],nc0=["ytp-ce-small-round","ytp-ce-medium-round","ytp-ce-large-round"];var qYF={l3q:"current",dll:"new"};var gnV={CLOSE:"close",JKl:"openUrl",SUBSCRIBE:"subscribe"},DOC={W4C:"click",CLOSE:"close",ABH:"hidden",Z$0:"rollOut",EZl:"rollOver",Jvl:"shown"};Ct0.prototype.Eo=function(){var X=MBu(this,function(J){return J.type==="openUrl"&&J.url!=null}); return X?X.url:null}; var DwI={siI:"anchored",qR:"branding",CHANNEL:"channel",CJ0:"cta",yBl:"highlightText",SQM:"label",PLAYLIST:"playlist",POPUP:"popup",O$i:"speech",SUBSCRIBE:"subscribe",mXH:"title",VIDEO:"video",b1H:"website"},gcd={qR:"branding",vWY:"card",ub0:"drawer",R1l:"highlight",aKC:"marker",LAl:"promotion",TEXT:"text",Fdl:"widget"};g.w(Ad,g.G);g.a=Ad.prototype;g.a.addCueRange=function(X,J,L,x,Q){X=new g.Rw(X,J,{id:L,namespace:"annotations_module"});x&&this.bB.set(X,x);Q&&this.SC.set(X,Q);this.context.Z.tj([X],1)}; g.a.LR=function(){this.context.K.subscribe("resize",this.X_,this)}; g.a.kH=function(){return this.element}; g.a.k9=function(X,J,L,x,Q,K){if(this.Cm)return!1;K&&(K.stopPropagation(),K.preventDefault());this.navigate(X,L,x,Q);return!1}; g.a.show=function(){}; g.a.hide=function(){}; g.a.destroy=function(){g.aW(this.kH())}; g.a.X_=function(){}; g.a.navigate=function(X,J,L,x){var Q=this,K=N5(X);if(K){var q=wt0(K,X.target),D=function(){X.L&&Q.context.Z.pauseVideo();var C=Q.context.videoData.UM||!1,M=g.XU(K||"");C&&M&&(M.v||M.list)?Q.context.Z.G7(M.v,J,M.list,!1):g.Ge(K||"",q==="current"?"_top":void 0,J)}; q==="new"&&(D(),D=null);$l(this.context.logger,L,D,x);aev(K)||(L=g.Ow(),x=J.itct,L&&x&&g.AR(L,g.nf(x)))}}; g.a.uB=function(){this.bB.clear();this.SC.clear();g.G.prototype.uB.call(this)}; g.a.createElement=function(X){X=new g.R(X);g.f(this,X);return X.element};g.w(dO0,Ad);g.a=dO0.prototype;g.a.vK=function(){this.aB&&Qi(this,this.aB)}; g.a.isAvailable=function(){var X;if(X=!!this.cards.length)(X=this.Z.getRootNode())?(X=g.JB(X),X=173L.WO.startMs||X.WO.startMs===L.WO.startMs&&X.WO.timestamp>=L.WO.timestamp?!0:!1}); return J===-1?0:J+1}; g.a.qJ=function(){if(this.N){$l(this.context.logger,I5(this).mU.close);var X=g.Ow();X&&this.W&&g.AR(X,this.W);xl(this)}}; g.a.yW=function(){g.q8(this.T,"iv-drawer-scrolled",this.K.scrollTop>0)}; g.a.t$=function(){var X=g.Ow(),J=I5(this);J=J?J.tO:this.tO;X&&J&&g.kO(X,[J])}; g.a.eU=function(){var X=g.Ow(),J=I5(this);J=J?J.tO:this.tO;X&&J&&g.Z4(X,[J])}; g.a.Cl=function(){var X=I5(this);$l(this.context.logger,X.mU.TU);var J=g.Ow();if(J&&X)if(this.Z.Y("web_infocards_teaser_show_logging_fix")){var L=[];X.b6&&L.push(X.b6);X.tO&&L.push(X.tO);L.length>0&&g.kO(J,L)}else g.kO(J,[X.b6,X.tO])}; g.a.X0=function(){var X=g.Ow(),J=I5(this);X&&J&&g.Z4(X,[J.b6])}; g.a.X1=function(X){var J=I5(this),L=g.Ow();this.L?X?(X=this.context.logger,$l(X,J.mU.xg),X.Z.sendVideoStatsEngageEvent(4,void 0),L&&J.b6&&g.AR(L,J.b6)):(X=this.context.logger,$l(X,J.mU.xg),X.Z.sendVideoStatsEngageEvent(4,void 0),L&&J.tO&&g.AR(L,J.tO)):(X=this.context.logger,$l(X,J.mU.xg),X.Z.sendVideoStatsEngageEvent(4,void 0),L&&this.tO&&g.AR(L,this.tO))};g.w(g$,Ad);g$.prototype.LR=function(){Ad.prototype.LR.call(this);vne(this)}; g$.prototype.show=function(){Ad.prototype.show.call(this);var X=g.Ow(),J=this.annotation.data;X&&J&&(J=J.session_data)&&g.kO(X,[g.nf(J.itct)])}; g$.prototype.hide=function(){Ad.prototype.hide.call(this);var X=g.Ow(),J=this.annotation.data;X&&J&&(J=J.session_data)&&g.Z4(X,[g.nf(J.itct)])};g.w(DS,g$); DS.prototype.show=function(){if(!this.isActive){g$.prototype.show.call(this);if(!this.W){g.xq(this.kH(),"iv-branding");var X=this.annotation.data;this.K=this.createElement({V:"img",Ql:["branding-img","iv-click-target"],X:{"aria-label":"Channel watermark",src:X.image_url,width:X.image_width,height:X.image_height}});g.LQ(this.K,!1);var J=this.createElement({V:"button",Ql:["branding-img-container","ytp-button"]});J.appendChild(this.K);this.kH().appendChild(J);var L=this.annotation.Eo();L&&Xx(this,J, L,this.annotation.id,X.session_data);this.context.Z.Y("disable_branding_context")||fe0(this,X);this.W=!0}g.LQ(this.kH(),!0);this.isActive=!0;if(this.K){try{juF(this,this.K)}catch(x){}g.xq(this.context.Z.getRootNode(),"ytp-branding-shown");this.context.Z.getRootNode().style.setProperty("--branding-image-width",this.K.getAttribute("width")+"px")}}}; DS.prototype.hide=function(){this.isActive&&(g$.prototype.hide.call(this),g.LQ(this.kH(),!1),this.isActive=!1,g.Qd(this.context.Z.getRootNode(),"ytp-branding-shown"))}; DS.prototype.destroy=function(){this.L&&(this.L.dispose(),this.L=null);g.Qd(this.context.Z.getRootNode(),"ytp-branding-shown");g$.prototype.destroy.call(this)};g.w(FfH,g$);g.a=FfH.prototype;g.a.show=function(){this.isActive||(g$.prototype.show.call(this),this.D||(RAF(this),this.D=!0),g.LQ(this.kH(),!0),g.v4(function(){g.Qd(this.kH(),"iv-promo-inactive")},100,this),this.kH().removeAttribute("aria-hidden"),this.isActive=!0,UOS(this),BzS(this),suH(this,this.B))}; g.a.hide=function(){this.isActive&&(g.xq(this.kH(),"iv-promo-inactive"),this.isActive=!1,this.kH().setAttribute("aria-hidden","true"))}; g.a.k9=function(X,J,L,x,Q,K){return this.isCollapsed?!1:g$.prototype.k9.call(this,X,J,L,x,Q,K)}; g.a.ox=function(X){this.S=!0;leF(this,500,X)}; g.a.J7=function(){this.S=!1;Nz3(this)}; g.a.HF=function(X){X.stopPropagation();this.hide()}; g.a.WF=function(X){X.stopPropagation();UOS(this);this.isCollapsed=!0;g.xq(this.kH(),"iv-promo-collapsed-no-delay");this.j.start()}; g.a.destroy=function(){this.j.dispose();g$.prototype.destroy.call(this)};g.w(kRF,g.bf);g.a=kRF.prototype;g.a.Dx=function(X,J){if(!ChH(this.player.G().playerStyle))return null;switch(X){case "loadCustomAnnotationsXml":return(X=g.LZ(J))&&Ld8(this,X),!0;case "removeCustomAnnotationById":return J&&this.L&&(SYu(this.L,J),hd(this.player)),!0}return null}; g.a.getOptions=function(){return ChH(this.player.G().playerStyle)?["loadCustomAnnotationsXml","removeCustomAnnotationById"]:[]}; g.a.yX=function(){var X=this.player.G(),J=this.player.getVideoData(),L=X.annotationsLoadPolicy||J.annotationsLoadPolicy;return g.$F(J)||this.player.isMutedByEmbedsMutedAutoplay()?!1:L===1&&!J.q$||X.jC.get(J.videoId)||g.Nd(J)||g.Ur(J)?!0:!1}; g.a.L4=function(){if(this.N){var X=this.player.t0().getVideoContentRect(!0);g.X9(this.N.element,X.width,X.height);g.m9(this.N.element,X.left,X.top)}if(this.L){var J=this.player.wg();X=this.L;J=J.width;g.q8(X.T,"iv-drawer-small",J<=426);g.q8(X.T,"iv-drawer-big",J>=1280)}}; g.a.l7=function(X){Aau(this,X.state);g.N(X.state,2)&&(this.AB()&&this.Ew()&&this.player.getPresentingPlayerType()!==2&&this.jD(!1),this.B3(!1))}; g.a.load=function(){function X(q){var D=J.loadNumber;J.j=null;J.loaded&&J.loadNumber===D&&J.player.getVideoData().videoId===x&&(q=g.DE(q)&&q.responseXML?q.responseXML:null)&&(Ld8(J,q),g.xq(J.player.getRootNode(),"iv-module-loaded"))} var J=this;g.bf.prototype.load.call(this);Aau(this,this.player.getPlayerStateObject());this.loadNumber++;var L=this.player.getVideoData(),x=L.videoId;g.k1()&&(X=xwu(this,X));var Q={format:"XML",onFinish:X,onError:function(){J.j=null}, urlParams:{}};L.isPharma&&(Q.urlParams.pharma="1");Q.method="POST";Q.withCredentials=!0;var K=this.player.G().jC.get(x);K&&iHS(Q,K);K=K&&(K.pH||K.rb);if(!L.u3||K)L.jC?XTu(this,L.jC,Q):(this.W=function(){if(!J.S)J.onVideoDataChange(Q);var q=J.player.getVideoData();(q==null?0:g.sr(q))&&!J.Km&&IDv(J,q)},this.player.addEventListener("videodatachange",this.W)); g.l0(this.player,this.N.element,4);this.L4();(K=g.Nd(L))&&qE8(this,K);(K=g.Ur(L))&&K.featuredChannel&&$w0(this,K.featuredChannel,K.annotationId||"branding",L.videoId||null,L.eventId||null);this.ai=g.qG("ytp-cards-button",this.player.getRootNode());g.sr(L)&&IDv(this,L)}; g.a.onVideoDataChange=function(X){var J=this.player.getVideoData();J.jC&&XTu(this,J.jC,X)}; g.a.unload=function(){this.player.Q0("annotations_module");for(var X=g.d(Object.keys(this.B)),J=X.next();!J.done;J=X.next())this.B[J.value].destroy();this.D=null;this.L&&(this.L.destroy(),this.L=null,hd(this.player));this.S=!1;this.j&&(this.j.abort(),this.j=null);this.Km=!1;this.B={};this.K.hide();g.bf.prototype.unload.call(this);this.N.detach();this.W&&(this.player.removeEventListener("videodatachange",this.W),this.W=null)}; g.a.q1=function(X){X===this.player.getVideoData().videoId&&(this.loaded?Q6F(this):this.load())}; g.a.AB=function(){var X;return((X=this.L)==null?void 0:X.isAvailable())||this.Km}; g.a.Ew=function(){return!!this.L&&this.L.N}; g.a.jD=function(X,J,L){J=J===void 0?!1:J;this.AB();this.L&&(X?L?Lc(this.L,L,J):Lc(this.L,"YOUTUBE_DRAWER_AUTO_OPEN",J):xl(this.L))}; g.a.B3=function(X,J){this.player.publish(X?"cardsteasershow":"cardsteaserhide",J)}; g.a.uB=function(){this.player.G().jC.unsubscribe("vast_info_card_add",this.q1,this);g.Qd(this.player.getRootNode(),g.wf.IV_DRAWER_OPEN);for(var X=this.aB,J=g.j$,L=0,x=X.length;L