textmode.js 0.8.0-beta.3 → 0.8.1-beta.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.
Files changed (28) hide show
  1. package/README.md +179 -179
  2. package/dist/textmode.esm.js +457 -450
  3. package/dist/textmode.umd.js +15 -15
  4. package/dist/types/Textmode.d.ts +14 -2
  5. package/dist/types/errors/ErrorHandler.d.ts +1 -1
  6. package/dist/types/index.d.ts +10 -2
  7. package/dist/types/rendering/webgl/utils/hash.d.ts +6 -6
  8. package/dist/types/textmode/Textmodifier.d.ts +8 -0
  9. package/dist/types/textmode/conversion/ConversionManager.d.ts +2 -2
  10. package/dist/types/textmode/conversion/ConversionRegistry.d.ts +2 -2
  11. package/dist/types/textmode/filters/FilterManager.d.ts +2 -7
  12. package/dist/types/textmode/filters/FilterRegistry.d.ts +2 -2
  13. package/dist/types/textmode/interfaces/ITextmodifier.d.ts +57 -9
  14. package/dist/types/textmode/layers/LayerManager.d.ts +4 -3
  15. package/dist/types/textmode/layers/TextmodeLayer.d.ts +2 -2
  16. package/dist/types/textmode/layers/interfaces/ILayerManager.d.ts +1 -1
  17. package/dist/types/textmode/layers/interfaces/ITextmodeLayer.d.ts +7 -9
  18. package/dist/types/textmode/layers/types.d.ts +2 -2
  19. package/dist/types/textmode/loadables/TextmodeImage.d.ts +2 -4
  20. package/dist/types/textmode/loadables/font/TextmodeFont.d.ts +3 -3
  21. package/dist/types/textmode/loadables/video/TextmodeVideo.d.ts +2 -4
  22. package/dist/types/textmode/loading/LoadingPhase.d.ts +6 -4
  23. package/dist/types/textmode/loading/LoadingScreenManager.d.ts +4 -4
  24. package/dist/types/textmode/loading/types.d.ts +10 -6
  25. package/dist/types/textmode/mixins/interfaces/IAnimationMixin.d.ts +1 -1
  26. package/dist/types/textmode/mixins/interfaces/IRenderingMixin.d.ts +15 -15
  27. package/dist/types/textmode/mixins/interfaces/ITouchMixin.d.ts +11 -11
  28. package/package.json +72 -72
@@ -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 X) {
118
+ if (e instanceof Z) {
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,7 +146,7 @@ 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 Y(n, t, e, i) {
149
+ function z(n, t, e, i) {
150
150
  return Math.hypot(e - n, i - t);
151
151
  }
152
152
  function O(n, t, e) {
@@ -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);}}`, Z = class Z {
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 {
172
172
  constructor(t, e, i = e, r = 1, s = {}, h) {
173
173
  a(this, "N");
174
174
  a(this, "X");
@@ -181,7 +181,7 @@ 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 }, Z.J || (Z.J = new q(t, rt, `#version 300 es
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
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;}`));
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();
@@ -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 = Z.J;
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;
248
248
  this.q = this.Z.vt.dt(s, r, !0);
249
249
  }
250
250
  gt() {
@@ -266,8 +266,8 @@ 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(Z, "J", null);
270
- let X = Z;
269
+ a(X, "J", null);
270
+ let Z = X;
271
271
  const Ct = /* @__PURE__ */ new WeakMap();
272
272
  function ht(n, t) {
273
273
  Ct.set(n, t);
@@ -389,7 +389,7 @@ class st {
389
389
  return this.xt;
390
390
  }
391
391
  }
392
- const dt = new Float32Array([-0.5, -0.5, 0, 0, 0.5, -0.5, 1, 0, -0.5, 0.5, 0, 1, -0.5, 0.5, 0, 1, 0.5, -0.5, 1, 0, 0.5, 0.5, 1, 1]), k = { _s: 16, As: WebGL2RenderingContext.TRIANGLES, ws: { bs: { size: 2, offset: 0 }, Cs: { size: 2, offset: 8 } } };
392
+ const dt = new Float32Array([-0.5, -0.5, 0, 0, 0.5, -0.5, 1, 0, -0.5, 0.5, 0, 1, -0.5, 0.5, 0, 1, 0.5, -0.5, 1, 0, 0.5, 0.5, 1, 1]), Y = { _s: 16, As: WebGL2RenderingContext.TRIANGLES, ws: { bs: { size: 2, offset: 0 }, Cs: { size: 2, offset: 8 } } };
393
393
  class te {
394
394
  constructor(t) {
395
395
  a(this, "A");
@@ -400,8 +400,8 @@ class te {
400
400
  $s(t, e, i, r) {
401
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;
402
402
  for (let v = 0; v < g.length; v += 4) {
403
- const A = g[v], m = g[v + 1], b = 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] = b, p[v + 3] = y;
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;
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
  }
@@ -409,7 +409,7 @@ class te {
409
409
  this.A.deleteBuffer(this.Ms);
410
410
  }
411
411
  }
412
- var w = ((n) => (n.RECTANGLE = "rectangle", n.LINE = "line", n.ELLIPSE = "ellipse", n.ARC = "arc", n.TRIANGLE = "triangle", n.BEZIER_CURVE = "bezier_curve", n))(w || {});
412
+ var b = ((n) => (n.RECTANGLE = "rectangle", n.LINE = "line", n.ELLIPSE = "ellipse", n.ARC = "arc", n.TRIANGLE = "triangle", n.BEZIER_CURVE = "bezier_curve", n))(b || {});
413
413
  const ee = { rectangle: 2, line: 2, ellipse: 2, triangle: 2, arc: 3, bezier_curve: 4 };
414
414
  class ie {
415
415
  constructor(t) {
@@ -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 D = class D {
441
+ const _ = class _ {
442
442
  static Rs(t, e, i = 0) {
443
- const r = e || new Float32Array(D.FLOATS_PER_INSTANCE);
443
+ const r = e || new Float32Array(_.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 D = class D {
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 * D.FLOATS_PER_INSTANCE, r = e || new Float32Array(i);
454
+ const i = t.length * _.FLOATS_PER_INSTANCE, r = e || new Float32Array(i);
455
455
  for (let s = 0; s < t.length; s++) {
456
- const h = s * D.FLOATS_PER_INSTANCE;
457
- D.Rs(t[s], r, h);
456
+ const h = s * _.FLOATS_PER_INSTANCE;
457
+ _.Rs(t[s], r, h);
458
458
  }
459
459
  return r;
460
460
  }
461
461
  };
462
- a(D, "BYTES_PER_INSTANCE", 144), a(D, "FLOATS_PER_INSTANCE", 36);
463
- let N = D;
464
- const M = class M {
462
+ a(_, "BYTES_PER_INSTANCE", 144), a(_, "FLOATS_PER_INSTANCE", 36);
463
+ let N = _;
464
+ const P = class P {
465
465
  };
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 W = M;
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;
468
468
  class re {
469
469
  constructor(t = 1e3, e = 1.5) {
470
470
  a(this, "Ys");
@@ -623,7 +623,7 @@ class he {
623
623
  this._i.gt();
624
624
  }
625
625
  }
626
- class _ {
626
+ class D {
627
627
  constructor(t, e, i, r) {
628
628
  a(this, "A");
629
629
  a(this, "bi");
@@ -665,14 +665,14 @@ class _ {
665
665
  return this.bi.oi(v);
666
666
  }
667
667
  }
668
- const oe = { Fi: dt, Ri: 6, ...k }, ae = { Fi: new Float32Array([0, -0.5, 0, 0, 1, -0.5, 1, 0, 0, 0.5, 0, 1, 0, 0.5, 0, 1, 1, -0.5, 1, 0, 1, 0.5, 1, 1]), Ri: 6, ...k }, ce = { Fi: function(n = 32) {
668
+ const oe = { Fi: dt, Ri: 6, ...Y }, ae = { Fi: new Float32Array([0, -0.5, 0, 0, 1, -0.5, 1, 0, 0, 0.5, 0, 1, 0, 0.5, 0, 1, 1, -0.5, 1, 0, 1, 0.5, 1, 1]), Ri: 6, ...Y }, ce = { Fi: function(n = 32) {
669
669
  const t = [], e = 2 * Math.PI / n;
670
670
  for (let i = 0; i < n; i++) {
671
671
  const r = i * e, s = (i + 1) % n * e, h = Math.cos(r), o = Math.sin(r), c = 0.5 * (h + 1), l = 0.5 * (o + 1), u = Math.cos(s), f = Math.sin(s), d = 0.5 * (u + 1), g = 0.5 * (f + 1);
672
672
  t.push(0, 0, 0.5, 0.5, h, o, c, l, u, f, d, g);
673
673
  }
674
674
  return new Float32Array(t);
675
- }(32), Ri: 96, ...k };
675
+ }(32), Ri: 96, ...Y };
676
676
  let le = { Fi: function(n) {
677
677
  const t = [];
678
678
  for (let e = 0; e < n; e++) {
@@ -680,55 +680,55 @@ let le = { Fi: function(n) {
680
680
  t.push(i, 0, i, 0, i, 1, i, 1, r, 1, r, 1);
681
681
  }
682
682
  return new Float32Array(t);
683
- }(32), Ri: 96, ...k };
684
- const ue = { Fi: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0.5, 1, 0.5, 1]), Ri: 3, ...k }, fe = { Fi: function(n = 16) {
683
+ }(32), Ri: 96, ...Y };
684
+ const ue = { Fi: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0.5, 1, 0.5, 1]), Ri: 3, ...Y }, fe = { Fi: function(n = 16) {
685
685
  const t = [];
686
686
  for (let e = 0; e < n; e++) {
687
687
  const i = e / n, r = (e + 1) / n;
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, ...k }, de = { [w.RECTANGLE]: class extends _ {
691
+ }(16), Ri: 96, ...Y }, de = { [b.RECTANGLE]: class extends D {
692
692
  constructor(n, t) {
693
- super(n, t, w.RECTANGLE, oe);
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
- }, [w.LINE]: class extends _ {
698
+ }, [b.LINE]: class extends D {
699
699
  constructor(n, t) {
700
- super(n, t, w.LINE, ae);
700
+ super(n, t, b.LINE, ae);
701
701
  }
702
702
  yi(n, t) {
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
- }, [w.ELLIPSE]: class extends _ {
706
+ }, [b.ELLIPSE]: class extends D {
707
707
  constructor(n, t) {
708
- super(n, t, w.ELLIPSE, ce);
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
- }, [w.ARC]: class extends _ {
713
+ }, [b.ARC]: class extends D {
714
714
  constructor(n, t) {
715
- super(n, t, w.ARC, le);
715
+ super(n, t, b.ARC, le);
716
716
  }
717
717
  yi(n, t) {
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
- }, [w.TRIANGLE]: class extends _ {
721
+ }, [b.TRIANGLE]: class extends D {
722
722
  constructor(n, t) {
723
- super(n, t, w.TRIANGLE, ue);
723
+ super(n, t, b.TRIANGLE, ue);
724
724
  }
725
725
  yi(n, t) {
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
- }, [w.BEZIER_CURVE]: class extends _ {
729
+ }, [b.BEZIER_CURVE]: class extends D {
730
730
  constructor(n, t) {
731
- super(n, t, w.BEZIER_CURVE, fe);
731
+ super(n, t, b.BEZIER_CURVE, fe);
732
732
  }
733
733
  yi(n, t) {
734
734
  return this.Ei(0, 0, 1, t.Ot || 1, t, { cp1x: n.cp1x, cp1y: n.cp1y, cp2x: n.cp2x, cp2y: n.cp2y, bezStartX: n.x1, bezStartY: n.y1, bezEndX: n.x2, bezEndY: n.y2 });
@@ -740,7 +740,7 @@ class ge {
740
740
  a(this, "Si");
741
741
  a(this, "zi");
742
742
  this.A = t, this.zi = new ie(t), this.Si = /* @__PURE__ */ new Map();
743
- for (const e of Object.values(w)) {
743
+ for (const e of Object.values(b)) {
744
744
  const i = new he(t), r = new de[e](t, i);
745
745
  this.Si.set(e, r);
746
746
  }
@@ -776,7 +776,7 @@ class ge {
776
776
  this.Si.clear(), this.zi.gt();
777
777
  }
778
778
  }
779
- function Mt(n) {
779
+ function Pt(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,9 +784,9 @@ function Mt(n) {
784
784
  }
785
785
  const yt = /* @__PURE__ */ new WeakMap();
786
786
  let ve = 1;
787
- function bt(n) {
787
+ function Et(n) {
788
788
  if (n == null) return 0;
789
- if (typeof n != "object" && typeof n != "function") return Mt(n + "");
789
+ if (typeof n != "object" && typeof n != "function") return Pt(n + "");
790
790
  let t = yt.get(n);
791
791
  return t || (t = ve++, yt.set(n, t)), t;
792
792
  }
@@ -815,10 +815,10 @@ 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 = bt(t.G), r = function(s, h) {
818
+ const i = Et(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, Mt(l)), o = G(o, h(s[l]));
821
+ for (const l of c) o = G(o, Pt(l)), o = G(o, h(s[l]));
822
822
  return o;
823
823
  }(e, this.Xi.bind(this));
824
824
  return G(i, r);
@@ -836,7 +836,7 @@ precision highp float;in vec3 v_glyphIndex;in vec4 v_glyphColor;in vec4 v_cellCo
836
836
  const r = Math.min(e.length, 16);
837
837
  for (let s = 0; s < r; s++) i = G(i, e[s]);
838
838
  return i;
839
- }(t) : t instanceof WebGLTexture ? bt(t) : 0;
839
+ }(t) : t instanceof WebGLTexture ? Et(t) : 0;
840
840
  }
841
841
  gt() {
842
842
  this.Bi != this.Bi && this.Bi.dispose(), this.Bi.dispose(), this.Hi.clear();
@@ -857,27 +857,27 @@ class Ae {
857
857
  return i.id = this.ji++, i.type = t, i.material = e, this.Ss++, i;
858
858
  }
859
859
  Wi(t, e, i) {
860
- const r = this.Ki(w.RECTANGLE, i), s = r.params;
860
+ const r = this.Ki(b.RECTANGLE, i), s = r.params;
861
861
  return s.width = t.width, s.height = t.height, e.Wt(r.state), r.id;
862
862
  }
863
863
  Zi(t, e, i) {
864
- const r = this.Ki(w.LINE, i), s = r.params;
864
+ const r = this.Ki(b.LINE, i), s = r.params;
865
865
  return s.x1 = t.x1, s.y1 = t.y1, s.x2 = t.x2, s.y2 = t.y2, s.thickness = t.thickness, e.Wt(r.state), r.id;
866
866
  }
867
867
  qi(t, e, i) {
868
- const r = this.Ki(w.ELLIPSE, i), s = r.params;
868
+ const r = this.Ki(b.ELLIPSE, i), s = r.params;
869
869
  return s.width = t.width, s.height = t.height, s.startAngle = t.startAngle, s.endAngle = t.endAngle, s.segments = t.segments, e.Wt(r.state), r.id;
870
870
  }
871
871
  Vi(t, e, i) {
872
- const r = this.Ki(w.ARC, i), s = r.params;
872
+ const r = this.Ki(b.ARC, i), s = r.params;
873
873
  return s.width = t.width, s.height = t.height, s.start = t.start, s.stop = t.stop, e.Wt(r.state), r.id;
874
874
  }
875
875
  Ji(t, e, i) {
876
- const r = this.Ki(w.TRIANGLE, i), s = r.params;
876
+ const r = this.Ki(b.TRIANGLE, i), s = r.params;
877
877
  return s.x1 = t.x1, s.y1 = t.y1, s.x2 = t.x2, s.y2 = t.y2, s.x3 = t.x3, s.y3 = t.y3, e.Wt(r.state), r.id;
878
878
  }
879
879
  te(t, e, i) {
880
- const r = this.Ki(w.BEZIER_CURVE, i), s = r.params;
880
+ const r = this.Ki(b.BEZIER_CURVE, i), s = r.params;
881
881
  return s.x1 = t.x1, s.y1 = t.y1, s.cp1x = t.cp1x, s.cp1y = t.cp1y, s.cp2x = t.cp2x, s.cp2y = t.cp2y, s.x2 = t.x2, s.y2 = t.y2, s.thickness = t.thickness, s.segments = t.segments, e.Wt(r.state), r.id;
882
882
  }
883
883
  wi() {
@@ -942,7 +942,7 @@ class me {
942
942
  return new q(this.A, rt, t);
943
943
  }
944
944
  ye(t, e, i, r) {
945
- t instanceof X || !r || t.Ae(r), this.re.Wi({ width: e ?? t.width, height: i ?? t.height }, this.ee, t.ut());
945
+ t instanceof Z || !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 X(this.A, t, e, i, r, this);
972
+ return new Z(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 be {
1045
+ class Ee {
1046
1046
  constructor(t) {
1047
1047
  a(this, "b");
1048
1048
  a(this, "p", 0);
@@ -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[Ee(l, c)] = o;
1084
+ u || (u = [], h.set(c, u)), u[we(l, c)] = o;
1085
1085
  }
1086
1086
  return { min: t, max: e, table: h };
1087
1087
  }
@@ -1097,12 +1097,12 @@ function at(n, t) {
1097
1097
  }
1098
1098
  throw Error("Invalid Huffman code");
1099
1099
  }
1100
- function Ee(n, t) {
1100
+ function we(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;
1104
1104
  }
1105
- function we(n) {
1105
+ function be(n) {
1106
1106
  if (n.length < 2) throw Error("ZLIB data too short");
1107
1107
  const t = n[0], e = n[1];
1108
1108
  if ((15 & t) != 8) throw Error("Unsupported ZLIB compression method");
@@ -1133,28 +1133,28 @@ function we(n) {
1133
1133
  for (let A = 280; A <= 287; A++) v[A] = 8;
1134
1134
  g = H(v), p = H(Array(32).fill(5));
1135
1135
  } else {
1136
- const v = s.readBits(5) + 257, A = s.readBits(5) + 1, m = s.readBits(4) + 4, b = [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[b[T]] = s.readBits(3);
1138
- const x = H(y), E = [];
1139
- for (; E.length < v + A; ) {
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; ) {
1140
1140
  const T = at(s, x);
1141
- if (T <= 15) E.push(T);
1141
+ if (T <= 15) w.push(T);
1142
1142
  else if (T === 16) {
1143
- const L = s.readBits(2) + 3, F = E[E.length - 1] || 0;
1144
- for (let Q = 0; Q < L; Q++) E.push(F);
1143
+ const L = s.readBits(2) + 3, F = w[w.length - 1] || 0;
1144
+ for (let Q = 0; Q < L; Q++) w.push(F);
1145
1145
  } else if (T === 17) {
1146
1146
  const L = s.readBits(3) + 3;
1147
- for (let F = 0; F < L; F++) E.push(0);
1147
+ for (let F = 0; F < L; F++) w.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++) E.push(0);
1152
+ for (let F = 0; F < L; F++) w.push(0);
1153
1153
  }
1154
1154
  }
1155
1155
  }
1156
- const C = E.slice(0, v), P = E.slice(v, v + A);
1157
- g = H(C), p = H(P);
1156
+ const C = w.slice(0, v), M = w.slice(v, v + A);
1157
+ g = H(C), p = H(M);
1158
1158
  }
1159
1159
  for (; ; ) {
1160
1160
  const v = at(s, g);
@@ -1164,23 +1164,23 @@ function we(n) {
1164
1164
  if (v > 256 && v < 286) {
1165
1165
  const A = v - 257;
1166
1166
  let m = o[A];
1167
- const b = c[A];
1168
- b && (m += s.readBits(b));
1167
+ const E = c[A];
1168
+ E && (m += s.readBits(E));
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 E = u[y];
1173
- E && (x += s.readBits(E));
1172
+ const w = u[y];
1173
+ w && (x += s.readBits(w));
1174
1174
  const C = h.length - x;
1175
1175
  if (C < 0) throw Error("Invalid distance");
1176
- for (let P = 0; P < m; P++) h.push(h[C + P] || 0);
1176
+ for (let M = 0; M < m; M++) h.push(h[C + M] || 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 be(n.subarray(i)), r), new Uint8Array(r);
1183
+ }(new Ee(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 b = t.readASCII(e, o, 4), y = t.readUint(e, o + 4), x = t.readUint(e, o + 8), E = t.readUint(e, o + 12), C = t.readUint(e, o + 16);
1192
- h.push({ tag: b, offset: y, compLength: x, origLength: E, checksum: C }), o += 20;
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;
1193
1193
  }
1194
1194
  for (const m of h) {
1195
- const b = new Uint8Array(e.buffer, m.offset, m.compLength);
1196
- if (m.compLength === m.origLength) m.data = new Uint8Array(b);
1197
- else if (m.data = we(b), m.data.length !== m.origLength) if (m.data.length < m.origLength) {
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) {
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 b = m.data;
1215
- if (m.tag === "head" && b.length >= 12) {
1216
- const y = new Uint8Array(b);
1214
+ let E = m.data;
1215
+ if (m.tag === "head" && E.length >= 12) {
1216
+ const y = new Uint8Array(E);
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(b, 0, K(b.length))), A += 4;
1219
+ B(v, A, ot(E, 0, K(E.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 b = p[m.tag];
1224
- v.set(m.data, b);
1223
+ const E = p[m.tag];
1224
+ v.set(m.data, E);
1225
1225
  }
1226
1226
  if (h.find((m) => m.tag === "head")) {
1227
- const m = p.head, b = function(y, x) {
1228
- const E = x + 8, C = [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] = C[0], y[E + 1] = C[1], y[E + 2] = C[2], y[E + 3] = C[3], P >>> 0;
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;
1232
1232
  }(v, m);
1233
- B(v, m + 8, b);
1233
+ B(v, m + 8, E);
1234
1234
  }
1235
1235
  return v.buffer;
1236
1236
  }
@@ -1299,7 +1299,7 @@ const Te = { parseTab(n, t, e) {
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
- } }, Et = { cmap: Te, head: Re, hhea: Ce, maxp: { parseTab(n, t, e) {
1302
+ } }, wt = { cmap: Te, head: Re, hhea: Ce, 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
1305
  } }, hmtx: Fe, loca: { parseTab(n, t, e, i) {
@@ -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 = j.findTable(i, "glyf", n.ke);
1317
+ const s = V.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
- } } }, j = { parse(n) {
1352
+ } } }, V = { 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 = Et, r = {}, s = { ze: e, De: 0, ke: 0 };
1355
+ const e = new Uint8Array(n), i = wt, r = {}, s = { ze: e, De: 0, ke: 0 };
1356
1356
  for (const h in i) {
1357
- const o = h, c = j.findTable(e, o, 0);
1357
+ const o = h, c = V.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: Et, B: R };
1377
- class Me {
1376
+ }, T: wt, B: R };
1377
+ class Pe {
1378
1378
  Le(t) {
1379
1379
  var i;
1380
1380
  const e = [];
@@ -1430,7 +1430,7 @@ class Me {
1430
1430
  return 0;
1431
1431
  }
1432
1432
  }
1433
- class Pe {
1433
+ class Me {
1434
1434
  constructor(t) {
1435
1435
  a(this, "He");
1436
1436
  a(this, "Ge");
@@ -1451,8 +1451,8 @@ class Pe {
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), b = A + 0.5 * (e.width - f), y = m + s.hhea.ascender * h;
1455
- this.Ye(u, b, 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), E = A + 0.5 * (e.width - f), y = m + s.hhea.ascender * h;
1455
+ this.Ye(u, E, y, h);
1456
1456
  }
1457
1457
  }
1458
1458
  Ye(t, e, i, r) {
@@ -1475,21 +1475,21 @@ class Pe {
1475
1475
  } else {
1476
1476
  const v = e + s[p] * r, A = i - h[p] * r;
1477
1477
  if (p + 1 > f) {
1478
- const b = e + s[l] * r, y = i - h[l] * r;
1479
- if (1 & c[l]) this.Ge.quadraticCurveTo(v, A, b, y);
1478
+ const E = e + s[l] * r, y = i - h[l] * r;
1479
+ if (1 & c[l]) this.Ge.quadraticCurveTo(v, A, E, y);
1480
1480
  else {
1481
- const x = (v + b) / 2, E = (A + y) / 2;
1482
- this.Ge.quadraticCurveTo(v, A, x, E);
1481
+ const x = (v + E) / 2, w = (A + y) / 2;
1482
+ this.Ge.quadraticCurveTo(v, A, x, w);
1483
1483
  }
1484
1484
  break;
1485
1485
  }
1486
1486
  const m = p + 1;
1487
1487
  if (1 & c[m]) {
1488
- const b = e + s[m] * r, y = i - h[m] * r;
1489
- this.Ge.quadraticCurveTo(v, A, b, y), p = m + 1;
1488
+ const E = e + s[m] * r, y = i - h[m] * r;
1489
+ this.Ge.quadraticCurveTo(v, A, E, y), p = m + 1;
1490
1490
  } else {
1491
- const b = (v + (e + s[m] * r)) / 2, y = (A + (i - h[m] * r)) / 2;
1492
- this.Ge.quadraticCurveTo(v, A, b, y), p = m;
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;
1493
1493
  }
1494
1494
  }
1495
1495
  this.Ge.closePath();
@@ -1500,7 +1500,7 @@ class Pe {
1500
1500
  this.Ge.fill();
1501
1501
  }
1502
1502
  }
1503
- class Pt {
1503
+ class Mt {
1504
1504
  je(t, e) {
1505
1505
  const i = t.cmap;
1506
1506
  if (!i || !i.tables) return 0;
@@ -1550,7 +1550,7 @@ class Pt {
1550
1550
  class Se {
1551
1551
  constructor() {
1552
1552
  a(this, "Je");
1553
- this.Je = new Pt();
1553
+ this.Je = new Mt();
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 Pt();
1570
+ this.sr = new Mt();
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 = j.T.glyf.Se(t, r);
1587
+ const h = V.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 Me(), this.mr = new Pe(t), this._r = new Se(), this.yr = new Ue();
1607
+ this.lr = e, this.gr = new Pe(), this.mr = new Me(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/PVoaGVhAAARXAAAABkAAAAkCwEFAmhtdHgAABF4AAAAh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AAEBYBpIAAAB42mNgZoCANAZjIMnIgAYADecAng==")).arrayBuffer();
1618
- await this.br(e), this.nr = j.parse(e)[0], await this.Cr();
1618
+ await this.br(e), this.nr = V.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 = j.parse(i);
1632
+ const r = V.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 De {
1775
+ class _e {
1776
1776
  constructor(t = {}) {
1777
1777
  a(this, "kr");
1778
1778
  a(this, "Nr", null);
@@ -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 z extends St {
2031
+ class k 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 z 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 z(h, t, o, e, c, l, r, s);
2040
+ return new k(h, t, o, e, c, l, r, s);
2041
2041
  }
2042
2042
  $n() {
2043
2043
  return this.ln;
@@ -2308,7 +2308,7 @@ class Nt {
2308
2308
  return this.Ho[t] || t.toLowerCase();
2309
2309
  }
2310
2310
  }
2311
- const _e = Object.freeze(Object.defineProperty({ __proto__: null, KeyboardManager: Nt }, Symbol.toStringTag, { value: "Module" }));
2311
+ const De = 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) && Y(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) && 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));
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 = Y(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 = z(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 = Y(r.x, r.y, s.x, s.y) / this.sh.initialDistance, o = h - this.sh.lastScale;
2495
+ const h = z(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 = Y(t.startPosition.clientX, t.startPosition.clientY, t.lastPosition.clientX, t.lastPosition.clientY);
2507
+ const i = performance.now(), r = i - t.startTime, s = z(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,7 +2514,7 @@ 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 : Y(t.clientX, t.clientY, this.Sh.clientX, this.Sh.clientY) <= this.Ch;
2517
+ return !this.Sh || e - this.Rh > this.bh ? !1 : z(t.clientX, t.clientY, this.Sh.clientX, this.Sh.clientY) <= this.Ch;
2518
2518
  }
2519
2519
  Zh(t) {
2520
2520
  return { ...t };
@@ -2597,7 +2597,7 @@ class nt extends St {
2597
2597
  return !this.ra.paused && !this.ra.ended;
2598
2598
  }
2599
2599
  }
2600
- const Ze = (n) => class extends n {
2600
+ const Xe = (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 Ze = (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 X && this.Z.ct();
2718
+ this.Z.ye(t, e, i, r), t instanceof Z && this.Z.ct();
2719
2719
  }
2720
2720
  async loadImage(t) {
2721
2721
  if (typeof t != "string")
2722
- return z.Tn(this.Z, this.gn, t, this.grid.cols, this.grid.rows);
2722
+ return k.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 z.Tn(this.Z, this.gn, i, this.grid.cols, this.grid.rows);
2727
+ return k.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
- }, Xe = (n) => class extends n {
2732
+ }, Ze = (n) => class extends n {
2733
2733
  get frameCount() {
2734
2734
  return this.aa.Kn;
2735
2735
  }
@@ -2751,7 +2751,7 @@ const Ze = (n) => class extends n {
2751
2751
  isLooping() {
2752
2752
  return this.aa.Yn;
2753
2753
  }
2754
- }, ze = (n) => class extends n {
2754
+ }, ke = (n) => class extends n {
2755
2755
  constructor(...t) {
2756
2756
  super(...t);
2757
2757
  }
@@ -2776,7 +2776,7 @@ const Ze = (n) => class extends n {
2776
2776
  cursor(t) {
2777
2777
  this.qo.mo(t);
2778
2778
  }
2779
- }, ke = (n) => class extends n {
2779
+ }, Ye = (n) => class extends n {
2780
2780
  constructor(...t) {
2781
2781
  super(...t);
2782
2782
  }
@@ -2813,7 +2813,7 @@ const Ze = (n) => class extends n {
2813
2813
  get touches() {
2814
2814
  return this.la.Bh();
2815
2815
  }
2816
- }, Ye = (n) => class extends n {
2816
+ }, ze = (n) => class extends n {
2817
2817
  constructor(...t) {
2818
2818
  super(...t);
2819
2819
  }
@@ -2897,8 +2897,8 @@ class Ge {
2897
2897
  }
2898
2898
  }
2899
2899
  }
2900
- const V = `#version 300 es
2901
- in vec2 A0;in vec2 A1;out vec2 v_uv;void main(){v_uv=A1;gl_Position=vec4(A0,0.,1.);}`, Dt = `#version 300 es
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
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
2903
  class It {
2904
2904
  constructor() {
@@ -2949,7 +2949,7 @@ class It {
2949
2949
  });
2950
2950
  }
2951
2951
  }
2952
- class _t {
2952
+ class Dt {
2953
2953
  constructor(t = "active") {
2954
2954
  a(this, "Ia");
2955
2955
  a(this, "Ha", "");
@@ -3025,15 +3025,15 @@ 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 Zt(n) {
3028
+ function Xt(n) {
3029
3029
  return n.mode === "light" ? ["#E91E63", "#9C27B0", "#FF6F00"] : ["#8EF9F3", "#F15BB5", "#FF9B71"];
3030
3030
  }
3031
- function Xt(n, t) {
3031
+ function Zt(n, t) {
3032
3032
  return n.length ? n.map((e) => t.color(e)) : [t.color("#FFFFFF")];
3033
3033
  }
3034
- class zt {
3035
- constructor(t, e, i) {
3036
- this.hc = t, this.id = e, this.label = i;
3034
+ class kt {
3035
+ constructor(t, e, i, r) {
3036
+ this.hc = t, this.id = e, this.label = i, this.ac = r;
3037
3037
  }
3038
3038
  report(t) {
3039
3039
  this.hc.Da(this.id, t);
@@ -3042,14 +3042,14 @@ class zt {
3042
3042
  this.hc.La(this.id);
3043
3043
  }
3044
3044
  fail(t) {
3045
- this.hc.Oa(this.id);
3045
+ this.hc.Oa(this.id), this.ac && this.ac(t ?? Error(`Loading phase "${this.label}" failed`));
3046
3046
  }
3047
3047
  async track(t) {
3048
3048
  try {
3049
3049
  const e = typeof t == "function" ? await t() : await t;
3050
3050
  return this.complete(), e;
3051
3051
  } catch (e) {
3052
- throw this.fail(), e;
3052
+ throw this.fail(e instanceof Error ? e : e + ""), e;
3053
3053
  }
3054
3054
  }
3055
3055
  }
@@ -3058,20 +3058,20 @@ const He = ({ textmodifier: n, grid: t, progress: e, frameCount: i, message: r,
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", b = -Math.floor(m.length / 2);
3062
- n.push(), n.translate(b, 0, 0);
3061
+ const m = "SETUP ERROR", E = -Math.floor(m.length / 2);
3062
+ n.push(), n.translate(E, 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 E = Math.floor(0.8 * t.cols), C = u.split(" "), P = [];
3067
+ const w = Math.floor(0.8 * t.cols), C = u.split(" "), M = [];
3068
3068
  let T = "";
3069
- for (const F of C) (T + " " + F).length <= E ? T = T ? T + " " + F : F : (T && P.push(T), T = F);
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((F, Q) => {
3073
- const Vt = -Math.floor(F.length / 2);
3074
- n.push(), n.translate(Vt, 3 + Q, 0);
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
3075
  for (const Qt of F) n.char(Qt), n.rect(1, 1), n.translateX(1);
3076
3076
  n.pop();
3077
3077
  });
@@ -3079,28 +3079,27 @@ const He = ({ textmodifier: n, grid: t, progress: e, frameCount: i, message: r,
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), b = 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), E = 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 E = x < b ? "*" : ".", C = y[x % y.length], P = n.color(C.r, C.g, C.b, p);
3086
- n.charColor(P), n.char(E), n.rect(1, 1), n.translateX(1);
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);
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 b = -Math.floor(r.length / 2);
3094
- n.push(), n.translate(b, 5, 0);
3093
+ const E = -Math.floor(r.length / 2);
3094
+ n.push(), n.translate(E, 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, "ac");
3102
- a(this, "nc");
3103
3101
  a(this, "cc");
3102
+ a(this, "nc");
3104
3103
  a(this, "lc");
3105
3104
  a(this, "uc");
3106
3105
  a(this, "fc");
@@ -3108,168 +3107,169 @@ class it {
3108
3107
  a(this, "vc");
3109
3108
  a(this, "gc");
3110
3109
  a(this, "mc");
3111
- a(this, "nr");
3112
3110
  a(this, "_c");
3111
+ a(this, "nr");
3113
3112
  a(this, "yc");
3114
3113
  a(this, "wc");
3115
3114
  a(this, "bc");
3116
- a(this, "Cc", null);
3117
- a(this, "xc", !1);
3118
- a(this, "Mc", []);
3119
- this.ac = e.visible ?? !0, this.nc = e.opacity ?? 1, this.cc = e.blendMode ?? "normal", this.lc = e.offsetX ?? 0, this.uc = e.offsetY ?? 0, this.fc = e.rotation ?? 0, this.dc = e.fontSize ?? 16, this.vc = e.fontSource, e.fontSource instanceof et ? this.nr = e.fontSource : this.nr = new et(t, this.dc);
3120
- }
3121
- async Fc(t) {
3122
- this.gc = t, this.nr.Tr || await this.nr.wr(this.vc);
3115
+ 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);
3123
3123
  const e = this.nr.maxGlyphDimensions;
3124
- this.mc = new Le(this.gc.canvas.canvas, e.width, e.height);
3125
- const i = this.mc;
3126
- this._c = this.gc.createFramebuffer(i.cols, i.rows, 3), this.yc = this.gc.createFramebuffer(i.width, i.height, 1), this.wc = this.gc.createFramebuffer(i.width, i.height, 1), this.bc = [this.gc.createFramebuffer(i.width, i.height, 1, { depth: !1 }), this.gc.createFramebuffer(i.width, i.height, 1, { depth: !1 })], this.xc = !1, this.mc.Hr(() => {
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(() => {
3127
3127
  var r, s, h;
3128
- this._c.resize(this.mc.cols, this.mc.rows), this.yc.resize(this.mc.width, this.mc.height), (r = this.wc) == null || r.resize(this.mc.width, this.mc.height), (s = this.bc) == null || s[0].resize(this.mc.width, this.mc.height), (h = this.bc) == null || h[1].resize(this.mc.width, this.mc.height);
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);
3129
3129
  });
3130
3130
  }
3131
- $c() {
3132
- return this.Cc !== null;
3131
+ Pc() {
3132
+ return this.xc !== null;
3133
3133
  }
3134
- Pc(t) {
3135
- this.Cc && this.Cc.call(t);
3134
+ Tc(t) {
3135
+ this.xc && this.xc.call(t);
3136
3136
  }
3137
3137
  draw(t) {
3138
- this.Cc = t;
3138
+ this.xc = t;
3139
3139
  }
3140
3140
  show() {
3141
- this.ac = !0;
3141
+ this.cc = !0;
3142
3142
  }
3143
3143
  hide() {
3144
- this.ac = !1;
3144
+ this.cc = !1;
3145
3145
  }
3146
3146
  opacity(t) {
3147
3147
  if (t === void 0) return this.nc;
3148
3148
  this.nc = Math.min(1, Math.max(0, t));
3149
3149
  }
3150
3150
  blendMode(t) {
3151
- if (t === void 0) return this.cc;
3152
- this.cc = t;
3151
+ if (t === void 0) return this.lc;
3152
+ this.lc = t;
3153
3153
  }
3154
3154
  offset(t, e = 0) {
3155
- if (t === void 0) return { x: this.lc, y: this.uc };
3156
- this.lc = t, this.uc = e;
3155
+ if (t === void 0) return { x: this.uc, y: this.fc };
3156
+ this.uc = t, this.fc = e;
3157
3157
  }
3158
3158
  rotateZ(t) {
3159
- if (t === void 0) return this.fc;
3160
- this.fc = t;
3159
+ if (t === void 0) return this.dc;
3160
+ this.dc = t;
3161
3161
  }
3162
3162
  filter(t, e) {
3163
- this.Mc.push({ name: t, params: e });
3163
+ this.Fc.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.Tc();
3167
+ this.nr.Mr(t), this.Ec();
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.Tc(), this.nr;
3171
+ return t instanceof et ? (this.nr = t, this.nr.Tr || await this.nr.wr()) : await this.nr.Fr(t), this.Ec(), this.nr;
3172
3172
  }
3173
3173
  ca(t, e, i) {
3174
3174
  const r = i == null ? void 0 : i.fallbackDraw;
3175
- if (!this.ac) return void (this.xc = !1);
3176
- if (!this.Cc && !r) return void (this.xc = !1);
3177
- const s = this.gc.renderer;
3178
- this._c.begin(), s.state.qt(), t.dn = this.nr, t.Uc = this.mc;
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;
3179
3179
  try {
3180
- this.Cc ? this.Cc.call(t) : r == null || r();
3180
+ this.xc ? this.xc.call(t) : r == null || r();
3181
3181
  } finally {
3182
- t.dn = void 0, t.Uc = void 0;
3182
+ t.dn = void 0, t.Rc = void 0;
3183
3183
  }
3184
- this._c.end();
3185
- const h = this.Mc.length > 0, o = h ? this.wc : this.yc;
3184
+ this.yc.end();
3185
+ const h = this.Fc.length > 0, o = h ? this.bc : this.wc;
3186
3186
  o.begin(), s.ve(e);
3187
- const c = this.mc;
3188
- e.O({ u_characterTexture: this.nr.fontFramebuffer, u_charsetDimensions: [this.nr.textureColumns, this.nr.textureRows], Ul: this._c.textures[0], Um: this._c.textures[1], Un: this._c.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.gc.filterManager.Ec(this.wc.textures[0], this.yc, this.Mc, this.yc.width, this.yc.height, this.bc), this.Mc = [], this.xc = !0;
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;
3189
3189
  }
3190
3190
  Jr() {
3191
3191
  var t;
3192
- this._c && this.yc && ((t = this.mc) == null || t.ti());
3192
+ this.yc && this.wc && ((t = this._c) == null || t.ti());
3193
3193
  }
3194
3194
  gt() {
3195
3195
  var t, e, i, r, s, h, o;
3196
- (t = this._c) == null || t.gt(), (e = this.yc) == null || e.gt(), (i = this.wc) == null || i.gt(), (r = this.bc) == null || r[0].gt(), (s = this.bc) == null || s[1].gt(), (h = this.nr) == null || h.gt(), (o = this.mc) == null || o.gt();
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();
3197
3197
  }
3198
3198
  get texture() {
3199
3199
  var t;
3200
- return (t = this.yc) == null ? void 0 : t.textures[0];
3200
+ return (t = this.wc) == null ? void 0 : t.textures[0];
3201
3201
  }
3202
3202
  get grid() {
3203
- return this.mc;
3203
+ return this._c;
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.yc ? this.yc.width : 0;
3210
+ return this.wc ? this.wc.width : 0;
3211
3211
  }
3212
3212
  get height() {
3213
- return this.yc ? this.yc.height : 0;
3213
+ return this.wc ? this.wc.height : 0;
3214
3214
  }
3215
- get Rc() {
3216
- return this.xc;
3215
+ get zc() {
3216
+ return this.Mc;
3217
3217
  }
3218
3218
  get drawFramebuffer() {
3219
- return this._c;
3219
+ return this.yc;
3220
3220
  }
3221
3221
  get asciiFramebuffer() {
3222
- return this.yc;
3222
+ return this.wc;
3223
3223
  }
3224
- Tc() {
3225
- if (!this.mc || !this.nr) return;
3224
+ Ec() {
3225
+ if (!this._c || !this.nr) return;
3226
3226
  const t = this.nr.maxGlyphDimensions;
3227
- this.mc.Qr(t.width, t.height), this._c && this.yc && this.Jr();
3227
+ this._c.Qr(t.width, t.height), this.yc && this.wc && this.Jr();
3228
3228
  }
3229
3229
  }
3230
3230
  const We = { message: "LOADING...", tone: "auto", transition: "fade", transitionDuration: 500 };
3231
- class kt {
3231
+ class Yt {
3232
3232
  constructor(t, e, i) {
3233
3233
  a(this, "fa");
3234
3234
  a(this, "l");
3235
- a(this, "Sc");
3236
- a(this, "hc");
3237
- a(this, "zc");
3238
3235
  a(this, "kc");
3236
+ a(this, "hc");
3239
3237
  a(this, "Dc");
3240
3238
  a(this, "Lc");
3241
- a(this, "Oc", []);
3239
+ a(this, "Oc");
3242
3240
  a(this, "Bc");
3243
- a(this, "Ic", performance.now());
3244
- a(this, "Hc", 0);
3245
- a(this, "Gc", !1);
3241
+ a(this, "Ic", []);
3242
+ a(this, "Hc");
3243
+ a(this, "Gc", performance.now());
3244
+ a(this, "Qc", 0);
3245
+ a(this, "Nc", !1);
3246
3246
  a(this, "Ar", !1);
3247
- a(this, "jc");
3248
- this.fa = t, this.l = { ...We, ...e ?? {} }, this.Sc = new _t("active"), this.hc = new It(), this.zc = new Ot(this.l.transition, this.l.transitionDuration), this.kc = new Ut(60), this.Bc = gt(this.l, i);
3249
- const r = Zt(this.Bc);
3250
- this.Oc = Xt(r, this.fa), this.Lc = this.Qc(), this.hc.za((s) => {
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
3251
  s >= 0.999 && this.Wa();
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.Nc;
3257
- this.Dc = new it(t, { visible: !0, opacity: 1, fontSize: 16 }), await this.Dc.Fc({ 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.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;
3258
3258
  }
3259
3259
  get Xa() {
3260
- return this.Sc.Xa && this.Gc;
3260
+ return this.kc.Xa && this.Nc;
3261
3261
  }
3262
3262
  In() {
3263
- this.Gc || (this.Gc = !0, this.Ic = performance.now(), this.Hc = 0, this.kc.In(() => this.Xc()));
3263
+ this.Nc || (this.Nc = !0, this.Gc = performance.now(), this.Qc = 0, this.Lc.In(() => this.jc()));
3264
3264
  }
3265
3265
  Hn() {
3266
- this.Gc && (this.Gc = !1, this.kc.Hn());
3266
+ this.Nc && (this.Nc = !1, this.Lc.Hn());
3267
3267
  }
3268
3268
  Jr() {
3269
- this.Ar && this.Dc.Jr();
3269
+ this.Ar && this.Oc.Jr();
3270
3270
  }
3271
3271
  gt() {
3272
- this.Hn(), this.Ar && (this.Dc.gt(), this.Ar = !1);
3272
+ this.Hn(), this.Ar && (this.Oc.gt(), this.Ar = !1);
3273
3273
  }
3274
3274
  get progress() {
3275
3275
  return this.hc.Sa;
@@ -3278,36 +3278,36 @@ class kt {
3278
3278
  return typeof t == "string" && (this.l.message = t), this.l.message;
3279
3279
  }
3280
3280
  addPhase(t, e = 1) {
3281
- this.Sc.Ka();
3281
+ this.kc.Ka();
3282
3282
  const i = this.hc.ka(t, e);
3283
- return new zt(this.hc, i, t);
3283
+ return new kt(this.hc, i, t, (r) => this.error(r));
3284
3284
  }
3285
3285
  Wa() {
3286
- this.l.transition !== "none" && this.l.transitionDuration > 0 ? (this.Sc.Za(), this.zc.In()) : (this.Sc.Wa(), this.Hn(), this.Yc());
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()));
3287
3287
  }
3288
- Yc() {
3289
- this.jc && this.jc();
3288
+ Kc() {
3289
+ this.Wc && this.Wc();
3290
3290
  }
3291
- Kc(t) {
3292
- this.jc = t;
3291
+ Zc(t) {
3292
+ this.Wc = t;
3293
3293
  }
3294
3294
  error(t) {
3295
- this.Sc.Va(t);
3295
+ this.kc.Va(t);
3296
3296
  }
3297
- Xc() {
3298
- if (this.Sc.Xa) {
3299
- if (this.Hc++, this.Sc.Qa === "transitioning" && this.zc.et())
3300
- return this.Sc.qa(), this.Yc(), void this.Hn();
3301
- this.Wc();
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();
3302
3302
  }
3303
3303
  }
3304
- Wc() {
3304
+ qc() {
3305
3305
  if (!this.Ar) return;
3306
- const t = this.Dc, e = t.grid, i = this.fa.Z, r = this.fa.Zc, s = this.fa.qc, h = { textmodifier: this.fa, grid: e, progress: this.progress, elapsedMs: performance.now() - this.Ic, frameCount: this.Hc, message: this.l.message, palette: this.Oc, theme: this.Bc, phases: this.hc.Ba(), transitionOpacity: this.zc.nc, isError: this.Sc.Qa === "error", errorMessage: this.Sc.Ya || void 0, errorDetails: this.Sc.ja || void 0 };
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 };
3307
3307
  t.draw(() => {
3308
3308
  this.fa.clear(), this.fa.push();
3309
3309
  try {
3310
- this.Lc(h);
3310
+ this.Bc(h);
3311
3311
  } finally {
3312
3312
  this.fa.pop();
3313
3313
  }
@@ -3315,158 +3315,158 @@ class kt {
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
- Vc(t) {
3319
- this.Bc = gt(this.l, t);
3318
+ tl(t) {
3319
+ this.Hc = gt(this.l, t);
3320
3320
  }
3321
- Qc() {
3321
+ Xc() {
3322
3322
  const t = this.l.renderer || He;
3323
3323
  return (e) => {
3324
- t(e), this.Jc(e);
3324
+ t(e), this.sl(e);
3325
3325
  };
3326
3326
  }
3327
- Jc(t) {
3327
+ sl(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), b = e.color(p, v, A, m);
3332
- e.charColor(b), 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), E = e.color(p, v, A, m);
3332
+ e.charColor(E), e.char(d), e.point(), e.translateX(1);
3333
3333
  }
3334
3334
  e.pop();
3335
3335
  }
3336
3336
  }
3337
- const wt = { 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 Yt {
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 {
3339
3339
  constructor(t, e, i) {
3340
3340
  a(this, "Z");
3341
- a(this, "tl");
3342
- a(this, "bc");
3343
- a(this, "sl", 0);
3344
- this.Z = t, this.tl = t.pe(V, `#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.bc = [this.Z.Pe(e, i, 1), this.Z.Pe(e, i, 1)];
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)];
3346
3346
  }
3347
- il(t) {
3347
+ rl(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.bc[0];
3351
- f.begin(), this.Z.wi(...s), f.end(), this.sl = 0, i.layer.ac && this.el(i.texture, o, c, i.width, i.height, i.layer.nc, i.offsetX, i.offsetY, i.layer.fc, "normal", e);
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);
3352
3352
  for (const d of h) {
3353
3353
  const g = d.layer;
3354
- g.ac && g.Rc && this.el(d.texture, o, c, d.width, d.height, g.nc, d.offsetX, d.offsetY, g.fc, g.cc, e);
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);
3355
3355
  }
3356
- this.rl(r, o, c, e), e.depthMask(u), l && e.enable(e.DEPTH_TEST);
3356
+ this.ol(r, o, c, e), e.depthMask(u), l && e.enable(e.DEPTH_TEST);
3357
3357
  }
3358
- el(t, e, i, r, s, h, o, c, l, u, f) {
3359
- const d = this.bc[this.sl], g = this.sl === 0 ? 1 : 0, p = this.bc[g], v = l * (Math.PI / 180);
3360
- p.begin(), f.disable(f.BLEND), this.Z.ve(this.tl), this.tl.O({ Ud: t, Ue: d.textures[0], Uf: [e, i], Ug: [r, s], Uh: [o, c], Ui: h, Uj: v, Uk: wt[u] }), this.Z.we(0, 0, d.width, d.height), p.end(), this.sl = g;
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;
3361
3361
  }
3362
- rl(t, e, i, r) {
3363
- const s = this.bc[this.sl];
3364
- t.begin(), r.disable(r.BLEND), this.Z.ve(this.tl), this.tl.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: wt.normal }), this.Z.we(0, 0, e, i), t.end();
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();
3365
3365
  }
3366
3366
  Jr(t, e) {
3367
- this.bc[0].resize(t, e), this.bc[1].resize(t, e);
3367
+ this.Cc[0].resize(t, e), this.Cc[1].resize(t, e);
3368
3368
  }
3369
3369
  gt() {
3370
- this.tl.dispose(), this.bc[0].gt(), this.bc[1].gt();
3370
+ this.il.dispose(), this.Cc[0].gt(), this.Cc[1].gt();
3371
3371
  }
3372
3372
  }
3373
3373
  class Gt {
3374
3374
  constructor(t, e) {
3375
3375
  a(this, "fa");
3376
3376
  a(this, "Z");
3377
- a(this, "nl");
3378
- a(this, "ol");
3379
- a(this, "hl", []);
3380
- a(this, "al", []);
3381
- a(this, "cl");
3382
- a(this, "ll", !1);
3383
- a(this, "ul", /* @__PURE__ */ new Set());
3384
- this.fa = t, this.Z = t.Z, this.nl = t.Zc, this.ol = new Yt(this.Z, this.fa.kr.width, this.fa.kr.height), this.cl = new it(this.Z, { visible: !0, opacity: 1, fontSize: e.fontSize, fontSource: e.fontSource });
3377
+ a(this, "hl");
3378
+ a(this, "al");
3379
+ a(this, "cl", []);
3380
+ 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 });
3385
3385
  }
3386
3386
  async wr() {
3387
- if (!this.ll) {
3388
- await this.fl(this.cl);
3389
- for (const t of this.hl) await this.fl(t), this.al.push(t);
3390
- this.hl = [], this.ll = !0;
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;
3391
3391
  }
3392
3392
  }
3393
3393
  add(t = {}) {
3394
3394
  const e = new it(this.Z, t);
3395
- return this.ll ? (this.fl(e), this.al.push(e)) : this.hl.push(e), e;
3395
+ return this.fl ? (this.vl(e), this.ll.push(e)) : this.cl.push(e), e;
3396
3396
  }
3397
3397
  remove(t) {
3398
- this.dl(this.al, t) || this.dl(this.hl, t);
3398
+ this.pl(this.ll, t) || this.pl(this.cl, t);
3399
3399
  }
3400
3400
  move(t, e) {
3401
- this.vl(this.al, t, e) || this.vl(this.hl, t, e);
3401
+ this.ml(this.ll, t, e) || this.ml(this.cl, t, e);
3402
3402
  }
3403
3403
  swap(t, e) {
3404
- t !== e && (this.pl(this.al, t, e) || this.pl(this.hl, t, e));
3404
+ t !== e && (this._l(this.ll, t, e) || this._l(this.cl, t, e));
3405
3405
  }
3406
3406
  clear() {
3407
- this.cl.gt(), this.al.forEach((t) => t.gt()), this.al = [], this.hl.forEach((t) => t.gt()), this.hl = [];
3407
+ this.ul.gt(), this.ll.forEach((t) => t.gt()), this.ll = [], this.cl.forEach((t) => t.gt()), this.cl = [];
3408
3408
  }
3409
- ml(t, e) {
3410
- this.cl.ca(this.fa, this.nl, { fallbackDraw: e });
3409
+ yl(t, e) {
3410
+ this.ul.ca(this.fa, this.hl, { fallbackDraw: e });
3411
3411
  const i = [...this.Z.state.canvasBackgroundColor];
3412
- this._l(), this.yl(t, i);
3412
+ this.Al(), this.wl(t, i);
3413
3413
  }
3414
- _l() {
3415
- this.al.length !== 0 && this.al.forEach((t) => t.ca(this.fa, this.nl));
3414
+ Al() {
3415
+ this.ll.length !== 0 && this.ll.forEach((t) => t.ca(this.fa, this.hl));
3416
3416
  }
3417
- yl(t, e) {
3418
- const i = this.fa.kr, r = this.cl.grid, s = this.cl.texture;
3417
+ wl(t, e) {
3418
+ const i = this.fa.kr, r = this.ul.grid, s = this.ul.texture;
3419
3419
  if (!s) return;
3420
- const h = { layer: this.cl, texture: s, width: r.width, height: r.height, offsetX: r.offsetX + this.cl.lc, offsetY: r.offsetY + this.cl.uc }, o = this.al.map((c) => {
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) => {
3421
3421
  const l = c.grid;
3422
- return { layer: c, texture: c.texture, width: l.width, height: l.height, offsetX: l.offsetX + c.lc, offsetY: l.offsetY + c.uc };
3422
+ return { layer: c, texture: c.texture, width: l.width, height: l.height, offsetX: l.offsetX + c.uc, offsetY: l.offsetY + c.fc };
3423
3423
  });
3424
- this.ol.il({ base: h, layers: o, targetFramebuffer: t, backgroundColor: e, canvasWidth: i.width, canvasHeight: i.height });
3424
+ this.al.rl({ base: h, layers: o, targetFramebuffer: t, backgroundColor: e, canvasWidth: i.width, canvasHeight: i.height });
3425
3425
  }
3426
3426
  Jr() {
3427
- this.ll && (this.cl.Jr(), this.al.forEach((t) => t.Jr()), this.ol.Jr(this.fa.kr.width, this.fa.kr.height));
3427
+ this.fl && (this.ul.Jr(), this.ll.forEach((t) => t.Jr()), this.al.Jr(this.fa.kr.width, this.fa.kr.height));
3428
3428
  }
3429
3429
  gt() {
3430
- this.al.forEach((t) => t.gt()), this.hl.forEach((t) => t.gt()), this.cl.gt(), this.ol.gt();
3430
+ this.ll.forEach((t) => t.gt()), this.cl.forEach((t) => t.gt()), this.ul.gt(), this.al.gt();
3431
3431
  }
3432
3432
  get all() {
3433
- return this.al;
3433
+ return this.ll;
3434
3434
  }
3435
3435
  get base() {
3436
- return this.cl;
3436
+ return this.ul;
3437
3437
  }
3438
- getTopmostGrid() {
3439
- for (let t = this.al.length - 1; t >= 0; t--) {
3440
- const e = this.al[t];
3441
- if (e.ac && e.grid) return e.grid;
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;
3442
3442
  }
3443
- return this.cl.grid;
3443
+ return this.ul.grid;
3444
3444
  }
3445
- Al(t) {
3446
- this.ul.add(t);
3445
+ Cl(t) {
3446
+ this.dl.add(t);
3447
3447
  }
3448
- wl() {
3449
- for (const t of this.ul) t();
3448
+ xl() {
3449
+ for (const t of this.dl) t();
3450
3450
  }
3451
- async fl(t) {
3451
+ async vl(t) {
3452
3452
  var i;
3453
- const e = { renderer: this.Z, canvas: this.fa.kr, filterManager: this.fa.Nc, createFramebuffer: (r, s, h = 1, o) => this.Z.Pe(r, s, h, o) };
3454
- await t.Fc(e), (i = t.grid) == null || i.Hr(() => this.wl());
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());
3455
3455
  }
3456
- dl(t, e) {
3456
+ pl(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
- vl(t, e, i) {
3462
+ ml(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
- pl(t, e, i) {
3469
+ _l(t, e, i) {
3470
3470
  const r = t.indexOf(e);
3471
3471
  if (r === -1) return !1;
3472
3472
  const s = t.indexOf(i);
@@ -3476,11 +3476,11 @@ class Gt {
3476
3476
  class Ht {
3477
3477
  constructor(t) {
3478
3478
  a(this, "Z");
3479
- a(this, "bl", /* @__PURE__ */ new Map());
3480
- a(this, "Cl", /* @__PURE__ */ new Map());
3481
- this.Z = t, this.xl();
3479
+ a(this, "Ml", /* @__PURE__ */ new Map());
3480
+ a(this, "Fl", /* @__PURE__ */ new Map());
3481
+ this.Z = t, this.$l();
3482
3482
  }
3483
- async Ml(t, e, i = {}) {
3483
+ async Pl(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(V, c), this.Cl.set(t, h);
3494
- } else h = e, this.Cl.set(t, h);
3493
+ h = this.Z.pe(j, c), this.Fl.set(t, h);
3494
+ } else h = e, this.Fl.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,88 +3500,88 @@ class Ht {
3500
3500
  }
3501
3501
  return u;
3502
3502
  } };
3503
- this.bl.set(t, o);
3503
+ this.Ml.set(t, o);
3504
3504
  }
3505
- Fl(t) {
3506
- const e = this.Cl.get(t);
3507
- return e && (e.dispose(), this.Cl.delete(t)), this.bl.delete(t);
3505
+ Tl(t) {
3506
+ const e = this.Fl.get(t);
3507
+ return e && (e.dispose(), this.Fl.delete(t)), this.Ml.delete(t);
3508
3508
  }
3509
3509
  Pn(t) {
3510
- return this.bl.get(t);
3510
+ return this.Ml.get(t);
3511
3511
  }
3512
3512
  gt() {
3513
- for (const t of this.Cl.values()) t.dispose();
3514
- this.Cl.clear(), this.bl.clear();
3513
+ for (const t of this.Fl.values()) t.dispose();
3514
+ this.Fl.clear(), this.Ml.clear();
3515
3515
  }
3516
- xl() {
3517
- this.Ml("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.Ml("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.Ml("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.Ml("threshold", `#version 300 es
3521
- precision highp float;uniform sampler2D u_texture;uniform float U9;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(U9,B);fragColor=vec4(vec3(C),A.a);}`, { U9: ["threshold", 0.5] });
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] });
3522
3522
  }
3523
3523
  }
3524
3524
  class Wt {
3525
3525
  constructor(t) {
3526
3526
  a(this, "Z");
3527
- a(this, "Cl", /* @__PURE__ */ new Map());
3527
+ a(this, "Fl", /* @__PURE__ */ new Map());
3528
3528
  a(this, "J");
3529
- a(this, "bc");
3529
+ a(this, "Cc");
3530
3530
  a(this, "Ar", !1);
3531
- a(this, "$l");
3532
- this.Z = t, this.$l = new Ht(this.Z), this.J = t.pe(V, Dt);
3531
+ a(this, "El");
3532
+ this.Z = t, this.El = new Ht(this.Z), this.J = t.pe(j, _t);
3533
3533
  }
3534
3534
  async register(t, e, i = {}) {
3535
- await this.$l.Ml(t, e, i);
3535
+ await this.El.Pl(t, e, i);
3536
3536
  }
3537
3537
  unregister(t) {
3538
- return this.$l.Fl(t) ?? !1;
3538
+ return this.El.Tl(t) ?? !1;
3539
3539
  }
3540
3540
  has(t) {
3541
- return this.$l.Pn(t) !== void 0;
3541
+ return this.El.Pn(t) !== void 0;
3542
3542
  }
3543
3543
  wr(t, e) {
3544
- this.Ar || (this.bc = [this.Z.Pe(t, e, 1, { depth: !1 }), this.Z.Pe(t, e, 1, { depth: !1 })], this.Ar = !0);
3544
+ this.Ar || (this.Cc = [this.Z.Pe(t, e, 1, { depth: !1 }), this.Z.Pe(t, e, 1, { depth: !1 })], this.Ar = !0);
3545
3545
  }
3546
- Pl(t, e, i, r, s) {
3547
- this.bc[0].width === r && this.bc[0].height === s || (this.bc[0].resize(r, s), this.bc[1].resize(r, s)), this.Ec(t, e, i, r, s, this.bc);
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);
3548
3548
  }
3549
- Ec(t, e, i, r, s, h) {
3550
- if (i.length === 0) return void this.Tl(t, e, r, s);
3549
+ Sc(t, e, i, r, s, h) {
3550
+ if (i.length === 0) return void this.Sl(t, e, r, s);
3551
3551
  const o = this.Z.context, c = o.isEnabled(o.BLEND);
3552
- o.disable(o.BLEND), this.Tl(t, h[0], r, s);
3552
+ o.disable(o.BLEND), this.Sl(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.El(f, h[l], p, r, s), d || (l = g);
3556
+ this.zl(f, h[l], p, r, s), d || (l = g);
3557
3557
  }
3558
3558
  c && o.enable(o.BLEND);
3559
3559
  }
3560
- El(t, e, i, r, s) {
3561
- const h = this.$l.Pn(t.name);
3562
- if (!h) return console.warn(`[textmode.js] Unknown filter: "${t.name}". Skipping.`), void this.Tl(e.textures[0], i, r, s);
3563
- const o = this.Rl(t.name, h, r, s), c = { renderer: this.Z, gl: this.Z.context, width: r, height: s };
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 };
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
- Rl(t, e, i, r) {
3569
- let s = this.Cl.get(t);
3568
+ kl(t, e, i, r) {
3569
+ let s = this.Fl.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.Cl.set(t, s);
3572
+ s = e.createShader(h), this.Fl.set(t, s);
3573
3573
  }
3574
3574
  return s;
3575
3575
  }
3576
- Tl(t, e, i, r) {
3576
+ Sl(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.bc && (this.bc[0].resize(t, e), this.bc[1].resize(t, e));
3580
+ this.Cc && (this.Cc[0].resize(t, e), this.Cc[1].resize(t, e));
3581
3581
  }
3582
3582
  gt() {
3583
- for (const t of this.Cl.values()) t.dispose();
3584
- this.Cl.clear(), this.J.dispose(), this.$l.gt(), this.bc && (this.bc[0].gt(), this.bc[1].gt()), this.Ar = !1;
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;
3585
3585
  }
3586
3586
  }
3587
3587
  const Qe = Object.freeze(Object.defineProperty({ __proto__: null, FilterRegistry: Ht, TextmodeFilterManager: Wt }, Symbol.toStringTag, { value: "Module" }));
@@ -3590,57 +3590,57 @@ const qe = { id: "brightness", createShader: ({ gl: n }) => (lt || (lt = new q(n
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
3591
  class qt {
3592
3592
  constructor() {
3593
- a(this, "Sl", /* @__PURE__ */ new Map());
3594
- a(this, "Cl", /* @__PURE__ */ new Map());
3595
- this.zl();
3593
+ a(this, "Dl", /* @__PURE__ */ new Map());
3594
+ a(this, "Fl", /* @__PURE__ */ new Map());
3595
+ this.Ll();
3596
3596
  }
3597
- Ml(t) {
3598
- this.Sl.set(t.id, t);
3597
+ Pl(t) {
3598
+ this.Dl.set(t.id, t);
3599
3599
  }
3600
- Fl(t) {
3601
- const e = this.Cl.get(t);
3602
- return e && (e.dispose(), this.Cl.delete(t)), this.Sl.delete(t);
3600
+ Tl(t) {
3601
+ const e = this.Fl.get(t);
3602
+ return e && (e.dispose(), this.Fl.delete(t)), this.Dl.delete(t);
3603
3603
  }
3604
3604
  Pn(t) {
3605
- return this.Sl.get(t);
3605
+ return this.Dl.get(t);
3606
3606
  }
3607
- kl(t) {
3608
- return this.Sl.has(t);
3607
+ Ol(t) {
3608
+ return this.Dl.has(t);
3609
3609
  }
3610
3610
  gt() {
3611
- for (const t of this.Cl.values()) t.dispose();
3612
- this.Cl.clear(), this.Sl.clear();
3611
+ for (const t of this.Fl.values()) t.dispose();
3612
+ this.Fl.clear(), this.Dl.clear();
3613
3613
  }
3614
- zl() {
3615
- this.Ml(qe);
3614
+ Ll() {
3615
+ this.Pl(qe);
3616
3616
  }
3617
3617
  }
3618
- class jt {
3618
+ class Vt {
3619
3619
  constructor() {
3620
- a(this, "Dl");
3621
- this.Dl = new qt();
3620
+ a(this, "Bl");
3621
+ this.Bl = new qt();
3622
3622
  }
3623
3623
  register(t) {
3624
- this.Dl.Ml(t);
3624
+ this.Bl.Pl(t);
3625
3625
  }
3626
3626
  unregister(t) {
3627
- return this.Dl.Fl(t);
3627
+ return this.Bl.Tl(t);
3628
3628
  }
3629
3629
  has(t) {
3630
- return this.Dl.kl(t);
3630
+ return this.Bl.Ol(t);
3631
3631
  }
3632
3632
  Pn(t) {
3633
- return this.Dl.Pn(t);
3633
+ return this.Bl.Pn(t);
3634
3634
  }
3635
3635
  gt() {
3636
- this.Dl.gt();
3636
+ this.Bl.gt();
3637
3637
  }
3638
3638
  }
3639
- const Ke = Object.freeze(Object.defineProperty({ __proto__: null, ConversionRegistry: qt, TextmodeConversionManager: jt }, Symbol.toStringTag, { value: "Module" }));
3640
- class je extends function(e, ...i) {
3639
+ const Ke = Object.freeze(Object.defineProperty({ __proto__: null, ConversionRegistry: qt, TextmodeConversionManager: Vt }, Symbol.toStringTag, { value: "Module" }));
3640
+ class Ve extends function(e, ...i) {
3641
3641
  return i.reduce((r, s) => s(r), e);
3642
3642
  }(class {
3643
- }, Ze, Xe, ze, ke, Ye) {
3643
+ }, Xe, Ze, ke, Ye, ze) {
3644
3644
  constructor(e = {}) {
3645
3645
  super();
3646
3646
  a(this, "Z");
@@ -3649,85 +3649,86 @@ class je extends function(e, ...i) {
3649
3649
  a(this, "qo");
3650
3650
  a(this, "la");
3651
3651
  a(this, "ua");
3652
- a(this, "Ll");
3653
- a(this, "Zc");
3654
- a(this, "qc");
3652
+ a(this, "Il");
3653
+ a(this, "Vc");
3654
+ a(this, "Jc");
3655
3655
  a(this, "ha");
3656
3656
  a(this, "dn");
3657
- a(this, "Uc");
3658
- a(this, "Nc");
3657
+ a(this, "Rc");
3658
+ a(this, "Yc");
3659
3659
  a(this, "gn");
3660
- a(this, "Ol", []);
3661
- a(this, "Bl");
3662
- a(this, "Il");
3663
- a(this, "Hl");
3664
- a(this, "Gl", !1);
3665
- a(this, "Ql", !1);
3666
- a(this, "Nl", !1);
3660
+ a(this, "Hl", []);
3661
+ a(this, "Gl");
3662
+ a(this, "Ql");
3663
+ a(this, "Nl");
3667
3664
  a(this, "Xl", !1);
3668
- a(this, "Yl", () => {
3665
+ a(this, "Yl", !1);
3666
+ a(this, "jl", !1);
3667
+ a(this, "Kl", !1);
3668
+ a(this, "Wl", () => {
3669
3669
  });
3670
- a(this, "Cc", () => {
3670
+ a(this, "xc", () => {
3671
3671
  });
3672
- a(this, "jl", () => {
3672
+ a(this, "Zl", () => {
3673
3673
  });
3674
- a(this, "Kl");
3675
- a(this, "Wl");
3674
+ a(this, "ql");
3675
+ a(this, "Vl");
3676
3676
  a(this, "Xr", !1);
3677
- a(this, "Zl");
3678
- this.Hl = new Ge(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.Ll = new kt(this, e.loadingScreen, this.kr.Vr()), this.Ll.Kc(() => {
3679
- this.aa.Kn = 0, this.Xl = !0;
3680
- }), this.Zc = this.Z.pe(V, `#version 300 es
3681
- 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.qc = this.Z.pe(V, Dt), this.ha = new Gt(this, e);
3682
- const i = () => this.ha.getTopmostGrid();
3683
- this.qo = new Lt(this.kr, i), this.la = new Bt(this.kr, i, this.qo), this.ua = new Nt(), this.Nc = new Wt(this.Z), this.gn = new jt(), this.Ll.In(), this.ql(e);
3684
- }
3685
- async ql(e) {
3686
- await this.ha.wr(), await this.Ll.wr();
3677
+ a(this, "Jl");
3678
+ 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();
3687
3688
  const i = this.ha.base.grid;
3688
- this.ha.Al(() => {
3689
+ this.ha.Cl(() => {
3689
3690
  this.qo.Fo(), this.la.Fo();
3690
- }), this.Bl = this.Z.Pe(this.kr.width, this.kr.height, 1), this.Il = this.Z.Pe(this.kr.width, this.kr.height, 1), this.Nc.wr(this.kr.width, this.kr.height), this.Xr && (this.Zl = z.Tn(this.Z, this.gn, this.kr.targetCanvas, i.cols, i.rows)), this.Vl(), this.aa.In(() => this.ca()), await this.Hl.ma(e.plugins ?? []);
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
3692
  try {
3692
- await this.Yl(), this.Ll.Wa();
3693
+ await this.Wl(), this.Il.Wa();
3693
3694
  } catch (r) {
3694
- console.error("Error during setup:", r), this.Ll.error(r);
3695
+ console.error("Error during setup:", r), this.Il.error(r);
3695
3696
  }
3696
3697
  }
3697
- Vl() {
3698
- this.Kl = () => {
3699
- this.Xr && this.resizeCanvas(this.kr.targetCanvas.width, this.kr.targetCanvas.height), this.jl();
3700
- }, window.addEventListener("resize", this.Kl), this.qo._o(), this.la._o(), this.ua._o(), window.addEventListener("blur", () => {
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", () => {
3701
3702
  this.ua.Zo();
3702
- }), this.Xr && (this.Wl = new ResizeObserver(() => {
3703
+ }), this.Xr && (this.Vl = new ResizeObserver(() => {
3703
3704
  this.resizeCanvas(this.kr.targetCanvas.width, this.kr.targetCanvas.height);
3704
- }), this.Wl.observe(this.kr.targetCanvas));
3705
+ }), this.Vl.observe(this.kr.targetCanvas));
3705
3706
  }
3706
3707
  ca() {
3707
- if (!this.Ll.Xa && this.Xl) {
3708
- this.Ql = !0;
3708
+ if (!this.Il.Xa && this.Kl) {
3709
+ this.Yl = !0;
3709
3710
  try {
3710
- this.aa.Xn(), this.aa.Wn(), this.Xr && Tt(this.Z.context, this.Zl.texture, this.kr.targetCanvas), this.Hl.ba(), this.Z.state.qt(), this.ha.ml(this.Bl, () => this.Cc());
3711
- let e = this.Bl.textures[0];
3712
- this.Ol.length > 0 && (this.Nc.Pl(this.Bl.textures[0], this.Il, this.Ol, this.kr.width, this.kr.height), e = this.Il.textures[0], this.Ol = []), this.Z.wi(0, 0, 0, 0), this.Z.ve(this.qc), this.qc.O({ u_texture: e }), this.Z.we(0, 0, this.kr.width, this.kr.height), this.Hl.xa();
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();
3713
3714
  } finally {
3714
- this.Ql = !1, this.Gl && !this.Nl && this.Jl();
3715
+ this.Yl = !1, this.Xl && !this.jl && this.ru();
3715
3716
  }
3716
3717
  }
3717
3718
  }
3718
3719
  resizeCanvas(e, i) {
3719
3720
  var r, s, h, o;
3720
- this.kr.Jr(e, i), this.Ll.Vc(this.kr.Vr()), this.Ll.Jr(), (r = this.Bl) == null || r.resize(this.kr.width, this.kr.height), (s = this.Il) == null || s.resize(this.kr.width, this.kr.height), (h = this.Nc) == 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.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
3722
  }
3722
3723
  destroy() {
3723
- this.Nl || this.Gl || (this.Gl = !0, this.aa.Gn(), this.Ql || this.Jl());
3724
+ this.jl || this.Xl || (this.Xl = !0, this.aa.Gn(), this.Yl || this.ru());
3724
3725
  }
3725
- Jl() {
3726
+ ru() {
3726
3727
  var e, i, r, s, h, o, c;
3727
- this.Gl = !1, this.Ll.gt(), this.Hl.Ma(), window.removeEventListener("resize", this.Kl), (e = this.Wl) == null || e.disconnect(), this.qo.Mo(), this.la.Mo(), this.ua.Mo(), this.Zc.dispose(), (i = this.ha) == null || i.gt(), (r = this.Nc) == null || r.gt(), (s = this.gn) == null || s.gt(), (h = this.Bl) == null || h.gt(), (o = this.Il) == null || o.gt(), this.Z.gt(), this.qc.dispose(), (c = this.Zl) == null || c.gt(), this.kr.gt(), this.Nl = !0;
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
3729
  }
3729
3730
  filter(e, i) {
3730
- this.Ol.push({ name: e, params: i });
3731
+ this.Hl.push({ name: e, params: i });
3731
3732
  }
3732
3733
  async loadFont(e) {
3733
3734
  return await this.ha.base.loadFont(e), this.ha.base.font;
@@ -3735,17 +3736,23 @@ precision highp float;uniform sampler2D u_characterTexture;uniform vec2 u_charse
3735
3736
  fontSize(e) {
3736
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);
3737
3738
  }
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());
3741
+ }
3742
+ su() {
3743
+ return this.tu ? this.tu : this.ha.bl();
3744
+ }
3738
3745
  async setup(e) {
3739
- this.Yl = e;
3746
+ this.Wl = e;
3740
3747
  }
3741
3748
  draw(e) {
3742
- this.Cc = e;
3749
+ this.xc = e;
3743
3750
  }
3744
3751
  windowResized(e) {
3745
- this.jl = e;
3752
+ this.Zl = e;
3746
3753
  }
3747
3754
  get grid() {
3748
- return this.Uc ?? this.ha.base.grid;
3755
+ return this.Rc ?? this.ha.base.grid;
3749
3756
  }
3750
3757
  get font() {
3751
3758
  return this.dn ?? this.ha.base.font;
@@ -3760,19 +3767,19 @@ precision highp float;uniform sampler2D u_characterTexture;uniform vec2 u_charse
3760
3767
  return this.kr.canvas;
3761
3768
  }
3762
3769
  get isDisposed() {
3763
- return this.Nl;
3770
+ return this.jl;
3764
3771
  }
3765
3772
  get overlay() {
3766
- return this.Zl;
3773
+ return this.Jl;
3767
3774
  }
3768
3775
  get loading() {
3769
- return this.Ll;
3776
+ return this.Il;
3770
3777
  }
3771
3778
  get layers() {
3772
3779
  return this.ha;
3773
3780
  }
3774
3781
  get filters() {
3775
- return this.Nc;
3782
+ return this.Yc;
3776
3783
  }
3777
3784
  get conversions() {
3778
3785
  return this.gn;
@@ -3782,23 +3789,23 @@ class At {
3782
3789
  constructor() {
3783
3790
  }
3784
3791
  static create(t = {}) {
3785
- return new je(t);
3792
+ return new Ve(t);
3786
3793
  }
3787
3794
  static setErrorLevel(t) {
3788
3795
  vt._(t);
3789
3796
  }
3790
3797
  static get version() {
3791
- return "0.8.0-beta.3";
3798
+ return "0.8.1-beta.1";
3792
3799
  }
3793
3800
  }
3794
- const Je = Object.freeze(Object.defineProperty({ __proto__: null, LoadingPhase: zt, LoadingPhaseTracker: It, LoadingScreenManager: kt, LoadingScreenStateMachine: _t, LoadingScreenTransition: Ot, resolveColorInputs: Xt, resolveDefaultPalette: Zt, 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: _e, mouse: Ie, touch: Oe }, Symbol.toStringTag, { value: "Module" })), ei = Object.freeze(Object.defineProperty({ __proto__: null, LayerCompositor: Yt, 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: 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;
3795
3802
  export {
3796
- De as TextmodeCanvas,
3803
+ _e as TextmodeCanvas,
3797
3804
  S as TextmodeColor,
3798
3805
  $t as TextmodeErrorLevel,
3799
- X as TextmodeFramebuffer,
3806
+ Z as TextmodeFramebuffer,
3800
3807
  Le as TextmodeGrid,
3801
- je as Textmodifier,
3808
+ Ve as Textmodifier,
3802
3809
  Ke as conversion,
3803
3810
  ii as create,
3804
3811
  Qe as filters,