1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8851],{8851:function(e,t,s){s.r(t),s.d(t,{SSAParser:function(){return p},default:function(){return b}});var a=s(16497);let r=/^Format:[\s\t]*/,i=/^Style:[\s\t]*/,l=/^Dialogue:[\s\t]*/,n=/[\s\t]*,[\s\t]*/,c=/\{[^}]+\}/g,h=/\\N/g,u=/^\[(.*)[\s\t]?Styles\]$/,o=/^\[(.*)[\s\t]?Events\]$/;class p{h;O=0;c=null;l=[];m=[];N=null;f;P={};async init(e){this.h=e,e.errors&&(this.f=(await s.e(2743).then(s.bind(s,42743))).ParseErrorBuilder)}parse(e,t){if(this.O)switch(this.O){case 1:if(""===e)this.O=0;else if(i.test(e)){if(this.N){let t=e.replace(i,"").split(n);this.S(t)}else this.g(this.f?.T("Style",t))}else r.test(e)?this.N=e.replace(r,"").split(n):o.test(e)&&(this.N=null,this.O=2);break;case 2:if(""===e)this.Q();else if(l.test(e)){if(this.Q(),this.N){let s=e.replace(l,"").split(n),a=this.U(s,t);a&&(this.c=a)}else this.g(this.f?.T("Dialogue",t))}else this.c?this.c.text+="\n"+e.replace(c,"").replace(h,"\n"):r.test(e)?this.N=e.replace(r,"").split(n):u.test(e)?(this.N=null,this.O=1):o.test(e)&&(this.N=null)}else""===e||(u.test(e)?(this.N=null,this.O=1):o.test(e)&&(this.N=null,this.O=2))}done(){return{metadata:{},cues:this.l,regions:[],errors:this.m}}Q(){this.c&&(this.l.push(this.c),this.h.onCue?.(this.c),this.c=null)}S(e){let t="Default",s={},a,r="center",i="bottom",l,n=1.2,c,h,u=3,o=[];for(let p=0;p<this.N.length;p++){let g=this.N[p],b=e[p];switch(g){case"Name":t=b;break;case"Fontname":s["font-family"]=b;break;case"Fontsize":s["font-size"]=`calc(${b} / var(--overlay-height))`;break;case"PrimaryColour":let k=f(b);k&&(s["--cue-color"]=k);break;case"BorderStyle":u=parseInt(b,10);break;case"BackColour":h=f(b);break;case"OutlineColour":let d=f(b);d&&(c=d);break;case"Bold":parseInt(b)&&(s["font-weight"]="bold");break;case"Italic":parseInt(b)&&(s["font-style"]="italic");break;case"Underline":parseInt(b)&&(s["text-decoration"]="underline");break;case"StrikeOut":parseInt(b)&&(s["text-decoration"]="line-through");break;case"Spacing":s["letter-spacing"]=b+"px";break;case"AlphaLevel":s.opacity=parseFloat(b);break;case"ScaleX":o.push(`scaleX(${parseFloat(b)/100})`);break;case"ScaleY":o.push(`scaleY(${parseFloat(b)/100})`);break;case"Angle":o.push(`rotate(${b}deg)`);break;case"Shadow":n=1.2*parseInt(b,10);break;case"MarginL":s["--cue-width"]="auto",s["--cue-left"]=parseFloat(b)+"px";break;case"MarginR":s["--cue-width"]="auto",s["--cue-right"]=parseFloat(b)+"px";break;case"MarginV":l=parseFloat(b);break;case"Outline":a=parseInt(b,10);break;case"Alignment":let N=parseInt(b,10);switch(N>=4&&(i=N>=7?"top":"center"),N%3){case 1:r="start";break;case 2:r="center";break;case 3:r="end"}}}if(s.R=i,s["--cue-white-space"]="normal",s["--cue-line-height"]="normal",s["--cue-text-align"]=r,"center"===i?(s["--cue-top"]="50%",o.push("translateY(-50%)")):s[`--cue-${i}`]=(l||0)+"px",1===u&&(s["--cue-padding-y"]="0"),(1===u||h)&&(s["--cue-bg-color"]=1===u?"none":h),3===u&&c&&(s["--cue-outline"]=`${a}px solid ${c}`),1===u&&"number"==typeof a){let e=h??"#000";s["--cue-text-shadow"]=[c&&g(1.2*a,1.2*n,c),c?g(a/2*a,a/2*n,e):g(a,n,e)].filter(Boolean).join(", ")}o.length&&(s["--cue-transform"]=o.join(" ")),this.P[t]=s}U(e,t){let s=this.V(e),r=this.q(s.Start,s.End,t);if(!r)return;let i=new a.b(r[0],r[1],""),l={...this.P[s.Style]||{}},n=s.Name?`<v ${s.Name}>`:"",u=l.R,o=s.MarginL&&parseFloat(s.MarginL),p=s.MarginR&&parseFloat(s.MarginR),f=s.MarginV&&parseFloat(s.MarginV);return o&&(l["--cue-width"]="auto",l["--cue-left"]=o+"px"),p&&(l["--cue-width"]="auto",l["--cue-right"]=p+"px"),f&&"center"!==u&&(l[`--cue-${u}`]=f+"px"),i.text=n+e.slice(this.N.length-1).join(", ").replace(c,"").replace(h,"\n"),delete l.R,Object.keys(l).length&&(i.style=l),i}V(e){let t={};for(let s=0;s<this.N.length;s++)t[this.N[s]]=e[s];return t}q(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.g(this.f?.s(e,s)),null===i&&this.g(this.f?.t(t,s)),null!=r&&null!==i&&i>r&&this.g(this.f?.u(r,i,s))}g(e){if(e){if(this.m.push(e),this.h.strict)throw this.h.cancel(),e;this.h.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 g(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 b(){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.