textmode.js 0.1.9 → 0.2.0-beta.2

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 (63) hide show
  1. package/README.md +4 -4
  2. package/dist/textmode.esm.js +1418 -1481
  3. package/dist/textmode.esm.min.js +1500 -1563
  4. package/dist/textmode.umd.js +19 -56
  5. package/dist/textmode.umd.min.js +20 -57
  6. package/dist/types/Textmode.d.ts +10 -38
  7. package/dist/types/export/base/DataExtractor.d.ts +3 -3
  8. package/dist/types/export/image/ImageExporter.d.ts +4 -11
  9. package/dist/types/export/image/types.d.ts +2 -3
  10. package/dist/types/export/svg/SVGExporter.d.ts +1 -1
  11. package/dist/types/export/svg/types.d.ts +1 -0
  12. package/dist/types/export/txt/TXTExporter.d.ts +1 -1
  13. package/dist/types/export/txt/types.d.ts +2 -2
  14. package/dist/types/index.d.ts +1 -7
  15. package/dist/types/rendering/index.d.ts +0 -1
  16. package/dist/types/rendering/webgl/DrawQueue.d.ts +26 -0
  17. package/dist/types/rendering/webgl/Framebuffer.d.ts +41 -40
  18. package/dist/types/rendering/webgl/InstanceBatch.d.ts +91 -0
  19. package/dist/types/rendering/webgl/InstanceData.d.ts +65 -0
  20. package/dist/types/rendering/webgl/RenderPipeline.d.ts +15 -0
  21. package/dist/types/rendering/webgl/RenderState.d.ts +71 -0
  22. package/dist/types/rendering/webgl/Renderer.d.ts +54 -81
  23. package/dist/types/rendering/webgl/Shader.d.ts +11 -16
  24. package/dist/types/rendering/webgl/VAOManager.d.ts +15 -0
  25. package/dist/types/rendering/webgl/geometries/Arc.d.ts +16 -0
  26. package/dist/types/rendering/webgl/geometries/BaseGeometry.d.ts +35 -29
  27. package/dist/types/rendering/webgl/geometries/BezierCurve.d.ts +22 -0
  28. package/dist/types/rendering/webgl/geometries/Ellipse.d.ts +20 -0
  29. package/dist/types/rendering/webgl/geometries/Line.d.ts +13 -4
  30. package/dist/types/rendering/webgl/geometries/Rectangle.d.ts +13 -8
  31. package/dist/types/rendering/webgl/geometries/Triangle.d.ts +20 -0
  32. package/dist/types/rendering/webgl/geometries/index.d.ts +4 -1
  33. package/dist/types/rendering/webgl/index.d.ts +17 -1
  34. package/dist/types/rendering/webgl/types/DrawCommand.d.ts +9 -0
  35. package/dist/types/rendering/webgl/types/GeometryTypes.d.ts +144 -0
  36. package/dist/types/rendering/webgl/types/RenderTypes.d.ts +12 -0
  37. package/dist/types/textmode/AnimationController.d.ts +81 -0
  38. package/dist/types/textmode/Canvas.d.ts +18 -19
  39. package/dist/types/textmode/Grid.d.ts +1 -34
  40. package/dist/types/textmode/Textmodifier.d.ts +36 -277
  41. package/dist/types/textmode/font/CharacterColorMapper.d.ts +3 -3
  42. package/dist/types/textmode/font/TextmodeFont.d.ts +6 -11
  43. package/dist/types/textmode/font/types.d.ts +1 -1
  44. package/dist/types/textmode/font/typr/types.d.ts +1 -1
  45. package/dist/types/textmode/font/utils/index.d.ts +0 -1
  46. package/dist/types/textmode/mixins/AnimationMixin.d.ts +120 -0
  47. package/dist/types/textmode/mixins/ExportMixin.d.ts +4 -6
  48. package/dist/types/textmode/mixins/FontMixin.d.ts +4 -10
  49. package/dist/types/textmode/mixins/RenderingMixin.d.ts +224 -246
  50. package/dist/types/textmode/mixins/TextmodifierMixin.d.ts +13 -4
  51. package/dist/types/textmode/mixins/index.d.ts +2 -2
  52. package/package.json +1 -1
  53. package/dist/types/ColorPalette.d.ts +0 -35
  54. package/dist/types/rendering/core/Framebuffer.d.ts +0 -140
  55. package/dist/types/rendering/core/Shader.d.ts +0 -59
  56. package/dist/types/rendering/core/index.d.ts +0 -2
  57. package/dist/types/textmode/ConversionPipeline.d.ts +0 -110
  58. package/dist/types/textmode/converters/BrightnessConverter.d.ts +0 -58
  59. package/dist/types/textmode/converters/Converter.d.ts +0 -69
  60. package/dist/types/textmode/converters/FeatureConverter.d.ts +0 -128
  61. package/dist/types/textmode/converters/index.d.ts +0 -3
  62. package/dist/types/textmode/font/utils/FontConstants.d.ts +0 -60
  63. package/dist/types/textmode/mixins/ConversionMixin.d.ts +0 -62
@@ -1,9 +1,9 @@
1
- var sA = Object.defineProperty;
2
- var rA = (o, A, t) => A in o ? sA(o, A, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[A] = t;
3
- var E = (o, A, t) => rA(o, typeof A != "symbol" ? A + "" : A, t);
4
- class I extends Error {
1
+ var J = Object.defineProperty;
2
+ var X = (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) => X(E, typeof A != "symbol" ? A + "" : A, t);
4
+ class f extends Error {
5
5
  constructor(A, t = {}) {
6
- super(I.A(A, t)), this.name = "TextmodeError";
6
+ super(f.A(A, t)), this.name = "TextmodeError";
7
7
  }
8
8
  static A(A, t) {
9
9
  let e = A;
@@ -11,9 +11,9 @@ class I extends Error {
11
11
  e += `
12
12
 
13
13
  📋 Context:`;
14
- for (const [s, r] of Object.entries(t))
14
+ for (const [B, r] of Object.entries(t))
15
15
  e += `
16
- - ${s}: ${I.i(r)}`;
16
+ - ${B}: ${f.i(r)}`;
17
17
  }
18
18
  return e += `
19
19
 
@@ -25,1631 +25,1632 @@ class I extends Error {
25
25
  if (A === void 0) return "undefined";
26
26
  if (typeof A == "string") return `"${A}"`;
27
27
  if (typeof A == "number" || typeof A == "boolean") return A + "";
28
- if (Array.isArray(A)) return A.length === 0 ? "[]" : A.length <= 5 ? `[${A.map((t) => I.i(t)).join(", ")}]` : `[${A.slice(0, 3).map((t) => I.i(t)).join(", ")}, ... +${A.length - 3} more]`;
28
+ if (Array.isArray(A)) return A.length === 0 ? "[]" : A.length <= 5 ? `[${A.map((t) => f.i(t)).join(", ")}]` : `[${A.slice(0, 3).map((t) => f.i(t)).join(", ")}, ... +${A.length - 3} more]`;
29
29
  if (typeof A == "object") {
30
30
  const t = Object.keys(A);
31
- return t.length === 0 ? "{}" : t.length <= 3 ? `{ ${t.map((e) => `${e}: ${I.i(A[e])}`).join(", ")} }` : `{ ${t.slice(0, 2).map((e) => `${e}: ${I.i(A[e])}`).join(", ")}, ... +${t.length - 2} more }`;
31
+ return t.length === 0 ? "{}" : t.length <= 3 ? `{ ${t.map((e) => `${e}: ${f.i(A[e])}`).join(", ")} }` : `{ ${t.slice(0, 2).map((e) => `${e}: ${f.i(A[e])}`).join(", ")}, ... +${t.length - 2} more }`;
32
32
  }
33
33
  return A + "";
34
34
  }
35
35
  }
36
- var iA = ((o) => (o[o.SILENT = 0] = "SILENT", o[o.WARNING = 1] = "WARNING", o[o.ERROR = 2] = "ERROR", o[o.THROW = 3] = "THROW", o))(iA || {});
37
- const v = class v {
36
+ var j = ((E) => (E[E.SILENT = 0] = "SILENT", E[E.WARNING = 1] = "WARNING", E[E.ERROR = 2] = "ERROR", E[E.THROW = 3] = "THROW", E))(j || {});
37
+ const x = class x {
38
38
  constructor() {
39
- E(this, "h", { globalLevel: 3 });
39
+ n(this, "h", { globalLevel: 3 });
40
40
  }
41
- static l() {
42
- return v.o || (v.o = new v()), v.o;
41
+ static C() {
42
+ return x.o || (x.o = new x()), x.o;
43
43
  }
44
44
  D(A, t) {
45
- 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;";
45
+ const e = "%c[textmode.js] Oops! (╯°□°)╯︵ Something went wrong in your code.", B = "color: #f44336; font-weight: bold; background: #ffebee; padding: 2px 6px; border-radius: 3px;";
46
46
  switch (this.h.globalLevel) {
47
47
  case 0:
48
48
  return !1;
49
49
  case 1:
50
- return console.group(e, s), console.warn(I.A(A, t)), console.groupEnd(), !1;
50
+ return console.group(e, B), console.warn(f.A(A, t)), console.groupEnd(), !1;
51
51
  case 2:
52
- return console.group(e, s), console.error(I.A(A, t)), console.groupEnd(), !1;
52
+ return console.group(e, B), console.error(f.A(A, t)), console.groupEnd(), !1;
53
53
  default:
54
- throw new I(A, t);
54
+ throw new f(A, t);
55
55
  }
56
56
  }
57
- C(A, t, e) {
57
+ l(A, t, e) {
58
58
  return !!A || (this.D(t, e), !1);
59
59
  }
60
- u(A) {
60
+ P(A) {
61
61
  this.h.globalLevel = A;
62
62
  }
63
63
  };
64
- E(v, "o", null);
65
- let U = v;
66
- const D = U.l(), j = /* @__PURE__ */ new WeakMap();
67
- function F(o, A) {
68
- j.set(o, A);
64
+ n(x, "o", null);
65
+ let S = x;
66
+ const T = S.C(), H = /* @__PURE__ */ new WeakMap();
67
+ function M(E, A) {
68
+ H.set(E, A);
69
69
  }
70
- function J(o) {
71
- return j.get(o);
70
+ function G(E) {
71
+ return H.get(E);
72
72
  }
73
- class X {
74
- constructor(A, t = A, e = {}) {
75
- E(this, "P");
76
- E(this, "I");
77
- E(this, "h");
78
- E(this, "m", null);
79
- this.P = A, this.I = t, this.h = { filter: "nearest", wrap: "clamp", format: "rgba", type: "unsigned_byte", ...e };
73
+ class K {
74
+ constructor(A, t, e = t, B = 1, r = {}) {
75
+ n(this, "I");
76
+ n(this, "u");
77
+ n(this, "h");
78
+ n(this, "p", null);
79
+ n(this, "m");
80
+ n(this, "_");
81
+ n(this, "v", []);
82
+ n(this, "G");
83
+ n(this, "$", null);
84
+ n(this, "M", []);
85
+ this.I = t, this.u = e, this.h = { filter: "nearest", wrap: "clamp", format: "rgba", type: "unsigned_byte", ...r }, this.m = A, this.G = Math.min(Math.max(1, B), 8);
86
+ const i = A.getParameter(A.MAX_DRAW_BUFFERS), s = A.getParameter(A.MAX_COLOR_ATTACHMENTS);
87
+ this.G = Math.min(this.G, i, s), this._ = A.createFramebuffer(), this.Y(), this.F(), this.M = Array(this.G).fill(null);
80
88
  }
81
- get width() {
82
- return this.P;
83
- }
84
- get height() {
85
- return this.I;
86
- }
87
- get pixels() {
88
- return this.m;
89
- }
90
- get options() {
91
- return { ...this.h };
89
+ Y() {
90
+ const A = this.m, t = this.h.filter === "linear" ? A.LINEAR : A.NEAREST, e = this.h.wrap === "repeat" ? A.REPEAT : A.CLAMP_TO_EDGE, B = this.h.type === "float" ? A.FLOAT : A.UNSIGNED_BYTE;
91
+ for (let r = 0; r < this.G; r++) {
92
+ const i = A.createTexture();
93
+ A.bindTexture(A.TEXTURE_2D, i), 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.u, 0, A.RGBA, B, null), this.v.push(i);
94
+ }
95
+ A.bindTexture(A.TEXTURE_2D, null);
92
96
  }
93
- validateCoordinates(A, t, e = !0) {
94
- return (A < 0 || t < 0 || A >= this.P || t >= this.I) && e && console.warn("The x and y values passed to Framebuffer.get are outside of its range and will be clamped."), [Math.max(0, Math.min(A, this.P - 1)), Math.max(0, Math.min(t, this.I - 1))];
97
+ F() {
98
+ const A = this.m;
99
+ if (A.bindFramebuffer(A.FRAMEBUFFER, this._), this.G === 1) A.framebufferTexture2D(A.FRAMEBUFFER, A.COLOR_ATTACHMENT0, A.TEXTURE_2D, this.v[0], 0);
100
+ else {
101
+ const e = [];
102
+ for (let B = 0; B < this.G; B++) {
103
+ const r = A.COLOR_ATTACHMENT0 + B;
104
+ A.framebufferTexture2D(A.FRAMEBUFFER, r, A.TEXTURE_2D, this.v[B], 0), e.push(r);
105
+ }
106
+ A.drawBuffers(e);
107
+ }
108
+ const t = A.checkFramebufferStatus(A.FRAMEBUFFER);
109
+ t !== A.FRAMEBUFFER_COMPLETE && console.error("GLFramebuffer is not complete:", t), A.bindFramebuffer(A.FRAMEBUFFER, null);
110
+ }
111
+ R(A) {
112
+ const t = this.m;
113
+ t.bindTexture(t.TEXTURE_2D, this.v[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
+ }
115
+ S(A, t) {
116
+ this.I = A, this.u = t, this.p = null, this.M = Array(this.G).fill(null);
117
+ const e = this.m, B = this.h.type === "float" ? e.FLOAT : e.UNSIGNED_BYTE;
118
+ for (const r of this.v) e.bindTexture(e.TEXTURE_2D, r), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, this.I, this.u, 0, e.RGBA, B, null);
119
+ e.bindTexture(e.TEXTURE_2D, null);
120
+ }
121
+ O(A) {
122
+ const t = this.m;
123
+ if (A < 0 || A >= this.G) throw Error(`GLFramebuffer: attachment index ${A} out of range (count=${this.G})`);
124
+ const e = this.M[A];
125
+ if (e) return e;
126
+ const B = this.I, r = this.u, i = new Uint8Array(B * r * 4), s = t.getParameter(t.READ_FRAMEBUFFER_BINDING);
127
+ t.bindFramebuffer(t.READ_FRAMEBUFFER, this._), t.readBuffer(t.COLOR_ATTACHMENT0 + A), t.readPixels(0, 0, B, r, t.RGBA, t.UNSIGNED_BYTE, i), t.bindFramebuffer(t.READ_FRAMEBUFFER, s);
128
+ const Q = 4 * B, o = new Uint8Array(i.length);
129
+ for (let g = 0; g < r; g++) {
130
+ const a = (r - 1 - g) * Q, h = g * Q;
131
+ o.set(i.subarray(a, a + Q), h);
132
+ }
133
+ return this.M[A] = o, o;
95
134
  }
96
- validateRegion(A, t, e, s) {
97
- return [A = Math.max(0, Math.min(A, this.P - 1)), t = Math.max(0, Math.min(t, this.I - 1)), e = Math.max(1, Math.min(e, this.P - A)), s = Math.max(1, Math.min(s, this.I - t))];
135
+ L() {
136
+ for (let A = 0; A < this.G; A++) this.O(A);
98
137
  }
99
- updateDimensions(A, t) {
100
- this.P = A, this.I = t, this.m = null;
138
+ U() {
139
+ const A = this.m;
140
+ this.$ = { framebuffer: A.getParameter(A.FRAMEBUFFER_BINDING), viewport: A.getParameter(A.VIEWPORT) }, A.bindFramebuffer(A.FRAMEBUFFER, this._), this.M = Array(this.G).fill(null);
141
+ for (let t = 0; t < this.G; t++) A.clearBufferfv(A.COLOR, t, new Float32Array([0, 0, 0, 0]));
142
+ A.viewport(0, 0, this.I, this.u), M(A, [0, 0, this.I, this.u]);
101
143
  }
102
- }
103
- class K extends X {
104
- constructor(t, e, s = e, r = {}) {
105
- super(e, s, r);
106
- E(this, "p");
107
- E(this, "_");
108
- E(this, "v");
109
- E(this, "M", null);
110
- this.p = t, this.v = this.G(), this._ = t.createFramebuffer(), this.F();
111
- }
112
- $(t) {
113
- const { p: e } = this, s = e.getParameter(e.FRAMEBUFFER_BINDING);
114
- e.bindFramebuffer(e.FRAMEBUFFER, this._);
115
- try {
116
- return t();
117
- } finally {
118
- e.bindFramebuffer(e.FRAMEBUFFER, s);
119
- }
144
+ k() {
145
+ if (!this.$) return;
146
+ const A = this.m;
147
+ A.bindFramebuffer(A.FRAMEBUFFER, this.$.framebuffer), A.viewport(...this.$.viewport), M(A, this.$.viewport), this.$ = null;
120
148
  }
121
- G() {
122
- const { p: t } = this, e = t.createTexture();
123
- t.bindTexture(t.TEXTURE_2D, e);
124
- const s = this.h.filter === "linear" ? t.LINEAR : t.NEAREST, r = this.h.wrap === "repeat" ? t.REPEAT : t.CLAMP_TO_EDGE;
125
- return t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, s), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, s), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, r), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, r), this.Y(), e;
149
+ W() {
150
+ const A = this.m;
151
+ this._ && A.deleteFramebuffer(this._);
152
+ for (const t of this.v) A.deleteTexture(t);
153
+ this.v = [], this.M = [];
126
154
  }
127
- Y() {
128
- const { p: t } = this, e = this.h.type === "float" ? t.FLOAT : t.UNSIGNED_BYTE;
129
- t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, this.P, this.I, 0, t.RGBA, e, null);
155
+ get width() {
156
+ return this.I;
130
157
  }
131
- F() {
132
- const { p: t } = this;
133
- t.bindFramebuffer(t.FRAMEBUFFER, this._), t.framebufferTexture2D(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, this.v, 0), t.bindFramebuffer(t.FRAMEBUFFER, null);
134
- }
135
- S(t) {
136
- const { p: e } = this;
137
- e.bindTexture(e.TEXTURE_2D, this.v), e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, 1), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, e.RGBA, e.UNSIGNED_BYTE, t), e.bindTexture(e.TEXTURE_2D, null);
138
- }
139
- updatePixels(t, e, s) {
140
- const { p: r } = this;
141
- r.bindTexture(r.TEXTURE_2D, this.v), r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, e, s, 0, r.RGBA, r.UNSIGNED_BYTE, t), r.bindTexture(r.TEXTURE_2D, null);
142
- }
143
- resize(t, e) {
144
- const { p: s } = this;
145
- this.updateDimensions(t, e), s.bindTexture(s.TEXTURE_2D, this.v), this.Y(), s.bindTexture(s.TEXTURE_2D, null);
146
- }
147
- begin() {
148
- const { p: t } = this;
149
- this.M = { framebuffer: t.getParameter(t.FRAMEBUFFER_BINDING), viewport: t.getParameter(t.VIEWPORT) }, t.bindFramebuffer(t.FRAMEBUFFER, this._), t.viewport(0, 0, this.P, this.I), F(t, [0, 0, this.P, this.I]);
150
- }
151
- end() {
152
- if (!this.M) return;
153
- const { p: t } = this;
154
- t.bindFramebuffer(t.FRAMEBUFFER, this.M.framebuffer), t.viewport(...this.M.viewport), F(t, this.M.viewport), this.M = null;
155
- }
156
- loadPixels() {
157
- const { p: t } = this;
158
- this.m || (this.m = new Uint8Array(this.P * this.I * 4)), this.$(() => {
159
- t.readPixels(0, 0, this.P, this.I, t.RGBA, t.UNSIGNED_BYTE, this.m);
160
- });
158
+ get height() {
159
+ return this.u;
161
160
  }
162
- get(t, e, s, r) {
163
- const { p: i } = this;
164
- if (t === void 0 && e === void 0) {
165
- const B = new Uint8Array(this.P * this.I * 4);
166
- return this.$(() => (i.readPixels(0, 0, this.P, this.I, i.RGBA, i.UNSIGNED_BYTE, B), B));
167
- }
168
- if (s === void 0 && r === void 0) {
169
- const [B, Q] = this.validateCoordinates(t, e), n = new Uint8Array(4);
170
- return this.$(() => (i.readPixels(B, Q, 1, 1, i.RGBA, i.UNSIGNED_BYTE, n), [n[0], n[1], n[2], n[3]]));
171
- }
172
- {
173
- const [B, Q, n, g] = this.validateRegion(t, e, s, r), a = new Uint8Array(n * g * 4);
174
- return this.$(() => (i.readPixels(B, Q, n, g, i.RGBA, i.UNSIGNED_BYTE, a), a));
175
- }
161
+ get pixels() {
162
+ return this.p;
176
163
  }
177
- O() {
178
- this._ && this.p.deleteFramebuffer(this._), this.v && this.p.deleteTexture(this.v);
164
+ get options() {
165
+ return { ...this.h };
179
166
  }
180
167
  get framebuffer() {
181
168
  return this._;
182
169
  }
183
170
  get texture() {
184
- return this.v;
171
+ return this.v[0];
185
172
  }
186
- }
187
- class q {
188
- constructor() {
189
- E(this, "U", !1);
173
+ get textures() {
174
+ return [...this.v];
190
175
  }
191
- get isReady() {
192
- return this.U;
176
+ get attachmentCount() {
177
+ return this.G;
193
178
  }
194
- setUniforms(A) {
195
- for (const [t, e] of Object.entries(A)) this.setUniform(t, e);
179
+ getAttachmentPixels(A) {
180
+ return this.M[A] ?? null;
196
181
  }
197
182
  }
198
- class p extends q {
199
- constructor(t, e, s) {
200
- super();
201
- E(this, "p");
202
- E(this, "R");
203
- E(this, "k", /* @__PURE__ */ new Map());
204
- E(this, "V", /* @__PURE__ */ new Map());
205
- E(this, "H", 0);
206
- E(this, "L");
207
- this.p = t, this.R = this.J(e, s), this.L = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS), this.j(), this.U = !0;
208
- }
209
- static fromSource(t, e) {
210
- return new p(t, e.vertex, e.fragment);
211
- }
212
- j() {
213
- const t = this.p.getProgramParameter(this.R, this.p.ACTIVE_UNIFORMS);
214
- for (let e = 0; e < t; e++) {
215
- const s = this.p.getActiveUniform(this.R, e);
216
- if (s) {
217
- const r = this.p.getUniformLocation(this.R, s.name);
218
- r && (this.k.set(s.name, r), this.V.set(s.name, s.type));
183
+ class Z {
184
+ constructor(A, t, e) {
185
+ n(this, "m");
186
+ n(this, "H");
187
+ n(this, "J", /* @__PURE__ */ new Map());
188
+ n(this, "V", /* @__PURE__ */ new Map());
189
+ n(this, "K", 0);
190
+ n(this, "j");
191
+ this.m = A, this.H = this.Z(t, e), this.j = A.getParameter(A.MAX_TEXTURE_IMAGE_UNITS), this.N();
192
+ }
193
+ N() {
194
+ const A = this.m.getProgramParameter(this.H, this.m.ACTIVE_UNIFORMS);
195
+ for (let t = 0; t < A; t++) {
196
+ const e = this.m.getActiveUniform(this.H, t);
197
+ if (e) {
198
+ const B = this.m.getUniformLocation(this.H, e.name);
199
+ B && (this.J.set(e.name, B), this.V.set(e.name, e.type));
219
200
  }
220
201
  }
221
202
  }
222
- J(t, e) {
223
- const s = this.K(this.p.VERTEX_SHADER, t), r = this.K(this.p.FRAGMENT_SHADER, e), i = this.p.createProgram();
224
- if (this.p.attachShader(i, s), this.p.attachShader(i, r), this.p.linkProgram(i), !this.p.getProgramParameter(i, this.p.LINK_STATUS)) {
225
- const B = this.p.getProgramInfoLog(i);
226
- throw Error("Shader program link error: " + B);
203
+ Z(A, t) {
204
+ const e = this.X(this.m.VERTEX_SHADER, A), B = this.X(this.m.FRAGMENT_SHADER, t), r = this.m.createProgram();
205
+ if (this.m.attachShader(r, e), this.m.attachShader(r, B), this.m.linkProgram(r), !this.m.getProgramParameter(r, this.m.LINK_STATUS)) {
206
+ const i = this.m.getProgramInfoLog(r);
207
+ throw Error("Shader program link error: " + i);
227
208
  }
228
- return this.p.deleteShader(s), this.p.deleteShader(r), i;
209
+ return this.m.deleteShader(e), this.m.deleteShader(B), r;
229
210
  }
230
- K(t, e) {
231
- const s = this.p.createShader(t);
232
- if (this.p.shaderSource(s, e), this.p.compileShader(s), !this.p.getShaderParameter(s, this.p.COMPILE_STATUS)) {
233
- const r = this.p.getShaderInfoLog(s);
234
- throw this.p.deleteShader(s), Error("Shader compilation error: " + r);
211
+ X(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 B = this.m.getShaderInfoLog(e);
215
+ throw this.m.deleteShader(e), Error("Shader compilation error: " + B);
235
216
  }
236
- return s;
217
+ return e;
237
218
  }
238
- W() {
239
- this.p.useProgram(this.R), this.N();
219
+ q() {
220
+ this.m.useProgram(this.H), this.AA();
240
221
  }
241
- N() {
242
- this.H = 0;
243
- }
244
- setUniform(t, e) {
245
- const s = this.k.get(t);
246
- if (s) if (typeof e == "number")
247
- this.Z(t) ? this.p.uniform1i(s, Math.floor(e)) : this.p.uniform1f(s, e);
248
- else if (typeof e == "boolean") this.p.uniform1i(s, e ? 1 : 0);
249
- else if (Array.isArray(e)) switch (e.length) {
222
+ AA() {
223
+ this.K = 0;
224
+ }
225
+ tA(A) {
226
+ for (const [t, e] of Object.entries(A)) this.eA(t, e);
227
+ }
228
+ eA(A, t) {
229
+ const e = this.J.get(A);
230
+ if (e) if (typeof t == "number") this.m.uniform1f(e, t);
231
+ else if (typeof t == "boolean") this.m.uniform1i(e, t ? 1 : 0);
232
+ else if (Array.isArray(t)) switch (t.length) {
250
233
  case 2:
251
- this.p.uniform2f(s, e[0], e[1]);
234
+ this.m.uniform2f(e, t[0], t[1]);
252
235
  break;
253
236
  case 3:
254
- this.p.uniform3f(s, e[0], e[1], e[2]);
237
+ this.m.uniform3f(e, t[0], t[1], t[2]);
255
238
  break;
256
239
  case 4:
257
- this.p.uniform4f(s, e[0], e[1], e[2], e[3]);
240
+ this.m.uniform4f(e, t[0], t[1], t[2], t[3]);
258
241
  break;
259
242
  default:
260
- console.warn(`Unsupported array length ${e.length} for uniform '${t}'`);
243
+ console.warn(`Unsupported array length ${t.length} for uniform '${A}'`);
261
244
  }
262
- else if (e instanceof WebGLTexture) {
263
- const r = this.X();
264
- this.p.uniform1i(s, r), this.p.activeTexture(this.p.TEXTURE0 + r), this.p.bindTexture(this.p.TEXTURE_2D, e);
265
- } else if (e instanceof K) {
266
- const r = this.X();
267
- this.p.uniform1i(s, r), this.p.activeTexture(this.p.TEXTURE0 + r), this.p.bindTexture(this.p.TEXTURE_2D, e.texture);
268
- } else if (typeof e == "object" && "texture" in e) {
269
- const r = this.X();
270
- this.p.uniform1i(s, r), this.p.activeTexture(this.p.TEXTURE0 + r), this.p.bindTexture(this.p.TEXTURE_2D, e.texture);
271
- } else console.warn(`Unsupported uniform type for '${t}':`, typeof e);
272
- }
273
- X() {
274
- return this.H >= this.L && console.warn(`Exceeded maximum texture units (${this.L}). Texture may not render correctly.`), this.H++;
275
- }
276
- Z(t) {
277
- const e = this.V.get(t);
278
- return !!e && (e === this.p.INT || e === this.p.INT_VEC2 || e === this.p.INT_VEC3 || e === this.p.INT_VEC4 || e === this.p.SAMPLER_2D || e === this.p.SAMPLER_CUBE);
279
- }
280
- get glProgram() {
281
- return this.R;
282
- }
283
- O() {
284
- this.p.deleteProgram(this.R);
245
+ else if (t instanceof WebGLTexture) {
246
+ const B = this.BA();
247
+ this.m.uniform1i(e, B), this.m.activeTexture(this.m.TEXTURE0 + B), this.m.bindTexture(this.m.TEXTURE_2D, t);
248
+ } else if (t instanceof K) {
249
+ const B = this.BA();
250
+ this.m.uniform1i(e, B), this.m.activeTexture(this.m.TEXTURE0 + B), this.m.bindTexture(this.m.TEXTURE_2D, t.texture);
251
+ } else if (typeof t == "object" && "texture" in t) {
252
+ const B = this.BA();
253
+ this.m.uniform1i(e, B), this.m.activeTexture(this.m.TEXTURE0 + B), this.m.bindTexture(this.m.TEXTURE_2D, t.texture);
254
+ } else console.warn(`Unsupported uniform type for '${A}':`, typeof t);
255
+ }
256
+ BA() {
257
+ return this.K >= this.j && console.warn(`Exceeded maximum texture units (${this.j}). Texture may not render correctly.`), this.K++;
258
+ }
259
+ get QA() {
260
+ return this.H;
261
+ }
262
+ W() {
263
+ this.m.deleteProgram(this.H);
285
264
  }
286
265
  }
287
- class AA {
288
- constructor(A) {
289
- E(this, "p");
290
- E(this, "q", null);
291
- E(this, "AA", 16);
292
- E(this, "tA", /* @__PURE__ */ new Map());
293
- this.p = A;
294
- }
295
- eA() {
296
- if (this.q) return;
297
- const A = this.p;
298
- this.q = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, this.q);
299
- }
300
- sA() {
301
- const A = this.p, t = A.getParameter(A.CURRENT_PROGRAM);
302
- let e = this.tA.get(t);
303
- return e || (e = { a_position: A.getAttribLocation(t, "a_position"), a_texCoord: A.getAttribLocation(t, "a_texCoord") }, this.tA.set(t, e)), A.enableVertexAttribArray(e.a_position), A.vertexAttribPointer(e.a_position, 2, A.FLOAT, !1, this.AA, 0), A.enableVertexAttribArray(e.a_texCoord), A.vertexAttribPointer(e.a_texCoord, 2, A.FLOAT, !1, this.AA, 8), { positionLoc: e.a_position, texLoc: e.a_texCoord };
304
- }
305
- rA(A, t) {
306
- const e = this.p;
307
- e.disableVertexAttribArray(A), e.disableVertexAttribArray(t);
308
- }
309
- BA(A, t) {
310
- const e = this.p, s = J(e) || [0, 0, e.canvas.width, e.canvas.height];
311
- return { nx: A / s[2] * 2 - 1, ny: 1 - t / s[3] * 2 };
312
- }
313
- iA(A, t, e, s) {
314
- const r = this.p;
315
- this.eA(), r.bindBuffer(r.ARRAY_BUFFER, this.q);
316
- const i = new Float32Array([A, s, 0, 0, e, s, 1, 0, A, t, 0, 1, A, t, 0, 1, e, s, 1, 0, e, t, 1, 1]);
317
- r.bufferData(r.ARRAY_BUFFER, i, r.DYNAMIC_DRAW);
318
- }
319
- O() {
320
- this.q && this.p.deleteBuffer(this.q);
266
+ class q {
267
+ constructor() {
268
+ n(this, "sA", 1);
269
+ n(this, "EA", 0);
270
+ n(this, "iA", [0, 0, 0]);
271
+ n(this, "rA", [1, 1, 1, 1]);
272
+ n(this, "nA", [0, 0, 0, 1]);
273
+ n(this, "gA", !1);
274
+ n(this, "oA", !1);
275
+ n(this, "aA", !1);
276
+ n(this, "cA", [0, 0]);
277
+ n(this, "hA", [0, 0, 0, 1]);
278
+ n(this, "CA", []);
279
+ }
280
+ DA() {
281
+ this.CA.push({ lineWeight: this.sA, rotation: this.EA, charRotation: [...this.cA], flipHorizontally: this.gA, flipVertically: this.oA, invert: this.aA, character: [...this.iA], charColor: [...this.rA], cellColor: [...this.nA] });
282
+ }
283
+ lA() {
284
+ const A = this.CA.pop();
285
+ A ? (this.sA = A.lineWeight, this.EA = A.rotation, this.cA = A.charRotation, this.gA = A.flipHorizontally, this.oA = A.flipVertically, this.aA = A.invert, this.iA = A.character, this.rA = A.charColor, this.nA = A.cellColor) : console.warn("pop() called without matching push()");
286
+ }
287
+ PA() {
288
+ this.CA = [], this.EA = 0;
289
+ }
290
+ IA(A) {
291
+ A.lineWeight = this.sA, A.rotation = this.EA, A.character[0] = this.iA[0], A.character[1] = this.iA[1], A.character[2] = this.iA[2], A.charColor[0] = this.rA[0], A.charColor[1] = this.rA[1], A.charColor[2] = this.rA[2], A.charColor[3] = this.rA[3], A.bgColor[0] = this.nA[0], A.bgColor[1] = this.nA[1], A.bgColor[2] = this.nA[2], A.bgColor[3] = this.nA[3], A.flipHorizontally = this.gA, A.flipVertically = this.oA, A.invert = this.aA, A.charRotation[0] = this.cA[0], A.charRotation[1] = this.cA[1];
292
+ }
293
+ get lineWeight() {
294
+ return this.sA;
295
+ }
296
+ get canvasBackgroundColor() {
297
+ return this.hA;
298
+ }
299
+ uA(A) {
300
+ this.sA = Math.abs(A);
301
+ }
302
+ wA(A) {
303
+ this.EA = A;
304
+ }
305
+ fA(A) {
306
+ this.iA = A;
307
+ }
308
+ dA(A, t, e, B = 255) {
309
+ this.rA = [A / 255, t / 255, e / 255, B / 255];
310
+ }
311
+ pA(A, t, e, B = 255) {
312
+ this.nA = [A / 255, t / 255, e / 255, B / 255];
313
+ }
314
+ mA(A) {
315
+ this.gA = A;
316
+ }
317
+ _A(A) {
318
+ this.oA = A;
319
+ }
320
+ vA(A) {
321
+ this.aA = A;
322
+ }
323
+ xA(A) {
324
+ const t = 255 * A / 360, e = Math.floor(t) / 255, B = Math.round(t - Math.floor(t));
325
+ this.cA = [e, B];
326
+ }
327
+ yA(A, t, e, B) {
328
+ this.hA = [A / 255, t / 255, e / 255, B / 255];
321
329
  }
322
330
  }
323
- class BA extends AA {
331
+ 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 || {});
332
+ class AA {
324
333
  constructor(A) {
325
- super(A);
334
+ n(this, "m");
335
+ n(this, "bA", /* @__PURE__ */ new Map());
336
+ this.m = A;
337
+ }
338
+ GA(A, t, e, B) {
339
+ const r = this.m;
340
+ let i = this.bA.get(A);
341
+ i || (i = /* @__PURE__ */ new Map(), this.bA.set(A, i));
342
+ let s = i.get(t) || null;
343
+ if (!s) {
344
+ s = r.createVertexArray(), i.set(t, s), r.bindVertexArray(s), r.bindBuffer(r.ARRAY_BUFFER, B);
345
+ const Q = r.getAttribLocation(A, "a_position");
346
+ Q !== -1 && (r.enableVertexAttribArray(Q), r.vertexAttribPointer(Q, e.attributes.position.size, r.FLOAT, !1, e.stride, e.attributes.position.offset), r.vertexAttribDivisor(Q, 0));
347
+ const o = r.getAttribLocation(A, "a_texCoord");
348
+ o !== -1 && (r.enableVertexAttribArray(o), r.vertexAttribPointer(o, e.attributes.texCoord.size, r.FLOAT, !1, e.stride, e.attributes.texCoord.offset), r.vertexAttribDivisor(o, 0));
349
+ }
350
+ r.bindVertexArray(s);
326
351
  }
327
- QA(A, t, e, s) {
328
- const r = this.BA(A, t), i = this.BA(A + e, t + s);
329
- this.iA(r.nx, r.ny, i.nx, i.ny);
330
- const B = this.sA();
331
- this.p.drawArrays(this.p.TRIANGLES, 0, 6), this.rA(B.positionLoc, B.texLoc);
352
+ $A() {
353
+ this.m.bindVertexArray(null);
332
354
  }
333
- EA(A, t, e, s, r) {
334
- this.QA(A, t, e, r), this.QA(A + e - r, t, r, s), this.QA(A, t + s - r, e, r), this.QA(A, t, r, s);
355
+ W() {
356
+ const A = this.m;
357
+ for (const [, t] of this.bA) for (const [, e] of t) e && A.deleteVertexArray(e);
358
+ this.bA.clear();
335
359
  }
336
360
  }
337
- class oA extends AA {
361
+ class tA {
338
362
  constructor(A) {
339
- super(A);
340
- }
341
- oA(A, t, e, s, r) {
342
- const i = e - A, B = s - t, Q = Math.hypot(i, B);
343
- if (Q === 0) {
344
- const g = r / 2, a = this.BA(A - g, t - g), h = this.BA(A + g, t + g);
345
- this.iA(a.nx, a.ny, h.nx, h.ny);
346
- } else {
347
- const g = -B / Q, a = i / Q, h = r / 2, u = A + g * h, c = t + a * h, l = A - g * h, d = t - a * h, C = e + g * h, P = s + a * h, w = e - g * h, m = s - a * h, y = this.BA(u, c), x = this.BA(l, d), _ = this.BA(C, P), V = this.BA(w, m), T = this.p;
348
- this.eA(), T.bindBuffer(T.ARRAY_BUFFER, this.q);
349
- const eA = new Float32Array([y.nx, y.ny, 0, 0, x.nx, x.ny, 0, 1, _.nx, _.ny, 1, 0, x.nx, x.ny, 0, 1, V.nx, V.ny, 1, 1, _.nx, _.ny, 1, 0]);
350
- T.bufferData(T.ARRAY_BUFFER, eA, T.DYNAMIC_DRAW);
363
+ n(this, "MA");
364
+ n(this, "m");
365
+ this.m = A, this.MA = new AA(A);
366
+ }
367
+ YA(A, t, e) {
368
+ const { shader: B } = A, r = G(this.m) || this.m.getParameter(this.m.VIEWPORT);
369
+ B.tA({ u_aspectRatio: r[2] / r[3], u_viewportSize: [r[2], r[3]] });
370
+ const i = (o) => {
371
+ if (!o || !o.TA()) return;
372
+ const g = o.unitGeometry, a = o.unitBuffer;
373
+ try {
374
+ this.MA.GA(B.QA, o.type + "", g, a), o.batch.zA(B), o.batch.FA(g.primitiveType, g.vertexCount);
375
+ } finally {
376
+ o.batch.RA(B), this.MA.$A(), o.SA();
377
+ }
378
+ };
379
+ let s = null, Q = null;
380
+ for (const o of t) {
381
+ s !== null && o.type !== s && (i(Q), s = null, Q = null);
382
+ let g = Q;
383
+ g && o.type === s || (g = e.get(o.type) || null, Q = g, s = o.type), g && g.OA(o.params, o.state);
351
384
  }
352
- const n = this.sA();
353
- this.p.drawArrays(this.p.TRIANGLES, 0, 6), this.rA(n.positionLoc, n.texLoc);
385
+ i(Q);
354
386
  }
355
387
  }
356
- var Y = "attribute vec2 a_position;attribute vec2 a_texCoord;varying vec2 v_uv;uniform float u_rotation;uniform vec2 u_center;uniform float u_aspectRatio;mat2 rotate2D(float angle){float s=sin(angle);float c=cos(angle);return mat2(c,-s,s,c);}void main(){v_uv=a_texCoord;vec2 pos=a_position;pos-=u_center;pos.x*=u_aspectRatio;pos=rotate2D(-u_rotation)*pos;pos.x/=u_aspectRatio;pos+=u_center;gl_Position=vec4(pos,0.0,1.0);}";
357
- class EA {
358
- constructor(A) {
359
- E(this, "p");
360
- E(this, "gA");
361
- E(this, "nA");
362
- E(this, "aA", null);
363
- E(this, "hA");
364
- E(this, "lA");
365
- E(this, "cA", [1, 1, 1, 1]);
366
- E(this, "DA", !0);
367
- E(this, "CA", [0, 0, 0, 1]);
368
- E(this, "uA", 1);
369
- E(this, "PA", !0);
370
- E(this, "IA", 0);
371
- E(this, "wA", []);
372
- this.p = A, this.gA = new p(this.p, Y, "precision lowp float;uniform sampler2D u_texture;varying vec2 v_uv;void main(){gl_FragColor=texture2D(u_texture,v_uv);}"), this.nA = new p(this.p, Y, "precision lowp float;uniform vec4 u_color;void main(){gl_FragColor=u_color;}"), this.hA = new BA(this.p), this.lA = new oA(this.p), this.p.enable(this.p.BLEND), this.p.blendEquation(this.p.FUNC_ADD), this.p.blendFunc(this.p.ONE, this.p.ONE_MINUS_SRC_ALPHA), F(this.p, [0, 0, this.p.canvas.width, this.p.canvas.height]);
388
+ class eA {
389
+ constructor() {
390
+ n(this, "LA", []);
391
+ n(this, "UA", 1);
392
+ n(this, "kA", 0);
393
+ }
394
+ WA(A) {
395
+ if (this.kA >= this.LA.length) {
396
+ const e = { id: this.UA++, type: A, params: {}, state: { lineWeight: 1, rotation: 0, character: [0, 0, 0], charColor: [1, 1, 1, 1], bgColor: [0, 0, 0, 1], flipHorizontally: !1, flipVertically: !1, invert: !1, charRotation: [0, 0] } };
397
+ this.LA.push(e);
398
+ }
399
+ const t = this.LA[this.kA];
400
+ switch (t.id = this.UA++, t.type = A, A) {
401
+ case D.RECTANGLE:
402
+ case D.ELLIPSE:
403
+ t.params && "width" in t.params || (t.params = { x: 0, y: 0, width: 0, height: 0 });
404
+ break;
405
+ case D.ARC:
406
+ t.params && "start" in t.params || (t.params = { x: 0, y: 0, width: 0, height: 0, start: 0, stop: 0 });
407
+ break;
408
+ case D.LINE:
409
+ t.params && "x2" in t.params || (t.params = { x1: 0, y1: 0, x2: 0, y2: 0, thickness: void 0 });
410
+ break;
411
+ case D.TRIANGLE:
412
+ t.params && "x3" in t.params || (t.params = { x1: 0, y1: 0, x2: 0, y2: 0, x3: 0, y3: 0 });
413
+ break;
414
+ case D.BEZIER_CURVE:
415
+ t.params && "cp2y" in t.params || (t.params = { x1: 0, y1: 0, cp1x: 0, cp1y: 0, cp2x: 0, cp2y: 0, x2: 0, y2: 0, thickness: void 0 });
416
+ break;
417
+ default:
418
+ t.params || (t.params = {});
419
+ }
420
+ return this.kA++, t;
373
421
  }
374
- fA(A) {
375
- this.aA !== A && (this.aA = A, A.W());
422
+ HA(A, t, e, B, r) {
423
+ const i = this.WA(D.RECTANGLE);
424
+ return i.params.x = A, i.params.y = t, i.params.width = e, i.params.height = B, r.IA(i.state), i.id;
376
425
  }
377
- dA(A, t, e, s) {
378
- if (this.DA = !0, t === void 0 && e === void 0 && s === void 0) {
379
- const r = A / 255;
380
- this.cA = [r, r, r, 1];
381
- } else if (e !== void 0 && s === void 0) this.cA = [A / 255, t / 255, e / 255, 1];
382
- else {
383
- if (e === void 0 || s === void 0) throw Error("Invalid fill parameters. Use fill(gray), fill(r,g,b), or fill(r,g,b,a)");
384
- this.cA = [A / 255, t / 255, e / 255, s / 255];
426
+ JA(A, t, e, B, r, i) {
427
+ const s = this.WA(D.LINE);
428
+ return s.params.x1 = A, s.params.y1 = t, s.params.x2 = e, s.params.y2 = B, s.params.thickness = r, i.IA(s.state), s.id;
429
+ }
430
+ VA(A, t, e, B, r) {
431
+ const i = this.WA(D.ELLIPSE);
432
+ return i.params.x = A, i.params.y = t, i.params.width = e, i.params.height = B, r.IA(i.state), i.id;
433
+ }
434
+ KA(A, t, e, B, r, i, s) {
435
+ const Q = this.WA(D.ARC);
436
+ return Q.params.x = A, Q.params.y = t, Q.params.width = e, Q.params.height = B, Q.params.start = r, Q.params.stop = i, s.IA(Q.state), Q.id;
437
+ }
438
+ jA(A, t, e, B, r, i, s) {
439
+ const Q = this.WA(D.TRIANGLE);
440
+ return Q.params.x1 = A, Q.params.y1 = t, Q.params.x2 = e, Q.params.y2 = B, Q.params.x3 = r, Q.params.y3 = i, s.IA(Q.state), Q.id;
441
+ }
442
+ ZA(A, t, e, B, r, i, s, Q, o, g) {
443
+ const a = this.WA(D.BEZIER_CURVE);
444
+ return a.params.x1 = A, a.params.y1 = t, a.params.cp1x = e, a.params.cp1y = B, a.params.cp2x = r, a.params.cp2y = i, a.params.x2 = s, a.params.y2 = Q, a.params.thickness = o, g.IA(a.state), a.id;
445
+ }
446
+ get length() {
447
+ return this.kA;
448
+ }
449
+ get isEmpty() {
450
+ return this.kA === 0;
451
+ }
452
+ NA() {
453
+ this.kA = 0;
454
+ }
455
+ [Symbol.iterator]() {
456
+ let A = 0;
457
+ const t = this.kA, e = this.LA;
458
+ return { next: () => A < t ? { value: e[A++], done: !1 } : { value: void 0, done: !0 } };
459
+ }
460
+ }
461
+ const y = class y {
462
+ static XA(A, t, e = 0) {
463
+ var i, s, Q, o, g, a, h, l, c, C;
464
+ const B = t || new Float32Array(y.FLOATS_PER_INSTANCE);
465
+ let r = e;
466
+ return B[r++] = A.position[0], B[r++] = A.position[1], B[r++] = A.size[0], B[r++] = A.size[1], B[r++] = A.character[0], B[r++] = A.character[1], B[r++] = A.character[2], B[r++] = A.primaryColor[0], B[r++] = A.primaryColor[1], B[r++] = A.primaryColor[2], B[r++] = A.primaryColor[3], B[r++] = A.secondaryColor[0], B[r++] = A.secondaryColor[1], B[r++] = A.secondaryColor[2], B[r++] = A.secondaryColor[3], B[r++] = A.rotation[0], B[r++] = A.rotation[1], B[r++] = A.transform[0], B[r++] = A.transform[1], B[r++] = A.transform[2], B[r++] = A.globalRotation, B[r++] = A.rotationCenter[0], B[r++] = A.rotationCenter[1], B[r++] = ((i = A.arcAngles) == null ? void 0 : i[0]) || 0, B[r++] = ((s = A.arcAngles) == null ? void 0 : s[1]) || 0, B[r++] = ((Q = A.bezierControlPoint1) == null ? void 0 : Q[0]) || 0, B[r++] = ((o = A.bezierControlPoint1) == null ? void 0 : o[1]) || 0, B[r++] = ((g = A.bezierControlPoint2) == null ? void 0 : g[0]) || 0, B[r++] = ((a = A.bezierControlPoint2) == null ? void 0 : a[1]) || 0, B[r++] = ((h = A.bezierStartPoint) == null ? void 0 : h[0]) || 0, B[r++] = ((l = A.bezierStartPoint) == null ? void 0 : l[1]) || 0, B[r++] = ((c = A.bezierEndPoint) == null ? void 0 : c[0]) || 0, B[r++] = ((C = A.bezierEndPoint) == null ? void 0 : C[1]) || 0, B;
467
+ }
468
+ static qA(A) {
469
+ const t = A.length * y.FLOATS_PER_INSTANCE, e = new Float32Array(t);
470
+ for (let B = 0; B < A.length; B++) {
471
+ const r = B * y.FLOATS_PER_INSTANCE;
472
+ y.XA(A[B], e, r);
385
473
  }
474
+ return e;
386
475
  }
387
- mA(A, t, e, s) {
388
- if (this.PA = !0, t === void 0 && e === void 0 && s === void 0) {
389
- const r = A / 255;
390
- this.CA = [r, r, r, 1];
391
- } else if (e !== void 0 && s === void 0) this.CA = [A / 255, t / 255, e / 255, 1];
392
- else {
393
- if (e === void 0 || s === void 0) throw Error("Invalid stroke parameters. Use stroke(gray), stroke(r,g,b), or stroke(r,g,b,a)");
394
- this.CA = [A / 255, t / 255, e / 255, s / 255];
476
+ };
477
+ n(y, "BYTES_PER_INSTANCE", 132), n(y, "FLOATS_PER_INSTANCE", 33);
478
+ let v = y;
479
+ const P = class P {
480
+ };
481
+ n(P, "STRIDE", v.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: 1, 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: 84, divisor: 1 }, a_instanceArcAngles: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 92, divisor: 1 }, a_instanceBezierCP1: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 100, divisor: 1 }, a_instanceBezierCP2: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 108, divisor: 1 }, a_instanceBezierStart: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 116, divisor: 1 }, a_instanceBezierEnd: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: P.STRIDE, offset: 124, divisor: 1 } });
482
+ let _ = P;
483
+ class BA {
484
+ constructor(A, t = 1e3, e = 1.5) {
485
+ n(this, "m");
486
+ n(this, "At", []);
487
+ n(this, "tt");
488
+ n(this, "et");
489
+ n(this, "Bt", null);
490
+ n(this, "Qt", !0);
491
+ n(this, "st", 0);
492
+ n(this, "Et", /* @__PURE__ */ new Map());
493
+ n(this, "it", null);
494
+ this.m = A, this.tt = t, this.et = e, this.rt();
495
+ }
496
+ OA(A) {
497
+ const t = this.At.length;
498
+ return this.At.push(A), this.Qt = !0, t;
499
+ }
500
+ get count() {
501
+ return this.At.length;
502
+ }
503
+ get isEmpty() {
504
+ return this.At.length === 0;
505
+ }
506
+ clear() {
507
+ this.At.length = 0, this.Qt = !0;
508
+ }
509
+ nt(A) {
510
+ if (A <= this.tt) return;
511
+ const t = Math.ceil(A * this.et);
512
+ this.tt = t, this.rt(), console.log(`InstanceBatch: Grew buffer capacity to ${t} instances`);
513
+ }
514
+ rt() {
515
+ const A = this.m;
516
+ if (this.Bt && A.deleteBuffer(this.Bt), this.Bt = A.createBuffer(), !this.Bt) throw Error("Failed to create instance buffer");
517
+ const t = this.tt * v.BYTES_PER_INSTANCE;
518
+ A.bindBuffer(A.ARRAY_BUFFER, this.Bt), A.bufferData(A.ARRAY_BUFFER, t, A.DYNAMIC_DRAW), A.bindBuffer(A.ARRAY_BUFFER, null), this.Qt = !0, this.st = 0;
519
+ }
520
+ gt() {
521
+ if (!this.Qt || this.At.length === 0) return;
522
+ const A = this.m, t = this.At.length;
523
+ this.nt(t), (!this.it || this.it.length < t * v.FLOATS_PER_INSTANCE) && (this.it = new Float32Array(t * v.FLOATS_PER_INSTANCE));
524
+ const e = v.qA(this.At);
525
+ A.bindBuffer(A.ARRAY_BUFFER, this.Bt), t <= this.st ? A.bufferSubData(A.ARRAY_BUFFER, 0, e) : A.bufferData(A.ARRAY_BUFFER, e, A.DYNAMIC_DRAW), A.bindBuffer(A.ARRAY_BUFFER, null), this.Qt = !1, this.st = t;
526
+ }
527
+ ot(A) {
528
+ let t = this.Et.get(A);
529
+ if (!t) {
530
+ t = /* @__PURE__ */ new Map();
531
+ const e = this.m;
532
+ for (const B in _.ATTRIBUTES) {
533
+ const r = e.getAttribLocation(A, B);
534
+ r !== -1 && t.set(B, r);
535
+ }
536
+ this.Et.set(A, t);
537
+ }
538
+ return t;
539
+ }
540
+ zA(A) {
541
+ if (!this.Bt || this.At.length === 0) return;
542
+ const t = this.m, e = A.QA;
543
+ if (!e) return void console.warn("InstanceBatch: Cannot bind attributes - invalid shader program");
544
+ this.gt();
545
+ const B = this.ot(e);
546
+ t.bindBuffer(t.ARRAY_BUFFER, this.Bt);
547
+ for (const [r, i] of B) {
548
+ const s = _.ATTRIBUTES[r];
549
+ s && (t.enableVertexAttribArray(i), t.vertexAttribPointer(i, s.size, s.type, s.normalized, s.stride, s.offset), t.vertexAttribDivisor(i, s.divisor));
395
550
  }
396
551
  }
397
- pA(A) {
398
- if (A < 0) throw Error("Stroke weight must be non-negative");
399
- this.uA = A;
552
+ RA(A) {
553
+ const t = this.m, e = this.ot(A.QA);
554
+ for (const [, B] of e) t.disableVertexAttribArray(B), t.vertexAttribDivisor(B, 0);
400
555
  }
401
- _A() {
402
- this.PA = !1;
556
+ FA(A, t) {
557
+ this.At.length !== 0 && this.m.drawArraysInstanced(A, 0, t, this.At.length);
403
558
  }
404
- vA() {
405
- this.DA = !1;
559
+ W() {
560
+ const A = this.m;
561
+ this.Bt && (A.deleteBuffer(this.Bt), this.Bt = null), this.At.length = 0, this.Et.clear(), this.it = null;
406
562
  }
407
- bA(A) {
408
- this.IA = A;
563
+ }
564
+ class b {
565
+ constructor(A, t, e, B) {
566
+ n(this, "m");
567
+ n(this, "ct");
568
+ n(this, "ht");
569
+ n(this, "Ct");
570
+ n(this, "Dt", null);
571
+ this.m = A, this.ct = t, this.ht = e, this.Ct = B;
572
+ const r = this.m.createBuffer();
573
+ if (!r) throw Error("Failed to create unit geometry buffer");
574
+ this.m.bindBuffer(this.m.ARRAY_BUFFER, r), this.m.bufferData(this.m.ARRAY_BUFFER, this.Ct.vertices, this.m.STATIC_DRAW), this.m.bindBuffer(this.m.ARRAY_BUFFER, null), this.Dt = r;
409
575
  }
410
- xA() {
411
- this.wA.push({ fillColor: [...this.cA], fillMode: this.DA, strokeColor: [...this.CA], strokeWeight: this.uA, strokeMode: this.PA, rotation: this.IA });
576
+ get type() {
577
+ return this.ht;
412
578
  }
413
- yA() {
414
- const A = this.wA.pop();
415
- A ? (this.cA = A.fillColor, this.DA = A.fillMode, this.CA = A.strokeColor, this.uA = A.strokeWeight, this.PA = A.strokeMode, this.IA = A.rotation) : console.warn("pop() called without matching push()");
579
+ get unitGeometry() {
580
+ return this.Ct;
416
581
  }
417
- MA() {
418
- this.aA = null, this.wA = [], this.IA = 0;
582
+ get unitBuffer() {
583
+ return this.Dt;
419
584
  }
420
- GA(A) {
421
- const t = A.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/.*$/gm, "").trim().match(/^#version\s+(\d+)\s+(es)?/i);
422
- return t ? parseInt(t[1], 10) >= 300 : !1;
585
+ get batch() {
586
+ return this.ct;
423
587
  }
424
- FA(A, t) {
425
- return new p(this.p, A, t);
588
+ SA() {
589
+ this.ct.clear();
426
590
  }
427
- $A(A) {
428
- const t = this.GA(A) ? `#version 300 es
429
- in vec2 a_position;in vec2 a_texCoord;out vec2 v_uv;uniform float u_rotation;uniform vec2 u_center;uniform float u_aspectRatio;mat2 rotate2D(float angle){float s=sin(angle);float c=cos(angle);return mat2(c,-s,s,c);}void main(){v_uv=a_texCoord;vec2 pos=a_position;pos-=u_center;pos.x*=u_aspectRatio;pos=rotate2D(-u_rotation)*pos;pos.x/=u_aspectRatio;pos+=u_center;gl_Position=vec4(pos,0.0,1.0);}` : Y;
430
- return new p(this.p, t, A);
591
+ TA() {
592
+ return !this.ct.isEmpty;
431
593
  }
432
- YA(A, t) {
433
- this.aA.setUniform(A, t);
594
+ W() {
595
+ this.ct.W(), this.Dt && (this.m.deleteBuffer(this.Dt), this.Dt = null);
434
596
  }
435
- TA(A, t, e, s) {
436
- if (this.aA !== null) {
437
- const { centerX: a, centerY: h, radians: u, aspectRatio: c } = this.SA(A, t, e, s);
438
- return this.YA("u_rotation", u), this.YA("u_center", [a, h]), this.YA("u_aspectRatio", c), this.hA.QA(A, t, e, s), void (this.aA = null);
439
- }
440
- const r = this.nA;
441
- let i = 0, B = 0, Q = 0, n = 1;
442
- const g = this.SA(A, t, e, s);
443
- i = g.centerX, B = g.centerY, Q = g.radians, n = g.aspectRatio, this.DA && (this.fA(r), this.YA("u_color", this.cA), this.YA("u_rotation", Q), this.YA("u_center", [i, B]), this.YA("u_aspectRatio", n), this.hA.QA(A, t, e, s)), this.PA && this.uA > 0 && (this.fA(r), this.YA("u_color", this.CA), this.YA("u_rotation", Q), this.YA("u_center", [i, B]), this.YA("u_aspectRatio", n), this.hA.EA(A, t, e, s, this.uA)), this.aA = null;
444
- }
445
- OA(A, t, e, s) {
446
- if (this.aA !== null) {
447
- const l = (A + e) / 2, d = (t + s) / 2, C = Math.abs(e - A) || 1, P = Math.abs(s - t) || 1, { centerX: w, centerY: m, radians: y, aspectRatio: x } = this.SA(l - C / 2, d - P / 2, C, P);
448
- this.YA("u_rotation", y), this.YA("u_center", [w, m]), this.YA("u_aspectRatio", x);
449
- const _ = this.uA > 0 ? this.uA : 1;
450
- return this.lA.oA(A, t, e, s, _), void (this.aA = null);
451
- }
452
- if (!this.PA || this.uA <= 0) return;
453
- const r = this.nA, i = (A + e) / 2, B = (t + s) / 2, Q = Math.abs(e - A) || 1, n = Math.abs(s - t) || 1, g = this.IA !== 0;
454
- let a = 0, h = 0, u = 0, c = 1;
455
- if (g) {
456
- const l = this.SA(i - Q / 2, B - n / 2, Q, n);
457
- a = l.centerX, h = l.centerY, u = l.radians, c = l.aspectRatio;
458
- }
459
- this.fA(r), this.YA("u_color", this.CA), g && (this.YA("u_rotation", u), this.YA("u_center", [a, h]), this.YA("u_aspectRatio", c)), this.lA.oA(A, t, e, s, this.uA);
597
+ lt(A, t, e, B, r) {
598
+ const i = this.Pt(A, t, e, B, r.rotation || 0);
599
+ return { position: [A, t], size: [e, B], character: r.character || [0, 0, 0], primaryColor: r.charColor || [1, 1, 1, 1], secondaryColor: r.bgColor || [0, 0, 0, 1], rotation: r.charRotation || [0, 0], transform: [r.invert ? 1 : 0, r.flipHorizontally ? 1 : 0, r.flipVertically ? 1 : 0], globalRotation: i.radians, rotationCenter: [i.centerX, i.centerY] };
600
+ }
601
+ It(A, t) {
602
+ const e = G(this.m) || [0, 0, this.m.canvas.width, this.m.canvas.height];
603
+ return { nx: A / e[2] * 2 - 1, ny: 1 - t / e[3] * 2 };
604
+ }
605
+ ut(A, t, e) {
606
+ const B = this.It(t, e);
607
+ A.rotationCenter = [B.nx, B.ny];
608
+ }
609
+ Pt(A, t, e, B, r) {
610
+ const i = G(this.m) || [0, 0, this.m.canvas.width, this.m.canvas.height], s = i[2], Q = i[3];
611
+ return { centerX: (A + e / 2) / s * 2 - 1, centerY: 1 - (t + B / 2) / Q * 2, radians: -r * Math.PI / 180, aspectRatio: s / Q };
612
+ }
613
+ }
614
+ 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 } } };
615
+ class iA extends b {
616
+ constructor(A, t) {
617
+ super(A, t, D.RECTANGLE, rA);
618
+ }
619
+ OA(A, t) {
620
+ const e = this.lt(A.x, A.y, A.width, A.height, t);
621
+ return this.ct.OA(e);
622
+ }
623
+ }
624
+ const sA = { 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 } } };
625
+ class EA extends b {
626
+ constructor(A, t) {
627
+ super(A, t, D.LINE, sA);
628
+ }
629
+ OA(A, t) {
630
+ const e = A.x2 - A.x1, B = A.y2 - A.y1, r = Math.hypot(e, B), i = Math.atan2(B, e), s = A.thickness || t.lineWeight || 1, Q = A.x1 + e / 2, o = A.y1 + B / 2, g = Q - r / 2, a = o, h = { character: t.character, charColor: t.charColor, bgColor: t.bgColor, charRotation: t.charRotation, flipHorizontally: t.flipHorizontally, flipVertically: t.flipVertically, invert: t.invert, rotation: (t.rotation || 0) + 180 * i / Math.PI, lineWeight: s }, l = this.lt(g, a, r, s, h);
631
+ return this.ut(l, Q, o), this.ct.OA(l);
632
+ }
633
+ }
634
+ const QA = { vertices: function(E = 32) {
635
+ const A = [], t = 2 * Math.PI / E;
636
+ for (let e = 0; e < E; e++) {
637
+ const B = e * t, r = (e + 1) % E * t, i = Math.cos(B), s = Math.sin(B), Q = 0.5 * (i + 1), o = 0.5 * (s + 1), g = Math.cos(r), a = Math.sin(r), h = 0.5 * (g + 1), l = 0.5 * (a + 1);
638
+ A.push(0, 0, 0.5, 0.5, i, s, Q, o, g, a, h, l);
639
+ }
640
+ return new Float32Array(A);
641
+ }(32), vertexCount: 96, primitiveType: WebGL2RenderingContext.TRIANGLES, stride: 16, attributes: { position: { size: 2, offset: 0 }, texCoord: { size: 2, offset: 8 } } };
642
+ class nA extends b {
643
+ constructor(A, t) {
644
+ super(A, t, D.ELLIPSE, QA);
645
+ }
646
+ OA(A, t) {
647
+ const e = this.lt(A.x, A.y, A.width, A.height, t);
648
+ return this.ut(e, A.x, A.y), this.ct.OA(e);
649
+ }
650
+ }
651
+ let oA = { vertices: function(E) {
652
+ const A = [];
653
+ for (let t = 0; t < E; t++) {
654
+ const e = t / E, B = (t + 1) / E;
655
+ A.push(e, 0, e, 0, e, 1, e, 1, B, 1, B, 1);
656
+ }
657
+ return new Float32Array(A);
658
+ }(32), vertexCount: 96, primitiveType: WebGL2RenderingContext.TRIANGLES, stride: 16, attributes: { position: { size: 2, offset: 0 }, texCoord: { size: 2, offset: 8 } } };
659
+ class gA extends b {
660
+ constructor(A, t) {
661
+ super(A, t, D.ARC, oA);
662
+ }
663
+ OA(A, t) {
664
+ const e = A.x - A.width / 2, B = A.y - A.height / 2, r = A.start * Math.PI / 180, i = A.stop * Math.PI / 180, s = this.lt(e, B, A.width, A.height, t);
665
+ return this.ut(s, A.x, A.y), s.arcAngles = [r, i], this.ct.OA(s);
666
+ }
667
+ }
668
+ const aA = { 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 } } };
669
+ class hA extends b {
670
+ constructor(A, t) {
671
+ super(A, t, D.TRIANGLE, aA);
672
+ }
673
+ OA(A, t) {
674
+ const e = Math.min(A.x1, A.x2, A.x3), B = Math.max(A.x1, A.x2, A.x3), r = Math.min(A.y1, A.y2, A.y3), i = B - e, s = Math.max(A.y1, A.y2, A.y3) - r, Q = this.lt(e, r, i, s, t), o = e + 0.5 * i, g = r + s * (1 / 3);
675
+ return this.ut(Q, o, g), this.ct.OA(Q);
676
+ }
677
+ }
678
+ function L(E, A, t, e, B) {
679
+ const r = 1 - E, i = r * r, s = E * E;
680
+ return i * r * A + 3 * i * E * t + 3 * r * s * e + s * E * B;
681
+ }
682
+ const cA = { vertices: function(E = 16) {
683
+ const A = [];
684
+ for (let t = 0; t < E; t++) {
685
+ const e = t / E, B = (t + 1) / E;
686
+ A.push(e, -0.5, e, 0), A.push(B, -0.5, B, 0), A.push(e, 0.5, e, 1), A.push(e, 0.5, e, 1), A.push(B, -0.5, B, 0), A.push(B, 0.5, B, 1);
687
+ }
688
+ return new Float32Array(A);
689
+ }(16), vertexCount: 96, primitiveType: WebGL2RenderingContext.TRIANGLES, stride: 16, attributes: { position: { size: 2, offset: 0 }, texCoord: { size: 2, offset: 8 } } };
690
+ class lA extends b {
691
+ constructor(A, t) {
692
+ super(A, t, D.BEZIER_CURVE, cA);
693
+ }
694
+ OA(A, t) {
695
+ const e = t.lineWeight || 1, B = L(0.5, A.x1, A.cp1x, A.cp2x, A.x2), r = L(0.5, A.y1, A.cp1y, A.cp2y, A.y2), i = { character: t.character, charColor: t.charColor, bgColor: t.bgColor, charRotation: t.charRotation, flipHorizontally: t.flipHorizontally, flipVertically: t.flipVertically, invert: t.invert, rotation: t.rotation || 0, lineWeight: e }, s = this.lt(0, 0, 1, e, i);
696
+ return this.ut(s, B, r), s.bezierStartPoint = [A.x1, A.y1], s.bezierControlPoint1 = [A.cp1x, A.cp1y], s.bezierControlPoint2 = [A.cp2x, A.cp2y], s.bezierEndPoint = [A.x2, A.y2], this.ct.OA(s);
697
+ }
698
+ }
699
+ class CA {
700
+ constructor(A) {
701
+ n(this, "m");
702
+ n(this, "wt", null);
703
+ n(this, "ft", null);
704
+ n(this, "dt", null);
705
+ n(this, "_t", /* @__PURE__ */ new Map());
706
+ n(this, "vt");
707
+ n(this, "xt");
708
+ n(this, "yt");
709
+ this.m = A, this.yt = new q(), this.vt = new tA(A), this.xt = new eA(), this.ft = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, this.ft), A.bufferData(A.ARRAY_BUFFER, new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]), A.STATIC_DRAW), this.dt = A.createBuffer(), M(this.m, [0, 0, this.m.canvas.width, this.m.canvas.height]);
710
+ }
711
+ bt(A) {
712
+ let t = this._t.get(A);
713
+ if (t) return t;
714
+ const e = new BA(this.m);
715
+ return t = (0, { [D.RECTANGLE]: () => new iA(this.m, e), [D.LINE]: () => new EA(this.m, e), [D.ELLIPSE]: () => new nA(this.m, e), [D.ARC]: () => new gA(this.m, e), [D.TRIANGLE]: () => new hA(this.m, e), [D.BEZIER_CURVE]: () => new lA(this.m, e) }[A])(), this._t.set(A, t), t;
716
+ }
717
+ Gt(A) {
718
+ this.wt !== A && (this.wt = A, A.q());
719
+ }
720
+ $t(A, t) {
721
+ return new Z(this.m, A, t);
722
+ }
723
+ Mt(A, t, e, B) {
724
+ var C;
725
+ const r = this.m, i = r.canvas.width, s = r.canvas.height, Q = A / i * 2 - 1, o = (A + e) / i * 2 - 1, g = 1 - t / s * 2, a = 1 - (t + B) / s * 2, h = new Float32Array([Q, a, o, a, Q, g, o, a, o, g, Q, g]);
726
+ r.bindBuffer(r.ARRAY_BUFFER, this.dt), r.bufferData(r.ARRAY_BUFFER, h, r.DYNAMIC_DRAW);
727
+ const l = ((C = this.wt) == null ? void 0 : C.QA) || r.getParameter(r.CURRENT_PROGRAM), c = l ? r.getAttribLocation(l, "a_position") : -1;
728
+ c !== -1 && (r.enableVertexAttribArray(c), r.vertexAttribPointer(c, 2, r.FLOAT, !1, 8, 0)), r.drawArrays(r.TRIANGLES, 0, 6), c !== -1 && r.disableVertexAttribArray(c);
729
+ }
730
+ Yt(A, t, e, B) {
731
+ this.xt.HA(A, t, e, B, this.yt);
732
+ }
733
+ Tt(A, t, e, B) {
734
+ this.xt.JA(A, t, e, B, this.yt.lineWeight, this.yt);
460
735
  }
461
- SA(A, t, e, s) {
462
- const r = J(this.p) || [0, 0, this.p.canvas.width, this.p.canvas.height], i = r[2], B = r[3], Q = i / B;
463
- return { centerX: (A + e / 2) / i * 2 - 1, centerY: 1 - (t + s / 2) / B * 2, radians: this.IA * Math.PI / 180, aspectRatio: Q };
736
+ zt(A, t, e, B) {
737
+ this.xt.VA(A, t, e, B, this.yt);
464
738
  }
465
- UA(A, t, e = {}) {
466
- return new K(this.p, A, t, e);
739
+ Ft(A, t, e, B, r, i) {
740
+ this.xt.jA(A, t, e, B, r, i, this.yt);
467
741
  }
468
- RA(A, t = A, e = A, s = 255) {
469
- this.kA(A / 255, t / 255, e / 255, s / 255);
742
+ Rt(A, t, e, B, r, i, s, Q) {
743
+ const o = this.yt.lineWeight;
744
+ this.xt.ZA(A, t, e, B, r, i, s, Q, o, this.yt);
470
745
  }
471
- kA(A = 0, t = 0, e = 0, s = 0) {
472
- this.p.clearColor(A, t, e, s), this.p.clear(this.p.COLOR_BUFFER_BIT);
746
+ St(A, t, e = 1, B = {}) {
747
+ return new K(this.m, A, t, e, B);
473
748
  }
474
- VA() {
475
- this.p.viewport(0, 0, this.p.canvas.width, this.p.canvas.height), F(this.p, [0, 0, this.p.canvas.width, this.p.canvas.height]);
749
+ Ot(A, t, e, B, r, i) {
750
+ this.xt.KA(A, t, e, B, r, i, this.yt);
751
+ }
752
+ Lt(A, t = A, e = A, B = 255) {
753
+ this.state.yA(A, t, e, B), this.NA(A / 255, t / 255, e / 255, B / 255);
754
+ }
755
+ NA(A = 0, t = 0, e = 0, B = 0) {
756
+ this.m.clearColor(A, t, e, B), this.m.clear(this.m.COLOR_BUFFER_BIT);
757
+ }
758
+ Ut() {
759
+ 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]);
476
760
  }
477
761
  get context() {
478
- return this.p;
762
+ return this.m;
479
763
  }
480
- O() {
481
- this.gA.O(), this.nA.O(), this.hA.O(), this.lA.O();
764
+ get state() {
765
+ return this.yt;
766
+ }
767
+ kt(A) {
768
+ const t = G(this.m) ?? this.m.getParameter(this.m.VIEWPORT), e = { shader: A, gl: this.m, viewport: t }, B = /* @__PURE__ */ new Set();
769
+ for (const r of this.xt) B.add(r.type);
770
+ for (const r of B) this.bt(r);
771
+ this.vt.YA(e, this.xt, this._t), this.xt.NA();
482
772
  }
483
- HA(A, t, e, s, r) {
484
- const i = this.p, B = s ?? A.width, Q = r ?? A.height;
485
- this.fA(this.gA), this.YA("u_texture", A);
486
- const n = this.SA(t, e, B, Q);
487
- this.YA("u_rotation", n.radians), this.YA("u_center", [n.centerX, n.centerY]), this.YA("u_aspectRatio", n.aspectRatio), this.hA.QA(t, e, B, Q), i.bindTexture(i.TEXTURE_2D, null), this.aA = null;
773
+ W() {
774
+ this.m.deleteBuffer(this.ft), this.m.deleteBuffer(this.dt), this.xt.NA();
775
+ for (const A of this._t.values()) A.W();
488
776
  }
489
777
  }
490
- const f = { readShort: (o, A) => (f.t.uint16[0] = o[A] << 8 | o[A + 1], f.t.int16[0]), readUshort: (o, A) => o[A] << 8 | o[A + 1], readUshorts(o, A, t) {
778
+ 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) {
491
779
  const e = [];
492
- for (let s = 0; s < t; s++) e.push(f.readUshort(o, A + 2 * s));
780
+ for (let B = 0; B < t; B++) e.push(u.readUshort(E, A + 2 * B));
493
781
  return e;
494
- }, readUint(o, A) {
495
- const t = f.t.uint8;
496
- return t[3] = o[A], t[2] = o[A + 1], t[1] = o[A + 2], t[0] = o[A + 3], f.t.uint32[0];
497
- }, readASCII(o, A, t) {
782
+ }, readUint(E, A) {
783
+ const t = u.t.uint8;
784
+ return t[3] = E[A], t[2] = E[A + 1], t[1] = E[A + 2], t[0] = E[A + 3], u.t.uint32[0];
785
+ }, readASCII(E, A, t) {
498
786
  let e = "";
499
- for (let s = 0; s < t; s++) e += String.fromCharCode(o[A + s]);
787
+ for (let B = 0; B < t; B++) e += String.fromCharCode(E[A + B]);
500
788
  return e;
501
789
  }, t: (() => {
502
- const o = new ArrayBuffer(8);
503
- return { uint8: new Uint8Array(o), int16: new Int16Array(o), uint16: new Uint16Array(o), uint32: new Uint32Array(o) };
504
- })() }, QA = { parseTab(o, A, t) {
790
+ const E = new ArrayBuffer(8);
791
+ return { uint8: new Uint8Array(E), int16: new Int16Array(E), uint16: new Uint16Array(E), uint32: new Uint32Array(E) };
792
+ })() }, DA = { parseTab(E, A, t) {
505
793
  const e = { tables: [], ids: {}, off: A };
506
- o = new Uint8Array(o.buffer, A, t), A = 0;
507
- const s = f, r = s.readUshort, i = r(o, A += 2);
794
+ E = new Uint8Array(E.buffer, A, t), A = 0;
795
+ const B = u, r = B.readUshort, i = r(E, A += 2);
508
796
  A += 2;
509
- const B = [];
797
+ const s = [];
510
798
  for (let Q = 0; Q < i; Q++) {
511
- const n = r(o, A), g = r(o, A += 2);
799
+ const o = r(E, A), g = r(E, A += 2);
512
800
  A += 2;
513
- const a = s.readUint(o, A);
801
+ const a = B.readUint(E, A);
514
802
  A += 4;
515
- const h = `p${n}e${g}`;
516
- let u = B.indexOf(a);
517
- if (u === -1) {
803
+ const h = `p${o}e${g}`;
804
+ let l = s.indexOf(a);
805
+ if (l === -1) {
518
806
  let c;
519
- u = e.tables.length, B.push(a);
520
- const l = r(o, a);
521
- c = l === 4 ? this.parse4(o, a) : l === 12 ? this.parse12(o, a) : { format: l }, e.tables.push(c);
807
+ l = e.tables.length, s.push(a);
808
+ const C = r(E, a);
809
+ c = C === 4 ? this.parse4(E, a) : C === 12 ? this.parse12(E, a) : { format: C }, e.tables.push(c);
522
810
  }
523
- e.ids[h] != null && console.warn("Multiple tables for one platform+encoding: " + h), e.ids[h] = u;
811
+ e.ids[h] != null && console.warn("Multiple tables for one platform+encoding: " + h), e.ids[h] = l;
524
812
  }
525
813
  return e;
526
- }, parse4(o, A) {
527
- const t = f, e = t.readUshort, s = t.readUshorts, r = A, i = e(o, A += 2);
814
+ }, parse4(E, A) {
815
+ const t = u, e = t.readUshort, B = t.readUshorts, r = A, i = e(E, A += 2);
528
816
  A += 2;
529
- const B = e(o, A += 2) >>> 1, Q = { format: 4, searchRange: e(o, A += 2), entrySelector: 0, rangeShift: 0, endCount: [], startCount: [], idDelta: [], idRangeOffset: [], glyphIdArray: [] };
530
- A += 2, Q.entrySelector = e(o, A), A += 2, Q.rangeShift = e(o, A), A += 2, Q.endCount = s(o, A, B), A += 2 * B, A += 2, Q.startCount = s(o, A, B), A += 2 * B;
531
- for (let n = 0; n < B; n++) Q.idDelta.push(t.readShort(o, A)), A += 2;
532
- return Q.idRangeOffset = s(o, A, B), A += 2 * B, Q.glyphIdArray = s(o, A, r + i - A >> 1), Q;
533
- }, parse12(o, A) {
534
- const t = f.readUint;
535
- t(o, A += 4), t(o, A += 4);
536
- const e = t(o, A += 4);
817
+ const s = e(E, A += 2) >>> 1, Q = { format: 4, searchRange: e(E, A += 2), entrySelector: 0, rangeShift: 0, endCount: [], startCount: [], idDelta: [], idRangeOffset: [], glyphIdArray: [] };
818
+ A += 2, Q.entrySelector = e(E, A), A += 2, Q.rangeShift = e(E, A), A += 2, Q.endCount = B(E, A, s), A += 2 * s, A += 2, Q.startCount = B(E, A, s), A += 2 * s;
819
+ for (let o = 0; o < s; o++) Q.idDelta.push(t.readShort(E, A)), A += 2;
820
+ return Q.idRangeOffset = B(E, A, s), A += 2 * s, Q.glyphIdArray = B(E, A, r + i - A >> 1), Q;
821
+ }, parse12(E, A) {
822
+ const t = u.readUint;
823
+ t(E, A += 4), t(E, A += 4);
824
+ const e = t(E, A += 4);
537
825
  A += 4;
538
- const s = new Uint32Array(3 * e);
539
- for (let r = 0; r < 3 * e; r += 3) s[r] = t(o, A + (r << 2)), s[r + 1] = t(o, A + (r << 2) + 4), s[r + 2] = t(o, A + (r << 2) + 8);
540
- return { format: 12, groups: s };
541
- } }, nA = { parseTab(o, A, t) {
542
- const e = f;
826
+ const B = new Uint32Array(3 * e);
827
+ for (let r = 0; r < 3 * e; r += 3) B[r] = t(E, A + (r << 2)), B[r + 1] = t(E, A + (r << 2) + 4), B[r + 2] = t(E, A + (r << 2) + 8);
828
+ return { format: 12, groups: B };
829
+ } }, PA = { parseTab(E, A, t) {
830
+ const e = u;
543
831
  A += 18;
544
- const s = e.readUshort(o, A);
832
+ const B = e.readUshort(E, A);
545
833
  A += 2, A += 16;
546
- const r = e.readShort(o, A);
834
+ const r = e.readShort(E, A);
547
835
  A += 2;
548
- const i = e.readShort(o, A);
836
+ const i = e.readShort(E, A);
549
837
  A += 2;
550
- const B = e.readShort(o, A);
838
+ const s = e.readShort(E, A);
551
839
  A += 2;
552
- const Q = e.readShort(o, A);
553
- return A += 2, A += 6, { unitsPerEm: s, xMin: r, yMin: i, xMax: B, yMax: Q, indexToLocFormat: e.readShort(o, A) };
554
- } }, gA = { parseTab(o, A, t) {
555
- const e = f;
840
+ const Q = e.readShort(E, A);
841
+ return A += 2, A += 6, { unitsPerEm: B, xMin: r, yMin: i, xMax: s, yMax: Q, indexToLocFormat: e.readShort(E, A) };
842
+ } }, uA = { parseTab(E, A, t) {
843
+ const e = u;
556
844
  A += 4;
557
- const s = ["ascender", "descender", "lineGap", "advanceWidthMax", "minLeftSideBearing", "minRightSideBearing", "xMaxExtent", "caretSlopeRise", "caretSlopeRun", "caretOffset", "res0", "res1", "res2", "res3", "metricDataFormat", "numberOfHMetrics"], r = {};
558
- for (let i = 0; i < s.length; i++) {
559
- const B = s[i], Q = B === "advanceWidthMax" || B === "numberOfHMetrics" ? e.readUshort : e.readShort;
560
- r[B] = Q(o, A + 2 * i);
845
+ const B = ["ascender", "descender", "lineGap", "advanceWidthMax", "minLeftSideBearing", "minRightSideBearing", "xMaxExtent", "caretSlopeRise", "caretSlopeRun", "caretOffset", "res0", "res1", "res2", "res3", "metricDataFormat", "numberOfHMetrics"], r = {};
846
+ for (let i = 0; i < B.length; i++) {
847
+ const s = B[i], Q = s === "advanceWidthMax" || s === "numberOfHMetrics" ? e.readUshort : e.readShort;
848
+ r[s] = Q(E, A + 2 * i);
561
849
  }
562
850
  return r;
563
- } }, hA = { parseTab(o, A, t, e) {
564
- if (!e) throw Error("Font object required for hmtx parsing");
565
- const s = f, r = [], i = [], B = e.maxp.numGlyphs, Q = e.hhea.numberOfHMetrics;
566
- let n = 0, g = 0, a = 0;
567
- for (; a < Q; ) n = s.readUshort(o, A + (a << 2)), g = s.readShort(o, A + (a << 2) + 2), r.push(n), i.push(g), a++;
568
- for (; a < B; ) r.push(n), i.push(g), a++;
851
+ } }, IA = { parseTab(E, A, t, e) {
852
+ const B = u, r = [], i = [], s = e.maxp.numGlyphs, Q = e.hhea.numberOfHMetrics;
853
+ let o = 0, g = 0, a = 0;
854
+ for (; a < Q; ) o = B.readUshort(E, A + (a << 2)), g = B.readShort(E, A + (a << 2) + 2), r.push(o), i.push(g), a++;
855
+ for (; a < s; ) r.push(o), i.push(g), a++;
569
856
  return { aWidth: r, lsBearing: i };
570
- } }, N = { cmap: QA, head: nA, hhea: gA, maxp: { parseTab(o, A, t) {
571
- const e = f;
572
- return e.readUint(o, A), A += 4, { numGlyphs: e.readUshort(o, A) };
573
- } }, hmtx: hA, loca: { parseTab(o, A, t, e) {
574
- if (!e) throw Error("Font object required for loca parsing");
575
- const s = f, r = [], i = e.head.indexToLocFormat, B = e.maxp.numGlyphs + 1;
576
- if (i === 0) for (let Q = 0; Q < B; Q++) r.push(s.readUshort(o, A + (Q << 1)) << 1);
577
- else if (i === 1) for (let Q = 0; Q < B; Q++) r.push(s.readUint(o, A + (Q << 2)));
857
+ } }, z = { cmap: DA, head: PA, hhea: uA, maxp: { parseTab(E, A, t) {
858
+ const e = u;
859
+ return e.readUint(E, A), A += 4, { numGlyphs: e.readUshort(E, A) };
860
+ } }, hmtx: IA, loca: { parseTab(E, A, t, e) {
861
+ const B = u, r = [], i = e.head.indexToLocFormat, s = e.maxp.numGlyphs + 1;
862
+ if (i === 0) for (let Q = 0; Q < s; Q++) r.push(B.readUshort(E, A + (Q << 1)) << 1);
863
+ else if (i === 1) for (let Q = 0; Q < s; Q++) r.push(B.readUint(E, A + (Q << 2)));
578
864
  return r;
579
- } }, glyf: { parseTab(o, A, t, e) {
580
- if (!e) throw Error("Font object required for glyf parsing");
581
- const s = [], r = e.maxp.numGlyphs;
582
- for (let i = 0; i < r; i++) s.push(null);
583
- return s;
584
- }, zA(o, A) {
585
- const t = f, e = o.LA, s = o.loca;
586
- if (s[A] === s[A + 1]) return null;
587
- const r = b.findTable(e, "glyf", o.JA);
865
+ } }, glyf: { parseTab(E, A, t, e) {
866
+ const B = [], r = e.maxp.numGlyphs;
867
+ for (let i = 0; i < r; i++) B.push(null);
868
+ return B;
869
+ }, Wt(E, A) {
870
+ const t = u, e = E.Ht, B = E.loca;
871
+ if (B[A] === B[A + 1]) return null;
872
+ const r = p.findTable(e, "glyf", E.Jt);
588
873
  if (!r) return null;
589
- let i = r[0] + s[A];
590
- const B = {};
591
- if (B.noc = t.readShort(e, i), i += 2, B.xMin = t.readShort(e, i), i += 2, B.yMin = t.readShort(e, i), i += 2, B.xMax = t.readShort(e, i), i += 2, B.yMax = t.readShort(e, i), i += 2, B.xMin >= B.xMax || B.yMin >= B.yMax) return null;
592
- if (B.noc > 0) {
593
- B.endPts = [];
594
- for (let h = 0; h < B.noc; h++) B.endPts.push(t.readUshort(e, i)), i += 2;
874
+ let i = r[0] + B[A];
875
+ const s = {};
876
+ if (s.noc = t.readShort(e, i), i += 2, s.xMin = t.readShort(e, i), i += 2, s.yMin = t.readShort(e, i), i += 2, s.xMax = t.readShort(e, i), i += 2, s.yMax = t.readShort(e, i), i += 2, s.xMin >= s.xMax || s.yMin >= s.yMax) return null;
877
+ if (s.noc > 0) {
878
+ s.endPts = [];
879
+ for (let h = 0; h < s.noc; h++) s.endPts.push(t.readUshort(e, i)), i += 2;
595
880
  const Q = t.readUshort(e, i);
596
881
  if (i += 2, e.length - i < Q) return null;
597
882
  i += Q;
598
- const n = B.endPts[B.noc - 1] + 1;
599
- B.flags = [];
600
- for (let h = 0; h < n; h++) {
601
- const u = e[i];
602
- if (i++, B.flags.push(u), 8 & u) {
883
+ const o = s.endPts[s.noc - 1] + 1;
884
+ s.flags = [];
885
+ for (let h = 0; h < o; h++) {
886
+ const l = e[i];
887
+ if (i++, s.flags.push(l), 8 & l) {
603
888
  const c = e[i];
604
889
  i++;
605
- for (let l = 0; l < c; l++) B.flags.push(u), h++;
890
+ for (let C = 0; C < c; C++) s.flags.push(l), h++;
606
891
  }
607
892
  }
608
- B.xs = [];
609
- for (let h = 0; h < n; h++) {
610
- const u = B.flags[h], c = !!(16 & u);
611
- 2 & u ? (B.xs.push(c ? e[i] : -e[i]), i++) : c ? B.xs.push(0) : (B.xs.push(t.readShort(e, i)), i += 2);
893
+ s.xs = [];
894
+ for (let h = 0; h < o; h++) {
895
+ const l = s.flags[h], c = !!(16 & l);
896
+ 2 & l ? (s.xs.push(c ? e[i] : -e[i]), i++) : c ? s.xs.push(0) : (s.xs.push(t.readShort(e, i)), i += 2);
612
897
  }
613
- B.ys = [];
614
- for (let h = 0; h < n; h++) {
615
- const u = B.flags[h], c = !!(32 & u);
616
- 4 & u ? (B.ys.push(c ? e[i] : -e[i]), i++) : c ? B.ys.push(0) : (B.ys.push(t.readShort(e, i)), i += 2);
898
+ s.ys = [];
899
+ for (let h = 0; h < o; h++) {
900
+ const l = s.flags[h], c = !!(32 & l);
901
+ 4 & l ? (s.ys.push(c ? e[i] : -e[i]), i++) : c ? s.ys.push(0) : (s.ys.push(t.readShort(e, i)), i += 2);
617
902
  }
618
903
  let g = 0, a = 0;
619
- for (let h = 0; h < n; h++) g += B.xs[h], a += B.ys[h], B.xs[h] = g, B.ys[h] = a;
620
- } else B.parts = [], B.endPts = [], B.flags = [], B.xs = [], B.ys = [];
621
- return B;
622
- } } }, b = { parse: (o) => [((A, t, e, s) => {
623
- const r = N, i = { LA: A, jA: t, JA: e };
624
- for (const B in r) {
625
- const Q = B, n = b.findTable(A, Q, e);
626
- if (n) {
627
- const [g, a] = n;
628
- let h = s[g];
629
- h == null && (h = r[Q].parseTab(A, g, a, i), s[g] = h), i[Q] = h;
904
+ for (let h = 0; h < o; h++) g += s.xs[h], a += s.ys[h], s.xs[h] = g, s.ys[h] = a;
905
+ } else s.parts = [], s.endPts = [], s.flags = [], s.xs = [], s.ys = [];
906
+ return s;
907
+ } } }, p = { parse: (E) => [((A, t, e, B) => {
908
+ const r = z, i = { Ht: A, Vt: t, Jt: e };
909
+ for (const s in r) {
910
+ const Q = s, o = p.findTable(A, Q, e);
911
+ if (o) {
912
+ const [g, a] = o;
913
+ let h = B[g];
914
+ h == null && (h = r[Q].parseTab(A, g, a, i), B[g] = h), i[Q] = h;
630
915
  }
631
916
  }
632
917
  return i;
633
- })(new Uint8Array(o), 0, 0, {})], findTable(o, A, t) {
634
- const e = f, s = e.readUshort(o, t + 4);
918
+ })(new Uint8Array(E), 0, 0, {})], findTable(E, A, t) {
919
+ const e = u, B = e.readUshort(E, t + 4);
635
920
  let r = t + 12;
636
- for (let i = 0; i < s; i++) {
637
- const B = e.readASCII(o, r, 4);
638
- e.readUint(o, r + 4);
639
- const Q = e.readUint(o, r + 8), n = e.readUint(o, r + 12);
640
- if (B === A) return [Q, n];
921
+ for (let i = 0; i < B; i++) {
922
+ const s = e.readASCII(E, r, 4);
923
+ e.readUint(E, r + 4);
924
+ const Q = e.readUint(E, r + 8), o = e.readUint(E, r + 12);
925
+ if (s === A) return [Q, o];
641
926
  r += 16;
642
927
  }
643
928
  return null;
644
- }, T: N, B: f };
645
- class G {
929
+ }, T: z, B: u };
930
+ class F {
646
931
  constructor() {
647
- E(this, "KA", /* @__PURE__ */ new Map());
648
- E(this, "WA", /* @__PURE__ */ new Map());
649
- }
650
- NA(A, t) {
651
- const e = `${this.ZA(A)}_${t}`;
652
- if (this.KA.has(e)) return this.KA.get(e);
653
- const s = A.cmap;
654
- if (!s || !s.tables) return this.KA.set(e, 0), 0;
932
+ n(this, "Kt", /* @__PURE__ */ new Map());
933
+ n(this, "jt", /* @__PURE__ */ new Map());
934
+ }
935
+ Zt(A, t) {
936
+ const e = `${this.Nt(A)}_${t}`;
937
+ if (this.Kt.has(e)) return this.Kt.get(e);
938
+ const B = A.cmap;
939
+ if (!B || !B.tables) return this.Kt.set(e, 0), 0;
655
940
  let r = 0;
656
- for (const i of s.tables) if (i.format === 4 ? r = this.XA(t, i) : i.format === 12 && (r = this.qA(t, i)), r > 0) break;
657
- return this.KA.set(e, r), r;
941
+ for (const i of B.tables) if (i.format === 4 ? r = this.Xt(t, i) : i.format === 12 && (r = this.qt(t, i)), r > 0) break;
942
+ return this.Kt.set(e, r), r;
658
943
  }
659
- At(A, t) {
944
+ Ae(A, t) {
660
945
  const e = t.codePointAt(0);
661
- return e === void 0 ? 0 : this.NA(A, e);
946
+ return e === void 0 ? 0 : this.Zt(A, e);
662
947
  }
663
- tt(A, t) {
948
+ te(A, t) {
664
949
  const e = A.hmtx;
665
950
  return e && e.aWidth && e.aWidth.length !== 0 ? t < e.aWidth.length ? e.aWidth[t] : e.aWidth[e.aWidth.length - 1] : 0;
666
951
  }
667
- et(A, t) {
668
- const e = t / A.head.unitsPerEm, s = A.hhea.ascender * e, r = A.hhea.descender * e, i = A.hhea.lineGap * e;
669
- return { ascender: s, descender: r, lineGap: i, lineHeight: s - r + i, unitsPerEm: A.head.unitsPerEm, scale: e };
952
+ ee(A, t) {
953
+ const e = t / A.head.unitsPerEm, B = A.hhea.ascender * e, r = A.hhea.descender * e, i = A.hhea.lineGap * e;
954
+ return { ascender: B, descender: r, lineGap: i, lineHeight: B - r + i, unitsPerEm: A.head.unitsPerEm, scale: e };
670
955
  }
671
- st() {
672
- this.KA.clear(), this.WA.clear();
956
+ Be() {
957
+ this.Kt.clear(), this.jt.clear();
673
958
  }
674
- ZA(A) {
675
- return `${A.JA}_${A.LA.length}`;
959
+ Nt(A) {
960
+ return `${A.Jt}_${A.Ht.length}`;
676
961
  }
677
- XA(A, t) {
962
+ Xt(A, t) {
678
963
  const e = t.endCount.length;
679
- let s = -1;
964
+ let B = -1;
680
965
  for (let r = 0; r < e; r++) if (A <= t.endCount[r]) {
681
- s = r;
966
+ B = r;
682
967
  break;
683
968
  }
684
- if (s === -1 || A < t.startCount[s]) return 0;
685
- if (t.idRangeOffset[s] === 0) return A + t.idDelta[s] & 65535;
969
+ if (B === -1 || A < t.startCount[B]) return 0;
970
+ if (t.idRangeOffset[B] === 0) return A + t.idDelta[B] & 65535;
686
971
  {
687
- const r = t.idRangeOffset[s] / 2 + (A - t.startCount[s]) - (e - s);
972
+ const r = t.idRangeOffset[B] / 2 + (A - t.startCount[B]) - (e - B);
688
973
  if (r >= 0 && r < t.glyphIdArray.length) {
689
974
  const i = t.glyphIdArray[r];
690
- return i === 0 ? 0 : i + t.idDelta[s] & 65535;
975
+ return i === 0 ? 0 : i + t.idDelta[B] & 65535;
691
976
  }
692
977
  }
693
978
  return 0;
694
979
  }
695
- qA(A, t) {
980
+ qt(A, t) {
696
981
  const e = t.groups.length / 3;
697
- for (let s = 0; s < e; s++) {
698
- const r = t.groups[3 * s], i = t.groups[3 * s + 1], B = t.groups[3 * s + 2];
699
- if (A >= r && A <= i) return B + (A - r);
982
+ for (let B = 0; B < e; B++) {
983
+ const r = t.groups[3 * B], i = t.groups[3 * B + 1], s = t.groups[3 * B + 2];
984
+ if (A >= r && A <= i) return s + (A - r);
700
985
  }
701
986
  return 0;
702
987
  }
703
988
  }
704
- class aA {
989
+ class fA {
705
990
  constructor(A) {
706
- E(this, "rt");
707
- this.rt = A;
991
+ n(this, "Qe");
992
+ this.Qe = A;
708
993
  }
709
- Bt(A) {
994
+ se(A) {
710
995
  var e;
711
996
  const t = [];
712
- return (e = A == null ? void 0 : A.cmap) != null && e.tables ? (A.cmap.tables.forEach((s) => {
713
- if (s.format === 4) {
714
- const r = this.it(s);
997
+ return (e = A.cmap) != null && e.tables ? (A.cmap.tables.forEach((B) => {
998
+ if (B.format === 4) {
999
+ const r = this.Ee(B);
715
1000
  t.push(...r);
716
- } else if (s.format === 12) {
717
- const r = this.Qt(s);
1001
+ } else if (B.format === 12) {
1002
+ const r = this.ie(B);
718
1003
  t.push(...r);
719
1004
  }
720
1005
  }), [...new Set(t)]) : [];
721
1006
  }
722
- Et(A, t) {
723
- return this.rt.At(A, t) > 0;
1007
+ re(A, t) {
1008
+ return this.Qe.Ae(A, t) > 0;
724
1009
  }
725
- ot(A, t) {
726
- for (const e of t) if (!this.Et(A, e)) return !1;
1010
+ ne(A, t) {
1011
+ for (const e of t) if (!this.re(A, e)) return !1;
727
1012
  return !0;
728
1013
  }
729
- gt(A, t) {
730
- return t.filter((e) => this.Et(A, e));
1014
+ ge(A, t) {
1015
+ return t.filter((e) => this.re(A, e));
731
1016
  }
732
- nt(A) {
733
- return A.filter((t) => this.ht(t));
1017
+ oe(A) {
1018
+ return A.filter((t) => this.ae(t));
734
1019
  }
735
- it(A) {
1020
+ Ee(A) {
736
1021
  const t = [];
737
1022
  if (!(A.startCount && A.endCount && A.idRangeOffset && A.idDelta)) return t;
738
1023
  for (let e = 0; e < A.startCount.length; e++) {
739
- const s = A.startCount[e], r = A.endCount[e];
740
- if (s !== 65535 || r !== 65535) {
741
- for (let i = s; i <= r; i++)
742
- if (this.lt(A, i, e) > 0) try {
743
- const B = String.fromCodePoint(i);
744
- t.push(B);
1024
+ const B = A.startCount[e], r = A.endCount[e];
1025
+ if (B !== 65535 || r !== 65535) {
1026
+ for (let i = B; i <= r; i++)
1027
+ if (this.ce(A, i, e) > 0) try {
1028
+ const s = String.fromCodePoint(i);
1029
+ t.push(s);
745
1030
  } catch {
746
1031
  }
747
1032
  }
748
1033
  }
749
1034
  return t;
750
1035
  }
751
- Qt(A) {
1036
+ ie(A) {
752
1037
  const t = [];
753
1038
  if (!A.groups) return t;
754
1039
  for (let e = 0; e < A.groups.length; e += 3) {
755
- const s = A.groups[e], r = A.groups[e + 1], i = A.groups[e + 2];
756
- for (let B = s; B <= r; B++)
757
- if (i + (B - s) > 0) try {
758
- const Q = String.fromCodePoint(B);
1040
+ const B = A.groups[e], r = A.groups[e + 1], i = A.groups[e + 2];
1041
+ for (let s = B; s <= r; s++)
1042
+ if (i + (s - B) > 0) try {
1043
+ const Q = String.fromCodePoint(s);
759
1044
  t.push(Q);
760
1045
  } catch {
761
1046
  }
762
1047
  }
763
1048
  return t;
764
1049
  }
765
- lt(A, t, e) {
1050
+ ce(A, t, e) {
766
1051
  if (A.idRangeOffset[e] === 0) return t + A.idDelta[e] & 65535;
767
1052
  {
768
- const s = A.idRangeOffset[e] / 2 + (t - A.startCount[e]) - (A.startCount.length - e);
769
- if (s >= 0 && A.glyphIdArray && s < A.glyphIdArray.length) {
770
- const r = A.glyphIdArray[s];
1053
+ const B = A.idRangeOffset[e] / 2 + (t - A.startCount[e]) - (A.startCount.length - e);
1054
+ if (B >= 0 && A.glyphIdArray && B < A.glyphIdArray.length) {
1055
+ const r = A.glyphIdArray[B];
771
1056
  if (r !== 0) return r + A.idDelta[e] & 65535;
772
1057
  }
773
1058
  }
774
1059
  return 0;
775
1060
  }
776
- ht(A) {
1061
+ ae(A) {
777
1062
  const t = A.codePointAt(0) || 0;
778
1063
  return !(t >= 0 && t <= 31 && t !== 9 && t !== 10 && t !== 13 || t >= 127 && t <= 159);
779
1064
  }
780
1065
  }
781
- class lA {
1066
+ class dA {
782
1067
  constructor() {
783
- E(this, "ct");
784
- const A = new G();
785
- this.ct = new aA(A);
1068
+ n(this, "he");
1069
+ const A = new F();
1070
+ this.he = new fA(A);
786
1071
  }
787
1072
  extractCharacters(A) {
788
- return this.ct.Bt(A);
1073
+ return this.he.se(A);
789
1074
  }
790
1075
  filterProblematicCharacters(A) {
791
- return this.ct.nt(A);
1076
+ return this.he.oe(A);
792
1077
  }
793
1078
  characterExists(A, t) {
794
- return this.ct.Et(A, t);
1079
+ return this.he.re(A, t);
795
1080
  }
796
1081
  allCharactersExist(A, t) {
797
- return this.ct.ot(A, t);
1082
+ return this.he.ne(A, t);
798
1083
  }
799
1084
  }
800
- class cA {
1085
+ class wA {
801
1086
  constructor(A) {
802
- E(this, "Dt");
803
- E(this, "Ct");
804
- E(this, "ut");
805
- E(this, "Pt");
806
- this.ut = A, this.Pt = new G(), this.Dt = document.createElement("canvas"), this.Ct = this.Dt.getContext("2d", { willReadFrequently: !0, alpha: !1 });
807
- }
808
- createTextureAtlas(A, t, e, s) {
809
- const r = A.length, i = Math.ceil(Math.sqrt(r)), B = Math.ceil(r / i), Q = t.width * i, n = t.height * B, g = typeof s == "object" ? s : null;
810
- this.It(Q, n), this.wt(A, t, i, e, g);
811
- const a = this.ut.UA(Q, n, { filter: "nearest" });
812
- return a.S(this.Dt), { framebuffer: a, columns: i, rows: B };
813
- }
814
- It(A, t) {
815
- this.Dt.width = A, this.Dt.height = t, this.Dt.style.width = A + "px", this.Dt.style.height = A + "px", this.Ct.imageSmoothingEnabled = !1, this.Dt.style.imageRendering = "pixelated", this.Ct.fillStyle = "black", this.Ct.fillRect(0, 0, A, t), this.Ct.textBaseline = "top", this.Ct.textAlign = "left", this.Ct.fillStyle = "white";
816
- }
817
- wt(A, t, e, s, r) {
818
- const i = s / r.head.unitsPerEm;
819
- for (let B = 0; B < A.length; B++) {
820
- const Q = B % e, n = Math.floor(B / e), g = A[B].character, a = this.ft(r, g);
1087
+ n(this, "Ce");
1088
+ n(this, "De");
1089
+ n(this, "le");
1090
+ n(this, "Pe");
1091
+ this.le = A, this.Pe = new F(), this.Ce = document.createElement("canvas"), this.De = this.Ce.getContext("2d", { willReadFrequently: !0, alpha: !1 });
1092
+ }
1093
+ createTextureAtlas(A, t, e, B) {
1094
+ const r = A.length, i = Math.ceil(Math.sqrt(r)), s = Math.ceil(r / i), Q = t.width * i, o = t.height * s, g = typeof B == "object" ? B : null;
1095
+ this.Ie(Q, o), this.ue(A, t, i, e, g);
1096
+ const a = this.le.St(Q, o, 1, { filter: "nearest" });
1097
+ return a.R(this.Ce), { framebuffer: a, columns: i, rows: s };
1098
+ }
1099
+ Ie(A, t) {
1100
+ this.Ce.width = A, this.Ce.height = t, this.Ce.style.width = A + "px", this.Ce.style.height = A + "px", this.De.imageSmoothingEnabled = !1, this.Ce.style.imageRendering = "pixelated", this.De.fillStyle = "black", this.De.fillRect(0, 0, A, t), this.De.textBaseline = "top", this.De.textAlign = "left", this.De.fillStyle = "white";
1101
+ }
1102
+ ue(A, t, e, B, r) {
1103
+ const i = B / r.head.unitsPerEm;
1104
+ for (let s = 0; s < A.length; s++) {
1105
+ const Q = s % e, o = Math.floor(s / e), g = A[s].character, a = this.we(r, g);
821
1106
  if (!a) continue;
822
- const h = g.codePointAt(0) || 0, u = this.Pt.NA(r, h), c = this.dt(r, u) * i, l = Q * t.width, d = n * t.height, C = l + 0.5 * t.width, P = d + 0.5 * t.height, w = Math.round(C - 0.5 * t.width), m = Math.round(P - 0.5 * s), y = w + 0.5 * (t.width - c), x = m + r.hhea.ascender * i;
823
- this._t(a, y, x, i);
1107
+ const h = g.codePointAt(0) || 0, l = this.Pe.Zt(r, h), c = this.fe(r, l) * i, C = Q * t.width, d = o * t.height, I = C + 0.5 * t.width, w = d + 0.5 * t.height, m = Math.round(I - 0.5 * t.width), R = Math.round(w - 0.5 * B), $ = m + 0.5 * (t.width - c), V = R + r.hhea.ascender * i;
1108
+ this.de(a, $, V, i);
824
1109
  }
825
1110
  }
826
- ft(A, t) {
827
- const e = t.codePointAt(0) || 0, s = this.Pt.NA(A, e);
828
- if (s === 0) return null;
829
- if (A.glyf && A.glyf[s] !== null) return A.glyf[s];
830
- if (b && b.T && b.T.glyf) {
831
- const r = b.T.glyf.zA(A, s);
832
- return A.glyf && r && (A.glyf[s] = r), r;
1111
+ we(A, t) {
1112
+ const e = t.codePointAt(0) || 0, B = this.Pe.Zt(A, e);
1113
+ if (B === 0) return null;
1114
+ if (A.glyf && A.glyf[B] !== null) return A.glyf[B];
1115
+ if (p && p.T && p.T.glyf) {
1116
+ const r = p.T.glyf.Wt(A, B);
1117
+ return A.glyf && r && (A.glyf[B] = r), r;
833
1118
  }
834
1119
  return null;
835
1120
  }
836
- dt(A, t) {
1121
+ fe(A, t) {
837
1122
  const e = A.hmtx;
838
1123
  return e && e.aWidth ? t < e.aWidth.length ? e.aWidth[t] : e.aWidth[e.aWidth.length - 1] : 0;
839
1124
  }
840
- _t(A, t, e, s) {
1125
+ de(A, t, e, B) {
841
1126
  if (!A || !A.xs || A.noc === 0) return;
842
- const { xs: r, ys: i, endPts: B, flags: Q } = A;
843
- if (!(r && i && B && Q)) return;
844
- this.Ct.beginPath();
845
- let n = 0;
846
- for (let g = 0; g < B.length; g++) {
847
- const a = B[g];
848
- if (!(a < n)) {
849
- if (a >= n) {
850
- const h = t + r[n] * s, u = e - i[n] * s;
851
- this.Ct.moveTo(h, u);
852
- let c = n + 1;
1127
+ const { xs: r, ys: i, endPts: s, flags: Q } = A;
1128
+ if (!(r && i && s && Q)) return;
1129
+ this.De.beginPath();
1130
+ let o = 0;
1131
+ for (let g = 0; g < s.length; g++) {
1132
+ const a = s[g];
1133
+ if (!(a < o)) {
1134
+ if (a >= o) {
1135
+ const h = t + r[o] * B, l = e - i[o] * B;
1136
+ this.De.moveTo(h, l);
1137
+ let c = o + 1;
853
1138
  for (; c <= a; )
854
1139
  if (1 & Q[c]) {
855
- const l = t + r[c] * s, d = e - i[c] * s;
856
- this.Ct.lineTo(l, d), c++;
1140
+ const C = t + r[c] * B, d = e - i[c] * B;
1141
+ this.De.lineTo(C, d), c++;
857
1142
  } else {
858
- const l = t + r[c] * s, d = e - i[c] * s;
859
- let C = c + 1 > a ? n : c + 1;
860
- if (1 & Q[C]) {
861
- const P = t + r[C] * s, w = e - i[C] * s;
862
- this.Ct.quadraticCurveTo(l, d, P, w), c = C + 1;
1143
+ const C = t + r[c] * B, d = e - i[c] * B;
1144
+ let I = c + 1 > a ? o : c + 1;
1145
+ if (1 & Q[I]) {
1146
+ const w = t + r[I] * B, m = e - i[I] * B;
1147
+ this.De.quadraticCurveTo(C, d, w, m), c = I + 1;
863
1148
  } else {
864
- const P = (l + (t + r[C] * s)) / 2, w = (d + (e - i[C] * s)) / 2;
865
- this.Ct.quadraticCurveTo(l, d, P, w), c = C;
1149
+ const w = (C + (t + r[I] * B)) / 2, m = (d + (e - i[I] * B)) / 2;
1150
+ this.De.quadraticCurveTo(C, d, w, m), c = I;
866
1151
  }
867
1152
  }
868
- this.Ct.closePath();
1153
+ this.De.closePath();
869
1154
  }
870
- n = a + 1;
1155
+ o = a + 1;
871
1156
  }
872
1157
  }
873
- this.Ct.fill();
1158
+ this.De.fill();
874
1159
  }
875
1160
  }
876
- class uA {
1161
+ class mA {
877
1162
  constructor() {
878
- E(this, "rt");
879
- this.rt = new G();
1163
+ n(this, "Qe");
1164
+ this.Qe = new F();
880
1165
  }
881
1166
  calculateMaxGlyphDimensions(A, t, e) {
882
- let s = 0;
883
- const r = this.rt.et(e, t), i = r.lineHeight;
884
- for (const B of A) {
885
- const Q = this.rt.At(e, B);
1167
+ let B = 0;
1168
+ const r = this.Qe.ee(e, t), i = r.lineHeight;
1169
+ for (const s of A) {
1170
+ const Q = this.Qe.Ae(e, s);
886
1171
  if (Q === 0) continue;
887
- const n = this.rt.tt(e, Q) * r.scale;
888
- s = Math.max(s, n);
1172
+ const o = this.Qe.te(e, Q) * r.scale;
1173
+ B = Math.max(B, o);
889
1174
  }
890
- return { width: Math.ceil(s), height: Math.ceil(i) };
1175
+ return { width: Math.ceil(B), height: Math.ceil(i) };
891
1176
  }
892
1177
  getCharacterAdvanceWidth(A, t, e) {
893
- const s = this.rt.et(e, t), r = this.rt.At(e, A);
894
- return this.rt.tt(e, r) * s.scale;
1178
+ const B = this.Qe.ee(e, t), r = this.Qe.Ae(e, A);
1179
+ return this.Qe.te(e, r) * B.scale;
895
1180
  }
896
1181
  getFontMetrics(A, t) {
897
- return this.rt.et(t, A);
1182
+ return this.Qe.ee(t, A);
898
1183
  }
899
- st() {
900
- this.rt.st();
1184
+ Be() {
1185
+ this.Qe.Be();
901
1186
  }
902
1187
  }
903
- class CA {
1188
+ class pA {
904
1189
  constructor() {
905
- E(this, "Pt");
906
- this.Pt = new G();
1190
+ n(this, "Pe");
1191
+ this.Pe = new F();
907
1192
  }
908
1193
  createCharacterObjects(A, t) {
909
- return A.map((e, s) => {
910
- const r = e.codePointAt(0) || 0, i = this.vt(s);
911
- let B = 0;
1194
+ return A.map((e, B) => {
1195
+ const r = e.codePointAt(0) || 0, i = this.pe(B);
1196
+ let s = 0;
912
1197
  if (t.hmtx && t.hmtx.aWidth) {
913
- const Q = this.Pt.NA(t, r);
914
- Q > 0 && t.hmtx.aWidth[Q] !== void 0 && (B = t.hmtx.aWidth[Q]);
1198
+ const Q = this.Pe.Zt(t, r);
1199
+ Q > 0 && t.hmtx.aWidth[Q] !== void 0 && (s = t.hmtx.aWidth[Q]);
915
1200
  }
916
- return { character: e, unicode: r, color: i, advanceWidth: B };
1201
+ return { character: e, unicode: r, color: i, advanceWidth: s };
917
1202
  });
918
1203
  }
919
- vt(A) {
920
- return [A % 256, Math.floor(A / 256) % 256, Math.floor(A / 65536) % 256];
1204
+ pe(A) {
1205
+ return [A % 256 / 255, Math.floor(A / 256) % 256 / 255, Math.floor(A / 65536) % 256 / 255];
921
1206
  }
922
- getCharacterColor(A, t) {
923
- if (!D.C(typeof A == "string", "Character must be a string.", { method: "getCharacterColor", providedValue: A })) return [0, 0, 0];
924
- const e = t.find((s) => s.character === A);
1207
+ me(A, t) {
1208
+ if (!T.l(typeof A == "string", "Character must be a string.", { method: "getCharacterColor", providedValue: A })) return [0, 0, 0];
1209
+ const e = t.find((B) => B.character === A);
925
1210
  return e ? e.color : [0, 0, 0];
926
1211
  }
927
- getCharacterColors(A, t) {
928
- return D.C(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.getCharacterColor(e, t) || [0, 0, 0]) : [[0, 0, 0]];
1212
+ _e(A, t) {
1213
+ return T.l(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.me(e, t) || [0, 0, 0]) : [[0, 0, 0]];
929
1214
  }
930
1215
  }
931
- class DA {
1216
+ class yA {
932
1217
  constructor(A, t = 16) {
933
- E(this, "bt");
934
- E(this, "xt", []);
935
- E(this, "yt");
936
- E(this, "Mt", 16);
937
- E(this, "Gt", 0);
938
- E(this, "Ft", 0);
939
- E(this, "$t", { width: 0, height: 0 });
940
- E(this, "Yt");
941
- E(this, "Tt", "UrsaFont");
942
- E(this, "St");
943
- E(this, "Ot");
944
- E(this, "Ut");
945
- E(this, "Rt");
946
- this.Mt = t, this.St = new lA(), this.Ot = new cA(A), this.Ut = new uA(), this.Rt = new CA();
947
- }
948
- async kt(A) {
1218
+ n(this, "ve");
1219
+ n(this, "xe", []);
1220
+ n(this, "ye");
1221
+ n(this, "be", 16);
1222
+ n(this, "Ge", 0);
1223
+ n(this, "$e", 0);
1224
+ n(this, "Me", { width: 0, height: 0 });
1225
+ n(this, "Ye");
1226
+ n(this, "Te");
1227
+ n(this, "ze");
1228
+ n(this, "Fe");
1229
+ n(this, "Re");
1230
+ this.be = t, this.Te = new dA(), this.ze = new wA(A), this.Fe = new mA(), this.Re = new pA();
1231
+ }
1232
+ async Se(A) {
949
1233
  let t;
950
1234
  if (A) {
951
1235
  const e = await fetch(A);
952
- if (!e.ok) throw new I(`Failed to load font file: ${e.status} ${e.statusText}`);
1236
+ if (!e.ok) throw new f(`Failed to load font file: ${e.status} ${e.statusText}`);
953
1237
  t = await e.arrayBuffer();
954
1238
  } else
955
1239
  t = await (await fetch(`data:font/truetype;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMs+QEyQAAAEoAAAAYGNtYXAg7yVJAAAFjAAACSBnbHlmuHLTdAAAErQAAGi0aGVhZFvXdUwAAACsAAAANmhoZWELAQUCAAAA5AAAACRobXR4BACDgAAAAYgAAAQEbG9jYQAy54AAAA6sAAAECG1heHABIgCCAAABCAAAACBuYW1lVs/OSgAAe2gAAAOicG9zdABpADQAAH8MAAAAIAABAAAAAQAAzOWHqV8PPPUAAAQAAAAAAHxiGCcAAAAAfGIYJwAAAAAEAAQAAAAACAACAAEAAAAAAAEAAAQAAAAAAAQAAAAAAAcAAAEAAAAAAAAAAAAAAAAAAAEBAAEAAAEBAIAAIAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAgQAAZAABQAEAgACAAAAAAACAAIAAAACAAAzAMwAAAAABAAAAAAAAACAAACLAABw4wAAAAAAAAAAWUFMLgBAACAmawQAAAAAAAQAAAAAAAFRAAAAAAMABAAAAAAgAAAEAAAABAAAAAQAAAAEAAGABAABAAQAAIAEAACABAAAgAQAAIAEAAGABAABAAQAAQAEAACABAABAAQAAIAEAACABAABAAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAABAAQAAIAEAAEABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAABAAQAAIAEAAEABAAAgAQAAIAEAAEABAAAgAQAAIAEAACABAAAgAQAAIAEAAEABAAAgAQAAIAEAAGABAAAgAQAAIAEAAGABAAAgAQAAIAEAACABAAAgAQAAIAEAAEABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAABgAQAAQAEAACABAAAAAQAAgAEAACABAAAgAQAAIAEAACABAACAAQAAAAEAAIABAABgAQAAgAEAACABAAAgAQAAAAEAACABAAAAAQAAAAEAAAABAAAAAQAAAAEAAIABAADAAQAAAAEAAAABAAAgAQAAYAEAAAABAAAAAQAAIAEAAAABAAAgAQAAIAEAACABAAAAAQAAIAEAAAABAAAAAQAAIAEAAGABAAAAAQAAAAEAAAABAAAAAQAAIAEAACABAAAAAQAAIAEAACABAAAAAQAAIAEAACABAAAgAQAAAAEAAC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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\r
956
1240
  `)).arrayBuffer();
957
- await this.Vt(t), this.bt = b.parse(t)[0], await this.Ht();
1241
+ await this.Oe(t), this.ve = p.parse(t)[0], await this.Le();
958
1242
  }
959
- zt(A) {
960
- if (A === void 0) return this.Mt;
961
- this.Mt = A, this.$t = this.Ut.calculateMaxGlyphDimensions(this.xt.map((e) => e.character), this.Mt, this.bt);
962
- const t = this.Ot.createTextureAtlas(this.xt, this.$t, this.Mt, this.bt);
963
- this.yt = t.framebuffer, this.Gt = t.columns, this.Ft = t.rows;
1243
+ Ue(A) {
1244
+ if (A === void 0) return this.be;
1245
+ this.be = A, this.Me = this.Fe.calculateMaxGlyphDimensions(this.xe.map((e) => e.character), this.be, this.ve);
1246
+ const t = this.ze.createTextureAtlas(this.xe, this.Me, this.be, this.ve);
1247
+ this.ye = t.framebuffer, this.Ge = t.columns, this.$e = t.rows;
964
1248
  }
965
- async Lt(A) {
1249
+ async ke(A) {
966
1250
  try {
967
1251
  const t = await fetch(A);
968
- if (!t.ok) throw new I(`Failed to load font file: ${t.status} ${t.statusText}`);
1252
+ if (!t.ok) throw new f(`Failed to load font file: ${t.status} ${t.statusText}`);
969
1253
  const e = await t.arrayBuffer();
970
- await this.Vt(e);
971
- const s = b.parse(e);
972
- if (!s || s.length === 0) throw Error("Failed to parse font file");
973
- this.bt = s[0], await this.Ht();
1254
+ await this.Oe(e);
1255
+ const B = p.parse(e);
1256
+ if (!B || B.length === 0) throw Error("Failed to parse font file");
1257
+ this.ve = B[0], await this.Le();
974
1258
  } catch (t) {
975
- throw new I("Failed to load font: " + (t instanceof Error ? t.message : "Unknown error"), t);
1259
+ throw new f("Failed to load font: " + (t instanceof Error ? t.message : "Unknown error"), t);
976
1260
  }
977
1261
  }
978
- async Vt(A) {
1262
+ async Oe(A) {
979
1263
  const t = Date.now();
980
- this.Tt = this.Tt === "UrsaFont" ? "UrsaFont" : "CustomFont_" + t, this.Yt = new FontFace(this.Tt, A), await this.Yt.load(), document.fonts.add(this.Yt);
981
- }
982
- async Ht() {
983
- const A = this.St.extractCharacters(this.bt), t = this.St.filterProblematicCharacters(A);
984
- this.xt = this.Rt.createCharacterObjects(t, this.bt), this.$t = this.Ut.calculateMaxGlyphDimensions(t, this.Mt, this.bt);
985
- const e = this.Ot.createTextureAtlas(this.xt, this.$t, this.Mt, this.bt);
986
- this.yt = e.framebuffer, this.Gt = e.columns, this.Ft = e.rows;
1264
+ this.Ye = new FontFace("CustomFont_" + t, A), await this.Ye.load(), document.fonts.add(this.Ye);
987
1265
  }
988
- getCharacterColor(A) {
989
- return this.Rt.getCharacterColor(A, this.xt);
1266
+ async Le() {
1267
+ const A = this.Te.extractCharacters(this.ve), t = this.Te.filterProblematicCharacters(A);
1268
+ this.xe = this.Re.createCharacterObjects(t, this.ve), this.Me = this.Fe.calculateMaxGlyphDimensions(t, this.be, this.ve);
1269
+ const e = this.ze.createTextureAtlas(this.xe, this.Me, this.be, this.ve);
1270
+ this.ye = e.framebuffer, this.Ge = e.columns, this.$e = e.rows;
990
1271
  }
991
- getCharacterColors(A) {
992
- return this.Rt.getCharacterColors(A, this.xt);
1272
+ me(A) {
1273
+ return this.Re.me(A, this.xe);
993
1274
  }
994
- hasAllCharacters(A) {
995
- if (typeof A != "string" || A.length === 0) return !1;
996
- const t = new Set(this.xt.map((e) => e.character));
997
- for (const e of A) if (!t.has(e)) return !1;
998
- return !0;
1275
+ _e(A) {
1276
+ return this.Re._e(A, this.xe);
999
1277
  }
1000
- O() {
1001
- this.yt.O(), document.fonts.delete(this.Yt);
1278
+ W() {
1279
+ this.ye.W(), document.fonts.delete(this.Ye);
1002
1280
  }
1003
1281
  get fontFramebuffer() {
1004
- return this.yt;
1282
+ return this.ye;
1005
1283
  }
1006
1284
  get characters() {
1007
- return this.xt;
1285
+ return this.xe;
1008
1286
  }
1009
1287
  get textureColumns() {
1010
- return this.Gt;
1288
+ return this.Ge;
1011
1289
  }
1012
1290
  get textureRows() {
1013
- return this.Ft;
1291
+ return this.$e;
1014
1292
  }
1015
1293
  get maxGlyphDimensions() {
1016
- return this.$t;
1294
+ return this.Me;
1017
1295
  }
1018
1296
  get fontSize() {
1019
- return this.Mt;
1297
+ return this.be;
1020
1298
  }
1021
1299
  get font() {
1022
- return this.bt;
1300
+ return this.ve;
1023
1301
  }
1024
1302
  }
1025
- class PA {
1303
+ class xA {
1026
1304
  constructor(A, t, e) {
1027
- E(this, "Jt");
1028
- E(this, "jt");
1029
- E(this, "P");
1030
- E(this, "I");
1031
- E(this, "Kt");
1032
- E(this, "Wt");
1033
- E(this, "Nt", !1);
1034
- E(this, "Zt");
1035
- E(this, "Xt");
1036
- E(this, "qt");
1037
- this.Zt = A, this.Xt = t, this.qt = e, this.MA();
1038
- }
1039
- MA() {
1040
- this.Nt || (this.Jt = Math.floor(this.Zt.width / this.Xt), this.jt = Math.floor(this.Zt.height / this.qt)), this.Ae();
1041
- }
1042
- Ae() {
1043
- this.P = this.Jt * this.Xt, this.I = this.jt * this.qt, this.Kt = Math.floor((this.Zt.width - this.P) / 2), this.Wt = Math.floor((this.Zt.height - this.I) / 2);
1044
- }
1045
- te(A, t) {
1046
- this.Xt = A, this.qt = t, this.MA();
1047
- }
1048
- ee(A, t) {
1049
- this.Nt = !0, this.Jt = A, this.jt = t, this.Ae();
1305
+ n(this, "We");
1306
+ n(this, "He");
1307
+ n(this, "I");
1308
+ n(this, "u");
1309
+ n(this, "Je");
1310
+ n(this, "Ve");
1311
+ n(this, "Ke");
1312
+ n(this, "je");
1313
+ n(this, "Ze");
1314
+ this.Ke = A, this.je = t, this.Ze = e, this.PA();
1315
+ }
1316
+ PA() {
1317
+ this.We = Math.floor(this.Ke.width / this.je), this.He = Math.floor(this.Ke.height / this.Ze), this.I = this.We * this.je, this.u = this.He * this.Ze, this.Je = Math.floor((this.Ke.width - this.I) / 2), this.Ve = Math.floor((this.Ke.height - this.u) / 2);
1050
1318
  }
1051
- se() {
1052
- this.Nt = !1, this.MA();
1053
- }
1054
- re() {
1055
- this.Nt ? this.Ae() : this.MA();
1056
- }
1057
- Be(A) {
1058
- if (A === void 0) return this.Nt;
1059
- this.Nt = A;
1319
+ Ne(A, t) {
1320
+ this.je = A, this.Ze = t, this.PA();
1060
1321
  }
1061
1322
  get cellWidth() {
1062
- return this.Xt;
1323
+ return this.je;
1063
1324
  }
1064
1325
  get cellHeight() {
1065
- return this.qt;
1326
+ return this.Ze;
1066
1327
  }
1067
1328
  get cols() {
1068
- return this.Jt;
1329
+ return this.We;
1069
1330
  }
1070
1331
  get rows() {
1071
- return this.jt;
1332
+ return this.He;
1072
1333
  }
1073
1334
  get width() {
1074
- return this.P;
1335
+ return this.I;
1075
1336
  }
1076
1337
  get height() {
1077
- return this.I;
1338
+ return this.u;
1078
1339
  }
1079
1340
  get offsetX() {
1080
- return this.Kt;
1341
+ return this.Je;
1081
1342
  }
1082
1343
  get offsetY() {
1083
- return this.Wt;
1344
+ return this.Ve;
1084
1345
  }
1085
1346
  }
1086
- class dA {
1087
- constructor(A, t = !1, e = {}) {
1088
- E(this, "Zt");
1089
- E(this, "ie");
1090
- E(this, "Qe");
1091
- E(this, "Ee");
1092
- E(this, "onTransformChange");
1093
- this.ie = A, this.Qe = t, this.Zt = this.oe(e.width, e.height), t && this.setupTransformObserver();
1094
- }
1095
- oe(A, t) {
1096
- var s;
1347
+ class vA {
1348
+ constructor(A = {}) {
1349
+ n(this, "Ke");
1350
+ n(this, "Xe");
1351
+ n(this, "qe");
1352
+ A.canvas ? (this.Ke = A.canvas, this.qe = !1) : (this.Ke = this.AB(A.width, A.height), this.qe = !0), this.Ke.style.imageRendering = "pixelated";
1353
+ }
1354
+ AB(A, t) {
1097
1355
  const e = document.createElement("canvas");
1098
- if (e.className = "textmodeCanvas", e.style.imageRendering = "pixelated", this.Qe) e.width = A || 800, e.height = t || 600, document.body.appendChild(e);
1099
- else {
1100
- const r = this.ie.getBoundingClientRect();
1101
- let i = Math.round(r.width), B = Math.round(r.height);
1102
- if (this.ie instanceof HTMLVideoElement) {
1103
- const g = this.ie;
1104
- (i === 0 || B === 0) && g.videoWidth > 0 && g.videoHeight > 0 && (i = g.videoWidth, B = g.videoHeight);
1105
- }
1106
- e.width = i, e.height = B, e.style.position = "absolute", e.style.pointerEvents = "none";
1107
- const Q = window.getComputedStyle(this.ie);
1108
- let n = parseInt(Q.zIndex || "0", 10);
1109
- isNaN(n) && (n = 0), e.style.zIndex = "" + (n + 1), this.ge(e), (s = this.ie.parentNode) == null || s.insertBefore(e, this.ie.nextSibling);
1110
- }
1111
- return e;
1112
- }
1113
- ge(A) {
1114
- const t = this.ie.getBoundingClientRect();
1115
- let e = this.ie.offsetParent;
1116
- if (e && e !== document.body) {
1117
- const s = e.getBoundingClientRect();
1118
- A.style.top = t.top - s.top + "px", A.style.left = t.left - s.left + "px";
1119
- } else A.style.top = t.top + window.scrollY + "px", A.style.left = t.left + window.scrollX + "px";
1120
- }
1121
- re(A, t) {
1122
- if (this.Qe) this.Zt.width = A ?? this.Zt.width, this.Zt.height = t ?? this.Zt.height;
1123
- else {
1124
- const e = this.ie.getBoundingClientRect();
1125
- let s = Math.round(e.width), r = Math.round(e.height);
1126
- if (this.ie instanceof HTMLVideoElement) {
1127
- const i = this.ie;
1128
- (s === 0 || r === 0) && i.videoWidth > 0 && i.videoHeight > 0 && (s = i.videoWidth, r = i.videoHeight);
1129
- }
1130
- this.Zt.width = s, this.Zt.height = r, this.ge(this.Zt);
1131
- }
1356
+ return e.className = "textmodeCanvas", e.style.imageRendering = "pixelated", e.width = A || 800, e.height = t || 600, document.body.appendChild(e), e;
1132
1357
  }
1133
- ne() {
1134
- const A = { alpha: !1, premultipliedAlpha: !1, preserveDrawingBuffer: !0, antialias: !1, depth: !1, stencil: !1, powerPreference: "high-performance" }, t = this.Zt.getContext("webgl2", A) || this.Zt.getContext("webgl", A);
1135
- if (!t) throw new I("WebGL context could not be created. Ensure your browser supports WebGL.");
1136
- return t;
1358
+ S(A, t) {
1359
+ this.Ke.width = A ?? this.Ke.width, this.Ke.height = t ?? this.Ke.height;
1137
1360
  }
1138
- setupTransformObserver() {
1139
- this.Ee = new ResizeObserver((A) => {
1140
- for (const t of A) {
1141
- const e = t.contentRect;
1142
- !this.onTransformChange || Math.round(e.width) === this.Zt.width && Math.round(e.height) === this.Zt.height || this.onTransformChange();
1143
- }
1144
- }), this.Ee.observe(this.Zt);
1361
+ tB() {
1362
+ const A = this.Ke.getContext("webgl2", { alpha: !0, premultipliedAlpha: !1, preserveDrawingBuffer: !0, antialias: !1, depth: !1, stencil: !1, powerPreference: "high-performance" });
1363
+ if (!A) throw new f("`textmode.js` requires WebGL2 support.");
1364
+ return A;
1145
1365
  }
1146
- O() {
1147
- this.Ee && this.Ee.disconnect();
1148
- const A = this.Zt.getContext("webgl") || this.Zt.getContext("webgl2");
1366
+ W() {
1367
+ this.Xe && this.Xe.disconnect();
1368
+ const A = this.Ke.getContext("webgl") || this.Ke.getContext("webgl2");
1149
1369
  if (A) {
1150
1370
  const t = A.getExtension("WEBGL_lose_context");
1151
1371
  t && t.loseContext();
1152
1372
  }
1153
- this.Zt.parentNode && this.Zt.parentNode.removeChild(this.Zt);
1373
+ this.qe && this.Ke.parentNode && this.Ke.parentNode.removeChild(this.Ke);
1154
1374
  }
1155
1375
  get canvas() {
1156
- return this.Zt;
1376
+ return this.Ke;
1157
1377
  }
1158
1378
  get width() {
1159
- return this.Zt.width;
1379
+ return this.Ke.width;
1160
1380
  }
1161
1381
  get height() {
1162
- return this.Zt.height;
1382
+ return this.Ke.height;
1163
1383
  }
1164
1384
  }
1165
- class M {
1166
- constructor(A, t, e, s = {}) {
1167
- E(this, "ut");
1168
- E(this, "ae");
1169
- E(this, "he");
1170
- E(this, "le");
1171
- E(this, "ce");
1172
- E(this, "De");
1173
- E(this, "Ce");
1174
- E(this, "ue");
1175
- E(this, "h");
1176
- this.ut = A, this.ae = t, this.he = e, this.h = { enabled: !0, ...s };
1177
- const r = this.he.cols, i = this.he.rows;
1178
- this.le = this.ut.UA(r, i), this.ce = this.ut.UA(r, i), this.De = this.ut.UA(r, i), this.Ce = this.ut.UA(r, i), this.ue = this.ut.UA(r, i);
1179
- }
1180
- re() {
1181
- const A = this.he.cols, t = this.he.rows;
1182
- this.le.resize(A, t), this.ce.resize(A, t), this.De.resize(A, t), this.Ce.resize(A, t), this.ue.resize(A, t);
1183
- }
1184
- enabled(A) {
1185
- D.C(typeof A == "boolean" || typeof A == "number" && Number.isInteger(A), "Enabled must be a boolean value or an integer (0 for false, any other number for true).", { method: "enabled", providedValue: A }) && (this.h.enabled = !!A);
1186
- }
1187
- enable() {
1188
- this.enabled(!0);
1189
- }
1190
- disable() {
1191
- this.enabled(!1);
1192
- }
1193
- O() {
1194
- this.le.O(), this.ce.O(), this.De.O(), this.Ce.O(), this.ue.O();
1195
- }
1196
- get characterFramebuffer() {
1197
- return this.le;
1198
- }
1199
- get primaryColorFramebuffer() {
1200
- return this.ce;
1385
+ class bA {
1386
+ constructor(A = 60) {
1387
+ n(this, "eB");
1388
+ n(this, "BB");
1389
+ n(this, "QB", null);
1390
+ n(this, "sB", 0);
1391
+ n(this, "EB", !0);
1392
+ n(this, "iB", 0);
1393
+ n(this, "rB", 0);
1394
+ n(this, "nB", []);
1395
+ n(this, "gB", 10);
1396
+ n(this, "oB", 0);
1397
+ this.eB = A, this.BB = 1e3 / A;
1398
+ }
1399
+ start(A) {
1400
+ if (!this.EB) return;
1401
+ this.sB = performance.now();
1402
+ const t = (e) => {
1403
+ if (!this.EB) return void (this.QB = null);
1404
+ const B = e - this.sB;
1405
+ B >= this.BB && (A(), this.sB = e - B % this.BB), this.EB && (this.QB = requestAnimationFrame(t));
1406
+ };
1407
+ this.QB = requestAnimationFrame(t);
1201
1408
  }
1202
- get secondaryColorFramebuffer() {
1203
- return this.De;
1409
+ stop() {
1410
+ this.QB && (cancelAnimationFrame(this.QB), this.QB = null);
1204
1411
  }
1205
- get rotationFramebuffer() {
1206
- return this.Ce;
1412
+ pause() {
1413
+ this.EB && (this.EB = !1, this.stop());
1207
1414
  }
1208
- get transformFramebuffer() {
1209
- return this.ue;
1415
+ resume(A) {
1416
+ this.EB || (this.EB = !0, this.start(A));
1210
1417
  }
1211
- get options() {
1212
- return this.h;
1418
+ frameRate(A, t) {
1419
+ if (A === void 0) return this.iB;
1420
+ this.eB = A, this.BB = 1e3 / A, this.EB && t && (this.stop(), this.start(t));
1213
1421
  }
1214
- }
1215
- class IA {
1216
- constructor(A, t) {
1217
- E(this, "_");
1218
- E(this, "ut");
1219
- E(this, "Pe");
1220
- this.ut = A, this.Pe = t;
1221
- const e = Math.max(this.Pe.length, 1);
1222
- this._ = this.ut.UA(e, 1), this.Ie();
1223
- }
1224
- Ie() {
1225
- const A = this.Pe.length;
1226
- this._.width !== A && this._.resize(A, 1);
1227
- const t = new Uint8Array(1 * A * 4);
1228
- for (let e = 0; e < A; e++) {
1229
- const s = this.Pe[e], r = 4 * e;
1230
- t[r] = s[0], t[r + 1] = s[1], t[r + 2] = s[2], t[r + 3] = 255;
1422
+ measureFrameRate() {
1423
+ const A = performance.now();
1424
+ if (this.rB > 0) {
1425
+ const t = A - this.rB;
1426
+ this.nB.push(t), this.nB.length > this.gB && this.nB.shift();
1427
+ const e = this.nB.reduce((B, r) => B + r, 0) / this.nB.length;
1428
+ this.iB = 1e3 / e;
1231
1429
  }
1232
- this._.updatePixels(t, A, 1);
1233
- }
1234
- setColors(A) {
1235
- this.Pe = A, this.Ie();
1236
- }
1237
- get colors() {
1238
- return this.Pe;
1239
- }
1240
- get framebuffer() {
1241
- return this._;
1242
- }
1243
- }
1244
- class S extends M {
1245
- constructor(t, e, s, r = {}) {
1246
- super(t, e, s, { enabled: !0, characters: " .:-=+*%@#", characterColor: [1, 1, 1, 1], characterColorMode: "sampled", cellColor: [0, 0, 0, 1], cellColorMode: "fixed", invert: !1, rotation: [0, 0, 0, 1], flipHorizontally: !1, flipVertically: !1, ...r });
1247
- E(this, "we");
1248
- this.we = new IA(this.ut, this.ae.getCharacterColors(" .:-=+*%@#"));
1249
- }
1250
- characters(t) {
1251
- D.C(this.ae.hasAllCharacters(t), "One or more characters do not exist in the current font.", { method: "characters", providedValue: t }) && (this.h.characters = t, this.we.setColors(this.ae.getCharacterColors(t)));
1252
- }
1253
- characterColor(t, e, s, r = 255) {
1254
- const i = this.fe(t, "characterColor", e, s, r);
1255
- i && (this.h.characterColor = i);
1256
- }
1257
- characterColorMode(t) {
1258
- this.de(t, "characterColorMode");
1259
- }
1260
- cellColor(t, e, s, r = 255) {
1261
- const i = this.fe(t, "cellColor", e, s, r);
1262
- i && (this.h.cellColor = i);
1430
+ this.rB = A;
1263
1431
  }
1264
- cellColorMode(t) {
1265
- this.de(t, "cellColorMode");
1432
+ get isLooping() {
1433
+ return this.EB;
1266
1434
  }
1267
- invert(t) {
1268
- this.me(t, "invert", "Invert");
1435
+ get frameRateLimit() {
1436
+ return this.eB;
1269
1437
  }
1270
- rotation(t) {
1271
- if (!D.C(typeof t == "number", "Rotation angle must be a number.", { method: "rotation", providedValue: t })) return;
1272
- (t %= 360) < 0 && (t += 360);
1273
- const e = 255 * t / 360, s = Math.floor(e) / 255, r = Math.round(e - s);
1274
- this.h.rotation = [s, r, 0, 1];
1438
+ get currentFrameRate() {
1439
+ return this.iB;
1275
1440
  }
1276
- flipHorizontally(t) {
1277
- this.me(t, "flipHorizontally", "Flip horizontally");
1278
- }
1279
- flipVertically(t) {
1280
- this.me(t, "flipVertically", "Flip vertically");
1281
- }
1282
- fe(t, e, s, r, i = 255) {
1283
- let B, Q, n, g;
1284
- if (typeof t == "string") {
1285
- const a = this.pe(t);
1286
- if (!a) return D.C(!1, "Invalid hex color format. Use '#FF0000', '#F00', 'FF0000', or 'F00'.", { method: e, providedValue: t }), null;
1287
- [B, Q, n, g] = a;
1288
- } else if (B = t, Q = s !== void 0 ? s : t, n = r !== void 0 ? r : t, g = i, !D.C([B, Q, n, g].every((a) => a >= 0 && a <= 255), e.charAt(0).toUpperCase() + e.slice(1) + " color values must be between 0 and 255", { method: e, providedValues: { r: B, g: Q, b: n, a: g } })) return null;
1289
- return [B / 255, Q / 255, n / 255, g / 255];
1290
- }
1291
- de(t, e) {
1292
- D.C(["sampled", "fixed"].includes(t), "Invalid color mode. Must be 'sampled' or 'fixed'.", { method: e, providedValue: t }) && (this.h[e] = t);
1441
+ get frameCount() {
1442
+ return this.oB;
1293
1443
  }
1294
- me(t, e, s) {
1295
- D.C(typeof t == "boolean" || typeof t == "number" && Number.isInteger(t), s + " must be a boolean value or an integer (0 for false, any other number for true).", { method: e, providedValue: t }) && (this.h[e] = !!t);
1444
+ set frameCount(A) {
1445
+ this.oB = A;
1296
1446
  }
1297
- pe(t) {
1298
- return t = t.replace(/^#/, ""), /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(t) ? (t.length === 3 && (t = t.split("").map((e) => e + e).join("")), [parseInt(t.slice(0, 2), 16), parseInt(t.slice(2, 4), 16), parseInt(t.slice(4, 6), 16), 255]) : null;
1447
+ incrementFrame() {
1448
+ this.oB++;
1299
1449
  }
1300
- }
1301
- const R = `attribute vec2 a_position;\r
1302
- attribute vec2 a_texCoord;\r
1303
- varying vec2 v_uv;\r
1304
- \r
1305
- uniform float u_rotation; // rotation angle in radians\r
1306
- uniform vec2 u_center; // rotation center in normalized coordinates\r
1307
- uniform float u_aspectRatio; // canvas width / canvas height\r
1308
- \r
1309
- mat2 rotate2D(float angle) {\r
1310
- float s = sin(angle);\r
1311
- float c = cos(angle);\r
1312
- return mat2(c, -s, s, c);\r
1313
- }\r
1314
- \r
1315
- void main() {\r
1316
- v_uv = a_texCoord;\r
1317
- \r
1318
- // Use the position directly (it's already in normalized device coordinates)\r
1319
- vec2 pos = a_position;\r
1320
- \r
1321
- // Translate to origin for rotation\r
1322
- pos -= u_center;\r
1323
- \r
1324
- // Correct for aspect ratio: scale X coordinate to make space square\r
1325
- pos.x *= u_aspectRatio;\r
1326
- \r
1327
- // Rotate in corrected space\r
1328
- // Negate rotation to make positive values rotate clockwise (like p5.js)\r
1329
- pos = rotate2D(-u_rotation) * pos;\r
1330
- \r
1331
- // Restore aspect ratio: scale X coordinate back\r
1332
- pos.x /= u_aspectRatio;\r
1333
- \r
1334
- // Translate back from origin\r
1335
- pos += u_center;\r
1336
- \r
1337
- gl_Position = vec4(pos, 0.0, 1.0);\r
1338
- }\r
1339
- `, tA = { enabled: !0, characters: " .:-=+*%@#", characterColor: [1, 1, 1, 1], characterColorMode: "sampled", cellColor: [0, 0, 0, 1], cellColorMode: "fixed", invert: !1, rotation: [0, 0, 0, 255], flipHorizontally: !1, flipVertically: !1, brightnessRange: [0, 255] };
1340
- class O extends S {
1341
- constructor(t, e, s) {
1342
- super(t, e, s, tA);
1343
- E(this, "_e");
1344
- E(this, "ve");
1345
- E(this, "be");
1346
- E(this, "xe");
1347
- E(this, "ye");
1348
- E(this, "Me");
1349
- this._e = new p(t.context, R, "precision lowp float;uniform sampler2D u_sketchTexture;uniform vec2 u_gridCellDimensions;uniform vec2 u_brightnessRange;varying vec2 v_uv;void main(){vec2 cellCenter=(floor(v_uv*u_gridCellDimensions)+vec2(0.5))/u_gridCellDimensions;vec4 color=texture2D(u_sketchTexture,cellCenter);float brightness=dot(color.rgb,vec3(0.299,0.587,0.114));float brightnessValue=brightness*255.0;if(brightnessValue>=u_brightnessRange.x&&brightnessValue<=u_brightnessRange.y){gl_FragColor=color;}else{gl_FragColor=vec4(0.0);}}"), this.ve = new p(t.context, R, "precision lowp float;uniform sampler2D u_sampleTexture;uniform vec4 u_fillColor;uniform bool u_useFixedColor;varying vec2 v_uv;void main(){vec4 sampleColor=texture2D(u_sampleTexture,v_uv);if(sampleColor.a>0.0){if(u_useFixedColor){gl_FragColor=u_fillColor;}else{gl_FragColor=sampleColor;}}else{gl_FragColor=vec4(0.0);}}"), this.xe = new p(t.context, R, "precision lowp float;uniform sampler2D u_sampleTexture;uniform bool u_invert;uniform bool u_flipHorizontally;uniform bool u_flipVertically;varying vec2 v_uv;void main(){vec4 sampleColor=texture2D(u_sampleTexture,v_uv);if(sampleColor.a>0.0){float invertValue=u_invert ? 1.0 : 0.0;float flipHValue=u_flipHorizontally ? 1.0 : 0.0;float flipVValue=u_flipVertically ? 1.0 : 0.0;gl_FragColor=vec4(invertValue,flipHValue,flipVValue,1.0);}else{gl_FragColor=vec4(0.0);}}"), this.ye = new p(t.context, R, "precision lowp float;uniform sampler2D u_sampleTexture;uniform vec4 u_rotationColor;varying vec2 v_uv;void main(){vec4 sampleColor=texture2D(u_sampleTexture,v_uv);if(sampleColor.a>0.0){gl_FragColor=u_rotationColor;}else{gl_FragColor=vec4(0.0);}}"), this.be = new p(t.context, R, "precision lowp float;uniform sampler2D u_colorSampleFramebuffer;uniform sampler2D u_charPaletteTexture;uniform vec2 u_charPaletteSize;uniform vec2 u_brightnessRange;varying vec2 v_uv;void main(){vec4 color=texture2D(u_colorSampleFramebuffer,v_uv);if(color.a==0.0){gl_FragColor=vec4(0.0);return;}float brightness=dot(color.rgb,vec3(0.299,0.587,0.114))*255.0;vec2 range=u_brightnessRange;if(brightness<range.x||brightness>range.y){gl_FragColor=vec4(0.0);return;}float t=(brightness-range.x)/(range.y-range.x);float idx=clamp(floor(t*u_charPaletteSize.x),0.0,u_charPaletteSize.x-1.0);vec3 charColor=texture2D(u_charPaletteTexture,vec2((idx+0.5)/u_charPaletteSize.x,0.0)).rgb;gl_FragColor=vec4(charColor,1.0);}"), this.Me = this.ut.UA(this.he.cols, this.he.rows);
1350
- }
1351
- Ge(t) {
1352
- const e = this.he.cols, s = this.he.rows;
1353
- this.Me.begin(), this.ut.kA(), this.ut.fA(this._e), this.ut.YA("u_sketchTexture", t), this.ut.YA("u_gridCellDimensions", [e, s]), this.ut.YA("u_brightnessRange", this.h.brightnessRange), this.ut.TA(0, 0, e, s), this.Me.end(), this.ce.begin(), this.ut.kA(), this.ut.fA(this.ve), this.ut.YA("u_sampleTexture", this.Me), this.ut.YA("u_fillColor", this.h.characterColor), this.ut.YA("u_useFixedColor", this.h.characterColorMode === "fixed"), this.ut.TA(0, 0, e, s), this.ce.end(), this.De.begin(), this.ut.kA(), this.ut.fA(this.ve), this.ut.YA("u_sampleTexture", this.Me), this.ut.YA("u_fillColor", this.h.cellColor), this.ut.YA("u_useFixedColor", this.h.cellColorMode === "fixed"), this.ut.TA(0, 0, e, s), this.De.end(), this.ue.begin(), this.ut.kA(), this.ut.fA(this.xe), this.ut.YA("u_sampleTexture", this.Me), this.ut.YA("u_invert", this.h.invert), this.ut.YA("u_flipHorizontally", this.h.flipHorizontally), this.ut.YA("u_flipVertically", this.h.flipVertically), this.ut.TA(0, 0, e, s), this.ue.end(), this.Ce.begin(), this.ut.kA(), this.ut.fA(this.ye), this.ut.YA("u_sampleTexture", this.Me), this.ut.YA("u_rotationColor", this.h.rotation), this.ut.TA(0, 0, e, s), this.Ce.end(), this.le.begin(), this.ut.kA(), this.ut.fA(this.be), this.ut.YA("u_colorSampleFramebuffer", this.Me), this.ut.YA("u_charPaletteTexture", this.we.framebuffer), this.ut.YA("u_charPaletteSize", [this.we.colors.length, 1]), this.ut.YA("u_brightnessRange", this.h.brightnessRange), this.ut.TA(0, 0, e, s), this.le.end();
1354
- }
1355
- re() {
1356
- super.re(), this.Me.resize(this.he.cols, this.he.rows);
1357
- }
1358
- brightnessRange(t) {
1359
- D.C(Array.isArray(t) && t.length === 2 && t.every((e) => typeof e == "number" && e >= 0 && e <= 255), "Brightness range must be an array of two numbers between 0 and 255.", { method: "brightnessRange", providedValue: t }) && (this.h.brightnessRange = t);
1450
+ resetFrameCount() {
1451
+ this.oB = 0;
1360
1452
  }
1361
1453
  }
1362
- const LA = Object.freeze(Object.defineProperty({ __proto__: null, BRIGHTNESS_DEFAULT_OPTIONS: tA, TextmodeBrightnessConverter: O, TextmodeConverter: M, TextmodeFeatureConverter: S }, Symbol.toStringTag, { value: "Module" }));
1363
- class fA {
1364
- constructor(A, t, e) {
1365
- E(this, "ut");
1366
- E(this, "bt");
1367
- E(this, "he");
1368
- E(this, "Fe");
1369
- E(this, "$e");
1370
- E(this, "Ye");
1371
- E(this, "Te");
1372
- E(this, "Se");
1373
- E(this, "le");
1374
- E(this, "ce");
1375
- E(this, "De");
1376
- E(this, "Ce");
1377
- E(this, "ue");
1378
- this.ut = A, this.bt = t, this.he = e, this.Se = this.ut.FA(Y, "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 sampler2D u_captureTexture;uniform vec2 u_captureDimensions;uniform int u_backgroundMode;uniform vec2 u_gridCellDimensions;uniform vec2 u_gridPixelDimensions;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_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);if(encodedIndexVec.a<0.01){gl_FragColor=(u_backgroundMode==0)? vec4(0.0):texture2D(u_captureTexture,gl_FragCoord.xy/u_captureDimensions);return;}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.$e = new O(A, t, e), this.Ye = new M(A, t, e), this.Fe = [this.$e, this.Ye], this.le = this.ut.UA(e.cols, e.rows), this.ce = this.ut.UA(e.cols, e.rows), this.De = this.ut.UA(e.cols, e.rows), this.Ce = this.ut.UA(e.cols, e.rows), this.ue = this.ut.UA(e.cols, e.rows), this.Te = this.ut.UA(this.he.width, this.he.height);
1379
- }
1380
- Oe(A) {
1381
- for (const e of this.Fe) e.options.enabled && e instanceof S && e.Ge(A);
1382
- const t = (e, s) => {
1383
- e.begin(), this.ut.kA();
1384
- for (const r of this.Fe) r.options.enabled && this.ut.HA(s(r), 0, 0);
1385
- e.end();
1386
- };
1387
- t(this.le, (e) => e.characterFramebuffer), t(this.ce, (e) => e.primaryColorFramebuffer), t(this.De, (e) => e.secondaryColorFramebuffer), t(this.Ce, (e) => e.rotationFramebuffer), t(this.ue, (e) => e.transformFramebuffer), this.Te.begin(), this.ut.kA(), this.ut.fA(this.Se), this.ut.YA("u_characterTexture", this.bt.fontFramebuffer), this.ut.YA("u_charsetDimensions", [this.bt.textureColumns, this.bt.textureRows]), this.ut.YA("u_asciiCharacterTexture", this.le), this.ut.YA("u_primaryColorTexture", this.ce), this.ut.YA("u_secondaryColorTexture", this.De), this.ut.YA("u_transformTexture", this.ue), this.ut.YA("u_rotationTexture", this.Ce), this.ut.YA("u_captureTexture", A), this.ut.YA("u_backgroundMode", !1), this.ut.YA("u_captureDimensions", [A.width, A.height]), this.ut.YA("u_gridCellDimensions", [this.he.cols, this.he.rows]), this.ut.YA("u_gridPixelDimensions", [this.he.width, this.he.height]), this.ut.TA(0, 0, this.Te.width, this.Te.height), this.Te.end();
1388
- }
1389
- add(A) {
1390
- if (!D.C(A === "brightness" || A === "custom", 'Converter type must be either "brightness" or "custom".', { method: "add", providedValue: A })) return;
1391
- let t;
1392
- return t = A === "brightness" ? new O(this.ut, this.bt, this.he) : new M(this.ut, this.bt, this.he), this.Fe.push(t), t;
1393
- }
1394
- remove(A) {
1395
- if (!D.C(A instanceof M, "Parameter must be a TextmodeConverter instance.", { method: "remove", providedValue: A })) return;
1396
- const t = this.Fe.indexOf(A);
1397
- D.C(t !== -1, "Converter instance not found in pipeline.", { method: "remove", providedValue: A, convertersCount: this.Fe.length }) && this.Fe.splice(t, 1);
1398
- }
1399
- swap(A, t) {
1400
- const e = (B, Q) => {
1401
- if (typeof B == "number") return D.C(Number.isInteger(B) && B >= 0 && B < this.Fe.length, Q + " index must be a valid integer within the converter array bounds.", { method: "swap", providedValue: B, convertersCount: this.Fe.length }) ? B : null;
1402
- if (B instanceof M) {
1403
- const n = this.Fe.indexOf(B);
1404
- return D.C(n !== -1, Q + " converter instance not found in pipeline.", { method: "swap", providedValue: B, convertersCount: this.Fe.length }) ? n : null;
1405
- }
1406
- return D.C(!1, Q + " parameter must be either an integer index or a TextmodeConverter instance.", { method: "swap", providedValue: B }), null;
1407
- }, s = e(A, "First"), r = e(t, "Second");
1408
- if (s === null || r === null || !D.C(s !== r, "Cannot swap a converter with itself.", { method: "swap", firstIndex: s, secondIndex: r })) return;
1409
- const i = this.Fe[s];
1410
- this.Fe[s] = this.Fe[r], this.Fe[r] = i;
1411
- }
1412
- re() {
1413
- this.Te.resize(this.he.width, this.he.height);
1414
- const A = this.he.cols, t = this.he.rows;
1415
- this.le.resize(A, t), this.ce.resize(A, t), this.De.resize(A, t), this.Ce.resize(A, t), this.ue.resize(A, t);
1416
- for (const e of this.Fe) e.re();
1417
- }
1418
- hasEnabledConverters() {
1419
- return this.Fe.some((A) => A.options.enabled);
1420
- }
1421
- disable() {
1422
- for (const A of this.Fe) A.disable();
1423
- }
1424
- enable() {
1425
- for (const A of this.Fe) A.enable();
1426
- }
1427
- O() {
1428
- for (const A of this.Fe) A.O();
1429
- this.le.O(), this.ce.O(), this.De.O(), this.Ce.O(), this.ue.O(), this.Te.O(), this.Se.O();
1430
- }
1431
- get texture() {
1432
- return this.Te;
1433
- }
1434
- get characterFramebuffer() {
1435
- return this.le;
1436
- }
1437
- get primaryColorFramebuffer() {
1438
- return this.ce;
1439
- }
1440
- get secondaryColorFramebuffer() {
1441
- return this.De;
1442
- }
1443
- get rotationFramebuffer() {
1444
- return this.Ce;
1445
- }
1446
- get transformFramebuffer() {
1447
- return this.ue;
1448
- }
1449
- get brightness() {
1450
- return this.$e;
1451
- }
1452
- get custom() {
1453
- return this.Ye;
1454
+ const RA = (E) => class extends E {
1455
+ rotate(A) {
1456
+ this.le.state.wA(A);
1454
1457
  }
1455
- }
1456
- const wA = (o) => class extends o {
1457
- fill(A, t, e, s) {
1458
- this.ut.dA(A, t, e, s);
1458
+ push() {
1459
+ this.le.state.DA();
1459
1460
  }
1460
- stroke(A, t, e, s) {
1461
- this.ut.mA(A, t, e, s);
1461
+ pop() {
1462
+ this.le.state.lA();
1462
1463
  }
1463
- strokeWeight(A) {
1464
- this.ut.pA(A);
1464
+ rect(A, t, e = 1, B = 1) {
1465
+ this.le.Yt(A, t, e, B);
1465
1466
  }
1466
- noStroke() {
1467
- this.ut._A();
1467
+ line(A, t, e, B) {
1468
+ this.le.Tt(A, t, e, B);
1468
1469
  }
1469
- noFill() {
1470
- this.ut.vA();
1470
+ lineWeight(A) {
1471
+ this.le.state.uA(A);
1471
1472
  }
1472
- rotate(A) {
1473
- this.ut.bA(A);
1473
+ background(A, t = A, e = A, B = 255) {
1474
+ this.le.Lt(A, t, e, B);
1474
1475
  }
1475
- push() {
1476
- this.ut.xA();
1476
+ char(A) {
1477
+ this.le.state.fA(this.ve.me(A));
1477
1478
  }
1478
- pop() {
1479
- this.ut.yA();
1479
+ charColor(A, t, e) {
1480
+ this.le.state.dA(A, t, e);
1480
1481
  }
1481
- rect(A, t, e = 1, s = 1) {
1482
- this.ut.TA(A, t, e, s);
1482
+ cellColor(A, t, e) {
1483
+ this.le.state.pA(A, t, e);
1483
1484
  }
1484
- line(A, t, e, s) {
1485
- this.ut.OA(A, t, e, s);
1485
+ flipHorizontally(A) {
1486
+ this.le.state.mA(A);
1486
1487
  }
1487
- background(A, t = A, e = A, s = 255) {
1488
- this.ut.RA(A, t, e, s);
1488
+ flipVertically(A) {
1489
+ this.le.state._A(A);
1489
1490
  }
1490
- createShader(A, t) {
1491
- return this.ut.FA(A, t);
1491
+ charRotation(A) {
1492
+ this.le.state.xA(A);
1492
1493
  }
1493
- createFilterShader(A) {
1494
- return this.ut.$A(A);
1494
+ invert(A) {
1495
+ this.le.state.vA(A);
1495
1496
  }
1496
- shader(A) {
1497
- this.ut.fA(A);
1497
+ clear() {
1498
+ this.le.Lt(0, 0, 0, 0);
1498
1499
  }
1499
- setUniform(A, t) {
1500
- this.ut.YA(A, t);
1500
+ ellipse(A, t, e, B) {
1501
+ this.le.zt(A, t, e / 2, B / 2);
1501
1502
  }
1502
- image(A, t, e, s, r) {
1503
- this.ut.HA(A, t, e, s, r);
1503
+ triangle(A, t, e, B, r, i) {
1504
+ this.le.Ft(A, t, e, B, r, i);
1504
1505
  }
1505
- clear() {
1506
- this.ut.kA();
1506
+ bezierCurve(A, t, e, B, r, i, s, Q) {
1507
+ this.le.Rt(A, t, e, B, r, i, s, Q);
1507
1508
  }
1508
- createFramebuffer(A, t, e = {}) {
1509
- return this.ut.UA(A, t, e);
1509
+ arc(A, t, e, B, r, i) {
1510
+ this.le.Ot(A, t, e, B, r, i);
1510
1511
  }
1511
1512
  };
1512
- class k {
1513
- Ue(A) {
1514
- const t = A.characterFramebuffer, e = A.primaryColorFramebuffer, s = A.secondaryColorFramebuffer, r = A.transformFramebuffer, i = A.rotationFramebuffer;
1515
- return t == null || t.loadPixels(), e == null || e.loadPixels(), s == null || s.loadPixels(), r == null || r.loadPixels(), i == null || i.loadPixels(), { characterPixels: (t == null ? void 0 : t.pixels) || new Uint8Array(0), primaryColorPixels: (e == null ? void 0 : e.pixels) || new Uint8Array(0), secondaryColorPixels: (s == null ? void 0 : s.pixels) || new Uint8Array(0), transformPixels: (r == null ? void 0 : r.pixels) || new Uint8Array(0), rotationPixels: (i == null ? void 0 : i.pixels) || new Uint8Array(0) };
1513
+ class U {
1514
+ aB(A) {
1515
+ const t = A.O(0), e = A.O(1), B = A.O(2), r = A.O(3);
1516
+ return { characterPixels: t, primaryColorPixels: e, secondaryColorPixels: B, transformPixels: A.O(4), rotationPixels: r };
1516
1517
  }
1517
- Re(A, t) {
1518
+ cB(A, t) {
1518
1519
  return A[t] + (A[t + 1] << 8);
1519
1520
  }
1520
- ke(A, t) {
1521
+ hB(A, t) {
1521
1522
  return { r: A[t], g: A[t + 1], b: A[t + 2], a: A[t + 3] };
1522
1523
  }
1523
1524
  }
1524
- class L {
1525
- Ve(A, t) {
1525
+ class Y {
1526
+ CB(A, t) {
1526
1527
  return new Blob([A], { type: t });
1527
1528
  }
1528
- He(A, t, e) {
1529
+ DB(A, t, e) {
1529
1530
  try {
1530
- const s = this.Ve(A, e), r = URL.createObjectURL(s), i = document.createElement("a");
1531
+ const B = this.CB(A, e), r = URL.createObjectURL(B), i = document.createElement("a");
1531
1532
  i.href = r, i.download = t, i.style.display = "none", i.rel = "noopener", document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(r);
1532
- } catch (s) {
1533
- throw console.error("Failed to download file:", s), Error("File download failed: " + (s instanceof Error ? s.message : "Unknown error"));
1533
+ } catch (B) {
1534
+ throw console.error("Failed to download file:", B), Error("File download failed: " + (B instanceof Error ? B.message : "Unknown error"));
1534
1535
  }
1535
1536
  }
1536
- ze() {
1537
+ lB() {
1537
1538
  return (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace(/:/g, "-");
1538
1539
  }
1539
- Le() {
1540
+ PB() {
1540
1541
  const A = /* @__PURE__ */ new Date();
1541
1542
  return { date: A.toISOString().split("T")[0], time: A.toTimeString().split(" ")[0].replace(/:/g, "-") };
1542
1543
  }
1543
- Je(A) {
1544
+ IB(A) {
1544
1545
  return A.replace(/[<>:"/\\|?*]/g, "_").replace(/\s+/g, "_").replace(/_{2,}/g, "_").replace(/^_+|_+$/g, "").substring(0, 255);
1545
1546
  }
1546
- je() {
1547
- return "'textmode-export'-" + this.ze();
1547
+ uB() {
1548
+ return "'textmode-export'-" + this.lB();
1548
1549
  }
1549
1550
  }
1550
- class pA extends k {
1551
- Ke(A, t, e) {
1552
- const s = A[e] === 255, r = A[e + 1] === 255, i = A[e + 2] === 255, B = t[e], Q = t[e + 1];
1553
- return { isInverted: s, flipHorizontal: r, flipVertical: i, rotation: Math.round(360 * (B + Q / 255) / 255 * 100) / 100 };
1551
+ class TA extends U {
1552
+ wB(A, t, e) {
1553
+ const B = A[e] === 255, r = A[e + 1] === 255, i = A[e + 2] === 255, s = t[e], Q = t[e + 1];
1554
+ return { isInverted: B, flipHorizontal: r, flipVertical: i, rotation: Math.round(360 * (s + Q / 255) / 255 * 100) / 100 };
1554
1555
  }
1555
- We(A, t, e) {
1556
+ fB(A, t, e) {
1556
1557
  return { x: A, y: t, cellX: A * e.cellWidth, cellY: t * e.cellHeight };
1557
1558
  }
1558
- Ne(A, t) {
1559
+ dB(A, t) {
1559
1560
  const e = [];
1560
- let s = 0;
1561
+ let B = 0;
1561
1562
  for (let r = 0; r < t.rows; r++) for (let i = 0; i < t.cols; i++) {
1562
- const B = 4 * s, Q = this.Re(A.characterPixels, B);
1563
- let n = this.ke(A.primaryColorPixels, B), g = this.ke(A.secondaryColorPixels, B);
1564
- const a = this.Ke(A.transformPixels, A.rotationPixels, B);
1563
+ const s = 4 * B, Q = this.cB(A.characterPixels, s);
1564
+ let o = this.hB(A.primaryColorPixels, s), g = this.hB(A.secondaryColorPixels, s);
1565
+ const a = this.wB(A.transformPixels, A.rotationPixels, s);
1565
1566
  if (a.isInverted) {
1566
- const u = n;
1567
- n = g, g = u;
1567
+ const l = o;
1568
+ o = g, g = l;
1568
1569
  }
1569
- const h = this.We(i, r, t);
1570
- e.push({ charIndex: Q, primaryColor: n, secondaryColor: g, transform: a, position: h }), s++;
1570
+ const h = this.fB(i, r, t);
1571
+ e.push({ charIndex: Q, primaryColor: o, secondaryColor: g, transform: a, position: h }), B++;
1571
1572
  }
1572
1573
  return e;
1573
1574
  }
1574
1575
  }
1575
- class mA {
1576
- Ze(A, t) {
1576
+ class MA {
1577
+ pB(A, t) {
1577
1578
  const e = A.cmap;
1578
- for (const s of e.tables) if (s.format === 4) {
1579
- const r = s;
1579
+ for (const B of e.tables) if (B.format === 4) {
1580
+ const r = B;
1580
1581
  for (let i = 0; i < r.startCount.length; i++) if (t >= r.startCount[i] && t <= r.endCount[i]) {
1581
1582
  if (r.idRangeOffset[i] === 0) return t + r.idDelta[i] & 65535;
1582
1583
  {
1583
- const B = r.idRangeOffset[i] / 2 + (t - r.startCount[i]) - (r.startCount.length - i);
1584
- if (B >= 0 && B < r.glyphIdArray.length) {
1585
- const Q = r.glyphIdArray[B];
1584
+ const s = r.idRangeOffset[i] / 2 + (t - r.startCount[i]) - (r.startCount.length - i);
1585
+ if (s >= 0 && s < r.glyphIdArray.length) {
1586
+ const Q = r.glyphIdArray[s];
1586
1587
  if (Q !== 0) return Q + r.idDelta[i] & 65535;
1587
1588
  }
1588
1589
  }
1589
1590
  }
1590
- } else if (s.format === 12) {
1591
- const r = s;
1591
+ } else if (B.format === 12) {
1592
+ const r = B;
1592
1593
  for (let i = 0; i < r.groups.length; i += 3) {
1593
- const B = r.groups[i], Q = r.groups[i + 1], n = r.groups[i + 2];
1594
- if (t >= B && t <= Q) return n + (t - B);
1594
+ const s = r.groups[i], Q = r.groups[i + 1], o = r.groups[i + 2];
1595
+ if (t >= s && t <= Q) return o + (t - s);
1595
1596
  }
1596
1597
  }
1597
1598
  return 0;
1598
1599
  }
1599
- Xe(A, t, e, s, r) {
1600
+ mB(A, t, e, B, r) {
1600
1601
  const i = r / A.head.unitsPerEm;
1601
- return { getBoundingBox: () => ({ x1: e + t.xMin * i, y1: s + -t.yMax * i, x2: e + t.xMax * i, y2: s + -t.yMin * i }), toSVG: () => this.qe(t, e, s, i) };
1602
+ return { getBoundingBox: () => ({ x1: e + t.xMin * i, y1: B + -t.yMax * i, x2: e + t.xMax * i, y2: B + -t.yMin * i }), toSVG: () => this._B(t, e, B, i) };
1602
1603
  }
1603
- qe(A, t, e, s) {
1604
+ _B(A, t, e, B) {
1604
1605
  if (!A || !A.xs) return "";
1605
- const { xs: r, ys: i, endPts: B, flags: Q } = A;
1606
- if (!(r && i && B && Q)) return "";
1607
- let n = "", g = 0;
1608
- for (let a = 0; a < B.length; a++) {
1609
- const h = B[a];
1606
+ const { xs: r, ys: i, endPts: s, flags: Q } = A;
1607
+ if (!(r && i && s && Q)) return "";
1608
+ let o = "", g = 0;
1609
+ for (let a = 0; a < s.length; a++) {
1610
+ const h = s[a];
1610
1611
  if (!(h < g)) {
1611
1612
  if (h >= g) {
1612
- const u = t + r[g] * s, c = e - i[g] * s;
1613
- n += `M${u.toFixed(2)},${c.toFixed(2)}`;
1614
- let l = g + 1;
1615
- for (; l <= h; )
1616
- if (1 & Q[l]) {
1617
- const d = t + r[l] * s, C = e - i[l] * s;
1618
- n += `L${d.toFixed(2)},${C.toFixed(2)}`, l++;
1613
+ const l = t + r[g] * B, c = e - i[g] * B;
1614
+ o += `M${l.toFixed(2)},${c.toFixed(2)}`;
1615
+ let C = g + 1;
1616
+ for (; C <= h; )
1617
+ if (1 & Q[C]) {
1618
+ const d = t + r[C] * B, I = e - i[C] * B;
1619
+ o += `L${d.toFixed(2)},${I.toFixed(2)}`, C++;
1619
1620
  } else {
1620
- const d = t + r[l] * s, C = e - i[l] * s;
1621
- let P = l + 1 > h ? g : l + 1;
1622
- if (1 & Q[P]) {
1623
- const w = t + r[P] * s, m = e - i[P] * s;
1624
- n += `Q${d.toFixed(2)},${C.toFixed(2)} ${w.toFixed(2)},${m.toFixed(2)}`, l = P + 1;
1621
+ const d = t + r[C] * B, I = e - i[C] * B;
1622
+ let w = C + 1 > h ? g : C + 1;
1623
+ if (1 & Q[w]) {
1624
+ const m = t + r[w] * B, R = e - i[w] * B;
1625
+ o += `Q${d.toFixed(2)},${I.toFixed(2)} ${m.toFixed(2)},${R.toFixed(2)}`, C = w + 1;
1625
1626
  } else {
1626
- const w = (d + (t + r[P] * s)) / 2, m = (C + (e - i[P] * s)) / 2;
1627
- n += `Q${d.toFixed(2)},${C.toFixed(2)} ${w.toFixed(2)},${m.toFixed(2)}`, l = P;
1627
+ const m = (d + (t + r[w] * B)) / 2, R = (I + (e - i[w] * B)) / 2;
1628
+ o += `Q${d.toFixed(2)},${I.toFixed(2)} ${m.toFixed(2)},${R.toFixed(2)}`, C = w;
1628
1629
  }
1629
1630
  }
1630
- n += "Z";
1631
+ o += "Z";
1631
1632
  }
1632
1633
  g = h + 1;
1633
1634
  }
1634
1635
  }
1635
- return n;
1636
+ return o;
1636
1637
  }
1637
- As(A, t, e, s, r) {
1638
- const i = A.codePointAt(0) || 0, B = this.Ze(t, i);
1638
+ vB(A, t, e, B, r) {
1639
+ const i = A.codePointAt(0) || 0, s = this.pB(t, i);
1639
1640
  let Q = null;
1640
- return t.glyf && t.glyf[B] !== null ? Q = t.glyf[B] : (Q = b.T.glyf.zA(t, B), t.glyf[B] = Q), this.Xe(t, Q, e, s, r);
1641
+ return t.glyf && t.glyf[s] !== null ? Q = t.glyf[s] : (Q = p.T.glyf.Wt(t, s), t.glyf[s] = Q), this.mB(t, Q, e, B, r);
1641
1642
  }
1642
- ts(A, t, e, s, r, i, B, Q) {
1643
- const n = e + (r - Q * (B / t.head.unitsPerEm)) / 2, g = s + (i + 0.7 * B) / 2;
1644
- return this.As(A, t, n, g, B).toSVG() || null;
1643
+ xB(A, t, e, B, r, i, s, Q) {
1644
+ const o = e + (r - Q * (s / t.head.unitsPerEm)) / 2, g = B + (i + 0.7 * s) / 2;
1645
+ return this.vB(A, t, o, g, s).toSVG() || null;
1645
1646
  }
1646
1647
  }
1647
- class bA {
1648
+ class GA {
1648
1649
  constructor() {
1649
- E(this, "es");
1650
- this.es = new mA();
1650
+ n(this, "yB");
1651
+ this.yB = new MA();
1651
1652
  }
1652
- ss(A) {
1653
+ bB(A) {
1653
1654
  return `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1654
1655
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
1655
1656
  <svg width="${A.width}" height="${A.height}" viewBox="0 0 ${A.width} ${A.height}"
@@ -1657,175 +1658,173 @@ class bA {
1657
1658
  <title>textmode art generated via textmode.js</title>
1658
1659
  <desc>textmode art visualization generated by textmode.js library</desc>`;
1659
1660
  }
1660
- rs() {
1661
+ GB() {
1661
1662
  return `
1662
1663
  </g>
1663
1664
  </svg>`;
1664
1665
  }
1665
- Bs(A, t) {
1666
+ $B(A, t) {
1666
1667
  if (!t.includeBackgroundRectangles) return "";
1667
- const e = t.backgroundColor, s = `rgba(${e[0]},${e[1]},${e[2]},${e[3] / 255})`;
1668
+ const e = t.backgroundColor, B = `rgba(${e[0]},${e[1]},${e[2]},${e[3] / 255})`;
1668
1669
  return `
1669
- <rect width="${A.width}" height="${A.height}" fill="${s}" />`;
1670
+ <rect width="${A.width}" height="${A.height}" fill="${B}" />`;
1670
1671
  }
1671
- Qs(A) {
1672
+ MB(A) {
1672
1673
  return `rgba(${A.r},${A.g},${A.b},${A.a / 255})`;
1673
1674
  }
1674
- Es(A, t) {
1675
- const { transform: e, position: s } = A, r = s.cellX + t.cellWidth / 2, i = s.cellY + t.cellHeight / 2, B = [];
1675
+ YB(A, t) {
1676
+ const { transform: e, position: B } = A, r = B.cellX + t.cellWidth / 2, i = B.cellY + t.cellHeight / 2, s = [];
1676
1677
  if (e.flipHorizontal || e.flipVertical) {
1677
- const Q = e.flipHorizontal ? -1 : 1, n = e.flipVertical ? -1 : 1;
1678
- B.push(`translate(${r} ${i})`), B.push(`scale(${Q} ${n})`), B.push(`translate(${-r} ${-i})`);
1678
+ const Q = e.flipHorizontal ? -1 : 1, o = e.flipVertical ? -1 : 1;
1679
+ s.push(`translate(${r} ${i})`), s.push(`scale(${Q} ${o})`), s.push(`translate(${-r} ${-i})`);
1679
1680
  }
1680
- return e.rotation && B.push(`rotate(${e.rotation} ${r} ${i})`), B.length ? ` transform="${B.join(" ")}"` : "";
1681
+ return e.rotation && s.push(`rotate(${e.rotation} ${r} ${i})`), s.length ? ` transform="${s.join(" ")}"` : "";
1681
1682
  }
1682
- gs(A, t, e) {
1683
+ TB(A, t, e) {
1683
1684
  if (!e.includeBackgroundRectangles || A.secondaryColor.a === 0) return "";
1684
- const { position: s } = A, r = this.Qs(A.secondaryColor);
1685
+ const { position: B } = A, r = this.MB(A.secondaryColor);
1685
1686
  return e.drawMode === "stroke" ? `
1686
- <rect x="${s.cellX}" y="${s.cellY}" width="${t.cellWidth}" height="${t.cellHeight}" stroke="${r}" fill="none" stroke-width="${e.strokeWidth}" />` : `
1687
- <rect x="${s.cellX}" y="${s.cellY}" width="${t.cellWidth}" height="${t.cellHeight}" fill="${r}" />`;
1687
+ <rect x="${B.cellX}" y="${B.cellY}" width="${t.cellWidth}" height="${t.cellHeight}" stroke="${r}" fill="none" stroke-width="${e.strokeWidth}" />` : `
1688
+ <rect x="${B.cellX}" y="${B.cellY}" width="${t.cellWidth}" height="${t.cellHeight}" fill="${r}" />`;
1688
1689
  }
1689
- As(A, t, e, s) {
1690
+ vB(A, t, e, B) {
1690
1691
  const r = e.characters[A.charIndex];
1691
1692
  if (!r) return "";
1692
- const i = this.es.ts(r.character, e.font, A.position.cellX, A.position.cellY, t.cellWidth, t.cellHeight, e.fontSize, r.advanceWidth);
1693
+ const i = this.yB.xB(r.character, e.font, A.position.cellX, A.position.cellY, t.cellWidth, t.cellHeight, e.fontSize, r.advanceWidth);
1693
1694
  if (!i) return "";
1694
- const B = this.Qs(A.primaryColor);
1695
- return s.drawMode === "stroke" ? `
1696
- <path id="${`path-${A.charIndex}-${A.position.cellX}-${A.position.cellY}`.replace(/\./g, "-")}" d="${i}" stroke="${B}" stroke-width="${s.strokeWidth}" fill="none" />` : `
1697
- <path d="${i}" fill="${B}" />`;
1695
+ const s = this.MB(A.primaryColor);
1696
+ return B.drawMode === "stroke" ? `
1697
+ <path id="${`path-${A.charIndex}-${A.position.cellX}-${A.position.cellY}`.replace(/\./g, "-")}" d="${i}" stroke="${s}" stroke-width="${B.strokeWidth}" fill="none" />` : `
1698
+ <path d="${i}" fill="${s}" />`;
1698
1699
  }
1699
- ns(A, t, e, s) {
1700
+ zB(A, t, e, B) {
1700
1701
  let r = "";
1701
- r += this.gs(A, t, s);
1702
- const i = this.Es(A, t), B = this.As(A, t, e, s);
1703
- return B && (i ? (r += `
1704
- <g${i}>`, r += B, r += `
1705
- </g>`) : r += B), r;
1706
- }
1707
- hs(A, t, e, s) {
1708
- let r = this.ss(t);
1709
- r += this.Bs(t, s), r += `
1702
+ r += this.TB(A, t, B);
1703
+ const i = this.YB(A, t), s = this.vB(A, t, e, B);
1704
+ return s && (i ? (r += `
1705
+ <g${i}>`, r += s, r += `
1706
+ </g>`) : r += s), r;
1707
+ }
1708
+ FB(A, t, e, B) {
1709
+ let r = this.bB(t);
1710
+ r += this.$B(t, B), r += `
1710
1711
  <g id="ascii-cells">`;
1711
- for (const i of A) r += this.ns(i, t, e, s);
1712
- return r += this.rs(), r;
1712
+ for (const i of A) r += this.zB(i, t, e, B);
1713
+ return r += this.GB(), r;
1713
1714
  }
1714
- ls(A) {
1715
+ RB(A) {
1715
1716
  return A.replace(/<path[^>]*d=""[^>]*\/>/g, "").replace(/\n\s*\n/g, `
1716
1717
  `).replace(/[ \t]+$/gm, "");
1717
1718
  }
1718
1719
  }
1719
- class xA extends L {
1720
- cs(A) {
1721
- return this.Ve(A, "image/svg+xml;charset=utf-8");
1720
+ class _A extends Y {
1721
+ SB(A) {
1722
+ return this.CB(A, "image/svg+xml;charset=utf-8");
1722
1723
  }
1723
- Ds(A, t) {
1724
- this.He(A, this.Je(t) + ".svg", "image/svg+xml;charset=utf-8");
1724
+ OB(A, t) {
1725
+ this.DB(A, this.IB(t) + ".svg", "image/svg+xml;charset=utf-8");
1725
1726
  }
1726
- Cs(A, t) {
1727
- this.Ds(A, t || this.je());
1727
+ LB(A, t) {
1728
+ this.OB(A, t || this.uB());
1728
1729
  }
1729
1730
  }
1730
- class $ {
1731
+ class W {
1731
1732
  constructor() {
1732
- E(this, "us");
1733
- E(this, "Ps");
1734
- E(this, "Is");
1735
- this.us = new pA(), this.Ps = new bA(), this.Is = new xA();
1733
+ n(this, "UB");
1734
+ n(this, "kB");
1735
+ n(this, "WB");
1736
+ this.UB = new TA(), this.kB = new GA(), this.WB = new _A();
1736
1737
  }
1737
- ws(A) {
1738
- return { includeBackgroundRectangles: A.includeBackgroundRectangles ?? !0, drawMode: A.drawMode ?? "fill", strokeWidth: A.strokeWidth ?? 1, backgroundColor: A.backgroundColor ?? [0, 0, 0, 0] };
1738
+ HB(A) {
1739
+ return { includeBackgroundRectangles: A.includeBackgroundRectangles ?? !0, drawMode: A.drawMode ?? "fill", strokeWidth: A.strokeWidth ?? 1, backgroundColor: A.backgroundColor ?? [0, 0, 0, 0], filename: A.filename || this.WB.uB() };
1739
1740
  }
1740
- fs(A, t = {}) {
1741
- const e = this.ws(t), s = this.us.Ue(A.pipeline), r = this.us.Ne(s, A.grid), i = this.Ps.hs(r, A.grid, A.font, e);
1742
- return this.Ps.ls(i);
1741
+ JB(A, t = {}) {
1742
+ const e = this.UB.dB(this.UB.aB(A.pipeline), A.grid), B = this.kB.FB(e, A.grid, A.font, this.HB(t));
1743
+ return this.kB.RB(B);
1743
1744
  }
1744
- Cs(A, t = {}) {
1745
- const e = this.fs(A, t), s = t.filename || this.Is.je();
1746
- this.Is.Cs(e, s);
1745
+ LB(A, t = {}) {
1746
+ this.WB.LB(this.JB(A, t), t.filename);
1747
1747
  }
1748
1748
  }
1749
- class vA extends k {
1750
- ds(A, t, e, s = " ") {
1751
- var B;
1749
+ class FA extends U {
1750
+ VB(A, t, e, B = " ") {
1751
+ var s;
1752
1752
  const r = [];
1753
1753
  let i = 0;
1754
1754
  for (let Q = 0; Q < t.rows; Q++) {
1755
- const n = [];
1755
+ const o = [];
1756
1756
  for (let g = 0; g < t.cols; g++) {
1757
- const a = 4 * i, h = this.Re(A.characterPixels, a), u = ((B = e.characters[h]) == null ? void 0 : B.character) || s;
1758
- n.push(u), i++;
1757
+ const a = 4 * i, h = this.cB(A.characterPixels, a), l = ((s = e.characters[h]) == null ? void 0 : s.character) || B;
1758
+ o.push(l), i++;
1759
1759
  }
1760
- r.push(n);
1760
+ r.push(o);
1761
1761
  }
1762
1762
  return r;
1763
1763
  }
1764
1764
  }
1765
- class yA {
1766
- ps(A, t) {
1765
+ class SA {
1766
+ KB(A, t) {
1767
1767
  const e = [];
1768
1768
  for (const r of A) {
1769
1769
  let i = r.join("");
1770
1770
  t.preserveTrailingSpaces || (i = i.replace(/\s+$/, "")), e.push(i);
1771
1771
  }
1772
- const s = t.lineEnding === "crlf" ? `\r
1772
+ const B = t.lineEnding === "crlf" ? `\r
1773
1773
  ` : `
1774
1774
  `;
1775
- return e.join(s);
1775
+ return e.join(B);
1776
1776
  }
1777
1777
  }
1778
- class _A extends L {
1779
- _s(A, t) {
1780
- const e = this.vs(t);
1781
- this.He(A, e, "text/plain;charset=utf-8");
1778
+ class UA extends Y {
1779
+ jB(A, t) {
1780
+ const e = this.ZB(t);
1781
+ this.DB(A, e, "text/plain;charset=utf-8");
1782
1782
  }
1783
- vs(A) {
1784
- let t = this.Je(A);
1785
- return t === ".txt" || t.length <= 4 ? this.je() : t;
1783
+ ZB(A) {
1784
+ let t = this.IB(A);
1785
+ return t === ".txt" || t.length <= 4 ? this.uB() : t;
1786
1786
  }
1787
1787
  }
1788
- class z {
1788
+ class k {
1789
1789
  constructor() {
1790
- E(this, "us");
1791
- E(this, "Ps");
1792
- E(this, "Is");
1793
- this.us = new vA(), this.Ps = new yA(), this.Is = new _A();
1790
+ n(this, "UB");
1791
+ n(this, "kB");
1792
+ n(this, "WB");
1793
+ this.UB = new FA(), this.kB = new SA(), this.WB = new UA();
1794
1794
  }
1795
- ws(A) {
1796
- return { preserveTrailingSpaces: A.preserveTrailingSpaces ?? !1, lineEnding: A.lineEnding ?? "lf", emptyCharacter: A.emptyCharacter ?? " " };
1795
+ HB(A) {
1796
+ return { preserveTrailingSpaces: A.preserveTrailingSpaces ?? !1, lineEnding: A.lineEnding ?? "lf", emptyCharacter: A.emptyCharacter ?? " ", filename: A.filename || this.WB.uB() };
1797
1797
  }
1798
- bs(A, t = {}) {
1799
- const e = this.ws(t), s = this.us.Ue(A.pipeline), r = this.us.ds(s, A.grid, A.font, e.emptyCharacter);
1800
- return this.Ps.ps(r, e);
1798
+ NB(A, t = {}) {
1799
+ const e = this.HB(t), B = this.UB.VB(this.UB.aB(A.pipeline), A.grid, A.font, e.emptyCharacter);
1800
+ return this.kB.KB(B, e);
1801
1801
  }
1802
- _s(A, t = {}) {
1803
- const e = this.bs(A, t), s = t.filename || this.Is.je();
1804
- this.Is._s(e, s);
1802
+ jB(A, t = {}) {
1803
+ this.WB.jB(this.NB(A, t), t.filename);
1805
1804
  }
1806
1805
  }
1807
- class MA extends k {
1808
- Ms(A, t = 1, e = "transparent") {
1809
- const s = A.canvas;
1810
- if (t === 1 && e === "transparent") return s;
1811
- const r = document.createElement("canvas"), i = r.getContext("2d"), B = Math.round(s.width * t), Q = Math.round(s.height * t);
1812
- return r.width = B, r.height = Q, e !== "transparent" && (i.fillStyle = e, i.fillRect(0, 0, B, Q)), i.imageSmoothingEnabled = !1, i.drawImage(s, 0, 0, s.width, s.height, 0, 0, B, Q), r;
1806
+ class YA extends U {
1807
+ XB(A, t = 1, e = "transparent") {
1808
+ const B = A.canvas;
1809
+ if (t === 1 && e === "transparent") return B;
1810
+ const r = document.createElement("canvas"), i = r.getContext("2d"), s = Math.round(B.width * t), Q = Math.round(B.height * t);
1811
+ return r.width = s, r.height = Q, e !== "transparent" && (i.fillStyle = e, i.fillRect(0, 0, s, Q)), i.imageSmoothingEnabled = !1, i.drawImage(B, 0, 0, B.width, B.height, 0, 0, s, Q), r;
1813
1812
  }
1814
1813
  }
1815
- class TA {
1816
- Gs(A, t) {
1817
- const e = this.Fs(t.format);
1814
+ class OA {
1815
+ qB(A, t) {
1816
+ const e = this.AQ(t.format);
1818
1817
  return t.format === "png" ? A.toDataURL(e) : A.toDataURL(e, t.quality);
1819
1818
  }
1820
- async $s(A, t) {
1821
- return new Promise((e, s) => {
1822
- const r = this.Fs(t.format), i = (B) => {
1823
- B ? e(B) : s(Error(`Failed to generate ${t.format.toUpperCase()} blob`));
1819
+ async tQ(A, t) {
1820
+ return new Promise((e, B) => {
1821
+ const r = this.AQ(t.format), i = (s) => {
1822
+ s ? e(s) : B(Error(`Failed to generate ${t.format.toUpperCase()} blob`));
1824
1823
  };
1825
1824
  t.format === "png" ? A.toBlob(i, r) : A.toBlob(i, r, t.quality);
1826
1825
  });
1827
1826
  }
1828
- Fs(A) {
1827
+ AQ(A) {
1829
1828
  switch (A) {
1830
1829
  case "png":
1831
1830
  return "image/png";
@@ -1838,273 +1837,211 @@ class TA {
1838
1837
  }
1839
1838
  }
1840
1839
  }
1841
- const RA = { png: "image/png", jpg: "image/jpeg", webp: "image/webp" }, Z = { png: ".png", jpg: ".jpg", webp: ".webp" };
1842
- class YA extends L {
1843
- Ys(A, t, e) {
1844
- this.Ts(A, this.Je(t) + Z[e]);
1840
+ const LA = { png: "image/png", jpg: "image/jpeg", webp: "image/webp" }, N = { png: ".png", jpg: ".jpg", webp: ".webp" };
1841
+ class zA extends Y {
1842
+ eQ(A, t, e) {
1843
+ this.BQ(A, this.IB(t) + N[e]);
1845
1844
  }
1846
- Ts(A, t) {
1845
+ BQ(A, t) {
1847
1846
  const e = URL.createObjectURL(A);
1848
1847
  try {
1849
- const s = document.createElement("a");
1850
- s.href = e, s.download = t, s.style.display = "none", s.rel = "noopener", document.body.appendChild(s), s.click(), document.body.removeChild(s);
1848
+ const B = document.createElement("a");
1849
+ B.href = e, B.download = t, B.style.display = "none", B.rel = "noopener", document.body.appendChild(B), B.click(), document.body.removeChild(B);
1851
1850
  } finally {
1852
1851
  URL.revokeObjectURL(e);
1853
1852
  }
1854
1853
  }
1855
- Ss(A) {
1856
- return A in RA && A in Z;
1854
+ QQ(A) {
1855
+ return A in LA && A in N;
1857
1856
  }
1858
1857
  }
1859
- class FA {
1858
+ class WA {
1860
1859
  constructor() {
1861
- E(this, "us");
1862
- E(this, "Ps");
1863
- E(this, "Is");
1864
- this.us = new MA(), this.Ps = new TA(), this.Is = new YA();
1860
+ n(this, "UB");
1861
+ n(this, "kB");
1862
+ n(this, "WB");
1863
+ this.UB = new YA(), this.kB = new OA(), this.WB = new zA();
1865
1864
  }
1866
- ws(A) {
1867
- return { format: A.format ?? "png", quality: A.quality ?? 1, scale: A.scale ?? 1, backgroundColor: A.backgroundColor ?? "transparent" };
1865
+ HB(A) {
1866
+ return { format: A.format ?? "png", quality: A.quality ?? 1, scale: A.scale ?? 1, backgroundColor: A.backgroundColor ?? "transparent", filename: A.filename || this.WB.uB() };
1868
1867
  }
1869
- Os(A) {
1870
- if (console.log("Validating image export options:", A), !this.Is.Ss(A.format)) throw Error(`Saving '${A.format}' files is not supported`);
1868
+ sQ(A) {
1869
+ if (!this.WB.QQ(A.format)) throw Error(`Saving '${A.format}' files is not supported`);
1871
1870
  if (A.quality < 0 || A.quality > 1) throw Error("Image quality must be between 0.0 and 1.0");
1872
1871
  if (A.scale <= 0) throw Error("Scale factor must be greater than 0");
1873
- A.scale > 10 && console.warn("Large scale factors may result in very large files and slow performance"), A.format === "jpg" && A.backgroundColor === "transparent" && (A.backgroundColor = "black");
1874
- }
1875
- Us(A, t = {}) {
1876
- const e = this.ws(t);
1877
- if (this.Os(e), e.scale === 1 && e.backgroundColor === "transparent") return this.Ps.Gs(A.canvas, e);
1878
- const s = this.us.Ms(A, e.scale, e.backgroundColor);
1879
- return this.Ps.Gs(s, e);
1872
+ A.format === "jpg" && A.backgroundColor === "transparent" && (A.backgroundColor = "black");
1880
1873
  }
1881
- async $s(A, t = {}) {
1882
- const e = this.ws(t);
1883
- if (this.Os(e), e.scale === 1 && e.backgroundColor === "transparent") return await this.Ps.$s(A.canvas, e);
1884
- const s = this.us.Ms(A, e.scale, e.backgroundColor);
1885
- return await this.Ps.$s(s, e);
1874
+ async tQ(A, t) {
1875
+ if (t.scale === 1 && t.backgroundColor === "transparent") return await this.kB.tQ(A.canvas, t);
1876
+ const e = this.UB.XB(A, t.scale, t.backgroundColor);
1877
+ return await this.kB.tQ(e, t);
1886
1878
  }
1887
- async Ys(A, t = {}) {
1888
- const e = await this.$s(A, t), s = t.format ?? "png", r = t.filename || this.Is.je();
1889
- this.Is.Ys(e, r, s);
1879
+ async eQ(A, t = {}) {
1880
+ const e = this.HB(t);
1881
+ this.sQ(e);
1882
+ const B = await this.tQ(A, e);
1883
+ this.WB.eQ(B, e.filename, e.format);
1890
1884
  }
1891
1885
  }
1892
- const GA = (o) => class extends o {
1886
+ const kA = (E) => class extends E {
1887
+ EQ() {
1888
+ this.le.kt(this.iQ);
1889
+ }
1893
1890
  toString(A = {}) {
1894
- return new z().bs({ pipeline: this.Rs, grid: this.he, font: this.bt }, A);
1891
+ return this.EQ(), new k().NB({ pipeline: this.rQ, grid: this.nQ, font: this.ve }, A);
1895
1892
  }
1896
1893
  saveStrings(A = {}) {
1897
- new z()._s({ pipeline: this.Rs, grid: this.he, font: this.bt }, A);
1894
+ this.EQ(), new k().jB({ pipeline: this.rQ, grid: this.nQ, font: this.ve }, A);
1898
1895
  }
1899
1896
  toSVG(A = {}) {
1900
- return new $().fs(this, A);
1897
+ return this.EQ(), new W().JB(this, A);
1901
1898
  }
1902
1899
  saveSVG(A = {}) {
1903
- new $().Cs(this, A);
1900
+ this.EQ(), new W().LB(this, A);
1904
1901
  }
1905
- async saveCanvas(A, t = "png", e = {}) {
1906
- await new FA().Ys(this.Zt, { ...e, filename: A, format: t });
1902
+ async saveCanvas(A = {}) {
1903
+ await new WA().eQ(this.Ke, A);
1907
1904
  }
1908
- }, UA = (o) => class extends o {
1905
+ }, NA = (E) => class extends E {
1909
1906
  async loadFont(A) {
1910
- return this.bt.Lt(A).then(() => {
1911
- const t = this.bt.maxGlyphDimensions;
1912
- this.he.te(t.width, t.height), this.Rs.re();
1907
+ return this.ve.ke(A).then(() => {
1908
+ const t = this.ve.maxGlyphDimensions;
1909
+ this.nQ.Ne(t.width, t.height), this.le.Ut();
1913
1910
  });
1914
1911
  }
1915
1912
  fontSize(A) {
1916
- if (!D.C(typeof A == "number" && A > 0, "Font size must be a positive number greater than 0.", { method: "fontSize", providedValue: A }) || this.bt.fontSize === A) return;
1917
- this.bt.zt(A);
1918
- const t = this.bt.maxGlyphDimensions;
1919
- this.he.te(t.width, t.height), this.Rs.re(), this.ut.VA();
1920
- }
1921
- }, OA = (o) => class extends o {
1922
- addConverter(A) {
1923
- return this.Rs.add(A);
1924
- }
1925
- removeConverter(A) {
1926
- this.Rs.remove(A);
1927
- }
1928
- };
1929
- class SA {
1930
- constructor() {
1931
- E(this, "ut");
1932
- E(this, "bt");
1933
- E(this, "Rs");
1934
- E(this, "Zt");
1935
- E(this, "he");
1936
- }
1937
- }
1938
- class W extends function(t, ...e) {
1939
- return e.reduce((s, r) => r(s), t);
1940
- }(SA, wA, GA, UA, OA) {
1941
- constructor(t = null, e = {}) {
1942
- super();
1943
- E(this, "ie");
1944
- E(this, "ks");
1945
- E(this, "Ee");
1946
- E(this, "Vs");
1947
- E(this, "Hs");
1948
- E(this, "zs", null);
1949
- E(this, "Ls", 0);
1950
- E(this, "Js");
1951
- E(this, "js", !0);
1952
- E(this, "Ks", 0);
1953
- E(this, "Ws", 0);
1954
- E(this, "Ns", 0);
1955
- E(this, "Zs", []);
1956
- E(this, "Xs", 10);
1957
- E(this, "qs", !1);
1958
- E(this, "Ar", !1);
1959
- E(this, "tr", () => {
1960
- });
1961
- E(this, "er", () => {
1962
- });
1963
- E(this, "sr");
1964
- this.ie = t, this.Ar = t === null, this.Vs = e.renderMode ?? "auto", this.Hs = e.frameRate ?? 60, this.Js = 1e3 / this.Hs;
1965
- }
1966
- static async create(t = null, e = {}) {
1967
- const s = new this(t, e), r = s.Ar ? e : void 0;
1968
- let i, B;
1969
- s.Zt = new dA(s.ie, s.Ar, r), s.ut = new EA(s.Zt.ne()), s.Ar ? (i = e.width || 800, B = e.height || 600) : (i = s.Zt.width || 800, B = s.Zt.height || 600), s.ks = s.ut.UA(i, B), s.bt = new DA(s.ut, e.fontSize ?? 16), await s.bt.kt(e.fontSource);
1970
- const Q = s.bt.maxGlyphDimensions;
1971
- return s.he = new PA(s.Zt.canvas, Q.width, Q.height), s.Rs = new fA(s.ut, s.bt, s.he), s.rr(), s.Br(), s;
1972
- }
1973
- rr() {
1974
- this.sr = () => {
1975
- this.Ar ? this.er() : this.ir();
1976
- }, window.addEventListener("resize", this.sr), window.ResizeObserver && this.ie && !this.Ar && (this.Ee = new ResizeObserver(() => {
1977
- this.ir();
1978
- }), this.Ee.observe(this.ie));
1979
- }
1980
- render() {
1981
- this.Qr(), this.Ns++, this.qs ? console.warn("Cannot render: Required resources have been disposed") : (this.Ar ? (this.ks.begin(), this.tr(), this.ks.end()) : this.ks.S(this.ie), this.Rs.hasEnabledConverters() ? (this.Rs.Oe(this.ks), this.ut.RA(0), this.ut.HA(this.Rs.texture, this.he.offsetX, this.he.offsetY, this.Rs.texture.width, this.Rs.texture.height)) : (this.ut.kA(), this.ut.HA(this.ks, this.he.offsetX, this.he.offsetY, this.ks.width, this.ks.height)));
1982
- }
1983
- ir() {
1984
- this.Zt.re(), this.ks.resize(this.Zt.width, this.Zt.height), this.he.re(), this.Rs.re(), this.ut.VA(), this.Vs !== "manual" && this.render();
1985
- }
1986
- Br() {
1987
- if (this.Vs !== "auto" || !this.js) return;
1988
- this.Ls = performance.now();
1989
- const t = (e) => {
1990
- if (!this.js) return void (this.zs = null);
1991
- const s = e - this.Ls;
1992
- s >= this.Js && (this.render(), this.Ls = e - s % this.Js), this.js && (this.zs = requestAnimationFrame(t));
1993
- };
1994
- this.zs = requestAnimationFrame(t);
1995
- }
1996
- Qr() {
1997
- const t = performance.now();
1998
- if (this.Ws > 0) {
1999
- const e = t - this.Ws;
2000
- this.Zs.push(e), this.Zs.length > this.Xs && this.Zs.shift();
2001
- const s = this.Zs.reduce((r, i) => r + i, 0) / this.Zs.length;
2002
- this.Ks = 1e3 / s;
2003
- }
2004
- this.Ws = t;
1913
+ if (!T.l(typeof A == "number" && A > 0, "Font size must be a positive number greater than 0.", { method: "fontSize", providedValue: A }) || this.ve.fontSize === A) return;
1914
+ this.ve.Ue(A);
1915
+ const t = this.ve.maxGlyphDimensions;
1916
+ this.nQ.Ne(t.width, t.height), this.le.Ut();
2005
1917
  }
2006
- Er() {
2007
- this.zs && (cancelAnimationFrame(this.zs), this.zs = null);
1918
+ }, HA = (E) => class extends E {
1919
+ get frameCount() {
1920
+ return this.gQ.frameCount;
2008
1921
  }
2009
- renderMode(t) {
2010
- this.Vs !== t && (this.Er(), this.Vs = t, t === "auto" && this.js && this.Br());
1922
+ set frameCount(A) {
1923
+ this.gQ.frameCount = A;
2011
1924
  }
2012
- frameRate(t) {
2013
- if (t === void 0) return this.Ks;
2014
- this.Hs = t, this.Js = 1e3 / t, this.Vs === "auto" && this.js && (this.Er(), this.Br());
1925
+ frameRate(A) {
1926
+ return A === void 0 ? this.gQ.currentFrameRate : this.gQ.frameRate(A, () => this.oQ());
2015
1927
  }
2016
1928
  noLoop() {
2017
- this.js && (this.js = !1, this.zs && (cancelAnimationFrame(this.zs), this.zs = null));
1929
+ this.gQ.pause();
2018
1930
  }
2019
1931
  loop() {
2020
- this.js || (this.js = !0, this.Vs === "auto" && this.Br());
1932
+ this.gQ.resume(() => this.oQ());
2021
1933
  }
2022
- redraw(t = 1) {
2023
- if (D.C(typeof t == "number" && t > 0 && Number.isInteger(t), "Redraw count must be a positive integer.", { method: "redraw", providedValue: t })) for (let e = 0; e < t; e++) this.render();
1934
+ redraw(A = 1) {
1935
+ if (T.l(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.oQ();
2024
1936
  }
2025
1937
  isLooping() {
2026
- return this.Vs === "auto" && this.js;
1938
+ return this.gQ.isLooping;
1939
+ }
1940
+ };
1941
+ class KA {
1942
+ constructor() {
1943
+ n(this, "le");
1944
+ n(this, "ve");
1945
+ n(this, "Ke");
1946
+ n(this, "nQ");
1947
+ n(this, "gQ");
1948
+ n(this, "iQ");
1949
+ n(this, "rQ");
1950
+ n(this, "aQ");
1951
+ }
1952
+ oQ() {
1953
+ }
1954
+ }
1955
+ class $A extends function(t, ...e) {
1956
+ return e.reduce((B, r) => r(B), t);
1957
+ }(KA, RA, kA, NA, HA) {
1958
+ constructor(t = {}) {
1959
+ super();
1960
+ n(this, "cQ", !1);
1961
+ n(this, "hQ", () => {
1962
+ });
1963
+ n(this, "CQ", () => {
1964
+ });
1965
+ n(this, "DQ");
1966
+ this.Ke = new vA(t), this.le = new CA(this.Ke.tB()), this.ve = new yA(this.le, t.fontSize ?? 16), this.gQ = new bA(t.frameRate ?? 60), this.iQ = this.le.$t(`#version 300 es
1967
+ 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 float 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;mat2 rotate2D(float angle){float s=sin(angle);float c=cos(angle);return mat2(c,-s,s,c);}vec2 evaluateBezier(float t,vec2 p0,vec2 p1,vec2 p2,vec2 p3){float oneMinusT=1.0-t;float oneMinusT2=oneMinusT*oneMinusT;float oneMinusT3=oneMinusT2*oneMinusT;float t2=t*t;float t3=t2*t;return oneMinusT3*p0+3.0*oneMinusT2*t*p1+3.0*oneMinusT*t2*p2+t3*p3;}vec2 evaluateBezierDerivative(float t,vec2 p0,vec2 p1,vec2 p2,vec2 p3){float oneMinusT=1.0-t;float oneMinusT2=oneMinusT*oneMinusT;float t2=t*t;return-3.0*oneMinusT2*p0+3.0*oneMinusT2*p1-6.0*oneMinusT*t*p1+6.0*oneMinusT*t*p2-3.0*t2*p2+3.0*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 isBezierCurve=length(a_instanceBezierCP1)>0.0||length(a_instanceBezierCP2)>0.0||length(a_instanceBezierStart)>0.0||length(a_instanceBezierEnd)>0.0;bool isArc=a_instanceArcAngles.x!=0.0||a_instanceArcAngles.y!=0.0;if(isBezierCurve){float t=a_position.x;float thicknessOffset=a_position.y;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 tangentLength=length(tangent);if(tangentLength>0.0){tangent=tangent/tangentLength;}else{tangent=vec2(1.0,0.0);}vec2 normal=vec2(-tangent.y,tangent.x);float thickness=a_instanceSize.y;vec2 thicknessVector=normal*thicknessOffset*thickness;worldPosition=curvePoint+thicknessVector;}else if(isArc){float startA=a_instanceArcAngles.x;float stopA=a_instanceArcAngles.y;float TWO_PI=6.28318530718;startA=mod(startA,TWO_PI);if(startA<0.0)startA+=TWO_PI;stopA=mod(stopA,TWO_PI);if(stopA<0.0)stopA+=TWO_PI;float cwDelta=startA-stopA;if(cwDelta<=0.0)cwDelta+=TWO_PI;float angle=startA-a_position.x*cwDelta;float r=a_position.y;vec2 local=vec2(cos(angle),sin(angle))*r;vec2 scaledPosition=local*a_instanceSize*0.5+vec2(a_instanceSize.x*0.5,a_instanceSize.y*0.5);worldPosition=scaledPosition+a_instancePosition;}else{vec2 scaledPosition=a_position*a_instanceSize;worldPosition=scaledPosition+a_instancePosition;}vec2 ndc=(worldPosition/u_viewportSize)*2.0-1.0;ndc.y=-ndc.y;if(a_instanceGlobalRotation!=0.0){ndc-=a_instanceRotationCenter;ndc.x*=u_aspectRatio;ndc=rotate2D(-a_instanceGlobalRotation)*ndc;ndc.x/=u_aspectRatio;ndc+=a_instanceRotationCenter;}gl_Position=vec4(ndc,0.0,1.0);}`, `#version 300 es
1968
+ 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.aQ = this.le.$t("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);}");
1969
+ }
1970
+ static async create(t = {}) {
1971
+ const e = new this(t);
1972
+ await e.ve.Se(t.fontSource);
1973
+ const B = e.ve.maxGlyphDimensions;
1974
+ return e.nQ = new xA(e.Ke.canvas, B.width, B.height), e.rQ = e.le.St(e.nQ.cols, e.nQ.rows, 5), e.lQ(), e.gQ.start(() => e.oQ()), e;
1975
+ }
1976
+ lQ() {
1977
+ this.DQ = () => {
1978
+ this.CQ();
1979
+ }, window.addEventListener("resize", this.DQ);
1980
+ }
1981
+ oQ() {
1982
+ if (this.gQ.measureFrameRate(), this.gQ.incrementFrame(), this.cQ) return;
1983
+ this.rQ.U(), this.le.Gt(this.iQ), this.hQ(), this.le.kt(this.iQ), this.rQ.k();
1984
+ const t = this.le.state.canvasBackgroundColor;
1985
+ this.le.NA(t[0], t[1], t[2], t[3]), this.le.Gt(this.aQ), this.aQ.tA({ u_characterTexture: this.ve.fontFramebuffer, u_charsetDimensions: [this.ve.textureColumns, this.ve.textureRows], u_asciiCharacterTexture: this.rQ.textures[0], u_primaryColorTexture: this.rQ.textures[1], u_secondaryColorTexture: this.rQ.textures[2], u_transformTexture: this.rQ.textures[4], u_rotationTexture: this.rQ.textures[3], u_gridCellDimensions: [this.nQ.cols, this.nQ.rows], u_gridPixelDimensions: [this.nQ.width, this.nQ.height], u_gridOffsetPixels: [this.nQ.offsetX, this.nQ.offsetY], u_aspectRatio: this.nQ.width / this.nQ.height }), this.le.Mt(this.nQ.offsetX, this.nQ.offsetY, this.nQ.width, this.nQ.height);
2027
1986
  }
2028
1987
  draw(t) {
2029
- this.tr = t;
1988
+ this.hQ = t;
2030
1989
  }
2031
1990
  windowResized(t) {
2032
- this.er = t;
1991
+ this.CQ = t;
2033
1992
  }
2034
1993
  resizeCanvas(t, e) {
2035
- this.Ar && (this.Zt.re(t, e), this.ks.resize(this.Zt.width, this.Zt.height), this.he.re(), this.Rs.re(), this.ut.VA(), this.Vs !== "manual" && this.render());
1994
+ this.Ke.S(t, e), this.nQ.PA(), this.rQ.S(this.nQ.cols, this.nQ.rows), this.le.Ut(), this.oQ();
2036
1995
  }
2037
1996
  destroy() {
2038
- this.qs || (this.Er(), window.removeEventListener("resize", this.sr), this.Ee && this.Ee.disconnect(), this.Rs.O(), this.bt.O(), this.ks.O(), this.ut.O(), this.qs = !0);
1997
+ this.cQ || (this.gQ.stop(), window.removeEventListener("resize", this.DQ), this.ve.W(), this.le.W(), this.cQ = !0);
2039
1998
  }
2040
1999
  get grid() {
2041
- return this.he;
2000
+ return this.nQ;
2042
2001
  }
2043
2002
  get font() {
2044
- return this.bt;
2045
- }
2046
- get mode() {
2047
- return this.Vs;
2048
- }
2049
- get pipeline() {
2050
- return this.Rs;
2051
- }
2052
- get frameCount() {
2053
- return this.Ns;
2054
- }
2055
- get renderer() {
2056
- return this.ut;
2057
- }
2058
- set frameCount(t) {
2059
- this.Ns = t;
2003
+ return this.ve;
2060
2004
  }
2061
2005
  get width() {
2062
- return this.Zt.width;
2006
+ return this.Ke.width;
2063
2007
  }
2064
2008
  get height() {
2065
- return this.Zt.height;
2009
+ return this.Ke.height;
2066
2010
  }
2067
2011
  get canvas() {
2068
- return this.Zt;
2012
+ return this.Ke.canvas;
2069
2013
  }
2070
2014
  get isDisposed() {
2071
- return this.qs;
2015
+ return this.cQ;
2016
+ }
2017
+ get drawFramebuffer() {
2018
+ return this.rQ;
2072
2019
  }
2073
2020
  }
2074
- class H {
2021
+ class O {
2075
2022
  constructor() {
2076
- throw new I("Textmode is a static class and cannot be instantiated.");
2023
+ throw new f("Textmode is a static class and cannot be instantiated.");
2077
2024
  }
2078
- static async create(A, t = {}) {
2079
- if (!(A == null || A instanceof HTMLCanvasElement || A instanceof HTMLVideoElement || typeof A == "object")) throw new I("First parameter must be HTMLCanvasElement, HTMLVideoElement, or options object.");
2080
- if (typeof t != "object") throw new I("Second parameter must be an options object.");
2081
- if (A instanceof HTMLCanvasElement || A instanceof HTMLVideoElement) return W.create(A, t);
2082
- {
2083
- const e = A || {};
2084
- return W.create(null, e);
2085
- }
2025
+ static async create(A) {
2026
+ return $A.create(A);
2086
2027
  }
2087
2028
  static setErrorLevel(A) {
2088
- D.u(A);
2029
+ T.P(A);
2089
2030
  }
2090
2031
  static get version() {
2091
- return "0.1.9";
2032
+ return "0.2.0-beta.2";
2092
2033
  }
2093
2034
  }
2094
- const HA = Object.freeze(Object.defineProperty({ __proto__: null }, Symbol.toStringTag, { value: "Module" })), VA = Object.freeze(Object.defineProperty({ __proto__: null, DEFAULT_FRAMEBUFFER_OPTIONS: { filter: "nearest", wrap: "clamp", format: "rgba", type: "unsigned_byte" }, Framebuffer: X, Shader: q }, Symbol.toStringTag, { value: "Module" })), NA = H.create, $A = H.setErrorLevel, zA = H.version;
2035
+ const JA = Object.freeze(Object.defineProperty({ __proto__: null }, Symbol.toStringTag, { value: "Module" })), XA = O.create, jA = O.setErrorLevel, ZA = O.version;
2095
2036
  export {
2096
- dA as TextmodeCanvas,
2097
- IA as TextmodeColorPalette,
2098
- fA as TextmodeConversionPipeline,
2099
- iA as TextmodeErrorLevel,
2100
- DA as TextmodeFont,
2101
- PA as TextmodeGrid,
2102
- W as Textmodifier,
2103
- LA as converters,
2104
- NA as create,
2105
- HA as export,
2106
- VA as rendering,
2107
- $A as setErrorLevel,
2108
- H as textmode,
2109
- zA as version
2037
+ vA as TextmodeCanvas,
2038
+ j as TextmodeErrorLevel,
2039
+ yA as TextmodeFont,
2040
+ xA as TextmodeGrid,
2041
+ $A as Textmodifier,
2042
+ XA as create,
2043
+ JA as export,
2044
+ jA as setErrorLevel,
2045
+ O as textmode,
2046
+ ZA as version
2110
2047
  };