1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6900],{6900:function(e,t,s){s.r(t),s.d(t,{SSAParser:function(){return p},default:function(){return g}});var a=s(60574);let r=/^Format:[\s\t]*/,i=/^Style:[\s\t]*/,l=/^Dialogue:[\s\t]*/,n=/[\s\t]*,[\s\t]*/,c=/\{[^}]+\}/g,h=/\\N/g,o=/^\[(.*)[\s\t]?Styles\]$/,u=/^\[(.*)[\s\t]?Events\]$/;class p{f;P=0;a=null;j=[];k=[];O=null;d;Q={};async init(e){this.f=e,e.errors&&(this.d=(await s.e(2557).then(s.bind(s,82557))).ParseErrorBuilder)}parse(e,t){if(this.P)switch(this.P){case 1:if(""===e)this.P=0;else if(i.test(e)){if(this.O){let t=e.replace(i,"").split(n);this.T(t)}else this.e(this.d?.N("Style",t))}else r.test(e)?this.O=e.replace(r,"").split(n):u.test(e)&&(this.O=null,this.P=2);break;case 2:if(""===e)this.R();else if(l.test(e)){if(this.R(),this.O){let s=e.replace(l,"").split(n),a=this.U(s,t);a&&(this.a=a)}else this.e(this.d?.N("Dialogue",t))}else this.a?this.a.text+="\n"+e.replace(c,"").replace(h,"\n"):r.test(e)?this.O=e.replace(r,"").split(n):o.test(e)?(this.O=null,this.P=1):u.test(e)&&(this.O=null)}else""===e||(o.test(e)?(this.O=null,this.P=1):u.test(e)&&(this.O=null,this.P=2))}done(){return{metadata:{},cues:this.j,regions:[],errors:this.k}}R(){this.a&&(this.j.push(this.a),this.f.onCue?.(this.a),this.a=null)}T(e){let t="Default",s={},a,r="center",i="bottom",l,n=1.2,c,h,o=3,u=[];for(let p=0;p<this.O.length;p++){let b=this.O[p],g=e[p];switch(b){case"Name":t=g;break;case"Fontname":s["font-family"]=g;break;case"Fontsize":s["font-size"]=`calc(${g} / var(--overlay-height))`;break;case"PrimaryColour":let k=f(g);k&&(s["--cue-color"]=k);break;case"BorderStyle":o=parseInt(g,10);break;case"BackColour":h=f(g);break;case"OutlineColour":let d=f(g);d&&(c=d);break;case"Bold":parseInt(g)&&(s["font-weight"]="bold");break;case"Italic":parseInt(g)&&(s["font-style"]="italic");break;case"Underline":parseInt(g)&&(s["text-decoration"]="underline");break;case"StrikeOut":parseInt(g)&&(s["text-decoration"]="line-through");break;case"Spacing":s["letter-spacing"]=g+"px";break;case"AlphaLevel":s.opacity=parseFloat(g);break;case"ScaleX":u.push(`scaleX(${parseFloat(g)/100})`);break;case"ScaleY":u.push(`scaleY(${parseFloat(g)/100})`);break;case"Angle":u.push(`rotate(${g}deg)`);break;case"Shadow":n=1.2*parseInt(g,10);break;case"MarginL":s["--cue-width"]="auto",s["--cue-left"]=parseFloat(g)+"px";break;case"MarginR":s["--cue-width"]="auto",s["--cue-right"]=parseFloat(g)+"px";break;case"MarginV":l=parseFloat(g);break;case"Outline":a=parseInt(g,10);break;case"Alignment":let O=parseInt(g,10);switch(O>=4&&(i=O>=7?"top":"center"),O%3){case 1:r="start";break;case 2:r="center";break;case 3:r="end"}}}if(s.S=i,s["--cue-white-space"]="normal",s["--cue-line-height"]="normal",s["--cue-text-align"]=r,"center"===i?(s["--cue-top"]="50%",u.push("translateY(-50%)")):s[`--cue-${i}`]=(l||0)+"px",1===o&&(s["--cue-padding-y"]="0"),(1===o||h)&&(s["--cue-bg-color"]=1===o?"none":h),3===o&&c&&(s["--cue-outline"]=`${a}px solid ${c}`),1===o&&"number"==typeof a){let e=h??"#000";s["--cue-text-shadow"]=[c&&b(1.2*a,1.2*n,c),c?b(a/2*a,a/2*n,e):b(a,n,e)].filter(Boolean).join(", ")}u.length&&(s["--cue-transform"]=u.join(" ")),this.Q[t]=s}U(e,t){let s=this.V(e),r=this.o(s.Start,s.End,t);if(!r)return;let i=new a.b(r[0],r[1],""),l={...this.Q[s.Style]||{}},n=s.Name?`<v ${s.Name}>`:"",o=l.S,u=s.MarginL&&parseFloat(s.MarginL),p=s.MarginR&&parseFloat(s.MarginR),f=s.MarginV&&parseFloat(s.MarginV);return u&&(l["--cue-width"]="auto",l["--cue-left"]=u+"px"),p&&(l["--cue-width"]="auto",l["--cue-right"]=p+"px"),f&&"center"!==o&&(l[`--cue-${o}`]=f+"px"),i.text=n+e.slice(this.O.length-1).join(", ").replace(c,"").replace(h,"\n"),delete l.S,Object.keys(l).length&&(i.style=l),i}V(e){let t={};for(let s=0;s<this.O.length;s++)t[this.O[s]]=e[s];return t}o(e,t,s){let r=(0,a.p)(e),i=(0,a.p)(t);if(null!==r&&null!==i&&i>r)return[r,i];null===r&&this.e(this.d?.q(e,s)),null===i&&this.e(this.d?.r(t,s)),null!=r&&null!==i&&i>r&&this.e(this.d?.s(r,i,s))}e(e){if(e){if(this.k.push(e),this.f.strict)throw this.f.cancel(),e;this.f.onError?.(e)}}}function f(e){let t=parseInt(e.replace("&H",""),16);return t>=0?"rgba("+[255&t,t>>8&255,t>>16&255,(t>>24&255^255)/255].join(",")+")":null}function b(e,t,s){let a=Math.ceil(2*Math.PI*e),r="";for(let i=0;i<a;i++){let l=2*Math.PI*i/a;r+=e*Math.cos(l)+"px "+t*Math.sin(l)+"px 0 "+s+(i==a-1?"":",")}return r}function g(){return new p}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.