textmode.js 0.2.1-beta.4 → 0.2.1-beta.6

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 (34) hide show
  1. package/dist/textmode.esm.js +2142 -1840
  2. package/dist/textmode.esm.min.js +1854 -1551
  3. package/dist/textmode.umd.js +9 -9
  4. package/dist/textmode.umd.min.js +8 -7
  5. package/dist/types/assets/shaders-minified/frag/image-to-mrt.d.ts +14 -0
  6. package/dist/types/assets/shaders-minified/frag/present.d.ts +14 -0
  7. package/dist/types/assets/shaders-minified/index.d.ts +2 -0
  8. package/dist/types/index.d.ts +1 -0
  9. package/dist/types/rendering/index.d.ts +0 -2
  10. package/dist/types/rendering/webgl/DrawQueue.d.ts +9 -7
  11. package/dist/types/rendering/webgl/InstanceData.d.ts +15 -15
  12. package/dist/types/rendering/webgl/RenderPipeline.d.ts +1 -0
  13. package/dist/types/rendering/webgl/RenderState.d.ts +13 -19
  14. package/dist/types/rendering/webgl/Renderer.d.ts +13 -2
  15. package/dist/types/rendering/webgl/Shader.d.ts +3 -4
  16. package/dist/types/rendering/webgl/ShaderManager.d.ts +12 -11
  17. package/dist/types/rendering/webgl/geometries/BaseGeometry.d.ts +2 -1
  18. package/dist/types/rendering/webgl/types/DrawCommand.d.ts +2 -2
  19. package/dist/types/textmode/Canvas.d.ts +6 -0
  20. package/dist/types/textmode/TextmodeImage.d.ts +92 -0
  21. package/dist/types/textmode/Textmodifier.d.ts +18 -2
  22. package/dist/types/textmode/font/CharacterExtractor.d.ts +14 -14
  23. package/dist/types/textmode/font/MetricsCalculator.d.ts +1 -21
  24. package/dist/types/textmode/font/typr/Typr.d.ts +2 -0
  25. package/dist/types/textmode/font/typr/types.d.ts +6 -0
  26. package/dist/types/textmode/font/utils/index.d.ts +0 -1
  27. package/dist/types/textmode/mixins/AnimationMixin.d.ts +6 -0
  28. package/dist/types/textmode/mixins/FontMixin.d.ts +43 -3
  29. package/dist/types/textmode/mixins/KeyboardMixin.d.ts +2 -3
  30. package/dist/types/textmode/mixins/MouseMixin.d.ts +6 -6
  31. package/dist/types/textmode/mixins/RenderingMixin.d.ts +23 -5
  32. package/package.json +1 -1
  33. package/dist/types/rendering/webgl/types/ShaderTypes.d.ts +0 -35
  34. package/dist/types/textmode/font/utils/CmapParser.d.ts +0 -47
@@ -1,2184 +1,2474 @@
1
- var q = Object.defineProperty;
2
- var AA = (E, A, t) => A in E ? q(E, A, { enumerable: !0, configurable: !0, writable: !0, value: t }) : E[A] = t;
3
- var n = (E, A, t) => AA(E, typeof A != "symbol" ? A + "" : A, t);
4
- class f extends Error {
5
- constructor(A, t = {}) {
6
- super(f.A(A, t)), this.name = "TextmodeError";
7
- }
8
- static A(A, t) {
9
- return `${A}${t && Object.keys(t).length > 0 ? `
1
+ var ct = Object.defineProperty;
2
+ var lt = (a, t, e) => t in a ? ct(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
+ var h = (a, t, e) => lt(a, typeof t != "symbol" ? t + "" : t, e);
4
+ class U extends Error {
5
+ constructor(t, e = {}) {
6
+ super(U.i(t, e)), this.name = "TextmodeError";
7
+ }
8
+ static i(t, e) {
9
+ return `${t}${e && Object.keys(e).length > 0 ? `
10
10
 
11
- 📋 Context:` + Object.entries(t).map(([e, s]) => `
12
- - ${e}: ${f.C(s)}`).join("") : ""}
11
+ 📋 Context:` + Object.entries(e).map(([i, s]) => `
12
+ - ${i}: ${U.o(s)}`).join("") : ""}
13
13
 
14
14
  ${"↓".repeat(24)}
15
15
  `;
16
16
  }
17
- static C(A) {
18
- if (A === null) return "null";
19
- if (A === void 0) return "undefined";
20
- if (typeof A == "string") return `"${A}"`;
21
- if (typeof A == "number" || typeof A == "boolean") return A + "";
22
- if (Array.isArray(A)) return A.length === 0 ? "[]" : A.length <= 5 ? `[${A.map((t) => f.C(t)).join(", ")}]` : `[${A.slice(0, 3).map((t) => f.C(t)).join(", ")}, ... +${A.length - 3} more]`;
23
- if (typeof A == "object") {
24
- const t = Object.keys(A);
25
- return t.length === 0 ? "{}" : t.length <= 3 ? `{ ${t.map((e) => `${e}: ${f.C(A[e])}`).join(", ")} }` : `{ ${t.slice(0, 2).map((e) => `${e}: ${f.C(A[e])}`).join(", ")}, ... +${t.length - 2} more }`;
17
+ static o(t) {
18
+ if (t === null) return "null";
19
+ if (t === void 0) return "undefined";
20
+ if (typeof t == "string") return `"${t}"`;
21
+ if (typeof t == "number" || typeof t == "boolean") return t + "";
22
+ if (Array.isArray(t)) return t.length === 0 ? "[]" : t.length <= 5 ? `[${t.map((e) => U.o(e)).join(", ")}]` : `[${t.slice(0, 3).map((e) => U.o(e)).join(", ")}, ... +${t.length - 3} more]`;
23
+ if (typeof t == "object") {
24
+ const e = Object.keys(t);
25
+ return e.length === 0 ? "{}" : e.length <= 3 ? `{ ${e.map((i) => `${i}: ${U.o(t[i])}`).join(", ")} }` : `{ ${e.slice(0, 2).map((i) => `${i}: ${U.o(t[i])}`).join(", ")}, ... +${e.length - 2} more }`;
26
26
  }
27
- return A + "";
27
+ return t + "";
28
28
  }
29
29
  }
30
- var tA = ((E) => (E[E.SILENT = 0] = "SILENT", E[E.WARNING = 1] = "WARNING", E[E.ERROR = 2] = "ERROR", E[E.THROW = 3] = "THROW", E))(tA || {});
31
- const v = class v {
30
+ var ut = ((a) => (a[a.SILENT = 0] = "SILENT", a[a.WARNING = 1] = "WARNING", a[a.ERROR = 2] = "ERROR", a[a.THROW = 3] = "THROW", a))(ut || {});
31
+ const M = class M {
32
32
  constructor() {
33
- n(this, "P", { globalLevel: 3 });
33
+ h(this, "u", { globalLevel: 3 });
34
34
  }
35
- static u() {
36
- return v.D || (v.D = new v()), v.D;
35
+ static m() {
36
+ return M.l || (M.l = new M()), M.l;
37
37
  }
38
- I(A, t) {
39
- const e = "%c[textmode.js] Oops! (╯°□°)╯︵ Something went wrong in your code.", s = "color: #f44336; font-weight: bold; background: #ffebee; padding: 2px 6px; border-radius: 3px;";
40
- switch (this.P.globalLevel) {
38
+ _(t, e) {
39
+ const i = "%c[textmode.js] Oops! (╯°□°)╯︵ Something went wrong in your code.", s = "color: #f44336; font-weight: bold; background: #ffebee; padding: 2px 6px; border-radius: 3px;";
40
+ switch (this.u.globalLevel) {
41
41
  case 0:
42
42
  return !1;
43
43
  case 1:
44
- return console.group(e, s), console.warn(f.A(A, t)), console.groupEnd(), !1;
44
+ return console.group(i, s), console.warn(U.i(t, e)), console.groupEnd(), !1;
45
45
  case 2:
46
- return console.group(e, s), console.error(f.A(A, t)), console.groupEnd(), !1;
46
+ return console.group(i, s), console.error(U.i(t, e)), console.groupEnd(), !1;
47
47
  default:
48
- throw new f(A, t);
48
+ throw new U(t, e);
49
49
  }
50
50
  }
51
- _(A, t, e) {
52
- return !!A || (this.I(t, e), !1);
51
+ v(t, e, i) {
52
+ return !!t || (this._(e, i), !1);
53
53
  }
54
- v(A) {
55
- this.P.globalLevel = A;
54
+ A(t) {
55
+ this.u.globalLevel = t;
56
56
  }
57
57
  };
58
- n(v, "D", null);
59
- let Y = v;
60
- const M = Y.u(), X = /* @__PURE__ */ new WeakMap();
61
- function F(E, A) {
62
- X.set(E, A);
58
+ h(M, "l", null);
59
+ let K = M;
60
+ const N = K.m(), ot = /* @__PURE__ */ new WeakMap();
61
+ function H(a, t) {
62
+ ot.set(a, t);
63
63
  }
64
- function G(E) {
65
- return X.get(E);
64
+ function k(a) {
65
+ return ot.get(a);
66
66
  }
67
- class J {
67
+ class at {
68
68
  constructor() {
69
- n(this, "$", 1);
70
- n(this, "G", 0);
71
- n(this, "M", 0);
72
- n(this, "Y", 0);
73
- n(this, "F", [0, 0, 0]);
74
- n(this, "R", [1, 1, 1, 1]);
75
- n(this, "S", [0, 0, 0, 1]);
76
- n(this, "L", !1);
77
- n(this, "O", !1);
78
- n(this, "U", !1);
79
- n(this, "W", [0, 0]);
80
- n(this, "H", [0, 0, 0, 1]);
81
- n(this, "K", []);
82
- }
83
- J() {
84
- this.K.push({ V: this.$, Z: this.G, N: this.M, X: this.Y, W: [...this.W], L: this.L, O: this.O, U: this.U, AA: [...this.F], tA: [...this.R], eA: [...this.S] });
85
- }
86
- sA() {
87
- const A = this.K.pop();
88
- A ? (this.$ = A.V, this.G = A.Z, this.M = A.N, this.Y = A.X, this.W = A.W, this.L = A.L, this.O = A.O, this.U = A.U, this.F = A.AA, this.R = A.tA, this.S = A.eA) : console.warn("pop() called without matching push()");
89
- }
90
- iA() {
91
- this.K = [], this.G = 0, this.M = 0, this.Y = 0;
92
- }
93
- BA(A) {
94
- A.lineWeight = this.$, A.rotationX = this.G, A.rotationY = this.M, A.rotationZ = this.Y, A.character[0] = this.F[0], A.character[1] = this.F[1], A.character[2] = this.F[2], A.charColor[0] = this.R[0], A.charColor[1] = this.R[1], A.charColor[2] = this.R[2], A.charColor[3] = this.R[3], A.bgColor[0] = this.S[0], A.bgColor[1] = this.S[1], A.bgColor[2] = this.S[2], A.bgColor[3] = this.S[3], A.flipHorizontally = this.L, A.flipVertically = this.O, A.invert = this.U, A.charRotation[0] = this.W[0], A.charRotation[1] = this.W[1];
69
+ h(this, "C", 1);
70
+ h(this, "U", 0);
71
+ h(this, "$", 0);
72
+ h(this, "M", 0);
73
+ h(this, "F", [0, 0, 0]);
74
+ h(this, "R", [1, 1, 1, 1]);
75
+ h(this, "P", [0, 0, 0, 1]);
76
+ h(this, "S", !1);
77
+ h(this, "G", !1);
78
+ h(this, "D", !1);
79
+ h(this, "L", [0, 0]);
80
+ h(this, "k", [0, 0, 0, 1]);
81
+ h(this, "O", []);
82
+ }
83
+ H() {
84
+ this.O.push({ I: this.C, N: this.U, X: this.$, W: this.M, L: [...this.L], V: this.S, K: this.G, D: this.D, j: [...this.F], Y: [...this.R], q: [...this.P] });
85
+ }
86
+ Z() {
87
+ const t = this.O.pop();
88
+ t ? (this.C = t.I, this.U = t.N, this.$ = t.X, this.M = t.W, this.L = t.L, this.S = t.V, this.G = t.K, this.D = t.D, this.F = t.j, this.R = t.Y, this.P = t.q) : console.warn("pop() called without matching push()");
89
+ }
90
+ J(t) {
91
+ t.I = this.C, t.N = this.U, t.X = this.$, t.W = this.M, t.j[0] = this.F[0], t.j[1] = this.F[1], t.j[2] = this.F[2], t.Y[0] = this.R[0], t.Y[1] = this.R[1], t.Y[2] = this.R[2], t.Y[3] = this.R[3], t.q[0] = this.P[0], t.q[1] = this.P[1], t.q[2] = this.P[2], t.q[3] = this.P[3], t.V = this.S, t.K = this.G, t.D = this.D, t.L[0] = this.L[0], t.L[1] = this.L[1];
95
92
  }
96
93
  get lineWeight() {
97
- return this.$;
94
+ return this.C;
98
95
  }
99
96
  get canvasBackgroundColor() {
100
- return this.H;
97
+ return this.k;
101
98
  }
102
- QA(A) {
103
- this.$ = Math.abs(A);
99
+ tt(t) {
100
+ this.C = Math.abs(t);
104
101
  }
105
- EA(A) {
106
- this.G = A;
102
+ et(t) {
103
+ this.U = t;
107
104
  }
108
- rA(A) {
109
- this.M = A;
105
+ st(t) {
106
+ this.$ = t;
110
107
  }
111
- nA(A) {
112
- this.Y = A;
108
+ it(t) {
109
+ this.M = t;
113
110
  }
114
- oA(A) {
115
- this.F = A;
111
+ rt(t) {
112
+ this.F = t;
116
113
  }
117
- gA(A, t, e, s = 255) {
118
- this.R = [A / 255, t / 255, e / 255, s / 255];
114
+ nt(t, e, i, s = 255) {
115
+ this.R = [t / 255, e / 255, i / 255, s / 255];
119
116
  }
120
- aA(A, t, e, s = 255) {
121
- this.S = [A / 255, t / 255, e / 255, s / 255];
117
+ ot(t, e, i, s = 255) {
118
+ this.P = [t / 255, e / 255, i / 255, s / 255];
122
119
  }
123
- hA(A) {
124
- this.L = A;
120
+ ht(t) {
121
+ this.S = t;
125
122
  }
126
- cA(A) {
127
- this.O = A;
123
+ ct(t) {
124
+ this.G = t;
128
125
  }
129
- lA(A) {
130
- this.U = A;
126
+ lt(t) {
127
+ this.D = t;
131
128
  }
132
- CA(A) {
133
- const t = 255 * A / 360, e = Math.floor(t) / 255, s = Math.round(t - Math.floor(t));
134
- this.W = [e, s];
129
+ ut(t) {
130
+ const e = 255 * t / 360, i = Math.floor(e) / 255, s = Math.round(e - Math.floor(e));
131
+ this.L = [i, s];
135
132
  }
136
- DA(A, t, e, s) {
137
- this.H = [A / 255, t / 255, e / 255, s / 255];
133
+ ft(t, e, i, s) {
134
+ this.k = [t / 255, e / 255, i / 255, s / 255];
138
135
  }
139
136
  }
140
- class U {
141
- constructor(A, t, e = t, s = 1, i = {}, B = null, r = !1) {
142
- n(this, "PA");
143
- n(this, "uA");
144
- n(this, "P");
145
- n(this, "IA", null);
146
- n(this, "wA");
147
- n(this, "fA");
148
- n(this, "dA", []);
149
- n(this, "pA");
150
- n(this, "_A", null);
151
- n(this, "mA", []);
152
- n(this, "vA", null);
153
- n(this, "yA", !1);
154
- n(this, "bA", null);
155
- this.PA = t, this.uA = e, this.P = { filter: "nearest", wrap: "clamp", format: "rgba", type: "unsigned_byte", ...i }, this.wA = A, this.pA = Math.min(Math.max(1, s), 8), this.vA = B, this.yA = !!r, this.bA = this.yA ? new J() : null;
156
- const Q = A.getParameter(A.MAX_DRAW_BUFFERS), o = A.getParameter(A.MAX_COLOR_ATTACHMENTS);
157
- this.pA = Math.min(this.pA, Q, o), this.fA = A.createFramebuffer(), this.$A(), this.GA(), this.mA = Array(this.pA).fill(null);
158
- }
159
- $A() {
160
- const A = this.wA, t = this.P.filter === "linear" ? A.LINEAR : A.NEAREST, e = this.P.wrap === "repeat" ? A.REPEAT : A.CLAMP_TO_EDGE, s = this.P.type === "float" ? A.FLOAT : A.UNSIGNED_BYTE;
161
- for (let i = 0; i < this.pA; i++) {
162
- const B = A.createTexture();
163
- A.bindTexture(A.TEXTURE_2D, B), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_MIN_FILTER, t), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_MAG_FILTER, t), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_WRAP_S, e), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_WRAP_T, e), A.texImage2D(A.TEXTURE_2D, 0, A.RGBA, this.PA, this.uA, 0, A.RGBA, s, null), this.dA.push(B);
137
+ class q {
138
+ constructor(t, e, i = e, s = 1, r = {}, n = null, o = !1) {
139
+ h(this, "dt");
140
+ h(this, "gt");
141
+ h(this, "u");
142
+ h(this, "_t", null);
143
+ h(this, "vt");
144
+ h(this, "yt");
145
+ h(this, "At", []);
146
+ h(this, "wt");
147
+ h(this, "Ct", null);
148
+ h(this, "bt", []);
149
+ h(this, "xt", null);
150
+ h(this, "$t", !1);
151
+ h(this, "Mt", null);
152
+ this.dt = e, this.gt = i, this.u = { filter: "nearest", wrap: "clamp", format: "rgba", type: "unsigned_byte", ...r }, this.vt = t, this.wt = Math.min(Math.max(1, s), 8), this.xt = n, this.$t = !!o, this.Mt = this.$t ? new at() : null;
153
+ const c = t.getParameter(t.MAX_DRAW_BUFFERS), l = t.getParameter(t.MAX_COLOR_ATTACHMENTS);
154
+ this.wt = Math.min(this.wt, c, l), this.yt = t.createFramebuffer(), this.Ft(), this.Rt(), this.bt = Array(this.wt).fill(null);
155
+ }
156
+ Ft() {
157
+ const t = this.vt, e = this.u.filter === "linear" ? t.LINEAR : t.NEAREST, i = this.u.wrap === "repeat" ? t.REPEAT : t.CLAMP_TO_EDGE, s = this.u.type === "float" ? t.FLOAT : t.UNSIGNED_BYTE;
158
+ for (let r = 0; r < this.wt; r++) {
159
+ const n = t.createTexture();
160
+ t.bindTexture(t.TEXTURE_2D, n), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, e), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, e), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, i), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, i), t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, this.dt, this.gt, 0, t.RGBA, s, null), this.At.push(n);
164
161
  }
165
- A.bindTexture(A.TEXTURE_2D, null);
162
+ t.bindTexture(t.TEXTURE_2D, null);
166
163
  }
167
- GA() {
168
- const A = this.wA;
169
- if (A.bindFramebuffer(A.FRAMEBUFFER, this.fA), this.pA === 1) A.framebufferTexture2D(A.FRAMEBUFFER, A.COLOR_ATTACHMENT0, A.TEXTURE_2D, this.dA[0], 0);
164
+ Rt() {
165
+ const t = this.vt;
166
+ if (t.bindFramebuffer(t.FRAMEBUFFER, this.yt), this.wt === 1) t.framebufferTexture2D(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, this.At[0], 0);
170
167
  else {
171
- const e = [];
172
- for (let s = 0; s < this.pA; s++) {
173
- const i = A.COLOR_ATTACHMENT0 + s;
174
- A.framebufferTexture2D(A.FRAMEBUFFER, i, A.TEXTURE_2D, this.dA[s], 0), e.push(i);
168
+ const i = [];
169
+ for (let s = 0; s < this.wt; s++) {
170
+ const r = t.COLOR_ATTACHMENT0 + s;
171
+ t.framebufferTexture2D(t.FRAMEBUFFER, r, t.TEXTURE_2D, this.At[s], 0), i.push(r);
175
172
  }
176
- A.drawBuffers(e);
173
+ t.drawBuffers(i);
177
174
  }
178
- const t = A.checkFramebufferStatus(A.FRAMEBUFFER);
179
- t !== A.FRAMEBUFFER_COMPLETE && console.error("GLFramebuffer is not complete:", t), A.bindFramebuffer(A.FRAMEBUFFER, null);
180
- }
181
- xA(A) {
182
- const t = this.wA;
183
- t.bindTexture(t.TEXTURE_2D, this.dA[0]), t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, 1), t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, t.RGBA, t.UNSIGNED_BYTE, A), t.bindTexture(t.TEXTURE_2D, null);
184
- }
185
- resize(A, t) {
186
- this.PA = A, this.uA = t, this.IA = null, this.mA = Array(this.pA).fill(null);
187
- const e = this.wA, s = this.P.type === "float" ? e.FLOAT : e.UNSIGNED_BYTE;
188
- for (const i of this.dA) e.bindTexture(e.TEXTURE_2D, i), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, this.PA, this.uA, 0, e.RGBA, s, null);
189
- e.bindTexture(e.TEXTURE_2D, null);
190
- }
191
- MA(A) {
192
- const t = this.wA, e = this.mA[A];
193
- if (e) return e;
194
- const s = this.PA, i = this.uA, B = new Uint8Array(s * i * 4), r = t.getParameter(t.READ_FRAMEBUFFER_BINDING);
195
- t.bindFramebuffer(t.READ_FRAMEBUFFER, this.fA), t.readBuffer(t.COLOR_ATTACHMENT0 + A), t.readPixels(0, 0, s, i, t.RGBA, t.UNSIGNED_BYTE, B), t.bindFramebuffer(t.READ_FRAMEBUFFER, r);
196
- const Q = 4 * s, o = new Uint8Array(B.length);
197
- for (let g = 0; g < i; g++) {
198
- const a = (i - 1 - g) * Q, h = g * Q;
199
- o.set(B.subarray(a, a + Q), h);
175
+ const e = t.checkFramebufferStatus(t.FRAMEBUFFER);
176
+ e !== t.FRAMEBUFFER_COMPLETE && console.error("GLFramebuffer is not complete:", e), t.bindFramebuffer(t.FRAMEBUFFER, null);
177
+ }
178
+ zt(t) {
179
+ const e = this.vt;
180
+ e.bindTexture(e.TEXTURE_2D, this.At[0]), e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, 1), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, e.RGBA, e.UNSIGNED_BYTE, t), e.bindTexture(e.TEXTURE_2D, null);
181
+ }
182
+ resize(t, e) {
183
+ this.dt = t, this.gt = e, this._t = null, this.bt = Array(this.wt).fill(null);
184
+ const i = this.vt, s = this.u.type === "float" ? i.FLOAT : i.UNSIGNED_BYTE;
185
+ for (const r of this.At) i.bindTexture(i.TEXTURE_2D, r), i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, this.dt, this.gt, 0, i.RGBA, s, null);
186
+ i.bindTexture(i.TEXTURE_2D, null);
187
+ }
188
+ Pt(t) {
189
+ const e = this.vt, i = this.bt[t];
190
+ if (i) return i;
191
+ const s = this.dt, r = this.gt, n = new Uint8Array(s * r * 4), o = e.getParameter(e.READ_FRAMEBUFFER_BINDING);
192
+ e.bindFramebuffer(e.READ_FRAMEBUFFER, this.yt), e.readBuffer(e.COLOR_ATTACHMENT0 + t), e.readPixels(0, 0, s, r, e.RGBA, e.UNSIGNED_BYTE, n), e.bindFramebuffer(e.READ_FRAMEBUFFER, o);
193
+ const c = 4 * s, l = new Uint8Array(n.length);
194
+ for (let f = 0; f < r; f++) {
195
+ const u = (r - 1 - f) * c, g = f * c;
196
+ l.set(n.subarray(u, u + c), g);
200
197
  }
201
- return this.mA[A] = o, o;
198
+ return this.bt[t] = l, l;
202
199
  }
203
200
  begin() {
204
- var t, e, s, i;
205
- const A = this.wA;
206
- if (this.vA) {
207
- const B = ((e = (t = this.vA).YA) == null ? void 0 : e.call(t)) ?? null;
208
- B && this.vA.FA(B), this.yA && this.bA && ((i = (s = this.vA).RA) == null || i.call(s, this.bA));
201
+ var e, i, s, r;
202
+ const t = this.vt;
203
+ if (this.xt) {
204
+ const n = ((i = (e = this.xt).Tt) == null ? void 0 : i.call(e)) ?? null;
205
+ n && this.xt.St(n), this.$t && this.Mt && ((r = (s = this.xt).Et) == null || r.call(s, this.Mt));
209
206
  }
210
- this._A = { framebuffer: A.getParameter(A.FRAMEBUFFER_BINDING), viewport: A.getParameter(A.VIEWPORT) }, A.bindFramebuffer(A.FRAMEBUFFER, this.fA), this.mA = Array(this.pA).fill(null);
211
- for (let B = 0; B < this.pA; B++) A.clearBufferfv(A.COLOR, B, new Float32Array([0, 0, 0, 0]));
212
- A.viewport(0, 0, this.PA, this.uA), F(A, [0, 0, this.PA, this.uA]);
207
+ this.Ct = { framebuffer: t.getParameter(t.FRAMEBUFFER_BINDING), viewport: t.getParameter(t.VIEWPORT) }, t.bindFramebuffer(t.FRAMEBUFFER, this.yt), this.bt = Array(this.wt).fill(null);
208
+ for (let n = 0; n < this.wt; n++) t.clearBufferfv(t.COLOR, n, new Float32Array([0, 0, 0, 0]));
209
+ t.viewport(0, 0, this.dt, this.gt), H(t, [0, 0, this.dt, this.gt]);
213
210
  }
214
211
  end() {
215
- var t, e, s, i;
216
- if (!this._A) return;
217
- const A = this.wA;
218
- if (this.vA) {
219
- const B = ((e = (t = this.vA).YA) == null ? void 0 : e.call(t)) ?? null;
220
- B && this.vA.FA(B);
212
+ var e, i, s, r;
213
+ if (!this.Ct) return;
214
+ const t = this.vt;
215
+ if (this.xt) {
216
+ const n = ((i = (e = this.xt).Tt) == null ? void 0 : i.call(e)) ?? null;
217
+ n && this.xt.St(n);
221
218
  }
222
- A.bindFramebuffer(A.FRAMEBUFFER, this._A.framebuffer), A.viewport(...this._A.viewport), F(A, this._A.viewport), this._A = null, this.vA && this.yA && this.bA && ((i = (s = this.vA).SA) == null || i.call(s));
219
+ t.bindFramebuffer(t.FRAMEBUFFER, this.Ct.framebuffer), t.viewport(...this.Ct.viewport), H(t, this.Ct.viewport), this.Ct = null, this.xt && this.$t && this.Mt && ((r = (s = this.xt).Bt) == null || r.call(s));
223
220
  }
224
- kA() {
225
- const A = this.wA;
226
- A.deleteFramebuffer(this.fA);
227
- for (const t of this.dA) A.deleteTexture(t);
221
+ Gt() {
222
+ const t = this.vt;
223
+ t.deleteFramebuffer(this.yt);
224
+ for (const e of this.At) t.deleteTexture(e);
228
225
  }
229
226
  get width() {
230
- return this.PA;
227
+ return this.dt;
231
228
  }
232
229
  get height() {
233
- return this.uA;
230
+ return this.gt;
234
231
  }
235
232
  get textures() {
236
- return [...this.dA];
233
+ return [...this.At];
237
234
  }
238
235
  }
239
- function N(E) {
240
- return typeof E == "string" ? E : E.sourceCode;
241
- }
242
- class T {
243
- constructor(A, t, e) {
244
- n(this, "wA");
245
- n(this, "zA");
246
- n(this, "LA", /* @__PURE__ */ new Map());
247
- n(this, "OA", /* @__PURE__ */ new Map());
248
- n(this, "TA", 0);
249
- this.wA = A, this.zA = this.UA(N(t), N(e)), this.WA();
250
- }
251
- WA() {
252
- const A = this.wA.getProgramParameter(this.zA, this.wA.ACTIVE_UNIFORMS);
253
- for (let t = 0; t < A; t++) {
254
- const e = this.wA.getActiveUniform(this.zA, t);
255
- if (e) {
256
- const s = this.wA.getUniformLocation(this.zA, e.name);
257
- if (s && (this.LA.set(e.name, s), this.OA.set(e.name, { type: e.type, size: e.size }), e.size > 1)) {
258
- const i = e.name.replace(/\[.*\]$/, "");
259
- this.LA.has(i) || (this.LA.set(i, s), this.OA.set(i, { type: e.type, size: e.size }));
236
+ class _ {
237
+ constructor(t, e, i) {
238
+ h(this, "vt");
239
+ h(this, "Dt");
240
+ h(this, "Lt", /* @__PURE__ */ new Map());
241
+ h(this, "kt", /* @__PURE__ */ new Map());
242
+ h(this, "Ot", 0);
243
+ this.vt = t, this.Dt = this.Ht(e, i), this.It();
244
+ }
245
+ It() {
246
+ const t = this.vt.getProgramParameter(this.Dt, this.vt.ACTIVE_UNIFORMS);
247
+ for (let e = 0; e < t; e++) {
248
+ const i = this.vt.getActiveUniform(this.Dt, e);
249
+ if (i) {
250
+ const s = this.vt.getUniformLocation(this.Dt, i.name);
251
+ if (s && (this.Lt.set(i.name, s), this.kt.set(i.name, { type: i.type, size: i.size }), i.size > 1)) {
252
+ const r = i.name.replace(/\[.*\]$/, "");
253
+ this.Lt.has(r) || (this.Lt.set(r, s), this.kt.set(r, { type: i.type, size: i.size }));
260
254
  }
261
255
  }
262
256
  }
263
257
  }
264
- UA(A, t) {
265
- const e = this.HA(this.wA.VERTEX_SHADER, A), s = this.HA(this.wA.FRAGMENT_SHADER, t), i = this.wA.createProgram();
266
- if (this.wA.attachShader(i, e), this.wA.attachShader(i, s), this.wA.linkProgram(i), !this.wA.getProgramParameter(i, this.wA.LINK_STATUS)) {
267
- const B = this.wA.getProgramInfoLog(i);
268
- throw Error("Shader program link error: " + B);
258
+ Ht(t, e) {
259
+ const i = this.Nt(this.vt.VERTEX_SHADER, t), s = this.Nt(this.vt.FRAGMENT_SHADER, e), r = this.vt.createProgram();
260
+ if (this.vt.attachShader(r, i), this.vt.attachShader(r, s), this.vt.linkProgram(r), !this.vt.getProgramParameter(r, this.vt.LINK_STATUS)) {
261
+ const n = this.vt.getProgramInfoLog(r);
262
+ throw Error("Shader program link error: " + n);
269
263
  }
270
- return this.wA.deleteShader(e), this.wA.deleteShader(s), i;
264
+ return this.vt.deleteShader(i), this.vt.deleteShader(s), r;
271
265
  }
272
- HA(A, t) {
273
- const e = this.wA.createShader(A);
274
- if (this.wA.shaderSource(e, t), this.wA.compileShader(e), !this.wA.getShaderParameter(e, this.wA.COMPILE_STATUS)) {
275
- const s = this.wA.getShaderInfoLog(e);
276
- throw this.wA.deleteShader(e), Error("Shader compilation error: " + s);
266
+ Nt(t, e) {
267
+ const i = this.vt.createShader(t);
268
+ if (this.vt.shaderSource(i, e), this.vt.compileShader(i), !this.vt.getShaderParameter(i, this.vt.COMPILE_STATUS)) {
269
+ const s = this.vt.getShaderInfoLog(i);
270
+ throw this.vt.deleteShader(i), Error("Shader compilation error: " + s);
277
271
  }
278
- return e;
272
+ return i;
273
+ }
274
+ Xt() {
275
+ this.vt.useProgram(this.Dt), this.Wt();
276
+ }
277
+ Wt() {
278
+ this.Ot = 0;
279
279
  }
280
- KA() {
281
- this.wA.useProgram(this.zA), this.JA();
282
- }
283
- JA() {
284
- this.TA = 0;
285
- }
286
- VA(A) {
287
- for (const [t, e] of Object.entries(A)) this.ZA(t, e);
288
- }
289
- NA(A) {
290
- return this.LA.has(A);
291
- }
292
- XA(A) {
293
- return this.OA.get(A) || null;
294
- }
295
- jA() {
296
- const A = [];
297
- for (const [t, e] of this.OA.entries()) A.push({ name: t, ...e });
298
- return A;
299
- }
300
- ZA(A, t) {
301
- var Q;
302
- const e = this.LA.get(A);
303
- if (!e) return;
304
- const s = this.OA.get(A);
305
- if (!s) return void console.warn(`No type information found for uniform '${A}'`);
306
- const { type: i, size: B } = s, r = this.wA;
307
- if (typeof t == "number") switch (i) {
308
- case r.INT:
309
- case r.BOOL:
310
- r.uniform1i(e, t);
280
+ Vt(t) {
281
+ for (const [e, i] of Object.entries(t)) this.Kt(e, i);
282
+ }
283
+ jt(t) {
284
+ return this.Lt.has(t);
285
+ }
286
+ Yt(t) {
287
+ return this.kt.get(t) || null;
288
+ }
289
+ qt() {
290
+ const t = [];
291
+ for (const [e, i] of this.kt.entries()) t.push({ name: e, ...i });
292
+ return t;
293
+ }
294
+ Kt(t, e) {
295
+ var c;
296
+ const i = this.Lt.get(t);
297
+ if (!i) return;
298
+ const s = this.kt.get(t);
299
+ if (!s) return void console.warn(`No type information found for uniform '${t}'`);
300
+ const { type: r, size: n } = s, o = this.vt;
301
+ if (typeof e == "number") switch (r) {
302
+ case o.INT:
303
+ case o.BOOL:
304
+ o.uniform1i(i, e);
311
305
  break;
312
- case r.FLOAT:
313
- r.uniform1f(e, t);
306
+ case o.FLOAT:
307
+ o.uniform1f(i, e);
314
308
  break;
315
309
  default:
316
- console.warn(`Unexpected uniform type for scalar '${A}': ${i}`), r.uniform1f(e, t);
310
+ console.warn(`Unexpected uniform type for scalar '${t}': ${r}`), o.uniform1f(i, e);
317
311
  }
318
- else if (typeof t == "boolean") r.uniform1i(e, t ? 1 : 0);
319
- else if (Array.isArray(t)) if (Array.isArray(t[0])) {
320
- const o = t, g = ((Q = o[0]) == null ? void 0 : Q.length) || 0, a = o.flat();
321
- switch (i) {
322
- case r.FLOAT_VEC2:
323
- g === 2 ? r.uniform2fv(e, a) : console.warn(`Vector length mismatch for '${A}': expected 2, got ${g}`);
312
+ else if (typeof e == "boolean") o.uniform1i(i, e ? 1 : 0);
313
+ else if (Array.isArray(e)) if (Array.isArray(e[0])) {
314
+ const l = e, f = ((c = l[0]) == null ? void 0 : c.length) || 0, u = l.flat();
315
+ switch (r) {
316
+ case o.FLOAT_VEC2:
317
+ f === 2 ? o.uniform2fv(i, u) : console.warn(`Vector length mismatch for '${t}': expected 2, got ${f}`);
324
318
  break;
325
- case r.FLOAT_VEC3:
326
- g === 3 ? r.uniform3fv(e, a) : console.warn(`Vector length mismatch for '${A}': expected 3, got ${g}`);
319
+ case o.FLOAT_VEC3:
320
+ f === 3 ? o.uniform3fv(i, u) : console.warn(`Vector length mismatch for '${t}': expected 3, got ${f}`);
327
321
  break;
328
- case r.FLOAT_VEC4:
329
- g === 4 ? r.uniform4fv(e, a) : console.warn(`Vector length mismatch for '${A}': expected 4, got ${g}`);
322
+ case o.FLOAT_VEC4:
323
+ f === 4 ? o.uniform4fv(i, u) : console.warn(`Vector length mismatch for '${t}': expected 4, got ${f}`);
330
324
  break;
331
325
  default:
332
- console.warn(`Unsupported uniform type for vector array '${A}': ${i}`);
326
+ console.warn(`Unsupported uniform type for vector array '${t}': ${r}`);
333
327
  }
334
- } else switch (i) {
335
- case r.FLOAT_VEC2:
336
- t.length === 2 ? r.uniform2f(e, t[0], t[1]) : console.warn(`Vector length mismatch for '${A}': expected 2, got ${t.length}`);
328
+ } else switch (r) {
329
+ case o.FLOAT_VEC2:
330
+ e.length === 2 ? o.uniform2f(i, e[0], e[1]) : console.warn(`Vector length mismatch for '${t}': expected 2, got ${e.length}`);
337
331
  break;
338
- case r.FLOAT_VEC3:
339
- t.length === 3 ? r.uniform3f(e, t[0], t[1], t[2]) : console.warn(`Vector length mismatch for '${A}': expected 3, got ${t.length}`);
332
+ case o.FLOAT_VEC3:
333
+ e.length === 3 ? o.uniform3f(i, e[0], e[1], e[2]) : console.warn(`Vector length mismatch for '${t}': expected 3, got ${e.length}`);
340
334
  break;
341
- case r.FLOAT_VEC4:
342
- t.length === 4 ? r.uniform4f(e, t[0], t[1], t[2], t[3]) : console.warn(`Vector length mismatch for '${A}': expected 4, got ${t.length}`);
335
+ case o.FLOAT_VEC4:
336
+ e.length === 4 ? o.uniform4f(i, e[0], e[1], e[2], e[3]) : console.warn(`Vector length mismatch for '${t}': expected 4, got ${e.length}`);
343
337
  break;
344
- case r.INT:
345
- B > 1 ? r.uniform1iv(e, t) : console.warn(`Array provided for scalar uniform '${A}'`);
338
+ case o.INT:
339
+ n > 1 ? o.uniform1iv(i, e) : console.warn(`Array provided for scalar uniform '${t}'`);
346
340
  break;
347
- case r.FLOAT:
348
- B > 1 ? r.uniform1fv(e, t) : console.warn(`Array provided for scalar uniform '${A}'`);
341
+ case o.FLOAT:
342
+ n > 1 ? o.uniform1fv(i, e) : console.warn(`Array provided for scalar uniform '${t}'`);
349
343
  break;
350
344
  default:
351
- console.warn(`Unsupported uniform type for array '${A}': ${i}`);
345
+ console.warn(`Unsupported uniform type for array '${t}': ${r}`);
352
346
  }
353
- else if (t instanceof WebGLTexture) {
354
- const o = this.qA();
355
- r.uniform1i(e, o), r.activeTexture(r.TEXTURE0 + o), r.bindTexture(r.TEXTURE_2D, t);
356
- } else if (t instanceof U) {
357
- const o = this.qA();
358
- r.uniform1i(e, o), r.activeTexture(r.TEXTURE0 + o), r.bindTexture(r.TEXTURE_2D, t.textures[0]);
359
- } else console.warn(`Unsupported uniform type for '${A}':`, typeof t);
347
+ else if (e instanceof WebGLTexture) {
348
+ const l = this.Zt();
349
+ o.uniform1i(i, l), o.activeTexture(o.TEXTURE0 + l), o.bindTexture(o.TEXTURE_2D, e);
350
+ } else if (e instanceof q) {
351
+ const l = this.Zt();
352
+ o.uniform1i(i, l), o.activeTexture(o.TEXTURE0 + l), o.bindTexture(o.TEXTURE_2D, e.textures[0]);
353
+ } else console.warn(`Unsupported uniform type for '${t}':`, typeof e);
360
354
  }
361
- qA() {
362
- return this.TA++;
355
+ Zt() {
356
+ return this.Ot++;
363
357
  }
364
- get At() {
365
- return this.zA;
358
+ get Qt() {
359
+ return this.Dt;
366
360
  }
367
- kA() {
368
- this.wA.deleteProgram(this.zA);
361
+ Gt() {
362
+ this.vt.deleteProgram(this.Dt);
369
363
  }
370
364
  }
371
- const L = `#version 300 es
372
- in vec2 a_position;in vec2 a_texCoord;in vec2 a_instancePosition;in vec2 a_instanceSize;in vec3 a_instanceCharacter;in vec4 a_instancePrimaryColor;in vec4 a_instanceSecondaryColor;in vec2 a_instanceRotation;in vec3 a_instanceTransform;in vec3 a_instanceGlobalRotation;in vec2 a_instanceRotationCenter;in vec2 a_instanceBezierCP1;in vec2 a_instanceBezierCP2;in vec2 a_instanceBezierStart;in vec2 a_instanceBezierEnd;in vec2 a_instanceArcAngles;uniform float k;uniform vec2 t;out vec2 v_uv;out vec3 v_character;out vec4 v_primaryColor;out vec4 v_secondaryColor;out vec2 v_rotation;out vec3 v_transform;mat3 A(float B){float C=sin(B),D=cos(B);return mat3(1,0,0,0,D,-C,0,C,D);}mat3 E(float B){float C=sin(B),D=cos(B);return mat3(D,0,C,0,1,0,-C,0,D);}mat3 F(float B){float C=sin(B),D=cos(B);return mat3(D,-C,0,C,D,0,0,0,1);}vec2 G(float t,vec2 H,vec2 I,vec2 J,vec2 K){float L=1.-t,M=L*L,N=t*t;return M*L*H+3.*M*t*I+3.*L*N*J+N*t*K;}vec2 O(float t,vec2 H,vec2 I,vec2 J,vec2 K){float L=1.-t,M=L*L,N=t*t;return-3.*M*H+3.*M*I-6.*L*t*I+6.*L*t*J-3.*N*J+3.*N*K;}void main(){v_uv=a_texCoord;v_character=a_instanceCharacter;v_primaryColor=a_instancePrimaryColor;v_secondaryColor=a_instanceSecondaryColor;v_rotation=a_instanceRotation;v_transform=a_instanceTransform;vec2 P;bool Q=length(a_instanceBezierCP1)+length(a_instanceBezierCP2)+length(a_instanceBezierStart)+length(a_instanceBezierEnd)>0.;bool R=a_instanceArcAngles.x!=0.||a_instanceArcAngles.y!=0.;if(Q){float t=a_position.x;vec2 S=G(t,a_instanceBezierStart,a_instanceBezierCP1,a_instanceBezierCP2,a_instanceBezierEnd);vec2 T=O(t,a_instanceBezierStart,a_instanceBezierCP1,a_instanceBezierCP2,a_instanceBezierEnd);float U=length(T);T=U>0.?T/U:vec2(1,0);P=S+vec2(-T.y,T.x)*a_position.y*a_instanceSize.y;}else if(R){float C=a_instanceArcAngles.x,V=a_instanceArcAngles.y;C=mod(C,6.28318530718);if(C<0.)C+=6.28318530718;V=mod(V,6.28318530718);if(V<0.)V+=6.28318530718;float W=C-V;if(W<=0.)W+=6.28318530718;float X=C-a_position.x*W;vec2 Y=vec2(cos(X),sin(X))*a_position.y;P=Y*a_instanceSize*.5+a_instanceSize*.5+a_instancePosition;}else{P=a_position*a_instanceSize+a_instancePosition;}vec2 Z=(P/t)*2.-1.;Z.y=-Z.y;if(length(a_instanceGlobalRotation)>0.){vec3 a=vec3(Z-a_instanceRotationCenter,0);a.x*=k;if(a_instanceGlobalRotation.x!=0.)a=A(-a_instanceGlobalRotation.x)*a;if(a_instanceGlobalRotation.y!=0.)a=E(-a_instanceGlobalRotation.y)*a;if(a_instanceGlobalRotation.z!=0.)a=F(-a_instanceGlobalRotation.z)*a;a.x/=k;Z=a.xy+a_instanceRotationCenter;}gl_Position=vec4(Z,0,1);}`;
373
- class eA {
374
- constructor(A) {
375
- n(this, "tt", /* @__PURE__ */ new Map());
376
- n(this, "wA");
377
- this.wA = A;
378
- }
379
- et(A, t) {
380
- if (!this.tt.has(A)) {
381
- const e = t();
382
- this.tt.set(A, e);
383
- }
384
- return this.tt.get(A);
365
+ const X = `#version 300 es
366
+ in vec2 a_position;in vec2 a_texCoord;in vec2 a_instancePosition;in vec2 a_instanceSize;in vec3 a_instanceCharacter;in vec4 a_instancePrimaryColor;in vec4 a_instanceSecondaryColor;in vec2 a_instanceRotation;in vec3 a_instanceTransform;in vec3 a_instanceGlobalRotation;in vec2 a_instanceRotationCenter;in vec2 a_instanceBezierCP1;in vec2 a_instanceBezierCP2;in vec2 a_instanceBezierStart;in vec2 a_instanceBezierEnd;in vec2 a_instanceArcAngles;uniform float U9;uniform vec2 Uy;out vec2 v_uv;out vec3 v_character;out vec4 v_primaryColor;out vec4 v_secondaryColor;out vec2 v_rotation;out vec3 v_transform;mat3 A(float B){float C=sin(B),D=cos(B);return mat3(1,0,0,0,D,-C,0,C,D);}mat3 E(float B){float C=sin(B),D=cos(B);return mat3(D,0,C,0,1,0,-C,0,D);}mat3 F(float B){float C=sin(B),D=cos(B);return mat3(D,-C,0,C,D,0,0,0,1);}vec2 G(float H,vec2 I,vec2 J,vec2 K,vec2 L){float M=1.-H,N=M*M,O=H*H;return N*M*I+3.*N*H*J+3.*M*O*K+O*H*L;}vec2 P(float H,vec2 I,vec2 J,vec2 K,vec2 L){float M=1.-H,N=M*M,O=H*H;return-3.*N*I+3.*N*J-6.*M*H*J+6.*M*H*K-3.*O*K+3.*O*L;}void main(){v_uv=a_texCoord;v_character=a_instanceCharacter;v_primaryColor=a_instancePrimaryColor;v_secondaryColor=a_instanceSecondaryColor;v_rotation=a_instanceRotation;v_transform=a_instanceTransform;vec2 Q;bool R=length(a_instanceBezierCP1)+length(a_instanceBezierCP2)+length(a_instanceBezierStart)+length(a_instanceBezierEnd)>0.;bool S=a_instanceArcAngles.x!=0.||a_instanceArcAngles.y!=0.;if(R){float H=a_position.x;vec2 T=G(H,a_instanceBezierStart,a_instanceBezierCP1,a_instanceBezierCP2,a_instanceBezierEnd);vec2 U=P(H,a_instanceBezierStart,a_instanceBezierCP1,a_instanceBezierCP2,a_instanceBezierEnd);float V=length(U);U=V>0.?U/V:vec2(1,0);Q=T+vec2(-U.y,U.x)*a_position.y*a_instanceSize.y;}else if(S){float C=a_instanceArcAngles.x,W=a_instanceArcAngles.y;C=mod(C,6.28318530718);if(C<0.)C+=6.28318530718;W=mod(W,6.28318530718);if(W<0.)W+=6.28318530718;float X=C-W;if(X<=0.)X+=6.28318530718;float Y=C-a_position.x*X;vec2 Z=vec2(cos(Y),sin(Y))*a_position.y;Q=Z*a_instanceSize*.5+a_instanceSize*.5+a_instancePosition;}else{Q=a_position*a_instanceSize+a_instancePosition;}vec2 a=(Q/Uy)*2.-1.;a.y=-a.y;if(length(a_instanceGlobalRotation)>0.){vec3 b=vec3(a-a_instanceRotationCenter,0);b.x*=U9;if(a_instanceGlobalRotation.x!=0.)b=A(-a_instanceGlobalRotation.x)*b;if(a_instanceGlobalRotation.y!=0.)b=E(-a_instanceGlobalRotation.y)*b;if(a_instanceGlobalRotation.z!=0.)b=F(-a_instanceGlobalRotation.z)*b;b.x/=U9;a=b.xy+a_instanceRotationCenter;}gl_Position=vec4(a,0,1);}`, ht = "attribute vec2 a_position;attribute vec2 a_texCoord;varying vec2 v_uv;void main(){v_uv=a_texCoord;gl_Position=vec4(a_position,0.,1.);}";
367
+ class ft {
368
+ constructor(t) {
369
+ h(this, "vt");
370
+ h(this, "Jt");
371
+ h(this, "te");
372
+ h(this, "ee");
373
+ h(this, "se");
374
+ this.vt = t, this.te = new _(this.vt, X, `#version 300 es
375
+ precision highp float;in vec2 v_uv;in vec3 v_character;in vec4 v_primaryColor;in vec4 v_secondaryColor;in vec2 v_rotation;in vec3 v_transform;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 o_rotation;layout(location=4)out vec4 o_transform;void main(){o_character=vec4(v_character,1.);o_primaryColor=v_primaryColor;o_secondaryColor=v_secondaryColor;o_rotation=vec4(v_rotation,0.,1.);o_transform=vec4(v_transform,1.);}`), this.Jt = new _(this.vt, X, `#version 300 es
376
+ precision highp float;in vec2 v_uv;uniform sampler2D Ue;uniform sampler2D Uf;uniform sampler2D Ug;uniform sampler2D Uh;uniform sampler2D Ui;uniform vec2 Uj;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 o_rotation;layout(location=4)out vec4 o_transform;void main(){vec2 A=vec2(v_uv.x,1.-v_uv.y);vec2 B=A*Uj;vec2 C=(floor(B)+0.5f)/Uj;vec4 D=texture(Ue,C);vec4 E=texture(Uf,C);if(E.a==0.){discard;}vec4 F=texture(Ug,C);vec4 G=texture(Uh,C);vec4 H=texture(Ui,C);o_character=D;o_primaryColor=E;o_secondaryColor=F;o_rotation=G;o_transform=H;}`), this.ee = new _(this.vt, ht, "precision mediump float;uniform sampler2D U0;uniform vec2 U1;uniform sampler2D U3;uniform sampler2D U4;uniform sampler2D U5;uniform sampler2D U2;uniform sampler2D U6;uniform vec2 U7;uniform vec2 U8;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/U8;vec2 F=E*U7;vec2 G=floor(F);vec2 H=(G+0.5)/U7;vec4 I=texture2D(U3,H);vec4 J=texture2D(U4,H);vec4 K=texture2D(U5,H);bool L=K.r>0.5;bool M=K.g>0.5;bool N=K.b>0.5;vec4 O=texture2D(U2,H);int P=int(O.r*255.+0.5)+int(O.g*255.+0.5)*256;int Q=int(mod(float(P),U1.x));int R=P/int(U1.x);float S=(U1.y-1.)-float(R);vec2 T=vec2(float(Q),S)/U1;vec4 U=texture2D(U6,H);float V=U.r*255.+U.g;float W=-(V*360./255.)*0.017453292;vec2 X=fract(F)-0.5;if(M)X.x=-X.x;if(N)X.y=-X.y;X=A(W)*X+0.5;vec2 Y=1./U1;vec2 Z=T+X*Y;vec2 a=T+Y;if(any(lessThan(Z,T))||any(greaterThan(Z,a))){gl_FragColor=L?I:J;return;}vec4 b=texture2D(U0,Z);if(L)b.rgb=1.-b.rgb;gl_FragColor=mix(J,I,b);}"), this.se = new _(this.vt, X, `#version 300 es
377
+ precision highp float;in vec2 v_uv;uniform sampler2D Uk;uniform bool Ul;uniform bool Um;uniform bool Un;uniform vec2 Uo;uniform bool Up;uniform vec3 Uq;uniform bool Ur;uniform vec3 Us;uniform vec4 Ut;uniform int Uu;uniform vec3 Uv[64];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 o_rotation;layout(location=4)out vec4 o_transform;float A(vec3 B){return dot(B,vec3(0.299,0.587,0.114));}void main(){vec2 C=vec2(v_uv.x,1.-v_uv.y);vec4 D=texture(Uk,C);float E=A(D.rgb);if(Uu>0){float F=float(Uu);float G=clamp(E*(F-1.),0.,F-1.);int H=int(floor(G+0.5));vec3 I=Uv[H];o_character=vec4(I,1.);}else{o_character=vec4(E,0.,0.,1.);}vec3 J=D.rgb;vec3 K=Up?Uq:J;vec3 L=Ur?Us:J;float M=Up?1.:D.a;float N;if(D.a<0.01){K=Ut.rgb;L=Ut.rgb;M=Ut.a;N=Ut.a;}else{N=Ur?1.:D.a;}o_primaryColor=vec4(K,M);o_secondaryColor=vec4(L,N);o_rotation=vec4(Uo.xy,0.,1.);o_transform=vec4(float(Ul),float(Um),float(Un),1.);}`);
378
+ }
379
+ ie() {
380
+ return this.Jt;
385
381
  }
386
- st() {
387
- return this.et("mrt-copy", () => new T(this.wA, L, `#version 300 es
388
- precision highp float;in vec2 v_uv;uniform sampler2D l;uniform sampler2D m;uniform sampler2D n;uniform sampler2D o;uniform sampler2D p;uniform vec2 q;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 o_rotation;layout(location=4)out vec4 o_transform;void main(){vec2 A=vec2(v_uv.x,1.-v_uv.y);vec2 B=A*q;vec2 C=(floor(B)+0.5f)/q;vec4 D=texture(l,C);vec4 E=texture(m,C);if(E.a==0.){discard;}vec4 F=texture(n,C);vec4 G=texture(o,C);vec4 H=texture(p,C);o_character=D;o_primaryColor=E;o_secondaryColor=F;o_rotation=G;o_transform=H;}`));
382
+ Tt() {
383
+ return this.te;
389
384
  }
390
- YA() {
391
- return this.et("mrt-draw", () => new T(this.wA, L, `#version 300 es
392
- precision highp float;in vec2 v_uv;in vec3 v_character;in vec4 v_primaryColor;in vec4 v_secondaryColor;in vec2 v_rotation;in vec3 v_transform;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 o_rotation;layout(location=4)out vec4 o_transform;void main(){o_character=vec4(v_character,1.);o_primaryColor=v_primaryColor;o_secondaryColor=v_secondaryColor;o_rotation=vec4(v_rotation,0.,1.);o_transform=vec4(v_transform,1.);}`));
385
+ re() {
386
+ return this.ee;
393
387
  }
394
- it() {
395
- return this.et("ascii-conversion", () => new T(this.wA, "attribute vec2 a_position;attribute vec2 a_texCoord;varying vec2 v_uv;void main(){v_uv=a_texCoord;gl_Position=vec4(a_position,0.,1.);}", "precision mediump float;uniform sampler2D a;uniform vec2 b;uniform sampler2D d;uniform sampler2D e;uniform sampler2D f;uniform sampler2D c;uniform sampler2D g;uniform vec2 h;uniform vec2 i;uniform vec2 j;mat2 A(float B){float C=sin(B);float c=cos(B);return mat2(c,-C,C,c);}void main(){vec2 D=(gl_FragCoord.xy-j)/i;vec2 E=D*h;vec2 F=floor(E);vec2 G=(F+0.5)/h;vec4 H=texture2D(d,G);vec4 I=texture2D(e,G);vec4 J=texture2D(f,G);bool K=J.r>0.5;bool L=J.g>0.5;bool M=J.b>0.5;vec4 N=texture2D(c,G);int O=int(N.r*255.+0.5)+int(N.g*255.+0.5)*256;int P=int(mod(float(O),b.x));int Q=O/int(b.x);float R=(b.y-1.)-float(Q);vec2 S=vec2(float(P),R)/b;vec4 T=texture2D(g,G);float U=T.r*255.+T.g;float V=-(U*360./255.)*0.017453292;vec2 W=fract(E)-0.5;if(L)W.x=-W.x;if(M)W.y=-W.y;W=A(V)*W+0.5;vec2 X=1./b;vec2 Y=S+W*X;vec2 Z=S+X;if(any(lessThan(Y,S))||any(greaterThan(Y,Z))){gl_FragColor=K?H:I;return;}vec4 a=texture2D(a,Y);if(K)a.rgb=1.-a.rgb;gl_FragColor=mix(I,H,a);}"));
388
+ ne() {
389
+ return this.se;
396
390
  }
397
- Bt(A) {
398
- return new T(this.wA, L, A);
391
+ oe(t) {
392
+ return new _(this.vt, X, t);
399
393
  }
400
- Qt(A, t) {
401
- return new T(this.wA, A, t);
394
+ ae(t, e) {
395
+ return new _(this.vt, t, e);
402
396
  }
403
- kA() {
404
- for (const A of this.tt.values()) A.kA();
405
- this.tt.clear();
397
+ Gt() {
398
+ this.Jt.Gt(), this.te.Gt(), this.ee.Gt(), this.se.Gt();
406
399
  }
407
400
  }
408
- var D = ((E) => (E.RECTANGLE = "rectangle", E.LINE = "line", E.ELLIPSE = "ellipse", E.ARC = "arc", E.TRIANGLE = "triangle", E.BEZIER_CURVE = "bezier_curve", E.CUSTOM = "custom", E))(D || {});
409
- class sA {
410
- constructor(A) {
411
- n(this, "wA");
412
- n(this, "Et", /* @__PURE__ */ new Map());
413
- this.wA = A;
414
- }
415
- rt(A, t, e, s) {
416
- const i = this.wA;
417
- let B = this.Et.get(A);
418
- B || (B = /* @__PURE__ */ new Map(), this.Et.set(A, B));
419
- let r = B.get(t) || null;
420
- if (!r) {
421
- r = i.createVertexArray(), B.set(t, r), i.bindVertexArray(r), i.bindBuffer(i.ARRAY_BUFFER, s);
422
- const Q = i.getAttribLocation(A, "a_position");
423
- Q !== -1 && (i.enableVertexAttribArray(Q), i.vertexAttribPointer(Q, e.ot.nt.size, i.FLOAT, !1, e.gt, e.ot.nt.offset), i.vertexAttribDivisor(Q, 0));
424
- const o = i.getAttribLocation(A, "a_texCoord");
425
- o !== -1 && (i.enableVertexAttribArray(o), i.vertexAttribPointer(o, e.ot.ht.size, i.FLOAT, !1, e.gt, e.ot.ht.offset), i.vertexAttribDivisor(o, 0));
401
+ var E = ((a) => (a.RECTANGLE = "rectangle", a.LINE = "line", a.ELLIPSE = "ellipse", a.ARC = "arc", a.TRIANGLE = "triangle", a.BEZIER_CURVE = "bezier_curve", a.CUSTOM = "custom", a))(E || {});
402
+ class dt {
403
+ constructor(t) {
404
+ h(this, "vt");
405
+ h(this, "he", /* @__PURE__ */ new Map());
406
+ this.vt = t;
407
+ }
408
+ ce(t, e, i, s) {
409
+ const r = this.vt;
410
+ let n = this.he.get(t);
411
+ n || (n = /* @__PURE__ */ new Map(), this.he.set(t, n));
412
+ let o = n.get(e) || null;
413
+ if (!o) {
414
+ o = r.createVertexArray(), n.set(e, o), r.bindVertexArray(o), r.bindBuffer(r.ARRAY_BUFFER, s);
415
+ const c = r.getAttribLocation(t, "a_position");
416
+ c !== -1 && (r.enableVertexAttribArray(c), r.vertexAttribPointer(c, i.ue.le.size, r.FLOAT, !1, i.fe, i.ue.le.offset), r.vertexAttribDivisor(c, 0));
417
+ const l = r.getAttribLocation(t, "a_texCoord");
418
+ l !== -1 && (r.enableVertexAttribArray(l), r.vertexAttribPointer(l, i.ue.de.size, r.FLOAT, !1, i.fe, i.ue.de.offset), r.vertexAttribDivisor(l, 0));
426
419
  }
427
- i.bindVertexArray(r);
420
+ r.bindVertexArray(o);
428
421
  }
429
- ct() {
430
- this.wA.bindVertexArray(null);
422
+ pe() {
423
+ this.vt.bindVertexArray(null);
431
424
  }
432
- kA() {
433
- const A = this.wA;
434
- for (const [, t] of this.Et) for (const [, e] of t) e && A.deleteVertexArray(e);
435
- this.Et.clear();
425
+ Gt() {
426
+ for (const [, t] of this.he) for (const [, e] of t) e && this.vt.deleteVertexArray(e);
436
427
  }
437
428
  }
438
- class iA {
439
- constructor(A, t) {
440
- n(this, "lt");
441
- n(this, "wA");
442
- n(this, "vA");
443
- n(this, "Ct", null);
444
- n(this, "Dt", null);
445
- this.wA = A, this.lt = new sA(A), this.vA = t;
446
- }
447
- Pt(A, t, e) {
448
- const { shader: s } = A, i = G(this.wA) || this.wA.getParameter(this.wA.VIEWPORT);
449
- s.VA({ k: i[2] / i[3], t: [i[2], i[3]] });
450
- const B = (o) => {
451
- if (!o || !o.ut()) return;
452
- const g = o.unitGeometry, a = o.unitBuffer;
429
+ class gt {
430
+ constructor(t, e) {
431
+ h(this, "me");
432
+ h(this, "vt");
433
+ h(this, "xt");
434
+ h(this, "ge", null);
435
+ h(this, "_e", null);
436
+ this.vt = t, this.me = new dt(t), this.xt = e;
437
+ }
438
+ ve(t, e, i) {
439
+ const { shader: s } = t, r = k(this.vt) || this.vt.getParameter(this.vt.VIEWPORT);
440
+ s.Vt({ U9: r[2] / r[3], Uy: [r[2], r[3]] });
441
+ const n = (l) => {
442
+ if (!l || !l.ye()) return;
443
+ const f = l.unitGeometry, u = l.unitBuffer;
453
444
  try {
454
- this.lt.rt(s.At, o.type + "", g, a), o.batch.It(s), o.batch.wt(g.ft, g.dt);
445
+ this.me.ce(s.Qt, l.type + "", f, u), l.batch.Ae(s), l.batch.we(f.Ce, f.be);
455
446
  } finally {
456
- o.batch._t(s), this.lt.ct(), o.vt();
447
+ l.batch.xe(s), this.me.pe(), l.$e();
457
448
  }
458
449
  };
459
- let r = null, Q = null;
460
- for (const o of t) {
461
- if (o.type === D.CUSTOM) {
462
- Q && (B(Q), r = null, Q = null), this.yt(A, o.params, o.state, e.get(D.RECTANGLE));
450
+ let o = null, c = null;
451
+ for (const l of e) {
452
+ if (l.type === E.CUSTOM) {
453
+ c && (n(c), o = null, c = null), this.Me(t, l.params, l.state, i.get(E.RECTANGLE));
463
454
  continue;
464
455
  }
465
- r !== null && o.type !== r && (B(Q), r = null, Q = null);
466
- let g = Q;
467
- g && o.type === r || (g = e.get(o.type) || null, Q = g, r = o.type), g && g.bt(o.params, o.state);
456
+ o !== null && l.type !== o && (n(c), o = null, c = null);
457
+ let f = c;
458
+ f && l.type === o || (f = i.get(l.type) || null, c = f, o = l.type), f && f.Fe(l.params, l.state);
468
459
  }
469
- B(Q);
470
- }
471
- yt(A, t, e, s) {
472
- const { x: i, y: B, width: r, height: Q, shader: o, uniforms: g } = t;
473
- if (o === this.$t()) return this.Gt(s, o, g, Math.floor(i), Math.floor(B), Math.max(1, Math.floor(r)), Math.max(1, Math.floor(Q)), e), void A.shader.KA();
474
- const a = this.xt(Math.max(1, Math.floor(r)), Math.max(1, Math.floor(Q)));
475
- a.begin(), this.Gt(s, o, g, 0, 0, a.width, a.height, {}), a.end();
476
- const h = this.$t(), c = { l: a.textures[0], m: a.textures[1], n: a.textures[2], o: a.textures[3], p: a.textures[4], q: [a.width, a.height] };
477
- this.Gt(s, h, c, Math.floor(i), Math.floor(B), Math.max(1, Math.floor(r)), Math.max(1, Math.floor(Q)), e), A.shader.KA();
478
- }
479
- Gt(A, t, e, s, i, B, r, Q) {
480
- t.KA(), t.VA(e);
481
- const o = this.wA.getParameter(this.wA.VIEWPORT);
482
- if (t.VA({ k: o[2] / o[3], t: [o[2], o[3]] }), A.vt(), A.bt({ x: s, y: i, width: B, height: r }, Q), A.ut()) {
483
- const g = A.unitGeometry, a = A.unitBuffer;
460
+ n(c);
461
+ }
462
+ Me(t, e, i, s) {
463
+ const { x: r, y: n, width: o, height: c, shader: l, uniforms: f } = e, u = this.Re(Math.max(1, Math.floor(o)), Math.max(1, Math.floor(c)));
464
+ u.begin(), this.ze(s, l, f, 0, 0, u.width, u.height, {}), u.end();
465
+ const g = this.Pe(), v = { Ue: u.textures[0], Uf: u.textures[1], Ug: u.textures[2], Uh: u.textures[3], Ui: u.textures[4], Uj: [u.width, u.height] };
466
+ this.ze(s, g, v, Math.floor(r), Math.floor(n), Math.max(1, Math.floor(o)), Math.max(1, Math.floor(c)), i), t.shader.Xt();
467
+ }
468
+ ze(t, e, i, s, r, n, o, c) {
469
+ e.Xt(), e.Vt(i);
470
+ const l = this.vt.getParameter(this.vt.VIEWPORT);
471
+ if (e.Vt({ U9: l[2] / l[3], Uy: [l[2], l[3]] }), t.$e(), t.Fe({ x: s, y: r, width: n, height: o }, c), t.ye()) {
472
+ const f = t.unitGeometry, u = t.unitBuffer;
484
473
  try {
485
- this.lt.rt(t.At, A.type + "", g, a), A.batch.It(t), A.batch.wt(g.ft, g.dt);
474
+ this.me.ce(e.Qt, t.type + "", f, u), t.batch.Ae(e), t.batch.we(f.Ce, f.be);
486
475
  } finally {
487
- A.batch._t(t), this.lt.ct(), A.vt();
476
+ t.batch.xe(e), this.me.pe(), t.$e();
488
477
  }
489
478
  }
490
479
  }
491
- $t() {
492
- return this.vA.st();
480
+ Pe() {
481
+ return this.xt.ie();
493
482
  }
494
- xt(A, t) {
495
- return this.Ct && this.Dt && this.Dt.w === A && this.Dt.h === t || (this.Ct && this.Ct.kA(), this.Ct = new U(this.wA, A, t, 5), this.Dt = { w: A, h: t }), this.Ct;
483
+ Re(t, e) {
484
+ return this.ge && this._e && this._e.w === t && this._e.h === e || (this.ge && this.ge.Gt(), this.ge = new q(this.vt, t, e, 5), this._e = { w: t, h: e }), this.ge;
485
+ }
486
+ Gt() {
487
+ this.me.Gt(), this.ge && this.ge.Gt();
496
488
  }
497
489
  }
498
- class BA {
490
+ class pt {
499
491
  constructor() {
500
- n(this, "Mt", []);
501
- n(this, "Yt", 1);
502
- n(this, "Ft", 0);
503
- }
504
- Rt(A) {
505
- if (this.Ft >= this.Mt.length) {
506
- const e = { id: this.Yt++, type: A, params: {}, state: { V: 1, Z: 0, N: 0, X: 0, character: [0, 0, 0], charColor: [1, 1, 1, 1], bgColor: [0, 0, 0, 1], flipHorizontally: !1, flipVertically: !1, invert: !1, charRotation: [0, 0] } };
507
- this.Mt.push(e);
508
- }
509
- const t = this.Mt[this.Ft];
510
- switch (t.id = this.Yt++, t.type = A, A) {
511
- case D.RECTANGLE:
512
- case D.ELLIPSE:
513
- t.params && "width" in t.params || (t.params = { x: 0, y: 0, width: 0, height: 0 });
514
- break;
515
- case D.CUSTOM:
516
- t.params && "shader" in t.params || (t.params = { x: 0, y: 0, width: 0, height: 0, shader: void 0, uniforms: {} });
517
- break;
518
- case D.ARC:
519
- t.params && "start" in t.params || (t.params = { x: 0, y: 0, width: 0, height: 0, start: 0, stop: 0 });
520
- break;
521
- case D.LINE:
522
- t.params && "x2" in t.params || (t.params = { x1: 0, y1: 0, x2: 0, y2: 0, thickness: void 0 });
523
- break;
524
- case D.TRIANGLE:
525
- t.params && "x3" in t.params || (t.params = { x1: 0, y1: 0, x2: 0, y2: 0, x3: 0, y3: 0 });
526
- break;
527
- case D.BEZIER_CURVE:
528
- t.params && "cp2y" in t.params || (t.params = { x1: 0, y1: 0, cp1x: 0, cp1y: 0, cp2x: 0, cp2y: 0, x2: 0, y2: 0, thickness: void 0 });
529
- break;
530
- default:
531
- t.params || (t.params = {});
492
+ h(this, "Te", []);
493
+ h(this, "Se", 1);
494
+ h(this, "Ee", 0);
495
+ }
496
+ Be(t) {
497
+ if (this.Ee >= this.Te.length) {
498
+ const i = { id: this.Se++, type: t, params: {}, state: { I: 1, N: 0, X: 0, W: 0, j: [0, 0, 0], Y: [1, 1, 1, 1], q: [0, 0, 0, 1], V: !1, K: !1, D: !1, L: [0, 0] } };
499
+ this.Te.push(i);
532
500
  }
533
- return this.Ft++, t;
501
+ const e = this.Te[this.Ee];
502
+ return e.id = this.Se++, e.type = t, this.Ee++, e;
534
503
  }
535
- St(A, t, e, s, i) {
536
- const B = this.Rt(D.RECTANGLE);
537
- return B.params.x = A, B.params.y = t, B.params.width = e, B.params.height = s, i.BA(B.state), B.id;
504
+ Ge(t, e, i, s, r) {
505
+ const n = this.Be(E.RECTANGLE);
506
+ return n.params.x = t, n.params.y = e, n.params.width = i, n.params.height = s, r.J(n.state), n.id;
538
507
  }
539
- kt(A, t, e, s, i, B, r) {
540
- const Q = this.Rt(D.CUSTOM);
541
- return Q.params.x = A, Q.params.y = t, Q.params.width = e, Q.params.height = s, Q.params.shader = i, Q.params.uniforms = B, r.BA(Q.state), Q.id;
508
+ De(t, e, i, s, r, n, o) {
509
+ const c = this.Be(E.CUSTOM);
510
+ return c.params.x = t, c.params.y = e, c.params.width = i, c.params.height = s, c.params.shader = r, c.params.uniforms = n, o.J(c.state), c.id;
542
511
  }
543
- zt(A, t, e, s, i, B) {
544
- const r = this.Rt(D.LINE);
545
- return r.params.x1 = A, r.params.y1 = t, r.params.x2 = e, r.params.y2 = s, r.params.thickness = i, B.BA(r.state), r.id;
512
+ Le(t, e, i, s, r, n) {
513
+ const o = this.Be(E.LINE);
514
+ return o.params.x1 = t, o.params.y1 = e, o.params.x2 = i, o.params.y2 = s, o.params.thickness = r, n.J(o.state), o.id;
546
515
  }
547
- Lt(A, t, e, s, i) {
548
- const B = this.Rt(D.ELLIPSE);
549
- return B.params.x = A, B.params.y = t, B.params.width = e, B.params.height = s, i.BA(B.state), B.id;
516
+ ke(t, e, i, s, r) {
517
+ const n = this.Be(E.ELLIPSE);
518
+ return n.params.x = t, n.params.y = e, n.params.width = i, n.params.height = s, r.J(n.state), n.id;
550
519
  }
551
- Ot(A, t, e, s, i, B, r) {
552
- const Q = this.Rt(D.ARC);
553
- return Q.params.x = A, Q.params.y = t, Q.params.width = e, Q.params.height = s, Q.params.start = i, Q.params.stop = B, r.BA(Q.state), Q.id;
520
+ Oe(t, e, i, s, r, n, o) {
521
+ const c = this.Be(E.ARC);
522
+ return c.params.x = t, c.params.y = e, c.params.width = i, c.params.height = s, c.params.start = r, c.params.stop = n, o.J(c.state), c.id;
554
523
  }
555
- Tt(A, t, e, s, i, B, r) {
556
- const Q = this.Rt(D.TRIANGLE);
557
- return Q.params.x1 = A, Q.params.y1 = t, Q.params.x2 = e, Q.params.y2 = s, Q.params.x3 = i, Q.params.y3 = B, r.BA(Q.state), Q.id;
524
+ He(t, e, i, s, r, n, o) {
525
+ const c = this.Be(E.TRIANGLE);
526
+ return c.params.x1 = t, c.params.y1 = e, c.params.x2 = i, c.params.y2 = s, c.params.x3 = r, c.params.y3 = n, o.J(c.state), c.id;
558
527
  }
559
- Ut(A, t, e, s, i, B, r, Q, o, g) {
560
- const a = this.Rt(D.BEZIER_CURVE);
561
- return a.params.x1 = A, a.params.y1 = t, a.params.cp1x = e, a.params.cp1y = s, a.params.cp2x = i, a.params.cp2y = B, a.params.x2 = r, a.params.y2 = Q, a.params.thickness = o, g.BA(a.state), a.id;
528
+ Ie(t, e, i, s, r, n, o, c, l, f) {
529
+ const u = this.Be(E.BEZIER_CURVE);
530
+ return u.params.x1 = t, u.params.y1 = e, u.params.cp1x = i, u.params.cp1y = s, u.params.cp2x = r, u.params.cp2y = n, u.params.x2 = o, u.params.y2 = c, u.params.thickness = l, f.J(u.state), u.id;
562
531
  }
563
532
  get length() {
564
- return this.Ft;
533
+ return this.Ee;
565
534
  }
566
535
  get isEmpty() {
567
- return this.Ft === 0;
536
+ return this.Ee === 0;
568
537
  }
569
- Wt() {
570
- this.Ft = 0;
538
+ Ne() {
539
+ this.Ee = 0;
571
540
  }
572
541
  [Symbol.iterator]() {
573
- let A = 0;
574
- const t = this.Ft, e = this.Mt;
575
- return { next: () => A < t ? { value: e[A++], done: !1 } : { value: void 0, done: !0 } };
542
+ let t = 0;
543
+ const e = this.Ee, i = this.Te;
544
+ return { next: () => t < e ? { value: i[t++], done: !1 } : { value: void 0, done: !0 } };
576
545
  }
577
546
  }
578
- const y = class y {
579
- static Ht(A, t, e = 0) {
580
- var B, r, Q, o, g, a, h, c, l, C;
581
- const s = t || new Float32Array(y.FLOATS_PER_INSTANCE);
582
- let i = e;
583
- return s[i++] = A.position[0], s[i++] = A.position[1], s[i++] = A.size[0], s[i++] = A.size[1], s[i++] = A.AA[0], s[i++] = A.AA[1], s[i++] = A.AA[2], s[i++] = A.primaryColor[0], s[i++] = A.primaryColor[1], s[i++] = A.primaryColor[2], s[i++] = A.primaryColor[3], s[i++] = A.secondaryColor[0], s[i++] = A.secondaryColor[1], s[i++] = A.secondaryColor[2], s[i++] = A.secondaryColor[3], s[i++] = A.rotation[0], s[i++] = A.rotation[1], s[i++] = A.transform[0], s[i++] = A.transform[1], s[i++] = A.transform[2], s[i++] = A.globalRotationX, s[i++] = A.globalRotationY, s[i++] = A.globalRotationZ, s[i++] = A.rotationCenter[0], s[i++] = A.rotationCenter[1], s[i++] = ((B = A.arcAngles) == null ? void 0 : B[0]) || 0, s[i++] = ((r = A.arcAngles) == null ? void 0 : r[1]) || 0, s[i++] = ((Q = A.bezierControlPoint1) == null ? void 0 : Q[0]) || 0, s[i++] = ((o = A.bezierControlPoint1) == null ? void 0 : o[1]) || 0, s[i++] = ((g = A.bezierControlPoint2) == null ? void 0 : g[0]) || 0, s[i++] = ((a = A.bezierControlPoint2) == null ? void 0 : a[1]) || 0, s[i++] = ((h = A.bezierStartPoint) == null ? void 0 : h[0]) || 0, s[i++] = ((c = A.bezierStartPoint) == null ? void 0 : c[1]) || 0, s[i++] = ((l = A.bezierEndPoint) == null ? void 0 : l[0]) || 0, s[i++] = ((C = A.bezierEndPoint) == null ? void 0 : C[1]) || 0, s;
584
- }
585
- static Kt(A) {
586
- const t = A.length * y.FLOATS_PER_INSTANCE, e = new Float32Array(t);
587
- for (let s = 0; s < A.length; s++) {
588
- const i = s * y.FLOATS_PER_INSTANCE;
589
- y.Ht(A[s], e, i);
547
+ const P = class P {
548
+ static Xe(t, e, i = 0) {
549
+ var n, o, c, l, f, u, g, v, m, d;
550
+ const s = e || new Float32Array(P.FLOATS_PER_INSTANCE);
551
+ let r = i;
552
+ return s[r++] = t.le[0], s[r++] = t.le[1], s[r++] = t.Ee[0], s[r++] = t.Ee[1], s[r++] = t.j[0], s[r++] = t.j[1], s[r++] = t.j[2], s[r++] = t.Y[0], s[r++] = t.Y[1], s[r++] = t.Y[2], s[r++] = t.Y[3], s[r++] = t.q[0], s[r++] = t.q[1], s[r++] = t.q[2], s[r++] = t.q[3], s[r++] = t.L[0], s[r++] = t.L[1], s[r++] = t.We[0], s[r++] = t.We[1], s[r++] = t.We[2], s[r++] = t.N, s[r++] = t.X, s[r++] = t.W, s[r++] = t.Ve[0], s[r++] = t.Ve[1], s[r++] = ((n = t.Ke) == null ? void 0 : n[0]) || 0, s[r++] = ((o = t.Ke) == null ? void 0 : o[1]) || 0, s[r++] = ((c = t.je) == null ? void 0 : c[0]) || 0, s[r++] = ((l = t.je) == null ? void 0 : l[1]) || 0, s[r++] = ((f = t.Ye) == null ? void 0 : f[0]) || 0, s[r++] = ((u = t.Ye) == null ? void 0 : u[1]) || 0, s[r++] = ((g = t.qe) == null ? void 0 : g[0]) || 0, s[r++] = ((v = t.qe) == null ? void 0 : v[1]) || 0, s[r++] = ((m = t.Ze) == null ? void 0 : m[0]) || 0, s[r++] = ((d = t.Ze) == null ? void 0 : d[1]) || 0, s;
553
+ }
554
+ static Qe(t) {
555
+ const e = t.length * P.FLOATS_PER_INSTANCE, i = new Float32Array(e);
556
+ for (let s = 0; s < t.length; s++) {
557
+ const r = s * P.FLOATS_PER_INSTANCE;
558
+ P.Xe(t[s], i, r);
590
559
  }
591
- return e;
560
+ return i;
592
561
  }
593
562
  };
594
- n(y, "BYTES_PER_INSTANCE", 140), n(y, "FLOATS_PER_INSTANCE", 35);
595
- let R = y;
596
- const P = class P {
563
+ h(P, "BYTES_PER_INSTANCE", 140), h(P, "FLOATS_PER_INSTANCE", 35);
564
+ let D = P;
565
+ const T = class T {
597
566
  };
598
- n(P, "STRIDE", R.BYTES_PER_INSTANCE), n(P, "ATTRIBUTES", { a_instancePosition: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 0, divisor: 1 }, a_instanceSize: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 8, divisor: 1 }, a_instanceCharacter: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 16, divisor: 1 }, a_instancePrimaryColor: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 28, divisor: 1 }, a_instanceSecondaryColor: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 44, divisor: 1 }, a_instanceRotation: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 60, divisor: 1 }, a_instanceTransform: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 68, divisor: 1 }, a_instanceGlobalRotation: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 80, divisor: 1 }, a_instanceRotationCenter: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 92, divisor: 1 }, a_instanceArcAngles: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 100, divisor: 1 }, a_instanceBezierCP1: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 108, divisor: 1 }, a_instanceBezierCP2: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 116, divisor: 1 }, a_instanceBezierStart: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 124, divisor: 1 }, a_instanceBezierEnd: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 132, divisor: 1 } });
599
- let S = P;
600
- class rA {
601
- constructor(A, t = 1e3, e = 1.5) {
602
- n(this, "wA");
603
- n(this, "Jt", []);
604
- n(this, "Vt");
605
- n(this, "Zt");
606
- n(this, "Nt", null);
607
- n(this, "Xt", !0);
608
- n(this, "jt", 0);
609
- n(this, "qt", /* @__PURE__ */ new Map());
610
- n(this, "Ae", null);
611
- this.wA = A, this.Vt = t, this.Zt = e, this.te();
612
- }
613
- bt(A) {
614
- const t = this.Jt.length;
615
- return this.Jt.push(A), this.Xt = !0, t;
567
+ h(T, "STRIDE", D.BYTES_PER_INSTANCE), h(T, "ATTRIBUTES", { a_instancePosition: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: T.STRIDE, offset: 0, divisor: 1 }, a_instanceSize: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: T.STRIDE, offset: 8, divisor: 1 }, a_instanceCharacter: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: T.STRIDE, offset: 16, divisor: 1 }, a_instancePrimaryColor: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: T.STRIDE, offset: 28, divisor: 1 }, a_instanceSecondaryColor: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: T.STRIDE, offset: 44, divisor: 1 }, a_instanceRotation: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: T.STRIDE, offset: 60, divisor: 1 }, a_instanceTransform: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: T.STRIDE, offset: 68, divisor: 1 }, a_instanceGlobalRotation: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: T.STRIDE, offset: 80, divisor: 1 }, a_instanceRotationCenter: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: T.STRIDE, offset: 92, divisor: 1 }, a_instanceArcAngles: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: T.STRIDE, offset: 100, divisor: 1 }, a_instanceBezierCP1: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: T.STRIDE, offset: 108, divisor: 1 }, a_instanceBezierCP2: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: T.STRIDE, offset: 116, divisor: 1 }, a_instanceBezierStart: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: T.STRIDE, offset: 124, divisor: 1 }, a_instanceBezierEnd: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: T.STRIDE, offset: 132, divisor: 1 } });
568
+ let Y = T;
569
+ class mt {
570
+ constructor(t, e = 1e3, i = 1.5) {
571
+ h(this, "vt");
572
+ h(this, "Je", []);
573
+ h(this, "ts");
574
+ h(this, "es");
575
+ h(this, "ss", null);
576
+ h(this, "rs", !0);
577
+ h(this, "ns", 0);
578
+ h(this, "hs", /* @__PURE__ */ new Map());
579
+ h(this, "cs", null);
580
+ this.vt = t, this.ts = e, this.es = i, this.ls();
581
+ }
582
+ Fe(t) {
583
+ const e = this.Je.length;
584
+ return this.Je.push(t), this.rs = !0, e;
616
585
  }
617
586
  get count() {
618
- return this.Jt.length;
587
+ return this.Je.length;
619
588
  }
620
589
  get isEmpty() {
621
- return this.Jt.length === 0;
590
+ return this.Je.length === 0;
622
591
  }
623
592
  clear() {
624
- this.Jt.length = 0, this.Xt = !0;
625
- }
626
- ee(A) {
627
- if (A <= this.Vt) return;
628
- const t = Math.ceil(A * this.Zt);
629
- this.Vt = t, this.te();
630
- }
631
- te() {
632
- const A = this.wA;
633
- this.Nt && A.deleteBuffer(this.Nt), this.Nt = A.createBuffer();
634
- const t = this.Vt * R.BYTES_PER_INSTANCE;
635
- A.bindBuffer(A.ARRAY_BUFFER, this.Nt), A.bufferData(A.ARRAY_BUFFER, t, A.DYNAMIC_DRAW), A.bindBuffer(A.ARRAY_BUFFER, null), this.Xt = !0, this.jt = 0;
636
- }
637
- se() {
638
- if (!this.Xt || this.Jt.length === 0) return;
639
- const A = this.wA, t = this.Jt.length;
640
- this.ee(t), (!this.Ae || this.Ae.length < t * R.FLOATS_PER_INSTANCE) && (this.Ae = new Float32Array(t * R.FLOATS_PER_INSTANCE));
641
- const e = R.Kt(this.Jt);
642
- A.bindBuffer(A.ARRAY_BUFFER, this.Nt), t <= this.jt ? A.bufferSubData(A.ARRAY_BUFFER, 0, e) : A.bufferData(A.ARRAY_BUFFER, e, A.DYNAMIC_DRAW), A.bindBuffer(A.ARRAY_BUFFER, null), this.Xt = !1, this.jt = t;
643
- }
644
- ie(A) {
645
- let t = this.qt.get(A);
646
- if (!t) {
647
- t = /* @__PURE__ */ new Map();
648
- const e = this.wA;
649
- for (const s in S.ATTRIBUTES) {
650
- const i = e.getAttribLocation(A, s);
651
- i !== -1 && t.set(s, i);
593
+ this.Je.length = 0, this.rs = !0;
594
+ }
595
+ us(t) {
596
+ if (t <= this.ts) return;
597
+ const e = Math.ceil(t * this.es);
598
+ this.ts = e, this.ls();
599
+ }
600
+ ls() {
601
+ const t = this.vt;
602
+ this.ss && t.deleteBuffer(this.ss), this.ss = t.createBuffer();
603
+ const e = this.ts * D.BYTES_PER_INSTANCE;
604
+ t.bindBuffer(t.ARRAY_BUFFER, this.ss), t.bufferData(t.ARRAY_BUFFER, e, t.DYNAMIC_DRAW), t.bindBuffer(t.ARRAY_BUFFER, null), this.rs = !0, this.ns = 0;
605
+ }
606
+ fs() {
607
+ if (!this.rs || this.Je.length === 0) return;
608
+ const t = this.vt, e = this.Je.length;
609
+ this.us(e), (!this.cs || this.cs.length < e * D.FLOATS_PER_INSTANCE) && (this.cs = new Float32Array(e * D.FLOATS_PER_INSTANCE));
610
+ const i = D.Qe(this.Je);
611
+ t.bindBuffer(t.ARRAY_BUFFER, this.ss), e <= this.ns ? t.bufferSubData(t.ARRAY_BUFFER, 0, i) : t.bufferData(t.ARRAY_BUFFER, i, t.DYNAMIC_DRAW), t.bindBuffer(t.ARRAY_BUFFER, null), this.rs = !1, this.ns = e;
612
+ }
613
+ ds(t) {
614
+ let e = this.hs.get(t);
615
+ if (!e) {
616
+ e = /* @__PURE__ */ new Map();
617
+ const i = this.vt;
618
+ for (const s in Y.ATTRIBUTES) {
619
+ const r = i.getAttribLocation(t, s);
620
+ r !== -1 && e.set(s, r);
652
621
  }
653
- this.qt.set(A, t);
622
+ this.hs.set(t, e);
654
623
  }
655
- return t;
624
+ return e;
656
625
  }
657
- It(A) {
658
- if (!this.Nt || this.Jt.length === 0) return;
659
- const t = this.wA, e = A.At;
660
- this.se();
661
- const s = this.ie(e);
662
- t.bindBuffer(t.ARRAY_BUFFER, this.Nt);
663
- for (const [i, B] of s) {
664
- const r = S.ATTRIBUTES[i];
665
- r && (t.enableVertexAttribArray(B), t.vertexAttribPointer(B, r.size, r.type, r.normalized, r.stride, r.offset), t.vertexAttribDivisor(B, r.divisor));
626
+ Ae(t) {
627
+ if (!this.ss || this.Je.length === 0) return;
628
+ const e = this.vt, i = t.Qt;
629
+ this.fs();
630
+ const s = this.ds(i);
631
+ e.bindBuffer(e.ARRAY_BUFFER, this.ss);
632
+ for (const [r, n] of s) {
633
+ const o = Y.ATTRIBUTES[r];
634
+ o && (e.enableVertexAttribArray(n), e.vertexAttribPointer(n, o.size, o.type, o.normalized, o.stride, o.offset), e.vertexAttribDivisor(n, o.divisor));
666
635
  }
667
636
  }
668
- _t(A) {
669
- const t = this.wA, e = this.ie(A.At);
670
- for (const [, s] of e) t.disableVertexAttribArray(s), t.vertexAttribDivisor(s, 0);
637
+ xe(t) {
638
+ const e = this.vt, i = this.ds(t.Qt);
639
+ for (const [, s] of i) e.disableVertexAttribArray(s), e.vertexAttribDivisor(s, 0);
671
640
  }
672
- wt(A, t) {
673
- this.Jt.length !== 0 && this.wA.drawArraysInstanced(A, 0, t, this.Jt.length);
641
+ we(t, e) {
642
+ this.Je.length !== 0 && this.vt.drawArraysInstanced(t, 0, e, this.Je.length);
674
643
  }
675
- kA() {
676
- const A = this.wA;
677
- this.Nt && (A.deleteBuffer(this.Nt), this.Nt = null), this.Jt.length = 0, this.qt.clear(), this.Ae = null;
644
+ Gt() {
645
+ this.ss && this.vt.deleteBuffer(this.ss);
678
646
  }
679
647
  }
680
- class b {
681
- constructor(A, t, e, s) {
682
- n(this, "wA");
683
- n(this, "Be");
684
- n(this, "Qe");
685
- n(this, "Ee");
686
- n(this, "re", null);
687
- this.wA = A, this.Be = t, this.Qe = e, this.Ee = s;
688
- const i = this.wA.createBuffer();
689
- if (!i) throw Error("Failed to create unit geometry buffer");
690
- this.wA.bindBuffer(this.wA.ARRAY_BUFFER, i), this.wA.bufferData(this.wA.ARRAY_BUFFER, this.Ee.ne, this.wA.STATIC_DRAW), this.wA.bindBuffer(this.wA.ARRAY_BUFFER, null), this.re = i;
648
+ class I {
649
+ constructor(t, e, i, s) {
650
+ h(this, "vt");
651
+ h(this, "ps");
652
+ h(this, "gs");
653
+ h(this, "_s");
654
+ h(this, "vs", null);
655
+ this.vt = t, this.ps = e, this.gs = i, this._s = s;
656
+ const r = this.vt.createBuffer();
657
+ if (!r) throw Error("Failed to create unit geometry buffer");
658
+ this.vt.bindBuffer(this.vt.ARRAY_BUFFER, r), this.vt.bufferData(this.vt.ARRAY_BUFFER, this._s.As, this.vt.STATIC_DRAW), this.vt.bindBuffer(this.vt.ARRAY_BUFFER, null), this.vs = r;
691
659
  }
692
660
  get type() {
693
- return this.Qe;
661
+ return this.gs;
694
662
  }
695
663
  get unitGeometry() {
696
- return this.Ee;
664
+ return this._s;
697
665
  }
698
666
  get unitBuffer() {
699
- return this.re;
667
+ return this.vs;
700
668
  }
701
669
  get batch() {
702
- return this.Be;
670
+ return this.ps;
703
671
  }
704
- vt() {
705
- this.Be.clear();
672
+ $e() {
673
+ this.ps.clear();
706
674
  }
707
- ut() {
708
- return !this.Be.isEmpty;
675
+ ye() {
676
+ return !this.ps.isEmpty;
709
677
  }
710
- kA() {
711
- this.Be.kA(), this.re && (this.wA.deleteBuffer(this.re), this.re = null);
678
+ Gt() {
679
+ this.ps.Gt(), this.vt.deleteBuffer(this.vs);
712
680
  }
713
- oe(A, t, e, s, i) {
714
- const B = this.ge(A, t, e, s, i.rotationX || 0, i.rotationY || 0, i.rotationZ || 0);
715
- return { position: [A, t], size: [e, s], AA: i.character || [0, 0, 0], primaryColor: i.charColor || [1, 1, 1, 1], secondaryColor: i.bgColor || [0, 0, 0, 1], rotation: i.charRotation || [0, 0], transform: [i.invert ? 1 : 0, i.flipHorizontally ? 1 : 0, i.flipVertically ? 1 : 0], globalRotationX: B.radiansX, globalRotationY: B.radiansY, globalRotationZ: B.radiansZ, rotationCenter: [B.centerX, B.centerY] };
681
+ ws(t, e, i, s, r) {
682
+ const n = this.Cs(t, e, i, s, r.N || 0, r.X || 0, r.W || 0);
683
+ return { le: [t, e], Ee: [i, s], j: r.j || [0, 0, 0], Y: r.Y || [1, 1, 1, 1], q: r.q || [0, 0, 0, 1], L: r.L || [0, 0], We: [r.D ? 1 : 0, r.V ? 1 : 0, r.K ? 1 : 0], N: n.radiansX, X: n.radiansY, W: n.radiansZ, Ve: [n.centerX, n.centerY] };
716
684
  }
717
- ae(A, t) {
718
- const e = G(this.wA) || [0, 0, this.wA.canvas.width, this.wA.canvas.height];
719
- return { nx: A / e[2] * 2 - 1, ny: 1 - t / e[3] * 2 };
685
+ bs(t, e) {
686
+ const i = k(this.vt) || [0, 0, this.vt.canvas.width, this.vt.canvas.height];
687
+ return { nx: t / i[2] * 2 - 1, ny: 1 - e / i[3] * 2 };
720
688
  }
721
- he(A, t, e) {
722
- const s = this.ae(t, e);
723
- A.rotationCenter = [s.nx, s.ny];
689
+ $s(t, e, i) {
690
+ const s = this.bs(e, i);
691
+ t.Ve = [s.nx, s.ny];
724
692
  }
725
- ge(A, t, e, s, i, B, r) {
726
- const Q = G(this.wA) || [0, 0, this.wA.canvas.width, this.wA.canvas.height], o = Q[2], g = Q[3];
727
- return { centerX: (A + e / 2) / o * 2 - 1, centerY: 1 - (t + s / 2) / g * 2, radiansX: -i * Math.PI / 180, radiansY: -B * Math.PI / 180, radiansZ: -r * Math.PI / 180, aspectRatio: o / g };
693
+ Cs(t, e, i, s, r, n, o) {
694
+ const c = k(this.vt) || [0, 0, this.vt.canvas.width, this.vt.canvas.height], l = c[2], f = c[3];
695
+ return { centerX: (t + i / 2) / l * 2 - 1, centerY: 1 - (e + s / 2) / f * 2, radiansX: -r * Math.PI / 180, radiansY: -n * Math.PI / 180, radiansZ: -o * Math.PI / 180, aspectRatio: l / f };
728
696
  }
729
697
  }
730
- const EA = { ne: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1]), dt: 6, ft: WebGL2RenderingContext.TRIANGLES, gt: 16, ot: { nt: { size: 2, offset: 0 }, ht: { size: 2, offset: 8 } } };
731
- class QA extends b {
732
- constructor(A, t) {
733
- super(A, t, D.RECTANGLE, EA);
698
+ const vt = { As: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1]), be: 6, Ce: WebGL2RenderingContext.TRIANGLES, fe: 16, ue: { le: { size: 2, offset: 0 }, de: { size: 2, offset: 8 } } };
699
+ class At extends I {
700
+ constructor(t, e) {
701
+ super(t, e, E.RECTANGLE, vt);
734
702
  }
735
- bt(A, t) {
736
- const e = this.oe(A.x, A.y, A.width, A.height, t);
737
- return this.Be.bt(e);
703
+ Fe(t, e) {
704
+ const i = this.ws(t.x, t.y, t.width, t.height, e);
705
+ return this.ps.Fe(i);
738
706
  }
739
707
  }
740
- const nA = { ne: 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]), dt: 6, ft: WebGL2RenderingContext.TRIANGLES, gt: 16, ot: { nt: { size: 2, offset: 0 }, ht: { size: 2, offset: 8 } } };
741
- class oA extends b {
742
- constructor(A, t) {
743
- super(A, t, D.LINE, nA);
708
+ const xt = { As: 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]), be: 6, Ce: WebGL2RenderingContext.TRIANGLES, fe: 16, ue: { le: { size: 2, offset: 0 }, de: { size: 2, offset: 8 } } };
709
+ class yt extends I {
710
+ constructor(t, e) {
711
+ super(t, e, E.LINE, xt);
744
712
  }
745
- bt(A, t) {
746
- const e = A.x2 - A.x1, s = A.y2 - A.y1, i = Math.hypot(e, s), B = Math.atan2(s, e), r = A.thickness || t.lineWeight || 1, Q = A.x1 + e / 2, o = A.y1 + s / 2, g = Q - i / 2, a = o, h = { character: t.character, charColor: t.charColor, bgColor: t.bgColor, charRotation: t.charRotation, flipHorizontally: t.flipHorizontally, flipVertically: t.flipVertically, invert: t.invert, rotationX: t.rotationX || 0, rotationY: t.rotationY || 0, rotationZ: (t.rotationZ || 0) + 180 * B / Math.PI, lineWeight: r }, c = this.oe(g, a, i, r, h);
747
- return this.he(c, Q, o), this.Be.bt(c);
713
+ Fe(t, e) {
714
+ const i = t.x2 - t.x1, s = t.y2 - t.y1, r = Math.hypot(i, s), n = t.thickness || e.I || 1, o = t.x1 + i / 2, c = t.y1 + s / 2, l = o - r / 2, f = c, u = this.ws(l, f, r, n, e);
715
+ return this.$s(u, o, c), this.ps.Fe(u);
748
716
  }
749
717
  }
750
- const gA = { ne: function(E = 32) {
751
- const A = [], t = 2 * Math.PI / E;
752
- for (let e = 0; e < E; e++) {
753
- const s = e * t, i = (e + 1) % E * t, B = Math.cos(s), r = Math.sin(s), Q = 0.5 * (B + 1), o = 0.5 * (r + 1), g = Math.cos(i), a = Math.sin(i), h = 0.5 * (g + 1), c = 0.5 * (a + 1);
754
- A.push(0, 0, 0.5, 0.5, B, r, Q, o, g, a, h, c);
755
- }
756
- return new Float32Array(A);
757
- }(32), dt: 96, ft: WebGL2RenderingContext.TRIANGLES, gt: 16, ot: { nt: { size: 2, offset: 0 }, ht: { size: 2, offset: 8 } } };
758
- class aA extends b {
759
- constructor(A, t) {
760
- super(A, t, D.ELLIPSE, gA);
761
- }
762
- bt(A, t) {
763
- const e = this.oe(A.x, A.y, A.width, A.height, t);
764
- return this.he(e, A.x, A.y), this.Be.bt(e);
718
+ const Et = { As: function(a = 32) {
719
+ const t = [], e = 2 * Math.PI / a;
720
+ for (let i = 0; i < a; i++) {
721
+ const s = i * e, r = (i + 1) % a * e, n = Math.cos(s), o = Math.sin(s), c = 0.5 * (n + 1), l = 0.5 * (o + 1), f = Math.cos(r), u = Math.sin(r), g = 0.5 * (f + 1), v = 0.5 * (u + 1);
722
+ t.push(0, 0, 0.5, 0.5, n, o, c, l, f, u, g, v);
723
+ }
724
+ return new Float32Array(t);
725
+ }(32), be: 96, Ce: WebGL2RenderingContext.TRIANGLES, fe: 16, ue: { le: { size: 2, offset: 0 }, de: { size: 2, offset: 8 } } };
726
+ class wt extends I {
727
+ constructor(t, e) {
728
+ super(t, e, E.ELLIPSE, Et);
729
+ }
730
+ Fe(t, e) {
731
+ const i = this.ws(t.x, t.y, t.width, t.height, e);
732
+ return this.$s(i, t.x, t.y), this.ps.Fe(i);
765
733
  }
766
734
  }
767
- let hA = { ne: function(E) {
768
- const A = [];
769
- for (let t = 0; t < E; t++) {
770
- const e = t / E, s = (t + 1) / E;
771
- A.push(e, 0, e, 0, e, 1, e, 1, s, 1, s, 1);
772
- }
773
- return new Float32Array(A);
774
- }(32), dt: 96, ft: WebGL2RenderingContext.TRIANGLES, gt: 16, ot: { nt: { size: 2, offset: 0 }, ht: { size: 2, offset: 8 } } };
775
- class cA extends b {
776
- constructor(A, t) {
777
- super(A, t, D.ARC, hA);
778
- }
779
- bt(A, t) {
780
- const e = A.x - A.width / 2, s = A.y - A.height / 2, i = A.start * Math.PI / 180, B = A.stop * Math.PI / 180, r = this.oe(e, s, A.width, A.height, t);
781
- return this.he(r, A.x, A.y), r.arcAngles = [i, B], this.Be.bt(r);
735
+ let Rt = { As: function(a) {
736
+ const t = [];
737
+ for (let e = 0; e < a; e++) {
738
+ const i = e / a, s = (e + 1) / a;
739
+ t.push(i, 0, i, 0, i, 1, i, 1, s, 1, s, 1);
740
+ }
741
+ return new Float32Array(t);
742
+ }(32), be: 96, Ce: WebGL2RenderingContext.TRIANGLES, fe: 16, ue: { le: { size: 2, offset: 0 }, de: { size: 2, offset: 8 } } };
743
+ class bt extends I {
744
+ constructor(t, e) {
745
+ super(t, e, E.ARC, Rt);
746
+ }
747
+ Fe(t, e) {
748
+ const i = t.x - t.width / 2, s = t.y - t.height / 2, r = t.start * Math.PI / 180, n = t.stop * Math.PI / 180, o = this.ws(i, s, t.width, t.height, e);
749
+ return this.$s(o, t.x, t.y), o.Ke = [r, n], this.ps.Fe(o);
782
750
  }
783
751
  }
784
- const lA = { ne: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0.5, 1, 0.5, 1]), dt: 3, ft: WebGL2RenderingContext.TRIANGLES, gt: 16, ot: { nt: { size: 2, offset: 0 }, ht: { size: 2, offset: 8 } } };
785
- class CA extends b {
786
- constructor(A, t) {
787
- super(A, t, D.TRIANGLE, lA);
752
+ const Tt = { As: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0.5, 1, 0.5, 1]), be: 3, Ce: WebGL2RenderingContext.TRIANGLES, fe: 16, ue: { le: { size: 2, offset: 0 }, de: { size: 2, offset: 8 } } };
753
+ class Ct extends I {
754
+ constructor(t, e) {
755
+ super(t, e, E.TRIANGLE, Tt);
788
756
  }
789
- bt(A, t) {
790
- const e = Math.min(A.x1, A.x2, A.x3), s = Math.max(A.x1, A.x2, A.x3), i = Math.min(A.y1, A.y2, A.y3), B = s - e, r = Math.max(A.y1, A.y2, A.y3) - i, Q = this.oe(e, i, B, r, t), o = e + 0.5 * B, g = i + r * (1 / 3);
791
- return this.he(Q, o, g), this.Be.bt(Q);
757
+ Fe(t, e) {
758
+ const i = Math.min(t.x1, t.x2, t.x3), s = Math.max(t.x1, t.x2, t.x3), r = Math.min(t.y1, t.y2, t.y3), n = s - i, o = Math.max(t.y1, t.y2, t.y3) - r, c = this.ws(i, r, n, o, e), l = i + 0.5 * n, f = r + o * (1 / 3);
759
+ return this.$s(c, l, f), this.ps.Fe(c);
792
760
  }
793
761
  }
794
- function W(E, A, t, e, s) {
795
- const i = 1 - E, B = i * i, r = E * E;
796
- return B * i * A + 3 * B * E * t + 3 * i * r * e + r * E * s;
762
+ function et(a, t, e, i, s) {
763
+ const r = 1 - a, n = r * r, o = a * a;
764
+ return n * r * t + 3 * n * a * e + 3 * r * o * i + o * a * s;
797
765
  }
798
- const DA = { ne: function(E = 16) {
799
- const A = [];
800
- for (let t = 0; t < E; t++) {
801
- const e = t / E, s = (t + 1) / E;
802
- A.push(e, -0.5, e, 0), A.push(s, -0.5, s, 0), A.push(e, 0.5, e, 1), A.push(e, 0.5, e, 1), A.push(s, -0.5, s, 0), A.push(s, 0.5, s, 1);
803
- }
804
- return new Float32Array(A);
805
- }(16), dt: 96, ft: WebGL2RenderingContext.TRIANGLES, gt: 16, ot: { nt: { size: 2, offset: 0 }, ht: { size: 2, offset: 8 } } };
806
- class PA extends b {
807
- constructor(A, t) {
808
- super(A, t, D.BEZIER_CURVE, DA);
809
- }
810
- bt(A, t) {
811
- const e = t.lineWeight || 1, s = W(0.5, A.x1, A.cp1x, A.cp2x, A.x2), i = W(0.5, A.y1, A.cp1y, A.cp2y, A.y2), B = { character: t.character, charColor: t.charColor, bgColor: t.bgColor, charRotation: t.charRotation, flipHorizontally: t.flipHorizontally, flipVertically: t.flipVertically, invert: t.invert, rotationX: t.rotationX || 0, rotationY: t.rotationY || 0, rotationZ: t.rotationZ || 0, lineWeight: e }, r = this.oe(0, 0, 1, e, B);
812
- return this.he(r, s, i), r.bezierStartPoint = [A.x1, A.y1], r.bezierControlPoint1 = [A.cp1x, A.cp1y], r.bezierControlPoint2 = [A.cp2x, A.cp2y], r.bezierEndPoint = [A.x2, A.y2], this.Be.bt(r);
766
+ const Ut = { As: function(a = 16) {
767
+ const t = [];
768
+ for (let e = 0; e < a; e++) {
769
+ const i = e / a, s = (e + 1) / a;
770
+ t.push(i, -0.5, i, 0), t.push(s, -0.5, s, 0), t.push(i, 0.5, i, 1), t.push(i, 0.5, i, 1), t.push(s, -0.5, s, 0), t.push(s, 0.5, s, 1);
771
+ }
772
+ return new Float32Array(t);
773
+ }(16), be: 96, Ce: WebGL2RenderingContext.TRIANGLES, fe: 16, ue: { le: { size: 2, offset: 0 }, de: { size: 2, offset: 8 } } };
774
+ class Ft extends I {
775
+ constructor(t, e) {
776
+ super(t, e, E.BEZIER_CURVE, Ut);
777
+ }
778
+ Fe(t, e) {
779
+ const i = e.I || 1, s = et(0.5, t.x1, t.cp1x, t.cp2x, t.x2), r = et(0.5, t.y1, t.cp1y, t.cp2y, t.y2), n = this.ws(0, 0, 1, i, e);
780
+ return this.$s(n, s, r), n.qe = [t.x1, t.y1], n.je = [t.cp1x, t.cp1y], n.Ye = [t.cp2x, t.cp2y], n.Ze = [t.x2, t.y2], this.ps.Fe(n);
813
781
  }
814
782
  }
815
- class uA {
816
- constructor(A) {
817
- n(this, "wA");
818
- n(this, "ce", null);
819
- n(this, "le");
820
- n(this, "Ce", null);
821
- n(this, "De", {});
822
- n(this, "Pe", null);
823
- n(this, "ue", /* @__PURE__ */ new Map());
824
- n(this, "Ie");
825
- n(this, "we");
826
- n(this, "fe");
827
- n(this, "K", []);
828
- this.wA = A, this.le = new eA(A), this.fe = new J(), this.Ie = new iA(A, this), this.we = new BA(), this.Pe = A.createBuffer(), F(this.wA, [0, 0, this.wA.canvas.width, this.wA.canvas.height]);
783
+ class St {
784
+ constructor(t) {
785
+ h(this, "vt");
786
+ h(this, "Ms", null);
787
+ h(this, "Fs");
788
+ h(this, "Rs", null);
789
+ h(this, "zs", {});
790
+ h(this, "Ps", null);
791
+ h(this, "Ts", /* @__PURE__ */ new Map());
792
+ h(this, "Ss");
793
+ h(this, "Es");
794
+ h(this, "Bs");
795
+ h(this, "O", []);
796
+ this.vt = t, this.Fs = new ft(t), this.Bs = new at(), this.Ss = new gt(t, this), this.Es = new pt(), this.Ps = t.createBuffer(), H(this.vt, [0, 0, this.vt.canvas.width, this.vt.canvas.height]);
797
+ }
798
+ Gs(t) {
799
+ let e = this.Ts.get(t);
800
+ if (e) return e;
801
+ const i = new mt(this.vt);
802
+ return e = (0, { [E.RECTANGLE]: () => new At(this.vt, i), [E.LINE]: () => new yt(this.vt, i), [E.ELLIPSE]: () => new wt(this.vt, i), [E.ARC]: () => new bt(this.vt, i), [E.TRIANGLE]: () => new Ct(this.vt, i), [E.BEZIER_CURVE]: () => new Ft(this.vt, i) }[t])(), this.Ts.set(t, e), e;
803
+ }
804
+ Ds(t) {
805
+ this.Ms !== t && (this.Ms = t, t.Xt());
829
806
  }
830
- de(A) {
831
- let t = this.ue.get(A);
832
- if (t) return t;
833
- const e = new rA(this.wA);
834
- return t = (0, { [D.RECTANGLE]: () => new QA(this.wA, e), [D.LINE]: () => new oA(this.wA, e), [D.ELLIPSE]: () => new aA(this.wA, e), [D.ARC]: () => new cA(this.wA, e), [D.TRIANGLE]: () => new CA(this.wA, e), [D.BEZIER_CURVE]: () => new PA(this.wA, e) }[A])(), this.ue.set(A, t), t;
807
+ ae(t, e) {
808
+ return this.Fs.ae(t, e);
835
809
  }
836
- pe(A) {
837
- this.ce !== A && (this.ce = A, A.KA());
810
+ ie() {
811
+ return this.Fs.ie();
838
812
  }
839
- _e(A, t) {
840
- return this.le.Qt(A, t);
813
+ Tt() {
814
+ return this.Fs.Tt();
841
815
  }
842
- st() {
843
- return this.le.st();
816
+ re() {
817
+ return this.Fs.re();
844
818
  }
845
- YA() {
846
- return this.le.YA();
819
+ ne() {
820
+ return this.Fs.ne();
847
821
  }
848
- it() {
849
- return this.le.it();
822
+ Ls(t) {
823
+ this.Rs = t, t && (this.zs = {});
850
824
  }
851
- me(A) {
852
- this.Ce = A, A && (this.De = {});
825
+ Kt(t, e) {
826
+ this.zs[t] = e;
853
827
  }
854
- ZA(A, t) {
855
- this.De[A] = t;
828
+ ks(t) {
829
+ Object.assign(this.zs, t);
856
830
  }
857
- ve(A) {
858
- Object.assign(this.De, A);
831
+ oe(t) {
832
+ return this.Fs.oe(t);
859
833
  }
860
- Bt(A) {
861
- return this.le.Bt(A);
834
+ Os(t, e, i, s, r) {
835
+ const n = this.ie(), o = { Ue: t.textures[0], Uf: t.textures[1], Ug: t.textures[2], Uh: t.textures[3], Ui: t.textures[4], Uj: [t.width, t.height] };
836
+ this.Es.De(e, i, s, r, n, o, this.Bs);
862
837
  }
863
- ye(A, t, e, s, i) {
864
- const B = this.st(), r = { l: A.textures[0], m: A.textures[1], n: A.textures[2], o: A.textures[3], p: A.textures[4], q: [A.width, A.height] };
865
- this.we.kt(t, e, s, i, B, r, this.fe);
838
+ Hs(t, e, i, s, r) {
839
+ const n = this.ne(), o = t.texture, c = t.flags, l = t.charRotationRG, f = [l[0], l[1]], u = t.colorUniforms ?? { charColorFixed: !1, Y: [1, 1, 1], cellColorFixed: !1, cellColor: [0, 0, 0], backgroundColor: [0, 0, 0, 1] }, g = t.characterListUniforms, v = { Uk: o, Ul: !!c.invert, Um: !!c.flipX, Un: !!c.flipY, Uo: f, Up: !!u.charColorFixed, Uq: u.Y, Ur: !!u.cellColorFixed, Us: u.cellColor, Ut: u.backgroundColor, Uu: g.count, Uv: g.list };
840
+ this.Es.De(e, i, s, r, n, v, this.Bs);
866
841
  }
867
- be(A, t, e, s) {
868
- var C;
869
- const i = this.wA, B = i.canvas.width, r = i.canvas.height, Q = A / B * 2 - 1, o = (A + e) / B * 2 - 1, g = 1 - t / r * 2, a = 1 - (t + s) / r * 2, h = new Float32Array([Q, a, o, a, Q, g, o, a, o, g, Q, g]);
870
- i.bindBuffer(i.ARRAY_BUFFER, this.Pe), i.bufferData(i.ARRAY_BUFFER, h, i.DYNAMIC_DRAW);
871
- const c = ((C = this.ce) == null ? void 0 : C.At) || i.getParameter(i.CURRENT_PROGRAM), l = c ? i.getAttribLocation(c, "a_position") : -1;
872
- l !== -1 && (i.enableVertexAttribArray(l), i.vertexAttribPointer(l, 2, i.FLOAT, !1, 8, 0)), i.drawArrays(i.TRIANGLES, 0, 6), l !== -1 && i.disableVertexAttribArray(l);
842
+ Is(t, e, i, s) {
843
+ var d;
844
+ const r = this.vt, n = r.canvas.width, o = r.canvas.height, c = t / n * 2 - 1, l = (t + i) / n * 2 - 1, f = 1 - e / o * 2, u = 1 - (e + s) / o * 2, g = new Float32Array([c, u, l, u, c, f, l, u, l, f, c, f]);
845
+ r.bindBuffer(r.ARRAY_BUFFER, this.Ps), r.bufferData(r.ARRAY_BUFFER, g, r.DYNAMIC_DRAW);
846
+ const v = ((d = this.Ms) == null ? void 0 : d.Qt) || r.getParameter(r.CURRENT_PROGRAM), m = v ? r.getAttribLocation(v, "a_position") : -1;
847
+ m !== -1 && (r.enableVertexAttribArray(m), r.vertexAttribPointer(m, 2, r.FLOAT, !1, 8, 0)), r.drawArrays(r.TRIANGLES, 0, 6), m !== -1 && r.disableVertexAttribArray(m);
873
848
  }
874
- $e(A, t, e, s) {
875
- this.Ce ? (this.we.kt(A, t, e, s, this.Ce, { ...this.De }, this.fe), this.Ce = null, this.De = {}) : this.we.St(A, t, e, s, this.fe);
849
+ Ns(t, e, i, s) {
850
+ this.Rs ? (this.Es.De(t, e, i, s, this.Rs, { ...this.zs }, this.Bs), this.Rs = null, this.zs = {}) : this.Es.Ge(t, e, i, s, this.Bs);
876
851
  }
877
- Ge(A, t, e, s) {
878
- this.we.zt(A, t, e, s, this.fe.lineWeight, this.fe);
852
+ Xs(t, e, i, s) {
853
+ this.Es.Le(t, e, i, s, this.Bs.lineWeight, this.Bs);
879
854
  }
880
- xe(A, t, e, s) {
881
- this.we.Lt(A, t, e, s, this.fe);
855
+ Ws(t, e, i, s) {
856
+ this.Es.ke(t, e, i, s, this.Bs);
882
857
  }
883
- Me(A, t, e, s, i, B) {
884
- this.we.Tt(A, t, e, s, i, B, this.fe);
858
+ Vs(t, e, i, s, r, n) {
859
+ this.Es.He(t, e, i, s, r, n, this.Bs);
885
860
  }
886
- Ye(A, t, e, s, i, B, r, Q) {
887
- const o = this.fe.lineWeight;
888
- this.we.Ut(A, t, e, s, i, B, r, Q, o, this.fe);
861
+ Ks(t, e, i, s, r, n, o, c) {
862
+ const l = this.Bs.lineWeight;
863
+ this.Es.Ie(t, e, i, s, r, n, o, c, l, this.Bs);
889
864
  }
890
- Fe(A, t, e = 1, s = {}) {
891
- return new U(this.wA, A, t, e, s, this, !0);
865
+ js(t, e, i = 1, s = {}) {
866
+ return new q(this.vt, t, e, i, s, this, !0);
892
867
  }
893
- Re(A, t, e, s, i, B) {
894
- this.we.Ot(A, t, e, s, i, B, this.fe);
868
+ Ys(t, e, i, s, r, n) {
869
+ this.Es.Oe(t, e, i, s, r, n, this.Bs);
895
870
  }
896
- Se(A, t = A, e = A, s = 255) {
897
- this.state.DA(A, t, e, s), this.Wt(A / 255, t / 255, e / 255, s / 255);
871
+ qs(t, e = t, i = t, s = 255) {
872
+ this.state.ft(t, e, i, s), this.Ne(t / 255, e / 255, i / 255, s / 255);
898
873
  }
899
- Wt(A = 0, t = 0, e = 0, s = 0) {
900
- this.wA.clearColor(A, t, e, s), this.wA.clear(this.wA.COLOR_BUFFER_BIT);
874
+ Ne(t = 0, e = 0, i = 0, s = 0) {
875
+ this.vt.clearColor(t, e, i, s), this.vt.clear(this.vt.COLOR_BUFFER_BIT);
901
876
  }
902
- ke() {
903
- this.wA.viewport(0, 0, this.wA.canvas.width, this.wA.canvas.height), F(this.wA, [0, 0, this.wA.canvas.width, this.wA.canvas.height]);
877
+ Zs() {
878
+ this.vt.viewport(0, 0, this.vt.canvas.width, this.vt.canvas.height), H(this.vt, [0, 0, this.vt.canvas.width, this.vt.canvas.height]);
904
879
  }
905
880
  get context() {
906
- return this.wA;
881
+ return this.vt;
907
882
  }
908
883
  get state() {
909
- return this.fe;
884
+ return this.Bs;
910
885
  }
911
- RA(A) {
912
- this.K.push(this.fe), this.fe = A;
886
+ Et(t) {
887
+ this.O.push(this.Bs), this.Bs = t;
913
888
  }
914
- SA() {
915
- const A = this.K.pop();
916
- A && (this.fe = A);
889
+ Bt() {
890
+ const t = this.O.pop();
891
+ t && (this.Bs = t);
917
892
  }
918
- FA(A) {
919
- const t = A, e = G(this.wA) ?? this.wA.getParameter(this.wA.VIEWPORT), s = { shader: t, gl: this.wA, viewport: e };
920
- this.pe(t);
921
- const i = /* @__PURE__ */ new Set();
922
- for (const B of this.we) B.type === D.CUSTOM ? i.add(D.RECTANGLE) : i.add(B.type);
923
- for (const B of i) B !== D.CUSTOM && this.de(B);
924
- this.Ie.Pt(s, this.we, this.ue), this.we.Wt();
893
+ St(t) {
894
+ const e = t, i = k(this.vt) ?? this.vt.getParameter(this.vt.VIEWPORT), s = { shader: e, gl: this.vt, viewport: i };
895
+ this.Ds(e);
896
+ const r = /* @__PURE__ */ new Set();
897
+ for (const n of this.Es) n.type === E.CUSTOM ? r.add(E.RECTANGLE) : r.add(n.type);
898
+ for (const n of r) n !== E.CUSTOM && this.Gs(n);
899
+ this.Ss.ve(s, this.Es, this.Ts), this.Es.Ne();
925
900
  }
926
- kA() {
927
- this.wA.deleteBuffer(this.Pe), this.we.Wt();
928
- for (const A of this.ue.values()) A.kA();
929
- this.le.kA();
901
+ Gt() {
902
+ this.vt.deleteBuffer(this.Ps), this.Es.Ne();
903
+ for (const t of this.Ts.values()) t.Gt();
904
+ this.Fs.Gt(), this.Ss.Gt();
930
905
  }
931
906
  }
932
- const u = { readShort: (E, A) => (u.t.uint16[0] = E[A] << 8 | E[A + 1], u.t.int16[0]), readUshort: (E, A) => E[A] << 8 | E[A + 1], readUshorts(E, A, t) {
933
- const e = [];
934
- for (let s = 0; s < t; s++) e.push(u.readUshort(E, A + 2 * s));
935
- return e;
936
- }, readUint(E, A) {
937
- const t = u.t.uint8;
938
- return t[3] = E[A], t[2] = E[A + 1], t[1] = E[A + 2], t[0] = E[A + 3], u.t.uint32[0];
939
- }, readASCII(E, A, t) {
940
- let e = "";
941
- for (let s = 0; s < t; s++) e += String.fromCharCode(E[A + s]);
942
- return e;
907
+ const w = { readShort: (a, t) => (w.t.uint16[0] = a[t] << 8 | a[t + 1], w.t.int16[0]), readUshort: (a, t) => a[t] << 8 | a[t + 1], readUshorts(a, t, e) {
908
+ const i = [];
909
+ for (let s = 0; s < e; s++) i.push(w.readUshort(a, t + 2 * s));
910
+ return i;
911
+ }, readUint(a, t) {
912
+ const e = w.t.uint8;
913
+ return e[3] = a[t], e[2] = a[t + 1], e[1] = a[t + 2], e[0] = a[t + 3], w.t.uint32[0];
914
+ }, readASCII(a, t, e) {
915
+ let i = "";
916
+ for (let s = 0; s < e; s++) i += String.fromCharCode(a[t + s]);
917
+ return i;
918
+ }, writeUshort(a, t, e) {
919
+ a[t] = e >>> 8 & 255, a[t + 1] = 255 & e;
920
+ }, writeUint(a, t, e) {
921
+ a[t] = e >>> 24 & 255, a[t + 1] = e >>> 16 & 255, a[t + 2] = e >>> 8 & 255, a[t + 3] = 255 & e;
922
+ }, writeASCII(a, t, e) {
923
+ for (let i = 0; i < e.length; i++) a[t + i] = 255 & e.charCodeAt(i);
943
924
  }, t: (() => {
944
- const E = new ArrayBuffer(8);
945
- return { uint8: new Uint8Array(E), int16: new Int16Array(E), uint16: new Uint16Array(E), uint32: new Uint32Array(E) };
946
- })() }, wA = { parseTab(E, A, t) {
947
- const e = { tables: [], ids: {}, off: A };
948
- E = new Uint8Array(E.buffer, A, t), A = 0;
949
- const s = u, i = s.readUshort, B = i(E, A += 2);
950
- A += 2;
951
- const r = [];
952
- for (let Q = 0; Q < B; Q++) {
953
- const o = i(E, A), g = i(E, A += 2);
954
- A += 2;
955
- const a = s.readUint(E, A);
956
- A += 4;
957
- const h = `p${o}e${g}`;
958
- let c = r.indexOf(a);
959
- if (c === -1) {
960
- let l;
961
- c = e.tables.length, r.push(a);
962
- const C = i(E, a);
963
- l = C === 4 ? this.parse4(E, a) : C === 12 ? this.parse12(E, a) : { format: C }, e.tables.push(l);
925
+ const a = new ArrayBuffer(8);
926
+ return { uint8: new Uint8Array(a), int16: new Int16Array(a), uint16: new Uint16Array(a), uint32: new Uint32Array(a) };
927
+ })() };
928
+ function W(a) {
929
+ return a + 3 & -4;
930
+ }
931
+ function V(a, t, e) {
932
+ const i = t + e;
933
+ let s = 0;
934
+ const r = w.t;
935
+ for (let n = t; n < i; n += 4) r.uint8[3] = a[n] || 0, r.uint8[2] = a[n + 1] || 0, r.uint8[1] = a[n + 2] || 0, r.uint8[0] = a[n + 3] || 0, s = s + (r.uint32[0] >>> 0) >>> 0;
936
+ return s >>> 0;
937
+ }
938
+ class Bt {
939
+ constructor(t) {
940
+ h(this, "b");
941
+ h(this, "p", 0);
942
+ h(this, "bitbuf", 0);
943
+ h(this, "bitcnt", 0);
944
+ this.b = t;
945
+ }
946
+ readBits(t) {
947
+ for (; this.bitcnt < t; ) {
948
+ const i = this.b[this.p++] || 0;
949
+ this.bitbuf |= i << this.bitcnt, this.bitcnt += 8;
964
950
  }
965
- e.ids[h] = c;
966
- }
967
- return e;
968
- }, parse4(E, A) {
969
- const t = u, e = t.readUshort, s = t.readUshorts, i = A, B = e(E, A += 2);
970
- A += 2;
971
- const r = e(E, A += 2) >>> 1, Q = { format: 4, searchRange: e(E, A += 2), entrySelector: 0, rangeShift: 0, endCount: [], startCount: [], idDelta: [], idRangeOffset: [], glyphIdArray: [] };
972
- A += 2, Q.entrySelector = e(E, A), A += 2, Q.rangeShift = e(E, A), A += 2, Q.endCount = s(E, A, r), A += 2 * r, A += 2, Q.startCount = s(E, A, r), A += 2 * r;
973
- for (let o = 0; o < r; o++) Q.idDelta.push(t.readShort(E, A)), A += 2;
974
- return Q.idRangeOffset = s(E, A, r), A += 2 * r, Q.glyphIdArray = s(E, A, i + B - A >> 1), Q;
975
- }, parse12(E, A) {
976
- const t = u.readUint;
977
- t(E, A += 4), t(E, A += 4);
978
- const e = t(E, A += 4);
979
- A += 4;
980
- const s = new Uint32Array(3 * e);
981
- for (let i = 0; i < 3 * e; i += 3) s[i] = t(E, A + (i << 2)), s[i + 1] = t(E, A + (i << 2) + 4), s[i + 2] = t(E, A + (i << 2) + 8);
982
- return { format: 12, groups: s };
983
- } }, fA = { parseTab(E, A, t) {
984
- const e = u;
985
- A += 18;
986
- const s = e.readUshort(E, A);
987
- A += 2, A += 16;
988
- const i = e.readShort(E, A);
989
- A += 2;
990
- const B = e.readShort(E, A);
991
- A += 2;
992
- const r = e.readShort(E, A);
993
- A += 2;
994
- const Q = e.readShort(E, A);
995
- return A += 2, A += 6, { unitsPerEm: s, xMin: i, yMin: B, xMax: r, yMax: Q, indexToLocFormat: e.readShort(E, A) };
996
- } }, IA = { parseTab(E, A, t) {
997
- const e = u;
998
- A += 4;
999
- const s = ["ascender", "descender", "lineGap", "advanceWidthMax", "minLeftSideBearing", "minRightSideBearing", "xMaxExtent", "caretSlopeRise", "caretSlopeRun", "caretOffset", "res0", "res1", "res2", "res3", "metricDataFormat", "numberOfHMetrics"], i = {};
1000
- for (let B = 0; B < s.length; B++) {
1001
- const r = s[B], Q = r === "advanceWidthMax" || r === "numberOfHMetrics" ? e.readUshort : e.readShort;
1002
- i[r] = Q(E, A + 2 * B);
951
+ const e = this.bitbuf & (1 << t) - 1;
952
+ return this.bitbuf >>>= t, this.bitcnt -= t, e;
1003
953
  }
1004
- return i;
1005
- } }, dA = { parseTab(E, A, t, e) {
1006
- const s = u, i = [], B = [], r = e.maxp.numGlyphs, Q = e.hhea.numberOfHMetrics;
1007
- let o = 0, g = 0, a = 0;
1008
- for (; a < Q; ) o = s.readUshort(E, A + (a << 2)), g = s.readShort(E, A + (a << 2) + 2), i.push(o), B.push(g), a++;
1009
- for (; a < r; ) i.push(o), B.push(g), a++;
1010
- return { aWidth: i, lsBearing: B };
1011
- } }, V = { cmap: wA, head: fA, hhea: IA, maxp: { parseTab(E, A, t) {
1012
- const e = u;
1013
- return e.readUint(E, A), A += 4, { numGlyphs: e.readUshort(E, A) };
1014
- } }, hmtx: dA, loca: { parseTab(E, A, t, e) {
1015
- const s = u, i = [], B = e.head.indexToLocFormat, r = e.maxp.numGlyphs + 1;
1016
- if (B === 0) for (let Q = 0; Q < r; Q++) i.push(s.readUshort(E, A + (Q << 1)) << 1);
1017
- else if (B === 1) for (let Q = 0; Q < r; Q++) i.push(s.readUint(E, A + (Q << 2)));
1018
- return i;
1019
- } }, glyf: { parseTab(E, A, t, e) {
1020
- const s = [], i = e.maxp.numGlyphs;
1021
- for (let B = 0; B < i; B++) s.push(null);
1022
- return s;
1023
- }, ze(E, A) {
1024
- const t = u, e = E.Le, s = E.loca;
1025
- if (s[A] === s[A + 1]) return null;
1026
- const i = m.findTable(e, "glyf", E.Oe);
1027
- if (!i) return null;
1028
- let B = i[0] + s[A];
1029
- const r = {};
1030
- if (r.noc = t.readShort(e, B), B += 2, r.xMin = t.readShort(e, B), B += 2, r.yMin = t.readShort(e, B), B += 2, r.xMax = t.readShort(e, B), B += 2, r.yMax = t.readShort(e, B), B += 2, r.xMin >= r.xMax || r.yMin >= r.yMax) return null;
1031
- if (r.noc > 0) {
1032
- r.endPts = [];
1033
- for (let h = 0; h < r.noc; h++) r.endPts.push(t.readUshort(e, B)), B += 2;
1034
- const Q = t.readUshort(e, B);
1035
- if (B += 2, e.length - B < Q) return null;
1036
- B += Q;
1037
- const o = r.endPts[r.noc - 1] + 1;
1038
- r.flags = [];
1039
- for (let h = 0; h < o; h++) {
1040
- const c = e[B];
1041
- if (B++, r.flags.push(c), 8 & c) {
1042
- const l = e[B];
1043
- B++;
1044
- for (let C = 0; C < l; C++) r.flags.push(c), h++;
1045
- }
954
+ alignToByte() {
955
+ this.bitbuf = 0, this.bitcnt = 0;
956
+ }
957
+ get offset() {
958
+ return this.p;
959
+ }
960
+ }
961
+ function G(a) {
962
+ let t = 32, e = 0;
963
+ for (const o of a) o && (o < t && (t = o), o > e && (e = o));
964
+ if (e === 0) return { min: 0, max: 0, table: /* @__PURE__ */ new Map() };
965
+ const i = new Uint32Array(e + 1);
966
+ for (const o of a) o && i[o]++;
967
+ const s = new Uint32Array(e + 1);
968
+ let r = 0;
969
+ i[0] = 0;
970
+ for (let o = 1; o <= e; o++) r = r + i[o - 1] << 1, s[o] = r;
971
+ const n = /* @__PURE__ */ new Map();
972
+ for (let o = 0; o < a.length; o++) {
973
+ const c = a[o];
974
+ if (!c) continue;
975
+ const l = s[c]++;
976
+ let f = n.get(c);
977
+ f || (f = [], n.set(c, f)), f[Pt(l, c)] = o;
978
+ }
979
+ return { min: t, max: e, table: n };
980
+ }
981
+ function j(a, t) {
982
+ let e = 0;
983
+ for (let i = 1; i <= t.max; i++) {
984
+ e |= a.readBits(1) << i - 1;
985
+ const s = t.table.get(i);
986
+ if (s && e < s.length) {
987
+ const r = s[e];
988
+ if (r !== void 0) return r;
1046
989
  }
1047
- r.xs = [];
1048
- for (let h = 0; h < o; h++) {
1049
- const c = r.flags[h], l = !!(16 & c);
1050
- 2 & c ? (r.xs.push(l ? e[B] : -e[B]), B++) : l ? r.xs.push(0) : (r.xs.push(t.readShort(e, B)), B += 2);
990
+ }
991
+ throw Error("Invalid Huffman code");
992
+ }
993
+ function Pt(a, t) {
994
+ let e = 0;
995
+ for (let i = 0; i < t; i++) e = e << 1 | 1 & a, a >>>= 1;
996
+ return e >>> 0;
997
+ }
998
+ function Lt(a) {
999
+ if (a.length < 2) throw Error("ZLIB data too short");
1000
+ const t = a[0], e = a[1];
1001
+ if ((15 & t) != 8) throw Error("Unsupported ZLIB compression method");
1002
+ if (((t << 8) + e) % 31 != 0) throw Error("Bad ZLIB header check");
1003
+ let i = 2;
1004
+ 32 & e && (i += 4);
1005
+ const s = [];
1006
+ return function(r, n) {
1007
+ const o = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258], c = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], l = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577], f = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];
1008
+ let u = 0;
1009
+ for (; !u; ) {
1010
+ u = r.readBits(1);
1011
+ const g = r.readBits(2);
1012
+ if (g === 0) {
1013
+ r.alignToByte();
1014
+ const v = r.readBits(16);
1015
+ if ((65535 & (65535 ^ v)) !== r.readBits(16)) throw Error("DEFLATE uncompressed LEN/NLEN mismatch");
1016
+ for (let m = 0; m < v; m++) n.push(r.readBits(8));
1017
+ } else {
1018
+ if (g !== 1 && g !== 2) throw Error("Unsupported DEFLATE type");
1019
+ {
1020
+ let v, m;
1021
+ if (g === 1) {
1022
+ const d = Array(288).fill(0);
1023
+ for (let A = 0; A <= 143; A++) d[A] = 8;
1024
+ for (let A = 144; A <= 255; A++) d[A] = 9;
1025
+ for (let A = 256; A <= 279; A++) d[A] = 7;
1026
+ for (let A = 280; A <= 287; A++) d[A] = 8;
1027
+ v = G(d), m = G(Array(32).fill(5));
1028
+ } else {
1029
+ const d = r.readBits(5) + 257, A = r.readBits(5) + 1, p = r.readBits(4) + 4, y = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], x = Array(19).fill(0);
1030
+ for (let F = 0; F < p; F++) x[y[F]] = r.readBits(3);
1031
+ const C = G(x), R = [];
1032
+ for (; R.length < d + A; ) {
1033
+ const F = j(r, C);
1034
+ if (F <= 15) R.push(F);
1035
+ else if (F === 16) {
1036
+ const O = r.readBits(2) + 3, L = R[R.length - 1] || 0;
1037
+ for (let tt = 0; tt < O; tt++) R.push(L);
1038
+ } else if (F === 17) {
1039
+ const O = r.readBits(3) + 3;
1040
+ for (let L = 0; L < O; L++) R.push(0);
1041
+ } else {
1042
+ if (F !== 18) throw Error("Invalid code length symbol");
1043
+ {
1044
+ const O = r.readBits(7) + 11;
1045
+ for (let L = 0; L < O; L++) R.push(0);
1046
+ }
1047
+ }
1048
+ }
1049
+ const b = R.slice(0, d), S = R.slice(d, d + A);
1050
+ v = G(b), m = G(S);
1051
+ }
1052
+ for (; ; ) {
1053
+ const d = j(r, v);
1054
+ if (d < 256) n.push(d);
1055
+ else {
1056
+ if (d === 256) break;
1057
+ if (d > 256 && d < 286) {
1058
+ const A = d - 257;
1059
+ let p = o[A];
1060
+ const y = c[A];
1061
+ y && (p += r.readBits(y));
1062
+ const x = j(r, m);
1063
+ if (x >= 30) throw Error("Invalid distance symbol");
1064
+ let C = l[x];
1065
+ const R = f[x];
1066
+ R && (C += r.readBits(R));
1067
+ const b = n.length - C;
1068
+ if (b < 0) throw Error("Invalid distance");
1069
+ for (let S = 0; S < p; S++) n.push(n[b + S] || 0);
1070
+ } else if (d === 286 || d === 287) throw Error("Reserved length symbol");
1071
+ }
1072
+ }
1073
+ }
1074
+ }
1051
1075
  }
1052
- r.ys = [];
1053
- for (let h = 0; h < o; h++) {
1054
- const c = r.flags[h], l = !!(32 & c);
1055
- 4 & c ? (r.ys.push(l ? e[B] : -e[B]), B++) : l ? r.ys.push(0) : (r.ys.push(t.readShort(e, B)), B += 2);
1076
+ }(new Bt(a.subarray(i)), s), new Uint8Array(s);
1077
+ }
1078
+ function Mt(a) {
1079
+ const t = w, e = new Uint8Array(a);
1080
+ if (t.readASCII(e, 0, 4) !== "wOFF") throw Error("Invalid WOFF signature");
1081
+ const i = t.readUint(e, 4), s = t.readUshort(e, 12), r = t.readUint(e, 16), n = [];
1082
+ let o = 44;
1083
+ for (let p = 0; p < s; p++) {
1084
+ const y = t.readASCII(e, o, 4), x = t.readUint(e, o + 4), C = t.readUint(e, o + 8), R = t.readUint(e, o + 12), b = t.readUint(e, o + 16);
1085
+ n.push({ tag: y, offset: x, compLength: C, origLength: R, checksum: b }), o += 20;
1086
+ }
1087
+ for (const p of n) {
1088
+ const y = new Uint8Array(e.buffer, p.offset, p.compLength);
1089
+ if (p.compLength === p.origLength) p.data = new Uint8Array(y);
1090
+ else if (p.data = Lt(y), p.data.length !== p.origLength) if (p.data.length < p.origLength) {
1091
+ const x = new Uint8Array(p.origLength);
1092
+ x.set(p.data), p.data = x;
1093
+ } else p.data = p.data.subarray(0, p.origLength);
1094
+ }
1095
+ const c = s;
1096
+ let l = 1, f = 0;
1097
+ for (; l << 1 <= c; ) l <<= 1, f++;
1098
+ const u = 16 * l, g = 16 * c - u;
1099
+ let v = 12 + 16 * c;
1100
+ const m = {};
1101
+ for (const p of n) m[p.tag] = v, v = W(v + p.data.length);
1102
+ const d = new Uint8Array(Math.max(r || 0, v));
1103
+ t.writeUint(d, 0, i), t.writeUshort(d, 4, c), t.writeUshort(d, 6, u), t.writeUshort(d, 8, f), t.writeUshort(d, 10, g);
1104
+ let A = 12;
1105
+ for (const p of n) {
1106
+ t.writeASCII(d, A, p.tag), A += 4;
1107
+ let y = p.data;
1108
+ if (p.tag === "head" && y.length >= 12) {
1109
+ const x = new Uint8Array(y);
1110
+ t.writeUint(x, 8, 0);
1111
+ const C = V(x, 0, W(x.length));
1112
+ t.writeUint(d, A, C), A += 4;
1113
+ } else {
1114
+ const x = V(y, 0, W(y.length));
1115
+ t.writeUint(d, A, x), A += 4;
1056
1116
  }
1057
- let g = 0, a = 0;
1058
- for (let h = 0; h < o; h++) g += r.xs[h], a += r.ys[h], r.xs[h] = g, r.ys[h] = a;
1059
- } else r.parts = [], r.endPts = [], r.flags = [], r.xs = [], r.ys = [];
1060
- return r;
1061
- } } }, m = { parse: (E) => [((A, t, e, s) => {
1062
- const i = V, B = { Le: A, Te: t, Oe: e };
1063
- for (const r in i) {
1064
- const Q = r, o = m.findTable(A, Q, e);
1065
- if (o) {
1066
- const [g, a] = o;
1067
- let h = s[g];
1068
- h == null && (h = i[Q].parseTab(A, g, a, B), s[g] = h), B[Q] = h;
1117
+ t.writeUint(d, A, m[p.tag]), A += 4, t.writeUint(d, A, p.data.length), A += 4;
1118
+ }
1119
+ for (const p of n) {
1120
+ const y = m[p.tag];
1121
+ d.set(p.data, y);
1122
+ }
1123
+ if (n.find((p) => p.tag === "head")) {
1124
+ const p = m.head, y = function(x, C) {
1125
+ const R = w, b = C + 8, S = [x[b], x[b + 1], x[b + 2], x[b + 3]];
1126
+ R.writeUint(x, b, 0);
1127
+ const F = 2981146554 - (V(x, 0, W(x.length)) >>> 0) >>> 0;
1128
+ return x[b] = S[0], x[b + 1] = S[1], x[b + 2] = S[2], x[b + 3] = S[3], F >>> 0;
1129
+ }(d, p);
1130
+ t.writeUint(d, p + 8, y);
1131
+ }
1132
+ return d.buffer;
1133
+ }
1134
+ const Dt = { parseTab(a, t, e) {
1135
+ const i = { tables: [], ids: {}, off: t };
1136
+ a = new Uint8Array(a.buffer, t, e), t = 0;
1137
+ const s = w, r = s.readUshort, n = r(a, t += 2);
1138
+ t += 2;
1139
+ const o = [];
1140
+ for (let c = 0; c < n; c++) {
1141
+ const l = r(a, t), f = r(a, t += 2);
1142
+ t += 2;
1143
+ const u = s.readUint(a, t);
1144
+ t += 4;
1145
+ const g = `p${l}e${f}`;
1146
+ let v = o.indexOf(u);
1147
+ if (v === -1) {
1148
+ let m;
1149
+ v = i.tables.length, o.push(u);
1150
+ const d = r(a, u);
1151
+ m = d === 4 ? this.parse4(a, u) : d === 12 ? this.parse12(a, u) : { format: d }, i.tables.push(m);
1069
1152
  }
1153
+ i.ids[g] = v;
1070
1154
  }
1071
- return B;
1072
- })(new Uint8Array(E), 0, 0, {})], findTable(E, A, t) {
1073
- const e = u, s = e.readUshort(E, t + 4);
1074
- let i = t + 12;
1075
- for (let B = 0; B < s; B++) {
1076
- const r = e.readASCII(E, i, 4);
1077
- e.readUint(E, i + 4);
1078
- const Q = e.readUint(E, i + 8), o = e.readUint(E, i + 12);
1079
- if (r === A) return [Q, o];
1080
- i += 16;
1155
+ return i;
1156
+ }, parse4(a, t) {
1157
+ const e = w, i = e.readUshort, s = e.readUshorts, r = t, n = i(a, t += 2);
1158
+ t += 2;
1159
+ const o = i(a, t += 2) >>> 1, c = { format: 4, searchRange: i(a, t += 2), entrySelector: 0, rangeShift: 0, endCount: [], startCount: [], idDelta: [], idRangeOffset: [], glyphIdArray: [] };
1160
+ t += 2, c.entrySelector = i(a, t), t += 2, c.rangeShift = i(a, t), t += 2, c.endCount = s(a, t, o), t += 2 * o, t += 2, c.startCount = s(a, t, o), t += 2 * o;
1161
+ for (let l = 0; l < o; l++) c.idDelta.push(e.readShort(a, t)), t += 2;
1162
+ return c.idRangeOffset = s(a, t, o), t += 2 * o, c.glyphIdArray = s(a, t, r + n - t >> 1), c;
1163
+ }, parse12(a, t) {
1164
+ const e = w.readUint;
1165
+ e(a, t += 4), e(a, t += 4);
1166
+ const i = e(a, t += 4);
1167
+ t += 4;
1168
+ const s = new Uint32Array(3 * i);
1169
+ for (let r = 0; r < 3 * i; r += 3) s[r] = e(a, t + (r << 2)), s[r + 1] = e(a, t + (r << 2) + 4), s[r + 2] = e(a, t + (r << 2) + 8);
1170
+ return { format: 12, groups: s };
1171
+ } }, _t = { parseTab(a, t, e) {
1172
+ const i = w;
1173
+ t += 18;
1174
+ const s = i.readUshort(a, t);
1175
+ t += 2, t += 16;
1176
+ const r = i.readShort(a, t);
1177
+ t += 2;
1178
+ const n = i.readShort(a, t);
1179
+ t += 2;
1180
+ const o = i.readShort(a, t);
1181
+ t += 2;
1182
+ const c = i.readShort(a, t);
1183
+ return t += 2, t += 6, { unitsPerEm: s, xMin: r, yMin: n, xMax: o, yMax: c, indexToLocFormat: i.readShort(a, t) };
1184
+ } }, It = { parseTab(a, t, e) {
1185
+ const i = w;
1186
+ t += 4;
1187
+ const s = ["ascender", "descender", "lineGap", "advanceWidthMax", "minLeftSideBearing", "minRightSideBearing", "xMaxExtent", "caretSlopeRise", "caretSlopeRun", "caretOffset", "res0", "res1", "res2", "res3", "metricDataFormat", "numberOfHMetrics"], r = {};
1188
+ for (let n = 0; n < s.length; n++) {
1189
+ const o = s[n], c = o === "advanceWidthMax" || o === "numberOfHMetrics" ? i.readUshort : i.readShort;
1190
+ r[o] = c(a, t + 2 * n);
1081
1191
  }
1082
- return null;
1083
- }, T: V, B: u };
1084
- class _ {
1085
- constructor() {
1086
- n(this, "Ue", /* @__PURE__ */ new Map());
1087
- n(this, "We", /* @__PURE__ */ new Map());
1088
- }
1089
- He(A, t) {
1090
- const e = `${this.Ke(A)}_${t}`;
1091
- if (this.Ue.has(e)) return this.Ue.get(e);
1092
- const s = A.cmap;
1093
- if (!s || !s.tables) return this.Ue.set(e, 0), 0;
1094
- let i = 0;
1095
- for (const B of s.tables) if (B.format === 4 ? i = this.Je(t, B) : B.format === 12 && (i = this.Ve(t, B)), i > 0) break;
1096
- return this.Ue.set(e, i), i;
1097
- }
1098
- Ze(A, t) {
1099
- const e = t.codePointAt(0);
1100
- return e === void 0 ? 0 : this.He(A, e);
1101
- }
1102
- Ne(A, t) {
1103
- const e = A.hmtx;
1104
- return e && e.aWidth && e.aWidth.length !== 0 ? t < e.aWidth.length ? e.aWidth[t] : e.aWidth[e.aWidth.length - 1] : 0;
1105
- }
1106
- Xe(A, t) {
1107
- const e = t / A.head.unitsPerEm, s = A.hhea.ascender * e, i = A.hhea.descender * e, B = A.hhea.lineGap * e;
1108
- return { ascender: s, descender: i, lineGap: B, lineHeight: s - i + B, unitsPerEm: A.head.unitsPerEm, scale: e };
1109
- }
1110
- je() {
1111
- this.Ue.clear(), this.We.clear();
1112
- }
1113
- Ke(A) {
1114
- return `${A.Oe}_${A.Le.length}`;
1115
- }
1116
- Je(A, t) {
1117
- const e = t.endCount.length;
1118
- let s = -1;
1119
- for (let i = 0; i < e; i++) if (A <= t.endCount[i]) {
1120
- s = i;
1121
- break;
1122
- }
1123
- if (s === -1 || A < t.startCount[s]) return 0;
1124
- if (t.idRangeOffset[s] === 0) return A + t.idDelta[s] & 65535;
1125
- {
1126
- const i = t.idRangeOffset[s] / 2 + (A - t.startCount[s]) - (e - s);
1127
- if (i >= 0 && i < t.glyphIdArray.length) {
1128
- const B = t.glyphIdArray[i];
1129
- return B === 0 ? 0 : B + t.idDelta[s] & 65535;
1192
+ return r;
1193
+ } }, Ot = { parseTab(a, t, e, i) {
1194
+ const s = w, r = [], n = [], o = i.maxp.numGlyphs, c = i.hhea.numberOfHMetrics;
1195
+ let l = 0, f = 0, u = 0;
1196
+ for (; u < c; ) l = s.readUshort(a, t + (u << 2)), f = s.readShort(a, t + (u << 2) + 2), r.push(l), n.push(f), u++;
1197
+ for (; u < o; ) r.push(l), n.push(f), u++;
1198
+ return { aWidth: r, lsBearing: n };
1199
+ } }, it = { cmap: Dt, head: _t, hhea: It, maxp: { parseTab(a, t, e) {
1200
+ const i = w;
1201
+ return i.readUint(a, t), t += 4, { numGlyphs: i.readUshort(a, t) };
1202
+ } }, hmtx: Ot, loca: { parseTab(a, t, e, i) {
1203
+ const s = w, r = [], n = i.head.indexToLocFormat, o = i.maxp.numGlyphs + 1;
1204
+ if (n === 0) for (let c = 0; c < o; c++) r.push(s.readUshort(a, t + (c << 1)) << 1);
1205
+ else if (n === 1) for (let c = 0; c < o; c++) r.push(s.readUint(a, t + (c << 2)));
1206
+ return r;
1207
+ } }, glyf: { parseTab(a, t, e, i) {
1208
+ const s = [], r = i.maxp.numGlyphs;
1209
+ for (let n = 0; n < r; n++) s.push(null);
1210
+ return s;
1211
+ }, Qs(a, t) {
1212
+ const e = w, i = a.Js, s = a.loca;
1213
+ if (s[t] === s[t + 1]) return null;
1214
+ const r = B.findTable(i, "glyf", a.ti);
1215
+ if (!r) return null;
1216
+ let n = r[0] + s[t];
1217
+ const o = {};
1218
+ if (o.noc = e.readShort(i, n), n += 2, o.xMin = e.readShort(i, n), n += 2, o.yMin = e.readShort(i, n), n += 2, o.xMax = e.readShort(i, n), n += 2, o.yMax = e.readShort(i, n), n += 2, o.xMin >= o.xMax || o.yMin >= o.yMax) return null;
1219
+ if (o.noc > 0) {
1220
+ o.endPts = [];
1221
+ for (let g = 0; g < o.noc; g++) o.endPts.push(e.readUshort(i, n)), n += 2;
1222
+ const c = e.readUshort(i, n);
1223
+ if (n += 2, i.length - n < c) return null;
1224
+ n += c;
1225
+ const l = o.endPts[o.noc - 1] + 1;
1226
+ o.flags = [];
1227
+ for (let g = 0; g < l; g++) {
1228
+ const v = i[n];
1229
+ if (n++, o.flags.push(v), 8 & v) {
1230
+ const m = i[n];
1231
+ n++;
1232
+ for (let d = 0; d < m; d++) o.flags.push(v), g++;
1130
1233
  }
1131
1234
  }
1132
- return 0;
1133
- }
1134
- Ve(A, t) {
1135
- const e = t.groups.length / 3;
1136
- for (let s = 0; s < e; s++) {
1137
- const i = t.groups[3 * s], B = t.groups[3 * s + 1], r = t.groups[3 * s + 2];
1138
- if (A >= i && A <= B) return r + (A - i);
1235
+ o.xs = [];
1236
+ for (let g = 0; g < l; g++) {
1237
+ const v = o.flags[g], m = !!(16 & v);
1238
+ 2 & v ? (o.xs.push(m ? i[n] : -i[n]), n++) : m ? o.xs.push(0) : (o.xs.push(e.readShort(i, n)), n += 2);
1139
1239
  }
1140
- return 0;
1141
- }
1142
- }
1143
- class pA {
1144
- constructor(A) {
1145
- n(this, "qe");
1146
- this.qe = A;
1240
+ o.ys = [];
1241
+ for (let g = 0; g < l; g++) {
1242
+ const v = o.flags[g], m = !!(32 & v);
1243
+ 4 & v ? (o.ys.push(m ? i[n] : -i[n]), n++) : m ? o.ys.push(0) : (o.ys.push(e.readShort(i, n)), n += 2);
1244
+ }
1245
+ let f = 0, u = 0;
1246
+ for (let g = 0; g < l; g++) f += o.xs[g], u += o.ys[g], o.xs[g] = f, o.ys[g] = u;
1247
+ } else o.parts = [], o.endPts = [], o.flags = [], o.xs = [], o.ys = [];
1248
+ return o;
1249
+ } } }, B = { parse(a) {
1250
+ const t = new Uint8Array(a), e = w.readASCII(t, 0, 4);
1251
+ if (e === "wOFF") a = Mt(a);
1252
+ else if (e === "wOF2") throw Error("WOFF2 is not supported in this build (Brotli + WOFF2 transforms required)");
1253
+ return [((i, s, r, n) => {
1254
+ const o = it, c = { Js: i, ei: s, ti: r };
1255
+ for (const l in o) {
1256
+ const f = l, u = B.findTable(i, f, r);
1257
+ if (u) {
1258
+ const [g, v] = u;
1259
+ let m = n[g];
1260
+ m == null && (m = o[f].parseTab(i, g, v, c), n[g] = m), c[f] = m;
1261
+ }
1262
+ }
1263
+ return c;
1264
+ })(new Uint8Array(a), 0, 0, {})];
1265
+ }, findTable(a, t, e) {
1266
+ const i = w, s = i.readUshort(a, e + 4);
1267
+ let r = e + 12;
1268
+ for (let n = 0; n < s; n++) {
1269
+ const o = i.readASCII(a, r, 4);
1270
+ i.readUint(a, r + 4);
1271
+ const c = i.readUint(a, r + 8), l = i.readUint(a, r + 12);
1272
+ if (o === t) return [c, l];
1273
+ r += 16;
1147
1274
  }
1148
- As(A) {
1149
- var e;
1150
- const t = [];
1151
- return (e = A.cmap) != null && e.tables ? (A.cmap.tables.forEach((s) => {
1275
+ return null;
1276
+ }, T: it, B: w };
1277
+ class Gt {
1278
+ si(t) {
1279
+ var i;
1280
+ const e = [];
1281
+ return (i = t.cmap) != null && i.tables ? (t.cmap.tables.forEach((s) => {
1152
1282
  if (s.format === 4) {
1153
- const i = this.ts(s);
1154
- t.push(...i);
1283
+ const r = this.ii(s);
1284
+ e.push(...r);
1155
1285
  } else if (s.format === 12) {
1156
- const i = this.es(s);
1157
- t.push(...i);
1286
+ const r = this.ri(s);
1287
+ e.push(...r);
1158
1288
  }
1159
- }), [...new Set(t)]) : [];
1289
+ }), [...new Set(e)]) : [];
1160
1290
  }
1161
- ss(A, t) {
1162
- return this.qe.Ze(A, t) > 0;
1291
+ ni(t) {
1292
+ return t.filter((e) => this.oi(e));
1163
1293
  }
1164
- Bs(A, t) {
1165
- for (const e of t) if (!this.ss(A, e)) return !1;
1166
- return !0;
1167
- }
1168
- Qs(A, t) {
1169
- return t.filter((e) => this.ss(A, e));
1170
- }
1171
- Es(A) {
1172
- return A.filter((t) => this.rs(t));
1173
- }
1174
- ts(A) {
1175
- const t = [];
1176
- if (!(A.startCount && A.endCount && A.idRangeOffset && A.idDelta)) return t;
1177
- for (let e = 0; e < A.startCount.length; e++) {
1178
- const s = A.startCount[e], i = A.endCount[e];
1179
- if (s !== 65535 || i !== 65535) {
1180
- for (let B = s; B <= i; B++)
1181
- if (this.ns(A, B, e) > 0) try {
1182
- const r = String.fromCodePoint(B);
1183
- t.push(r);
1294
+ ii(t) {
1295
+ const e = [];
1296
+ if (!(t.startCount && t.endCount && t.idRangeOffset && t.idDelta)) return e;
1297
+ for (let i = 0; i < t.startCount.length; i++) {
1298
+ const s = t.startCount[i], r = t.endCount[i];
1299
+ if (s !== 65535 || r !== 65535) {
1300
+ for (let n = s; n <= r; n++)
1301
+ if (this.ai(t, n, i) > 0) try {
1302
+ const o = String.fromCodePoint(n);
1303
+ e.push(o);
1184
1304
  } catch {
1185
1305
  }
1186
1306
  }
1187
1307
  }
1188
- return t;
1308
+ return e;
1189
1309
  }
1190
- es(A) {
1191
- const t = [];
1192
- if (!A.groups) return t;
1193
- for (let e = 0; e < A.groups.length; e += 3) {
1194
- const s = A.groups[e], i = A.groups[e + 1], B = A.groups[e + 2];
1195
- for (let r = s; r <= i; r++)
1196
- if (B + (r - s) > 0) try {
1197
- const Q = String.fromCodePoint(r);
1198
- t.push(Q);
1310
+ ri(t) {
1311
+ const e = [];
1312
+ if (!t.groups) return e;
1313
+ for (let i = 0; i < t.groups.length; i += 3) {
1314
+ const s = t.groups[i], r = t.groups[i + 1], n = t.groups[i + 2];
1315
+ for (let o = s; o <= r; o++)
1316
+ if (n + (o - s) > 0) try {
1317
+ const c = String.fromCodePoint(o);
1318
+ e.push(c);
1199
1319
  } catch {
1200
1320
  }
1201
1321
  }
1202
- return t;
1322
+ return e;
1203
1323
  }
1204
- ns(A, t, e) {
1205
- if (A.idRangeOffset[e] === 0) return t + A.idDelta[e] & 65535;
1324
+ ai(t, e, i) {
1325
+ if (t.idRangeOffset[i] === 0) return e + t.idDelta[i] & 65535;
1206
1326
  {
1207
- const s = A.idRangeOffset[e] / 2 + (t - A.startCount[e]) - (A.startCount.length - e);
1208
- if (s >= 0 && A.glyphIdArray && s < A.glyphIdArray.length) {
1209
- const i = A.glyphIdArray[s];
1210
- if (i !== 0) return i + A.idDelta[e] & 65535;
1327
+ const s = t.idRangeOffset[i] / 2 + (e - t.startCount[i]) - (t.startCount.length - i);
1328
+ if (s >= 0 && t.glyphIdArray && s < t.glyphIdArray.length) {
1329
+ const r = t.glyphIdArray[s];
1330
+ if (r !== 0) return r + t.idDelta[i] & 65535;
1211
1331
  }
1212
1332
  }
1213
1333
  return 0;
1214
1334
  }
1215
- rs(A) {
1216
- const t = A.codePointAt(0) || 0;
1217
- return !(t >= 0 && t <= 31 && t !== 9 && t !== 10 && t !== 13 || t >= 127 && t <= 159);
1335
+ oi(t) {
1336
+ const e = t.codePointAt(0) || 0;
1337
+ return !(e >= 0 && e <= 31 && e !== 9 && e !== 10 && e !== 13 || e >= 127 && e <= 159);
1218
1338
  }
1219
1339
  }
1220
- class mA {
1340
+ class Z {
1221
1341
  constructor() {
1222
- n(this, "gs");
1223
- const A = new _();
1224
- this.gs = new pA(A);
1342
+ h(this, "hi", /* @__PURE__ */ new Map());
1343
+ h(this, "ci", /* @__PURE__ */ new Map());
1344
+ }
1345
+ li(t, e) {
1346
+ const i = `${this.ui(t)}_${e}`;
1347
+ if (this.hi.has(i)) return this.hi.get(i);
1348
+ const s = t.cmap;
1349
+ if (!s || !s.tables) return this.hi.set(i, 0), 0;
1350
+ let r = 0;
1351
+ for (const n of s.tables) if (n.format === 4 ? r = this.fi(e, n) : n.format === 12 && (r = this.di(e, n)), r > 0) break;
1352
+ return this.hi.set(i, r), r;
1353
+ }
1354
+ pi(t, e) {
1355
+ const i = e.codePointAt(0);
1356
+ return i === void 0 ? 0 : this.li(t, i);
1357
+ }
1358
+ mi(t, e) {
1359
+ const i = t.hmtx;
1360
+ return i && i.aWidth && i.aWidth.length !== 0 ? e < i.aWidth.length ? i.aWidth[e] : i.aWidth[i.aWidth.length - 1] : 0;
1361
+ }
1362
+ gi(t, e) {
1363
+ const i = e / t.head.unitsPerEm, s = t.hhea.ascender * i, r = t.hhea.descender * i, n = t.hhea.lineGap * i;
1364
+ return { ascender: s, descender: r, lineGap: n, lineHeight: s - r + n, unitsPerEm: t.head.unitsPerEm, scale: i };
1225
1365
  }
1226
- extractCharacters(A) {
1227
- return this.gs.As(A);
1366
+ _i() {
1367
+ this.hi.clear(), this.ci.clear();
1228
1368
  }
1229
- filterProblematicCharacters(A) {
1230
- return this.gs.Es(A);
1369
+ ui(t) {
1370
+ return `${t.ti}_${t.Js.length}`;
1231
1371
  }
1232
- characterExists(A, t) {
1233
- return this.gs.ss(A, t);
1372
+ fi(t, e) {
1373
+ const i = e.endCount.length;
1374
+ let s = -1;
1375
+ for (let r = 0; r < i; r++) if (t <= e.endCount[r]) {
1376
+ s = r;
1377
+ break;
1378
+ }
1379
+ if (s === -1 || t < e.startCount[s]) return 0;
1380
+ if (e.idRangeOffset[s] === 0) return t + e.idDelta[s] & 65535;
1381
+ {
1382
+ const r = e.idRangeOffset[s] / 2 + (t - e.startCount[s]) - (i - s);
1383
+ if (r >= 0 && r < e.glyphIdArray.length) {
1384
+ const n = e.glyphIdArray[r];
1385
+ return n === 0 ? 0 : n + e.idDelta[s] & 65535;
1386
+ }
1387
+ }
1388
+ return 0;
1234
1389
  }
1235
- allCharactersExist(A, t) {
1236
- return this.gs.Bs(A, t);
1390
+ di(t, e) {
1391
+ const i = e.groups.length / 3;
1392
+ for (let s = 0; s < i; s++) {
1393
+ const r = e.groups[3 * s], n = e.groups[3 * s + 1], o = e.groups[3 * s + 2];
1394
+ if (t >= r && t <= n) return o + (t - r);
1395
+ }
1396
+ return 0;
1237
1397
  }
1238
1398
  }
1239
- class yA {
1240
- constructor(A) {
1241
- n(this, "hs");
1242
- n(this, "cs");
1243
- n(this, "vA");
1244
- n(this, "ls");
1245
- this.vA = A, this.ls = new _(), this.hs = document.createElement("canvas"), this.cs = this.hs.getContext("2d", { willReadFrequently: !0, alpha: !1 });
1246
- }
1247
- createTextureAtlas(A, t, e, s) {
1248
- const i = A.length, B = Math.ceil(Math.sqrt(i)), r = Math.ceil(i / B), Q = t.width * B, o = t.height * r, g = typeof s == "object" ? s : null;
1249
- this.Cs(Q, o), this.Ds(A, t, B, e, g);
1250
- const a = this.vA.Fe(Q, o, 1, { filter: "nearest" });
1251
- return a.xA(this.hs), { framebuffer: a, columns: B, rows: r };
1252
- }
1253
- Cs(A, t) {
1254
- this.hs.width = A, this.hs.height = t, this.hs.style.width = A + "px", this.hs.style.height = A + "px", this.cs.imageSmoothingEnabled = !1, this.hs.style.imageRendering = "pixelated", this.cs.fillStyle = "black", this.cs.fillRect(0, 0, A, t), this.cs.textBaseline = "top", this.cs.textAlign = "left", this.cs.fillStyle = "white";
1255
- }
1256
- Ds(A, t, e, s, i) {
1257
- const B = s / i.head.unitsPerEm;
1258
- for (let r = 0; r < A.length; r++) {
1259
- const Q = r % e, o = Math.floor(r / e), g = A[r].character, a = this.Ps(i, g);
1260
- if (!a) continue;
1261
- const h = g.codePointAt(0) || 0, c = this.ls.He(i, h), l = this.us(i, c) * B, C = Q * t.width, I = o * t.height, w = C + 0.5 * t.width, d = I + 0.5 * t.height, p = Math.round(w - 0.5 * t.width), x = Math.round(d - 0.5 * s), Z = p + 0.5 * (t.width - l), j = x + i.hhea.ascender * B;
1262
- this.Is(a, Z, j, B);
1399
+ class Nt {
1400
+ constructor(t) {
1401
+ h(this, "yi");
1402
+ h(this, "Ai");
1403
+ h(this, "xt");
1404
+ h(this, "wi");
1405
+ this.xt = t, this.wi = new Z(), this.yi = document.createElement("canvas"), this.Ai = this.yi.getContext("2d", { willReadFrequently: !0, alpha: !1 });
1406
+ }
1407
+ createTextureAtlas(t, e, i, s) {
1408
+ const r = t.length, n = Math.ceil(Math.sqrt(r)), o = Math.ceil(r / n), c = e.width * n, l = e.height * o, f = typeof s == "object" ? s : null;
1409
+ this.Ci(c, l), this.bi(t, e, n, i, f);
1410
+ const u = this.xt.js(c, l, 1, { filter: "nearest" });
1411
+ return u.zt(this.yi), { framebuffer: u, columns: n, rows: o };
1412
+ }
1413
+ Ci(t, e) {
1414
+ this.yi.width = t, this.yi.height = e, this.yi.style.width = t + "px", this.yi.style.height = t + "px", this.Ai.imageSmoothingEnabled = !1, this.yi.style.imageRendering = "pixelated", this.Ai.fillStyle = "black", this.Ai.fillRect(0, 0, t, e), this.Ai.textBaseline = "top", this.Ai.textAlign = "left", this.Ai.fillStyle = "white";
1415
+ }
1416
+ bi(t, e, i, s, r) {
1417
+ const n = s / r.head.unitsPerEm;
1418
+ for (let o = 0; o < t.length; o++) {
1419
+ const c = o % i, l = Math.floor(o / i), f = t[o].character, u = this.xi(r, f);
1420
+ if (!u) continue;
1421
+ const g = f.codePointAt(0) || 0, v = this.wi.li(r, g), m = this.$i(r, v) * n, d = c * e.width, A = l * e.height, p = d + 0.5 * e.width, y = A + 0.5 * e.height, x = Math.round(p - 0.5 * e.width), C = Math.round(y - 0.5 * s), R = x + 0.5 * (e.width - m), b = C + r.hhea.ascender * n;
1422
+ this.Mi(u, R, b, n);
1263
1423
  }
1264
1424
  }
1265
- Ps(A, t) {
1266
- const e = t.codePointAt(0) || 0, s = this.ls.He(A, e);
1425
+ xi(t, e) {
1426
+ const i = e.codePointAt(0) || 0, s = this.wi.li(t, i);
1267
1427
  if (s === 0) return null;
1268
- if (A.glyf && A.glyf[s] !== null) return A.glyf[s];
1269
- if (m && m.T && m.T.glyf) {
1270
- const i = m.T.glyf.ze(A, s);
1271
- return A.glyf && i && (A.glyf[s] = i), i;
1428
+ if (t.glyf && t.glyf[s] !== null) return t.glyf[s];
1429
+ if (B && B.T && B.T.glyf) {
1430
+ const r = B.T.glyf.Qs(t, s);
1431
+ return t.glyf && r && (t.glyf[s] = r), r;
1272
1432
  }
1273
1433
  return null;
1274
1434
  }
1275
- us(A, t) {
1276
- const e = A.hmtx;
1277
- return e && e.aWidth ? t < e.aWidth.length ? e.aWidth[t] : e.aWidth[e.aWidth.length - 1] : 0;
1278
- }
1279
- Is(A, t, e, s) {
1280
- if (!A || !A.xs || A.noc === 0) return;
1281
- const { xs: i, ys: B, endPts: r, flags: Q } = A;
1282
- if (!(i && B && r && Q)) return;
1283
- this.cs.beginPath();
1284
- let o = 0;
1285
- for (let g = 0; g < r.length; g++) {
1286
- const a = r[g];
1287
- if (!(a < o)) {
1288
- if (a >= o) {
1289
- const h = t + i[o] * s, c = e - B[o] * s;
1290
- this.cs.moveTo(h, c);
1291
- let l = o + 1;
1292
- for (; l <= a; )
1293
- if (1 & Q[l]) {
1294
- const C = t + i[l] * s, I = e - B[l] * s;
1295
- this.cs.lineTo(C, I), l++;
1435
+ $i(t, e) {
1436
+ const i = t.hmtx;
1437
+ return i && i.aWidth ? e < i.aWidth.length ? i.aWidth[e] : i.aWidth[i.aWidth.length - 1] : 0;
1438
+ }
1439
+ Mi(t, e, i, s) {
1440
+ if (!t || !t.xs || t.noc === 0) return;
1441
+ const { xs: r, ys: n, endPts: o, flags: c } = t;
1442
+ if (!(r && n && o && c)) return;
1443
+ this.Ai.beginPath();
1444
+ let l = 0;
1445
+ for (let f = 0; f < o.length; f++) {
1446
+ const u = o[f];
1447
+ if (!(u < l)) {
1448
+ if (u >= l) {
1449
+ const g = e + r[l] * s, v = i - n[l] * s;
1450
+ this.Ai.moveTo(g, v);
1451
+ let m = l + 1;
1452
+ for (; m <= u; )
1453
+ if (1 & c[m]) {
1454
+ const d = e + r[m] * s, A = i - n[m] * s;
1455
+ this.Ai.lineTo(d, A), m++;
1296
1456
  } else {
1297
- const C = t + i[l] * s, I = e - B[l] * s;
1298
- let w = l + 1 > a ? o : l + 1;
1299
- if (1 & Q[w]) {
1300
- const d = t + i[w] * s, p = e - B[w] * s;
1301
- this.cs.quadraticCurveTo(C, I, d, p), l = w + 1;
1457
+ const d = e + r[m] * s, A = i - n[m] * s;
1458
+ let p = m + 1 > u ? l : m + 1;
1459
+ if (1 & c[p]) {
1460
+ const y = e + r[p] * s, x = i - n[p] * s;
1461
+ this.Ai.quadraticCurveTo(d, A, y, x), m = p + 1;
1302
1462
  } else {
1303
- const d = (C + (t + i[w] * s)) / 2, p = (I + (e - B[w] * s)) / 2;
1304
- this.cs.quadraticCurveTo(C, I, d, p), l = w;
1463
+ const y = (d + (e + r[p] * s)) / 2, x = (A + (i - n[p] * s)) / 2;
1464
+ this.Ai.quadraticCurveTo(d, A, y, x), m = p;
1305
1465
  }
1306
1466
  }
1307
- this.cs.closePath();
1467
+ this.Ai.closePath();
1308
1468
  }
1309
- o = a + 1;
1469
+ l = u + 1;
1310
1470
  }
1311
1471
  }
1312
- this.cs.fill();
1472
+ this.Ai.fill();
1313
1473
  }
1314
1474
  }
1315
- class vA {
1475
+ class zt {
1316
1476
  constructor() {
1317
- n(this, "qe");
1318
- this.qe = new _();
1477
+ h(this, "Fi");
1478
+ this.Fi = new Z();
1319
1479
  }
1320
- calculateMaxGlyphDimensions(A, t, e) {
1480
+ Ri(t, e, i) {
1321
1481
  let s = 0;
1322
- const i = this.qe.Xe(e, t), B = i.lineHeight;
1323
- for (const r of A) {
1324
- const Q = this.qe.Ze(e, r);
1325
- if (Q === 0) continue;
1326
- const o = this.qe.Ne(e, Q) * i.scale;
1327
- s = Math.max(s, o);
1482
+ const r = this.Fi.gi(i, e), n = r.lineHeight;
1483
+ for (const o of t) {
1484
+ const c = this.Fi.pi(i, o);
1485
+ if (c === 0) continue;
1486
+ const l = this.Fi.mi(i, c) * r.scale;
1487
+ s = Math.max(s, l);
1328
1488
  }
1329
- return { width: Math.ceil(s), height: Math.ceil(B) };
1330
- }
1331
- getCharacterAdvanceWidth(A, t, e) {
1332
- const s = this.qe.Xe(e, t), i = this.qe.Ze(e, A);
1333
- return this.qe.Ne(e, i) * s.scale;
1334
- }
1335
- getFontMetrics(A, t) {
1336
- return this.qe.Xe(t, A);
1489
+ return { width: Math.ceil(s), height: Math.ceil(n) };
1337
1490
  }
1338
- je() {
1339
- this.qe.je();
1491
+ _i() {
1492
+ this.Fi._i();
1340
1493
  }
1341
1494
  }
1342
- class RA {
1495
+ class Xt {
1343
1496
  constructor() {
1344
- n(this, "ls");
1345
- this.ls = new _();
1346
- }
1347
- createCharacterObjects(A, t) {
1348
- return A.map((e, s) => {
1349
- const i = e.codePointAt(0) || 0, B = this.ws(s);
1350
- let r = 0;
1351
- if (t.hmtx && t.hmtx.aWidth) {
1352
- const Q = this.ls.He(t, i);
1353
- Q > 0 && t.hmtx.aWidth[Q] !== void 0 && (r = t.hmtx.aWidth[Q]);
1497
+ h(this, "wi");
1498
+ this.wi = new Z();
1499
+ }
1500
+ createCharacterObjects(t, e) {
1501
+ return t.map((i, s) => {
1502
+ const r = i.codePointAt(0) || 0, n = this.zi(s);
1503
+ let o = 0;
1504
+ if (e.hmtx && e.hmtx.aWidth) {
1505
+ const c = this.wi.li(e, r);
1506
+ c > 0 && e.hmtx.aWidth[c] !== void 0 && (o = e.hmtx.aWidth[c]);
1354
1507
  }
1355
- return { character: e, unicode: i, color: B, advanceWidth: r };
1508
+ return { character: i, unicode: r, color: n, advanceWidth: o };
1356
1509
  });
1357
1510
  }
1358
- ws(A) {
1359
- return [A % 256 / 255, Math.floor(A / 256) % 256 / 255, Math.floor(A / 65536) % 256 / 255];
1511
+ zi(t) {
1512
+ return [t % 256 / 255, Math.floor(t / 256) % 256 / 255, Math.floor(t / 65536) % 256 / 255];
1360
1513
  }
1361
- fs(A, t) {
1362
- if (!M._(typeof A == "string", "Character must be a string.", { method: "getCharacterColor", providedValue: A })) return [0, 0, 0];
1363
- const e = t.find((s) => s.character === A);
1364
- return e ? e.color : [0, 0, 0];
1514
+ Pi(t, e) {
1515
+ if (!N.v(typeof t == "string", "Character must be a string.", { method: "getCharacterColor", providedValue: t })) return [0, 0, 0];
1516
+ const i = e.find((s) => s.character === t);
1517
+ return i ? i.color : [0, 0, 0];
1365
1518
  }
1366
- ds(A, t) {
1367
- return M._(typeof A == "string" && A.length > 0, "Characters must be a string with at least one character.", { method: "getCharacterColors", providedValue: A }) ? Array.from(A).map((e) => this.fs(e, t) || [0, 0, 0]) : [[0, 0, 0]];
1519
+ Ti(t, e) {
1520
+ return N.v(typeof t == "string" && t.length > 0, "Characters must be a string with at least one character.", { method: "getCharacterColors", providedValue: t }) ? Array.from(t).map((i) => this.Pi(i, e) || [0, 0, 0]) : [[0, 0, 0]];
1368
1521
  }
1369
1522
  }
1370
- class bA {
1371
- constructor(A, t = 16) {
1372
- n(this, "ps");
1373
- n(this, "_s", []);
1374
- n(this, "vs");
1375
- n(this, "bs", 16);
1376
- n(this, "$s", 0);
1377
- n(this, "Gs", 0);
1378
- n(this, "Ms", { width: 0, height: 0 });
1379
- n(this, "Ys");
1380
- n(this, "Fs");
1381
- n(this, "Rs");
1382
- n(this, "Ss");
1383
- n(this, "ks");
1384
- this.bs = t, this.Fs = new mA(), this.Rs = new yA(A), this.Ss = new vA(), this.ks = new RA();
1385
- }
1386
- async zs(A) {
1387
- let t;
1388
- if (A) {
1389
- const e = await fetch(A);
1390
- if (!e.ok) throw new f(`Failed to load font file: ${e.status} ${e.statusText}`);
1391
- t = await e.arrayBuffer();
1523
+ class Wt {
1524
+ constructor(t, e = 16) {
1525
+ h(this, "Si");
1526
+ h(this, "Ei", []);
1527
+ h(this, "Bi");
1528
+ h(this, "Gi", 16);
1529
+ h(this, "Di", 0);
1530
+ h(this, "Li", 0);
1531
+ h(this, "ki", { width: 0, height: 0 });
1532
+ h(this, "Oi");
1533
+ h(this, "Hi");
1534
+ h(this, "Ii");
1535
+ h(this, "Ni");
1536
+ h(this, "Xi");
1537
+ this.Gi = e, this.Hi = new Gt(), this.Ii = new Nt(t), this.Ni = new zt(), this.Xi = new Xt();
1538
+ }
1539
+ async Wi(t) {
1540
+ let e;
1541
+ if (t) {
1542
+ const i = await fetch(t);
1543
+ if (!i.ok) throw new U(`Failed to load font file: ${i.status} ${i.statusText}`);
1544
+ e = await i.arrayBuffer();
1392
1545
  } else
1393
- t = await (await fetch(`data:font/truetype;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMs+QEyQAAAEoAAAAYGNtYXAg7yVJAAAFjAAACSBnbHlmuHLTdAAAErQAAGi0aGVhZFvXdUwAAACsAAAANmhoZWELAQUCAAAA5AAAACRobXR4BACDgAAAAYgAAAQEbG9jYQAy54AAAA6sAAAECG1heHABIgCCAAABCAAAACBuYW1lVs/OSgAAe2gAAAOicG9zdABpADQAAH8MAAAAIAABAAAAAQAAzOWHqV8PPPUAAAQAAAAAAHxiGCcAAAAAfGIYJwAAAAAEAAQAAAAACAACAAEAAAAAAAEAAAQAAAAAAAQAAAAAAAcAAAEAAAAAAAAAAAAAAAAAAAEBAAEAAAEBAIAAIAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAgQAAZAABQAEAgACAAAAAAACAAIAAAACAAAzAMwAAAAABAAAAAAAAACAAACLAABw4wAAAAAAAAAAWUFMLgBAACAmawQAAAAAAAQAAAAAAAFRAAAAAAMABAAAAAAgAAAEAAAABAAAAAQAAAAEAAGABAABAAQAAIAEAACABAAAgAQAAIAEAAGABAABAAQAAQAEAACABAABAAQAAIAEAACABAABAAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAABAAQAAIAEAAEABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAABAAQAAIAEAAEABAAAgAQAAIAEAAEABAAAgAQAAIAEAACABAAAgAQAAIAEAAEABAAAgAQAAIAEAAGABAAAgAQAAIAEAAGABAAAgAQAAIAEAACABAAAgAQAAIAEAAEABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAABgAQAAQAEAACABAAAAAQAAgAEAACABAAAgAQAAIAEAACABAACAAQAAAAEAAIABAABgAQAAgAEAACABAAAgAQAAAAEAACABAAAAAQAAAAEAAAABAAAAAQAAAAEAAIABAADAAQAAAAEAAAABAAAgAQAAYAEAAAABAAAAAQAAIAEAAAABAAAgAQAAIAEAACABAAAAAQAAIAEAAAABAAAAAQAAIAEAAGABAAAAAQAAAAEAAAABAAAAAQAAIAEAACABAAAAAQAAIAEAACABAAAAAQAAIAEAACABAAAgAQAAAAEAACABAAAAAQAAAAEAAEABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAACAAQAAIAEAAAABAAAAAQAAAAEAACABAABAAQAAQAEAAEABAABAAQAAIAEAACABAAAAAQAAAAEAAAABAABAAQAAAAEAACABAAAAAQAAAAEAAIABAAAgAQAAAAEAAAABAAAAAQAAAAEAAAABAABgAQAAAAEAAAABAABgAQAAAAEAAGABAABgAQAAYAEAAAABAAAAAQAAAAEAAAABAABgAQAAYAEAAAABAAAAAQAAAAEAAAABAABgAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAABgAQAAAAEAAGABAABgAQAAAAEAAAABAABgAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAYAEAAAABAAAAAQAAQAEAACABAAAAAQAAAAEAAAABAAAgAQAAIAEAACABAAAgAQAAIAEAAAABAABAAQAAIAEAACABAAAgAQAAIAEAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\r
1394
- `)).arrayBuffer();
1395
- await this.Ls(t), this.ps = m.parse(t)[0], await this.Os();
1546
+ e = await (await fetch("data:font/woff;base64,d09GRgABAAAAABbwAAoAAAAAfywAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABjbWFwAAAA9AAAAbsAAAkgIO8lSWdseWYAAAKwAAAOfgAAaLS4ctN0aGVhZAAAETAAAAAsAAAAOCi8/PVoaGVhAAARXAAAABkAAAAkCwEFAmhtdHgAABF4AAAAhQAABAQEAIOAbG9jYQAAEgAAAAKUAAAECAAy54BtYXhwAAAUlAAAABgAAAAgASIAgm5hbWUAABSsAAAB5wAAA6RWz85KT1MvMgAAFpQAAABFAAAAYM+QEyRwb3N0AAAW3AAAABQAAAAgAGkANHja7dRPSFRRFMfx38wdXblw4cJC7M0bz60gWlULGUFctWgR0UIQQkmDyn27kpAQaaEO2jhWJuafiQFtcDJtSqGhiFZtot5x3jzEVQQhlRJcOb0khiRc1+J94R64uw8cOADCAJT/avwZAiIpRCK3/P999KAS9biOSUxhBhlksYjnWMFrvME7vMca1vEF37ANAwkNqYRKqkk1rdLqscqpVVVQryzbils3rJnocHTWPmgfso/ap+0OuysWjlXHogQKUxVVUw3VUh010DE6QXHqph7qpT66TQmaoAxlaZnyVKC39FHHdbNu0e36or6kr4r4TgsTu75HmEcOy76vUPaVsIFNbOHHX74F3/fyD9+A7ztg1//2de76rH18Z8u+AXqwx/dB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IMV34T28wQ+6qG6Puz5+Civyb+EOO/4Ir6GvOsJdaLUrvI53KhXeoGYs3MOu+iq8hai+CW/jo/olvIOiA+E97HeKw/xIp8M0nYQ6O/MunpvZwmbhafv01JK/MKGee6ePB8N/JCFzN6dO+8o4bee5cbnRM+NMyKyuFqHytdHR3MXSF0ZfNQOn93rVORoNm4l64ua3NMjsdYxVfZIkeTBZZC73ZeldPfBhllSLKR0KX2ZzlzyY4BO2JmNjrdeXPtjiAIfIcQTNbz/knWKCgBoZzuDhEHEOgxkWsMyFF9Xne/1Mf8Fdo5i3dY1jDOjz/ymB0eEGp63ao2J/Q5YT8pabqOnQsGn1lvuKjoHRc05Tj4x3jCUzRZu5Wp1winvGl54jruHqjI3C0fVW3qDxuWZ/pEvNPzjhylkxrETR5fQoW09HzYDPwJMm7emm8g5Fq8nIjpWHdronLV0TjJmxXJ4nuGwnWPYcAH8BoeumrAB42mNgYmFgnMDAysDCxMDEAAIQGoiNGc6A+CwMENDAwNDNwFDwGMpliHT00WNwYFBQy4aogJCMgSCSGcJTYGAAAEBYBpIAAAB42mNgZoCANAZjIMnIgAYADecAng==")).arrayBuffer();
1547
+ await this.Vi(e), this.Si = B.parse(e)[0], await this.Ki();
1396
1548
  }
1397
- Ts(A) {
1398
- if (A === void 0) return this.bs;
1399
- this.bs = A, this.Ms = this.Ss.calculateMaxGlyphDimensions(this._s.map((e) => e.character), this.bs, this.ps);
1400
- const t = this.Rs.createTextureAtlas(this._s, this.Ms, this.bs, this.ps);
1401
- this.vs = t.framebuffer, this.$s = t.columns, this.Gs = t.rows;
1549
+ ji(t) {
1550
+ if (t === void 0) return this.Gi;
1551
+ this.Gi = t, this.ki = this.Ni.Ri(this.Ei.map((i) => i.character), this.Gi, this.Si);
1552
+ const e = this.Ii.createTextureAtlas(this.Ei, this.ki, this.Gi, this.Si);
1553
+ this.Bi = e.framebuffer, this.Di = e.columns, this.Li = e.rows;
1402
1554
  }
1403
- async Us(A) {
1555
+ async Yi(t) {
1404
1556
  try {
1405
- const t = await fetch(A);
1406
- if (!t.ok) throw new f(`Failed to load font file: ${t.status} ${t.statusText}`);
1407
- const e = await t.arrayBuffer();
1408
- await this.Ls(e);
1409
- const s = m.parse(e);
1557
+ const e = await fetch(t);
1558
+ if (!e.ok) throw new U(`Failed to load font file: ${e.status} ${e.statusText}`);
1559
+ const i = await e.arrayBuffer();
1560
+ await this.Vi(i);
1561
+ const s = B.parse(i);
1410
1562
  if (!s || s.length === 0) throw Error("Failed to parse font file");
1411
- this.ps = s[0], await this.Os();
1412
- } catch (t) {
1413
- throw new f("Failed to load font: " + (t instanceof Error ? t.message : "Unknown error"), t);
1563
+ this.Si = s[0], await this.Ki();
1564
+ } catch (e) {
1565
+ throw new U("Failed to load font: " + (e instanceof Error ? e.message : "Unknown error"), e);
1414
1566
  }
1415
1567
  }
1416
- async Ls(A) {
1417
- const t = Date.now();
1418
- this.Ys = new FontFace("CustomFont_" + t, A), await this.Ys.load(), document.fonts.add(this.Ys);
1568
+ async Vi(t) {
1569
+ const e = Date.now();
1570
+ this.Oi = new FontFace("CustomFont_" + e, t), await this.Oi.load(), document.fonts.add(this.Oi);
1419
1571
  }
1420
- async Os() {
1421
- const A = this.Fs.extractCharacters(this.ps), t = this.Fs.filterProblematicCharacters(A);
1422
- this._s = this.ks.createCharacterObjects(t, this.ps), this.Ms = this.Ss.calculateMaxGlyphDimensions(t, this.bs, this.ps);
1423
- const e = this.Rs.createTextureAtlas(this._s, this.Ms, this.bs, this.ps);
1424
- this.vs = e.framebuffer, this.$s = e.columns, this.Gs = e.rows;
1572
+ async Ki() {
1573
+ const t = this.Hi.si(this.Si), e = this.Hi.ni(t);
1574
+ this.Ei = this.Xi.createCharacterObjects(e, this.Si), this.ki = this.Ni.Ri(e, this.Gi, this.Si);
1575
+ const i = this.Ii.createTextureAtlas(this.Ei, this.ki, this.Gi, this.Si);
1576
+ this.Bi = i.framebuffer, this.Di = i.columns, this.Li = i.rows;
1425
1577
  }
1426
- fs(A) {
1427
- return this.ks.fs(A, this._s);
1578
+ Pi(t) {
1579
+ return this.Xi.Pi(t, this.Ei);
1428
1580
  }
1429
- ds(A) {
1430
- return this.ks.ds(A, this._s);
1581
+ Ti(t) {
1582
+ return this.Xi.Ti(t, this.Ei);
1431
1583
  }
1432
- kA() {
1433
- this.vs.kA(), document.fonts.delete(this.Ys);
1584
+ Gt() {
1585
+ this.Bi.Gt(), document.fonts.delete(this.Oi);
1434
1586
  }
1435
1587
  get fontFramebuffer() {
1436
- return this.vs;
1588
+ return this.Bi;
1437
1589
  }
1438
1590
  get characters() {
1439
- return this._s;
1591
+ return this.Ei;
1440
1592
  }
1441
1593
  get textureColumns() {
1442
- return this.$s;
1594
+ return this.Di;
1443
1595
  }
1444
1596
  get textureRows() {
1445
- return this.Gs;
1597
+ return this.Li;
1446
1598
  }
1447
1599
  get maxGlyphDimensions() {
1448
- return this.Ms;
1600
+ return this.ki;
1449
1601
  }
1450
1602
  get fontSize() {
1451
- return this.bs;
1603
+ return this.Gi;
1452
1604
  }
1453
1605
  get font() {
1454
- return this.ps;
1606
+ return this.Si;
1455
1607
  }
1456
1608
  }
1457
- class xA {
1458
- constructor(A, t, e) {
1459
- n(this, "Ws");
1460
- n(this, "Hs");
1461
- n(this, "PA");
1462
- n(this, "uA");
1463
- n(this, "Ks");
1464
- n(this, "Js");
1465
- n(this, "Vs");
1466
- n(this, "Zs");
1467
- n(this, "Ns");
1468
- this.Vs = A, this.Zs = t, this.Ns = e, this.iA();
1469
- }
1470
- iA() {
1471
- this.Ws = Math.floor(this.Vs.width / this.Zs), this.Hs = Math.floor(this.Vs.height / this.Ns), this.PA = this.Ws * this.Zs, this.uA = this.Hs * this.Ns, this.Ks = Math.floor((this.Vs.width - this.PA) / 2), this.Js = Math.floor((this.Vs.height - this.uA) / 2);
1472
- }
1473
- Xs(A, t) {
1474
- this.Zs = A, this.Ns = t, this.iA();
1609
+ class Ht {
1610
+ constructor(t, e, i) {
1611
+ h(this, "qi");
1612
+ h(this, "Zi");
1613
+ h(this, "dt");
1614
+ h(this, "gt");
1615
+ h(this, "Qi");
1616
+ h(this, "Ji");
1617
+ h(this, "tr");
1618
+ h(this, "er");
1619
+ h(this, "sr");
1620
+ this.tr = t, this.er = e, this.sr = i, this.ir();
1621
+ }
1622
+ ir() {
1623
+ this.qi = Math.floor(this.tr.width / this.er), this.Zi = Math.floor(this.tr.height / this.sr), this.dt = this.qi * this.er, this.gt = this.Zi * this.sr, this.Qi = Math.floor((this.tr.width - this.dt) / 2), this.Ji = Math.floor((this.tr.height - this.gt) / 2);
1624
+ }
1625
+ rr(t, e) {
1626
+ this.er = t, this.sr = e, this.ir();
1475
1627
  }
1476
1628
  get cellWidth() {
1477
- return this.Zs;
1629
+ return this.er;
1478
1630
  }
1479
1631
  get cellHeight() {
1480
- return this.Ns;
1632
+ return this.sr;
1481
1633
  }
1482
1634
  get cols() {
1483
- return this.Ws;
1635
+ return this.qi;
1484
1636
  }
1485
1637
  get rows() {
1486
- return this.Hs;
1638
+ return this.Zi;
1487
1639
  }
1488
1640
  get width() {
1489
- return this.PA;
1641
+ return this.dt;
1490
1642
  }
1491
1643
  get height() {
1492
- return this.uA;
1644
+ return this.gt;
1493
1645
  }
1494
1646
  get offsetX() {
1495
- return this.Ks;
1647
+ return this.Qi;
1496
1648
  }
1497
1649
  get offsetY() {
1498
- return this.Js;
1650
+ return this.Ji;
1499
1651
  }
1500
1652
  }
1501
- class TA {
1502
- constructor(A = {}) {
1503
- n(this, "Vs");
1504
- n(this, "js");
1505
- n(this, "qs");
1506
- A.canvas ? (this.Vs = A.canvas, this.qs = !1) : (this.Vs = this.Ai(A.width, A.height), this.qs = !0), this.Vs.style.imageRendering = "pixelated";
1507
- }
1508
- Ai(A, t) {
1509
- const e = document.createElement("canvas");
1510
- return e.className = "textmodeCanvas", e.style.imageRendering = "pixelated", e.width = A || 800, e.height = t || 600, document.body.appendChild(e), e;
1511
- }
1512
- ti(A, t) {
1513
- this.Vs.width = A ?? this.Vs.width, this.Vs.height = t ?? this.Vs.height;
1514
- }
1515
- ei() {
1516
- const A = this.Vs.getContext("webgl2", { alpha: !0, premultipliedAlpha: !1, preserveDrawingBuffer: !0, antialias: !1, depth: !1, stencil: !1, powerPreference: "high-performance" });
1517
- if (!A) throw new f("`textmode.js` requires WebGL2 support.");
1518
- return A;
1519
- }
1520
- kA() {
1521
- this.js && this.js.disconnect();
1522
- const A = this.Vs.getContext("webgl") || this.Vs.getContext("webgl2");
1523
- if (A) {
1524
- const t = A.getExtension("WEBGL_lose_context");
1525
- t && t.loseContext();
1653
+ class kt {
1654
+ constructor(t = {}) {
1655
+ h(this, "tr");
1656
+ h(this, "nr", null);
1657
+ h(this, "ar", !1);
1658
+ h(this, "hr");
1659
+ h(this, "cr");
1660
+ this.ar = t.overlay ?? !1, this.ar && t.canvas ? (this.nr = t.canvas, this.tr = this.lr(), this.cr = !0, this.ur()) : t.canvas ? (this.tr = t.canvas, this.cr = !1) : (this.tr = this.dr(t.width, t.height), this.cr = !0), this.tr.style.imageRendering = "pixelated";
1661
+ }
1662
+ dr(t, e) {
1663
+ const i = document.createElement("canvas");
1664
+ return i.className = "textmodeCanvas", i.style.imageRendering = "pixelated", i.width = t || 800, i.height = e || 600, document.body.appendChild(i), i;
1665
+ }
1666
+ lr() {
1667
+ const t = document.createElement("canvas");
1668
+ t.className = "textmodeCanvas", t.style.imageRendering = "pixelated";
1669
+ const e = this.nr.getBoundingClientRect();
1670
+ let i = Math.round(e.width), s = Math.round(e.height);
1671
+ if (this.nr instanceof HTMLVideoElement) {
1672
+ const o = this.nr;
1673
+ (i === 0 || s === 0) && o.videoWidth > 0 && o.videoHeight > 0 && (i = o.videoWidth, s = o.videoHeight);
1674
+ }
1675
+ t.width = i, t.height = s, t.style.position = "absolute", t.style.pointerEvents = "none";
1676
+ const r = window.getComputedStyle(this.nr);
1677
+ let n = parseInt(r.zIndex || "0", 10);
1678
+ return isNaN(n) && (n = 0), t.style.zIndex = "" + (n + 1), t;
1679
+ }
1680
+ ur() {
1681
+ var t;
1682
+ this.pr(), (t = this.nr.parentNode) == null || t.insertBefore(this.tr, this.nr.nextSibling), window.ResizeObserver && (this.hr = new ResizeObserver(() => {
1683
+ this.mr();
1684
+ }), this.hr.observe(this.nr)), window.addEventListener("resize", () => {
1685
+ this.mr();
1686
+ });
1687
+ }
1688
+ pr() {
1689
+ if (!this.nr) return;
1690
+ const t = this.nr.getBoundingClientRect();
1691
+ let e = this.nr.offsetParent;
1692
+ if (e && e !== document.body) {
1693
+ const i = e.getBoundingClientRect();
1694
+ this.tr.style.top = t.top - i.top + "px", this.tr.style.left = t.left - i.left + "px";
1695
+ } else this.tr.style.top = t.top + window.scrollY + "px", this.tr.style.left = t.left + window.scrollX + "px";
1696
+ }
1697
+ mr(t, e) {
1698
+ if (this.ar) {
1699
+ const i = this.nr.getBoundingClientRect();
1700
+ let s = Math.round(i.width), r = Math.round(i.height);
1701
+ if (this.nr instanceof HTMLVideoElement) {
1702
+ const n = this.nr;
1703
+ (s === 0 || r === 0) && n.videoWidth > 0 && n.videoHeight > 0 && (s = n.videoWidth, r = n.videoHeight);
1704
+ }
1705
+ this.tr.width = s, this.tr.height = r, this.pr();
1706
+ } else this.tr.width = t ?? this.tr.width, this.tr.height = e ?? this.tr.height;
1707
+ }
1708
+ gr() {
1709
+ const t = this.tr.getContext("webgl2", { alpha: !0, premultipliedAlpha: !1, preserveDrawingBuffer: !0, antialias: !1, depth: !1, stencil: !1, powerPreference: "high-performance" });
1710
+ if (!t) throw new U("`textmode.js` requires WebGL2 support.");
1711
+ return t;
1712
+ }
1713
+ Gt() {
1714
+ this.hr && this.hr.disconnect();
1715
+ const t = this.tr.getContext("webgl") || this.tr.getContext("webgl2");
1716
+ if (t) {
1717
+ const e = t.getExtension("WEBGL_lose_context");
1718
+ e && e.loseContext();
1526
1719
  }
1527
- this.qs && this.Vs.parentNode && this.Vs.parentNode.removeChild(this.Vs);
1720
+ this.cr && this.tr.parentNode && this.tr.parentNode.removeChild(this.tr);
1528
1721
  }
1529
1722
  get canvas() {
1530
- return this.Vs;
1723
+ return this.tr;
1724
+ }
1725
+ get targetCanvas() {
1726
+ return this.nr;
1531
1727
  }
1532
1728
  get width() {
1533
- return this.Vs.width;
1729
+ return this.tr.width;
1534
1730
  }
1535
1731
  get height() {
1536
- return this.Vs.height;
1732
+ return this.tr.height;
1733
+ }
1734
+ }
1735
+ class z {
1736
+ constructor(t, e, i, s) {
1737
+ h(this, "texture");
1738
+ h(this, "width");
1739
+ h(this, "height");
1740
+ h(this, "vt");
1741
+ h(this, "D", 0);
1742
+ h(this, "V", 0);
1743
+ h(this, "K", 0);
1744
+ h(this, "L", [0, 0]);
1745
+ h(this, "_r", "sampled");
1746
+ h(this, "vr", "fixed");
1747
+ h(this, "Y", [1, 1, 1]);
1748
+ h(this, "q", [0, 0, 0]);
1749
+ h(this, "yr", [0, 0, 0, 1]);
1750
+ h(this, "Ar", [[0.1, 0, 0]]);
1751
+ h(this, "wr");
1752
+ this.vt = t, this.texture = e, this.width = i, this.height = s;
1753
+ }
1754
+ Gt() {
1755
+ this.vt.deleteTexture(this.texture);
1756
+ }
1757
+ Cr(t) {
1758
+ return typeof t == "boolean" ? t ? 1 : 0 : (t == null ? 0 : Number(t)) > 0 ? 1 : 0;
1759
+ }
1760
+ invert(t = !0) {
1761
+ return this.D = this.Cr(t), this;
1762
+ }
1763
+ flipX(t = !0) {
1764
+ return this.V = this.Cr(t), this;
1765
+ }
1766
+ flipY(t = !0) {
1767
+ return this.K = this.Cr(t), this;
1768
+ }
1769
+ charRotation(t) {
1770
+ const e = 255 * t / 360, i = Math.floor(e) / 255, s = Math.round(e - Math.floor(e));
1771
+ return this.L = [i, s], this;
1772
+ }
1773
+ get flags() {
1774
+ return { invert: this.D, flipX: this.V, flipY: this.K };
1775
+ }
1776
+ get charRotationRG() {
1777
+ return this.L;
1778
+ }
1779
+ charColorMode(t) {
1780
+ return this._r = t, this;
1781
+ }
1782
+ cellColorMode(t) {
1783
+ return this.vr = t, this;
1784
+ }
1785
+ charColor(t, e, i) {
1786
+ return this.Y = [(t ?? 0) / 255, (e ?? t ?? 0) / 255, (i ?? t ?? 0) / 255], this;
1787
+ }
1788
+ cellColor(t, e, i) {
1789
+ return this.q = [(t ?? 0) / 255, (e ?? t ?? 0) / 255, (i ?? t ?? 0) / 255], this;
1790
+ }
1791
+ background(t, e, i, s) {
1792
+ return this.yr = [(t ?? 0) / 255, (e ?? t ?? 0) / 255, (i ?? t ?? 0) / 255, (s ?? 255) / 255], this;
1793
+ }
1794
+ charactersFromColors(t) {
1795
+ const e = t.filter((i) => Array.isArray(i)).slice(0, 64);
1796
+ return this.Ar = e, this;
1797
+ }
1798
+ characters(t) {
1799
+ const e = this.wr(t);
1800
+ return this.charactersFromColors(e), this;
1801
+ }
1802
+ get characterListUniforms() {
1803
+ return { count: this.Ar.length, list: this.Ar };
1804
+ }
1805
+ get colorUniforms() {
1806
+ return { charColorFixed: this._r === "fixed", Y: this.Y, cellColorFixed: this.vr === "fixed", cellColor: this.q, backgroundColor: this.yr };
1807
+ }
1808
+ static fromSource(t, e, i) {
1809
+ const s = t.context, r = s.createTexture();
1810
+ s.bindTexture(s.TEXTURE_2D, r), s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, 1), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, s.NEAREST), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, s.NEAREST), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, s.CLAMP_TO_EDGE), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, s.CLAMP_TO_EDGE), s.texImage2D(s.TEXTURE_2D, 0, s.RGBA, s.RGBA, s.UNSIGNED_BYTE, e), s.bindTexture(s.TEXTURE_2D, null);
1811
+ const n = e.naturalWidth ?? e.width ?? e.videoWidth ?? 0, o = e.naturalHeight ?? e.height ?? e.videoHeight ?? 0, c = new z(s, r, n, o);
1812
+ return c.wr = i, c;
1537
1813
  }
1538
1814
  }
1539
- class MA {
1540
- constructor(A = 60) {
1541
- n(this, "si");
1542
- n(this, "ii");
1543
- n(this, "Bi", null);
1544
- n(this, "Qi", 0);
1545
- n(this, "Ei", !0);
1546
- n(this, "ri", 0);
1547
- n(this, "ni", 0);
1548
- n(this, "oi", []);
1549
- n(this, "gi", 10);
1550
- n(this, "ai", 0);
1551
- this.si = A, this.ii = 1e3 / A;
1552
- }
1553
- start(A) {
1554
- if (!this.Ei) return;
1555
- this.Qi = performance.now();
1556
- const t = (e) => {
1557
- if (!this.Ei) return void (this.Bi = null);
1558
- const s = e - this.Qi;
1559
- s >= this.ii && (A(), this.Qi = e - s % this.ii), this.Ei && (this.Bi = requestAnimationFrame(t));
1815
+ class Yt {
1816
+ constructor(t = 60) {
1817
+ h(this, "br");
1818
+ h(this, "$r");
1819
+ h(this, "Mr", null);
1820
+ h(this, "Fr", 0);
1821
+ h(this, "Rr", !0);
1822
+ h(this, "zr", 0);
1823
+ h(this, "Pr", 0);
1824
+ h(this, "Tr", []);
1825
+ h(this, "Sr", 10);
1826
+ h(this, "Er", 0);
1827
+ this.br = t, this.$r = 1e3 / t;
1828
+ }
1829
+ start(t) {
1830
+ if (!this.Rr) return;
1831
+ this.Fr = performance.now();
1832
+ const e = (i) => {
1833
+ if (!this.Rr) return void (this.Mr = null);
1834
+ const s = i - this.Fr;
1835
+ s >= this.$r && (t(), this.Fr = i - s % this.$r), this.Rr && (this.Mr = requestAnimationFrame(e));
1560
1836
  };
1561
- this.Bi = requestAnimationFrame(t);
1837
+ this.Mr = requestAnimationFrame(e);
1562
1838
  }
1563
1839
  stop() {
1564
- this.Bi && (cancelAnimationFrame(this.Bi), this.Bi = null);
1840
+ this.Mr && (cancelAnimationFrame(this.Mr), this.Mr = null);
1565
1841
  }
1566
1842
  pause() {
1567
- this.Ei && (this.Ei = !1, this.stop());
1843
+ this.Rr && (this.Rr = !1, this.stop());
1568
1844
  }
1569
- resume(A) {
1570
- this.Ei || (this.Ei = !0, this.start(A));
1845
+ resume(t) {
1846
+ this.Rr || (this.Rr = !0, this.start(t));
1571
1847
  }
1572
- frameRate(A, t) {
1573
- if (A === void 0) return this.ri;
1574
- this.si = A, this.ii = 1e3 / A, this.Ei && t && (this.stop(), this.start(t));
1848
+ frameRate(t, e) {
1849
+ if (t === void 0) return this.zr;
1850
+ this.br = t, this.$r = 1e3 / t, this.Rr && e && (this.stop(), this.start(e));
1575
1851
  }
1576
1852
  measureFrameRate() {
1577
- const A = performance.now();
1578
- if (this.ni > 0) {
1579
- const t = A - this.ni;
1580
- this.oi.push(t), this.oi.length > this.gi && this.oi.shift();
1581
- const e = this.oi.reduce((s, i) => s + i, 0) / this.oi.length;
1582
- this.ri = 1e3 / e;
1853
+ const t = performance.now();
1854
+ if (this.Pr > 0) {
1855
+ const e = t - this.Pr;
1856
+ this.Tr.push(e), this.Tr.length > this.Sr && this.Tr.shift();
1857
+ const i = this.Tr.reduce((s, r) => s + r, 0) / this.Tr.length;
1858
+ this.zr = 1e3 / i;
1583
1859
  }
1584
- this.ni = A;
1860
+ this.Pr = t;
1585
1861
  }
1586
1862
  get isLooping() {
1587
- return this.Ei;
1863
+ return this.Rr;
1588
1864
  }
1589
1865
  get frameRateLimit() {
1590
- return this.si;
1866
+ return this.br;
1591
1867
  }
1592
1868
  get currentFrameRate() {
1593
- return this.ri;
1869
+ return this.zr;
1594
1870
  }
1595
1871
  get frameCount() {
1596
- return this.ai;
1872
+ return this.Er;
1597
1873
  }
1598
- set frameCount(A) {
1599
- this.ai = A;
1874
+ set frameCount(t) {
1875
+ this.Er = t;
1600
1876
  }
1601
1877
  incrementFrame() {
1602
- this.ai++;
1878
+ this.Er++;
1603
1879
  }
1604
1880
  resetFrameCount() {
1605
- this.ai = 0;
1881
+ this.Er = 0;
1606
1882
  }
1607
1883
  }
1608
- class FA {
1884
+ class Vt {
1609
1885
  constructor() {
1610
- n(this, "hi", /* @__PURE__ */ new Map());
1611
- n(this, "ci", null);
1612
- n(this, "li", null);
1613
- n(this, "Ci");
1614
- n(this, "Di");
1615
- n(this, "Pi", !1);
1616
- n(this, "ui");
1617
- n(this, "Ii");
1618
- n(this, "wi", { ArrowUp: "UP_ARROW", ArrowDown: "DOWN_ARROW", ArrowLeft: "LEFT_ARROW", ArrowRight: "RIGHT_ARROW", F1: "F1", F2: "F2", F3: "F3", F4: "F4", F5: "F5", F6: "F6", F7: "F7", F8: "F8", F9: "F9", F10: "F10", F11: "F11", F12: "F12", Enter: "ENTER", Return: "RETURN", Tab: "TAB", Escape: "ESCAPE", Backspace: "BACKSPACE", Delete: "DELETE", Insert: "INSERT", Home: "HOME", End: "END", PageUp: "PAGE_UP", PageDown: "PAGE_DOWN", Shift: "SHIFT", Control: "CONTROL", Alt: "ALT", Meta: "META", " ": "SPACE" });
1619
- }
1620
- fi() {
1621
- this.Pi || (this.Ci = (A) => {
1622
- this.di(A);
1623
- }, this.Di = (A) => {
1624
- this.pi(A);
1625
- }, window.addEventListener("keydown", this.Ci, { passive: !1 }), window.addEventListener("keyup", this.Di, { passive: !1 }), this.Pi = !0);
1626
- }
1627
- _i() {
1628
- this.Pi && (window.removeEventListener("keydown", this.Ci), window.removeEventListener("keyup", this.Di), this.Pi = !1, this.hi.clear(), this.ci = null, this.li = null);
1629
- }
1630
- mi(A) {
1631
- this.ui = A;
1632
- }
1633
- yi(A) {
1634
- this.Ii = A;
1635
- }
1636
- bi(A) {
1637
- const t = this.$i(A), e = this.hi.get(A) || this.hi.get(t);
1638
- return (e == null ? void 0 : e.isPressed) || !1;
1639
- }
1640
- Gi() {
1641
- return this.ci;
1642
- }
1643
- xi() {
1644
- return this.li;
1645
- }
1646
- Mi() {
1647
- const A = [];
1648
- for (const [t, e] of this.hi) e.isPressed && A.push(t);
1649
- return A;
1886
+ h(this, "Br", /* @__PURE__ */ new Map());
1887
+ h(this, "Gr", null);
1888
+ h(this, "Dr", null);
1889
+ h(this, "Lr");
1890
+ h(this, "kr");
1891
+ h(this, "Or", !1);
1892
+ h(this, "Hr");
1893
+ h(this, "Ir");
1894
+ h(this, "Nr", { ArrowUp: "UP_ARROW", ArrowDown: "DOWN_ARROW", ArrowLeft: "LEFT_ARROW", ArrowRight: "RIGHT_ARROW", F1: "F1", F2: "F2", F3: "F3", F4: "F4", F5: "F5", F6: "F6", F7: "F7", F8: "F8", F9: "F9", F10: "F10", F11: "F11", F12: "F12", Enter: "ENTER", Return: "RETURN", Tab: "TAB", Escape: "ESCAPE", Backspace: "BACKSPACE", Delete: "DELETE", Insert: "INSERT", Home: "HOME", End: "END", PageUp: "PAGE_UP", PageDown: "PAGE_DOWN", Shift: "SHIFT", Control: "CONTROL", Alt: "ALT", Meta: "META", " ": "SPACE" });
1895
+ }
1896
+ Xr() {
1897
+ this.Or || (this.Lr = (t) => {
1898
+ this.Wr(t);
1899
+ }, this.kr = (t) => {
1900
+ this.Vr(t);
1901
+ }, window.addEventListener("keydown", this.Lr, { passive: !1 }), window.addEventListener("keyup", this.kr, { passive: !1 }), this.Or = !0);
1902
+ }
1903
+ Kr() {
1904
+ this.Or && (window.removeEventListener("keydown", this.Lr), window.removeEventListener("keyup", this.kr), this.Or = !1, this.Br.clear(), this.Gr = null, this.Dr = null);
1905
+ }
1906
+ jr(t) {
1907
+ this.Hr = t;
1908
+ }
1909
+ Yr(t) {
1910
+ this.Ir = t;
1911
+ }
1912
+ qr(t) {
1913
+ const e = this.Zr(t), i = this.Br.get(t) || this.Br.get(e);
1914
+ return (i == null ? void 0 : i.isPressed) || !1;
1915
+ }
1916
+ Qr() {
1917
+ return this.Gr;
1918
+ }
1919
+ Jr() {
1920
+ return this.Dr;
1921
+ }
1922
+ tn() {
1923
+ const t = [];
1924
+ for (const [e, i] of this.Br) i.isPressed && t.push(e);
1925
+ return t;
1650
1926
  }
1651
- Yi() {
1652
- return { ctrl: this.bi("Control"), shift: this.bi("Shift"), alt: this.bi("Alt"), meta: this.bi("Meta") };
1927
+ en() {
1928
+ return { ctrl: this.qr("Control"), shift: this.qr("Shift"), alt: this.qr("Alt"), meta: this.qr("Meta") };
1653
1929
  }
1654
- Fi() {
1655
- this.hi.clear(), this.ci = null, this.li = null;
1930
+ sn() {
1931
+ this.Br.clear(), this.Gr = null, this.Dr = null;
1656
1932
  }
1657
- di(A) {
1658
- const t = A.key, e = Date.now();
1659
- this.hi.has(t) || this.hi.set(t, { isPressed: !1, lastPressTime: 0, lastReleaseTime: 0 });
1660
- const s = this.hi.get(t);
1661
- if (!s.isPressed && (s.isPressed = !0, s.lastPressTime = e, this.ci = t, this.ui)) {
1662
- const i = { key: t, keyCode: A.keyCode, ctrlKey: A.ctrlKey, shiftKey: A.shiftKey, altKey: A.altKey, metaKey: A.metaKey, isPressed: !0, originalEvent: A };
1663
- this.ui(i);
1933
+ Wr(t) {
1934
+ const e = t.key, i = Date.now();
1935
+ this.Br.has(e) || this.Br.set(e, { isPressed: !1, lastPressTime: 0, lastReleaseTime: 0 });
1936
+ const s = this.Br.get(e);
1937
+ if (!s.isPressed && (s.isPressed = !0, s.lastPressTime = i, this.Gr = e, this.Hr)) {
1938
+ const r = { key: e, keyCode: t.keyCode, ctrlKey: t.ctrlKey, shiftKey: t.shiftKey, altKey: t.altKey, metaKey: t.metaKey, isPressed: !0, originalEvent: t };
1939
+ this.Hr(r);
1664
1940
  }
1665
1941
  }
1666
- pi(A) {
1667
- const t = A.key, e = Date.now();
1668
- this.hi.has(t) || this.hi.set(t, { isPressed: !1, lastPressTime: 0, lastReleaseTime: 0 });
1669
- const s = this.hi.get(t);
1670
- if (s.isPressed = !1, s.lastReleaseTime = e, this.li = t, this.Ii) {
1671
- const i = { key: t, keyCode: A.keyCode, ctrlKey: A.ctrlKey, shiftKey: A.shiftKey, altKey: A.altKey, metaKey: A.metaKey, isPressed: !1, originalEvent: A };
1672
- this.Ii(i);
1942
+ Vr(t) {
1943
+ const e = t.key, i = Date.now();
1944
+ this.Br.has(e) || this.Br.set(e, { isPressed: !1, lastPressTime: 0, lastReleaseTime: 0 });
1945
+ const s = this.Br.get(e);
1946
+ if (s.isPressed = !1, s.lastReleaseTime = i, this.Dr = e, this.Ir) {
1947
+ const r = { key: e, keyCode: t.keyCode, ctrlKey: t.ctrlKey, shiftKey: t.shiftKey, altKey: t.altKey, metaKey: t.metaKey, isPressed: !1, originalEvent: t };
1948
+ this.Ir(r);
1673
1949
  }
1674
1950
  }
1675
- $i(A) {
1676
- return this.wi[A] || A.toLowerCase();
1951
+ Zr(t) {
1952
+ return this.Nr[t] || t.toLowerCase();
1677
1953
  }
1678
1954
  }
1679
- class GA {
1680
- constructor(A) {
1681
- n(this, "Vs");
1682
- n(this, "Ri");
1683
- n(this, "Si", { x: -1, y: -1 });
1684
- n(this, "ki", { x: -1, y: -1 });
1685
- n(this, "zi", null);
1686
- n(this, "Li");
1687
- n(this, "Oi");
1688
- n(this, "Ti");
1689
- n(this, "Ui");
1690
- n(this, "Wi");
1691
- n(this, "Hi");
1692
- n(this, "Pi", !1);
1693
- n(this, "Ki");
1694
- n(this, "Ji");
1695
- n(this, "Vi");
1696
- n(this, "Zi");
1697
- n(this, "Ni");
1698
- this.Vs = A;
1699
- }
1700
- zs(A) {
1701
- this.Ri = A, this.Xi();
1702
- }
1703
- fi() {
1704
- if (this.Pi) return;
1705
- const A = this.Vs.canvas;
1706
- this.Li = (t) => {
1707
- this.ji(t), this.qi(t);
1708
- }, this.Oi = () => {
1709
- this.ki = { ...this.Si }, this.Si.x = -1, this.Si.y = -1, this.zi = null;
1710
- }, this.Ti = (t) => {
1711
- this.ji(t), this.AB(t);
1712
- }, this.Ui = (t) => {
1713
- this.ji(t), this.tB(t);
1714
- }, this.Wi = (t) => {
1715
- this.ji(t), this.eB(t);
1716
- }, this.Hi = (t) => {
1717
- this.ji(t), this.sB(t);
1718
- }, A.addEventListener("mousemove", this.Li, { passive: !0 }), A.addEventListener("mouseleave", this.Oi, { passive: !0 }), A.addEventListener("mousedown", this.Ti, { passive: !0 }), A.addEventListener("mouseup", this.Ui, { passive: !0 }), A.addEventListener("click", this.Wi, { passive: !0 }), A.addEventListener("wheel", this.Hi, { passive: !1 }), this.Pi = !0;
1719
- }
1720
- _i() {
1721
- if (!this.Pi) return;
1722
- const A = this.Vs.canvas;
1723
- A.removeEventListener("mousemove", this.Li), A.removeEventListener("mouseleave", this.Oi), A.removeEventListener("mousedown", this.Ti), A.removeEventListener("mouseup", this.Ui), A.removeEventListener("click", this.Wi), A.removeEventListener("wheel", this.Hi), this.Pi = !1;
1724
- }
1725
- Xi() {
1726
- if (this.Pi) try {
1727
- if (this.zi) {
1728
- const A = new MouseEvent("mousemove", { clientX: this.zi.x, clientY: this.zi.y, bubbles: !1, cancelable: !1 });
1729
- this.ji(A);
1730
- } else this.Si.x !== -1 && this.Si.y !== -1 && (this.Si.x >= this.Ri.cols || this.Si.y >= this.Ri.rows) && (this.Si.x = -1, this.Si.y = -1);
1955
+ class jt {
1956
+ constructor(t) {
1957
+ h(this, "tr");
1958
+ h(this, "rn");
1959
+ h(this, "nn", { x: -1, y: -1 });
1960
+ h(this, "an", { x: -1, y: -1 });
1961
+ h(this, "hn", null);
1962
+ h(this, "cn");
1963
+ h(this, "ln");
1964
+ h(this, "un");
1965
+ h(this, "fn");
1966
+ h(this, "dn");
1967
+ h(this, "pn");
1968
+ h(this, "Or", !1);
1969
+ h(this, "mn");
1970
+ h(this, "gn");
1971
+ h(this, "_n");
1972
+ h(this, "vn");
1973
+ h(this, "yn");
1974
+ this.tr = t;
1975
+ }
1976
+ Wi(t) {
1977
+ this.rn = t, this.An();
1978
+ }
1979
+ Xr() {
1980
+ if (this.Or) return;
1981
+ const t = this.tr.canvas;
1982
+ this.cn = (e) => {
1983
+ this.wn(e), this.Cn(e);
1984
+ }, this.ln = () => {
1985
+ this.an = { ...this.nn }, this.nn.x = -1, this.nn.y = -1, this.hn = null;
1986
+ }, this.un = (e) => {
1987
+ this.wn(e), this.bn(e);
1988
+ }, this.fn = (e) => {
1989
+ this.wn(e), this.xn(e);
1990
+ }, this.dn = (e) => {
1991
+ this.wn(e), this.$n(e);
1992
+ }, this.pn = (e) => {
1993
+ this.wn(e), this.Mn(e);
1994
+ }, t.addEventListener("mousemove", this.cn, { passive: !0 }), t.addEventListener("mouseleave", this.ln, { passive: !0 }), t.addEventListener("mousedown", this.un, { passive: !0 }), t.addEventListener("mouseup", this.fn, { passive: !0 }), t.addEventListener("click", this.dn, { passive: !0 }), t.addEventListener("wheel", this.pn, { passive: !1 }), this.Or = !0;
1995
+ }
1996
+ Kr() {
1997
+ if (!this.Or) return;
1998
+ const t = this.tr.canvas;
1999
+ t.removeEventListener("mousemove", this.cn), t.removeEventListener("mouseleave", this.ln), t.removeEventListener("mousedown", this.un), t.removeEventListener("mouseup", this.fn), t.removeEventListener("click", this.dn), t.removeEventListener("wheel", this.pn), this.Or = !1;
2000
+ }
2001
+ An() {
2002
+ if (this.Or) try {
2003
+ if (this.hn) {
2004
+ const t = new MouseEvent("mousemove", { clientX: this.hn.x, clientY: this.hn.y, bubbles: !1, cancelable: !1 });
2005
+ this.wn(t);
2006
+ } else this.nn.x !== -1 && this.nn.y !== -1 && (this.nn.x >= this.rn.cols || this.nn.y >= this.rn.rows) && (this.nn.x = -1, this.nn.y = -1);
1731
2007
  } catch {
1732
- this.Si.x = -1, this.Si.y = -1;
2008
+ this.nn.x = -1, this.nn.y = -1;
1733
2009
  }
1734
2010
  }
1735
- iB(A) {
1736
- this.Ki = A;
2011
+ Fn(t) {
2012
+ this.mn = t;
1737
2013
  }
1738
- mi(A) {
1739
- this.Ji = A;
2014
+ jr(t) {
2015
+ this.gn = t;
1740
2016
  }
1741
- yi(A) {
1742
- this.Vi = A;
2017
+ Yr(t) {
2018
+ this._n = t;
1743
2019
  }
1744
- BB(A) {
1745
- this.Zi = A;
2020
+ Rn(t) {
2021
+ this.vn = t;
1746
2022
  }
1747
- QB(A) {
1748
- this.Ni = A;
2023
+ zn(t) {
2024
+ this.yn = t;
1749
2025
  }
1750
- EB() {
1751
- return { x: this.Si.x, y: this.Si.y };
2026
+ Pn() {
2027
+ return { x: this.nn.x, y: this.nn.y };
1752
2028
  }
1753
- qi(A) {
1754
- if (this.Zi) {
1755
- const t = { position: { ...this.Si }, previousPosition: { ...this.ki }, originalEvent: A };
1756
- this.Zi(t);
2029
+ Cn(t) {
2030
+ if (this.vn) {
2031
+ const e = { position: { ...this.nn }, previousPosition: { ...this.an }, originalEvent: t };
2032
+ this.vn(e);
1757
2033
  }
1758
2034
  }
1759
- AB(A) {
1760
- if (this.Ji) {
1761
- const t = { position: { ...this.Si }, previousPosition: { ...this.ki }, button: A.button, originalEvent: A };
1762
- this.Ji(t);
2035
+ bn(t) {
2036
+ if (this.gn) {
2037
+ const e = { position: { ...this.nn }, previousPosition: { ...this.an }, button: t.button, originalEvent: t };
2038
+ this.gn(e);
1763
2039
  }
1764
2040
  }
1765
- tB(A) {
1766
- if (this.Vi) {
1767
- const t = { position: { ...this.Si }, previousPosition: { ...this.ki }, button: A.button, originalEvent: A };
1768
- this.Vi(t);
2041
+ xn(t) {
2042
+ if (this._n) {
2043
+ const e = { position: { ...this.nn }, previousPosition: { ...this.an }, button: t.button, originalEvent: t };
2044
+ this._n(e);
1769
2045
  }
1770
2046
  }
1771
- eB(A) {
1772
- if (this.Ki) {
1773
- const t = { position: { ...this.Si }, previousPosition: { ...this.ki }, button: A.button, originalEvent: A };
1774
- this.Ki(t);
2047
+ $n(t) {
2048
+ if (this.mn) {
2049
+ const e = { position: { ...this.nn }, previousPosition: { ...this.an }, button: t.button, originalEvent: t };
2050
+ this.mn(e);
1775
2051
  }
1776
2052
  }
1777
- sB(A) {
1778
- if (this.Ni) {
1779
- const t = { position: { ...this.Si }, previousPosition: { ...this.ki }, delta: { x: A.deltaX, y: A.deltaY }, originalEvent: A };
1780
- this.Ni(t);
2053
+ Mn(t) {
2054
+ if (this.yn) {
2055
+ const e = { position: { ...this.nn }, previousPosition: { ...this.an }, delta: { x: t.deltaX, y: t.deltaY }, originalEvent: t };
2056
+ this.yn(e);
1781
2057
  }
1782
2058
  }
1783
- ji(A) {
1784
- const t = this.Vs.canvas;
1785
- this.ki = { ...this.Si }, this.zi = { x: A.clientX, y: A.clientY };
1786
- const e = t.getBoundingClientRect(), s = A.clientX - e.left, i = A.clientY - e.top, B = t.width / e.width, r = i * (t.height / e.height), Q = s * B - this.Ri.offsetX, o = r - this.Ri.offsetY, g = Math.floor(Q / this.Ri.cellWidth), a = Math.floor(o / this.Ri.cellHeight);
1787
- g >= 0 && g < this.Ri.cols && a >= 0 && a < this.Ri.rows ? (this.Si.x = g, this.Si.y = a) : (this.Si.x = -1, this.Si.y = -1);
2059
+ wn(t) {
2060
+ const e = this.tr.canvas;
2061
+ this.an = { ...this.nn }, this.hn = { x: t.clientX, y: t.clientY };
2062
+ const i = e.getBoundingClientRect(), s = t.clientX - i.left, r = t.clientY - i.top, n = e.width / i.width, o = r * (e.height / i.height), c = s * n - this.rn.offsetX, l = o - this.rn.offsetY, f = Math.floor(c / this.rn.cellWidth), u = Math.floor(l / this.rn.cellHeight);
2063
+ f >= 0 && f < this.rn.cols && u >= 0 && u < this.rn.rows ? (this.nn.x = f, this.nn.y = u) : (this.nn.x = -1, this.nn.y = -1);
1788
2064
  }
1789
2065
  }
1790
- const SA = (E) => class extends E {
1791
- rotate(A = 0, t = 0, e = 0) {
1792
- this.vA.state.EA(A), this.vA.state.rA(t), this.vA.state.nA(e);
2066
+ const Kt = (a) => class extends a {
2067
+ rotate(t = 0, e = 0, i = 0) {
2068
+ this.xt.state.et(t), this.xt.state.st(e), this.xt.state.it(i);
1793
2069
  }
1794
- rotateX(A) {
1795
- this.vA.state.EA(A);
2070
+ rotateX(t) {
2071
+ this.xt.state.et(t);
1796
2072
  }
1797
- rotateY(A) {
1798
- this.vA.state.rA(A);
2073
+ rotateY(t) {
2074
+ this.xt.state.st(t);
1799
2075
  }
1800
- rotateZ(A) {
1801
- this.vA.state.nA(A);
2076
+ rotateZ(t) {
2077
+ this.xt.state.it(t);
1802
2078
  }
1803
2079
  push() {
1804
- this.vA.state.J();
2080
+ this.xt.state.H();
1805
2081
  }
1806
2082
  pop() {
1807
- this.vA.state.sA();
2083
+ this.xt.state.Z();
1808
2084
  }
1809
- rect(A, t, e = 1, s = 1) {
1810
- this.vA.$e(A, t, e, s);
2085
+ rect(t, e, i = 1, s = 1) {
2086
+ this.xt.Ns(t, e, i, s);
1811
2087
  }
1812
- point(A, t) {
1813
- this.vA.$e(A, t, 1, 1);
2088
+ point(t, e) {
2089
+ this.xt.Ns(t, e, 1, 1);
1814
2090
  }
1815
- line(A, t, e, s) {
1816
- this.vA.Ge(A, t, e, s);
2091
+ line(t, e, i, s) {
2092
+ this.xt.Xs(t, e, i, s);
1817
2093
  }
1818
- lineWeight(A) {
1819
- this.vA.state.QA(A);
2094
+ lineWeight(t) {
2095
+ this.xt.state.tt(t);
1820
2096
  }
1821
- background(A, t = A, e = A, s = 255) {
1822
- this.vA.Se(A, t, e, s);
2097
+ background(t, e = t, i = t, s = 255) {
2098
+ this.xt.qs(t, e, i, s);
1823
2099
  }
1824
- char(A) {
1825
- this.vA.state.oA(this.ps.fs(A));
2100
+ char(t) {
2101
+ this.xt.state.rt(this.Si.Pi(t));
1826
2102
  }
1827
- charColor(A, t, e) {
1828
- this.vA.state.gA(A, t, e);
2103
+ charColor(t, e, i) {
2104
+ this.xt.state.nt(t, e, i);
1829
2105
  }
1830
- cellColor(A, t, e) {
1831
- this.vA.state.aA(A, t, e);
2106
+ cellColor(t, e, i) {
2107
+ this.xt.state.ot(t, e, i);
1832
2108
  }
1833
- flipX(A) {
1834
- this.vA.state.hA(A);
2109
+ flipX(t) {
2110
+ this.xt.state.ht(t);
1835
2111
  }
1836
- flipY(A) {
1837
- this.vA.state.cA(A);
2112
+ flipY(t) {
2113
+ this.xt.state.ct(t);
1838
2114
  }
1839
- charRotation(A) {
1840
- this.vA.state.CA(A);
2115
+ charRotation(t) {
2116
+ this.xt.state.ut(t);
1841
2117
  }
1842
- invert(A) {
1843
- this.vA.state.lA(A);
2118
+ invert(t) {
2119
+ this.xt.state.lt(t);
1844
2120
  }
1845
2121
  clear() {
1846
- this.vA.Se(0, 0, 0, 0);
2122
+ this.xt.qs(0, 0, 0, 0);
1847
2123
  }
1848
- ellipse(A, t, e, s) {
1849
- this.vA.xe(A, t, e / 2, s / 2);
2124
+ ellipse(t, e, i, s) {
2125
+ this.xt.Ws(t, e, i / 2, s / 2);
1850
2126
  }
1851
- triangle(A, t, e, s, i, B) {
1852
- this.vA.Me(A, t, e, s, i, B);
2127
+ triangle(t, e, i, s, r, n) {
2128
+ this.xt.Vs(t, e, i, s, r, n);
1853
2129
  }
1854
- bezierCurve(A, t, e, s, i, B, r, Q) {
1855
- this.vA.Ye(A, t, e, s, i, B, r, Q);
2130
+ bezierCurve(t, e, i, s, r, n, o, c) {
2131
+ this.xt.Ks(t, e, i, s, r, n, o, c);
1856
2132
  }
1857
- arc(A, t, e, s, i, B) {
1858
- this.vA.Re(A, t, e, s, i, B);
2133
+ arc(t, e, i, s, r, n) {
2134
+ this.xt.Ys(t, e, i, s, r, n);
1859
2135
  }
1860
- shader(A) {
1861
- this.vA.me(A);
2136
+ shader(t) {
2137
+ this.xt.Ls(t);
1862
2138
  }
1863
- setUniform(A, t) {
1864
- this.vA.ZA(A, t);
2139
+ setUniform(t, e) {
2140
+ this.xt.Kt(t, e);
1865
2141
  }
1866
- setUniforms(A) {
1867
- this.vA.ve(A);
2142
+ setUniforms(t) {
2143
+ this.xt.ks(t);
1868
2144
  }
1869
- createFilterShader(A) {
1870
- return this.vA.Bt(A);
2145
+ createFilterShader(t) {
2146
+ return this.xt.oe(t);
1871
2147
  }
1872
- createFramebuffer(A) {
1873
- return this.vA.Fe(A.width, A.height, 5, { filter: "nearest", wrap: "clamp", format: "rgba", type: "unsigned_byte" });
2148
+ createFramebuffer(t) {
2149
+ return this.xt.js(t.width, t.height, 5, { filter: "nearest", wrap: "clamp", format: "rgba", type: "unsigned_byte" });
1874
2150
  }
1875
- image(A, t, e, s, i) {
1876
- this.vA.ye(A, t, e, s ?? A.width, i ?? A.height);
2151
+ image(t, e, i, s, r) {
2152
+ if (t.textures) {
2153
+ const n = t;
2154
+ this.xt.Os(n, e, i, s ?? n.width, r ?? n.height);
2155
+ } else {
2156
+ const n = t;
2157
+ this.xt.Hs(n, e, i, s ?? n.width, r ?? n.height);
2158
+ }
2159
+ }
2160
+ async loadImage(t) {
2161
+ if (typeof t != "string") return z.fromSource(this.xt, t, (s) => this.Si.Ti(s));
2162
+ const e = t, i = await new Promise((s, r) => {
2163
+ const n = new Image();
2164
+ n.crossOrigin = "anonymous", n.onload = () => s(n), n.onerror = (o) => r(o), n.src = e;
2165
+ });
2166
+ return z.fromSource(this.xt, i, (s) => this.Si.Ti(s));
1877
2167
  }
1878
2168
  };
1879
- class O {
1880
- rB(A) {
1881
- const t = A.MA(0), e = A.MA(1), s = A.MA(2), i = A.MA(3);
1882
- return { characterPixels: t, primaryColorPixels: e, secondaryColorPixels: s, transformPixels: A.MA(4), rotationPixels: i };
2169
+ class $ {
2170
+ Tn(t) {
2171
+ const e = t.Pt(0), i = t.Pt(1), s = t.Pt(2), r = t.Pt(3);
2172
+ return { characterPixels: e, primaryColorPixels: i, secondaryColorPixels: s, transformPixels: t.Pt(4), rotationPixels: r };
1883
2173
  }
1884
- nB(A, t) {
1885
- return A[t] + (A[t + 1] << 8);
2174
+ Sn(t, e) {
2175
+ return t[e] + (t[e + 1] << 8);
1886
2176
  }
1887
- oB(A, t) {
1888
- return { r: A[t], g: A[t + 1], b: A[t + 2], a: A[t + 3] };
2177
+ En(t, e) {
2178
+ return { r: t[e], g: t[e + 1], b: t[e + 2], a: t[e + 3] };
1889
2179
  }
1890
2180
  }
1891
- class z {
1892
- gB(A, t) {
1893
- return new Blob([A], { type: t });
2181
+ class J {
2182
+ Bn(t, e) {
2183
+ return new Blob([t], { type: e });
1894
2184
  }
1895
- aB(A, t, e) {
2185
+ Gn(t, e, i) {
1896
2186
  try {
1897
- const s = this.gB(A, e), i = URL.createObjectURL(s), B = document.createElement("a");
1898
- B.href = i, B.download = t, B.style.display = "none", B.rel = "noopener", document.body.appendChild(B), B.click(), document.body.removeChild(B), URL.revokeObjectURL(i);
2187
+ const s = this.Bn(t, i), r = URL.createObjectURL(s), n = document.createElement("a");
2188
+ n.href = r, n.download = e, n.style.display = "none", n.rel = "noopener", document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(r);
1899
2189
  } catch (s) {
1900
- throw console.error("Failed to download file:", s), Error("File download failed: " + (s instanceof Error ? s.message : "Unknown error"));
2190
+ console.error("Failed to download file:", s);
1901
2191
  }
1902
2192
  }
1903
- hB() {
2193
+ Dn() {
1904
2194
  return (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace(/:/g, "-");
1905
2195
  }
1906
- cB() {
1907
- const A = /* @__PURE__ */ new Date();
1908
- return { date: A.toISOString().split("T")[0], time: A.toTimeString().split(" ")[0].replace(/:/g, "-") };
2196
+ Ln() {
2197
+ const t = /* @__PURE__ */ new Date();
2198
+ return { date: t.toISOString().split("T")[0], time: t.toTimeString().split(" ")[0].replace(/:/g, "-") };
1909
2199
  }
1910
- lB(A) {
1911
- return A.replace(/[<>:"/\\|?*]/g, "_").replace(/\s+/g, "_").replace(/_{2,}/g, "_").replace(/^_+|_+$/g, "").substring(0, 255);
2200
+ kn(t) {
2201
+ return t.replace(/[<>:"/\\|?*]/g, "_").replace(/\s+/g, "_").replace(/_{2,}/g, "_").replace(/^_+|_+$/g, "").substring(0, 255);
1912
2202
  }
1913
- CB() {
1914
- return "textmode-export-" + this.hB();
2203
+ On() {
2204
+ return "textmode-export-" + this.Dn();
1915
2205
  }
1916
2206
  }
1917
- class _A extends O {
1918
- DB(A, t, e) {
1919
- const s = A[e] === 255, i = A[e + 1] === 255, B = A[e + 2] === 255, r = t[e], Q = t[e + 1];
1920
- return { isInverted: s, flipHorizontal: i, flipVertical: B, rotation: Math.round(360 * (r + Q / 255) / 255 * 100) / 100 };
2207
+ class qt extends $ {
2208
+ Hn(t, e, i) {
2209
+ const s = t[i] === 255, r = t[i + 1] === 255, n = t[i + 2] === 255, o = e[i], c = e[i + 1];
2210
+ return { isInverted: s, flipHorizontal: r, flipVertical: n, rotation: Math.round(360 * (o + c / 255) / 255 * 100) / 100 };
1921
2211
  }
1922
- PB(A, t, e) {
1923
- return { x: A, y: t, cellX: A * e.cellWidth, cellY: t * e.cellHeight };
2212
+ In(t, e, i) {
2213
+ return { x: t, y: e, cellX: t * i.cellWidth, cellY: e * i.cellHeight };
1924
2214
  }
1925
- uB(A, t) {
1926
- const e = [];
2215
+ Nn(t, e) {
2216
+ const i = [];
1927
2217
  let s = 0;
1928
- for (let i = 0; i < t.rows; i++) for (let B = 0; B < t.cols; B++) {
1929
- const r = 4 * s, Q = this.nB(A.characterPixels, r);
1930
- let o = this.oB(A.primaryColorPixels, r), g = this.oB(A.secondaryColorPixels, r);
1931
- const a = this.DB(A.transformPixels, A.rotationPixels, r);
1932
- if (a.isInverted) {
1933
- const c = o;
1934
- o = g, g = c;
2218
+ for (let r = 0; r < e.rows; r++) for (let n = 0; n < e.cols; n++) {
2219
+ const o = 4 * s, c = this.Sn(t.characterPixels, o);
2220
+ let l = this.En(t.primaryColorPixels, o), f = this.En(t.secondaryColorPixels, o);
2221
+ const u = this.Hn(t.transformPixels, t.rotationPixels, o);
2222
+ if (u.isInverted) {
2223
+ const v = l;
2224
+ l = f, f = v;
1935
2225
  }
1936
- const h = this.PB(B, i, t);
1937
- e.push({ charIndex: Q, primaryColor: o, secondaryColor: g, transform: a, position: h }), s++;
2226
+ const g = this.In(n, r, e);
2227
+ i.push({ charIndex: c, primaryColor: l, secondaryColor: f, transform: u, position: g }), s++;
1938
2228
  }
1939
- return e;
2229
+ return i;
1940
2230
  }
1941
2231
  }
1942
- class LA {
1943
- IB(A, t) {
1944
- const e = A.cmap;
1945
- for (const s of e.tables) if (s.format === 4) {
1946
- const i = s;
1947
- for (let B = 0; B < i.startCount.length; B++) if (t >= i.startCount[B] && t <= i.endCount[B]) {
1948
- if (i.idRangeOffset[B] === 0) return t + i.idDelta[B] & 65535;
2232
+ class Zt {
2233
+ Xn(t, e) {
2234
+ const i = t.cmap;
2235
+ for (const s of i.tables) if (s.format === 4) {
2236
+ const r = s;
2237
+ for (let n = 0; n < r.startCount.length; n++) if (e >= r.startCount[n] && e <= r.endCount[n]) {
2238
+ if (r.idRangeOffset[n] === 0) return e + r.idDelta[n] & 65535;
1949
2239
  {
1950
- const r = i.idRangeOffset[B] / 2 + (t - i.startCount[B]) - (i.startCount.length - B);
1951
- if (r >= 0 && r < i.glyphIdArray.length) {
1952
- const Q = i.glyphIdArray[r];
1953
- if (Q !== 0) return Q + i.idDelta[B] & 65535;
2240
+ const o = r.idRangeOffset[n] / 2 + (e - r.startCount[n]) - (r.startCount.length - n);
2241
+ if (o >= 0 && o < r.glyphIdArray.length) {
2242
+ const c = r.glyphIdArray[o];
2243
+ if (c !== 0) return c + r.idDelta[n] & 65535;
1954
2244
  }
1955
2245
  }
1956
2246
  }
1957
2247
  } else if (s.format === 12) {
1958
- const i = s;
1959
- for (let B = 0; B < i.groups.length; B += 3) {
1960
- const r = i.groups[B], Q = i.groups[B + 1], o = i.groups[B + 2];
1961
- if (t >= r && t <= Q) return o + (t - r);
2248
+ const r = s;
2249
+ for (let n = 0; n < r.groups.length; n += 3) {
2250
+ const o = r.groups[n], c = r.groups[n + 1], l = r.groups[n + 2];
2251
+ if (e >= o && e <= c) return l + (e - o);
1962
2252
  }
1963
2253
  }
1964
2254
  return 0;
1965
2255
  }
1966
- wB(A, t, e, s, i) {
1967
- const B = i / A.head.unitsPerEm;
1968
- return { getBoundingBox: () => ({ x1: e + t.xMin * B, y1: s + -t.yMax * B, x2: e + t.xMax * B, y2: s + -t.yMin * B }), toSVG: () => this.fB(t, e, s, B) };
1969
- }
1970
- fB(A, t, e, s) {
1971
- if (!A || !A.xs) return "";
1972
- const { xs: i, ys: B, endPts: r, flags: Q } = A;
1973
- if (!(i && B && r && Q)) return "";
1974
- let o = "", g = 0;
1975
- for (let a = 0; a < r.length; a++) {
1976
- const h = r[a];
1977
- if (!(h < g)) {
1978
- if (h >= g) {
1979
- const c = t + i[g] * s, l = e - B[g] * s;
1980
- o += `M${c.toFixed(2)},${l.toFixed(2)}`;
1981
- let C = g + 1;
1982
- for (; C <= h; )
1983
- if (1 & Q[C]) {
1984
- const I = t + i[C] * s, w = e - B[C] * s;
1985
- o += `L${I.toFixed(2)},${w.toFixed(2)}`, C++;
2256
+ Wn(t, e, i, s, r) {
2257
+ const n = r / t.head.unitsPerEm;
2258
+ return { getBoundingBox: () => ({ x1: i + e.xMin * n, y1: s + -e.yMax * n, x2: i + e.xMax * n, y2: s + -e.yMin * n }), toSVG: () => this.Vn(e, i, s, n) };
2259
+ }
2260
+ Vn(t, e, i, s) {
2261
+ if (!t || !t.xs) return "";
2262
+ const { xs: r, ys: n, endPts: o, flags: c } = t;
2263
+ if (!(r && n && o && c)) return "";
2264
+ let l = "", f = 0;
2265
+ for (let u = 0; u < o.length; u++) {
2266
+ const g = o[u];
2267
+ if (!(g < f)) {
2268
+ if (g >= f) {
2269
+ const v = e + r[f] * s, m = i - n[f] * s;
2270
+ l += `M${v.toFixed(2)},${m.toFixed(2)}`;
2271
+ let d = f + 1;
2272
+ for (; d <= g; )
2273
+ if (1 & c[d]) {
2274
+ const A = e + r[d] * s, p = i - n[d] * s;
2275
+ l += `L${A.toFixed(2)},${p.toFixed(2)}`, d++;
1986
2276
  } else {
1987
- const I = t + i[C] * s, w = e - B[C] * s;
1988
- let d = C + 1 > h ? g : C + 1;
1989
- if (1 & Q[d]) {
1990
- const p = t + i[d] * s, x = e - B[d] * s;
1991
- o += `Q${I.toFixed(2)},${w.toFixed(2)} ${p.toFixed(2)},${x.toFixed(2)}`, C = d + 1;
2277
+ const A = e + r[d] * s, p = i - n[d] * s;
2278
+ let y = d + 1 > g ? f : d + 1;
2279
+ if (1 & c[y]) {
2280
+ const x = e + r[y] * s, C = i - n[y] * s;
2281
+ l += `Q${A.toFixed(2)},${p.toFixed(2)} ${x.toFixed(2)},${C.toFixed(2)}`, d = y + 1;
1992
2282
  } else {
1993
- const p = (I + (t + i[d] * s)) / 2, x = (w + (e - B[d] * s)) / 2;
1994
- o += `Q${I.toFixed(2)},${w.toFixed(2)} ${p.toFixed(2)},${x.toFixed(2)}`, C = d;
2283
+ const x = (A + (e + r[y] * s)) / 2, C = (p + (i - n[y] * s)) / 2;
2284
+ l += `Q${A.toFixed(2)},${p.toFixed(2)} ${x.toFixed(2)},${C.toFixed(2)}`, d = y;
1995
2285
  }
1996
2286
  }
1997
- o += "Z";
2287
+ l += "Z";
1998
2288
  }
1999
- g = h + 1;
2289
+ f = g + 1;
2000
2290
  }
2001
2291
  }
2002
- return o;
2292
+ return l;
2003
2293
  }
2004
- dB(A, t, e, s, i) {
2005
- const B = A.codePointAt(0) || 0, r = this.IB(t, B);
2006
- let Q = null;
2007
- return t.glyf && t.glyf[r] !== null ? Q = t.glyf[r] : (Q = m.T.glyf.ze(t, r), t.glyf[r] = Q), this.wB(t, Q, e, s, i);
2294
+ Kn(t, e, i, s, r) {
2295
+ const n = t.codePointAt(0) || 0, o = this.Xn(e, n);
2296
+ let c = null;
2297
+ return e.glyf && e.glyf[o] !== null ? c = e.glyf[o] : (c = B.T.glyf.Qs(e, o), e.glyf[o] = c), this.Wn(e, c, i, s, r);
2008
2298
  }
2009
- pB(A, t, e, s, i, B, r, Q) {
2010
- const o = e + (i - Q * (r / t.head.unitsPerEm)) / 2, g = s + (B + 0.7 * r) / 2;
2011
- return this.dB(A, t, o, g, r).toSVG() || null;
2299
+ jn(t, e, i, s, r, n, o, c) {
2300
+ const l = i + (r - c * (o / e.head.unitsPerEm)) / 2, f = s + (n + 0.7 * o) / 2;
2301
+ return this.Kn(t, e, l, f, o).toSVG() || null;
2012
2302
  }
2013
2303
  }
2014
- class YA {
2304
+ class $t {
2015
2305
  constructor() {
2016
- n(this, "_B");
2017
- this._B = new LA();
2306
+ h(this, "Yn");
2307
+ this.Yn = new Zt();
2018
2308
  }
2019
- mB(A) {
2020
- const { width: t, height: e } = A;
2021
- return `<?xml version="1.0" encoding="UTF-8"?><svg width="${t}" height="${e}" viewBox="0 0 ${t} ${e}" xmlns="http://www.w3.org/2000/svg"><title>textmode.js sketch</title>`;
2309
+ qn(t) {
2310
+ const { width: e, height: i } = t;
2311
+ return `<?xml version="1.0" encoding="UTF-8"?><svg width="${e}" height="${i}" viewBox="0 0 ${e} ${i}" xmlns="http://www.w3.org/2000/svg"><title>textmode.js sketch</title>`;
2022
2312
  }
2023
- vB() {
2313
+ Zn() {
2024
2314
  return "</g></svg>";
2025
2315
  }
2026
- yB(A, t) {
2027
- if (!t.includeBackgroundRectangles) return "";
2028
- const [e, s, i, B] = t.backgroundColor;
2029
- return `<rect width="${A.width}" height="${A.height}" fill="rgba(${e},${s},${i},${B / 255})"/>`;
2030
- }
2031
- bB(A, t) {
2032
- const { transform: e, position: s } = A;
2033
- if (!e.flipHorizontal && !e.flipVertical && !e.rotation) return "";
2034
- const i = s.cellX + t.cellWidth / 2, B = s.cellY + t.cellHeight / 2, r = [];
2035
- if (e.flipHorizontal || e.flipVertical) {
2036
- const Q = e.flipHorizontal ? -1 : 1, o = e.flipVertical ? -1 : 1;
2037
- r.push(`translate(${i} ${B})scale(${Q} ${o})translate(${-i} ${-B})`);
2316
+ Qn(t, e) {
2317
+ if (!e.includeBackgroundRectangles) return "";
2318
+ const [i, s, r, n] = e.backgroundColor;
2319
+ return `<rect width="${t.width}" height="${t.height}" fill="rgba(${i},${s},${r},${n / 255})"/>`;
2320
+ }
2321
+ Jn(t, e) {
2322
+ const { transform: i, position: s } = t;
2323
+ if (!i.flipHorizontal && !i.flipVertical && !i.rotation) return "";
2324
+ const r = s.cellX + e.cellWidth / 2, n = s.cellY + e.cellHeight / 2, o = [];
2325
+ if (i.flipHorizontal || i.flipVertical) {
2326
+ const c = i.flipHorizontal ? -1 : 1, l = i.flipVertical ? -1 : 1;
2327
+ o.push(`translate(${r} ${n})scale(${c} ${l})translate(${-r} ${-n})`);
2038
2328
  }
2039
- return e.rotation && r.push(`rotate(${e.rotation} ${i} ${B})`), ` transform="${r.join(" ")}"`;
2040
- }
2041
- $B(A, t, e) {
2042
- if (!e.includeBackgroundRectangles || A.secondaryColor.a === 0) return "";
2043
- const { position: s } = A, { r: i, g: B, b: r, a: Q } = A.secondaryColor, o = `rgba(${i},${B},${r},${Q / 255})`;
2044
- return e.drawMode === "stroke" ? `<rect x="${s.cellX}" y="${s.cellY}" width="${t.cellWidth}" height="${t.cellHeight}" stroke="${o}" fill="none" stroke-width="${e.strokeWidth}"/>` : `<rect x="${s.cellX}" y="${s.cellY}" width="${t.cellWidth}" height="${t.cellHeight}" fill="${o}"/>`;
2045
- }
2046
- dB(A, t, e, s) {
2047
- const i = e.characters[A.charIndex];
2048
- if (!i) return "";
2049
- const B = this._B.pB(i.character, e.font, A.position.cellX, A.position.cellY, t.cellWidth, t.cellHeight, e.fontSize, i.advanceWidth);
2050
- if (!B) return "";
2051
- const { r, g: Q, b: o, a: g } = A.primaryColor, a = `rgba(${r},${Q},${o},${g / 255})`;
2052
- return s.drawMode === "stroke" ? `<path d="${B}" stroke="${a}" stroke-width="${s.strokeWidth}" fill="none"/>` : `<path d="${B}" fill="${a}"/>`;
2053
- }
2054
- GB(A, t, e, s) {
2055
- const i = [], B = this.$B(A, t, s);
2056
- B && i.push(B);
2057
- const r = this.dB(A, t, e, s);
2058
- if (r) {
2059
- const Q = this.bB(A, t);
2060
- i.push(Q ? `<g${Q}>${r}</g>` : r);
2329
+ return i.rotation && o.push(`rotate(${i.rotation} ${r} ${n})`), ` transform="${o.join(" ")}"`;
2330
+ }
2331
+ eo(t, e, i) {
2332
+ if (!i.includeBackgroundRectangles || t.secondaryColor.a === 0) return "";
2333
+ const { position: s } = t, { r, g: n, b: o, a: c } = t.secondaryColor, l = `rgba(${r},${n},${o},${c / 255})`;
2334
+ return i.drawMode === "stroke" ? `<rect x="${s.cellX}" y="${s.cellY}" width="${e.cellWidth}" height="${e.cellHeight}" stroke="${l}" fill="none" stroke-width="${i.strokeWidth}"/>` : `<rect x="${s.cellX}" y="${s.cellY}" width="${e.cellWidth}" height="${e.cellHeight}" fill="${l}"/>`;
2335
+ }
2336
+ Kn(t, e, i, s) {
2337
+ const r = i.characters[t.charIndex];
2338
+ if (!r) return "";
2339
+ const n = this.Yn.jn(r.character, i.font, t.position.cellX, t.position.cellY, e.cellWidth, e.cellHeight, i.fontSize, r.advanceWidth);
2340
+ if (!n) return "";
2341
+ const { r: o, g: c, b: l, a: f } = t.primaryColor, u = `rgba(${o},${c},${l},${f / 255})`;
2342
+ return s.drawMode === "stroke" ? `<path d="${n}" stroke="${u}" stroke-width="${s.strokeWidth}" fill="none"/>` : `<path d="${n}" fill="${u}"/>`;
2343
+ }
2344
+ so(t, e, i, s) {
2345
+ const r = [], n = this.eo(t, e, s);
2346
+ n && r.push(n);
2347
+ const o = this.Kn(t, e, i, s);
2348
+ if (o) {
2349
+ const c = this.Jn(t, e);
2350
+ r.push(c ? `<g${c}>${o}</g>` : o);
2061
2351
  }
2062
- return i.join("");
2352
+ return r.join("");
2063
2353
  }
2064
- xB(A, t, e, s) {
2065
- const i = [this.mB(t), this.yB(t, s), '<g id="ascii-cells">'];
2066
- for (const B of A) i.push(this.GB(B, t, e, s));
2067
- return i.push(this.vB()), i.join("");
2354
+ io(t, e, i, s) {
2355
+ const r = [this.qn(e), this.Qn(e, s), '<g id="ascii-cells">'];
2356
+ for (const n of t) r.push(this.so(n, e, i, s));
2357
+ return r.push(this.Zn()), r.join("");
2068
2358
  }
2069
- MB(A) {
2070
- return A.replace(/<path[^>]*d=""[^>]*\/>/g, "").replace(/\s+/g, " ").replace(/> </g, "><");
2359
+ ro(t) {
2360
+ return t.replace(/<path[^>]*d=""[^>]*\/>/g, "").replace(/\s+/g, " ").replace(/> </g, "><");
2071
2361
  }
2072
2362
  }
2073
- class UA extends z {
2074
- YB(A) {
2075
- return this.gB(A, "image/svg+xml;charset=utf-8");
2363
+ class Jt extends J {
2364
+ no(t) {
2365
+ return this.Bn(t, "image/svg+xml;charset=utf-8");
2076
2366
  }
2077
- FB(A, t) {
2078
- this.aB(A, this.lB(t) + ".svg", "image/svg+xml;charset=utf-8");
2367
+ oo(t, e) {
2368
+ this.Gn(t, this.kn(e) + ".svg", "image/svg+xml;charset=utf-8");
2079
2369
  }
2080
- RB(A, t) {
2081
- this.FB(A, t || this.CB());
2370
+ ao(t, e) {
2371
+ this.oo(t, e || this.On());
2082
2372
  }
2083
2373
  }
2084
- class $ {
2374
+ class st {
2085
2375
  constructor() {
2086
- n(this, "SB");
2087
- n(this, "kB");
2088
- n(this, "zB");
2089
- this.SB = new _A(), this.kB = new YA(), this.zB = new UA();
2376
+ h(this, "ho");
2377
+ h(this, "co");
2378
+ h(this, "lo");
2379
+ this.ho = new qt(), this.co = new $t(), this.lo = new Jt();
2090
2380
  }
2091
- LB(A) {
2092
- return { includeBackgroundRectangles: A.includeBackgroundRectangles ?? !0, drawMode: A.drawMode ?? "fill", strokeWidth: A.strokeWidth ?? 1, backgroundColor: A.backgroundColor ?? [0, 0, 0, 0], filename: A.filename || this.zB.CB() };
2381
+ uo(t) {
2382
+ return { includeBackgroundRectangles: t.includeBackgroundRectangles ?? !0, drawMode: t.drawMode ?? "fill", strokeWidth: t.strokeWidth ?? 1, backgroundColor: t.backgroundColor ?? [0, 0, 0, 0], filename: t.filename || this.lo.On() };
2093
2383
  }
2094
- OB(A, t = {}) {
2095
- const e = this.SB.uB(this.SB.rB(A.pipeline), A.grid), s = this.kB.xB(e, A.grid, A.font, this.LB(t));
2096
- return this.kB.MB(s);
2384
+ fo(t, e = {}) {
2385
+ const i = this.ho.Nn(this.ho.Tn(t.pipeline), t.grid), s = this.co.io(i, t.grid, t.font, this.uo(e));
2386
+ return this.co.ro(s);
2097
2387
  }
2098
- RB(A, t = {}) {
2099
- this.zB.RB(this.OB(A, t), t.filename);
2388
+ ao(t, e = {}) {
2389
+ this.lo.ao(this.fo(t, e), e.filename);
2100
2390
  }
2101
2391
  }
2102
- class OA extends O {
2103
- TB(A, t, e, s = " ") {
2104
- var r;
2105
- const i = [];
2106
- let B = 0;
2107
- for (let Q = 0; Q < t.rows; Q++) {
2108
- const o = [];
2109
- for (let g = 0; g < t.cols; g++) {
2110
- const a = 4 * B, h = this.nB(A.characterPixels, a), c = ((r = e.characters[h]) == null ? void 0 : r.character) || s;
2111
- o.push(c), B++;
2392
+ class Qt extends $ {
2393
+ do(t, e, i, s = " ") {
2394
+ var o;
2395
+ const r = [];
2396
+ let n = 0;
2397
+ for (let c = 0; c < e.rows; c++) {
2398
+ const l = [];
2399
+ for (let f = 0; f < e.cols; f++) {
2400
+ const u = 4 * n, g = this.Sn(t.characterPixels, u), v = ((o = i.characters[g]) == null ? void 0 : o.character) || s;
2401
+ l.push(v), n++;
2112
2402
  }
2113
- i.push(o);
2403
+ r.push(l);
2114
2404
  }
2115
- return i;
2405
+ return r;
2116
2406
  }
2117
2407
  }
2118
- class zA {
2119
- UB(A, t) {
2120
- const e = [];
2121
- for (const i of A) {
2122
- let B = i.join("");
2123
- t.preserveTrailingSpaces || (B = B.replace(/\s+$/, "")), e.push(B);
2408
+ class te {
2409
+ po(t, e) {
2410
+ const i = [];
2411
+ for (const r of t) {
2412
+ let n = r.join("");
2413
+ e.preserveTrailingSpaces || (n = n.replace(/\s+$/, "")), i.push(n);
2124
2414
  }
2125
- const s = t.lineEnding === "crlf" ? `\r
2415
+ const s = e.lineEnding === "crlf" ? `\r
2126
2416
  ` : `
2127
2417
  `;
2128
- return e.join(s);
2418
+ return i.join(s);
2129
2419
  }
2130
2420
  }
2131
- class kA extends z {
2132
- WB(A, t) {
2133
- const e = this.HB(t);
2134
- this.aB(A, e, "text/plain;charset=utf-8");
2421
+ class ee extends J {
2422
+ mo(t, e) {
2423
+ const i = this._o(e);
2424
+ this.Gn(t, i, "text/plain;charset=utf-8");
2135
2425
  }
2136
- HB(A) {
2137
- let t = this.lB(A);
2138
- return t === ".txt" || t.length <= 4 ? this.CB() : t;
2426
+ _o(t) {
2427
+ let e = this.kn(t);
2428
+ return e === ".txt" || e.length <= 4 ? this.On() : e;
2139
2429
  }
2140
2430
  }
2141
- class H {
2431
+ class rt {
2142
2432
  constructor() {
2143
- n(this, "SB");
2144
- n(this, "kB");
2145
- n(this, "zB");
2146
- this.SB = new OA(), this.kB = new zA(), this.zB = new kA();
2433
+ h(this, "ho");
2434
+ h(this, "co");
2435
+ h(this, "lo");
2436
+ this.ho = new Qt(), this.co = new te(), this.lo = new ee();
2147
2437
  }
2148
- LB(A) {
2149
- return { preserveTrailingSpaces: A.preserveTrailingSpaces ?? !1, lineEnding: A.lineEnding ?? "lf", emptyCharacter: A.emptyCharacter ?? " ", filename: A.filename || this.zB.CB() };
2438
+ uo(t) {
2439
+ return { preserveTrailingSpaces: t.preserveTrailingSpaces ?? !1, lineEnding: t.lineEnding ?? "lf", emptyCharacter: t.emptyCharacter ?? " ", filename: t.filename || this.lo.On() };
2150
2440
  }
2151
- KB(A, t = {}) {
2152
- const e = this.LB(t), s = this.SB.TB(this.SB.rB(A.pipeline), A.grid, A.font, e.emptyCharacter);
2153
- return this.kB.UB(s, e);
2441
+ vo(t, e = {}) {
2442
+ const i = this.uo(e), s = this.ho.do(this.ho.Tn(t.pipeline), t.grid, t.font, i.emptyCharacter);
2443
+ return this.co.po(s, i);
2154
2444
  }
2155
- WB(A, t = {}) {
2156
- this.zB.WB(this.KB(A, t), t.filename);
2445
+ mo(t, e = {}) {
2446
+ this.lo.mo(this.vo(t, e), e.filename);
2157
2447
  }
2158
2448
  }
2159
- class NA extends O {
2160
- JB(A, t = 1, e = "transparent") {
2161
- const s = A.canvas;
2162
- if (t === 1 && e === "transparent") return s;
2163
- const i = document.createElement("canvas"), B = i.getContext("2d"), r = Math.round(s.width * t), Q = Math.round(s.height * t);
2164
- return i.width = r, i.height = Q, e !== "transparent" && (B.fillStyle = e, B.fillRect(0, 0, r, Q)), B.imageSmoothingEnabled = !1, B.drawImage(s, 0, 0, s.width, s.height, 0, 0, r, Q), i;
2449
+ class ie extends $ {
2450
+ yo(t, e = 1, i = "transparent") {
2451
+ const s = t.canvas;
2452
+ if (e === 1 && i === "transparent") return s;
2453
+ const r = document.createElement("canvas"), n = r.getContext("2d"), o = Math.round(s.width * e), c = Math.round(s.height * e);
2454
+ return r.width = o, r.height = c, i !== "transparent" && (n.fillStyle = i, n.fillRect(0, 0, o, c)), n.imageSmoothingEnabled = !1, n.drawImage(s, 0, 0, s.width, s.height, 0, 0, o, c), r;
2165
2455
  }
2166
2456
  }
2167
- class WA {
2168
- VB(A, t) {
2169
- const e = this.ZB(t.format);
2170
- return t.format === "png" ? A.toDataURL(e) : A.toDataURL(e, t.quality);
2171
- }
2172
- async NB(A, t) {
2173
- return new Promise((e, s) => {
2174
- const i = this.ZB(t.format), B = (r) => {
2175
- r ? e(r) : s(Error(`Failed to generate ${t.format.toUpperCase()} blob`));
2457
+ class se {
2458
+ Ao(t, e) {
2459
+ const i = this.wo(e.format);
2460
+ return e.format === "png" ? t.toDataURL(i) : t.toDataURL(i, e.quality);
2461
+ }
2462
+ async Co(t, e) {
2463
+ return new Promise((i, s) => {
2464
+ const r = this.wo(e.format), n = (o) => {
2465
+ o ? i(o) : s(Error(`Failed to generate ${e.format.toUpperCase()} blob`));
2176
2466
  };
2177
- t.format === "png" ? A.toBlob(B, i) : A.toBlob(B, i, t.quality);
2467
+ e.format === "png" ? t.toBlob(n, r) : t.toBlob(n, r, e.quality);
2178
2468
  });
2179
2469
  }
2180
- ZB(A) {
2181
- switch (A) {
2470
+ wo(t) {
2471
+ switch (t) {
2182
2472
  case "png":
2183
2473
  return "image/png";
2184
2474
  case "jpg":
@@ -2186,274 +2476,286 @@ class WA {
2186
2476
  case "webp":
2187
2477
  return "image/webp";
2188
2478
  default:
2189
- throw Error("Unsupported image format: " + A);
2479
+ throw Error("Unsupported image format: " + t);
2190
2480
  }
2191
2481
  }
2192
2482
  }
2193
- const VA = { png: "image/png", jpg: "image/jpeg", webp: "image/webp" }, K = { png: ".png", jpg: ".jpg", webp: ".webp" };
2194
- class $A extends z {
2195
- XB(A, t, e) {
2196
- this.jB(A, this.lB(t) + K[e]);
2483
+ const re = { png: "image/png", jpg: "image/jpeg", webp: "image/webp" }, nt = { png: ".png", jpg: ".jpg", webp: ".webp" };
2484
+ class ne extends J {
2485
+ bo(t, e, i) {
2486
+ this.xo(t, this.kn(e) + nt[i]);
2197
2487
  }
2198
- jB(A, t) {
2199
- const e = URL.createObjectURL(A);
2488
+ xo(t, e) {
2489
+ const i = URL.createObjectURL(t);
2200
2490
  try {
2201
2491
  const s = document.createElement("a");
2202
- s.href = e, s.download = t, s.style.display = "none", s.rel = "noopener", document.body.appendChild(s), s.click(), document.body.removeChild(s);
2492
+ s.href = i, s.download = e, s.style.display = "none", s.rel = "noopener", document.body.appendChild(s), s.click(), document.body.removeChild(s);
2203
2493
  } finally {
2204
- URL.revokeObjectURL(e);
2494
+ URL.revokeObjectURL(i);
2205
2495
  }
2206
2496
  }
2207
- qB(A) {
2208
- return A in VA && A in K;
2497
+ $o(t) {
2498
+ return t in re && t in nt;
2209
2499
  }
2210
2500
  }
2211
- class HA {
2501
+ class oe {
2212
2502
  constructor() {
2213
- n(this, "SB");
2214
- n(this, "kB");
2215
- n(this, "zB");
2216
- this.SB = new NA(), this.kB = new WA(), this.zB = new $A();
2217
- }
2218
- LB(A) {
2219
- return { format: A.format ?? "png", quality: A.quality ?? 1, scale: A.scale ?? 1, backgroundColor: A.backgroundColor ?? "transparent", filename: A.filename || this.zB.CB() };
2220
- }
2221
- AQ(A) {
2222
- if (!this.zB.qB(A.format)) throw Error(`Saving '${A.format}' files is not supported`);
2223
- if (A.quality < 0 || A.quality > 1) throw Error("Image quality must be between 0.0 and 1.0");
2224
- if (A.scale <= 0) throw Error("Scale factor must be greater than 0");
2225
- A.format === "jpg" && A.backgroundColor === "transparent" && (A.backgroundColor = "black");
2226
- }
2227
- async NB(A, t) {
2228
- if (t.scale === 1 && t.backgroundColor === "transparent") return await this.kB.NB(A.canvas, t);
2229
- const e = this.SB.JB(A, t.scale, t.backgroundColor);
2230
- return await this.kB.NB(e, t);
2231
- }
2232
- async XB(A, t = {}) {
2233
- const e = this.LB(t);
2234
- this.AQ(e);
2235
- const s = await this.NB(A, e);
2236
- this.zB.XB(s, e.filename, e.format);
2503
+ h(this, "ho");
2504
+ h(this, "co");
2505
+ h(this, "lo");
2506
+ this.ho = new ie(), this.co = new se(), this.lo = new ne();
2507
+ }
2508
+ uo(t) {
2509
+ return { format: t.format ?? "png", quality: t.quality ?? 1, scale: t.scale ?? 1, backgroundColor: t.backgroundColor ?? "transparent", filename: t.filename || this.lo.On() };
2510
+ }
2511
+ Mo(t) {
2512
+ if (!this.lo.$o(t.format)) throw Error(`Saving '${t.format}' files is not supported`);
2513
+ if (t.quality < 0 || t.quality > 1) throw Error("Image quality must be between 0.0 and 1.0");
2514
+ if (t.scale <= 0) throw Error("Scale factor must be greater than 0");
2515
+ t.format === "jpg" && t.backgroundColor === "transparent" && (t.backgroundColor = "black");
2516
+ }
2517
+ async Co(t, e) {
2518
+ if (e.scale === 1 && e.backgroundColor === "transparent") return await this.co.Co(t.canvas, e);
2519
+ const i = this.ho.yo(t, e.scale, e.backgroundColor);
2520
+ return await this.co.Co(i, e);
2521
+ }
2522
+ async bo(t, e = {}) {
2523
+ const i = this.uo(e);
2524
+ this.Mo(i);
2525
+ const s = await this.Co(t, i);
2526
+ this.lo.bo(s, i.filename, i.format);
2237
2527
  }
2238
2528
  }
2239
- const KA = (E) => class extends E {
2240
- tQ() {
2241
- this.vA.FA(this.eQ);
2529
+ const ae = (a) => class extends a {
2530
+ Fo() {
2531
+ this.xt.St(this.Ro);
2242
2532
  }
2243
- toString(A = {}) {
2244
- return this.tQ(), new H().KB({ pipeline: this.sQ, grid: this.Ri, font: this.ps }, A);
2533
+ toString(t = {}) {
2534
+ return this.Fo(), new rt().vo({ pipeline: this.zo, grid: this.rn, font: this.Si }, t);
2245
2535
  }
2246
- saveStrings(A = {}) {
2247
- this.tQ(), new H().WB({ pipeline: this.sQ, grid: this.Ri, font: this.ps }, A);
2536
+ saveStrings(t = {}) {
2537
+ this.Fo(), new rt().mo({ pipeline: this.zo, grid: this.rn, font: this.Si }, t);
2248
2538
  }
2249
- toSVG(A = {}) {
2250
- return this.tQ(), new $().OB({ pipeline: this.sQ, grid: this.Ri, font: this.ps }, A);
2539
+ toSVG(t = {}) {
2540
+ return this.Fo(), new st().fo({ pipeline: this.zo, grid: this.rn, font: this.Si }, t);
2251
2541
  }
2252
- saveSVG(A = {}) {
2253
- this.tQ(), new $().RB({ pipeline: this.sQ, grid: this.Ri, font: this.ps }, A);
2542
+ saveSVG(t = {}) {
2543
+ this.Fo(), new st().ao({ pipeline: this.zo, grid: this.rn, font: this.Si }, t);
2254
2544
  }
2255
- async saveCanvas(A = {}) {
2256
- await new HA().XB(this.Vs, A);
2545
+ async saveCanvas(t = {}) {
2546
+ await new oe().bo(this.tr, t);
2257
2547
  }
2258
- }, XA = (E) => class extends E {
2259
- async loadFont(A) {
2260
- return this.ps.Us(A).then(() => {
2261
- const t = this.ps.maxGlyphDimensions;
2262
- this.Ri.Xs(t.width, t.height), this.sQ.resize(this.Ri.cols, this.Ri.rows), this.vA.ke(), this.iQ.Xi();
2548
+ }, he = (a) => class extends a {
2549
+ async loadFont(t) {
2550
+ return this.Si.Yi(t).then(() => {
2551
+ const e = this.Si.maxGlyphDimensions;
2552
+ this.rn.rr(e.width, e.height), this.zo.resize(this.rn.cols, this.rn.rows), this.xt.Zs(), this.Po.An();
2263
2553
  });
2264
2554
  }
2265
- fontSize(A) {
2266
- if (!M._(typeof A == "number" && A > 0, "Font size must be a positive number greater than 0.", { method: "fontSize", providedValue: A }) || this.ps.fontSize === A) return;
2267
- this.ps.Ts(A);
2268
- const t = this.ps.maxGlyphDimensions;
2269
- this.Ri.Xs(t.width, t.height), this.sQ.resize(this.Ri.cols, this.Ri.rows), this.vA.ke(), this.iQ.Xi();
2555
+ fontSize(t) {
2556
+ if (!N.v(typeof t == "number" && t > 0, "Font size must be a positive number greater than 0.", { method: "fontSize", providedValue: t }) || this.Si.fontSize === t) return;
2557
+ this.Si.ji(t);
2558
+ const e = this.Si.maxGlyphDimensions;
2559
+ this.rn.rr(e.width, e.height), this.zo.resize(this.rn.cols, this.rn.rows), this.xt.Zs(), this.Po.An();
2270
2560
  }
2271
- glyphColor(A) {
2272
- return this.ps.fs(A);
2561
+ glyphColor(t) {
2562
+ return this.Si.Pi(t);
2273
2563
  }
2274
- glyphColors(A) {
2275
- return this.ps.ds(A);
2564
+ glyphColors(t) {
2565
+ return this.Si.Ti(t);
2276
2566
  }
2277
- }, JA = (E) => class extends E {
2567
+ }, ce = (a) => class extends a {
2278
2568
  get frameCount() {
2279
- return this.BQ.frameCount;
2569
+ return this.To.frameCount;
2280
2570
  }
2281
- set frameCount(A) {
2282
- this.BQ.frameCount = A;
2571
+ set frameCount(t) {
2572
+ this.To.frameCount = t;
2283
2573
  }
2284
- frameRate(A) {
2285
- return A === void 0 ? this.BQ.currentFrameRate : this.BQ.frameRate(A, () => this.QQ());
2574
+ frameRate(t) {
2575
+ return t === void 0 ? this.To.currentFrameRate : this.To.frameRate(t, () => this.So());
2286
2576
  }
2287
2577
  noLoop() {
2288
- this.BQ.pause();
2578
+ this.To.pause();
2289
2579
  }
2290
2580
  loop() {
2291
- this.BQ.resume(() => this.QQ());
2581
+ this.To.resume(() => this.So());
2292
2582
  }
2293
- redraw(A = 1) {
2294
- if (M._(typeof A == "number" && A > 0 && Number.isInteger(A), "Redraw count must be a positive integer.", { method: "redraw", providedValue: A })) for (let t = 0; t < A; t++) this.QQ();
2583
+ redraw(t = 1) {
2584
+ if (N.v(typeof t == "number" && t > 0 && Number.isInteger(t), "Redraw count must be a positive integer.", { method: "redraw", providedValue: t })) for (let e = 0; e < t; e++) this.So();
2295
2585
  }
2296
2586
  isLooping() {
2297
- return this.BQ.isLooping;
2587
+ return this.To.isLooping;
2298
2588
  }
2299
- }, ZA = (E) => class extends E {
2300
- constructor(...A) {
2301
- super(...A);
2589
+ }, le = (a) => class extends a {
2590
+ constructor(...t) {
2591
+ super(...t);
2302
2592
  }
2303
- mouseClicked(A) {
2304
- this.iQ.iB(A);
2593
+ mouseClicked(t) {
2594
+ this.Po.Fn(t);
2305
2595
  }
2306
- mousePressed(A) {
2307
- this.iQ.mi(A);
2596
+ mousePressed(t) {
2597
+ this.Po.jr(t);
2308
2598
  }
2309
- mouseReleased(A) {
2310
- this.iQ.yi(A);
2599
+ mouseReleased(t) {
2600
+ this.Po.Yr(t);
2311
2601
  }
2312
- mouseMoved(A) {
2313
- this.iQ.BB(A);
2602
+ mouseMoved(t) {
2603
+ this.Po.Rn(t);
2314
2604
  }
2315
- mouseScrolled(A) {
2316
- this.iQ.QB(A);
2605
+ mouseScrolled(t) {
2606
+ this.Po.zn(t);
2317
2607
  }
2318
2608
  get mouse() {
2319
- return this.iQ.EB();
2609
+ return this.Po.Pn();
2320
2610
  }
2321
- }, jA = (E) => class extends E {
2322
- constructor(...A) {
2323
- super(...A);
2611
+ }, ue = (a) => class extends a {
2612
+ constructor(...t) {
2613
+ super(...t);
2324
2614
  }
2325
- keyPressed(A) {
2326
- this.EQ.mi(A);
2615
+ keyPressed(t) {
2616
+ this.Eo.jr(t);
2327
2617
  }
2328
- keyReleased(A) {
2329
- this.EQ.yi(A);
2618
+ keyReleased(t) {
2619
+ this.Eo.Yr(t);
2330
2620
  }
2331
- isKeyPressed(A) {
2332
- return this.EQ.bi(A);
2621
+ isKeyPressed(t) {
2622
+ return this.Eo.qr(t);
2333
2623
  }
2334
2624
  get lastKeyPressed() {
2335
- return this.EQ.Gi();
2625
+ return this.Eo.Qr();
2336
2626
  }
2337
2627
  get lastKeyReleased() {
2338
- return this.EQ.xi();
2628
+ return this.Eo.Jr();
2339
2629
  }
2340
2630
  get pressedKeys() {
2341
- return this.EQ.Mi();
2631
+ return this.Eo.tn();
2342
2632
  }
2343
2633
  get modifierState() {
2344
- return this.EQ.Yi();
2634
+ return this.Eo.en();
2345
2635
  }
2346
2636
  };
2347
- class qA {
2637
+ class fe {
2348
2638
  constructor() {
2349
- n(this, "vA");
2350
- n(this, "ps");
2351
- n(this, "Vs");
2352
- n(this, "Ri");
2353
- n(this, "BQ");
2354
- n(this, "iQ");
2355
- n(this, "EQ");
2356
- n(this, "eQ");
2357
- n(this, "sQ");
2358
- n(this, "rQ");
2359
- }
2360
- QQ() {
2639
+ h(this, "xt");
2640
+ h(this, "Si");
2641
+ h(this, "tr");
2642
+ h(this, "rn");
2643
+ h(this, "To");
2644
+ h(this, "Po");
2645
+ h(this, "Eo");
2646
+ h(this, "Ro");
2647
+ h(this, "zo");
2648
+ h(this, "Bo");
2649
+ h(this, "Go");
2650
+ h(this, "Do");
2651
+ }
2652
+ So() {
2361
2653
  }
2362
2654
  }
2363
- class At extends function(t, ...e) {
2364
- return e.reduce((s, i) => i(s), t);
2365
- }(qA, SA, KA, XA, JA, ZA, jA) {
2366
- constructor(t = {}) {
2655
+ class de extends function(e, ...i) {
2656
+ return i.reduce((s, r) => r(s), e);
2657
+ }(fe, Kt, ae, he, ce, le, ue) {
2658
+ constructor(e = {}) {
2367
2659
  super();
2368
- n(this, "nQ", !1);
2369
- n(this, "oQ", () => {
2370
- });
2371
- n(this, "gQ", () => {
2660
+ h(this, "Lo", !1);
2661
+ h(this, "ko", () => {
2372
2662
  });
2373
- n(this, "aQ", () => {
2663
+ h(this, "Oo", () => {
2374
2664
  });
2375
- n(this, "hQ");
2376
- this.Vs = new TA(t), this.vA = new uA(this.Vs.ei()), this.ps = new bA(this.vA, t.fontSize ?? 16), this.BQ = new MA(t.frameRate ?? 60), this.iQ = new GA(this.Vs), this.EQ = new FA(), this.eQ = this.vA.YA(), this.rQ = this.vA.it(), this.cQ(t);
2377
- }
2378
- async cQ(t) {
2379
- await this.ps.zs(t.fontSource);
2380
- const e = this.ps.maxGlyphDimensions;
2381
- this.Ri = new xA(this.Vs.canvas, e.width, e.height), this.iQ.zs(this.Ri), this.sQ = this.vA.Fe(this.Ri.cols, this.Ri.rows, 5), this.lQ(), this.oQ(), this.BQ.start(() => this.QQ());
2382
- }
2383
- lQ() {
2384
- this.hQ = () => {
2385
- this.aQ();
2386
- }, window.addEventListener("resize", this.hQ), this.iQ.fi(), this.EQ.fi(), window.addEventListener("blur", () => {
2387
- this.EQ.Fi();
2665
+ h(this, "Ho", () => {
2388
2666
  });
2389
- }
2390
- QQ() {
2391
- if (this.BQ.measureFrameRate(), this.BQ.incrementFrame(), this.nQ) return;
2392
- this.sQ.begin(), this.vA.pe(this.eQ), this.gQ(), this.vA.FA(this.eQ), this.sQ.end();
2393
- const t = this.vA.state.canvasBackgroundColor;
2394
- this.vA.Wt(t[0], t[1], t[2], t[3]), this.vA.pe(this.rQ), this.rQ.VA({ a: this.ps.fontFramebuffer, b: [this.ps.textureColumns, this.ps.textureRows], c: this.sQ.textures[0], d: this.sQ.textures[1], e: this.sQ.textures[2], f: this.sQ.textures[4], g: this.sQ.textures[3], h: [this.Ri.cols, this.Ri.rows], i: [this.Ri.width, this.Ri.height], j: [this.Ri.offsetX, this.Ri.offsetY], k: this.Ri.width / this.Ri.height }), this.vA.be(this.Ri.offsetX, this.Ri.offsetY, this.Ri.width, this.Ri.height);
2395
- }
2396
- setup(t) {
2397
- this.oQ = t;
2398
- }
2399
- draw(t) {
2400
- this.gQ = t;
2401
- }
2402
- windowResized(t) {
2403
- this.aQ = t;
2404
- }
2405
- resizeCanvas(t, e) {
2406
- this.Vs.ti(t, e), this.Ri.iA(), this.sQ.resize(this.Ri.cols, this.Ri.rows), this.vA.ke(), this.iQ.Xi(), this.QQ();
2667
+ h(this, "Io");
2668
+ h(this, "hr");
2669
+ h(this, "ar", !1);
2670
+ h(this, "No");
2671
+ this.ar = e.overlay ?? !1, this.tr = new kt(e), this.xt = new St(this.tr.gr()), this.Si = new Wt(this.xt, e.fontSize ?? 16), this.To = new Yt(e.frameRate ?? 60), this.Po = new jt(this.tr), this.Eo = new Vt(), this.Ro = this.xt.Tt(), this.Bo = this.xt.re(), this.Xo(e);
2672
+ }
2673
+ async Xo(e) {
2674
+ await this.Si.Wi(e.fontSource);
2675
+ const i = this.Si.maxGlyphDimensions;
2676
+ this.rn = new Ht(this.tr.canvas, i.width, i.height), this.Po.Wi(this.rn), this.zo = this.xt.js(this.rn.cols, this.rn.rows, 5), this.Go = this.xt.js(this.rn.width, this.rn.height, 1), this.ar && (this.No = z.fromSource(this.xt, this.tr.targetCanvas, (s) => this.Si.Ti(s))), this.Do = this.xt.ae(ht, "precision mediump float;uniform sampler2D Ua;uniform vec2 Ub;uniform vec2 Uc;uniform vec2 Ud;void main(){vec2 A=gl_FragCoord.xy-Uc;vec2 B=A*(Ub/Ud);vec2 C=(floor(B)+0.5)/Ub;gl_FragColor=texture2D(Ua,C);}"), this.Wo(), this.ko(), this.To.start(() => this.So());
2677
+ }
2678
+ Wo() {
2679
+ this.Io = () => {
2680
+ this.ar && this.resizeCanvas(this.tr.width, this.tr.height), this.Ho();
2681
+ }, window.addEventListener("resize", this.Io), this.Po.Xr(), this.Eo.Xr(), window.addEventListener("blur", () => {
2682
+ this.Eo.sn();
2683
+ }), window.ResizeObserver && this.ar && (this.hr = new ResizeObserver(() => {
2684
+ this.resizeCanvas(this.tr.targetCanvas.width, this.tr.targetCanvas.height);
2685
+ }), this.hr.observe(this.tr.targetCanvas));
2686
+ }
2687
+ So() {
2688
+ if (this.To.measureFrameRate(), this.To.incrementFrame(), this.Lo) return;
2689
+ if (this.ar) {
2690
+ const i = this.xt.context;
2691
+ i.bindTexture(i.TEXTURE_2D, this.No.texture), i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL, 1), i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, i.RGBA, i.UNSIGNED_BYTE, this.tr.targetCanvas), i.bindTexture(i.TEXTURE_2D, null), this.zo.begin(), this.xt.Hs(this.No, 0, 0, this.rn.cols, this.rn.rows), this.xt.Ds(this.Ro), this.Oo(), this.xt.St(this.Ro), this.zo.end();
2692
+ } else this.zo.begin(), this.xt.Ds(this.Ro), this.Oo(), this.xt.St(this.Ro), this.zo.end();
2693
+ this.Go.begin(), this.xt.Ds(this.Bo), this.Bo.Vt({ U0: this.Si.fontFramebuffer, U1: [this.Si.textureColumns, this.Si.textureRows], U2: this.zo.textures[0], U3: this.zo.textures[1], U4: this.zo.textures[2], U5: this.zo.textures[4], U6: this.zo.textures[3], U7: [this.rn.cols, this.rn.rows], U8: [this.Go.width, this.Go.height], U9: this.Go.width / this.Go.height }), this.xt.Is(0, 0, this.tr.width, this.tr.height), this.Go.end();
2694
+ const e = this.xt.state.canvasBackgroundColor;
2695
+ this.xt.Ne(e[0], e[1], e[2], e[3]), this.xt.Ds(this.Do), this.Do.Vt({ Ua: this.Go.textures[0], Ub: [this.Go.width, this.Go.height], Uc: [this.rn.offsetX, this.rn.offsetY], Ud: [this.rn.width, this.rn.height] }), this.xt.Is(this.rn.offsetX, this.rn.offsetY, this.rn.width, this.rn.height);
2696
+ }
2697
+ setup(e) {
2698
+ this.ko = e;
2699
+ }
2700
+ draw(e) {
2701
+ this.Oo = e;
2702
+ }
2703
+ windowResized(e) {
2704
+ this.Ho = e;
2705
+ }
2706
+ resizeCanvas(e, i) {
2707
+ this.tr.mr(e, i), this.rn.ir(), this.zo.resize(this.rn.cols, this.rn.rows), this.Go.resize(this.rn.width, this.rn.height), this.xt.Zs(), this.Po.An(), this.So();
2407
2708
  }
2408
2709
  destroy() {
2409
- this.nQ || (this.BQ.stop(), window.removeEventListener("resize", this.hQ), this.iQ._i(), this.EQ._i(), this.ps.kA(), this.vA.kA(), this.nQ = !0);
2710
+ this.Lo || (this.To.stop(), window.removeEventListener("resize", this.Io), this.Po.Kr(), this.Eo.Kr(), this.Si.Gt(), this.xt.Gt(), this.Go.Gt(), this.Do.Gt(), this.No && this.No.Gt(), this.Lo = !0);
2410
2711
  }
2411
2712
  get grid() {
2412
- return this.Ri;
2713
+ return this.rn;
2413
2714
  }
2414
2715
  get font() {
2415
- return this.ps;
2716
+ return this.Si;
2416
2717
  }
2417
2718
  get width() {
2418
- return this.Vs.width;
2719
+ return this.tr.width;
2419
2720
  }
2420
2721
  get height() {
2421
- return this.Vs.height;
2722
+ return this.tr.height;
2422
2723
  }
2423
2724
  get canvas() {
2424
- return this.Vs.canvas;
2725
+ return this.tr.canvas;
2425
2726
  }
2426
2727
  get isDisposed() {
2427
- return this.nQ;
2728
+ return this.Lo;
2428
2729
  }
2429
- get drawFramebuffer() {
2430
- return this.sQ;
2730
+ get overlay() {
2731
+ return this.No;
2431
2732
  }
2432
2733
  }
2433
- class k {
2734
+ class Q {
2434
2735
  constructor() {
2435
2736
  }
2436
- static create(A = {}) {
2437
- return new At(A);
2737
+ static create(t = {}) {
2738
+ return new de(t);
2438
2739
  }
2439
- static setErrorLevel(A) {
2440
- M.v(A);
2740
+ static setErrorLevel(t) {
2741
+ N.A(t);
2441
2742
  }
2442
2743
  static get version() {
2443
- return "0.2.1-beta.4";
2744
+ return "0.2.1-beta.6";
2444
2745
  }
2445
2746
  }
2446
- const et = Object.freeze(Object.defineProperty({ __proto__: null }, Symbol.toStringTag, { value: "Module" })), st = k.create, it = k.setErrorLevel, Bt = k.version;
2747
+ const pe = Object.freeze(Object.defineProperty({ __proto__: null }, Symbol.toStringTag, { value: "Module" })), me = Q.create, ve = Q.setErrorLevel, Ae = Q.version;
2447
2748
  export {
2448
- TA as TextmodeCanvas,
2449
- tA as TextmodeErrorLevel,
2450
- bA as TextmodeFont,
2451
- U as TextmodeFramebuffer,
2452
- xA as TextmodeGrid,
2453
- At as Textmodifier,
2454
- st as create,
2455
- et as export,
2456
- it as setErrorLevel,
2457
- k as textmode,
2458
- Bt as version
2749
+ kt as TextmodeCanvas,
2750
+ ut as TextmodeErrorLevel,
2751
+ Wt as TextmodeFont,
2752
+ q as TextmodeFramebuffer,
2753
+ Ht as TextmodeGrid,
2754
+ z as TextmodeImage,
2755
+ de as Textmodifier,
2756
+ me as create,
2757
+ pe as export,
2758
+ ve as setErrorLevel,
2759
+ Q as textmode,
2760
+ Ae as version
2459
2761
  };