(function(g){var window=this;'use strict';var zRt=function(q){var Z=q.vG.getVideoContentRect(!0).height,F=q.vG.getVideoContentRect(!0).width;if(!Z||!F)return null;Z*=q.uL.height;F*=q.uL.width;return{width:F,height:Z}},nYE=function(){return g.sY("yt-player-caption-display-settings")},bdm=function(){gY.call(this)},NV6=function(q,Z){if(q.policy.P3&&q.player.Os()){var F=g.Tv(Z,q.policy,{}); F.set("pot",q.player.Os());F=F.fP()}else F=g.Tv(Z,q.policy,{}).fP();var B={format:"RAW",withCredentials:!0};if(q.policy.BG){B.method="POST";var f=Z.G;f&&Object.keys(f).length>0?B.postBody=g.q7(f,g.a7):B.postBody=(0,g.HV)([120,0])}q.Z&&(B.responseType="arraybuffer");var D=++q.uL,G=(0,g.Le)();q.K=g.Zy(F,B,3,100,-1,function(n){n.errorCode==="net.timeout"&&q.player.iL("capnt",{rn:D++})}).then(function(n){if(q.policy.UK&&D%100===1){var b=(0,g.Le)(); q.player.iL("caprsp",{rn:D,ms:b-G,kb:(n.xhr.responseText.length/1024).toFixed()})}a:{n=n.xhr;q.jU();if(q.S){var N=!(q.Z?n.response:n.responseText)||n.status>=400;if(b=g.EqD(n)){n=g.Tv(q.S,q.policy,{});q.S.XX(n,b);NV6(q,q.S);break a}if(N)q.player.iL("capfail",{status:n.status});else{var S;g.XY("fcb_r",(0,g.Le)(),((S=q.player.getVideoData())==null?void 0:S.Dl)||"");S=q.S.TP[0];b=S.Uc;q.V!=null&&q.j!==b&&(q.Z?q.V(n.response,(S.startTime+q.player.oh())*1E3):q.V(n.responseText,(S.startTime+q.player.oh())* 1E3),q.j=b)}}q.S=null;q.K=null}}).Kz(function(n){q.S=null; q.K=null;var b;q.player.iL("capfail",{rn:D,status:(b=n.xhr)==null?void 0:b.status})}); q.S=Z;gY5(q.G,q.S.TP[0].Uc)},Sb=function(q){q.isActive()||q.start()},Uxm=function(q){if(!S90.test(q))throw Error("'"+q+"' is not a valid hex color"); q.length==4&&(q=q.replace(lRE,"#$1$1$2$2$3$3"));q=q.toLowerCase();q=parseInt(q.slice(1),16);return[q>>16,q>>8&255,q&255]},l7=function(q,Z){if(q.storage)try{q.storage.set("module-enabled",Z)}catch(F){}},rWe=function(q,Z){if(!q.D)return{}; if(Z){g.q_(Z)||q.El(Z.vss_id,"m");if(q.Z||!g.yF(Z))return;if(g.q_(Z)){Ur(q,null,!0);return}for(var F,B=g.vH(q.D.K,!0),f=0;f=0||F<0&&(-F-1)%2===1||(F=-F-1,F>0&&Z-q.segments[F-1]===1&&F0&&Z-q.segments[F-1]===1?q.segments[F-1]=Z:F1?1:0){case 1:return new rY(Z,q.S,q.j,F.width,F.height,f,B,q.J.experiments,q.eG.bind(q),q.B);case 2:return new yv(Z,q.S,q.j,F.width,F.height,f,B,q.J.experiments,q.eG.bind(q),q.B);default:return new PN(Z,q.S,q.j,F.width,F.height,f, B,q.J.experiments,q.eG.bind(q),q.B)}},vYm=function(q,Z){if(!Z)return""; q.S&&q.K.params.Gx!==1&&(Z*=-1);return"translate"+(q.S?"X":"Y")+"("+Z+"px)"},XX_=function(q){q.style.set(4); q.D=q.text;q.D.style=q.style;q.S.mode=1<0?(q=Number(q[0]))?q:0:0},KBu=function(q,Z){return Z?q.captionsInitialState:"CAPTIONS_INITIAL_STATE_UNKNOWN"},aRe=function(q,Z,F){$x_(q,Z).then(function(B){B&&F(B.trackData,new g.G9(B.metadata))})},idm=function(q,Z){q.D=function(F,B){if(F.info.G){var f=F; if(q.O$.length>0){for(f=q.O$.shift();q.O$.length>0;)f=g.K8(f,q.O$.shift());f=g.K8(f,F)}if(f){F=f;try{var D=g.Q9(F)*1E3}catch(N){D=F.info.startTime*1E3}try{var G=g.sGB(F)*1E3}catch(N){G=F.info.duration*1E3}if(D<0||G<0)D<0&&(D=F.info.startTime*1E3),G<0&&(G=F.info.duration*1E3);F.info.startTime=D/1E3;F.info.Z=D/1E3;F.info.duration=G/1E3;F.info.V=G/1E3;D=q.HM(f);G=D.Uc;D={formatId:D.formatId,startTimeMs:D.startTimeMs,durationMs:D.durationMs,BE:G,zD:G};G=mxm(q.z0,D.startTimeMs);var n=(F=G>=0?q.z0[G]:null)? F.startTimeMs+F.durationMs:0,b=D.startTimeMs+D.durationMs;!F||D.startTimeMs-n>q.K?q.z0.splice(G+1,0,D):(F.durationMs=Math.max(n,b)-F.startTimeMs,F.zD=Math.max(F.zD,D.zD));B(q.z0);D=g.Xd(f);B=q.S;D=D.buffer.slice(D.byteOffset,D.byteLength+D.byteOffset);f=f.info.Z;B.j?B.G==null?g.md(B.logger,350058965,"Null loaded track meta data at captions data received"):Z.a8(D,B.G,f*1E3):g.md(B.logger,350058965,"Null Representation at captions data received")}else g.md(q.logger,350058965,"Empty slice")}else q.O$.push(F)}; q.B.addEventListener("sabrCaptionsDataLoaded",q.D)},Qv=function(){this.state=this.QW=this.Qt=0},saB=function(q){if(typeof q==="string")return!1; q=new xo(q,8,0);return kYm(q)},ja6=function(q,Z,F,B){B=Object.assign({MV:0},B); return new AL(q,Z,F,"_"+vN++,B)},IR6=function(q,Z){var F={},B=Z.getAttribute("wp"); B&&Object.assign(F,q.V[B]);q=Xm(Z,"ap");q!=null&&(F.KQ=q);q=wY(Z,"cc");q!=null&&(F.py=q);q=wY(Z,"ah");q!=null&&(F.yM=q);q=wY(Z,"rc");q!=null&&(F.tM=q);Z=wY(Z,"av");Z!=null&&(F.zn=Z);return F},C$j=function(q,Z){var F=q.B.Mi().QO().textTracks; q=q.K.toString();for(var B=0;B0||(Er(B,F),RRE(q.K),RRE(q.G),B.row=15,B.D=Z,f=!0)}q.style.set(3);q.D=B;q.D.style=q.style;q.S.mode=1<Z?(Er(B,F),KU(B,B.row-B.D,Z)):B.row0&&q.WG===0,f=F=2&&q.K>1&&(--q.K,i7(q).D=0); var B=i7(q);B.timestamp=q.Z.time+0;B.D=nwE(Z,F);q.K<32&&q.K++},NSu=function(q){var Z=bV5.length; if(q.byteLength0?q.D:1; q.K=1;KU(q,0,15)},TV_=function(q){q.zP=Array.from(q.element.getElementsByClassName("caption-visual-line")); for(var Z=q.K.params.tM,F=0,B=0,f=q.zP.length-1;F-1;){var D=q.zP[f];B+=q.S?D.offsetWidth:D.offsetHeight;F++;f--}q.V=B;Z=Math;F=Z.max;isNaN(q.Y$)&&((B=q.D.py)?(f=g.AV("SPAN"),g.Tk(f,"\u2013".repeat(B)),g.u$(f,V_t(q,q.D.G8)),q.G.appendChild(f),q.Y$=f.offsetWidth,q.G.removeChild(f)):q.Y$=0);B=q.G;q.Dl=F.call(Z,q.Y$,q.KB,(q.S?B.offsetHeight:B.offsetWidth)+1)},UR5=function(q,Z,F){var B=g.pN(q,0,1836476516),f=9E4; B&&(f=g.dC(B)||9E4);B=0;for(var D=g.Vi(q,1836019558),G=0;G0?q:10},hL=function(q,Z){q=q.getAttribute(Z); if(q!=null)return CU.test(q),q},Er=function(q,Z){if(q.style.type===3){for(var F=0,B=0,f=q.Z.time+0,D="",G="",n=f,b=1;b<=15;++b){for(var N=!1,S=B?B:1;S<=32;++S){var l=q.S[b][S]; if(l.D!==0){F===0&&(F=b,B=S);N=String.fromCharCode(l.D);var U=l.timestamp;U>5&1]; q=F&16?((F&14)>>1)*4:0;F=Z.D;switch(Z.style.get()){case 4:B=F.row;break;case 3:if(B!==F.row){if(B0&&(Z+=D,f-=D)):(D=D+f-G,D>0&&(f-=D));KU(F,Z,f)}}F.row=B;F.K=q+1}else switch(f&7){case 1:switch(F&112){case 32:ko(Z.D,0,32);break a;case 48:F===57?(B=Z.D,i7(B).D=0,B.K<32&&B.K++):ko(Z.D,1,F&15)}break;case 2:F&32&&ko(Z.D,2,F&31);break;case 3:F&32&&ko(Z.D,3,F&31);break;case 4:case 5:if(32<=F&&F<=47)switch(F){case 32:gw8(Z); break;case 33:B=Z.D;B.K>1&&(--B.K,i7(B).D=0);break;case 36:B=Z.D;Z=i7(B);for(q=0;q<=15;q++)for(F=0;F<=32;F++)if(B.S[q][F]===Z){for(;F<=32;F++)B.S[q][F].reset();break}break;case 37:cWm(Z,2,B);break;case 38:cWm(Z,3,B);break;case 39:cWm(Z,4,B);break;case 40:ko(Z.D,0,32);break;case 41:Z.style.set(2);Z.D=Z.K;Z.D.D=0;Z.D.style=Z.style;Z.S.mode=1<32&&(B.K=32)}}},SyE=function(q,Z){var F={},B=Z.getAttribute("ws"); Object.assign(F,B?q.PG[B]:q.G);q=Xm(Z,"mh");q!=null&&(F.MV=q);q=Xm(Z,"ju");q!=null&&(F.textAlign=q);q=Xm(Z,"pd");q!=null&&(F.F9=q);q=Xm(Z,"sd");q!=null&&(F.Gx=q);q=hL(Z,"wfc");q!=null&&(F.windowColor=q);Z=wY(Z,"wfo");Z!==void 0&&(F.windowOpacity=Z/255);return F},uN0=function(q,Z){var F=new g.G9; F.languageCode=q.languageCode;F.languageName=q.languageName;F.name=q.name;F.displayName=q.displayName;F.kind=q.kind;F.isDefault=!1;F.D=q.D;F.isTranslateable=q.isTranslateable;F.vssId=q.vssId;F.url=q.url;F.translationLanguage=Z;q.xtags&&(F.xtags=q.xtags);q.captionId&&(F.captionId=q.captionId);return F},JL=function(q){return q.PG&&q.PG.D},OVm=function(q){var Z={}; if(q=g.Qw(q))Z.lang=q,g.utt.test(q)&&(Z.F9=1);return Z},Qhj=function(q,Z,F){q.k$=q.k$||!!F; var B={};Object.assign(B,q.D.G8);Object.assign(B,F||Z.D);Object.assign(B,q.Hg.G8);(F=!q.X)&&t__(q);for(var f=q.dU&&q.BG&&g.eS(B,q.BG)?q.dU:eR5(q,B),D=typeof Z.text==="string",G=D?Z.text.split("\n"):[Z.text],n=0;n0||!Z.append,N=G[n];b&&!F?(t__(q),f=eR5(q,B)):b&&F&&(F=!1);N&&(f.appendChild(D?g.T$(N):N),D||N.tagName!=="RUBY"||N.childElementCount!==4||g.pi||!g.gb(N.children[2],"text-emphasis")||(b=q.S?"padding-right":"padding-top",g.gb(N.children[2],"text-emphasis-position")&&(b= q.S?"padding-left":"padding-bottom"),g.YN?g.u$(f,b,"1em"):g.u$(f,b,"0.5em")))}q.BG=B;q.dU=f;q.j.push(Z)},xRe=function(q,Z,F,B,f,D){g.J.call(this); this.policy=q;this.player=Z;this.Dl=F;this.V=B;this.Z=f;this.PG=D;this.G=new sr;this.j=-1;this.K=this.S=this.D=null;this.uL=0;this.X=new g.im(this.vS,1E3,this);this.events=new g.pO(this);g.y(this,this.X);g.y(this,this.events);this.events.N(Z,"SEEK_COMPLETE",this.W$);this.W$();this.vS()},kYm=function(q){if(!(q.byteOffset1)return!1;RN(q);RN(q);RN(q);return!0},tL=function(q,Z){q.B.isInline()||g.e0("yt-player-sticky-caption",Z,2592E3)},A9e=function(q,Z){if(!g.GQZ(q)||q.D!=null&&g.Mb6(Z,q.D)&&q.D.D.rawcc!=null)return!1; Z=!!q.D&&q.D.isManifestless&&Object.values(q.D.D).some(function(F){return g.Sd(F,"386")}); q=!!q.D&&!q.D.isManifestless&&g.ma6(q.D);return Z||q},vwu=function(q,Z,F,B,f,D,G,n,b){switch(G.tagName){case "b":n.bold=!0; break;case "i":n.italic=!0;break;case "u":n.underline=!0}for(var N=0;N0,g.q_(n)?void 0:n),b.push(S),f.D.push(S);else{var l={};Object.assign(l,n);vwu(q,Z,F,B,f,!0,S,l,b)}}},pU=function(q,Z){g.AA.call(this,Z); this.D=q;this.B=Z;this.G=null;this.j=!1;this.logger=new g.Wz("caps");this.X=g.Mb6(this.B,this.D)},$x_=function(q,Z){var F,B,f; return g.h(function(D){if(D.D==1)return F=q+"|"+Z,g.R(D,g.$M(),2);if(D.D!=3){B=D.K;if(!B)throw g.mJ("gct");return g.R(D,g.ms(B),3)}f=D.K;return D.return(f.get("captions",F))})},dY=function(q,Z){q=q.getAttribute(Z); if(q!=null)return q==="1"},Od6=function(q,Z){var F="vertical-rl"; q.D.Gx===1&&(F="vertical-lr");g.D7&&(F=F==="vertical-lr"?"tb-lr":"tb-rl");g.u$(Z,"-o-writing-mode",F);g.u$(Z,"-webkit-writing-mode",F);g.u$(Z,"writing-mode",F);g.u$(Z,"text-orientation","upright");g.e$(Z,"ytp-vertical-caption");q.K.params.F9===3&&(g.u$(Z,"text-orientation",""),g.u$(Z,"transform","rotate(180deg)"))},GPu=function(q){this.S=q; this.Z=0;this.style=new LU;this.j=new HN(this.S);this.X=new HN(this.S);this.text=new HN(this.S);this.K=this.j;this.G=this.X;this.D=this.K},P$E=function(q){return g.LO(q)||q.U("web_enable_caption_language_preference_stickiness")},Yo=function(q){var Z=q.byteOffset; q.byteOffset+=4;return q.D.getUint32(Z)},XY_=function(q,Z){q.player.MB(Z); Z=g.E(Z);for(var F=Z.next();!F.done;F=Z.next())g.NL(q.dU,F.value);Sb(q.BG)},V_t=function(q,Z){var F={},B=Z.background?Z.background:q.D.G8.background; if(Z.backgroundOpacity!=null||Z.background){var f=Z.backgroundOpacity!=null?Z.backgroundOpacity:q.D.G8.backgroundOpacity;B=Uxm(B);F.background="rgba("+B[0]+","+B[1]+","+B[2]+","+f+")";q.w2&&(F["box-decoration-break"]="clone",F["border-radius"]=q.HG/8+"px")}if(Z.fontSizeIncrement!=null||Z.offset!=null)F["font-size"]=q.Oc*LB8(Z)+"px";B=1;f=Z.color||q.D.G8.color;if(Z.color||Z.textOpacity!=null)f=Uxm(f),B=Z.textOpacity==null?q.D.G8.textOpacity:Z.textOpacity,f="rgba("+f[0]+","+f[1]+","+f[2]+","+B+")", F.color=f,F.fill=f;var D=Z.charEdgeStyle;D===0&&(D=void 0);if(D){f="rgba(34, 34, 34, "+B+")";var G="rgba(204, 204, 204, "+B+")";Z.nZ&&(G=f=Z.nZ);var n=q.Oc/16/2,b=Math.max(n,1),N=Math.max(2*n,1),S=Math.max(3*n,1),l=Math.max(5*n,1);B=[];switch(D){case 4:for(;S<=l;S+=n)B.push(N+"px "+N+"px "+S+"px "+f);break;case 1:N=window.devicePixelRatio>=2?.5:1;for(D=b;D<=S;D+=N)B.push(D+"px "+D+"px "+f);break;case 2:B.push(b+"px "+b+"px "+G);B.push("-"+b+"px -"+b+"px "+f);break;case 3:for(S=0;S<5;S++)B.push("0 0 "+ N+"px "+f)}F["text-shadow"]=B.join(", ")}f="";switch(Z.fontFamily){case 1:f='"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace';break;case 2:f='"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif';break;case 3:f='"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace';break;case 5:f='"Comic Sans MS", Impact, Handlee, fantasy';break;case 6:f='"Monotype Corsiva", "URW Chancery L", "Apple Chancery", "Dancing Script", cursive';break;case 7:f=g.TP()? '"Carrois Gothic SC", sans-serif-smallcaps':'Arial, Helvetica, Verdana, "Marcellus SC", sans-serif';break;case 0:case 4:f='"YouTube Noto", Roboto, Arial, Helvetica, Verdana, "PT Sans Caption", sans-serif'}f&&(F["font-family"]=f);f=Z.offset;f==null&&(f=q.D.G8.offset);switch(f){case 0:F["vertical-align"]="sub";break;case 2:F["vertical-align"]="super"}Z.fontFamily===7&&(F["font-variant"]="small-caps");Z.bold&&(F["font-weight"]="bold");Z.italic&&(F["font-style"]="italic");Z.underline&&(F["text-decoration"]= "underline");Z.aP&&(F.visibility="hidden");Z.iz===1&&q.S&&(F["text-combine-upright"]="all",F["text-orientation"]="mixed",f=g.pi||g.GW,q.K.params.F9===3?F.transform=f?"rotate(90deg)":"rotate(180deg)":f&&(F.transform="rotate(-90deg)"));if(Z.textEmphasis===1||Z.textEmphasis===2||Z.textEmphasis===3||Z.textEmphasis===4||Z.textEmphasis===5)if(g.pi)F["font-weight"]="bold";else switch(F["text-emphasis-style"]="filled circle",F["text-emphasis-color"]="currentcolor",F["webkit-text-emphasis"]="filled circle", Z.textEmphasis){case 4:case 3:F["text-emphasis-position"]="under left";F["webkit-text-emphasis-position"]="under left";break;case 5:case 2:F["text-emphasis-position"]="over right",F["webkit-text-emphasis-position"]="over right"}return F},Ew0=function(q,Z){var F=[],B; for(B in q.D.D)if(q.D.D.hasOwnProperty(B)){var f=q.D.D[B];if(g.Sd(f,Z||null)){var D=f.info.id,G=D,n="."+D,b="",N="";if(f=f.info.captionTrack)D=f.languageCode,G=f.displayName,n=f.vssId,b=f.kind,N=f.id;F.push(new g.G9({id:B,languageCode:D,languageName:G,is_servable:!0,is_default:!0,is_translateable:!1,vss_id:n,kind:b,captionId:N}))}}return F},Ur=function(q,Z,F){q.loaded&&q.unload(); F!=null&&(q.V=F,q.V&&(g.LO(q.J)?tL(q,!!Z):l7(q,!!Z)));Z!==null||Vv(q,!0)||q.TH(Z,!!Z,q.V?"m":"s");q.K=Z;Vv(q)&&(q.K=JL(q));var B;K0E(q,(B=q.K)!=null?B:void 0);q.load()},$RB=function(q){var Z=q.split(":"); q=0;Z=g.E(Z);for(var F=Z.next();!F.done;F=Z.next())q=q*60+Number(F.value);return q*1E3},HVm=function(q,Z,F,B){for(var f=0;f=q&&(q=640,B>F*1.3&&(q=480),f=F/q*16);return f},gY=function(){g.J.apply(this,arguments)},ZVB=function(q,Z,F,B){Z===255&&F===255||!Z&&!F?(++q.S===45&&q.reset(),q.G.K.clear(),q.Z.K.clear()):(q.S=0,F0u(q.G,Z,F,B))},fPu=function(q){if(!q.B.isInline())return g.sY("yt-player-sticky-caption")},jhu=function(q,Z){if(Z instanceof AL){var F=q.zP[Z.id]; F&&F.K!==Z&&(F.dispose(),delete q.zP[Z.id],F=null);F||(F=AW_(q,Z))&&(q.zP[Z.id]=F)}else F=Z.windowId,q.HG[F]||(q.HG[F]=[]),q.HG[F].push(Z)},hHe=function(q){g.a3.call(this,q); var Z=this;this.B=q;this.dU=[];this.zP={};this.HG={};this.V=!1;this.G="NONE";this.D=this.PG=this.Dl=this.Oc=this.I_=null;this.Gb={CD:function(){Z.CD()}, a8:function(D,G,n,b){Z.a8(D,G,n,b)}}; this.K=null;this.J=this.B.C();this.videoData=this.B.getVideoData();this.vG=this.B.Ca();this.S={G8:{}};this.j={G8:{}};g.X4(this.videoData)?this.G="OFFLINE":A9e(this.videoData,this.B)?this.G="SABR_LIVE":g.o_D(this.videoData,this.B)?this.G="LIVE":this.videoData.captionTracks.length?this.G="INNERTUBE":this.videoData.QC&&(this.G="TTS");this.o_=this.J.controlsType==="3";this.eU=new IN(this.B,this.J);this.k$=new g.pO(this);this.X=new g.w({Y:"div",W:"ytp-caption-window-container",L:{id:"ytp-caption-window-container"}}); this.uL={top:0,right:0,bottom:0,left:0,width:1,height:1};var F=null,B=g.oB("yt-html5-player-modules::subtitlesModuleData");B&&(F=new g.ML(B));this.storage=F;var f;this.Jn=!((f=q.Mi())==null||!f.Io());this.Z=IPt(this);this.Y$=!this.Z&&this.o_&&this.Jn&&(this.G==="LIVE"||this.G==="SABR_LIVE");g.y(this,this.eU);this.Z?this.WG=this.BG=null:(this.BG=new g.S2(this.Cd,void 0,this),g.y(this,this.BG),this.WG=new g.im(this.uwF,2E3,this),g.y(this,this.WG));g.y(this,this.k$);g.C5(this.player,this.X.element,4); g.y(this,this.X);this.Z||this.k$.N(q,"resize",this.U8);(this.KB=g.Us(this.J)&&!g.By()&&!this.B.isFullscreen()&&!this.Z&&!this.Y$)&&this.k$.N(q,"resize",this.KsP);this.k$.N(q,"onPlaybackAudioChange",this.RWU);this.k$.N(q,g.UK("captions"),function(D){Z.onCueRangeEnter(D)}); this.k$.N(q,g.s2("captions"),function(D){Z.onCueRangeExit(D)}); CJB(this,nYE()||{});this.player.Ry("onCaptionsModuleAvailable")},EY6=function(){this.timestamp=this.D=0},L0B=function(q,Z,F){if(q===255&&Z===255||!q&&!Z)return{Qt:q, QW:Z,result:0};q=RHB[q];Z=RHB[Z];if(q&128){var B;if(B=!(Z&128))B=Z,B=F.hP()&&F.QW===B;if(B)return{Qt:q,QW:Z,result:1}}else if(Z&128&&1<=q&&q<=31)return{Qt:q,QW:Z,result:2};return{Qt:q,QW:Z,result:3}},K0E=function(q,Z){q.J.U("html5_modify_caption_vss_logging")&&(q.videoData.zw=Z)},u7=function(q){var Z=JL(q); return!!Z&&q.K===Z},KU=function(q,Z,F){for(var B=0;B=0?q:-q-2},J90=function(q,Z,F){Z&&!q.Dl?(Z=aPB({F9:0, lang:"es-419"}),q.Dl=[Z,new mF(Z.start,Z.end-Z.start,0,Z.id,F!=null?F:"Los subt\u00edtulos tendr\u00e1n este aspecto:")],q.player.sZ(q.Dl)):!Z&&q.Dl&&(XY_(q,q.Dl),q.Dl=null)},mF=function(q,Z,F,B,f,D,G){D=D===void 0?!1:D; G=G===void 0?null:G;g.u8.call(this,q,q+Z,{priority:F,namespace:"captions"});this.windowId=B;this.text=f;this.append=D;this.D=G},Me=function(q){gY.call(this); this.G=q;this.pens={};this.V={};this.PG={};this.Z="_"+vN++;this.X={};this.K=this.D=null;this.j=!0}; g.AA.prototype.xO=g.nS(71,function(){return!1}); g.AA.prototype.Ty=g.nS(70,function(){}); g.UI.prototype.Ty=g.nS(69,function(q,Z,F){var B=this;this.jU();Z=this.eH(q,Z);var f=this.lL.C().U("html5_report_captions_ctmp_qoe"),D=(0,g.Le)();this.nx();qym(this,Z,{format:"RAW",onSuccess:function(G){B.D=null;if(f){var n=(G.responseText.length/1024).toFixed(),b=(0,g.Le)();B.videoData.iL("capresp",{ms:b-D,kb:n})}F.a8(G.responseText,q)}, onError:f?function(G){var n;G=(n=G==null?void 0:G.status)!=null?n:0;B.videoData.iL("capfail",{status:G})}:void 0, withCredentials:!0})}); g.X9.prototype.Ty=g.nS(68,function(q,Z,F){var B=this;this.jU();Z=this.eH(q,Z);this.nx();this.D=g.QN(Z,{format:"RAW",onSuccess:function(f){B.D=null;F.a8(f.responseText,q)}, withCredentials:!0})}); g.I4.prototype.jm=g.nS(67,function(){for(var q=g.ti(document,"track",void 0,this.D),Z=0;Z=0||q<0&&(-q-1)%2===1}; sr.prototype.length=function(){return this.segments.length/2}; g.V(xRe,g.J);g.r=xRe.prototype;g.r.SU=function(){g.J.prototype.SU.call(this);this.K&&this.K.cancel()}; g.r.W$=function(){this.seekTo(this.player.getCurrentTime())}; g.r.seekTo=function(q){q-=this.player.oh();var Z=this.D;this.D=g.uU(this.Dl.Ly(q).TP);Z!==this.D&&this.PG&&this.PG()}; g.r.reset=function(){this.G=new sr;this.j=-1;this.K&&(this.K.cancel(),this.K=null)}; g.r.vS=function(){this.jU();var q;if(q=this.D!=null)q=this.D,q=q.D.Mz(q);if(q&&!this.K&&!(this.D&&this.D.startTime-this.player.getCurrentTime()>30)){q=this.D;q=q.D.Ji(q);var Z=q.TP[0],F;if((F=this.player.getVideoData())==null?0:F.enableServerStitchedDai)if(F=this.player.N4()){var B=Z.D.info.id,f=Z.Uc,D=q.TP[0].Z;if(this.policy.BG){if(F=F.aB(D,f,B,3))q.G=F}else if(B=F.Jg(D,f,B,3))if(F=F.O1(f),F===0)B&&(q.D=new g.O_(B));else if(F===2){this.X.start();wXu(this)&&this.seekTo(this.player.getCurrentTime()); return}}Z.D.index.g3(Z.Uc)?(this.G.contains(q.TP[0].Uc)||NV6(this,q),this.D=g.uU(q.TP)):wXu(this)&&this.seekTo(this.player.getCurrentTime())}this.X.start()}; g.V(pU,g.AA);g.r=pU.prototype;g.r.Ty=function(q,Z,F){var B=this;this.nx();Z=pXE(this,q.getId());Z||(Z=q.languageCode,Z=this.D.isManifestless?W06(this,Z,"386"):W06(this,Z));if(Z){var f=(Z.index.VL(Z.index.X8())-Z.index.getStartTime(Z.index.X8()))*1E3,D=new g.FtD(this.B.C());this.G=new xRe(D,this.B,Z,function(G,n){F.a8(G,q,n,f)},this.X||g.Wv(Z.info),function(){B.G&&B.G.reset(); B.j=!0})}}; g.r.xO=function(){var q=this.j;this.j=!1;return q}; g.r.jd=function(q){var Z=this.B.C().U("html5_fallback_if_rawcc_missing");var F=this.D.D.rawcc!=null;if(!this.X||!F&&Z)Z=this.D.isManifestless?sh5(this,"386"):sh5(this);else{if(!F){g.md(this.logger,386248249,"rawcc used but unavailable");return}Z=[new g.G9({id:"rawcc",languageCode:"rawcc",languageName:"CC1",is_servable:!0,is_default:!0,is_translateable:!1,vss_id:".en"}),new g.G9({id:"rawcc",languageCode:"rawcc",languageName:"CC3",is_servable:!0,is_default:!0,is_translateable:!1,vss_id:".en"})]}Z=g.E(Z); for(F=Z.next();!F.done;F=Z.next())g.N3(this.K,F.value);q.CD()}; g.r.nx=function(){this.G&&(this.G.dispose(),this.G=null)}; g.r.eH=function(){return""}; var CU=/^#(?:[0-9a-f]{3}){1,2}$/i;var Hdm=["left","right","center","justify"];g.V(PN,g.w);g.r=PN.prototype;g.r.Bj=function(q,Z){this.o_=q;this.eU=Z;var F=g.uy(this.element,this.element.parentElement);this.I_=q-F.x;this.vG=Z-F.y}; g.r.rN=function(q,Z){if(q!==this.o_||Z!==this.eU){g.QU(this.element,"ytp-dragging")||g.e$(this.element,"ytp-dragging");var F=g.bD(this.element);q=q-this.I_-.02*this.G0;var B=Z-this.vG-.02*this.LB,f=(q+F.width/2)/this.maxWidth*3;f=Math.floor(g.JY(f,0,2));var D=(B+F.height/2)/this.maxHeight*3;D=Math.floor(g.JY(D,0,2));Z=f+D*3;q=(q+f/2*F.width)/this.maxWidth;q=g.JY(q,0,1)*100;F=(B+D/2*F.height)/this.maxHeight;F=g.JY(F,0,1)*100;this.K.params.KQ=Z;this.K.params.zn=F;this.K.params.yM=q;this.K.params.isDefault= !1;this.D.KQ=Z;this.D.zn=F;this.D.yM=q;this.D.isDefault=!1;this.uL.KQ=Z;this.uL.zn=F;this.uL.yM=q;this.uL.isDefault=!1;this.Yv()}}; g.r.R$=function(){g.vc(this.element,"ytp-dragging")}; g.r.Yv=function(){this.qV(this.j)}; g.r.qV=function(q){var Z=this.Jn?0:Math.min(this.QH(),this.maxWidth),F=this.c9(),B=this.Jn;if(B){var f=getComputedStyle(this.G.parentNode);f=Or(f.borderLeftWidth)+Or(f.borderRightWidth)+Or(f.paddingLeft)+Or(f.paddingRight)}else f=0;var D=f;f="";this.K.params.F9===3&&(f="rotate(180deg)");var G=B?"calc(96% - "+D+"px)":"96%";g.u$(this.element,{top:0,left:0,right:"",bottom:"",width:Z?Z+"px":"",height:F?F+"px":"","max-width":G,"max-height":G,margin:"",transform:""});this.q3(q);f={transform:f,top:"",left:"", width:Z?Z+"px":"",height:F?F+"px":"","max-width":"","max-height":""};var n=this.D.yM*.96+2;G=this.D.KQ;switch(G){case 0:case 3:case 6:(B=this.D.G8.fontSizeIncrement)&&B>0&&this.D.F9!==2&&this.D.F9!==3&&(n=Math.max(n/(1+B*2),2));f.left=n+"%";break;case 1:case 4:case 7:f.left=n+"%";n=this.G.offsetWidth;Z||n?(Z=Z||n+1,f.width=Z+"px",f["margin-left"]=B?Z/-2-D/2+"px":Z/-2+"px"):f.transform+=" translateX(-50%)";break;case 2:case 5:case 8:f.right=100-n+"%"}B=this.D.zn*.96+2;switch(G){case 0:case 1:case 2:f.top= B+"%";break;case 3:case 4:case 5:f.top=B+"%";(F=F||this.element.clientHeight)?(f.height=F+"px",f["margin-top"]=F/-2+"px"):f.transform+=" translateY(-50%)";break;case 6:case 7:case 8:f.bottom=100-B+"%"}g.u$(this.element,f);if(this.Z){F=this.G.offsetHeight;B=1;for(Z=0;ZZ)Z=0,this.k$=!1,this.j=[],this.X=this.BG=this.dU=null,g.kP(this.G);for(;Z10?n-1:n);q=Xm(q,"hg");q!=null&&(G.iz=q);D[F]=G;break;case "ws":F=q.getAttribute("id");this.PG[F]=SyE(this,q);break;case "wp":F=q.getAttribute("id"),this.V[F]=IR6(this,q)}if(f){B=[];f=Array.from(f.childNodes);f=g.E(f);for(q=f.next();!q.done;q=f.next())if(q=q.value,q.nodeType===1)switch(q.tagName){case "w":this.D=lPE(this,q,Z,!1);(q=this.X[this.D.id])&&q.end>this.D.start&&(q.end=this.D.start);this.X[this.D.id]=this.D;B.push(this.D);break;case "p":var b=q;n=Z;F=[];D=b.getAttribute("w")|| this.Z;G=!!dY(b,"a");n=(wY(b,"t")||0)+n;var N=wY(b,"d")||5E3;G||(!this.j&&this.K&&this.K.windowId===D&&this.K.end>n&&(this.K.end=n),this.K&&this.K.text==="\n"&&(this.K.text=""));var S=G?6:5,l=b.getAttribute("p");l=l?this.pens[l]:null;var U=Array.from(b.childNodes);U.length&&(this.j=b.getAttribute("d")!=null);for(b=0;b0&&(G=!0);var W=void 0;u.nodeType===1&&(W=u);if(W&&W.tagName==="s"){if((u=(u=W.getAttribute("p"))?this.pens[u]:null)&&u.R4&&(u.R4===1?(u=U.slice(b, b+4),u.length===4&&(P=owm(n,N,D,G,S,u,this.pens),b+=3)):P=owm(n,N,D,G,S,[W],this.pens)),!P){var H=W;P=n;W=N;u=D;var X=G,Q=S,a=H.textContent?H.textContent:"",m=H.getAttribute("p");m=m?this.pens[m]:null;H=wY(H,"t")||0;P=new mF(P+H,W-H,Q,u,a,X,m)}}else P=new mF(n,N,S,D,u.textContent||"",G,l);F.push(P);this.K=P}if(F.length>0)for(F[0].windowId===this.Z&&(this.D=lPE(this,q,Z,!0),B.push(this.D)),q=g.E(F),F=q.next();!F.done;F=q.next())F=F.value,F.windowId=this.D.id,this.D.D.push(F),B.push(F)}Z=B}else Z=[]; return Z};var Yy5=new Map([[9,1],[10,1],[11,2],[12,3],[13,4],[14,5]]);g.V($o,gY);$o.prototype.reset=function(){this.K.clear()}; $o.prototype.S=function(q,Z){var F=JSON.parse(q);if(!F)return[];if(F.pens){q=0;for(var B=g.E(F.pens),f=B.next();!f.done;f=B.next()){f=f.value;var D={},G=f.pParentId;G&&Object.assign(D,this.D.get(G));f.bAttr&&(D.bold=!0);f.iAttr&&(D.italic=!0);f.uAttr&&(D.underline=!0);G=f.ofOffset;G!=null&&(D.offset=G);f.szPenSize!==void 0&&(D.fontSizeIncrement=f.szPenSize/100-1);G=f.etEdgeType;G!=null&&(D.charEdgeStyle=G);f.ecEdgeColor!==void 0&&(D.nZ=jb(f.ecEdgeColor));G=f.fsFontStyle;G!=null&&G!==0&&(D.fontFamily= G);f.fcForeColor!==void 0&&(D.color=jb(f.fcForeColor));f.foForeAlpha!==void 0&&(D.textOpacity=f.foForeAlpha/255);f.bcBackColor!==void 0&&(D.background=jb(f.bcBackColor));f.boBackAlpha!==void 0&&(D.backgroundOpacity=f.boBackAlpha/255);(G=f.rbRuby)&&G!==10&&(D.R4=G>10?G-1:G,D.textEmphasis=Yy5.get(D.R4));f.hgHorizGroup&&(D.iz=f.hgHorizGroup);this.D.set(q++,D)}}if(F.wsWinStyles)for(q=0,B=g.E(F.wsWinStyles),f=B.next();!f.done;f=B.next())f=f.value,D={},(G=f.wsParentId)?Object.assign(D,this.Z.get(G)):Object.assign(D, this.j),f.mhModeHint!==void 0&&(D.MV=f.mhModeHint),f.juJustifCode!==void 0&&(D.textAlign=f.juJustifCode),f.pdPrintDir!==void 0&&(D.F9=f.pdPrintDir),f.sdScrollDir!==void 0&&(D.Gx=f.sdScrollDir),f.wfcWinFillColor!==void 0&&(D.windowColor=jb(f.wfcWinFillColor)),f.wfoWinFillAlpha!==void 0&&(D.windowOpacity=f.wfoWinFillAlpha/255),this.Z.set(q++,D);if(F.wpWinPositions)for(q=0,B=g.E(F.wpWinPositions),f=B.next();!f.done;f=B.next())f=f.value,D={},(G=f.wpParentId)&&Object.assign(D,this.G.get(G)),f.ahHorPos!== void 0&&(D.yM=f.ahHorPos),f.apPoint!==void 0&&(D.KQ=f.apPoint),f.avVerPos!==void 0&&(D.zn=f.avVerPos),f.ccCols!==void 0&&(D.py=f.ccCols),f.rcRows!==void 0&&(D.tM=f.rcRows),this.G.set(q++,D);if(F.events){q=[];F=g.E(F.events);for(B=F.next();!B.done;B=F.next()){var n=B.value;f=(n.tStartMs||0)+Z;D=n.dDurationMs||0;if(n.id)G=String(n.id),B=JW5(this,n,f,D,G),q.push(B),this.K.set(G,B);else{n.wWinId?G=n.wWinId.toString():(G="_"+vN++,B=JW5(this,n,f,D,G),q.push(B),this.K.set(G,B));B=q;var b=n;D===0&&(D=5E3); n=this.K.get(G);var N=!!b.aAppend,S=N?6:5,l=b.segs,U=null;b.pPenId&&(U=this.D.get(b.pPenId));for(b=0;b1?1:0)===2&&N&&P==="\n")continue;u=null;var X=[],Q;if(Q=H&&H.R4===1){Q=l;var a=b;if(a+3>=Q.length||!Q[a+1].pPenId||!Q[a+2].pPenId||!Q[a+3].pPenId)Q=!1;else{var m=Q[a+1].pPenId;(m=this.D.get(m))&&m.R4&&m.R4===2?(m=Q[a+2].pPenId,m=this.D.get(m),!m||!m.R4|| m.R4<3?Q=!1:(m=Q[a+3].pPenId,Q=(m=this.D.get(m))&&m.R4&&m.R4===2?!0:!1)):Q=!1}}if(Q)W=l[b+1].utf8,u=l[b+3].utf8,Q=l[b+2].utf8,a=this.D.get(l[b+2].pPenId),P=dx5(P,W,Q,u,a),u=new mF(f,D,S,G,P,N,H),b+=3;else{if(P.indexOf("<")>-1){var c=void 0;X=H;Q=U;a=f;m=D;var e=W,Y=S,Zg=N,GZ=[],FD=g.m9(""+P+"");if(!FD.getElementsByTagName("parsererror").length&&((c=FD.firstChild)==null?0:c.childNodes.length))for(c=g.E(FD.firstChild.childNodes),FD=c.next();!FD.done;FD=c.next()){FD=FD.value;var Ny=void 0, qy=void 0,y9=(qy=(Ny=FD.textContent)==null?void 0:Ny.replace(/\n/g,""))!=null?qy:"";if(FD.nodeType!==3||y9&&y9.match(/^ *$/)==null){Ny={};Object.assign(Ny,X||Q);qy=void 0;switch((qy=FD)==null?void 0:qy.tagName){case "b":Ny.bold=!0;break;case "i":Ny.italic=!0;break;case "u":Ny.underline=!0}GZ.push(new mF(a+e,m-e,Y,n.id,y9,Zg,Ny))}}X=GZ}X.length||(X=[new mF(f+W,D-W,S,n.id,P,N,H||U)])}if(X.length)for(N=g.E(X),H=N.next();!H.done;H=N.next())H=H.value,B.push(H),n.D.push(H);else u&&(B.push(u),n.D.push(u))}N= !0}}}Z=q}else Z=[];return Z};g.V(aN,g.AA);aN.prototype.Ty=function(q,Z,F){aRe(this.videoData.videoId,q.vssId,F.a8)}; aN.prototype.jd=function(q){if(this.audioTrack)for(var Z=g.E(this.audioTrack.captionTracks),F=Z.next();!F.done;F=Z.next())g.N3(this.K,F.value);q.CD()};g.V(rY,PN);rY.prototype.q3=function(q){var Z=this.K.D;PN.prototype.q3.call(this,q);for(q=q.length;q0;q.Z--){var Z=RN(q),F=RN(q),B=RN(q);Z&4&&(Z&3)===this.track&&(this.track===0||this.track===1)&&(Z=this.D,Z.D.push({time:q.S,type:this.track,II:F,qe:B,order:Z.D.length}))}BS6(this.D,q);return q.K}return[]}; WN.prototype.reset=function(){this.D.clear()};g.V(yv,PN);g.r=yv.prototype;g.r.Yv=function(){g.LF(this.Gb)}; g.r.m5=function(){this.element.removeEventListener("transitionend",this.m5,!1);g.vc(this.element,"ytp-rollup-mode");this.qV(this.j$,!0)}; g.r.c9=function(){return this.S?this.Dl:this.V}; g.r.QH=function(){return this.S?this.V:this.Dl}; g.r.qV=function(q,Z){this.j$=q;if(this.K.params.tM){for(var F=0,B=0;B0&&F=4){var n=$RB(G[1]),b=$RB(G[2])-n;n+=D;var N=(G=G[3])?G.split(" "):[];G={};var S=null;var l="";var U=null,u="";N=g.E(N);for(var P=N.next();!P.done;P=N.next())if(P=P.value.split(":"),P.length===2){var W=P[1];switch(P[0]){case "line":P=W.split(",");P[0].endsWith("%")&&(S=P[0],G.zn=Number.parseInt(S, 10),P.length===2&&(l=P[1].trim()));break;case "position":P=W.split(",");U=P[0];G.yM=Number.parseInt(U,10);P.length===2&&(u=P[1].trim());break;case "align":switch(W){case "start":G.textAlign=0;break;case "middle":G.textAlign=2;break;case "end":G.textAlign=1}}}S||l||(l="end");if(!U)switch(G.textAlign){case 0:G.yM=0;break;case 1:G.yM=100;break;case 2:G.yM=50}if(G.textAlign!=null){S=0;switch(l){case "center":S+=3;break;case "end":S+=6;break;default:S+=0}switch(u){case "line-left":S+=0;break;case "center":S+= 1;break;case "line-right":S+=2;break;default:switch(G.textAlign){case 0:S+=0;break;case 2:S+=1;break;case 1:S+=2}}l=S<0||S>8?7:S;G.KQ=l}f=f.substring(Vze.lastIndex).replace(/[\x01-\x09\x0b-\x1f]/g,"");u=G;G=f;f={};if(G.indexOf("<")<0&&G.indexOf("&")<0)D=ja6(n,b,5,u),b=new mF(n,b,5,D.id,G,!1,g.q_(f)?void 0:f),F.push(D),F.push(b),D.D.push(b);else for(l=G.split(eH_),l.length===1?(G=5,u=ja6(n,b,G,u)):(S=G=6,u=Object.assign({py:32},u),u=new AL(n,b,S,"_"+vN++,u)),F.push(u),S=n,U=0;U"+N+""),P.getElementsByTagName("parsererror").length?(W=P.createElement("span"),W.appendChild(P.createTextNode(N))):W=P.firstChild,vwu(this,S,b-(S-n),G,u,U>0,W,f,F)):S=$RB(N)+D}Vze.lastIndex=0}}return F}; var dRm=/^NOTE/,pY5=/(?:\r\n|\r|\n){2,}/,Vze=RegExp("^((?:[\\d]{2}:)?[\\d]{2}:[\\d]{2}\\.[\\d]{3})[\\t ]+--\x3e[\\t ]+((?:[\\d]{2}:)?[\\d]{2}:[\\d]{2}\\.[\\d]{3})(?:[\\t ]*)(.*)(?:\\r\\n|\\r|\\n)","gm"),eH_=RegExp("<((?:[\\d]{2}:)?[\\d]{2}:[\\d]{2}\\.[\\d]{3})>");g.V(IN,g.J);IN.prototype.clear=function(){this.D&&this.D.dispose();this.D=null}; IN.prototype.reset=function(){this.D&&this.D.reset()}; IN.prototype.SU=function(){g.J.prototype.SU.call(this);this.clear()};var Tm={windowColor:"#080808",windowOpacity:0,textAlign:2,KQ:7,yM:50,zn:100,isDefault:!0,G8:{background:"#080808",backgroundOpacity:.75,charEdgeStyle:0,color:"#fff",fontFamily:4,fontSizeIncrement:0,textOpacity:1,offset:1}};g.V(hHe,g.a3);g.r=hHe.prototype;g.r.SU=function(){if(this.Z||this.Y$){var q=this.B.Mi();q&&!q.jU()&&q.jm()}else J90(this,!1);g.a3.prototype.SU.call(this)}; g.r.Vx=function(){return this.J.U("html5_honor_caption_availabilities_in_audio_track")&&this.G!=="LIVE"&&this.G!=="SABR_LIVE"}; g.r.Hu=function(){if(this.o_)return this.Z||this.Y$;var q=this.getAudioTrack();if(this.Vx()){if(!q.captionTracks.length)return!1;if(!this.D)return!0}q=KBu(q,g.LO(this.J));return q==="CAPTIONS_INITIAL_STATE_ON_REQUIRED"?!0:q==="CAPTIONS_INITIAL_STATE_OFF_REQUIRED"?Vv(this):DR5(this)||Vv(this)?!0:iVt(this)}; g.r.load=function(){g.a3.prototype.load.call(this);this.PG=this.getAudioTrack();if(this.D)this.K&&(this.eU.clear(),this.Z?C$j(this,!0):this.player.getPresentingPlayerType()!==3&&this.D.Ty(this.K,"json3",this.Gb),this.Z||this.Y$||u7(this)||this.player.Ry("captionschanged",g.XZ(this.K)));else{var q;this.G==="OFFLINE"?q=new aN(this.player,this.videoData,this.getAudioTrack()):this.G==="SABR_LIVE"?q=new cN(this.videoData.D,this.player):this.G==="LIVE"?q=new pU(this.videoData.D,this.player):this.G==="INNERTUBE"? q=new g.UI(this.player,this.videoData,this.getAudioTrack()):q=new g.X9(this.player,this.videoData.QC,this.videoData.videoId,g.x5E(this.videoData),this.videoData.s$,this.videoData.eventId);this.D=q;g.y(this,this.D);this.D.jd(this.Gb)}}; g.r.unload=function(){this.Z&&this.K?C$j(this,!1):(this.WG&&g.HP(this.WG),this.player.WZ("captions"),this.dU=[],this.D&&this.D.nx(),this.eU.clear(),this.Dl&&this.player.sZ(this.Dl),this.U8());g.a3.prototype.unload.call(this);this.player.CG();this.player.Ry("captionschanged",{})}; g.r.create=function(){this.Hu()&&this.load();var q;a:{var Z,F,B;if(this.J.U("web_player_nitrate_promo_tooltip")&&((Z=this.videoData.getPlayerResponse())==null?0:(F=Z.captions)==null?0:(B=F.playerCaptionsTracklistRenderer)==null?0:B.enableTouchCaptionsNitrate)){var f,D;if(Z=(q=this.videoData.getPlayerResponse())==null?void 0:(f=q.captions)==null?void 0:(D=f.playerCaptionsTracklistRenderer)==null?void 0:D.captionTracks)for(q=g.E(Z),f=q.next();!f.done;f=q.next())if(f=f.value,f.kind==="asr"&&f.languageCode=== "en"){q=!0;break a}}q=!1}q&&this.B.publish("showpromotooltip",this.X.element)}; g.r.CD=function(){var q=KBu(this.player.getAudioTrack(),g.LO(this.J));var Z=q==="CAPTIONS_INITIAL_STATE_ON_REQUIRED"?eb(this,this.V):q==="CAPTIONS_INITIAL_STATE_OFF_REQUIRED"&&Vv(this)?JL(this):DR5(this)||this.V||iVt(this)?eb(this,this.V):Vv(this)?JL(this):null;if(this.Z||this.Y$){var F=g.vH(this.D.K,!0);q=[];for(var B=0;B0&&(Ny=this.K,this.TH(Ny,!!Ny,u7(this)?"g":this.V?"m":"s"));this.player.sZ(Z,void 0,this.G==="LIVE"||this.G==="SABR_LIVE"); !this.V||this.Y$||u7(this)||g.em(this.J)||g.dh(this.J)||g.SQ(this.J)||this.J.k$==="shortspage"||this.player.isInline()||(g.HP(this.WG),Z=aPB({KQ:0,yM:5,zn:5,tM:2,textAlign:0,F9:0,lang:"es-419"}),this.Oc=[Z],Ny=["Haz clic en "," para acceder a la configuraci\u00f3n."],this.I_||(D=new g.i0(g.WP()),g.y(this,D),this.I_=D.element),D=Z.end-Z.start,(G=g.va(this.K))&&this.Oc.push(new mF(Z.start,D,0,Z.id,G)),this.Oc.push(new mF(Z.start,D,0,Z.id,Ny[0]),new mF(Z.start,D,0,Z.id,this.I_,!0),new mF(Z.start,D,0, Z.id,Ny[1],!0)),this.player.sZ(this.Oc),g.$t(this.WG));!this.V||this.Y$||u7(this)||(g.LO(this.J)?tL(this,!0):l7(this,!0),this.PG&&(this.PG.G=this.K),this.player.CG());this.V=!1}}; g.r.onCueRangeEnter=function(q){this.dU.push(q);Sb(this.BG)}; g.r.onCueRangeExit=function(q){g.NL(this.dU,q);this.D instanceof pU&&this.D.X&&this.player.MB([q]);Sb(this.BG)}; g.r.getCaptionWindowContainerId=function(){return this.X.element.id}; g.r.uwF=function(){XY_(this,this.Oc);this.Oc=null}; g.r.Cd=function(){var q=this;if(!this.KB||!this.Z){this.BG.stop();g.rBX(this.HG);this.dU.sort(g.nu);var Z=this.dU;if(this.Dl){var F=g.uh(Z,function(D){return this.Dl.indexOf(D)===-1},this); F.length&&(Z=F)}Z=g.E(Z);for(F=Z.next();!F.done;F=Z.next())jhu(this,F.value);Z=g.E(Object.entries(this.zP));var B=Z.next();for(F={};!B.done;F={UD:void 0,Of:void 0},B=Z.next()){var f=g.E(B.value);B=f.next().value;f=f.next().value;F.UD=B;F.Of=f;this.HG[F.UD]?(F.Of.element.parentNode||(F.Of instanceof yv||F.Of instanceof rY||g.O4(this.zP,function(D){return function(G,n){n!==D.UD&&G.K.params.KQ===D.Of.K.params.KQ&&G.K.params.yM===D.Of.K.params.yM&&G.K.params.zn===D.Of.K.params.zn&&(G.dispose(),delete q.zP[n]); return n===D.UD}}(F),this),this.X.element.appendChild(F.Of.element)),F.Of.qV(this.HG[F.UD])):(F.Of.dispose(),delete this.zP[F.UD])}}}; g.r.ner=function(){CJB(this,{},!0);this.player.Ry("captionssettingschanged")}; g.r.eS=function(){var q=Tm.G8;q={background:q.background,backgroundOpacity:q.backgroundOpacity,charEdgeStyle:q.charEdgeStyle,color:q.color,fontFamily:q.fontFamily,fontSizeIncrement:q.fontSizeIncrement,fontStyle:q.bold&&q.italic?3:q.bold?1:q.italic?2:0,textOpacity:q.textOpacity,windowColor:Tm.windowColor,windowOpacity:Tm.windowOpacity};var Z=nYE()||{};Z.background!=null&&(q.background=Z.background);Z.backgroundOverride!=null&&(q.backgroundOverride=Z.backgroundOverride);Z.backgroundOpacity!=null&&(q.backgroundOpacity= Z.backgroundOpacity);Z.backgroundOpacityOverride!=null&&(q.backgroundOpacityOverride=Z.backgroundOpacityOverride);Z.charEdgeStyle!=null&&(q.charEdgeStyle=Z.charEdgeStyle);Z.charEdgeStyleOverride!=null&&(q.charEdgeStyleOverride=Z.charEdgeStyleOverride);Z.color!=null&&(q.color=Z.color);Z.colorOverride!=null&&(q.colorOverride=Z.colorOverride);Z.fontFamily!=null&&(q.fontFamily=Z.fontFamily);Z.fontFamilyOverride!=null&&(q.fontFamilyOverride=Z.fontFamilyOverride);Z.fontSizeIncrement!=null&&(q.fontSizeIncrement= Z.fontSizeIncrement);Z.fontSizeIncrementOverride!=null&&(q.fontSizeIncrementOverride=Z.fontSizeIncrementOverride);Z.fontStyle!=null&&(q.fontStyle=Z.fontStyle);Z.fontStyleOverride!=null&&(q.fontStyleOverride=Z.fontStyleOverride);Z.textOpacity!=null&&(q.textOpacity=Z.textOpacity);Z.textOpacityOverride!=null&&(q.textOpacityOverride=Z.textOpacityOverride);Z.windowColor!=null&&(q.windowColor=Z.windowColor);Z.windowColorOverride!=null&&(q.windowColorOverride=Z.windowColorOverride);Z.windowOpacity!=null&& (q.windowOpacity=Z.windowOpacity);Z.windowOpacityOverride!=null&&(q.windowOpacityOverride=Z.windowOpacityOverride);return q}; g.r.MI=function(q,Z){var F={};Object.assign(F,nYE());Object.assign(F,q);CJB(this,F,Z);this.player.Ry("captionssettingschanged")}; g.r.U8=function(){!this.Z&&this.loaded&&(g.Hh(this.zP,function(q,Z){q.dispose();delete this.zP[Z]},this),this.Cd())}; g.r.zA=function(q,Z){switch(q){case "fontSize":if(isNaN(Z))break;q=g.JY(Z,-2,4);this.MI({fontSizeIncrement:q});return q;case "reload":Z&&!this.Z&&Ur(this,this.K,!0);break;case "stickyLoading":Z!==void 0&&this.J.V&&(g.LO(this.J)?tL(this,!!Z):l7(this,!!Z));break;case "track":return rWe(this,Z);case "tracklist":return this.D?g.DC(g.vH(this.D.K,!(!Z||!Z.includeAsr)),function(F){return g.XZ(F)}):[]; case "translationLanguages":return this.D?this.D.Z.map(function(F){return Object.assign({},F)}):[]; case "sampleSubtitles":this.Z||Z===void 0||J90(this,!!Z);break;case "sampleSubtitlesCustomized":this.Z||J90(this,!!Z,Z);break;case "recommendedTranslationLanguages":return g.gk();case "defaultTranslationSourceTrackIndices":return this.D?this.D.V:[]}}; g.r.getOptions=function(){var q="reload fontSize track tracklist translationLanguages sampleSubtitle".split(" ");this.J.V&&q.push("stickyLoading");return q}; g.r.gV=function(){var q=this.K;if(this.B.J3("captions")){if(this.J.U("html5_modify_caption_vss_logging")){var Z;return(q=(Z=this.videoData.zw)!=null?Z:null)?{cc:g.Hmb(q)}:{}}if(q)return Z=q.vssId,q.translationLanguage&&Z&&(Z="t"+Z+"."+g.Qw(q)),{cc:Z}}return{}}; g.r.kHU=function(){this.isSubtitlesOn()?(g.LO(this.J)?tL(this,!1):l7(this,!1),K0E(this),Ur(this,null,!0)):this.WQ()}; g.r.WQ=function(){var q=u7(this)||!this.K?eb(this,!0):this.K;q&&this.El(q.vssId,"m");this.isSubtitlesOn()||Ur(this,u7(this)||!this.K?eb(this,!0):this.K,!0)}; g.r.isSubtitlesOn=function(){return!!this.loaded&&!!this.K&&!u7(this)}; g.r.RWU=function(){var q=u7(this);Vv(this,q)?Ur(this,this.getAudioTrack().D,!1):this.videoData.captionTracks.length&&(this.loaded&&this.unload(),this.Vx()&&(this.V=!1,this.K=null,this.D&&(this.D.dispose(),this.D=null)),this.Hu()&&(q?Ur(this,eb(this,!1),!1):this.load()))}; g.r.RX=function(q){q&&(this.uL={top:q.top,right:q.right,bottom:q.bottom,left:q.left,width:1-q.left-q.right,height:1-q.top-q.bottom},this.X.element.style.top=this.uL.top*100+"%",this.X.element.style.left=this.uL.left*100+"%",this.X.element.style.width=this.uL.width*100+"%",this.X.element.style.height=this.uL.height*100+"%",this.X.element.style.position="absolute",q=zRt(this))&&(this.X.element.style.width=q.width+"px",this.X.element.style.height=q.height+"px")}; g.r.onVideoDataChange=function(q,Z){q==="newdata"&&(this.videoData=Z,this.loaded&&this.unload(),this.V=!1,this.K=null,this.D&&(this.D.dispose(),this.D=null,this.player.Ry("captionschanged",{})),this.Hu()&&this.load())}; g.r.getAudioTrack=function(){return this.player.getAudioTrack()}; g.r.KsP=function(){var q=this.B.Mi();q&&!q.jU()&&q.jm();this.B.isFullscreen()?(this.Z=this.o_=!0,this.loaded&&this.CD()):(this.o_=this.J.controlsType==="3",this.Z=IPt(this));Ur(this,this.K)}; g.r.eG=function(){var q,Z,F,B=(q=this.videoData.getPlayerResponse())==null?void 0:(Z=q.captions)==null?void 0:(F=Z.playerCaptionsTracklistRenderer)==null?void 0:F.openTranscriptCommand;B&&this.player.a_("innertubeCommand",B)}; g.r.TH=function(q,Z,F){var B=/&|,|:|;|(\n)|(\s)|(\/)|(\\)/gm,f="";q&&(f=q.vssId,f=f.replace(B,""));var D="";q&&q.getId()&&(D=q.getId()||"");q&&q.getXtags()&&(q=q.getXtags(),q=q.replace(B,""),D=D.concat(";"+q));this.B.TH(Z?f:"",Z?D:"",F)}; g.r.El=function(q,Z){q=(q||"").replace(/&|,|:|;|(\n)|(\s)|(\/)|(\\)/gm,"");q.length>0&&this.B.El(q,Z)};g.Nx("captions",hHe);})(_yt_player);