modern-canvas 0.14.18 → 0.14.20

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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineProperty as ts, Observable as de, Reactivable as rs, parseColor as oi, property as h, isGradient as ni, isColorFillObject as Gr, clearUndef as ss, idGenerator as is, normalizeFill as li, isNone as V, normalizeBackground as ci, normalizeForeground as hi, normalizeOutline as ui, normalizeShadow as di, normalizeShape as fi, getDefaultStyle as pi, normalizeText as _i, normalizeTextContent as mi, getDefaultTextStyle as gi, getDefaultLayoutStyle as vi, RawWeakMap as bi } from "modern-idoc";
1
+ import { defineProperty as ts, Observable as de, Reactivable as rs, parseColor as oi, property as h, isGradient as ni, isColorFillObject as Gr, clearUndef as ss, idGenerator as is, normalizeFill as li, isNone as V, normalizeBackground as ci, normalizeForeground as hi, normalizeOutline as ui, normalizeShadow as di, normalizeShape as pi, getDefaultStyle as fi, normalizeText as _i, normalizeTextContent as mi, getDefaultTextStyle as gi, getDefaultLayoutStyle as vi, RawWeakMap as bi } from "modern-idoc";
2
2
  import { fonts as yi } from "modern-font";
3
3
  import { extend as xi } from "colord";
4
4
  import wi from "colord/plugins/names";
@@ -172,10 +172,6 @@ function os(r, e, t = {}) {
172
172
  break;
173
173
  }
174
174
  break;
175
- case "turn":
176
- case "em":
177
- // div fontSize
178
- case "rem":
179
175
  // div fontSize
180
176
  default:
181
177
  n.normalizedIntValue = n.intValue;
@@ -516,7 +512,7 @@ class Ee extends rs {
516
512
  class Ji extends Ee {
517
513
  //
518
514
  }
519
- class fe extends Ji {
515
+ class pe extends Ji {
520
516
  //
521
517
  }
522
518
  class le extends de {
@@ -537,11 +533,11 @@ class le extends de {
537
533
  const { dim: d } = t;
538
534
  switch (e) {
539
535
  case "*":
540
- for (let f = 0; f < d; f++) {
536
+ for (let p = 0; p < d; p++) {
541
537
  let m = 0;
542
- for (let p = 0; p < i; p++)
543
- p < d && (m += n[f * i + p] * (l[p] ?? 0));
544
- u[f] = m;
538
+ for (let f = 0; f < i; f++)
539
+ f < d && (m += n[p * i + f] * (l[f] ?? 0));
540
+ u[p] = m;
545
541
  }
546
542
  break;
547
543
  default:
@@ -551,20 +547,20 @@ class le extends de {
551
547
  switch (e) {
552
548
  case "*":
553
549
  for (let d = 0; d < i; d++)
554
- for (let f = 0; f < a; f++) {
555
- const m = f * i;
556
- let p = 0;
550
+ for (let p = 0; p < a; p++) {
551
+ const m = p * i;
552
+ let f = 0;
557
553
  for (let _ = 0; _ < a; _++) {
558
554
  const g = m + _, v = _ * i + d;
559
- p += n[g] * (l[v] ?? 0);
555
+ f += n[g] * (l[v] ?? 0);
560
556
  }
561
- u[m + d] = p;
557
+ u[m + d] = f;
562
558
  }
563
559
  break;
564
560
  case "=":
565
561
  for (let d = 0; d < o; d++) {
566
- const f = l[d];
567
- f !== void 0 && (n[d] = f);
562
+ const p = l[d];
563
+ p !== void 0 && (n[d] = p);
568
564
  }
569
565
  return this._onUpdate(n), this.emit("update", n), this;
570
566
  default:
@@ -637,8 +633,8 @@ class Q extends de {
637
633
  case "*":
638
634
  for (let u = 0; u < i; u++) {
639
635
  let d = 0;
640
- for (let f = 0; f < i; f++)
641
- d += a[u] * o[f * c + u];
636
+ for (let p = 0; p < i; p++)
637
+ d += a[u] * o[p * c + u];
642
638
  l[u] = d;
643
639
  }
644
640
  break;
@@ -1010,7 +1006,7 @@ class Qi extends le {
1010
1006
  super(4, 4, e);
1011
1007
  }
1012
1008
  }
1013
- const fr = yr / 180, uc = 180 / yr;
1009
+ const pr = yr / 180, uc = 180 / yr;
1014
1010
  function ce(r, e, t) {
1015
1011
  return Math.max(e, Math.min(r, t));
1016
1012
  }
@@ -1035,7 +1031,7 @@ class ea extends Q {
1035
1031
  super(4), this.set(e, t, s, i);
1036
1032
  }
1037
1033
  }
1038
- class fs extends le {
1034
+ class ps extends le {
1039
1035
  constructor(e) {
1040
1036
  super(4, 5, e);
1041
1037
  }
@@ -1293,12 +1289,12 @@ class fs extends le {
1293
1289
  return new ea(e[4] / 255, e[9] / 255, e[14] / 255, e[19] / 255);
1294
1290
  }
1295
1291
  }
1296
- class fc extends le {
1292
+ class pc extends le {
1297
1293
  constructor(e) {
1298
1294
  super(2, 2, e);
1299
1295
  }
1300
1296
  }
1301
- class ps extends le {
1297
+ class fs extends le {
1302
1298
  constructor(e) {
1303
1299
  super(3, 3, e);
1304
1300
  }
@@ -1313,7 +1309,7 @@ class ps extends le {
1313
1309
  n,
1314
1310
  l,
1315
1311
  c
1316
- ] = this._array, u = c * a - o * l, d = o * n - c * i, f = l * i - a * n, m = e * u + t * d + s * f;
1312
+ ] = this._array, u = c * a - o * l, d = o * n - c * i, p = l * i - a * n, m = e * u + t * d + s * p;
1317
1313
  if (m === 0)
1318
1314
  return this.set([
1319
1315
  0,
@@ -1326,17 +1322,17 @@ class ps extends le {
1326
1322
  0,
1327
1323
  0
1328
1324
  ]);
1329
- const p = 1 / m;
1325
+ const f = 1 / m;
1330
1326
  return this.set([
1331
- u * p,
1332
- (s * l - c * t) * p,
1333
- (o * t - s * a) * p,
1334
- d * p,
1335
- (c * e - s * n) * p,
1336
- (s * i - o * e) * p,
1337
- f * p,
1338
- (t * n - l * e) * p,
1339
- (a * e - t * i) * p
1327
+ u * f,
1328
+ (s * l - c * t) * f,
1329
+ (o * t - s * a) * f,
1330
+ d * f,
1331
+ (c * e - s * n) * f,
1332
+ (s * i - o * e) * f,
1333
+ p * f,
1334
+ (t * n - l * e) * f,
1335
+ (a * e - t * i) * f
1340
1336
  ]);
1341
1337
  }
1342
1338
  }
@@ -1346,7 +1342,7 @@ class Dt extends ee {
1346
1342
  */
1347
1343
  rotation;
1348
1344
  get rotationDegrees() {
1349
- return this.rotation / fr;
1345
+ return this.rotation / pr;
1350
1346
  }
1351
1347
  constructor(...e) {
1352
1348
  let t, s;
@@ -1358,12 +1354,12 @@ class Dt extends ee {
1358
1354
  {
1359
1355
  const s = (l, c) => Math.abs(l.x * c.x + l.y * c.y), i = (l) => {
1360
1356
  const { width: c, height: u, rotation: d = 0 } = l;
1361
- let f = d / fr;
1362
- f = -f % 180;
1363
- const m = f / 180 * Math.PI, p = { x: Math.cos(m), y: -Math.sin(m) }, _ = { x: Math.sin(m), y: Math.cos(m) };
1357
+ let p = d / pr;
1358
+ p = -p % 180;
1359
+ const m = p / 180 * Math.PI, f = { x: Math.cos(m), y: -Math.sin(m) }, _ = { x: Math.sin(m), y: Math.cos(m) };
1364
1360
  return {
1365
- axis: [p, _],
1366
- projectionRadius: (g) => c / 2 * s(g, p) + u / 2 * s(g, _)
1361
+ axis: [f, _],
1362
+ projectionRadius: (g) => c / 2 * s(g, f) + u / 2 * s(g, _)
1367
1363
  };
1368
1364
  }, a = i(this), o = i(e), n = {
1369
1365
  x: this.left + this.width / 2 - (e.left + e.width / 2),
@@ -1397,7 +1393,7 @@ class Dt extends ee {
1397
1393
  return new Dt(this.toJSON());
1398
1394
  }
1399
1395
  }
1400
- class ta extends ps {
1396
+ class ta extends fs {
1401
1397
  constructor(e = 0, t = 0, s = 0, i = 0, a = !1) {
1402
1398
  super(), this._x = e, this._y = t, this._width = s, this._height = i, this._flipY = a, this._performUpdateArray();
1403
1399
  }
@@ -1428,7 +1424,7 @@ class ta extends ps {
1428
1424
  ]);
1429
1425
  }
1430
1426
  }
1431
- class M extends ps {
1427
+ class M extends fs {
1432
1428
  static _t2d = /* @__PURE__ */ new M();
1433
1429
  premultiply(e) {
1434
1430
  return e.multiply(this, this);
@@ -1537,8 +1533,8 @@ class M extends ps {
1537
1533
  if (e === 0 && t === 0)
1538
1534
  return [0, 0, i];
1539
1535
  {
1540
- const a = Math.cos(i), o = Math.sin(i), n = a + e * e * (1 - a), l = e * t * (1 - a) - s * o, c = e * s * (1 - a) + t * o, u = a + t * t * (1 - a), d = t * s * (1 - a) - e * o, f = a + s * s * (1 - a), m = -Math.atan2(-d, u), p = -Math.atan2(c, Math.sqrt(d * d + f * f)), _ = -Math.atan2(-l, n);
1541
- return [m, p, _];
1536
+ const a = Math.cos(i), o = Math.sin(i), n = a + e * e * (1 - a), l = e * t * (1 - a) - s * o, c = e * s * (1 - a) + t * o, u = a + t * t * (1 - a), d = t * s * (1 - a) - e * o, p = a + s * s * (1 - a), m = -Math.atan2(-d, u), f = -Math.atan2(c, Math.sqrt(d * d + p * p)), _ = -Math.atan2(-l, n);
1537
+ return [m, f, _];
1542
1538
  }
1543
1539
  }
1544
1540
  makeRotation(e) {
@@ -1596,7 +1592,7 @@ class M extends ps {
1596
1592
  return { a: e, c: t, tx: s, b: i, d: a, ty: o, tz: n };
1597
1593
  }
1598
1594
  }
1599
- class pc extends Q {
1595
+ class fc extends Q {
1600
1596
  constructor() {
1601
1597
  super(3);
1602
1598
  }
@@ -1781,20 +1777,20 @@ function ha(r, e) {
1781
1777
  ${r}` : r;
1782
1778
  }
1783
1779
  const ua = {}, da = {};
1784
- function fa(r, { name: e = "program" }, t = !0) {
1780
+ function pa(r, { name: e = "program" }, t = !0) {
1785
1781
  e = e.replace(/\s+/g, "-"), e += t ? "-fragment" : "-vertex";
1786
1782
  const s = t ? ua : da;
1787
1783
  return s[e] ? (s[e]++, e += `-${s[e]}`) : s[e] = 1, r.includes("#define SHADER_NAME") ? r : `${`#define SHADER_NAME ${e}`}
1788
1784
  ${r}`;
1789
1785
  }
1790
- function pa(r, e) {
1786
+ function fa(r, e) {
1791
1787
  return e ? r.replace("#version 300 es", "") : r;
1792
1788
  }
1793
1789
  const tt = /* @__PURE__ */ Object.create(null), tr = {
1794
- stripVersion: pa,
1790
+ stripVersion: fa,
1795
1791
  ensurePrecision: ca,
1796
1792
  addProgramDefines: la,
1797
- setProgramName: fa,
1793
+ setProgramName: pa,
1798
1794
  insertVersion: ha
1799
1795
  };
1800
1796
  class nt {
@@ -2020,11 +2016,11 @@ class ba extends W {
2020
2016
  throw new Error(`Failed to link program: ${t.getProgramInfoLog(s.native)}`);
2021
2017
  const o = /* @__PURE__ */ Object.create(null), n = !/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertex);
2022
2018
  for (let u = t.getProgramParameter(s.native, t.ACTIVE_ATTRIBUTES), d = 0; d < u; d++) {
2023
- const f = t.getActiveAttrib(s.native, d);
2024
- if (!f || f.name.startsWith("gl_"))
2019
+ const p = t.getActiveAttrib(s.native, d);
2020
+ if (!p || p.name.startsWith("gl_"))
2025
2021
  continue;
2026
- const m = va(t, f.type);
2027
- o[f.name] = {
2022
+ const m = va(t, p.type);
2023
+ o[p.name] = {
2028
2024
  location: 0,
2029
2025
  format: m,
2030
2026
  stride: Ot(m).stride,
@@ -2045,17 +2041,17 @@ class ba extends W {
2045
2041
  e.attributes = o;
2046
2042
  const c = /* @__PURE__ */ Object.create(null);
2047
2043
  for (let u = t.getProgramParameter(s.native, t.ACTIVE_UNIFORMS), d = 0; d < u; d++) {
2048
- const f = t.getActiveUniform(s.native, d);
2049
- if (!f)
2044
+ const p = t.getActiveUniform(s.native, d);
2045
+ if (!p)
2050
2046
  continue;
2051
- const m = f.name.replace(/\[.*?\]$/, ""), p = gs(t, f.type), _ = f.size;
2047
+ const m = p.name.replace(/\[.*?\]$/, ""), f = gs(t, p.type), _ = p.size;
2052
2048
  c[m] = {
2053
2049
  name: m,
2054
2050
  index: d,
2055
- type: p,
2051
+ type: f,
2056
2052
  size: _,
2057
- isArray: !!f.name.match(/\[.*?\]$/),
2058
- value: _a(p, _)
2053
+ isArray: !!p.name.match(/\[.*?\]$/),
2054
+ value: _a(f, _)
2059
2055
  };
2060
2056
  }
2061
2057
  return e.uniforms = c, t.deleteShader(i), t.deleteShader(a), s;
@@ -2080,63 +2076,63 @@ ${s.getShaderInfoLog(i)}`);
2080
2076
  const l = i[n], c = o[n];
2081
2077
  if (!c)
2082
2078
  continue;
2083
- const { type: u, isArray: d, value: f, name: m } = c;
2084
- if (f === l)
2079
+ const { type: u, isArray: d, value: p, name: m } = c;
2080
+ if (p === l)
2085
2081
  continue;
2086
2082
  c.value = l;
2087
- const p = t.getUniformLocation(a.native, m);
2083
+ const f = t.getUniformLocation(a.native, m);
2088
2084
  switch (u) {
2089
2085
  case "float":
2090
- d ? t.uniform1fv(p, l) : t.uniform1f(p, l);
2086
+ d ? t.uniform1fv(f, l) : t.uniform1f(f, l);
2091
2087
  break;
2092
2088
  case "uint":
2093
- d ? t.uniform1uiv(p, l) : t.uniform1ui(p, l);
2089
+ d ? t.uniform1uiv(f, l) : t.uniform1ui(f, l);
2094
2090
  break;
2095
2091
  case "bool":
2096
2092
  case "int":
2097
2093
  case "sampler2D":
2098
2094
  case "samplerCube":
2099
2095
  case "sampler2DArray":
2100
- d ? t.uniform1iv(p, l) : t.uniform1i(p, l);
2096
+ d ? t.uniform1iv(f, l) : t.uniform1i(f, l);
2101
2097
  break;
2102
2098
  case "bvec2":
2103
2099
  case "ivec2":
2104
- t.uniform2iv(p, l);
2100
+ t.uniform2iv(f, l);
2105
2101
  break;
2106
2102
  case "uvec2":
2107
- t.uniform2uiv(p, l);
2103
+ t.uniform2uiv(f, l);
2108
2104
  break;
2109
2105
  case "vec2":
2110
- t.uniform2fv(p, l);
2106
+ t.uniform2fv(f, l);
2111
2107
  break;
2112
2108
  case "bvec3":
2113
2109
  case "ivec3":
2114
- t.uniform3iv(p, l);
2110
+ t.uniform3iv(f, l);
2115
2111
  break;
2116
2112
  case "uvec3":
2117
- t.uniform3uiv(p, l);
2113
+ t.uniform3uiv(f, l);
2118
2114
  break;
2119
2115
  case "vec3":
2120
- t.uniform3fv(p, l);
2116
+ t.uniform3fv(f, l);
2121
2117
  break;
2122
2118
  case "bvec4":
2123
2119
  case "ivec4":
2124
- t.uniform4iv(p, l);
2120
+ t.uniform4iv(f, l);
2125
2121
  break;
2126
2122
  case "uvec4":
2127
- t.uniform4uiv(p, l);
2123
+ t.uniform4uiv(f, l);
2128
2124
  break;
2129
2125
  case "vec4":
2130
- t.uniform4fv(p, l);
2126
+ t.uniform4fv(f, l);
2131
2127
  break;
2132
2128
  case "mat2":
2133
- t.uniformMatrix2fv(p, !1, l);
2129
+ t.uniformMatrix2fv(f, !1, l);
2134
2130
  break;
2135
2131
  case "mat3":
2136
- t.uniformMatrix3fv(p, !1, l);
2132
+ t.uniformMatrix3fv(f, !1, l);
2137
2133
  break;
2138
2134
  case "mat4":
2139
- t.uniformMatrix4fv(p, !1, l);
2135
+ t.uniformMatrix4fv(f, !1, l);
2140
2136
  break;
2141
2137
  }
2142
2138
  }
@@ -2415,9 +2411,9 @@ ${Array.from({ length: e }, (l, c) => {
2415
2411
  const i = this._renderer.texture.maxTextureImageUnits, a = this._getBufferData(e), o = new Float32Array(a), n = new Uint8Array(a), l = this._getIndexBufferData(t);
2416
2412
  let c = 0, u = 0;
2417
2413
  const d = [];
2418
- let f = 0;
2419
- for (let p = s.length, _ = { id: ++f }, g = [], v = /* @__PURE__ */ new Map(), w = 0, S = 0, C = 0; C < p; C++) {
2420
- const k = s[C].texture, ge = C === p - 1;
2414
+ let p = 0;
2415
+ for (let f = s.length, _ = { id: ++p }, g = [], v = /* @__PURE__ */ new Map(), w = 0, S = 0, C = 0; C < f; C++) {
2416
+ const k = s[C].texture, ge = C === f - 1;
2421
2417
  if (!k || v.has(k)) {
2422
2418
  if (!ge)
2423
2419
  continue;
@@ -2436,7 +2432,7 @@ ${Array.from({ length: e }, (l, c) => {
2436
2432
  clipOutsideUv: ei,
2437
2433
  roundPixels: ti
2438
2434
  } = s[ve];
2439
- S < ve && _.blendMode !== zr && (_.size = u - _.start, d.push(_), S = ve, _ = { id: ++f }, _.textures = g, _.start = u);
2435
+ S < ve && _.blendMode !== zr && (_.size = u - _.start, d.push(_), S = ve, _ = { id: ++p }, _.textures = g, _.start = u);
2440
2436
  const { width: Yt, height: Kt } = Qs, ri = c / this._vertexSize, si = (Fr ? v.get(Fr) : 255) ?? 255, ii = ti ? 1 : 0, ai = ei ? 1 : 0;
2441
2437
  let xt, wt;
2442
2438
  for (let Zt = qt.length, J = 0; J < Zt; J += 2) {
@@ -2448,12 +2444,12 @@ ${Array.from({ length: e }, (l, c) => {
2448
2444
  l[u++] = ri + Br[J];
2449
2445
  _.blendMode = zr;
2450
2446
  }
2451
- S = C + 1, _.size = u - _.start, d.push(_), _ = { id: ++f }, g = [], v = /* @__PURE__ */ new Map();
2447
+ S = C + 1, _.size = u - _.start, d.push(_), _ = { id: ++p }, g = [], v = /* @__PURE__ */ new Map();
2452
2448
  }
2453
2449
  }
2454
2450
  const m = this._getShader(i);
2455
2451
  m.update(o, l);
2456
- for (let p = d.length, _ = 0; _ < p; _++) {
2452
+ for (let f = d.length, _ = 0; _ < f; _++) {
2457
2453
  const g = d[_], { start: v = 0, textures: w, textureLocationMap: S } = g;
2458
2454
  for (let C = w.length, k = 0; k < C; k++) {
2459
2455
  const ge = w[k], ve = S.get(ge);
@@ -2516,7 +2512,7 @@ class Pa extends W {
2516
2512
  "x" in s && this._renderer.scissor.pop(), "render" in s && (this._renderer.flush(), a !== 0 ? this._renderer.stencil.bind(D.renderingMaskRemove, a) : (this._renderer.clear(at.stencil), this._renderer.stencil.bind(D.disabled, a)), a--, s.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(D.maskActive, a), this._renderer.colorMask.bind(15)), this._maskStackHash[i] = a;
2517
2513
  }
2518
2514
  }
2519
- var pr = /* @__PURE__ */ ((r) => (r[r.RGBA = 6408] = "RGBA", r[r.RGB = 6407] = "RGB", r[r.RG = 33319] = "RG", r[r.RED = 6403] = "RED", r[r.RGBA_INTEGER = 36249] = "RGBA_INTEGER", r[r.RGB_INTEGER = 36248] = "RGB_INTEGER", r[r.RG_INTEGER = 33320] = "RG_INTEGER", r[r.RED_INTEGER = 36244] = "RED_INTEGER", r[r.ALPHA = 6406] = "ALPHA", r[r.LUMINANCE = 6409] = "LUMINANCE", r[r.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA", r[r.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT", r[r.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL", r))(pr || {}), vs = /* @__PURE__ */ ((r) => (r[r.TEXTURE_2D = 3553] = "TEXTURE_2D", r[r.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP", r[r.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY", r[r.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X", r[r.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X", r[r.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y", r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y", r[r.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z", r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z", r))(vs || {}), y = /* @__PURE__ */ ((r) => (r[r.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", r[r.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", r[r.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5", r[r.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4", r[r.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1", r[r.UNSIGNED_INT = 5125] = "UNSIGNED_INT", r[r.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV", r[r.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV", r[r.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8", r[r.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV", r[r.BYTE = 5120] = "BYTE", r[r.SHORT = 5122] = "SHORT", r[r.INT = 5124] = "INT", r[r.FLOAT = 5126] = "FLOAT", r[r.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV", r[r.HALF_FLOAT = 36193] = "HALF_FLOAT", r))(y || {});
2515
+ var fr = /* @__PURE__ */ ((r) => (r[r.RGBA = 6408] = "RGBA", r[r.RGB = 6407] = "RGB", r[r.RG = 33319] = "RG", r[r.RED = 6403] = "RED", r[r.RGBA_INTEGER = 36249] = "RGBA_INTEGER", r[r.RGB_INTEGER = 36248] = "RGB_INTEGER", r[r.RG_INTEGER = 33320] = "RG_INTEGER", r[r.RED_INTEGER = 36244] = "RED_INTEGER", r[r.ALPHA = 6406] = "ALPHA", r[r.LUMINANCE = 6409] = "LUMINANCE", r[r.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA", r[r.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT", r[r.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL", r))(fr || {}), vs = /* @__PURE__ */ ((r) => (r[r.TEXTURE_2D = 3553] = "TEXTURE_2D", r[r.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP", r[r.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY", r[r.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X", r[r.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X", r[r.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y", r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y", r[r.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z", r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z", r))(vs || {}), y = /* @__PURE__ */ ((r) => (r[r.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", r[r.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", r[r.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5", r[r.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4", r[r.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1", r[r.UNSIGNED_INT = 5125] = "UNSIGNED_INT", r[r.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV", r[r.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV", r[r.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8", r[r.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV", r[r.BYTE = 5120] = "BYTE", r[r.SHORT = 5122] = "SHORT", r[r.INT = 5124] = "INT", r[r.FLOAT = 5126] = "FLOAT", r[r.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV", r[r.HALF_FLOAT = 36193] = "HALF_FLOAT", r))(y || {});
2520
2516
  class Ea {
2521
2517
  constructor(e) {
2522
2518
  this.native = e;
@@ -2526,8 +2522,8 @@ class Ea {
2526
2522
  height = -1;
2527
2523
  mipmap = !1;
2528
2524
  type = y.UNSIGNED_BYTE;
2529
- internalFormat = pr.RGBA;
2530
- format = pr.RGBA;
2525
+ internalFormat = fr.RGBA;
2526
+ format = fr.RGBA;
2531
2527
  }
2532
2528
  function Sa(r) {
2533
2529
  return {
@@ -2791,9 +2787,9 @@ function Oa(r, e, t, s, i, a, o, n) {
2791
2787
  addressModeV: c = "repeat",
2792
2788
  addressModeW: u = "repeat",
2793
2789
  magFilter: d = "linear",
2794
- minFilter: f = "linear",
2790
+ minFilter: p = "linear",
2795
2791
  mipmapFilter: m = "linear",
2796
- maxAnisotropy: p = 0,
2792
+ maxAnisotropy: f = 0,
2797
2793
  compare: _
2798
2794
  } = r, g = a;
2799
2795
  if (!n || l !== "repeat" || c !== "repeat" || u !== "repeat") {
@@ -2802,13 +2798,13 @@ function Oa(r, e, t, s, i, a, o, n) {
2802
2798
  }
2803
2799
  if ((!n || d !== "linear") && e[i](g, e.TEXTURE_MAG_FILTER, Kr[d]), t) {
2804
2800
  if (!n || m !== "linear") {
2805
- const v = Aa[f][m];
2801
+ const v = Aa[p][m];
2806
2802
  e[i](g, e.TEXTURE_MIN_FILTER, v);
2807
2803
  }
2808
2804
  } else
2809
- e[i](g, e.TEXTURE_MIN_FILTER, Kr[f]);
2810
- if (s && p > 1) {
2811
- const v = Math.min(p, e.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));
2805
+ e[i](g, e.TEXTURE_MIN_FILTER, Kr[p]);
2806
+ if (s && f > 1) {
2807
+ const v = Math.min(f, e.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));
2812
2808
  e[i](g, s.TEXTURE_MAX_ANISOTROPY_EXT, v);
2813
2809
  }
2814
2810
  _ && e[i](g, e.TEXTURE_COMPARE_FUNC, Ca[_]);
@@ -3147,26 +3143,26 @@ class Ba extends W {
3147
3143
  const l = a[n], c = l.buffer, u = i.getGlBuffer(c), d = t.attributes[n];
3148
3144
  if (d) {
3149
3145
  o !== u && (i.bind(c), o = u);
3150
- const f = d.location;
3151
- s.enableVertexAttribArray(f);
3152
- const m = Ot(l.format), p = ka(l.format);
3146
+ const p = d.location;
3147
+ s.enableVertexAttribArray(p);
3148
+ const m = Ot(l.format), f = ka(l.format);
3153
3149
  if (d.format?.substring(1, 4) === "int" ? s.vertexAttribIPointer(
3154
- f,
3155
- m.size,
3156
3150
  p,
3151
+ m.size,
3152
+ f,
3157
3153
  l.stride ?? 0,
3158
3154
  l.start ?? 0
3159
3155
  ) : s.vertexAttribPointer(
3160
- f,
3161
- m.size,
3162
3156
  p,
3157
+ m.size,
3158
+ f,
3163
3159
  m.normalized,
3164
3160
  l.stride ?? 0,
3165
3161
  l.start ?? 0
3166
3162
  ), l.instance)
3167
3163
  if (this.hasInstance) {
3168
3164
  const _ = l.divisor ?? 1;
3169
- s.vertexAttribDivisor(f, _);
3165
+ s.vertexAttribDivisor(p, _);
3170
3166
  } else
3171
3167
  throw new Error("geometry error, GPU Instancing is not supported on this device");
3172
3168
  }
@@ -3232,15 +3228,15 @@ class La extends W {
3232
3228
  }
3233
3229
  }
3234
3230
  function Tt(r, e, t) {
3235
- const [s, i, a, o, n, l, c, u, d] = r, f = s * e + o * t + c, m = i * e + n * t + u, p = a * e + l * t + d;
3236
- return { x: f / p, y: m / p };
3231
+ const [s, i, a, o, n, l, c, u, d] = r, p = s * e + o * t + c, m = i * e + n * t + u, f = a * e + l * t + d;
3232
+ return { x: p / f, y: m / f };
3237
3233
  }
3238
3234
  function Fa(r, e) {
3239
- const { x: t, y: s, width: i, height: a } = e, o = Tt(r, t, s), n = Tt(r, t + i, s), l = Tt(r, t + i, s + a), c = Tt(r, t, s + a), u = [o, n, l, c], d = u.map((v) => v.x), f = u.map((v) => v.y), m = Math.min(...d), p = Math.max(...d), _ = Math.min(...f), g = Math.max(...f);
3235
+ const { x: t, y: s, width: i, height: a } = e, o = Tt(r, t, s), n = Tt(r, t + i, s), l = Tt(r, t + i, s + a), c = Tt(r, t, s + a), u = [o, n, l, c], d = u.map((v) => v.x), p = u.map((v) => v.y), m = Math.min(...d), f = Math.max(...d), _ = Math.min(...p), g = Math.max(...p);
3240
3236
  return {
3241
3237
  x: m,
3242
3238
  y: _,
3243
- width: p - m,
3239
+ width: f - m,
3244
3240
  height: g - _
3245
3241
  };
3246
3242
  }
@@ -3774,7 +3770,7 @@ var Wa = Object.defineProperty, bs = (r, e, t, s) => {
3774
3770
  (o = r[a]) && (i = o(e, t, i) || i);
3775
3771
  return i && Wa(e, t, i), i;
3776
3772
  };
3777
- class We extends fe {
3773
+ class We extends pe {
3778
3774
  constructor(e) {
3779
3775
  super(), this.setProperties(e);
3780
3776
  }
@@ -3790,7 +3786,7 @@ var qa = Object.defineProperty, Vt = (r, e, t, s) => {
3790
3786
  (o = r[a]) && (i = o(e, t, i) || i);
3791
3787
  return i && qa(e, t, i), i;
3792
3788
  };
3793
- class Ue extends fe {
3789
+ class Ue extends pe {
3794
3790
  constructor(e = {}) {
3795
3791
  super(), this.setProperties(e);
3796
3792
  }
@@ -3815,7 +3811,7 @@ var Ya = Object.defineProperty, ys = (r, e, t, s) => {
3815
3811
  (o = r[a]) && (i = o(e, t, i) || i);
3816
3812
  return i && Ya(e, t, i), i;
3817
3813
  };
3818
- class xe extends fe {
3814
+ class xe extends pe {
3819
3815
  constructor(e) {
3820
3816
  super(), this.setProperties(e);
3821
3817
  }
@@ -3831,7 +3827,7 @@ var Ka = Object.defineProperty, Be = (r, e, t, s) => {
3831
3827
  (o = r[a]) && (i = o(e, t, i) || i);
3832
3828
  return i && Ka(e, t, i), i;
3833
3829
  };
3834
- class H extends fe {
3830
+ class H extends pe {
3835
3831
  constructor(e) {
3836
3832
  super(), this.setProperties(e);
3837
3833
  }
@@ -3887,7 +3883,7 @@ function Qa() {
3887
3883
  tint: new Float32Array([1, 1, 1, 1])
3888
3884
  };
3889
3885
  }
3890
- class E extends fe {
3886
+ class E extends pe {
3891
3887
  static instance = new this();
3892
3888
  glProgram;
3893
3889
  constructor(e = {}) {
@@ -4075,7 +4071,7 @@ var so = Object.defineProperty, Se = (r, e, t, s) => {
4075
4071
  (o = r[a]) && (i = o(e, t, i) || i);
4076
4072
  return i && so(e, t, i), i;
4077
4073
  };
4078
- class te extends fe {
4074
+ class te extends pe {
4079
4075
  get valid() {
4080
4076
  return !!(this.width && this.height);
4081
4077
  }
@@ -4115,7 +4111,7 @@ var io = Object.defineProperty, N = (r, e, t, s) => {
4115
4111
  (o = r[a]) && (i = o(e, t, i) || i);
4116
4112
  return i && io(e, t, i), i;
4117
4113
  };
4118
- class x extends fe {
4114
+ class x extends pe {
4119
4115
  static get EMPTY() {
4120
4116
  return new this({ width: 1, height: 1 });
4121
4117
  }
@@ -4230,7 +4226,7 @@ N([
4230
4226
  N([
4231
4227
  h({ fallback: !1 })
4232
4228
  ], x.prototype, "isPowerOfTwo");
4233
- class ao extends fe {
4229
+ class ao extends pe {
4234
4230
  frames;
4235
4231
  frameIndex = 0;
4236
4232
  get currentFrame() {
@@ -4306,7 +4302,7 @@ class $t extends x {
4306
4302
  const a = i.getContext("2d");
4307
4303
  if (!a)
4308
4304
  throw new Error("Failed to parse linear gradient, get canvas context is null.");
4309
- const { angle: o = 0, stops: n } = e, l = t, c = s, u = l / 2, d = c / 2, f = (o + 90) * Math.PI / 180, m = Math.sin(f), p = -Math.cos(f), _ = Math.abs(l * Math.sin(f)) + Math.abs(c * Math.cos(f)), g = u - m * (_ / 2), v = d - p * (_ / 2), w = u + m * (_ / 2), S = d + p * (_ / 2), C = a.createLinearGradient(g, v, w, S);
4305
+ const { angle: o = 0, stops: n } = e, l = t, c = s, u = l / 2, d = c / 2, p = (o + 90) * Math.PI / 180, m = Math.sin(p), f = -Math.cos(p), _ = Math.abs(l * Math.sin(p)) + Math.abs(c * Math.cos(p)), g = u - m * (_ / 2), v = d - f * (_ / 2), w = u + m * (_ / 2), S = d + f * (_ / 2), C = a.createLinearGradient(g, v, w, S);
4310
4306
  for (const ge of n) C.addColorStop(ge.offset, ge.color);
4311
4307
  a.fillStyle = C, a.fillRect(0, 0, l, c);
4312
4308
  const k = a.getImageData(0, 0, i.width, i.height);
@@ -4621,7 +4617,7 @@ class uo {
4621
4617
  return [...this.default];
4622
4618
  }
4623
4619
  }
4624
- class fo extends Ee {
4620
+ class po extends Ee {
4625
4621
  constructor(e) {
4626
4622
  return super(), this.parent = e, new Proxy(this, {
4627
4623
  get: (t, s, i) => Reflect.has(t, s) || String(s).startsWith("_") ? Reflect.get(t, s, i) : t.getProperty(String(s)),
@@ -4641,10 +4637,10 @@ class fo extends Ee {
4641
4637
  return { internalKey: `____${e}` };
4642
4638
  }
4643
4639
  }
4644
- var po = Object.defineProperty, _o = Object.getOwnPropertyDescriptor, se = (r, e, t, s) => {
4640
+ var fo = Object.defineProperty, _o = Object.getOwnPropertyDescriptor, se = (r, e, t, s) => {
4645
4641
  for (var i = s > 1 ? void 0 : s ? _o(e, t) : e, a = r.length - 1, o; a >= 0; a--)
4646
4642
  (o = r[a]) && (i = (s ? o(e, t, i) : o(i)) || i);
4647
- return s && i && po(e, t, i), i;
4643
+ return s && i && fo(e, t, i), i;
4648
4644
  };
4649
4645
  const Jr = {};
4650
4646
  function mo(r) {
@@ -4652,19 +4648,27 @@ function mo(r) {
4652
4648
  return e++, Jr[r] = e, e;
4653
4649
  }
4654
4650
  let I = class extends Ee {
4655
- _meta = new fo(this);
4651
+ _meta = new po(this);
4656
4652
  get meta() {
4657
4653
  return this._meta;
4658
4654
  }
4659
4655
  set meta(r) {
4660
4656
  this._meta.resetProperties().setProperties(r);
4661
4657
  }
4658
+ _processable = !1;
4659
+ get processable() {
4660
+ return this._processable;
4661
+ }
4662
+ _renderable = !1;
4663
+ get renderable() {
4664
+ return this._renderable;
4665
+ }
4662
4666
  _readyed = !1;
4663
4667
  constructor(r, e = []) {
4664
4668
  super(), this._onTreeEnter = this._onTreeEnter.bind(this), this._onTreeExit = this._onTreeExit.bind(this), this._onParented = this._onParented.bind(this), this._onUnparented = this._onUnparented.bind(this), this._onReady = this._onReady.bind(this), this._onProcess = this._onProcess.bind(this), this.setProperties({
4665
4669
  name: `${this.is}:${mo(this.is)}`,
4666
4670
  ...r
4667
- }).append(e), this.on("treeEnter", this._onTreeEnter).on("treeExit", this._onTreeExit).on("parented", this._onParented).on("unparented", this._onUnparented).on("ready", this._onReady).on("process", this._onProcess);
4671
+ }).append(e), this.on("treeEnter", this._onTreeEnter).on("treeExit", this._onTreeExit).on("parented", this._onParented).on("unparented", this._onUnparented).on("ready", this._onReady).on("process", this._onProcess), this.updateProcessable(), this.updateRenderable();
4668
4672
  }
4669
4673
  setProperties(r) {
4670
4674
  if (r) {
@@ -4770,23 +4774,6 @@ let I = class extends Ee {
4770
4774
  const r = this._parent?.children;
4771
4775
  return r ? r[r.length - 1] : void 0;
4772
4776
  }
4773
- canProcess() {
4774
- if (!this._tree)
4775
- return !1;
4776
- switch (this.processMode) {
4777
- case "inherit":
4778
- return this._parent?.canProcess() ?? !0;
4779
- case "pausable":
4780
- return !this._tree.processPaused;
4781
- case "when-paused":
4782
- return this._tree.processPaused;
4783
- case "always":
4784
- return !0;
4785
- case "disabled":
4786
- default:
4787
- return !1;
4788
- }
4789
- }
4790
4777
  canInput() {
4791
4778
  if (!this._tree)
4792
4779
  return !1;
@@ -4795,20 +4782,6 @@ let I = class extends Ee {
4795
4782
  return this._parent?.canInput() ?? !0;
4796
4783
  case "always":
4797
4784
  return !0;
4798
- case "disabled":
4799
- default:
4800
- return !1;
4801
- }
4802
- }
4803
- canRender() {
4804
- if (!this._tree)
4805
- return !1;
4806
- switch (this.renderMode) {
4807
- case "inherit":
4808
- return this._parent?.canRender() ?? !0;
4809
- case "always":
4810
- return !0;
4811
- case "disabled":
4812
4785
  default:
4813
4786
  return !1;
4814
4787
  }
@@ -4829,7 +4802,7 @@ let I = class extends Ee {
4829
4802
  this._ready();
4830
4803
  }
4831
4804
  _onProcess(r = 0) {
4832
- const e = this._tree, t = this.canRender(), s = this.canProcess(), i = [], a = [];
4805
+ const e = this._tree, t = this.renderable, s = this.processable, i = [], a = [];
4833
4806
  this._children.internal.forEach((n) => {
4834
4807
  switch (n.processSortMode) {
4835
4808
  case "default":
@@ -4854,8 +4827,52 @@ let I = class extends Ee {
4854
4827
  requestRender() {
4855
4828
  this.needsRender = !0;
4856
4829
  }
4830
+ updateProcessable() {
4831
+ switch (this.processMode) {
4832
+ case "inherit":
4833
+ this._processable = this._parent?.processable ?? !0;
4834
+ break;
4835
+ case "pausable":
4836
+ this._processable = this._tree ? !this._tree.processPaused : !1;
4837
+ break;
4838
+ case "when-paused":
4839
+ this._processable = this._tree ? this._tree.processPaused : !1;
4840
+ break;
4841
+ case "always":
4842
+ this._processable = !0;
4843
+ break;
4844
+ default:
4845
+ this._processable = !1;
4846
+ break;
4847
+ }
4848
+ this.children.forEach((r) => {
4849
+ r.processMode === "inherit" && r.updateProcessable();
4850
+ });
4851
+ }
4852
+ updateRenderable() {
4853
+ switch (this.renderMode) {
4854
+ case "inherit":
4855
+ this._renderable = this._parent?.renderable ?? !0;
4856
+ break;
4857
+ case "always":
4858
+ this._renderable = !0;
4859
+ break;
4860
+ default:
4861
+ this._renderable = !1;
4862
+ break;
4863
+ }
4864
+ this.children.forEach((r) => {
4865
+ r.renderMode === "inherit" && r.updateRenderable();
4866
+ });
4867
+ }
4857
4868
  _updateProperty(r, e, t) {
4858
4869
  switch (super._updateProperty(r, e, t), r) {
4870
+ case "processMode":
4871
+ this.updateProcessable();
4872
+ break;
4873
+ case "renderMode":
4874
+ this.updateRenderable();
4875
+ break;
4859
4876
  case "needsRender":
4860
4877
  e && this._parent?.requestRender();
4861
4878
  break;
@@ -4981,9 +4998,11 @@ let I = class extends Ee {
4981
4998
  }
4982
4999
  // eslint-disable-next-line unused-imports/no-unused-vars
4983
5000
  _parented(r) {
5001
+ this.updateProcessable(), this.updateRenderable();
4984
5002
  }
4985
5003
  // eslint-disable-next-line unused-imports/no-unused-vars
4986
5004
  _unparented(r) {
5005
+ this.updateProcessable(), this.updateRenderable();
4987
5006
  }
4988
5007
  // eslint-disable-next-line unused-imports/no-unused-vars
4989
5008
  _process(r) {
@@ -5170,8 +5189,8 @@ let Ge = class extends q {
5170
5189
  isVisibleInTree() {
5171
5190
  return this.globalOpacity > 0 && this.globalVisible;
5172
5191
  }
5173
- canRender() {
5174
- return super.canRender() && this.isVisibleInTree();
5192
+ updateRenderable() {
5193
+ super.updateRenderable(), this._renderable = this._renderable && this.isVisibleInTree();
5175
5194
  }
5176
5195
  requestDraw() {
5177
5196
  this.needsDraw = !0, this.requestRender();
@@ -5239,8 +5258,8 @@ let Ge = class extends q {
5239
5258
  1 + -a / e.height
5240
5259
  ), l = new Float32Array(o.length);
5241
5260
  for (let c = o.length, u = 0; u < c; u += 2) {
5242
- const { x: d, y: f } = n.apply({ x: o[u], y: o[u + 1] });
5243
- l[u] = d, l[u + 1] = f;
5261
+ const { x: d, y: p } = n.apply({ x: o[u], y: o[u + 1] });
5262
+ l[u] = d, l[u + 1] = p;
5244
5263
  }
5245
5264
  return r.uvs = l, e.texture;
5246
5265
  }
@@ -5416,26 +5435,13 @@ let T = class extends q {
5416
5435
  r.off("processing", this._onProcessing), r.off("nodeProcessed", this._onNodeProcessed), this.viewport1.setTree(void 0), this.viewport2.setTree(void 0);
5417
5436
  }
5418
5437
  _onProcessing() {
5419
- if (this.canProcess())
5420
- switch (this._updateCurrentTime(), this._effectMode) {
5421
- case "transition":
5422
- this._previousSibling = this.previousSibling, this._nextSibling = this.nextSibling;
5423
- break;
5424
- default:
5425
- this._previousSibling = void 0, this._nextSibling = void 0;
5426
- break;
5427
- }
5438
+ this.processable && (this._updateCurrentTime(), this._effectMode === "transition" ? (this._previousSibling = this.previousSibling, this._nextSibling = this.nextSibling) : (this._previousSibling = void 0, this._nextSibling = void 0));
5428
5439
  }
5429
5440
  _onNodeProcessed(r) {
5430
- if (!this.canProcess() || !this.isInsideTimeRange())
5441
+ if (!this.processable || !this.isInsideTimeRange())
5431
5442
  return;
5432
5443
  const e = this._tree?.renderStack;
5433
- if (e)
5434
- switch (this._effectMode) {
5435
- case "transition":
5436
- r.equal(this._previousSibling) ? (this._previousSibling = void 0, e.push(this)) : r.equal(this._nextSibling) && (this._nextSibling = void 0, e.push(this));
5437
- break;
5438
- }
5444
+ e && this._effectMode === "transition" && (r.equal(this._previousSibling) ? (this._previousSibling = void 0, e.push(this)) : r.equal(this._nextSibling) && (this._nextSibling = void 0, e.push(this)));
5439
5445
  }
5440
5446
  getRect() {
5441
5447
  return new ee(this._rect);
@@ -5481,7 +5487,7 @@ let T = class extends q {
5481
5487
  this.children.length && (super.emit("process"), this._tree?.renderStack.push(this));
5482
5488
  }
5483
5489
  _onProcess(r = 0) {
5484
- if (this.canProcess())
5490
+ if (this.processable)
5485
5491
  switch (this._renderId = 0, this._effectMode) {
5486
5492
  case "before":
5487
5493
  super._onProcess(r);
@@ -5557,8 +5563,6 @@ let T = class extends q {
5557
5563
  case "transition":
5558
5564
  this._renderTransition(r);
5559
5565
  break;
5560
- case "parent":
5561
- case "children":
5562
5566
  default:
5563
5567
  this._renderParentOrChildren(r);
5564
5568
  break;
@@ -5689,14 +5693,17 @@ let _r = class extends X {
5689
5693
  }
5690
5694
  };
5691
5695
  _r = Co([
5692
- b("Window")
5696
+ b("Window", {
5697
+ processMode: "always",
5698
+ renderMode: "always"
5699
+ })
5693
5700
  ], _r);
5694
5701
  var Oo = Object.defineProperty, Te = (r, e, t, s) => {
5695
5702
  for (var i = void 0, a = r.length - 1, o; a >= 0; a--)
5696
5703
  (o = r[a]) && (i = o(e, t, i) || i);
5697
5704
  return i && Oo(e, t, i), i;
5698
5705
  };
5699
- class pe extends wr {
5706
+ class fe extends wr {
5700
5707
  input = new Zi();
5701
5708
  renderStack = new So();
5702
5709
  root = new _r().setTree(this);
@@ -5745,28 +5752,28 @@ class pe extends wr {
5745
5752
  }
5746
5753
  Te([
5747
5754
  h({ alias: "root.msaa" })
5748
- ], pe.prototype, "msaa");
5755
+ ], fe.prototype, "msaa");
5749
5756
  Te([
5750
5757
  h({ fallback: !1 })
5751
- ], pe.prototype, "pixelate");
5758
+ ], fe.prototype, "pixelate");
5752
5759
  Te([
5753
5760
  h({ fallback: !1 })
5754
- ], pe.prototype, "roundPixels");
5761
+ ], fe.prototype, "roundPixels");
5755
5762
  Te([
5756
5763
  h()
5757
- ], pe.prototype, "backgroundColor");
5764
+ ], fe.prototype, "backgroundColor");
5758
5765
  Te([
5759
5766
  h({ internal: !0, fallback: !1 })
5760
- ], pe.prototype, "debug");
5767
+ ], fe.prototype, "debug");
5761
5768
  Te([
5762
5769
  h({ internal: !0, fallback: !1 })
5763
- ], pe.prototype, "processPaused");
5770
+ ], fe.prototype, "processPaused");
5764
5771
  Te([
5765
5772
  h({ internal: !0, default: () => yi })
5766
- ], pe.prototype, "fonts");
5773
+ ], fe.prototype, "fonts");
5767
5774
  Te([
5768
5775
  h({ internal: !0, default: () => new he() })
5769
- ], pe.prototype, "timeline");
5776
+ ], fe.prototype, "timeline");
5770
5777
  var Do = Object.getOwnPropertyDescriptor, Io = (r, e, t, s) => {
5771
5778
  for (var i = s > 1 ? void 0 : s ? Do(e, t) : e, a = r.length - 1, o; a >= 0; a--)
5772
5779
  (o = r[a]) && (i = o(i) || i);
@@ -5805,11 +5812,7 @@ let Ie = class extends Ge {
5805
5812
  super(), this.setProperties(r).append(e);
5806
5813
  }
5807
5814
  _updateProperty(r, e, t) {
5808
- switch (super._updateProperty(r, e, t), r) {
5809
- case "rotation":
5810
- this.updateGlobalTransform();
5811
- break;
5812
- }
5815
+ super._updateProperty(r, e, t), r === "rotation" && this.updateGlobalTransform();
5813
5816
  }
5814
5817
  updateTransform() {
5815
5818
  this.transform.identity().translate(-this.pivot.x, -this.pivot.y).scale(this.scale.x, this.scale.y).skew(this.skew.x, this.skew.y).rotate(this.rotation).multiply(this.extraTransform).translate(this.position.x, this.position.y).translate(this.pivot.x, this.pivot.y);
@@ -5834,8 +5837,8 @@ let Ie = class extends Ge {
5834
5837
  const { a: e, c: t, tx: s, b: i, d: a, ty: o } = this.globalTransform.toObject(), n = r.vertices.slice(), l = r.transformVertex ?? (() => {
5835
5838
  });
5836
5839
  let c, u;
5837
- for (let d = n.length, f = 0; f < d; f += 2)
5838
- c = n[f], u = n[f + 1], n[f] = e * c + t * u + s, n[f + 1] = i * c + a * u + o, l(n, f);
5840
+ for (let d = n.length, p = 0; p < d; p += 2)
5841
+ c = n[p], u = n[p + 1], n[p] = e * c + t * u + s, n[p + 1] = i * c + a * u + o, l(n, p);
5839
5842
  return n;
5840
5843
  }
5841
5844
  _relayout(r) {
@@ -6008,7 +6011,7 @@ const Qr = {
6008
6011
  sepia: 0
6009
6012
  };
6010
6013
  function gc(r) {
6011
- const e = new fs();
6014
+ const e = new ps();
6012
6015
  if (r === "none")
6013
6016
  return e;
6014
6017
  const t = zt(r).reduce((s, { name: i, args: a }) => (s[i] = a[0].normalizedIntValue, s), {});
@@ -6228,16 +6231,12 @@ var Ss = Object.defineProperty, Vo = Object.getOwnPropertyDescriptor, $o = (r, e
6228
6231
  return s && i && Ss(e, t, i), i;
6229
6232
  }, Ho = (r, e, t) => $o(r, e + "", t);
6230
6233
  let $e = class extends T {
6231
- _colorMatrix = new fs();
6234
+ _colorMatrix = new ps();
6232
6235
  constructor(r, e = []) {
6233
6236
  super(), this.setProperties(r).append(e);
6234
6237
  }
6235
6238
  _updateProperty(r, e, t) {
6236
- switch (super._updateProperty(r, e, t), r) {
6237
- case "filter":
6238
- this.renderMode = this.filter ? "inherit" : "disabled";
6239
- break;
6240
- }
6239
+ super._updateProperty(r, e, t), r === "filter" && (this.renderMode = this.filter ? "inherit" : "disabled");
6241
6240
  }
6242
6241
  apply(r, e) {
6243
6242
  if (!this.filter)
@@ -6719,11 +6718,7 @@ let Y = class extends T {
6719
6718
  super(), this.setProperties(r).append(e);
6720
6719
  }
6721
6720
  _updateProperty(r, e, t) {
6722
- switch (super._updateProperty(r, e, t), r) {
6723
- case "watermark":
6724
- this._loadWatermark(e);
6725
- break;
6726
- }
6721
+ super._updateProperty(r, e, t), r === "watermark" && this._loadWatermark(e);
6727
6722
  }
6728
6723
  async _loadWatermark(r) {
6729
6724
  r ? this._watermark = await $.texture.load(r) : this._watermark = void 0;
@@ -7047,11 +7042,11 @@ Us([
7047
7042
  ct = Us([
7048
7043
  b("EmbossEffect")
7049
7044
  ], ct);
7050
- var Bs = Object.defineProperty, fn = Object.getOwnPropertyDescriptor, pn = (r, e, t) => e in r ? Bs(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, ie = (r, e, t, s) => {
7051
- for (var i = s > 1 ? void 0 : s ? fn(e, t) : e, a = r.length - 1, o; a >= 0; a--)
7045
+ var Bs = Object.defineProperty, pn = Object.getOwnPropertyDescriptor, fn = (r, e, t) => e in r ? Bs(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, ie = (r, e, t, s) => {
7046
+ for (var i = s > 1 ? void 0 : s ? pn(e, t) : e, a = r.length - 1, o; a >= 0; a--)
7052
7047
  (o = r[a]) && (i = (s ? o(e, t, i) : o(i)) || i);
7053
7048
  return s && i && Bs(e, t, i), i;
7054
- }, _n = (r, e, t) => pn(r, e + "", t);
7049
+ }, _n = (r, e, t) => fn(r, e + "", t);
7055
7050
  let G = class extends T {
7056
7051
  _canvas;
7057
7052
  _texture;
@@ -7922,12 +7917,12 @@ function kt(r, e) {
7922
7917
  1 / Math.abs(1 + (-v - S))
7923
7918
  ), o = !0;
7924
7919
  }
7925
- const { a: l, c, tx: u, b: d, d: f, ty: m } = n.toObject();
7926
- let p, _;
7920
+ const { a: l, c, tx: u, b: d, d: p, ty: m } = n.toObject();
7921
+ let f, _;
7927
7922
  return {
7928
7923
  clipOutsideUv: o,
7929
7924
  transformUv: (g, v) => {
7930
- p = g[v], _ = g[v + 1], g[v] = l * p + c * _ + u, g[v + 1] = d * p + f * _ + m;
7925
+ f = g[v], _ = g[v + 1], g[v] = l * f + c * _ + u, g[v + 1] = d * f + p * _ + m;
7931
7926
  }
7932
7927
  };
7933
7928
  }
@@ -8073,11 +8068,7 @@ class Xs extends F {
8073
8068
  );
8074
8069
  }
8075
8070
  _updateProperty(e, t, s) {
8076
- switch (super._updateProperty(e, t, s), e) {
8077
- case "fillWithShape":
8078
- this.parent.requestDraw();
8079
- break;
8080
- }
8071
+ super._updateProperty(e, t, s), e === "fillWithShape" && this.parent.requestDraw();
8081
8072
  }
8082
8073
  }
8083
8074
  Ln([
@@ -8095,11 +8086,7 @@ class js extends F {
8095
8086
  );
8096
8087
  }
8097
8088
  _updateProperty(e, t, s) {
8098
- switch (super._updateProperty(e, t, s), e) {
8099
- case "fillWithShape":
8100
- this.parent.requestDraw();
8101
- break;
8102
- }
8089
+ super._updateProperty(e, t, s), e === "fillWithShape" && this.parent.requestDraw();
8103
8090
  }
8104
8091
  }
8105
8092
  zn([
@@ -8209,7 +8196,7 @@ class Qe extends Ee {
8209
8196
  _path2DSet = new Pi();
8210
8197
  setProperties(e) {
8211
8198
  return super.setProperties(
8212
- V(e) ? void 0 : fi(e)
8199
+ V(e) ? void 0 : pi(e)
8213
8200
  );
8214
8201
  }
8215
8202
  _updateProperty(e, t, s) {
@@ -8273,13 +8260,13 @@ bt([
8273
8260
  bt([
8274
8261
  h()
8275
8262
  ], Qe.prototype, "paths");
8276
- class Ws extends fe {
8263
+ class Ws extends pe {
8277
8264
  constructor(e) {
8278
8265
  super(), this.setProperties(e);
8279
8266
  }
8280
8267
  }
8281
8268
  const es = {
8282
- ...pi(),
8269
+ ...fi(),
8283
8270
  left: 0,
8284
8271
  top: 0,
8285
8272
  width: 0,
@@ -8326,10 +8313,12 @@ class ae extends Ee {
8326
8313
  }
8327
8314
  }
8328
8315
  update() {
8329
- this.base.fonts = this.base.fonts ?? this.parent.tree?.fonts, this.base.update(), this._texture.width = Math.ceil(this.base.boundingBox.width), this._texture.height = Math.ceil(this.base.boundingBox.height), this.base.render({
8330
- view: this._texture.source,
8331
- pixelRatio: this._texture.pixelRatio
8332
- }), this._texture.requestUpdate("source"), this.parent.requestDraw();
8316
+ this.base.fonts = this.base.fonts ?? this.parent.tree?.fonts, this.base.update();
8317
+ const e = this._texture;
8318
+ e.width = Math.ceil(this.base.boundingBox.width), e.height = Math.ceil(this.base.boundingBox.height), this.base.render({
8319
+ view: e.source,
8320
+ pixelRatio: e.pixelRatio
8321
+ }), e.requestUpdate("source"), this.parent.requestDraw();
8333
8322
  }
8334
8323
  _updateTextureMap() {
8335
8324
  this._textureMap.clear();
@@ -8368,20 +8357,23 @@ class ae extends Ee {
8368
8357
  setContent(e) {
8369
8358
  this.content = mi(e);
8370
8359
  }
8360
+ getStringContent() {
8361
+ return this.base.toString();
8362
+ }
8371
8363
  measure() {
8372
8364
  return this.update(), this.base.measure();
8373
8365
  }
8374
8366
  isValid() {
8375
- return !!(this.enabled && !/^\s*$/.test(this.base.toString()));
8367
+ return !!(this.enabled && !/^\s*$/.test(this.getStringContent()));
8376
8368
  }
8377
8369
  _createTransformVertex() {
8378
8370
  const e = this.parent;
8379
8371
  if (e.scale.x > 0 && e.scale.y > 0)
8380
8372
  return;
8381
8373
  const t = e.scale.x * e.scale.y, s = e.pivot, i = new M().translate(-s.x, -s.y).scale(t > 0 ? 1 : -1, 1).translate(s.x, s.y), { a, c: o, tx: n, b: l, d: c, ty: u } = i.toObject();
8382
- let d, f;
8383
- return (m, p) => {
8384
- d = m[p], f = m[p + 1], m[p] = a * d + o * f + n, m[p + 1] = l * d + c * f + u;
8374
+ let d, p;
8375
+ return (m, f) => {
8376
+ d = m[f], p = m[f + 1], m[f] = a * d + o * p + n, m[f + 1] = l * d + c * p + u;
8385
8377
  };
8386
8378
  }
8387
8379
  useTextureDraw() {
@@ -8442,11 +8434,11 @@ class ae extends Ee {
8442
8434
  _textureDraw(e) {
8443
8435
  const { left: t = 0, top: s = 0, width: i, height: a } = this.base.boundingBox;
8444
8436
  e.fillStyle = this._texture, e.rect(t, s, i, a);
8445
- const o = new M().translate(-t, -s).scale(1 / i, 1 / a), { a: n, c: l, tx: c, b: u, d, ty: f } = o.toObject();
8446
- let m, p;
8437
+ const o = new M().translate(-t, -s).scale(1 / i, 1 / a), { a: n, c: l, tx: c, b: u, d, ty: p } = o.toObject();
8438
+ let m, f;
8447
8439
  e.fill({
8448
8440
  transformUv: (_, g) => {
8449
- m = _[g], p = _[g + 1], _[g] = n * m + l * p + c, _[g + 1] = u * m + d * p + f;
8441
+ m = _[g], f = _[g + 1], _[g] = n * m + l * f + c, _[g + 1] = u * m + d * f + p;
8450
8442
  },
8451
8443
  transformVertex: this._createTransformVertex()
8452
8444
  });
@@ -8801,7 +8793,7 @@ let Pe = class extends Ie {
8801
8793
  }
8802
8794
  flexbox = new Nr(this);
8803
8795
  size = new O().on("update", () => {
8804
- this.onUpdateStyleProperty("transform", this.style.transform, void 0), this.onUpdateStyleProperty("transformOrigin", this.style.transformOrigin, void 0), this.updateGlobalTransform(), this.requestDraw();
8796
+ this.onUpdateStyleProperty("transformOrigin", this.style.transformOrigin, void 0), this.onUpdateStyleProperty("transform", this.style.transform, void 0), this.updateGlobalTransform(), this.requestDraw();
8805
8797
  });
8806
8798
  _allowPointerEvents = !0;
8807
8799
  _overflowHidden = !1;
@@ -8896,7 +8888,7 @@ let Pe = class extends Ie {
8896
8888
  this.updateGlobalDisplay();
8897
8889
  break;
8898
8890
  case "rotate":
8899
- this.rotation = e * fr;
8891
+ this.rotation = e * pr;
8900
8892
  break;
8901
8893
  case "scaleX":
8902
8894
  this.scale.x = e, this.text.isValid() && (e ^ t) < 0 && this.requestDraw();
@@ -8911,12 +8903,12 @@ let Pe = class extends Ie {
8911
8903
  this.skew.y = e;
8912
8904
  break;
8913
8905
  case "transform":
8914
- Bo(
8906
+ this.extraTransform.identity(), this.extraTransform.translate(-this.pivot.x, -this.pivot.y), Bo(
8915
8907
  e ?? "",
8916
8908
  this.size.width,
8917
8909
  this.size.height,
8918
- this.extraTransform.identity()
8919
- ), this.updateGlobalTransform();
8910
+ this.extraTransform
8911
+ ), this.extraTransform.translate(this.pivot.x, this.pivot.y), this.updateGlobalTransform();
8920
8912
  break;
8921
8913
  case "transformOrigin": {
8922
8914
  const s = Lo(e ?? "");
@@ -9158,11 +9150,7 @@ let mr = class extends qs {
9158
9150
  super(), this.setProperties(r), this.append(e);
9159
9151
  }
9160
9152
  _updateProperty(r, e, t) {
9161
- switch (super._updateProperty(r, e, t), r) {
9162
- case "src":
9163
- this._load();
9164
- break;
9165
- }
9153
+ super._updateProperty(r, e, t), r === "src" && this._load();
9166
9154
  }
9167
9155
  _updateStyleProperty(r, e, t) {
9168
9156
  switch (super._updateStyleProperty(r, e, t), r) {
@@ -9232,11 +9220,7 @@ let gr = class extends qs {
9232
9220
  super(), this.setProperties(r), this.append(e);
9233
9221
  }
9234
9222
  _updateProperty(r, e, t) {
9235
- switch (super._updateProperty(r, e, t), r) {
9236
- case "src":
9237
- this._wait = this._load(e);
9238
- break;
9239
- }
9223
+ super._updateProperty(r, e, t), r === "src" && (this._wait = this._load(e));
9240
9224
  }
9241
9225
  waitLoad() {
9242
9226
  return this._wait;
@@ -9271,11 +9255,11 @@ var sl = Object.defineProperty, il = Object.getOwnPropertyDescriptor, jt = (r, e
9271
9255
  };
9272
9256
  const al = (r) => r, ol = yt(0.25, 0.1, 0.25, 1), nl = yt(0.42, 0, 1, 1), ll = yt(0, 0, 0.58, 1), cl = yt(0.42, 0, 0.58, 1);
9273
9257
  function yt(r, e, t, s) {
9274
- const a = 3 * r - 3 * t + 1, o = 3 * t - 6 * r, n = 3 * r, l = 3 * e - 3 * s + 1, c = 3 * s - 6 * e, u = 3 * e, d = (_) => (3 * a * _ + 2 * o) * _ + n, f = (_) => ((a * _ + o) * _ + n) * _, m = (_) => ((l * _ + c) * _ + u) * _;
9275
- function p(_) {
9258
+ const a = 3 * r - 3 * t + 1, o = 3 * t - 6 * r, n = 3 * r, l = 3 * e - 3 * s + 1, c = 3 * s - 6 * e, u = 3 * e, d = (_) => (3 * a * _ + 2 * o) * _ + n, p = (_) => ((a * _ + o) * _ + n) * _, m = (_) => ((l * _ + c) * _ + u) * _;
9259
+ function f(_) {
9276
9260
  let g = _, v, w;
9277
9261
  for (let k = 0; k < 8; k++) {
9278
- if (w = f(g) - _, Math.abs(w) < 1e-6)
9262
+ if (w = p(g) - _, Math.abs(w) < 1e-6)
9279
9263
  return g;
9280
9264
  if (v = d(g), Math.abs(v) < 1e-6)
9281
9265
  break;
@@ -9283,13 +9267,13 @@ function yt(r, e, t, s) {
9283
9267
  }
9284
9268
  let S = 1, C = 0;
9285
9269
  for (g = _; S > C; ) {
9286
- if (w = f(g) - _, Math.abs(w) < 1e-6)
9270
+ if (w = p(g) - _, Math.abs(w) < 1e-6)
9287
9271
  return g;
9288
9272
  w > 0 ? S = g : C = g, g = (S + C) / 2;
9289
9273
  }
9290
9274
  return g;
9291
9275
  }
9292
- return (_) => m(p(_));
9276
+ return (_) => m(f(_));
9293
9277
  }
9294
9278
  const ur = {
9295
9279
  linear: al,
@@ -9313,7 +9297,7 @@ let dt = class extends q {
9313
9297
  super._unparented(r), this.cancel();
9314
9298
  }
9315
9299
  _process() {
9316
- this.canProcess() && this.commitStyles();
9300
+ this.processable && this.commitStyles();
9317
9301
  }
9318
9302
  _updateProperty(r, e, t) {
9319
9303
  switch (super._updateProperty(r, e, t), r) {
@@ -9325,16 +9309,7 @@ let dt = class extends q {
9325
9309
  }
9326
9310
  _getTargets() {
9327
9311
  let r;
9328
- switch (this.effectMode) {
9329
- case "sibling":
9330
- r = this.getParent()?.getChildren(!0) ?? [];
9331
- break;
9332
- case "parent":
9333
- default:
9334
- r = [this.getParent()].filter(Boolean);
9335
- break;
9336
- }
9337
- return r.filter((e) => e instanceof Pe);
9312
+ return this.effectMode === "sibling" ? r = this.getParent()?.getChildren(!0) ?? [] : r = [this.getParent()].filter(Boolean), r.filter((e) => e instanceof Pe);
9338
9313
  }
9339
9314
  _updateKeyframes() {
9340
9315
  const r = [], e = this.keyframes;
@@ -9410,11 +9385,11 @@ let dt = class extends q {
9410
9385
  const {
9411
9386
  offset: u,
9412
9387
  easing: d
9413
- } = t, f = { ...t.props };
9414
- return e.forEach((m, p) => {
9415
- (!(p in f) || f[p] === null) && (f[p] = m), (!(p in c) || c[p] === null) && (c[p] = m);
9388
+ } = t, p = { ...t.props };
9389
+ return e.forEach((m, f) => {
9390
+ (!(f in p) || p[f] === null) && (p[f] = m), (!(f in c) || c[f] === null) && (c[f] = m);
9416
9391
  }), [
9417
- { offset: u, easing: d, props: f },
9392
+ { offset: u, easing: d, props: p },
9418
9393
  { offset: n, easing: l, props: c }
9419
9394
  ];
9420
9395
  }
@@ -9423,20 +9398,20 @@ let dt = class extends q {
9423
9398
  return null;
9424
9399
  }
9425
9400
  _commitStyle(r, e, t, s, i) {
9426
- const { offset: a, easing: o, props: n } = s, { offset: l, props: c } = i, u = l - a, d = o((r - a) / u), f = {
9401
+ const { offset: a, easing: o, props: n } = s, { offset: l, props: c } = i, u = l - a, d = o((r - a) / u), p = {
9427
9402
  width: e.size.x,
9428
9403
  height: e.size.y,
9429
9404
  fontSize: e.style.fontSize
9430
9405
  };
9431
- t.forEach((m, p) => {
9406
+ t.forEach((m, f) => {
9432
9407
  e.onUpdateStyleProperty(
9433
- p,
9408
+ f,
9434
9409
  this._getDiffValue(
9435
- p,
9436
- n[p],
9437
- c[p],
9410
+ f,
9411
+ n[f],
9412
+ c[f],
9438
9413
  d,
9439
- f
9414
+ p
9440
9415
  ),
9441
9416
  void 0
9442
9417
  );
@@ -9455,16 +9430,16 @@ let dt = class extends q {
9455
9430
  a = Et(r, String(e), i), o = Et(r, String(t), i);
9456
9431
  if (Array.isArray(a) && Array.isArray(o)) {
9457
9432
  const n = /* @__PURE__ */ new Set(), l = {}, c = {};
9458
- a.forEach(({ name: d, args: f }) => {
9459
- l[d] = f, n.add(d);
9460
- }), o.forEach(({ name: d, args: f }) => {
9461
- c[d] = f, n.add(d);
9433
+ a.forEach(({ name: d, args: p }) => {
9434
+ l[d] = p, n.add(d);
9435
+ }), o.forEach(({ name: d, args: p }) => {
9436
+ c[d] = p, n.add(d);
9462
9437
  });
9463
9438
  let u = "";
9464
9439
  return n.forEach((d) => {
9465
- const f = Math.max(l[d]?.length ?? 0, c[d]?.length ?? 0), m = l[d], p = c[d];
9466
- u += `${d}(${Array.from({ length: f }, (_, g) => {
9467
- const v = m?.[g], w = p?.[g], S = v?.normalizedIntValue ?? 0, C = w?.normalizedIntValue ?? 0;
9440
+ const p = Math.max(l[d]?.length ?? 0, c[d]?.length ?? 0), m = l[d], f = c[d];
9441
+ u += `${d}(${Array.from({ length: p }, (_, g) => {
9442
+ const v = m?.[g], w = f?.[g], S = v?.normalizedIntValue ?? 0, C = w?.normalizedIntValue ?? 0;
9468
9443
  return Number.isNaN(S) || Number.isNaN(C) ? w?.value ?? 0 : A(S, C, s);
9469
9444
  }).join(", ")}) `;
9470
9445
  }), u;
@@ -9848,7 +9823,7 @@ class Oe extends Zs {
9848
9823
  e.setValueAtTime ? e.setValueAtTime(t, this._context.currentTime) : e.value = t;
9849
9824
  }
9850
9825
  }
9851
- class fl extends de {
9826
+ class pl extends de {
9852
9827
  _audio = null;
9853
9828
  _sourceNode = null;
9854
9829
  _gain = null;
@@ -10003,7 +9978,7 @@ class fl extends de {
10003
9978
  super.destroy(), this._stop(), this._gain?.disconnect(), this._gain = null, this._audio?.context.off("refresh", this.refresh), this._audio?.context.off("refreshPaused", this.refreshPaused), this._audio = null, this._processors.forEach((e) => e.disconnect()), this._processors.length = 0, this._end = 0, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._elapsed = 0, this._duration = 0, this._paused = !1, this._muted = !1, this._pausedReal = !1;
10004
9979
  }
10005
9980
  }
10006
- class pl extends Zs {
9981
+ class fl extends Zs {
10007
9982
  constructor(e) {
10008
9983
  const t = Oe.audioContext, s = t.createBufferSource(), i = t.createGain(), a = t.createAnalyser();
10009
9984
  s.connect(a), a.connect(i), i.connect(Oe.instance.destination), super(a, i), this.parent = e, this._sourceNode = s, this.gain = i, this.analyser = a;
@@ -10050,7 +10025,7 @@ class pl extends Zs {
10050
10025
  return s.buffer = t.buffer, s.loop = t.loop, e.setParamValue(s.playbackRate, t.playbackRate.value), s.connect(i), i.connect(this.destination), { source: s, gain: i };
10051
10026
  }
10052
10027
  createSound() {
10053
- return new fl();
10028
+ return new pl();
10054
10029
  }
10055
10030
  }
10056
10031
  var _l = Object.defineProperty, ml = Object.getOwnPropertyDescriptor, gl = (r, e, t) => e in r ? _l(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, vl = (r, e, t, s) => {
@@ -10061,7 +10036,7 @@ var _l = Object.defineProperty, ml = Object.getOwnPropertyDescriptor, gl = (r, e
10061
10036
  let De = class extends q {
10062
10037
  _sounds = [];
10063
10038
  /** PlatformAudio */
10064
- _platformAudio = Li ? new pl(this) : new hl(this);
10039
+ _platformAudio = Li ? new fl(this) : new hl(this);
10065
10040
  get platformAudio() {
10066
10041
  return this._platformAudio;
10067
10042
  }
@@ -10187,7 +10162,7 @@ let De = class extends q {
10187
10162
  _prevTime = 0;
10188
10163
  _timer = 0;
10189
10164
  _process(r) {
10190
- if (super._process(r), this.canProcess()) {
10165
+ if (super._process(r), this.processable) {
10191
10166
  const e = this._tree?.timeline.currentTime ?? 0;
10192
10167
  e - this._prevTime > 0 && (this._timer || (this._setTimeStop(), this.play({
10193
10168
  start: this.start + (e - this.delay) % this.duration
@@ -10212,7 +10187,7 @@ var yl = Object.defineProperty, xl = Object.getOwnPropertyDescriptor, Wt = (r, e
10212
10187
  (o = r[a]) && (i = (s ? o(e, t, i) : o(i)) || i);
10213
10188
  return s && i && yl(e, t, i), i;
10214
10189
  };
10215
- let ft = class extends Pe {
10190
+ let pt = class extends Pe {
10216
10191
  _audioBuffer;
10217
10192
  _src = xr ? new x({
10218
10193
  source: document.createElement("canvas")
@@ -10257,13 +10232,13 @@ let ft = class extends Pe {
10257
10232
  a.fillStyle = this.color;
10258
10233
  const o = e.getChannelData(0), n = Math.ceil(o.length / s), l = i / 2;
10259
10234
  for (let c = 1, u = -1, d = 0; d < s; d++) {
10260
- for (let f = 0; f < n; f++) {
10261
- const m = o[d * n + f];
10235
+ for (let p = 0; p < n; p++) {
10236
+ const m = o[d * n + p];
10262
10237
  m < c && (c = m), m > u && (u = m);
10263
10238
  }
10264
10239
  if (!this.gap || d % (this.gap * 2) === 0) {
10265
- const f = d, m = (1 + c) * l, p = this.gap || 1, _ = Math.max(1, (u - c) * l);
10266
- a.fillRect(f, m, p, _), c = 1, u = -1;
10240
+ const p = d, m = (1 + c) * l, f = this.gap || 1, _ = Math.max(1, (u - c) * l);
10241
+ a.fillRect(p, m, f, _), c = 1, u = -1;
10267
10242
  }
10268
10243
  }
10269
10244
  this._src?.requestUpdate("source"), this.requestDraw();
@@ -10274,16 +10249,16 @@ let ft = class extends Pe {
10274
10249
  };
10275
10250
  Wt([
10276
10251
  h()
10277
- ], ft.prototype, "src", 2);
10252
+ ], pt.prototype, "src", 2);
10278
10253
  Wt([
10279
10254
  h({ fallback: 0 })
10280
- ], ft.prototype, "gap", 2);
10255
+ ], pt.prototype, "gap", 2);
10281
10256
  Wt([
10282
10257
  h({ fallback: "#000000" })
10283
- ], ft.prototype, "color", 2);
10284
- ft = Wt([
10258
+ ], pt.prototype, "color", 2);
10259
+ pt = Wt([
10285
10260
  b("AudioWaveform")
10286
- ], ft);
10261
+ ], pt);
10287
10262
  var wl = Object.defineProperty, Pl = Object.getOwnPropertyDescriptor, El = (r, e, t) => e in r ? wl(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, Sl = (r, e, t, s) => {
10288
10263
  for (var i = s > 1 ? void 0 : s ? Pl(e, t) : e, a = r.length - 1, o; a >= 0; a--)
10289
10264
  (o = r[a]) && (i = o(i) || i);
@@ -10303,14 +10278,14 @@ let Bt = class extends Ve {
10303
10278
  for (let w = 1; w < o; w++)
10304
10279
  g -= v, u.push(g);
10305
10280
  }
10306
- const d = 1 / n, f = 1 / l, m = [];
10307
- let p;
10281
+ const d = 1 / n, p = 1 / l, m = [];
10282
+ let f;
10308
10283
  const _ = o - 1;
10309
10284
  for (let g = 0; g < _; g++)
10310
- p = u[g] + 0.5, m[0] = p * d, m[1] = p * f, c.push({
10285
+ f = u[g] + 0.5, m[0] = f * d, m[1] = f * p, c.push({
10311
10286
  offset: m
10312
10287
  });
10313
- p = u[_] + 0.5, m[0] = p * d, m[1] = p * f, c.push({
10288
+ f = u[_] + 0.5, m[0] = f * d, m[1] = f * p, c.push({
10314
10289
  offset: m
10315
10290
  }), c.forEach((g) => {
10316
10291
  P.draw(r, Bt.material, {
@@ -10404,36 +10379,36 @@ var Il = Object.defineProperty, Ml = Object.getOwnPropertyDescriptor, Nl = (r, e
10404
10379
  (o = r[a]) && (i = o(i) || i);
10405
10380
  return i;
10406
10381
  }, Ul = (r, e, t) => Nl(r, e + "", t);
10407
- let pt = class extends Ve {
10382
+ let ft = class extends Ve {
10408
10383
  blur = 100;
10409
10384
  gradientBlur = 600;
10410
10385
  apply(r, e) {
10411
10386
  const t = this.currentTimeProgress;
10412
10387
  let s, i;
10413
10388
  t < 0.5 ? (s = 0, i = (0.5 - t) / 0.5) : (s = 1, i = (t - 0.5) / 0.5);
10414
- const a = e.width, o = e.height, n = [0, o / 2], l = [600, o / 2], c = [a, o], u = l[0] - n[0], d = l[1] - n[1], f = Math.sqrt(u * u + d * d);
10415
- P.draw(r, pt.material, {
10389
+ const a = e.width, o = e.height, n = [0, o / 2], l = [600, o / 2], c = [a, o], u = l[0] - n[0], d = l[1] - n[1], p = Math.sqrt(u * u + d * d);
10390
+ P.draw(r, ft.material, {
10416
10391
  sampler: s,
10417
10392
  progress: i,
10418
10393
  blur: this.blur,
10419
10394
  gradientBlur: this.gradientBlur,
10420
10395
  start: n,
10421
10396
  end: l,
10422
- delta: [u / f, d / f],
10397
+ delta: [u / p, d / p],
10423
10398
  texSize: c
10424
- }), P.draw(r, pt.material, {
10399
+ }), P.draw(r, ft.material, {
10425
10400
  sampler: s,
10426
10401
  progress: i,
10427
10402
  blur: this.blur,
10428
10403
  gradientBlur: this.gradientBlur,
10429
10404
  start: n,
10430
10405
  end: l,
10431
- delta: [-d / f, u / f],
10406
+ delta: [-d / p, u / p],
10432
10407
  texSize: c
10433
10408
  });
10434
10409
  }
10435
10410
  };
10436
- Ul(pt, "material", new E({
10411
+ Ul(ft, "material", new E({
10437
10412
  gl: {
10438
10413
  vertex: `attribute vec2 position;
10439
10414
  attribute vec2 uv;
@@ -10483,9 +10458,9 @@ void main(void) {
10483
10458
  }`
10484
10459
  }
10485
10460
  }));
10486
- pt = kl([
10461
+ ft = kl([
10487
10462
  b("TiltShiftTransition")
10488
- ], pt);
10463
+ ], ft);
10489
10464
  var Bl = Object.defineProperty, Ll = Object.getOwnPropertyDescriptor, Fl = (r, e, t) => e in r ? Bl(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, zl = (r, e, t, s) => {
10490
10465
  for (var i = s > 1 ? void 0 : s ? Ll(e, t) : e, a = r.length - 1, o; a >= 0; a--)
10491
10466
  (o = r[a]) && (i = o(i) || i);
@@ -10797,7 +10772,7 @@ const Fe = {
10797
10772
  preserveDrawingBuffer: !1,
10798
10773
  powerPreference: "default"
10799
10774
  };
10800
- class Ur extends pe {
10775
+ class Ur extends fe {
10801
10776
  renderer;
10802
10777
  get view() {
10803
10778
  return this.renderer.view;
@@ -10973,18 +10948,18 @@ async function ec(r) {
10973
10948
  preserveDrawingBuffer: !0
10974
10949
  }), U.resetProperties(), U.setProperties(c), U.debug = e, U.fonts = t, U.timeline.currentTime = 0, U.resize(s, i, !0), U.root.removeChildren(), U.root.append(a), await n?.(U), await U.waitAndRender(), o.length && await new Promise((u) => {
10975
10950
  let d = 0;
10976
- const f = o.length, m = o[f - 1];
10977
- async function p() {
10978
- if (d === f)
10951
+ const p = o.length, m = o[p - 1];
10952
+ async function f() {
10953
+ if (d === p)
10979
10954
  return u();
10980
10955
  const _ = o[d++], v = (o[d] || _) - _;
10981
10956
  U.timeline.currentTime = _, U.render(), await l?.(U.toPixels(), {
10982
10957
  currentTime: _,
10983
10958
  duration: v,
10984
10959
  progress: m !== 0 ? _ / m : 1
10985
- }), requestAnimationFrame(p);
10960
+ }), requestAnimationFrame(f);
10986
10961
  }
10987
- p();
10962
+ f();
10988
10963
  }), U.toCanvas2D();
10989
10964
  }
10990
10965
  async function yc(r) {
@@ -11001,7 +10976,7 @@ export {
11001
10976
  Zs as AudioPipeline,
11002
10977
  vc as AudioProcessor,
11003
10978
  bc as AudioSpectrum,
11004
- ft as AudioWaveform,
10979
+ pt as AudioWaveform,
11005
10980
  ye as BufferUsage,
11006
10981
  Nt as Camera2D,
11007
10982
  ho as CanvasContext,
@@ -11010,13 +10985,13 @@ export {
11010
10985
  ne as Color,
11011
10986
  j as ColorAdjustEffect,
11012
10987
  $e as ColorFilterEffect,
11013
- fs as ColorMatrix,
10988
+ ps as ColorMatrix,
11014
10989
  He as ColorOverlayEffect,
11015
10990
  Xe as ColorRemoveEffect,
11016
10991
  je as ColorReplaceEffect,
11017
10992
  Er as ColorTexture,
11018
10993
  Ee as CoreObject,
11019
- fr as DEG_TO_RAD,
10994
+ pr as DEG_TO_RAD,
11020
10995
  hs as DEVICE_PIXEL_RATIO,
11021
10996
  Y as DrawboardEffect,
11022
10997
  re as DropShadowEffect,
@@ -11077,10 +11052,10 @@ export {
11077
11052
  Me as MaskEffect,
11078
11053
  E as Material,
11079
11054
  le as Matrix,
11080
- fc as Matrix2,
11081
- ps as Matrix3,
11055
+ pc as Matrix2,
11056
+ fs as Matrix3,
11082
11057
  Qi as Matrix4,
11083
- fo as Meta,
11058
+ po as Meta,
11084
11059
  ds as MouseInputEvent,
11085
11060
  I as Node,
11086
11061
  Ie as Node2D,
@@ -11098,7 +11073,7 @@ export {
11098
11073
  Ji as RefCounted,
11099
11074
  te as RenderTarget,
11100
11075
  Pr as Renderer,
11101
- fe as Resource,
11076
+ pe as Resource,
11102
11077
  ns as SUPPORTS_AUDIO_CONTEXT,
11103
11078
  Ui as SUPPORTS_CLICK_EVENTS,
11104
11079
  cc as SUPPORTS_CREATE_IMAGE_BITMAP,
@@ -11113,13 +11088,13 @@ export {
11113
11088
  Bi as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT,
11114
11089
  Li as SUPPORTS_WEB_AUDIO,
11115
11090
  ki as SUPPORTS_WHEEL_EVENTS,
11116
- pe as SceneTree,
11091
+ fe as SceneTree,
11117
11092
  Xl as TextLoader,
11118
11093
  x as Texture2D,
11119
11094
  jl as TextureLoader,
11120
11095
  qs as TextureRect2D,
11121
11096
  B as Ticker,
11122
- pt as TiltShiftTransition,
11097
+ ft as TiltShiftTransition,
11123
11098
  he as Timeline,
11124
11099
  q as TimelineNode,
11125
11100
  M as Transform2D,
@@ -11130,7 +11105,7 @@ export {
11130
11105
  Mt as UvMaterial,
11131
11106
  Q as Vector,
11132
11107
  O as Vector2,
11133
- pc as Vector3,
11108
+ fc as Vector3,
11134
11109
  ea as Vector4,
11135
11110
  H as VertexAttribute,
11136
11111
  xe as VertexBuffer,
@@ -11139,9 +11114,9 @@ export {
11139
11114
  co as VideoTexture,
11140
11115
  X as Viewport,
11141
11116
  Tr as ViewportTexture,
11142
- pl as WebAudio,
11117
+ fl as WebAudio,
11143
11118
  Oe as WebAudioContext,
11144
- fl as WebSound,
11119
+ pl as WebSound,
11145
11120
  Yi as WheelInputEvent,
11146
11121
  _r as Window,
11147
11122
  we as ZoomBlurEffect,