textmode.js 0.8.1-beta.1 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,12 +28,12 @@ ${"↓".repeat(24)}
28
28
  }
29
29
  }
30
30
  var $t = ((n) => (n[n.SILENT = 0] = "SILENT", n[n.WARNING = 1] = "WARNING", n[n.ERROR = 2] = "ERROR", n[n.THROW = 3] = "THROW", n))($t || {});
31
- const I = class I {
31
+ const _ = class _ {
32
32
  constructor() {
33
33
  a(this, "l", { globalLevel: 3 });
34
34
  }
35
35
  static u() {
36
- return I.h || (I.h = new I()), I.h;
36
+ return _.h || (_.h = new _()), _.h;
37
37
  }
38
38
  v(t, e) {
39
39
  const i = "%c[textmode.js] Oops! (╯°□°)╯︵ Something went wrong in your code.", r = "color: #f44336; font-weight: bold; background: #ffebee; padding: 2px 6px; border-radius: 3px;";
@@ -55,10 +55,10 @@ const I = class I {
55
55
  this.l.globalLevel = t;
56
56
  }
57
57
  };
58
- a(I, "h", null);
59
- let ut = I;
58
+ a(_, "h", null);
59
+ let ut = _;
60
60
  const vt = ut.u();
61
- class q {
61
+ class W {
62
62
  constructor(t, e, i) {
63
63
  a(this, "A");
64
64
  a(this, "C");
@@ -115,7 +115,7 @@ class q {
115
115
  const u = this.H(t);
116
116
  return o.uniform1i(i, u), o.activeTexture(o.TEXTURE0 + u), void o.bindTexture(o.TEXTURE_2D, e);
117
117
  }
118
- if (e instanceof Z) {
118
+ if (e instanceof X) {
119
119
  const u = this.H(t);
120
120
  return o.uniform1i(i, u), o.activeTexture(o.TEXTURE0 + u), void o.bindTexture(o.TEXTURE_2D, e.textures[0]);
121
121
  }
@@ -146,10 +146,10 @@ class q {
146
146
  function mt(n, t, e, i) {
147
147
  return 180 * Math.atan2(i - t, e - n) / Math.PI;
148
148
  }
149
- function z(n, t, e, i) {
149
+ function k(n, t, e, i) {
150
150
  return Math.hypot(e - n, i - t);
151
151
  }
152
- function O(n, t, e) {
152
+ function Z(n, t, e) {
153
153
  return Math.min(Math.max(n, t), e);
154
154
  }
155
155
  function xt(n) {
@@ -168,7 +168,7 @@ function Rt(n, t, e, i, r) {
168
168
  n.bindBuffer(t, e), n.bufferData(t, i, r), n.bindBuffer(t, null);
169
169
  }
170
170
  const rt = `#version 300 es
171
- in vec2 A0;in vec2 A1;in vec2 A2;in vec2 A3;in vec3 A4;in vec4 A5;in vec4 A6;in vec4 A7;in vec3 A8;in vec3 A9;in vec4 Aa;in vec4 Ab;in vec3 Ac;uniform vec2 Ur;uniform float Us;uniform float Ut;out vec2 v_uv;out vec3 v_glyphIndex;out vec4 v_glyphColor;out vec4 v_cellColor;out vec4 v_glyphFlags;out vec3 v_worldPosition;out vec3 v_normal;out float v_geometryType;const float A=6.28318530718f;const int B=2;const int C=3;const int D=4;vec2 E(float F,vec2 G,vec2 H,vec2 I,vec2 J){float K=1.0f-F;float L=K*K;float M=L*K;float N=F*F;float O=N*F;return M*G+3.0f*L*F*H+3.0f*K*N*I+O*J;}vec2 P(float F,vec2 G,vec2 H,vec2 I,vec2 J){float K=1.0f-F;float L=K*K;float N=F*F;return-3.0f*L*G+3.0f*(L-2.0f*K*F)*H+3.0f*(2.0f*K*F-N)*I+3.0f*N*J;}vec3 Q(vec3 R,float S){float T=cos(S);float U=sin(S);return vec3(R.x,R.y*T-R.z*U,R.y*U+R.z*T);}vec3 V(vec3 R,float S){float T=cos(S);float U=sin(S);return vec3(R.x*T+R.z*U,R.y,-R.x*U+R.z*T);}vec3 W(vec3 R,float S){float T=cos(S);float U=sin(S);return vec3(R.x*T-R.y*U,R.x*U+R.y*T,R.z);}vec3 X(vec3 R,vec3 Y){vec3 Z=R;if(Y.z!=0.0f){Z=W(Z,Y.z);}if(Y.y!=0.0f){Z=V(Z,Y.y);}if(Y.x!=0.0f){Z=Q(Z,Y.x);}return Z;}void main(){v_uv=A1;v_glyphIndex=A4;v_glyphColor=A5;v_cellColor=A6;v_glyphFlags=A7;vec4 a=Aa;vec4 b=Ab;vec2 c=A3;vec2 d=A2;float e=Ac.x;float f=Ac.y;int g=int(Ac.z);vec2 h=d;vec2 i=h+c*0.5f;float j=f+e*0.5f;vec3 k=vec3(i,j);vec3 l;if(g==D){float F=clamp(A0.x,0.0f,1.0f);vec2 G=b.xy;vec2 H=a.xy;vec2 I=a.zw;vec2 J=b.zw;vec2 m=E(F,G,H,I,J);vec2 n=P(F,G,H,I,J);float o=length(n);vec2 p=o>0.0f?n/o:vec2(1.0f,0.0f);vec2 q=vec2(-p.y,p.x);vec2 r=m;vec2 s=r+q*A0.y*c.y;l=vec3(s,f);}else if(g==C){float t=mod(a.x,A);if(t<0.0f){t+=A;}float u=mod(a.y,A);if(u<0.0f){u+=A;}float v=t-u;if(v<=0.0f){v+=A;}float S=t-A0.x*v;vec2 w=vec2(cos(S),sin(S))*A0.y;vec2 s=w*c+h;l=vec3(s,f);}else if(g==B){vec2 s=A0.xy*c+h;l=vec3(s,f);}vec3 x=X(l,A9);vec3 y=x+A8;vec3 z=vec3(0.0f,0.0f,1.0f);v_worldPosition=y;v_normal=z;v_geometryType=float(g);vec2 AA=(y.xy/Ur)*2.0f;AA.y=-AA.y;float AB=y.z/Ur.y;float AC=clamp(-AB*Us,-0.99f,0.99f);if(Ut>0.5f){gl_Position=vec4(AA,AC,1.0f);}else{float AD=0.5f;float AE=1.0f/(1.0f-AB*AD);AA*=AE;gl_Position=vec4(AA,AC,1.0f);}}`, X = class X {
171
+ in vec2 A0;in vec2 A1;in vec2 A2;in vec2 A3;in vec3 A4;in vec4 A5;in vec4 A6;in vec4 A7;in vec3 A8;in vec3 A9;in vec4 Aa;in vec4 Ab;in vec3 Ac;uniform vec2 Ur;uniform float Us;uniform float Ut;out vec2 v_uv;out vec3 v_glyphIndex;out vec4 v_glyphColor;out vec4 v_cellColor;out vec4 v_glyphFlags;out vec3 v_worldPosition;out vec3 v_normal;out float v_geometryType;const float A=6.28318530718f;const int B=2;const int C=3;const int D=4;vec2 E(float F,vec2 G,vec2 H,vec2 I,vec2 J){float K=1.0f-F;float L=K*K;float M=L*K;float N=F*F;float O=N*F;return M*G+3.0f*L*F*H+3.0f*K*N*I+O*J;}vec2 P(float F,vec2 G,vec2 H,vec2 I,vec2 J){float K=1.0f-F;float L=K*K;float N=F*F;return-3.0f*L*G+3.0f*(L-2.0f*K*F)*H+3.0f*(2.0f*K*F-N)*I+3.0f*N*J;}vec3 Q(vec3 R,float S){float T=cos(S);float U=sin(S);return vec3(R.x,R.y*T-R.z*U,R.y*U+R.z*T);}vec3 V(vec3 R,float S){float T=cos(S);float U=sin(S);return vec3(R.x*T+R.z*U,R.y,-R.x*U+R.z*T);}vec3 W(vec3 R,float S){float T=cos(S);float U=sin(S);return vec3(R.x*T-R.y*U,R.x*U+R.y*T,R.z);}vec3 X(vec3 R,vec3 Y){vec3 Z=R;if(Y.z!=0.0f){Z=W(Z,Y.z);}if(Y.y!=0.0f){Z=V(Z,Y.y);}if(Y.x!=0.0f){Z=Q(Z,Y.x);}return Z;}void main(){v_uv=A1;v_glyphIndex=A4;v_glyphColor=A5;v_cellColor=A6;v_glyphFlags=A7;vec4 a=Aa;vec4 b=Ab;vec2 c=A3;vec2 d=A2;float e=Ac.x;float f=Ac.y;int g=int(Ac.z);vec2 h=d;vec2 i=h+c*0.5f;float j=f+e*0.5f;vec3 k=vec3(i,j);vec3 l;if(g==D){float F=clamp(A0.x,0.0f,1.0f);vec2 G=b.xy;vec2 H=a.xy;vec2 I=a.zw;vec2 J=b.zw;vec2 m=E(F,G,H,I,J);vec2 n=P(F,G,H,I,J);float o=length(n);vec2 p=o>0.0f?n/o:vec2(1.0f,0.0f);vec2 q=vec2(-p.y,p.x);vec2 r=m;vec2 s=r+q*A0.y*c.y;l=vec3(s,f);}else if(g==C){float t=mod(a.x,A);if(t<0.0f){t+=A;}float u=mod(a.y,A);if(u<0.0f){u+=A;}float v=t-u;if(v<=0.0f){v+=A;}float S=t-A0.x*v;vec2 w=vec2(cos(S),sin(S))*A0.y;vec2 s=w*c+h;l=vec3(s,f);}else if(g==B){vec2 s=A0.xy*c+h;l=vec3(s,f);}vec3 x=X(l,A9);vec3 y=x+A8;vec3 z=vec3(0.0f,0.0f,1.0f);v_worldPosition=y;v_normal=z;v_geometryType=float(g);vec2 AA=(y.xy/Ur)*2.0f;AA.y=-AA.y;float AB=y.z/Ur.y;float AC=clamp(-AB*Us,-0.99f,0.99f);if(Ut>0.5f){gl_Position=vec4(AA,AC,1.0f);}else{float AD=0.5f;float AE=1.0f/(1.0f-AB*AD);AA*=AE;gl_Position=vec4(AA,AC,1.0f);}}`, I = class I {
172
172
  constructor(t, e, i = e, r = 1, s = {}, h) {
173
173
  a(this, "N");
174
174
  a(this, "X");
@@ -181,8 +181,8 @@ in vec2 A0;in vec2 A1;in vec2 A2;in vec2 A3;in vec3 A4;in vec4 A5;in vec4 A6;in
181
181
  a(this, "Z");
182
182
  a(this, "q", null);
183
183
  a(this, "V", /* @__PURE__ */ new Map());
184
- this.N = e, this.X = i, this.A = t, this.W = O(r, 1, 8), this.Z = h, this.l = { filter: "nearest", wrap: "clamp", format: "rgba", type: "unsigned_byte", depth: !0, ...s }, X.J || (X.J = new q(t, rt, `#version 300 es
185
- precision highp float;in vec2 v_uv;uniform sampler2D U0;uniform sampler2D U1;uniform sampler2D U2;uniform sampler2D U3;uniform vec2 U4;uniform bool U5;uniform bool U6;uniform bool U7;layout(location=0)out vec4 o_character;layout(location=1)out vec4 o_primaryColor;layout(location=2)out vec4 o_secondaryColor;layout(location=3)out vec4 A;void main(){vec2 B=vec2(v_uv.x,1.-v_uv.y);vec2 C=B*U4;vec2 D=(floor(C)+0.5f)/U4;vec4 E=texture(U0,D);vec4 F=U5?texture(U1,D):vec4(0.);if(U5&&F.a==0.){discard;}vec4 G=U6?texture(U2,D):vec4(0.);vec4 H=U7?texture(U3,D):vec4(0.);o_character=E;o_primaryColor=F;o_secondaryColor=G;A=H;}`));
184
+ this.N = e, this.X = i, this.A = t, this.W = Z(r, 1, 8), this.Z = h, this.l = { filter: "nearest", wrap: "clamp", format: "rgba", type: "unsigned_byte", depth: !0, ...s }, I.J || (I.J = new W(t, rt, `#version 300 es
185
+ precision highp float;in vec2 v_uv;uniform sampler2D U5;uniform sampler2D U6;uniform sampler2D U7;uniform sampler2D U8;uniform vec2 U9;uniform bool Ua;uniform bool Ub;uniform bool Uc;layout(location=0)out vec4 o_character;layout(location=1)out vec4 o_primaryColor;layout(location=2)out vec4 o_secondaryColor;layout(location=3)out vec4 A;void main(){vec2 B=vec2(v_uv.x,1.-v_uv.y);vec2 C=B*U9;vec2 D=(floor(C)+0.5f)/U9;vec4 E=texture(U5,D);vec4 F=Ua?texture(U6,D):vec4(0.);if(Ua&&F.a==0.){discard;}vec4 G=Ub?texture(U7,D):vec4(0.);vec4 H=Uc?texture(U8,D):vec4(0.);o_character=E;o_primaryColor=F;o_secondaryColor=G;A=H;}`));
186
186
  const o = t.getParameter(t.MAX_DRAW_BUFFERS), c = t.getParameter(t.MAX_COLOR_ATTACHMENTS);
187
187
  this.W = Math.min(this.W, o, c), this.Y = t.createFramebuffer(), this.tt(), this.st(), this.l.depth && this.it();
188
188
  }
@@ -244,7 +244,7 @@ precision highp float;in vec2 v_uv;uniform sampler2D U0;uniform sampler2D U1;uni
244
244
  }
245
245
  ft() {
246
246
  if (!this.Z) return;
247
- const t = this.W > 1, e = this.W > 2, i = this.W > 3, r = { U0: this.j[0], U1: t ? this.j[1] : this.j[0], U2: e ? this.j[2] : this.j[0], U3: i ? this.j[3] : this.j[0], U4: [this.N, this.X], U5: t, U6: e, U7: i }, s = X.J;
247
+ const t = this.W > 1, e = this.W > 2, i = this.W > 3, r = { U5: this.j[0], U6: t ? this.j[1] : this.j[0], U7: e ? this.j[2] : this.j[0], U8: i ? this.j[3] : this.j[0], U9: [this.N, this.X], Ua: t, Ub: e, Uc: i }, s = I.J;
248
248
  this.q = this.Z.vt.dt(s, r, !0);
249
249
  }
250
250
  gt() {
@@ -266,14 +266,14 @@ precision highp float;in vec2 v_uv;uniform sampler2D U0;uniform sampler2D U1;uni
266
266
  return this.W;
267
267
  }
268
268
  };
269
- a(X, "J", null);
270
- let Z = X;
271
- const Ct = /* @__PURE__ */ new WeakMap();
269
+ a(I, "J", null);
270
+ let X = I;
271
+ const Ft = /* @__PURE__ */ new WeakMap();
272
272
  function ht(n, t) {
273
- Ct.set(n, t);
273
+ Ft.set(n, t);
274
274
  }
275
- function Ft(n) {
276
- return Ct.get(n);
275
+ function Ct(n) {
276
+ return Ft.get(n);
277
277
  }
278
278
  function tt(n, t, e, i, r = 255) {
279
279
  n[0] = t / 255, n[1] = (e ?? t) / 255, n[2] = (i ?? t) / 255, n[3] = r / 255;
@@ -398,10 +398,10 @@ class te {
398
398
  this.A = t, this.Ms = t.createBuffer(), this.Fs = new Float32Array(dt.length);
399
399
  }
400
400
  $s(t, e, i, r) {
401
- const s = this.A, h = Ft(this.A), o = h[2], c = h[3], l = t / o * 2 - 1, u = (t + i) / o * 2 - 1, f = 1 - (e + r) / c * 2, d = 1 - e / c * 2, g = dt, p = this.Fs;
401
+ const s = this.A, h = Ct(this.A), o = h[2], c = h[3], l = t / o * 2 - 1, u = (t + i) / o * 2 - 1, f = 1 - (e + r) / c * 2, d = 1 - e / c * 2, g = dt, p = this.Fs;
402
402
  for (let v = 0; v < g.length; v += 4) {
403
- const A = g[v], m = g[v + 1], E = g[v + 2], y = g[v + 3], x = l + (A + 0.5) * (u - l), w = f + (m + 0.5) * (d - f);
404
- p[v] = x, p[v + 1] = w, p[v + 2] = E, p[v + 3] = y;
403
+ const A = g[v], m = g[v + 1], w = g[v + 2], y = g[v + 3], x = l + (A + 0.5) * (u - l), E = f + (m + 0.5) * (d - f);
404
+ p[v] = x, p[v + 1] = E, p[v + 2] = w, p[v + 3] = y;
405
405
  }
406
406
  s.bindBuffer(s.ARRAY_BUFFER, this.Ms), s.bufferData(s.ARRAY_BUFFER, p, s.DYNAMIC_DRAW), s.enableVertexAttribArray(0), s.vertexAttribPointer(0, 2, s.FLOAT, !1, 16, 0), s.enableVertexAttribArray(1), s.vertexAttribPointer(1, 2, s.FLOAT, !1, 16, 8), s.drawArrays(s.TRIANGLES, 0, 6), s.disableVertexAttribArray(1), s.disableVertexAttribArray(0), s.bindBuffer(s.ARRAY_BUFFER, null);
407
407
  }
@@ -438,9 +438,9 @@ class ie {
438
438
  for (const [, t] of this.Ps) for (const [, e] of t) e && this.A.deleteVertexArray(e);
439
439
  }
440
440
  }
441
- const _ = class _ {
441
+ const D = class D {
442
442
  static Rs(t, e, i = 0) {
443
- const r = e || new Float32Array(_.FLOATS_PER_INSTANCE);
443
+ const r = e || new Float32Array(D.FLOATS_PER_INSTANCE);
444
444
  let s = i;
445
445
  r[s++] = t.bs[0], r[s++] = t.bs[1], r[s++] = t.Ss[0], r[s++] = t.Ss[1], r[s++] = t.Nt[0], r[s++] = t.Nt[1], r[s++] = t.Nt[2], r[s++] = t.Xt[0], r[s++] = t.Xt[1], r[s++] = t.Xt[2], r[s++] = t.Xt[3], r[s++] = t.Yt[0], r[s++] = t.Yt[1], r[s++] = t.Yt[2], r[s++] = t.Yt[3], r[s++] = t.zs[0], r[s++] = t.zs[1], r[s++] = t.zs[2], r[s++] = t.Rt;
446
446
  const h = t.ks;
@@ -451,20 +451,20 @@ const _ = class _ {
451
451
  return g ? (r[s++] = (f == null ? void 0 : f[0]) ?? 0, r[s++] = (f == null ? void 0 : f[1]) ?? 0, r[s++] = (d == null ? void 0 : d[0]) ?? 0, r[s++] = (d == null ? void 0 : d[1]) ?? 0, r[s++] = l[0], r[s++] = l[1], r[s++] = u[0], r[s++] = u[1]) : !g && !!c ? (r[s++] = c[0], r[s++] = c[1], r[s++] = 0, r[s++] = 0, r[s++] = 0, r[s++] = 0, r[s++] = 0, r[s++] = 0) : (r[s++] = 0, r[s++] = 0, r[s++] = 0, r[s++] = 0, r[s++] = 0, r[s++] = 0, r[s++] = 0, r[s++] = 0), r[s++] = t.Gs ?? 0, r[s++] = t.Qs ?? 0, r[s++] = t.Ns ?? 0, r;
452
452
  }
453
453
  static Xs(t, e) {
454
- const i = t.length * _.FLOATS_PER_INSTANCE, r = e || new Float32Array(i);
454
+ const i = t.length * D.FLOATS_PER_INSTANCE, r = e || new Float32Array(i);
455
455
  for (let s = 0; s < t.length; s++) {
456
- const h = s * _.FLOATS_PER_INSTANCE;
457
- _.Rs(t[s], r, h);
456
+ const h = s * D.FLOATS_PER_INSTANCE;
457
+ D.Rs(t[s], r, h);
458
458
  }
459
459
  return r;
460
460
  }
461
461
  };
462
- a(_, "BYTES_PER_INSTANCE", 144), a(_, "FLOATS_PER_INSTANCE", 36);
463
- let N = _;
464
- const P = class P {
462
+ a(D, "BYTES_PER_INSTANCE", 144), a(D, "FLOATS_PER_INSTANCE", 36);
463
+ let N = D;
464
+ const M = class M {
465
465
  };
466
- a(P, "STRIDE", N.BYTES_PER_INSTANCE), a(P, "ATTRIBUTES", { A2: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 0, divisor: 1 }, A3: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 8, divisor: 1 }, A4: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 16, divisor: 1 }, A5: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 28, divisor: 1 }, A6: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 44, divisor: 1 }, A7: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 60, divisor: 1 }, A8: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 76, divisor: 1 }, A9: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 88, divisor: 1 }, Aa: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 100, divisor: 1 }, Ab: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 116, divisor: 1 }, Ac: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 132, divisor: 1 } });
467
- let W = P;
466
+ a(M, "STRIDE", N.BYTES_PER_INSTANCE), a(M, "ATTRIBUTES", { A2: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: M.STRIDE, offset: 0, divisor: 1 }, A3: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: M.STRIDE, offset: 8, divisor: 1 }, A4: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: M.STRIDE, offset: 16, divisor: 1 }, A5: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: M.STRIDE, offset: 28, divisor: 1 }, A6: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: M.STRIDE, offset: 44, divisor: 1 }, A7: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: M.STRIDE, offset: 60, divisor: 1 }, A8: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: M.STRIDE, offset: 76, divisor: 1 }, A9: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: M.STRIDE, offset: 88, divisor: 1 }, Aa: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: M.STRIDE, offset: 100, divisor: 1 }, Ab: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: M.STRIDE, offset: 116, divisor: 1 }, Ac: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: M.STRIDE, offset: 132, divisor: 1 } });
467
+ let q = M;
468
468
  class re {
469
469
  constructor(t = 1e3, e = 1.5) {
470
470
  a(this, "Ys");
@@ -556,7 +556,7 @@ class ne {
556
556
  if (!e) {
557
557
  e = /* @__PURE__ */ new Map();
558
558
  const i = this.A;
559
- for (const r in W.ATTRIBUTES) {
559
+ for (const r in q.ATTRIBUTES) {
560
560
  const s = i.getAttribLocation(t, r);
561
561
  s !== -1 && e.set(r, s);
562
562
  }
@@ -567,14 +567,14 @@ class ne {
567
567
  pi(t) {
568
568
  const e = this.A, i = t.G, r = this.di(i);
569
569
  for (const [s, h] of r) {
570
- const o = W.ATTRIBUTES[s];
570
+ const o = q.ATTRIBUTES[s];
571
571
  o && ft(e, h, o.size, o.stride, o.offset, o.divisor, o.type, o.normalized);
572
572
  }
573
573
  }
574
574
  gi(t) {
575
575
  const e = this.A, i = this.di(t.G);
576
576
  for (const [r, s] of i)
577
- W.ATTRIBUTES[r] && (e.disableVertexAttribArray(s), e.vertexAttribDivisor(s, 0));
577
+ q.ATTRIBUTES[r] && (e.disableVertexAttribArray(s), e.vertexAttribDivisor(s, 0));
578
578
  }
579
579
  gt() {
580
580
  this.hi && (this.A.deleteBuffer(this.hi), this.hi = null), this.ci.clear();
@@ -623,7 +623,7 @@ class he {
623
623
  this._i.gt();
624
624
  }
625
625
  }
626
- class D {
626
+ class O {
627
627
  constructor(t, e, i, r) {
628
628
  a(this, "A");
629
629
  a(this, "bi");
@@ -688,14 +688,14 @@ const ue = { Fi: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0.5, 1, 0.5, 1]), Ri:
688
688
  t.push(i, -0.5, i, 0, r, -0.5, r, 0, i, 0.5, i, 1, i, 0.5, i, 1, r, -0.5, r, 0, r, 0.5, r, 1);
689
689
  }
690
690
  return new Float32Array(t);
691
- }(16), Ri: 96, ...Y }, de = { [b.RECTANGLE]: class extends D {
691
+ }(16), Ri: 96, ...Y }, de = { [b.RECTANGLE]: class extends O {
692
692
  constructor(n, t) {
693
693
  super(n, t, b.RECTANGLE, oe);
694
694
  }
695
695
  yi(n, t) {
696
696
  return this.Ei(0, 0, n.width, n.height, t);
697
697
  }
698
- }, [b.LINE]: class extends D {
698
+ }, [b.LINE]: class extends O {
699
699
  constructor(n, t) {
700
700
  super(n, t, b.LINE, ae);
701
701
  }
@@ -703,14 +703,14 @@ const ue = { Fi: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0.5, 1, 0.5, 1]), Ri:
703
703
  const e = n.x2 - n.x1, i = n.y2 - n.y1, r = Math.hypot(e, i), s = Math.atan2(i, e), h = t.Ot || 1, o = n.x1 + e / 2 - r / 2, c = n.y1 + i / 2, l = { ...t, xt: (t.xt || 0) + s };
704
704
  return this.Ei(o, c, r, h, l);
705
705
  }
706
- }, [b.ELLIPSE]: class extends D {
706
+ }, [b.ELLIPSE]: class extends O {
707
707
  constructor(n, t) {
708
708
  super(n, t, b.ELLIPSE, ce);
709
709
  }
710
710
  yi(n, t) {
711
711
  return this.Ei(0, 0, n.width, n.height, t);
712
712
  }
713
- }, [b.ARC]: class extends D {
713
+ }, [b.ARC]: class extends O {
714
714
  constructor(n, t) {
715
715
  super(n, t, b.ARC, le);
716
716
  }
@@ -718,7 +718,7 @@ const ue = { Fi: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0.5, 1, 0.5, 1]), Ri:
718
718
  const e = n.start * Math.PI / 180, i = n.stop * Math.PI / 180;
719
719
  return this.Ei(0, 0, n.width, n.height, t, { arcStart: e, arcStop: i });
720
720
  }
721
- }, [b.TRIANGLE]: class extends D {
721
+ }, [b.TRIANGLE]: class extends O {
722
722
  constructor(n, t) {
723
723
  super(n, t, b.TRIANGLE, ue);
724
724
  }
@@ -726,7 +726,7 @@ const ue = { Fi: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0.5, 1, 0.5, 1]), Ri:
726
726
  const e = Math.min(n.x1, n.x2, n.x3), i = Math.max(n.x1, n.x2, n.x3), r = Math.min(n.y1, n.y2, n.y3), s = i - e, h = Math.max(n.y1, n.y2, n.y3) - r;
727
727
  return this.Ei(e, r, s, h, t);
728
728
  }
729
- }, [b.BEZIER_CURVE]: class extends D {
729
+ }, [b.BEZIER_CURVE]: class extends O {
730
730
  constructor(n, t) {
731
731
  super(n, t, b.BEZIER_CURVE, fe);
732
732
  }
@@ -759,7 +759,7 @@ class ge {
759
759
  Li(t) {
760
760
  const { material: e, type: i, commands: r } = t, s = this.Si.get(i);
761
761
  e.shader.D(), e.shader.O(e.uniforms);
762
- const h = Ft(this.A), o = r.length > 0 && r[0].state.zt;
762
+ const h = Ct(this.A), o = r.length > 0 && r[0].state.zt;
763
763
  if (e.shader.O({ Uu: h[2] / h[3], Ur: [h[2], h[3]], Us: 1, Ut: o ? 1 : 0 }), s.$i(), r.forEach((c) => {
764
764
  s.yi(c.params, c.state);
765
765
  }), s.Pi()) {
@@ -776,7 +776,7 @@ class ge {
776
776
  this.Si.clear(), this.zi.gt();
777
777
  }
778
778
  }
779
- function Pt(n) {
779
+ function Mt(n) {
780
780
  let t = 0;
781
781
  for (let e = 0; e < n.length; e++)
782
782
  t = (t << 5) - t + n.charCodeAt(e), t &= t;
@@ -784,13 +784,13 @@ function Pt(n) {
784
784
  }
785
785
  const yt = /* @__PURE__ */ new WeakMap();
786
786
  let ve = 1;
787
- function Et(n) {
787
+ function wt(n) {
788
788
  if (n == null) return 0;
789
- if (typeof n != "object" && typeof n != "function") return Pt(n + "");
789
+ if (typeof n != "object" && typeof n != "function") return Mt(n + "");
790
790
  let t = yt.get(n);
791
791
  return t || (t = ve++, yt.set(n, t)), t;
792
792
  }
793
- function G(n, t) {
793
+ function H(n, t) {
794
794
  return (n << 5) - n + t;
795
795
  }
796
796
  class pe {
@@ -799,7 +799,7 @@ class pe {
799
799
  a(this, "Bi");
800
800
  a(this, "Ii");
801
801
  a(this, "Hi", /* @__PURE__ */ new Map());
802
- this.Bi = new q(t, rt, `#version 300 es
802
+ this.Bi = new W(t, rt, `#version 300 es
803
803
  precision highp float;in vec3 v_glyphIndex;in vec4 v_glyphColor;in vec4 v_cellColor;in vec4 v_glyphFlags;layout(location=0)out vec4 o_character;layout(location=1)out vec4 o_primaryColor;layout(location=2)out vec4 o_secondaryColor;layout(location=3)out vec4 A;void main(){int B=int(v_glyphFlags.r>0.5?1:0);int C=int(v_glyphFlags.g>0.5?1:0);int D=int(v_glyphFlags.b>0.5?1:0);float E=float(B|(C<<1)|(D<<2))/255.;o_character=vec4(v_glyphIndex.xy,E,clamp(v_glyphFlags.a,0.,1.));o_primaryColor=vec4(v_glyphColor.rgb,v_glyphColor.a);o_secondaryColor=vec4(v_cellColor.rgb,v_cellColor.a);A=vec4(0.);}`), this.Ii = { id: this.Oi++, shader: this.Bi, uniforms: Object.freeze({}), hash: this.Gi(this.Bi, {}), isBuiltIn: !0 };
804
804
  }
805
805
  get Qi() {
@@ -815,13 +815,13 @@ precision highp float;in vec3 v_glyphIndex;in vec4 v_glyphColor;in vec4 v_cellCo
815
815
  return { id: this.Oi++, shader: t, uniforms: Object.freeze({ ...e }), hash: 0, isBuiltIn: !1 };
816
816
  }
817
817
  Gi(t, e) {
818
- const i = Et(t.G), r = function(s, h) {
818
+ const i = wt(t.G), r = function(s, h) {
819
819
  let o = 0;
820
820
  const c = Object.keys(s).sort();
821
- for (const l of c) o = G(o, Pt(l)), o = G(o, h(s[l]));
821
+ for (const l of c) o = H(o, Mt(l)), o = H(o, h(s[l]));
822
822
  return o;
823
823
  }(e, this.Xi.bind(this));
824
- return G(i, r);
824
+ return H(i, r);
825
825
  }
826
826
  Xi(t) {
827
827
  return typeof t == "number" || typeof t == "boolean" ? function(e) {
@@ -829,14 +829,14 @@ precision highp float;in vec3 v_glyphIndex;in vec4 v_glyphColor;in vec4 v_cellCo
829
829
  }(t) : Array.isArray(t) ? function(e) {
830
830
  let i = 0;
831
831
  const r = Array.isArray(e[0]) ? e.flat() : e;
832
- for (const s of r) i = G(i, typeof s == "number" ? s : 0);
832
+ for (const s of r) i = H(i, typeof s == "number" ? s : 0);
833
833
  return i;
834
834
  }(t) : t instanceof Float32Array || t instanceof Int32Array ? function(e) {
835
835
  let i = 0;
836
836
  const r = Math.min(e.length, 16);
837
- for (let s = 0; s < r; s++) i = G(i, e[s]);
837
+ for (let s = 0; s < r; s++) i = H(i, e[s]);
838
838
  return i;
839
- }(t) : t instanceof WebGLTexture ? Et(t) : 0;
839
+ }(t) : t instanceof WebGLTexture ? wt(t) : 0;
840
840
  }
841
841
  gt() {
842
842
  this.Bi != this.Bi && this.Bi.dispose(), this.Bi.dispose(), this.Hi.clear();
@@ -927,7 +927,7 @@ class me {
927
927
  this.se !== t && (this.se = t, t.D());
928
928
  }
929
929
  pe(t, e) {
930
- return new q(this.A, t, e);
930
+ return new W(this.A, t, e);
931
931
  }
932
932
  ge(t) {
933
933
  this.oe = t, t && (this.he = {});
@@ -939,10 +939,10 @@ class me {
939
939
  Object.assign(this.he, t);
940
940
  }
941
941
  _e(t) {
942
- return new q(this.A, rt, t);
942
+ return new W(this.A, rt, t);
943
943
  }
944
944
  ye(t, e, i, r) {
945
- t instanceof Z || !r || t.Ae(r), this.re.Wi({ width: e ?? t.width, height: i ?? t.height }, this.ee, t.ut());
945
+ t instanceof X || !r || t.Ae(r), this.re.Wi({ width: e ?? t.width, height: i ?? t.height }, this.ee, t.ut());
946
946
  }
947
947
  we(t, e, i, r) {
948
948
  this.ne.$s(t, e, i, r);
@@ -969,7 +969,7 @@ class me {
969
969
  this.re.Vi({ width: t, height: e, start: i, stop: r }, this.ee, this.vt.Qi);
970
970
  }
971
971
  Pe(t, e, i = 1, r = {}) {
972
- return new Z(this.A, t, e, i, r, this);
972
+ return new X(this.A, t, e, i, r, this);
973
973
  }
974
974
  Te(t, e = t, i = t, r = 255) {
975
975
  this.ee.ps(t, e ?? t, i ?? t, r);
@@ -1042,7 +1042,7 @@ function ot(n, t, e) {
1042
1042
  for (let h = t; h < i; h += 4) s.uint8[3] = n[h] || 0, s.uint8[2] = n[h + 1] || 0, s.uint8[1] = n[h + 2] || 0, s.uint8[0] = n[h + 3] || 0, r = r + (s.uint32[0] >>> 0) >>> 0;
1043
1043
  return r >>> 0;
1044
1044
  }
1045
- class Ee {
1045
+ class we {
1046
1046
  constructor(t) {
1047
1047
  a(this, "b");
1048
1048
  a(this, "p", 0);
@@ -1065,7 +1065,7 @@ class Ee {
1065
1065
  return this.p;
1066
1066
  }
1067
1067
  }
1068
- function H(n) {
1068
+ function G(n) {
1069
1069
  let t = 32, e = 0;
1070
1070
  for (const o of n) o && (o < t && (t = o), o > e && (e = o));
1071
1071
  if (e === 0) return { min: 0, max: 0, table: /* @__PURE__ */ new Map() };
@@ -1081,7 +1081,7 @@ function H(n) {
1081
1081
  if (!c) continue;
1082
1082
  const l = r[c]++;
1083
1083
  let u = h.get(c);
1084
- u || (u = [], h.set(c, u)), u[we(l, c)] = o;
1084
+ u || (u = [], h.set(c, u)), u[Ee(l, c)] = o;
1085
1085
  }
1086
1086
  return { min: t, max: e, table: h };
1087
1087
  }
@@ -1097,7 +1097,7 @@ function at(n, t) {
1097
1097
  }
1098
1098
  throw Error("Invalid Huffman code");
1099
1099
  }
1100
- function we(n, t) {
1100
+ function Ee(n, t) {
1101
1101
  let e = 0;
1102
1102
  for (let i = 0; i < t; i++) e = e << 1 | 1 & n, n >>>= 1;
1103
1103
  return e >>> 0;
@@ -1131,30 +1131,30 @@ function be(n) {
1131
1131
  for (let A = 144; A <= 255; A++) v[A] = 9;
1132
1132
  for (let A = 256; A <= 279; A++) v[A] = 7;
1133
1133
  for (let A = 280; A <= 287; A++) v[A] = 8;
1134
- g = H(v), p = H(Array(32).fill(5));
1134
+ g = G(v), p = G(Array(32).fill(5));
1135
1135
  } else {
1136
- const v = s.readBits(5) + 257, A = s.readBits(5) + 1, m = s.readBits(4) + 4, E = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], y = Array(19).fill(0);
1137
- for (let T = 0; T < m; T++) y[E[T]] = s.readBits(3);
1138
- const x = H(y), w = [];
1139
- for (; w.length < v + A; ) {
1136
+ const v = s.readBits(5) + 257, A = s.readBits(5) + 1, m = s.readBits(4) + 4, w = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], y = Array(19).fill(0);
1137
+ for (let T = 0; T < m; T++) y[w[T]] = s.readBits(3);
1138
+ const x = G(y), E = [];
1139
+ for (; E.length < v + A; ) {
1140
1140
  const T = at(s, x);
1141
- if (T <= 15) w.push(T);
1141
+ if (T <= 15) E.push(T);
1142
1142
  else if (T === 16) {
1143
- const L = s.readBits(2) + 3, F = w[w.length - 1] || 0;
1144
- for (let Q = 0; Q < L; Q++) w.push(F);
1143
+ const L = s.readBits(2) + 3, C = E[E.length - 1] || 0;
1144
+ for (let Q = 0; Q < L; Q++) E.push(C);
1145
1145
  } else if (T === 17) {
1146
1146
  const L = s.readBits(3) + 3;
1147
- for (let F = 0; F < L; F++) w.push(0);
1147
+ for (let C = 0; C < L; C++) E.push(0);
1148
1148
  } else {
1149
1149
  if (T !== 18) throw Error("Invalid code length symbol");
1150
1150
  {
1151
1151
  const L = s.readBits(7) + 11;
1152
- for (let F = 0; F < L; F++) w.push(0);
1152
+ for (let C = 0; C < L; C++) E.push(0);
1153
1153
  }
1154
1154
  }
1155
1155
  }
1156
- const C = w.slice(0, v), M = w.slice(v, v + A);
1157
- g = H(C), p = H(M);
1156
+ const F = E.slice(0, v), P = E.slice(v, v + A);
1157
+ g = G(F), p = G(P);
1158
1158
  }
1159
1159
  for (; ; ) {
1160
1160
  const v = at(s, g);
@@ -1164,23 +1164,23 @@ function be(n) {
1164
1164
  if (v > 256 && v < 286) {
1165
1165
  const A = v - 257;
1166
1166
  let m = o[A];
1167
- const E = c[A];
1168
- E && (m += s.readBits(E));
1167
+ const w = c[A];
1168
+ w && (m += s.readBits(w));
1169
1169
  const y = at(s, p);
1170
1170
  if (y >= 30) throw Error("Invalid distance symbol");
1171
1171
  let x = l[y];
1172
- const w = u[y];
1173
- w && (x += s.readBits(w));
1174
- const C = h.length - x;
1175
- if (C < 0) throw Error("Invalid distance");
1176
- for (let M = 0; M < m; M++) h.push(h[C + M] || 0);
1172
+ const E = u[y];
1173
+ E && (x += s.readBits(E));
1174
+ const F = h.length - x;
1175
+ if (F < 0) throw Error("Invalid distance");
1176
+ for (let P = 0; P < m; P++) h.push(h[F + P] || 0);
1177
1177
  } else if (v === 286 || v === 287) throw Error("Reserved length symbol");
1178
1178
  }
1179
1179
  }
1180
1180
  }
1181
1181
  }
1182
1182
  }
1183
- }(new Ee(n.subarray(i)), r), new Uint8Array(r);
1183
+ }(new we(n.subarray(i)), r), new Uint8Array(r);
1184
1184
  }
1185
1185
  function xe(n) {
1186
1186
  const t = R, e = new Uint8Array(n);
@@ -1188,13 +1188,13 @@ function xe(n) {
1188
1188
  const i = t.readUint(e, 4), r = t.readUshort(e, 12), s = t.readUint(e, 16), h = [];
1189
1189
  let o = 44;
1190
1190
  for (let m = 0; m < r; m++) {
1191
- const E = t.readASCII(e, o, 4), y = t.readUint(e, o + 4), x = t.readUint(e, o + 8), w = t.readUint(e, o + 12), C = t.readUint(e, o + 16);
1192
- h.push({ tag: E, offset: y, compLength: x, origLength: w, checksum: C }), o += 20;
1191
+ const w = t.readASCII(e, o, 4), y = t.readUint(e, o + 4), x = t.readUint(e, o + 8), E = t.readUint(e, o + 12), F = t.readUint(e, o + 16);
1192
+ h.push({ tag: w, offset: y, compLength: x, origLength: E, checksum: F }), o += 20;
1193
1193
  }
1194
1194
  for (const m of h) {
1195
- const E = new Uint8Array(e.buffer, m.offset, m.compLength);
1196
- if (m.compLength === m.origLength) m.data = new Uint8Array(E);
1197
- else if (m.data = be(E), m.data.length !== m.origLength) if (m.data.length < m.origLength) {
1195
+ const w = new Uint8Array(e.buffer, m.offset, m.compLength);
1196
+ if (m.compLength === m.origLength) m.data = new Uint8Array(w);
1197
+ else if (m.data = be(w), m.data.length !== m.origLength) if (m.data.length < m.origLength) {
1198
1198
  const y = new Uint8Array(m.origLength);
1199
1199
  y.set(m.data), m.data = y;
1200
1200
  } else m.data = m.data.subarray(0, m.origLength);
@@ -1211,26 +1211,26 @@ function xe(n) {
1211
1211
  let A = 12;
1212
1212
  for (const m of h) {
1213
1213
  ye(v, A, m.tag), A += 4;
1214
- let E = m.data;
1215
- if (m.tag === "head" && E.length >= 12) {
1216
- const y = new Uint8Array(E);
1214
+ let w = m.data;
1215
+ if (m.tag === "head" && w.length >= 12) {
1216
+ const y = new Uint8Array(w);
1217
1217
  B(y, 8, 0), B(v, A, ot(y, 0, K(y.length))), A += 4;
1218
1218
  } else
1219
- B(v, A, ot(E, 0, K(E.length))), A += 4;
1219
+ B(v, A, ot(w, 0, K(w.length))), A += 4;
1220
1220
  B(v, A, p[m.tag]), A += 4, B(v, A, m.data.length), A += 4;
1221
1221
  }
1222
1222
  for (const m of h) {
1223
- const E = p[m.tag];
1224
- v.set(m.data, E);
1223
+ const w = p[m.tag];
1224
+ v.set(m.data, w);
1225
1225
  }
1226
1226
  if (h.find((m) => m.tag === "head")) {
1227
- const m = p.head, E = function(y, x) {
1228
- const w = x + 8, C = [y[w], y[w + 1], y[w + 2], y[w + 3]];
1229
- B(y, w, 0);
1230
- const M = 2981146554 - (ot(y, 0, K(y.length)) >>> 0) >>> 0;
1231
- return y[w] = C[0], y[w + 1] = C[1], y[w + 2] = C[2], y[w + 3] = C[3], M >>> 0;
1227
+ const m = p.head, w = function(y, x) {
1228
+ const E = x + 8, F = [y[E], y[E + 1], y[E + 2], y[E + 3]];
1229
+ B(y, E, 0);
1230
+ const P = 2981146554 - (ot(y, 0, K(y.length)) >>> 0) >>> 0;
1231
+ return y[E] = F[0], y[E + 1] = F[1], y[E + 2] = F[2], y[E + 3] = F[3], P >>> 0;
1232
1232
  }(v, m);
1233
- B(v, m + 8, E);
1233
+ B(v, m + 8, w);
1234
1234
  }
1235
1235
  return v.buffer;
1236
1236
  }
@@ -1284,7 +1284,7 @@ const Te = { parseTab(n, t, e) {
1284
1284
  t += 2;
1285
1285
  const c = i.readShort(n, t);
1286
1286
  return t += 2, t += 6, { unitsPerEm: r, xMin: s, yMin: h, xMax: o, yMax: c, indexToLocFormat: i.readShort(n, t) };
1287
- } }, Ce = { parseTab(n, t, e) {
1287
+ } }, Fe = { parseTab(n, t, e) {
1288
1288
  const i = R;
1289
1289
  t += 4;
1290
1290
  const r = ["ascender", "descender", "lineGap", "advanceWidthMax", "minLeftSideBearing", "minRightSideBearing", "xMaxExtent", "caretSlopeRise", "caretSlopeRun", "caretOffset", "res0", "res1", "res2", "res3", "metricDataFormat", "numberOfHMetrics"], s = {};
@@ -1293,16 +1293,16 @@ const Te = { parseTab(n, t, e) {
1293
1293
  s[o] = c(n, t + 2 * h);
1294
1294
  }
1295
1295
  return s;
1296
- } }, Fe = { parseTab(n, t, e, i) {
1296
+ } }, Ce = { parseTab(n, t, e, i) {
1297
1297
  const r = R, s = [], h = [], o = i.maxp.numGlyphs, c = i.hhea.numberOfHMetrics;
1298
1298
  let l = 0, u = 0, f = 0;
1299
1299
  for (; f < c; ) l = r.readUshort(n, t + (f << 2)), u = r.readShort(n, t + (f << 2) + 2), s.push(l), h.push(u), f++;
1300
1300
  for (; f < o; ) s.push(l), h.push(u), f++;
1301
1301
  return { aWidth: s, lsBearing: h };
1302
- } }, wt = { cmap: Te, head: Re, hhea: Ce, maxp: { parseTab(n, t, e) {
1302
+ } }, Et = { cmap: Te, head: Re, hhea: Fe, maxp: { parseTab(n, t, e) {
1303
1303
  const i = R;
1304
1304
  return i.readUint(n, t), t += 4, { numGlyphs: i.readUshort(n, t) };
1305
- } }, hmtx: Fe, loca: { parseTab(n, t, e, i) {
1305
+ } }, hmtx: Ce, loca: { parseTab(n, t, e, i) {
1306
1306
  const r = R, s = [], h = i.head.indexToLocFormat, o = i.maxp.numGlyphs + 1;
1307
1307
  if (h === 0) for (let c = 0; c < o; c++) s.push(r.readUshort(n, t + (c << 1)) << 1);
1308
1308
  else if (h === 1) for (let c = 0; c < o; c++) s.push(r.readUint(n, t + (c << 2)));
@@ -1314,7 +1314,7 @@ const Te = { parseTab(n, t, e) {
1314
1314
  }, Se(n, t) {
1315
1315
  const e = R, i = n.ze, r = n.loca;
1316
1316
  if (r[t] === r[t + 1]) return null;
1317
- const s = V.findTable(i, "glyf", n.ke);
1317
+ const s = j.findTable(i, "glyf", n.ke);
1318
1318
  if (!s) return null;
1319
1319
  let h = s[0] + r[t];
1320
1320
  const o = {};
@@ -1349,12 +1349,12 @@ const Te = { parseTab(n, t, e) {
1349
1349
  for (let d = 0; d < l; d++) u += o.xs[d], f += o.ys[d], o.xs[d] = u, o.ys[d] = f;
1350
1350
  } else o.parts = [], o.endPts = [], o.flags = [], o.xs = [], o.ys = [];
1351
1351
  return o;
1352
- } } }, V = { parse(n) {
1352
+ } } }, j = { parse(n) {
1353
1353
  const t = new Uint8Array(n);
1354
1354
  R.readASCII(t, 0, 4) === "wOFF" && (n = xe(n));
1355
- const e = new Uint8Array(n), i = wt, r = {}, s = { ze: e, De: 0, ke: 0 };
1355
+ const e = new Uint8Array(n), i = Et, r = {}, s = { ze: e, De: 0, ke: 0 };
1356
1356
  for (const h in i) {
1357
- const o = h, c = V.findTable(e, o, 0);
1357
+ const o = h, c = j.findTable(e, o, 0);
1358
1358
  if (c) {
1359
1359
  const [l, u] = c;
1360
1360
  let f = r[l];
@@ -1373,8 +1373,8 @@ const Te = { parseTab(n, t, e) {
1373
1373
  s += 16;
1374
1374
  }
1375
1375
  return null;
1376
- }, T: wt, B: R };
1377
- class Pe {
1376
+ }, T: Et, B: R };
1377
+ class Me {
1378
1378
  Le(t) {
1379
1379
  var i;
1380
1380
  const e = [];
@@ -1430,7 +1430,7 @@ class Pe {
1430
1430
  return 0;
1431
1431
  }
1432
1432
  }
1433
- class Me {
1433
+ class Pe {
1434
1434
  constructor(t) {
1435
1435
  a(this, "He");
1436
1436
  a(this, "Ge");
@@ -1451,8 +1451,8 @@ class Me {
1451
1451
  for (let o = 0; o < t.length; o++) {
1452
1452
  const c = o % i, l = Math.floor(o / i), u = t[o].glyphData;
1453
1453
  if (!u) continue;
1454
- const f = u.advanceWidth * h, d = c * e.width, g = l * e.height, p = d + 0.5 * e.width, v = g + 0.5 * e.height, A = Math.round(p - 0.5 * e.width), m = Math.round(v - 0.5 * r), E = A + 0.5 * (e.width - f), y = m + s.hhea.ascender * h;
1455
- this.Ye(u, E, y, h);
1454
+ const f = u.advanceWidth * h, d = c * e.width, g = l * e.height, p = d + 0.5 * e.width, v = g + 0.5 * e.height, A = Math.round(p - 0.5 * e.width), m = Math.round(v - 0.5 * r), w = A + 0.5 * (e.width - f), y = m + s.hhea.ascender * h;
1455
+ this.Ye(u, w, y, h);
1456
1456
  }
1457
1457
  }
1458
1458
  Ye(t, e, i, r) {
@@ -1475,21 +1475,21 @@ class Me {
1475
1475
  } else {
1476
1476
  const v = e + s[p] * r, A = i - h[p] * r;
1477
1477
  if (p + 1 > f) {
1478
- const E = e + s[l] * r, y = i - h[l] * r;
1479
- if (1 & c[l]) this.Ge.quadraticCurveTo(v, A, E, y);
1478
+ const w = e + s[l] * r, y = i - h[l] * r;
1479
+ if (1 & c[l]) this.Ge.quadraticCurveTo(v, A, w, y);
1480
1480
  else {
1481
- const x = (v + E) / 2, w = (A + y) / 2;
1482
- this.Ge.quadraticCurveTo(v, A, x, w);
1481
+ const x = (v + w) / 2, E = (A + y) / 2;
1482
+ this.Ge.quadraticCurveTo(v, A, x, E);
1483
1483
  }
1484
1484
  break;
1485
1485
  }
1486
1486
  const m = p + 1;
1487
1487
  if (1 & c[m]) {
1488
- const E = e + s[m] * r, y = i - h[m] * r;
1489
- this.Ge.quadraticCurveTo(v, A, E, y), p = m + 1;
1488
+ const w = e + s[m] * r, y = i - h[m] * r;
1489
+ this.Ge.quadraticCurveTo(v, A, w, y), p = m + 1;
1490
1490
  } else {
1491
- const E = (v + (e + s[m] * r)) / 2, y = (A + (i - h[m] * r)) / 2;
1492
- this.Ge.quadraticCurveTo(v, A, E, y), p = m;
1491
+ const w = (v + (e + s[m] * r)) / 2, y = (A + (i - h[m] * r)) / 2;
1492
+ this.Ge.quadraticCurveTo(v, A, w, y), p = m;
1493
1493
  }
1494
1494
  }
1495
1495
  this.Ge.closePath();
@@ -1500,7 +1500,7 @@ class Me {
1500
1500
  this.Ge.fill();
1501
1501
  }
1502
1502
  }
1503
- class Mt {
1503
+ class Pt {
1504
1504
  je(t, e) {
1505
1505
  const i = t.cmap;
1506
1506
  if (!i || !i.tables) return 0;
@@ -1550,7 +1550,7 @@ class Mt {
1550
1550
  class Se {
1551
1551
  constructor() {
1552
1552
  a(this, "Je");
1553
- this.Je = new Mt();
1553
+ this.Je = new Pt();
1554
1554
  }
1555
1555
  tr(t, e, i) {
1556
1556
  let r = 0;
@@ -1567,7 +1567,7 @@ class Se {
1567
1567
  class Ue {
1568
1568
  constructor() {
1569
1569
  a(this, "sr");
1570
- this.sr = new Mt();
1570
+ this.sr = new Pt();
1571
1571
  }
1572
1572
  ir(t, e) {
1573
1573
  const i = [], r = /* @__PURE__ */ new Map();
@@ -1584,7 +1584,7 @@ class Ue {
1584
1584
  if (r === 0) return null;
1585
1585
  let s = 0;
1586
1586
  t.hmtx && t.hmtx.aWidth && r > 0 && t.hmtx.aWidth[r] !== void 0 && (s = t.hmtx.aWidth[r]);
1587
- const h = V.T.glyf.Se(t, r);
1587
+ const h = j.T.glyf.Se(t, r);
1588
1588
  return h ? { ...h, advanceWidth: s } : null;
1589
1589
  }
1590
1590
  }
@@ -1604,7 +1604,7 @@ class et {
1604
1604
  a(this, "_r");
1605
1605
  a(this, "yr");
1606
1606
  a(this, "Ar", !1);
1607
- this.lr = e, this.gr = new Pe(), this.mr = new Me(t), this._r = new Se(), this.yr = new Ue();
1607
+ this.lr = e, this.gr = new Me(), this.mr = new Pe(t), this._r = new Se(), this.yr = new Ue();
1608
1608
  }
1609
1609
  async wr(t) {
1610
1610
  if (this.Ar) return;
@@ -1615,7 +1615,7 @@ class et {
1615
1615
  e = await i.arrayBuffer();
1616
1616
  } else
1617
1617
  e = await (await fetch("data:font/woff;base64,d09GRgABAAAAABbwAAoAAAAAfywAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABjbWFwAAAA9AAAAbsAAAkgIO8lSWdseWYAAAKwAAAOfgAAaLS4ctN0aGVhZAAAETAAAAAsAAAAOCi8/PVoaGVhAAARXAAAABkAAAAkCwEFAmhtdHgAABF4AAAAhQAABAQEAIOAbG9jYQAAEgAAAAKUAAAECAAy54BtYXhwAAAUlAAAABgAAAAgASIAgm5hbWUAABSsAAAB5wAAA6RWz85KT1MvMgAAFpQAAABFAAAAYM+QEyRwb3N0AAAW3AAAABQAAAAgAGkANHja7dRPSFRRFMfx38wdXblw4cJC7M0bz60gWlULGUFctWgR0UIQQkmDyn27kpAQaaEO2jhWJuafiQFtcDJtSqGhiFZtot5x3jzEVQQhlRJcOb0khiRc1+J94R64uw8cOADCAJT/avwZAiIpRCK3/P999KAS9biOSUxhBhlksYjnWMFrvME7vMca1vEF37ANAwkNqYRKqkk1rdLqscqpVVVQryzbils3rJnocHTWPmgfso/ap+0OuysWjlXHogQKUxVVUw3VUh010DE6QXHqph7qpT66TQmaoAxlaZnyVKC39FHHdbNu0e36or6kr4r4TgsTu75HmEcOy76vUPaVsIFNbOHHX74F3/fyD9+A7ztg1//2de76rH18Z8u+AXqwx/dBN5Z9XfqKiKzLqqzIC8nLkixKThZkXuZkVh7KuNyTuzImKRmVO1KxU7ETMtvmu/lqPptPxjOuKXo3vcveYQ+l2lKlO+Im3H632z3vnis+KaaLKc7zM87yHGc4zdM8zkke5H6+xp3cwRe4jVv5DLdwE5/ik3ycj3Cdk3eWnKfOmDPqJJ3hX9sOCvpPC65QcIWCgv5pPwGY9ak7AHja3V07ryQ5FT62axjQaDWsVmiCFQJpA4QINiAgICDYgICAgICAgICAgICAgIAA//AuF9Xlsn2etqv67iIY6apv3+6yj31e33nYA95FiD4uAAHeA7jyLzoA2Paf/Lp/Dun5W8x/Be/AxyCfO79fnj+e25/ZZzlewcM+3wIhwpfwE/Sc9e8YDyLU1ycF5XUD+to+L98O/An8VKQj0lnOtYdM776OJ71fTVC8//N1rLKDGsXl863OjSl5/iyIUu0HjJ+d+uO3rX3rXd33d/DjfR0/h6/n1iK5kWf36Hf2AxpVa6zU7ZLTnt3Q3wN7+tK6MVcBjUP/3vj56diHuT3YxVbKSvl9FdJHeFE4jfmJn2DSSOS9fuJ27SH7umuoL3oLWGOLxh3f2b8bnn/5Ql8n5SEYFD33q/0lKXxwjQfDOZtGgyEz+W8X5txl2zVb9MXO2S8HfD3ncbHousP6WPV2i/R7C+c06HK5ye/lfdl3Bj5Q2qitaLYhgLQWZY+fr/65A9Ly1r10jI783HOffJWZJ6ee8uuB0nmMXeSqWvRz5Dx/tiWf7H0OF+1DuK7vhy4ffP8An/doofqbQNXTqmlNT1c0v4/Eqpy29eBMLHty0PKZoCMW6VqRlDXNwvbD4RW2MYfyjNdXV3LaJuEdKgXcHvX2nHiz27RxHmC9w/qn0AbS+mJbSeX8pO1zlbbogPK7zJxAs3iFtrV8W/LHsHVZvxJ6Rlt7gum1nvjpnHNO4gFJqaoBWOKFVwKqAangorb2j5KKvG5N31O1ownZdhcZH7FuT9nznoxRv4ylrbfvzA9D88GO8uGDtgN0/1O09ntFlv3YhbIf/ml3/dPGqvi6rCMw6jNd53PM07BnK2eCJXmnzxrruI8ObOuxmZ/dxbd5nS77U7I/xaMdLm5/DXzuLLcwXlOLIVQ0an722pou6raGnpp/QYiwR0V5nwDL0Gk/f2TSUalIGOkSvfNAcVNCesV9a2q675FtsVAk4c5GPEfZT27XVqT9PmpxXtVn0577KO3MGrkXs+xKkHZk6EMUS440uO01t+Ark8yGYYjtsleqoPQksLuF0kOd/7TtbZ3XvNalNRNLqK+90fEDTAfy1FWWOBcT9fkTmrExe+viDNccYF+JqHeIbyBtlYxhStbmSc8DSX9/rICoXkkGSMfEJR7QsYAjNlhgn6iNS7T0AtakNnvaJ+W1TeQdeIxHaHtXaMtU+GP3CL5v+2RqHfc5JC6k9DJ6HhFaHHfu9Lc1Z5HlB5JWNOc8NupiUSlpa/7NIx0W0Ra10YcOVWnDfqhodmgI1CM5nrJS1DYKlMmyeAmoZaLrQnmNSRxAV7qZ0u0sr2Q8WbzUrRivE200nZ+x371Yj+idQH+bsOAFD16woZXuheBJI85UYyA+Ht17bJsTKLHHG+tuQpJX/AGX4eu2lq+vh8gQPgaLUpk1h7fcb1SJ4LEnGb+rdUHRHw96riVV36L5EgdqHNByqCTy82hnkrSSk3k5KTNWnJZ/buTlOvQngiceAkd4OHPz0K+tdOmGUYwJht2kcuBEntSRPOmZfyc40tFqD40IQeb2goGZvKIVzW4G5DMcQ4qOY3zVRzpmo1sMg+U1VemumtLofjFeCcxqJIUnM2vJuQeCHiOOwx4ss7pF6u+PtXxmZApbjCti22JtA+hVxUw7z6Xs2sSzMkeklSLPfwalYkjjt/0bHye4gKkXeaig5MpILVRiAd1vCrtP5Aj5uaN2PF1zxrE7koOgaY2PPL9FkccCKlprUZGr+zr0tw56iCvwGBTs+MFFxVbWeTaCQTj2WCBM1NnoWNxOBpBZU8f00hPsFDr+15wPevNsJG4IN+OGwKyWzKnW8S/GDUHZOd+44SsvbDvCuhYUTQSaQSFeWtoR4Xc833VimVzRvgm58QwZFQTthQ+awgQTeuVI7gLrF638Yixi+ot4RVZ5niDPFxBediyXNj++jUWDgkU3Zc96fDKwv4iiylyA4nalMkLX9C1hf24DNNkZyNDkflOPF4BqwdYbv1vLG9VX03W96PVKiCq+A01i5utY2d9YfSMP0qvQ7eFQUHSKvNfpCl21nqNafqf1UQksqfVe1PEPPNiJpY81iZoP119ZTUHojdpseMYqec5zr/2Jgo695rmycZWzSgOpXzMpbFrHu1Zmq/xA8pX3cgEQZU1/YzaexuQbXIoxF9THdaEzz9VaE5fgNVIPR/sIS8fQyipam9JXqHdOtPEIRllqzP7Ewh9063Z2IYH+GiLNUPFXJIcEM4RYc7bEkjwQL4/1fx+aHL8/62Of5vo3y+p92QX2fh18zrNFcPX9sfZAdBDZu8vxCM4clX31Qr9RrLPkDDDau8v8LZRar2N8lSOj1NGsLJeBZam1TIuwpzwepL3CJAvyANsPnj3BAzsD3a5X6ydEaZUSs50b7g2JrYcyG2lRL+xl+jD+Gfod33w82P0FTuYREa3c70CRS82XCtxIueJHXuIMB6tMt+x7lf7m5U4tyK9L3smuLrxqDxYPI30rYzk2h2NzgPXqAvPrQdqUxvdWF2zVwDrHCq0RoI0Hcrzcn9D8BMxYEMszZBzooqa/jsTxSeTthXTm9FC2n+pYEh8uVqyL9436quMD6pnK7njZM6msy4uYsunVquBSi4clVn8gblYc96TFyF04ll2oqCB300cDIbPxrZoqXZ1DHWvNh2irrNxstSaZYa2VB333tOr9mRcx7ETmXKmSFz6GkidstKjZFE8qIX26eG8KoS/b9uij9GFOiwFIVj5NyErT8rZGstdmD4lc4/xaNevd1uwOPCLX7Ems2TTc81MrUVmzyqdOr1v1PCPat9jmQfUYJEEbzNCSse4DevSYCIXal+bDCC3I2+EeTFKd7ltnFNN0sGLIfRcGfSWKD0BPANWTQIqcNtsaAON/1A/BeywPGhybs2ZEA1sH9FbgDMpTQx5L5k4fN/RR8lBHvif2ftB7oa8isVdrdWDxp/Hp6N8MsdUgqdS0M12EZrhC7TpJZZLZOZelRdeDUyffq3s6xPhztK4Xd9h6f4pIieNu4lI/jEN1XEMjbafK6lry/jkOYedyVMyp2vaHGlM8zBjCkdi28NdrNldgLa/a0orYtN6OwoMh7vPAsxb9eNTDrOdJBWuXsb6En8Evb5yTrJw1Y1XTHnmCFNtPkhHnuN+8QwHGi3JUJf4zeaTJsBpFdnik5V4fZq510ifEHMf7M55f2fteR1DJ73gzf4vyO42Or3Z5mZcWdlY6wb3sRvd0olKfGeaCWm5yGEtDwzLH6yPS95wmcVb2BBrYzig5tGb7Bvb5fkyfvW2nRhlxF3cyz8qGOF//eVLXq7P4oQTop9UASTKPr91h1zu5wu753DbqtXUO8pOT6wzdnQfWn2X3Csr5ktxP4FUmlBHHPThBO0mQ6wTFVxbM5mPCeXWP7ha4YDf8BdvAeaGd/XntlgHlW2eMFAR2CBPYAQzPrGeVy1ieYCOQdtpXGZyss4F2rkr5W8tJh06NTd/HGi+1vbiPN6JTeSfP5k0ihAhRQwgad9wQ1dhoKAntU87DfZy/K8SuEsPg82VQRU5xUGU+ZVrp8SMYtOHiwFC+Z1jLG2dqRuhAw01cZ2qeXBk/ROjaAS1TIuKHVp+Fi5YMrHqqahlY3YbJ0E/N2uUTq/0Cvt717Vfwa/gNfAO/hd/B7+EP8Ef4E/wZ/gJ/hb/B3+Ef8E/4F/z7nla+5T+Afp1wHdQRH/F/+/lF6VrSbuP4v/18VHMVmm7q6TX/Czha0mxJrf+YyNyOfRcYeKSap3+b8UufB8GnJSdec6Iu+toF6nHkaeZxvJ5h4PVgj3ILMz5teArdxnr8/PPoCXqiuvR91zoh2pvS8b0SqUD1FLPubHPaK9Q5lU+GzwI3PgfCOsB9NORgqm5OqfVxLMd1L9+A/s2s+0/0a93MTd3NNRHapruGQLnhZTSzpBMuYFNaz7N5RffPo/MnV2zac3wfRX6Vng0As1cTmE5M38U0eS+H0rvZxXtg6460jlQTZ3Snxw+pO9TKz+mOB5vffTs6umGj+UjMb3/QKfndvlP47UsVAO9Drzo11h+T/rF09Po0st98jHsKh31Ruj2UnbYWLuEd/pM9wOwpZ+KqccfWNZsc4F6c3jtf2ou7Ca6akqXRPThzsadua+/4hq7vgmn6uqux6bXw6AjnLMJbXMM5Ixwi8mR2rc3AOfg2nrs4zZlnDFaChbCtk/bwilwMfBxc0iMYy0MX40x2o/ft9D2Znn9Kl+3MO90HUb747jnzjpyCKVeTuij6DllsctyiUzXN0dgE9We1yK54WBffFqtew9TXpbYfy7dILWH/SXxmqeg4zlvRsZfIbuFnic0SHfRtfj4vsaVq532jl/QpYBykzpe/jec7n1uOmhuETi2xzM5vfy01xQC0vkp6PiKpDd07x6qcUc719K0A1YZjpvLivftqNpzxV/tDtXPTWFrbaowzXj+czsG+nmMt/bQspzj7fnvxeeuG4O/s/Xe412VW3+5VuPT+EV97/r++14Gc3ZvQRHrXMz91IrWHZ4FnK7WOVGjJPfAO3R0BczdLKuevQd5LPVsXd/X8PK6Ll2jK0/NM7P4V1PuI51FvsEMV+KhV4T2+22IQF85a0FlLWXs/IHTOX1B5CGCeEDh6V2ZiTK+eee/dnNjOa2xXz2zndd7sq+XYEZ/Gx/exoK5PoOceWNdnef9W9KCT9EYXqkrPxuhC9GA7faMXpHef1smLTDe1qaDY1N4ozLI4fqsHlwpf+3Cu9F1E/Z4AajG3V8430/6bCdq8QQs9b4OqJyQa1+6BACWaTPI8zrROa//7QGJ19U4tHeTTtePNqu3PnVhXJFSjzZFz4eo3Ndqidi/O6J5Z7X+VsS3cYki51T35Iv+merFeuGe69cbJM3Jq1Fn4kUA5rze4o9CRs22iy5jMsYLMS8g5/wOjbDW/AAB42mNgZGBgAOIzT9tXxvPbfGVgYGEAgZokCXVkmgUizsHABFLNwAAACJYG1HjaY2BkYGBhAAEIyc7AwMiAAhgZAQHPABQAAAB42r1TwRaAIAgD88P59PRA0hxUlw578mBDQOwi0i+oDUzb7nC/xyKH8SuwHH/jSx83jnE745c1RO44G9E1WTE14AQtYvKO6PN6BXRW5EONgCazSS4VXiere+sp7F7cQeSp7Pe2YkaxN7fVFhg/8z/1hfnfaBXnZ8k7wNzp/y13+wRWwErCAAAAeNpl0ylUVVEUBuCtoiKgoiIzAjIIMj9mZBZYMsmMjwcuBhEIBoPBYDAYDAaDwWA0GAwGgsFgMBgMBoPBYDAYDAaDweBnlrX+9e6955x/2oeI//664HbEgTL4HnHwZ8Sh1/AlIm0W3kUc3oN9+BFxJBva4E3E0SvwLCIdR/qniGO98Coiw3vG04hMv5n/fj9GZBUD3iz8xx9FnMiBJxEn0+E+/IrIppNt/VQzvITfEadH4HnEmUG4BV8jchaBn7NZgCMXdy7uXGfzeMjjKZ/PfBwF9hTYU/AhotC5QtpFtIt4K7oLnyOK6RXTKP4TUcJDCe5zNXAHcJTiKOWxlEZZPeAo00U5b+XyltM9vw24KvBWyFzpTOWLiCr5qu6BPdV0qx+Cni+sAc4a3mvw1nqu/RZxsRJkrEsDWeo2wAzq8dY/iGgwpwbfGvTdaA6NOmnUb5PnpiTY00S3SXfN/DU/BustdFrMq8VagqcE/YReEjK3+t4qayuPbTTbdNH2PqJdL+06a5e33VoHjg7vHdY7cXTK2ekedPHWha+b5279ddPo1ndPPuDrkbkH3yX5e/XXy3OvzH34+sy132+//P14B/AO6GuA3qBOB3U6hH/It2Haw2Y2rI9hHV6WdcSsR6eAl1GZx3Qwpr9xcxv3PqGDCbyTvE3KM+muT+lwypkpe6bNaZqfaX6v8j7D8wyNGbwzbyNmdTMrzxxfc9bndDFn5vM8zds37x4smMeCHhf5WTKHJb0uuc/L/C7bs4zrGr2kO5m0ntRZkv8VfazIkvI9RSelg5ReUrKvOrvqHq7p4Lr5retx3fcN/5Mb+Dfs25RpE/8mji0etqzfwLHteZufmzrZobfj/K5ednna0/fe/l+Pca7seNpjYGRgYGRkaGBQYAABJgY0AAAP+ACmeNp1ksFO20AQhv8NgRJaUApSy61LDxVc4uAjNxoJReoNKdCrYy8hZb1rrTcIuPMKfaY+QM899RH6AP3tDJEKqlcefzvzz/xrywD21ScoLK9N3ktW5E3hDl6hL7zG7HvhLrMfhNfxGonwBjUnwj2uz8JbzH4R3sZbPArvIMV34T28wQ+6qG6Puz5+Civyb+EOO/4Ir6GvOsJdaLUrvI53KhXeoGYs3MOu+iq8hai+CW/jo/olvIOiA+E97HeKw/xIp8M0nYQ6O/MunpvZwmbhafv01JK/MKGee6ePB8N/JCFzN6dO+8o4bee5cbnRM+NMyKyuFqHytdHR3MXSF0ZfNQOn93rVORoNm4l64ua3NMjsdYxVfZIkeTBZZC73ZeldPfBhllSLKR0KX2ZzlzyY4BO2JmNjrdeXPtjiAIfIcQTNbz/knWKCgBoZzuDhEHEOgxkWsMyFF9Xne/1Mf8Fdo5i3dY1jDOjz/ymB0eEGp63ao2J/Q5YT8pabqOnQsGn1lvuKjoHRc05Tj4x3jCUzRZu5Wp1winvGl54jruHqjI3C0fVW3qDxuWZ/pEvNPzjhylkxrETR5fQoW09HzYDPwJMm7emm8g5Fq8nIjpWHdronLV0TjJmxXJ4nuGwnWPYcAH8BoeumrAB42mNgYmFgnMDAysDCxMDEAAIQGoiNGc6A+CwMENDAwNDNwFDwGMpliHT00WNwYFBQy4aogJCMgSCSGcJTYGAAAEBYBpIAAAB42mNgZoCANAZjIMnIgAYADecAng==")).arrayBuffer();
1618
- await this.br(e), this.nr = V.parse(e)[0], await this.Cr();
1618
+ await this.br(e), this.nr = j.parse(e)[0], await this.Cr();
1619
1619
  }
1620
1620
  Mr(t) {
1621
1621
  if (t === void 0) return this.lr;
@@ -1629,7 +1629,7 @@ class et {
1629
1629
  if (!e.ok) throw new U(`Failed to load font file: ${e.status} ${e.statusText}`);
1630
1630
  const i = await e.arrayBuffer();
1631
1631
  await this.br(i);
1632
- const r = V.parse(i);
1632
+ const r = j.parse(i);
1633
1633
  if (!r || r.length === 0) throw Error("Failed to parse font file");
1634
1634
  this.nr = r[0], await this.Cr();
1635
1635
  } catch (e) {
@@ -1772,7 +1772,7 @@ function Be(n) {
1772
1772
  return [h, o, c, Math.round(l)];
1773
1773
  }(t)), e ? e[3] === 0 ? null : e : null;
1774
1774
  }
1775
- class _e {
1775
+ class De {
1776
1776
  constructor(t = {}) {
1777
1777
  a(this, "kr");
1778
1778
  a(this, "Nr", null);
@@ -1857,7 +1857,7 @@ class _e {
1857
1857
  }
1858
1858
  }
1859
1859
  function $(n) {
1860
- return O(parseInt(n, 16), 0, 255);
1860
+ return Z(parseInt(n, 16), 0, 255);
1861
1861
  }
1862
1862
  class S {
1863
1863
  constructor(t, e, i, r) {
@@ -1867,7 +1867,7 @@ class S {
1867
1867
  a(this, "g");
1868
1868
  a(this, "b");
1869
1869
  a(this, "a");
1870
- this.r = O(t, 0, 255), this.g = O(e, 0, 255), this.b = O(i, 0, 255), this.a = O(r, 0, 255), this.sn = [this.r, this.g, this.b, this.a], this.en = [this.r / 255, this.g / 255, this.b / 255, this.a / 255];
1870
+ this.r = Z(t, 0, 255), this.g = Z(e, 0, 255), this.b = Z(i, 0, 255), this.a = Z(r, 0, 255), this.sn = [this.r, this.g, this.b, this.a], this.en = [this.r / 255, this.g / 255, this.b / 255, this.a / 255];
1871
1871
  }
1872
1872
  static rn(t, e, i, r) {
1873
1873
  if (S.nn(t)) return t;
@@ -2028,7 +2028,7 @@ class St {
2028
2028
  return { renderer: this.Z, gl: this.A, font: this.dn, source: this, gridWidth: this.N, gridHeight: this.X };
2029
2029
  }
2030
2030
  }
2031
- class k extends St {
2031
+ class z extends St {
2032
2032
  constructor(t, e, i, r, s, h, o, c) {
2033
2033
  const l = Math.min(o / s, c / h);
2034
2034
  super(t, e, i, r, s, h, Math.max(1, Math.floor(s * l)), Math.max(1, Math.floor(h * l)));
@@ -2037,7 +2037,7 @@ class k extends St {
2037
2037
  const h = t.context, o = h.createTexture();
2038
2038
  h.bindTexture(h.TEXTURE_2D, o), h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL, 1), pt(h, h.NEAREST, h.NEAREST, h.CLAMP_TO_EDGE, h.CLAMP_TO_EDGE), h.texImage2D(h.TEXTURE_2D, 0, h.RGBA, h.RGBA, h.UNSIGNED_BYTE, i), h.bindTexture(h.TEXTURE_2D, null);
2039
2039
  const c = i.naturalWidth ?? i.width ?? i.videoWidth ?? 0, l = i.naturalHeight ?? i.height ?? i.videoHeight ?? 0;
2040
- return new k(h, t, o, e, c, l, r, s);
2040
+ return new z(h, t, o, e, c, l, r, s);
2041
2041
  }
2042
2042
  $n() {
2043
2043
  return this.ln;
@@ -2236,7 +2236,7 @@ class Lt {
2236
2236
  } else this.qn.x = -1 / 0, this.qn.y = -1 / 0;
2237
2237
  }
2238
2238
  }
2239
- const Ie = Object.freeze(Object.defineProperty({ __proto__: null, MouseManager: Lt }, Symbol.toStringTag, { value: "Module" }));
2239
+ const _e = Object.freeze(Object.defineProperty({ __proto__: null, MouseManager: Lt }, Symbol.toStringTag, { value: "Module" }));
2240
2240
  class Nt {
2241
2241
  constructor() {
2242
2242
  a(this, "zo", /* @__PURE__ */ new Map());
@@ -2308,7 +2308,7 @@ class Nt {
2308
2308
  return this.Ho[t] || t.toLowerCase();
2309
2309
  }
2310
2310
  }
2311
- const De = Object.freeze(Object.defineProperty({ __proto__: null, KeyboardManager: Nt }, Symbol.toStringTag, { value: "Module" }));
2311
+ const Oe = Object.freeze(Object.defineProperty({ __proto__: null, KeyboardManager: Nt }, Symbol.toStringTag, { value: "Module" }));
2312
2312
  class Bt {
2313
2313
  constructor(t, e, i) {
2314
2314
  a(this, "kr");
@@ -2438,7 +2438,7 @@ class Bt {
2438
2438
  const h = this.Vo.get(s.id), o = h ? this.Zh(h) : void 0;
2439
2439
  o && this.Jo.set(s.id, o), this.Vo.set(s.id, s);
2440
2440
  const c = this.th.get(s.id);
2441
- c && (c.lastPosition = s, c.lastTime = e, o) && z(o.clientX, o.clientY, s.clientX, s.clientY) > this.Mh && c.longPressTimer !== null && (window.clearTimeout(c.longPressTimer), c.longPressTimer = null), this.uh && this.uh(this.qh(s, t, o, e));
2441
+ c && (c.lastPosition = s, c.lastTime = e, o) && k(o.clientX, o.clientY, s.clientX, s.clientY) > this.Mh && c.longPressTimer !== null && (window.clearTimeout(c.longPressTimer), c.longPressTimer = null), this.uh && this.uh(this.qh(s, t, o, e));
2442
2442
  }
2443
2443
  this.Vo.size === 2 ? this.Jh(t) : this.sh = null;
2444
2444
  }
@@ -2485,14 +2485,14 @@ class Bt {
2485
2485
  }
2486
2486
  Vh() {
2487
2487
  if (this.Vo.size !== 2) return void (this.sh = null);
2488
- const t = Array.from(this.Vo.values()), [e, i] = t, r = z(e.x, e.y, i.x, i.y), s = mt(e.clientX, e.clientY, i.clientX, i.clientY);
2488
+ const t = Array.from(this.Vo.values()), [e, i] = t, r = k(e.x, e.y, i.x, i.y), s = mt(e.clientX, e.clientY, i.clientX, i.clientY);
2489
2489
  this.sh = { ids: [e.id, i.id], initialDistance: Math.max(r, 1e-4), initialAngle: s, lastScale: 1, lastRotation: 0 };
2490
2490
  }
2491
2491
  Jh(t) {
2492
2492
  if (this.sh || this.Vh(), !this.sh) return;
2493
2493
  const [e, i] = this.sh.ids, r = this.Vo.get(e), s = this.Vo.get(i);
2494
2494
  if (!r || !s) return;
2495
- const h = z(r.x, r.y, s.x, s.y) / this.sh.initialDistance, o = h - this.sh.lastScale;
2495
+ const h = k(r.x, r.y, s.x, s.y) / this.sh.initialDistance, o = h - this.sh.lastScale;
2496
2496
  this.yh && Math.abs(o) > this.Ph && (this.yh({ touches: [this.Zh(r), this.Zh(s)], scale: h, deltaScale: o, center: this.ia(r, s), originalEvent: t }), this.sh.lastScale = h);
2497
2497
  let c = mt(r.clientX, r.clientY, s.clientX, s.clientY) - this.sh.initialAngle;
2498
2498
  c = (c + 180) % 360 - 180;
@@ -2504,7 +2504,7 @@ class Bt {
2504
2504
  return { x: s.x, y: s.y };
2505
2505
  }
2506
2506
  ta(t, e) {
2507
- const i = performance.now(), r = i - t.startTime, s = z(t.startPosition.clientX, t.startPosition.clientY, t.lastPosition.clientX, t.lastPosition.clientY);
2507
+ const i = performance.now(), r = i - t.startTime, s = k(t.startPosition.clientX, t.startPosition.clientY, t.lastPosition.clientX, t.lastPosition.clientY);
2508
2508
  if (!t.longPressFired && r <= this.wh && s <= this.Ch)
2509
2509
  this.ea(t.lastPosition, i) && this.gh ? this.gh({ touch: this.Zh(t.lastPosition), taps: 2, originalEvent: e }) : this.ph && this.ph({ touch: this.Zh(t.lastPosition), taps: 1, originalEvent: e });
2510
2510
  else if (!t.longPressFired && r <= this.$h && s >= this.Fh) {
@@ -2514,13 +2514,13 @@ class Bt {
2514
2514
  this.Rh = i, this.Sh = this.Zh(t.lastPosition);
2515
2515
  }
2516
2516
  ea(t, e) {
2517
- return !this.Sh || e - this.Rh > this.bh ? !1 : z(t.clientX, t.clientY, this.Sh.clientX, this.Sh.clientY) <= this.Ch;
2517
+ return !this.Sh || e - this.Rh > this.bh ? !1 : k(t.clientX, t.clientY, this.Sh.clientX, this.Sh.clientY) <= this.Ch;
2518
2518
  }
2519
2519
  Zh(t) {
2520
2520
  return { ...t };
2521
2521
  }
2522
2522
  }
2523
- const Oe = Object.freeze(Object.defineProperty({ __proto__: null, TouchManager: Bt }, Symbol.toStringTag, { value: "Module" }));
2523
+ const Ze = Object.freeze(Object.defineProperty({ __proto__: null, TouchManager: Bt }, Symbol.toStringTag, { value: "Module" }));
2524
2524
  class nt extends St {
2525
2525
  constructor(e, i, r, s, h, o, c, l, u) {
2526
2526
  const f = o / c;
@@ -2597,7 +2597,7 @@ class nt extends St {
2597
2597
  return !this.ra.paused && !this.ra.ended;
2598
2598
  }
2599
2599
  }
2600
- const Xe = (n) => class extends n {
2600
+ const Ie = (n) => class extends n {
2601
2601
  oa(t, e, i, r) {
2602
2602
  if (S.nn(t)) return t;
2603
2603
  if (typeof t == "number" || typeof t == "string") return this.color(t, e, i, r);
@@ -2715,21 +2715,21 @@ const Xe = (n) => class extends n {
2715
2715
  }
2716
2716
  image(t, e, i) {
2717
2717
  const r = this.dn ?? this.ha.base.font;
2718
- this.Z.ye(t, e, i, r), t instanceof Z && this.Z.ct();
2718
+ this.Z.ye(t, e, i, r), t instanceof X && this.Z.ct();
2719
2719
  }
2720
2720
  async loadImage(t) {
2721
2721
  if (typeof t != "string")
2722
- return k.Tn(this.Z, this.gn, t, this.grid.cols, this.grid.rows);
2722
+ return z.Tn(this.Z, this.gn, t, this.grid.cols, this.grid.rows);
2723
2723
  const e = t, i = await new Promise((r, s) => {
2724
2724
  const h = new Image();
2725
2725
  h.crossOrigin = "anonymous", h.onload = () => r(h), h.onerror = (o) => s(o), h.src = e;
2726
2726
  });
2727
- return k.Tn(this.Z, this.gn, i, this.grid.cols, this.grid.rows);
2727
+ return z.Tn(this.Z, this.gn, i, this.grid.cols, this.grid.rows);
2728
2728
  }
2729
2729
  async loadVideo(t) {
2730
2730
  return await nt.Tn(this.Z, this.gn, t, this.grid.cols, this.grid.rows);
2731
2731
  }
2732
- }, Ze = (n) => class extends n {
2732
+ }, Xe = (n) => class extends n {
2733
2733
  get frameCount() {
2734
2734
  return this.aa.Kn;
2735
2735
  }
@@ -2751,7 +2751,7 @@ const Xe = (n) => class extends n {
2751
2751
  isLooping() {
2752
2752
  return this.aa.Yn;
2753
2753
  }
2754
- }, ke = (n) => class extends n {
2754
+ }, ze = (n) => class extends n {
2755
2755
  constructor(...t) {
2756
2756
  super(...t);
2757
2757
  }
@@ -2813,7 +2813,7 @@ const Xe = (n) => class extends n {
2813
2813
  get touches() {
2814
2814
  return this.la.Bh();
2815
2815
  }
2816
- }, ze = (n) => class extends n {
2816
+ }, ke = (n) => class extends n {
2817
2817
  constructor(...t) {
2818
2818
  super(...t);
2819
2819
  }
@@ -2839,7 +2839,7 @@ const Xe = (n) => class extends n {
2839
2839
  return this.ua.Wo();
2840
2840
  }
2841
2841
  };
2842
- class Ge {
2842
+ class He {
2843
2843
  constructor(t) {
2844
2844
  a(this, "fa");
2845
2845
  a(this, "da", /* @__PURE__ */ new Map());
@@ -2897,21 +2897,21 @@ class Ge {
2897
2897
  }
2898
2898
  }
2899
2899
  }
2900
- const j = `#version 300 es
2901
- layout(location=0)in vec2 A;layout(location=1)in vec2 B;out vec2 v_uv;void main(){v_uv=B;gl_Position=vec4(A,0.,1.);}`, _t = `#version 300 es
2900
+ const V = `#version 300 es
2901
+ layout(location=0)in vec2 A;layout(location=1)in vec2 B;out vec2 v_uv;void main(){v_uv=B;gl_Position=vec4(A,0.,1.);}`, Dt = `#version 300 es
2902
2902
  precision highp float;uniform sampler2D u_texture;in vec2 v_uv;out vec4 fragColor;void main(){fragColor=texture(u_texture,v_uv);}`;
2903
- class It {
2903
+ class _t {
2904
2904
  constructor() {
2905
2905
  a(this, "$a", /* @__PURE__ */ new Map());
2906
2906
  a(this, "Pa", []);
2907
2907
  a(this, "Ta", 0);
2908
- a(this, "Ua", 0);
2909
- a(this, "Ea");
2908
+ a(this, "Ea", 0);
2909
+ a(this, "Ra");
2910
2910
  }
2911
- get Ra() {
2911
+ get Sa() {
2912
2912
  return this.Ta;
2913
2913
  }
2914
- get Sa() {
2914
+ get za() {
2915
2915
  if (this.Ta === 0) return 0;
2916
2916
  let t = 0;
2917
2917
  for (const e of this.Pa) {
@@ -2920,100 +2920,100 @@ class It {
2920
2920
  }
2921
2921
  return Math.min(1, t / this.Ta);
2922
2922
  }
2923
- za(t) {
2924
- this.Ea = t;
2923
+ ka(t) {
2924
+ this.Ra = t;
2925
2925
  }
2926
- ka(t, e = 1) {
2926
+ Da(t, e = 1) {
2927
2927
  const i = `phase-${this.Pa.length + 1}-${Date.now()}`, r = { id: i, label: t, weight: Math.max(1e-3, e), progress: 0, status: "running" };
2928
2928
  return this.$a.set(i, r), this.Pa.push(i), this.Ta += r.weight, i;
2929
2929
  }
2930
- Da(t, e) {
2930
+ La(t, e) {
2931
2931
  const i = this.$a.get(t);
2932
2932
  if (!i) return;
2933
2933
  i.progress = Math.max(0, Math.min(1, e)), i.status = i.progress >= 1 ? "complete" : "running";
2934
- const r = this.Sa;
2935
- Math.abs(r - this.Ua) > 1e-3 && (this.Ua = r, this.Ea && this.Ea(r));
2934
+ const r = this.za;
2935
+ Math.abs(r - this.Ea) > 1e-3 && (this.Ea = r, this.Ra && this.Ra(r));
2936
2936
  }
2937
- La(t) {
2937
+ Oa(t) {
2938
2938
  const e = this.$a.get(t);
2939
- e && (e.progress = 1, e.status = "complete", this.Da(t, 1));
2939
+ e && (e.progress = 1, e.status = "complete", this.La(t, 1));
2940
2940
  }
2941
- Oa(t) {
2941
+ Ba(t) {
2942
2942
  const e = this.$a.get(t);
2943
2943
  e && (e.status = "failed");
2944
2944
  }
2945
- Ba() {
2945
+ Ia() {
2946
2946
  return this.Pa.map((t) => {
2947
2947
  const e = this.$a.get(t);
2948
2948
  return e ? { id: e.id, label: e.label, weight: e.weight, progress: e.progress, status: e.status } : { id: t, label: t, weight: 1, progress: 0, status: "pending" };
2949
2949
  });
2950
2950
  }
2951
2951
  }
2952
- class Dt {
2952
+ class Ot {
2953
2953
  constructor(t = "active") {
2954
- a(this, "Ia");
2955
- a(this, "Ha", "");
2954
+ a(this, "Ha");
2956
2955
  a(this, "Ga", "");
2957
- this.Ia = t;
2958
- }
2959
- get Qa() {
2960
- return this.Ia;
2956
+ a(this, "Qa", "");
2957
+ this.Ha = t;
2961
2958
  }
2962
2959
  get Na() {
2963
- return this.Ia !== "disabled";
2960
+ return this.Ha;
2964
2961
  }
2965
2962
  get Xa() {
2966
- return this.Ia === "active" || this.Ia === "transitioning" || this.Ia === "error";
2963
+ return this.Ha !== "disabled";
2967
2964
  }
2968
2965
  get Ya() {
2969
- return this.Ha;
2966
+ return this.Ha === "active" || this.Ha === "transitioning" || this.Ha === "error";
2970
2967
  }
2971
2968
  get ja() {
2972
2969
  return this.Ga;
2973
2970
  }
2974
- Ka() {
2975
- this.Ia !== "done" && this.Ia !== "transitioning" || (this.Ia = "active");
2971
+ get Ka() {
2972
+ return this.Qa;
2976
2973
  }
2977
2974
  Wa() {
2978
- this.Ia !== "disabled" && (this.Ia = "done");
2975
+ this.Ha !== "done" && this.Ha !== "transitioning" || (this.Ha = "active");
2979
2976
  }
2980
2977
  Za() {
2981
- this.Ia !== "disabled" && (this.Ia = "transitioning");
2978
+ this.Ha !== "disabled" && (this.Ha = "done");
2982
2979
  }
2983
2980
  qa() {
2984
- this.Ia === "transitioning" && (this.Ia = "done");
2981
+ this.Ha !== "disabled" && (this.Ha = "transitioning");
2985
2982
  }
2986
- Va(t) {
2987
- this.Ia !== "disabled" && (this.Ia = "error", t instanceof Error ? (this.Ha = t.message, this.Ga = t.stack || "") : (this.Ha = t, this.Ga = ""));
2983
+ Va() {
2984
+ this.Ha === "transitioning" && (this.Ha = "done");
2988
2985
  }
2989
- Ja() {
2990
- this.Ia = "disabled";
2986
+ Ja(t) {
2987
+ this.Ha !== "disabled" && (this.Ha = "error", t instanceof Error ? (this.Ga = t.message, this.Qa = t.stack || "") : (this.Ga = t, this.Qa = ""));
2988
+ }
2989
+ tc() {
2990
+ this.Ha = "disabled";
2991
2991
  }
2992
2992
  }
2993
- class Ot {
2993
+ class Zt {
2994
2994
  constructor(t, e) {
2995
- a(this, "tc", 0);
2996
- a(this, "sc", 1);
2997
- a(this, "ec");
2995
+ a(this, "sc", 0);
2996
+ a(this, "ec", 1);
2998
2997
  a(this, "rc");
2999
- this.ec = t, this.rc = e;
3000
- }
3001
- get nc() {
3002
- return this.sc;
2998
+ a(this, "nc");
2999
+ this.rc = t, this.nc = e;
3003
3000
  }
3004
3001
  get oc() {
3005
- return this.sc < 1;
3002
+ return this.ec;
3003
+ }
3004
+ get hc() {
3005
+ return this.ec < 1;
3006
3006
  }
3007
3007
  In() {
3008
- this.ec !== "none" && this.rc > 0 && (this.tc = performance.now());
3008
+ this.rc !== "none" && this.nc > 0 && (this.sc = performance.now());
3009
3009
  }
3010
3010
  et() {
3011
- if (this.ec === "none" || this.rc === 0) return this.sc = 1, !1;
3012
- const t = performance.now() - this.tc, e = Math.min(1, t / this.rc);
3013
- return e >= 1 ? (this.sc = 0, !0) : (this.sc = 1 - e, !1);
3011
+ if (this.rc === "none" || this.nc === 0) return this.ec = 1, !1;
3012
+ const t = performance.now() - this.sc, e = Math.min(1, t / this.nc);
3013
+ return e >= 1 ? (this.ec = 0, !0) : (this.ec = 1 - e, !1);
3014
3014
  }
3015
3015
  ti() {
3016
- this.sc = 1, this.tc = 0;
3016
+ this.ec = 1, this.sc = 0;
3017
3017
  }
3018
3018
  }
3019
3019
  function gt(n, t) {
@@ -3025,24 +3025,24 @@ function gt(n, t) {
3025
3025
  return 0.2126 * c(s) + 0.7152 * c(h) + 0.0722 * c(o);
3026
3026
  }(t) > 0.5 ? "light" : "dark"), { mode: i, background: t, textColor: i === "light" ? "#1A1A1A" : "#F8F8F8", subtleColor: i === "light" ? "#4A4A4A" : "#C0C0C0" };
3027
3027
  }
3028
- function Xt(n) {
3028
+ function It(n) {
3029
3029
  return n.mode === "light" ? ["#E91E63", "#9C27B0", "#FF6F00"] : ["#8EF9F3", "#F15BB5", "#FF9B71"];
3030
3030
  }
3031
- function Zt(n, t) {
3031
+ function Xt(n, t) {
3032
3032
  return n.length ? n.map((e) => t.color(e)) : [t.color("#FFFFFF")];
3033
3033
  }
3034
- class kt {
3034
+ class zt {
3035
3035
  constructor(t, e, i, r) {
3036
- this.hc = t, this.id = e, this.label = i, this.ac = r;
3036
+ this.ac = t, this.id = e, this.label = i, this.cc = r;
3037
3037
  }
3038
3038
  report(t) {
3039
- this.hc.Da(this.id, t);
3039
+ this.ac.La(this.id, t);
3040
3040
  }
3041
3041
  complete() {
3042
- this.hc.La(this.id);
3042
+ this.ac.Oa(this.id);
3043
3043
  }
3044
3044
  fail(t) {
3045
- this.hc.Oa(this.id), this.ac && this.ac(t ?? Error(`Loading phase "${this.label}" failed`));
3045
+ this.ac.Ba(this.id), this.cc && this.cc(t ?? Error(`Loading phase "${this.label}" failed`));
3046
3046
  }
3047
3047
  async track(t) {
3048
3048
  try {
@@ -3053,54 +3053,53 @@ class kt {
3053
3053
  }
3054
3054
  }
3055
3055
  }
3056
- const He = ({ textmodifier: n, grid: t, progress: e, frameCount: i, message: r, palette: s, theme: h, phases: o, transitionOpacity: c, isError: l, errorMessage: u }) => {
3056
+ const Ge = ({ textmodifier: n, grid: t, progress: e, frameCount: i, message: r, palette: s, theme: h, phases: o, transitionOpacity: c, isError: l, errorMessage: u }) => {
3057
3057
  const f = "|/-\\", d = Math.floor(i / 6) % 4, g = n.color(h.textColor), p = Math.floor(255 * c), v = n.color(g.r, g.g, g.b, p);
3058
3058
  if (n.charColor(v), n.cellColor(0, 0, 0, 0), l) {
3059
3059
  const A = n.color(h.mode === "light" ? "#D32F2F" : "#FF6B6B", p);
3060
3060
  n.charColor(A), n.push(), n.translate(0, -2, 0), n.char("X"), n.rect(1, 1), n.pop();
3061
- const m = "SETUP ERROR", E = -Math.floor(m.length / 2);
3062
- n.push(), n.translate(E, 0, 0);
3061
+ const m = "SETUP ERROR", w = -Math.floor(m.length / 2);
3062
+ n.push(), n.translate(w, 0, 0);
3063
3063
  for (const y of m) n.char(y), n.rect(1, 1), n.translateX(1);
3064
3064
  if (n.pop(), u) {
3065
3065
  const y = n.color(h.subtleColor), x = n.color(y.r, y.g, y.b, p);
3066
3066
  n.charColor(x);
3067
- const w = Math.floor(0.8 * t.cols), C = u.split(" "), M = [];
3067
+ const E = Math.floor(0.8 * t.cols), F = u.split(" "), P = [];
3068
3068
  let T = "";
3069
- for (const F of C) (T + " " + F).length <= w ? T = T ? T + " " + F : F : (T && M.push(T), T = F);
3070
- T && M.push(T);
3071
- const L = M.slice(0, 3);
3072
- M.length > 3 && (L[2] = L[2].substring(0, w - 3) + "..."), L.forEach((F, Q) => {
3073
- const jt = -Math.floor(F.length / 2);
3074
- n.push(), n.translate(jt, 3 + Q, 0);
3075
- for (const Qt of F) n.char(Qt), n.rect(1, 1), n.translateX(1);
3069
+ for (const C of F) (T + " " + C).length <= E ? T = T ? T + " " + C : C : (T && P.push(T), T = C);
3070
+ T && P.push(T);
3071
+ const L = P.slice(0, 3);
3072
+ P.length > 3 && (L[2] = L[2].substring(0, E - 3) + "..."), L.forEach((C, Q) => {
3073
+ const Vt = -Math.floor(C.length / 2);
3074
+ n.push(), n.translate(Vt, 3 + Q, 0);
3075
+ for (const Qt of C) n.char(Qt), n.rect(1, 1), n.translateX(1);
3076
3076
  n.pop();
3077
3077
  });
3078
3078
  }
3079
3079
  return;
3080
3080
  }
3081
3081
  if (n.push(), n.translate(0, 0, 0), n.char(f[d]), n.rect(1, 1), n.pop(), e > 0 || o.some((A) => A.status !== "pending")) {
3082
- const A = Math.max(6, Math.floor(0.6 * t.cols)), m = -Math.floor(A / 2), E = Math.floor(A * e), y = s.length ? s : [n.color("#FFFFFF")];
3082
+ const A = Math.max(6, Math.floor(0.6 * t.cols)), m = -Math.floor(A / 2), w = Math.floor(A * e), y = s.length ? s : [n.color("#FFFFFF")];
3083
3083
  n.push(), n.translate(m, 3, 0);
3084
3084
  for (let x = 0; x < A; x++) {
3085
- const w = x < E ? "*" : ".", C = y[x % y.length], M = n.color(C.r, C.g, C.b, p);
3086
- n.charColor(M), n.char(w), n.rect(1, 1), n.translateX(1);
3085
+ const E = x < w ? "*" : ".", F = y[x % y.length], P = n.color(F.r, F.g, F.b, p);
3086
+ n.charColor(P), n.char(E), n.rect(1, 1), n.translateX(1);
3087
3087
  }
3088
3088
  n.pop();
3089
3089
  }
3090
3090
  if (r) {
3091
3091
  const A = n.color(h.subtleColor), m = n.color(A.r, A.g, A.b, p);
3092
3092
  n.charColor(m);
3093
- const E = -Math.floor(r.length / 2);
3094
- n.push(), n.translate(E, 5, 0);
3093
+ const w = -Math.floor(r.length / 2);
3094
+ n.push(), n.translate(w, 5, 0);
3095
3095
  for (const y of r) n.char(y), n.rect(1, 1), n.translateX(1);
3096
3096
  n.pop();
3097
3097
  }
3098
3098
  };
3099
3099
  class it {
3100
3100
  constructor(t, e = {}) {
3101
- a(this, "cc");
3102
- a(this, "nc");
3103
3101
  a(this, "lc");
3102
+ a(this, "oc");
3104
3103
  a(this, "uc");
3105
3104
  a(this, "fc");
3106
3105
  a(this, "dc");
@@ -3108,206 +3107,207 @@ class it {
3108
3107
  a(this, "gc");
3109
3108
  a(this, "mc");
3110
3109
  a(this, "_c");
3111
- a(this, "nr");
3112
3110
  a(this, "yc");
3111
+ a(this, "nr");
3113
3112
  a(this, "wc");
3114
3113
  a(this, "bc");
3115
3114
  a(this, "Cc");
3116
- a(this, "xc", null);
3117
- a(this, "Mc", !1);
3118
- a(this, "Fc", []);
3119
- this.cc = e.visible ?? !0, this.nc = e.opacity ?? 1, this.lc = e.blendMode ?? "normal", this.uc = e.offsetX ?? 0, this.fc = e.offsetY ?? 0, this.dc = e.rotationZ ?? 0, this.vc = e.fontSize ?? 16, this.gc = e.fontSource, e.fontSource instanceof et ? this.nr = e.fontSource : this.nr = new et(t, this.vc);
3120
- }
3121
- async $c(t) {
3122
- this.mc = t, this.nr.Tr || await this.nr.wr(this.gc);
3115
+ a(this, "xc");
3116
+ a(this, "Mc", null);
3117
+ a(this, "Fc", !1);
3118
+ a(this, "$c", []);
3119
+ this.lc = e.visible ?? !0, this.oc = e.opacity ?? 1, this.uc = e.blendMode ?? "normal", this.fc = e.offsetX ?? 0, this.dc = e.offsetY ?? 0, this.vc = e.rotationZ ?? 0, this.gc = e.fontSize ?? 16, this.mc = e.fontSource, e.fontSource instanceof et ? this.nr = e.fontSource : this.nr = new et(t, this.gc);
3120
+ }
3121
+ async Pc(t) {
3122
+ this._c = t, this.nr.Tr || await this.nr.wr(this.mc);
3123
3123
  const e = this.nr.maxGlyphDimensions;
3124
- this._c = new Le(this.mc.canvas.canvas, e.width, e.height);
3125
- const i = this._c;
3126
- this.yc = this.mc.createFramebuffer(i.cols, i.rows, 3), this.wc = this.mc.createFramebuffer(i.width, i.height, 1), this.bc = this.mc.createFramebuffer(i.width, i.height, 1), this.Cc = [this.mc.createFramebuffer(i.width, i.height, 1, { depth: !1 }), this.mc.createFramebuffer(i.width, i.height, 1, { depth: !1 })], this.Mc = !1, this._c.Hr(() => {
3124
+ this.yc = new Le(this._c.canvas.canvas, e.width, e.height);
3125
+ const i = this.yc;
3126
+ this.wc = this._c.createFramebuffer(i.cols, i.rows, 3), this.bc = this._c.createFramebuffer(i.width, i.height, 1), this.Cc = this._c.createFramebuffer(i.width, i.height, 1), this.xc = [this._c.createFramebuffer(i.width, i.height, 1, { depth: !1 }), this._c.createFramebuffer(i.width, i.height, 1, { depth: !1 })], this.Fc = !1, this.yc.Hr(() => {
3127
3127
  var r, s, h;
3128
- this.yc.resize(this._c.cols, this._c.rows), this.wc.resize(this._c.width, this._c.height), (r = this.bc) == null || r.resize(this._c.width, this._c.height), (s = this.Cc) == null || s[0].resize(this._c.width, this._c.height), (h = this.Cc) == null || h[1].resize(this._c.width, this._c.height);
3128
+ this.wc.resize(this.yc.cols, this.yc.rows), this.bc.resize(this.yc.width, this.yc.height), (r = this.Cc) == null || r.resize(this.yc.width, this.yc.height), (s = this.xc) == null || s[0].resize(this.yc.width, this.yc.height), (h = this.xc) == null || h[1].resize(this.yc.width, this.yc.height);
3129
3129
  });
3130
3130
  }
3131
- Pc() {
3132
- return this.xc !== null;
3131
+ Tc() {
3132
+ return this.Mc !== null;
3133
3133
  }
3134
- Tc(t) {
3135
- this.xc && this.xc.call(t);
3134
+ Ec(t) {
3135
+ this.Mc && this.Mc.call(t);
3136
3136
  }
3137
3137
  draw(t) {
3138
- this.xc = t;
3138
+ this.Mc = t;
3139
3139
  }
3140
3140
  show() {
3141
- this.cc = !0;
3141
+ this.lc = !0;
3142
3142
  }
3143
3143
  hide() {
3144
- this.cc = !1;
3144
+ this.lc = !1;
3145
3145
  }
3146
3146
  opacity(t) {
3147
- if (t === void 0) return this.nc;
3148
- this.nc = Math.min(1, Math.max(0, t));
3147
+ if (t === void 0) return this.oc;
3148
+ this.oc = Math.min(1, Math.max(0, t));
3149
3149
  }
3150
3150
  blendMode(t) {
3151
- if (t === void 0) return this.lc;
3152
- this.lc = t;
3151
+ if (t === void 0) return this.uc;
3152
+ this.uc = t;
3153
3153
  }
3154
3154
  offset(t, e = 0) {
3155
- if (t === void 0) return { x: this.uc, y: this.fc };
3156
- this.uc = t, this.fc = e;
3155
+ if (t === void 0) return { x: this.fc, y: this.dc };
3156
+ this.fc = t, this.dc = e;
3157
3157
  }
3158
3158
  rotateZ(t) {
3159
- if (t === void 0) return this.dc;
3160
- this.dc = t;
3159
+ if (t === void 0) return this.vc;
3160
+ this.vc = t;
3161
3161
  }
3162
3162
  filter(t, e) {
3163
- this.Fc.push({ name: t, params: e });
3163
+ this.$c.push({ name: t, params: e });
3164
3164
  }
3165
3165
  fontSize(t) {
3166
3166
  if (t === void 0) return this.nr.fontSize;
3167
- this.nr.Mr(t), this.Ec();
3167
+ this.nr.Mr(t), this.Rc();
3168
3168
  }
3169
3169
  async loadFont(t) {
3170
3170
  if (!this.nr) throw Error("Layer font not initialized. Ensure layer is attached before loading fonts.");
3171
- return t instanceof et ? (this.nr = t, this.nr.Tr || await this.nr.wr()) : await this.nr.Fr(t), this.Ec(), this.nr;
3171
+ return t instanceof et ? (this.nr = t, this.nr.Tr || await this.nr.wr()) : await this.nr.Fr(t), this.Rc(), this.nr;
3172
3172
  }
3173
3173
  ca(t, e, i) {
3174
3174
  const r = i == null ? void 0 : i.fallbackDraw;
3175
- if (!this.cc) return void (this.Mc = !1);
3176
- if (!this.xc && !r) return void (this.Mc = !1);
3177
- const s = this.mc.renderer;
3178
- this.yc.begin(), s.state.qt(), t.dn = this.nr, t.Rc = this._c;
3175
+ if (!this.lc) return void (this.Fc = !1);
3176
+ if (!this.Mc && !r) return void (this.Fc = !1);
3177
+ const s = this._c.renderer;
3178
+ this.wc.begin(), s.state.qt(), t.dn = this.nr, t.Sc = this.yc;
3179
3179
  try {
3180
- this.xc ? this.xc.call(t) : r == null || r();
3180
+ this.Mc ? this.Mc.call(t) : r == null || r();
3181
3181
  } finally {
3182
- t.dn = void 0, t.Rc = void 0;
3182
+ t.dn = void 0, t.Sc = void 0;
3183
3183
  }
3184
- this.yc.end();
3185
- const h = this.Fc.length > 0, o = h ? this.bc : this.wc;
3184
+ this.wc.end();
3185
+ const h = this.$c.length > 0, o = h ? this.Cc : this.bc;
3186
3186
  o.begin(), s.ve(e);
3187
- const c = this._c;
3188
- e.O({ u_characterTexture: this.nr.fontFramebuffer, u_charsetDimensions: [this.nr.textureColumns, this.nr.textureRows], Ul: this.yc.textures[0], Um: this.yc.textures[1], Un: this.yc.textures[2], Uo: [c.cols, c.rows], Up: [o.width, o.height], Uq: [0, 0, 0, 0] }), s.we(0, 0, c.width, c.height), o.end(), h && this.mc.filterManager.Sc(this.bc.textures[0], this.wc, this.Fc, this.wc.width, this.wc.height, this.Cc), this.Fc = [], this.Mc = !0;
3187
+ const c = this.yc;
3188
+ e.O({ u_characterTexture: this.nr.fontFramebuffer, u_charsetDimensions: [this.nr.textureColumns, this.nr.textureRows], Ud: this.wc.textures[0], Ue: this.wc.textures[1], Uf: this.wc.textures[2], Ug: [c.cols, c.rows], Uh: [o.width, o.height], Ui: [0, 0, 0, 0] }), s.we(0, 0, c.width, c.height), o.end(), h && this._c.filterManager.zc(this.Cc.textures[0], this.bc, this.$c, this.bc.width, this.bc.height, this.xc), this.$c = [], this.Fc = !0;
3189
3189
  }
3190
3190
  Jr() {
3191
3191
  var t;
3192
- this.yc && this.wc && ((t = this._c) == null || t.ti());
3192
+ this.wc && this.bc && ((t = this.yc) == null || t.ti());
3193
3193
  }
3194
3194
  gt() {
3195
3195
  var t, e, i, r, s, h, o;
3196
- (t = this.yc) == null || t.gt(), (e = this.wc) == null || e.gt(), (i = this.bc) == null || i.gt(), (r = this.Cc) == null || r[0].gt(), (s = this.Cc) == null || s[1].gt(), (h = this.nr) == null || h.gt(), (o = this._c) == null || o.gt();
3196
+ (t = this.wc) == null || t.gt(), (e = this.bc) == null || e.gt(), (i = this.Cc) == null || i.gt(), (r = this.xc) == null || r[0].gt(), (s = this.xc) == null || s[1].gt(), (h = this.nr) == null || h.gt(), (o = this.yc) == null || o.gt();
3197
3197
  }
3198
3198
  get texture() {
3199
3199
  var t;
3200
- return (t = this.wc) == null ? void 0 : t.textures[0];
3200
+ return (t = this.bc) == null ? void 0 : t.textures[0];
3201
3201
  }
3202
3202
  get grid() {
3203
- return this._c;
3203
+ return this.yc;
3204
3204
  }
3205
3205
  get font() {
3206
3206
  if (!this.nr) throw Error("Layer font not initialized. Ensure font is set before accessing.");
3207
3207
  return this.nr;
3208
3208
  }
3209
3209
  get width() {
3210
- return this.wc ? this.wc.width : 0;
3210
+ return this.bc ? this.bc.width : 0;
3211
3211
  }
3212
3212
  get height() {
3213
- return this.wc ? this.wc.height : 0;
3213
+ return this.bc ? this.bc.height : 0;
3214
3214
  }
3215
- get zc() {
3216
- return this.Mc;
3215
+ get kc() {
3216
+ return this.Fc;
3217
3217
  }
3218
3218
  get drawFramebuffer() {
3219
- return this.yc;
3219
+ return this.wc;
3220
3220
  }
3221
3221
  get asciiFramebuffer() {
3222
- return this.wc;
3222
+ return this.bc;
3223
3223
  }
3224
- Ec() {
3225
- if (!this._c || !this.nr) return;
3224
+ Rc() {
3225
+ if (!this.yc || !this.nr) return;
3226
3226
  const t = this.nr.maxGlyphDimensions;
3227
- this._c.Qr(t.width, t.height), this.yc && this.wc && this.Jr();
3227
+ this.yc.Qr(t.width, t.height), this.wc && this.bc && this.Jr();
3228
3228
  }
3229
3229
  }
3230
- const We = { message: "LOADING...", tone: "auto", transition: "fade", transitionDuration: 500 };
3230
+ const qe = { message: "LOADING...", tone: "auto", transition: "fade", transitionDuration: 500 };
3231
3231
  class Yt {
3232
3232
  constructor(t, e, i) {
3233
3233
  a(this, "fa");
3234
3234
  a(this, "l");
3235
- a(this, "kc");
3236
- a(this, "hc");
3237
3235
  a(this, "Dc");
3236
+ a(this, "ac");
3238
3237
  a(this, "Lc");
3239
3238
  a(this, "Oc");
3240
3239
  a(this, "Bc");
3241
- a(this, "Ic", []);
3242
- a(this, "Hc");
3243
- a(this, "Gc", performance.now());
3244
- a(this, "Qc", 0);
3245
- a(this, "Nc", !1);
3240
+ a(this, "Ic");
3241
+ a(this, "Hc", []);
3242
+ a(this, "Gc");
3243
+ a(this, "Qc", performance.now());
3244
+ a(this, "Nc", 0);
3245
+ a(this, "Xc", !1);
3246
3246
  a(this, "Ar", !1);
3247
- a(this, "Wc");
3248
- this.fa = t, this.l = { ...We, ...e ?? {} }, this.kc = new Dt("active"), this.hc = new It(), this.Dc = new Ot(this.l.transition, this.l.transitionDuration), this.Lc = new Ut(60), this.Hc = gt(this.l, i);
3249
- const r = Xt(this.Hc);
3250
- this.Ic = Zt(r, this.fa), this.Bc = this.Xc(), this.hc.za((s) => {
3251
- s >= 0.999 && this.Wa();
3247
+ a(this, "Zc");
3248
+ this.fa = t, this.l = { ...qe, ...e ?? {} }, this.Dc = new Ot("active"), this.ac = new _t(), this.Lc = new Zt(this.l.transition, this.l.transitionDuration), this.Oc = new Ut(60), this.Gc = gt(this.l, i);
3249
+ const r = It(this.Gc);
3250
+ this.Hc = Xt(r, this.fa), this.Ic = this.Yc(), this.ac.ka((s) => {
3251
+ s >= 0.999 && this.Za();
3252
3252
  });
3253
3253
  }
3254
3254
  async wr() {
3255
3255
  if (this.Ar) return;
3256
- const t = this.fa.Z, e = this.fa.kr, i = this.fa.Yc;
3257
- this.Oc = new it(t, { visible: !0, opacity: 1, fontSize: 16 }), await this.Oc.$c({ renderer: t, canvas: e, filterManager: i, createFramebuffer: (r, s, h = 1, o) => t.Pe(r, s, h, o) }), this.Ar = !0;
3256
+ const t = this.fa.Z, e = this.fa.kr, i = this.fa.jc;
3257
+ this.Bc = new it(t, { visible: !0, opacity: 1, fontSize: 16 }), await this.Bc.Pc({ renderer: t, canvas: e, filterManager: i, createFramebuffer: (r, s, h = 1, o) => t.Pe(r, s, h, o) }), this.Ar = !0;
3258
3258
  }
3259
- get Xa() {
3260
- return this.kc.Xa && this.Nc;
3259
+ get Ya() {
3260
+ return this.Dc.Ya && this.Xc;
3261
3261
  }
3262
3262
  In() {
3263
- this.Nc || (this.Nc = !0, this.Gc = performance.now(), this.Qc = 0, this.Lc.In(() => this.jc()));
3263
+ this.Xc || (this.Xc = !0, this.Qc = performance.now(), this.Nc = 0, this.Oc.In(() => this.Kc()));
3264
3264
  }
3265
3265
  Hn() {
3266
- this.Nc && (this.Nc = !1, this.Lc.Hn());
3266
+ this.Xc && (this.Xc = !1, this.Oc.Hn());
3267
3267
  }
3268
3268
  Jr() {
3269
- this.Ar && this.Oc.Jr();
3269
+ this.Ar && this.Bc.Jr();
3270
3270
  }
3271
3271
  gt() {
3272
- this.Hn(), this.Ar && (this.Oc.gt(), this.Ar = !1);
3272
+ this.Hn(), this.Ar && (this.Bc.gt(), this.Ar = !1);
3273
3273
  }
3274
3274
  get progress() {
3275
- return this.hc.Sa;
3275
+ return this.ac.za;
3276
3276
  }
3277
3277
  message(t) {
3278
3278
  return typeof t == "string" && (this.l.message = t), this.l.message;
3279
3279
  }
3280
3280
  addPhase(t, e = 1) {
3281
- this.kc.Ka();
3282
- const i = this.hc.ka(t, e);
3283
- return new kt(this.hc, i, t, (r) => this.error(r));
3281
+ this.Dc.Wa();
3282
+ const i = this.ac.Da(t, e);
3283
+ return new zt(this.ac, i, t, (r) => this.error(r));
3284
3284
  }
3285
- Wa() {
3286
- this.kc.Qa !== "error" && (this.l.transition !== "none" && this.l.transitionDuration > 0 ? (this.kc.Za(), this.Dc.In()) : (this.kc.Wa(), this.Hn(), this.Kc()));
3285
+ Za() {
3286
+ this.Dc.Na !== "error" && (this.l.transition !== "none" && this.l.transitionDuration > 0 ? (this.Dc.qa(), this.Lc.In()) : (this.Dc.Za(), this.Hn(), this.Wc()));
3287
3287
  }
3288
- Kc() {
3289
- this.Wc && this.Wc();
3288
+ Wc() {
3289
+ this.Zc && this.Zc();
3290
3290
  }
3291
- Zc(t) {
3292
- this.Wc = t;
3291
+ qc(t) {
3292
+ this.Zc = t;
3293
3293
  }
3294
3294
  error(t) {
3295
- this.kc.Va(t);
3295
+ this.Dc.Ja(t);
3296
3296
  }
3297
- jc() {
3298
- if (this.kc.Xa) {
3299
- if (this.Qc++, this.kc.Qa === "transitioning" && this.Dc.et())
3300
- return this.kc.qa(), this.Kc(), void this.Hn();
3301
- this.qc();
3297
+ Kc() {
3298
+ if (this.Dc.Ya) {
3299
+ if (this.Nc++, this.Dc.Na === "transitioning" && this.Lc.et())
3300
+ return this.Dc.Va(), this.Wc(), void this.Hn();
3301
+ this.Vc();
3302
3302
  }
3303
3303
  }
3304
- qc() {
3304
+ Vc() {
3305
3305
  if (!this.Ar) return;
3306
- const t = this.Oc, e = t.grid, i = this.fa.Z, r = this.fa.Vc, s = this.fa.Jc, h = { textmodifier: this.fa, grid: e, progress: this.progress, elapsedMs: performance.now() - this.Gc, frameCount: this.Qc, message: this.l.message, palette: this.Ic, theme: this.Hc, phases: this.hc.Ba(), transitionOpacity: this.Dc.nc, isError: this.kc.Qa === "error", errorMessage: this.kc.Ya || void 0, errorDetails: this.kc.ja || void 0 };
3306
+ const t = this.Bc, e = t.grid, i = this.fa.Z, r = this.fa.Jc, s = this.fa.tl, h = { textmodifier: this.fa, grid: e, progress: this.progress, elapsedMs: performance.now() - this.Qc, frameCount: this.Nc, message: this.l.message, palette: this.Hc, theme: this.Gc, phases: this.ac.Ia(), transitionOpacity: this.Lc.oc, isError: this.Dc.Na === "error", errorMessage: this.Dc.ja || void 0, errorDetails: this.Dc.Ka || void 0 };
3307
3307
  t.draw(() => {
3308
3308
  this.fa.clear(), this.fa.push();
3309
3309
  try {
3310
- this.Bc(h);
3310
+ this.Ic(h);
3311
3311
  } finally {
3312
3312
  this.fa.pop();
3313
3313
  }
@@ -3315,172 +3315,172 @@ class Yt {
3315
3315
  const o = t.texture;
3316
3316
  o && (i.wi(...i.state.canvasBackgroundColor), i.ve(s), s.O({ u_texture: o }), i.we(e.offsetX, e.offsetY, e.width, e.height));
3317
3317
  }
3318
- tl(t) {
3319
- this.Hc = gt(this.l, t);
3318
+ sl(t) {
3319
+ this.Gc = gt(this.l, t);
3320
3320
  }
3321
- Xc() {
3322
- const t = this.l.renderer || He;
3321
+ Yc() {
3322
+ const t = this.l.renderer || Ge;
3323
3323
  return (e) => {
3324
- t(e), this.sl(e);
3324
+ t(e), this.il(e);
3325
3325
  };
3326
3326
  }
3327
- sl(t) {
3327
+ il(t) {
3328
3328
  const { textmodifier: e, grid: i, frameCount: r, theme: s, transitionOpacity: h } = t, o = [116, 101, 120, 116, 109, 111, 100, 101, 46, 106, 115].map((f) => String.fromCharCode(f)).join(""), c = (i.rows + 1 >> 1) - 2, l = 2 - (i.cols + 1 >> 1), u = s.mode === "light" ? [[233, 30, 99], [156, 39, 176], [255, 111, 0]] : [[142, 249, 243], [241, 91, 181], [255, 155, 113]];
3329
3329
  e.push(), e.translate(l, c, 0);
3330
3330
  for (let f = 0; f < o.length; f++) {
3331
- const d = o[f], g = Math.floor(0.1 * r + 0.5 * f) % u.length, [p, v, A] = u[g], m = Math.floor(255 * h), E = e.color(p, v, A, m);
3332
- e.charColor(E), e.char(d), e.point(), e.translateX(1);
3331
+ const d = o[f], g = Math.floor(0.1 * r + 0.5 * f) % u.length, [p, v, A] = u[g], m = Math.floor(255 * h), w = e.color(p, v, A, m);
3332
+ e.charColor(w), e.char(d), e.point(), e.translateX(1);
3333
3333
  }
3334
3334
  e.pop();
3335
3335
  }
3336
3336
  }
3337
3337
  const bt = { normal: 0, additive: 1, multiply: 2, screen: 3, subtract: 4, darken: 5, lighten: 6, overlay: 7, softLight: 8, hardLight: 9, colorDodge: 10, colorBurn: 11, difference: 12, exclusion: 13 };
3338
- class zt {
3338
+ class kt {
3339
3339
  constructor(t, e, i) {
3340
3340
  a(this, "Z");
3341
- a(this, "il");
3342
- a(this, "Cc");
3343
- a(this, "el", 0);
3344
- this.Z = t, this.il = t.pe(j, `#version 300 es
3345
- precision highp float;uniform sampler2D Ud;uniform sampler2D Ue;uniform vec2 Uf;uniform vec2 Ug;uniform vec2 Uh;uniform float Ui;uniform float Uj;uniform int Uk;in vec2 v_uv;out vec4 fragColor;const int A=0;const int B=1;const int C=2;const int D=3;const int E=4;const int F=5;const int G=6;const int H=7;const int I=8;const int J=9;const int K=10;const int L=11;const int M=12;const int N=13;vec3 O(vec3 P,vec3 Q){return Q;}vec3 R(vec3 P,vec3 Q){return P+Q;}vec3 S(vec3 P,vec3 Q){return P*Q;}vec3 T(vec3 P,vec3 Q){return 1.-(1.-P)*(1.-Q);}vec3 U(vec3 P,vec3 Q){return max(P-Q,0.);}vec3 V(vec3 P,vec3 Q){return min(P,Q);}vec3 W(vec3 P,vec3 Q){return max(P,Q);}vec3 X(vec3 P,vec3 Q){return mix(2.*P*Q,1.-2.*(1.-P)*(1.-Q),step(0.5,P));}vec3 Y(vec3 P,vec3 Q){return mix(P-(1.-2.*Q)*P*(1.-P),mix(P+(2.*Q-1.)*(P*(3.-2.*P)-P),P+(2.*Q-1.)*(sqrt(P)-P),step(0.25,P)),step(0.5,Q));}vec3 Z(vec3 P,vec3 Q){return mix(2.*P*Q,1.-2.*(1.-P)*(1.-Q),step(0.5,Q));}vec3 a(vec3 P,vec3 Q){return mix(min(vec3(1.),P/max(1.-Q,0.0001)),vec3(1.),step(1.,Q));}vec3 b(vec3 P,vec3 Q){return mix(1.-min(vec3(1.),(1.-P)/max(Q,0.0001)),vec3(0.),step(Q,vec3(0.)));}vec3 c(vec3 P,vec3 Q){return abs(P-Q);}vec3 d(vec3 P,vec3 Q){return P+Q-2.*P*Q;}vec3 e(int f,vec3 P,vec3 Q){if(f==A)return O(P,Q);if(f==B)return R(P,Q);if(f==C)return S(P,Q);if(f==D)return T(P,Q);if(f==E)return U(P,Q);if(f==F)return V(P,Q);if(f==G)return W(P,Q);if(f==H)return X(P,Q);if(f==I)return Y(P,Q);if(f==J)return Z(P,Q);if(f==K)return a(P,Q);if(f==L)return b(P,Q);if(f==M)return c(P,Q);if(f==N)return d(P,Q);return O(P,Q);}void main(){vec4 g=texture(Ue,v_uv);vec2 h=v_uv*Uf;vec2 i=h-Uh;vec2 j=Ug*0.5;vec2 k=i-j;float l=cos(-Uj);float m=sin(-Uj);vec2 n=vec2(k.x*l-k.y*m,k.x*m+k.y*l);i=n+j;bool o=any(lessThan(i,vec2(0.)))||any(greaterThanEqual(i,Ug));if(o){fragColor=g;return;}vec2 p=(floor(i)+0.5)/Ug;vec4 q=texture(Ud,p);float r=q.a*Ui;if(r<=0.){fragColor=g;return;}vec3 s=e(Uk,g.rgb,q.rgb);vec3 t=mix(g.rgb,s,r);float u=g.a+r*(1.-g.a);fragColor=vec4(t,u);}`), this.Cc = [this.Z.Pe(e, i, 1), this.Z.Pe(e, i, 1)];
3341
+ a(this, "el");
3342
+ a(this, "xc");
3343
+ a(this, "rl", 0);
3344
+ this.Z = t, this.el = t.pe(V, `#version 300 es
3345
+ precision highp float;uniform sampler2D Uj;uniform sampler2D Uk;uniform vec2 Ul;uniform vec2 Um;uniform vec2 Un;uniform float Uo;uniform float Up;uniform int Uq;in vec2 v_uv;out vec4 fragColor;const int A=0;const int B=1;const int C=2;const int D=3;const int E=4;const int F=5;const int G=6;const int H=7;const int I=8;const int J=9;const int K=10;const int L=11;const int M=12;const int N=13;vec3 O(vec3 P,vec3 Q){return Q;}vec3 R(vec3 P,vec3 Q){return P+Q;}vec3 S(vec3 P,vec3 Q){return P*Q;}vec3 T(vec3 P,vec3 Q){return 1.-(1.-P)*(1.-Q);}vec3 U(vec3 P,vec3 Q){return max(P-Q,0.);}vec3 V(vec3 P,vec3 Q){return min(P,Q);}vec3 W(vec3 P,vec3 Q){return max(P,Q);}vec3 X(vec3 P,vec3 Q){return mix(2.*P*Q,1.-2.*(1.-P)*(1.-Q),step(0.5,P));}vec3 Y(vec3 P,vec3 Q){return mix(P-(1.-2.*Q)*P*(1.-P),mix(P+(2.*Q-1.)*(P*(3.-2.*P)-P),P+(2.*Q-1.)*(sqrt(P)-P),step(0.25,P)),step(0.5,Q));}vec3 Z(vec3 P,vec3 Q){return mix(2.*P*Q,1.-2.*(1.-P)*(1.-Q),step(0.5,Q));}vec3 a(vec3 P,vec3 Q){return mix(min(vec3(1.),P/max(1.-Q,0.0001)),vec3(1.),step(1.,Q));}vec3 b(vec3 P,vec3 Q){return mix(1.-min(vec3(1.),(1.-P)/max(Q,0.0001)),vec3(0.),step(Q,vec3(0.)));}vec3 c(vec3 P,vec3 Q){return abs(P-Q);}vec3 d(vec3 P,vec3 Q){return P+Q-2.*P*Q;}vec3 e(int f,vec3 P,vec3 Q){if(f==A)return O(P,Q);if(f==B)return R(P,Q);if(f==C)return S(P,Q);if(f==D)return T(P,Q);if(f==E)return U(P,Q);if(f==F)return V(P,Q);if(f==G)return W(P,Q);if(f==H)return X(P,Q);if(f==I)return Y(P,Q);if(f==J)return Z(P,Q);if(f==K)return a(P,Q);if(f==L)return b(P,Q);if(f==M)return c(P,Q);if(f==N)return d(P,Q);return O(P,Q);}void main(){vec4 g=texture(Uk,v_uv);vec2 h=v_uv*Ul;vec2 i=h-Un;vec2 j=Um*0.5;vec2 k=i-j;float l=cos(-Up);float m=sin(-Up);vec2 n=vec2(k.x*l-k.y*m,k.x*m+k.y*l);i=n+j;bool o=any(lessThan(i,vec2(0.)))||any(greaterThanEqual(i,Um));if(o){fragColor=g;return;}vec2 p=(floor(i)+0.5)/Um;vec4 q=texture(Uj,p);float r=q.a*Uo;if(r<=0.){fragColor=g;return;}vec3 s=e(Uq,g.rgb,q.rgb);vec3 t=mix(g.rgb,s,r);float u=g.a+r*(1.-g.a);fragColor=vec4(t,u);}`), this.xc = [this.Z.Pe(e, i, 1), this.Z.Pe(e, i, 1)];
3346
3346
  }
3347
- rl(t) {
3347
+ nl(t) {
3348
3348
  const e = this.Z.context, { base: i, targetFramebuffer: r, backgroundColor: s, layers: h, canvasWidth: o, canvasHeight: c } = t, l = e.isEnabled(e.DEPTH_TEST), u = e.getParameter(e.DEPTH_WRITEMASK);
3349
3349
  l && e.disable(e.DEPTH_TEST), u && e.depthMask(!1);
3350
- const f = this.Cc[0];
3351
- f.begin(), this.Z.wi(...s), f.end(), this.el = 0, i.layer.cc && this.nl(i.texture, o, c, i.width, i.height, i.layer.nc, i.offsetX, i.offsetY, i.layer.dc, "normal", e);
3350
+ const f = this.xc[0];
3351
+ f.begin(), this.Z.wi(...s), f.end(), this.rl = 0, i.layer.lc && this.ol(i.texture, o, c, i.width, i.height, i.layer.oc, i.offsetX, i.offsetY, i.layer.vc, "normal", e);
3352
3352
  for (const d of h) {
3353
3353
  const g = d.layer;
3354
- g.cc && g.zc && this.nl(d.texture, o, c, d.width, d.height, g.nc, d.offsetX, d.offsetY, g.dc, g.lc, e);
3354
+ g.lc && g.kc && this.ol(d.texture, o, c, d.width, d.height, g.oc, d.offsetX, d.offsetY, g.vc, g.uc, e);
3355
3355
  }
3356
- this.ol(r, o, c, e), e.depthMask(u), l && e.enable(e.DEPTH_TEST);
3356
+ this.hl(r, o, c, e), e.depthMask(u), l && e.enable(e.DEPTH_TEST);
3357
3357
  }
3358
- nl(t, e, i, r, s, h, o, c, l, u, f) {
3359
- const d = this.Cc[this.el], g = this.el === 0 ? 1 : 0, p = this.Cc[g], v = l * (Math.PI / 180);
3360
- p.begin(), f.disable(f.BLEND), this.Z.ve(this.il), this.il.O({ Ud: t, Ue: d.textures[0], Uf: [e, i], Ug: [r, s], Uh: [o, c], Ui: h, Uj: v, Uk: bt[u] }), this.Z.we(0, 0, d.width, d.height), p.end(), this.el = g;
3358
+ ol(t, e, i, r, s, h, o, c, l, u, f) {
3359
+ const d = this.xc[this.rl], g = this.rl === 0 ? 1 : 0, p = this.xc[g], v = l * (Math.PI / 180);
3360
+ p.begin(), f.disable(f.BLEND), this.Z.ve(this.el), this.el.O({ Uj: t, Uk: d.textures[0], Ul: [e, i], Um: [r, s], Un: [o, c], Uo: h, Up: v, Uq: bt[u] }), this.Z.we(0, 0, d.width, d.height), p.end(), this.rl = g;
3361
3361
  }
3362
- ol(t, e, i, r) {
3363
- const s = this.Cc[this.el];
3364
- t.begin(), r.disable(r.BLEND), this.Z.ve(this.il), this.il.O({ Ud: s.textures[0], Ue: s.textures[0], Uf: [e, i], Ug: [s.width, s.height], Uh: [0, 0], Ui: 1, Uj: 0, Uk: bt.normal }), this.Z.we(0, 0, e, i), t.end();
3362
+ hl(t, e, i, r) {
3363
+ const s = this.xc[this.rl];
3364
+ t.begin(), r.disable(r.BLEND), this.Z.ve(this.el), this.el.O({ Uj: s.textures[0], Uk: s.textures[0], Ul: [e, i], Um: [s.width, s.height], Un: [0, 0], Uo: 1, Up: 0, Uq: bt.normal }), this.Z.we(0, 0, e, i), t.end();
3365
3365
  }
3366
3366
  Jr(t, e) {
3367
- this.Cc[0].resize(t, e), this.Cc[1].resize(t, e);
3367
+ this.xc[0].resize(t, e), this.xc[1].resize(t, e);
3368
3368
  }
3369
3369
  gt() {
3370
- this.il.dispose(), this.Cc[0].gt(), this.Cc[1].gt();
3370
+ this.el.dispose(), this.xc[0].gt(), this.xc[1].gt();
3371
3371
  }
3372
3372
  }
3373
- class Gt {
3373
+ class Ht {
3374
3374
  constructor(t, e) {
3375
3375
  a(this, "fa");
3376
3376
  a(this, "Z");
3377
- a(this, "hl");
3378
3377
  a(this, "al");
3379
- a(this, "cl", []);
3378
+ a(this, "cl");
3380
3379
  a(this, "ll", []);
3381
- a(this, "ul");
3382
- a(this, "fl", !1);
3383
- a(this, "dl", /* @__PURE__ */ new Set());
3384
- this.fa = t, this.Z = t.Z, this.hl = t.Vc, this.al = new zt(this.Z, this.fa.kr.width, this.fa.kr.height), this.ul = new it(this.Z, { visible: !0, opacity: 1, fontSize: e.fontSize, fontSource: e.fontSource });
3380
+ a(this, "ul", []);
3381
+ a(this, "fl");
3382
+ a(this, "dl", !1);
3383
+ a(this, "vl", /* @__PURE__ */ new Set());
3384
+ this.fa = t, this.Z = t.Z, this.al = t.Jc, this.cl = new kt(this.Z, this.fa.kr.width, this.fa.kr.height), this.fl = new it(this.Z, { visible: !0, opacity: 1, fontSize: e.fontSize, fontSource: e.fontSource });
3385
3385
  }
3386
3386
  async wr() {
3387
- if (!this.fl) {
3388
- await this.vl(this.ul);
3389
- for (const t of this.cl) await this.vl(t), this.ll.push(t);
3390
- this.cl = [], this.fl = !0;
3387
+ if (!this.dl) {
3388
+ await this.pl(this.fl);
3389
+ for (const t of this.ll) await this.pl(t), this.ul.push(t);
3390
+ this.ll = [], this.dl = !0;
3391
3391
  }
3392
3392
  }
3393
3393
  add(t = {}) {
3394
3394
  const e = new it(this.Z, t);
3395
- return this.fl ? (this.vl(e), this.ll.push(e)) : this.cl.push(e), e;
3395
+ return this.dl ? (this.pl(e), this.ul.push(e)) : this.ll.push(e), e;
3396
3396
  }
3397
3397
  remove(t) {
3398
- this.pl(this.ll, t) || this.pl(this.cl, t);
3398
+ this.ml(this.ul, t) || this.ml(this.ll, t);
3399
3399
  }
3400
3400
  move(t, e) {
3401
- this.ml(this.ll, t, e) || this.ml(this.cl, t, e);
3401
+ this._l(this.ul, t, e) || this._l(this.ll, t, e);
3402
3402
  }
3403
3403
  swap(t, e) {
3404
- t !== e && (this._l(this.ll, t, e) || this._l(this.cl, t, e));
3404
+ t !== e && (this.yl(this.ul, t, e) || this.yl(this.ll, t, e));
3405
3405
  }
3406
3406
  clear() {
3407
- this.ul.gt(), this.ll.forEach((t) => t.gt()), this.ll = [], this.cl.forEach((t) => t.gt()), this.cl = [];
3407
+ this.fl.gt(), this.ul.forEach((t) => t.gt()), this.ul = [], this.ll.forEach((t) => t.gt()), this.ll = [];
3408
3408
  }
3409
- yl(t, e) {
3410
- this.ul.ca(this.fa, this.hl, { fallbackDraw: e });
3409
+ Al(t, e) {
3410
+ this.fl.ca(this.fa, this.al, { fallbackDraw: e });
3411
3411
  const i = [...this.Z.state.canvasBackgroundColor];
3412
- this.Al(), this.wl(t, i);
3412
+ this.wl(), this.bl(t, i);
3413
3413
  }
3414
- Al() {
3415
- this.ll.length !== 0 && this.ll.forEach((t) => t.ca(this.fa, this.hl));
3414
+ wl() {
3415
+ this.ul.length !== 0 && this.ul.forEach((t) => t.ca(this.fa, this.al));
3416
3416
  }
3417
- wl(t, e) {
3418
- const i = this.fa.kr, r = this.ul.grid, s = this.ul.texture;
3417
+ bl(t, e) {
3418
+ const i = this.fa.kr, r = this.fl.grid, s = this.fl.texture;
3419
3419
  if (!s) return;
3420
- const h = { layer: this.ul, texture: s, width: r.width, height: r.height, offsetX: r.offsetX + this.ul.uc, offsetY: r.offsetY + this.ul.fc }, o = this.ll.map((c) => {
3420
+ const h = { layer: this.fl, texture: s, width: r.width, height: r.height, offsetX: r.offsetX + this.fl.fc, offsetY: r.offsetY + this.fl.dc }, o = this.ul.map((c) => {
3421
3421
  const l = c.grid;
3422
- return { layer: c, texture: c.texture, width: l.width, height: l.height, offsetX: l.offsetX + c.uc, offsetY: l.offsetY + c.fc };
3422
+ return { layer: c, texture: c.texture, width: l.width, height: l.height, offsetX: l.offsetX + c.fc, offsetY: l.offsetY + c.dc };
3423
3423
  });
3424
- this.al.rl({ base: h, layers: o, targetFramebuffer: t, backgroundColor: e, canvasWidth: i.width, canvasHeight: i.height });
3424
+ this.cl.nl({ base: h, layers: o, targetFramebuffer: t, backgroundColor: e, canvasWidth: i.width, canvasHeight: i.height });
3425
3425
  }
3426
3426
  Jr() {
3427
- this.fl && (this.ul.Jr(), this.ll.forEach((t) => t.Jr()), this.al.Jr(this.fa.kr.width, this.fa.kr.height));
3427
+ this.dl && (this.fl.Jr(), this.ul.forEach((t) => t.Jr()), this.cl.Jr(this.fa.kr.width, this.fa.kr.height));
3428
3428
  }
3429
3429
  gt() {
3430
- this.ll.forEach((t) => t.gt()), this.cl.forEach((t) => t.gt()), this.ul.gt(), this.al.gt();
3430
+ this.ul.forEach((t) => t.gt()), this.ll.forEach((t) => t.gt()), this.fl.gt(), this.cl.gt();
3431
3431
  }
3432
3432
  get all() {
3433
- return this.ll;
3433
+ return this.ul;
3434
3434
  }
3435
3435
  get base() {
3436
- return this.ul;
3436
+ return this.fl;
3437
3437
  }
3438
- bl() {
3439
- for (let t = this.ll.length - 1; t >= 0; t--) {
3440
- const e = this.ll[t];
3441
- if (e.cc && e.grid) return e.grid;
3438
+ Cl() {
3439
+ for (let t = this.ul.length - 1; t >= 0; t--) {
3440
+ const e = this.ul[t];
3441
+ if (e.lc && e.grid) return e.grid;
3442
3442
  }
3443
- return this.ul.grid;
3443
+ return this.fl.grid;
3444
3444
  }
3445
- Cl(t) {
3446
- this.dl.add(t);
3445
+ xl(t) {
3446
+ this.vl.add(t);
3447
3447
  }
3448
- xl() {
3449
- for (const t of this.dl) t();
3448
+ Ml() {
3449
+ for (const t of this.vl) t();
3450
3450
  }
3451
- async vl(t) {
3451
+ async pl(t) {
3452
3452
  var i;
3453
- const e = { renderer: this.Z, canvas: this.fa.kr, filterManager: this.fa.Yc, createFramebuffer: (r, s, h = 1, o) => this.Z.Pe(r, s, h, o) };
3454
- await t.$c(e), (i = t.grid) == null || i.Hr(() => this.xl());
3453
+ const e = { renderer: this.Z, canvas: this.fa.kr, filterManager: this.fa.jc, createFramebuffer: (r, s, h = 1, o) => this.Z.Pe(r, s, h, o) };
3454
+ await t.Pc(e), (i = t.grid) == null || i.Hr(() => this.Ml());
3455
3455
  }
3456
- pl(t, e) {
3456
+ ml(t, e) {
3457
3457
  const i = t.indexOf(e);
3458
3458
  if (i === -1) return !1;
3459
3459
  const [r] = t.splice(i, 1);
3460
3460
  return r.gt(), !0;
3461
3461
  }
3462
- ml(t, e, i) {
3462
+ _l(t, e, i) {
3463
3463
  const r = t.indexOf(e);
3464
3464
  if (r === -1) return !1;
3465
3465
  t.splice(r, 1);
3466
3466
  const s = Math.max(0, Math.min(t.length, i));
3467
3467
  return t.splice(s, 0, e), !0;
3468
3468
  }
3469
- _l(t, e, i) {
3469
+ yl(t, e, i) {
3470
3470
  const r = t.indexOf(e);
3471
3471
  if (r === -1) return !1;
3472
3472
  const s = t.indexOf(i);
3473
3473
  return s !== -1 && (t[r] = i, t[s] = e, !0);
3474
3474
  }
3475
3475
  }
3476
- class Ht {
3476
+ class Gt {
3477
3477
  constructor(t) {
3478
3478
  a(this, "Z");
3479
- a(this, "Ml", /* @__PURE__ */ new Map());
3480
3479
  a(this, "Fl", /* @__PURE__ */ new Map());
3481
- this.Z = t, this.$l();
3480
+ a(this, "$l", /* @__PURE__ */ new Map());
3481
+ this.Z = t, this.Pl();
3482
3482
  }
3483
- async Pl(t, e, i = {}) {
3483
+ async Tl(t, e, i = {}) {
3484
3484
  const r = Object.entries(i), s = r.length > 0 ? r[0][1][0] : null;
3485
3485
  let h;
3486
3486
  if (typeof e == "string") {
@@ -3490,8 +3490,8 @@ class Ht {
3490
3490
  if (!l.ok) throw Error(`Failed to load shader from ${e}: ${l.statusText}`);
3491
3491
  c = await l.text();
3492
3492
  }
3493
- h = this.Z.pe(j, c), this.Fl.set(t, h);
3494
- } else h = e, this.Fl.set(t, h);
3493
+ h = this.Z.pe(V, c), this.$l.set(t, h);
3494
+ } else h = e, this.$l.set(t, h);
3495
3495
  const o = { id: t, createShader: () => h, createUniforms: (c, l) => {
3496
3496
  const u = { u_resolution: [l.width, l.height] };
3497
3497
  for (const [f, [d, g]] of r) {
@@ -3500,147 +3500,147 @@ class Ht {
3500
3500
  }
3501
3501
  return u;
3502
3502
  } };
3503
- this.Ml.set(t, o);
3503
+ this.Fl.set(t, o);
3504
3504
  }
3505
- Tl(t) {
3506
- const e = this.Fl.get(t);
3507
- return e && (e.dispose(), this.Fl.delete(t)), this.Ml.delete(t);
3505
+ El(t) {
3506
+ const e = this.$l.get(t);
3507
+ return e && (e.dispose(), this.$l.delete(t)), this.Fl.delete(t);
3508
3508
  }
3509
3509
  Pn(t) {
3510
- return this.Ml.get(t);
3510
+ return this.Fl.get(t);
3511
3511
  }
3512
3512
  gt() {
3513
- for (const t of this.Fl.values()) t.dispose();
3514
- this.Fl.clear(), this.Ml.clear();
3513
+ for (const t of this.$l.values()) t.dispose();
3514
+ this.$l.clear(), this.Fl.clear();
3515
3515
  }
3516
- $l() {
3517
- this.Pl("invert", `#version 300 es
3518
- precision highp float;uniform sampler2D u_texture;in vec2 v_uv;out vec4 fragColor;void main(){vec4 A=texture(u_texture,v_uv);fragColor=vec4(1.-A.rgb,A.a);}`, {}), this.Pl("grayscale", `#version 300 es
3519
- precision highp float;uniform sampler2D u_texture;uniform float U8;in vec2 v_uv;out vec4 fragColor;void main(){vec4 A=texture(u_texture,v_uv);float B=dot(A.rgb,vec3(0.299,0.587,0.114));vec3 C=mix(A.rgb,vec3(B),U8);fragColor=vec4(C,A.a);}`, { U8: ["amount", 1] }), this.Pl("sepia", `#version 300 es
3520
- precision highp float;uniform sampler2D u_texture;uniform float U8;in vec2 v_uv;out vec4 fragColor;void main(){vec4 A=texture(u_texture,v_uv);vec3 B;B.r=dot(A.rgb,vec3(0.393,0.769,0.189));B.g=dot(A.rgb,vec3(0.349,0.686,0.168));B.b=dot(A.rgb,vec3(0.272,0.534,0.131));vec3 C=mix(A.rgb,B,U8);fragColor=vec4(C,A.a);}`, { U8: ["amount", 1] }), this.Pl("threshold", `#version 300 es
3521
- precision highp float;uniform sampler2D u_texture;uniform float Uc;in vec2 v_uv;out vec4 fragColor;void main(){vec4 A=texture(u_texture,v_uv);float B=dot(A.rgb,vec3(0.299,0.587,0.114));float C=step(Uc,B);fragColor=vec4(vec3(C),A.a);}`, { Uc: ["threshold", 0.5] });
3516
+ Pl() {
3517
+ this.Tl("invert", `#version 300 es
3518
+ precision highp float;uniform sampler2D u_texture;in vec2 v_uv;out vec4 fragColor;void main(){vec4 A=texture(u_texture,v_uv);fragColor=vec4(1.-A.rgb,A.a);}`, {}), this.Tl("grayscale", `#version 300 es
3519
+ precision highp float;uniform sampler2D u_texture;uniform float U0;in vec2 v_uv;out vec4 fragColor;void main(){vec4 A=texture(u_texture,v_uv);float B=dot(A.rgb,vec3(0.299,0.587,0.114));vec3 C=mix(A.rgb,vec3(B),U0);fragColor=vec4(C,A.a);}`, { U0: ["amount", 1] }), this.Tl("sepia", `#version 300 es
3520
+ precision highp float;uniform sampler2D u_texture;uniform float U0;in vec2 v_uv;out vec4 fragColor;void main(){vec4 A=texture(u_texture,v_uv);vec3 B;B.r=dot(A.rgb,vec3(0.393,0.769,0.189));B.g=dot(A.rgb,vec3(0.349,0.686,0.168));B.b=dot(A.rgb,vec3(0.272,0.534,0.131));vec3 C=mix(A.rgb,B,U0);fragColor=vec4(C,A.a);}`, { U0: ["amount", 1] }), this.Tl("threshold", `#version 300 es
3521
+ precision highp float;uniform sampler2D u_texture;uniform float U1;in vec2 v_uv;out vec4 fragColor;void main(){vec4 A=texture(u_texture,v_uv);float B=dot(A.rgb,vec3(0.299,0.587,0.114));float C=step(U1,B);fragColor=vec4(vec3(C),A.a);}`, { U1: ["threshold", 0.5] });
3522
3522
  }
3523
3523
  }
3524
- class Wt {
3524
+ class qt {
3525
3525
  constructor(t) {
3526
3526
  a(this, "Z");
3527
- a(this, "Fl", /* @__PURE__ */ new Map());
3527
+ a(this, "$l", /* @__PURE__ */ new Map());
3528
3528
  a(this, "J");
3529
- a(this, "Cc");
3529
+ a(this, "xc");
3530
3530
  a(this, "Ar", !1);
3531
- a(this, "El");
3532
- this.Z = t, this.El = new Ht(this.Z), this.J = t.pe(j, _t);
3531
+ a(this, "Rl");
3532
+ this.Z = t, this.Rl = new Gt(this.Z), this.J = t.pe(V, Dt);
3533
3533
  }
3534
3534
  async register(t, e, i = {}) {
3535
- await this.El.Pl(t, e, i);
3535
+ await this.Rl.Tl(t, e, i);
3536
3536
  }
3537
3537
  unregister(t) {
3538
- return this.El.Tl(t) ?? !1;
3538
+ return this.Rl.El(t) ?? !1;
3539
3539
  }
3540
3540
  has(t) {
3541
- return this.El.Pn(t) !== void 0;
3541
+ return this.Rl.Pn(t) !== void 0;
3542
3542
  }
3543
3543
  wr(t, e) {
3544
- this.Ar || (this.Cc = [this.Z.Pe(t, e, 1, { depth: !1 }), this.Z.Pe(t, e, 1, { depth: !1 })], this.Ar = !0);
3544
+ this.Ar || (this.xc = [this.Z.Pe(t, e, 1, { depth: !1 }), this.Z.Pe(t, e, 1, { depth: !1 })], this.Ar = !0);
3545
3545
  }
3546
- Rl(t, e, i, r, s) {
3547
- this.Cc[0].width === r && this.Cc[0].height === s || (this.Cc[0].resize(r, s), this.Cc[1].resize(r, s)), this.Sc(t, e, i, r, s, this.Cc);
3546
+ Sl(t, e, i, r, s) {
3547
+ this.xc[0].width === r && this.xc[0].height === s || (this.xc[0].resize(r, s), this.xc[1].resize(r, s)), this.zc(t, e, i, r, s, this.xc);
3548
3548
  }
3549
- Sc(t, e, i, r, s, h) {
3550
- if (i.length === 0) return void this.Sl(t, e, r, s);
3549
+ zc(t, e, i, r, s, h) {
3550
+ if (i.length === 0) return void this.zl(t, e, r, s);
3551
3551
  const o = this.Z.context, c = o.isEnabled(o.BLEND);
3552
- o.disable(o.BLEND), this.Sl(t, h[0], r, s);
3552
+ o.disable(o.BLEND), this.zl(t, h[0], r, s);
3553
3553
  let l = 0;
3554
3554
  for (let u = 0; u < i.length; u++) {
3555
3555
  const f = i[u], d = u === i.length - 1, g = l === 0 ? 1 : 0, p = d ? e : h[g];
3556
- this.zl(f, h[l], p, r, s), d || (l = g);
3556
+ this.kl(f, h[l], p, r, s), d || (l = g);
3557
3557
  }
3558
3558
  c && o.enable(o.BLEND);
3559
3559
  }
3560
- zl(t, e, i, r, s) {
3561
- const h = this.El.Pn(t.name);
3562
- if (!h) return console.warn(`[textmode.js] Unknown filter: "${t.name}". Skipping.`), void this.Sl(e.textures[0], i, r, s);
3563
- const o = this.kl(t.name, h, r, s), c = { renderer: this.Z, gl: this.Z.context, width: r, height: s };
3560
+ kl(t, e, i, r, s) {
3561
+ const h = this.Rl.Pn(t.name);
3562
+ if (!h) return console.warn(`[textmode.js] Unknown filter: "${t.name}". Skipping.`), void this.zl(e.textures[0], i, r, s);
3563
+ const o = this.Dl(t.name, h, r, s), c = { renderer: this.Z, gl: this.Z.context, width: r, height: s };
3564
3564
  i.begin(), this.Z.ve(o), o.O({ u_texture: e.textures[0] });
3565
3565
  const l = h.createUniforms(t.params, c);
3566
3566
  o.O(l), this.Z.we(0, 0, r, s), i.end();
3567
3567
  }
3568
- kl(t, e, i, r) {
3569
- let s = this.Fl.get(t);
3568
+ Dl(t, e, i, r) {
3569
+ let s = this.$l.get(t);
3570
3570
  if (!s && e) {
3571
3571
  const h = { renderer: this.Z, gl: this.Z.context, width: i, height: r };
3572
- s = e.createShader(h), this.Fl.set(t, s);
3572
+ s = e.createShader(h), this.$l.set(t, s);
3573
3573
  }
3574
3574
  return s;
3575
3575
  }
3576
- Sl(t, e, i, r) {
3576
+ zl(t, e, i, r) {
3577
3577
  e.begin(), this.Z.ve(this.J), this.J.O({ u_texture: t, u_resolution: [i, r] }), this.Z.we(0, 0, i, r), e.end();
3578
3578
  }
3579
3579
  Jr(t, e) {
3580
- this.Cc && (this.Cc[0].resize(t, e), this.Cc[1].resize(t, e));
3580
+ this.xc && (this.xc[0].resize(t, e), this.xc[1].resize(t, e));
3581
3581
  }
3582
3582
  gt() {
3583
- for (const t of this.Fl.values()) t.dispose();
3584
- this.Fl.clear(), this.J.dispose(), this.El.gt(), this.Cc && (this.Cc[0].gt(), this.Cc[1].gt()), this.Ar = !1;
3583
+ for (const t of this.$l.values()) t.dispose();
3584
+ this.$l.clear(), this.J.dispose(), this.Rl.gt(), this.xc && (this.xc[0].gt(), this.xc[1].gt()), this.Ar = !1;
3585
3585
  }
3586
3586
  }
3587
- const Qe = Object.freeze(Object.defineProperty({ __proto__: null, FilterRegistry: Ht, TextmodeFilterManager: Wt }, Symbol.toStringTag, { value: "Module" }));
3587
+ const Qe = Object.freeze(Object.defineProperty({ __proto__: null, FilterRegistry: Gt, TextmodeFilterManager: qt }, Symbol.toStringTag, { value: "Module" }));
3588
3588
  let lt = null;
3589
- const qe = { id: "brightness", createShader: ({ gl: n }) => (lt || (lt = new q(n, rt, `#version 300 es
3589
+ const We = { id: "brightness", createShader: ({ gl: n }) => (lt || (lt = new W(n, rt, `#version 300 es
3590
3590
  precision highp float;in vec2 v_uv;uniform sampler2D u_image;uniform bool u_invert;uniform bool u_flipX;uniform bool u_flipY;uniform float u_charRotation;uniform bool u_charColorFixed;uniform vec4 u_charColor;uniform bool u_cellColorFixed;uniform vec4 u_cellColor;uniform vec4 u_backgroundColor;uniform int u_charCount;uniform vec3 u_charList[255];layout(location=0)out vec4 o_character;layout(location=1)out vec4 o_primaryColor;layout(location=2)out vec4 o_secondaryColor;layout(location=3)out vec4 A;float B(vec3 C){return dot(C,vec3(0.299f,0.587f,0.114f));}void main(){vec2 D=vec2(v_uv.x,1.0f-v_uv.y);vec4 E=texture(u_image,D);float F=B(E.rgb);vec2 G=vec2(0.);if(u_charCount>0){float H=float(u_charCount);float I=clamp(F*(H-1.0f),0.0f,H-1.0f);int J=int(floor(I+0.5f));vec3 K=u_charList[J];G=K.xy;}else{G=vec2(0.0f,0.0f);}vec4 L=u_charColorFixed?u_charColor:E;vec4 M=u_cellColorFixed?u_cellColor:E;if(E.a<0.01f){discard;}o_primaryColor=vec4(L.rgb,L.a);o_secondaryColor=vec4(M.rgb,M.a);A=vec4(0.);int N=int(u_invert?1:0);int O=int(u_flipX?1:0);int P=int(u_flipY?1:0);float Q=float(N|(O<<1)|(P<<2))/255.;o_character=vec4(G,Q,clamp(u_charRotation,0.0f,1.0f));}`)), lt), createUniforms: ({ source: n }) => n.createBaseConversionUniforms() };
3591
- class qt {
3591
+ class Wt {
3592
3592
  constructor() {
3593
- a(this, "Dl", /* @__PURE__ */ new Map());
3594
- a(this, "Fl", /* @__PURE__ */ new Map());
3595
- this.Ll();
3596
- }
3597
- Pl(t) {
3598
- this.Dl.set(t.id, t);
3593
+ a(this, "Ll", /* @__PURE__ */ new Map());
3594
+ a(this, "$l", /* @__PURE__ */ new Map());
3595
+ this.Ol();
3599
3596
  }
3600
3597
  Tl(t) {
3601
- const e = this.Fl.get(t);
3602
- return e && (e.dispose(), this.Fl.delete(t)), this.Dl.delete(t);
3598
+ this.Ll.set(t.id, t);
3599
+ }
3600
+ El(t) {
3601
+ const e = this.$l.get(t);
3602
+ return e && (e.dispose(), this.$l.delete(t)), this.Ll.delete(t);
3603
3603
  }
3604
3604
  Pn(t) {
3605
- return this.Dl.get(t);
3605
+ return this.Ll.get(t);
3606
3606
  }
3607
- Ol(t) {
3608
- return this.Dl.has(t);
3607
+ Bl(t) {
3608
+ return this.Ll.has(t);
3609
3609
  }
3610
3610
  gt() {
3611
- for (const t of this.Fl.values()) t.dispose();
3612
- this.Fl.clear(), this.Dl.clear();
3611
+ for (const t of this.$l.values()) t.dispose();
3612
+ this.$l.clear(), this.Ll.clear();
3613
3613
  }
3614
- Ll() {
3615
- this.Pl(qe);
3614
+ Ol() {
3615
+ this.Tl(We);
3616
3616
  }
3617
3617
  }
3618
- class Vt {
3618
+ class jt {
3619
3619
  constructor() {
3620
- a(this, "Bl");
3621
- this.Bl = new qt();
3620
+ a(this, "Il");
3621
+ this.Il = new Wt();
3622
3622
  }
3623
3623
  register(t) {
3624
- this.Bl.Pl(t);
3624
+ this.Il.Tl(t);
3625
3625
  }
3626
3626
  unregister(t) {
3627
- return this.Bl.Tl(t);
3627
+ return this.Il.El(t);
3628
3628
  }
3629
3629
  has(t) {
3630
- return this.Bl.Ol(t);
3630
+ return this.Il.Bl(t);
3631
3631
  }
3632
3632
  Pn(t) {
3633
- return this.Bl.Pn(t);
3633
+ return this.Il.Pn(t);
3634
3634
  }
3635
3635
  gt() {
3636
- this.Bl.gt();
3636
+ this.Il.gt();
3637
3637
  }
3638
3638
  }
3639
- const Ke = Object.freeze(Object.defineProperty({ __proto__: null, ConversionRegistry: qt, TextmodeConversionManager: Vt }, Symbol.toStringTag, { value: "Module" }));
3640
- class Ve extends function(e, ...i) {
3639
+ const Ke = Object.freeze(Object.defineProperty({ __proto__: null, ConversionRegistry: Wt, TextmodeConversionManager: jt }, Symbol.toStringTag, { value: "Module" }));
3640
+ class je extends function(e, ...i) {
3641
3641
  return i.reduce((r, s) => s(r), e);
3642
3642
  }(class {
3643
- }, Xe, Ze, ke, Ye, ze) {
3643
+ }, Ie, Xe, ze, Ye, ke) {
3644
3644
  constructor(e = {}) {
3645
3645
  super();
3646
3646
  a(this, "Z");
@@ -3649,86 +3649,86 @@ class Ve extends function(e, ...i) {
3649
3649
  a(this, "qo");
3650
3650
  a(this, "la");
3651
3651
  a(this, "ua");
3652
- a(this, "Il");
3653
- a(this, "Vc");
3652
+ a(this, "Hl");
3654
3653
  a(this, "Jc");
3654
+ a(this, "tl");
3655
3655
  a(this, "ha");
3656
3656
  a(this, "dn");
3657
- a(this, "Rc");
3658
- a(this, "Yc");
3657
+ a(this, "Sc");
3658
+ a(this, "jc");
3659
3659
  a(this, "gn");
3660
- a(this, "Hl", []);
3661
- a(this, "Gl");
3660
+ a(this, "Gl", []);
3662
3661
  a(this, "Ql");
3663
3662
  a(this, "Nl");
3664
- a(this, "Xl", !1);
3663
+ a(this, "Xl");
3665
3664
  a(this, "Yl", !1);
3666
3665
  a(this, "jl", !1);
3667
3666
  a(this, "Kl", !1);
3668
- a(this, "Wl", () => {
3667
+ a(this, "Wl", !1);
3668
+ a(this, "Zl", () => {
3669
3669
  });
3670
- a(this, "xc", () => {
3670
+ a(this, "Mc", () => {
3671
3671
  });
3672
- a(this, "Zl", () => {
3672
+ a(this, "ql", () => {
3673
3673
  });
3674
- a(this, "ql");
3675
3674
  a(this, "Vl");
3676
- a(this, "Xr", !1);
3677
3675
  a(this, "Jl");
3676
+ a(this, "Xr", !1);
3678
3677
  a(this, "tu");
3679
- this.Nl = new Ge(this), this.Xr = e.overlay ?? !1, this.kr = new _e(e), this.Z = new me(this.kr.tn()), this.aa = new Ut(e.frameRate ?? 60), this.Il = new Yt(this, e.loadingScreen, this.kr.Vr()), this.Il.Zc(() => {
3680
- this.aa.Kn = 0, this.Kl = !0;
3681
- }), this.Vc = this.Z.pe(j, `#version 300 es
3682
- precision highp float;uniform sampler2D u_characterTexture;uniform vec2 u_charsetDimensions;uniform sampler2D Um;uniform sampler2D Un;uniform sampler2D Ul;uniform vec2 Uo;uniform vec2 Up;uniform vec4 Uq;in vec2 v_uv;out vec4 fragColor;mat2 A(float B){float C=sin(B);float D=cos(B);return mat2(D,-C,C,D);}void main(){vec2 E=gl_FragCoord.xy/Up;vec2 F=E*Uo;vec2 G=floor(F);vec2 H=(G+0.5)/Uo;vec4 I=texture(Um,H);vec4 J=texture(Un,H);vec4 K=texture(Ul,H);int L=int(K.b*255.+0.5);bool M=(L&1)!=0;bool N=(L&2)!=0;bool O=(L&4)!=0;int P=int(K.r*255.+0.5)+int(K.g*255.+0.5)*256;int Q=int(u_charsetDimensions.x);int R=P/Q;int S=P-(R*Q);float T=(u_charsetDimensions.y-1.)-float(R);vec2 U=1./u_charsetDimensions;vec2 V=vec2(float(S),T)*U;vec2 W=V+U;float X=-K.a*360.*0.017453292;vec2 Y=fract(F)-0.5f;vec2 Z=vec2(N?-1.:1.,O?-1.:1.);Y*=Z;Y=A(X)*Y+0.5;vec2 a=V+clamp(Y,0.,1.)*U;const float b=0.0001;if(any(lessThan(a,V-b))||any(greaterThan(a,W+b))){fragColor=M?I:J;return;}vec4 c=texture(u_characterTexture,a);if(M)c.rgb=mix(c.rgb,1.-c.rgb,float(M));vec4 d=mix(Uq,J,J.a);fragColor=mix(d,I,c);}`), this.Jc = this.Z.pe(j, _t), this.ha = new Gt(this, e);
3683
- const i = () => this.su();
3684
- this.qo = new Lt(this.kr, i), this.la = new Bt(this.kr, i, this.qo), this.ua = new Nt(), this.Yc = new Wt(this.Z), this.gn = new Vt(), this.Il.In(), this.iu(e);
3685
- }
3686
- async iu(e) {
3687
- await this.ha.wr(), await this.Il.wr();
3678
+ a(this, "su");
3679
+ this.Xl = new He(this), this.Xr = e.overlay ?? !1, this.kr = new De(e), this.Z = new me(this.kr.tn()), this.aa = new Ut(e.frameRate ?? 60), this.Hl = new Yt(this, e.loadingScreen, this.kr.Vr()), this.Hl.qc(() => {
3680
+ this.aa.Kn = 0, this.Wl = !0;
3681
+ }), this.Jc = this.Z.pe(V, `#version 300 es
3682
+ precision highp float;uniform sampler2D u_characterTexture;uniform vec2 u_charsetDimensions;uniform sampler2D Ue;uniform sampler2D Uf;uniform sampler2D Ud;uniform vec2 Ug;uniform vec2 Uh;uniform vec4 Ui;in vec2 v_uv;out vec4 fragColor;mat2 A(float B){float C=sin(B);float D=cos(B);return mat2(D,-C,C,D);}void main(){vec2 E=gl_FragCoord.xy/Uh;vec2 F=E*Ug;vec2 G=floor(F);vec2 H=(G+0.5)/Ug;vec4 I=texture(Ue,H);vec4 J=texture(Uf,H);vec4 K=texture(Ud,H);int L=int(K.b*255.+0.5);bool M=(L&1)!=0;bool N=(L&2)!=0;bool O=(L&4)!=0;int P=int(K.r*255.+0.5)+int(K.g*255.+0.5)*256;int Q=int(u_charsetDimensions.x);int R=P/Q;int S=P-(R*Q);float T=(u_charsetDimensions.y-1.)-float(R);vec2 U=1./u_charsetDimensions;vec2 V=vec2(float(S),T)*U;vec2 W=V+U;float X=-K.a*360.*0.017453292;vec2 Y=fract(F)-0.5f;vec2 Z=vec2(N?-1.:1.,O?-1.:1.);Y*=Z;Y=A(X)*Y+0.5;vec2 a=V+clamp(Y,0.,1.)*U;const float b=0.0001;if(any(lessThan(a,V-b))||any(greaterThan(a,W+b))){fragColor=M?I:J;return;}vec4 c=texture(u_characterTexture,a);if(M)c.rgb=mix(c.rgb,1.-c.rgb,float(M));vec4 d=mix(Ui,J,J.a);fragColor=mix(d,I,c);}`), this.tl = this.Z.pe(V, Dt), this.ha = new Ht(this, e);
3683
+ const i = () => this.iu();
3684
+ this.qo = new Lt(this.kr, i), this.la = new Bt(this.kr, i, this.qo), this.ua = new Nt(), this.jc = new qt(this.Z), this.gn = new jt(), this.Hl.In(), this.eu(e);
3685
+ }
3686
+ async eu(e) {
3687
+ await this.ha.wr(), await this.Hl.wr();
3688
3688
  const i = this.ha.base.grid;
3689
- this.ha.Cl(() => {
3689
+ this.ha.xl(() => {
3690
3690
  this.qo.Fo(), this.la.Fo();
3691
- }), this.Gl = this.Z.Pe(this.kr.width, this.kr.height, 1), this.Ql = this.Z.Pe(this.kr.width, this.kr.height, 1), this.Yc.wr(this.kr.width, this.kr.height), this.Xr && (this.Jl = k.Tn(this.Z, this.gn, this.kr.targetCanvas, i.cols, i.rows)), this.eu(), this.aa.In(() => this.ca()), await this.Nl.ma(e.plugins ?? []);
3691
+ }), this.Ql = this.Z.Pe(this.kr.width, this.kr.height, 1), this.Nl = this.Z.Pe(this.kr.width, this.kr.height, 1), this.jc.wr(this.kr.width, this.kr.height), this.Xr && (this.tu = z.Tn(this.Z, this.gn, this.kr.targetCanvas, i.cols, i.rows)), this.ru(), this.aa.In(() => this.ca()), await this.Xl.ma(e.plugins ?? []);
3692
3692
  try {
3693
- await this.Wl(), this.Il.Wa();
3693
+ await this.Zl(), this.Hl.Za();
3694
3694
  } catch (r) {
3695
- console.error("Error during setup:", r), this.Il.error(r);
3695
+ console.error("Error during setup:", r), this.Hl.error(r);
3696
3696
  }
3697
3697
  }
3698
- eu() {
3699
- this.ql = () => {
3700
- this.Xr && this.resizeCanvas(this.kr.targetCanvas.width, this.kr.targetCanvas.height), this.Zl();
3701
- }, window.addEventListener("resize", this.ql), this.qo._o(), this.la._o(), this.ua._o(), window.addEventListener("blur", () => {
3698
+ ru() {
3699
+ this.Vl = () => {
3700
+ this.Xr && this.resizeCanvas(this.kr.targetCanvas.width, this.kr.targetCanvas.height), this.ql();
3701
+ }, window.addEventListener("resize", this.Vl), this.qo._o(), this.la._o(), this.ua._o(), window.addEventListener("blur", () => {
3702
3702
  this.ua.Zo();
3703
- }), this.Xr && (this.Vl = new ResizeObserver(() => {
3703
+ }), this.Xr && (this.Jl = new ResizeObserver(() => {
3704
3704
  this.resizeCanvas(this.kr.targetCanvas.width, this.kr.targetCanvas.height);
3705
- }), this.Vl.observe(this.kr.targetCanvas));
3705
+ }), this.Jl.observe(this.kr.targetCanvas));
3706
3706
  }
3707
3707
  ca() {
3708
- if (!this.Il.Xa && this.Kl) {
3709
- this.Yl = !0;
3708
+ if (!this.Hl.Ya && this.Wl) {
3709
+ this.jl = !0;
3710
3710
  try {
3711
- this.aa.Xn(), this.aa.Wn(), this.Xr && Tt(this.Z.context, this.Jl.texture, this.kr.targetCanvas), this.Nl.ba(), this.Z.state.qt(), this.ha.yl(this.Gl, () => this.xc());
3712
- let e = this.Gl.textures[0];
3713
- this.Hl.length > 0 && (this.Yc.Rl(this.Gl.textures[0], this.Ql, this.Hl, this.kr.width, this.kr.height), e = this.Ql.textures[0], this.Hl = []), this.Z.wi(0, 0, 0, 0), this.Z.ve(this.Jc), this.Jc.O({ u_texture: e }), this.Z.we(0, 0, this.kr.width, this.kr.height), this.Nl.xa();
3711
+ this.aa.Xn(), this.aa.Wn(), this.Xr && Tt(this.Z.context, this.tu.texture, this.kr.targetCanvas), this.Xl.ba(), this.Z.state.qt(), this.ha.Al(this.Ql, () => this.Mc());
3712
+ let e = this.Ql.textures[0];
3713
+ this.Gl.length > 0 && (this.jc.Sl(this.Ql.textures[0], this.Nl, this.Gl, this.kr.width, this.kr.height), e = this.Nl.textures[0], this.Gl = []), this.Z.wi(0, 0, 0, 0), this.Z.ve(this.tl), this.tl.O({ u_texture: e }), this.Z.we(0, 0, this.kr.width, this.kr.height), this.Xl.xa();
3714
3714
  } finally {
3715
- this.Yl = !1, this.Xl && !this.jl && this.ru();
3715
+ this.jl = !1, this.Yl && !this.Kl && this.nu();
3716
3716
  }
3717
3717
  }
3718
3718
  }
3719
3719
  resizeCanvas(e, i) {
3720
3720
  var r, s, h, o;
3721
- this.kr.Jr(e, i), this.Il.tl(this.kr.Vr()), this.Il.Jr(), (r = this.Gl) == null || r.resize(this.kr.width, this.kr.height), (s = this.Ql) == null || s.resize(this.kr.width, this.kr.height), (h = this.Yc) == null || h.Jr(this.kr.width, this.kr.height), (o = this.ha) == null || o.Jr(), this.Z.Re(), this.ca();
3721
+ this.kr.Jr(e, i), this.Hl.sl(this.kr.Vr()), this.Hl.Jr(), (r = this.Ql) == null || r.resize(this.kr.width, this.kr.height), (s = this.Nl) == null || s.resize(this.kr.width, this.kr.height), (h = this.jc) == null || h.Jr(this.kr.width, this.kr.height), (o = this.ha) == null || o.Jr(), this.Z.Re(), this.ca();
3722
3722
  }
3723
3723
  destroy() {
3724
- this.jl || this.Xl || (this.Xl = !0, this.aa.Gn(), this.Yl || this.ru());
3724
+ this.Kl || this.Yl || (this.Yl = !0, this.aa.Gn(), this.jl || this.nu());
3725
3725
  }
3726
- ru() {
3726
+ nu() {
3727
3727
  var e, i, r, s, h, o, c;
3728
- this.Xl = !1, this.Il.gt(), this.Nl.Ma(), window.removeEventListener("resize", this.ql), (e = this.Vl) == null || e.disconnect(), this.qo.Mo(), this.la.Mo(), this.ua.Mo(), this.Vc.dispose(), (i = this.ha) == null || i.gt(), (r = this.Yc) == null || r.gt(), (s = this.gn) == null || s.gt(), (h = this.Gl) == null || h.gt(), (o = this.Ql) == null || o.gt(), this.Z.gt(), this.Jc.dispose(), (c = this.Jl) == null || c.gt(), this.kr.gt(), this.jl = !0;
3728
+ this.Yl = !1, this.Hl.gt(), this.Xl.Ma(), window.removeEventListener("resize", this.Vl), (e = this.Jl) == null || e.disconnect(), this.qo.Mo(), this.la.Mo(), this.ua.Mo(), this.Jc.dispose(), (i = this.ha) == null || i.gt(), (r = this.jc) == null || r.gt(), (s = this.gn) == null || s.gt(), (h = this.Ql) == null || h.gt(), (o = this.Nl) == null || o.gt(), this.Z.gt(), this.tl.dispose(), (c = this.tu) == null || c.gt(), this.kr.gt(), this.Kl = !0;
3729
3729
  }
3730
3730
  filter(e, i) {
3731
- this.Hl.push({ name: e, params: i });
3731
+ this.Gl.push({ name: e, params: i });
3732
3732
  }
3733
3733
  async loadFont(e) {
3734
3734
  return await this.ha.base.loadFont(e), this.ha.base.font;
@@ -3737,22 +3737,22 @@ precision highp float;uniform sampler2D u_characterTexture;uniform vec2 u_charse
3737
3737
  vt.m(typeof e == "number" && e > 0, "Font size must be a positive number greater than 0.", { method: "fontSize", providedValue: e }) && this.ha.base.font.fontSize !== e && this.ha.base.font.Mr(e);
3738
3738
  }
3739
3739
  inputGrid(e) {
3740
- return e === void 0 ? this.tu ?? "topmost" : e === "topmost" ? (this.tu = void 0, this.qo.Fo(), void this.la.Fo()) : (this.tu = e, this.qo.Fo(), void this.la.Fo());
3740
+ return e === void 0 ? this.su ?? "topmost" : e === "topmost" ? (this.su = void 0, this.qo.Fo(), void this.la.Fo()) : (this.su = e, this.qo.Fo(), void this.la.Fo());
3741
3741
  }
3742
- su() {
3743
- return this.tu ? this.tu : this.ha.bl();
3742
+ iu() {
3743
+ return this.su ? this.su : this.ha.Cl();
3744
3744
  }
3745
3745
  async setup(e) {
3746
- this.Wl = e;
3746
+ this.Zl = e;
3747
3747
  }
3748
3748
  draw(e) {
3749
- this.xc = e;
3749
+ this.Mc = e;
3750
3750
  }
3751
3751
  windowResized(e) {
3752
- this.Zl = e;
3752
+ this.ql = e;
3753
3753
  }
3754
3754
  get grid() {
3755
- return this.Rc ?? this.ha.base.grid;
3755
+ return this.Sc ?? this.ha.base.grid;
3756
3756
  }
3757
3757
  get font() {
3758
3758
  return this.dn ?? this.ha.base.font;
@@ -3767,19 +3767,19 @@ precision highp float;uniform sampler2D u_characterTexture;uniform vec2 u_charse
3767
3767
  return this.kr.canvas;
3768
3768
  }
3769
3769
  get isDisposed() {
3770
- return this.jl;
3770
+ return this.Kl;
3771
3771
  }
3772
3772
  get overlay() {
3773
- return this.Jl;
3773
+ return this.tu;
3774
3774
  }
3775
3775
  get loading() {
3776
- return this.Il;
3776
+ return this.Hl;
3777
3777
  }
3778
3778
  get layers() {
3779
3779
  return this.ha;
3780
3780
  }
3781
3781
  get filters() {
3782
- return this.Yc;
3782
+ return this.jc;
3783
3783
  }
3784
3784
  get conversions() {
3785
3785
  return this.gn;
@@ -3789,23 +3789,23 @@ class At {
3789
3789
  constructor() {
3790
3790
  }
3791
3791
  static create(t = {}) {
3792
- return new Ve(t);
3792
+ return new je(t);
3793
3793
  }
3794
3794
  static setErrorLevel(t) {
3795
3795
  vt._(t);
3796
3796
  }
3797
3797
  static get version() {
3798
- return "0.8.1-beta.1";
3798
+ return "0.8.1";
3799
3799
  }
3800
3800
  }
3801
- const Je = Object.freeze(Object.defineProperty({ __proto__: null, LoadingPhase: kt, LoadingPhaseTracker: It, LoadingScreenManager: Yt, LoadingScreenStateMachine: Dt, LoadingScreenTransition: Ot, resolveColorInputs: Zt, resolveDefaultPalette: Xt, resolveTheme: gt }, Symbol.toStringTag, { value: "Module" })), $e = Object.freeze(Object.defineProperty({ __proto__: null, TextmodeFont: et, TextmodeImage: k, TextmodeVideo: nt }, Symbol.toStringTag, { value: "Module" })), ti = Object.freeze(Object.defineProperty({ __proto__: null, keyboard: De, mouse: Ie, touch: Oe }, Symbol.toStringTag, { value: "Module" })), ei = Object.freeze(Object.defineProperty({ __proto__: null, LayerCompositor: zt, TextmodeLayer: it, TextmodeLayerManager: Gt }, Symbol.toStringTag, { value: "Module" })), ii = At.create, ri = At.setErrorLevel, si = At.version;
3801
+ const Je = Object.freeze(Object.defineProperty({ __proto__: null, LoadingPhase: zt, LoadingPhaseTracker: _t, LoadingScreenManager: Yt, LoadingScreenStateMachine: Ot, LoadingScreenTransition: Zt, resolveColorInputs: Xt, resolveDefaultPalette: It, resolveTheme: gt }, Symbol.toStringTag, { value: "Module" })), $e = Object.freeze(Object.defineProperty({ __proto__: null, TextmodeFont: et, TextmodeImage: z, TextmodeVideo: nt }, Symbol.toStringTag, { value: "Module" })), ti = Object.freeze(Object.defineProperty({ __proto__: null, keyboard: Oe, mouse: _e, touch: Ze }, Symbol.toStringTag, { value: "Module" })), ei = Object.freeze(Object.defineProperty({ __proto__: null, LayerCompositor: kt, TextmodeLayer: it, TextmodeLayerManager: Ht }, Symbol.toStringTag, { value: "Module" })), ii = At.create, ri = At.setErrorLevel, si = At.version;
3802
3802
  export {
3803
- _e as TextmodeCanvas,
3803
+ De as TextmodeCanvas,
3804
3804
  S as TextmodeColor,
3805
3805
  $t as TextmodeErrorLevel,
3806
- Z as TextmodeFramebuffer,
3806
+ X as TextmodeFramebuffer,
3807
3807
  Le as TextmodeGrid,
3808
- Ve as Textmodifier,
3808
+ je as Textmodifier,
3809
3809
  Ke as conversion,
3810
3810
  ii as create,
3811
3811
  Qe as filters,