textmode.js 0.2.1-beta.1 → 0.2.1-beta.3

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