modern-canvas 0.24.2 → 0.24.4

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
@@ -531,7 +531,7 @@ var ut = class e {
531
531
  destroy() {
532
532
  this.destroyed || (this.destroyed = !0, this._destroy(), this.emit("destroy"), this.removeAllListeners());
533
533
  }
534
- }, _t = class extends T {}, E = class extends _t {}, vt = class e {
534
+ }, _t = class extends T {}, vt = class extends _t {}, yt = class e {
535
535
  get x() {
536
536
  return this.min.x;
537
537
  }
@@ -665,7 +665,7 @@ var ut = class e {
665
665
  //#endregion
666
666
  //#region src/core/math/Color.ts
667
667
  pe([me]);
668
- var yt = class {
668
+ var E = class {
669
669
  get value() {
670
670
  return this._value;
671
671
  }
@@ -749,15 +749,15 @@ var yt = class {
749
749
  ];
750
750
  }
751
751
  }, bt = xe / 180, xt = 180 / xe;
752
- function St(e, t, n) {
752
+ function D(e, t, n) {
753
753
  return Math.max(t, Math.min(e, n));
754
754
  }
755
- function D(e, t, n) {
755
+ function O(e, t, n) {
756
756
  return (1 - n) * e + n * t;
757
757
  }
758
758
  //#endregion
759
759
  //#region src/core/math/ColorMatrix.ts
760
- var Ct = class {
760
+ var St = class {
761
761
  _array = new Float32Array(20);
762
762
  constructor() {
763
763
  this.identity();
@@ -887,7 +887,7 @@ var Ct = class {
887
887
  ]);
888
888
  }
889
889
  invert(e = 1) {
890
- let t = D(1, -1, e), n = D(0, 255, e);
890
+ let t = O(1, -1, e), n = O(0, 255, e);
891
891
  return this.multiply([
892
892
  t,
893
893
  0,
@@ -912,21 +912,21 @@ var Ct = class {
912
912
  ]);
913
913
  }
914
914
  sepia(e = 1) {
915
- let t = St(e, 0, 1);
915
+ let t = D(e, 0, 1);
916
916
  return this.multiply([
917
- D(1, .393, t),
918
- D(0, .7689999, t),
919
- D(0, .18899999, t),
917
+ O(1, .393, t),
918
+ O(0, .7689999, t),
919
+ O(0, .18899999, t),
920
920
  0,
921
921
  0,
922
- D(0, .349, t),
923
- D(1, .6859999, t),
924
- D(0, .16799999, t),
922
+ O(0, .349, t),
923
+ O(1, .6859999, t),
924
+ O(0, .16799999, t),
925
925
  0,
926
926
  0,
927
- D(0, .272, t),
928
- D(0, .5339999, t),
929
- D(1, .13099999, t),
927
+ O(0, .272, t),
928
+ O(0, .5339999, t),
929
+ O(1, .13099999, t),
930
930
  0,
931
931
  0,
932
932
  0,
@@ -961,7 +961,7 @@ var Ct = class {
961
961
  ]);
962
962
  }
963
963
  grayscale(e = 1) {
964
- let t = St(e, 0, 1), n = D(1, .3, t), r = D(0, .3, t), i = D(1, .59, t), a = D(0, .59, t), o = D(1, .11, t), s = D(0, .11, t);
964
+ let t = D(e, 0, 1), n = O(1, .3, t), r = O(0, .3, t), i = O(1, .59, t), a = O(0, .59, t), o = O(1, .11, t), s = O(0, .11, t);
965
965
  return this.multiply([
966
966
  n,
967
967
  a,
@@ -1013,7 +1013,7 @@ var Ct = class {
1013
1013
  toArray() {
1014
1014
  return this._array;
1015
1015
  }
1016
- }, wt = class e extends vt {
1016
+ }, Ct = class e extends yt {
1017
1017
  rotation;
1018
1018
  get rotationDegrees() {
1019
1019
  return this.rotation / bt;
@@ -1068,7 +1068,7 @@ var Ct = class {
1068
1068
  clone() {
1069
1069
  return new e(this.toJSON());
1070
1070
  }
1071
- }, Tt = class {
1071
+ }, wt = class {
1072
1072
  _array;
1073
1073
  x = 0;
1074
1074
  y = 0;
@@ -1092,12 +1092,12 @@ var Ct = class {
1092
1092
  };
1093
1093
  //#endregion
1094
1094
  //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateMetadata.js
1095
- function O(e, t) {
1095
+ function k(e, t) {
1096
1096
  if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
1097
1097
  }
1098
1098
  //#endregion
1099
1099
  //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
1100
- function k(e, t, n, r) {
1100
+ function A(e, t, n, r) {
1101
1101
  var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
1102
1102
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
1103
1103
  else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
@@ -1105,7 +1105,7 @@ function k(e, t, n, r) {
1105
1105
  }
1106
1106
  //#endregion
1107
1107
  //#region src/core/os/MainLoop.ts
1108
- var Et = class extends T {
1108
+ var Tt = class extends T {
1109
1109
  _starting = !1;
1110
1110
  _nextDeltaTime = 0;
1111
1111
  _startedProcess;
@@ -1135,22 +1135,22 @@ var Et = class extends T {
1135
1135
  super._destroy(), this.stop();
1136
1136
  }
1137
1137
  };
1138
- k([_({ fallback: 60 }), O("design:type", Number)], Et.prototype, "fps", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Et.prototype, "speed", void 0);
1138
+ A([_({ fallback: 60 }), k("design:type", Number)], Tt.prototype, "fps", void 0), A([_({ fallback: 1 }), k("design:type", Number)], Tt.prototype, "speed", void 0);
1139
1139
  //#endregion
1140
1140
  //#region src/core/renderers/gl/buffer/const.ts
1141
- var Dt = /* @__PURE__ */ function(e) {
1141
+ var Et = /* @__PURE__ */ function(e) {
1142
1142
  return e[e.elementArrayBuffer = 34963] = "elementArrayBuffer", e[e.arrayBuffer = 34962] = "arrayBuffer", e[e.uniformBuffer = 35345] = "uniformBuffer", e;
1143
- }({}), Ot = class {
1143
+ }({}), Dt = class {
1144
1144
  native;
1145
- target = Dt.arrayBuffer;
1145
+ target = Et.arrayBuffer;
1146
1146
  byteLength = 0;
1147
1147
  dirty = !0;
1148
1148
  constructor(e) {
1149
1149
  this.native = e;
1150
1150
  }
1151
- }, A = /* @__PURE__ */ function(e) {
1151
+ }, j = /* @__PURE__ */ function(e) {
1152
1152
  return e[e.mapRead = 1] = "mapRead", e[e.mapWrite = 2] = "mapWrite", e[e.copySrc = 4] = "copySrc", e[e.copyDst = 8] = "copyDst", e[e.index = 16] = "index", e[e.vertex = 32] = "vertex", e[e.uniform = 64] = "uniform", e[e.storage = 128] = "storage", e[e.indirect = 256] = "indirect", e[e.queryResolve = 512] = "queryResolve", e[e.static = 1024] = "static", e;
1153
- }({}), kt = class extends n {
1153
+ }({}), Ot = class extends n {
1154
1154
  screen = {
1155
1155
  x: 0,
1156
1156
  y: 0,
@@ -1169,12 +1169,12 @@ var Dt = /* @__PURE__ */ function(e) {
1169
1169
  this.view && (this.view.width = Math.floor(e * this.pixelRatio), this.view.height = Math.floor(t * this.pixelRatio)), this.screen.width = e, this.screen.height = t, n && this.view && (this.view.style.width = `${e}px`, this.view.style.height = `${t}px`);
1170
1170
  }
1171
1171
  };
1172
- k([_({ fallback: Je }), O("design:type", Number)], kt.prototype, "pixelRatio", void 0), k([_({ internal: !0 }), O("design:type", typeof HTMLCanvasElement > "u" ? Object : HTMLCanvasElement)], kt.prototype, "view", void 0);
1172
+ A([_({ fallback: Je }), k("design:type", Number)], Ot.prototype, "pixelRatio", void 0), A([_({ internal: !0 }), k("design:type", typeof HTMLCanvasElement > "u" ? Object : HTMLCanvasElement)], Ot.prototype, "view", void 0);
1173
1173
  //#endregion
1174
1174
  //#region src/core/renderers/shared/shader/UniformGroup.ts
1175
- var At = 0, jt = class {
1175
+ var kt = 0, At = class {
1176
1176
  isUniformGroup = !0;
1177
- uid = ++At;
1177
+ uid = ++kt;
1178
1178
  uniforms;
1179
1179
  ubo;
1180
1180
  isStatic;
@@ -1185,14 +1185,14 @@ var At = 0, jt = class {
1185
1185
  update() {
1186
1186
  this._dirtyId++;
1187
1187
  }
1188
- }, Mt = Object.create(null), Nt = Object.create(null);
1189
- function Pt(e, t) {
1190
- let n = Nt[e];
1191
- return n === void 0 && (Mt[t] === void 0 && (Mt[t] = 1), Nt[e] = n = Mt[t]++), n;
1188
+ }, jt = Object.create(null), Mt = Object.create(null);
1189
+ function Nt(e, t) {
1190
+ let n = Mt[e];
1191
+ return n === void 0 && (jt[t] === void 0 && (jt[t] = 1), Mt[e] = n = jt[t]++), n;
1192
1192
  }
1193
1193
  //#endregion
1194
1194
  //#region src/core/renderers/gl/system/GlSystem.ts
1195
- var j = class extends e {
1195
+ var M = class extends e {
1196
1196
  get _gl() {
1197
1197
  return this._renderer.gl;
1198
1198
  }
@@ -1206,7 +1206,7 @@ var j = class extends e {
1206
1206
  _setup() {}
1207
1207
  flush() {}
1208
1208
  reset() {}
1209
- }, Ft = class extends j {
1209
+ }, Pt = class extends M {
1210
1210
  install(e) {
1211
1211
  super.install(e), e.buffer = this;
1212
1212
  }
@@ -1216,8 +1216,8 @@ var j = class extends e {
1216
1216
  return this.glBuffers.get(e.instanceId) || this._createGlBuffer(e);
1217
1217
  }
1218
1218
  _createGlBuffer(e) {
1219
- let t = this._gl, n = new Ot(t.createBuffer()), r = Dt.arrayBuffer;
1220
- return e.usage & A.index ? r = Dt.elementArrayBuffer : e.usage & A.uniform && (r = Dt.uniformBuffer), n.target = r, this.glBuffers.set(e.instanceId, n), this.buffers.get(e.instanceId) || ("on" in e && (e.on("updateProperty", (e) => {
1219
+ let t = this._gl, n = new Dt(t.createBuffer()), r = Et.arrayBuffer;
1220
+ return e.usage & j.index ? r = Et.elementArrayBuffer : e.usage & j.uniform && (r = Et.uniformBuffer), n.target = r, this.glBuffers.set(e.instanceId, n), this.buffers.get(e.instanceId) || ("on" in e && (e.on("updateProperty", (e) => {
1221
1221
  switch (e) {
1222
1222
  case "usage":
1223
1223
  case "data":
@@ -1240,7 +1240,7 @@ var j = class extends e {
1240
1240
  n.dirty = !1;
1241
1241
  let { _gl: r } = this, { usage: i, data: a } = e;
1242
1242
  r.bindBuffer(n.target, n.native);
1243
- let o = i & A.static ? r.STATIC_DRAW : r.DYNAMIC_DRAW;
1243
+ let o = i & j.static ? r.STATIC_DRAW : r.DYNAMIC_DRAW;
1244
1244
  if (a) if (n.byteLength >= a.byteLength) {
1245
1245
  let e = a.length * a.BYTES_PER_ELEMENT;
1246
1246
  r.bufferSubData(n.target, 0, a, 0, e / a.BYTES_PER_ELEMENT);
@@ -1255,13 +1255,13 @@ var j = class extends e {
1255
1255
  }
1256
1256
  this.buffers.clear(), this.glBuffers.clear();
1257
1257
  }
1258
- }, It;
1259
- function Lt() {
1260
- return It ||= "mediump", It;
1258
+ }, Ft;
1259
+ function It() {
1260
+ return Ft ||= "mediump", Ft;
1261
1261
  }
1262
1262
  //#endregion
1263
1263
  //#region src/core/renderers/gl/shader/preprocessors/addProgramDefines.ts
1264
- function Rt(e, t, n) {
1264
+ function Lt(e, t, n) {
1265
1265
  return t ? e : n ? (e = e.replace("out vec4 finalColor;", ""), `#ifdef GL_ES
1266
1266
  #define in varying
1267
1267
  #define finalColor gl_FragColor
@@ -1275,7 +1275,7 @@ ${e}`;
1275
1275
  }
1276
1276
  //#endregion
1277
1277
  //#region src/core/renderers/gl/shader/preprocessors/ensurePrecision.ts
1278
- function zt(e, t, n) {
1278
+ function Rt(e, t, n) {
1279
1279
  let r = n ? t.maxSupportedFragmentPrecision : t.maxSupportedVertexPrecision;
1280
1280
  if (e.substring(0, 9) !== "precision") {
1281
1281
  let i = n ? t.requestedFragmentPrecision : t.requestedVertexPrecision;
@@ -1285,31 +1285,31 @@ function zt(e, t, n) {
1285
1285
  }
1286
1286
  //#endregion
1287
1287
  //#region src/core/renderers/gl/shader/preprocessors/insertVersion.ts
1288
- function Bt(e, t) {
1288
+ function zt(e, t) {
1289
1289
  return t ? `#version 300 es\n${e}` : e;
1290
1290
  }
1291
1291
  //#endregion
1292
1292
  //#region src/core/renderers/gl/shader/preprocessors/setProgramName.ts
1293
- var Vt = {}, Ht = {};
1294
- function Ut(e, { name: t = "program" }, n = !0) {
1293
+ var Bt = {}, Vt = {};
1294
+ function Ht(e, { name: t = "program" }, n = !0) {
1295
1295
  t = t.replace(/\s+/g, "-"), t += n ? "-fragment" : "-vertex";
1296
- let r = n ? Vt : Ht;
1296
+ let r = n ? Bt : Vt;
1297
1297
  return r[t] ? (r[t]++, t += `-${r[t]}`) : r[t] = 1, e.includes("#define SHADER_NAME") ? e : `${`#define SHADER_NAME ${t}`}\n${e}`;
1298
1298
  }
1299
1299
  //#endregion
1300
1300
  //#region src/core/renderers/gl/shader/preprocessors/stripVersion.ts
1301
- function Wt(e, t) {
1301
+ function Ut(e, t) {
1302
1302
  return t ? e.replace("#version 300 es", "") : e;
1303
1303
  }
1304
1304
  //#endregion
1305
1305
  //#region src/core/renderers/gl/shader/GlProgram.ts
1306
- var Gt = Object.create(null), Kt = {
1307
- stripVersion: Wt,
1308
- ensurePrecision: zt,
1309
- addProgramDefines: Rt,
1310
- setProgramName: Ut,
1311
- insertVersion: Bt
1312
- }, qt = class e {
1306
+ var Wt = Object.create(null), Gt = {
1307
+ stripVersion: Ut,
1308
+ ensurePrecision: Rt,
1309
+ addProgramDefines: Lt,
1310
+ setProgramName: Ht,
1311
+ insertVersion: zt
1312
+ }, Kt = class e {
1313
1313
  static defaultOptions = {
1314
1314
  preferredVertexPrecision: "highp",
1315
1315
  preferredFragmentPrecision: "mediump"
@@ -1332,25 +1332,25 @@ var Gt = Object.create(null), Kt = {
1332
1332
  requestedFragmentPrecision: t.preferredFragmentPrecision,
1333
1333
  requestedVertexPrecision: t.preferredVertexPrecision,
1334
1334
  maxSupportedVertexPrecision: "highp",
1335
- maxSupportedFragmentPrecision: Lt()
1335
+ maxSupportedFragmentPrecision: It()
1336
1336
  },
1337
1337
  setProgramName: { name: t.name },
1338
1338
  addProgramDefines: i,
1339
1339
  insertVersion: i
1340
1340
  };
1341
- Object.keys(Kt).forEach((e) => {
1341
+ Object.keys(Gt).forEach((e) => {
1342
1342
  let t = a[e];
1343
- n = Kt[e](n, t, !0), r = Kt[e](r, t, !1);
1344
- }), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id = Pt(`${r}:${n}`, "GlProgram");
1343
+ n = Gt[e](n, t, !0), r = Gt[e](r, t, !1);
1344
+ }), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id = Nt(`${r}:${n}`, "GlProgram");
1345
1345
  }
1346
1346
  destroy() {
1347
- this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete Gt[this._cacheKey];
1347
+ this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete Wt[this._cacheKey];
1348
1348
  }
1349
1349
  static from(t) {
1350
1350
  let n = `${t.vertex}:${t.fragment}`;
1351
- return Gt[n] || (Gt[n] = new e(t), Gt[n]._cacheKey = n), Gt[n];
1351
+ return Wt[n] || (Wt[n] = new e(t), Wt[n]._cacheKey = n), Wt[n];
1352
1352
  }
1353
- }, Jt = {
1353
+ }, qt = {
1354
1354
  uint8x2: {
1355
1355
  size: 2,
1356
1356
  stride: 2,
@@ -1502,18 +1502,18 @@ var Gt = Object.create(null), Kt = {
1502
1502
  normalized: !1
1503
1503
  }
1504
1504
  };
1505
- function Yt(e) {
1506
- return Jt[e] ?? Jt.float32;
1505
+ function Jt(e) {
1506
+ return qt[e] ?? qt.float32;
1507
1507
  }
1508
1508
  //#endregion
1509
1509
  //#region src/core/renderers/gl/shader/GlProgramData.ts
1510
- var Xt = class {
1510
+ var Yt = class {
1511
1511
  native;
1512
1512
  uniformDirtyGroups = Object.create(null);
1513
1513
  constructor(e) {
1514
1514
  this.native = e;
1515
1515
  }
1516
- }, Zt, Qt = {
1516
+ }, Xt, Zt = {
1517
1517
  FLOAT: "float",
1518
1518
  FLOAT_VEC2: "vec2",
1519
1519
  FLOAT_VEC3: "vec3",
@@ -1542,7 +1542,7 @@ var Xt = class {
1542
1542
  SAMPLER_2D_ARRAY: "sampler2DArray",
1543
1543
  INT_SAMPLER_2D_ARRAY: "sampler2DArray",
1544
1544
  UNSIGNED_INT_SAMPLER_2D_ARRAY: "sampler2DArray"
1545
- }, $t = {
1545
+ }, Qt = {
1546
1546
  float: "float32",
1547
1547
  vec2: "float32x2",
1548
1548
  vec3: "float32x3",
@@ -1560,29 +1560,29 @@ var Xt = class {
1560
1560
  bvec3: "uint32x3",
1561
1561
  bvec4: "uint32x4"
1562
1562
  };
1563
- function en(e, t) {
1564
- if (!Zt) {
1565
- let t = Object.keys(Qt);
1566
- Zt = {};
1563
+ function $t(e, t) {
1564
+ if (!Xt) {
1565
+ let t = Object.keys(Zt);
1566
+ Xt = {};
1567
1567
  for (let n = 0; n < t.length; ++n) {
1568
1568
  let r = t[n];
1569
- Zt[e[r]] = Qt[r];
1569
+ Xt[e[r]] = Zt[r];
1570
1570
  }
1571
1571
  }
1572
- return Zt[t];
1572
+ return Xt[t];
1573
1573
  }
1574
- function tn(e, t) {
1575
- return $t[en(e, t)] || "float32";
1574
+ function en(e, t) {
1575
+ return Qt[$t(e, t)] || "float32";
1576
1576
  }
1577
1577
  //#endregion
1578
1578
  //#region src/core/renderers/gl/shader/GlShaderSystem.ts
1579
- var nn = class extends j {
1579
+ var tn = class extends M {
1580
1580
  install(e) {
1581
1581
  super.install(e), e.shader = this;
1582
1582
  }
1583
1583
  glProgramDatas = /* @__PURE__ */ new Map();
1584
1584
  currentProgram = null;
1585
- globalUniforms = new jt({
1585
+ globalUniforms = new At({
1586
1586
  projectionMatrix: new Float32Array([
1587
1587
  1,
1588
1588
  0,
@@ -1623,7 +1623,7 @@ var nn = class extends j {
1623
1623
  return this.glProgramDatas.get(e.id) || this._createGlProgramData(e);
1624
1624
  }
1625
1625
  _createGlProgramData(e) {
1626
- let t = this._gl, n = new Xt(t.createProgram());
1626
+ let t = this._gl, n = new Yt(t.createProgram());
1627
1627
  this.glProgramDatas.set(e.id, n), this.useProgram(e);
1628
1628
  let r = this._createGlShader(e.vertex, t.VERTEX_SHADER), i = this._createGlShader(e.fragment, t.FRAGMENT_SHADER);
1629
1629
  if (t.attachShader(n.native, r), t.attachShader(n.native, i), t.linkProgram(n.native), !t.getProgramParameter(n.native, t.LINK_STATUS)) throw Error(`Failed to link program: ${t.getProgramInfoLog(n.native)}`);
@@ -1631,11 +1631,11 @@ var nn = class extends j {
1631
1631
  for (let e = t.getProgramParameter(n.native, t.ACTIVE_ATTRIBUTES), r = 0; r < e; r++) {
1632
1632
  let e = t.getActiveAttrib(n.native, r);
1633
1633
  if (!e || e.name.startsWith("gl_")) continue;
1634
- let i = tn(t, e.type);
1634
+ let i = en(t, e.type);
1635
1635
  a[e.name] = {
1636
1636
  location: 0,
1637
1637
  format: i,
1638
- stride: Yt(i).stride,
1638
+ stride: Jt(i).stride,
1639
1639
  offset: 0,
1640
1640
  instance: !1,
1641
1641
  start: 0
@@ -1652,7 +1652,7 @@ var nn = class extends j {
1652
1652
  for (let e = t.getProgramParameter(n.native, t.ACTIVE_UNIFORMS), r = 0; r < e; r++) {
1653
1653
  let e = t.getActiveUniform(n.native, r);
1654
1654
  if (!e) continue;
1655
- let i = e.name.replace(/\[.*?\]$/, ""), a = en(t, e.type), o = e.size;
1655
+ let i = e.name.replace(/\[.*?\]$/, ""), a = $t(t, e.type), o = e.size;
1656
1656
  c[i] = {
1657
1657
  name: i,
1658
1658
  index: r,
@@ -1687,7 +1687,7 @@ var nn = class extends j {
1687
1687
  let { type: s, isArray: c, name: l } = o;
1688
1688
  o.location === void 0 && (o.location = r.getUniformLocation(t.native, l));
1689
1689
  let u = o.location;
1690
- if (rn(o.value, a)) switch (o.value = an(o.value, a), s) {
1690
+ if (nn(o.value, a)) switch (o.value = rn(o.value, a), s) {
1691
1691
  case "float":
1692
1692
  c ? r.uniform1fv(u, a) : r.uniform1f(u, a);
1693
1693
  break;
@@ -1774,7 +1774,7 @@ var nn = class extends j {
1774
1774
  super.destroy(), this.bind(null);
1775
1775
  }
1776
1776
  };
1777
- function rn(e, t) {
1777
+ function nn(e, t) {
1778
1778
  if (typeof t == "object" && t) {
1779
1779
  let n = t.length;
1780
1780
  if (typeof e != "object" || !e || e.length !== n) return !0;
@@ -1783,7 +1783,7 @@ function rn(e, t) {
1783
1783
  }
1784
1784
  return e !== t;
1785
1785
  }
1786
- function an(e, t) {
1786
+ function rn(e, t) {
1787
1787
  if (typeof t == "object" && t) {
1788
1788
  let n = t.length;
1789
1789
  if (typeof e == "object" && e && e.length === n) {
@@ -1796,10 +1796,10 @@ function an(e, t) {
1796
1796
  }
1797
1797
  //#endregion
1798
1798
  //#region src/core/renderers/gl/state/GlBlendMode.ts
1799
- var on = /* @__PURE__ */ function(e) {
1799
+ var an = /* @__PURE__ */ function(e) {
1800
1800
  return e.normal = "normal", e.add = "add", e.multiply = "multiply", e.screen = "screen", e.none = "none", e.normalNpm = "normalNpm", e.addNpm = "add_npm", e.screenNpm = "screenNpm", e.srcIn = "srcIn", e.srcOut = "srcOut", e.srcAtop = "srcAtop", e.dstOver = "dstOver", e.dstIn = "dstIn", e.dstOut = "dstOut", e.dstAtop = "dstAtop", e.xor = "xor", e.subtract = "subtract", e;
1801
1801
  }({});
1802
- function sn(e) {
1802
+ function on(e) {
1803
1803
  return {
1804
1804
  normal: [e.ONE, e.ONE_MINUS_SRC_ALPHA],
1805
1805
  add: [e.ONE, e.ONE],
@@ -1854,7 +1854,7 @@ function sn(e) {
1854
1854
  }
1855
1855
  //#endregion
1856
1856
  //#region src/core/renderers/gl/state/GlStateSystem.ts
1857
- var cn = class e {
1857
+ var sn = class e {
1858
1858
  static _properties = [
1859
1859
  "blend",
1860
1860
  "offsets",
@@ -1881,14 +1881,14 @@ var cn = class e {
1881
1881
  let t = new e();
1882
1882
  return t.depthTest = !1, t.blend = !0, t;
1883
1883
  }
1884
- _blendMode = on.normal;
1884
+ _blendMode = an.normal;
1885
1885
  _polygonOffset = 0;
1886
1886
  bitmap = 0;
1887
1887
  get blendMode() {
1888
1888
  return this._blendMode;
1889
1889
  }
1890
1890
  set blendMode(e) {
1891
- this.blend = e !== on.none, this._blendMode = e;
1891
+ this.blend = e !== an.none, this._blendMode = e;
1892
1892
  }
1893
1893
  get polygonOffset() {
1894
1894
  return this._polygonOffset;
@@ -1900,19 +1900,19 @@ var cn = class e {
1900
1900
  if (e) for (let t in e) this[t] = e[t];
1901
1901
  }
1902
1902
  };
1903
- cn._init();
1904
- var ln = class extends j {
1903
+ sn._init();
1904
+ var cn = class extends M {
1905
1905
  install(e) {
1906
1906
  super.install(e), e.state = this;
1907
1907
  }
1908
1908
  _blendEq = !1;
1909
- _setters = cn._properties.map((e) => this[`set${e.replace(/^\S/, (e) => e.toUpperCase())}`]);
1909
+ _setters = sn._properties.map((e) => this[`set${e.replace(/^\S/, (e) => e.toUpperCase())}`]);
1910
1910
  boundStateBitmap = 0;
1911
1911
  boundBlendMode;
1912
1912
  blendModes;
1913
- defaultState = new cn({ blend: !0 });
1913
+ defaultState = new sn({ blend: !0 });
1914
1914
  _updateContext(e) {
1915
- super._updateContext(e), this.blendModes = sn(e);
1915
+ super._updateContext(e), this.blendModes = on(e);
1916
1916
  }
1917
1917
  toggle(e, t) {
1918
1918
  this._renderer.gl[t ? "enable" : "disable"](e);
@@ -1955,14 +1955,14 @@ var ln = class extends j {
1955
1955
  }
1956
1956
  reset() {
1957
1957
  super.reset();
1958
- let e = (1 << cn._properties.length) - 1;
1958
+ let e = (1 << sn._properties.length) - 1;
1959
1959
  this.boundStateBitmap = ~this.defaultState.bitmap & e, this.boundBlendMode = void 0, this._blendEq = !0, this.bind(this.defaultState);
1960
1960
  }
1961
- }, un = class extends j {
1961
+ }, ln = class extends M {
1962
1962
  install(e) {
1963
1963
  super.install(e), e.batch2D = this;
1964
1964
  }
1965
- _state = cn.for2D();
1965
+ _state = sn.for2D();
1966
1966
  _batchSize = 4096 * 4;
1967
1967
  _batchables = [];
1968
1968
  _vertexCount = 0;
@@ -1984,7 +1984,7 @@ var ln = class extends j {
1984
1984
  _createShader(e) {
1985
1985
  let t = this._renderer, n = {
1986
1986
  instanceId: lt(),
1987
- glProgram: new qt({
1987
+ glProgram: new Kt({
1988
1988
  vertex: "precision highp float;\nin vec2 aPosition;\nin vec2 aUv;\nin vec4 aTextureParams;\nin vec4 aModulate;\n\nuniform vec2 size;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\n\nout float vTextureId;\nout float vClipOutsideUv;\nout vec2 vUv;\nout vec4 vModulate;\n\nvec2 roundPixels(vec2 position, vec2 targetSize) {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n}\n\nvoid main(void) {\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n mat3 modelViewProjectionMatrix = projectionMatrix * viewMatrix * modelMatrix;\n gl_Position = vec4((modelViewProjectionMatrix * vec3(aPosition, 1.0)).xy, 0.0, 1.0);\n vTextureId = aTextureParams.x;\n vClipOutsideUv = aTextureParams.y;\n if (aTextureParams.z == 1.) {\n gl_Position.xy = roundPixels(gl_Position.xy, size);\n }\n vUv = aUv;\n vModulate = aModulate;\n}",
1989
1989
  fragment: `precision highp float;
1990
1990
  in float vTextureId;
@@ -2014,11 +2014,11 @@ void main(void) {
2014
2014
  })
2015
2015
  }, r = {
2016
2016
  instanceId: lt(),
2017
- usage: A.vertex,
2017
+ usage: j.vertex,
2018
2018
  data: new Float32Array()
2019
2019
  }, i = {
2020
2020
  instanceId: lt(),
2021
- usage: A.index,
2021
+ usage: j.index,
2022
2022
  data: new Uint32Array()
2023
2023
  }, a = {
2024
2024
  instanceId: lt(),
@@ -2061,7 +2061,7 @@ void main(void) {
2061
2061
  let { indices: r, vertices: p, uvs: h = new Float32Array(), size: g = {
2062
2062
  width: 0,
2063
2063
  height: 0
2064
- }, texture: ee, blendMode: te = on.normal, clipOutsideUv: ne, roundPixels: re, modulate: ie = [
2064
+ }, texture: ee, blendMode: te = an.normal, clipOutsideUv: ne, roundPixels: re, modulate: ie = [
2065
2065
  255,
2066
2066
  255,
2067
2067
  255,
@@ -2091,22 +2091,22 @@ void main(void) {
2091
2091
  }
2092
2092
  }
2093
2093
  _getBufferData(e) {
2094
- let t = dn(Math.ceil(e / 8)), n = fn(t), r = t * 8;
2094
+ let t = un(Math.ceil(e / 8)), n = dn(t), r = t * 8;
2095
2095
  this._attributeBuffer.length <= n && (this._attributeBuffer.length = n + 1);
2096
2096
  let i = this._attributeBuffer[n];
2097
2097
  return i || (this._attributeBuffer[n] = i = /* @__PURE__ */ new ArrayBuffer(r * this._vertexSize * 4)), i;
2098
2098
  }
2099
2099
  _getIndexBufferData(e) {
2100
- let t = dn(Math.ceil(e / 12)), n = fn(t), r = t * 12;
2100
+ let t = un(Math.ceil(e / 12)), n = dn(t), r = t * 12;
2101
2101
  this._indexBuffers.length <= n && (this._indexBuffers.length = n + 1);
2102
2102
  let i = this._indexBuffers[n];
2103
2103
  return i || (this._indexBuffers[n] = i = new Uint32Array(r)), i;
2104
2104
  }
2105
2105
  };
2106
- function dn(e) {
2106
+ function un(e) {
2107
2107
  return e += +(e === 0), --e, e |= e >>> 1, e |= e >>> 2, e |= e >>> 4, e |= e >>> 8, e |= e >>> 16, e + 1;
2108
2108
  }
2109
- function fn(e) {
2109
+ function dn(e) {
2110
2110
  let t = (e > 65535) << 4;
2111
2111
  e >>>= t;
2112
2112
  let n = (e > 255) << 3;
@@ -2114,11 +2114,11 @@ function fn(e) {
2114
2114
  }
2115
2115
  //#endregion
2116
2116
  //#region src/core/renderers/gl/const.ts
2117
- var M = /* @__PURE__ */ function(e) {
2117
+ var N = /* @__PURE__ */ function(e) {
2118
2118
  return e[e.disabled = 0] = "disabled", e[e.renderingMaskAdd = 1] = "renderingMaskAdd", e[e.maskActive = 2] = "maskActive", e[e.inverseMaskActive = 3] = "inverseMaskActive", e[e.renderingMaskRemove = 4] = "renderingMaskRemove", e[e.none = 5] = "none", e;
2119
- }({}), pn = /* @__PURE__ */ function(e) {
2119
+ }({}), fn = /* @__PURE__ */ function(e) {
2120
2120
  return e[e.none = 0] = "none", e[e.color = 16384] = "color", e[e.stencil = 1024] = "stencil", e[e.depth = 256] = "depth", e[e.colorDepth = 16640] = "colorDepth", e[e.colorStencil = 17408] = "colorStencil", e[e.depthStencil = 1280] = "depthStencil", e[e.all = 17664] = "all", e;
2121
- }({}), mn = class extends j {
2121
+ }({}), pn = class extends M {
2122
2122
  install(e) {
2123
2123
  super.install(e), e.mask = this;
2124
2124
  }
@@ -2137,16 +2137,16 @@ var M = /* @__PURE__ */ function(e) {
2137
2137
  };
2138
2138
  this.stack.push(n);
2139
2139
  let r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
2140
- "x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(M.renderingMaskAdd, i), this._renderer.colorMask.bind(0), i++, t.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(M.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
2140
+ "x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(N.renderingMaskAdd, i), this._renderer.colorMask.bind(0), i++, t.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(N.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
2141
2141
  }
2142
2142
  pop(e) {
2143
2143
  let t = this.stack.pop();
2144
2144
  if (!t || t.source !== e) return;
2145
2145
  let { mask: n } = t, r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
2146
- "x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(pn.stencil), this._renderer.stencil.bind(M.disabled, i)) : this._renderer.stencil.bind(M.renderingMaskRemove, i), i--, n.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(M.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
2146
+ "x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(fn.stencil), this._renderer.stencil.bind(N.disabled, i)) : this._renderer.stencil.bind(N.renderingMaskRemove, i), i--, n.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(N.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
2147
2147
  }
2148
- }, hn = [];
2149
- hn[M.none] = {}, hn[M.disabled] = {}, hn[M.renderingMaskAdd] = {
2148
+ }, mn = [];
2149
+ mn[N.none] = {}, mn[N.disabled] = {}, mn[N.renderingMaskAdd] = {
2150
2150
  stencilFront: {
2151
2151
  compare: "equal",
2152
2152
  passOp: "increment-clamp"
@@ -2155,7 +2155,7 @@ hn[M.none] = {}, hn[M.disabled] = {}, hn[M.renderingMaskAdd] = {
2155
2155
  compare: "equal",
2156
2156
  passOp: "increment-clamp"
2157
2157
  }
2158
- }, hn[M.renderingMaskRemove] = {
2158
+ }, mn[N.renderingMaskRemove] = {
2159
2159
  stencilFront: {
2160
2160
  compare: "equal",
2161
2161
  passOp: "decrement-clamp"
@@ -2164,7 +2164,7 @@ hn[M.none] = {}, hn[M.disabled] = {}, hn[M.renderingMaskAdd] = {
2164
2164
  compare: "equal",
2165
2165
  passOp: "decrement-clamp"
2166
2166
  }
2167
- }, hn[M.maskActive] = {
2167
+ }, mn[N.maskActive] = {
2168
2168
  stencilFront: {
2169
2169
  compare: "equal",
2170
2170
  passOp: "keep"
@@ -2173,7 +2173,7 @@ hn[M.none] = {}, hn[M.disabled] = {}, hn[M.renderingMaskAdd] = {
2173
2173
  compare: "equal",
2174
2174
  passOp: "keep"
2175
2175
  }
2176
- }, hn[M.inverseMaskActive] = {
2176
+ }, mn[N.inverseMaskActive] = {
2177
2177
  stencilFront: {
2178
2178
  compare: "not-equal",
2179
2179
  passOp: "keep"
@@ -2183,17 +2183,17 @@ hn[M.none] = {}, hn[M.disabled] = {}, hn[M.renderingMaskAdd] = {
2183
2183
  passOp: "keep"
2184
2184
  }
2185
2185
  };
2186
- var gn = class extends j {
2186
+ var hn = class extends M {
2187
2187
  install(e) {
2188
2188
  super.install(e), e.stencil = this;
2189
2189
  }
2190
2190
  _cache = {
2191
2191
  enabled: !1,
2192
- stencilMode: M.none,
2192
+ stencilMode: N.none,
2193
2193
  refCount: 0
2194
2194
  };
2195
2195
  current = { [-1]: {
2196
- stencilMode: M.disabled,
2196
+ stencilMode: N.disabled,
2197
2197
  refCount: 0
2198
2198
  } };
2199
2199
  _passOpMap;
@@ -2223,20 +2223,20 @@ var gn = class extends j {
2223
2223
  super._setup(), this._renderer.renderTarget.on("updateRenderTarget", this._updateRenderTarget);
2224
2224
  }
2225
2225
  reset() {
2226
- this._cache.enabled = !1, this._cache.stencilMode = M.none, this._cache.refCount = 0;
2226
+ this._cache.enabled = !1, this._cache.stencilMode = N.none, this._cache.refCount = 0;
2227
2227
  }
2228
2228
  _updateRenderTarget = (e) => {
2229
2229
  if (e) {
2230
2230
  let t = this.current[e.instanceId];
2231
2231
  t ||= this.current[e.instanceId] = {
2232
- stencilMode: M.disabled,
2232
+ stencilMode: N.disabled,
2233
2233
  refCount: 0
2234
2234
  }, this.bind(t.stencilMode, t.refCount);
2235
2235
  }
2236
2236
  };
2237
2237
  bind(e, t) {
2238
- let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i = hn[e], a = this._cache;
2239
- if (n.stencilMode = e, n.refCount = t, e === M.disabled) {
2238
+ let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i = mn[e], a = this._cache;
2239
+ if (n.stencilMode = e, n.refCount = t, e === N.disabled) {
2240
2240
  this._cache.enabled && (this._cache.enabled = !1, r.disable(r.STENCIL_TEST));
2241
2241
  return;
2242
2242
  }
@@ -2245,8 +2245,8 @@ var gn = class extends j {
2245
2245
  destroy() {
2246
2246
  super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
2247
2247
  }
2248
- }, _n = class extends j {
2249
- current = new vt(0, 0, 0, 0);
2248
+ }, gn = class extends M {
2249
+ current = new yt(0, 0, 0, 0);
2250
2250
  install(e) {
2251
2251
  super.install(e), e.viewport = this;
2252
2252
  }
@@ -2254,7 +2254,7 @@ var gn = class extends j {
2254
2254
  let t = this.current, n = Math.floor(e.x), r = Math.floor(e.y), i = Math.floor(e.width), a = Math.floor(e.height);
2255
2255
  t.x === n && t.y === r && t.width === i && t.height === a || (this._gl.viewport(n, r, i, a), t.x = n, t.y = r, t.width = i, t.height = a);
2256
2256
  }
2257
- }, vn = class {
2257
+ }, _n = class {
2258
2258
  framebuffer;
2259
2259
  width = -1;
2260
2260
  height = -1;
@@ -2265,7 +2265,7 @@ var gn = class extends j {
2265
2265
  constructor(e) {
2266
2266
  this.framebuffer = e;
2267
2267
  }
2268
- }, yn = class extends j {
2268
+ }, vn = class extends M {
2269
2269
  install(e) {
2270
2270
  super.install(e), e.renderTarget = this;
2271
2271
  }
@@ -2275,7 +2275,7 @@ var gn = class extends j {
2275
2275
  _msaaSamples = [];
2276
2276
  _hasMRT = !0;
2277
2277
  _writeDepthTexture = !0;
2278
- projection = new Tt();
2278
+ projection = new wt();
2279
2279
  _updateContext(e) {
2280
2280
  if (super._updateContext(e), this._hasMRT = !0, this._writeDepthTexture = !0, this._renderer.version === 1) {
2281
2281
  let t = this._renderer.extensions.drawBuffers, n = this._renderer.extensions.depthTexture;
@@ -2311,7 +2311,7 @@ var gn = class extends j {
2311
2311
  return this.glRenderTargets.get(e.instanceId) || this._createGlRenderTarget(e);
2312
2312
  }
2313
2313
  _createGlRenderTarget(e) {
2314
- let t = this._gl, n = new vn(t.createFramebuffer());
2314
+ let t = this._gl, n = new _n(t.createFramebuffer());
2315
2315
  return this.glRenderTargets.set(e.instanceId, n), this.renderTargets.get(e.instanceId) || (this.renderTargets.set(e.instanceId, e), this._update(e, n), "on" in e && (e.on("updateProperty", (t) => {
2316
2316
  switch (t) {
2317
2317
  case "width":
@@ -2388,28 +2388,28 @@ var gn = class extends j {
2388
2388
  reset() {
2389
2389
  super.reset(), this._renderer.contextLost || this.glRenderTargets.forEach((e) => this.destroyGpuRenderTarget(e)), this.renderTargets.clear(), this.glRenderTargets.clear(), this.current = null, this._msaaSamples.length = 0;
2390
2390
  }
2391
- }, bn = /* @__PURE__ */ function(e) {
2391
+ }, yn = /* @__PURE__ */ function(e) {
2392
2392
  return e[e.RGBA = 6408] = "RGBA", e[e.RGB = 6407] = "RGB", e[e.RG = 33319] = "RG", e[e.RED = 6403] = "RED", e[e.RGBA_INTEGER = 36249] = "RGBA_INTEGER", e[e.RGB_INTEGER = 36248] = "RGB_INTEGER", e[e.RG_INTEGER = 33320] = "RG_INTEGER", e[e.RED_INTEGER = 36244] = "RED_INTEGER", e[e.ALPHA = 6406] = "ALPHA", e[e.LUMINANCE = 6409] = "LUMINANCE", e[e.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA", e[e.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT", e[e.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL", e;
2393
- }({}), xn = /* @__PURE__ */ function(e) {
2393
+ }({}), bn = /* @__PURE__ */ function(e) {
2394
2394
  return e[e.TEXTURE_2D = 3553] = "TEXTURE_2D", e[e.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP", e[e.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY", e[e.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X", e[e.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X", e[e.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y", e[e.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z", e;
2395
- }({}), N = /* @__PURE__ */ function(e) {
2395
+ }({}), P = /* @__PURE__ */ function(e) {
2396
2396
  return e[e.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", e[e.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", e[e.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5", e[e.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4", e[e.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1", e[e.UNSIGNED_INT = 5125] = "UNSIGNED_INT", e[e.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV", e[e.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV", e[e.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8", e[e.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV", e[e.BYTE = 5120] = "BYTE", e[e.SHORT = 5122] = "SHORT", e[e.INT = 5124] = "INT", e[e.FLOAT = 5126] = "FLOAT", e[e.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV", e[e.HALF_FLOAT = 36193] = "HALF_FLOAT", e;
2397
- }({}), Sn = class {
2397
+ }({}), xn = class {
2398
2398
  native;
2399
- target = xn.TEXTURE_2D;
2399
+ target = bn.TEXTURE_2D;
2400
2400
  width = -1;
2401
2401
  height = -1;
2402
2402
  mipmap = !1;
2403
- type = N.UNSIGNED_BYTE;
2404
- internalFormat = bn.RGBA;
2405
- format = bn.RGBA;
2403
+ type = P.UNSIGNED_BYTE;
2404
+ internalFormat = yn.RGBA;
2405
+ format = yn.RGBA;
2406
2406
  constructor(e) {
2407
2407
  this.native = e;
2408
2408
  }
2409
2409
  };
2410
2410
  //#endregion
2411
2411
  //#region src/core/renderers/gl/texture/mapFormatToGlFormat.ts
2412
- function Cn(e) {
2412
+ function Sn(e) {
2413
2413
  return {
2414
2414
  r8unorm: e.RED,
2415
2415
  r8snorm: e.RED,
@@ -2457,7 +2457,7 @@ function Cn(e) {
2457
2457
  }
2458
2458
  //#endregion
2459
2459
  //#region src/core/renderers/gl/texture/mapFormatToGlInternalFormat.ts
2460
- function wn(e, t) {
2460
+ function Cn(e, t) {
2461
2461
  let n = {}, r = e.RGBA;
2462
2462
  return e instanceof WebGLRenderingContext ? t.srgb && (n = {
2463
2463
  "rgba8unorm-srgb": t.srgb.SRGB8_ALPHA8_EXT,
@@ -2573,7 +2573,7 @@ function wn(e, t) {
2573
2573
  }
2574
2574
  //#endregion
2575
2575
  //#region src/core/renderers/gl/texture/mapFormatToGlType.ts
2576
- function Tn(e) {
2576
+ function wn(e) {
2577
2577
  return {
2578
2578
  r8unorm: e.UNSIGNED_BYTE,
2579
2579
  r8snorm: e.BYTE,
@@ -2621,7 +2621,7 @@ function Tn(e) {
2621
2621
  }
2622
2622
  //#endregion
2623
2623
  //#region src/core/renderers/gl/texture/updateTextureStyle.ts
2624
- var En = {
2624
+ var Tn = {
2625
2625
  linear: {
2626
2626
  linear: 9987,
2627
2627
  nearest: 9985
@@ -2630,10 +2630,10 @@ var En = {
2630
2630
  linear: 9986,
2631
2631
  nearest: 9984
2632
2632
  }
2633
- }, Dn = {
2633
+ }, En = {
2634
2634
  linear: 9729,
2635
2635
  nearest: 9728
2636
- }, On = {
2636
+ }, Dn = {
2637
2637
  never: 512,
2638
2638
  less: 513,
2639
2639
  equal: 514,
@@ -2642,32 +2642,32 @@ var En = {
2642
2642
  "not-equal": 517,
2643
2643
  "greater-equal": 518,
2644
2644
  always: 519
2645
- }, kn = {
2645
+ }, On = {
2646
2646
  "clamp-to-edge": 33071,
2647
2647
  repeat: 10497,
2648
2648
  "mirror-repeat": 33648
2649
2649
  };
2650
- function An(e, t, n, r, i, a, o, s) {
2650
+ function kn(e, t, n, r, i, a, o, s) {
2651
2651
  let { addressModeU: c = "repeat", addressModeV: l = "repeat", addressModeW: u = "repeat", magFilter: d = "linear", minFilter: f = "linear", mipmapFilter: p = "linear", maxAnisotropy: m = 0, compare: h } = e, g = a;
2652
2652
  if (!s || c !== "repeat" || l !== "repeat" || u !== "repeat") {
2653
- let e = kn[o ? "clamp-to-edge" : c], n = kn[o ? "clamp-to-edge" : l], r = kn[o ? "clamp-to-edge" : u];
2653
+ let e = On[o ? "clamp-to-edge" : c], n = On[o ? "clamp-to-edge" : l], r = On[o ? "clamp-to-edge" : u];
2654
2654
  t[i](g, t.TEXTURE_WRAP_S, e), t[i](g, t.TEXTURE_WRAP_T, n), t.TEXTURE_WRAP_R && t[i](g, t.TEXTURE_WRAP_R, r);
2655
2655
  }
2656
- if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER, Dn[d]), n) {
2656
+ if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER, En[d]), n) {
2657
2657
  if (!s || p !== "linear") {
2658
- let e = En[f][p];
2658
+ let e = Tn[f][p];
2659
2659
  t[i](g, t.TEXTURE_MIN_FILTER, e);
2660
2660
  }
2661
- } else t[i](g, t.TEXTURE_MIN_FILTER, Dn[f]);
2661
+ } else t[i](g, t.TEXTURE_MIN_FILTER, En[f]);
2662
2662
  if (r && m > 1) {
2663
2663
  let e = Math.min(m, t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));
2664
2664
  t[i](g, r.TEXTURE_MAX_ANISOTROPY_EXT, e);
2665
2665
  }
2666
- h && t[i](g, t.TEXTURE_COMPARE_FUNC, On[h]);
2666
+ h && t[i](g, t.TEXTURE_COMPARE_FUNC, Dn[h]);
2667
2667
  }
2668
2668
  //#endregion
2669
2669
  //#region src/core/renderers/gl/texture/uploaders/index.ts
2670
- var jn = {
2670
+ var An = {
2671
2671
  buffer: {
2672
2672
  id: "buffer",
2673
2673
  upload: (e, t, n) => {
@@ -2681,8 +2681,8 @@ var jn = {
2681
2681
  c < o || l < s ? ((i !== o || a !== s) && n.texImage2D(t.target, 0, t.internalFormat, o, s, 0, t.format, t.type, null), r === 2 ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, c, l, t.format, t.type, e.source) : n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.format, t.type, e.source)) : i === o && a === s ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.format, t.type, e.source) : r === 2 ? n.texImage2D(t.target, 0, t.internalFormat, o, s, 0, t.format, t.type, e.source) : n.texImage2D(t.target, 0, t.internalFormat, t.format, t.type, e.source), t.width = o, t.height = s;
2682
2682
  }
2683
2683
  }
2684
- }, Mn = class extends j {
2685
- uploaders = { ...jn };
2684
+ }, jn = class extends M {
2685
+ uploaders = { ...An };
2686
2686
  textures = /* @__PURE__ */ new Map();
2687
2687
  glTextures = /* @__PURE__ */ new Map();
2688
2688
  _mapFormatToInternalFormat = Object.create(null);
@@ -2697,14 +2697,14 @@ var jn = {
2697
2697
  super.install(e), e.texture = this;
2698
2698
  }
2699
2699
  _updateContext(e) {
2700
- super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat = wn(e, this._renderer.extensions), this._mapFormatToType = Tn(e), this._mapFormatToFormat = Cn(e)), this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.maxTextureImageUnits = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);
2700
+ super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat = Cn(e, this._renderer.extensions), this._mapFormatToType = wn(e), this._mapFormatToFormat = Sn(e)), this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.maxTextureImageUnits = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);
2701
2701
  for (let e = 0; e < this.maxTextureImageUnits; e++) this.unbind(e);
2702
2702
  }
2703
2703
  getGlTexture(e) {
2704
2704
  return this.glTextures.get(e.instanceId) || this._createGlTexture(e);
2705
2705
  }
2706
2706
  _createGlTexture(e) {
2707
- let t = this._gl, n = new Sn(t.createTexture());
2707
+ let t = this._gl, n = new xn(t.createTexture());
2708
2708
  if (t.bindTexture(n.target, n.native), n.type = this._mapFormatToType[e.format], n.internalFormat = this._mapFormatToInternalFormat[e.format], n.format = this._mapFormatToFormat[e.format], this.glTextures.set(e.instanceId, n), e.mipmap && (this._renderer.supports.nonPowOf2mipmaps || e.isPowerOfTwo)) {
2709
2709
  let t = Math.max(e.width, e.height);
2710
2710
  e.mipLevelCount = Math.floor(Math.log2(t)) + 1;
@@ -2764,7 +2764,7 @@ var jn = {
2764
2764
  }
2765
2765
  updateStyle(e, t = !1) {
2766
2766
  let n = this._gl;
2767
- An(e, n, e.mipLevelCount > 1, this._renderer.extensions.anisotropicFiltering, "texParameteri", n.TEXTURE_2D, !this._renderer.supports.nonPowOf2wrapping && !e.isPowerOfTwo, t);
2767
+ kn(e, n, e.mipLevelCount > 1, this._renderer.extensions.anisotropicFiltering, "texParameteri", n.TEXTURE_2D, !this._renderer.supports.nonPowOf2wrapping && !e.isPowerOfTwo, t);
2768
2768
  }
2769
2769
  updateGpuTexture(e) {
2770
2770
  this.bind(e);
@@ -2779,50 +2779,50 @@ var jn = {
2779
2779
  let e = this._gl;
2780
2780
  this._renderer.contextLost || this.glTextures.forEach((t) => e.deleteTexture(t.native)), this.textures.clear(), this.glTextures.clear(), this._location = 0, this.current.length = 0, this._premultiplyAlpha = !1, this._renderer.contextLost || e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this._premultiplyAlpha);
2781
2781
  }
2782
- }, Nn = {
2783
- uint8x2: N.UNSIGNED_BYTE,
2784
- uint8x4: N.UNSIGNED_BYTE,
2785
- sint8x2: N.BYTE,
2786
- sint8x4: N.BYTE,
2787
- unorm8x2: N.UNSIGNED_BYTE,
2788
- unorm8x4: N.UNSIGNED_BYTE,
2789
- snorm8x2: N.BYTE,
2790
- snorm8x4: N.BYTE,
2791
- uint16x2: N.UNSIGNED_SHORT,
2792
- uint16x4: N.UNSIGNED_SHORT,
2793
- sint16x2: N.SHORT,
2794
- sint16x4: N.SHORT,
2795
- unorm16x2: N.UNSIGNED_SHORT,
2796
- unorm16x4: N.UNSIGNED_SHORT,
2797
- snorm16x2: N.SHORT,
2798
- snorm16x4: N.SHORT,
2799
- float16x2: N.HALF_FLOAT,
2800
- float16x4: N.HALF_FLOAT,
2801
- float32: N.FLOAT,
2802
- float32x2: N.FLOAT,
2803
- float32x3: N.FLOAT,
2804
- float32x4: N.FLOAT,
2805
- uint32: N.UNSIGNED_INT,
2806
- uint32x2: N.UNSIGNED_INT,
2807
- uint32x3: N.UNSIGNED_INT,
2808
- uint32x4: N.UNSIGNED_INT,
2809
- sint32: N.INT,
2810
- sint32x2: N.INT,
2811
- sint32x3: N.INT,
2812
- sint32x4: N.INT
2782
+ }, Mn = {
2783
+ uint8x2: P.UNSIGNED_BYTE,
2784
+ uint8x4: P.UNSIGNED_BYTE,
2785
+ sint8x2: P.BYTE,
2786
+ sint8x4: P.BYTE,
2787
+ unorm8x2: P.UNSIGNED_BYTE,
2788
+ unorm8x4: P.UNSIGNED_BYTE,
2789
+ snorm8x2: P.BYTE,
2790
+ snorm8x4: P.BYTE,
2791
+ uint16x2: P.UNSIGNED_SHORT,
2792
+ uint16x4: P.UNSIGNED_SHORT,
2793
+ sint16x2: P.SHORT,
2794
+ sint16x4: P.SHORT,
2795
+ unorm16x2: P.UNSIGNED_SHORT,
2796
+ unorm16x4: P.UNSIGNED_SHORT,
2797
+ snorm16x2: P.SHORT,
2798
+ snorm16x4: P.SHORT,
2799
+ float16x2: P.HALF_FLOAT,
2800
+ float16x4: P.HALF_FLOAT,
2801
+ float32: P.FLOAT,
2802
+ float32x2: P.FLOAT,
2803
+ float32x3: P.FLOAT,
2804
+ float32x4: P.FLOAT,
2805
+ uint32: P.UNSIGNED_INT,
2806
+ uint32x2: P.UNSIGNED_INT,
2807
+ uint32x3: P.UNSIGNED_INT,
2808
+ uint32x4: P.UNSIGNED_INT,
2809
+ sint32: P.INT,
2810
+ sint32x2: P.INT,
2811
+ sint32x3: P.INT,
2812
+ sint32x4: P.INT
2813
2813
  };
2814
- function Pn(e) {
2815
- return Nn[e] ?? Nn.float32;
2814
+ function Nn(e) {
2815
+ return Mn[e] ?? Mn.float32;
2816
2816
  }
2817
2817
  //#endregion
2818
2818
  //#region src/core/renderers/gl/geometry/GlGeometrySystem.ts
2819
- var Fn = {
2819
+ var Pn = {
2820
2820
  "point-list": 0,
2821
2821
  "line-list": 1,
2822
2822
  "line-strip": 3,
2823
2823
  "triangle-list": 4,
2824
2824
  "triangle-strip": 5
2825
- }, In = class extends j {
2825
+ }, Fn = class extends M {
2826
2826
  _geometryVaoHash = {};
2827
2827
  hasInstance = !1;
2828
2828
  current = null;
@@ -2861,11 +2861,11 @@ var Fn = {
2861
2861
  }
2862
2862
  for (let e in r) {
2863
2863
  let t = r[e];
2864
- i[t.buffer.instanceId] += Yt(t.format).stride;
2864
+ i[t.buffer.instanceId] += Jt(t.format).stride;
2865
2865
  }
2866
2866
  for (let e in r) {
2867
2867
  let t = r[e];
2868
- t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] += Yt(t.format).stride;
2868
+ t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] += Jt(t.format).stride;
2869
2869
  }
2870
2870
  }
2871
2871
  _createVao(e, t) {
@@ -2900,7 +2900,7 @@ var Fn = {
2900
2900
  a !== c && (r.bind(s), a = c);
2901
2901
  let e = l.location;
2902
2902
  n.enableVertexAttribArray(e);
2903
- let t = Yt(o.format), i = Pn(o.format);
2903
+ let t = Jt(o.format), i = Nn(o.format);
2904
2904
  if (l.format?.substring(1, 4) === "int" ? n.vertexAttribIPointer(e, t.size, i, o.stride ?? 0, o.start ?? 0) : n.vertexAttribPointer(e, t.size, i, t.normalized, o.stride ?? 0, o.start ?? 0), o.instance) if (this.hasInstance) {
2905
2905
  let t = o.divisor ?? 1;
2906
2906
  n.vertexAttribDivisor(e, t);
@@ -2933,7 +2933,7 @@ var Fn = {
2933
2933
  let { topology: t, size: n, start: r = 0, instanceCount: i } = e, { gl: a } = this._renderer, o = this.current;
2934
2934
  if (!o) return this;
2935
2935
  t = t || o.topology || "triangle-list";
2936
- let s = Fn[t];
2936
+ let s = Pn[t];
2937
2937
  if (i = i || o.instanceCount || 1, o.indexBuffer) {
2938
2938
  n ||= o.indexBuffer.data.length;
2939
2939
  let e = o.indexBuffer.data.BYTES_PER_ELEMENT, t = e === 2 ? a.UNSIGNED_SHORT : a.UNSIGNED_INT;
@@ -2954,7 +2954,7 @@ var Fn = {
2954
2954
  }
2955
2955
  this._geometryVaoHash = {}, this.current = null, this.currentVao = null;
2956
2956
  }
2957
- }, Ln = class extends j {
2957
+ }, In = class extends M {
2958
2958
  install(e) {
2959
2959
  super.install(e), e.colorMask = this;
2960
2960
  }
@@ -2965,19 +2965,19 @@ var Fn = {
2965
2965
  };
2966
2966
  //#endregion
2967
2967
  //#region src/core/renderers/gl/GlScissorSystem.ts
2968
- function Rn(e, t, n) {
2968
+ function Ln(e, t, n) {
2969
2969
  let [r, i, a, o, s, c, l, u, d] = e, f = r * t + o * n + l, p = i * t + s * n + u, m = a * t + c * n + d;
2970
2970
  return {
2971
2971
  x: f / m,
2972
2972
  y: p / m
2973
2973
  };
2974
2974
  }
2975
- function zn(e, t) {
2975
+ function Rn(e, t) {
2976
2976
  let { x: n, y: r, width: i, height: a } = t, o = [
2977
- Rn(e, n, r),
2978
- Rn(e, n + i, r),
2979
- Rn(e, n + i, r + a),
2980
- Rn(e, n, r + a)
2977
+ Ln(e, n, r),
2978
+ Ln(e, n + i, r),
2979
+ Ln(e, n + i, r + a),
2980
+ Ln(e, n, r + a)
2981
2981
  ], s = o.map((e) => e.x), c = o.map((e) => e.y), l = Math.min(...s), u = Math.max(...s), d = Math.min(...c), f = Math.max(...c);
2982
2982
  return {
2983
2983
  x: l,
@@ -2986,55 +2986,72 @@ function zn(e, t) {
2986
2986
  height: f - d
2987
2987
  };
2988
2988
  }
2989
- var Bn = class extends j {
2989
+ function zn(e, t) {
2990
+ let n = Math.max(e.x, t.x), r = Math.max(e.y, t.y), i = Math.min(e.x + e.width, t.x + t.width), a = Math.min(e.y + e.height, t.y + t.height);
2991
+ return {
2992
+ x: n,
2993
+ y: r,
2994
+ width: Math.max(0, i - n),
2995
+ height: Math.max(0, a - r)
2996
+ };
2997
+ }
2998
+ var Bn = class extends M {
2990
2999
  install(e) {
2991
3000
  super.install(e), e.scissor = this;
2992
3001
  }
2993
- current = { [-1]: { refCount: 0 } };
3002
+ current = { [-1]: { stack: [] } };
2994
3003
  _setup() {
2995
3004
  super._setup(), this._renderer.renderTarget.on("updateRenderTarget", this._updateRenderTarget);
2996
3005
  }
3006
+ _current() {
3007
+ let e = this._renderer.renderTarget.current?.instanceId ?? -1;
3008
+ return this.current[e] ?? (this.current[e] = { stack: [] });
3009
+ }
2997
3010
  _updateRenderTarget = (e) => {
2998
3011
  if (e) {
2999
- let t = this.current[e.instanceId];
3000
- t ||= this.current[e.instanceId] = { refCount: 0 }, t.rect && t.refCount > 0 ? this.bind(t.rect) : this.bind(null);
3012
+ let t = this.current[e.instanceId] ?? (this.current[e.instanceId] = { stack: [] });
3013
+ this.bind(t.stack[t.stack.length - 1] ?? null);
3001
3014
  }
3002
3015
  };
3003
3016
  push(e) {
3004
- let t = this._gl;
3005
- t.enable(t.SCISSOR_TEST);
3006
- let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1];
3007
- n.refCount++, n.rect = e, this.bind(e);
3017
+ let t = this._current(), n = t.stack[t.stack.length - 1], r = {
3018
+ x: e.x,
3019
+ y: e.y,
3020
+ width: e.width,
3021
+ height: e.height
3022
+ }, i = n ? zn(n, r) : r;
3023
+ t.stack.push(i), this.bind(i);
3008
3024
  }
3009
3025
  pop() {
3010
- let e = this.current[this._renderer.renderTarget.current?.instanceId ?? -1];
3011
- e.refCount > 0 && e.refCount--, e.refCount <= 0 && this.bind(null);
3026
+ let e = this._current();
3027
+ e.stack.pop(), this.bind(e.stack[e.stack.length - 1] ?? null);
3012
3028
  }
3013
3029
  bind(e) {
3014
3030
  let t = this._gl;
3015
3031
  if (e) {
3016
- let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } = zn(i, e), l = r.current.height / n - (o + c);
3032
+ t.enable(t.SCISSOR_TEST);
3033
+ let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } = Rn(i, e), l = r.current.height / n - (o + c);
3017
3034
  t.scissor(a * n, l * n, s * n, c * n);
3018
3035
  } else t.disable(t.SCISSOR_TEST);
3019
3036
  }
3020
3037
  destroy() {
3021
3038
  super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
3022
3039
  }
3023
- }, Vn = class extends kt {
3040
+ }, Vn = class extends Ot {
3024
3041
  contextLost = !1;
3025
3042
  _systems = [
3026
- new Mn(),
3027
- new Ft(),
3028
- new nn(),
3043
+ new jn(),
3044
+ new Pt(),
3045
+ new tn(),
3046
+ new Fn(),
3047
+ new vn(),
3048
+ new cn(),
3049
+ new pn(),
3029
3050
  new In(),
3030
- new yn(),
3031
- new ln(),
3032
- new mn(),
3033
- new Ln(),
3034
- new gn(),
3051
+ new hn(),
3035
3052
  new Bn(),
3036
- new un(),
3037
- new _n()
3053
+ new ln(),
3054
+ new gn()
3038
3055
  ];
3039
3056
  bindPoints = /* @__PURE__ */ new Map();
3040
3057
  supports = {
@@ -3128,8 +3145,8 @@ var Bn = class extends j {
3128
3145
  height: this.screen.height * this.pixelRatio
3129
3146
  });
3130
3147
  }
3131
- clear(e = pn.all) {
3132
- typeof e == "boolean" && (e = e ? pn.all : pn.none), e && this.gl.clear(e);
3148
+ clear(e = fn.all) {
3149
+ typeof e == "boolean" && (e = e ? fn.all : fn.none), e && this.gl.clear(e);
3133
3150
  }
3134
3151
  reset() {
3135
3152
  this._systems.forEach((e) => e.reset());
@@ -3160,15 +3177,15 @@ var Bn = class extends j {
3160
3177
  e.register(n, t);
3161
3178
  }), e.font = this, this;
3162
3179
  }
3163
- }, Wn = class extends E {
3180
+ }, Wn = class extends vt {
3164
3181
  constructor(e) {
3165
3182
  super(), this.setProperties(e);
3166
3183
  }
3167
3184
  };
3168
- k([_({ fallback: A.index }), O("design:type", A === void 0 ? Object : A)], Wn.prototype, "usage", void 0), k([_({ default: () => new Uint32Array() }), O("design:type", Object)], Wn.prototype, "data", void 0);
3185
+ A([_({ fallback: j.index }), k("design:type", j === void 0 ? Object : j)], Wn.prototype, "usage", void 0), A([_({ default: () => new Uint32Array() }), k("design:type", Object)], Wn.prototype, "data", void 0);
3169
3186
  //#endregion
3170
3187
  //#region src/scene/resources/geometries/Geometry.ts
3171
- var Gn = class extends E {
3188
+ var Gn = class extends vt {
3172
3189
  constructor(e = {}) {
3173
3190
  super(), this.setProperties(e);
3174
3191
  }
@@ -3176,32 +3193,32 @@ var Gn = class extends E {
3176
3193
  e.flush(), t.activate(e, n), e.geometry.bind(this, t.glProgram), e.geometry.draw(), e.geometry.unbind();
3177
3194
  }
3178
3195
  };
3179
- k([_({ fallback: "triangle-list" }), O("design:type", Object)], Gn.prototype, "topology", void 0), k([_({ default: () => ({}) }), O("design:type", typeof Record > "u" ? Object : Record)], Gn.prototype, "attributes", void 0), k([_({ default: () => new Wn() }), O("design:type", Wn === void 0 ? Object : Wn)], Gn.prototype, "indexBuffer", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Gn.prototype, "instanceCount", void 0);
3196
+ A([_({ fallback: "triangle-list" }), k("design:type", Object)], Gn.prototype, "topology", void 0), A([_({ default: () => ({}) }), k("design:type", typeof Record > "u" ? Object : Record)], Gn.prototype, "attributes", void 0), A([_({ default: () => new Wn() }), k("design:type", Wn === void 0 ? Object : Wn)], Gn.prototype, "indexBuffer", void 0), A([_({ fallback: 1 }), k("design:type", Number)], Gn.prototype, "instanceCount", void 0);
3180
3197
  //#endregion
3181
3198
  //#region src/scene/resources/geometries/VertexBuffer.ts
3182
- var P = class extends E {
3199
+ var F = class extends vt {
3183
3200
  constructor(e) {
3184
3201
  super(), this.setProperties(e);
3185
3202
  }
3186
3203
  };
3187
- k([_({ fallback: A.vertex }), O("design:type", A === void 0 ? Object : A)], P.prototype, "usage", void 0), k([_({ default: () => new Float32Array() }), O("design:type", Object)], P.prototype, "data", void 0);
3204
+ A([_({ fallback: j.vertex }), k("design:type", j === void 0 ? Object : j)], F.prototype, "usage", void 0), A([_({ default: () => new Float32Array() }), k("design:type", Object)], F.prototype, "data", void 0);
3188
3205
  //#endregion
3189
3206
  //#region src/scene/resources/geometries/VertexAttribute.ts
3190
- var F = class extends E {
3207
+ var I = class extends vt {
3191
3208
  constructor(e) {
3192
3209
  super(), this.setProperties(e);
3193
3210
  }
3194
3211
  };
3195
- k([_({ default: () => new P() }), O("design:type", P === void 0 ? Object : P)], F.prototype, "buffer", void 0), k([_({ fallback: "float32" }), O("design:type", Object)], F.prototype, "format", void 0), k([_(), O("design:type", Boolean)], F.prototype, "instance", void 0), k([_(), O("design:type", Number)], F.prototype, "stride", void 0), k([_(), O("design:type", Number)], F.prototype, "offset", void 0), k([_(), O("design:type", Number)], F.prototype, "start", void 0), k([_(), O("design:type", Number)], F.prototype, "divisor", void 0);
3212
+ A([_({ default: () => new F() }), k("design:type", F === void 0 ? Object : F)], I.prototype, "buffer", void 0), A([_({ fallback: "float32" }), k("design:type", Object)], I.prototype, "format", void 0), A([_(), k("design:type", Boolean)], I.prototype, "instance", void 0), A([_(), k("design:type", Number)], I.prototype, "stride", void 0), A([_(), k("design:type", Number)], I.prototype, "offset", void 0), A([_(), k("design:type", Number)], I.prototype, "start", void 0), A([_(), k("design:type", Number)], I.prototype, "divisor", void 0);
3196
3213
  //#endregion
3197
3214
  //#region src/scene/resources/geometries/QuadGeometry.ts
3198
3215
  var Kn = class extends Gn {
3199
3216
  constructor() {
3200
3217
  super({
3201
3218
  topology: "triangle-strip",
3202
- attributes: { position: new F({
3219
+ attributes: { position: new I({
3203
3220
  format: "float32x2",
3204
- buffer: new P({ data: new Float32Array([
3221
+ buffer: new F({ data: new Float32Array([
3205
3222
  0,
3206
3223
  0,
3207
3224
  1,
@@ -3255,13 +3272,13 @@ function qn() {
3255
3272
  ])
3256
3273
  };
3257
3274
  }
3258
- var I = class extends E {
3275
+ var L = class extends vt {
3259
3276
  static instance = new this();
3260
3277
  glProgram;
3261
3278
  constructor(e = {}) {
3262
3279
  super();
3263
3280
  let { uniforms: t, gl: n } = e;
3264
- t && (this.uniforms = t), this.glProgram = new qt({
3281
+ t && (this.uniforms = t), this.glProgram = new Kt({
3265
3282
  vertex: "in vec2 position;\nuniform mat3 projectionMatrix;\nuniform mat3 modelViewMatrix;\nvoid main(void) {\n gl_Position = vec4((projectionMatrix * modelViewMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}",
3266
3283
  fragment: "uniform vec4 tint;\nvoid main(void) {\n gl_FragColor = tint;\n}",
3267
3284
  ...n
@@ -3274,7 +3291,7 @@ var I = class extends E {
3274
3291
  }, e.shader.updateUniforms(this);
3275
3292
  }
3276
3293
  };
3277
- k([_({ default: qn }), O("design:type", typeof Record > "u" ? Object : Record)], I.prototype, "uniforms", void 0);
3294
+ A([_({ default: qn }), k("design:type", typeof Record > "u" ? Object : Record)], L.prototype, "uniforms", void 0);
3278
3295
  //#endregion
3279
3296
  //#region src/scene/resources/materials/EffectMaterial.ts
3280
3297
  var Jn = /^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm, Yn = /vec(\d)\((.*)\)/;
@@ -3289,7 +3306,7 @@ function Xn(e) {
3289
3306
  }
3290
3307
  return Number(e);
3291
3308
  }
3292
- var Zn = class e extends I {
3309
+ var Zn = class e extends L {
3293
3310
  static RE = {
3294
3311
  getColor: /\sgetColor\s*\(/,
3295
3312
  getFromColor: /\sgetFromColor\s*\(/,
@@ -3330,7 +3347,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3330
3347
  this.uniforms[t.trim()] = Xn(e[2]);
3331
3348
  });
3332
3349
  }
3333
- }, Qn = class extends I {
3350
+ }, Qn = class extends L {
3334
3351
  static _instance;
3335
3352
  static get instance() {
3336
3353
  return this._instance ??= new this();
@@ -3374,7 +3391,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3374
3391
  }
3375
3392
  });
3376
3393
  }
3377
- }, L = class extends Gn {
3394
+ }, R = class extends Gn {
3378
3395
  static _instance;
3379
3396
  static get instance() {
3380
3397
  return this._instance ??= new this();
@@ -3385,9 +3402,9 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3385
3402
  constructor() {
3386
3403
  super({
3387
3404
  attributes: {
3388
- position: new F({
3405
+ position: new I({
3389
3406
  format: "float32x2",
3390
- buffer: new P({ data: new Float32Array([
3407
+ buffer: new F({ data: new Float32Array([
3391
3408
  -1,
3392
3409
  -1,
3393
3410
  1,
@@ -3398,9 +3415,9 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3398
3415
  1
3399
3416
  ]) })
3400
3417
  }),
3401
- uv: new F({
3418
+ uv: new I({
3402
3419
  format: "float32x2",
3403
- buffer: new P({ data: new Float32Array([
3420
+ buffer: new F({ data: new Float32Array([
3404
3421
  0,
3405
3422
  0,
3406
3423
  1,
@@ -3426,15 +3443,15 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3426
3443
  positionBuffer;
3427
3444
  uvBuffer;
3428
3445
  constructor(e) {
3429
- let t = new P({ data: new Float32Array() }), n = new P({ data: new Float32Array() });
3446
+ let t = new F({ data: new Float32Array() }), n = new F({ data: new Float32Array() });
3430
3447
  super({
3431
3448
  ...e,
3432
3449
  attributes: {
3433
- position: new F({
3450
+ position: new I({
3434
3451
  format: "float32x2",
3435
3452
  buffer: t
3436
3453
  }),
3437
- uv: new F({
3454
+ uv: new I({
3438
3455
  format: "float32x2",
3439
3456
  buffer: n
3440
3457
  })
@@ -3442,7 +3459,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3442
3459
  indexBuffer: new Wn({ data: new Uint32Array() })
3443
3460
  }), this.positionBuffer = t, this.uvBuffer = n;
3444
3461
  }
3445
- }, R = class extends E {
3462
+ }, z = class extends vt {
3446
3463
  get valid() {
3447
3464
  return !!(this.width && this.height);
3448
3465
  }
@@ -3456,10 +3473,10 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3456
3473
  super._destroy(), this.colorTextures.forEach((e) => e.destroy());
3457
3474
  }
3458
3475
  };
3459
- k([_({ fallback: !1 }), O("design:type", Boolean)], R.prototype, "isRoot", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "x", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "y", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "height", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "mipLevel", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], R.prototype, "msaa", void 0), k([_({ default: () => [new z()] }), O("design:type", Array)], R.prototype, "colorTextures", void 0);
3476
+ A([_({ fallback: !1 }), k("design:type", Boolean)], z.prototype, "isRoot", void 0), A([_({ fallback: 0 }), k("design:type", Number)], z.prototype, "x", void 0), A([_({ fallback: 0 }), k("design:type", Number)], z.prototype, "y", void 0), A([_({ fallback: 0 }), k("design:type", Number)], z.prototype, "width", void 0), A([_({ fallback: 0 }), k("design:type", Number)], z.prototype, "height", void 0), A([_({ fallback: 0 }), k("design:type", Number)], z.prototype, "mipLevel", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], z.prototype, "msaa", void 0), A([_({ default: () => [new B()] }), k("design:type", Array)], z.prototype, "colorTextures", void 0);
3460
3477
  //#endregion
3461
3478
  //#region src/scene/resources/textures/Texture2D.ts
3462
- var z = class extends E {
3479
+ var B = class extends vt {
3463
3480
  static get EMPTY() {
3464
3481
  return new this({
3465
3482
  width: 1,
@@ -3570,10 +3587,10 @@ var z = class extends E {
3570
3587
  super._destroy(), Ne && this.source instanceof ImageBitmap && this.source.close();
3571
3588
  }
3572
3589
  };
3573
- k([_({ fallback: "unknown" }), O("design:type", String)], z.prototype, "uploadMethodId", void 0), k([_({ internal: !0 }), O("design:type", Object)], z.prototype, "source", void 0), k([_({ fallback: 0 }), O("design:type", Number)], z.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], z.prototype, "height", void 0), k([_({ fallback: 1 }), O("design:type", Number)], z.prototype, "pixelRatio", void 0), k([_({ fallback: "bgra8unorm" }), O("design:type", Object)], z.prototype, "format", void 0), k([_({ fallback: "premultiply-alpha-on-upload" }), O("design:type", Object)], z.prototype, "alphaMode", void 0), k([_({ fallback: 1 }), O("design:type", Number)], z.prototype, "mipLevelCount", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], z.prototype, "mipmap", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeU", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeV", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeW", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "magFilter", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "minFilter", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "mipmapFilter", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], z.prototype, "isPowerOfTwo", void 0);
3590
+ A([_({ fallback: "unknown" }), k("design:type", String)], B.prototype, "uploadMethodId", void 0), A([_({ internal: !0 }), k("design:type", Object)], B.prototype, "source", void 0), A([_({ fallback: 0 }), k("design:type", Number)], B.prototype, "width", void 0), A([_({ fallback: 0 }), k("design:type", Number)], B.prototype, "height", void 0), A([_({ fallback: 1 }), k("design:type", Number)], B.prototype, "pixelRatio", void 0), A([_({ fallback: "bgra8unorm" }), k("design:type", Object)], B.prototype, "format", void 0), A([_({ fallback: "premultiply-alpha-on-upload" }), k("design:type", Object)], B.prototype, "alphaMode", void 0), A([_({ fallback: 1 }), k("design:type", Number)], B.prototype, "mipLevelCount", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], B.prototype, "mipmap", void 0), A([_({ fallback: "clamp-to-edge" }), k("design:type", Object)], B.prototype, "addressModeU", void 0), A([_({ fallback: "clamp-to-edge" }), k("design:type", Object)], B.prototype, "addressModeV", void 0), A([_({ fallback: "clamp-to-edge" }), k("design:type", Object)], B.prototype, "addressModeW", void 0), A([_({ fallback: "linear" }), k("design:type", Object)], B.prototype, "magFilter", void 0), A([_({ fallback: "linear" }), k("design:type", Object)], B.prototype, "minFilter", void 0), A([_({ fallback: "linear" }), k("design:type", Object)], B.prototype, "mipmapFilter", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], B.prototype, "isPowerOfTwo", void 0);
3574
3591
  //#endregion
3575
3592
  //#region src/scene/resources/textures/AnimatedTexture.ts
3576
- var er = class extends E {
3593
+ var er = class extends vt {
3577
3594
  frames;
3578
3595
  frameIndex = 0;
3579
3596
  get currentFrame() {
@@ -3583,7 +3600,7 @@ var er = class extends E {
3583
3600
  super();
3584
3601
  let t;
3585
3602
  if (Array.isArray(e)) t = e;
3586
- else if (e instanceof z) t = [{
3603
+ else if (e instanceof B) t = [{
3587
3604
  texture: e,
3588
3605
  duration: 0
3589
3606
  }];
@@ -3598,7 +3615,7 @@ var er = class extends E {
3598
3615
  e.texture.destroy();
3599
3616
  });
3600
3617
  }
3601
- }, tr = class extends z {
3618
+ }, tr = class extends B {
3602
3619
  constructor(e = {}) {
3603
3620
  super({
3604
3621
  pixelRatio: 2,
@@ -3618,14 +3635,14 @@ var er = class extends E {
3618
3635
  }
3619
3636
  super._updateProperty(e, t, n);
3620
3637
  }
3621
- }, nr = class e extends z {
3638
+ }, nr = class e extends B {
3622
3639
  static _cached = /* @__PURE__ */ new Map();
3623
3640
  static get(t) {
3624
- let n = new yt(t), r = n.toHex(), i = this._cached.get(r);
3641
+ let n = new E(t), r = n.toHex(), i = this._cached.get(r);
3625
3642
  return i || (i = new e(n), this._cached.set(r, i)), i;
3626
3643
  }
3627
3644
  constructor(e) {
3628
- let t = e instanceof yt ? e : new yt(e);
3645
+ let t = e instanceof E ? e : new E(e);
3629
3646
  super({
3630
3647
  width: 1,
3631
3648
  height: 1,
@@ -3639,7 +3656,7 @@ var er = class extends E {
3639
3656
  mipmap: !0
3640
3657
  });
3641
3658
  }
3642
- }, rr = class e extends z {
3659
+ }, rr = class e extends B {
3643
3660
  static test(e) {
3644
3661
  return u(e);
3645
3662
  }
@@ -3673,7 +3690,7 @@ var er = class extends E {
3673
3690
  constructor(t, n, r) {
3674
3691
  super(e.linearGradient(t, n, r));
3675
3692
  }
3676
- }, ir = class extends z {
3693
+ }, ir = class extends B {
3677
3694
  constructor(e = {}) {
3678
3695
  super({
3679
3696
  ...e,
@@ -3694,7 +3711,7 @@ function ar(e) {
3694
3711
  playsinline: !!(e?.playsinline ?? !0)
3695
3712
  };
3696
3713
  }
3697
- var or = class e extends z {
3714
+ var or = class e extends B {
3698
3715
  static mimeTypes = new Map(Object.entries({
3699
3716
  ogv: "video/ogg",
3700
3717
  mov: "video/quicktime",
@@ -3718,6 +3735,34 @@ var or = class e extends z {
3718
3735
  set currentTime(e) {
3719
3736
  this.source.currentTime = e;
3720
3737
  }
3738
+ get paused() {
3739
+ return this.source.paused;
3740
+ }
3741
+ get muted() {
3742
+ return this.source.muted;
3743
+ }
3744
+ set muted(e) {
3745
+ this.source.muted !== e && (this.source.muted = e);
3746
+ }
3747
+ get loop() {
3748
+ return this.source.loop;
3749
+ }
3750
+ set loop(e) {
3751
+ this.source.loop !== e && (this.source.loop = e);
3752
+ }
3753
+ get playbackRate() {
3754
+ return this.source.playbackRate;
3755
+ }
3756
+ set playbackRate(e) {
3757
+ this.source.playbackRate !== e && (this.source.playbackRate = e);
3758
+ }
3759
+ play() {
3760
+ let e = this.source.play();
3761
+ e && typeof e.catch == "function" && e.catch(() => {});
3762
+ }
3763
+ pause() {
3764
+ this.source.pause();
3765
+ }
3721
3766
  _spf = 0;
3722
3767
  _autoPlay = !1;
3723
3768
  _sourceLoad;
@@ -3821,16 +3866,16 @@ var or = class e extends z {
3821
3866
  e && (e.removeEventListener("play", this._onPlayStart), e.removeEventListener("pause", this._onPlayStop), e.removeEventListener("seeked", this._onSeeked), e.removeEventListener("canplay", this._onCanPlay), e.removeEventListener("canplaythrough", this._onCanPlay), e.removeEventListener("error", this._onError, !0), e.pause(), e.src = "", e.load());
3822
3867
  }
3823
3868
  };
3824
- k([_({
3869
+ A([_({
3825
3870
  internal: !0,
3826
3871
  fallback: !0
3827
- }), O("design:type", Boolean)], or.prototype, "autoUpdate", void 0), k([_({
3872
+ }), k("design:type", Boolean)], or.prototype, "autoUpdate", void 0), A([_({
3828
3873
  internal: !0,
3829
3874
  fallback: 0
3830
- }), O("design:type", Number)], or.prototype, "fps", void 0);
3875
+ }), k("design:type", Number)], or.prototype, "fps", void 0);
3831
3876
  //#endregion
3832
3877
  //#region src/scene/resources/textures/ViewportTexture.ts
3833
- var sr = class extends z {}, cr = class extends v {
3878
+ var sr = class extends B {}, cr = class extends v {
3834
3879
  fillStyle;
3835
3880
  fillRule;
3836
3881
  strokeStyle;
@@ -3844,7 +3889,7 @@ var sr = class extends z {}, cr = class extends v {
3844
3889
  _draws = [];
3845
3890
  _triCache = [];
3846
3891
  _parseDrawStyle(e) {
3847
- return e ? e instanceof z ? { texture: e } : { texture: nr.get(e) } : {};
3892
+ return e ? e instanceof B ? { texture: e } : { texture: nr.get(e) } : {};
3848
3893
  }
3849
3894
  stroke(e) {
3850
3895
  if (!this.curves.length) return;
@@ -4028,7 +4073,7 @@ function pr(e) {
4028
4073
  let t = fr[e] ?? 0;
4029
4074
  return t++, fr[e] = t, t;
4030
4075
  }
4031
- var B = dr = class extends T {
4076
+ var V = dr = class extends T {
4032
4077
  static parse(e, t = "Node") {
4033
4078
  if (Array.isArray(e)) return e.map((e) => this.parse(e));
4034
4079
  let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((ve.get(n ?? r.inCanvasIs ?? t)) ?? dr)({
@@ -4391,13 +4436,13 @@ var B = dr = class extends T {
4391
4436
  });
4392
4437
  }
4393
4438
  };
4394
- k([_({ default: () => c() }), O("design:type", String)], B.prototype, "id", void 0), k([_({ default: () => c() }), O("design:type", String)], B.prototype, "name", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "processMode", void 0), k([_({ fallback: "default" }), O("design:type", Object)], B.prototype, "processSortMode", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "renderMode", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "inputMode", void 0), k([_({ fallback: "default" }), O("design:type", Object)], B.prototype, "internalMode", void 0), k([_({
4439
+ A([_({ default: () => c() }), k("design:type", String)], V.prototype, "id", void 0), A([_({ default: () => c() }), k("design:type", String)], V.prototype, "name", void 0), A([_({ fallback: "inherit" }), k("design:type", Object)], V.prototype, "processMode", void 0), A([_({ fallback: "default" }), k("design:type", Object)], V.prototype, "processSortMode", void 0), A([_({ fallback: "inherit" }), k("design:type", Object)], V.prototype, "renderMode", void 0), A([_({ fallback: "inherit" }), k("design:type", Object)], V.prototype, "inputMode", void 0), A([_({ fallback: "default" }), k("design:type", Object)], V.prototype, "internalMode", void 0), A([_({
4395
4440
  internal: !0,
4396
4441
  default: !0
4397
- }), O("design:type", Boolean)], B.prototype, "needsRender", void 0), B = dr = k([S("Node"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], B);
4442
+ }), k("design:type", Boolean)], V.prototype, "needsRender", void 0), V = dr = A([S("Node"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], V);
4398
4443
  //#endregion
4399
4444
  //#region src/scene/main/TimelineNode.ts
4400
- var V = class extends B {
4445
+ var H = class extends V {
4401
4446
  insideTimeRange = !1;
4402
4447
  get _timeline() {
4403
4448
  return this._tree?.timeline;
@@ -4433,7 +4478,7 @@ var V = class extends B {
4433
4478
  return this._globalStartTime + this._globalDuration;
4434
4479
  }
4435
4480
  get currentTimeProgress() {
4436
- return this._duration ? St(this._currentTime / this._duration, 0, 1) : 0;
4481
+ return this._duration ? D(this._currentTime / this._duration, 0, 1) : 0;
4437
4482
  }
4438
4483
  isInsideTimeRange() {
4439
4484
  let e = this._currentTime;
@@ -4479,7 +4524,7 @@ var V = class extends B {
4479
4524
  super._process(e), this._updateCurrentTime();
4480
4525
  }
4481
4526
  };
4482
- k([_({ fallback: !1 }), O("design:type", Boolean)], V.prototype, "loop", void 0), k([_({ fallback: 0 }), O("design:type", Number)], V.prototype, "delay", void 0), k([_({ fallback: 0 }), O("design:type", Number)], V.prototype, "duration", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], V.prototype, "paused", void 0), V = k([S("TimelineNode"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], V);
4527
+ A([_({ fallback: !1 }), k("design:type", Boolean)], H.prototype, "loop", void 0), A([_({ fallback: 0 }), k("design:type", Number)], H.prototype, "delay", void 0), A([_({ fallback: 0 }), k("design:type", Number)], H.prototype, "duration", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], H.prototype, "paused", void 0), H = A([S("TimelineNode"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], H);
4483
4528
  //#endregion
4484
4529
  //#region src/scene/main/CanvasItem.ts
4485
4530
  var mr = [], hr = 0;
@@ -4490,7 +4535,7 @@ function _r(e, t, n, r) {
4490
4535
  let i = mr[hr];
4491
4536
  return i || (i = {}, mr[hr] = i), hr++, Object.assign(i, e), i.roundPixels = t, i.size = n, i.texture = r, i;
4492
4537
  }
4493
- var vr = class extends V {
4538
+ var vr = class extends H {
4494
4539
  _blendMode;
4495
4540
  _parentGlobalVisible;
4496
4541
  _globalVisible;
@@ -4570,7 +4615,7 @@ var vr = class extends V {
4570
4615
  }
4571
4616
  _updateGlobalOpacity() {
4572
4617
  this._parentGlobalOpacity = this.getParent()?.opacity;
4573
- let e = St(this.opacity, 0, 1) * (this._parentGlobalOpacity ?? 1);
4618
+ let e = D(this.opacity, 0, 1) * (this._parentGlobalOpacity ?? 1);
4574
4619
  this._globalOpacity !== e && (this._globalOpacity = e, this._updateModulate(), this.requestPaint(), this.updateRenderable());
4575
4620
  }
4576
4621
  _draw() {
@@ -4649,19 +4694,19 @@ var vr = class extends V {
4649
4694
  super._destroy(), this.context.destroy(), this._drawBatchables = [], this._layoutBatchables = [], this._batchables = [];
4650
4695
  }
4651
4696
  };
4652
- k([_(), O("design:type", Object)], vr.prototype, "blendMode", void 0), k([_({
4697
+ A([_(), k("design:type", Object)], vr.prototype, "blendMode", void 0), A([_({
4653
4698
  internal: !0,
4654
4699
  fallback: !0
4655
- }), O("design:type", Boolean)], vr.prototype, "visible", void 0), k([_({
4700
+ }), k("design:type", Boolean)], vr.prototype, "visible", void 0), A([_({
4656
4701
  internal: !0,
4657
4702
  fallback: 1
4658
- }), O("design:type", Number)], vr.prototype, "opacity", void 0), vr = k([S("CanvasItem"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], vr);
4703
+ }), k("design:type", Number)], vr.prototype, "opacity", void 0), vr = A([S("CanvasItem"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], vr);
4659
4704
  //#endregion
4660
4705
  //#region src/scene/main/Viewport.ts
4661
- var H = class extends B {
4706
+ var U = class extends V {
4662
4707
  canvasTransform = new b();
4663
4708
  renderTargetIndex = 0;
4664
- renderTargets = [new R(), new R()];
4709
+ renderTargets = [new z(), new z()];
4665
4710
  get valid() {
4666
4711
  return !!(this.width && this.height);
4667
4712
  }
@@ -4708,7 +4753,7 @@ var H = class extends B {
4708
4753
  return !1;
4709
4754
  }
4710
4755
  activateWithCopy(e, t) {
4711
- this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), L.draw(e, Qn.instance, { sampler: 0 }));
4756
+ this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), R.draw(e, Qn.instance, { sampler: 0 }));
4712
4757
  }
4713
4758
  renderStart(e, t) {
4714
4759
  this.activate(e, t) && e.clear();
@@ -4721,7 +4766,7 @@ var H = class extends B {
4721
4766
  this.renderStart(e), super.render(e, t), this.renderEnd(e, n);
4722
4767
  }
4723
4768
  getRect() {
4724
- return new vt(this.x, this.y, this.width, this.height);
4769
+ return new yt(this.x, this.y, this.width, this.height);
4725
4770
  }
4726
4771
  toCanvasGlobal(e, t) {
4727
4772
  return this.canvasTransform.applyAffineInverse(e, t);
@@ -4733,16 +4778,16 @@ var H = class extends B {
4733
4778
  super._destroy(), this.canvasTransform.destroy(), this.renderTargets.forEach((e) => e.destroy());
4734
4779
  }
4735
4780
  };
4736
- k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "x", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "y", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "height", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "mipLevel", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], H.prototype, "msaa", void 0), H = k([S("Viewport")], H);
4781
+ A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "x", void 0), A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "y", void 0), A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "width", void 0), A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "height", void 0), A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "mipLevel", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], U.prototype, "msaa", void 0), U = A([S("Viewport")], U);
4737
4782
  //#endregion
4738
4783
  //#region src/scene/main/Effect.ts
4739
- var U = class extends V {
4784
+ var W = class extends H {
4740
4785
  material;
4741
4786
  get _effectMode() {
4742
4787
  return this.effectMode ?? "parent";
4743
4788
  }
4744
- viewport1 = new H();
4745
- viewport2 = new H();
4789
+ viewport1 = new U();
4790
+ viewport2 = new U();
4746
4791
  _renderId = 0;
4747
4792
  _renderViewport;
4748
4793
  _previousSibling;
@@ -4794,7 +4839,7 @@ var U = class extends V {
4794
4839
  }
4795
4840
  }
4796
4841
  getRect() {
4797
- return new vt(this._rect);
4842
+ return new yt(this._rect);
4798
4843
  }
4799
4844
  _processParent() {
4800
4845
  let e = this._tree?.renderStack;
@@ -4947,13 +4992,13 @@ var U = class extends V {
4947
4992
  }
4948
4993
  apply(e, t, n) {
4949
4994
  this.material && (n?.redraw ? t.redraw(e, () => {
4950
- L.draw(e, this.material, {
4995
+ R.draw(e, this.material, {
4951
4996
  from: 0,
4952
4997
  to: 1,
4953
4998
  progress: this.currentTimeProgress,
4954
4999
  ratio: t.width / t.height
4955
5000
  });
4956
- }) : L.draw(e, this.material, {
5001
+ }) : R.draw(e, this.material, {
4957
5002
  from: 0,
4958
5003
  to: 1,
4959
5004
  progress: this.currentTimeProgress,
@@ -4964,7 +5009,7 @@ var U = class extends V {
4964
5009
  super._destroy(), this.viewport1.destroy(), this.viewport2.destroy();
4965
5010
  }
4966
5011
  };
4967
- k([_({ internal: !0 }), O("design:type", Object)], U.prototype, "material", void 0), k([_(), O("design:type", Object)], U.prototype, "effectMode", void 0), k([_(), O("design:type", String)], U.prototype, "glsl", void 0), k([_(), O("design:type", String)], U.prototype, "glslSrc", void 0), U = k([S("Effect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], U);
5012
+ A([_({ internal: !0 }), k("design:type", Object)], W.prototype, "material", void 0), A([_(), k("design:type", Object)], W.prototype, "effectMode", void 0), A([_(), k("design:type", String)], W.prototype, "glsl", void 0), A([_(), k("design:type", String)], W.prototype, "glslSrc", void 0), W = A([S("Effect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], W);
4968
5013
  //#endregion
4969
5014
  //#region src/scene/main/RenderStack.ts
4970
5015
  var yr = class {
@@ -4989,8 +5034,25 @@ var yr = class {
4989
5034
  });
4990
5035
  }), this.calls = [];
4991
5036
  }
4992
- }, br, xr = br = class extends B {
5037
+ }, br, xr = br = class extends V {
4993
5038
  currentTime = 0;
5039
+ playing = !1;
5040
+ playbackRate = 1;
5041
+ _rate = 1;
5042
+ _direction = 1;
5043
+ _loopMode = "none";
5044
+ get loopMode() {
5045
+ return this._loopMode;
5046
+ }
5047
+ set loopMode(e) {
5048
+ this._loopMode = e, this.loop = e === "loop";
5049
+ }
5050
+ get rate() {
5051
+ return this._rate;
5052
+ }
5053
+ set rate(e) {
5054
+ this._rate = e, this.playbackRate = e * this._direction;
5055
+ }
4994
5056
  static from(e, t = !1) {
4995
5057
  let [n, r] = e ? Array.isArray(e) ? e : [0, e] : [];
4996
5058
  return new br({
@@ -5011,16 +5073,38 @@ var yr = class {
5011
5073
  }
5012
5074
  addTime(e) {
5013
5075
  let t = this.endTime, n = Math.min(this.startTime, this.endTime), r = this.currentTime;
5014
- return r += e, this.loop && r > t && (r = n + r % t), r = St(r, n, t), this.currentTime = r, this.emit("updateCurrentTime", r, e), this;
5076
+ return r += e, this.loop && r > t && (r = n + r % t), r = D(r, n, t), this.currentTime = r, this.emit("updateCurrentTime", r, e), this;
5077
+ }
5078
+ play(e) {
5079
+ return e?.rate !== void 0 && (this._rate = e.rate), e?.loopMode !== void 0 && (this.loopMode = e.loopMode), this._direction = 1, (!Number.isFinite(this.currentTime) || this.currentTime >= this.endTime) && (this.currentTime = Math.min(this.startTime, this.endTime)), this.playing = !0, this.playbackRate = this._rate * this._direction, this;
5080
+ }
5081
+ pause() {
5082
+ return this.playing = !1, this;
5083
+ }
5084
+ advance(e) {
5085
+ if (!this.playing) return this;
5086
+ this.playbackRate = this._rate * this._direction;
5087
+ let t = Math.min(this.startTime, this.endTime), n = this.endTime;
5088
+ if (this.addTime(e * this._rate * this._direction), n <= t) return this;
5089
+ let r = this.currentTime;
5090
+ switch (this._loopMode) {
5091
+ case "none":
5092
+ (this._direction > 0 && r >= n || this._direction < 0 && r <= t) && (this.pause(), this.emit("ended"));
5093
+ break;
5094
+ case "alternate":
5095
+ this._direction > 0 && r >= n ? this._direction = -1 : this._direction < 0 && r <= t && (this._direction = 1);
5096
+ break;
5097
+ }
5098
+ return this;
5015
5099
  }
5016
5100
  _process(e) {
5017
5101
  super._process(e), this.paused || this.addTime(e);
5018
5102
  }
5019
5103
  };
5020
- k([_({ fallback: 0 }), O("design:type", Number)], xr.prototype, "startTime", void 0), k([_({ fallback: 2 ** 53 - 1 }), O("design:type", Number)], xr.prototype, "endTime", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], xr.prototype, "loop", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], xr.prototype, "paused", void 0), xr = br = k([S("Timeline"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], xr);
5104
+ A([_({ fallback: 0 }), k("design:type", Number)], xr.prototype, "startTime", void 0), A([_({ fallback: 2 ** 53 - 1 }), k("design:type", Number)], xr.prototype, "endTime", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], xr.prototype, "loop", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], xr.prototype, "paused", void 0), xr = br = A([S("Timeline"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], xr);
5021
5105
  //#endregion
5022
5106
  //#region src/scene/main/Window.ts
5023
- var Sr = class extends H {
5107
+ var Sr = class extends U {
5024
5108
  constructor() {
5025
5109
  super(), this.renderTargets.forEach((e) => e.isRoot = !0);
5026
5110
  }
@@ -5031,13 +5115,13 @@ var Sr = class extends H {
5031
5115
  super.flush(e), this.finish(e);
5032
5116
  }
5033
5117
  };
5034
- Sr = k([S("Window", {
5118
+ Sr = A([S("Window", {
5035
5119
  processMode: "always",
5036
5120
  renderMode: "always"
5037
- }), O("design:paramtypes", [])], Sr);
5121
+ }), k("design:paramtypes", [])], Sr);
5038
5122
  //#endregion
5039
5123
  //#region src/scene/main/SceneTree.ts
5040
- var Cr = class extends Et {
5124
+ var Cr = class extends Tt {
5041
5125
  input = new gt();
5042
5126
  renderStack = new yr();
5043
5127
  root = new Sr().setTree(this);
@@ -5046,7 +5130,7 @@ var Cr = class extends Et {
5046
5130
  _boundFonts;
5047
5131
  _textRemeasureScheduled = !1;
5048
5132
  _onFontLoad = () => this._scheduleTextRemeasure();
5049
- _backgroundColor = new yt();
5133
+ _backgroundColor = new E();
5050
5134
  _previousViewport;
5051
5135
  _currentViewport;
5052
5136
  getPreviousViewport() {
@@ -5104,33 +5188,33 @@ var Cr = class extends Et {
5104
5188
  _renderScreen(e) {
5105
5189
  this.root.finish(e), e.state.reset(), e.renderTarget.unbind(), this.backgroundColor && e.gl.clearColor(...this._backgroundColor.toArray()), e.clear(), this.backgroundColor && e.gl.clearColor(0, 0, 0, 0);
5106
5190
  let t = this.root.texture;
5107
- t.activate(e, 0), L.draw(e), t.inactivate(e);
5191
+ t.activate(e, 0), R.draw(e), t.inactivate(e);
5108
5192
  }
5109
5193
  _destroy() {
5110
5194
  super._destroy(), this._bindFonts(void 0), this.root.destroy(), this.input.destroy(), this.nodeMap.clear();
5111
5195
  }
5112
5196
  };
5113
- k([_({ alias: "root.msaa" }), O("design:type", Boolean)], Cr.prototype, "msaa", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Cr.prototype, "pixelate", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Cr.prototype, "roundPixels", void 0), k([_(), O("design:type", Object)], Cr.prototype, "backgroundColor", void 0), k([_({
5197
+ A([_({ alias: "root.msaa" }), k("design:type", Boolean)], Cr.prototype, "msaa", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], Cr.prototype, "pixelate", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], Cr.prototype, "roundPixels", void 0), A([_(), k("design:type", Object)], Cr.prototype, "backgroundColor", void 0), A([_({
5114
5198
  internal: !0,
5115
5199
  fallback: !1
5116
- }), O("design:type", Boolean)], Cr.prototype, "debug", void 0), k([_({
5200
+ }), k("design:type", Boolean)], Cr.prototype, "debug", void 0), A([_({
5117
5201
  internal: !0,
5118
5202
  fallback: !1
5119
- }), O("design:type", Boolean)], Cr.prototype, "processPaused", void 0), k([_({
5203
+ }), k("design:type", Boolean)], Cr.prototype, "processPaused", void 0), A([_({
5120
5204
  internal: !0,
5121
5205
  default: () => he
5122
- }), O("design:type", Object)], Cr.prototype, "fonts", void 0);
5206
+ }), k("design:type", Object)], Cr.prototype, "fonts", void 0);
5123
5207
  //#endregion
5124
5208
  //#region src/scene/main/Transition.ts
5125
- var wr = class extends U {
5209
+ var wr = class extends W {
5126
5210
  constructor(e, t = []) {
5127
5211
  super(), this.setProperties(e).append(t);
5128
5212
  }
5129
5213
  };
5130
- wr = k([S("Transition", {
5214
+ wr = A([S("Transition", {
5131
5215
  effectMode: "transition",
5132
5216
  duration: 2e3
5133
- }), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], wr);
5217
+ }), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], wr);
5134
5218
  //#endregion
5135
5219
  //#region src/scene/2d/Node2D.ts
5136
5220
  var Tr = class extends vr {
@@ -5185,7 +5269,7 @@ var Tr = class extends vr {
5185
5269
  super._destroy(), this.position.destroy(), this.scale.destroy(), this.skew.destroy(), this.pivot.destroy(), this.extraTransform.destroy(), this.transform.destroy(), this.globalPosition.destroy(), this.globalScale.destroy(), this.globalSkew.destroy(), this.globalTransform.destroy();
5186
5270
  }
5187
5271
  };
5188
- Tr = k([S("Node2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Tr);
5272
+ Tr = A([S("Node2D"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Tr);
5189
5273
  //#endregion
5190
5274
  //#region src/scene/2d/Camera2D.ts
5191
5275
  var Er = class extends Tr {
@@ -5229,7 +5313,7 @@ var Er = class extends Tr {
5229
5313
  return this.setZoom(this._zoom.x + e, this._zoom.y + t);
5230
5314
  }
5231
5315
  setZoom(e, t = e) {
5232
- return this._zoom.set(St(e, this._minZoom.x, this._maxZoom.x), St(t, this._minZoom.y, this._maxZoom.y)), this;
5316
+ return this._zoom.set(D(e, this._minZoom.x, this._maxZoom.x), D(t, this._minZoom.y, this._maxZoom.y)), this;
5233
5317
  }
5234
5318
  setZoomAtOrigin(e, t, n) {
5235
5319
  let r;
@@ -5332,16 +5416,16 @@ var Er = class extends Tr {
5332
5416
  };
5333
5417
  }
5334
5418
  };
5335
- k([_({
5419
+ A([_({
5336
5420
  internal: !0,
5337
5421
  fallback: !1
5338
- }), O("design:type", Boolean)], Er.prototype, "spaceKey", void 0), k([_({
5422
+ }), k("design:type", Boolean)], Er.prototype, "spaceKey", void 0), A([_({
5339
5423
  internal: !0,
5340
5424
  fallback: !1
5341
- }), O("design:type", Boolean)], Er.prototype, "grabbing", void 0), Er = k([S("Camera2D", {
5425
+ }), k("design:type", Boolean)], Er.prototype, "grabbing", void 0), Er = A([S("Camera2D", {
5342
5426
  processMode: "disabled",
5343
5427
  renderMode: "disabled"
5344
- }), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Er);
5428
+ }), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Er);
5345
5429
  //#endregion
5346
5430
  //#region src/scene/2d/element/connectionRouter.ts
5347
5431
  function Dr(e, t) {
@@ -5489,7 +5573,7 @@ var Pr = {
5489
5573
  sepia: 0
5490
5574
  };
5491
5575
  function Fr(e) {
5492
- let t = new Ct();
5576
+ let t = new St();
5493
5577
  if (e === "none") return t;
5494
5578
  let n = ke(e).reduce((e, { name: t, args: n }) => (e[t] = n[0].normalizedIntValue, e), {});
5495
5579
  Object.keys(Pr).forEach((e) => {
@@ -5543,11 +5627,11 @@ function Ir(e) {
5543
5627
  }
5544
5628
  //#endregion
5545
5629
  //#region src/scene/effects/ColorAdjustEffect.ts
5546
- var Lr, W = class extends U {
5630
+ var Lr, G = class extends W {
5547
5631
  static {
5548
5632
  Lr = this;
5549
5633
  }
5550
- static material = new I({ gl: {
5634
+ static material = new L({ gl: {
5551
5635
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5552
5636
  fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform float gamma;\nuniform float contrast;\nuniform float saturation;\nuniform float brightness;\nuniform float red;\nuniform float green;\nuniform float blue;\nuniform float alpha;\n\nvoid main(void) {\n vec4 c = texture2D(sampler, vUv);\n if (c.a > 0.0) {\n c.rgb /= c.a;\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n c.rgb *= c.a;\n }\n gl_FragColor = c * alpha;\n}"
5553
5637
  } });
@@ -5556,7 +5640,7 @@ var Lr, W = class extends U {
5556
5640
  }
5557
5641
  apply(e, t) {
5558
5642
  t.redraw(e, () => {
5559
- L.draw(e, Lr.material, {
5643
+ R.draw(e, Lr.material, {
5560
5644
  sampler: 0,
5561
5645
  saturation: this.saturation,
5562
5646
  contrast: this.contrast,
@@ -5570,18 +5654,18 @@ var Lr, W = class extends U {
5570
5654
  });
5571
5655
  }
5572
5656
  };
5573
- k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "saturation", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "contrast", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "brightness", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "red", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "green", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "blue", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "alpha", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "gamma", void 0), W = Lr = k([S("ColorAdjustEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], W);
5657
+ A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "saturation", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "contrast", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "brightness", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "red", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "green", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "blue", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "alpha", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "gamma", void 0), G = Lr = A([S("ColorAdjustEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], G);
5574
5658
  //#endregion
5575
5659
  //#region src/scene/effects/ColorFilterEffect.ts
5576
- var Rr, zr = class extends U {
5660
+ var Rr, zr = class extends W {
5577
5661
  static {
5578
5662
  Rr = this;
5579
5663
  }
5580
- static material = new I({ gl: {
5664
+ static material = new L({ gl: {
5581
5665
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5582
5666
  fragment: "in vec2 vUv;\nuniform sampler2D sampler;\nuniform float m[20];\n\nvoid main(void) {\n vec4 c = texture2D(sampler, vUv);\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n gl_FragColor = vec4(\n m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4] / 255.0,\n m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9] / 255.0,\n m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14] / 255.0,\n m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19] / 255.0\n );\n}"
5583
5667
  } });
5584
- _colorMatrix = new Ct();
5668
+ _colorMatrix = new St();
5585
5669
  constructor(e, t = []) {
5586
5670
  super(), this.setProperties(e).append(t);
5587
5671
  }
@@ -5625,21 +5709,21 @@ var Rr, zr = class extends U {
5625
5709
  break;
5626
5710
  }
5627
5711
  }), t.redraw(e, () => {
5628
- L.draw(e, Rr.material, {
5712
+ R.draw(e, Rr.material, {
5629
5713
  sampler: 0,
5630
5714
  m: r.toArray()
5631
5715
  });
5632
5716
  });
5633
5717
  }
5634
5718
  };
5635
- k([_(), O("design:type", String)], zr.prototype, "filter", void 0), zr = Rr = k([S("ColorFilterEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], zr);
5719
+ A([_(), k("design:type", String)], zr.prototype, "filter", void 0), zr = Rr = A([S("ColorFilterEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], zr);
5636
5720
  //#endregion
5637
5721
  //#region src/scene/effects/ColorOverlayEffect.ts
5638
- var Br, Vr = 50, Hr = class extends U {
5722
+ var Br, Vr = 50, Hr = class extends W {
5639
5723
  static {
5640
5724
  Br = this;
5641
5725
  }
5642
- static material = new I({ gl: {
5726
+ static material = new L({ gl: {
5643
5727
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5644
5728
  fragment: `precision mediump float;
5645
5729
  uniform sampler2D sampler;
@@ -5679,7 +5763,7 @@ void main(void) {
5679
5763
  gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
5680
5764
  }`
5681
5765
  } });
5682
- _color = new yt();
5766
+ _color = new E();
5683
5767
  constructor(e, t = []) {
5684
5768
  super(), this.setProperties(e).append(t);
5685
5769
  }
@@ -5696,25 +5780,25 @@ void main(void) {
5696
5780
  0,
5697
5781
  0
5698
5782
  ]);
5699
- L.draw(e, Br.material, {
5783
+ R.draw(e, Br.material, {
5700
5784
  sampler: 0,
5701
5785
  colors: t.slice(0, Vr).flatMap((e) => e)
5702
5786
  });
5703
5787
  });
5704
5788
  }
5705
5789
  };
5706
- k([_({ default: () => [] }), O("design:type", Array)], Hr.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Hr.prototype, "alpha", void 0), Hr = Br = k([S("ColorOverlayEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Hr);
5790
+ A([_({ default: () => [] }), k("design:type", Array)], Hr.prototype, "colors", void 0), A([_({ fallback: .5 }), k("design:type", Number)], Hr.prototype, "alpha", void 0), Hr = Br = A([S("ColorOverlayEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Hr);
5707
5791
  //#endregion
5708
5792
  //#region src/scene/effects/ColorRemoveEffect.ts
5709
- var Ur, Wr = class extends U {
5793
+ var Ur, Wr = class extends W {
5710
5794
  static {
5711
5795
  Ur = this;
5712
5796
  }
5713
- static material = new I({ gl: {
5797
+ static material = new L({ gl: {
5714
5798
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5715
5799
  fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform float epsilon;\nconst int MAX_COLORS = 50;\nuniform vec3 originalColors[MAX_COLORS];\n\nvoid main(void) {\n vec4 color = texture2D(sampler, vUv);\n\n for (int i = 0; i < MAX_COLORS; i++) {\n vec3 origColor = originalColors[i];\n if (origColor.r < 0.0) {\n break;\n }\n vec3 colorDiff = origColor - color.rgb;\n if (length(colorDiff) < epsilon) {\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n }\n }\n\n gl_FragColor = color;\n}"
5716
5800
  } });
5717
- _color = new yt();
5801
+ _color = new E();
5718
5802
  constructor(e, t = []) {
5719
5803
  super(), this.setProperties(e).append(t);
5720
5804
  }
@@ -5728,7 +5812,7 @@ var Ur, Wr = class extends U {
5728
5812
  r.slice(0, 50).forEach((e, t) => {
5729
5813
  n[t * 3] = e[0], n[t * 3 + 1] = e[1], n[t * 3 + 2] = e[2];
5730
5814
  }), t.redraw(e, () => {
5731
- L.draw(e, Ur.material, {
5815
+ R.draw(e, Ur.material, {
5732
5816
  sampler: 0,
5733
5817
  epsilon: this.epsilon,
5734
5818
  originalColors: n
@@ -5736,14 +5820,14 @@ var Ur, Wr = class extends U {
5736
5820
  });
5737
5821
  }
5738
5822
  };
5739
- k([_({ default: () => [] }), O("design:type", Array)], Wr.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Wr.prototype, "epsilon", void 0), Wr = Ur = k([S("ColorRemoveEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Wr);
5823
+ A([_({ default: () => [] }), k("design:type", Array)], Wr.prototype, "colors", void 0), A([_({ fallback: .5 }), k("design:type", Number)], Wr.prototype, "epsilon", void 0), Wr = Ur = A([S("ColorRemoveEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Wr);
5740
5824
  //#endregion
5741
5825
  //#region src/scene/effects/ColorReplaceEffect.ts
5742
- var Gr, Kr = 50, qr = class extends U {
5826
+ var Gr, Kr = 50, qr = class extends W {
5743
5827
  static {
5744
5828
  Gr = this;
5745
5829
  }
5746
- static material = new I({ gl: {
5830
+ static material = new L({ gl: {
5747
5831
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5748
5832
  fragment: `varying vec2 vUv;
5749
5833
  uniform sampler2D sampler;
@@ -5776,7 +5860,7 @@ void main(void) {
5776
5860
  }
5777
5861
  }`
5778
5862
  } });
5779
- _color = new yt();
5863
+ _color = new E();
5780
5864
  constructor(e, t = []) {
5781
5865
  super(), this.setProperties(e).append(t);
5782
5866
  }
@@ -5799,7 +5883,7 @@ void main(void) {
5799
5883
  n.slice(0, Kr).forEach(([e, t], n) => {
5800
5884
  i[n * 3] = e[0], i[n * 3 + 1] = e[1], i[n * 3 + 2] = e[2], a[n * 3] = t[0], a[n * 3 + 1] = t[1], a[n * 3 + 2] = t[2];
5801
5885
  }), t.redraw(e, () => {
5802
- L.draw(e, Gr.material, {
5886
+ R.draw(e, Gr.material, {
5803
5887
  sampler: 0,
5804
5888
  epsilon: r,
5805
5889
  originalColors: i,
@@ -5808,15 +5892,15 @@ void main(void) {
5808
5892
  });
5809
5893
  }
5810
5894
  };
5811
- k([_({ default: () => [] }), O("design:type", Array)], qr.prototype, "colors", void 0), k([_({ fallback: .05 }), O("design:type", Number)], qr.prototype, "epsilon", void 0), qr = Gr = k([S("ColorReplaceEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], qr);
5895
+ A([_({ default: () => [] }), k("design:type", Array)], qr.prototype, "colors", void 0), A([_({ fallback: .05 }), k("design:type", Number)], qr.prototype, "epsilon", void 0), qr = Gr = A([S("ColorReplaceEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], qr);
5812
5896
  //#endregion
5813
5897
  //#region src/scene/effects/DrawboardEffect.frag?raw
5814
- var Jr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nuniform vec2 inputSize;\nuniform vec2 zoom;\nuniform vec2 translate;\nuniform float gridScale;\nuniform vec2 gridSize;\nuniform int checkerboard;\nuniform int checkerboardStyle;\nuniform float dotBackgroundBaseColor;\nuniform float dotBackgroundZoomedOutColor;\nuniform float dotColorDiff;\nuniform int pixelGrid;\nuniform int watermark;\nuniform sampler2D watermarkTexture;\nuniform vec2 watermarkSize;\nuniform vec2 watermarkOffset;\nuniform vec2 watermarkSpacing;\nuniform float watermarkRotation;\nuniform float watermarkAlpha;\n\nconst float VIEWPORT_SPACE_MIN_DOT_RADIUS = 0.5;\nconst float CANVAS_SPACE_DOT_RADIUS = 1.;\nconst float CANVAS_SPACE_DOT_GRID_SIZE_PX = 16.;\n\nconst int CHECKERBOARD_STYLE_NONE = 0;\nconst int CHECKERBOARD_STYLE_GRID = 1;\nconst int CHECKERBOARD_STYLE_GRID_DARK = 2;\nconst int CHECKERBOARD_STYLE_DOTS = 3;\nconst int CHECKERBOARD_STYLE_DOTS_DARK = 4;\n\nfloat _round(float val) {\n return floor(val + .5);\n}\n\nvec2 _round(vec2 pt) {\n return floor(pt + .5);\n}\n\nfloat scaledGridSize(float zoomScale) {\n if (zoomScale < 0.03125) {\n return 32.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.0625) {\n return 16.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.125) {\n return 8.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.25) {\n return 4.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.5) {\n return 2.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else {\n return CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n}\n\nvec4 renderCheckerboard(vec2 coord, vec4 color) {\n float value;\n if (checkerboardStyle == CHECKERBOARD_STYLE_GRID) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 1.0 : 0.95;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_GRID_DARK) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 0.12 : 0.17;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_DOTS || checkerboardStyle == CHECKERBOARD_STYLE_DOTS_DARK) {\n // light vs dark dots share this path; the base/dot colours are supplied as\n // uniforms (set per style on the CPU side), so only the values differ.\n float zoomScale = zoom.x;\n float gridPixelSize = scaledGridSize(zoomScale);\n float zoomInterpolationFactor = smoothstep(0.5, 1.0, zoomScale);\n float dotColor = dotBackgroundZoomedOutColor + dotColorDiff * zoomInterpolationFactor;\n vec2 nearestGridPoint = _round(coord / gridPixelSize) * gridPixelSize;\n float canvasSpaceDist = length(coord - nearestGridPoint);\n float viewportSpaceDist = canvasSpaceDist * zoomScale;\n float viewportSpaceDotRadius = max(VIEWPORT_SPACE_MIN_DOT_RADIUS, CANVAS_SPACE_DOT_RADIUS * zoomScale);\n float dist = 1.0 - smoothstep(0., 1., (viewportSpaceDist - viewportSpaceDotRadius + .5));\n value = mix(dotBackgroundBaseColor, dotColor, dist);\n }\n return vec4(value * (1.0 - color.a) + color.rgb, 1);\n}\n\nvec4 renderPixelGrid(vec2 coord, vec4 color) {\n vec3 rgb = color.rgb;\n vec2 corner = fract(coord);\n float gridWeight = max(float(corner.x < gridSize.x), float(corner.y < gridSize.y));\n vec3 gridColor;\n vec3 weights = vec3(0.299, 0.587, 0.114);\n float c2 = dot(rgb * rgb, weights);\n float luminance = sqrt(c2);\n if (luminance > 0.5) {\n float target = (luminance - 0.05) / luminance;\n gridColor = rgb * target;\n }\n else {\n float target = luminance * 0.8 + 0.15;\n float c1 = dot(rgb, weights);\n float a = 1.0 - 2.0 * c1 + c2;\n float b = c2 - c1;\n gridColor = mix(rgb, vec3(1), (b + sqrt(b * b - a * (c2 - target * target))) / a);\n }\n return vec4(mix(rgb, gridColor, gridWeight), color.a);\n}\n\nvec4 renderWatermark(vec2 coord, vec4 color) {\n float hw = watermarkSize.x * 0.5;\n float hh = watermarkSize.y * 0.5;\n float c = cos(-watermarkRotation);\n float s = sin(-watermarkRotation);\n vec2 blockSize = watermarkSize + watermarkSpacing;\n vec2 tiles = max(floor(inputSize / blockSize), vec2(1.0));\n vec2 gridCoverage = tiles * blockSize;\n vec2 startPos = watermarkOffset;\n vec2 localPix = coord - startPos;\n vec2 blockIndex = floor(localPix / blockSize);\n vec2 wmCenter = startPos + blockIndex * blockSize + watermarkSize * 0.5 + watermarkSpacing / 2.0;\n vec2 local = coord - wmCenter;\n vec2 inv = vec2(\n local.x * c + local.y * s,\n -local.x * s + local.y * c\n );\n if (inv.x >= -hw && inv.x <= hw && inv.y >= -hh && inv.y <= hh) {\n vec2 wmUV = (inv + vec2(hw, hh)) / watermarkSize;\n vec4 wmColor = texture(watermarkTexture, wmUV);\n float alpha = wmColor.a * watermarkAlpha;\n return mix(color, wmColor, alpha);\n } else {\n return color;\n }\n}\n\nvoid main(void) {\n vec4 color = texture(uTexture, vUv);\n vec2 coord = vec2(vUv.x, 1.0 - vUv.y);\n coord = (coord * inputSize - translate) / zoom;\n if (checkerboard > 0) {\n color = renderCheckerboard(coord, color);\n }\n if (watermark > 0) {\n color = renderWatermark(coord, color);\n }\n if (pixelGrid > 0) {\n color = renderPixelGrid(coord, color);\n }\n gl_FragColor = color;\n}\n", Yr, G = class extends U {
5898
+ var Jr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nuniform vec2 inputSize;\nuniform vec2 zoom;\nuniform vec2 translate;\nuniform float gridScale;\nuniform vec2 gridSize;\nuniform int checkerboard;\nuniform int checkerboardStyle;\nuniform float dotBackgroundBaseColor;\nuniform float dotBackgroundZoomedOutColor;\nuniform float dotColorDiff;\nuniform int pixelGrid;\nuniform int watermark;\nuniform sampler2D watermarkTexture;\nuniform vec2 watermarkSize;\nuniform vec2 watermarkOffset;\nuniform vec2 watermarkSpacing;\nuniform float watermarkRotation;\nuniform float watermarkAlpha;\n\nconst float VIEWPORT_SPACE_MIN_DOT_RADIUS = 0.5;\nconst float CANVAS_SPACE_DOT_RADIUS = 1.;\nconst float CANVAS_SPACE_DOT_GRID_SIZE_PX = 16.;\n\nconst int CHECKERBOARD_STYLE_NONE = 0;\nconst int CHECKERBOARD_STYLE_GRID = 1;\nconst int CHECKERBOARD_STYLE_GRID_DARK = 2;\nconst int CHECKERBOARD_STYLE_DOTS = 3;\nconst int CHECKERBOARD_STYLE_DOTS_DARK = 4;\n\nfloat _round(float val) {\n return floor(val + .5);\n}\n\nvec2 _round(vec2 pt) {\n return floor(pt + .5);\n}\n\nfloat scaledGridSize(float zoomScale) {\n if (zoomScale < 0.03125) {\n return 32.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.0625) {\n return 16.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.125) {\n return 8.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.25) {\n return 4.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.5) {\n return 2.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else {\n return CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n}\n\nvec4 renderCheckerboard(vec2 coord, vec4 color) {\n float value;\n if (checkerboardStyle == CHECKERBOARD_STYLE_GRID) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 1.0 : 0.95;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_GRID_DARK) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 0.12 : 0.17;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_DOTS || checkerboardStyle == CHECKERBOARD_STYLE_DOTS_DARK) {\n // light vs dark dots share this path; the base/dot colours are supplied as\n // uniforms (set per style on the CPU side), so only the values differ.\n float zoomScale = zoom.x;\n float gridPixelSize = scaledGridSize(zoomScale);\n float zoomInterpolationFactor = smoothstep(0.5, 1.0, zoomScale);\n float dotColor = dotBackgroundZoomedOutColor + dotColorDiff * zoomInterpolationFactor;\n vec2 nearestGridPoint = _round(coord / gridPixelSize) * gridPixelSize;\n float canvasSpaceDist = length(coord - nearestGridPoint);\n float viewportSpaceDist = canvasSpaceDist * zoomScale;\n float viewportSpaceDotRadius = max(VIEWPORT_SPACE_MIN_DOT_RADIUS, CANVAS_SPACE_DOT_RADIUS * zoomScale);\n float dist = 1.0 - smoothstep(0., 1., (viewportSpaceDist - viewportSpaceDotRadius + .5));\n value = mix(dotBackgroundBaseColor, dotColor, dist);\n }\n return vec4(value * (1.0 - color.a) + color.rgb, 1);\n}\n\nvec4 renderPixelGrid(vec2 coord, vec4 color) {\n vec3 rgb = color.rgb;\n vec2 corner = fract(coord);\n float gridWeight = max(float(corner.x < gridSize.x), float(corner.y < gridSize.y));\n vec3 gridColor;\n vec3 weights = vec3(0.299, 0.587, 0.114);\n float c2 = dot(rgb * rgb, weights);\n float luminance = sqrt(c2);\n if (luminance > 0.5) {\n float target = (luminance - 0.05) / luminance;\n gridColor = rgb * target;\n }\n else {\n float target = luminance * 0.8 + 0.15;\n float c1 = dot(rgb, weights);\n float a = 1.0 - 2.0 * c1 + c2;\n float b = c2 - c1;\n gridColor = mix(rgb, vec3(1), (b + sqrt(b * b - a * (c2 - target * target))) / a);\n }\n return vec4(mix(rgb, gridColor, gridWeight), color.a);\n}\n\nvec4 renderWatermark(vec2 coord, vec4 color) {\n float hw = watermarkSize.x * 0.5;\n float hh = watermarkSize.y * 0.5;\n float c = cos(-watermarkRotation);\n float s = sin(-watermarkRotation);\n vec2 blockSize = watermarkSize + watermarkSpacing;\n vec2 tiles = max(floor(inputSize / blockSize), vec2(1.0));\n vec2 gridCoverage = tiles * blockSize;\n vec2 startPos = watermarkOffset;\n vec2 localPix = coord - startPos;\n vec2 blockIndex = floor(localPix / blockSize);\n vec2 wmCenter = startPos + blockIndex * blockSize + watermarkSize * 0.5 + watermarkSpacing / 2.0;\n vec2 local = coord - wmCenter;\n vec2 inv = vec2(\n local.x * c + local.y * s,\n -local.x * s + local.y * c\n );\n if (inv.x >= -hw && inv.x <= hw && inv.y >= -hh && inv.y <= hh) {\n vec2 wmUV = (inv + vec2(hw, hh)) / watermarkSize;\n vec4 wmColor = texture(watermarkTexture, wmUV);\n float alpha = wmColor.a * watermarkAlpha;\n return mix(color, wmColor, alpha);\n } else {\n return color;\n }\n}\n\nvoid main(void) {\n vec4 color = texture(uTexture, vUv);\n vec2 coord = vec2(vUv.x, 1.0 - vUv.y);\n coord = (coord * inputSize - translate) / zoom;\n if (checkerboard > 0) {\n color = renderCheckerboard(coord, color);\n }\n if (watermark > 0) {\n color = renderWatermark(coord, color);\n }\n if (pixelGrid > 0) {\n color = renderPixelGrid(coord, color);\n }\n gl_FragColor = color;\n}\n", Yr, K = class extends W {
5815
5899
  static {
5816
5900
  Yr = this;
5817
5901
  }
5818
5902
  _watermark;
5819
- static material = new I({ gl: {
5903
+ static material = new L({ gl: {
5820
5904
  vertex: "attribute vec2 position;\nin vec2 uv;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position.xy, 0.0, 1.0);\n vUv = uv;\n}",
5821
5905
  fragment: Jr
5822
5906
  } });
@@ -5867,7 +5951,7 @@ var Jr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
5867
5951
  zoomedOut: this.dotColor ?? a.zoomedOut,
5868
5952
  diff: this.dotZoomDiff ?? a.diff
5869
5953
  };
5870
- L.draw(e, Yr.material, {
5954
+ R.draw(e, Yr.material, {
5871
5955
  uTexture: 0,
5872
5956
  inputSize: [t.width, t.height],
5873
5957
  zoom: [n[0], n[4]],
@@ -5891,18 +5975,18 @@ var Jr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
5891
5975
  });
5892
5976
  }
5893
5977
  };
5894
- k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "checkerboard", void 0), k([_({ fallback: "grid" }), O("design:type", Object)], G.prototype, "checkerboardStyle", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "pixelGrid", void 0), k([_(), O("design:type", Number)], G.prototype, "dotBaseColor", void 0), k([_(), O("design:type", Number)], G.prototype, "dotColor", void 0), k([_(), O("design:type", Number)], G.prototype, "dotZoomDiff", void 0), k([_(), O("design:type", String)], G.prototype, "watermark", void 0), k([_({ fallback: 100 }), O("design:type", Number)], G.prototype, "watermarkWidth", void 0), k([_({ fallback: .05 }), O("design:type", Number)], G.prototype, "watermarkAlpha", void 0), k([_({ fallback: .5236 }), O("design:type", Number)], G.prototype, "watermarkRotation", void 0), G = Yr = k([S("DrawboardEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], G);
5978
+ A([_({ fallback: !1 }), k("design:type", Boolean)], K.prototype, "checkerboard", void 0), A([_({ fallback: "grid" }), k("design:type", Object)], K.prototype, "checkerboardStyle", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], K.prototype, "pixelGrid", void 0), A([_(), k("design:type", Number)], K.prototype, "dotBaseColor", void 0), A([_(), k("design:type", Number)], K.prototype, "dotColor", void 0), A([_(), k("design:type", Number)], K.prototype, "dotZoomDiff", void 0), A([_(), k("design:type", String)], K.prototype, "watermark", void 0), A([_({ fallback: 100 }), k("design:type", Number)], K.prototype, "watermarkWidth", void 0), A([_({ fallback: .05 }), k("design:type", Number)], K.prototype, "watermarkAlpha", void 0), A([_({ fallback: .5236 }), k("design:type", Number)], K.prototype, "watermarkRotation", void 0), K = Yr = A([S("DrawboardEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], K);
5895
5979
  //#endregion
5896
5980
  //#region src/scene/effects/GaussianBlurEffect.ts
5897
- var Xr, Zr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void) {\n gl_FragColor = vec4(0.0);\n float flag = 0.0;\n for (int i = 0; i < 9; i++) {\n vec2 uv = vUv[i];\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {\n flag = 1.0;\n break;\n }\n }\n if (flag == 1.0) {\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n } else {\n gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;\n }\n}", Qr = class extends U {
5981
+ var Xr, Zr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void) {\n gl_FragColor = vec4(0.0);\n float flag = 0.0;\n for (int i = 0; i < 9; i++) {\n vec2 uv = vUv[i];\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {\n flag = 1.0;\n break;\n }\n }\n if (flag == 1.0) {\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n } else {\n gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;\n }\n}", Qr = class extends W {
5898
5982
  static {
5899
5983
  Xr = this;
5900
5984
  }
5901
- static materialX = new I({ gl: {
5985
+ static materialX = new L({ gl: {
5902
5986
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(-4.0 * uStrength, 0.0);\n vUv[1] = uv + vec2(-3.0 * uStrength, 0.0);\n vUv[2] = uv + vec2(-2.0 * uStrength, 0.0);\n vUv[3] = uv + vec2(-1.0 * uStrength, 0.0);\n vUv[4] = uv + vec2(0.0 * uStrength, 0.0);\n vUv[5] = uv + vec2(1.0 * uStrength, 0.0);\n vUv[6] = uv + vec2(2.0 * uStrength, 0.0);\n vUv[7] = uv + vec2(3.0 * uStrength, 0.0);\n vUv[8] = uv + vec2(4.0 * uStrength, 0.0);\n}",
5903
5987
  fragment: Zr
5904
5988
  } });
5905
- static materialY = new I({ gl: {
5989
+ static materialY = new L({ gl: {
5906
5990
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(0.0, -4.0 * uStrength);\n vUv[1] = uv + vec2(0.0, -3.0 * uStrength);\n vUv[2] = uv + vec2(0.0, -2.0 * uStrength);\n vUv[3] = uv + vec2(0.0, -1.0 * uStrength);\n vUv[4] = uv + vec2(0.0, 0.0 * uStrength);\n vUv[5] = uv + vec2(0.0, 1.0 * uStrength);\n vUv[6] = uv + vec2(0.0, 2.0 * uStrength);\n vUv[7] = uv + vec2(0.0, 3.0 * uStrength);\n vUv[8] = uv + vec2(0.0, 4.0 * uStrength);\n}",
5907
5991
  fragment: Zr
5908
5992
  } });
@@ -5912,39 +5996,39 @@ var Xr, Zr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void
5912
5996
  apply(e, t) {
5913
5997
  let n = 1 / t.width, r = 1 / t.height, i = Math.max(this.quality, 1);
5914
5998
  for (let r = 0; r < i; r++) t.redraw(e, () => {
5915
- L.draw(e, Xr.materialX, {
5999
+ R.draw(e, Xr.materialX, {
5916
6000
  sampler: 0,
5917
6001
  uStrength: n * (this.strength / i)
5918
6002
  });
5919
6003
  });
5920
6004
  for (let n = 0; n < i; n++) t.redraw(e, () => {
5921
- L.draw(e, Xr.materialY, {
6005
+ R.draw(e, Xr.materialY, {
5922
6006
  sampler: 0,
5923
6007
  uStrength: r * (this.strength / i)
5924
6008
  });
5925
6009
  });
5926
6010
  }
5927
6011
  };
5928
- k([_({ fallback: 4 }), O("design:type", Number)], Qr.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], Qr.prototype, "quality", void 0), Qr = Xr = k([S("GaussianBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Qr);
6012
+ A([_({ fallback: 4 }), k("design:type", Number)], Qr.prototype, "strength", void 0), A([_({ fallback: 3 }), k("design:type", Number)], Qr.prototype, "quality", void 0), Qr = Xr = A([S("GaussianBlurEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Qr);
5929
6013
  //#endregion
5930
6014
  //#region src/scene/effects/DropShadowEffect.ts
5931
- var $r, ei = class extends U {
6015
+ var $r, ei = class extends W {
5932
6016
  static {
5933
6017
  $r = this;
5934
6018
  }
5935
- static material = new I({ gl: {
6019
+ static material = new L({ gl: {
5936
6020
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5937
6021
  fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float uAlpha;\nuniform vec3 uColor;\nuniform vec2 uOffset;\nuniform vec4 uInputSize;\n\nvoid main(void) {\n vec4 sample = texture2D(sampler, vUv + uOffset * uInputSize.zw);\n sample.rgb = uColor.rgb * sample.a;\n sample *= uAlpha;\n gl_FragColor = sample;\n}"
5938
6022
  } });
5939
6023
  blurEffect = new Qr();
5940
- viewport3 = new H();
5941
- _color = new yt();
6024
+ viewport3 = new U();
6025
+ _color = new E();
5942
6026
  constructor(e, t = []) {
5943
6027
  super(), this.setProperties(e).append(t);
5944
6028
  }
5945
6029
  apply(e, t) {
5946
6030
  this.viewport3.activateWithCopy(e, t), this.viewport3.redraw(e, () => {
5947
- this._color.value = this.color, L.draw(e, $r.material, {
6031
+ this._color.value = this.color, R.draw(e, $r.material, {
5948
6032
  sampler: 0,
5949
6033
  uAlpha: this._color.a,
5950
6034
  uColor: this._color.toArray().slice(0, 3),
@@ -5957,18 +6041,18 @@ var $r, ei = class extends U {
5957
6041
  ]
5958
6042
  });
5959
6043
  }), this.blurEffect.strength = this.blur, this.blurEffect.apply(e, this.viewport3), t.redraw(e, () => {
5960
- this.viewport3.texture.activate(e, 1), L.draw(e, Qn.instance, { sampler: 1 }), this.shadowOnly || L.draw(e, Qn.instance, { sampler: 0 }), e.texture.unbind(1);
6044
+ this.viewport3.texture.activate(e, 1), R.draw(e, Qn.instance, { sampler: 1 }), this.shadowOnly || R.draw(e, Qn.instance, { sampler: 0 }), e.texture.unbind(1);
5961
6045
  });
5962
6046
  }
5963
6047
  };
5964
- k([_({ fallback: "#000000FF" }), O("design:type", Object)], ei.prototype, "color", void 0), k([_({ fallback: 4 }), O("design:type", Number)], ei.prototype, "blur", void 0), k([_({ fallback: 4 }), O("design:type", Number)], ei.prototype, "offsetX", void 0), k([_({ fallback: 4 }), O("design:type", Number)], ei.prototype, "offsetY", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], ei.prototype, "shadowOnly", void 0), ei = $r = k([S("DropShadowEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ei);
6048
+ A([_({ fallback: "#000000FF" }), k("design:type", Object)], ei.prototype, "color", void 0), A([_({ fallback: 4 }), k("design:type", Number)], ei.prototype, "blur", void 0), A([_({ fallback: 4 }), k("design:type", Number)], ei.prototype, "offsetX", void 0), A([_({ fallback: 4 }), k("design:type", Number)], ei.prototype, "offsetY", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], ei.prototype, "shadowOnly", void 0), ei = $r = A([S("DropShadowEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ei);
5965
6049
  //#endregion
5966
6050
  //#region src/scene/effects/EmbossEffect.ts
5967
- var ti, ni = class extends U {
6051
+ var ti, ni = class extends W {
5968
6052
  static {
5969
6053
  ti = this;
5970
6054
  }
5971
- static material = new I({ gl: {
6055
+ static material = new L({ gl: {
5972
6056
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5973
6057
  fragment: "precision mediump float;\nuniform sampler2D sampler;\nuniform vec4 inputSize;\nuniform float strength;\nvarying vec2 vUv;\n\nvoid main(void) {\n vec2 onePixel = inputSize.zw;\n vec4 color;\n color.rgb = vec3(0.5);\n color -= texture2D(sampler, vUv - onePixel) * strength;\n color += texture2D(sampler, vUv + onePixel) * strength;\n color.rgb = vec3((color.r + color.g + color.b) / 3.0);\n float alpha = texture2D(sampler, vUv).a;\n gl_FragColor = vec4(color.rgb * alpha, alpha);\n}"
5974
6058
  } });
@@ -5977,7 +6061,7 @@ var ti, ni = class extends U {
5977
6061
  }
5978
6062
  apply(e, t) {
5979
6063
  t.redraw(e, () => {
5980
- L.draw(e, ti.material, {
6064
+ R.draw(e, ti.material, {
5981
6065
  sampler: 0,
5982
6066
  strength: this.strength,
5983
6067
  inputSize: [
@@ -5990,14 +6074,14 @@ var ti, ni = class extends U {
5990
6074
  });
5991
6075
  }
5992
6076
  };
5993
- k([_({ fallback: 5 }), O("design:type", Number)], ni.prototype, "strength", void 0), ni = ti = k([S("EmbossEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ni);
6077
+ A([_({ fallback: 5 }), k("design:type", Number)], ni.prototype, "strength", void 0), ni = ti = A([S("EmbossEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ni);
5994
6078
  //#endregion
5995
6079
  //#region src/scene/effects/GlitchEffect.ts
5996
- var ri, K = class extends U {
6080
+ var ri, q = class extends W {
5997
6081
  static {
5998
6082
  ri = this;
5999
6083
  }
6000
- static material = new I({ gl: {
6084
+ static material = new L({ gl: {
6001
6085
  vertex: "in vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
6002
6086
  fragment: "\nin vec2 vUv;\nuniform sampler2D sampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void) {\n vec2 coord = (vUv * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vUv + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if (coord.x > filterClamp.z) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n }\n } else if (coord.x < filterClamp.x) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n }\n }\n\n if (coord.y > filterClamp.w) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n }\n } else if (coord.y < filterClamp.y) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n }\n }\n }\n\n gl_FragColor.r = texture(sampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture(sampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture(sampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture(sampler, coord).a;\n}"
6003
6087
  } });
@@ -6010,7 +6094,7 @@ var ri, K = class extends U {
6010
6094
  super(), this.setProperties(e).append(t);
6011
6095
  let n = w(4, this.sampleSize);
6012
6096
  if (!n) throw Error("GlitchEffect requires a canvas; call setCanvasFactory() in non-browser environments.");
6013
- this._canvas = n, this._texture = new z(this._canvas), this._sizes = new Float32Array(this.slices), this._offsets = new Float32Array(this.slices);
6097
+ this._canvas = n, this._texture = new B(this._canvas), this._sizes = new Float32Array(this.slices), this._offsets = new Float32Array(this.slices);
6014
6098
  }
6015
6099
  redraw() {
6016
6100
  let e = this.sampleSize, t = this._texture, n = this._canvas.getContext("2d");
@@ -6027,7 +6111,7 @@ var ri, K = class extends U {
6027
6111
  this._needsRedraw || (this._needsRedraw = !0, this.redraw());
6028
6112
  let n = t.width, r = t.height, i = this.direction * (Math.PI / 180), a = Math.sin(i), o = Math.cos(i);
6029
6113
  t.redraw(e, () => {
6030
- this._texture.activate(e, 1), L.draw(e, ri.material, {
6114
+ this._texture.activate(e, 1), R.draw(e, ri.material, {
6031
6115
  sampler: 0,
6032
6116
  filterClamp: [
6033
6117
  0,
@@ -6056,14 +6140,14 @@ var ri, K = class extends U {
6056
6140
  });
6057
6141
  }
6058
6142
  };
6059
- k([_({ fallback: 10 }), O("design:type", Number)], K.prototype, "slices", void 0), k([_({ fallback: 512 }), O("design:type", Number)], K.prototype, "sampleSize", void 0), k([_({ fallback: 100 }), O("design:type", Number)], K.prototype, "offset", void 0), k([_({ fallback: 0 }), O("design:type", Number)], K.prototype, "direction", void 0), k([_({ fallback: 2 }), O("design:type", Number)], K.prototype, "fillMode", void 0), k([_({ fallback: 0 }), O("design:type", Number)], K.prototype, "seed", void 0), k([_({ default: () => [2, 2] }), O("design:type", Array)], K.prototype, "red", void 0), k([_({ default: () => [-10, 4] }), O("design:type", Array)], K.prototype, "green", void 0), k([_({ default: () => [10, -4] }), O("design:type", Array)], K.prototype, "blue", void 0), K = ri = k([S("GlitchEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], K);
6143
+ A([_({ fallback: 10 }), k("design:type", Number)], q.prototype, "slices", void 0), A([_({ fallback: 512 }), k("design:type", Number)], q.prototype, "sampleSize", void 0), A([_({ fallback: 100 }), k("design:type", Number)], q.prototype, "offset", void 0), A([_({ fallback: 0 }), k("design:type", Number)], q.prototype, "direction", void 0), A([_({ fallback: 2 }), k("design:type", Number)], q.prototype, "fillMode", void 0), A([_({ fallback: 0 }), k("design:type", Number)], q.prototype, "seed", void 0), A([_({ default: () => [2, 2] }), k("design:type", Array)], q.prototype, "red", void 0), A([_({ default: () => [-10, 4] }), k("design:type", Array)], q.prototype, "green", void 0), A([_({ default: () => [10, -4] }), k("design:type", Array)], q.prototype, "blue", void 0), q = ri = A([S("GlitchEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], q);
6060
6144
  //#endregion
6061
6145
  //#region src/scene/effects/GodrayEffect.ts
6062
- var ii, ai = "vec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289(((x * 34.0) + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nvec3 fade(vec3 t) {\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain) {\n float sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i = 0.0; i < 6.0; i++) {\n sum += totalgain * pnoise(P * sc, rep);\n sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}", q = class extends U {
6146
+ var ii, ai = "vec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289(((x * 34.0) + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nvec3 fade(vec3 t) {\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain) {\n float sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i = 0.0; i < 6.0; i++) {\n sum += totalgain * pnoise(P * sc, rep);\n sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}", J = class extends W {
6063
6147
  static {
6064
6148
  ii = this;
6065
6149
  }
6066
- static material = new I({ gl: {
6150
+ static material = new L({ gl: {
6067
6151
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
6068
6152
  fragment: `precision highp float;
6069
6153
  varying vec2 vUv;
@@ -6115,7 +6199,7 @@ void main(void) {
6115
6199
  apply(e, t) {
6116
6200
  let n = this.angle * (Math.PI / 180), r = this.parallel ? [Math.cos(n), Math.sin(n)] : this.center;
6117
6201
  t.redraw(e, () => {
6118
- L.draw(e, ii.material, {
6202
+ R.draw(e, ii.material, {
6119
6203
  sampler: 0,
6120
6204
  uDimensions: [t.width, t.height],
6121
6205
  uParallel: +!!this.parallel,
@@ -6137,13 +6221,13 @@ void main(void) {
6137
6221
  });
6138
6222
  }
6139
6223
  };
6140
- k([_({ fallback: 0 }), O("design:type", Number)], q.prototype, "time", void 0), k([_({ fallback: 30 }), O("design:type", Number)], q.prototype, "angle", void 0), k([_({ fallback: .5 }), O("design:type", Number)], q.prototype, "gain", void 0), k([_({ fallback: 2.5 }), O("design:type", Number)], q.prototype, "lacunarity", void 0), k([_({ fallback: !0 }), O("design:type", Boolean)], q.prototype, "parallel", void 0), k([_({ default: () => [0, 0] }), O("design:type", Array)], q.prototype, "center", void 0), k([_({ fallback: 1 }), O("design:type", Number)], q.prototype, "alpha", void 0), q = ii = k([S("GodrayEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], q);
6224
+ A([_({ fallback: 0 }), k("design:type", Number)], J.prototype, "time", void 0), A([_({ fallback: 30 }), k("design:type", Number)], J.prototype, "angle", void 0), A([_({ fallback: .5 }), k("design:type", Number)], J.prototype, "gain", void 0), A([_({ fallback: 2.5 }), k("design:type", Number)], J.prototype, "lacunarity", void 0), A([_({ fallback: !0 }), k("design:type", Boolean)], J.prototype, "parallel", void 0), A([_({ default: () => [0, 0] }), k("design:type", Array)], J.prototype, "center", void 0), A([_({ fallback: 1 }), k("design:type", Number)], J.prototype, "alpha", void 0), J = ii = A([S("GodrayEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], J);
6141
6225
  //#endregion
6142
6226
  //#region src/scene/effects/KawaseBlurEffect.ts
6143
- var oi = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y - uOffset.y));\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));\n color *= 0.25;\n gl_FragColor = color;\n}", si = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\nuniform vec4 uInputClamp;\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color *= 0.25;\n gl_FragColor = color;\n}", ci = class extends U {
6227
+ var oi = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y - uOffset.y));\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));\n color *= 0.25;\n gl_FragColor = color;\n}", si = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\nuniform vec4 uInputClamp;\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color *= 0.25;\n gl_FragColor = color;\n}", ci = class extends W {
6144
6228
  _kernels = [0];
6145
6229
  constructor(e, t = []) {
6146
- super(), this.material = new I({ gl: {
6230
+ super(), this.material = new L({ gl: {
6147
6231
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
6148
6232
  fragment: e?.clamp ? si : oi
6149
6233
  } }), this.setProperties(e).append(t), this._generateKernels();
@@ -6169,7 +6253,7 @@ var oi = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
6169
6253
  this._kernels.forEach((i) => {
6170
6254
  let a = i + .5;
6171
6255
  t.redraw(e, () => {
6172
- L.draw(e, this.material, {
6256
+ R.draw(e, this.material, {
6173
6257
  sampler: 0,
6174
6258
  uOffset: [a * n, a * r],
6175
6259
  uInputClamp: [
@@ -6183,14 +6267,14 @@ var oi = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
6183
6267
  });
6184
6268
  }
6185
6269
  };
6186
- k([_({ fallback: 4 }), O("design:type", Number)], ci.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], ci.prototype, "quality", void 0), k([_({ default: () => [1, 1] }), O("design:type", Array)], ci.prototype, "pixelSize", void 0), ci = k([S("KawaseBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ci);
6270
+ A([_({ fallback: 4 }), k("design:type", Number)], ci.prototype, "strength", void 0), A([_({ fallback: 3 }), k("design:type", Number)], ci.prototype, "quality", void 0), A([_({ default: () => [1, 1] }), k("design:type", Array)], ci.prototype, "pixelSize", void 0), ci = A([S("KawaseBlurEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ci);
6187
6271
  //#endregion
6188
6272
  //#region src/scene/effects/MaskEffect.ts
6189
- var li, ui = class extends U {
6273
+ var li, ui = class extends W {
6190
6274
  static {
6191
6275
  li = this;
6192
6276
  }
6193
- static material = new I({ gl: {
6277
+ static material = new L({ gl: {
6194
6278
  vertex: "attribute vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
6195
6279
  fragment: "in vec2 vUv;\n\nuniform sampler2D sampler;\nuniform sampler2D mask;\nuniform float rotation;\n\nvec2 rotateUV(vec2 uv, float angle) {\n uv -= 0.5;\n float cosAngle = cos(angle);\n float sinAngle = sin(angle);\n mat2 rotationMatrix = mat2(\n cosAngle, -sinAngle,\n sinAngle, cosAngle\n );\n uv = rotationMatrix * uv;\n uv += 0.5;\n return uv;\n}\n\nvoid main(void) {\n vec4 color = texture(sampler, vUv);\n vec4 maskColor = texture(mask, rotateUV(vUv, rotation));\n gl_FragColor = mix(vec4(0.), color, maskColor.a);\n}"
6196
6280
  } });
@@ -6210,7 +6294,7 @@ var li, ui = class extends U {
6210
6294
  }
6211
6295
  apply(e, t, n) {
6212
6296
  this.texture && t.redraw(e, () => {
6213
- this.texture.activate(e, 1), L.draw(e, li.material, {
6297
+ this.texture.activate(e, 1), R.draw(e, li.material, {
6214
6298
  sampler: 0,
6215
6299
  mask: 1,
6216
6300
  rotation: n.target?.globalRotation ?? 0
@@ -6218,10 +6302,10 @@ var li, ui = class extends U {
6218
6302
  });
6219
6303
  }
6220
6304
  };
6221
- k([_({ fallback: "" }), O("design:type", String)], ui.prototype, "image", void 0), ui = li = k([S("MaskEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ui);
6305
+ A([_({ fallback: "" }), k("design:type", String)], ui.prototype, "image", void 0), ui = li = A([S("MaskEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ui);
6222
6306
  //#endregion
6223
6307
  //#region src/scene/effects/OutlineEffect.ts
6224
- var di, fi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uThickness;\nuniform vec3 uColor;\nuniform float uAlpha;\nuniform float uKnockout;\nuniform vec4 uInputClamp;\n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP = {ANGLE_STEP};\n\nfloat outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.) {\n return 0.;\n }\n vec4 displacedColor;\n vec2 displacedPos;\n float maxAlpha = 0.;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {\n displacedPos.x = vUv.x + uThickness.x * cos(angle);\n displacedPos.y = vUv.y + uThickness.y * sin(angle);\n displacedColor = texture2D(sampler, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor = texture2D(sampler, vUv);\n vec4 contentColor = sourceColor * float(uKnockout < 0.5);\n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vUv.xy) * (1.-sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n gl_FragColor = contentColor + outlineColor;\n}", J = class extends U {
6308
+ var di, fi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uThickness;\nuniform vec3 uColor;\nuniform float uAlpha;\nuniform float uKnockout;\nuniform vec4 uInputClamp;\n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP = {ANGLE_STEP};\n\nfloat outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.) {\n return 0.;\n }\n vec4 displacedColor;\n vec2 displacedPos;\n float maxAlpha = 0.;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {\n displacedPos.x = vUv.x + uThickness.x * cos(angle);\n displacedPos.y = vUv.y + uThickness.y * sin(angle);\n displacedColor = texture2D(sampler, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor = texture2D(sampler, vUv);\n vec4 contentColor = sourceColor * float(uKnockout < 0.5);\n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vUv.xy) * (1.-sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n gl_FragColor = contentColor + outlineColor;\n}", pi = class extends W {
6225
6309
  static {
6226
6310
  di = this;
6227
6311
  }
@@ -6230,16 +6314,16 @@ var di, fi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampl
6230
6314
  static getAngleStep(e) {
6231
6315
  return Number.parseFloat((Math.PI * 2 / Math.max(e * di.MAX_SAMPLES, di.MIN_SAMPLES)).toFixed(7));
6232
6316
  }
6233
- _color = new yt();
6317
+ _color = new E();
6234
6318
  constructor(e, t = []) {
6235
- super(), this.setProperties(e).append(t), this.material = new I({ gl: {
6319
+ super(), this.setProperties(e).append(t), this.material = new L({ gl: {
6236
6320
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
6237
6321
  fragment: fi.replace(/\{ANGLE_STEP\}/, di.getAngleStep(this.quality).toFixed(7))
6238
6322
  } });
6239
6323
  }
6240
6324
  apply(e, t) {
6241
6325
  t.redraw(e, () => {
6242
- this._color.value = this.color, L.draw(e, this.material, {
6326
+ this._color.value = this.color, R.draw(e, this.material, {
6243
6327
  sampler: 0,
6244
6328
  uThickness: [this.width / t.width, this.width / t.height],
6245
6329
  uColor: this._color.toArray().slice(0, 3),
@@ -6256,14 +6340,14 @@ var di, fi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampl
6256
6340
  });
6257
6341
  }
6258
6342
  };
6259
- k([_({ fallback: "#000000ff" }), O("design:type", Object)], J.prototype, "color", void 0), k([_({ fallback: 1 }), O("design:type", Number)], J.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", String)], J.prototype, "style", void 0), k([_(), O("design:type", Object)], J.prototype, "image", void 0), k([_({ fallback: 1 }), O("design:type", Number)], J.prototype, "opacity", void 0), k([_({ fallback: .1 }), O("design:type", Number)], J.prototype, "quality", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], J.prototype, "knockout", void 0), J = di = k([S("OutlineEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], J);
6343
+ A([_({ fallback: "#000000ff" }), k("design:type", Object)], pi.prototype, "color", void 0), A([_({ fallback: 1 }), k("design:type", Number)], pi.prototype, "width", void 0), A([_({ fallback: "solid" }), k("design:type", String)], pi.prototype, "style", void 0), A([_(), k("design:type", Object)], pi.prototype, "image", void 0), A([_({ fallback: 1 }), k("design:type", Number)], pi.prototype, "opacity", void 0), A([_({ fallback: .1 }), k("design:type", Number)], pi.prototype, "quality", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], pi.prototype, "knockout", void 0), pi = di = A([S("OutlineEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], pi);
6260
6344
  //#endregion
6261
6345
  //#region src/scene/effects/PixelateEffect.ts
6262
- var pi, mi = class extends U {
6346
+ var mi, hi = class extends W {
6263
6347
  static {
6264
- pi = this;
6348
+ mi = this;
6265
6349
  }
6266
- static material = new I({ gl: {
6350
+ static material = new L({ gl: {
6267
6351
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
6268
6352
  fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 offset;\nuniform vec2 step;\n\nvoid main(void) {\n vec2 uv = vUv;\n uv = floor((uv - offset) / step) * step + offset + step / 2.0;\n gl_FragColor = texture2D(sampler, uv);\n}"
6269
6353
  } });
@@ -6277,18 +6361,18 @@ var pi, mi = class extends U {
6277
6361
  offset: [(r[0] + i[0]) / t.width, 1 - (r[1] + i[1]) / t.height],
6278
6362
  step: [this.strength * r[0] / t.width, this.strength * r[1] / t.height]
6279
6363
  };
6280
- L.draw(e, pi.material, a);
6364
+ R.draw(e, mi.material, a);
6281
6365
  });
6282
6366
  }
6283
6367
  };
6284
- k([_({ fallback: 10 }), O("design:type", Number)], mi.prototype, "strength", void 0), mi = pi = k([S("PixelateEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], mi);
6368
+ A([_({ fallback: 10 }), k("design:type", Number)], hi.prototype, "strength", void 0), hi = mi = A([S("PixelateEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], hi);
6285
6369
  //#endregion
6286
6370
  //#region src/scene/effects/ZoomBlurEffect.ts
6287
- var hi, gi = class extends U {
6371
+ var gi, _i = class extends W {
6288
6372
  static {
6289
- hi = this;
6373
+ gi = this;
6290
6374
  }
6291
- static material = new I({ gl: {
6375
+ static material = new L({ gl: {
6292
6376
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
6293
6377
  fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec4 uInputSize;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n float minGradient = uInnerRadius * 0.3;\n float innerRadius1 = (uInnerRadius + minGradient * 0.5) / uInputSize.x;\n\n float gradient = uRadius * 0.3;\n float radius1 = (uRadius - gradient * 0.5) / uInputSize.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / uInputSize.xy - vUv);\n float dist = length(vec2(dir.x, dir.y * uInputSize.y / uInputSize.x));\n\n float strength1 = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius1) {\n delta = innerRadius1 - dist;\n gap = minGradient;\n } else if (radius1 >= 0.0 && dist > radius1) { // radius1 < 0 means it's infinity\n delta = dist - radius1;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / uInputSize.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength1 *= delta;\n if (countLimit < 1.0) {\n gl_FragColor = texture2D(sampler, vUv);\n return;\n }\n }\n\n float offset = rand(vUv, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength1;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vUv + dir * percent;\n color += texture2D(sampler, p) * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n\n gl_FragColor = color;\n}"
6294
6378
  } });
@@ -6297,7 +6381,7 @@ var hi, gi = class extends U {
6297
6381
  }
6298
6382
  apply(e, t) {
6299
6383
  t.redraw(e, () => {
6300
- L.draw(e, hi.material, {
6384
+ R.draw(e, gi.material, {
6301
6385
  sampler: 0,
6302
6386
  uCenter: [t.width / 2, t.height / 2],
6303
6387
  uInnerRadius: this.innerRadius,
@@ -6313,10 +6397,10 @@ var hi, gi = class extends U {
6313
6397
  });
6314
6398
  }
6315
6399
  };
6316
- k([_(), O("design:type", Array)], gi.prototype, "center", void 0), k([_({ fallback: 20 }), O("design:type", Number)], gi.prototype, "innerRadius", void 0), k([_({ fallback: -1 }), O("design:type", Number)], gi.prototype, "radius", void 0), k([_({ fallback: .1 }), O("design:type", Number)], gi.prototype, "strength", void 0), gi = hi = k([S("ZoomBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], gi);
6400
+ A([_(), k("design:type", Array)], _i.prototype, "center", void 0), A([_({ fallback: 20 }), k("design:type", Number)], _i.prototype, "innerRadius", void 0), A([_({ fallback: -1 }), k("design:type", Number)], _i.prototype, "radius", void 0), A([_({ fallback: .1 }), k("design:type", Number)], _i.prototype, "strength", void 0), _i = gi = A([S("ZoomBlurEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], _i);
6317
6401
  //#endregion
6318
6402
  //#region src/scene/2d/element/utils.ts
6319
- function _i(e, t) {
6403
+ function vi(e, t) {
6320
6404
  let { x: n, y: r, width: i, height: a } = t, o = !1, s = new b().translate(-n, -r).scale(1 / i, 1 / a);
6321
6405
  if (e.cropRect) {
6322
6406
  let { left: t = 0, top: n = 0, right: r = 0, bottom: i = 0 } = e.cropRect;
@@ -6397,7 +6481,7 @@ var Y = class extends T {
6397
6481
  let i = this.animatedTexture?.currentFrame.texture ?? this.texture;
6398
6482
  r = {
6399
6483
  ...r,
6400
- ..._i(this, this.tile && i ? {
6484
+ ...vi(this, this.tile && i ? {
6401
6485
  x: 0,
6402
6486
  y: 0,
6403
6487
  width: i.sourceWidth,
@@ -6433,10 +6517,10 @@ var Y = class extends T {
6433
6517
  this.updateFrameIndex();
6434
6518
  }
6435
6519
  };
6436
- k([_({ fallback: !0 }), O("design:type", Boolean)], Y.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Y.prototype, "color", void 0), k([_(), O("design:type", Object)], Y.prototype, "image", void 0), k([_(), O("design:type", Object)], Y.prototype, "linearGradient", void 0), k([_(), O("design:type", Object)], Y.prototype, "radialGradient", void 0), k([_(), O("design:type", Object)], Y.prototype, "cropRect", void 0), k([_(), O("design:type", Object)], Y.prototype, "stretchRect", void 0), k([_(), O("design:type", Object)], Y.prototype, "dpi", void 0), k([_(), O("design:type", Object)], Y.prototype, "rotateWithShape", void 0), k([_(), O("design:type", Object)], Y.prototype, "tile", void 0), k([_(), O("design:type", Object)], Y.prototype, "opacity", void 0);
6520
+ A([_({ fallback: !0 }), k("design:type", Boolean)], Y.prototype, "enabled", void 0), A([_(), k("design:type", Object)], Y.prototype, "color", void 0), A([_(), k("design:type", Object)], Y.prototype, "image", void 0), A([_(), k("design:type", Object)], Y.prototype, "linearGradient", void 0), A([_(), k("design:type", Object)], Y.prototype, "radialGradient", void 0), A([_(), k("design:type", Object)], Y.prototype, "cropRect", void 0), A([_(), k("design:type", Object)], Y.prototype, "stretchRect", void 0), A([_(), k("design:type", Object)], Y.prototype, "dpi", void 0), A([_(), k("design:type", Object)], Y.prototype, "rotateWithShape", void 0), A([_(), k("design:type", Object)], Y.prototype, "tile", void 0), A([_(), k("design:type", Object)], Y.prototype, "opacity", void 0);
6437
6521
  //#endregion
6438
6522
  //#region src/scene/2d/element/Element2DBackground.ts
6439
- var vi = class extends Y {
6523
+ var yi = class extends Y {
6440
6524
  setProperties(e) {
6441
6525
  return super._setProperties(d(e) ? void 0 : f(e));
6442
6526
  }
@@ -6448,14 +6532,14 @@ var vi = class extends Y {
6448
6532
  }
6449
6533
  }
6450
6534
  };
6451
- k([_(), O("design:type", Object)], vi.prototype, "fillWithShape", void 0);
6535
+ A([_(), k("design:type", Object)], yi.prototype, "fillWithShape", void 0);
6452
6536
  //#endregion
6453
6537
  //#region src/scene/2d/element/Element2DChart.ts
6454
- var yi;
6455
- function bi() {
6456
- return yi ||= import("echarts").then((e) => e?.init ? e : e?.default).catch(() => void 0), yi;
6538
+ var bi;
6539
+ function xi() {
6540
+ return bi ||= import("echarts").then((e) => e?.init ? e : e?.default).catch(() => void 0), bi;
6457
6541
  }
6458
- function xi(e) {
6542
+ function Si(e) {
6459
6543
  if (!e) return { show: !1 };
6460
6544
  switch (e) {
6461
6545
  case "bottom": return {
@@ -6521,7 +6605,7 @@ var X = class extends T {
6521
6605
  this._teardown(), this._parent.requestDraw();
6522
6606
  return;
6523
6607
  }
6524
- let n = await bi();
6608
+ let n = await xi();
6525
6609
  if (!n) {
6526
6610
  console.warn("[modern-canvas] chart rendering requires the optional \"echarts\" dependency (e.g. `pnpm add echarts`)"), this._renderPlaceholder(e, t);
6527
6611
  return;
@@ -6580,7 +6664,7 @@ var X = class extends T {
6580
6664
  text: this.title,
6581
6665
  left: "center"
6582
6666
  } : void 0,
6583
- legend: xi(this.legend),
6667
+ legend: Si(this.legend),
6584
6668
  tooltip: {}
6585
6669
  };
6586
6670
  if (n) {
@@ -6624,10 +6708,10 @@ var X = class extends T {
6624
6708
  this._teardown();
6625
6709
  }
6626
6710
  };
6627
- k([_({ fallback: !0 }), O("design:type", Boolean)], X.prototype, "enabled", void 0), k([_({ fallback: "column" }), O("design:type", Object)], X.prototype, "type", void 0), k([_(), O("design:type", Object)], X.prototype, "grouping", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], X.prototype, "categories", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], X.prototype, "series", void 0), k([_(), O("design:type", Object)], X.prototype, "title", void 0), k([_(), O("design:type", Object)], X.prototype, "legend", void 0), k([_(), O("design:type", Object)], X.prototype, "categoryAxis", void 0), k([_(), O("design:type", Object)], X.prototype, "valueAxis", void 0);
6711
+ A([_({ fallback: !0 }), k("design:type", Boolean)], X.prototype, "enabled", void 0), A([_({ fallback: "column" }), k("design:type", Object)], X.prototype, "type", void 0), A([_(), k("design:type", Object)], X.prototype, "grouping", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], X.prototype, "categories", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], X.prototype, "series", void 0), A([_(), k("design:type", Object)], X.prototype, "title", void 0), A([_(), k("design:type", Object)], X.prototype, "legend", void 0), A([_(), k("design:type", Object)], X.prototype, "categoryAxis", void 0), A([_(), k("design:type", Object)], X.prototype, "valueAxis", void 0);
6628
6712
  //#endregion
6629
6713
  //#region src/scene/2d/element/Element2DComments.ts
6630
- var Si = class extends T {
6714
+ var Ci = class extends T {
6631
6715
  parent;
6632
6716
  constructor(e) {
6633
6717
  super(), this.parent = e;
@@ -6661,7 +6745,7 @@ var Si = class extends T {
6661
6745
  isValid() {
6662
6746
  return Object.values(this._properties).some(Boolean);
6663
6747
  }
6664
- }, Ci = class extends T {
6748
+ }, wi = class extends T {
6665
6749
  _parent;
6666
6750
  _routeSig;
6667
6751
  _routePath;
@@ -6709,7 +6793,7 @@ var Si = class extends T {
6709
6793
  y: Math.sin(n.ang)
6710
6794
  }, {
6711
6795
  point: e,
6712
- dir: wi(i, t.globalRotation),
6796
+ dir: Ti(i, t.globalRotation),
6713
6797
  bbox: r
6714
6798
  };
6715
6799
  }
@@ -6735,8 +6819,8 @@ var Si = class extends T {
6735
6819
  return (r !== this._routeSig || !this._routePath) && (this._routeSig = r, this._routePath = Or(this.mode, e ?? t, t ?? e)), this._routePath;
6736
6820
  }
6737
6821
  };
6738
- k([_(), O("design:type", Object)], Ci.prototype, "start", void 0), k([_(), O("design:type", Object)], Ci.prototype, "end", void 0), k([_({ fallback: "straight" }), O("design:type", Object)], Ci.prototype, "mode", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Ci.prototype, "labelPosition", void 0);
6739
- function wi(e, t) {
6822
+ A([_(), k("design:type", Object)], wi.prototype, "start", void 0), A([_(), k("design:type", Object)], wi.prototype, "end", void 0), A([_({ fallback: "straight" }), k("design:type", Object)], wi.prototype, "mode", void 0), A([_({ fallback: .5 }), k("design:type", Number)], wi.prototype, "labelPosition", void 0);
6823
+ function Ti(e, t) {
6740
6824
  if (!t) return e;
6741
6825
  let n = Math.cos(t), r = Math.sin(t);
6742
6826
  return {
@@ -6746,29 +6830,29 @@ function wi(e, t) {
6746
6830
  }
6747
6831
  //#endregion
6748
6832
  //#region src/scene/2d/element/bakeImageEffects.ts
6749
- function Ti(e) {
6833
+ function Ei(e) {
6750
6834
  return e.getContext("2d");
6751
6835
  }
6752
- function Ei(e, t, n, r) {
6836
+ function Di(e, t, n, r) {
6753
6837
  let i = (t?.angle ?? 0) * Math.PI / 180, a = n / 2, o = r / 2, s = (Math.abs(Math.cos(i)) * n + Math.abs(Math.sin(i)) * r) / 2, c = Math.cos(i) * s, l = Math.sin(i) * s, u = e.createLinearGradient(a - c, o - l, a + c, o + l);
6754
6838
  for (let e of t?.stops ?? []) u.addColorStop(Math.min(1, Math.max(0, e.offset)), e.color);
6755
6839
  return u;
6756
6840
  }
6757
- function Di(e, t, n, r, i) {
6758
- let a = w(t, n), o = Ti(a);
6759
- return o.drawImage(e, 0, 0, t, n), o.globalCompositeOperation = "source-in", r.linearGradient ? (o.fillStyle = Ei(o, r.linearGradient, t, n), o.fillRect(0, 0, t, n)) : r.image && i[r.image] ? o.drawImage(i[r.image], 0, 0, t, n) : r.color && (o.fillStyle = r.color, o.fillRect(0, 0, t, n)), a;
6760
- }
6761
6841
  function Oi(e, t, n, r, i) {
6762
- let a = w(t, n), o = Ti(a), s = Math.max(8, Math.ceil(r) * 2);
6842
+ let a = w(t, n), o = Ei(a);
6843
+ return o.drawImage(e, 0, 0, t, n), o.globalCompositeOperation = "source-in", r.linearGradient ? (o.fillStyle = Di(o, r.linearGradient, t, n), o.fillRect(0, 0, t, n)) : r.image && i[r.image] ? o.drawImage(i[r.image], 0, 0, t, n) : r.color && (o.fillStyle = r.color, o.fillRect(0, 0, t, n)), a;
6844
+ }
6845
+ function ki(e, t, n, r, i) {
6846
+ let a = w(t, n), o = Ei(a), s = Math.max(8, Math.ceil(r) * 2);
6763
6847
  for (let i = 0; i < s; i++) {
6764
6848
  let a = i / s * Math.PI * 2;
6765
6849
  o.drawImage(e, Math.cos(a) * r, Math.sin(a) * r, t, n);
6766
6850
  }
6767
6851
  o.globalCompositeOperation = "source-in", o.fillStyle = i, o.fillRect(0, 0, t, n);
6768
- let c = w(t, n), l = Ti(c);
6852
+ let c = w(t, n), l = Ei(c);
6769
6853
  return l.drawImage(a, 0, 0), l.drawImage(e, 0, 0, t, n), c;
6770
6854
  }
6771
- function ki(e) {
6855
+ function Ai(e) {
6772
6856
  let t = 0, n = 0;
6773
6857
  if (!e) return {
6774
6858
  x: t,
@@ -6784,31 +6868,31 @@ function ki(e) {
6784
6868
  y: n
6785
6869
  };
6786
6870
  }
6787
- function Ai(e, t, n, r, i = {}) {
6871
+ function ji(e, t, n, r, i = {}) {
6788
6872
  let a = Math.max(1, Math.round(n)), o = Math.max(1, Math.round(r)), s = 0;
6789
6873
  for (let e of t) {
6790
6874
  e.outline?.width && e.outline.color && (s = Math.max(s, e.outline.width));
6791
- let t = ki(e.transform);
6875
+ let t = Ai(e.transform);
6792
6876
  s = Math.max(s, Math.abs(t.x), Math.abs(t.y));
6793
6877
  }
6794
6878
  s = Math.min(Math.ceil(s), Math.floor(Math.min(a, o) * .2));
6795
6879
  let c = e;
6796
6880
  if (s > 0) {
6797
6881
  let t = w(a, o);
6798
- Ti(t).drawImage(e, s, s, Math.max(1, a - s * 2), Math.max(1, o - s * 2)), c = t;
6882
+ Ei(t).drawImage(e, s, s, Math.max(1, a - s * 2), Math.max(1, o - s * 2)), c = t;
6799
6883
  }
6800
- let l = w(a, o), u = Ti(l);
6884
+ let l = w(a, o), u = Ei(l);
6801
6885
  for (let e of t) {
6802
6886
  let t = c;
6803
- e.fill && (e.fill.color || e.fill.linearGradient || e.fill.image) && (t = Di(t, a, o, e.fill, i)), e.outline?.width && e.outline.color && (t = Oi(t, a, o, e.outline.width, e.outline.color));
6804
- let { x: n, y: r } = ki(e.transform);
6887
+ e.fill && (e.fill.color || e.fill.linearGradient || e.fill.image) && (t = Oi(t, a, o, e.fill, i)), e.outline?.width && e.outline.color && (t = ki(t, a, o, e.outline.width, e.outline.color));
6888
+ let { x: n, y: r } = Ai(e.transform);
6805
6889
  u.save(), u.globalCompositeOperation = "destination-over", e.shadow && (u.shadowColor = e.shadow.color, u.shadowBlur = e.shadow.blur ?? 0, u.shadowOffsetX = e.shadow.offsetX ?? 0, u.shadowOffsetY = e.shadow.offsetY ?? 0), u.drawImage(t, n, r, a, o), u.restore();
6806
6890
  }
6807
6891
  return l;
6808
6892
  }
6809
6893
  //#endregion
6810
6894
  //#region src/scene/2d/element/Element2DForeground.ts
6811
- var ji = class extends Y {
6895
+ var Mi = class extends Y {
6812
6896
  _sourceCanvas;
6813
6897
  _sourceImage;
6814
6898
  setProperties(e) {
@@ -6834,8 +6918,8 @@ var ji = class extends Y {
6834
6918
  }
6835
6919
  let e = await this._resolveSourceCanvas();
6836
6920
  if (!e) return;
6837
- let t = e.width, n = e.height, r = await this._resolvePatterns(), i = Ai(e, this.effects, t, n, r);
6838
- this.texture = new z({
6921
+ let t = e.width, n = e.height, r = await this._resolvePatterns(), i = ji(e, this.effects, t, n, r);
6922
+ this.texture = new B({
6839
6923
  source: i,
6840
6924
  width: t,
6841
6925
  height: n,
@@ -6869,14 +6953,14 @@ var ji = class extends Y {
6869
6953
  if (!(!r || !i)) return i.drawImage(e, 0, 0, t, n), r;
6870
6954
  }
6871
6955
  };
6872
- k([_(), O("design:type", Object)], ji.prototype, "fillWithShape", void 0), k([_(), O("design:type", Array)], ji.prototype, "effects", void 0);
6956
+ A([_(), k("design:type", Object)], Mi.prototype, "fillWithShape", void 0), A([_(), k("design:type", Array)], Mi.prototype, "effects", void 0);
6873
6957
  //#endregion
6874
6958
  //#region src/scene/2d/element/Element2DOutline.ts
6875
- var Mi = {
6959
+ var Ni = {
6876
6960
  sm: 4,
6877
6961
  md: 6,
6878
6962
  lg: 8
6879
- }, Ni = class extends Y {
6963
+ }, Pi = class extends Y {
6880
6964
  setProperties(e) {
6881
6965
  return super._setProperties(d(e) ? void 0 : te(e));
6882
6966
  }
@@ -6898,7 +6982,7 @@ var Mi = {
6898
6982
  }
6899
6983
  draw() {
6900
6984
  let { width: e, height: t } = this._parent.size, n = this._parent.context;
6901
- this.image === "viewport" ? n.strokeStyle = new sr() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ..._i(this, {
6985
+ this.image === "viewport" ? n.strokeStyle = new sr() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ...vi(this, {
6902
6986
  x: 0,
6903
6987
  y: 0,
6904
6988
  width: e,
@@ -6921,14 +7005,14 @@ var Mi = {
6921
7005
  _fillEnd(e, t, n, r, i) {
6922
7006
  let a = e.x - t.x, o = e.y - t.y, s = Math.hypot(a, o);
6923
7007
  if (s < .001) return;
6924
- let c = Mi[String(n.width ?? n.height ?? "md")] ?? 6, l = r * c, u = r * c * .5, d = a / s, f = o / s, p = e.x - d * l, m = e.y - f * l, h = -f * u, g = d * u, ee = this._parent.context;
7008
+ let c = Ni[String(n.width ?? n.height ?? "md")] ?? 6, l = r * c, u = r * c * .5, d = a / s, f = o / s, p = e.x - d * l, m = e.y - f * l, h = -f * u, g = d * u, ee = this._parent.context;
6925
7009
  ee.fillStyle = i, ee.moveTo(e.x, e.y).lineTo(p + h, m + g).lineTo(p - h, m - g).closePath().fill();
6926
7010
  }
6927
7011
  };
6928
- k([_(), O("design:type", Object)], Ni.prototype, "color", void 0), k([_(), O("design:type", Object)], Ni.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", Object)], Ni.prototype, "style", void 0), k([_({ fallback: "butt" }), O("design:type", Object)], Ni.prototype, "lineCap", void 0), k([_({ fallback: "miter" }), O("design:type", Object)], Ni.prototype, "lineJoin", void 0), k([_(), O("design:type", Object)], Ni.prototype, "headEnd", void 0), k([_(), O("design:type", Object)], Ni.prototype, "tailEnd", void 0);
7012
+ A([_(), k("design:type", Object)], Pi.prototype, "color", void 0), A([_(), k("design:type", Object)], Pi.prototype, "width", void 0), A([_({ fallback: "solid" }), k("design:type", Object)], Pi.prototype, "style", void 0), A([_({ fallback: "butt" }), k("design:type", Object)], Pi.prototype, "lineCap", void 0), A([_({ fallback: "miter" }), k("design:type", Object)], Pi.prototype, "lineJoin", void 0), A([_(), k("design:type", Object)], Pi.prototype, "headEnd", void 0), A([_(), k("design:type", Object)], Pi.prototype, "tailEnd", void 0);
6929
7013
  //#endregion
6930
7014
  //#region src/scene/2d/element/Element2DShadow.ts
6931
- var Pi = class extends T {
7015
+ var Fi = class extends T {
6932
7016
  _parent;
6933
7017
  constructor(e) {
6934
7018
  super(), this._parent = e;
@@ -6952,10 +7036,10 @@ var Pi = class extends T {
6952
7036
  this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new ei({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
6953
7037
  }
6954
7038
  };
6955
- k([_({ fallback: !0 }), O("design:type", Boolean)], Pi.prototype, "enabled", void 0), k([_({ fallback: "#000000FF" }), O("design:type", Object)], Pi.prototype, "color", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Pi.prototype, "blur", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Pi.prototype, "offsetY", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Pi.prototype, "offsetX", void 0);
7039
+ A([_({ fallback: !0 }), k("design:type", Boolean)], Fi.prototype, "enabled", void 0), A([_({ fallback: "#000000FF" }), k("design:type", Object)], Fi.prototype, "color", void 0), A([_({ fallback: 0 }), k("design:type", Object)], Fi.prototype, "blur", void 0), A([_({ fallback: 0 }), k("design:type", Object)], Fi.prototype, "offsetY", void 0), A([_({ fallback: 0 }), k("design:type", Object)], Fi.prototype, "offsetX", void 0);
6956
7040
  //#endregion
6957
7041
  //#region src/scene/2d/element/Element2DShape.ts
6958
- var Fi = class extends T {
7042
+ var Ii = class extends T {
6959
7043
  _parent;
6960
7044
  _path2DSet = new ue();
6961
7045
  _localPath;
@@ -7053,24 +7137,24 @@ var Fi = class extends T {
7053
7137
  t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
7054
7138
  }
7055
7139
  };
7056
- k([_({ fallback: !0 }), O("design:type", Boolean)], Fi.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Fi.prototype, "preset", void 0), k([_(), O("design:type", Object)], Fi.prototype, "svg", void 0), k([_(), O("design:type", Object)], Fi.prototype, "viewBox", void 0), k([_(), O("design:type", Object)], Fi.prototype, "paths", void 0), k([_(), O("design:type", Object)], Fi.prototype, "connectionPoints", void 0);
7140
+ A([_({ fallback: !0 }), k("design:type", Boolean)], Ii.prototype, "enabled", void 0), A([_(), k("design:type", Object)], Ii.prototype, "preset", void 0), A([_(), k("design:type", Object)], Ii.prototype, "svg", void 0), A([_(), k("design:type", Object)], Ii.prototype, "viewBox", void 0), A([_(), k("design:type", Object)], Ii.prototype, "paths", void 0), A([_(), k("design:type", Object)], Ii.prototype, "connectionPoints", void 0);
7057
7141
  //#endregion
7058
7142
  //#region src/scene/2d/element/Element2DStyle.ts
7059
- var Ii = class extends E {
7143
+ var Li = class extends vt {
7060
7144
  constructor(e) {
7061
7145
  super(), this.setProperties(e);
7062
7146
  }
7063
- }, Li = {
7147
+ }, Ri = {
7064
7148
  ...o(),
7065
7149
  left: 0,
7066
7150
  top: 0,
7067
7151
  width: 0,
7068
7152
  height: 0
7069
7153
  };
7070
- for (let e in Li) i(Ii, e, { fallback: Li[e] });
7154
+ for (let e in Ri) i(Li, e, { fallback: Ri[e] });
7071
7155
  //#endregion
7072
7156
  //#region src/scene/2d/element/Element2DTable.ts
7073
- var Ri = 100, zi = 40, Bi = class extends T {
7157
+ var zi = 100, Bi = 40, Vi = class extends T {
7074
7158
  _parent;
7075
7159
  _cellNodes = /* @__PURE__ */ new Map();
7076
7160
  _cellSnapshots = /* @__PURE__ */ new Map();
@@ -7101,10 +7185,10 @@ var Ri = 100, zi = 40, Bi = class extends T {
7101
7185
  return !!(this.enabled && this.cells.length);
7102
7186
  }
7103
7187
  get gridWidth() {
7104
- return this.columns.reduce((e, t) => e + (t.width || Ri), 0);
7188
+ return this.columns.reduce((e, t) => e + (t.width || zi), 0);
7105
7189
  }
7106
7190
  get gridHeight() {
7107
- return this.rows.reduce((e, t) => e + (t.height || zi), 0);
7191
+ return this.rows.reduce((e, t) => e + (t.height || Bi), 0);
7108
7192
  }
7109
7193
  update() {
7110
7194
  if (this._dirty = !1, !this.isValid()) {
@@ -7114,9 +7198,9 @@ var Ri = 100, zi = 40, Bi = class extends T {
7114
7198
  let { columns: e, rows: t, cells: n } = this, r = e.length, i = t.length;
7115
7199
  for (let e of n) r = Math.max(r, e.col + (e.colSpan || 1)), i = Math.max(i, e.row + (e.rowSpan || 1));
7116
7200
  let a = [0];
7117
- for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width || Ri));
7201
+ for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width || zi));
7118
7202
  let o = [0];
7119
- for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height || zi));
7203
+ for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height || Bi));
7120
7204
  this._parent.size.set(a[e.length] ?? 0, o[t.length] ?? 0);
7121
7205
  let s = /* @__PURE__ */ new Set();
7122
7206
  for (let e of n) {
@@ -7130,7 +7214,7 @@ var Ri = 100, zi = 40, Bi = class extends T {
7130
7214
  }, r = `${JSON.stringify(e)}|${n.left},${n.top},${n.width},${n.height}`;
7131
7215
  if (this._cellNodes.has(t) && this._cellSnapshots.get(t) === r) continue;
7132
7216
  let i = this._cellNodes.get(t);
7133
- i || (i = B.parse({ is: "Element2D" }, "Element2D"), this._parent.appendChild(i, "back"), this._cellNodes.set(t, i)), this._applyCell(i, e, n), this._cellSnapshots.set(t, r);
7217
+ i || (i = V.parse({ is: "Element2D" }, "Element2D"), this._parent.appendChild(i, "back"), this._cellNodes.set(t, i)), this._applyCell(i, e, n), this._cellSnapshots.set(t, r);
7134
7218
  }
7135
7219
  for (let [e, t] of this._cellNodes) s.has(e) || (this._parent.removeChild(t), t.destroy(), this._cellNodes.delete(e), this._cellSnapshots.delete(e));
7136
7220
  this._parent.requestDraw();
@@ -7142,7 +7226,7 @@ var Ri = 100, zi = 40, Bi = class extends T {
7142
7226
  }, e.background = t.background;
7143
7227
  for (let t of [...e.getChildren(!0)]) e.removeChild(t), t.destroy();
7144
7228
  t.children?.forEach((t) => {
7145
- e.appendChild(B.parse(t, "Element2D"));
7229
+ e.appendChild(V.parse(t, "Element2D"));
7146
7230
  });
7147
7231
  }
7148
7232
  _clearCells() {
@@ -7153,7 +7237,7 @@ var Ri = 100, zi = 40, Bi = class extends T {
7153
7237
  this._clearCells();
7154
7238
  }
7155
7239
  };
7156
- k([_({ fallback: !0 }), O("design:type", Boolean)], Bi.prototype, "enabled", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Bi.prototype, "columns", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Bi.prototype, "rows", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Bi.prototype, "cells", void 0);
7240
+ A([_({ fallback: !0 }), k("design:type", Boolean)], Vi.prototype, "enabled", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], Vi.prototype, "columns", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], Vi.prototype, "rows", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], Vi.prototype, "cells", void 0);
7157
7241
  //#endregion
7158
7242
  //#region src/scene/2d/element/Element2DText.ts
7159
7243
  var Z = class extends T {
@@ -7268,7 +7352,7 @@ var Z = class extends T {
7268
7352
  if (n.style.fill && !d(n.style.fill)) if (typeof n.style.fill == "object") {
7269
7353
  let r = n.style.fill, o = this._textureMap.get(`${a}.${i}.fill`) ?? this._textureMap.get(`${a}.fill`) ?? this._textureMap.get("fill");
7270
7354
  r.enabled !== !1 && (o || r.color) && (e.addPath(n), e.style = { ...n.style }, e.fillStyle = o?.texture ?? r.color, e.fill({
7271
- ..._i(r, o?.box ?? {
7355
+ ...vi(r, o?.box ?? {
7272
7356
  x: 0,
7273
7357
  y: 0,
7274
7358
  width: this._parent.size.width,
@@ -7280,7 +7364,7 @@ var Z = class extends T {
7280
7364
  if (n.style.stroke && !d(n.style.stroke)) if (typeof n.style.stroke == "object") {
7281
7365
  let r = n.style.stroke, o = this._textureMap.get(`${a}.${i}.outline`) ?? this._textureMap.get(`${a}.outline`) ?? this._textureMap.get("outline");
7282
7366
  r.enabled !== !1 && (o || r.color) && (r.width === void 0 || r.width) && (e.addPath(n), e.style = { ...n.style }, e.lineWidth = r.width || 1, e.strokeStyle = o?.texture ?? r.color, e.lineCap = r.lineCap, e.lineJoin = r.lineJoin, e.stroke({
7283
- ..._i(r, o?.box ?? {
7367
+ ...vi(r, o?.box ?? {
7284
7368
  x: 0,
7285
7369
  y: 0,
7286
7370
  width: this._parent.size.width,
@@ -7310,7 +7394,7 @@ var Z = class extends T {
7310
7394
  }
7311
7395
  process(e) {}
7312
7396
  };
7313
- k([_({ fallback: !0 }), O("design:type", Object)], Z.prototype, "enabled", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Z.prototype, "content", void 0), k([_({ alias: "_parent.style.json" }), O("design:type", Object)], Z.prototype, "style", void 0), k([_(), O("design:type", Object)], Z.prototype, "effects", void 0), k([_(), O("design:type", Object)], Z.prototype, "fill", void 0), k([_(), O("design:type", Object)], Z.prototype, "outline", void 0), k([_(), O("design:type", Object)], Z.prototype, "deformation", void 0), k([_({ alias: "base.measureDom" }), O("design:type", typeof HTMLElement > "u" ? Object : HTMLElement)], Z.prototype, "measureDom", void 0), k([_({ alias: "base.fonts" }), O("design:type", Object)], Z.prototype, "fonts", void 0), k([_({ fallback: "auto" }), O("design:type", Object)], Z.prototype, "drawMode", void 0);
7397
+ A([_({ fallback: !0 }), k("design:type", Object)], Z.prototype, "enabled", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], Z.prototype, "content", void 0), A([_({ alias: "_parent.style.json" }), k("design:type", Object)], Z.prototype, "style", void 0), A([_(), k("design:type", Object)], Z.prototype, "effects", void 0), A([_(), k("design:type", Object)], Z.prototype, "fill", void 0), A([_(), k("design:type", Object)], Z.prototype, "outline", void 0), A([_(), k("design:type", Object)], Z.prototype, "deformation", void 0), A([_({ alias: "base.measureDom" }), k("design:type", typeof HTMLElement > "u" ? Object : HTMLElement)], Z.prototype, "measureDom", void 0), A([_({ alias: "base.fonts" }), k("design:type", Object)], Z.prototype, "fonts", void 0), A([_({ fallback: "auto" }), k("design:type", Object)], Z.prototype, "drawMode", void 0);
7314
7398
  //#endregion
7315
7399
  //#region src/scene/2d/element/Flexbox.ts
7316
7400
  var Q = {
@@ -7323,11 +7407,11 @@ var Q = {
7323
7407
  horizontal: 6,
7324
7408
  vertical: 7,
7325
7409
  all: 8
7326
- }, Vi = {
7410
+ }, Hi = {
7327
7411
  column: 0,
7328
7412
  row: 1,
7329
7413
  all: 2
7330
- }, Hi = {
7414
+ }, Ui = {
7331
7415
  auto: 0,
7332
7416
  "flex-start": 1,
7333
7417
  center: 2,
@@ -7337,42 +7421,42 @@ var Q = {
7337
7421
  "space-between": 6,
7338
7422
  "space-around": 7,
7339
7423
  "space-evenly": 8
7340
- }, Ui = {
7424
+ }, Wi = {
7341
7425
  flex: 0,
7342
7426
  none: 1,
7343
7427
  contents: 2
7344
- }, Wi = {
7428
+ }, Gi = {
7345
7429
  inherit: 0,
7346
7430
  ltr: 1,
7347
7431
  rtl: 2
7348
- }, Gi = {
7432
+ }, Ki = {
7349
7433
  column: 0,
7350
7434
  "column-reverse": 1,
7351
7435
  row: 2,
7352
7436
  "row-reverse": 3
7353
- }, Ki = {
7437
+ }, qi = {
7354
7438
  "no-wrap": 0,
7355
7439
  wrap: 1,
7356
7440
  "Wrap-reverse": 2
7357
- }, qi = {
7441
+ }, Ji = {
7358
7442
  "flex-start": 0,
7359
7443
  center: 1,
7360
7444
  "flex-end": 2,
7361
7445
  "space-between": 3,
7362
7446
  "space-around": 4,
7363
7447
  "space-evenly": 5
7364
- }, Ji = {
7448
+ }, Yi = {
7365
7449
  visible: 0,
7366
7450
  hidden: 1,
7367
7451
  scroll: 2
7368
- }, Yi = {
7452
+ }, Xi = {
7369
7453
  static: 0,
7370
7454
  relative: 1,
7371
7455
  absolute: 2
7372
- }, Xi = {
7456
+ }, Zi = {
7373
7457
  "border-box": 0,
7374
7458
  "content-box": 1
7375
- }, Zi = class e {
7459
+ }, Qi = class e {
7376
7460
  _parent;
7377
7461
  static _yoga;
7378
7462
  static async load() {
@@ -7384,27 +7468,27 @@ var Q = {
7384
7468
  this._parent = e, this._addChild = this._addChild.bind(this), this._removeChild = this._removeChild.bind(this), this._parent.on("addChild", this._addChild), this._parent.on("removeChild", this._removeChild);
7385
7469
  }
7386
7470
  _addChild(e, t) {
7387
- if (e instanceof na && e.flexbox.node && this.node) {
7471
+ if (e instanceof ra && e.flexbox.node && this.node) {
7388
7472
  this.node.insertChild(e.flexbox.node, t);
7389
7473
  let n = e.style.getProperties();
7390
7474
  for (let t in n) e.flexbox.updateStyleProperty(t, n[t]);
7391
7475
  }
7392
7476
  }
7393
7477
  _removeChild(e, t) {
7394
- e instanceof na && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
7478
+ e instanceof ra && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
7395
7479
  }
7396
7480
  updateStyleProperty(e, t) {
7397
7481
  let n = this.node;
7398
7482
  if (n) {
7399
7483
  switch (e) {
7400
7484
  case "alignContent":
7401
- n.setAlignContent(t ? Hi[t] ?? Hi["flex-start"] : Hi["flex-start"]);
7485
+ n.setAlignContent(t ? Ui[t] ?? Ui["flex-start"] : Ui["flex-start"]);
7402
7486
  break;
7403
7487
  case "alignItems":
7404
- n.setAlignItems(t ? Hi[t] ?? Hi["flex-start"] : Hi["flex-start"]);
7488
+ n.setAlignItems(t ? Ui[t] ?? Ui["flex-start"] : Ui["flex-start"]);
7405
7489
  break;
7406
7490
  case "alignSelf":
7407
- n.setAlignSelf(t ? Hi[t] ?? Hi["flex-start"] : Hi["flex-start"]);
7491
+ n.setAlignSelf(t ? Ui[t] ?? Ui["flex-start"] : Ui["flex-start"]);
7408
7492
  break;
7409
7493
  case "aspectRatio":
7410
7494
  n.setAspectRatio(t);
@@ -7425,10 +7509,10 @@ var Q = {
7425
7509
  n.setBorder(Q.all, this._parent.style.borderWidth);
7426
7510
  break;
7427
7511
  case "direction":
7428
- n.setDirection(t ? Wi[t] ?? Wi.inherit : Wi.inherit);
7512
+ n.setDirection(t ? Gi[t] ?? Gi.inherit : Gi.inherit);
7429
7513
  break;
7430
7514
  case "display":
7431
- n.setDisplay(t ? Ui[t] ?? Ui.flex : Ui.flex);
7515
+ n.setDisplay(t ? Wi[t] ?? Wi.flex : Wi.flex);
7432
7516
  break;
7433
7517
  case "flex":
7434
7518
  n.setFlex(t);
@@ -7437,7 +7521,7 @@ var Q = {
7437
7521
  n.setFlexBasis(t);
7438
7522
  break;
7439
7523
  case "flexDirection":
7440
- n.setFlexDirection(t ? Gi[t] ?? Gi.row : Gi.row);
7524
+ n.setFlexDirection(t ? Ki[t] ?? Ki.row : Ki.row);
7441
7525
  break;
7442
7526
  case "flexGrow":
7443
7527
  n.setFlexGrow(t);
@@ -7446,16 +7530,16 @@ var Q = {
7446
7530
  n.setFlexShrink(t);
7447
7531
  break;
7448
7532
  case "flexWrap":
7449
- n.setFlexWrap(t ? Ki[t] ?? Ki.wrap : Ki.wrap);
7533
+ n.setFlexWrap(t ? qi[t] ?? qi.wrap : qi.wrap);
7450
7534
  break;
7451
7535
  case "height":
7452
7536
  n.setHeight(t);
7453
7537
  break;
7454
7538
  case "justifyContent":
7455
- n.setJustifyContent(t ? qi[t] ?? qi["flex-start"] : qi["flex-start"]);
7539
+ n.setJustifyContent(t ? Ji[t] ?? Ji["flex-start"] : Ji["flex-start"]);
7456
7540
  break;
7457
7541
  case "gap":
7458
- t !== void 0 && n.setGap(Vi.all, t);
7542
+ t !== void 0 && n.setGap(Hi.all, t);
7459
7543
  break;
7460
7544
  case "marginTop":
7461
7545
  n.setMargin(Q.top, t);
@@ -7485,7 +7569,7 @@ var Q = {
7485
7569
  n.setMinWidth(t);
7486
7570
  break;
7487
7571
  case "overflow":
7488
- n.setOverflow(t ? Ji[t] ?? Ji.visible : Ji.visible);
7572
+ n.setOverflow(t ? Yi[t] ?? Yi.visible : Yi.visible);
7489
7573
  break;
7490
7574
  case "paddingTop":
7491
7575
  n.setPadding(Q.top, t);
@@ -7515,10 +7599,10 @@ var Q = {
7515
7599
  n.setPosition(Q.right, t);
7516
7600
  break;
7517
7601
  case "position":
7518
- n.setPositionType(t ? Yi[t] ?? Yi.relative : Yi.relative);
7602
+ n.setPositionType(t ? Xi[t] ?? Xi.relative : Xi.relative);
7519
7603
  break;
7520
7604
  case "boxSizing":
7521
- n.setBoxSizing(t ? Xi[t] ?? Xi["content-box"] : Xi["content-box"]);
7605
+ n.setBoxSizing(t ? Zi[t] ?? Zi["content-box"] : Zi["content-box"]);
7522
7606
  break;
7523
7607
  case "width":
7524
7608
  n.setWidth(t);
@@ -7529,7 +7613,7 @@ var Q = {
7529
7613
  }
7530
7614
  update() {
7531
7615
  let e = this._parent, t = this.node;
7532
- if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, Wi.ltr), t.hasNewLayout())) {
7616
+ if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, Gi.ltr), t.hasNewLayout())) {
7533
7617
  let { left: n, top: r, width: i, height: a } = t.getComputedLayout();
7534
7618
  (!Number.isNaN(n) && n !== e.position.x || !Number.isNaN(r) && r !== e.position.y) && e.position.set(n, r), (!Number.isNaN(i) && i !== e.size.x || !Number.isNaN(a) && a !== e.size.y) && e.size.set(i, a), t.markLayoutSeen();
7535
7619
  }
@@ -7537,15 +7621,15 @@ var Q = {
7537
7621
  destroy() {
7538
7622
  this.node?.free(), this.node = void 0;
7539
7623
  }
7540
- }, Qi = new Set(Object.keys(a())), $i = new Set(Object.keys(s())), ea = new x(), ta = [
7624
+ }, $i = new Set(Object.keys(a())), ea = new Set(Object.keys(s())), ta = new x(), na = [
7541
7625
  [0, 0],
7542
7626
  [1, 0],
7543
7627
  [1, 1],
7544
7628
  [0, 1]
7545
- ], na = class extends Tr {
7546
- flexbox = new Zi(this);
7547
- aabb = new vt();
7548
- globalAabb = new vt();
7629
+ ], ra = class extends Tr {
7630
+ flexbox = new Qi(this);
7631
+ aabb = new yt();
7632
+ globalAabb = new yt();
7549
7633
  _parentGlobalDisplay;
7550
7634
  _globalDisplay;
7551
7635
  get globalDisplay() {
@@ -7556,7 +7640,7 @@ var Q = {
7556
7640
  });
7557
7641
  _allowPointerEvents = !0;
7558
7642
  _overflowHidden = !1;
7559
- _style = new Ii().on("updateProperty", (...e) => {
7643
+ _style = new Li().on("updateProperty", (...e) => {
7560
7644
  this.onUpdateStyleProperty(e[0], e[1], e[2]);
7561
7645
  });
7562
7646
  get style() {
@@ -7570,14 +7654,14 @@ var Q = {
7570
7654
  this._endBatch();
7571
7655
  }
7572
7656
  }
7573
- _background = new vi(this);
7657
+ _background = new yi(this);
7574
7658
  get background() {
7575
7659
  return this._background;
7576
7660
  }
7577
7661
  set background(e) {
7578
7662
  this._background.resetProperties().setProperties(e);
7579
7663
  }
7580
- _shape = new Fi(this);
7664
+ _shape = new Ii(this);
7581
7665
  get shape() {
7582
7666
  return this._shape;
7583
7667
  }
@@ -7591,14 +7675,14 @@ var Q = {
7591
7675
  set fill(e) {
7592
7676
  this._fill.resetProperties().setProperties(e);
7593
7677
  }
7594
- _outline = new Ni(this);
7678
+ _outline = new Pi(this);
7595
7679
  get outline() {
7596
7680
  return this._outline;
7597
7681
  }
7598
7682
  set outline(e) {
7599
7683
  this._outline.resetProperties().setProperties(e);
7600
7684
  }
7601
- _foreground = new ji(this);
7685
+ _foreground = new Mi(this);
7602
7686
  get foreground() {
7603
7687
  return this._foreground;
7604
7688
  }
@@ -7612,21 +7696,21 @@ var Q = {
7612
7696
  set text(e) {
7613
7697
  this._text.resetProperties().setProperties(e);
7614
7698
  }
7615
- _shadow = new Pi(this);
7699
+ _shadow = new Fi(this);
7616
7700
  get shadow() {
7617
7701
  return this._shadow;
7618
7702
  }
7619
7703
  set shadow(e) {
7620
7704
  this._shadow.resetProperties().setProperties(e);
7621
7705
  }
7622
- _connection = new Ci(this);
7706
+ _connection = new wi(this);
7623
7707
  get connection() {
7624
7708
  return this._connection;
7625
7709
  }
7626
7710
  set connection(e) {
7627
7711
  this._connection.resetProperties().setProperties(e);
7628
7712
  }
7629
- _table = new Bi(this);
7713
+ _table = new Vi(this);
7630
7714
  get table() {
7631
7715
  return this._table;
7632
7716
  }
@@ -7640,7 +7724,7 @@ var Q = {
7640
7724
  set chart(e) {
7641
7725
  this._chart.resetProperties().setProperties(e);
7642
7726
  }
7643
- _comments = new Si(this);
7727
+ _comments = new Ci(this);
7644
7728
  get comments() {
7645
7729
  return this._comments;
7646
7730
  }
@@ -7790,7 +7874,7 @@ var Q = {
7790
7874
  this.requestDraw();
7791
7875
  break;
7792
7876
  }
7793
- if (($i.has(e) || Qi.has(e)) && this.text.isValid() && (this._batchDepth > 0 ? this._pendingTextUpdate = !0 : this.text.update()), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
7877
+ if ((ea.has(e) || $i.has(e)) && this.text.isValid() && (this._batchDepth > 0 ? this._pendingTextUpdate = !0 : this.text.update()), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
7794
7878
  else switch (e) {
7795
7879
  case "left":
7796
7880
  this.position.x = Number(t);
@@ -7823,17 +7907,21 @@ var Q = {
7823
7907
  let i = e.clone().applyTransform(new b().translate(-t.x, -t.y));
7824
7908
  this._shape.setLocalPath(i);
7825
7909
  }
7910
+ _renderCulled = !1;
7826
7911
  _cullsRender() {
7912
+ return this._renderCulled = this._computeCullsRender(), this._renderCulled;
7913
+ }
7914
+ _computeCullsRender() {
7827
7915
  if (this._colorFilterEffect || this._maskEffect || this._overflowHidden || this._connection.isValid()) return !1;
7828
7916
  let e = this.tree?.getCurrentViewport();
7829
7917
  return e?.valid ? !this._intersectsViewport(e) : !1;
7830
7918
  }
7831
7919
  _intersectsViewport(e) {
7832
7920
  let t = e.canvasTransform, n = e.width, r = e.height, i = Infinity, a = -Infinity, o = Infinity, s = -Infinity;
7833
- for (let [e, c] of ta) t.applyAffineInverse({
7921
+ for (let [e, c] of na) t.applyAffineInverse({
7834
7922
  x: e * n,
7835
7923
  y: c * r
7836
- }, ea), i = Math.min(i, ea.x), a = Math.max(a, ea.x), o = Math.min(o, ea.y), s = Math.max(s, ea.y);
7924
+ }, ta), i = Math.min(i, ta.x), a = Math.max(a, ta.x), o = Math.min(o, ta.y), s = Math.max(s, ta.y);
7837
7925
  let c = a - i, l = s - o, { min: u, size: d } = this.globalAabb;
7838
7926
  return !(u.x > a + c || u.x + d.x < i - c || u.y > s + l || u.y + d.y < o - l);
7839
7927
  }
@@ -7885,11 +7973,11 @@ var Q = {
7885
7973
  }
7886
7974
  getObb() {
7887
7975
  let e = this.pivot, t = this.transform.apply(e).sub(e);
7888
- return new wt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.rotation);
7976
+ return new Ct(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.rotation);
7889
7977
  }
7890
7978
  getGlobalObb() {
7891
7979
  let e = this.pivot, t = this.globalTransform.apply(e).sub(e);
7892
- return new wt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.globalRotation);
7980
+ return new Ct(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.globalRotation);
7893
7981
  }
7894
7982
  _draw() {
7895
7983
  super._draw(), this._background.isValid() && (this._shape.draw(!this._background.fillWithShape), this._background.draw()), this._fill.isValid() && (this._shape.draw(), this._fill.draw()), this._outline.isValid() && (this._shape.draw(), this._outline.draw()), this._foreground.isValid() && (this._shape.draw(!this._foreground.fillWithShape), this._foreground.draw()), this._text.isValid() && this._text.draw(), this._chart.isValid() && this._chart.draw(), this._drawContent();
@@ -7944,10 +8032,10 @@ var Q = {
7944
8032
  super._destroy(), this.flexbox.destroy(), this.aabb.destroy(), this.globalAabb.destroy(), this.size.destroy(), this.style.destroy(), this.background.destroy(), this.shape.destroy(), this.fill.destroy(), this.outline.destroy(), this.text.destroy(), this.foreground.destroy(), this.shadow.destroy(), this.connection.destroy(), this.comments.destroy(), this._colorFilterEffect = void 0, this._maskEffect = void 0;
7945
8033
  }
7946
8034
  };
7947
- na = k([S("Element2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], na);
8035
+ ra = A([S("Element2D"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ra);
7948
8036
  //#endregion
7949
8037
  //#region src/scene/2d/TextureRect2D.ts
7950
- var ra = class extends na {
8038
+ var ia = class extends ra {
7951
8039
  texture;
7952
8040
  region;
7953
8041
  constructor(e, t = []) {
@@ -7970,7 +8058,7 @@ var ra = class extends na {
7970
8058
  } });
7971
8059
  }
7972
8060
  }
7973
- }, ia = class extends ra {
8061
+ }, aa = class extends ia {
7974
8062
  texture = new tr();
7975
8063
  animation;
7976
8064
  _lastTime = NaN;
@@ -8001,10 +8089,10 @@ var ra = class extends na {
8001
8089
  this.currentTime !== this._lastTime && (this._lastTime = this.currentTime, this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw()), super._process(e);
8002
8090
  }
8003
8091
  };
8004
- k([_({ fallback: "" }), O("design:type", String)], ia.prototype, "src", void 0), ia = k([S("Lottie2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ia);
8092
+ A([_({ fallback: "" }), k("design:type", String)], aa.prototype, "src", void 0), aa = A([S("Lottie2D"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], aa);
8005
8093
  //#endregion
8006
8094
  //#region src/scene/2d/Mesh2D.ts
8007
- var aa = class extends na {
8095
+ var oa = class extends ra {
8008
8096
  texture;
8009
8097
  _vertices = new Float32Array();
8010
8098
  _uvs = new Float32Array();
@@ -8035,7 +8123,7 @@ var aa = class extends na {
8035
8123
  _drawContent() {
8036
8124
  this.texture?.isValid() && this._indices.length && this._vertices.length && (this.context.fillStyle = this.texture, this.context.drawMesh(this._vertices, this._uvs, this._indices));
8037
8125
  }
8038
- }, oa = class extends na {
8126
+ }, sa = class extends ra {
8039
8127
  constructor(e, t = []) {
8040
8128
  super(), this.setProperties(e).append(t);
8041
8129
  }
@@ -8048,20 +8136,20 @@ var aa = class extends na {
8048
8136
  }
8049
8137
  }
8050
8138
  _drawCircle(e, t) {
8051
- this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle = z.WHITE, this.context.fill(), this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
8139
+ this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle = B.WHITE, this.context.fill(), this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
8052
8140
  }
8053
8141
  _drawEllipse(e, t) {
8054
- this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle = z.WHITE, this.context.fill(), this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
8142
+ this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle = B.WHITE, this.context.fill(), this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
8055
8143
  }
8056
8144
  _draw() {
8057
8145
  let { width: e, height: t } = this.getRect();
8058
8146
  this.context.rect(0, 0, e, t), this.context.strokeStyle = "#00FF00", this.context.stroke(), this._drawCircle(0, 0), this._drawCircle(e, t), this._drawCircle(0, t), this._drawEllipse(0, t / 2), this._drawCircle(e, 0), this._drawEllipse(e, t / 2);
8059
8147
  }
8060
8148
  };
8061
- k([_({ fallback: 6 }), O("design:type", Number)], oa.prototype, "handleSize", void 0);
8149
+ A([_({ fallback: 6 }), k("design:type", Number)], sa.prototype, "handleSize", void 0);
8062
8150
  //#endregion
8063
8151
  //#region src/scene/2d/Video2D.ts
8064
- var sa = class extends ra {
8152
+ var ca = class extends ia {
8065
8153
  get videoDuration() {
8066
8154
  return (this.texture?.duration ?? 0) * 1e3;
8067
8155
  }
@@ -8092,24 +8180,33 @@ var sa = class extends ra {
8092
8180
  }
8093
8181
  _updateVideoCurrentTime() {
8094
8182
  let e = this.texture;
8095
- if (e && !e.isPlaying && !e.seeking) {
8096
- let t = ~~Math.max(0, this.currentTime % this.videoDuration) / 1e3;
8097
- e.currentTime !== t && (e.currentTime = t, $.awaitBy(() => e.waitSeek(this._loadAbort?.signal)));
8183
+ if (!e) return;
8184
+ let t = this.videoDuration;
8185
+ if (!t) return;
8186
+ if (!this.isVisibleInTree() || this._renderCulled) {
8187
+ e.paused || e.pause();
8188
+ return;
8098
8189
  }
8190
+ let n = Math.max(0, this.currentTime % t) / 1e3, r = this._timeline, i = r?.playbackRate ?? 1;
8191
+ if (r?.playing && i > 0) {
8192
+ e.muted = !0, e.loop = this.loop, e.playbackRate = D(i, .0625, 16), e.paused && e.isReady && e.play();
8193
+ let t = Math.abs(e.currentTime - n);
8194
+ !e.seeking && t > Math.max(.3, D(i, 1, 16) * .2) && (e.currentTime = n);
8195
+ } else e.paused || e.pause(), !e.isPlaying && !e.seeking && e.currentTime !== n && (e.currentTime = n, $.awaitBy(() => e.waitSeek(this._loadAbort?.signal)));
8099
8196
  }
8100
8197
  _process(e) {
8101
8198
  super._process(e), this._updateVideoCurrentTime();
8102
8199
  }
8103
8200
  };
8104
- k([_({ fallback: "" }), O("design:type", String)], sa.prototype, "src", void 0), sa = k([S("Video2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], sa);
8201
+ A([_({ fallback: "" }), k("design:type", String)], ca.prototype, "src", void 0), ca = A([S("Video2D"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ca);
8105
8202
  //#endregion
8106
8203
  //#region src/scene/animation/Animation.ts
8107
- function ca(e) {
8204
+ function la(e) {
8108
8205
  if (e == null) return 0;
8109
8206
  let t = String(e).trim(), n = Number.parseFloat(t);
8110
8207
  return Number.isNaN(n) ? 0 : n / 100;
8111
8208
  }
8112
- function la(e, t) {
8209
+ function ua(e, t) {
8113
8210
  let n = t * 180 / Math.PI;
8114
8211
  if (e == null || e === "auto") return n;
8115
8212
  let r = String(e).trim();
@@ -8118,11 +8215,11 @@ function la(e, t) {
8118
8215
  let i = Number.parseFloat(r);
8119
8216
  return Number.isNaN(i) ? n : i;
8120
8217
  }
8121
- function ua(e) {
8218
+ function da(e) {
8122
8219
  let t = e.trim(), n = /^path\((.*)\)$/s.exec(t);
8123
8220
  return n && (t = n[1].trim()), t.length >= 2 && (t[0] === "\"" || t[0] === "'") && t[t.length - 1] === t[0] && (t = t.slice(1, -1)), t.trim();
8124
8221
  }
8125
- function da(e, t, n, r) {
8222
+ function fa(e, t, n, r) {
8126
8223
  let i = 1e-6, a = 3 * e - 3 * n + 1, o = 3 * n - 6 * e, s = 3 * e, c = 3 * t - 3 * r + 1, l = 3 * r - 6 * t, u = 3 * t, d = (e) => (3 * a * e + 2 * o) * e + s, f = (e) => ((a * e + o) * e + s) * e, p = (e) => ((c * e + l) * e + u) * e;
8127
8224
  function m(e) {
8128
8225
  let t = e, n, r;
@@ -8142,7 +8239,7 @@ function da(e, t, n, r) {
8142
8239
  }
8143
8240
  return (e) => p(m(e));
8144
8241
  }
8145
- var fa = {
8242
+ var pa = {
8146
8243
  linear: [
8147
8244
  0,
8148
8245
  0,
@@ -8209,7 +8306,7 @@ var fa = {
8209
8306
  .355,
8210
8307
  1
8211
8308
  ]
8212
- }, pa = Object.fromEntries(Object.entries(fa).map(([e, [t, n, r, i]]) => [e, da(t, n, r, i)])), ma = class extends V {
8309
+ }, ma = Object.fromEntries(Object.entries(pa).map(([e, [t, n, r, i]]) => [e, fa(t, n, r, i)])), ha = class extends H {
8213
8310
  _keyframes = [];
8214
8311
  _isFirstUpdatePosition = !1;
8215
8312
  _cachedProps = new t();
@@ -8245,7 +8342,7 @@ var fa = {
8245
8342
  e = [this.getParent()].filter(Boolean);
8246
8343
  break;
8247
8344
  }
8248
- return e.filter((e) => e instanceof na);
8345
+ return e.filter((e) => e instanceof ra);
8249
8346
  }
8250
8347
  _updateKeyframes() {
8251
8348
  this._pathMeasures.clear();
@@ -8278,7 +8375,7 @@ var fa = {
8278
8375
  }
8279
8376
  let e = this._getTargets(), t = 1 / e.length, n = this.currentTimeProgress;
8280
8377
  e.forEach((e, r) => {
8281
- let i = t === 1 ? n : St(Math.max(0, n - t * r) / t, 0, 1), a = this._cachedProps.get(e);
8378
+ let i = t === 1 ? n : D(Math.max(0, n - t * r) / t, 0, 1), a = this._cachedProps.get(e);
8282
8379
  if (!a) return;
8283
8380
  let o = this._parseKeyframes(i, a);
8284
8381
  o?.length && this._commitStyle(i, e, a, o[0], o[1]);
@@ -8296,14 +8393,14 @@ var fa = {
8296
8393
  });
8297
8394
  }
8298
8395
  _parseEasing(e) {
8299
- if (!e) return pa.linear;
8300
- if (e in pa) return pa[e];
8396
+ if (!e) return ma.linear;
8397
+ if (e in ma) return ma[e];
8301
8398
  let t = /cubic-bezier\((.+)\)/.exec(e);
8302
8399
  if (t) {
8303
8400
  let e = t[1].split(",").map((e) => Number(e));
8304
- if (e.length === 4 && e.every((e) => !Number.isNaN(e))) return da(e[0], e[1], e[2], e[3]);
8401
+ if (e.length === 4 && e.every((e) => !Number.isNaN(e))) return fa(e[0], e[1], e[2], e[3]);
8305
8402
  }
8306
- return pa.linear;
8403
+ return ma.linear;
8307
8404
  }
8308
8405
  _parseKeyframes(e, t) {
8309
8406
  let n, r = this._keyframes;
@@ -8338,7 +8435,7 @@ var fa = {
8338
8435
  });
8339
8436
  }
8340
8437
  _commitOffsetPath(e, t, n, r, i, a) {
8341
- let o = ua(t);
8438
+ let o = da(t);
8342
8439
  if (!o) return;
8343
8440
  let s = this._pathMeasures.get(o);
8344
8441
  if (!s) {
@@ -8349,7 +8446,7 @@ var fa = {
8349
8446
  startY: t.y
8350
8447
  }, this._pathMeasures.set(o, s);
8351
8448
  }
8352
- let c = St(D(ca(r.offsetDistance ?? i.offsetDistance), ca(i.offsetDistance ?? r.offsetDistance), a), 0, 1), { position: l, angle: u } = s.measure.getPosTanAtProgress(c), d = l.x - s.startX, f = l.y - s.startY, p = la(i.offsetRotate ?? r.offsetRotate, u), m = n.get("transform");
8449
+ let c = D(O(la(r.offsetDistance ?? i.offsetDistance), la(i.offsetDistance ?? r.offsetDistance), a), 0, 1), { position: l, angle: u } = s.measure.getPosTanAtProgress(c), d = l.x - s.startX, f = l.y - s.startY, p = ua(i.offsetRotate ?? r.offsetRotate, u), m = n.get("transform");
8353
8450
  e.onUpdateStyleProperty("transform", `${m ? `${m} ` : ""}translate(${d}px, ${f}px) rotate(${p}deg)`, void 0);
8354
8451
  }
8355
8452
  _getDiffValue(e, t, n, r, i) {
@@ -8370,10 +8467,10 @@ var fa = {
8370
8467
  let a = Math.max(t[e]?.length ?? 0, n[e]?.length ?? 0), o = t[e], s = n[e];
8371
8468
  i += `${e}(${Array.from({ length: a }, (e, t) => {
8372
8469
  let n = o?.[t], i = s?.[t], a = n?.normalizedIntValue ?? 0, c = i?.normalizedIntValue ?? 0;
8373
- return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 : D(a, c, r);
8470
+ return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 : O(a, c, r);
8374
8471
  }).join(", ")}) `;
8375
8472
  }), i;
8376
- } else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value : D(a.normalizedIntValue, o.normalizedIntValue, r);
8473
+ } else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value : O(a.normalizedIntValue, o.normalizedIntValue, r);
8377
8474
  }
8378
8475
  isPlaying() {
8379
8476
  return !this.paused && this.isInsideTimeRange();
@@ -8396,14 +8493,14 @@ var fa = {
8396
8493
  });
8397
8494
  }
8398
8495
  };
8399
- k([_({ fallback: "parent" }), O("design:type", Object)], ma.prototype, "effectMode", void 0), k([_({ default: () => [] }), O("design:type", Array)], ma.prototype, "keyframes", void 0), k([_(), O("design:type", Object)], ma.prototype, "easing", void 0), ma = k([S("Animation", {
8496
+ A([_({ fallback: "parent" }), k("design:type", Object)], ha.prototype, "effectMode", void 0), A([_({ default: () => [] }), k("design:type", Array)], ha.prototype, "keyframes", void 0), A([_(), k("design:type", Object)], ha.prototype, "easing", void 0), ha = A([S("Animation", {
8400
8497
  renderMode: "disabled",
8401
8498
  processSortMode: "parent-before",
8402
8499
  duration: 2e3
8403
- }), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ma);
8500
+ }), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ha);
8404
8501
  //#endregion
8405
8502
  //#region src/scene/audio/html/HTMLAudioContext.ts
8406
- var ha = class t extends e {
8503
+ var ga = class t extends e {
8407
8504
  static _instance;
8408
8505
  static get instance() {
8409
8506
  return this._instance ||= new t(), this._instance;
@@ -8433,7 +8530,7 @@ var ha = class t extends e {
8433
8530
  togglePause() {
8434
8531
  return this.paused = !this.paused, this.refreshPaused(), this.paused;
8435
8532
  }
8436
- }, ga = class t extends e {
8533
+ }, _a = class t extends e {
8437
8534
  static PADDING = .1;
8438
8535
  _source = null;
8439
8536
  _audio = null;
@@ -8560,7 +8657,7 @@ var ha = class t extends e {
8560
8657
  let e = this._source;
8561
8658
  e && (e.onended = null, e.onplay = null, e.onpause = null, this._stop()), this._source = null, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._end = 0, this._start = 0, this._duration = 0, this._playing = !1, this._pausedReal = !1, this._paused = !1, this._muted = !1, this._audio &&= (this._audio.context.off("refresh", this.refresh), this._audio.context.off("refreshPaused", this.refreshPaused), null);
8562
8659
  }
8563
- }, _a = class {
8660
+ }, va = class {
8564
8661
  parent;
8565
8662
  source = new globalThis.Audio();
8566
8663
  _src = "";
@@ -8577,7 +8674,7 @@ var ha = class t extends e {
8577
8674
  return !!this.source && this.source.readyState === 4;
8578
8675
  }
8579
8676
  get context() {
8580
- return ha.instance;
8677
+ return ga.instance;
8581
8678
  }
8582
8679
  constructor(e) {
8583
8680
  this.parent = e;
@@ -8588,9 +8685,9 @@ var ha = class t extends e {
8588
8685
  });
8589
8686
  }
8590
8687
  createSound() {
8591
- return new ga();
8688
+ return new _a();
8592
8689
  }
8593
- }, va = class extends e {
8690
+ }, ya = class extends e {
8594
8691
  _input;
8595
8692
  _output;
8596
8693
  _processers = [];
@@ -8612,7 +8709,7 @@ var ha = class t extends e {
8612
8709
  get destination() {
8613
8710
  return this._input;
8614
8711
  }
8615
- }, ya = class {
8712
+ }, ba = class {
8616
8713
  destination;
8617
8714
  source;
8618
8715
  constructor(e, t = null) {
@@ -8627,21 +8724,21 @@ var ha = class t extends e {
8627
8724
  };
8628
8725
  //#endregion
8629
8726
  //#region src/scene/audio/web/WebAudioContext.ts
8630
- function ba() {
8727
+ function xa() {
8631
8728
  if (Ve) return new AudioContext();
8632
8729
  if (He) {
8633
8730
  let e = globalThis.webkitAudioContext;
8634
8731
  return new e();
8635
8732
  } else throw Error("Failed to createAudioContext");
8636
8733
  }
8637
- function xa(e, t, n) {
8734
+ function Sa(e, t, n) {
8638
8735
  if (Ue) return new OfflineAudioContext(e, t, n);
8639
8736
  if (We) {
8640
8737
  let r = globalThis.webkitOfflineAudioContext;
8641
8738
  return new r(e, t, n);
8642
8739
  } else throw Error("Failed to createOfflineAudioContext");
8643
8740
  }
8644
- var Sa = class e extends va {
8741
+ var Ca = class e extends ya {
8645
8742
  static _instance;
8646
8743
  static get instance() {
8647
8744
  return this._instance ||= new e(), this._instance;
@@ -8682,7 +8779,7 @@ var Sa = class e extends va {
8682
8779
  _compressor;
8683
8780
  _analyser;
8684
8781
  constructor() {
8685
- let e = ba(), t = xa(1, 2, Ue ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
8782
+ let e = xa(), t = Sa(1, 2, Ue ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
8686
8783
  r.connect(n), n.connect(e.destination), super(r, n), this._context = e, this._offlineContext = t, this._compressor = n, this._analyser = r, this._locked = e.state === "suspended" && (Re || ze), Ke && (this._locked && (this._unlock(), document.addEventListener("mousedown", this._unlock, !0), document.addEventListener("touchstart", this._unlock, !0), document.addEventListener("touchend", this._unlock, !0)), globalThis.addEventListener("focus", this._onFocus), globalThis.addEventListener("blur", this._onBlur));
8687
8784
  }
8688
8785
  _onFocus() {
@@ -8723,7 +8820,7 @@ var Sa = class e extends va {
8723
8820
  setParamValue(e, t) {
8724
8821
  e.setValueAtTime ? e.setValueAtTime(t, this._context.currentTime) : e.value = t;
8725
8822
  }
8726
- }, Ca = class extends e {
8823
+ }, wa = class extends e {
8727
8824
  _audio = null;
8728
8825
  _sourceNode = null;
8729
8826
  _gain = null;
@@ -8856,7 +8953,7 @@ var Sa = class e extends va {
8856
8953
  destroy() {
8857
8954
  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;
8858
8955
  }
8859
- }, wa = class extends va {
8956
+ }, Ta = class extends ya {
8860
8957
  parent;
8861
8958
  _sourceBuffer;
8862
8959
  _sourceNode;
@@ -8864,7 +8961,7 @@ var Sa = class e extends va {
8864
8961
  gain;
8865
8962
  analyser;
8866
8963
  get context() {
8867
- return Sa.instance;
8964
+ return Ca.instance;
8868
8965
  }
8869
8966
  get isPlayable() {
8870
8967
  return !!this._sourceNode.buffer;
@@ -8879,8 +8976,8 @@ var Sa = class e extends va {
8879
8976
  this._sourceNode.buffer = e;
8880
8977
  }
8881
8978
  constructor(e) {
8882
- let t = Sa.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
8883
- n.connect(i), i.connect(r), r.connect(Sa.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
8979
+ let t = Ca.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
8980
+ n.connect(i), i.connect(r), r.connect(Ca.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
8884
8981
  }
8885
8982
  async load() {
8886
8983
  return this._sourceLoad ||= new Promise((e) => {
@@ -8893,7 +8990,7 @@ var Sa = class e extends va {
8893
8990
  });
8894
8991
  }
8895
8992
  _decode(e) {
8896
- return Promise.resolve(e instanceof AudioBuffer ? e : Sa.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
8993
+ return Promise.resolve(e instanceof AudioBuffer ? e : Ca.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
8897
8994
  }
8898
8995
  cloneSource() {
8899
8996
  let e = this.context, t = this._sourceNode, n = e.audioContext.createBufferSource(), r = e.audioContext.createGain();
@@ -8903,15 +9000,15 @@ var Sa = class e extends va {
8903
9000
  };
8904
9001
  }
8905
9002
  createSound() {
8906
- return new Ca();
9003
+ return new wa();
8907
9004
  }
8908
- }, Ta, Ea = class extends V {
9005
+ }, Ea, Da = class extends H {
8909
9006
  static {
8910
- Ta = this;
9007
+ Ea = this;
8911
9008
  }
8912
9009
  static _soundPool = [];
8913
9010
  _sounds = [];
8914
- _platformAudio = Ge ? new wa(this) : new _a(this);
9011
+ _platformAudio = Ge ? new Ta(this) : new va(this);
8915
9012
  get platformAudio() {
8916
9013
  return this._platformAudio;
8917
9014
  }
@@ -9004,7 +9101,7 @@ var Sa = class e extends va {
9004
9101
  this._sounds.length = 0;
9005
9102
  }
9006
9103
  _createSound() {
9007
- return Ta._soundPool.length > 0 ? Ta._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
9104
+ return Ea._soundPool.length > 0 ? Ea._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
9008
9105
  }
9009
9106
  refresh() {
9010
9107
  for (let e = this._sounds.length, t = 0; t < e; t++) this._sounds[t].refresh();
@@ -9020,7 +9117,7 @@ var Sa = class e extends va {
9020
9117
  this._recycleSound(e);
9021
9118
  };
9022
9119
  _recycleSound(e) {
9023
- e.destroy(), Ta._soundPool.includes(e) || Ta._soundPool.push(e);
9120
+ e.destroy(), Ea._soundPool.includes(e) || Ea._soundPool.push(e);
9024
9121
  }
9025
9122
  _prevTime = 0;
9026
9123
  _timer = 0;
@@ -9036,14 +9133,14 @@ var Sa = class e extends va {
9036
9133
  }, 100);
9037
9134
  }
9038
9135
  };
9039
- Ea = Ta = k([S("Audio"), O("design:paramtypes", [Object])], Ea);
9136
+ Da = Ea = A([S("Audio"), k("design:paramtypes", [Object])], Da);
9040
9137
  //#endregion
9041
9138
  //#region src/scene/audio/AudioSpectrum.ts
9042
- var Da = class extends Tr {}, Oa = class extends na {
9139
+ var Oa = class extends Tr {}, ka = class extends ra {
9043
9140
  _audioBuffer;
9044
9141
  _src = (() => {
9045
9142
  let e = w();
9046
- return e ? new z({ source: e }) : void 0;
9143
+ return e ? new B({ source: e }) : void 0;
9047
9144
  })();
9048
9145
  _needsUpdateTexture = !1;
9049
9146
  constructor(e = {}) {
@@ -9063,7 +9160,7 @@ var Da = class extends Tr {}, Oa = class extends na {
9063
9160
  }
9064
9161
  }
9065
9162
  async _loadSrc(e) {
9066
- await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => Sa.decode(e)).then((e) => {
9163
+ await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => Ca.decode(e)).then((e) => {
9067
9164
  this._audioBuffer = e, this.syncTexture(!0);
9068
9165
  });
9069
9166
  }
@@ -9098,16 +9195,16 @@ var Da = class extends Tr {}, Oa = class extends na {
9098
9195
  this.syncTexture(), super._process(e);
9099
9196
  }
9100
9197
  };
9101
- k([_(), O("design:type", Object)], Oa.prototype, "src", void 0), k([_({ fallback: 0 }), O("design:type", Number)], Oa.prototype, "gap", void 0), k([_({ fallback: "#000000" }), O("design:type", String)], Oa.prototype, "color", void 0), Oa = k([S("AudioWaveform"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], Oa);
9198
+ A([_(), k("design:type", Object)], ka.prototype, "src", void 0), A([_({ fallback: 0 }), k("design:type", Number)], ka.prototype, "gap", void 0), A([_({ fallback: "#000000" }), k("design:type", String)], ka.prototype, "color", void 0), ka = A([S("AudioWaveform"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], ka);
9102
9199
  //#endregion
9103
9200
  //#region src/scene/transitions/KawaseTransition.ts
9104
- var ka, Aa = class extends wr {
9201
+ var Aa, ja = class extends wr {
9105
9202
  static {
9106
- ka = this;
9203
+ Aa = this;
9107
9204
  }
9108
9205
  blur = 10;
9109
9206
  quality = 10;
9110
- static material = new I({ gl: {
9207
+ static material = new L({ gl: {
9111
9208
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
9112
9209
  fragment: "precision highp float;\nin vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 offset;\nuniform float progress;\n\nvoid main(void) {\n vec2 offset1 = vec2(offset.x - progress * offset.x, offset.y - progress * offset.y);\n vec4 color = vec4(0.0);\n color += texture(sampler, vec2(vUv.x - offset1.x, vUv.y + offset1.y));\n color += texture(sampler, vec2(vUv.x + offset1.x, vUv.y + offset1.y));\n color += texture(sampler, vec2(vUv.x + offset1.x, vUv.y - offset1.y));\n color += texture(sampler, vec2(vUv.x - offset1.x, vUv.y - offset1.y));\n color *= 0.25;\n gl_FragColor = color;\n}"
9113
9210
  } });
@@ -9122,7 +9219,7 @@ var ka, Aa = class extends wr {
9122
9219
  let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
9123
9220
  for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
9124
9221
  m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
9125
- L.draw(e, ka.material, {
9222
+ R.draw(e, Aa.material, {
9126
9223
  sampler: r,
9127
9224
  progress: i,
9128
9225
  ...t
@@ -9130,35 +9227,35 @@ var ka, Aa = class extends wr {
9130
9227
  });
9131
9228
  }
9132
9229
  };
9133
- Aa = ka = k([S("KawaseTransition")], Aa);
9230
+ ja = Aa = A([S("KawaseTransition")], ja);
9134
9231
  //#endregion
9135
9232
  //#region src/scene/transitions/LeftEraseTransition.ts
9136
- var ja, Ma = class extends wr {
9233
+ var Ma, Na = class extends wr {
9137
9234
  static {
9138
- ja = this;
9235
+ Ma = this;
9139
9236
  }
9140
- static material = new I({ gl: {
9237
+ static material = new L({ gl: {
9141
9238
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
9142
9239
  fragment: "precision highp float;\nvarying vec2 vUv;\nuniform float progress;\nuniform sampler2D previous;\nuniform sampler2D next;\n\nfloat easeInOutQuint(float t) {\n return t < 0.5 ? 16.0*t*t*t*t*t : 1.0+16.0*(--t)*t*t*t*t;\n}\n\nvoid main() {\n vec4 src1Color = texture2D(previous, vUv);\n vec4 src2Color = texture2D(next, vUv);\n float mProgress = 1.0 - progress;\n float mixPercent = 0.0;\n if (vUv.x <= mProgress) {\n mixPercent = 1.0;\n }\n gl_FragColor = mix(src2Color, src1Color, mixPercent);\n}"
9143
9240
  } });
9144
9241
  apply(e) {
9145
- L.draw(e, ja.material, {
9242
+ R.draw(e, Ma.material, {
9146
9243
  previous: 0,
9147
9244
  next: 1,
9148
9245
  progress: this.currentTimeProgress
9149
9246
  });
9150
9247
  }
9151
9248
  };
9152
- Ma = ja = k([S("LeftEraseTransition")], Ma);
9249
+ Na = Ma = A([S("LeftEraseTransition")], Na);
9153
9250
  //#endregion
9154
9251
  //#region src/scene/transitions/TiltShiftTransition.ts
9155
- var Na, Pa = class extends wr {
9252
+ var Pa, Fa = class extends wr {
9156
9253
  static {
9157
- Na = this;
9254
+ Pa = this;
9158
9255
  }
9159
9256
  blur = 100;
9160
9257
  gradientBlur = 600;
9161
- static material = new I({ gl: {
9258
+ static material = new L({ gl: {
9162
9259
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
9163
9260
  fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\nuniform float progress;\n\nfloat random(vec3 scale, float seed) {\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void) {\n float blur1 = blur - progress * blur;\n float gradientBlur1 = progress * gradientBlur;\n\n vec4 color = vec4(0.0);\n float total = 0.0;\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vUv * texSize - start, normal)) / gradientBlur1) * blur1;\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample1 = texture2D(sampler, vUv + delta / texSize * percent * radius);\n sample1.rgb *= sample1.a;\n color += sample1 * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}"
9164
9261
  } });
@@ -9166,7 +9263,7 @@ var Na, Pa = class extends wr {
9166
9263
  let n = this.currentTimeProgress, r, i;
9167
9264
  n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
9168
9265
  let a = t.width, o = t.height, s = [0, o / 2], c = [600, o / 2], l = [a, o], u = c[0] - s[0], d = c[1] - s[1], f = Math.sqrt(u * u + d * d);
9169
- L.draw(e, Na.material, {
9266
+ R.draw(e, Pa.material, {
9170
9267
  sampler: r,
9171
9268
  progress: i,
9172
9269
  blur: this.blur,
@@ -9175,7 +9272,7 @@ var Na, Pa = class extends wr {
9175
9272
  end: c,
9176
9273
  delta: [u / f, d / f],
9177
9274
  texSize: l
9178
- }), L.draw(e, Na.material, {
9275
+ }), R.draw(e, Pa.material, {
9179
9276
  sampler: r,
9180
9277
  progress: i,
9181
9278
  blur: this.blur,
@@ -9187,18 +9284,18 @@ var Na, Pa = class extends wr {
9187
9284
  });
9188
9285
  }
9189
9286
  };
9190
- Pa = Na = k([S("TiltShiftTransition")], Pa);
9287
+ Fa = Pa = A([S("TiltShiftTransition")], Fa);
9191
9288
  //#endregion
9192
9289
  //#region src/scene/transitions/TwistTransition.ts
9193
- var Fa, Ia = class extends wr {
9290
+ var Ia, La = class extends wr {
9194
9291
  static {
9195
- Fa = this;
9292
+ Ia = this;
9196
9293
  }
9197
9294
  radius;
9198
9295
  angle = 4;
9199
9296
  padding = 20;
9200
9297
  offset;
9201
- static material = new I({ gl: {
9298
+ static material = new L({ gl: {
9202
9299
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
9203
9300
  fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\nuniform float progress;\n\nvec2 mapCoord(vec2 coord) {\n coord -= filterArea.zw;\n coord *= filterArea.xy;\n return coord;\n}\n\nvec2 unmapCoord(vec2 coord) {\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n return coord;\n}\n\nvec2 twist(vec2 coord, float radius) {\n coord -= offset;\n float dist = length(coord);\n if (dist < radius) {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n coord += offset;\n return coord;\n}\n\nvoid main(void) {\n vec2 coord = mapCoord(vUv);\n coord = twist(coord, radius - (progress * radius));\n coord = unmapCoord(coord);\n gl_FragColor = texture2D(sampler, coord);\n}"
9204
9301
  } });
@@ -9206,7 +9303,7 @@ var Fa, Ia = class extends wr {
9206
9303
  let n = this.currentTimeProgress, r, i;
9207
9304
  n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
9208
9305
  let a = t.width, o = t.height;
9209
- L.draw(e, Fa.material, {
9306
+ R.draw(e, Ia.material, {
9210
9307
  sampler: r,
9211
9308
  progress: i,
9212
9309
  filterArea: [
@@ -9222,10 +9319,10 @@ var Fa, Ia = class extends wr {
9222
9319
  });
9223
9320
  }
9224
9321
  };
9225
- Ia = Fa = k([S("TwistTransition")], Ia);
9322
+ La = Ia = A([S("TwistTransition")], La);
9226
9323
  //#endregion
9227
9324
  //#region src/asset/loaders/GifLoader.ts
9228
- var La = class extends Hn {
9325
+ var Ra = class extends Hn {
9229
9326
  install(e) {
9230
9327
  let t = async (t) => {
9231
9328
  let { decodeFrames: n } = await import("modern-gif");
@@ -9242,14 +9339,14 @@ var La = class extends Hn {
9242
9339
  e.register(n, t);
9243
9340
  }), e.gif = this, this;
9244
9341
  }
9245
- }, Ra = class extends Hn {
9342
+ }, za = class extends Hn {
9246
9343
  install(e) {
9247
9344
  let t = async (e) => JSON.parse(await e.text());
9248
9345
  return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
9249
9346
  e.register(n, t);
9250
9347
  }), e.json = this, this;
9251
9348
  }
9252
- }, za = class extends Hn {
9349
+ }, Ba = class extends Hn {
9253
9350
  install(e) {
9254
9351
  return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
9255
9352
  container: null,
@@ -9260,14 +9357,14 @@ var La = class extends Hn {
9260
9357
  animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
9261
9358
  }), e.lottie = this, this;
9262
9359
  }
9263
- }, Ba = class extends Hn {
9360
+ }, Va = class extends Hn {
9264
9361
  install(e) {
9265
9362
  let t = async (e) => e.text();
9266
9363
  return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
9267
9364
  }
9268
- }, Va = class extends Hn {
9365
+ }, Ha = class extends Hn {
9269
9366
  install(e) {
9270
- let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new z({
9367
+ let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new B({
9271
9368
  source: e,
9272
9369
  uploadMethodId: "image",
9273
9370
  mipmap: !0,
@@ -9289,11 +9386,11 @@ var La = class extends Hn {
9289
9386
  e.register(n, t);
9290
9387
  }), e.texture = this, this;
9291
9388
  }
9292
- }, Ha = class extends Hn {
9389
+ }, Ua = class extends Hn {
9293
9390
  install(e) {
9294
9391
  return this.load = (t) => e.awaitBy(() => new or(t).load()), e.video = this, this;
9295
9392
  }
9296
- }, Ua = Object.entries({
9393
+ }, Wa = Object.entries({
9297
9394
  "font/woff": ["woff"],
9298
9395
  "font/ttf": ["ttf"],
9299
9396
  "font/otf": ["otf"],
@@ -9309,31 +9406,31 @@ var La = class extends Hn {
9309
9406
  "image/webp": ["webp"],
9310
9407
  "application/json": ["json"]
9311
9408
  });
9312
- function Wa(e) {
9313
- for (let [t, n] of Ua) if (n.includes(e)) return t;
9314
- }
9315
9409
  function Ga(e) {
9410
+ for (let [t, n] of Wa) if (n.includes(e)) return t;
9411
+ }
9412
+ function Ka(e) {
9316
9413
  let t;
9317
9414
  if (e.startsWith("data:")) t = e.match(/^data:(.+?);/)?.[1];
9318
9415
  else if (e.startsWith("http")) {
9319
9416
  let n = e.split(/[#?]/)[0].split(".").pop()?.trim();
9320
- n && (t = Wa(n));
9417
+ n && (t = Ga(n));
9321
9418
  }
9322
9419
  return t;
9323
9420
  }
9324
9421
  //#endregion
9325
9422
  //#region src/asset/Assets.ts
9326
- var Ka = "WeakRef" in globalThis, qa = class extends e {
9423
+ var qa = "WeakRef" in globalThis, Ja = class extends e {
9327
9424
  defaultHandler = (e) => e;
9328
9425
  _handlers = /* @__PURE__ */ new Map();
9329
9426
  _handleing = /* @__PURE__ */ new Map();
9330
9427
  _handled = /* @__PURE__ */ new Map();
9331
- _gc = Ka ? new FinalizationRegistry((e) => {
9428
+ _gc = qa ? new FinalizationRegistry((e) => {
9332
9429
  let t = this.get(e);
9333
9430
  t && "destroy" in t && t.destroy(), this._handled.delete(e);
9334
9431
  }) : void 0;
9335
9432
  constructor() {
9336
- super(), Ka || C.on(this.gc.bind(this), { sort: 2 });
9433
+ super(), qa || C.on(this.gc.bind(this), { sort: 2 });
9337
9434
  }
9338
9435
  use(e) {
9339
9436
  return e.install(this), this;
@@ -9382,11 +9479,11 @@ var Ka = "WeakRef" in globalThis, qa = class extends e {
9382
9479
  }
9383
9480
  get(e) {
9384
9481
  let t = this._handled.get(e);
9385
- return Ka && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
9482
+ return qa && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
9386
9483
  }
9387
9484
  set(e, t) {
9388
9485
  let n = t;
9389
- Ka && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
9486
+ qa && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
9390
9487
  }
9391
9488
  async awaitBy(e) {
9392
9489
  let t = e(), n = c();
@@ -9401,7 +9498,7 @@ var Ka = "WeakRef" in globalThis, qa = class extends e {
9401
9498
  return this._handleing.set(e, r), r;
9402
9499
  }
9403
9500
  async load(e, t) {
9404
- let n = await this.loadBy(e), r = Ga(e);
9501
+ let n = await this.loadBy(e), r = Ka(e);
9405
9502
  return r === void 0 && (r = n.type?.split(";")[0] ?? void 0), ((r ? this._handlers.get(r) : void 0) ?? this.defaultHandler)(n, t);
9406
9503
  }
9407
9504
  async waitUntilLoad() {
@@ -9415,14 +9512,14 @@ var Ka = "WeakRef" in globalThis, qa = class extends e {
9415
9512
  n && "destroy" in n && n.destroy();
9416
9513
  }), this._handled.clear();
9417
9514
  }
9418
- }, $ = new qa().use(new Un()).use(new La()).use(new Ra()).use(new za()).use(new Ba()).use(new Va()).use(new Ha()), Ja = {
9515
+ }, $ = new Ja().use(new Un()).use(new Ra()).use(new za()).use(new Ba()).use(new Va()).use(new Ha()).use(new Ua()), Ya = {
9419
9516
  alpha: !0,
9420
9517
  stencil: !0,
9421
9518
  antialias: !1,
9422
9519
  premultipliedAlpha: !0,
9423
9520
  preserveDrawingBuffer: !1,
9424
9521
  powerPreference: "default"
9425
- }, Ya = class extends Cr {
9522
+ }, Xa = class extends Cr {
9426
9523
  renderer;
9427
9524
  get view() {
9428
9525
  return this.renderer.view;
@@ -9455,12 +9552,12 @@ var Ka = "WeakRef" in globalThis, qa = class extends e {
9455
9552
  constructor(e = {}) {
9456
9553
  let { view: t, width: n, height: r, pixelRatio: i = Je, autoResize: a, data: o } = e;
9457
9554
  super(), this.renderer = new Vn(t, {
9458
- alpha: Ja.alpha ?? e.alpha,
9459
- stencil: Ja.stencil ?? e.stencil,
9460
- antialias: Ja.antialias ?? e.antialias,
9461
- premultipliedAlpha: Ja.premultipliedAlpha ?? e.premultipliedAlpha,
9462
- preserveDrawingBuffer: Ja.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
9463
- powerPreference: Ja.powerPreference ?? e.powerPreference
9555
+ alpha: Ya.alpha ?? e.alpha,
9556
+ stencil: Ya.stencil ?? e.stencil,
9557
+ antialias: Ya.antialias ?? e.antialias,
9558
+ premultipliedAlpha: Ya.premultipliedAlpha ?? e.premultipliedAlpha,
9559
+ preserveDrawingBuffer: Ya.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
9560
+ powerPreference: Ya.powerPreference ?? e.powerPreference
9464
9561
  }), this._setupInput(), this.pixelRatio = i, a ? !t && this.renderer.view && (this.renderer.view.style.width = "100%", this.renderer.view.style.height = "100%") : this.resize(n || this.gl.drawingBufferWidth || this.view?.clientWidth || 200, r || this.gl.drawingBufferHeight || this.view?.clientHeight || 200, !t), this.setProperties(e), o && this.root.append(o);
9465
9562
  }
9466
9563
  _updateProperty(e, t, n) {
@@ -9543,22 +9640,22 @@ var Ka = "WeakRef" in globalThis, qa = class extends e {
9543
9640
  super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
9544
9641
  }
9545
9642
  };
9546
- k([_({ fallback: !1 }), O("design:type", Boolean)], Ya.prototype, "autoResize", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Ya.prototype, "autoStart", void 0);
9643
+ A([_({ fallback: !1 }), k("design:type", Boolean)], Xa.prototype, "autoResize", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], Xa.prototype, "autoStart", void 0);
9547
9644
  //#endregion
9548
9645
  //#region src/render.ts
9549
- var Xa, Za = [], Qa = !1;
9550
- function $a() {
9551
- return Xa ??= new Ya({
9646
+ var Za, Qa = [], $a = !1;
9647
+ function eo() {
9648
+ return Za ??= new Xa({
9552
9649
  pixelRatio: 1,
9553
9650
  width: 1,
9554
9651
  height: 1,
9555
9652
  preserveDrawingBuffer: !0
9556
9653
  });
9557
9654
  }
9558
- async function eo(e = 100) {
9559
- if (!Qa) {
9560
- for (Qa = !0; Za.length;) {
9561
- let t = Za.shift();
9655
+ async function to(e = 100) {
9656
+ if (!$a) {
9657
+ for ($a = !0; Qa.length;) {
9658
+ let t = Qa.shift();
9562
9659
  if (t) try {
9563
9660
  await t();
9564
9661
  } catch (e) {
@@ -9566,11 +9663,11 @@ async function eo(e = 100) {
9566
9663
  }
9567
9664
  else await new Promise((t) => setTimeout(t, e));
9568
9665
  }
9569
- Qa = !1;
9666
+ $a = !1;
9570
9667
  }
9571
9668
  }
9572
- async function to(e) {
9573
- let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f = $a();
9669
+ async function no(e) {
9670
+ let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f = eo();
9574
9671
  if (f.resetProperties(), f.setProperties(l), f.debug = t, f.fonts = n, f.timeline.currentTime = 0, f.resize(u, d, !0), f.root.removeChildren(!0), f.root.append(a), await s?.(f), await f.waitAndRender(), o.length) {
9575
9672
  let e = o.length, t = o[e - 1];
9576
9673
  for (let n = 0; n < e; n++) {
@@ -9588,15 +9685,15 @@ async function to(e) {
9588
9685
  toCanvas2D: () => f.toCanvas2D(new ImageData(p, u, d))
9589
9686
  };
9590
9687
  }
9591
- async function no(e) {
9688
+ async function ro(e) {
9592
9689
  return new Promise((t) => {
9593
- Za.push(async () => t(await to(e).then((e) => e.toCanvas2D()))), eo();
9690
+ Qa.push(async () => t(await no(e).then((e) => e.toCanvas2D()))), to();
9594
9691
  });
9595
9692
  }
9596
- async function ro(e) {
9693
+ async function io(e) {
9597
9694
  return new Promise((t) => {
9598
- Za.push(async () => t(await to(e).then((e) => e.pixels))), eo();
9695
+ Qa.push(async () => t(await no(e).then((e) => e.pixels))), to();
9599
9696
  });
9600
9697
  }
9601
9698
  //#endregion
9602
- export { vt as Aabb2D, er as AnimatedTexture, ma as Animation, qa as Assets, Ea as Audio, va as AudioPipeline, ya as AudioProcessor, Da as AudioSpectrum, Oa as AudioWaveform, A as BufferUsage, Er as Camera2D, cr as CanvasContext, vr as CanvasItem, tr as CanvasTexture, yt as Color, W as ColorAdjustEffect, zr as ColorFilterEffect, Ct as ColorMatrix, Hr as ColorOverlayEffect, Wr as ColorRemoveEffect, qr as ColorReplaceEffect, nr as ColorTexture, T as CoreObject, bt as DEG_TO_RAD, Je as DEVICE_PIXEL_RATIO, G as DrawboardEffect, ei as DropShadowEffect, U as Effect, Zn as EffectMaterial, na as Element2D, vi as Element2DBackground, X as Element2DChart, Si as Element2DComments, Ci as Element2DConnection, Y as Element2DFill, ji as Element2DForeground, Ni as Element2DOutline, Pi as Element2DShadow, Fi as Element2DShape, Ii as Element2DStyle, Bi as Element2DTable, Z as Element2DText, ni as EmbossEffect, Ya as Engine, Zi as Flexbox, Un as FontLoader, Qr as GaussianBlurEffect, Gn as Geometry, La as GifLoader, un as GlBatch2DSystem, on as GlBlendMode, Ot as GlBuffer, Ft as GlBufferSystem, Dt as GlBufferTarget, mn as GlMaskSystem, qt as GlProgram, vn as GlRenderTarget, yn as GlRenderTargetSystem, nn as GlShaderSystem, cn as GlState, ln as GlStateSystem, gn as GlStencilSystem, j as GlSystem, _n as GlViewportSystem, K as GlitchEffect, q as GodrayEffect, rr as GradientTexture, _a as HTMLAudio, ha as HTMLAudioContext, ga as HTMLSound, Ke as IN_BROWSER, qe as IN_MAC_OS, Wn as IndexBuffer, gt as Input, ut as InputEvent, Ra as JsonLoader, ci as KawaseBlurEffect, Aa as KawaseTransition, dt as KeyboardInputEvent, Ma as LeftEraseTransition, Hn as Loader, ia as Lottie2D, za as LottieLoader, Et as MainLoop, ui as MaskEffect, I as Material, aa as Mesh2D, ur as Meta, ft as MouseInputEvent, B as Node, Tr as Node2D, wt as Obb2D, J as OutlineEffect, xe as PI, Se as PI_2, mi as PixelateEffect, ir as PixelsTexture, pt as PointerInputEvent, Tt as Projection2D, Kn as QuadGeometry, L as QuadUvGeometry, xt as RAD_TO_DEG, _t as RefCounted, R as RenderTarget, kt as Renderer, E as Resource, Ve as SUPPORTS_AUDIO_CONTEXT, ze as SUPPORTS_CLICK_EVENTS, Be as SUPPORTS_CREATE_IMAGE_BITMAP, Ne as SUPPORTS_IMAGE_BITMAP, Le as SUPPORTS_MOUSE_EVENTS, Ue as SUPPORTS_OFFLINE_AUDIO_CONTEXT, Fe as SUPPORTS_POINTER_EVENTS, Pe as SUPPORTS_RESIZE_OBSERVER, Re as SUPPORTS_TOUCH_EVENTS, Me as SUPPORTS_WEBGL2, He as SUPPORTS_WEBKIT_AUDIO_CONTEXT, We as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, Ge as SUPPORTS_WEB_AUDIO, Ie as SUPPORTS_WHEEL_EVENTS, Cr as SceneTree, Ba as TextLoader, z as Texture2D, Va as TextureLoader, ra as TextureRect2D, C as Ticker, Pa as TiltShiftTransition, xr as Timeline, V as TimelineNode, oa as TransformRect2D, wr as Transition, Ia as TwistTransition, jt as UniformGroup, $n as UvGeometry, Qn as UvMaterial, F as VertexAttribute, P as VertexBuffer, sa as Video2D, Ha as VideoLoader, or as VideoTexture, H as Viewport, sr as ViewportTexture, wa as WebAudio, Sa as WebAudioContext, Vn as WebGLRenderer, Ca as WebSound, mt as WheelInputEvent, Sr as Window, gi as ZoomBlurEffect, Hi as alignMap, $ as assets, Dr as axisDir, Xi as boxSizingMap, St as clamp, si as clampFrag, w as createHTMLCanvas, Pt as createIdFromString, ye as createNode, st as crossOrigin, fa as cssEasingPresets, da as cubicBezier, S as customNode, ve as customNodes, Ja as defaultOptions, ot as determineCrossOrigin, Wi as directionMap, Ui as displayMap, Q as edgeMap, Gi as flexDirectionMap, Ki as flexWrapMap, oi as frag, nt as getCanvasFactory, De as getDefaultCssPropertyValue, at as getGlContextProvider, $a as getRenderEngine, Vi as gutterMap, lt as instanceId, Qe as isCanvasElement, Ye as isElementNode, Ze as isImageElement, Ce as isPow2, Xe as isVideoElement, $e as isWebgl2, qi as justifyMap, D as lerp, fn as log2, sn as mapGlBlendModes, dn as nextPow2, be as nextTick, Ji as overflowMap, Fr as parseCssFilter, ke as parseCssFunctions, Oe as parseCssProperty, Ir as parseCssTransformOrigin, Yi as positionTypeMap, no as render, ro as renderPixels, gr as resetBatchPool, Or as routeConnection, tt as setCanvasFactory, it as setGlContextProvider, hn as stencilModeMap };
9699
+ export { yt as Aabb2D, er as AnimatedTexture, ha as Animation, Ja as Assets, Da as Audio, ya as AudioPipeline, ba as AudioProcessor, Oa as AudioSpectrum, ka as AudioWaveform, j as BufferUsage, Er as Camera2D, cr as CanvasContext, vr as CanvasItem, tr as CanvasTexture, E as Color, G as ColorAdjustEffect, zr as ColorFilterEffect, St as ColorMatrix, Hr as ColorOverlayEffect, Wr as ColorRemoveEffect, qr as ColorReplaceEffect, nr as ColorTexture, T as CoreObject, bt as DEG_TO_RAD, Je as DEVICE_PIXEL_RATIO, K as DrawboardEffect, ei as DropShadowEffect, W as Effect, Zn as EffectMaterial, ra as Element2D, yi as Element2DBackground, X as Element2DChart, Ci as Element2DComments, wi as Element2DConnection, Y as Element2DFill, Mi as Element2DForeground, Pi as Element2DOutline, Fi as Element2DShadow, Ii as Element2DShape, Li as Element2DStyle, Vi as Element2DTable, Z as Element2DText, ni as EmbossEffect, Xa as Engine, Qi as Flexbox, Un as FontLoader, Qr as GaussianBlurEffect, Gn as Geometry, Ra as GifLoader, ln as GlBatch2DSystem, an as GlBlendMode, Dt as GlBuffer, Pt as GlBufferSystem, Et as GlBufferTarget, pn as GlMaskSystem, Kt as GlProgram, _n as GlRenderTarget, vn as GlRenderTargetSystem, tn as GlShaderSystem, sn as GlState, cn as GlStateSystem, hn as GlStencilSystem, M as GlSystem, gn as GlViewportSystem, q as GlitchEffect, J as GodrayEffect, rr as GradientTexture, va as HTMLAudio, ga as HTMLAudioContext, _a as HTMLSound, Ke as IN_BROWSER, qe as IN_MAC_OS, Wn as IndexBuffer, gt as Input, ut as InputEvent, za as JsonLoader, ci as KawaseBlurEffect, ja as KawaseTransition, dt as KeyboardInputEvent, Na as LeftEraseTransition, Hn as Loader, aa as Lottie2D, Ba as LottieLoader, Tt as MainLoop, ui as MaskEffect, L as Material, oa as Mesh2D, ur as Meta, ft as MouseInputEvent, V as Node, Tr as Node2D, Ct as Obb2D, pi as OutlineEffect, xe as PI, Se as PI_2, hi as PixelateEffect, ir as PixelsTexture, pt as PointerInputEvent, wt as Projection2D, Kn as QuadGeometry, R as QuadUvGeometry, xt as RAD_TO_DEG, _t as RefCounted, z as RenderTarget, Ot as Renderer, vt as Resource, Ve as SUPPORTS_AUDIO_CONTEXT, ze as SUPPORTS_CLICK_EVENTS, Be as SUPPORTS_CREATE_IMAGE_BITMAP, Ne as SUPPORTS_IMAGE_BITMAP, Le as SUPPORTS_MOUSE_EVENTS, Ue as SUPPORTS_OFFLINE_AUDIO_CONTEXT, Fe as SUPPORTS_POINTER_EVENTS, Pe as SUPPORTS_RESIZE_OBSERVER, Re as SUPPORTS_TOUCH_EVENTS, Me as SUPPORTS_WEBGL2, He as SUPPORTS_WEBKIT_AUDIO_CONTEXT, We as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, Ge as SUPPORTS_WEB_AUDIO, Ie as SUPPORTS_WHEEL_EVENTS, Cr as SceneTree, Va as TextLoader, B as Texture2D, Ha as TextureLoader, ia as TextureRect2D, C as Ticker, Fa as TiltShiftTransition, xr as Timeline, H as TimelineNode, sa as TransformRect2D, wr as Transition, La as TwistTransition, At as UniformGroup, $n as UvGeometry, Qn as UvMaterial, I as VertexAttribute, F as VertexBuffer, ca as Video2D, Ua as VideoLoader, or as VideoTexture, U as Viewport, sr as ViewportTexture, Ta as WebAudio, Ca as WebAudioContext, Vn as WebGLRenderer, wa as WebSound, mt as WheelInputEvent, Sr as Window, _i as ZoomBlurEffect, Ui as alignMap, $ as assets, Dr as axisDir, Zi as boxSizingMap, D as clamp, si as clampFrag, w as createHTMLCanvas, Nt as createIdFromString, ye as createNode, st as crossOrigin, pa as cssEasingPresets, fa as cubicBezier, S as customNode, ve as customNodes, Ya as defaultOptions, ot as determineCrossOrigin, Gi as directionMap, Wi as displayMap, Q as edgeMap, Ki as flexDirectionMap, qi as flexWrapMap, oi as frag, nt as getCanvasFactory, De as getDefaultCssPropertyValue, at as getGlContextProvider, eo as getRenderEngine, Hi as gutterMap, lt as instanceId, Qe as isCanvasElement, Ye as isElementNode, Ze as isImageElement, Ce as isPow2, Xe as isVideoElement, $e as isWebgl2, Ji as justifyMap, O as lerp, dn as log2, on as mapGlBlendModes, un as nextPow2, be as nextTick, Yi as overflowMap, Fr as parseCssFilter, ke as parseCssFunctions, Oe as parseCssProperty, Ir as parseCssTransformOrigin, Xi as positionTypeMap, ro as render, io as renderPixels, gr as resetBatchPool, Or as routeConnection, tt as setCanvasFactory, it as setGlContextProvider, mn as stencilModeMap };