PageSourceSearch

https://www.vwt.org.uk/vite/assets/ssa-parser-BMoGMZ1M.js

js vwt.org.uk collected 2026-10-02 06:00:51 UTC 5,231 bytes, 3 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/errors-BMXDrKF_.js","assets/prod-D0AP2oAO.js","assets/app-BOkv3sr5.js","assets/app-B0HfA0GL.css"])))=>i.map(i=>d[i]);
2var F=Object.defineProperty;var A=(c,t,s)=>t in c?F(c,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):c[t]=s;var f=(c,t,s)=>A(c,typeof t!="symbol"?t+"":t,s);import{a as P}from"./app-BOkv3sr5.js";import{b as L,p as R}from"./prod-D0AP2oAO.js";const b=/^Format:[\s\t]*/,y=/^Style:[\s\t]*/,O=/^Dialogue:[\s\t]*/,S=/[\s\t]*,[\s\t]*/,w=/\{[^}]+\}/g,I=/\\N/g,x=/^\[(.*)[\s\t]?Styles\]$/,k=/^\[(.*)[\s\t]?Events\]$/;class V{constructor(){f(this,"h");f(this,"O",0);f(this,"c",null);f(this,"l",[]);f(this,"m",[]);f(this,"N",null);f(this,"f");f(this,"P",{})}async init(t){this.h=t,t.errors&&(this.f=(await P(async()=>{const{ParseErrorBuilder:s}=await import("./errors-BMXDrKF_.js");return{ParseErrorBuilder:s}},__vite__mapDeps([0,1,2,3]))).ParseErrorBuilder)}parse(t,s){var e,a;if(this.O)switch(this.O){case 1:if(t==="")this.O=0;else if(y.test(t))if(this.N){const i=t.replace(y,"").split(S);this.S(i)}else this.g((e=this.f)==null?void 0:e.T("Style",s));else b.test(t)?this.N=t.replace(b,"").split(S):k.test(t)&&(this.N=null,this.O=2);break;case 2:if(t==="")this.Q();else if(O.test(t))if(this.Q(),this.N){const i=t.replace(O,"").split(S),r=this.U(i,s);r&&(this.c=r)}else this.g((a=this.f)==null?void 0:a.T("Dialogue",s));else this.c?this.c.text+="\n"+t.replace(w,"").replace(I,"\n"):b.test(t)?this.N=t.replace(b,"").split(S):x.test(t)?(this.N=null,this.O=1):k.test(t)&&(this.N=null)}else t===""||(x.test(t)?(this.N=null,this.O=1):k.test(t)&&(this.N=null,this.O=2))}done(){return{metadata:{},cues:this.l,regions:[],errors:this.m}}Q(){var t,s;this.c&&(this.l.push(this.c),(s=(t=this.h).onCue)==null||s.call(t,this.c),this.c=null)}S(t){let s="Default",e={},a,i="center",r="bottom",p,n=1.2,o,h,u=3,d=[];for(let g=0;g<this.N.length;g++){const M=this.N[g],l=t[g];switch(M){case"Name":s=l;break;case"Fontname":e["font-family"]=l;break;case"Fontsize":e["font-size"]="calc(".concat(l," / var(--overlay-height))");break;case"PrimaryColour":const _=T(l);_&&(e["--cue-color"]=_);break;case"BorderStyle":u=parseInt(l,10);break;case"BackColour":h=T(l);break;case"OutlineColour":const E=T(l);E&&(o=E);break;case"Bold":parseInt(l)&&(e["font-weight"]="bold");break;case"Italic":parseInt(l)&&(e["font-style"]="italic");break;case"Underline":parseInt(l)&&(e["text-decoration"]="underline");break;case"StrikeOut":parseInt(l)&&(e["text-decoration"]="line-through");break;case"Spacing":e["letter-spacing"]=l+"px";break;case"AlphaLevel":e.opacity=parseFloat(l);break;case"ScaleX":d.push("scaleX(".concat(parseFloat(l)/100,")"));break;case"ScaleY":d.push("scaleY(".concat(parseFloat(l)/100,")"));break;case"Angle":d.push("rotate(".concat(l,"deg)"));break;case"Shadow":n=parseInt(l,10)*1.2;break;case"MarginL":e["--cue-width"]="auto",e["--cue-left"]=parseFloat(l)+"px";break;case"MarginR":e["--cue-width"]="auto",e["--cue-right"]=parseFloat(l)+"px";break;case"MarginV":p=parseFloat(l);break;case"Outline":a=parseInt(l,10);break;case"Alignment":const m=parseInt(l,10);switch(m>=4&&(r=m>=7?"top":"center"),m%3){case 1:i="start";break;case 2:i="center";break;case 3:i="end";break}}}if(e.R=r,e["--cue-white-space"]="normal",e["--cue-line-height"]="normal",e["--cue-text-align"]=i,r==="center"?(e["--cue-top"]="50%",d.push("translateY(-50%)")):e["--cue-".concat(r)]=(p||0)+"px",u===1&&(e["--cue-padding-y"]="0"),(u===1||h)&&(e["--cue-bg-color"]=u===1?"none":h),u===3&&o&&(e["--cue-outline"]="".concat(a,"px solid ").concat(o)),u===1&&typeof a=="number"){const g=h!=null?h:"#000";e["--cue-text-shadow"]=[o&&N(a*1.2,n*1.2,o),o?N(a*(a/2),n*(a/2),g):N(a,n,g)].filter(Boolean).join(", ")}d.length&&(e["--cue-transform"]=d.join(" ")),this.P[s]=e}U(t,s){const e=this.V(t),a=this.q(e.Start,e.End,s);if(!a)return;const i=new L(a[0],a[1],""),r={...this.P[e.Style]||{}},p=e.Name?"<v ".concat(e.Name,">"):"",n=r.R,o=e.MarginL&&parseFloat(e.MarginL),h=e.MarginR&&parseFloat(e.MarginR),u=e.MarginV&&parseFloat(e.MarginV);return o&&(r["--cue-width"]="auto",r["--cue-left"]=o+"px"),h&&(r["--cue-width"]="auto",r["--cue-right"]=h+"px"),u&&n!=="center"&&(r["--cue-".concat(n)]=u+"px"),i.text=p+t.slice(this.N.length-1).join(", ").replace(w,"").replace(I,"\n"),delete r.R,Object.keys(r).length&&(i.style=r),i}V(t){const s={};for(let e=0;e<this.N.length;e++)s[this.N[e]]=t[e];return s}q(t,s,e){var r,p,n;const a=R(t),i=R(s);if(a!==null&&i!==null&&i>a)return[a,i];a===null&&this.g((r=this.f)==null?void 0:r.s(t,e)),i===null&&this.g((p=this.f)==null?void 0:p.t(s,e)),a!=null&&i!==null&&i>a&&this.g((n=this.f)==null?void 0:n.u(a,i,e))}g(t){var s,e;if(t){if(this.m.push(t),this.h.strict)throw this.h.cancel(),t;(e=(s=this.h).onError)==null||e.call(s,t)}}}function T(c){const t=parseInt(c.replace("&H",""),16);if(t>=0){const e=(t>>24&255^255)/255,a=t>>16&255,i=t>>8&255;return"rgba("+[t&255,i,a,e].join(",")+")"}return null}function N(c,t,s){const e=Math.ceil(2*Math.PI*c);let a="";for(let i=0;i<e;i++){const r=2*Math.PI*i/e;a+=c*Math.cos(r)+"px "+t*Math.sin(r)+"px 0 "+s+(i==e-1?"":",")}return a}function B(){return new V}export{V as SSAParser,B as default};
3//# sourceMappingURL=ssa-parser-BMoGMZ1M.js.map

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.