@kolkrabbi/design-editor 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -26
- package/dist/{BufferResource-CKQMSOM4.js → BufferResource-BfLgK37S.js} +42 -34
- package/dist/{CanvasPool-ilDNHrRx.js → CanvasPool-YNSF8hsR.js} +9 -9
- package/dist/CanvasRenderer-Bl0rlqNq.js +2 -0
- package/dist/{browserAll-CJ593myQ.js → FederatedEventTarget-BJgROaRQ.js} +119 -127
- package/dist/FilterSystem-BUrPNXx-.js +1323 -0
- package/dist/{Geometry-D3fkwmax.js → Geometry-C5s5KpWq.js} +492 -411
- package/dist/{OrbitControls-CE3qSrHQ.js → OrbitControls-Cql8Rn2i.js} +1944 -1914
- package/dist/{RenderTargetSystem-umK0aqrs.js → RenderTargetSystem-oFwWv5IW.js} +1107 -612
- package/dist/WebGLRenderer-CXxpVIx3.js +2 -0
- package/dist/WebGPURenderer-BwLEUYBa.js +2 -0
- package/dist/browserAll-CAzdTUbR.js +6 -0
- package/dist/canvasUtils-BoNfkAod.js +168 -0
- package/dist/{rolldown-runtime-B0aSnxlc.js → chunk-3b4jIN3o.js} +4 -11
- package/dist/design-editor.css +2 -2
- package/dist/design-editor.js +7675 -8478
- package/dist/{getTextureBatchBindGroup-ChWkOJ3t.js → getTextureBatchBindGroup-CNWhZRbV.js} +5 -5
- package/dist/{host-6EhdLf5-.js → host-CVR9RL_W.js} +8 -6
- package/dist/{host-DPFYZP9I.js → host-be1CWhN1.js} +4 -2
- package/dist/init-jApIMi04.js +4 -0
- package/dist/{phase-D3rwI6OO.js → phase-t_DhU5Nm.js} +2 -2
- package/dist/pipeline-CMpuPUaX.js +11995 -0
- package/dist/{src-zDOFeQWX.js → src-QwKcYKfv.js} +747 -746
- package/dist/webworkerAll-DEZhpG90.js +2 -0
- package/package.json +33 -27
- package/LICENSE +0 -21
- package/dist/CanvasRenderer-CDbc3nH9.js +0 -3396
- package/dist/WebGLRenderer-DVKPZbKc.js +0 -2145
- package/dist/WebGPURenderer-DHSBocAL.js +0 -1656
- package/dist/canvasUtils-CXoNqK7T.js +0 -168
- package/dist/defaultFilter.vert-C9efGgir.js +0 -888
- package/dist/init-4Y6mtayI.js +0 -441
- package/dist/pipeline-DfTD40M-.js +0 -4825
- package/dist/webworkerAll-wTH3MKcZ.js +0 -2
|
@@ -1,3396 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./rolldown-runtime-B0aSnxlc.js";
|
|
2
|
-
import { $ as t, A as n, B as r, D as i, I as a, J as o, K as s, M as c, P as l, Q as u, V as d, W as f, X as p, Y as m, _ as h, a as g, c as _, h as v, it as y, nt as b, q as x, rt as S, tt as C, v as w, w as T } from "./Geometry-D3fkwmax.js";
|
|
3
|
-
import { n as E, r as D, t as O } from "./canvasUtils-CXoNqK7T.js";
|
|
4
|
-
import { D as k, O as A, d as j, f as M, k as N, l as P, m as F, o as I, p as L, r as ee, t as te, u as ne } from "./RenderTargetSystem-umK0aqrs.js";
|
|
5
|
-
import { t as re } from "./getTextureBatchBindGroup-ChWkOJ3t.js";
|
|
6
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/maths/misc/squaredDistanceToLineSegment.mjs
|
|
7
|
-
function ie(e, t, n, r, i, a) {
|
|
8
|
-
let o = e - n, s = t - r, c = i - n, l = a - r, u = o * c + s * l, d = c * c + l * l, f = -1;
|
|
9
|
-
d !== 0 && (f = u / d);
|
|
10
|
-
let p, m;
|
|
11
|
-
f < 0 ? (p = n, m = r) : f > 1 ? (p = i, m = a) : (p = n + f * c, m = r + f * l);
|
|
12
|
-
let h = e - p, g = t - m;
|
|
13
|
-
return h * h + g * g;
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/maths/shapes/Circle.mjs
|
|
17
|
-
var R = class e {
|
|
18
|
-
constructor(e = 0, t = 0, n = 0) {
|
|
19
|
-
this.type = "circle", this.x = e, this.y = t, this.radius = n;
|
|
20
|
-
}
|
|
21
|
-
clone() {
|
|
22
|
-
return new e(this.x, this.y, this.radius);
|
|
23
|
-
}
|
|
24
|
-
contains(e, t) {
|
|
25
|
-
if (this.radius <= 0) return !1;
|
|
26
|
-
let n = this.radius * this.radius, r = this.x - e, i = this.y - t;
|
|
27
|
-
return r *= r, i *= i, r + i <= n;
|
|
28
|
-
}
|
|
29
|
-
strokeContains(e, t, n, r = .5) {
|
|
30
|
-
if (this.radius === 0) return !1;
|
|
31
|
-
let i = this.x - e, a = this.y - t, o = this.radius, s = (1 - r) * n, c = Math.sqrt(i * i + a * a);
|
|
32
|
-
return c <= o + s && c > o - (n - s);
|
|
33
|
-
}
|
|
34
|
-
getBounds(e) {
|
|
35
|
-
return e ||= new d(), e.x = this.x - this.radius, e.y = this.y - this.radius, e.width = this.radius * 2, e.height = this.radius * 2, e;
|
|
36
|
-
}
|
|
37
|
-
copyFrom(e) {
|
|
38
|
-
return this.x = e.x, this.y = e.y, this.radius = e.radius, this;
|
|
39
|
-
}
|
|
40
|
-
copyTo(e) {
|
|
41
|
-
return e.copyFrom(this), e;
|
|
42
|
-
}
|
|
43
|
-
toString() {
|
|
44
|
-
return `[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`;
|
|
45
|
-
}
|
|
46
|
-
}, z = class e {
|
|
47
|
-
constructor(e = 0, t = 0, n = 0, r = 0) {
|
|
48
|
-
this.type = "ellipse", this.x = e, this.y = t, this.halfWidth = n, this.halfHeight = r;
|
|
49
|
-
}
|
|
50
|
-
clone() {
|
|
51
|
-
return new e(this.x, this.y, this.halfWidth, this.halfHeight);
|
|
52
|
-
}
|
|
53
|
-
contains(e, t) {
|
|
54
|
-
if (this.halfWidth <= 0 || this.halfHeight <= 0) return !1;
|
|
55
|
-
let n = (e - this.x) / this.halfWidth, r = (t - this.y) / this.halfHeight;
|
|
56
|
-
return n *= n, r *= r, n + r <= 1;
|
|
57
|
-
}
|
|
58
|
-
strokeContains(e, t, n, r = .5) {
|
|
59
|
-
let { halfWidth: i, halfHeight: a } = this;
|
|
60
|
-
if (i <= 0 || a <= 0) return !1;
|
|
61
|
-
let o = n * (1 - r), s = n - o, c = i - s, l = a - s, u = i + o, d = a + o, f = e - this.x, p = t - this.y, m = f * f / (c * c) + p * p / (l * l), h = f * f / (u * u) + p * p / (d * d);
|
|
62
|
-
return m > 1 && h <= 1;
|
|
63
|
-
}
|
|
64
|
-
getBounds(e) {
|
|
65
|
-
return e ||= new d(), e.x = this.x - this.halfWidth, e.y = this.y - this.halfHeight, e.width = this.halfWidth * 2, e.height = this.halfHeight * 2, e;
|
|
66
|
-
}
|
|
67
|
-
copyFrom(e) {
|
|
68
|
-
return this.x = e.x, this.y = e.y, this.halfWidth = e.halfWidth, this.halfHeight = e.halfHeight, this;
|
|
69
|
-
}
|
|
70
|
-
copyTo(e) {
|
|
71
|
-
return e.copyFrom(this), e;
|
|
72
|
-
}
|
|
73
|
-
toString() {
|
|
74
|
-
return `[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`;
|
|
75
|
-
}
|
|
76
|
-
}, ae, oe, se = class e {
|
|
77
|
-
constructor(...e) {
|
|
78
|
-
this.type = "polygon";
|
|
79
|
-
let t = Array.isArray(e[0]) ? e[0] : e;
|
|
80
|
-
if (typeof t[0] != "number") {
|
|
81
|
-
let e = [];
|
|
82
|
-
for (let n = 0, r = t.length; n < r; n++) e.push(t[n].x, t[n].y);
|
|
83
|
-
t = e;
|
|
84
|
-
}
|
|
85
|
-
this.points = t, this.closePath = !0;
|
|
86
|
-
}
|
|
87
|
-
isClockwise() {
|
|
88
|
-
let e = 0, t = this.points, n = t.length;
|
|
89
|
-
for (let r = 0; r < n; r += 2) {
|
|
90
|
-
let i = t[r], a = t[r + 1], o = t[(r + 2) % n], s = t[(r + 3) % n];
|
|
91
|
-
e += (o - i) * (s + a);
|
|
92
|
-
}
|
|
93
|
-
return e < 0;
|
|
94
|
-
}
|
|
95
|
-
containsPolygon(e) {
|
|
96
|
-
let t = this.getBounds(ae), n = e.getBounds(oe);
|
|
97
|
-
if (!t.containsRect(n)) return !1;
|
|
98
|
-
let r = e.points;
|
|
99
|
-
for (let e = 0; e < r.length; e += 2) {
|
|
100
|
-
let t = r[e], n = r[e + 1];
|
|
101
|
-
if (!this.contains(t, n)) return !1;
|
|
102
|
-
}
|
|
103
|
-
return !0;
|
|
104
|
-
}
|
|
105
|
-
clone() {
|
|
106
|
-
let t = this.points.slice(), n = new e(t);
|
|
107
|
-
return n.closePath = this.closePath, n;
|
|
108
|
-
}
|
|
109
|
-
contains(e, t) {
|
|
110
|
-
let n = !1, r = this.points.length / 2;
|
|
111
|
-
for (let i = 0, a = r - 1; i < r; a = i++) {
|
|
112
|
-
let r = this.points[i * 2], o = this.points[i * 2 + 1], s = this.points[a * 2], c = this.points[a * 2 + 1];
|
|
113
|
-
o > t != c > t && e < (s - r) * ((t - o) / (c - o)) + r && (n = !n);
|
|
114
|
-
}
|
|
115
|
-
return n;
|
|
116
|
-
}
|
|
117
|
-
strokeContains(e, t, n, r = .5) {
|
|
118
|
-
let i = n * n, a = i * (1 - r), o = i - a, { points: s } = this, c = s.length - (this.closePath ? 0 : 2);
|
|
119
|
-
for (let n = 0; n < c; n += 2) {
|
|
120
|
-
let r = s[n], i = s[n + 1], c = s[(n + 2) % s.length], l = s[(n + 3) % s.length];
|
|
121
|
-
if (ie(e, t, r, i, c, l) <= (Math.sign((c - r) * (t - i) - (l - i) * (e - r)) < 0 ? o : a)) return !0;
|
|
122
|
-
}
|
|
123
|
-
return !1;
|
|
124
|
-
}
|
|
125
|
-
getBounds(e) {
|
|
126
|
-
e ||= new d();
|
|
127
|
-
let t = this.points, n = Infinity, r = -Infinity, i = Infinity, a = -Infinity;
|
|
128
|
-
for (let e = 0, o = t.length; e < o; e += 2) {
|
|
129
|
-
let o = t[e], s = t[e + 1];
|
|
130
|
-
n = o < n ? o : n, r = o > r ? o : r, i = s < i ? s : i, a = s > a ? s : a;
|
|
131
|
-
}
|
|
132
|
-
return e.x = n, e.width = r - n, e.y = i, e.height = a - i, e;
|
|
133
|
-
}
|
|
134
|
-
copyFrom(e) {
|
|
135
|
-
return this.points = e.points.slice(), this.closePath = e.closePath, this;
|
|
136
|
-
}
|
|
137
|
-
copyTo(e) {
|
|
138
|
-
return e.copyFrom(this), e;
|
|
139
|
-
}
|
|
140
|
-
toString() {
|
|
141
|
-
return `[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e, t) => `${e}, ${t}`, "")}]`;
|
|
142
|
-
}
|
|
143
|
-
get lastX() {
|
|
144
|
-
return this.points[this.points.length - 2];
|
|
145
|
-
}
|
|
146
|
-
get lastY() {
|
|
147
|
-
return this.points[this.points.length - 1];
|
|
148
|
-
}
|
|
149
|
-
get x() {
|
|
150
|
-
return x("8.11.0", "Polygon.lastX is deprecated, please use Polygon.lastX instead."), this.points[this.points.length - 2];
|
|
151
|
-
}
|
|
152
|
-
get y() {
|
|
153
|
-
return x("8.11.0", "Polygon.y is deprecated, please use Polygon.lastY instead."), this.points[this.points.length - 1];
|
|
154
|
-
}
|
|
155
|
-
get startX() {
|
|
156
|
-
return this.points[0];
|
|
157
|
-
}
|
|
158
|
-
get startY() {
|
|
159
|
-
return this.points[1];
|
|
160
|
-
}
|
|
161
|
-
}, B = (e, t, n, r, i, a, o) => {
|
|
162
|
-
let s = e - n, c = t - r, l = Math.sqrt(s * s + c * c);
|
|
163
|
-
return l >= i - a && l <= i + o;
|
|
164
|
-
}, ce = class e {
|
|
165
|
-
constructor(e = 0, t = 0, n = 0, r = 0, i = 20) {
|
|
166
|
-
this.type = "roundedRectangle", this.x = e, this.y = t, this.width = n, this.height = r, this.radius = i;
|
|
167
|
-
}
|
|
168
|
-
getBounds(e) {
|
|
169
|
-
return e ||= new d(), e.x = this.x, e.y = this.y, e.width = this.width, e.height = this.height, e;
|
|
170
|
-
}
|
|
171
|
-
clone() {
|
|
172
|
-
return new e(this.x, this.y, this.width, this.height, this.radius);
|
|
173
|
-
}
|
|
174
|
-
copyFrom(e) {
|
|
175
|
-
return this.x = e.x, this.y = e.y, this.width = e.width, this.height = e.height, this;
|
|
176
|
-
}
|
|
177
|
-
copyTo(e) {
|
|
178
|
-
return e.copyFrom(this), e;
|
|
179
|
-
}
|
|
180
|
-
contains(e, t) {
|
|
181
|
-
if (this.width <= 0 || this.height <= 0) return !1;
|
|
182
|
-
if (e >= this.x && e <= this.x + this.width && t >= this.y && t <= this.y + this.height) {
|
|
183
|
-
let n = Math.max(0, Math.min(this.radius, Math.min(this.width, this.height) / 2));
|
|
184
|
-
if (t >= this.y + n && t <= this.y + this.height - n || e >= this.x + n && e <= this.x + this.width - n) return !0;
|
|
185
|
-
let r = e - (this.x + n), i = t - (this.y + n), a = n * n;
|
|
186
|
-
if (r * r + i * i <= a || (r = e - (this.x + this.width - n), r * r + i * i <= a) || (i = t - (this.y + this.height - n), r * r + i * i <= a) || (r = e - (this.x + n), r * r + i * i <= a)) return !0;
|
|
187
|
-
}
|
|
188
|
-
return !1;
|
|
189
|
-
}
|
|
190
|
-
strokeContains(e, t, n, r = .5) {
|
|
191
|
-
let { x: i, y: a, width: o, height: s, radius: c } = this, l = n * (1 - r), u = n - l, d = i + c, f = a + c, p = o - c * 2, m = s - c * 2, h = i + o, g = a + s;
|
|
192
|
-
return (e >= i - l && e <= i + u || e >= h - u && e <= h + l) && t >= f && t <= f + m || (t >= a - l && t <= a + u || t >= g - u && t <= g + l) && e >= d && e <= d + p || e < d && t < f && B(e, t, d, f, c, u, l) || e > h - c && t < f && B(e, t, h - c, f, c, u, l) || e > h - c && t > g - c && B(e, t, h - c, g - c, c, u, l) || e < d && t > g - c && B(e, t, d, g - c, c, u, l);
|
|
193
|
-
}
|
|
194
|
-
toString() {
|
|
195
|
-
return `[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`;
|
|
196
|
-
}
|
|
197
|
-
}, le = 1e-4, V = 1e-4;
|
|
198
|
-
//#endregion
|
|
199
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/utils/getOrientationOfPoints.mjs
|
|
200
|
-
function ue(e) {
|
|
201
|
-
let t = e.length;
|
|
202
|
-
if (t < 6) return 1;
|
|
203
|
-
let n = 0;
|
|
204
|
-
for (let r = 0, i = e[t - 2], a = e[t - 1]; r < t; r += 2) {
|
|
205
|
-
let t = e[r], o = e[r + 1];
|
|
206
|
-
n += (t - i) * (o + a), i = t, a = o;
|
|
207
|
-
}
|
|
208
|
-
return n < 0 ? -1 : 1;
|
|
209
|
-
}
|
|
210
|
-
//#endregion
|
|
211
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildLine.mjs
|
|
212
|
-
function de(e, t, n, r, i, a, o, s) {
|
|
213
|
-
let c = e - n * i, l = t - r * i, u = e + n * a, d = t + r * a, f, p;
|
|
214
|
-
o ? (f = r, p = -n) : (f = -r, p = n);
|
|
215
|
-
let m = c + f, h = l + p, g = u + f, _ = d + p;
|
|
216
|
-
return s.push(m, h), s.push(g, _), 2;
|
|
217
|
-
}
|
|
218
|
-
function H(e, t, n, r, i, a, o, s) {
|
|
219
|
-
let c = n - e, l = r - t, u = Math.atan2(c, l), d = Math.atan2(i - e, a - t);
|
|
220
|
-
s && u < d ? u += Math.PI * 2 : !s && u > d && (d += Math.PI * 2);
|
|
221
|
-
let f = u, p = d - u, m = Math.abs(p), h = Math.sqrt(c * c + l * l), g = (15 * m * Math.sqrt(h) / Math.PI >> 0) + 1, _ = p / g;
|
|
222
|
-
if (f += _, s) {
|
|
223
|
-
o.push(e, t), o.push(n, r);
|
|
224
|
-
for (let n = 1, r = f; n < g; n++, r += _) o.push(e, t), o.push(e + Math.sin(r) * h, t + Math.cos(r) * h);
|
|
225
|
-
o.push(e, t), o.push(i, a);
|
|
226
|
-
} else {
|
|
227
|
-
o.push(n, r), o.push(e, t);
|
|
228
|
-
for (let n = 1, r = f; n < g; n++, r += _) o.push(e + Math.sin(r) * h, t + Math.cos(r) * h), o.push(e, t);
|
|
229
|
-
o.push(i, a), o.push(e, t);
|
|
230
|
-
}
|
|
231
|
-
return g * 2;
|
|
232
|
-
}
|
|
233
|
-
function fe(e, n, r, i, a, o) {
|
|
234
|
-
let s = le;
|
|
235
|
-
if (e.length === 0) return;
|
|
236
|
-
let c = n, l = c.alignment;
|
|
237
|
-
if (n.alignment !== .5) {
|
|
238
|
-
let t = ue(e);
|
|
239
|
-
r && (t *= -1), l = (l - .5) * t + .5;
|
|
240
|
-
}
|
|
241
|
-
let u = new t(e[0], e[1]), d = new t(e[e.length - 2], e[e.length - 1]), f = i, p = Math.abs(u.x - d.x) < s && Math.abs(u.y - d.y) < s;
|
|
242
|
-
if (f) {
|
|
243
|
-
e = e.slice(), p && (e.pop(), e.pop(), d.set(e[e.length - 2], e[e.length - 1]));
|
|
244
|
-
let t = (u.x + d.x) * .5, n = (d.y + u.y) * .5;
|
|
245
|
-
e.unshift(t, n), e.push(t, n);
|
|
246
|
-
}
|
|
247
|
-
let m = a, h = e.length / 2, g = e.length, _ = m.length / 2, v = c.width / 2, y = v * v, b = c.miterLimit * c.miterLimit, x = e[0], S = e[1], C = e[2], w = e[3], T = 0, E = 0, D = -(S - w), O = x - C, k = 0, A = 0, j = Math.sqrt(D * D + O * O);
|
|
248
|
-
D /= j, O /= j, D *= v, O *= v;
|
|
249
|
-
let M = l, N = (1 - M) * 2, P = M * 2;
|
|
250
|
-
f || (c.cap === "round" ? g += H(x - D * (N - P) * .5, S - O * (N - P) * .5, x - D * N, S - O * N, x + D * P, S + O * P, m, !0) + 2 : c.cap === "square" && (g += de(x, S, D, O, N, P, !0, m))), m.push(x - D * N, S - O * N), m.push(x + D * P, S + O * P);
|
|
251
|
-
for (let t = 1; t < h - 1; ++t) {
|
|
252
|
-
x = e[(t - 1) * 2], S = e[(t - 1) * 2 + 1], C = e[t * 2], w = e[t * 2 + 1], T = e[(t + 1) * 2], E = e[(t + 1) * 2 + 1], D = -(S - w), O = x - C, j = Math.sqrt(D * D + O * O), D /= j, O /= j, D *= v, O *= v, k = -(w - E), A = C - T, j = Math.sqrt(k * k + A * A), k /= j, A /= j, k *= v, A *= v;
|
|
253
|
-
let n = C - x, r = S - w, i = C - T, a = E - w, o = n * i + r * a, s = r * i - a * n, l = s < 0;
|
|
254
|
-
if (Math.abs(s) < .001 * Math.abs(o)) {
|
|
255
|
-
m.push(C - D * N, w - O * N), m.push(C + D * P, w + O * P), o >= 0 && (c.join === "round" ? g += H(C, w, C - D * N, w - O * N, C - k * N, w - A * N, m, !1) + 4 : g += 2, m.push(C - k * P, w - A * P), m.push(C + k * N, w + A * N));
|
|
256
|
-
continue;
|
|
257
|
-
}
|
|
258
|
-
let u = (-D + x) * (-O + w) - (-D + C) * (-O + S), d = (-k + T) * (-A + w) - (-k + C) * (-A + E), f = (n * d - i * u) / s, p = (a * u - r * d) / s, h = (f - C) * (f - C) + (p - w) * (p - w), _ = C + (f - C) * N, M = w + (p - w) * N, F = C - (f - C) * P, I = w - (p - w) * P, L = Math.min(n * n + r * r, i * i + a * a), ee = l ? N : P;
|
|
259
|
-
h <= L + ee * ee * y ? c.join === "bevel" || h / y > b ? (l ? (m.push(_, M), m.push(C + D * P, w + O * P), m.push(_, M), m.push(C + k * P, w + A * P)) : (m.push(C - D * N, w - O * N), m.push(F, I), m.push(C - k * N, w - A * N), m.push(F, I)), g += 2) : c.join === "round" ? l ? (m.push(_, M), m.push(C + D * P, w + O * P), g += H(C, w, C + D * P, w + O * P, C + k * P, w + A * P, m, !0) + 4, m.push(_, M), m.push(C + k * P, w + A * P)) : (m.push(C - D * N, w - O * N), m.push(F, I), g += H(C, w, C - D * N, w - O * N, C - k * N, w - A * N, m, !1) + 4, m.push(C - k * N, w - A * N), m.push(F, I)) : (m.push(_, M), m.push(F, I)) : (m.push(C - D * N, w - O * N), m.push(C + D * P, w + O * P), c.join === "round" ? g += l ? H(C, w, C + D * P, w + O * P, C + k * P, w + A * P, m, !0) + 2 : H(C, w, C - D * N, w - O * N, C - k * N, w - A * N, m, !1) + 2 : c.join === "miter" && h / y <= b && (l ? (m.push(F, I), m.push(F, I)) : (m.push(_, M), m.push(_, M)), g += 2), m.push(C - k * N, w - A * N), m.push(C + k * P, w + A * P), g += 2);
|
|
260
|
-
}
|
|
261
|
-
x = e[(h - 2) * 2], S = e[(h - 2) * 2 + 1], C = e[(h - 1) * 2], w = e[(h - 1) * 2 + 1], D = -(S - w), O = x - C, j = Math.sqrt(D * D + O * O), D /= j, O /= j, D *= v, O *= v, m.push(C - D * N, w - O * N), m.push(C + D * P, w + O * P), f || (c.cap === "round" ? g += H(C - D * (N - P) * .5, w - O * (N - P) * .5, C - D * N, w - O * N, C + D * P, w + O * P, m, !1) + 2 : c.cap === "square" && (g += de(C, w, D, O, N, P, !1, m)));
|
|
262
|
-
let F = V * V;
|
|
263
|
-
for (let e = _; e < g + _ - 2; ++e) x = m[e * 2], S = m[e * 2 + 1], C = m[(e + 1) * 2], w = m[(e + 1) * 2 + 1], T = m[(e + 2) * 2], E = m[(e + 2) * 2 + 1], !(Math.abs(x * (w - E) + C * (E - S) + T * (S - w)) < F) && o.push(e, e + 1, e + 2);
|
|
264
|
-
}
|
|
265
|
-
//#endregion
|
|
266
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/fill/FillGradient.mjs
|
|
267
|
-
var pe = [{
|
|
268
|
-
offset: 0,
|
|
269
|
-
color: "white"
|
|
270
|
-
}, {
|
|
271
|
-
offset: 1,
|
|
272
|
-
color: "black"
|
|
273
|
-
}], me = class e {
|
|
274
|
-
constructor(...t) {
|
|
275
|
-
this.uid = p("fillGradient"), this._tick = 0, this.type = "linear", this.colorStops = [];
|
|
276
|
-
let r = _e(t);
|
|
277
|
-
r = {
|
|
278
|
-
...r.type === "radial" ? e.defaultRadialOptions : e.defaultLinearOptions,
|
|
279
|
-
...n(r)
|
|
280
|
-
}, this._textureSize = r.textureSize, this._wrapMode = r.wrapMode, r.type === "radial" ? (this.center = r.center, this.outerCenter = r.outerCenter ?? this.center, this.innerRadius = r.innerRadius, this.outerRadius = r.outerRadius, this.scale = r.scale, this.rotation = r.rotation) : (this.start = r.start, this.end = r.end), this.textureSpace = r.textureSpace, this.type = r.type, r.colorStops.forEach((e) => {
|
|
281
|
-
this.addColorStop(e.offset, e.color);
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
addColorStop(e, t) {
|
|
285
|
-
return this.colorStops.push({
|
|
286
|
-
offset: e,
|
|
287
|
-
color: C.shared.setValue(t).toHexa()
|
|
288
|
-
}), this;
|
|
289
|
-
}
|
|
290
|
-
buildLinearGradient() {
|
|
291
|
-
if (this.texture) return;
|
|
292
|
-
let { x: e, y: t } = this.start, { x: n, y: r } = this.end, i = n - e, a = r - t, o = i < 0 || a < 0;
|
|
293
|
-
if (this._wrapMode === "clamp-to-edge") {
|
|
294
|
-
if (i < 0) {
|
|
295
|
-
let t = e;
|
|
296
|
-
e = n, n = t, i *= -1;
|
|
297
|
-
}
|
|
298
|
-
if (a < 0) {
|
|
299
|
-
let e = t;
|
|
300
|
-
t = r, r = e, a *= -1;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
let s = this.colorStops.length ? this.colorStops : pe, c = this._textureSize, { canvas: l, context: d } = ge(c, 1), f = o ? d.createLinearGradient(this._textureSize, 0, 0, 0) : d.createLinearGradient(0, 0, this._textureSize, 0);
|
|
304
|
-
he(f, s), d.fillStyle = f, d.fillRect(0, 0, c, 1), this.texture = new T({ source: new D({
|
|
305
|
-
resource: l,
|
|
306
|
-
addressMode: this._wrapMode
|
|
307
|
-
}) });
|
|
308
|
-
let p = Math.sqrt(i * i + a * a), m = Math.atan2(a, i), h = new u();
|
|
309
|
-
h.scale(p / c, 1), h.rotate(m), h.translate(e, t), this.textureSpace === "local" && h.scale(c, c), this.transform = h;
|
|
310
|
-
}
|
|
311
|
-
buildGradient() {
|
|
312
|
-
this.texture || this._tick++, this.type === "linear" ? this.buildLinearGradient() : this.buildRadialGradient();
|
|
313
|
-
}
|
|
314
|
-
buildRadialGradient() {
|
|
315
|
-
if (this.texture) return;
|
|
316
|
-
let e = this.colorStops.length ? this.colorStops : pe, t = this._textureSize, { canvas: n, context: r } = ge(t, t), { x: i, y: a } = this.center, { x: o, y: s } = this.outerCenter, c = this.innerRadius, l = this.outerRadius, d = o - l, f = s - l, p = t / (l * 2), m = (i - d) * p, h = (a - f) * p, g = r.createRadialGradient(m, h, c * p, (o - d) * p, (s - f) * p, l * p);
|
|
317
|
-
he(g, e), r.fillStyle = e[e.length - 1].color, r.fillRect(0, 0, t, t), r.fillStyle = g, r.translate(m, h), r.rotate(this.rotation), r.scale(1, this.scale), r.translate(-m, -h), r.fillRect(0, 0, t, t), this.texture = new T({ source: new D({
|
|
318
|
-
resource: n,
|
|
319
|
-
addressMode: this._wrapMode
|
|
320
|
-
}) });
|
|
321
|
-
let _ = new u();
|
|
322
|
-
this.textureSpace === "local" ? _.scale(2 * l, 2 * l) : _.scale(1 / p, 1 / p), _.translate(d, f), this.transform = _;
|
|
323
|
-
}
|
|
324
|
-
destroy() {
|
|
325
|
-
this.texture?.destroy(!0), this.texture = null, this.transform = null, this.colorStops = [], this.start = null, this.end = null, this.center = null, this.outerCenter = null;
|
|
326
|
-
}
|
|
327
|
-
get styleKey() {
|
|
328
|
-
return `fill-gradient-${this.uid}-${this._tick}`;
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
me.defaultLinearOptions = {
|
|
332
|
-
start: {
|
|
333
|
-
x: 0,
|
|
334
|
-
y: 0
|
|
335
|
-
},
|
|
336
|
-
end: {
|
|
337
|
-
x: 0,
|
|
338
|
-
y: 1
|
|
339
|
-
},
|
|
340
|
-
colorStops: [],
|
|
341
|
-
textureSpace: "local",
|
|
342
|
-
type: "linear",
|
|
343
|
-
textureSize: 256,
|
|
344
|
-
wrapMode: "clamp-to-edge"
|
|
345
|
-
}, me.defaultRadialOptions = {
|
|
346
|
-
center: {
|
|
347
|
-
x: .5,
|
|
348
|
-
y: .5
|
|
349
|
-
},
|
|
350
|
-
innerRadius: 0,
|
|
351
|
-
outerRadius: .5,
|
|
352
|
-
colorStops: [],
|
|
353
|
-
scale: 1,
|
|
354
|
-
rotation: 0,
|
|
355
|
-
textureSpace: "local",
|
|
356
|
-
type: "radial",
|
|
357
|
-
textureSize: 256,
|
|
358
|
-
wrapMode: "clamp-to-edge"
|
|
359
|
-
};
|
|
360
|
-
var U = me;
|
|
361
|
-
function he(e, t) {
|
|
362
|
-
for (let n = 0; n < t.length; n++) {
|
|
363
|
-
let r = t[n];
|
|
364
|
-
e.addColorStop(r.offset, r.color);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
function ge(e, t) {
|
|
368
|
-
let n = h.get().createCanvas(e, t);
|
|
369
|
-
return {
|
|
370
|
-
canvas: n,
|
|
371
|
-
context: n.getContext("2d")
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
function _e(e) {
|
|
375
|
-
let t = e[0] ?? {};
|
|
376
|
-
return (typeof t == "number" || e[1]) && (x("8.5.2", "use options object instead"), t = {
|
|
377
|
-
type: "linear",
|
|
378
|
-
start: {
|
|
379
|
-
x: e[0],
|
|
380
|
-
y: e[1]
|
|
381
|
-
},
|
|
382
|
-
end: {
|
|
383
|
-
x: e[2],
|
|
384
|
-
y: e[3]
|
|
385
|
-
},
|
|
386
|
-
textureSpace: e[4],
|
|
387
|
-
textureSize: e[5] ?? U.defaultLinearOptions.textureSize
|
|
388
|
-
}), t;
|
|
389
|
-
}
|
|
390
|
-
//#endregion
|
|
391
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/fill/FillPattern.mjs
|
|
392
|
-
function ve(e) {
|
|
393
|
-
return e.texture !== void 0;
|
|
394
|
-
}
|
|
395
|
-
var ye = {
|
|
396
|
-
repeat: {
|
|
397
|
-
addressModeU: "repeat",
|
|
398
|
-
addressModeV: "repeat"
|
|
399
|
-
},
|
|
400
|
-
"repeat-x": {
|
|
401
|
-
addressModeU: "repeat",
|
|
402
|
-
addressModeV: "clamp-to-edge"
|
|
403
|
-
},
|
|
404
|
-
"repeat-y": {
|
|
405
|
-
addressModeU: "clamp-to-edge",
|
|
406
|
-
addressModeV: "repeat"
|
|
407
|
-
},
|
|
408
|
-
"no-repeat": {
|
|
409
|
-
addressModeU: "clamp-to-edge",
|
|
410
|
-
addressModeV: "clamp-to-edge"
|
|
411
|
-
}
|
|
412
|
-
}, be = class {
|
|
413
|
-
constructor(e, t) {
|
|
414
|
-
this.uid = p("fillPattern"), this._tick = 0, this.transform = new u();
|
|
415
|
-
let n = ve(e) ? e : {
|
|
416
|
-
texture: e,
|
|
417
|
-
repetition: t
|
|
418
|
-
};
|
|
419
|
-
this.texture = n.texture, this.textureSpace = n.textureSpace ?? "global";
|
|
420
|
-
let r = n.repetition;
|
|
421
|
-
r && (this.texture.source.style.addressModeU = ye[r].addressModeU, this.texture.source.style.addressModeV = ye[r].addressModeV);
|
|
422
|
-
}
|
|
423
|
-
setTransform(e) {
|
|
424
|
-
if (e) {
|
|
425
|
-
if (this.transform.equals(e)) return;
|
|
426
|
-
this.transform.copyFrom(e);
|
|
427
|
-
} else {
|
|
428
|
-
if (this.transform.isIdentity()) return;
|
|
429
|
-
this.transform.identity();
|
|
430
|
-
}
|
|
431
|
-
this._tick++;
|
|
432
|
-
}
|
|
433
|
-
get texture() {
|
|
434
|
-
return this._texture;
|
|
435
|
-
}
|
|
436
|
-
set texture(e) {
|
|
437
|
-
this._texture !== e && (this._texture = e, this._tick++);
|
|
438
|
-
}
|
|
439
|
-
get styleKey() {
|
|
440
|
-
return `fill-pattern-${this.uid}-${this._tick}`;
|
|
441
|
-
}
|
|
442
|
-
destroy() {
|
|
443
|
-
this.texture.destroy(!0), this.texture = null;
|
|
444
|
-
}
|
|
445
|
-
};
|
|
446
|
-
//#endregion
|
|
447
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/geometry/utils/buildUvs.mjs
|
|
448
|
-
function xe(e, t, n, r, i, a, o, s = null) {
|
|
449
|
-
let c = 0;
|
|
450
|
-
n *= t, i *= a;
|
|
451
|
-
let l = s.a, u = s.b, d = s.c, f = s.d, p = s.tx, m = s.ty;
|
|
452
|
-
for (; c < o;) {
|
|
453
|
-
let o = e[n], s = e[n + 1];
|
|
454
|
-
r[i] = l * o + d * s + p, r[i + 1] = u * o + f * s + m, i += a, n += t, c++;
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
function Se(e, t, n, r) {
|
|
458
|
-
let i = 0;
|
|
459
|
-
for (t *= n; i < r;) e[t] = 0, e[t + 1] = 0, t += n, i++;
|
|
460
|
-
}
|
|
461
|
-
//#endregion
|
|
462
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/geometry/utils/transformVertices.mjs
|
|
463
|
-
function Ce(e, t, n, r, i) {
|
|
464
|
-
let a = t.a, o = t.b, s = t.c, c = t.d, l = t.tx, u = t.ty;
|
|
465
|
-
n ||= 0, r ||= 2, i ||= e.length / r - n;
|
|
466
|
-
let d = n * r;
|
|
467
|
-
for (let t = 0; t < i; t++) {
|
|
468
|
-
let t = e[d], n = e[d + 1];
|
|
469
|
-
e[d] = a * t + s * n + l, e[d + 1] = o * t + c * n + u, d += r;
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
//#endregion
|
|
473
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/BatchableGraphics.mjs
|
|
474
|
-
var we = new u(), Te = class {
|
|
475
|
-
constructor() {
|
|
476
|
-
this.packAsQuad = !1, this.batcherName = "default", this.topology = "triangle-list", this.applyTransform = !0, this.roundPixels = 0, this._batcher = null, this._batch = null;
|
|
477
|
-
}
|
|
478
|
-
get uvs() {
|
|
479
|
-
return this.geometryData.uvs;
|
|
480
|
-
}
|
|
481
|
-
get positions() {
|
|
482
|
-
return this.geometryData.vertices;
|
|
483
|
-
}
|
|
484
|
-
get indices() {
|
|
485
|
-
return this.geometryData.indices;
|
|
486
|
-
}
|
|
487
|
-
get blendMode() {
|
|
488
|
-
return this.renderable && this.applyTransform ? this.renderable.groupBlendMode : "normal";
|
|
489
|
-
}
|
|
490
|
-
get color() {
|
|
491
|
-
let e = this.baseColor, t = e >> 16 | e & 65280 | (e & 255) << 16, n = this.renderable;
|
|
492
|
-
return n ? a(t, n.groupColor) + (this.alpha * n.groupAlpha * 255 << 24) : t + (this.alpha * 255 << 24);
|
|
493
|
-
}
|
|
494
|
-
get transform() {
|
|
495
|
-
return this.renderable?.groupTransform || we;
|
|
496
|
-
}
|
|
497
|
-
copyTo(e) {
|
|
498
|
-
e.indexOffset = this.indexOffset, e.indexSize = this.indexSize, e.attributeOffset = this.attributeOffset, e.attributeSize = this.attributeSize, e.baseColor = this.baseColor, e.alpha = this.alpha, e.texture = this.texture, e.geometryData = this.geometryData, e.topology = this.topology;
|
|
499
|
-
}
|
|
500
|
-
reset() {
|
|
501
|
-
this.applyTransform = !0, this.renderable = null, this.topology = "triangle-list";
|
|
502
|
-
}
|
|
503
|
-
destroy() {
|
|
504
|
-
this.renderable = null, this.texture = null, this.geometryData = null, this._batcher = null, this._batch = null;
|
|
505
|
-
}
|
|
506
|
-
}, Ee = {
|
|
507
|
-
extension: {
|
|
508
|
-
type: S.ShapeBuilder,
|
|
509
|
-
name: "circle"
|
|
510
|
-
},
|
|
511
|
-
build(e, t) {
|
|
512
|
-
let n, r, i, a, o, s;
|
|
513
|
-
if (e.type === "circle") {
|
|
514
|
-
let t = e;
|
|
515
|
-
if (o = s = t.radius, o <= 0) return !1;
|
|
516
|
-
n = t.x, r = t.y, i = a = 0;
|
|
517
|
-
} else if (e.type === "ellipse") {
|
|
518
|
-
let t = e;
|
|
519
|
-
if (o = t.halfWidth, s = t.halfHeight, o <= 0 || s <= 0) return !1;
|
|
520
|
-
n = t.x, r = t.y, i = a = 0;
|
|
521
|
-
} else {
|
|
522
|
-
let t = e, c = t.width / 2, l = t.height / 2;
|
|
523
|
-
n = t.x + c, r = t.y + l, o = s = Math.max(0, Math.min(t.radius, Math.min(c, l))), i = c - o, a = l - s;
|
|
524
|
-
}
|
|
525
|
-
if (i < 0 || a < 0) return !1;
|
|
526
|
-
let c = Math.ceil(2.3 * Math.sqrt(o + s)), l = c * 8 + (i ? 4 : 0) + (a ? 4 : 0);
|
|
527
|
-
if (l === 0) return !1;
|
|
528
|
-
if (c === 0) return t[0] = t[6] = n + i, t[1] = t[3] = r + a, t[2] = t[4] = n - i, t[5] = t[7] = r - a, !0;
|
|
529
|
-
let u = 0, d = c * 4 + (i ? 2 : 0) + 2, f = d, p = l, m = i + o, h = a, g = n + m, _ = n - m, v = r + h;
|
|
530
|
-
if (t[u++] = g, t[u++] = v, t[--d] = v, t[--d] = _, a) {
|
|
531
|
-
let e = r - h;
|
|
532
|
-
t[f++] = _, t[f++] = e, t[--p] = e, t[--p] = g;
|
|
533
|
-
}
|
|
534
|
-
for (let e = 1; e < c; e++) {
|
|
535
|
-
let l = Math.PI / 2 * (e / c), m = i + Math.cos(l) * o, h = a + Math.sin(l) * s, g = n + m, _ = n - m, v = r + h, y = r - h;
|
|
536
|
-
t[u++] = g, t[u++] = v, t[--d] = v, t[--d] = _, t[f++] = _, t[f++] = y, t[--p] = y, t[--p] = g;
|
|
537
|
-
}
|
|
538
|
-
m = i, h = a + s, g = n + m, _ = n - m, v = r + h;
|
|
539
|
-
let y = r - h;
|
|
540
|
-
return t[u++] = g, t[u++] = v, t[--p] = y, t[--p] = g, i && (t[u++] = _, t[u++] = v, t[--p] = y, t[--p] = _), !0;
|
|
541
|
-
},
|
|
542
|
-
triangulate(e, t, n, r, i, a) {
|
|
543
|
-
if (e.length === 0) return;
|
|
544
|
-
let o = 0, s = 0;
|
|
545
|
-
for (let t = 0; t < e.length; t += 2) o += e[t], s += e[t + 1];
|
|
546
|
-
o /= e.length / 2, s /= e.length / 2;
|
|
547
|
-
let c = r;
|
|
548
|
-
t[c * n] = o, t[c * n + 1] = s;
|
|
549
|
-
let l = c++;
|
|
550
|
-
for (let r = 0; r < e.length; r += 2) t[c * n] = e[r], t[c * n + 1] = e[r + 1], r > 0 && (i[a++] = c, i[a++] = l, i[a++] = c - 1), c++;
|
|
551
|
-
i[a++] = l + 1, i[a++] = l, i[a++] = c - 1;
|
|
552
|
-
}
|
|
553
|
-
}, De = {
|
|
554
|
-
...Ee,
|
|
555
|
-
extension: {
|
|
556
|
-
...Ee.extension,
|
|
557
|
-
name: "ellipse"
|
|
558
|
-
}
|
|
559
|
-
}, Oe = {
|
|
560
|
-
...Ee,
|
|
561
|
-
extension: {
|
|
562
|
-
...Ee.extension,
|
|
563
|
-
name: "roundedRectangle"
|
|
564
|
-
}
|
|
565
|
-
};
|
|
566
|
-
//#endregion
|
|
567
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildPixelLine.mjs
|
|
568
|
-
function ke(e, t, n, r) {
|
|
569
|
-
let i = le;
|
|
570
|
-
if (e.length === 0) return;
|
|
571
|
-
let a = e[0], o = e[1], s = e[e.length - 2], c = e[e.length - 1], l = t || Math.abs(a - s) < i && Math.abs(o - c) < i, u = n, d = e.length / 2, f = u.length / 2;
|
|
572
|
-
for (let t = 0; t < d; t++) u.push(e[t * 2]), u.push(e[t * 2 + 1]);
|
|
573
|
-
for (let e = 0; e < d - 1; e++) r.push(f + e, f + e + 1);
|
|
574
|
-
l && r.push(f + d - 1, f);
|
|
575
|
-
}
|
|
576
|
-
//#endregion
|
|
577
|
-
//#region node_modules/.pnpm/earcut@3.2.3/node_modules/earcut/src/earcut.js
|
|
578
|
-
var Ae = /* @__PURE__ */ new Set(), je = !1;
|
|
579
|
-
function Me(e, t, n = 2) {
|
|
580
|
-
let r = t && t.length, i = r ? t[0] * n : e.length;
|
|
581
|
-
Ae.size && Ae.clear();
|
|
582
|
-
let a = Ne(e, 0, i, n, !0), o = [];
|
|
583
|
-
if (!a || a.next === a.prev) return o;
|
|
584
|
-
let s = 0, c = 0, l = 0;
|
|
585
|
-
if (r && (a = Be(e, t, a, n)), e.length > 80 * n) {
|
|
586
|
-
s = e[0], c = e[1];
|
|
587
|
-
let t = s, r = c;
|
|
588
|
-
for (let a = n; a < i; a += n) {
|
|
589
|
-
let n = e[a], i = e[a + 1];
|
|
590
|
-
n < s && (s = n), i < c && (c = i), n > t && (t = n), i > r && (r = i);
|
|
591
|
-
}
|
|
592
|
-
l = Math.max(t - s, r - c), l = l === 0 ? 0 : 32767 / l;
|
|
593
|
-
}
|
|
594
|
-
return Pe(a, o, s, c, l), o;
|
|
595
|
-
}
|
|
596
|
-
function Ne(e, t, n, r, i) {
|
|
597
|
-
let a = null;
|
|
598
|
-
if (i === bt(e, t, n, r) > 0) for (let i = t; i < n; i += r) a = _t(i / r | 0, e[i], e[i + 1], a);
|
|
599
|
-
else for (let i = n - r; i >= t; i -= r) a = _t(i / r | 0, e[i], e[i + 1], a);
|
|
600
|
-
return a && ut(a, a.next) && (vt(a), a = a.next), a;
|
|
601
|
-
}
|
|
602
|
-
function W(e, t = e) {
|
|
603
|
-
let n = t === e, r = e, i;
|
|
604
|
-
do
|
|
605
|
-
i = !1, r !== r.next && (Ae.size === 0 || !Ae.has(r)) && (ut(r, r.next) || J(r.prev, r, r.next) === 0) ? ((n || r === t) && (t = r.prev), je = !0, vt(r), r = r.prev, i = !0) : (n || r !== t) && (r = r.next, i = !n);
|
|
606
|
-
while (i || r !== t);
|
|
607
|
-
return t;
|
|
608
|
-
}
|
|
609
|
-
function Pe(e, t, n, r, i) {
|
|
610
|
-
i && rt(e, n, r, i);
|
|
611
|
-
let a = e, o = !1;
|
|
612
|
-
for (; e.prev !== e.next;) {
|
|
613
|
-
let s = e.prev, c = e.next;
|
|
614
|
-
if (J(s, e, c) < 0 && (i ? Ie(e, n, r, i) : Fe(e))) {
|
|
615
|
-
t.push(s.i, e.i, c.i), vt(e), e = c, a = c;
|
|
616
|
-
continue;
|
|
617
|
-
}
|
|
618
|
-
if (e = c, e === a) {
|
|
619
|
-
if (je = !1, e = W(e), je) {
|
|
620
|
-
a = e;
|
|
621
|
-
continue;
|
|
622
|
-
}
|
|
623
|
-
if (!o) {
|
|
624
|
-
e = Le(e, t), a = e, o = !0;
|
|
625
|
-
continue;
|
|
626
|
-
}
|
|
627
|
-
Re(e, t, n, r, i);
|
|
628
|
-
break;
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
function Fe(e) {
|
|
633
|
-
let t = e.prev, n = e, r = e.next, i = t.x, a = n.x, o = r.x, s = t.y, c = n.y, l = r.y, u = Math.min(i, a, o), d = Math.min(s, c, l), f = Math.max(i, a, o), p = Math.max(s, c, l), m = r.next;
|
|
634
|
-
for (; m !== t;) {
|
|
635
|
-
if (m.x >= u && m.x <= f && m.y >= d && m.y <= p && (i !== m.x || s !== m.y) && ct(i, s, a, c, o, l, m.x, m.y) && J(m.prev, m, m.next) >= 0) return !1;
|
|
636
|
-
m = m.next;
|
|
637
|
-
}
|
|
638
|
-
return !0;
|
|
639
|
-
}
|
|
640
|
-
function Ie(e, t, n, r) {
|
|
641
|
-
let i = e.prev, a = e, o = e.next, s = i.x, c = a.x, l = o.x, u = i.y, d = a.y, f = o.y, p = Math.min(s, c, l), m = Math.min(u, d, f), h = Math.max(s, c, l), g = Math.max(u, d, f), _ = ot(p, m, t, n, r), v = ot(h, g, t, n, r), y = e.prevZ;
|
|
642
|
-
for (; y && y.z >= _;) {
|
|
643
|
-
if (y.x >= p && y.x <= h && y.y >= m && y.y <= g && y !== o && (s !== y.x || u !== y.y) && ct(s, u, c, d, l, f, y.x, y.y) && J(y.prev, y, y.next) >= 0) return !1;
|
|
644
|
-
y = y.prevZ;
|
|
645
|
-
}
|
|
646
|
-
let b = e.nextZ;
|
|
647
|
-
for (; b && b.z <= v;) {
|
|
648
|
-
if (b.x >= p && b.x <= h && b.y >= m && b.y <= g && b !== o && (s !== b.x || u !== b.y) && ct(s, u, c, d, l, f, b.x, b.y) && J(b.prev, b, b.next) >= 0) return !1;
|
|
649
|
-
b = b.nextZ;
|
|
650
|
-
}
|
|
651
|
-
return !0;
|
|
652
|
-
}
|
|
653
|
-
function Le(e, t) {
|
|
654
|
-
let n = e, r = !1;
|
|
655
|
-
do {
|
|
656
|
-
let i = n.prev, a = n.next.next;
|
|
657
|
-
dt(i, n, n.next, a, !1) && mt(i, a) && mt(a, i) && (t.push(i.i, n.i, a.i), vt(n), vt(n.next), n = e = a, r = !0), n = n.next;
|
|
658
|
-
} while (n !== e);
|
|
659
|
-
return r ? W(n) : n;
|
|
660
|
-
}
|
|
661
|
-
function Re(e, t, n, r, i) {
|
|
662
|
-
let a = e;
|
|
663
|
-
do {
|
|
664
|
-
let e = a.next.next;
|
|
665
|
-
for (; e !== a.prev;) {
|
|
666
|
-
if (a.i !== e.i && lt(a, e)) {
|
|
667
|
-
let o = gt(a, e);
|
|
668
|
-
a = W(a, a.next), o = W(o, o.next), Pe(a, t, n, r, i), Pe(o, t, n, r, i);
|
|
669
|
-
return;
|
|
670
|
-
}
|
|
671
|
-
e = e.next;
|
|
672
|
-
}
|
|
673
|
-
a = a.next;
|
|
674
|
-
} while (a !== e);
|
|
675
|
-
}
|
|
676
|
-
var ze = !1;
|
|
677
|
-
function Be(e, t, n, r) {
|
|
678
|
-
let i = [];
|
|
679
|
-
for (let n = 0, a = t.length; n < a; n++) {
|
|
680
|
-
let o = Ne(e, t[n] * r, n < a - 1 ? t[n + 1] * r : e.length, r, !1);
|
|
681
|
-
o === o.next && Ae.add(o), i.push(st(o));
|
|
682
|
-
}
|
|
683
|
-
i.sort(Ve), qe(e.length / r, t.length), Je(n, n), ze = !0;
|
|
684
|
-
for (let e = 0; e < i.length; e++) n = He(i[e], n);
|
|
685
|
-
return ze = !1, W(n);
|
|
686
|
-
}
|
|
687
|
-
function Ve(e, t) {
|
|
688
|
-
return e.x - t.x || e.y - t.y || (e.next.y - e.y) / (e.next.x - e.x) - (t.next.y - t.y) / (t.next.x - t.x);
|
|
689
|
-
}
|
|
690
|
-
function He(e, t) {
|
|
691
|
-
let n = Qe(e, t);
|
|
692
|
-
if (!n) return t;
|
|
693
|
-
let r = gt(n, e), i = r.next;
|
|
694
|
-
return Je(n, i.next), W(r, r.next), W(n, n.next);
|
|
695
|
-
}
|
|
696
|
-
var Ue = 16, G = /* @__PURE__ */ new Float64Array(), We = 0, Ge = [], Ke = [];
|
|
697
|
-
function qe(e, t) {
|
|
698
|
-
let n = Math.ceil((e + 2 * t) / Ue) + t + 2;
|
|
699
|
-
G.length < n * 4 && (G = new Float64Array(n * 4)), We = 0;
|
|
700
|
-
}
|
|
701
|
-
function Je(e, t) {
|
|
702
|
-
let n = e;
|
|
703
|
-
do {
|
|
704
|
-
let e = We++;
|
|
705
|
-
Ge[e] = n;
|
|
706
|
-
let r = Infinity, i = Infinity, a = -Infinity, o = -Infinity, s = 0;
|
|
707
|
-
do {
|
|
708
|
-
let t = n.next;
|
|
709
|
-
n.z = e, n.x < r && (r = n.x), n.x > a && (a = n.x), n.y < i && (i = n.y), n.y > o && (o = n.y), t.x < r && (r = t.x), t.x > a && (a = t.x), t.y < i && (i = t.y), t.y > o && (o = t.y), n = t;
|
|
710
|
-
} while (++s < Ue && n !== t);
|
|
711
|
-
Ke[e] = n;
|
|
712
|
-
let c = e * 4;
|
|
713
|
-
G[c] = r, G[c + 1] = i, G[c + 2] = a, G[c + 3] = o;
|
|
714
|
-
} while (n !== t);
|
|
715
|
-
}
|
|
716
|
-
function Ye(e, t) {
|
|
717
|
-
let n = e.z * 4;
|
|
718
|
-
t.x < G[n] && (G[n] = t.x), t.y < G[n + 1] && (G[n + 1] = t.y), t.x > G[n + 2] && (G[n + 2] = t.x), t.y > G[n + 3] && (G[n + 3] = t.y);
|
|
719
|
-
}
|
|
720
|
-
function Xe(e) {
|
|
721
|
-
let t = Ke[e];
|
|
722
|
-
for (; t.prev.next !== t;) t = t.next;
|
|
723
|
-
return Ke[e] = t, t;
|
|
724
|
-
}
|
|
725
|
-
function Ze(e) {
|
|
726
|
-
let t = Ge[e];
|
|
727
|
-
for (; t.prev.next !== t;) t = t.next;
|
|
728
|
-
return Ge[e] = t, t;
|
|
729
|
-
}
|
|
730
|
-
function Qe(e, t) {
|
|
731
|
-
let n = t, r = e.x, i = e.y, a = -Infinity, o;
|
|
732
|
-
if (ut(e, n)) return n;
|
|
733
|
-
for (let t = 0, s = 0; t < We; t++, s += 4) {
|
|
734
|
-
if (i < G[s + 1] || i > G[s + 3] || G[s] > r || G[s + 2] <= a) continue;
|
|
735
|
-
let c = Xe(t);
|
|
736
|
-
n = Ze(t);
|
|
737
|
-
do {
|
|
738
|
-
if (n.prev.next === n) {
|
|
739
|
-
if (ut(e, n.next)) return n.next;
|
|
740
|
-
if (i <= n.y && i >= n.next.y && n.next.y !== n.y) {
|
|
741
|
-
let e = n.x + (i - n.y) * (n.next.x - n.x) / (n.next.y - n.y);
|
|
742
|
-
if (e <= r && e > a && (a = e, o = n.x < n.next.x ? n : n.next, e === r)) return o;
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
n = n.next;
|
|
746
|
-
} while (n !== c);
|
|
747
|
-
}
|
|
748
|
-
if (!o) return null;
|
|
749
|
-
let s = o.x, c = o.y, l = Math.min(i, c), u = Math.max(i, c), d = Infinity;
|
|
750
|
-
for (let t = 0, f = 0; t < We; t++, f += 4) {
|
|
751
|
-
if (G[f + 2] < s || G[f] > r || G[f + 3] < l || G[f + 1] > u) continue;
|
|
752
|
-
let p = Xe(t);
|
|
753
|
-
n = Ze(t);
|
|
754
|
-
do {
|
|
755
|
-
if (n.prev.next === n && r >= n.x && n.x >= s && r !== n.x && ct(i < c ? r : a, i, s, c, i < c ? a : r, i, n.x, n.y)) {
|
|
756
|
-
let t = Math.abs(i - n.y) / (r - n.x);
|
|
757
|
-
(mt(n, e) || n.y === i && n.next.y === i && n.next.x > r) && (t < d || t === d && (n.x > o.x || n.x === o.x && $e(o, n))) && (o = n, d = t);
|
|
758
|
-
}
|
|
759
|
-
n = n.next;
|
|
760
|
-
} while (n !== p);
|
|
761
|
-
}
|
|
762
|
-
return o;
|
|
763
|
-
}
|
|
764
|
-
function $e(e, t) {
|
|
765
|
-
return J(e.prev, e, t.prev) < 0 && J(t.next, e, e.next) < 0;
|
|
766
|
-
}
|
|
767
|
-
var K = [], et = [], q = /* @__PURE__ */ new Uint32Array(), tt = /* @__PURE__ */ new Uint32Array(), nt = /* @__PURE__ */ new Uint32Array(256);
|
|
768
|
-
function rt(e, t, n, r) {
|
|
769
|
-
let i = e, a = 0;
|
|
770
|
-
do
|
|
771
|
-
i.z = ot(i.x, i.y, t, n, r), K[a++] = i, i = i.next;
|
|
772
|
-
while (i !== e);
|
|
773
|
-
it(a);
|
|
774
|
-
let o = null;
|
|
775
|
-
for (let e = 0; e < a; e++) {
|
|
776
|
-
let t = K[e];
|
|
777
|
-
t.prevZ = o, o && (o.nextZ = t), o = t;
|
|
778
|
-
}
|
|
779
|
-
o.nextZ = null;
|
|
780
|
-
}
|
|
781
|
-
function it(e) {
|
|
782
|
-
if (e <= 32) {
|
|
783
|
-
for (let t = 1; t < e; t++) {
|
|
784
|
-
let e = K[t], n = e.z, r = t - 1;
|
|
785
|
-
for (; r >= 0 && K[r].z > n;) K[r + 1] = K[r], r--;
|
|
786
|
-
K[r + 1] = e;
|
|
787
|
-
}
|
|
788
|
-
return;
|
|
789
|
-
}
|
|
790
|
-
q.length < e && (q = new Uint32Array(e), tt = new Uint32Array(e), et = Array(e));
|
|
791
|
-
for (let t = 0; t < e; t++) q[t] = K[t].z;
|
|
792
|
-
at(e, K, q, et, tt, 0), at(e, et, tt, K, q, 8), at(e, K, q, et, tt, 16), at(e, et, tt, K, q, 24);
|
|
793
|
-
}
|
|
794
|
-
function at(e, t, n, r, i, a) {
|
|
795
|
-
nt.fill(0);
|
|
796
|
-
for (let t = 0; t < e; t++) nt[n[t] >>> a & 255]++;
|
|
797
|
-
let o = 0;
|
|
798
|
-
for (let e = 0; e < 256; e++) {
|
|
799
|
-
let t = nt[e];
|
|
800
|
-
nt[e] = o, o += t;
|
|
801
|
-
}
|
|
802
|
-
for (let o = 0; o < e; o++) {
|
|
803
|
-
let e = n[o], s = nt[e >>> a & 255]++;
|
|
804
|
-
r[s] = t[o], i[s] = e;
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
function ot(e, t, n, r, i) {
|
|
808
|
-
return e = (e - n) * i | 0, t = (t - r) * i | 0, e = (e | e << 8) & 16711935, e = (e | e << 4) & 252645135, e = (e | e << 2) & 858993459, e = (e | e << 1) & 1431655765, t = (t | t << 8) & 16711935, t = (t | t << 4) & 252645135, t = (t | t << 2) & 858993459, t = (t | t << 1) & 1431655765, e | t << 1;
|
|
809
|
-
}
|
|
810
|
-
function st(e) {
|
|
811
|
-
let t = e, n = e;
|
|
812
|
-
do
|
|
813
|
-
(t.x < n.x || t.x === n.x && t.y < n.y) && (n = t), t = t.next;
|
|
814
|
-
while (t !== e);
|
|
815
|
-
return n;
|
|
816
|
-
}
|
|
817
|
-
function ct(e, t, n, r, i, a, o, s) {
|
|
818
|
-
return (i - o) * (t - s) >= (e - o) * (a - s) && (e - o) * (r - s) >= (n - o) * (t - s) && (n - o) * (a - s) >= (i - o) * (r - s);
|
|
819
|
-
}
|
|
820
|
-
function lt(e, t) {
|
|
821
|
-
let n = ut(e, t) && J(e.prev, e, e.next) > 0 && J(t.prev, t, t.next) > 0;
|
|
822
|
-
return e.next.i !== t.i && (n || mt(e, t) && mt(t, e) && (J(e.prev, e, t.prev) !== 0 || J(e, t.prev, t) !== 0)) && !pt(e, t) && (n || ht(e, t));
|
|
823
|
-
}
|
|
824
|
-
function J(e, t, n) {
|
|
825
|
-
return (t.y - e.y) * (n.x - t.x) - (t.x - e.x) * (n.y - t.y);
|
|
826
|
-
}
|
|
827
|
-
function ut(e, t) {
|
|
828
|
-
return e.x === t.x && e.y === t.y;
|
|
829
|
-
}
|
|
830
|
-
function dt(e, t, n, r, i = !0) {
|
|
831
|
-
let a = J(e, t, n), o = J(e, t, r), s = J(n, r, e), c = J(n, r, t);
|
|
832
|
-
return (a > 0 && o < 0 || a < 0 && o > 0) && (s > 0 && c < 0 || s < 0 && c > 0) ? !0 : i ? !!(a === 0 && ft(e, n, t) || o === 0 && ft(e, r, t) || s === 0 && ft(n, e, r) || c === 0 && ft(n, t, r)) : !1;
|
|
833
|
-
}
|
|
834
|
-
function ft(e, t, n) {
|
|
835
|
-
return t.x <= Math.max(e.x, n.x) && t.x >= Math.min(e.x, n.x) && t.y <= Math.max(e.y, n.y) && t.y >= Math.min(e.y, n.y);
|
|
836
|
-
}
|
|
837
|
-
function pt(e, t) {
|
|
838
|
-
let n = Math.min(e.x, t.x), r = Math.max(e.x, t.x), i = Math.min(e.y, t.y), a = Math.max(e.y, t.y), o = e;
|
|
839
|
-
do {
|
|
840
|
-
let s = o.next;
|
|
841
|
-
if (o.x > r && s.x > r || o.x < n && s.x < n || o.y > a && s.y > a || o.y < i && s.y < i) {
|
|
842
|
-
o = s;
|
|
843
|
-
continue;
|
|
844
|
-
}
|
|
845
|
-
if (o.i !== e.i && s.i !== e.i && o.i !== t.i && s.i !== t.i && dt(o, s, e, t)) return !0;
|
|
846
|
-
o = s;
|
|
847
|
-
} while (o !== e);
|
|
848
|
-
return !1;
|
|
849
|
-
}
|
|
850
|
-
function mt(e, t) {
|
|
851
|
-
return J(e.prev, e, e.next) < 0 ? J(e, t, e.next) >= 0 && J(e, e.prev, t) >= 0 : J(e, t, e.prev) < 0 || J(e, e.next, t) < 0;
|
|
852
|
-
}
|
|
853
|
-
function ht(e, t) {
|
|
854
|
-
let n = e, r = !1, i = (e.x + t.x) / 2, a = (e.y + t.y) / 2;
|
|
855
|
-
do {
|
|
856
|
-
let e = n.next;
|
|
857
|
-
n.y > a != e.y > a && i < (e.x - n.x) * (a - n.y) / (e.y - n.y) + n.x && (r = !r), n = e;
|
|
858
|
-
} while (n !== e);
|
|
859
|
-
return r;
|
|
860
|
-
}
|
|
861
|
-
function gt(e, t) {
|
|
862
|
-
let n = yt(e.i, e.x, e.y), r = yt(t.i, t.x, t.y), i = e.next, a = t.prev;
|
|
863
|
-
return e.next = t, t.prev = e, n.next = i, i.prev = n, r.next = n, n.prev = r, a.next = r, r.prev = a, r;
|
|
864
|
-
}
|
|
865
|
-
function _t(e, t, n, r) {
|
|
866
|
-
let i = yt(e, t, n);
|
|
867
|
-
return r ? (i.next = r.next, i.prev = r, r.next.prev = i, r.next = i) : (i.prev = i, i.next = i), i;
|
|
868
|
-
}
|
|
869
|
-
function vt(e) {
|
|
870
|
-
e.next.prev = e.prev, e.prev.next = e.next, e.prevZ && (e.prevZ.nextZ = e.nextZ), e.nextZ && (e.nextZ.prevZ = e.prevZ), ze && Ye(e.prev, e.next);
|
|
871
|
-
}
|
|
872
|
-
function yt(e, t, n) {
|
|
873
|
-
return {
|
|
874
|
-
i: e,
|
|
875
|
-
x: t,
|
|
876
|
-
y: n,
|
|
877
|
-
prev: null,
|
|
878
|
-
next: null,
|
|
879
|
-
z: 0,
|
|
880
|
-
prevZ: null,
|
|
881
|
-
nextZ: null
|
|
882
|
-
};
|
|
883
|
-
}
|
|
884
|
-
function bt(e, t, n, r) {
|
|
885
|
-
let i = 0;
|
|
886
|
-
for (let a = t, o = n - r; a < n; a += r) i += (e[o] - e[a]) * (e[a + 1] + e[o + 1]), o = a;
|
|
887
|
-
return i;
|
|
888
|
-
}
|
|
889
|
-
//#endregion
|
|
890
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/utils.mjs
|
|
891
|
-
var xt = Me.default || Me;
|
|
892
|
-
//#endregion
|
|
893
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/utils/triangulateWithHoles.mjs
|
|
894
|
-
function St(e, t, n, r, i, a, o) {
|
|
895
|
-
let s = xt(e, t, 2);
|
|
896
|
-
if (!s) return;
|
|
897
|
-
for (let e = 0; e < s.length; e += 3) a[o++] = s[e] + i, a[o++] = s[e + 1] + i, a[o++] = s[e + 2] + i;
|
|
898
|
-
let c = i * r;
|
|
899
|
-
for (let t = 0; t < e.length; t += 2) n[c] = e[t], n[c + 1] = e[t + 1], c += r;
|
|
900
|
-
}
|
|
901
|
-
//#endregion
|
|
902
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildPolygon.mjs
|
|
903
|
-
var Ct = [], wt = {
|
|
904
|
-
extension: {
|
|
905
|
-
type: S.ShapeBuilder,
|
|
906
|
-
name: "polygon"
|
|
907
|
-
},
|
|
908
|
-
build(e, t) {
|
|
909
|
-
for (let n = 0; n < e.points.length; n++) t[n] = e.points[n];
|
|
910
|
-
return !0;
|
|
911
|
-
},
|
|
912
|
-
triangulate(e, t, n, r, i, a) {
|
|
913
|
-
St(e, Ct, t, n, r, i, a);
|
|
914
|
-
}
|
|
915
|
-
}, Tt = {
|
|
916
|
-
extension: {
|
|
917
|
-
type: S.ShapeBuilder,
|
|
918
|
-
name: "rectangle"
|
|
919
|
-
},
|
|
920
|
-
build(e, t) {
|
|
921
|
-
let n = e, r = n.x, i = n.y, a = n.width, o = n.height;
|
|
922
|
-
return a > 0 && o > 0 && (t[0] = r, t[1] = i, t[2] = r + a, t[3] = i, t[4] = r + a, t[5] = i + o, t[6] = r, t[7] = i + o, !0);
|
|
923
|
-
},
|
|
924
|
-
triangulate(e, t, n, r, i, a) {
|
|
925
|
-
let o = 0;
|
|
926
|
-
r *= n, t[r + o] = e[0], t[r + o + 1] = e[1], o += n, t[r + o] = e[2], t[r + o + 1] = e[3], o += n, t[r + o] = e[6], t[r + o + 1] = e[7], o += n, t[r + o] = e[4], t[r + o + 1] = e[5], o += n;
|
|
927
|
-
let s = r / n;
|
|
928
|
-
i[a++] = s, i[a++] = s + 1, i[a++] = s + 2, i[a++] = s + 1, i[a++] = s + 3, i[a++] = s + 2;
|
|
929
|
-
}
|
|
930
|
-
}, Et = {
|
|
931
|
-
extension: {
|
|
932
|
-
type: S.ShapeBuilder,
|
|
933
|
-
name: "triangle"
|
|
934
|
-
},
|
|
935
|
-
build(e, t) {
|
|
936
|
-
return t[0] = e.x, t[1] = e.y, t[2] = e.x2, t[3] = e.y2, t[4] = e.x3, t[5] = e.y3, !0;
|
|
937
|
-
},
|
|
938
|
-
triangulate(e, t, n, r, i, a) {
|
|
939
|
-
let o = 0;
|
|
940
|
-
r *= n, t[r + o] = e[0], t[r + o + 1] = e[1], o += n, t[r + o] = e[2], t[r + o + 1] = e[3], o += n, t[r + o] = e[4], t[r + o + 1] = e[5];
|
|
941
|
-
let s = r / n;
|
|
942
|
-
i[a++] = s, i[a++] = s + 1, i[a++] = s + 2;
|
|
943
|
-
}
|
|
944
|
-
}, Dt = new u(), Ot = new d();
|
|
945
|
-
function kt(e, t, n, r) {
|
|
946
|
-
let i = t.matrix ? e.copyFrom(t.matrix).invert() : e.identity();
|
|
947
|
-
if (t.textureSpace === "local") {
|
|
948
|
-
let e = n.getBounds(Ot);
|
|
949
|
-
t.width && e.pad(t.width);
|
|
950
|
-
let { x: r, y: a } = e, o = 1 / e.width, s = 1 / e.height, c = -r * o, l = -a * s, u = i.a, d = i.b, f = i.c, p = i.d;
|
|
951
|
-
i.a *= o, i.b *= o, i.c *= s, i.d *= s, i.tx = c * u + l * f + i.tx, i.ty = c * d + l * p + i.ty;
|
|
952
|
-
} else i.translate(t.texture.frame.x, t.texture.frame.y), i.scale(1 / t.texture.source.width, 1 / t.texture.source.height);
|
|
953
|
-
let a = t.texture.source.style;
|
|
954
|
-
return !(t.fill instanceof U) && a.addressMode === "clamp-to-edge" && (a.addressMode = "repeat", a.update()), r && i.append(Dt.copyFrom(r).invert()), i;
|
|
955
|
-
}
|
|
956
|
-
//#endregion
|
|
957
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/utils/buildContextBatches.mjs
|
|
958
|
-
var Y = {};
|
|
959
|
-
y.handleByMap(S.ShapeBuilder, Y), y.add(Tt, wt, Et, Ee, De, Oe);
|
|
960
|
-
var At = new d(), jt = new u();
|
|
961
|
-
function Mt(e, t) {
|
|
962
|
-
let { geometryData: n, batches: r } = t;
|
|
963
|
-
r.length = 0, n.indices.length = 0, n.vertices.length = 0, n.uvs.length = 0;
|
|
964
|
-
for (let t = 0; t < e.instructions.length; t++) {
|
|
965
|
-
let i = e.instructions[t];
|
|
966
|
-
if (i.action === "texture") Nt(i.data, r, n);
|
|
967
|
-
else if (i.action === "fill" || i.action === "stroke") {
|
|
968
|
-
let e = i.action === "stroke", t = i.data.path.shapePath, a = i.data.style, o = i.data.hole;
|
|
969
|
-
e && o && Pt(o.shapePath, a, !0, r, n), o && (t.shapePrimitives[t.shapePrimitives.length - 1].holes = o.shapePath.shapePrimitives), Pt(t, a, e, r, n);
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
function Nt(e, t, n) {
|
|
974
|
-
let r = [], i = Y.rectangle, a = At;
|
|
975
|
-
a.x = e.dx, a.y = e.dy, a.width = e.dw, a.height = e.dh;
|
|
976
|
-
let o = e.transform;
|
|
977
|
-
if (!i.build(a, r)) return;
|
|
978
|
-
let { vertices: s, uvs: c, indices: l } = n, u = l.length, d = s.length / 2;
|
|
979
|
-
o && Ce(r, o), i.triangulate(r, s, 2, d, l, u);
|
|
980
|
-
let p = e.image, m = p.uvs;
|
|
981
|
-
c.push(m.x0, m.y0, m.x1, m.y1, m.x3, m.y3, m.x2, m.y2);
|
|
982
|
-
let h = f.get(Te);
|
|
983
|
-
h.indexOffset = u, h.indexSize = l.length - u, h.attributeOffset = d, h.attributeSize = s.length / 2 - d, h.baseColor = e.style, h.alpha = e.alpha, h.texture = p, h.geometryData = n, t.push(h);
|
|
984
|
-
}
|
|
985
|
-
function Pt(e, t, n, r, i) {
|
|
986
|
-
let { vertices: a, uvs: o, indices: s } = i;
|
|
987
|
-
e.shapePrimitives.forEach(({ shape: e, transform: c, holes: l }) => {
|
|
988
|
-
let u = [], d = Y[e.type];
|
|
989
|
-
if (!d.build(e, u)) return;
|
|
990
|
-
let p = s.length, m = a.length / 2, h = "triangle-list";
|
|
991
|
-
if (c && Ce(u, c), n) {
|
|
992
|
-
let n = e.closePath ?? !0, r = t;
|
|
993
|
-
r.pixelLine ? (ke(u, n, a, s), h = "line-list") : fe(u, r, !1, n, a, s);
|
|
994
|
-
} else if (l) {
|
|
995
|
-
let e = [], t = u.slice();
|
|
996
|
-
Ft(l).forEach((n) => {
|
|
997
|
-
e.push(t.length / 2), t.push(...n);
|
|
998
|
-
}), St(t, e, a, 2, m, s, p);
|
|
999
|
-
} else d.triangulate(u, a, 2, m, s, p);
|
|
1000
|
-
let g = o.length / 2, _ = t.texture;
|
|
1001
|
-
if (_ !== T.WHITE) {
|
|
1002
|
-
let n = kt(jt, t, e, c);
|
|
1003
|
-
xe(a, 2, m, o, g, 2, a.length / 2 - m, n);
|
|
1004
|
-
} else Se(o, g, 2, a.length / 2 - m);
|
|
1005
|
-
let v = f.get(Te);
|
|
1006
|
-
v.indexOffset = p, v.indexSize = s.length - p, v.attributeOffset = m, v.attributeSize = a.length / 2 - m, v.baseColor = t.color, v.alpha = t.alpha, v.texture = _, v.geometryData = i, v.topology = h, r.push(v);
|
|
1007
|
-
});
|
|
1008
|
-
}
|
|
1009
|
-
function Ft(e) {
|
|
1010
|
-
let t = [];
|
|
1011
|
-
for (let n = 0; n < e.length; n++) {
|
|
1012
|
-
let r = e[n].shape, i = [];
|
|
1013
|
-
Y[r.type].build(r, i) && t.push(i);
|
|
1014
|
-
}
|
|
1015
|
-
return t;
|
|
1016
|
-
}
|
|
1017
|
-
//#endregion
|
|
1018
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/canvas/CanvasGraphicsAdaptor.mjs
|
|
1019
|
-
var It = "#808080", Lt = new u(), Rt = new u(), zt = new u(), Bt = new u();
|
|
1020
|
-
function Vt(e, t, n) {
|
|
1021
|
-
e.beginPath();
|
|
1022
|
-
for (let r = 0; r < n.length; r += 3) {
|
|
1023
|
-
let i = n[r] * 2, a = n[r + 1] * 2, o = n[r + 2] * 2;
|
|
1024
|
-
e.moveTo(t[i], t[i + 1]), e.lineTo(t[a], t[a + 1]), e.lineTo(t[o], t[o + 1]), e.closePath();
|
|
1025
|
-
}
|
|
1026
|
-
e.fill();
|
|
1027
|
-
}
|
|
1028
|
-
function Ht(e) {
|
|
1029
|
-
return `#${(e & 16777215).toString(16).padStart(6, "0")}`;
|
|
1030
|
-
}
|
|
1031
|
-
function Ut(e, t, n, r, i, a) {
|
|
1032
|
-
a = Math.max(0, Math.min(a, Math.min(r, i) / 2)), e.moveTo(t + a, n), e.lineTo(t + r - a, n), e.quadraticCurveTo(t + r, n, t + r, n + a), e.lineTo(t + r, n + i - a), e.quadraticCurveTo(t + r, n + i, t + r - a, n + i), e.lineTo(t + a, n + i), e.quadraticCurveTo(t, n + i, t, n + i - a), e.lineTo(t, n + a), e.quadraticCurveTo(t, n, t + a, n);
|
|
1033
|
-
}
|
|
1034
|
-
function Wt(e, t) {
|
|
1035
|
-
switch (t.type) {
|
|
1036
|
-
case "rectangle": {
|
|
1037
|
-
let n = t;
|
|
1038
|
-
e.rect(n.x, n.y, n.width, n.height);
|
|
1039
|
-
break;
|
|
1040
|
-
}
|
|
1041
|
-
case "roundedRectangle": {
|
|
1042
|
-
let n = t;
|
|
1043
|
-
Ut(e, n.x, n.y, n.width, n.height, n.radius);
|
|
1044
|
-
break;
|
|
1045
|
-
}
|
|
1046
|
-
case "circle": {
|
|
1047
|
-
let n = t;
|
|
1048
|
-
e.arc(n.x, n.y, n.radius, 0, Math.PI * 2);
|
|
1049
|
-
break;
|
|
1050
|
-
}
|
|
1051
|
-
case "ellipse": {
|
|
1052
|
-
let n = t;
|
|
1053
|
-
e.ellipse ? e.ellipse(n.x, n.y, n.halfWidth, n.halfHeight, 0, 0, Math.PI * 2) : (e.save(), e.translate(n.x, n.y), e.scale(n.halfWidth, n.halfHeight), e.arc(0, 0, 1, 0, Math.PI * 2), e.restore());
|
|
1054
|
-
break;
|
|
1055
|
-
}
|
|
1056
|
-
case "triangle": {
|
|
1057
|
-
let n = t;
|
|
1058
|
-
e.moveTo(n.x, n.y), e.lineTo(n.x2, n.y2), e.lineTo(n.x3, n.y3), e.closePath();
|
|
1059
|
-
break;
|
|
1060
|
-
}
|
|
1061
|
-
default: {
|
|
1062
|
-
let n = t, r = n.points;
|
|
1063
|
-
if (!r?.length) break;
|
|
1064
|
-
e.moveTo(r[0], r[1]);
|
|
1065
|
-
for (let t = 2; t < r.length; t += 2) e.lineTo(r[t], r[t + 1]);
|
|
1066
|
-
n.closePath && e.closePath();
|
|
1067
|
-
break;
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
1071
|
-
function Gt(e, t) {
|
|
1072
|
-
if (!t?.length) return !1;
|
|
1073
|
-
for (let n = 0; n < t.length; n++) {
|
|
1074
|
-
let r = t[n];
|
|
1075
|
-
if (!r?.shape) continue;
|
|
1076
|
-
let i = r.transform, a = i && !i.isIdentity();
|
|
1077
|
-
a && (e.save(), e.transform(i.a, i.b, i.c, i.d, i.tx, i.ty)), Wt(e, r.shape), a && e.restore();
|
|
1078
|
-
}
|
|
1079
|
-
return !0;
|
|
1080
|
-
}
|
|
1081
|
-
function Kt(e, t, n, r) {
|
|
1082
|
-
let i = e.fill;
|
|
1083
|
-
if (i instanceof U) {
|
|
1084
|
-
i.buildGradient();
|
|
1085
|
-
let a = i.texture;
|
|
1086
|
-
if (a) {
|
|
1087
|
-
let o = O.getTintedPattern(a, t), s = n ? Bt.copyFrom(n).scale(a.source.pixelWidth, a.source.pixelHeight) : Bt.copyFrom(i.transform);
|
|
1088
|
-
return r && !e.textureSpace && s.append(r), O.applyPatternTransform(o, s), o;
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
if (i instanceof be) {
|
|
1092
|
-
let e = O.getTintedPattern(i.texture, t);
|
|
1093
|
-
return O.applyPatternTransform(e, i.transform, !1), e;
|
|
1094
|
-
}
|
|
1095
|
-
let a = e.texture;
|
|
1096
|
-
if (a && a !== T.WHITE) {
|
|
1097
|
-
if (!a.source.resource) return It;
|
|
1098
|
-
let r = O.getTintedPattern(a, t), i = n ? Bt.copyFrom(n).scale(a.source.pixelWidth, a.source.pixelHeight) : e.matrix;
|
|
1099
|
-
return O.applyPatternTransform(r, i), r;
|
|
1100
|
-
}
|
|
1101
|
-
return Ht(t);
|
|
1102
|
-
}
|
|
1103
|
-
var qt = class {
|
|
1104
|
-
constructor() {
|
|
1105
|
-
this.shader = null;
|
|
1106
|
-
}
|
|
1107
|
-
contextChange(e) {}
|
|
1108
|
-
execute(e, t) {
|
|
1109
|
-
let n = e.renderer, r = n.canvasContext, o = r.activeContext, s = t.groupTransform, c = n.globalUniforms.globalUniformData?.worldColor ?? 4294967295, u = t.groupColorAlpha, d = (c >>> 24 & 255) / 255, f = (u >>> 24 & 255) / 255, p = n.filter?.alphaMultiplier ?? 1, m = d * f * p;
|
|
1110
|
-
if (m <= 0) return;
|
|
1111
|
-
let h = c & 16777215, g = u & 16777215, _ = l(a(g, h)), v = n._roundPixels | t._roundPixels;
|
|
1112
|
-
o.save(), r.setContextTransform(s, v === 1), r.setBlendMode(t.groupBlendMode);
|
|
1113
|
-
let y = t.context.instructions;
|
|
1114
|
-
for (let e = 0; e < y.length; e++) {
|
|
1115
|
-
let t = y[e];
|
|
1116
|
-
if (t.action === "texture") {
|
|
1117
|
-
let e = t.data, n = e.image, c = n ? O.getCanvasSource(n) : null;
|
|
1118
|
-
if (!c) continue;
|
|
1119
|
-
let l = e.alpha * m;
|
|
1120
|
-
if (l <= 0) continue;
|
|
1121
|
-
let u = a(e.style, _);
|
|
1122
|
-
o.globalAlpha = l;
|
|
1123
|
-
let d = c;
|
|
1124
|
-
u !== 16777215 && (d = O.getTintedCanvas({ texture: n }, u));
|
|
1125
|
-
let f = n.frame, p = n.source._resolution ?? n.source.resolution ?? 1, h = f.x * p, g = f.y * p, y = f.width * p, b = f.height * p;
|
|
1126
|
-
d !== c && (h = 0, g = 0);
|
|
1127
|
-
let x = e.transform, S = x && !x.isIdentity(), C = n.rotate;
|
|
1128
|
-
S || C ? (Lt.copyFrom(s), S && Lt.append(x), C && i.matrixAppendRotationInv(Lt, C, e.dx, e.dy, e.dw, e.dh), r.setContextTransform(Lt, v === 1)) : r.setContextTransform(s, v === 1), o.drawImage(d, h, g, d === c ? y : d.width, d === c ? b : d.height, C ? 0 : e.dx, C ? 0 : e.dy, e.dw, e.dh), (S || C) && r.setContextTransform(s, v === 1);
|
|
1129
|
-
continue;
|
|
1130
|
-
}
|
|
1131
|
-
let n = t.data, c = n?.path?.shapePath;
|
|
1132
|
-
if (!c?.shapePrimitives?.length) continue;
|
|
1133
|
-
let l = n.style, u = a(l.color, _), d = l.alpha * m;
|
|
1134
|
-
if (d <= 0) continue;
|
|
1135
|
-
let f = t.action === "stroke";
|
|
1136
|
-
if (o.globalAlpha = d, f) {
|
|
1137
|
-
let e = l;
|
|
1138
|
-
o.lineWidth = e.width, o.lineCap = e.cap, o.lineJoin = e.join, o.miterLimit = e.miterLimit;
|
|
1139
|
-
}
|
|
1140
|
-
let p = c.shapePrimitives;
|
|
1141
|
-
if (!f && n.hole?.shapePath?.shapePrimitives?.length) {
|
|
1142
|
-
let e = p[p.length - 1];
|
|
1143
|
-
e.holes = n.hole.shapePath.shapePrimitives;
|
|
1144
|
-
}
|
|
1145
|
-
for (let e = 0; e < p.length; e++) {
|
|
1146
|
-
let t = p[e];
|
|
1147
|
-
if (!t?.shape) continue;
|
|
1148
|
-
let n = t.transform, r = n && !n.isIdentity(), i = l.texture && l.texture !== T.WHITE, a = l.textureSpace === "global" ? n : null, c = Kt(l, u, i ? kt(Rt, l, t.shape, a) : null, r ? zt.copyFrom(s).append(n) : s);
|
|
1149
|
-
if (r && (o.save(), o.transform(n.a, n.b, n.c, n.d, n.tx, n.ty)), f) {
|
|
1150
|
-
let e = l;
|
|
1151
|
-
if (e.alignment !== .5 && !e.pixelLine) {
|
|
1152
|
-
let n = [], r = [], i = [];
|
|
1153
|
-
Y[t.shape.type]?.build(t.shape, n) ? (fe(n, e, !1, t.shape.closePath ?? !0, r, i), o.fillStyle = c, Vt(o, r, i)) : (o.strokeStyle = c, o.beginPath(), Wt(o, t.shape), o.stroke());
|
|
1154
|
-
} else o.strokeStyle = c, o.beginPath(), Wt(o, t.shape), o.stroke();
|
|
1155
|
-
} else o.fillStyle = c, o.beginPath(), Wt(o, t.shape), Gt(o, t.holes) ? o.fill("evenodd") : o.fill();
|
|
1156
|
-
r && o.restore();
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1159
|
-
o.restore();
|
|
1160
|
-
}
|
|
1161
|
-
destroy() {
|
|
1162
|
-
this.shader = null;
|
|
1163
|
-
}
|
|
1164
|
-
};
|
|
1165
|
-
qt.extension = {
|
|
1166
|
-
type: [S.CanvasPipesAdaptor],
|
|
1167
|
-
name: "graphics"
|
|
1168
|
-
};
|
|
1169
|
-
//#endregion
|
|
1170
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/batcher/canvas/CanvasBatchAdaptor.mjs
|
|
1171
|
-
var Jt = class e {
|
|
1172
|
-
static _getPatternRepeat(e, t) {
|
|
1173
|
-
let n = e && e !== "clamp-to-edge", r = t && t !== "clamp-to-edge";
|
|
1174
|
-
return n && r ? "repeat" : n ? "repeat-x" : r ? "repeat-y" : "no-repeat";
|
|
1175
|
-
}
|
|
1176
|
-
start(e, t, n) {}
|
|
1177
|
-
execute(t, n) {
|
|
1178
|
-
let r = n.elements;
|
|
1179
|
-
if (!r || !r.length) return;
|
|
1180
|
-
let o = t.renderer, s = o.canvasContext, c = s.activeContext;
|
|
1181
|
-
for (let t = 0; t < r.length; t++) {
|
|
1182
|
-
let u = r[t];
|
|
1183
|
-
if (!u.packAsQuad) continue;
|
|
1184
|
-
let d = u, f = d.texture, p = f ? O.getCanvasSource(f) : null;
|
|
1185
|
-
if (!p) continue;
|
|
1186
|
-
let m = f.source.style, h = s.smoothProperty, g = m.scaleMode !== "nearest";
|
|
1187
|
-
c[h] !== g && (c[h] = g), s.setBlendMode(n.blendMode);
|
|
1188
|
-
let _ = o.globalUniforms.globalUniformData?.worldColor ?? 4294967295, v = d.color, y = (_ >>> 24 & 255) / 255, b = (v >>> 24 & 255) / 255, x = o.filter?.alphaMultiplier ?? 1, S = y * b * x;
|
|
1189
|
-
if (S <= 0) continue;
|
|
1190
|
-
c.globalAlpha = S;
|
|
1191
|
-
let C = _ & 16777215, w = v & 16777215, T = l(a(w, C)), E = f.frame, D = m.addressModeU ?? m.addressMode, k = m.addressModeV ?? m.addressMode, A = e._getPatternRepeat(D, k), j = f.source._resolution ?? f.source.resolution ?? 1, M = d.renderable?.renderGroup?.isCachedAsTexture, N = E.x * j, P = E.y * j, F = E.width * j, I = E.height * j, L = d.bounds, ee = o.renderTarget.renderTarget.isRoot, te = L.minX, ne = L.minY, re = L.maxX - L.minX, ie = L.maxY - L.minY, R = f.rotate, z = f.uvs, ae = Math.min(z.x0, z.x1, z.x2, z.x3, z.y0, z.y1, z.y2, z.y3), oe = Math.max(z.x0, z.x1, z.x2, z.x3, z.y0, z.y1, z.y2, z.y3), se = A !== "no-repeat" && (ae < 0 || oe > 1), B = R && !(!se && (T !== 16777215 || R));
|
|
1192
|
-
B ? (e._tempPatternMatrix.copyFrom(d.transform), i.matrixAppendRotationInv(e._tempPatternMatrix, R, te, ne, re, ie), s.setContextTransform(e._tempPatternMatrix, d.roundPixels === 1, void 0, M && ee)) : s.setContextTransform(d.transform, d.roundPixels === 1, void 0, M && ee);
|
|
1193
|
-
let ce = re, le = ie, V = B ? 0 : te, ue = B ? 0 : ne;
|
|
1194
|
-
if (!B && d.roundPixels === 1 && (V |= 0, ue |= 0), se) {
|
|
1195
|
-
let t = p, n = T !== 16777215 && !R, r = E.width <= f.source.width && E.height <= f.source.height;
|
|
1196
|
-
n && r && (t = O.getTintedCanvas({ texture: f }, T));
|
|
1197
|
-
let i = c.createPattern(t, A);
|
|
1198
|
-
if (!i) continue;
|
|
1199
|
-
let a = ce, o = le;
|
|
1200
|
-
if (a === 0 || o === 0) continue;
|
|
1201
|
-
let s = 1 / a, l = 1 / o, u = (z.x1 - z.x0) * s, d = (z.y1 - z.y0) * s, m = (z.x3 - z.x0) * l, h = (z.y3 - z.y0) * l, g = z.x0 - u * V - m * ue, _ = z.y0 - d * V - h * ue, v = f.source.pixelWidth, y = f.source.pixelHeight;
|
|
1202
|
-
e._tempPatternMatrix.set(u * v, d * y, m * v, h * y, g * v, _ * y), O.applyPatternTransform(i, e._tempPatternMatrix), c.fillStyle = i, c.fillRect(V, ue, ce, le);
|
|
1203
|
-
} else {
|
|
1204
|
-
let e = T !== 16777215 || R ? O.getTintedCanvas({ texture: f }, T) : p, t = e !== p;
|
|
1205
|
-
c.drawImage(e, t ? 0 : N, t ? 0 : P, t ? e.width : F, t ? e.height : I, V, ue, ce, le);
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
}
|
|
1209
|
-
};
|
|
1210
|
-
Jt._tempPatternMatrix = new u(), Jt.extension = {
|
|
1211
|
-
type: [S.CanvasPipesAdaptor],
|
|
1212
|
-
name: "batch"
|
|
1213
|
-
};
|
|
1214
|
-
var Yt = Jt, Xt = class {
|
|
1215
|
-
constructor(e) {
|
|
1216
|
-
this._colorStack = [], this._colorStackIndex = 0, this._currentColor = 0, this._renderer = e;
|
|
1217
|
-
}
|
|
1218
|
-
buildStart() {
|
|
1219
|
-
this._colorStack[0] = 15, this._colorStackIndex = 1, this._currentColor = 15;
|
|
1220
|
-
}
|
|
1221
|
-
push(e, t, n) {
|
|
1222
|
-
this._renderer.renderPipes.batch.break(n);
|
|
1223
|
-
let r = this._colorStack;
|
|
1224
|
-
r[this._colorStackIndex] = r[this._colorStackIndex - 1] & e.mask;
|
|
1225
|
-
let i = this._colorStack[this._colorStackIndex];
|
|
1226
|
-
i !== this._currentColor && (this._currentColor = i, n.add({
|
|
1227
|
-
renderPipeId: "colorMask",
|
|
1228
|
-
colorMask: i,
|
|
1229
|
-
canBundle: !1
|
|
1230
|
-
})), this._colorStackIndex++;
|
|
1231
|
-
}
|
|
1232
|
-
pop(e, t, n) {
|
|
1233
|
-
this._renderer.renderPipes.batch.break(n);
|
|
1234
|
-
let r = this._colorStack;
|
|
1235
|
-
this._colorStackIndex--;
|
|
1236
|
-
let i = r[this._colorStackIndex - 1];
|
|
1237
|
-
i !== this._currentColor && (this._currentColor = i, n.add({
|
|
1238
|
-
renderPipeId: "colorMask",
|
|
1239
|
-
colorMask: i,
|
|
1240
|
-
canBundle: !1
|
|
1241
|
-
}));
|
|
1242
|
-
}
|
|
1243
|
-
execute(e) {}
|
|
1244
|
-
destroy() {
|
|
1245
|
-
this._renderer = null, this._colorStack = null;
|
|
1246
|
-
}
|
|
1247
|
-
};
|
|
1248
|
-
Xt.extension = {
|
|
1249
|
-
type: [S.CanvasPipes],
|
|
1250
|
-
name: "colorMask"
|
|
1251
|
-
};
|
|
1252
|
-
//#endregion
|
|
1253
|
-
//#region node_modules/.pnpm/parse-svg-path@0.2.0/node_modules/parse-svg-path/dist/index.mjs
|
|
1254
|
-
var Zt = {
|
|
1255
|
-
a: 7,
|
|
1256
|
-
c: 6,
|
|
1257
|
-
h: 1,
|
|
1258
|
-
l: 2,
|
|
1259
|
-
m: 2,
|
|
1260
|
-
q: 4,
|
|
1261
|
-
s: 4,
|
|
1262
|
-
t: 2,
|
|
1263
|
-
v: 1,
|
|
1264
|
-
z: 0
|
|
1265
|
-
}, Qt = /([astvzqmhlc])([^astvzqmhlc]*)/gi, $t = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;
|
|
1266
|
-
function en(e) {
|
|
1267
|
-
let t = [];
|
|
1268
|
-
return e.replace(Qt, (e, n, r) => {
|
|
1269
|
-
let i = n.toLowerCase(), a = n, o = tn(r);
|
|
1270
|
-
for (i === "m" && o.length > 2 && (t.push([a, ...o.splice(0, 2)]), i = "l", a = a === "m" ? "l" : "L");;) {
|
|
1271
|
-
if (o.length === Zt[i]) return t.push([a, ...o]), "";
|
|
1272
|
-
if (o.length < Zt[i]) throw Error("malformed path data");
|
|
1273
|
-
t.push([a, ...o.splice(0, Zt[i])]);
|
|
1274
|
-
}
|
|
1275
|
-
}), t;
|
|
1276
|
-
}
|
|
1277
|
-
function tn(e) {
|
|
1278
|
-
let t = e.match($t);
|
|
1279
|
-
return t ? t.map(Number) : [];
|
|
1280
|
-
}
|
|
1281
|
-
//#endregion
|
|
1282
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/svg/parseSVGPath.mjs
|
|
1283
|
-
function nn(e, t) {
|
|
1284
|
-
let n = en(e), r = [], i = null, a = 0, o = 0;
|
|
1285
|
-
for (let e = 0; e < n.length; e++) {
|
|
1286
|
-
let c = n[e], l = c[0], u = c;
|
|
1287
|
-
switch (l) {
|
|
1288
|
-
case "M":
|
|
1289
|
-
a = u[1], o = u[2], t.moveTo(a, o);
|
|
1290
|
-
break;
|
|
1291
|
-
case "m":
|
|
1292
|
-
a += u[1], o += u[2], t.moveTo(a, o);
|
|
1293
|
-
break;
|
|
1294
|
-
case "H":
|
|
1295
|
-
a = u[1], t.lineTo(a, o);
|
|
1296
|
-
break;
|
|
1297
|
-
case "h":
|
|
1298
|
-
a += u[1], t.lineTo(a, o);
|
|
1299
|
-
break;
|
|
1300
|
-
case "V":
|
|
1301
|
-
o = u[1], t.lineTo(a, o);
|
|
1302
|
-
break;
|
|
1303
|
-
case "v":
|
|
1304
|
-
o += u[1], t.lineTo(a, o);
|
|
1305
|
-
break;
|
|
1306
|
-
case "L":
|
|
1307
|
-
a = u[1], o = u[2], t.lineTo(a, o);
|
|
1308
|
-
break;
|
|
1309
|
-
case "l":
|
|
1310
|
-
a += u[1], o += u[2], t.lineTo(a, o);
|
|
1311
|
-
break;
|
|
1312
|
-
case "C":
|
|
1313
|
-
a = u[5], o = u[6], t.bezierCurveTo(u[1], u[2], u[3], u[4], a, o);
|
|
1314
|
-
break;
|
|
1315
|
-
case "c":
|
|
1316
|
-
t.bezierCurveTo(a + u[1], o + u[2], a + u[3], o + u[4], a + u[5], o + u[6]), a += u[5], o += u[6];
|
|
1317
|
-
break;
|
|
1318
|
-
case "S":
|
|
1319
|
-
a = u[3], o = u[4], t.bezierCurveToShort(u[1], u[2], a, o);
|
|
1320
|
-
break;
|
|
1321
|
-
case "s":
|
|
1322
|
-
t.bezierCurveToShort(a + u[1], o + u[2], a + u[3], o + u[4]), a += u[3], o += u[4];
|
|
1323
|
-
break;
|
|
1324
|
-
case "Q":
|
|
1325
|
-
a = u[3], o = u[4], t.quadraticCurveTo(u[1], u[2], a, o);
|
|
1326
|
-
break;
|
|
1327
|
-
case "q":
|
|
1328
|
-
t.quadraticCurveTo(a + u[1], o + u[2], a + u[3], o + u[4]), a += u[3], o += u[4];
|
|
1329
|
-
break;
|
|
1330
|
-
case "T":
|
|
1331
|
-
a = u[1], o = u[2], t.quadraticCurveToShort(a, o);
|
|
1332
|
-
break;
|
|
1333
|
-
case "t":
|
|
1334
|
-
a += u[1], o += u[2], t.quadraticCurveToShort(a, o);
|
|
1335
|
-
break;
|
|
1336
|
-
case "A":
|
|
1337
|
-
a = u[6], o = u[7], t.arcToSvg(u[1], u[2], u[3], u[4], u[5], a, o);
|
|
1338
|
-
break;
|
|
1339
|
-
case "a":
|
|
1340
|
-
a += u[6], o += u[7], t.arcToSvg(u[1], u[2], u[3], u[4], u[5], a, o);
|
|
1341
|
-
break;
|
|
1342
|
-
case "Z":
|
|
1343
|
-
case "z":
|
|
1344
|
-
t.closePath(), r.length > 0 && (i = r.pop(), i ? (a = i.startX, o = i.startY) : (a = 0, o = 0)), i = null;
|
|
1345
|
-
break;
|
|
1346
|
-
default: s(`Unknown SVG path command: ${l}`);
|
|
1347
|
-
}
|
|
1348
|
-
l !== "Z" && l !== "z" && i === null && (i = {
|
|
1349
|
-
startX: a,
|
|
1350
|
-
startY: o
|
|
1351
|
-
}, r.push(i));
|
|
1352
|
-
}
|
|
1353
|
-
return t;
|
|
1354
|
-
}
|
|
1355
|
-
//#endregion
|
|
1356
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/GraphicsContextSystem.mjs
|
|
1357
|
-
var rn = class {
|
|
1358
|
-
constructor() {
|
|
1359
|
-
this.batches = [], this.geometryData = {
|
|
1360
|
-
vertices: [],
|
|
1361
|
-
uvs: [],
|
|
1362
|
-
indices: []
|
|
1363
|
-
};
|
|
1364
|
-
}
|
|
1365
|
-
reset() {
|
|
1366
|
-
this.batches && this.batches.forEach((e) => {
|
|
1367
|
-
f.return(e);
|
|
1368
|
-
}), this.graphicsData && f.return(this.graphicsData), this.isBatchable = !1, this.context = null, this.batches.length = 0, this.geometryData.indices.length = 0, this.geometryData.vertices.length = 0, this.geometryData.uvs.length = 0, this.graphicsData = null;
|
|
1369
|
-
}
|
|
1370
|
-
destroy() {
|
|
1371
|
-
this.reset(), this.batches = null, this.geometryData = null;
|
|
1372
|
-
}
|
|
1373
|
-
}, an = class {
|
|
1374
|
-
constructor() {
|
|
1375
|
-
this.instructions = new c();
|
|
1376
|
-
}
|
|
1377
|
-
init(e) {
|
|
1378
|
-
let t = e.maxTextures;
|
|
1379
|
-
this.batcher ? this.batcher._updateMaxTextures(t) : this.batcher = new F({ maxTextures: t }), this.instructions.reset();
|
|
1380
|
-
}
|
|
1381
|
-
get geometry() {
|
|
1382
|
-
return x(m, "GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."), this.batcher.geometry;
|
|
1383
|
-
}
|
|
1384
|
-
destroy() {
|
|
1385
|
-
this.batcher.destroy(), this.instructions.destroy(), this.batcher = null, this.instructions = null;
|
|
1386
|
-
}
|
|
1387
|
-
}, on = class e {
|
|
1388
|
-
constructor(e) {
|
|
1389
|
-
this._renderer = e, this._managedContexts = new j({
|
|
1390
|
-
renderer: e,
|
|
1391
|
-
type: "resource",
|
|
1392
|
-
name: "graphicsContext"
|
|
1393
|
-
});
|
|
1394
|
-
}
|
|
1395
|
-
init(t) {
|
|
1396
|
-
e.defaultOptions.bezierSmoothness = t?.bezierSmoothness ?? e.defaultOptions.bezierSmoothness;
|
|
1397
|
-
}
|
|
1398
|
-
getContextRenderData(e) {
|
|
1399
|
-
return e._gpuData[this._renderer.uid].graphicsData || this._initContextRenderData(e);
|
|
1400
|
-
}
|
|
1401
|
-
updateGpuContext(e) {
|
|
1402
|
-
let t = !!e._gpuData[this._renderer.uid], n = e._gpuData[this._renderer.uid] || this._initContext(e);
|
|
1403
|
-
if (e.dirty || !t) {
|
|
1404
|
-
t && n.reset(), Mt(e, n);
|
|
1405
|
-
let r = e.batchMode;
|
|
1406
|
-
n.isBatchable = e.customShader || r === "no-batch" ? !1 : r !== "auto" || n.geometryData.vertices.length < 400, e.dirty = !1;
|
|
1407
|
-
}
|
|
1408
|
-
return n;
|
|
1409
|
-
}
|
|
1410
|
-
getGpuContext(e) {
|
|
1411
|
-
return e._gpuData[this._renderer.uid] || this._initContext(e);
|
|
1412
|
-
}
|
|
1413
|
-
_initContextRenderData(e) {
|
|
1414
|
-
let t = f.get(an, { maxTextures: this._renderer.limits.maxBatchableTextures }), n = e._gpuData[this._renderer.uid], { batches: r, geometryData: i } = n;
|
|
1415
|
-
n.graphicsData = t;
|
|
1416
|
-
let a = i.vertices.length, o = i.indices.length;
|
|
1417
|
-
for (let e = 0; e < r.length; e++) r[e].applyTransform = !1;
|
|
1418
|
-
let s = t.batcher;
|
|
1419
|
-
s.ensureAttributeBuffer(a), s.ensureIndexBuffer(o), s.begin();
|
|
1420
|
-
for (let e = 0; e < r.length; e++) {
|
|
1421
|
-
let t = r[e];
|
|
1422
|
-
s.add(t);
|
|
1423
|
-
}
|
|
1424
|
-
s.finish(t.instructions);
|
|
1425
|
-
let c = s.geometry;
|
|
1426
|
-
c.indexBuffer.setDataWithSize(s.indexBuffer, s.indexSize, !0), c.buffers[0].setDataWithSize(s.attributeBuffer.float32View, s.attributeSize, !0);
|
|
1427
|
-
let l = s.batches;
|
|
1428
|
-
for (let e = 0; e < l.length; e++) {
|
|
1429
|
-
let t = l[e];
|
|
1430
|
-
t.bindGroup = re(t.textures.textures, t.textures.count, this._renderer.limits.maxBatchableTextures);
|
|
1431
|
-
}
|
|
1432
|
-
return t;
|
|
1433
|
-
}
|
|
1434
|
-
_initContext(e) {
|
|
1435
|
-
let t = new rn();
|
|
1436
|
-
return t.context = e, e._gpuData[this._renderer.uid] = t, this._managedContexts.add(e), t;
|
|
1437
|
-
}
|
|
1438
|
-
destroy() {
|
|
1439
|
-
this._managedContexts.destroy(), this._renderer = null;
|
|
1440
|
-
}
|
|
1441
|
-
};
|
|
1442
|
-
on.extension = {
|
|
1443
|
-
type: [S.WebGLSystem, S.WebGPUSystem],
|
|
1444
|
-
name: "graphicsContext"
|
|
1445
|
-
}, on.defaultOptions = { bezierSmoothness: .5 };
|
|
1446
|
-
var sn = on, cn = 8, ln = 1.1920929e-7, un = 1;
|
|
1447
|
-
function dn(e, t, n, r, i, a, o, s, c, l) {
|
|
1448
|
-
let u = (un - Math.min(.99, Math.max(0, l ?? sn.defaultOptions.bezierSmoothness))) / 1;
|
|
1449
|
-
return u *= u, fn(t, n, r, i, a, o, s, c, e, u), e;
|
|
1450
|
-
}
|
|
1451
|
-
function fn(e, t, n, r, i, a, o, s, c, l) {
|
|
1452
|
-
pn(e, t, n, r, i, a, o, s, c, l, 0), c.push(o, s);
|
|
1453
|
-
}
|
|
1454
|
-
function pn(e, t, n, r, i, a, o, s, c, l, u) {
|
|
1455
|
-
if (u > cn) return;
|
|
1456
|
-
let d = (e + n) / 2, f = (t + r) / 2, p = (n + i) / 2, m = (r + a) / 2, h = (i + o) / 2, g = (a + s) / 2, _ = (d + p) / 2, v = (f + m) / 2, y = (p + h) / 2, b = (m + g) / 2, x = (_ + y) / 2, S = (v + b) / 2;
|
|
1457
|
-
if (u > 0) {
|
|
1458
|
-
let u = o - e, d = s - t, f = Math.abs((n - o) * d - (r - s) * u), p = Math.abs((i - o) * d - (a - s) * u);
|
|
1459
|
-
if (f > ln && p > ln) {
|
|
1460
|
-
if ((f + p) * (f + p) <= l * (u * u + d * d)) {
|
|
1461
|
-
c.push(x, S);
|
|
1462
|
-
return;
|
|
1463
|
-
}
|
|
1464
|
-
} else if (f > ln) {
|
|
1465
|
-
if (f * f <= l * (u * u + d * d)) {
|
|
1466
|
-
c.push(x, S);
|
|
1467
|
-
return;
|
|
1468
|
-
}
|
|
1469
|
-
} else if (p > ln) {
|
|
1470
|
-
if (p * p <= l * (u * u + d * d)) {
|
|
1471
|
-
c.push(x, S);
|
|
1472
|
-
return;
|
|
1473
|
-
}
|
|
1474
|
-
} else if (u = x - (e + o) / 2, d = S - (t + s) / 2, u * u + d * d <= l) {
|
|
1475
|
-
c.push(x, S);
|
|
1476
|
-
return;
|
|
1477
|
-
}
|
|
1478
|
-
}
|
|
1479
|
-
pn(e, t, d, f, _, v, x, S, c, l, u + 1), pn(x, S, y, b, h, g, o, s, c, l, u + 1);
|
|
1480
|
-
}
|
|
1481
|
-
//#endregion
|
|
1482
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildAdaptiveQuadratic.mjs
|
|
1483
|
-
var mn = 8, hn = 1.1920929e-7, gn = 1;
|
|
1484
|
-
function _n(e, t, n, r, i, a, o, s) {
|
|
1485
|
-
let c = (gn - Math.min(.99, Math.max(0, s ?? sn.defaultOptions.bezierSmoothness))) / 1;
|
|
1486
|
-
return c *= c, vn(t, n, r, i, a, o, e, c), e;
|
|
1487
|
-
}
|
|
1488
|
-
function vn(e, t, n, r, i, a, o, s) {
|
|
1489
|
-
yn(o, e, t, n, r, i, a, s, 0), o.push(i, a);
|
|
1490
|
-
}
|
|
1491
|
-
function yn(e, t, n, r, i, a, o, s, c) {
|
|
1492
|
-
if (c > mn) return;
|
|
1493
|
-
let l = (t + r) / 2, u = (n + i) / 2, d = (r + a) / 2, f = (i + o) / 2, p = (l + d) / 2, m = (u + f) / 2, h = a - t, g = o - n, _ = Math.abs((r - a) * g - (i - o) * h);
|
|
1494
|
-
if (_ > hn) {
|
|
1495
|
-
if (_ * _ <= s * (h * h + g * g)) {
|
|
1496
|
-
e.push(p, m);
|
|
1497
|
-
return;
|
|
1498
|
-
}
|
|
1499
|
-
} else if (h = p - (t + a) / 2, g = m - (n + o) / 2, h * h + g * g <= s) {
|
|
1500
|
-
e.push(p, m);
|
|
1501
|
-
return;
|
|
1502
|
-
}
|
|
1503
|
-
yn(e, t, n, l, u, p, m, s, c + 1), yn(e, p, m, d, f, a, o, s, c + 1);
|
|
1504
|
-
}
|
|
1505
|
-
//#endregion
|
|
1506
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildArc.mjs
|
|
1507
|
-
function bn(e, t, n, r, i, a, o, s) {
|
|
1508
|
-
let c = Math.abs(i - a);
|
|
1509
|
-
(!o && i > a || o && a > i) && (c = 2 * Math.PI - c), s ||= Math.max(6, Math.floor(6 * r ** (1 / 3) * (c / Math.PI))), s = Math.max(s, 3);
|
|
1510
|
-
let l = c / s, u = i;
|
|
1511
|
-
l *= o ? -1 : 1;
|
|
1512
|
-
for (let i = 0; i < s + 1; i++) {
|
|
1513
|
-
let i = Math.cos(u), a = Math.sin(u), o = t + i * r, s = n + a * r;
|
|
1514
|
-
e.push(o, s), u += l;
|
|
1515
|
-
}
|
|
1516
|
-
}
|
|
1517
|
-
//#endregion
|
|
1518
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildArcTo.mjs
|
|
1519
|
-
function xn(e, t, n, r, i, a) {
|
|
1520
|
-
let o = e[e.length - 2], s = e[e.length - 1] - n, c = o - t, l = i - n, u = r - t, d = Math.abs(s * u - c * l);
|
|
1521
|
-
if (d < 1e-8 || a === 0) {
|
|
1522
|
-
(e[e.length - 2] !== t || e[e.length - 1] !== n) && e.push(t, n);
|
|
1523
|
-
return;
|
|
1524
|
-
}
|
|
1525
|
-
let f = s * s + c * c, p = l * l + u * u, m = s * l + c * u, h = a * Math.sqrt(f) / d, g = a * Math.sqrt(p) / d, _ = h * m / f, v = g * m / p, y = h * u + g * c, b = h * l + g * s, x = c * (g + _), S = s * (g + _), C = u * (h + v), w = l * (h + v), T = Math.atan2(S - b, x - y), E = Math.atan2(w - b, C - y);
|
|
1526
|
-
bn(e, y + t, b + n, a, T, E, c * l > u * s);
|
|
1527
|
-
}
|
|
1528
|
-
//#endregion
|
|
1529
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildArcToSvg.mjs
|
|
1530
|
-
var Sn = Math.PI * 2, Cn = {
|
|
1531
|
-
centerX: 0,
|
|
1532
|
-
centerY: 0,
|
|
1533
|
-
ang1: 0,
|
|
1534
|
-
ang2: 0
|
|
1535
|
-
}, wn = ({ x: e, y: t }, n, r, i, a, o, s, c) => {
|
|
1536
|
-
e *= n, t *= r;
|
|
1537
|
-
let l = i * e - a * t, u = a * e + i * t;
|
|
1538
|
-
return c.x = l + o, c.y = u + s, c;
|
|
1539
|
-
};
|
|
1540
|
-
function Tn(e, t) {
|
|
1541
|
-
let n = t === -1.5707963267948966 ? -.551915024494 : 4 / 3 * Math.tan(t / 4), r = t === 1.5707963267948966 ? .551915024494 : n, i = Math.cos(e), a = Math.sin(e), o = Math.cos(e + t), s = Math.sin(e + t);
|
|
1542
|
-
return [
|
|
1543
|
-
{
|
|
1544
|
-
x: i - a * r,
|
|
1545
|
-
y: a + i * r
|
|
1546
|
-
},
|
|
1547
|
-
{
|
|
1548
|
-
x: o + s * r,
|
|
1549
|
-
y: s - o * r
|
|
1550
|
-
},
|
|
1551
|
-
{
|
|
1552
|
-
x: o,
|
|
1553
|
-
y: s
|
|
1554
|
-
}
|
|
1555
|
-
];
|
|
1556
|
-
}
|
|
1557
|
-
var En = (e, t, n, r) => {
|
|
1558
|
-
let i = e * r - t * n < 0 ? -1 : 1, a = e * n + t * r;
|
|
1559
|
-
return a > 1 && (a = 1), a < -1 && (a = -1), i * Math.acos(a);
|
|
1560
|
-
}, Dn = (e, t, n, r, i, a, o, s, c, l, u, d, f) => {
|
|
1561
|
-
let p = i ** 2, m = a ** 2, h = u ** 2, g = d ** 2, _ = p * m - p * g - m * h;
|
|
1562
|
-
_ < 0 && (_ = 0), _ /= p * g + m * h, _ = Math.sqrt(_) * (o === s ? -1 : 1);
|
|
1563
|
-
let v = _ * i / a * d, y = _ * -a / i * u, b = l * v - c * y + (e + n) / 2, x = c * v + l * y + (t + r) / 2, S = (u - v) / i, C = (d - y) / a, w = (-u - v) / i, T = (-d - y) / a, E = En(1, 0, S, C), D = En(S, C, w, T);
|
|
1564
|
-
s === 0 && D > 0 && (D -= Sn), s === 1 && D < 0 && (D += Sn), f.centerX = b, f.centerY = x, f.ang1 = E, f.ang2 = D;
|
|
1565
|
-
};
|
|
1566
|
-
function On(e, t, n, r, i, a, o, s = 0, c = 0, l = 0) {
|
|
1567
|
-
if (a === 0 || o === 0) return;
|
|
1568
|
-
let u = Math.sin(s * Sn / 360), d = Math.cos(s * Sn / 360), f = d * (t - r) / 2 + u * (n - i) / 2, p = -u * (t - r) / 2 + d * (n - i) / 2;
|
|
1569
|
-
if (f === 0 && p === 0) return;
|
|
1570
|
-
a = Math.abs(a), o = Math.abs(o);
|
|
1571
|
-
let m = f ** 2 / a ** 2 + p ** 2 / o ** 2;
|
|
1572
|
-
m > 1 && (a *= Math.sqrt(m), o *= Math.sqrt(m)), Dn(t, n, r, i, a, o, c, l, u, d, f, p, Cn);
|
|
1573
|
-
let { ang1: h, ang2: g } = Cn, { centerX: _, centerY: v } = Cn, y = Math.abs(g) / (Sn / 4);
|
|
1574
|
-
Math.abs(1 - y) < 1e-7 && (y = 1);
|
|
1575
|
-
let b = Math.max(Math.ceil(y), 1);
|
|
1576
|
-
g /= b;
|
|
1577
|
-
let x = e[e.length - 2], S = e[e.length - 1], C = {
|
|
1578
|
-
x: 0,
|
|
1579
|
-
y: 0
|
|
1580
|
-
};
|
|
1581
|
-
for (let t = 0; t < b; t++) {
|
|
1582
|
-
let t = Tn(h, g), { x: n, y: r } = wn(t[0], a, o, d, u, _, v, C), { x: i, y: s } = wn(t[1], a, o, d, u, _, v, C), { x: c, y: l } = wn(t[2], a, o, d, u, _, v, C);
|
|
1583
|
-
dn(e, x, S, n, r, i, s, c, l), x = c, S = l, h += g;
|
|
1584
|
-
}
|
|
1585
|
-
}
|
|
1586
|
-
//#endregion
|
|
1587
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/path/roundShape.mjs
|
|
1588
|
-
function kn(e, t, n) {
|
|
1589
|
-
let r = (e, t) => {
|
|
1590
|
-
let n = t.x - e.x, r = t.y - e.y, i = Math.sqrt(n * n + r * r);
|
|
1591
|
-
return {
|
|
1592
|
-
len: i,
|
|
1593
|
-
nx: n / i,
|
|
1594
|
-
ny: r / i
|
|
1595
|
-
};
|
|
1596
|
-
}, i = (t, n) => {
|
|
1597
|
-
t === 0 ? e.moveTo(n.x, n.y) : e.lineTo(n.x, n.y);
|
|
1598
|
-
}, a = t[t.length - 1];
|
|
1599
|
-
for (let o = 0; o < t.length; o++) {
|
|
1600
|
-
let s = t[o % t.length], c = s.radius ?? n;
|
|
1601
|
-
if (c <= 0) {
|
|
1602
|
-
i(o, s), a = s;
|
|
1603
|
-
continue;
|
|
1604
|
-
}
|
|
1605
|
-
let l = t[(o + 1) % t.length], u = r(s, a), d = r(s, l);
|
|
1606
|
-
if (u.len < 1e-4 || d.len < 1e-4) {
|
|
1607
|
-
i(o, s), a = s;
|
|
1608
|
-
continue;
|
|
1609
|
-
}
|
|
1610
|
-
let f = Math.asin(u.nx * d.ny - u.ny * d.nx), p = 1, m = !1;
|
|
1611
|
-
u.nx * d.nx - u.ny * -d.ny < 0 ? f < 0 ? f = Math.PI + f : (f = Math.PI - f, p = -1, m = !0) : f > 0 && (p = -1, m = !0);
|
|
1612
|
-
let h = f / 2, g, _ = Math.abs(Math.cos(h) * c / Math.sin(h));
|
|
1613
|
-
_ > Math.min(u.len / 2, d.len / 2) ? (_ = Math.min(u.len / 2, d.len / 2), g = Math.abs(_ * Math.sin(h) / Math.cos(h))) : g = c;
|
|
1614
|
-
let v = s.x + d.nx * _ + -d.ny * g * p, y = s.y + d.ny * _ + d.nx * g * p, b = Math.atan2(u.ny, u.nx) + Math.PI / 2 * p, x = Math.atan2(d.ny, d.nx) - Math.PI / 2 * p;
|
|
1615
|
-
o === 0 && e.moveTo(v + Math.cos(b) * g, y + Math.sin(b) * g), e.arc(v, y, g, b, x, m), a = s;
|
|
1616
|
-
}
|
|
1617
|
-
}
|
|
1618
|
-
function An(e, t, n, r) {
|
|
1619
|
-
let i = (e, t) => Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2), a = (e, t, n) => ({
|
|
1620
|
-
x: e.x + (t.x - e.x) * n,
|
|
1621
|
-
y: e.y + (t.y - e.y) * n
|
|
1622
|
-
}), o = t.length;
|
|
1623
|
-
for (let s = 0; s < o; s++) {
|
|
1624
|
-
let c = t[(s + 1) % o], l = c.radius ?? n;
|
|
1625
|
-
if (l <= 0) {
|
|
1626
|
-
s === 0 ? e.moveTo(c.x, c.y) : e.lineTo(c.x, c.y);
|
|
1627
|
-
continue;
|
|
1628
|
-
}
|
|
1629
|
-
let u = t[s], d = t[(s + 2) % o], f = i(u, c), p;
|
|
1630
|
-
p = f < 1e-4 ? c : a(c, u, Math.min(f / 2, l) / f);
|
|
1631
|
-
let m = i(d, c), h;
|
|
1632
|
-
h = m < 1e-4 ? c : a(c, d, Math.min(m / 2, l) / m), s === 0 ? e.moveTo(p.x, p.y) : e.lineTo(p.x, p.y), e.quadraticCurveTo(c.x, c.y, h.x, h.y, r);
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1635
|
-
//#endregion
|
|
1636
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/path/ShapePath.mjs
|
|
1637
|
-
var jn = new d(), Mn = class {
|
|
1638
|
-
constructor(e) {
|
|
1639
|
-
this.shapePrimitives = [], this._currentPoly = null, this._bounds = new r(), this._graphicsPath2D = e, this.signed = e.checkForHoles;
|
|
1640
|
-
}
|
|
1641
|
-
moveTo(e, t) {
|
|
1642
|
-
return this.startPoly(e, t), this;
|
|
1643
|
-
}
|
|
1644
|
-
lineTo(e, t) {
|
|
1645
|
-
this._ensurePoly();
|
|
1646
|
-
let n = this._currentPoly.points, r = n[n.length - 2], i = n[n.length - 1];
|
|
1647
|
-
return (r !== e || i !== t) && n.push(e, t), this;
|
|
1648
|
-
}
|
|
1649
|
-
arc(e, t, n, r, i, a) {
|
|
1650
|
-
this._ensurePoly(!1);
|
|
1651
|
-
let o = this._currentPoly.points;
|
|
1652
|
-
return bn(o, e, t, n, r, i, a), this;
|
|
1653
|
-
}
|
|
1654
|
-
arcTo(e, t, n, r, i) {
|
|
1655
|
-
this._ensurePoly();
|
|
1656
|
-
let a = this._currentPoly.points;
|
|
1657
|
-
return xn(a, e, t, n, r, i), this;
|
|
1658
|
-
}
|
|
1659
|
-
arcToSvg(e, t, n, r, i, a, o) {
|
|
1660
|
-
let s = this._currentPoly.points;
|
|
1661
|
-
return On(s, this._currentPoly.lastX, this._currentPoly.lastY, a, o, e, t, n, r, i), this;
|
|
1662
|
-
}
|
|
1663
|
-
bezierCurveTo(e, t, n, r, i, a, o) {
|
|
1664
|
-
this._ensurePoly();
|
|
1665
|
-
let s = this._currentPoly;
|
|
1666
|
-
return dn(this._currentPoly.points, s.lastX, s.lastY, e, t, n, r, i, a, o), this;
|
|
1667
|
-
}
|
|
1668
|
-
quadraticCurveTo(e, t, n, r, i) {
|
|
1669
|
-
this._ensurePoly();
|
|
1670
|
-
let a = this._currentPoly;
|
|
1671
|
-
return _n(this._currentPoly.points, a.lastX, a.lastY, e, t, n, r, i), this;
|
|
1672
|
-
}
|
|
1673
|
-
closePath() {
|
|
1674
|
-
return this.endPoly(!0), this;
|
|
1675
|
-
}
|
|
1676
|
-
addPath(e, t) {
|
|
1677
|
-
this.endPoly(), t && !t.isIdentity() && (e = e.clone(!0), e.transform(t));
|
|
1678
|
-
let n = this.shapePrimitives, r = n.length;
|
|
1679
|
-
for (let t = 0; t < e.instructions.length; t++) {
|
|
1680
|
-
let n = e.instructions[t];
|
|
1681
|
-
this[n.action](...n.data);
|
|
1682
|
-
}
|
|
1683
|
-
if (e.checkForHoles && n.length - r > 1) {
|
|
1684
|
-
let e = null;
|
|
1685
|
-
for (let t = r; t < n.length; t++) {
|
|
1686
|
-
let r = n[t];
|
|
1687
|
-
if (r.shape.type === "polygon") {
|
|
1688
|
-
let i = r.shape, a = e?.shape;
|
|
1689
|
-
a && a.containsPolygon(i) ? (e.holes || (e.holes = []), e.holes.push(r), n.copyWithin(t, t + 1), n.length--, t--) : e = r;
|
|
1690
|
-
}
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
return this;
|
|
1694
|
-
}
|
|
1695
|
-
finish(e = !1) {
|
|
1696
|
-
this.endPoly(e);
|
|
1697
|
-
}
|
|
1698
|
-
rect(e, t, n, r, i) {
|
|
1699
|
-
return this.drawShape(new d(e, t, n, r), i), this;
|
|
1700
|
-
}
|
|
1701
|
-
circle(e, t, n, r) {
|
|
1702
|
-
return this.drawShape(new R(e, t, n), r), this;
|
|
1703
|
-
}
|
|
1704
|
-
poly(e, t, n) {
|
|
1705
|
-
let r = new se(e);
|
|
1706
|
-
return r.closePath = t, this.drawShape(r, n), this;
|
|
1707
|
-
}
|
|
1708
|
-
regularPoly(e, t, n, r, i = 0, a) {
|
|
1709
|
-
r = Math.max(r | 0, 3);
|
|
1710
|
-
let o = -1 * Math.PI / 2 + i, s = Math.PI * 2 / r, c = [];
|
|
1711
|
-
for (let i = 0; i < r; i++) {
|
|
1712
|
-
let r = o - i * s;
|
|
1713
|
-
c.push(e + n * Math.cos(r), t + n * Math.sin(r));
|
|
1714
|
-
}
|
|
1715
|
-
return this.poly(c, !0, a), this;
|
|
1716
|
-
}
|
|
1717
|
-
roundPoly(e, t, n, r, i, a = 0, o) {
|
|
1718
|
-
if (r = Math.max(r | 0, 3), i <= 0) return this.regularPoly(e, t, n, r, a);
|
|
1719
|
-
let s = n * Math.sin(Math.PI / r) - .001;
|
|
1720
|
-
i = Math.min(i, s);
|
|
1721
|
-
let c = -1 * Math.PI / 2 + a, l = Math.PI * 2 / r, u = (r - 2) * Math.PI / r / 2;
|
|
1722
|
-
for (let a = 0; a < r; a++) {
|
|
1723
|
-
let r = a * l + c, s = e + n * Math.cos(r), d = t + n * Math.sin(r), f = r + Math.PI + u, p = r - Math.PI - u, m = s + i * Math.cos(f), h = d + i * Math.sin(f), g = s + i * Math.cos(p), _ = d + i * Math.sin(p);
|
|
1724
|
-
a === 0 ? this.moveTo(m, h) : this.lineTo(m, h), this.quadraticCurveTo(s, d, g, _, o);
|
|
1725
|
-
}
|
|
1726
|
-
return this.closePath();
|
|
1727
|
-
}
|
|
1728
|
-
roundShape(e, t, n = !1, r) {
|
|
1729
|
-
return e.length < 3 ? this : (n ? An(this, e, t, r) : kn(this, e, t), this.closePath());
|
|
1730
|
-
}
|
|
1731
|
-
filletRect(e, t, n, r, i) {
|
|
1732
|
-
if (i === 0) return this.rect(e, t, n, r);
|
|
1733
|
-
let a = Math.min(n, r) / 2, o = Math.min(a, Math.max(-a, i)), s = e + n, c = t + r, l = o < 0 ? -o : 0, u = Math.abs(o);
|
|
1734
|
-
return this.moveTo(e, t + u).arcTo(e + l, t + l, e + u, t, u).lineTo(s - u, t).arcTo(s - l, t + l, s, t + u, u).lineTo(s, c - u).arcTo(s - l, c - l, e + n - u, c, u).lineTo(e + u, c).arcTo(e + l, c - l, e, c - u, u).closePath();
|
|
1735
|
-
}
|
|
1736
|
-
chamferRect(e, t, n, r, i, a) {
|
|
1737
|
-
if (i <= 0) return this.rect(e, t, n, r);
|
|
1738
|
-
let o = Math.min(i, Math.min(n, r) / 2), s = e + n, c = t + r, l = [
|
|
1739
|
-
e + o,
|
|
1740
|
-
t,
|
|
1741
|
-
s - o,
|
|
1742
|
-
t,
|
|
1743
|
-
s,
|
|
1744
|
-
t + o,
|
|
1745
|
-
s,
|
|
1746
|
-
c - o,
|
|
1747
|
-
s - o,
|
|
1748
|
-
c,
|
|
1749
|
-
e + o,
|
|
1750
|
-
c,
|
|
1751
|
-
e,
|
|
1752
|
-
c - o,
|
|
1753
|
-
e,
|
|
1754
|
-
t + o
|
|
1755
|
-
];
|
|
1756
|
-
for (let e = l.length - 1; e >= 2; e -= 2) l[e] === l[e - 2] && l[e - 1] === l[e - 3] && l.splice(e - 1, 2);
|
|
1757
|
-
return this.poly(l, !0, a);
|
|
1758
|
-
}
|
|
1759
|
-
ellipse(e, t, n, r, i) {
|
|
1760
|
-
return this.drawShape(new z(e, t, n, r), i), this;
|
|
1761
|
-
}
|
|
1762
|
-
roundRect(e, t, n, r, i, a) {
|
|
1763
|
-
return this.drawShape(new ce(e, t, n, r, i), a), this;
|
|
1764
|
-
}
|
|
1765
|
-
drawShape(e, t) {
|
|
1766
|
-
return this.endPoly(), this.shapePrimitives.push({
|
|
1767
|
-
shape: e,
|
|
1768
|
-
transform: t
|
|
1769
|
-
}), this;
|
|
1770
|
-
}
|
|
1771
|
-
startPoly(e, t) {
|
|
1772
|
-
let n = this._currentPoly;
|
|
1773
|
-
return n && this.endPoly(), n = new se(), n.points.push(e, t), this._currentPoly = n, this;
|
|
1774
|
-
}
|
|
1775
|
-
endPoly(e = !1) {
|
|
1776
|
-
let t = this._currentPoly;
|
|
1777
|
-
return t && t.points.length > 2 && (t.closePath = e, this.shapePrimitives.push({ shape: t })), this._currentPoly = null, this;
|
|
1778
|
-
}
|
|
1779
|
-
_ensurePoly(e = !0) {
|
|
1780
|
-
if (!this._currentPoly && (this._currentPoly = new se(), e)) {
|
|
1781
|
-
let e = this.shapePrimitives[this.shapePrimitives.length - 1];
|
|
1782
|
-
if (e) {
|
|
1783
|
-
let t = e.shape.x, n = e.shape.y;
|
|
1784
|
-
if (e.transform && !e.transform.isIdentity()) {
|
|
1785
|
-
let r = e.transform, i = t;
|
|
1786
|
-
t = r.a * t + r.c * n + r.tx, n = r.b * i + r.d * n + r.ty;
|
|
1787
|
-
}
|
|
1788
|
-
this._currentPoly.points.push(t, n);
|
|
1789
|
-
} else this._currentPoly.points.push(0, 0);
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
buildPath() {
|
|
1793
|
-
let e = this._graphicsPath2D;
|
|
1794
|
-
this.shapePrimitives.length = 0, this._currentPoly = null;
|
|
1795
|
-
for (let t = 0; t < e.instructions.length; t++) {
|
|
1796
|
-
let n = e.instructions[t];
|
|
1797
|
-
this[n.action](...n.data);
|
|
1798
|
-
}
|
|
1799
|
-
this.finish();
|
|
1800
|
-
}
|
|
1801
|
-
get bounds() {
|
|
1802
|
-
let e = this._bounds;
|
|
1803
|
-
e.clear();
|
|
1804
|
-
let t = this.shapePrimitives;
|
|
1805
|
-
for (let n = 0; n < t.length; n++) {
|
|
1806
|
-
let r = t[n], i = r.shape.getBounds(jn);
|
|
1807
|
-
r.transform ? e.addRect(i, r.transform) : e.addRect(i);
|
|
1808
|
-
}
|
|
1809
|
-
return e;
|
|
1810
|
-
}
|
|
1811
|
-
}, X = class e {
|
|
1812
|
-
constructor(e, t = !1) {
|
|
1813
|
-
this.instructions = [], this.uid = p("graphicsPath"), this._dirty = !0, this.checkForHoles = t, typeof e == "string" ? nn(e, this) : this.instructions = e?.slice() ?? [];
|
|
1814
|
-
}
|
|
1815
|
-
get shapePath() {
|
|
1816
|
-
return this._shapePath ||= new Mn(this), this._dirty && (this._dirty = !1, this._shapePath.buildPath()), this._shapePath;
|
|
1817
|
-
}
|
|
1818
|
-
addPath(e, t) {
|
|
1819
|
-
return e = e.clone(), this.instructions.push({
|
|
1820
|
-
action: "addPath",
|
|
1821
|
-
data: [e, t]
|
|
1822
|
-
}), this._dirty = !0, this;
|
|
1823
|
-
}
|
|
1824
|
-
arc(...e) {
|
|
1825
|
-
return this.instructions.push({
|
|
1826
|
-
action: "arc",
|
|
1827
|
-
data: e
|
|
1828
|
-
}), this._dirty = !0, this;
|
|
1829
|
-
}
|
|
1830
|
-
arcTo(...e) {
|
|
1831
|
-
return this.instructions.push({
|
|
1832
|
-
action: "arcTo",
|
|
1833
|
-
data: e
|
|
1834
|
-
}), this._dirty = !0, this;
|
|
1835
|
-
}
|
|
1836
|
-
arcToSvg(...e) {
|
|
1837
|
-
return this.instructions.push({
|
|
1838
|
-
action: "arcToSvg",
|
|
1839
|
-
data: e
|
|
1840
|
-
}), this._dirty = !0, this;
|
|
1841
|
-
}
|
|
1842
|
-
bezierCurveTo(...e) {
|
|
1843
|
-
return this.instructions.push({
|
|
1844
|
-
action: "bezierCurveTo",
|
|
1845
|
-
data: e
|
|
1846
|
-
}), this._dirty = !0, this;
|
|
1847
|
-
}
|
|
1848
|
-
bezierCurveToShort(e, n, r, i, a) {
|
|
1849
|
-
let o = this.instructions[this.instructions.length - 1], s = this.getLastPoint(t.shared), c = 0, l = 0;
|
|
1850
|
-
if (!o || o.action !== "bezierCurveTo") c = s.x, l = s.y;
|
|
1851
|
-
else {
|
|
1852
|
-
c = o.data[2], l = o.data[3];
|
|
1853
|
-
let e = s.x, t = s.y;
|
|
1854
|
-
c = e + (e - c), l = t + (t - l);
|
|
1855
|
-
}
|
|
1856
|
-
return this.instructions.push({
|
|
1857
|
-
action: "bezierCurveTo",
|
|
1858
|
-
data: [
|
|
1859
|
-
c,
|
|
1860
|
-
l,
|
|
1861
|
-
e,
|
|
1862
|
-
n,
|
|
1863
|
-
r,
|
|
1864
|
-
i,
|
|
1865
|
-
a
|
|
1866
|
-
]
|
|
1867
|
-
}), this._dirty = !0, this;
|
|
1868
|
-
}
|
|
1869
|
-
closePath() {
|
|
1870
|
-
return this.instructions.push({
|
|
1871
|
-
action: "closePath",
|
|
1872
|
-
data: []
|
|
1873
|
-
}), this._dirty = !0, this;
|
|
1874
|
-
}
|
|
1875
|
-
ellipse(...e) {
|
|
1876
|
-
return this.instructions.push({
|
|
1877
|
-
action: "ellipse",
|
|
1878
|
-
data: e
|
|
1879
|
-
}), this._dirty = !0, this;
|
|
1880
|
-
}
|
|
1881
|
-
lineTo(...e) {
|
|
1882
|
-
return this.instructions.push({
|
|
1883
|
-
action: "lineTo",
|
|
1884
|
-
data: e
|
|
1885
|
-
}), this._dirty = !0, this;
|
|
1886
|
-
}
|
|
1887
|
-
moveTo(...e) {
|
|
1888
|
-
return this.instructions.push({
|
|
1889
|
-
action: "moveTo",
|
|
1890
|
-
data: e
|
|
1891
|
-
}), this;
|
|
1892
|
-
}
|
|
1893
|
-
quadraticCurveTo(...e) {
|
|
1894
|
-
return this.instructions.push({
|
|
1895
|
-
action: "quadraticCurveTo",
|
|
1896
|
-
data: e
|
|
1897
|
-
}), this._dirty = !0, this;
|
|
1898
|
-
}
|
|
1899
|
-
quadraticCurveToShort(e, n, r) {
|
|
1900
|
-
let i = this.instructions[this.instructions.length - 1], a = this.getLastPoint(t.shared), o = 0, s = 0;
|
|
1901
|
-
if (!i || i.action !== "quadraticCurveTo") o = a.x, s = a.y;
|
|
1902
|
-
else {
|
|
1903
|
-
o = i.data[0], s = i.data[1];
|
|
1904
|
-
let e = a.x, t = a.y;
|
|
1905
|
-
o = e + (e - o), s = t + (t - s);
|
|
1906
|
-
}
|
|
1907
|
-
return this.instructions.push({
|
|
1908
|
-
action: "quadraticCurveTo",
|
|
1909
|
-
data: [
|
|
1910
|
-
o,
|
|
1911
|
-
s,
|
|
1912
|
-
e,
|
|
1913
|
-
n,
|
|
1914
|
-
r
|
|
1915
|
-
]
|
|
1916
|
-
}), this._dirty = !0, this;
|
|
1917
|
-
}
|
|
1918
|
-
rect(e, t, n, r, i) {
|
|
1919
|
-
return this.instructions.push({
|
|
1920
|
-
action: "rect",
|
|
1921
|
-
data: [
|
|
1922
|
-
e,
|
|
1923
|
-
t,
|
|
1924
|
-
n,
|
|
1925
|
-
r,
|
|
1926
|
-
i
|
|
1927
|
-
]
|
|
1928
|
-
}), this._dirty = !0, this;
|
|
1929
|
-
}
|
|
1930
|
-
circle(e, t, n, r) {
|
|
1931
|
-
return this.instructions.push({
|
|
1932
|
-
action: "circle",
|
|
1933
|
-
data: [
|
|
1934
|
-
e,
|
|
1935
|
-
t,
|
|
1936
|
-
n,
|
|
1937
|
-
r
|
|
1938
|
-
]
|
|
1939
|
-
}), this._dirty = !0, this;
|
|
1940
|
-
}
|
|
1941
|
-
roundRect(...e) {
|
|
1942
|
-
return this.instructions.push({
|
|
1943
|
-
action: "roundRect",
|
|
1944
|
-
data: e
|
|
1945
|
-
}), this._dirty = !0, this;
|
|
1946
|
-
}
|
|
1947
|
-
poly(...e) {
|
|
1948
|
-
return this.instructions.push({
|
|
1949
|
-
action: "poly",
|
|
1950
|
-
data: e
|
|
1951
|
-
}), this._dirty = !0, this;
|
|
1952
|
-
}
|
|
1953
|
-
regularPoly(...e) {
|
|
1954
|
-
return this.instructions.push({
|
|
1955
|
-
action: "regularPoly",
|
|
1956
|
-
data: e
|
|
1957
|
-
}), this._dirty = !0, this;
|
|
1958
|
-
}
|
|
1959
|
-
roundPoly(...e) {
|
|
1960
|
-
return this.instructions.push({
|
|
1961
|
-
action: "roundPoly",
|
|
1962
|
-
data: e
|
|
1963
|
-
}), this._dirty = !0, this;
|
|
1964
|
-
}
|
|
1965
|
-
roundShape(...e) {
|
|
1966
|
-
return this.instructions.push({
|
|
1967
|
-
action: "roundShape",
|
|
1968
|
-
data: e
|
|
1969
|
-
}), this._dirty = !0, this;
|
|
1970
|
-
}
|
|
1971
|
-
filletRect(...e) {
|
|
1972
|
-
return this.instructions.push({
|
|
1973
|
-
action: "filletRect",
|
|
1974
|
-
data: e
|
|
1975
|
-
}), this._dirty = !0, this;
|
|
1976
|
-
}
|
|
1977
|
-
chamferRect(...e) {
|
|
1978
|
-
return this.instructions.push({
|
|
1979
|
-
action: "chamferRect",
|
|
1980
|
-
data: e
|
|
1981
|
-
}), this._dirty = !0, this;
|
|
1982
|
-
}
|
|
1983
|
-
star(e, t, n, r, i, a, o) {
|
|
1984
|
-
i ||= r / 2;
|
|
1985
|
-
let s = -1 * Math.PI / 2 + a, c = n * 2, l = Math.PI * 2 / c, u = [];
|
|
1986
|
-
for (let n = 0; n < c; n++) {
|
|
1987
|
-
let a = n % 2 ? i : r, o = n * l + s;
|
|
1988
|
-
u.push(e + a * Math.cos(o), t + a * Math.sin(o));
|
|
1989
|
-
}
|
|
1990
|
-
return this.poly(u, !0, o), this;
|
|
1991
|
-
}
|
|
1992
|
-
clone(t = !1) {
|
|
1993
|
-
let n = new e();
|
|
1994
|
-
if (n.checkForHoles = this.checkForHoles, !t) n.instructions = this.instructions.slice();
|
|
1995
|
-
else for (let e = 0; e < this.instructions.length; e++) {
|
|
1996
|
-
let t = this.instructions[e];
|
|
1997
|
-
n.instructions.push({
|
|
1998
|
-
action: t.action,
|
|
1999
|
-
data: t.data.slice()
|
|
2000
|
-
});
|
|
2001
|
-
}
|
|
2002
|
-
return n;
|
|
2003
|
-
}
|
|
2004
|
-
clear() {
|
|
2005
|
-
return this.instructions.length = 0, this._dirty = !0, this;
|
|
2006
|
-
}
|
|
2007
|
-
transform(e) {
|
|
2008
|
-
if (e.isIdentity()) return this;
|
|
2009
|
-
let t = e.a, n = e.b, r = e.c, i = e.d, a = e.tx, o = e.ty, c = 0, l = 0, u = 0, d = 0, f = 0, p = 0, m = 0, h = 0;
|
|
2010
|
-
for (let g = 0; g < this.instructions.length; g++) {
|
|
2011
|
-
let _ = this.instructions[g], v = _.data;
|
|
2012
|
-
switch (_.action) {
|
|
2013
|
-
case "moveTo":
|
|
2014
|
-
case "lineTo":
|
|
2015
|
-
c = v[0], l = v[1], v[0] = t * c + r * l + a, v[1] = n * c + i * l + o;
|
|
2016
|
-
break;
|
|
2017
|
-
case "bezierCurveTo":
|
|
2018
|
-
u = v[0], d = v[1], f = v[2], p = v[3], c = v[4], l = v[5], v[0] = t * u + r * d + a, v[1] = n * u + i * d + o, v[2] = t * f + r * p + a, v[3] = n * f + i * p + o, v[4] = t * c + r * l + a, v[5] = n * c + i * l + o;
|
|
2019
|
-
break;
|
|
2020
|
-
case "quadraticCurveTo":
|
|
2021
|
-
u = v[0], d = v[1], c = v[2], l = v[3], v[0] = t * u + r * d + a, v[1] = n * u + i * d + o, v[2] = t * c + r * l + a, v[3] = n * c + i * l + o;
|
|
2022
|
-
break;
|
|
2023
|
-
case "arcToSvg":
|
|
2024
|
-
c = v[5], l = v[6], m = v[0], h = v[1], v[0] = t * m + r * h, v[1] = n * m + i * h, v[5] = t * c + r * l + a, v[6] = n * c + i * l + o;
|
|
2025
|
-
break;
|
|
2026
|
-
case "circle":
|
|
2027
|
-
v[4] = Z(v[3], e);
|
|
2028
|
-
break;
|
|
2029
|
-
case "rect":
|
|
2030
|
-
v[4] = Z(v[4], e);
|
|
2031
|
-
break;
|
|
2032
|
-
case "ellipse":
|
|
2033
|
-
v[8] = Z(v[8], e);
|
|
2034
|
-
break;
|
|
2035
|
-
case "roundRect":
|
|
2036
|
-
v[5] = Z(v[5], e);
|
|
2037
|
-
break;
|
|
2038
|
-
case "addPath":
|
|
2039
|
-
v[0].transform(e);
|
|
2040
|
-
break;
|
|
2041
|
-
case "poly":
|
|
2042
|
-
v[2] = Z(v[2], e);
|
|
2043
|
-
break;
|
|
2044
|
-
case "regularPoly":
|
|
2045
|
-
case "chamferRect":
|
|
2046
|
-
v[5] = Z(v[5], e);
|
|
2047
|
-
break;
|
|
2048
|
-
case "closePath": break;
|
|
2049
|
-
default: s("unknown transform action", _.action);
|
|
2050
|
-
}
|
|
2051
|
-
}
|
|
2052
|
-
return this._dirty = !0, this;
|
|
2053
|
-
}
|
|
2054
|
-
get bounds() {
|
|
2055
|
-
return this.shapePath.bounds;
|
|
2056
|
-
}
|
|
2057
|
-
getLastPoint(e) {
|
|
2058
|
-
let t = this.instructions.length - 1, n = this.instructions[t];
|
|
2059
|
-
if (!n) return e.x = 0, e.y = 0, e;
|
|
2060
|
-
for (; n.action === "closePath";) {
|
|
2061
|
-
if (t--, t < 0) return e.x = 0, e.y = 0, e;
|
|
2062
|
-
n = this.instructions[t];
|
|
2063
|
-
}
|
|
2064
|
-
switch (n.action) {
|
|
2065
|
-
case "moveTo":
|
|
2066
|
-
case "lineTo":
|
|
2067
|
-
e.x = n.data[0], e.y = n.data[1];
|
|
2068
|
-
break;
|
|
2069
|
-
case "quadraticCurveTo":
|
|
2070
|
-
e.x = n.data[2], e.y = n.data[3];
|
|
2071
|
-
break;
|
|
2072
|
-
case "bezierCurveTo":
|
|
2073
|
-
e.x = n.data[4], e.y = n.data[5];
|
|
2074
|
-
break;
|
|
2075
|
-
case "arc":
|
|
2076
|
-
case "arcToSvg":
|
|
2077
|
-
e.x = n.data[5], e.y = n.data[6];
|
|
2078
|
-
break;
|
|
2079
|
-
case "addPath": n.data[0].getLastPoint(e);
|
|
2080
|
-
}
|
|
2081
|
-
return e;
|
|
2082
|
-
}
|
|
2083
|
-
};
|
|
2084
|
-
function Z(e, t) {
|
|
2085
|
-
return e ? e.prepend(t) : t.clone();
|
|
2086
|
-
}
|
|
2087
|
-
//#endregion
|
|
2088
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/svg/parseSVGFloatAttribute.mjs
|
|
2089
|
-
function Q(e, t, n) {
|
|
2090
|
-
let r = e.getAttribute(t);
|
|
2091
|
-
return r ? Number(r) : n;
|
|
2092
|
-
}
|
|
2093
|
-
//#endregion
|
|
2094
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/svg/parseSVGDefinitions.mjs
|
|
2095
|
-
function Nn(e, t) {
|
|
2096
|
-
let n = e.querySelectorAll("defs");
|
|
2097
|
-
for (let e = 0; e < n.length; e++) {
|
|
2098
|
-
let r = n[e];
|
|
2099
|
-
for (let e = 0; e < r.children.length; e++) {
|
|
2100
|
-
let n = r.children[e];
|
|
2101
|
-
switch (n.nodeName.toLowerCase()) {
|
|
2102
|
-
case "lineargradient":
|
|
2103
|
-
t.defs[n.id] = Pn(n);
|
|
2104
|
-
break;
|
|
2105
|
-
case "radialgradient": t.defs[n.id] = Fn(n);
|
|
2106
|
-
}
|
|
2107
|
-
}
|
|
2108
|
-
}
|
|
2109
|
-
}
|
|
2110
|
-
function Pn(e) {
|
|
2111
|
-
let t = new U(Q(e, "x1", 0), Q(e, "y1", 0), Q(e, "x2", 1), Q(e, "y2", 0), (e.getAttribute("gradientUnits") || "objectBoundingBox") === "objectBoundingBox" ? "local" : "global");
|
|
2112
|
-
for (let n = 0; n < e.children.length; n++) {
|
|
2113
|
-
let r = e.children[n], i = Q(r, "offset", 0), a = C.shared.setValue(r.getAttribute("stop-color")).toNumber();
|
|
2114
|
-
t.addColorStop(i, a);
|
|
2115
|
-
}
|
|
2116
|
-
return t;
|
|
2117
|
-
}
|
|
2118
|
-
function Fn(e) {
|
|
2119
|
-
return s("[SVG Parser] Radial gradients are not yet supported"), new U(0, 0, 1, 0);
|
|
2120
|
-
}
|
|
2121
|
-
//#endregion
|
|
2122
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/svg/utils/extractSvgUrlId.mjs
|
|
2123
|
-
function In(e) {
|
|
2124
|
-
let t = e.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);
|
|
2125
|
-
return t ? t[1] : "";
|
|
2126
|
-
}
|
|
2127
|
-
//#endregion
|
|
2128
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/svg/parseSVGStyle.mjs
|
|
2129
|
-
var Ln = {
|
|
2130
|
-
fill: {
|
|
2131
|
-
type: "paint",
|
|
2132
|
-
default: 0
|
|
2133
|
-
},
|
|
2134
|
-
"fill-opacity": {
|
|
2135
|
-
type: "number",
|
|
2136
|
-
default: 1
|
|
2137
|
-
},
|
|
2138
|
-
stroke: {
|
|
2139
|
-
type: "paint",
|
|
2140
|
-
default: 0
|
|
2141
|
-
},
|
|
2142
|
-
"stroke-width": {
|
|
2143
|
-
type: "number",
|
|
2144
|
-
default: 1
|
|
2145
|
-
},
|
|
2146
|
-
"stroke-opacity": {
|
|
2147
|
-
type: "number",
|
|
2148
|
-
default: 1
|
|
2149
|
-
},
|
|
2150
|
-
"stroke-linecap": {
|
|
2151
|
-
type: "string",
|
|
2152
|
-
default: "butt"
|
|
2153
|
-
},
|
|
2154
|
-
"stroke-linejoin": {
|
|
2155
|
-
type: "string",
|
|
2156
|
-
default: "miter"
|
|
2157
|
-
},
|
|
2158
|
-
"stroke-miterlimit": {
|
|
2159
|
-
type: "number",
|
|
2160
|
-
default: 10
|
|
2161
|
-
},
|
|
2162
|
-
"stroke-dasharray": {
|
|
2163
|
-
type: "string",
|
|
2164
|
-
default: "none"
|
|
2165
|
-
},
|
|
2166
|
-
"stroke-dashoffset": {
|
|
2167
|
-
type: "number",
|
|
2168
|
-
default: 0
|
|
2169
|
-
},
|
|
2170
|
-
opacity: {
|
|
2171
|
-
type: "number",
|
|
2172
|
-
default: 1
|
|
2173
|
-
}
|
|
2174
|
-
};
|
|
2175
|
-
function Rn(e, t) {
|
|
2176
|
-
let n = e.getAttribute("style"), r = {}, i = {}, a = {
|
|
2177
|
-
strokeStyle: r,
|
|
2178
|
-
fillStyle: i,
|
|
2179
|
-
useFill: !1,
|
|
2180
|
-
useStroke: !1
|
|
2181
|
-
};
|
|
2182
|
-
for (let n in Ln) {
|
|
2183
|
-
let r = e.getAttribute(n);
|
|
2184
|
-
r && zn(t, a, n, r.trim());
|
|
2185
|
-
}
|
|
2186
|
-
if (n) {
|
|
2187
|
-
let e = n.split(";");
|
|
2188
|
-
for (let n = 0; n < e.length; n++) {
|
|
2189
|
-
let [r, i] = e[n].trim().split(":");
|
|
2190
|
-
Ln[r] && zn(t, a, r, i.trim());
|
|
2191
|
-
}
|
|
2192
|
-
}
|
|
2193
|
-
return {
|
|
2194
|
-
strokeStyle: a.useStroke ? r : null,
|
|
2195
|
-
fillStyle: a.useFill ? i : null,
|
|
2196
|
-
useFill: a.useFill,
|
|
2197
|
-
useStroke: a.useStroke
|
|
2198
|
-
};
|
|
2199
|
-
}
|
|
2200
|
-
function zn(e, t, n, r) {
|
|
2201
|
-
switch (n) {
|
|
2202
|
-
case "stroke":
|
|
2203
|
-
if (r !== "none") {
|
|
2204
|
-
if (r.startsWith("url(")) {
|
|
2205
|
-
let n = In(r);
|
|
2206
|
-
t.strokeStyle.fill = e.defs[n];
|
|
2207
|
-
} else t.strokeStyle.color = C.shared.setValue(r).toNumber();
|
|
2208
|
-
t.useStroke = !0;
|
|
2209
|
-
}
|
|
2210
|
-
break;
|
|
2211
|
-
case "stroke-width":
|
|
2212
|
-
t.strokeStyle.width = Number(r);
|
|
2213
|
-
break;
|
|
2214
|
-
case "fill":
|
|
2215
|
-
if (r !== "none") {
|
|
2216
|
-
if (r.startsWith("url(")) {
|
|
2217
|
-
let n = In(r);
|
|
2218
|
-
t.fillStyle.fill = e.defs[n];
|
|
2219
|
-
} else t.fillStyle.color = C.shared.setValue(r).toNumber();
|
|
2220
|
-
t.useFill = !0;
|
|
2221
|
-
}
|
|
2222
|
-
break;
|
|
2223
|
-
case "fill-opacity":
|
|
2224
|
-
t.fillStyle.alpha = Number(r);
|
|
2225
|
-
break;
|
|
2226
|
-
case "stroke-opacity":
|
|
2227
|
-
t.strokeStyle.alpha = Number(r);
|
|
2228
|
-
break;
|
|
2229
|
-
case "opacity": t.fillStyle.alpha = Number(r), t.strokeStyle.alpha = Number(r);
|
|
2230
|
-
}
|
|
2231
|
-
}
|
|
2232
|
-
//#endregion
|
|
2233
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/svg/utils/fillOperations.mjs
|
|
2234
|
-
function Bn(e) {
|
|
2235
|
-
if (e.length <= 2) return !0;
|
|
2236
|
-
let t = e.map((e) => e.area).sort((e, t) => t - e), [n, r] = t, i = t[t.length - 1], a = n / r, o = r / i;
|
|
2237
|
-
return !(a > 3 && o < 2);
|
|
2238
|
-
}
|
|
2239
|
-
//#endregion
|
|
2240
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/svg/utils/pathOperations.mjs
|
|
2241
|
-
function Vn(e) {
|
|
2242
|
-
return e.split(/(?=[Mm])/).filter((e) => e.trim().length > 0);
|
|
2243
|
-
}
|
|
2244
|
-
function Hn(e) {
|
|
2245
|
-
let t = e.match(/[-+]?[0-9]*\.?[0-9]+/g);
|
|
2246
|
-
if (!t || t.length < 4) return 0;
|
|
2247
|
-
let n = t.map(Number), r = [], i = [];
|
|
2248
|
-
for (let e = 0; e < n.length; e += 2) e + 1 < n.length && (r.push(n[e]), i.push(n[e + 1]));
|
|
2249
|
-
if (r.length === 0 || i.length === 0) return 0;
|
|
2250
|
-
let a = Math.min(...r), o = Math.max(...r), s = Math.min(...i), c = Math.max(...i);
|
|
2251
|
-
return (o - a) * (c - s);
|
|
2252
|
-
}
|
|
2253
|
-
function Un(e, t) {
|
|
2254
|
-
let n = new X(e, !1);
|
|
2255
|
-
for (let e of n.instructions) t.instructions.push(e);
|
|
2256
|
-
}
|
|
2257
|
-
//#endregion
|
|
2258
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/svg/SVGParser.mjs
|
|
2259
|
-
function Wn(e, t) {
|
|
2260
|
-
if (typeof e == "string") {
|
|
2261
|
-
let t = document.createElement("div");
|
|
2262
|
-
t.innerHTML = e.trim(), e = t.querySelector("svg");
|
|
2263
|
-
}
|
|
2264
|
-
let n = {
|
|
2265
|
-
context: t,
|
|
2266
|
-
defs: {},
|
|
2267
|
-
path: new X()
|
|
2268
|
-
};
|
|
2269
|
-
Nn(e, n);
|
|
2270
|
-
let r = e.children, { fillStyle: i, strokeStyle: a } = Rn(e, n);
|
|
2271
|
-
for (let e = 0; e < r.length; e++) {
|
|
2272
|
-
let t = r[e];
|
|
2273
|
-
t.nodeName.toLowerCase() !== "defs" && Gn(t, n, i, a);
|
|
2274
|
-
}
|
|
2275
|
-
return t;
|
|
2276
|
-
}
|
|
2277
|
-
function Gn(e, t, n, r) {
|
|
2278
|
-
let i = e.children, { fillStyle: a, strokeStyle: o } = Rn(e, t);
|
|
2279
|
-
a && n ? n = {
|
|
2280
|
-
...n,
|
|
2281
|
-
...a
|
|
2282
|
-
} : a && (n = a), o && r ? r = {
|
|
2283
|
-
...r,
|
|
2284
|
-
...o
|
|
2285
|
-
} : o && (r = o);
|
|
2286
|
-
let c = !n && !r;
|
|
2287
|
-
c && (n = { color: 0 });
|
|
2288
|
-
let l, u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, T;
|
|
2289
|
-
switch (e.nodeName.toLowerCase()) {
|
|
2290
|
-
case "path": {
|
|
2291
|
-
S = e.getAttribute("d");
|
|
2292
|
-
let i = e.getAttribute("fill-rule"), a = Vn(S), o = i === "evenodd", s = a.length > 1;
|
|
2293
|
-
if (o && s) {
|
|
2294
|
-
let e = a.map((e) => ({
|
|
2295
|
-
path: e,
|
|
2296
|
-
area: Hn(e)
|
|
2297
|
-
}));
|
|
2298
|
-
if (e.sort((e, t) => t.area - e.area), a.length > 3 || !Bn(e)) for (let i = 0; i < e.length; i++) {
|
|
2299
|
-
let a = e[i], o = i === 0;
|
|
2300
|
-
t.context.beginPath();
|
|
2301
|
-
let s = new X(void 0, !0);
|
|
2302
|
-
Un(a.path, s), t.context.path(s), o ? (n && t.context.fill(n), r && t.context.stroke(r)) : t.context.cut();
|
|
2303
|
-
}
|
|
2304
|
-
else for (let i = 0; i < e.length; i++) {
|
|
2305
|
-
let a = e[i], o = i % 2 == 1;
|
|
2306
|
-
t.context.beginPath();
|
|
2307
|
-
let s = new X(void 0, !0);
|
|
2308
|
-
Un(a.path, s), t.context.path(s), o ? t.context.cut() : (n && t.context.fill(n), r && t.context.stroke(r));
|
|
2309
|
-
}
|
|
2310
|
-
} else C = new X(S, !i || i === "evenodd"), t.context.path(C), n && t.context.fill(n), r && t.context.stroke(r);
|
|
2311
|
-
break;
|
|
2312
|
-
}
|
|
2313
|
-
case "circle":
|
|
2314
|
-
h = Q(e, "cx", 0), g = Q(e, "cy", 0), _ = Q(e, "r", 0), t.context.ellipse(h, g, _, _), n && t.context.fill(n), r && t.context.stroke(r);
|
|
2315
|
-
break;
|
|
2316
|
-
case "rect":
|
|
2317
|
-
l = Q(e, "x", 0), u = Q(e, "y", 0), w = Q(e, "width", 0), T = Q(e, "height", 0), v = Q(e, "rx", 0), y = Q(e, "ry", 0), v || y ? t.context.roundRect(l, u, w, T, v || y) : t.context.rect(l, u, w, T), n && t.context.fill(n), r && t.context.stroke(r);
|
|
2318
|
-
break;
|
|
2319
|
-
case "ellipse":
|
|
2320
|
-
h = Q(e, "cx", 0), g = Q(e, "cy", 0), v = Q(e, "rx", 0), y = Q(e, "ry", 0), t.context.beginPath(), t.context.ellipse(h, g, v, y), n && t.context.fill(n), r && t.context.stroke(r);
|
|
2321
|
-
break;
|
|
2322
|
-
case "line":
|
|
2323
|
-
d = Q(e, "x1", 0), f = Q(e, "y1", 0), p = Q(e, "x2", 0), m = Q(e, "y2", 0), t.context.beginPath(), t.context.moveTo(d, f), t.context.lineTo(p, m), r && t.context.stroke(r);
|
|
2324
|
-
break;
|
|
2325
|
-
case "polygon":
|
|
2326
|
-
x = e.getAttribute("points"), b = x.match(/-?\d+/g).map((e) => parseInt(e, 10)), t.context.poly(b, !0), n && t.context.fill(n), r && t.context.stroke(r);
|
|
2327
|
-
break;
|
|
2328
|
-
case "polyline":
|
|
2329
|
-
x = e.getAttribute("points"), b = x.match(/-?\d+/g).map((e) => parseInt(e, 10)), t.context.poly(b, !1), r && t.context.stroke(r);
|
|
2330
|
-
break;
|
|
2331
|
-
case "g":
|
|
2332
|
-
case "svg": break;
|
|
2333
|
-
default: s(`[SVG parser] <${e.nodeName}> elements unsupported`);
|
|
2334
|
-
}
|
|
2335
|
-
c && (n = null);
|
|
2336
|
-
for (let e = 0; e < i.length; e++) Gn(i[e], t, n, r);
|
|
2337
|
-
}
|
|
2338
|
-
//#endregion
|
|
2339
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/utils/convertFillInputToFillStyle.mjs
|
|
2340
|
-
function Kn(e) {
|
|
2341
|
-
return C.isColorLike(e);
|
|
2342
|
-
}
|
|
2343
|
-
function qn(e) {
|
|
2344
|
-
return e instanceof be;
|
|
2345
|
-
}
|
|
2346
|
-
function Jn(e) {
|
|
2347
|
-
return e instanceof U;
|
|
2348
|
-
}
|
|
2349
|
-
function Yn(e) {
|
|
2350
|
-
return e instanceof T;
|
|
2351
|
-
}
|
|
2352
|
-
function Xn(e, t, n) {
|
|
2353
|
-
let r = C.shared.setValue(t ?? 0);
|
|
2354
|
-
return e.color = r.toNumber(), e.alpha = r.alpha === 1 ? n.alpha : r.alpha, e.texture = T.WHITE, {
|
|
2355
|
-
...n,
|
|
2356
|
-
...e
|
|
2357
|
-
};
|
|
2358
|
-
}
|
|
2359
|
-
function Zn(e, t, n) {
|
|
2360
|
-
return e.texture = t, {
|
|
2361
|
-
...n,
|
|
2362
|
-
...e
|
|
2363
|
-
};
|
|
2364
|
-
}
|
|
2365
|
-
function Qn(e, t, n) {
|
|
2366
|
-
return e.fill = t, e.color = 16777215, e.texture = t.texture, e.matrix = t.transform, e.textureSpace = t.textureSpace, {
|
|
2367
|
-
...n,
|
|
2368
|
-
...e
|
|
2369
|
-
};
|
|
2370
|
-
}
|
|
2371
|
-
function $n(e, t, n) {
|
|
2372
|
-
return t.buildGradient(), e.fill = t, e.color = 16777215, e.texture = t.texture, e.matrix = t.transform, e.textureSpace = t.textureSpace, {
|
|
2373
|
-
...n,
|
|
2374
|
-
...e
|
|
2375
|
-
};
|
|
2376
|
-
}
|
|
2377
|
-
function er(e, t) {
|
|
2378
|
-
let n = {
|
|
2379
|
-
...t,
|
|
2380
|
-
...e
|
|
2381
|
-
}, r = C.shared.setValue(n.color);
|
|
2382
|
-
return n.alpha *= r.alpha, n.color = r.toNumber(), n;
|
|
2383
|
-
}
|
|
2384
|
-
function tr(e, t) {
|
|
2385
|
-
if (e == null) return null;
|
|
2386
|
-
let n = {}, r = e;
|
|
2387
|
-
return Kn(e) ? Xn(n, e, t) : Yn(e) ? Zn(n, e, t) : qn(e) ? Qn(n, e, t) : Jn(e) ? $n(n, e, t) : r.fill && qn(r.fill) ? Qn(r, r.fill, t) : r.fill && Jn(r.fill) ? $n(r, r.fill, t) : er(r, t);
|
|
2388
|
-
}
|
|
2389
|
-
function nr(e, t) {
|
|
2390
|
-
let { width: n, alignment: r, miterLimit: i, cap: a, join: o, pixelLine: s, ...c } = t, l = tr(e, c);
|
|
2391
|
-
return l ? {
|
|
2392
|
-
width: n,
|
|
2393
|
-
alignment: r,
|
|
2394
|
-
miterLimit: i,
|
|
2395
|
-
cap: a,
|
|
2396
|
-
join: o,
|
|
2397
|
-
pixelLine: s,
|
|
2398
|
-
...l
|
|
2399
|
-
} : null;
|
|
2400
|
-
}
|
|
2401
|
-
//#endregion
|
|
2402
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/utils/getMaxMiterRatio.mjs
|
|
2403
|
-
function rr(e, t) {
|
|
2404
|
-
let n = 1, r = e.shapePath.shapePrimitives;
|
|
2405
|
-
for (let e = 0; e < r.length; e++) {
|
|
2406
|
-
let i = r[e].shape;
|
|
2407
|
-
if (i.type !== "polygon") continue;
|
|
2408
|
-
let a = i.points, o = a.length;
|
|
2409
|
-
if (o < 6) continue;
|
|
2410
|
-
let s = i.closePath;
|
|
2411
|
-
for (let e = 0; e < o; e += 2) {
|
|
2412
|
-
if (!s && (e === 0 || e === o - 2)) continue;
|
|
2413
|
-
let r = (e - 2 + o) % o, i = (e + 2) % o, c = a[r], l = a[r + 1], u = a[e], d = a[e + 1], f = a[i], p = a[i + 1], m = c - u, h = l - d, g = f - u, _ = p - d, v = m * m + h * h, y = g * g + _ * _;
|
|
2414
|
-
if (v < 1e-12 || y < 1e-12) continue;
|
|
2415
|
-
let b = (m * g + h * _) / Math.sqrt(v * y);
|
|
2416
|
-
b < -1 ? b = -1 : b > 1 && (b = 1);
|
|
2417
|
-
let x = Math.sqrt((1 - b) * .5);
|
|
2418
|
-
if (x < 1e-6) continue;
|
|
2419
|
-
let S = Math.min(1 / x, t);
|
|
2420
|
-
S > n && (n = S);
|
|
2421
|
-
}
|
|
2422
|
-
}
|
|
2423
|
-
return n;
|
|
2424
|
-
}
|
|
2425
|
-
//#endregion
|
|
2426
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/GraphicsContext.mjs
|
|
2427
|
-
var ir = new t(), ar = new u(), or = class e extends b {
|
|
2428
|
-
constructor() {
|
|
2429
|
-
super(...arguments), this._gpuData = /* @__PURE__ */ Object.create(null), this.autoGarbageCollect = !0, this._gcLastUsed = -1, this.uid = p("graphicsContext"), this.dirty = !0, this.batchMode = "auto", this.instructions = [], this.destroyed = !1, this._activePath = new X(), this._transform = new u(), this._fillStyle = { ...e.defaultFillStyle }, this._strokeStyle = { ...e.defaultStrokeStyle }, this._stateStack = [], this._tick = 0, this._bounds = new r(), this._boundsDirty = !0;
|
|
2430
|
-
}
|
|
2431
|
-
clone() {
|
|
2432
|
-
let t = new e();
|
|
2433
|
-
return t.batchMode = this.batchMode, t.instructions = this.instructions.slice(), t._activePath = this._activePath.clone(), t._transform = this._transform.clone(), t._fillStyle = { ...this._fillStyle }, t._strokeStyle = { ...this._strokeStyle }, t._stateStack = this._stateStack.slice(), t._bounds = this._bounds.clone(), t._boundsDirty = !0, t;
|
|
2434
|
-
}
|
|
2435
|
-
get fillStyle() {
|
|
2436
|
-
return this._fillStyle;
|
|
2437
|
-
}
|
|
2438
|
-
set fillStyle(t) {
|
|
2439
|
-
this._fillStyle = tr(t, e.defaultFillStyle);
|
|
2440
|
-
}
|
|
2441
|
-
get strokeStyle() {
|
|
2442
|
-
return this._strokeStyle;
|
|
2443
|
-
}
|
|
2444
|
-
set strokeStyle(t) {
|
|
2445
|
-
this._strokeStyle = nr(t, e.defaultStrokeStyle);
|
|
2446
|
-
}
|
|
2447
|
-
setFillStyle(t) {
|
|
2448
|
-
return this._fillStyle = tr(t, e.defaultFillStyle), this;
|
|
2449
|
-
}
|
|
2450
|
-
setStrokeStyle(t) {
|
|
2451
|
-
return this._strokeStyle = tr(t, e.defaultStrokeStyle), this;
|
|
2452
|
-
}
|
|
2453
|
-
texture(e, t, n, r, i, a) {
|
|
2454
|
-
return this.instructions.push({
|
|
2455
|
-
action: "texture",
|
|
2456
|
-
data: {
|
|
2457
|
-
image: e,
|
|
2458
|
-
dx: n || 0,
|
|
2459
|
-
dy: r || 0,
|
|
2460
|
-
dw: i || e.frame.width,
|
|
2461
|
-
dh: a || e.frame.height,
|
|
2462
|
-
transform: this._transform.clone(),
|
|
2463
|
-
alpha: this._fillStyle.alpha,
|
|
2464
|
-
style: t || t === 0 ? C.shared.setValue(t).toNumber() : 16777215
|
|
2465
|
-
}
|
|
2466
|
-
}), this.onUpdate(), this;
|
|
2467
|
-
}
|
|
2468
|
-
beginPath() {
|
|
2469
|
-
return this._activePath = new X(), this;
|
|
2470
|
-
}
|
|
2471
|
-
fill(t, n) {
|
|
2472
|
-
let r, i = this.instructions[this.instructions.length - 1];
|
|
2473
|
-
return r = this._tick === 0 && i?.action === "stroke" ? i.data.path : this._activePath.clone(), r ? (t != null && (n !== void 0 && typeof t == "number" && (x(o, "GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"), t = {
|
|
2474
|
-
color: t,
|
|
2475
|
-
alpha: n
|
|
2476
|
-
}), this._fillStyle = tr(t, e.defaultFillStyle)), this.instructions.push({
|
|
2477
|
-
action: "fill",
|
|
2478
|
-
data: {
|
|
2479
|
-
style: this.fillStyle,
|
|
2480
|
-
path: r
|
|
2481
|
-
}
|
|
2482
|
-
}), this.onUpdate(), this._initNextPathLocation(), this._tick = 0, this) : this;
|
|
2483
|
-
}
|
|
2484
|
-
_initNextPathLocation() {
|
|
2485
|
-
let { x: e, y: n } = this._activePath.getLastPoint(t.shared);
|
|
2486
|
-
this._activePath.clear(), this._activePath.moveTo(e, n);
|
|
2487
|
-
}
|
|
2488
|
-
stroke(t) {
|
|
2489
|
-
let n, r = this.instructions[this.instructions.length - 1];
|
|
2490
|
-
return n = this._tick === 0 && r?.action === "fill" ? r.data.path : this._activePath.clone(), n ? (t != null && (this._strokeStyle = nr(t, e.defaultStrokeStyle)), this.instructions.push({
|
|
2491
|
-
action: "stroke",
|
|
2492
|
-
data: {
|
|
2493
|
-
style: this.strokeStyle,
|
|
2494
|
-
path: n
|
|
2495
|
-
}
|
|
2496
|
-
}), this.onUpdate(), this._initNextPathLocation(), this._tick = 0, this) : this;
|
|
2497
|
-
}
|
|
2498
|
-
cut() {
|
|
2499
|
-
for (let e = 0; e < 2; e++) {
|
|
2500
|
-
let t = this.instructions[this.instructions.length - 1 - e], n = this._activePath.clone();
|
|
2501
|
-
if (t && (t.action === "stroke" || t.action === "fill")) {
|
|
2502
|
-
if (t.data.hole) t.data.hole.addPath(n);
|
|
2503
|
-
else {
|
|
2504
|
-
t.data.hole = n;
|
|
2505
|
-
break;
|
|
2506
|
-
}
|
|
2507
|
-
}
|
|
2508
|
-
}
|
|
2509
|
-
return this._initNextPathLocation(), this;
|
|
2510
|
-
}
|
|
2511
|
-
arc(e, t, n, r, i, a) {
|
|
2512
|
-
this._tick++;
|
|
2513
|
-
let o = this._transform;
|
|
2514
|
-
return this._activePath.arc(o.a * e + o.c * t + o.tx, o.b * e + o.d * t + o.ty, n, r, i, a), this;
|
|
2515
|
-
}
|
|
2516
|
-
arcTo(e, t, n, r, i) {
|
|
2517
|
-
this._tick++;
|
|
2518
|
-
let a = this._transform;
|
|
2519
|
-
return this._activePath.arcTo(a.a * e + a.c * t + a.tx, a.b * e + a.d * t + a.ty, a.a * n + a.c * r + a.tx, a.b * n + a.d * r + a.ty, i), this;
|
|
2520
|
-
}
|
|
2521
|
-
arcToSvg(e, t, n, r, i, a, o) {
|
|
2522
|
-
this._tick++;
|
|
2523
|
-
let s = this._transform;
|
|
2524
|
-
return this._activePath.arcToSvg(e, t, n, r, i, s.a * a + s.c * o + s.tx, s.b * a + s.d * o + s.ty), this;
|
|
2525
|
-
}
|
|
2526
|
-
bezierCurveTo(e, t, n, r, i, a, o) {
|
|
2527
|
-
this._tick++;
|
|
2528
|
-
let s = this._transform;
|
|
2529
|
-
return this._activePath.bezierCurveTo(s.a * e + s.c * t + s.tx, s.b * e + s.d * t + s.ty, s.a * n + s.c * r + s.tx, s.b * n + s.d * r + s.ty, s.a * i + s.c * a + s.tx, s.b * i + s.d * a + s.ty, o), this;
|
|
2530
|
-
}
|
|
2531
|
-
closePath() {
|
|
2532
|
-
return this._tick++, this._activePath?.closePath(), this;
|
|
2533
|
-
}
|
|
2534
|
-
ellipse(e, t, n, r) {
|
|
2535
|
-
return this._tick++, this._activePath.ellipse(e, t, n, r, this._transform.clone()), this;
|
|
2536
|
-
}
|
|
2537
|
-
circle(e, t, n) {
|
|
2538
|
-
return this._tick++, this._activePath.circle(e, t, n, this._transform.clone()), this;
|
|
2539
|
-
}
|
|
2540
|
-
path(e) {
|
|
2541
|
-
return this._tick++, this._activePath.addPath(e, this._transform.clone()), this;
|
|
2542
|
-
}
|
|
2543
|
-
lineTo(e, t) {
|
|
2544
|
-
this._tick++;
|
|
2545
|
-
let n = this._transform;
|
|
2546
|
-
return this._activePath.lineTo(n.a * e + n.c * t + n.tx, n.b * e + n.d * t + n.ty), this;
|
|
2547
|
-
}
|
|
2548
|
-
moveTo(e, t) {
|
|
2549
|
-
this._tick++;
|
|
2550
|
-
let n = this._transform, r = this._activePath.instructions, i = n.a * e + n.c * t + n.tx, a = n.b * e + n.d * t + n.ty;
|
|
2551
|
-
return r.length === 1 && r[0].action === "moveTo" ? (r[0].data[0] = i, r[0].data[1] = a, this) : (this._activePath.moveTo(i, a), this);
|
|
2552
|
-
}
|
|
2553
|
-
quadraticCurveTo(e, t, n, r, i) {
|
|
2554
|
-
this._tick++;
|
|
2555
|
-
let a = this._transform;
|
|
2556
|
-
return this._activePath.quadraticCurveTo(a.a * e + a.c * t + a.tx, a.b * e + a.d * t + a.ty, a.a * n + a.c * r + a.tx, a.b * n + a.d * r + a.ty, i), this;
|
|
2557
|
-
}
|
|
2558
|
-
rect(e, t, n, r) {
|
|
2559
|
-
return this._tick++, this._activePath.rect(e, t, n, r, this._transform.clone()), this;
|
|
2560
|
-
}
|
|
2561
|
-
roundRect(e, t, n, r, i) {
|
|
2562
|
-
return this._tick++, this._activePath.roundRect(e, t, n, r, i, this._transform.clone()), this;
|
|
2563
|
-
}
|
|
2564
|
-
poly(e, t) {
|
|
2565
|
-
return this._tick++, this._activePath.poly(e, t, this._transform.clone()), this;
|
|
2566
|
-
}
|
|
2567
|
-
regularPoly(e, t, n, r, i = 0, a) {
|
|
2568
|
-
return this._tick++, this._activePath.regularPoly(e, t, n, r, i, a), this;
|
|
2569
|
-
}
|
|
2570
|
-
roundPoly(e, t, n, r, i, a) {
|
|
2571
|
-
return this._tick++, this._activePath.roundPoly(e, t, n, r, i, a), this;
|
|
2572
|
-
}
|
|
2573
|
-
roundShape(e, t, n, r) {
|
|
2574
|
-
return this._tick++, this._activePath.roundShape(e, t, n, r), this;
|
|
2575
|
-
}
|
|
2576
|
-
filletRect(e, t, n, r, i) {
|
|
2577
|
-
return this._tick++, this._activePath.filletRect(e, t, n, r, i), this;
|
|
2578
|
-
}
|
|
2579
|
-
chamferRect(e, t, n, r, i, a) {
|
|
2580
|
-
return this._tick++, this._activePath.chamferRect(e, t, n, r, i, a), this;
|
|
2581
|
-
}
|
|
2582
|
-
star(e, t, n, r, i = 0, a = 0) {
|
|
2583
|
-
return this._tick++, this._activePath.star(e, t, n, r, i, a, this._transform.clone()), this;
|
|
2584
|
-
}
|
|
2585
|
-
svg(e) {
|
|
2586
|
-
return this._tick++, Wn(e, this), this;
|
|
2587
|
-
}
|
|
2588
|
-
restore() {
|
|
2589
|
-
let e = this._stateStack.pop();
|
|
2590
|
-
return e && (this._transform = e.transform, this._fillStyle = e.fillStyle, this._strokeStyle = e.strokeStyle), this;
|
|
2591
|
-
}
|
|
2592
|
-
save() {
|
|
2593
|
-
return this._stateStack.push({
|
|
2594
|
-
transform: this._transform.clone(),
|
|
2595
|
-
fillStyle: { ...this._fillStyle },
|
|
2596
|
-
strokeStyle: { ...this._strokeStyle }
|
|
2597
|
-
}), this;
|
|
2598
|
-
}
|
|
2599
|
-
getTransform() {
|
|
2600
|
-
return this._transform;
|
|
2601
|
-
}
|
|
2602
|
-
resetTransform() {
|
|
2603
|
-
return this._transform.identity(), this;
|
|
2604
|
-
}
|
|
2605
|
-
rotate(e) {
|
|
2606
|
-
return this._transform.rotate(e), this;
|
|
2607
|
-
}
|
|
2608
|
-
scale(e, t = e) {
|
|
2609
|
-
return this._transform.scale(e, t), this;
|
|
2610
|
-
}
|
|
2611
|
-
setTransform(e, t, n, r, i, a) {
|
|
2612
|
-
return e instanceof u ? (this._transform.set(e.a, e.b, e.c, e.d, e.tx, e.ty), this) : (this._transform.set(e, t, n, r, i, a), this);
|
|
2613
|
-
}
|
|
2614
|
-
transform(e, t, n, r, i, a) {
|
|
2615
|
-
return e instanceof u ? (this._transform.append(e), this) : (ar.set(e, t, n, r, i, a), this._transform.append(ar), this);
|
|
2616
|
-
}
|
|
2617
|
-
translate(e, t = e) {
|
|
2618
|
-
return this._transform.translate(e, t), this;
|
|
2619
|
-
}
|
|
2620
|
-
clear() {
|
|
2621
|
-
return this._activePath.clear(), this.instructions.length = 0, this.resetTransform(), this.onUpdate(), this;
|
|
2622
|
-
}
|
|
2623
|
-
onUpdate() {
|
|
2624
|
-
this._boundsDirty = !0, this.dirty = !0, this.emit("update", this, 16);
|
|
2625
|
-
}
|
|
2626
|
-
get bounds() {
|
|
2627
|
-
if (!this._boundsDirty) return this._bounds;
|
|
2628
|
-
this._boundsDirty = !1;
|
|
2629
|
-
let e = this._bounds;
|
|
2630
|
-
e.clear();
|
|
2631
|
-
for (let t = 0; t < this.instructions.length; t++) {
|
|
2632
|
-
let n = this.instructions[t], r = n.action;
|
|
2633
|
-
if (r === "fill") {
|
|
2634
|
-
let t = n.data;
|
|
2635
|
-
e.addBounds(t.path.bounds);
|
|
2636
|
-
} else if (r === "texture") {
|
|
2637
|
-
let t = n.data;
|
|
2638
|
-
e.addFrame(t.dx, t.dy, t.dx + t.dw, t.dy + t.dh, t.transform);
|
|
2639
|
-
}
|
|
2640
|
-
if (r === "stroke") {
|
|
2641
|
-
let t = n.data, r = t.style.alignment, i = t.style.width * (1 - r);
|
|
2642
|
-
t.style.join === "miter" && (i *= rr(t.path, t.style.miterLimit));
|
|
2643
|
-
let a = t.path.bounds;
|
|
2644
|
-
e.addFrame(a.minX - i, a.minY - i, a.maxX + i, a.maxY + i);
|
|
2645
|
-
}
|
|
2646
|
-
}
|
|
2647
|
-
return e.isValid || e.set(0, 0, 0, 0), e;
|
|
2648
|
-
}
|
|
2649
|
-
containsPoint(e) {
|
|
2650
|
-
if (!this.bounds.containsPoint(e.x, e.y)) return !1;
|
|
2651
|
-
let t = this.instructions, n = !1;
|
|
2652
|
-
for (let r = 0; r < t.length; r++) {
|
|
2653
|
-
let i = t[r], a = i.data, o = a.path;
|
|
2654
|
-
if (!i.action || !o) continue;
|
|
2655
|
-
let s = a.style, c = o.shapePath.shapePrimitives;
|
|
2656
|
-
for (let t = 0; t < c.length; t++) {
|
|
2657
|
-
let r = c[t].shape;
|
|
2658
|
-
if (!s || !r) continue;
|
|
2659
|
-
let o = c[t].transform, l = o ? o.applyInverse(e, ir) : e;
|
|
2660
|
-
if (i.action === "fill") n = r.contains(l.x, l.y);
|
|
2661
|
-
else {
|
|
2662
|
-
let e = s;
|
|
2663
|
-
n = r.strokeContains(l.x, l.y, e.width, e.alignment);
|
|
2664
|
-
}
|
|
2665
|
-
let u = a.hole;
|
|
2666
|
-
if (u) {
|
|
2667
|
-
let e = u.shapePath?.shapePrimitives;
|
|
2668
|
-
if (e) for (let t = 0; t < e.length; t++) e[t].shape.contains(l.x, l.y) && (n = !1);
|
|
2669
|
-
}
|
|
2670
|
-
if (n) return !0;
|
|
2671
|
-
}
|
|
2672
|
-
}
|
|
2673
|
-
return n;
|
|
2674
|
-
}
|
|
2675
|
-
unload() {
|
|
2676
|
-
this.emit("unload", this);
|
|
2677
|
-
for (let e in this._gpuData) this._gpuData[e]?.destroy();
|
|
2678
|
-
this._gpuData = /* @__PURE__ */ Object.create(null);
|
|
2679
|
-
}
|
|
2680
|
-
destroy(e = !1) {
|
|
2681
|
-
if (!this.destroyed) {
|
|
2682
|
-
if (this.destroyed = !0, this._stateStack.length = 0, this._transform = null, this.unload(), this.emit("destroy", this), this.removeAllListeners(), typeof e == "boolean" ? e : e?.texture) {
|
|
2683
|
-
let t = typeof e == "boolean" ? e : e?.textureSource;
|
|
2684
|
-
this._fillStyle.texture && (this._fillStyle.fill && "uid" in this._fillStyle.fill ? this._fillStyle.fill.destroy() : this._fillStyle.texture.destroy(t)), this._strokeStyle.texture && (this._strokeStyle.fill && "uid" in this._strokeStyle.fill ? this._strokeStyle.fill.destroy() : this._strokeStyle.texture.destroy(t));
|
|
2685
|
-
}
|
|
2686
|
-
this._fillStyle = null, this._strokeStyle = null, this.instructions = null, this._activePath = null, this._bounds = null, this._stateStack = null, this.customShader = null, this._transform = null;
|
|
2687
|
-
}
|
|
2688
|
-
}
|
|
2689
|
-
};
|
|
2690
|
-
or.defaultFillStyle = {
|
|
2691
|
-
color: 16777215,
|
|
2692
|
-
alpha: 1,
|
|
2693
|
-
texture: T.WHITE,
|
|
2694
|
-
matrix: null,
|
|
2695
|
-
fill: null,
|
|
2696
|
-
textureSpace: "local"
|
|
2697
|
-
}, or.defaultStrokeStyle = {
|
|
2698
|
-
width: 1,
|
|
2699
|
-
color: 16777215,
|
|
2700
|
-
alpha: 1,
|
|
2701
|
-
alignment: .5,
|
|
2702
|
-
miterLimit: 10,
|
|
2703
|
-
cap: "butt",
|
|
2704
|
-
join: "miter",
|
|
2705
|
-
texture: T.WHITE,
|
|
2706
|
-
matrix: null,
|
|
2707
|
-
fill: null,
|
|
2708
|
-
textureSpace: "local",
|
|
2709
|
-
pixelLine: !1
|
|
2710
|
-
};
|
|
2711
|
-
var sr = or, cr = class {
|
|
2712
|
-
constructor() {
|
|
2713
|
-
this.isBatchable = !1;
|
|
2714
|
-
}
|
|
2715
|
-
reset() {
|
|
2716
|
-
this.isBatchable = !1, this.context = null, this.graphicsData &&= (this.graphicsData.destroy(), null);
|
|
2717
|
-
}
|
|
2718
|
-
destroy() {
|
|
2719
|
-
this.reset();
|
|
2720
|
-
}
|
|
2721
|
-
}, lr = class {
|
|
2722
|
-
constructor() {
|
|
2723
|
-
this.instructions = new c();
|
|
2724
|
-
}
|
|
2725
|
-
init() {
|
|
2726
|
-
this.instructions.reset();
|
|
2727
|
-
}
|
|
2728
|
-
destroy() {
|
|
2729
|
-
this.instructions.destroy(), this.instructions = null;
|
|
2730
|
-
}
|
|
2731
|
-
}, ur = class e {
|
|
2732
|
-
constructor(e) {
|
|
2733
|
-
this._renderer = e, this._managedContexts = new j({
|
|
2734
|
-
renderer: e,
|
|
2735
|
-
type: "resource",
|
|
2736
|
-
name: "graphicsContext"
|
|
2737
|
-
});
|
|
2738
|
-
}
|
|
2739
|
-
init(t) {
|
|
2740
|
-
e.defaultOptions.bezierSmoothness = t?.bezierSmoothness ?? e.defaultOptions.bezierSmoothness;
|
|
2741
|
-
}
|
|
2742
|
-
getContextRenderData(e) {
|
|
2743
|
-
return this.getGpuContext(e).graphicsData || this._initContextRenderData(e);
|
|
2744
|
-
}
|
|
2745
|
-
updateGpuContext(e) {
|
|
2746
|
-
let t = e._gpuData, n = !!t[this._renderer.uid], r = t[this._renderer.uid] || this._initContext(e);
|
|
2747
|
-
return (e.dirty || !n) && (n && r.reset(), r.isBatchable = !1, e.dirty = !1), r;
|
|
2748
|
-
}
|
|
2749
|
-
getGpuContext(e) {
|
|
2750
|
-
return e._gpuData[this._renderer.uid] || this._initContext(e);
|
|
2751
|
-
}
|
|
2752
|
-
_initContextRenderData(e) {
|
|
2753
|
-
let t = new lr(), n = this.getGpuContext(e);
|
|
2754
|
-
return n.graphicsData = t, t.init(), t;
|
|
2755
|
-
}
|
|
2756
|
-
_initContext(e) {
|
|
2757
|
-
let t = new cr();
|
|
2758
|
-
return t.context = e, e._gpuData[this._renderer.uid] = t, this._managedContexts.add(e), t;
|
|
2759
|
-
}
|
|
2760
|
-
destroy() {
|
|
2761
|
-
this._managedContexts.destroy(), this._renderer = null;
|
|
2762
|
-
}
|
|
2763
|
-
};
|
|
2764
|
-
ur.extension = {
|
|
2765
|
-
type: [S.CanvasSystem],
|
|
2766
|
-
name: "graphicsContext"
|
|
2767
|
-
}, ur.defaultOptions = { bezierSmoothness: .5 };
|
|
2768
|
-
var dr = ur, fr = class {
|
|
2769
|
-
constructor(e, t) {
|
|
2770
|
-
this.state = g.for2d(), this.renderer = e, this._adaptor = t, this.renderer.runners.contextChange.add(this), this._managedGraphics = new j({
|
|
2771
|
-
renderer: e,
|
|
2772
|
-
type: "renderable",
|
|
2773
|
-
priority: -1,
|
|
2774
|
-
name: "graphics"
|
|
2775
|
-
});
|
|
2776
|
-
}
|
|
2777
|
-
contextChange() {
|
|
2778
|
-
this._adaptor.contextChange(this.renderer);
|
|
2779
|
-
}
|
|
2780
|
-
validateRenderable(e) {
|
|
2781
|
-
return !1;
|
|
2782
|
-
}
|
|
2783
|
-
addRenderable(e, t) {
|
|
2784
|
-
this._managedGraphics.add(e), this.renderer.renderPipes.batch.break(t), t.add(e);
|
|
2785
|
-
}
|
|
2786
|
-
updateRenderable(e) {}
|
|
2787
|
-
execute(e) {
|
|
2788
|
-
e.isRenderable && this._adaptor.execute(this, e);
|
|
2789
|
-
}
|
|
2790
|
-
destroy() {
|
|
2791
|
-
this._managedGraphics.destroy(), this.renderer = null, this._adaptor.destroy(), this._adaptor = null;
|
|
2792
|
-
}
|
|
2793
|
-
};
|
|
2794
|
-
fr.extension = {
|
|
2795
|
-
type: [S.CanvasPipes],
|
|
2796
|
-
name: "graphics"
|
|
2797
|
-
};
|
|
2798
|
-
//#endregion
|
|
2799
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/GraphicsPipe.mjs
|
|
2800
|
-
var pr = class {
|
|
2801
|
-
constructor() {
|
|
2802
|
-
this.batches = [], this.batched = !1;
|
|
2803
|
-
}
|
|
2804
|
-
destroy() {
|
|
2805
|
-
this.batches.forEach((e) => {
|
|
2806
|
-
f.return(e);
|
|
2807
|
-
}), this.batches.length = 0;
|
|
2808
|
-
}
|
|
2809
|
-
}, mr = class {
|
|
2810
|
-
constructor(e, t) {
|
|
2811
|
-
this.state = g.for2d(), this.renderer = e, this._adaptor = t, this.renderer.runners.contextChange.add(this), this._managedGraphics = new j({
|
|
2812
|
-
renderer: e,
|
|
2813
|
-
type: "renderable",
|
|
2814
|
-
priority: -1,
|
|
2815
|
-
name: "graphics"
|
|
2816
|
-
});
|
|
2817
|
-
}
|
|
2818
|
-
contextChange() {
|
|
2819
|
-
this._adaptor.contextChange(this.renderer);
|
|
2820
|
-
}
|
|
2821
|
-
validateRenderable(e) {
|
|
2822
|
-
let t = e.context, n = !!e._gpuData, r = this.renderer.graphicsContext.updateGpuContext(t);
|
|
2823
|
-
return !!(r.isBatchable || n !== r.isBatchable);
|
|
2824
|
-
}
|
|
2825
|
-
addRenderable(e, t) {
|
|
2826
|
-
let n = this.renderer.graphicsContext.updateGpuContext(e.context);
|
|
2827
|
-
e.didViewUpdate && this._rebuild(e), n.isBatchable ? this._addToBatcher(e, t) : (this.renderer.renderPipes.batch.break(t), t.add(e));
|
|
2828
|
-
}
|
|
2829
|
-
updateRenderable(e) {
|
|
2830
|
-
let t = this._getGpuDataForRenderable(e).batches;
|
|
2831
|
-
for (let e = 0; e < t.length; e++) {
|
|
2832
|
-
let n = t[e];
|
|
2833
|
-
n._batcher.updateElement(n);
|
|
2834
|
-
}
|
|
2835
|
-
}
|
|
2836
|
-
execute(e) {
|
|
2837
|
-
if (!e.isRenderable) return;
|
|
2838
|
-
let t = this.renderer, n = e.context;
|
|
2839
|
-
if (!t.graphicsContext.getGpuContext(n).batches.length) return;
|
|
2840
|
-
let r = n.customShader || this._adaptor.shader;
|
|
2841
|
-
this.state.blendMode = e.groupBlendMode;
|
|
2842
|
-
let i = r.resources.localUniforms.uniforms;
|
|
2843
|
-
i.uTransformMatrix = e.groupTransform, i.uRound = t._roundPixels | e._roundPixels, ne(e.groupColorAlpha, i.uColor, 0), this._adaptor.execute(this, e);
|
|
2844
|
-
}
|
|
2845
|
-
_rebuild(e) {
|
|
2846
|
-
let t = this._getGpuDataForRenderable(e), n = this.renderer.graphicsContext.updateGpuContext(e.context);
|
|
2847
|
-
t.destroy(), n.isBatchable && this._updateBatchesForRenderable(e, t);
|
|
2848
|
-
}
|
|
2849
|
-
_addToBatcher(e, t) {
|
|
2850
|
-
let n = this.renderer.renderPipes.batch, r = this._getGpuDataForRenderable(e).batches;
|
|
2851
|
-
for (let e = 0; e < r.length; e++) {
|
|
2852
|
-
let i = r[e];
|
|
2853
|
-
n.addToBatch(i, t);
|
|
2854
|
-
}
|
|
2855
|
-
}
|
|
2856
|
-
_getGpuDataForRenderable(e) {
|
|
2857
|
-
return e._gpuData[this.renderer.uid] || this._initGpuDataForRenderable(e);
|
|
2858
|
-
}
|
|
2859
|
-
_initGpuDataForRenderable(e) {
|
|
2860
|
-
let t = new pr();
|
|
2861
|
-
return e._gpuData[this.renderer.uid] = t, this._managedGraphics.add(e), t;
|
|
2862
|
-
}
|
|
2863
|
-
_updateBatchesForRenderable(e, t) {
|
|
2864
|
-
let n = e.context, r = this.renderer.graphicsContext.getGpuContext(n), i = this.renderer._roundPixels | e._roundPixels;
|
|
2865
|
-
t.batches = r.batches.map((t) => {
|
|
2866
|
-
let n = f.get(Te);
|
|
2867
|
-
return t.copyTo(n), n.renderable = e, n.roundPixels = i, n;
|
|
2868
|
-
});
|
|
2869
|
-
}
|
|
2870
|
-
destroy() {
|
|
2871
|
-
this._managedGraphics.destroy(), this.renderer = null, this._adaptor.destroy(), this._adaptor = null, this.state = null;
|
|
2872
|
-
}
|
|
2873
|
-
};
|
|
2874
|
-
mr.extension = {
|
|
2875
|
-
type: [S.WebGLPipes, S.WebGPUPipes],
|
|
2876
|
-
name: "graphics"
|
|
2877
|
-
}, y.add(fr), y.add(mr), y.add(dr), y.add(sn);
|
|
2878
|
-
//#endregion
|
|
2879
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/Graphics.mjs
|
|
2880
|
-
var hr = class e extends w {
|
|
2881
|
-
constructor(e) {
|
|
2882
|
-
e instanceof sr && (e = { context: e });
|
|
2883
|
-
let { context: t, roundPixels: n, ...r } = e || {};
|
|
2884
|
-
super({
|
|
2885
|
-
label: "Graphics",
|
|
2886
|
-
...r
|
|
2887
|
-
}), this.renderPipeId = "graphics", t ? this.context = t : (this.context = this._ownedContext = new sr(), this.context.autoGarbageCollect = this.autoGarbageCollect), this.didViewUpdate = !0, this.allowChildren = !1, this.roundPixels = n ?? !1;
|
|
2888
|
-
}
|
|
2889
|
-
set context(e) {
|
|
2890
|
-
e !== this._context && (this._context && (this._context.off("update", this.onViewUpdate, this), this._context.off("unload", this.unload, this)), this._context = e, this._context.on("update", this.onViewUpdate, this), this._context.on("unload", this.unload, this), this.onViewUpdate());
|
|
2891
|
-
}
|
|
2892
|
-
get context() {
|
|
2893
|
-
return this._context;
|
|
2894
|
-
}
|
|
2895
|
-
get bounds() {
|
|
2896
|
-
return this._context.bounds;
|
|
2897
|
-
}
|
|
2898
|
-
updateBounds() {}
|
|
2899
|
-
containsPoint(e) {
|
|
2900
|
-
return this._context.containsPoint(e);
|
|
2901
|
-
}
|
|
2902
|
-
destroy(e) {
|
|
2903
|
-
this._ownedContext && !e ? this._ownedContext.destroy(e) : (e === !0 || e?.context === !0) && this._context.destroy(e), this._ownedContext = null, this._context = null, super.destroy(e);
|
|
2904
|
-
}
|
|
2905
|
-
_onTouch(e) {
|
|
2906
|
-
this._gcLastUsed = e, this._context._gcLastUsed = e;
|
|
2907
|
-
}
|
|
2908
|
-
_callContextMethod(e, t) {
|
|
2909
|
-
return this.context[e](...t), this;
|
|
2910
|
-
}
|
|
2911
|
-
setFillStyle(...e) {
|
|
2912
|
-
return this._callContextMethod("setFillStyle", e);
|
|
2913
|
-
}
|
|
2914
|
-
setStrokeStyle(...e) {
|
|
2915
|
-
return this._callContextMethod("setStrokeStyle", e);
|
|
2916
|
-
}
|
|
2917
|
-
fill(...e) {
|
|
2918
|
-
return this._callContextMethod("fill", e);
|
|
2919
|
-
}
|
|
2920
|
-
stroke(...e) {
|
|
2921
|
-
return this._callContextMethod("stroke", e);
|
|
2922
|
-
}
|
|
2923
|
-
texture(...e) {
|
|
2924
|
-
return this._callContextMethod("texture", e);
|
|
2925
|
-
}
|
|
2926
|
-
beginPath() {
|
|
2927
|
-
return this._callContextMethod("beginPath", []);
|
|
2928
|
-
}
|
|
2929
|
-
cut() {
|
|
2930
|
-
return this._callContextMethod("cut", []);
|
|
2931
|
-
}
|
|
2932
|
-
arc(...e) {
|
|
2933
|
-
return this._callContextMethod("arc", e);
|
|
2934
|
-
}
|
|
2935
|
-
arcTo(...e) {
|
|
2936
|
-
return this._callContextMethod("arcTo", e);
|
|
2937
|
-
}
|
|
2938
|
-
arcToSvg(...e) {
|
|
2939
|
-
return this._callContextMethod("arcToSvg", e);
|
|
2940
|
-
}
|
|
2941
|
-
bezierCurveTo(...e) {
|
|
2942
|
-
return this._callContextMethod("bezierCurveTo", e);
|
|
2943
|
-
}
|
|
2944
|
-
closePath() {
|
|
2945
|
-
return this._callContextMethod("closePath", []);
|
|
2946
|
-
}
|
|
2947
|
-
ellipse(...e) {
|
|
2948
|
-
return this._callContextMethod("ellipse", e);
|
|
2949
|
-
}
|
|
2950
|
-
circle(...e) {
|
|
2951
|
-
return this._callContextMethod("circle", e);
|
|
2952
|
-
}
|
|
2953
|
-
path(...e) {
|
|
2954
|
-
return this._callContextMethod("path", e);
|
|
2955
|
-
}
|
|
2956
|
-
lineTo(...e) {
|
|
2957
|
-
return this._callContextMethod("lineTo", e);
|
|
2958
|
-
}
|
|
2959
|
-
moveTo(...e) {
|
|
2960
|
-
return this._callContextMethod("moveTo", e);
|
|
2961
|
-
}
|
|
2962
|
-
quadraticCurveTo(...e) {
|
|
2963
|
-
return this._callContextMethod("quadraticCurveTo", e);
|
|
2964
|
-
}
|
|
2965
|
-
rect(...e) {
|
|
2966
|
-
return this._callContextMethod("rect", e);
|
|
2967
|
-
}
|
|
2968
|
-
roundRect(...e) {
|
|
2969
|
-
return this._callContextMethod("roundRect", e);
|
|
2970
|
-
}
|
|
2971
|
-
poly(...e) {
|
|
2972
|
-
return this._callContextMethod("poly", e);
|
|
2973
|
-
}
|
|
2974
|
-
regularPoly(...e) {
|
|
2975
|
-
return this._callContextMethod("regularPoly", e);
|
|
2976
|
-
}
|
|
2977
|
-
roundPoly(...e) {
|
|
2978
|
-
return this._callContextMethod("roundPoly", e);
|
|
2979
|
-
}
|
|
2980
|
-
roundShape(...e) {
|
|
2981
|
-
return this._callContextMethod("roundShape", e);
|
|
2982
|
-
}
|
|
2983
|
-
filletRect(...e) {
|
|
2984
|
-
return this._callContextMethod("filletRect", e);
|
|
2985
|
-
}
|
|
2986
|
-
chamferRect(...e) {
|
|
2987
|
-
return this._callContextMethod("chamferRect", e);
|
|
2988
|
-
}
|
|
2989
|
-
star(...e) {
|
|
2990
|
-
return this._callContextMethod("star", e);
|
|
2991
|
-
}
|
|
2992
|
-
svg(...e) {
|
|
2993
|
-
return this._callContextMethod("svg", e);
|
|
2994
|
-
}
|
|
2995
|
-
restore(...e) {
|
|
2996
|
-
return this._callContextMethod("restore", e);
|
|
2997
|
-
}
|
|
2998
|
-
save() {
|
|
2999
|
-
return this._callContextMethod("save", []);
|
|
3000
|
-
}
|
|
3001
|
-
getTransform() {
|
|
3002
|
-
return this.context.getTransform();
|
|
3003
|
-
}
|
|
3004
|
-
resetTransform() {
|
|
3005
|
-
return this._callContextMethod("resetTransform", []);
|
|
3006
|
-
}
|
|
3007
|
-
rotateTransform(...e) {
|
|
3008
|
-
return this._callContextMethod("rotate", e);
|
|
3009
|
-
}
|
|
3010
|
-
scaleTransform(...e) {
|
|
3011
|
-
return this._callContextMethod("scale", e);
|
|
3012
|
-
}
|
|
3013
|
-
setTransform(...e) {
|
|
3014
|
-
return this._callContextMethod("setTransform", e);
|
|
3015
|
-
}
|
|
3016
|
-
transform(...e) {
|
|
3017
|
-
return this._callContextMethod("transform", e);
|
|
3018
|
-
}
|
|
3019
|
-
translateTransform(...e) {
|
|
3020
|
-
return this._callContextMethod("translate", e);
|
|
3021
|
-
}
|
|
3022
|
-
clear() {
|
|
3023
|
-
return this._callContextMethod("clear", []);
|
|
3024
|
-
}
|
|
3025
|
-
get fillStyle() {
|
|
3026
|
-
return this._context.fillStyle;
|
|
3027
|
-
}
|
|
3028
|
-
set fillStyle(e) {
|
|
3029
|
-
this._context.fillStyle = e;
|
|
3030
|
-
}
|
|
3031
|
-
get strokeStyle() {
|
|
3032
|
-
return this._context.strokeStyle;
|
|
3033
|
-
}
|
|
3034
|
-
set strokeStyle(e) {
|
|
3035
|
-
this._context.strokeStyle = e;
|
|
3036
|
-
}
|
|
3037
|
-
clone(t = !1) {
|
|
3038
|
-
return t ? new e(this._context.clone()) : (this._ownedContext = null, new e(this._context));
|
|
3039
|
-
}
|
|
3040
|
-
lineStyle(e, t, n) {
|
|
3041
|
-
x(o, "Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");
|
|
3042
|
-
let r = {};
|
|
3043
|
-
return e && (r.width = e), t && (r.color = t), n && (r.alpha = n), this.context.strokeStyle = r, this;
|
|
3044
|
-
}
|
|
3045
|
-
beginFill(e, t) {
|
|
3046
|
-
x(o, "Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");
|
|
3047
|
-
let n = {};
|
|
3048
|
-
return e !== void 0 && (n.color = e), t !== void 0 && (n.alpha = t), this.context.fillStyle = n, this;
|
|
3049
|
-
}
|
|
3050
|
-
endFill() {
|
|
3051
|
-
x(o, "Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."), this.context.fill();
|
|
3052
|
-
let e = this.context.strokeStyle;
|
|
3053
|
-
return (e.width !== sr.defaultStrokeStyle.width || e.color !== sr.defaultStrokeStyle.color || e.alpha !== sr.defaultStrokeStyle.alpha) && this.context.stroke(), this;
|
|
3054
|
-
}
|
|
3055
|
-
drawCircle(...e) {
|
|
3056
|
-
return x(o, "Graphics#drawCircle has been renamed to Graphics#circle"), this._callContextMethod("circle", e);
|
|
3057
|
-
}
|
|
3058
|
-
drawEllipse(...e) {
|
|
3059
|
-
return x(o, "Graphics#drawEllipse has been renamed to Graphics#ellipse"), this._callContextMethod("ellipse", e);
|
|
3060
|
-
}
|
|
3061
|
-
drawPolygon(...e) {
|
|
3062
|
-
return x(o, "Graphics#drawPolygon has been renamed to Graphics#poly"), this._callContextMethod("poly", e);
|
|
3063
|
-
}
|
|
3064
|
-
drawRect(...e) {
|
|
3065
|
-
return x(o, "Graphics#drawRect has been renamed to Graphics#rect"), this._callContextMethod("rect", e);
|
|
3066
|
-
}
|
|
3067
|
-
drawRoundedRect(...e) {
|
|
3068
|
-
return x(o, "Graphics#drawRoundedRect has been renamed to Graphics#roundRect"), this._callContextMethod("roundRect", e);
|
|
3069
|
-
}
|
|
3070
|
-
drawStar(...e) {
|
|
3071
|
-
return x(o, "Graphics#drawStar has been renamed to Graphics#star"), this._callContextMethod("star", e);
|
|
3072
|
-
}
|
|
3073
|
-
};
|
|
3074
|
-
//#endregion
|
|
3075
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/mask/stencil/CanvasStencilMaskPipe.mjs
|
|
3076
|
-
function gr(e, t, n, r, i, a) {
|
|
3077
|
-
a = Math.max(0, Math.min(a, Math.min(r, i) / 2)), e.moveTo(t + a, n), e.lineTo(t + r - a, n), e.quadraticCurveTo(t + r, n, t + r, n + a), e.lineTo(t + r, n + i - a), e.quadraticCurveTo(t + r, n + i, t + r - a, n + i), e.lineTo(t + a, n + i), e.quadraticCurveTo(t, n + i, t, n + i - a), e.lineTo(t, n + a), e.quadraticCurveTo(t, n, t + a, n);
|
|
3078
|
-
}
|
|
3079
|
-
function _r(e, t) {
|
|
3080
|
-
switch (t.type) {
|
|
3081
|
-
case "rectangle": {
|
|
3082
|
-
let n = t;
|
|
3083
|
-
e.rect(n.x, n.y, n.width, n.height);
|
|
3084
|
-
break;
|
|
3085
|
-
}
|
|
3086
|
-
case "roundedRectangle": {
|
|
3087
|
-
let n = t;
|
|
3088
|
-
gr(e, n.x, n.y, n.width, n.height, n.radius);
|
|
3089
|
-
break;
|
|
3090
|
-
}
|
|
3091
|
-
case "circle": {
|
|
3092
|
-
let n = t;
|
|
3093
|
-
e.moveTo(n.x + n.radius, n.y), e.arc(n.x, n.y, n.radius, 0, Math.PI * 2);
|
|
3094
|
-
break;
|
|
3095
|
-
}
|
|
3096
|
-
case "ellipse": {
|
|
3097
|
-
let n = t;
|
|
3098
|
-
e.ellipse ? (e.moveTo(n.x + n.halfWidth, n.y), e.ellipse(n.x, n.y, n.halfWidth, n.halfHeight, 0, 0, Math.PI * 2)) : (e.save(), e.translate(n.x, n.y), e.scale(n.halfWidth, n.halfHeight), e.moveTo(1, 0), e.arc(0, 0, 1, 0, Math.PI * 2), e.restore());
|
|
3099
|
-
break;
|
|
3100
|
-
}
|
|
3101
|
-
case "triangle": {
|
|
3102
|
-
let n = t;
|
|
3103
|
-
e.moveTo(n.x, n.y), e.lineTo(n.x2, n.y2), e.lineTo(n.x3, n.y3), e.closePath();
|
|
3104
|
-
break;
|
|
3105
|
-
}
|
|
3106
|
-
default: {
|
|
3107
|
-
let n = t, r = n.points;
|
|
3108
|
-
if (!r?.length) break;
|
|
3109
|
-
e.moveTo(r[0], r[1]);
|
|
3110
|
-
for (let t = 2; t < r.length; t += 2) e.lineTo(r[t], r[t + 1]);
|
|
3111
|
-
n.closePath && e.closePath();
|
|
3112
|
-
break;
|
|
3113
|
-
}
|
|
3114
|
-
}
|
|
3115
|
-
}
|
|
3116
|
-
function vr(e, t, n) {
|
|
3117
|
-
let r = [], i = [], a = [];
|
|
3118
|
-
if (!Y[t.type]?.build(t, r)) return !1;
|
|
3119
|
-
fe(r, n, !1, t.closePath ?? !0, i, a);
|
|
3120
|
-
for (let t = 0; t < a.length; t += 3) {
|
|
3121
|
-
let n = a[t] * 2, r = a[t + 1] * 2, o = a[t + 2] * 2;
|
|
3122
|
-
e.moveTo(i[n], i[n + 1]), e.lineTo(i[r], i[r + 1]), e.lineTo(i[o], i[o + 1]), e.closePath();
|
|
3123
|
-
}
|
|
3124
|
-
return !0;
|
|
3125
|
-
}
|
|
3126
|
-
function yr(e, t) {
|
|
3127
|
-
if (!t?.length) return !1;
|
|
3128
|
-
for (let n = 0; n < t.length; n++) {
|
|
3129
|
-
let r = t[n];
|
|
3130
|
-
if (!r?.shape) continue;
|
|
3131
|
-
let i = r.transform, a = i && !i.isIdentity();
|
|
3132
|
-
a && (e.save(), e.transform(i.a, i.b, i.c, i.d, i.tx, i.ty)), _r(e, r.shape), a && e.restore();
|
|
3133
|
-
}
|
|
3134
|
-
return !0;
|
|
3135
|
-
}
|
|
3136
|
-
var br = class {
|
|
3137
|
-
constructor(e) {
|
|
3138
|
-
this._warnedMaskTypes = /* @__PURE__ */ new Set(), this._canvasMaskStack = [], this._renderer = e;
|
|
3139
|
-
}
|
|
3140
|
-
push(e, t, n) {
|
|
3141
|
-
this._renderer.renderPipes.batch.break(n), n.add({
|
|
3142
|
-
renderPipeId: "stencilMask",
|
|
3143
|
-
action: "pushMaskBegin",
|
|
3144
|
-
mask: e,
|
|
3145
|
-
inverse: t._maskOptions.inverse,
|
|
3146
|
-
canBundle: !1
|
|
3147
|
-
});
|
|
3148
|
-
}
|
|
3149
|
-
pop(e, t, n) {
|
|
3150
|
-
this._renderer.renderPipes.batch.break(n), n.add({
|
|
3151
|
-
renderPipeId: "stencilMask",
|
|
3152
|
-
action: "popMaskEnd",
|
|
3153
|
-
mask: e,
|
|
3154
|
-
inverse: t._maskOptions.inverse,
|
|
3155
|
-
canBundle: !1
|
|
3156
|
-
});
|
|
3157
|
-
}
|
|
3158
|
-
execute(e) {
|
|
3159
|
-
if (e.action !== "pushMaskBegin" && e.action !== "popMaskEnd") return;
|
|
3160
|
-
let t = this._renderer, n = t.canvasContext, r = n?.activeContext;
|
|
3161
|
-
if (!r) return;
|
|
3162
|
-
if (e.action === "popMaskEnd") {
|
|
3163
|
-
this._canvasMaskStack.pop() && r.restore();
|
|
3164
|
-
return;
|
|
3165
|
-
}
|
|
3166
|
-
e.inverse && this._warnOnce("inverse", "CanvasRenderer: inverse masks are not supported on Canvas2D; ignoring inverse flag.");
|
|
3167
|
-
let i = e.mask.mask;
|
|
3168
|
-
if (!(i instanceof hr)) {
|
|
3169
|
-
this._warnOnce("nonGraphics", "CanvasRenderer: only Graphics masks are supported in Canvas2D; skipping mask."), this._canvasMaskStack.push(!1);
|
|
3170
|
-
return;
|
|
3171
|
-
}
|
|
3172
|
-
let a = i, o = a.context?.instructions;
|
|
3173
|
-
if (!o?.length) {
|
|
3174
|
-
this._canvasMaskStack.push(!1);
|
|
3175
|
-
return;
|
|
3176
|
-
}
|
|
3177
|
-
r.save(), n.setContextTransform(a.groupTransform, (t._roundPixels | a._roundPixels) === 1), r.beginPath();
|
|
3178
|
-
let s = !1, c = !1;
|
|
3179
|
-
for (let e = 0; e < o.length; e++) {
|
|
3180
|
-
let t = o[e], n = t.action;
|
|
3181
|
-
if (n !== "fill" && n !== "stroke") continue;
|
|
3182
|
-
let i = t.data, a = i?.path?.shapePath;
|
|
3183
|
-
if (!a?.shapePrimitives?.length) continue;
|
|
3184
|
-
let l = n === "stroke", u = a.shapePrimitives;
|
|
3185
|
-
for (let e = 0; e < u.length; e++) {
|
|
3186
|
-
let t = u[e];
|
|
3187
|
-
if (!t?.shape) continue;
|
|
3188
|
-
let n = t.transform, a = n && !n.isIdentity();
|
|
3189
|
-
a && (r.save(), r.transform(n.a, n.b, n.c, n.d, n.tx, n.ty)), l && i.style ? s = vr(r, t.shape, i.style) || s : (_r(r, t.shape), c = yr(r, t.holes) || c, s = !0), a && r.restore();
|
|
3190
|
-
}
|
|
3191
|
-
}
|
|
3192
|
-
if (!s) {
|
|
3193
|
-
r.restore(), this._canvasMaskStack.push(!1);
|
|
3194
|
-
return;
|
|
3195
|
-
}
|
|
3196
|
-
c ? r.clip("evenodd") : r.clip(), this._canvasMaskStack.push(!0);
|
|
3197
|
-
}
|
|
3198
|
-
destroy() {
|
|
3199
|
-
this._renderer = null, this._warnedMaskTypes = null, this._canvasMaskStack = null;
|
|
3200
|
-
}
|
|
3201
|
-
_warnOnce(e, t) {
|
|
3202
|
-
this._warnedMaskTypes.has(e) || (this._warnedMaskTypes.add(e), s(t));
|
|
3203
|
-
}
|
|
3204
|
-
};
|
|
3205
|
-
br.extension = {
|
|
3206
|
-
type: [S.CanvasPipes],
|
|
3207
|
-
name: "stencilMask"
|
|
3208
|
-
};
|
|
3209
|
-
//#endregion
|
|
3210
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/canvas/utils/mapCanvasBlendModesToPixi.mjs
|
|
3211
|
-
var $ = "source-over";
|
|
3212
|
-
function xr() {
|
|
3213
|
-
let e = E(), t = /* @__PURE__ */ Object.create(null);
|
|
3214
|
-
return t.inherit = $, t.none = $, t.normal = "source-over", t.add = "lighter", t.multiply = e ? "multiply" : $, t.screen = e ? "screen" : $, t.overlay = e ? "overlay" : $, t.darken = e ? "darken" : $, t.lighten = e ? "lighten" : $, t["color-dodge"] = e ? "color-dodge" : $, t["color-burn"] = e ? "color-burn" : $, t["hard-light"] = e ? "hard-light" : $, t["soft-light"] = e ? "soft-light" : $, t.difference = e ? "difference" : $, t.exclusion = e ? "exclusion" : $, t.saturation = e ? "saturation" : $, t.color = e ? "color" : $, t.luminosity = e ? "luminosity" : $, t["linear-burn"] = e ? "color-burn" : $, t["linear-dodge"] = e ? "color-dodge" : $, t["linear-light"] = e ? "hard-light" : $, t["pin-light"] = e ? "hard-light" : $, t["vivid-light"] = e ? "hard-light" : $, t["hard-mix"] = $, t.negation = e ? "difference" : $, t["normal-npm"] = t.normal, t["add-npm"] = t.add, t["screen-npm"] = t.screen, t.erase = "destination-out", t.subtract = $, t.divide = $, t.min = $, t.max = $, t;
|
|
3215
|
-
}
|
|
3216
|
-
//#endregion
|
|
3217
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/canvas/CanvasContextSystem.mjs
|
|
3218
|
-
var Sr = new u(), Cr = class {
|
|
3219
|
-
constructor(e) {
|
|
3220
|
-
this.activeResolution = 1, this.smoothProperty = "imageSmoothingEnabled", this.blendModes = xr(), this._activeBlendMode = "normal", this._projTransform = null, this._outerBlend = !1, this._warnedBlendModes = /* @__PURE__ */ new Set(), this._renderer = e;
|
|
3221
|
-
}
|
|
3222
|
-
resolutionChange(e) {
|
|
3223
|
-
this.activeResolution = e;
|
|
3224
|
-
}
|
|
3225
|
-
init() {
|
|
3226
|
-
let e = this._renderer.background.alpha < 1;
|
|
3227
|
-
if (this.rootContext = this._renderer.canvas.getContext("2d", { alpha: e }), this.activeContext = this.rootContext, this.activeResolution = this._renderer.resolution, !this.rootContext.imageSmoothingEnabled) {
|
|
3228
|
-
let e = this.rootContext;
|
|
3229
|
-
e.webkitImageSmoothingEnabled ? this.smoothProperty = "webkitImageSmoothingEnabled" : e.mozImageSmoothingEnabled ? this.smoothProperty = "mozImageSmoothingEnabled" : e.oImageSmoothingEnabled ? this.smoothProperty = "oImageSmoothingEnabled" : e.msImageSmoothingEnabled && (this.smoothProperty = "msImageSmoothingEnabled");
|
|
3230
|
-
}
|
|
3231
|
-
}
|
|
3232
|
-
setContextTransform(e, t, n, r) {
|
|
3233
|
-
let i = r ? u.IDENTITY : this._renderer.globalUniforms.globalUniformData?.worldTransformMatrix || u.IDENTITY, a = Sr;
|
|
3234
|
-
a.copyFrom(i), a.append(e);
|
|
3235
|
-
let o = this._projTransform, s = this.activeResolution;
|
|
3236
|
-
if (n ||= s, o) {
|
|
3237
|
-
let e = u.shared;
|
|
3238
|
-
e.copyFrom(a), e.prepend(o), a = e;
|
|
3239
|
-
}
|
|
3240
|
-
t ? this.activeContext.setTransform(a.a * n, a.b * n, a.c * n, a.d * n, a.tx * s | 0, a.ty * s | 0) : this.activeContext.setTransform(a.a * n, a.b * n, a.c * n, a.d * n, a.tx * s, a.ty * s);
|
|
3241
|
-
}
|
|
3242
|
-
clear(e, t) {
|
|
3243
|
-
let n = this.activeContext, r = this._renderer;
|
|
3244
|
-
if (n.clearRect(0, 0, r.width, r.height), e) {
|
|
3245
|
-
let i = C.shared.setValue(e);
|
|
3246
|
-
n.globalAlpha = t ?? i.alpha, n.fillStyle = i.toHex(), n.fillRect(0, 0, r.width, r.height), n.globalAlpha = 1;
|
|
3247
|
-
}
|
|
3248
|
-
}
|
|
3249
|
-
setBlendMode(e) {
|
|
3250
|
-
if (this._activeBlendMode === e) return;
|
|
3251
|
-
this._activeBlendMode = e, this._outerBlend = !1;
|
|
3252
|
-
let t = this.blendModes[e];
|
|
3253
|
-
if (!t) {
|
|
3254
|
-
this._warnedBlendModes.has(e) || (console.warn(`CanvasRenderer: blend mode "${e}" is not supported in Canvas2D; falling back to "source-over".`), this._warnedBlendModes.add(e)), this.activeContext.globalCompositeOperation = "source-over";
|
|
3255
|
-
return;
|
|
3256
|
-
}
|
|
3257
|
-
this.activeContext.globalCompositeOperation = t;
|
|
3258
|
-
}
|
|
3259
|
-
destroy() {
|
|
3260
|
-
this.rootContext = null, this.activeContext = null, this._warnedBlendModes.clear();
|
|
3261
|
-
}
|
|
3262
|
-
};
|
|
3263
|
-
Cr.extension = {
|
|
3264
|
-
type: [S.CanvasSystem],
|
|
3265
|
-
name: "canvasContext"
|
|
3266
|
-
};
|
|
3267
|
-
//#endregion
|
|
3268
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/canvas/CanvasLimitsSystem.mjs
|
|
3269
|
-
var wr = class {
|
|
3270
|
-
constructor() {
|
|
3271
|
-
this.maxTextures = 16, this.maxBatchableTextures = 16, this.maxUniformBindings = 0;
|
|
3272
|
-
}
|
|
3273
|
-
init() {}
|
|
3274
|
-
};
|
|
3275
|
-
wr.extension = {
|
|
3276
|
-
type: [S.CanvasSystem],
|
|
3277
|
-
name: "limits"
|
|
3278
|
-
};
|
|
3279
|
-
//#endregion
|
|
3280
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/canvas/renderTarget/CanvasRenderTargetAdaptor.mjs
|
|
3281
|
-
var Tr = class {
|
|
3282
|
-
init(e, t) {
|
|
3283
|
-
this._renderer = e, this._renderTargetSystem = t;
|
|
3284
|
-
}
|
|
3285
|
-
initGpuRenderTarget(e) {
|
|
3286
|
-
let t = e.colorTexture, { canvas: n, context: r } = this._ensureCanvas(t);
|
|
3287
|
-
return {
|
|
3288
|
-
canvas: n,
|
|
3289
|
-
context: r,
|
|
3290
|
-
width: n.width,
|
|
3291
|
-
height: n.height
|
|
3292
|
-
};
|
|
3293
|
-
}
|
|
3294
|
-
resizeGpuRenderTarget(e) {
|
|
3295
|
-
let t = e.colorTexture, { canvas: n } = this._ensureCanvas(t);
|
|
3296
|
-
n.width = e.pixelWidth, n.height = e.pixelHeight;
|
|
3297
|
-
}
|
|
3298
|
-
startRenderPass(e, t, n, r) {
|
|
3299
|
-
let i = this._renderTargetSystem.getGpuRenderTarget(e);
|
|
3300
|
-
this._renderer.canvasContext.activeContext = i.context, this._renderer.canvasContext.activeResolution = e.resolution, t && this.clear(e, t, n, r);
|
|
3301
|
-
}
|
|
3302
|
-
clear(e, t, n, r) {
|
|
3303
|
-
let i = this._renderTargetSystem.getGpuRenderTarget(e).context, a = r || {
|
|
3304
|
-
x: 0,
|
|
3305
|
-
y: 0,
|
|
3306
|
-
width: e.pixelWidth,
|
|
3307
|
-
height: e.pixelHeight
|
|
3308
|
-
};
|
|
3309
|
-
if (i.setTransform(1, 0, 0, 1, 0, 0), i.clearRect(a.x, a.y, a.width, a.height), n) {
|
|
3310
|
-
let e = C.shared.setValue(n);
|
|
3311
|
-
e.alpha > 0 && (i.globalAlpha = e.alpha, i.fillStyle = e.toHex(), i.fillRect(a.x, a.y, a.width, a.height), i.globalAlpha = 1);
|
|
3312
|
-
}
|
|
3313
|
-
}
|
|
3314
|
-
finishRenderPass() {}
|
|
3315
|
-
copyToTexture(e, t, n, r, i) {
|
|
3316
|
-
let a = this._renderTargetSystem.getGpuRenderTarget(e).canvas, o = t.source, { context: s } = this._ensureCanvas(o), c = i?.x ?? 0, l = i?.y ?? 0;
|
|
3317
|
-
return s.drawImage(a, n.x, n.y, r.width, r.height, c, l, r.width, r.height), o.update(), t;
|
|
3318
|
-
}
|
|
3319
|
-
destroyGpuRenderTarget(e) {}
|
|
3320
|
-
_ensureCanvas(e) {
|
|
3321
|
-
let t = e.resource;
|
|
3322
|
-
(!t || !v.test(t)) && (t = h.get().createCanvas(e.pixelWidth, e.pixelHeight), e.resource = t), (t.width !== e.pixelWidth || t.height !== e.pixelHeight) && (t.width = e.pixelWidth, t.height = e.pixelHeight);
|
|
3323
|
-
let n = t.getContext("2d");
|
|
3324
|
-
return {
|
|
3325
|
-
canvas: t,
|
|
3326
|
-
context: n
|
|
3327
|
-
};
|
|
3328
|
-
}
|
|
3329
|
-
}, Er = class extends te {
|
|
3330
|
-
constructor(e) {
|
|
3331
|
-
super(e), this.adaptor = new Tr(), this.adaptor.init(e, this);
|
|
3332
|
-
}
|
|
3333
|
-
};
|
|
3334
|
-
Er.extension = {
|
|
3335
|
-
type: [S.CanvasSystem],
|
|
3336
|
-
name: "renderTarget"
|
|
3337
|
-
};
|
|
3338
|
-
//#endregion
|
|
3339
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/canvas/texture/CanvasTextureSystem.mjs
|
|
3340
|
-
var Dr = class {
|
|
3341
|
-
constructor(e) {}
|
|
3342
|
-
init() {}
|
|
3343
|
-
initSource(e) {}
|
|
3344
|
-
generateCanvas(e) {
|
|
3345
|
-
let t = h.get().createCanvas(), n = t.getContext("2d"), r = O.getCanvasSource(e);
|
|
3346
|
-
if (!r) return t;
|
|
3347
|
-
let i = e.frame, a = e.source._resolution ?? e.source.resolution ?? 1, o = i.x * a, s = i.y * a, c = i.width * a, l = i.height * a;
|
|
3348
|
-
return t.width = Math.ceil(c), t.height = Math.ceil(l), n.drawImage(r, o, s, c, l, 0, 0, c, l), t;
|
|
3349
|
-
}
|
|
3350
|
-
getPixels(e) {
|
|
3351
|
-
let t = this.generateCanvas(e);
|
|
3352
|
-
return {
|
|
3353
|
-
pixels: t.getContext("2d", { willReadFrequently: !0 }).getImageData(0, 0, t.width, t.height).data,
|
|
3354
|
-
width: t.width,
|
|
3355
|
-
height: t.height
|
|
3356
|
-
};
|
|
3357
|
-
}
|
|
3358
|
-
destroy() {}
|
|
3359
|
-
};
|
|
3360
|
-
Dr.extension = {
|
|
3361
|
-
type: [S.CanvasSystem],
|
|
3362
|
-
name: "texture"
|
|
3363
|
-
};
|
|
3364
|
-
//#endregion
|
|
3365
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/canvas/CanvasRenderer.mjs
|
|
3366
|
-
var Or = /* @__PURE__ */ e({ CanvasRenderer: () => Fr }), kr = [
|
|
3367
|
-
...ee,
|
|
3368
|
-
Cr,
|
|
3369
|
-
wr,
|
|
3370
|
-
Dr,
|
|
3371
|
-
Er
|
|
3372
|
-
], Ar = [
|
|
3373
|
-
P,
|
|
3374
|
-
L,
|
|
3375
|
-
k,
|
|
3376
|
-
A,
|
|
3377
|
-
M,
|
|
3378
|
-
br,
|
|
3379
|
-
Xt,
|
|
3380
|
-
N
|
|
3381
|
-
], jr = [Yt, qt], Mr = [], Nr = [], Pr = [];
|
|
3382
|
-
y.handleByNamedList(S.CanvasSystem, Mr), y.handleByNamedList(S.CanvasPipes, Nr), y.handleByNamedList(S.CanvasPipesAdaptor, Pr), y.add(...kr, ...Ar, ...jr);
|
|
3383
|
-
var Fr = class extends I {
|
|
3384
|
-
constructor() {
|
|
3385
|
-
let e = {
|
|
3386
|
-
name: "canvas",
|
|
3387
|
-
type: _.CANVAS,
|
|
3388
|
-
systems: Mr,
|
|
3389
|
-
renderPipes: Nr,
|
|
3390
|
-
renderPipeAdaptors: Pr
|
|
3391
|
-
};
|
|
3392
|
-
super(e);
|
|
3393
|
-
}
|
|
3394
|
-
};
|
|
3395
|
-
//#endregion
|
|
3396
|
-
export { Or as t };
|