modern-canvas 0.21.2 → 0.21.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +334 -298
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5318,38 +5318,74 @@ function Br(e, t, n) {
5318
5318
  }, u = [{
5319
5319
  x: r.x,
5320
5320
  y: r.y
5321
- }, c], d = o.y === 0, f = s.y === 0;
5322
- if (d && f) {
5323
- let e = (c.x + l.x) / 2;
5324
- u.push({
5325
- x: e,
5326
- y: c.y
5327
- }, {
5328
- x: e,
5329
- y: l.y
5330
- });
5331
- } else if (!d && !f) {
5332
- let e = (c.y + l.y) / 2;
5333
- u.push({
5334
- x: c.x,
5335
- y: e
5336
- }, {
5337
- x: l.x,
5338
- y: e
5339
- });
5340
- } else d ? u.push({
5341
- x: l.x,
5342
- y: c.y
5343
- }) : u.push({
5344
- x: c.x,
5345
- y: l.y
5346
- });
5347
- return u.push(l, {
5321
+ }, c];
5322
+ return u.push(...Vr(c, o, l, s)), u.push(l, {
5348
5323
  x: i.x,
5349
5324
  y: i.y
5350
- }), Vr(u);
5325
+ }), Hr(u);
5326
+ }
5327
+ function Vr(e, t, n, r) {
5328
+ let i = t.y === 0;
5329
+ if (i === (r.y === 0)) {
5330
+ if (i) {
5331
+ if (t.x === -r.x && (n.x - e.x) * t.x > 0) {
5332
+ let t = (e.x + n.x) / 2;
5333
+ return [{
5334
+ x: t,
5335
+ y: e.y
5336
+ }, {
5337
+ x: t,
5338
+ y: n.y
5339
+ }];
5340
+ }
5341
+ let i = (e.y + n.y) / 2;
5342
+ return [{
5343
+ x: e.x,
5344
+ y: i
5345
+ }, {
5346
+ x: n.x,
5347
+ y: i
5348
+ }];
5349
+ }
5350
+ if (t.y === -r.y && (n.y - e.y) * t.y > 0) {
5351
+ let t = (e.y + n.y) / 2;
5352
+ return [{
5353
+ x: e.x,
5354
+ y: t
5355
+ }, {
5356
+ x: n.x,
5357
+ y: t
5358
+ }];
5359
+ }
5360
+ let a = (e.x + n.x) / 2;
5361
+ return [{
5362
+ x: a,
5363
+ y: e.y
5364
+ }, {
5365
+ x: a,
5366
+ y: n.y
5367
+ }];
5368
+ }
5369
+ let [a, o, s, c] = i ? [
5370
+ e,
5371
+ t,
5372
+ n,
5373
+ r
5374
+ ] : [
5375
+ n,
5376
+ r,
5377
+ e,
5378
+ t
5379
+ ];
5380
+ return (s.x - a.x) * o.x >= 0 && (s.y - a.y) * c.y <= 0 ? [{
5381
+ x: s.x,
5382
+ y: a.y
5383
+ }] : [{
5384
+ x: a.x,
5385
+ y: s.y
5386
+ }];
5351
5387
  }
5352
- function Vr(e) {
5388
+ function Hr(e) {
5353
5389
  let t = [];
5354
5390
  for (let n = 0; n < e.length; n++) {
5355
5391
  let r = e[n], i = t[t.length - 1];
@@ -5359,7 +5395,7 @@ function Vr(e) {
5359
5395
  }
5360
5396
  //#endregion
5361
5397
  //#region src/css/parseCssFilter.ts
5362
- var Hr = {
5398
+ var Ur = {
5363
5399
  brightness: 1,
5364
5400
  contrast: 1,
5365
5401
  grayscale: 0,
@@ -5369,12 +5405,12 @@ var Hr = {
5369
5405
  saturate: 1,
5370
5406
  sepia: 0
5371
5407
  };
5372
- function Ur(e) {
5408
+ function Wr(e) {
5373
5409
  let t = new vt();
5374
5410
  if (e === "none") return t;
5375
5411
  let n = De(e).reduce((e, { name: t, args: n }) => (e[t] = n[0].normalizedIntValue, e), {});
5376
- Object.keys(Hr).forEach((e) => {
5377
- n[e] = n[e] ?? Hr[e];
5412
+ Object.keys(Ur).forEach((e) => {
5413
+ n[e] = n[e] ?? Ur[e];
5378
5414
  });
5379
5415
  for (let e in n) {
5380
5416
  let r = n[e];
@@ -5409,7 +5445,7 @@ function Ur(e) {
5409
5445
  }
5410
5446
  //#endregion
5411
5447
  //#region src/css/parseCssTransformOrigin.ts
5412
- function Wr(e) {
5448
+ function Gr(e) {
5413
5449
  let [t, n = t] = e.split(" ");
5414
5450
  return [t, n].map((e) => {
5415
5451
  switch (e = e.trim(), e) {
@@ -5424,9 +5460,9 @@ function Wr(e) {
5424
5460
  }
5425
5461
  //#endregion
5426
5462
  //#region src/scene/effects/ColorAdjustEffect.ts
5427
- var Gr, Kr, U = class extends H {
5463
+ var Kr, qr, U = class extends H {
5428
5464
  static {
5429
- Kr = this;
5465
+ qr = this;
5430
5466
  }
5431
5467
  static material = new F({ gl: {
5432
5468
  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}",
@@ -5437,7 +5473,7 @@ var Gr, Kr, U = class extends H {
5437
5473
  }
5438
5474
  apply(e, t) {
5439
5475
  t.redraw(e, () => {
5440
- I.draw(e, Kr.material, {
5476
+ I.draw(e, qr.material, {
5441
5477
  sampler: 0,
5442
5478
  saturation: this.saturation,
5443
5479
  contrast: this.contrast,
@@ -5451,12 +5487,12 @@ var Gr, Kr, U = class extends H {
5451
5487
  });
5452
5488
  }
5453
5489
  };
5454
- O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "saturation", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "contrast", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "brightness", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "red", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "green", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "blue", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "alpha", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "gamma", void 0), U = Kr = O([x("ColorAdjustEffect"), D("design:paramtypes", [typeof (Gr = typeof Partial < "u" && Partial) == "function" ? Gr : Object, Array])], U);
5490
+ O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "saturation", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "contrast", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "brightness", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "red", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "green", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "blue", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "alpha", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "gamma", void 0), U = qr = O([x("ColorAdjustEffect"), D("design:paramtypes", [typeof (Kr = typeof Partial < "u" && Partial) == "function" ? Kr : Object, Array])], U);
5455
5491
  //#endregion
5456
5492
  //#region src/scene/effects/ColorFilterEffect.ts
5457
- var qr, Jr, Yr = class extends H {
5493
+ var Jr, Yr, Xr = class extends H {
5458
5494
  static {
5459
- Jr = this;
5495
+ Yr = this;
5460
5496
  }
5461
5497
  static material = new F({ gl: {
5462
5498
  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}",
@@ -5506,25 +5542,25 @@ var qr, Jr, Yr = class extends H {
5506
5542
  break;
5507
5543
  }
5508
5544
  }), t.redraw(e, () => {
5509
- I.draw(e, Jr.material, {
5545
+ I.draw(e, Yr.material, {
5510
5546
  sampler: 0,
5511
5547
  m: r.toArray()
5512
5548
  });
5513
5549
  });
5514
5550
  }
5515
5551
  };
5516
- O([_(), D("design:type", String)], Yr.prototype, "filter", void 0), Yr = Jr = O([x("ColorFilterEffect"), D("design:paramtypes", [typeof (qr = typeof Partial < "u" && Partial) == "function" ? qr : Object, Array])], Yr);
5552
+ O([_(), D("design:type", String)], Xr.prototype, "filter", void 0), Xr = Yr = O([x("ColorFilterEffect"), D("design:paramtypes", [typeof (Jr = typeof Partial < "u" && Partial) == "function" ? Jr : Object, Array])], Xr);
5517
5553
  //#endregion
5518
5554
  //#region src/scene/effects/ColorOverlayEffect.ts
5519
- var Xr, Zr, Qr = 50, $r = class extends H {
5555
+ var Zr, Qr, $r = 50, ei = class extends H {
5520
5556
  static {
5521
- Zr = this;
5557
+ Qr = this;
5522
5558
  }
5523
5559
  static material = new F({ gl: {
5524
5560
  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}",
5525
5561
  fragment: `precision mediump float;
5526
5562
  uniform sampler2D sampler;
5527
- uniform vec4 colors[${Qr}];
5563
+ uniform vec4 colors[${$r}];
5528
5564
  varying vec2 vUv;
5529
5565
 
5530
5566
  float calcWidth() {
@@ -5533,7 +5569,7 @@ float calcWidth() {
5533
5569
 
5534
5570
  int calcCount() {
5535
5571
  int count = 0;
5536
- for (int i = 0; i < ${Qr}; i++) {
5572
+ for (int i = 0; i < ${$r}; i++) {
5537
5573
  if (colors[i] != vec4(0,0,0,0)){
5538
5574
  count++;
5539
5575
  }
@@ -5545,7 +5581,7 @@ vec4 calcColor(float x) {
5545
5581
  float perUnit = calcWidth() / float(calcCount());
5546
5582
  int index = int(x / perUnit);
5547
5583
 
5548
- for(int i=0; i<${Qr}; i++){
5584
+ for(int i=0; i<${$r}; i++){
5549
5585
  if(i==index){
5550
5586
  return colors[i];
5551
5587
  }
@@ -5571,25 +5607,25 @@ void main(void) {
5571
5607
  let t = this._color.toArray();
5572
5608
  return t[3] = this.alpha, t;
5573
5609
  });
5574
- for (; t.length < Qr;) t.push([
5610
+ for (; t.length < $r;) t.push([
5575
5611
  0,
5576
5612
  0,
5577
5613
  0,
5578
5614
  0
5579
5615
  ]);
5580
- I.draw(e, Zr.material, {
5616
+ I.draw(e, Qr.material, {
5581
5617
  sampler: 0,
5582
- colors: t.slice(0, Qr).flatMap((e) => e)
5618
+ colors: t.slice(0, $r).flatMap((e) => e)
5583
5619
  });
5584
5620
  });
5585
5621
  }
5586
5622
  };
5587
- O([_({ default: () => [] }), D("design:type", Array)], $r.prototype, "colors", void 0), O([_({ fallback: .5 }), D("design:type", Number)], $r.prototype, "alpha", void 0), $r = Zr = O([x("ColorOverlayEffect"), D("design:paramtypes", [typeof (Xr = typeof Partial < "u" && Partial) == "function" ? Xr : Object, Array])], $r);
5623
+ O([_({ default: () => [] }), D("design:type", Array)], ei.prototype, "colors", void 0), O([_({ fallback: .5 }), D("design:type", Number)], ei.prototype, "alpha", void 0), ei = Qr = O([x("ColorOverlayEffect"), D("design:paramtypes", [typeof (Zr = typeof Partial < "u" && Partial) == "function" ? Zr : Object, Array])], ei);
5588
5624
  //#endregion
5589
5625
  //#region src/scene/effects/ColorRemoveEffect.ts
5590
- var ei, ti, ni = class extends H {
5626
+ var ti, ni, ri = class extends H {
5591
5627
  static {
5592
- ti = this;
5628
+ ni = this;
5593
5629
  }
5594
5630
  static material = new F({ gl: {
5595
5631
  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}",
@@ -5609,7 +5645,7 @@ var ei, ti, ni = class extends H {
5609
5645
  r.slice(0, 50).forEach((e, t) => {
5610
5646
  n[t * 3] = e[0], n[t * 3 + 1] = e[1], n[t * 3 + 2] = e[2];
5611
5647
  }), t.redraw(e, () => {
5612
- I.draw(e, ti.material, {
5648
+ I.draw(e, ni.material, {
5613
5649
  sampler: 0,
5614
5650
  epsilon: this.epsilon,
5615
5651
  originalColors: n
@@ -5617,19 +5653,19 @@ var ei, ti, ni = class extends H {
5617
5653
  });
5618
5654
  }
5619
5655
  };
5620
- O([_({ default: () => [] }), D("design:type", Array)], ni.prototype, "colors", void 0), O([_({ fallback: .5 }), D("design:type", Number)], ni.prototype, "epsilon", void 0), ni = ti = O([x("ColorRemoveEffect"), D("design:paramtypes", [typeof (ei = typeof Partial < "u" && Partial) == "function" ? ei : Object, Array])], ni);
5656
+ O([_({ default: () => [] }), D("design:type", Array)], ri.prototype, "colors", void 0), O([_({ fallback: .5 }), D("design:type", Number)], ri.prototype, "epsilon", void 0), ri = ni = O([x("ColorRemoveEffect"), D("design:paramtypes", [typeof (ti = typeof Partial < "u" && Partial) == "function" ? ti : Object, Array])], ri);
5621
5657
  //#endregion
5622
5658
  //#region src/scene/effects/ColorReplaceEffect.ts
5623
- var ri, ii, ai = 50, oi = class extends H {
5659
+ var ii, ai, oi = 50, si = class extends H {
5624
5660
  static {
5625
- ii = this;
5661
+ ai = this;
5626
5662
  }
5627
5663
  static material = new F({ gl: {
5628
5664
  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}",
5629
5665
  fragment: `varying vec2 vUv;
5630
5666
  uniform sampler2D sampler;
5631
5667
  uniform float epsilon;
5632
- const int MAX_COLORS = ${ai};
5668
+ const int MAX_COLORS = ${oi};
5633
5669
  uniform vec3 originalColors[MAX_COLORS];
5634
5670
  uniform vec3 targetColors[MAX_COLORS];
5635
5671
 
@@ -5666,8 +5702,8 @@ void main(void) {
5666
5702
  this._color.value = e[0];
5667
5703
  let t = this._color.toArray().slice(0, 3);
5668
5704
  return this._color.value = e[1], [t, this._color.toArray().slice(0, 3)];
5669
- }), r = this.epsilon, i = new Float32Array(ai * 3), a = new Float32Array(ai * 3);
5670
- for (; n.length < ai;) n.push([[
5705
+ }), r = this.epsilon, i = new Float32Array(oi * 3), a = new Float32Array(oi * 3);
5706
+ for (; n.length < oi;) n.push([[
5671
5707
  -1,
5672
5708
  0,
5673
5709
  0
@@ -5677,10 +5713,10 @@ void main(void) {
5677
5713
  0,
5678
5714
  1
5679
5715
  ]]);
5680
- n.slice(0, ai).forEach(([e, t], n) => {
5716
+ n.slice(0, oi).forEach(([e, t], n) => {
5681
5717
  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];
5682
5718
  }), t.redraw(e, () => {
5683
- I.draw(e, ii.material, {
5719
+ I.draw(e, ai.material, {
5684
5720
  sampler: 0,
5685
5721
  epsilon: r,
5686
5722
  originalColors: i,
@@ -5689,17 +5725,17 @@ void main(void) {
5689
5725
  });
5690
5726
  }
5691
5727
  };
5692
- O([_({ default: () => [] }), D("design:type", Array)], oi.prototype, "colors", void 0), O([_({ fallback: .05 }), D("design:type", Number)], oi.prototype, "epsilon", void 0), oi = ii = O([x("ColorReplaceEffect"), D("design:paramtypes", [typeof (ri = typeof Partial < "u" && Partial) == "function" ? ri : Object, Array])], oi);
5728
+ O([_({ default: () => [] }), D("design:type", Array)], si.prototype, "colors", void 0), O([_({ fallback: .05 }), D("design:type", Number)], si.prototype, "epsilon", void 0), si = ai = O([x("ColorReplaceEffect"), D("design:paramtypes", [typeof (ii = typeof Partial < "u" && Partial) == "function" ? ii : Object, Array])], si);
5693
5729
  //#endregion
5694
5730
  //#region src/scene/effects/DrawboardEffect.frag?raw
5695
- var si = "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;\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) {\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", ci, li, W = class extends H {
5731
+ var ci = "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;\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) {\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", li, ui, W = class extends H {
5696
5732
  static {
5697
- li = this;
5733
+ ui = this;
5698
5734
  }
5699
5735
  _watermark;
5700
5736
  static material = new F({ gl: {
5701
5737
  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}",
5702
- fragment: si
5738
+ fragment: ci
5703
5739
  } });
5704
5740
  constructor(e, t = []) {
5705
5741
  super(), this.setProperties(e).append(t);
@@ -5723,7 +5759,7 @@ var si = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
5723
5759
  t.redraw(e, () => {
5724
5760
  this._watermark ? this._watermark.activate(e, 1) : e.texture.unbind(1);
5725
5761
  let n = e.shader.uniforms.viewMatrix, r = this._watermark ? [this.watermarkWidth, this.watermarkWidth * this._watermark.height / this._watermark.width] : [0, 0], i = Math.max(r[0], r[1]);
5726
- I.draw(e, li.material, {
5762
+ I.draw(e, ui.material, {
5727
5763
  uTexture: 0,
5728
5764
  inputSize: [t.width, t.height],
5729
5765
  zoom: [n[0], n[4]],
@@ -5747,20 +5783,20 @@ var si = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
5747
5783
  });
5748
5784
  }
5749
5785
  };
5750
- O([_({ fallback: !1 }), D("design:type", Boolean)], W.prototype, "checkerboard", void 0), O([_({ fallback: "grid" }), D("design:type", Object)], W.prototype, "checkerboardStyle", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], W.prototype, "pixelGrid", void 0), O([_(), D("design:type", String)], W.prototype, "watermark", void 0), O([_({ fallback: 100 }), D("design:type", Number)], W.prototype, "watermarkWidth", void 0), O([_({ fallback: .05 }), D("design:type", Number)], W.prototype, "watermarkAlpha", void 0), O([_({ fallback: .5236 }), D("design:type", Number)], W.prototype, "watermarkRotation", void 0), W = li = O([x("DrawboardEffect"), D("design:paramtypes", [typeof (ci = typeof Partial < "u" && Partial) == "function" ? ci : Object, Array])], W);
5786
+ O([_({ fallback: !1 }), D("design:type", Boolean)], W.prototype, "checkerboard", void 0), O([_({ fallback: "grid" }), D("design:type", Object)], W.prototype, "checkerboardStyle", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], W.prototype, "pixelGrid", void 0), O([_(), D("design:type", String)], W.prototype, "watermark", void 0), O([_({ fallback: 100 }), D("design:type", Number)], W.prototype, "watermarkWidth", void 0), O([_({ fallback: .05 }), D("design:type", Number)], W.prototype, "watermarkAlpha", void 0), O([_({ fallback: .5236 }), D("design:type", Number)], W.prototype, "watermarkRotation", void 0), W = ui = O([x("DrawboardEffect"), D("design:paramtypes", [typeof (li = typeof Partial < "u" && Partial) == "function" ? li : Object, Array])], W);
5751
5787
  //#endregion
5752
5788
  //#region src/scene/effects/GaussianBlurEffect.ts
5753
- var ui, di, fi = "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}", pi = class extends H {
5789
+ var di, fi, pi = "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}", mi = class extends H {
5754
5790
  static {
5755
- di = this;
5791
+ fi = this;
5756
5792
  }
5757
5793
  static materialX = new F({ gl: {
5758
5794
  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}",
5759
- fragment: fi
5795
+ fragment: pi
5760
5796
  } });
5761
5797
  static materialY = new F({ gl: {
5762
5798
  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}",
5763
- fragment: fi
5799
+ fragment: pi
5764
5800
  } });
5765
5801
  constructor(e, t = []) {
5766
5802
  super(), this.setProperties(e).append(t);
@@ -5768,31 +5804,31 @@ var ui, di, fi = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(
5768
5804
  apply(e, t) {
5769
5805
  let n = 1 / t.width, r = 1 / t.height, i = Math.max(this.quality, 1);
5770
5806
  for (let r = 0; r < i; r++) t.redraw(e, () => {
5771
- I.draw(e, di.materialX, {
5807
+ I.draw(e, fi.materialX, {
5772
5808
  sampler: 0,
5773
5809
  uStrength: n * (this.strength / i)
5774
5810
  });
5775
5811
  });
5776
5812
  for (let n = 0; n < i; n++) t.redraw(e, () => {
5777
- I.draw(e, di.materialY, {
5813
+ I.draw(e, fi.materialY, {
5778
5814
  sampler: 0,
5779
5815
  uStrength: r * (this.strength / i)
5780
5816
  });
5781
5817
  });
5782
5818
  }
5783
5819
  };
5784
- O([_({ fallback: 4 }), D("design:type", Number)], pi.prototype, "strength", void 0), O([_({ fallback: 3 }), D("design:type", Number)], pi.prototype, "quality", void 0), pi = di = O([x("GaussianBlurEffect"), D("design:paramtypes", [typeof (ui = typeof Partial < "u" && Partial) == "function" ? ui : Object, Array])], pi);
5820
+ O([_({ fallback: 4 }), D("design:type", Number)], mi.prototype, "strength", void 0), O([_({ fallback: 3 }), D("design:type", Number)], mi.prototype, "quality", void 0), mi = fi = O([x("GaussianBlurEffect"), D("design:paramtypes", [typeof (di = typeof Partial < "u" && Partial) == "function" ? di : Object, Array])], mi);
5785
5821
  //#endregion
5786
5822
  //#region src/scene/effects/DropShadowEffect.ts
5787
- var mi, hi, gi = class extends H {
5823
+ var hi, gi, _i = class extends H {
5788
5824
  static {
5789
- hi = this;
5825
+ gi = this;
5790
5826
  }
5791
5827
  static material = new F({ gl: {
5792
5828
  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}",
5793
5829
  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}"
5794
5830
  } });
5795
- blurEffect = new pi();
5831
+ blurEffect = new mi();
5796
5832
  viewport3 = new V();
5797
5833
  _color = new T();
5798
5834
  constructor(e, t = []) {
@@ -5800,7 +5836,7 @@ var mi, hi, gi = class extends H {
5800
5836
  }
5801
5837
  apply(e, t) {
5802
5838
  this.viewport3.activateWithCopy(e, t), this.viewport3.redraw(e, () => {
5803
- this._color.value = this.color, I.draw(e, hi.material, {
5839
+ this._color.value = this.color, I.draw(e, gi.material, {
5804
5840
  sampler: 0,
5805
5841
  uAlpha: this._color.a,
5806
5842
  uColor: this._color.toArray().slice(0, 3),
@@ -5817,12 +5853,12 @@ var mi, hi, gi = class extends H {
5817
5853
  });
5818
5854
  }
5819
5855
  };
5820
- O([_({ fallback: "#000000FF" }), D("design:type", Object)], gi.prototype, "color", void 0), O([_({ fallback: 4 }), D("design:type", Number)], gi.prototype, "blur", void 0), O([_({ fallback: 4 }), D("design:type", Number)], gi.prototype, "offsetX", void 0), O([_({ fallback: 4 }), D("design:type", Number)], gi.prototype, "offsetY", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], gi.prototype, "shadowOnly", void 0), gi = hi = O([x("DropShadowEffect"), D("design:paramtypes", [typeof (mi = typeof Partial < "u" && Partial) == "function" ? mi : Object, Array])], gi);
5856
+ O([_({ fallback: "#000000FF" }), D("design:type", Object)], _i.prototype, "color", void 0), O([_({ fallback: 4 }), D("design:type", Number)], _i.prototype, "blur", void 0), O([_({ fallback: 4 }), D("design:type", Number)], _i.prototype, "offsetX", void 0), O([_({ fallback: 4 }), D("design:type", Number)], _i.prototype, "offsetY", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], _i.prototype, "shadowOnly", void 0), _i = gi = O([x("DropShadowEffect"), D("design:paramtypes", [typeof (hi = typeof Partial < "u" && Partial) == "function" ? hi : Object, Array])], _i);
5821
5857
  //#endregion
5822
5858
  //#region src/scene/effects/EmbossEffect.ts
5823
- var _i, vi, yi = class extends H {
5859
+ var vi, yi, bi = class extends H {
5824
5860
  static {
5825
- vi = this;
5861
+ yi = this;
5826
5862
  }
5827
5863
  static material = new F({ gl: {
5828
5864
  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}",
@@ -5833,7 +5869,7 @@ var _i, vi, yi = class extends H {
5833
5869
  }
5834
5870
  apply(e, t) {
5835
5871
  t.redraw(e, () => {
5836
- I.draw(e, vi.material, {
5872
+ I.draw(e, yi.material, {
5837
5873
  sampler: 0,
5838
5874
  strength: this.strength,
5839
5875
  inputSize: [
@@ -5846,12 +5882,12 @@ var _i, vi, yi = class extends H {
5846
5882
  });
5847
5883
  }
5848
5884
  };
5849
- O([_({ fallback: 5 }), D("design:type", Number)], yi.prototype, "strength", void 0), yi = vi = O([x("EmbossEffect"), D("design:paramtypes", [typeof (_i = typeof Partial < "u" && Partial) == "function" ? _i : Object, Array])], yi);
5885
+ O([_({ fallback: 5 }), D("design:type", Number)], bi.prototype, "strength", void 0), bi = yi = O([x("EmbossEffect"), D("design:paramtypes", [typeof (vi = typeof Partial < "u" && Partial) == "function" ? vi : Object, Array])], bi);
5850
5886
  //#endregion
5851
5887
  //#region src/scene/effects/GlitchEffect.ts
5852
- var bi, xi, G = class extends H {
5888
+ var xi, Si, G = class extends H {
5853
5889
  static {
5854
- xi = this;
5890
+ Si = this;
5855
5891
  }
5856
5892
  static material = new F({ gl: {
5857
5893
  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}",
@@ -5883,7 +5919,7 @@ var bi, xi, G = class extends H {
5883
5919
  this._needsRedraw || (this._needsRedraw = !0, this.redraw());
5884
5920
  let n = t.width, r = t.height, i = this.direction * (Math.PI / 180), a = Math.sin(i), o = Math.cos(i);
5885
5921
  t.redraw(e, () => {
5886
- this._texture.activate(e, 1), I.draw(e, xi.material, {
5922
+ this._texture.activate(e, 1), I.draw(e, Si.material, {
5887
5923
  sampler: 0,
5888
5924
  filterClamp: [
5889
5925
  0,
@@ -5912,12 +5948,12 @@ var bi, xi, G = class extends H {
5912
5948
  });
5913
5949
  }
5914
5950
  };
5915
- O([_({ fallback: 10 }), D("design:type", Number)], G.prototype, "slices", void 0), O([_({ fallback: 512 }), D("design:type", Number)], G.prototype, "sampleSize", void 0), O([_({ fallback: 100 }), D("design:type", Number)], G.prototype, "offset", void 0), O([_({ fallback: 0 }), D("design:type", Number)], G.prototype, "direction", void 0), O([_({ fallback: 2 }), D("design:type", Number)], G.prototype, "fillMode", void 0), O([_({ fallback: 0 }), D("design:type", Number)], G.prototype, "seed", void 0), O([_({ default: () => [2, 2] }), D("design:type", Array)], G.prototype, "red", void 0), O([_({ default: () => [-10, 4] }), D("design:type", Array)], G.prototype, "green", void 0), O([_({ default: () => [10, -4] }), D("design:type", Array)], G.prototype, "blue", void 0), G = xi = O([x("GlitchEffect"), D("design:paramtypes", [typeof (bi = typeof Partial < "u" && Partial) == "function" ? bi : Object, Array])], G);
5951
+ O([_({ fallback: 10 }), D("design:type", Number)], G.prototype, "slices", void 0), O([_({ fallback: 512 }), D("design:type", Number)], G.prototype, "sampleSize", void 0), O([_({ fallback: 100 }), D("design:type", Number)], G.prototype, "offset", void 0), O([_({ fallback: 0 }), D("design:type", Number)], G.prototype, "direction", void 0), O([_({ fallback: 2 }), D("design:type", Number)], G.prototype, "fillMode", void 0), O([_({ fallback: 0 }), D("design:type", Number)], G.prototype, "seed", void 0), O([_({ default: () => [2, 2] }), D("design:type", Array)], G.prototype, "red", void 0), O([_({ default: () => [-10, 4] }), D("design:type", Array)], G.prototype, "green", void 0), O([_({ default: () => [10, -4] }), D("design:type", Array)], G.prototype, "blue", void 0), G = Si = O([x("GlitchEffect"), D("design:paramtypes", [typeof (xi = typeof Partial < "u" && Partial) == "function" ? xi : Object, Array])], G);
5916
5952
  //#endregion
5917
5953
  //#region src/scene/effects/GodrayEffect.ts
5918
- var Si, Ci, wi = "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}", K = class extends H {
5954
+ var Ci, wi, Ti = "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}", K = class extends H {
5919
5955
  static {
5920
- Ci = this;
5956
+ wi = this;
5921
5957
  }
5922
5958
  static material = new F({ gl: {
5923
5959
  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}",
@@ -5932,7 +5968,7 @@ uniform float uTime;
5932
5968
  uniform vec3 uRay;
5933
5969
  uniform vec4 uInputSize;
5934
5970
 
5935
- ${wi}
5971
+ ${Ti}
5936
5972
 
5937
5973
  void main(void) {
5938
5974
  bool uParallel = uParallel > 0.5;
@@ -5971,7 +6007,7 @@ void main(void) {
5971
6007
  apply(e, t) {
5972
6008
  let n = this.angle * (Math.PI / 180), r = this.parallel ? [Math.cos(n), Math.sin(n)] : this.center;
5973
6009
  t.redraw(e, () => {
5974
- I.draw(e, Ci.material, {
6010
+ I.draw(e, wi.material, {
5975
6011
  sampler: 0,
5976
6012
  uDimensions: [t.width, t.height],
5977
6013
  uParallel: +!!this.parallel,
@@ -5993,15 +6029,15 @@ void main(void) {
5993
6029
  });
5994
6030
  }
5995
6031
  };
5996
- O([_({ fallback: 0 }), D("design:type", Number)], K.prototype, "time", void 0), O([_({ fallback: 30 }), D("design:type", Number)], K.prototype, "angle", void 0), O([_({ fallback: .5 }), D("design:type", Number)], K.prototype, "gain", void 0), O([_({ fallback: 2.5 }), D("design:type", Number)], K.prototype, "lacunarity", void 0), O([_({ fallback: !0 }), D("design:type", Boolean)], K.prototype, "parallel", void 0), O([_({ default: () => [0, 0] }), D("design:type", Array)], K.prototype, "center", void 0), O([_({ fallback: 1 }), D("design:type", Number)], K.prototype, "alpha", void 0), K = Ci = O([x("GodrayEffect"), D("design:paramtypes", [typeof (Si = typeof Partial < "u" && Partial) == "function" ? Si : Object, Array])], K);
6032
+ O([_({ fallback: 0 }), D("design:type", Number)], K.prototype, "time", void 0), O([_({ fallback: 30 }), D("design:type", Number)], K.prototype, "angle", void 0), O([_({ fallback: .5 }), D("design:type", Number)], K.prototype, "gain", void 0), O([_({ fallback: 2.5 }), D("design:type", Number)], K.prototype, "lacunarity", void 0), O([_({ fallback: !0 }), D("design:type", Boolean)], K.prototype, "parallel", void 0), O([_({ default: () => [0, 0] }), D("design:type", Array)], K.prototype, "center", void 0), O([_({ fallback: 1 }), D("design:type", Number)], K.prototype, "alpha", void 0), K = wi = O([x("GodrayEffect"), D("design:paramtypes", [typeof (Ci = typeof Partial < "u" && Partial) == "function" ? Ci : Object, Array])], K);
5997
6033
  //#endregion
5998
6034
  //#region src/scene/effects/KawaseBlurEffect.ts
5999
- var Ti, Ei = "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}", Di = "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}", Oi = class extends H {
6035
+ var Ei, Di = "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}", Oi = "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}", ki = class extends H {
6000
6036
  _kernels = [0];
6001
6037
  constructor(e, t = []) {
6002
6038
  super(), this.material = new F({ gl: {
6003
6039
  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}",
6004
- fragment: e?.clamp ? Di : Ei
6040
+ fragment: e?.clamp ? Oi : Di
6005
6041
  } }), this.setProperties(e).append(t), this._generateKernels();
6006
6042
  }
6007
6043
  _updateProperty(e, t, n) {
@@ -6039,12 +6075,12 @@ var Ti, Ei = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffse
6039
6075
  });
6040
6076
  }
6041
6077
  };
6042
- O([_({ fallback: 4 }), D("design:type", Number)], Oi.prototype, "strength", void 0), O([_({ fallback: 3 }), D("design:type", Number)], Oi.prototype, "quality", void 0), O([_({ default: () => [1, 1] }), D("design:type", Array)], Oi.prototype, "pixelSize", void 0), Oi = O([x("KawaseBlurEffect"), D("design:paramtypes", [typeof (Ti = typeof Partial < "u" && Partial) == "function" ? Ti : Object, Array])], Oi);
6078
+ O([_({ fallback: 4 }), D("design:type", Number)], ki.prototype, "strength", void 0), O([_({ fallback: 3 }), D("design:type", Number)], ki.prototype, "quality", void 0), O([_({ default: () => [1, 1] }), D("design:type", Array)], ki.prototype, "pixelSize", void 0), ki = O([x("KawaseBlurEffect"), D("design:paramtypes", [typeof (Ei = typeof Partial < "u" && Partial) == "function" ? Ei : Object, Array])], ki);
6043
6079
  //#endregion
6044
6080
  //#region src/scene/effects/MaskEffect.ts
6045
- var ki, Ai, ji = class extends H {
6081
+ var Ai, ji, Mi = class extends H {
6046
6082
  static {
6047
- Ai = this;
6083
+ ji = this;
6048
6084
  }
6049
6085
  static material = new F({ gl: {
6050
6086
  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}",
@@ -6066,7 +6102,7 @@ var ki, Ai, ji = class extends H {
6066
6102
  }
6067
6103
  apply(e, t, n) {
6068
6104
  this.texture && t.redraw(e, () => {
6069
- this.texture.activate(e, 1), I.draw(e, Ai.material, {
6105
+ this.texture.activate(e, 1), I.draw(e, ji.material, {
6070
6106
  sampler: 0,
6071
6107
  mask: 1,
6072
6108
  rotation: n.target?.globalRotation ?? 0
@@ -6074,23 +6110,23 @@ var ki, Ai, ji = class extends H {
6074
6110
  });
6075
6111
  }
6076
6112
  };
6077
- O([_({ fallback: "" }), D("design:type", String)], ji.prototype, "image", void 0), ji = Ai = O([x("MaskEffect"), D("design:paramtypes", [typeof (ki = typeof Partial < "u" && Partial) == "function" ? ki : Object, Array])], ji);
6113
+ O([_({ fallback: "" }), D("design:type", String)], Mi.prototype, "image", void 0), Mi = ji = O([x("MaskEffect"), D("design:paramtypes", [typeof (Ai = typeof Partial < "u" && Partial) == "function" ? Ai : Object, Array])], Mi);
6078
6114
  //#endregion
6079
6115
  //#region src/scene/effects/OutlineEffect.ts
6080
- var Mi, Ni, Pi = "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}", q = class extends H {
6116
+ var Ni, Pi, 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}", q = class extends H {
6081
6117
  static {
6082
- Ni = this;
6118
+ Pi = this;
6083
6119
  }
6084
6120
  static MIN_SAMPLES = 1;
6085
6121
  static MAX_SAMPLES = 100;
6086
6122
  static getAngleStep(e) {
6087
- return Number.parseFloat((Math.PI * 2 / Math.max(e * Ni.MAX_SAMPLES, Ni.MIN_SAMPLES)).toFixed(7));
6123
+ return Number.parseFloat((Math.PI * 2 / Math.max(e * Pi.MAX_SAMPLES, Pi.MIN_SAMPLES)).toFixed(7));
6088
6124
  }
6089
6125
  _color = new T();
6090
6126
  constructor(e, t = []) {
6091
6127
  super(), this.setProperties(e).append(t), this.material = new F({ gl: {
6092
6128
  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}",
6093
- fragment: Pi.replace(/\{ANGLE_STEP\}/, Ni.getAngleStep(this.quality).toFixed(7))
6129
+ fragment: Fi.replace(/\{ANGLE_STEP\}/, Pi.getAngleStep(this.quality).toFixed(7))
6094
6130
  } });
6095
6131
  }
6096
6132
  apply(e, t) {
@@ -6100,7 +6136,7 @@ var Mi, Ni, Pi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D s
6100
6136
  uThickness: [this.width / t.width, this.width / t.height],
6101
6137
  uColor: this._color.toArray().slice(0, 3),
6102
6138
  uAlpha: this.opacity === 1 ? this._color.a : this.opacity,
6103
- uAngleStep: Ni.getAngleStep(this.quality),
6139
+ uAngleStep: Pi.getAngleStep(this.quality),
6104
6140
  uKnockout: +!!this.knockout,
6105
6141
  uInputClamp: [
6106
6142
  0,
@@ -6112,12 +6148,12 @@ var Mi, Ni, Pi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D s
6112
6148
  });
6113
6149
  }
6114
6150
  };
6115
- O([_({ fallback: "#000000ff" }), D("design:type", Object)], q.prototype, "color", void 0), O([_({ fallback: 1 }), D("design:type", Number)], q.prototype, "width", void 0), O([_({ fallback: "solid" }), D("design:type", String)], q.prototype, "style", void 0), O([_(), D("design:type", Object)], q.prototype, "image", void 0), O([_({ fallback: 1 }), D("design:type", Number)], q.prototype, "opacity", void 0), O([_({ fallback: .1 }), D("design:type", Number)], q.prototype, "quality", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], q.prototype, "knockout", void 0), q = Ni = O([x("OutlineEffect"), D("design:paramtypes", [typeof (Mi = typeof Partial < "u" && Partial) == "function" ? Mi : Object, Array])], q);
6151
+ O([_({ fallback: "#000000ff" }), D("design:type", Object)], q.prototype, "color", void 0), O([_({ fallback: 1 }), D("design:type", Number)], q.prototype, "width", void 0), O([_({ fallback: "solid" }), D("design:type", String)], q.prototype, "style", void 0), O([_(), D("design:type", Object)], q.prototype, "image", void 0), O([_({ fallback: 1 }), D("design:type", Number)], q.prototype, "opacity", void 0), O([_({ fallback: .1 }), D("design:type", Number)], q.prototype, "quality", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], q.prototype, "knockout", void 0), q = Pi = O([x("OutlineEffect"), D("design:paramtypes", [typeof (Ni = typeof Partial < "u" && Partial) == "function" ? Ni : Object, Array])], q);
6116
6152
  //#endregion
6117
6153
  //#region src/scene/effects/PixelateEffect.ts
6118
- var Fi, Ii, Li = class extends H {
6154
+ var Ii, Li, Ri = class extends H {
6119
6155
  static {
6120
- Ii = this;
6156
+ Li = this;
6121
6157
  }
6122
6158
  static material = new F({ gl: {
6123
6159
  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}",
@@ -6133,16 +6169,16 @@ var Fi, Ii, Li = class extends H {
6133
6169
  offset: [(r[0] + i[0]) / t.width, 1 - (r[1] + i[1]) / t.height],
6134
6170
  step: [this.strength * r[0] / t.width, this.strength * r[1] / t.height]
6135
6171
  };
6136
- I.draw(e, Ii.material, a);
6172
+ I.draw(e, Li.material, a);
6137
6173
  });
6138
6174
  }
6139
6175
  };
6140
- O([_({ fallback: 10 }), D("design:type", Number)], Li.prototype, "strength", void 0), Li = Ii = O([x("PixelateEffect"), D("design:paramtypes", [typeof (Fi = typeof Partial < "u" && Partial) == "function" ? Fi : Object, Array])], Li);
6176
+ O([_({ fallback: 10 }), D("design:type", Number)], Ri.prototype, "strength", void 0), Ri = Li = O([x("PixelateEffect"), D("design:paramtypes", [typeof (Ii = typeof Partial < "u" && Partial) == "function" ? Ii : Object, Array])], Ri);
6141
6177
  //#endregion
6142
6178
  //#region src/scene/effects/ZoomBlurEffect.ts
6143
- var Ri, zi, Bi = class extends H {
6179
+ var zi, Bi, Vi = class extends H {
6144
6180
  static {
6145
- zi = this;
6181
+ Bi = this;
6146
6182
  }
6147
6183
  static material = new F({ gl: {
6148
6184
  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}",
@@ -6153,7 +6189,7 @@ var Ri, zi, Bi = class extends H {
6153
6189
  }
6154
6190
  apply(e, t) {
6155
6191
  t.redraw(e, () => {
6156
- I.draw(e, zi.material, {
6192
+ I.draw(e, Bi.material, {
6157
6193
  sampler: 0,
6158
6194
  uCenter: [t.width / 2, t.height / 2],
6159
6195
  uInnerRadius: this.innerRadius,
@@ -6169,10 +6205,10 @@ var Ri, zi, Bi = class extends H {
6169
6205
  });
6170
6206
  }
6171
6207
  };
6172
- O([_(), D("design:type", Array)], Bi.prototype, "center", void 0), O([_({ fallback: 20 }), D("design:type", Number)], Bi.prototype, "innerRadius", void 0), O([_({ fallback: -1 }), D("design:type", Number)], Bi.prototype, "radius", void 0), O([_({ fallback: .1 }), D("design:type", Number)], Bi.prototype, "strength", void 0), Bi = zi = O([x("ZoomBlurEffect"), D("design:paramtypes", [typeof (Ri = typeof Partial < "u" && Partial) == "function" ? Ri : Object, Array])], Bi);
6208
+ O([_(), D("design:type", Array)], Vi.prototype, "center", void 0), O([_({ fallback: 20 }), D("design:type", Number)], Vi.prototype, "innerRadius", void 0), O([_({ fallback: -1 }), D("design:type", Number)], Vi.prototype, "radius", void 0), O([_({ fallback: .1 }), D("design:type", Number)], Vi.prototype, "strength", void 0), Vi = Bi = O([x("ZoomBlurEffect"), D("design:paramtypes", [typeof (zi = typeof Partial < "u" && Partial) == "function" ? zi : Object, Array])], Vi);
6173
6209
  //#endregion
6174
6210
  //#region src/scene/2d/element/utils.ts
6175
- function Vi(e, t) {
6211
+ function Hi(e, t) {
6176
6212
  let { x: n, y: r, width: i, height: a } = t, o = !1, s = new v().translate(-n, -r).scale(1 / i, 1 / a);
6177
6213
  if (e.cropRect) {
6178
6214
  let { left: t = 0, top: n = 0, right: r = 0, bottom: i = 0 } = e.cropRect;
@@ -6253,7 +6289,7 @@ var J = class extends C {
6253
6289
  let i = this.animatedTexture?.currentFrame.texture ?? this.texture;
6254
6290
  r = {
6255
6291
  ...r,
6256
- ...Vi(this, this.tile && i ? {
6292
+ ...Hi(this, this.tile && i ? {
6257
6293
  x: 0,
6258
6294
  y: 0,
6259
6295
  width: i.sourceWidth,
@@ -6292,7 +6328,7 @@ var J = class extends C {
6292
6328
  O([_({ fallback: !0 }), D("design:type", Boolean)], J.prototype, "enabled", void 0), O([_(), D("design:type", Object)], J.prototype, "color", void 0), O([_(), D("design:type", Object)], J.prototype, "image", void 0), O([_(), D("design:type", Object)], J.prototype, "linearGradient", void 0), O([_(), D("design:type", Object)], J.prototype, "radialGradient", void 0), O([_(), D("design:type", Object)], J.prototype, "cropRect", void 0), O([_(), D("design:type", Object)], J.prototype, "stretchRect", void 0), O([_(), D("design:type", Object)], J.prototype, "dpi", void 0), O([_(), D("design:type", Object)], J.prototype, "rotateWithShape", void 0), O([_(), D("design:type", Object)], J.prototype, "tile", void 0), O([_(), D("design:type", Object)], J.prototype, "opacity", void 0);
6293
6329
  //#endregion
6294
6330
  //#region src/scene/2d/element/Element2DBackground.ts
6295
- var Hi = class extends J {
6331
+ var Ui = class extends J {
6296
6332
  setProperties(e) {
6297
6333
  return super._setProperties(d(e) ? void 0 : f(e));
6298
6334
  }
@@ -6304,14 +6340,14 @@ var Hi = class extends J {
6304
6340
  }
6305
6341
  }
6306
6342
  };
6307
- O([_(), D("design:type", Object)], Hi.prototype, "fillWithShape", void 0);
6343
+ O([_(), D("design:type", Object)], Ui.prototype, "fillWithShape", void 0);
6308
6344
  //#endregion
6309
6345
  //#region src/scene/2d/element/Element2DChart.ts
6310
- var Ui;
6311
- function Wi() {
6312
- return Ui ||= import("echarts").then((e) => e?.init ? e : e?.default).catch(() => void 0), Ui;
6346
+ var Wi;
6347
+ function Gi() {
6348
+ return Wi ||= import("echarts").then((e) => e?.init ? e : e?.default).catch(() => void 0), Wi;
6313
6349
  }
6314
- function Gi(e) {
6350
+ function Ki(e) {
6315
6351
  if (!e) return { show: !1 };
6316
6352
  switch (e) {
6317
6353
  case "bottom": return {
@@ -6377,7 +6413,7 @@ var Y = class extends C {
6377
6413
  this._teardown(), this._parent.requestDraw();
6378
6414
  return;
6379
6415
  }
6380
- let n = await Wi();
6416
+ let n = await Gi();
6381
6417
  if (!n) {
6382
6418
  console.warn("[modern-canvas] chart rendering requires the optional \"echarts\" dependency (e.g. `pnpm add echarts`)");
6383
6419
  return;
@@ -6426,7 +6462,7 @@ var Y = class extends C {
6426
6462
  text: this.title,
6427
6463
  left: "center"
6428
6464
  } : void 0,
6429
- legend: Gi(this.legend),
6465
+ legend: Ki(this.legend),
6430
6466
  tooltip: {}
6431
6467
  };
6432
6468
  if (n) {
@@ -6473,7 +6509,7 @@ var Y = class extends C {
6473
6509
  O([_({ fallback: !0 }), D("design:type", Boolean)], Y.prototype, "enabled", void 0), O([_({ fallback: "column" }), D("design:type", Object)], Y.prototype, "type", void 0), O([_(), D("design:type", Object)], Y.prototype, "grouping", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], Y.prototype, "categories", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], Y.prototype, "series", void 0), O([_(), D("design:type", Object)], Y.prototype, "title", void 0), O([_(), D("design:type", Object)], Y.prototype, "legend", void 0), O([_(), D("design:type", Object)], Y.prototype, "categoryAxis", void 0), O([_(), D("design:type", Object)], Y.prototype, "valueAxis", void 0);
6474
6510
  //#endregion
6475
6511
  //#region src/scene/2d/element/Element2DConnection.ts
6476
- var Ki = class extends C {
6512
+ var qi = class extends C {
6477
6513
  _parent;
6478
6514
  _routeSig;
6479
6515
  _routePath;
@@ -6511,7 +6547,7 @@ var Ki = class extends C {
6511
6547
  y: Math.sin(n.ang)
6512
6548
  }, {
6513
6549
  point: e,
6514
- dir: qi(r, t.globalRotation)
6550
+ dir: Ji(r, t.globalRotation)
6515
6551
  };
6516
6552
  }
6517
6553
  }
@@ -6528,8 +6564,8 @@ var Ki = class extends C {
6528
6564
  return (r !== this._routeSig || !this._routePath) && (this._routeSig = r, this._routePath = Rr(this.mode, e ?? t, t ?? e)), this._routePath;
6529
6565
  }
6530
6566
  };
6531
- O([_(), D("design:type", Object)], Ki.prototype, "start", void 0), O([_(), D("design:type", Object)], Ki.prototype, "end", void 0), O([_({ fallback: "straight" }), D("design:type", Object)], Ki.prototype, "mode", void 0);
6532
- function qi(e, t) {
6567
+ O([_(), D("design:type", Object)], qi.prototype, "start", void 0), O([_(), D("design:type", Object)], qi.prototype, "end", void 0), O([_({ fallback: "straight" }), D("design:type", Object)], qi.prototype, "mode", void 0);
6568
+ function Ji(e, t) {
6533
6569
  if (!t) return e;
6534
6570
  let n = Math.cos(t), r = Math.sin(t);
6535
6571
  return {
@@ -6539,7 +6575,7 @@ function qi(e, t) {
6539
6575
  }
6540
6576
  //#endregion
6541
6577
  //#region src/scene/2d/element/Element2DForeground.ts
6542
- var Ji = class extends J {
6578
+ var Yi = class extends J {
6543
6579
  setProperties(e) {
6544
6580
  return super._setProperties(d(e) ? void 0 : g(e));
6545
6581
  }
@@ -6551,10 +6587,10 @@ var Ji = class extends J {
6551
6587
  }
6552
6588
  }
6553
6589
  };
6554
- O([_(), D("design:type", Object)], Ji.prototype, "fillWithShape", void 0);
6590
+ O([_(), D("design:type", Object)], Yi.prototype, "fillWithShape", void 0);
6555
6591
  //#endregion
6556
6592
  //#region src/scene/2d/element/Element2DOutline.ts
6557
- var Yi = class extends J {
6593
+ var Xi = class extends J {
6558
6594
  setProperties(e) {
6559
6595
  return super._setProperties(d(e) ? void 0 : ee(e));
6560
6596
  }
@@ -6574,7 +6610,7 @@ var Yi = class extends J {
6574
6610
  }
6575
6611
  draw() {
6576
6612
  let { width: e, height: t } = this._parent.size, n = this._parent.context;
6577
- this.image === "viewport" ? n.strokeStyle = new lr() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ...Vi(this, {
6613
+ this.image === "viewport" ? n.strokeStyle = new lr() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ...Hi(this, {
6578
6614
  x: 0,
6579
6615
  y: 0,
6580
6616
  width: e,
@@ -6582,10 +6618,10 @@ var Yi = class extends J {
6582
6618
  }) });
6583
6619
  }
6584
6620
  };
6585
- O([_(), D("design:type", Object)], Yi.prototype, "color", void 0), O([_(), D("design:type", Object)], Yi.prototype, "width", void 0), O([_({ fallback: "solid" }), D("design:type", Object)], Yi.prototype, "style", void 0), O([_({ fallback: "butt" }), D("design:type", Object)], Yi.prototype, "lineCap", void 0), O([_({ fallback: "miter" }), D("design:type", Object)], Yi.prototype, "lineJoin", void 0);
6621
+ O([_(), D("design:type", Object)], Xi.prototype, "color", void 0), O([_(), D("design:type", Object)], Xi.prototype, "width", void 0), O([_({ fallback: "solid" }), D("design:type", Object)], Xi.prototype, "style", void 0), O([_({ fallback: "butt" }), D("design:type", Object)], Xi.prototype, "lineCap", void 0), O([_({ fallback: "miter" }), D("design:type", Object)], Xi.prototype, "lineJoin", void 0);
6586
6622
  //#endregion
6587
6623
  //#region src/scene/2d/element/Element2DShadow.ts
6588
- var Xi = class extends C {
6624
+ var Zi = class extends C {
6589
6625
  _parent;
6590
6626
  constructor(e) {
6591
6627
  super(), this._parent = e;
@@ -6606,13 +6642,13 @@ var Xi = class extends C {
6606
6642
  }
6607
6643
  updateEffect() {
6608
6644
  let e = "__$shadow", t = this._parent.getNode(e);
6609
- this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new gi({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
6645
+ this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new _i({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
6610
6646
  }
6611
6647
  };
6612
- O([_({ fallback: !0 }), D("design:type", Boolean)], Xi.prototype, "enabled", void 0), O([_({ fallback: "#000000FF" }), D("design:type", Object)], Xi.prototype, "color", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Xi.prototype, "blur", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Xi.prototype, "offsetY", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Xi.prototype, "offsetX", void 0);
6648
+ O([_({ fallback: !0 }), D("design:type", Boolean)], Zi.prototype, "enabled", void 0), O([_({ fallback: "#000000FF" }), D("design:type", Object)], Zi.prototype, "color", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Zi.prototype, "blur", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Zi.prototype, "offsetY", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Zi.prototype, "offsetX", void 0);
6613
6649
  //#endregion
6614
6650
  //#region src/scene/2d/element/Element2DShape.ts
6615
- var Zi = class extends C {
6651
+ var Qi = class extends C {
6616
6652
  _parent;
6617
6653
  _path2DSet = new le();
6618
6654
  _localPath;
@@ -6710,24 +6746,24 @@ var Zi = class extends C {
6710
6746
  t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
6711
6747
  }
6712
6748
  };
6713
- O([_({ fallback: !0 }), D("design:type", Boolean)], Zi.prototype, "enabled", void 0), O([_(), D("design:type", Object)], Zi.prototype, "preset", void 0), O([_(), D("design:type", Object)], Zi.prototype, "svg", void 0), O([_(), D("design:type", Object)], Zi.prototype, "viewBox", void 0), O([_(), D("design:type", Object)], Zi.prototype, "paths", void 0), O([_(), D("design:type", Object)], Zi.prototype, "connectionPoints", void 0);
6749
+ O([_({ fallback: !0 }), D("design:type", Boolean)], Qi.prototype, "enabled", void 0), O([_(), D("design:type", Object)], Qi.prototype, "preset", void 0), O([_(), D("design:type", Object)], Qi.prototype, "svg", void 0), O([_(), D("design:type", Object)], Qi.prototype, "viewBox", void 0), O([_(), D("design:type", Object)], Qi.prototype, "paths", void 0), O([_(), D("design:type", Object)], Qi.prototype, "connectionPoints", void 0);
6714
6750
  //#endregion
6715
6751
  //#region src/scene/2d/element/Element2DStyle.ts
6716
- var Qi = class extends w {
6752
+ var $i = class extends w {
6717
6753
  constructor(e) {
6718
6754
  super(), this.setProperties(e);
6719
6755
  }
6720
- }, $i = {
6756
+ }, ea = {
6721
6757
  ...o(),
6722
6758
  left: 0,
6723
6759
  top: 0,
6724
6760
  width: 0,
6725
6761
  height: 0
6726
6762
  };
6727
- for (let e in $i) i(Qi, e, { fallback: $i[e] });
6763
+ for (let e in ea) i($i, e, { fallback: ea[e] });
6728
6764
  //#endregion
6729
6765
  //#region src/scene/2d/element/Element2DTable.ts
6730
- var ea = 100, ta = 40, na = class extends C {
6766
+ var ta = 100, na = 40, ra = class extends C {
6731
6767
  _parent;
6732
6768
  _cellNodes = /* @__PURE__ */ new Map();
6733
6769
  _cellSnapshots = /* @__PURE__ */ new Map();
@@ -6758,10 +6794,10 @@ var ea = 100, ta = 40, na = class extends C {
6758
6794
  return !!(this.enabled && this.cells.length);
6759
6795
  }
6760
6796
  get gridWidth() {
6761
- return this.columns.reduce((e, t) => e + (t.width || ea), 0);
6797
+ return this.columns.reduce((e, t) => e + (t.width || ta), 0);
6762
6798
  }
6763
6799
  get gridHeight() {
6764
- return this.rows.reduce((e, t) => e + (t.height || ta), 0);
6800
+ return this.rows.reduce((e, t) => e + (t.height || na), 0);
6765
6801
  }
6766
6802
  update() {
6767
6803
  if (this._dirty = !1, !this.isValid()) {
@@ -6771,9 +6807,9 @@ var ea = 100, ta = 40, na = class extends C {
6771
6807
  let { columns: e, rows: t, cells: n } = this, r = e.length, i = t.length;
6772
6808
  for (let e of n) r = Math.max(r, e.col + (e.colSpan || 1)), i = Math.max(i, e.row + (e.rowSpan || 1));
6773
6809
  let a = [0];
6774
- for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width || ea));
6810
+ for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width || ta));
6775
6811
  let o = [0];
6776
- for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height || ta));
6812
+ for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height || na));
6777
6813
  this._parent.size.set(a[e.length] ?? 0, o[t.length] ?? 0);
6778
6814
  let s = /* @__PURE__ */ new Set();
6779
6815
  for (let e of n) {
@@ -6810,10 +6846,10 @@ var ea = 100, ta = 40, na = class extends C {
6810
6846
  this._clearCells();
6811
6847
  }
6812
6848
  };
6813
- O([_({ fallback: !0 }), D("design:type", Boolean)], na.prototype, "enabled", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], na.prototype, "columns", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], na.prototype, "rows", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], na.prototype, "cells", void 0);
6849
+ O([_({ fallback: !0 }), D("design:type", Boolean)], ra.prototype, "enabled", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], ra.prototype, "columns", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], ra.prototype, "rows", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], ra.prototype, "cells", void 0);
6814
6850
  //#endregion
6815
6851
  //#region src/scene/2d/element/Element2DText.ts
6816
- var ra, X = class extends C {
6852
+ var ia, X = class extends C {
6817
6853
  _parent;
6818
6854
  base;
6819
6855
  get textContent() {
@@ -6924,7 +6960,7 @@ var ra, X = class extends C {
6924
6960
  if (n.style.fill && !d(n.style.fill)) if (typeof n.style.fill == "object") {
6925
6961
  let r = n.style.fill, o = this._textureMap.get(`${a}.${i}.fill`) ?? this._textureMap.get(`${a}.fill`) ?? this._textureMap.get("fill");
6926
6962
  r.enabled !== !1 && (o || r.color) && (e.addPath(n), e.style = { ...n.style }, e.fillStyle = o?.texture ?? r.color, e.fill({
6927
- ...Vi(r, o?.box ?? {
6963
+ ...Hi(r, o?.box ?? {
6928
6964
  x: 0,
6929
6965
  y: 0,
6930
6966
  width: this._parent.size.width,
@@ -6936,7 +6972,7 @@ var ra, X = class extends C {
6936
6972
  if (n.style.stroke && !d(n.style.stroke)) if (typeof n.style.stroke == "object") {
6937
6973
  let r = n.style.stroke, o = this._textureMap.get(`${a}.${i}.outline`) ?? this._textureMap.get(`${a}.outline`) ?? this._textureMap.get("outline");
6938
6974
  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({
6939
- ...Vi(r, o?.box ?? {
6975
+ ...Hi(r, o?.box ?? {
6940
6976
  x: 0,
6941
6977
  y: 0,
6942
6978
  width: this._parent.size.width,
@@ -6966,7 +7002,7 @@ var ra, X = class extends C {
6966
7002
  }
6967
7003
  process(e) {}
6968
7004
  };
6969
- O([_({ fallback: !0 }), D("design:type", Object)], X.prototype, "enabled", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], X.prototype, "content", void 0), O([_({ alias: "_parent.style.json" }), D("design:type", Object)], X.prototype, "style", void 0), O([_(), D("design:type", Object)], X.prototype, "effects", void 0), O([_(), D("design:type", Object)], X.prototype, "fill", void 0), O([_(), D("design:type", Object)], X.prototype, "outline", void 0), O([_({ alias: "base.measureDom" }), D("design:type", typeof (ra = typeof HTMLElement < "u" && HTMLElement) == "function" ? ra : Object)], X.prototype, "measureDom", void 0), O([_({ alias: "base.fonts" }), D("design:type", Object)], X.prototype, "fonts", void 0), O([_({ fallback: "auto" }), D("design:type", Object)], X.prototype, "drawMode", void 0);
7005
+ O([_({ fallback: !0 }), D("design:type", Object)], X.prototype, "enabled", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], X.prototype, "content", void 0), O([_({ alias: "_parent.style.json" }), D("design:type", Object)], X.prototype, "style", void 0), O([_(), D("design:type", Object)], X.prototype, "effects", void 0), O([_(), D("design:type", Object)], X.prototype, "fill", void 0), O([_(), D("design:type", Object)], X.prototype, "outline", void 0), O([_({ alias: "base.measureDom" }), D("design:type", typeof (ia = typeof HTMLElement < "u" && HTMLElement) == "function" ? ia : Object)], X.prototype, "measureDom", void 0), O([_({ alias: "base.fonts" }), D("design:type", Object)], X.prototype, "fonts", void 0), O([_({ fallback: "auto" }), D("design:type", Object)], X.prototype, "drawMode", void 0);
6970
7006
  //#endregion
6971
7007
  //#region src/scene/2d/element/Flexbox.ts
6972
7008
  var Z = {
@@ -6979,7 +7015,7 @@ var Z = {
6979
7015
  horizontal: 6,
6980
7016
  vertical: 7,
6981
7017
  all: 8
6982
- }, ia = {
7018
+ }, aa = {
6983
7019
  column: 0,
6984
7020
  row: 1,
6985
7021
  all: 2
@@ -6993,42 +7029,42 @@ var Z = {
6993
7029
  "space-between": 6,
6994
7030
  "space-around": 7,
6995
7031
  "space-evenly": 8
6996
- }, aa = {
7032
+ }, oa = {
6997
7033
  flex: 0,
6998
7034
  none: 1,
6999
7035
  contents: 2
7000
- }, oa = {
7036
+ }, sa = {
7001
7037
  inherit: 0,
7002
7038
  ltr: 1,
7003
7039
  rtl: 2
7004
- }, sa = {
7040
+ }, ca = {
7005
7041
  column: 0,
7006
7042
  "column-reverse": 1,
7007
7043
  row: 2,
7008
7044
  "row-reverse": 3
7009
- }, ca = {
7045
+ }, la = {
7010
7046
  "no-wrap": 0,
7011
7047
  wrap: 1,
7012
7048
  "Wrap-reverse": 2
7013
- }, la = {
7049
+ }, ua = {
7014
7050
  "flex-start": 0,
7015
7051
  center: 1,
7016
7052
  "flex-end": 2,
7017
7053
  "space-between": 3,
7018
7054
  "space-around": 4,
7019
7055
  "space-evenly": 5
7020
- }, ua = {
7056
+ }, da = {
7021
7057
  visible: 0,
7022
7058
  hidden: 1,
7023
7059
  scroll: 2
7024
- }, da = {
7060
+ }, fa = {
7025
7061
  static: 0,
7026
7062
  relative: 1,
7027
7063
  absolute: 2
7028
- }, fa = {
7064
+ }, pa = {
7029
7065
  "border-box": 0,
7030
7066
  "content-box": 1
7031
- }, pa = class e {
7067
+ }, ma = class e {
7032
7068
  _parent;
7033
7069
  static _yoga;
7034
7070
  static async load() {
@@ -7040,14 +7076,14 @@ var Z = {
7040
7076
  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);
7041
7077
  }
7042
7078
  _addChild(e, t) {
7043
- if (e instanceof ya && e.flexbox.node && this.node) {
7079
+ if (e instanceof ba && e.flexbox.node && this.node) {
7044
7080
  this.node.insertChild(e.flexbox.node, t);
7045
7081
  let n = e.style.getProperties();
7046
7082
  for (let t in n) e.flexbox.updateStyleProperty(t, n[t]);
7047
7083
  }
7048
7084
  }
7049
7085
  _removeChild(e, t) {
7050
- e instanceof ya && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
7086
+ e instanceof ba && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
7051
7087
  }
7052
7088
  updateStyleProperty(e, t) {
7053
7089
  let n = this.node;
@@ -7081,10 +7117,10 @@ var Z = {
7081
7117
  n.setBorder(Z.all, this._parent.style.borderWidth);
7082
7118
  break;
7083
7119
  case "direction":
7084
- n.setDirection(t ? oa[t] ?? oa.inherit : oa.inherit);
7120
+ n.setDirection(t ? sa[t] ?? sa.inherit : sa.inherit);
7085
7121
  break;
7086
7122
  case "display":
7087
- n.setDisplay(t ? aa[t] ?? aa.flex : aa.flex);
7123
+ n.setDisplay(t ? oa[t] ?? oa.flex : oa.flex);
7088
7124
  break;
7089
7125
  case "flex":
7090
7126
  n.setFlex(t);
@@ -7093,7 +7129,7 @@ var Z = {
7093
7129
  n.setFlexBasis(t);
7094
7130
  break;
7095
7131
  case "flexDirection":
7096
- n.setFlexDirection(t ? sa[t] ?? sa.row : sa.row);
7132
+ n.setFlexDirection(t ? ca[t] ?? ca.row : ca.row);
7097
7133
  break;
7098
7134
  case "flexGrow":
7099
7135
  n.setFlexGrow(t);
@@ -7102,16 +7138,16 @@ var Z = {
7102
7138
  n.setFlexShrink(t);
7103
7139
  break;
7104
7140
  case "flexWrap":
7105
- n.setFlexWrap(t ? ca[t] ?? ca.wrap : ca.wrap);
7141
+ n.setFlexWrap(t ? la[t] ?? la.wrap : la.wrap);
7106
7142
  break;
7107
7143
  case "height":
7108
7144
  n.setHeight(t);
7109
7145
  break;
7110
7146
  case "justifyContent":
7111
- n.setJustifyContent(t ? la[t] ?? la["flex-start"] : la["flex-start"]);
7147
+ n.setJustifyContent(t ? ua[t] ?? ua["flex-start"] : ua["flex-start"]);
7112
7148
  break;
7113
7149
  case "gap":
7114
- t !== void 0 && n.setGap(ia.all, t);
7150
+ t !== void 0 && n.setGap(aa.all, t);
7115
7151
  break;
7116
7152
  case "marginTop":
7117
7153
  n.setMargin(Z.top, t);
@@ -7141,7 +7177,7 @@ var Z = {
7141
7177
  n.setMinWidth(t);
7142
7178
  break;
7143
7179
  case "overflow":
7144
- n.setOverflow(t ? ua[t] ?? ua.visible : ua.visible);
7180
+ n.setOverflow(t ? da[t] ?? da.visible : da.visible);
7145
7181
  break;
7146
7182
  case "paddingTop":
7147
7183
  n.setPadding(Z.top, t);
@@ -7171,10 +7207,10 @@ var Z = {
7171
7207
  n.setPosition(Z.right, t);
7172
7208
  break;
7173
7209
  case "position":
7174
- n.setPositionType(t ? da[t] ?? da.relative : da.relative);
7210
+ n.setPositionType(t ? fa[t] ?? fa.relative : fa.relative);
7175
7211
  break;
7176
7212
  case "boxSizing":
7177
- n.setBoxSizing(t ? fa[t] ?? fa["content-box"] : fa["content-box"]);
7213
+ n.setBoxSizing(t ? pa[t] ?? pa["content-box"] : pa["content-box"]);
7178
7214
  break;
7179
7215
  case "width":
7180
7216
  n.setWidth(t);
@@ -7185,7 +7221,7 @@ var Z = {
7185
7221
  }
7186
7222
  update() {
7187
7223
  let e = this._parent, t = this.node;
7188
- if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, oa.ltr), t.hasNewLayout())) {
7224
+ if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, sa.ltr), t.hasNewLayout())) {
7189
7225
  let { left: n, top: r, width: i, height: a } = t.getComputedLayout();
7190
7226
  (!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();
7191
7227
  }
@@ -7193,13 +7229,13 @@ var Z = {
7193
7229
  destroy() {
7194
7230
  this.node?.free(), this.node = void 0;
7195
7231
  }
7196
- }, ma, ha = new Set(Object.keys(a())), ga = new Set(Object.keys(s())), _a = new y(), va = [
7232
+ }, ha, ga = new Set(Object.keys(a())), _a = new Set(Object.keys(s())), va = new y(), ya = [
7197
7233
  [0, 0],
7198
7234
  [1, 0],
7199
7235
  [1, 1],
7200
7236
  [0, 1]
7201
- ], ya = class extends Pr {
7202
- flexbox = new pa(this);
7237
+ ], ba = class extends Pr {
7238
+ flexbox = new ma(this);
7203
7239
  aabb = new mt();
7204
7240
  globalAabb = new mt();
7205
7241
  _parentGlobalDisplay;
@@ -7212,7 +7248,7 @@ var Z = {
7212
7248
  });
7213
7249
  _allowPointerEvents = !0;
7214
7250
  _overflowHidden = !1;
7215
- _style = new Qi().on("updateProperty", (...e) => {
7251
+ _style = new $i().on("updateProperty", (...e) => {
7216
7252
  this.onUpdateStyleProperty(e[0], e[1], e[2]);
7217
7253
  });
7218
7254
  get style() {
@@ -7226,14 +7262,14 @@ var Z = {
7226
7262
  this._endBatch();
7227
7263
  }
7228
7264
  }
7229
- _background = new Hi(this);
7265
+ _background = new Ui(this);
7230
7266
  get background() {
7231
7267
  return this._background;
7232
7268
  }
7233
7269
  set background(e) {
7234
7270
  this._background.resetProperties().setProperties(e);
7235
7271
  }
7236
- _shape = new Zi(this);
7272
+ _shape = new Qi(this);
7237
7273
  get shape() {
7238
7274
  return this._shape;
7239
7275
  }
@@ -7247,14 +7283,14 @@ var Z = {
7247
7283
  set fill(e) {
7248
7284
  this._fill.resetProperties().setProperties(e);
7249
7285
  }
7250
- _outline = new Yi(this);
7286
+ _outline = new Xi(this);
7251
7287
  get outline() {
7252
7288
  return this._outline;
7253
7289
  }
7254
7290
  set outline(e) {
7255
7291
  this._outline.resetProperties().setProperties(e);
7256
7292
  }
7257
- _foreground = new Ji(this);
7293
+ _foreground = new Yi(this);
7258
7294
  get foreground() {
7259
7295
  return this._foreground;
7260
7296
  }
@@ -7268,21 +7304,21 @@ var Z = {
7268
7304
  set text(e) {
7269
7305
  this._text.resetProperties().setProperties(e);
7270
7306
  }
7271
- _shadow = new Xi(this);
7307
+ _shadow = new Zi(this);
7272
7308
  get shadow() {
7273
7309
  return this._shadow;
7274
7310
  }
7275
7311
  set shadow(e) {
7276
7312
  this._shadow.resetProperties().setProperties(e);
7277
7313
  }
7278
- _connection = new Ki(this);
7314
+ _connection = new qi(this);
7279
7315
  get connection() {
7280
7316
  return this._connection;
7281
7317
  }
7282
7318
  set connection(e) {
7283
7319
  this._connection.resetProperties().setProperties(e);
7284
7320
  }
7285
- _table = new na(this);
7321
+ _table = new ra(this);
7286
7322
  get table() {
7287
7323
  return this._table;
7288
7324
  }
@@ -7395,7 +7431,7 @@ var Z = {
7395
7431
  }), this.extraTransform.translate(this.pivot.x, this.pivot.y), this.updateGlobalTransform();
7396
7432
  break;
7397
7433
  case "transformOrigin": {
7398
- let e = Wr(t ?? "");
7434
+ let e = Gr(t ?? "");
7399
7435
  this.pivot.set(e[0] * this.size.width, e[1] * this.size.height);
7400
7436
  break;
7401
7437
  }
@@ -7439,7 +7475,7 @@ var Z = {
7439
7475
  this.requestDraw();
7440
7476
  break;
7441
7477
  }
7442
- if ((ga.has(e) || ha.has(e)) && this.text.isValid() && (this._batchDepth > 0 ? this._pendingTextUpdate = !0 : this.text.update()), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
7478
+ if ((_a.has(e) || ga.has(e)) && this.text.isValid() && (this._batchDepth > 0 ? this._pendingTextUpdate = !0 : this.text.update()), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
7443
7479
  else switch (e) {
7444
7480
  case "left":
7445
7481
  this.position.x = Number(t);
@@ -7479,21 +7515,21 @@ var Z = {
7479
7515
  }
7480
7516
  _intersectsViewport(e) {
7481
7517
  let t = e.canvasTransform, n = e.width, r = e.height, i = Infinity, a = -Infinity, o = Infinity, s = -Infinity;
7482
- for (let [e, c] of va) t.applyAffineInverse({
7518
+ for (let [e, c] of ya) t.applyAffineInverse({
7483
7519
  x: e * n,
7484
7520
  y: c * r
7485
- }, _a), i = Math.min(i, _a.x), a = Math.max(a, _a.x), o = Math.min(o, _a.y), s = Math.max(s, _a.y);
7521
+ }, va), i = Math.min(i, va.x), a = Math.max(a, va.x), o = Math.min(o, va.y), s = Math.max(s, va.y);
7486
7522
  let c = a - i, l = s - o, { min: u, size: d } = this.globalAabb;
7487
7523
  return !(u.x > a + c || u.x + d.x < i - c || u.y > s + l || u.y + d.y < o - l);
7488
7524
  }
7489
7525
  _updateStyleFilter(e) {
7490
- d(e) ? (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender()) : (this._colorFilterEffect || (this._colorFilterEffect = new Yr({
7526
+ d(e) ? (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender()) : (this._colorFilterEffect || (this._colorFilterEffect = new Xr({
7491
7527
  name: "styleFilter",
7492
7528
  internalMode: "front"
7493
7529
  }), this.append(this._colorFilterEffect)), this._colorFilterEffect.filter = e);
7494
7530
  }
7495
7531
  _updateStyleMaskImage(e) {
7496
- d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new ji({
7532
+ d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new Mi({
7497
7533
  name: "styleMaskImage",
7498
7534
  internalMode: "back"
7499
7535
  }), this.append(this._maskEffect)), this._maskEffect.image = e);
@@ -7582,10 +7618,10 @@ var Z = {
7582
7618
  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._colorFilterEffect = void 0, this._maskEffect = void 0;
7583
7619
  }
7584
7620
  };
7585
- ya = O([x("Element2D"), D("design:paramtypes", [typeof (ma = typeof Partial < "u" && Partial) == "function" ? ma : Object, Array])], ya);
7621
+ ba = O([x("Element2D"), D("design:paramtypes", [typeof (ha = typeof Partial < "u" && Partial) == "function" ? ha : Object, Array])], ba);
7586
7622
  //#endregion
7587
7623
  //#region src/scene/2d/TextureRect2D.ts
7588
- var ba = class extends ya {
7624
+ var xa = class extends ba {
7589
7625
  texture;
7590
7626
  constructor(e, t = []) {
7591
7627
  super(), this.setProperties(e).append(t);
@@ -7599,7 +7635,7 @@ var ba = class extends ya {
7599
7635
  } });
7600
7636
  }
7601
7637
  }
7602
- }, xa, Sa = class extends ba {
7638
+ }, Sa, Ca = class extends xa {
7603
7639
  texture = new rr();
7604
7640
  animation;
7605
7641
  _lastTime = NaN;
@@ -7630,10 +7666,10 @@ var ba = class extends ya {
7630
7666
  this.currentTime !== this._lastTime && (this._lastTime = this.currentTime, this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw()), super._process(e);
7631
7667
  }
7632
7668
  };
7633
- O([_({ fallback: "" }), D("design:type", String)], Sa.prototype, "src", void 0), Sa = O([x("Lottie2D"), D("design:paramtypes", [typeof (xa = typeof Partial < "u" && Partial) == "function" ? xa : Object, Array])], Sa);
7669
+ O([_({ fallback: "" }), D("design:type", String)], Ca.prototype, "src", void 0), Ca = O([x("Lottie2D"), D("design:paramtypes", [typeof (Sa = typeof Partial < "u" && Partial) == "function" ? Sa : Object, Array])], Ca);
7634
7670
  //#endregion
7635
7671
  //#region src/scene/2d/TransformRect2D.ts
7636
- var Ca = class extends ya {
7672
+ var wa = class extends ba {
7637
7673
  constructor(e, t = []) {
7638
7674
  super(), this.setProperties(e).append(t);
7639
7675
  }
@@ -7656,10 +7692,10 @@ var Ca = class extends ya {
7656
7692
  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);
7657
7693
  }
7658
7694
  };
7659
- O([_({ fallback: 6 }), D("design:type", Number)], Ca.prototype, "handleSize", void 0);
7695
+ O([_({ fallback: 6 }), D("design:type", Number)], wa.prototype, "handleSize", void 0);
7660
7696
  //#endregion
7661
7697
  //#region src/scene/2d/Video2D.ts
7662
- var wa, Ta = class extends ba {
7698
+ var Ta, Ea = class extends xa {
7663
7699
  get videoDuration() {
7664
7700
  return (this.texture?.duration ?? 0) * 1e3;
7665
7701
  }
@@ -7699,11 +7735,11 @@ var wa, Ta = class extends ba {
7699
7735
  super._process(e), this._updateVideoCurrentTime();
7700
7736
  }
7701
7737
  };
7702
- O([_({ fallback: "" }), D("design:type", String)], Ta.prototype, "src", void 0), Ta = O([x("Video2D"), D("design:paramtypes", [typeof (wa = typeof Partial < "u" && Partial) == "function" ? wa : Object, Array])], Ta);
7738
+ O([_({ fallback: "" }), D("design:type", String)], Ea.prototype, "src", void 0), Ea = O([x("Video2D"), D("design:paramtypes", [typeof (Ta = typeof Partial < "u" && Partial) == "function" ? Ta : Object, Array])], Ea);
7703
7739
  //#endregion
7704
7740
  //#region src/scene/animation/Animation.ts
7705
- var Ea, Da = (e) => e, Oa = Ma(.25, .1, .25, 1), ka = Ma(.42, 0, 1, 1), Aa = Ma(0, 0, .58, 1), ja = Ma(.42, 0, .58, 1);
7706
- function Ma(e, t, n, r) {
7741
+ var Da, Oa = (e) => e, ka = Na(.25, .1, .25, 1), Aa = Na(.42, 0, 1, 1), ja = Na(0, 0, .58, 1), Ma = Na(.42, 0, .58, 1);
7742
+ function Na(e, t, n, r) {
7707
7743
  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;
7708
7744
  function m(e) {
7709
7745
  let t = e, n, r;
@@ -7723,13 +7759,13 @@ function Ma(e, t, n, r) {
7723
7759
  }
7724
7760
  return (e) => p(m(e));
7725
7761
  }
7726
- var Na = {
7727
- linear: Da,
7728
- ease: Oa,
7729
- easeIn: ka,
7730
- easeOut: Aa,
7731
- easeInOut: ja
7732
- }, Pa = class extends B {
7762
+ var Pa = {
7763
+ linear: Oa,
7764
+ ease: ka,
7765
+ easeIn: Aa,
7766
+ easeOut: ja,
7767
+ easeInOut: Ma
7768
+ }, Fa = class extends B {
7733
7769
  _keyframes = [];
7734
7770
  _isFirstUpdatePosition = !1;
7735
7771
  _cachedProps = new t();
@@ -7764,7 +7800,7 @@ var Na = {
7764
7800
  e = [this.getParent()].filter(Boolean);
7765
7801
  break;
7766
7802
  }
7767
- return e.filter((e) => e instanceof ya);
7803
+ return e.filter((e) => e instanceof ba);
7768
7804
  }
7769
7805
  _updateKeyframes() {
7770
7806
  let e = [], t = this.keyframes;
@@ -7812,10 +7848,10 @@ var Na = {
7812
7848
  });
7813
7849
  }
7814
7850
  _parseEasing(e) {
7815
- if (!e) return Na.linear;
7816
- if (e in Na) return Na[e];
7851
+ if (!e) return Pa.linear;
7852
+ if (e in Pa) return Pa[e];
7817
7853
  let t = e.replace(/cubic-bezier\((.+)\)/, "$1").split(",").map((e) => Number(e));
7818
- return Ma(t[0], t[1], t[2], t[3]);
7854
+ return Na(t[0], t[1], t[2], t[3]);
7819
7855
  }
7820
7856
  _parseKeyframes(e, t) {
7821
7857
  let n, r = this._keyframes;
@@ -7893,14 +7929,14 @@ var Na = {
7893
7929
  });
7894
7930
  }
7895
7931
  };
7896
- O([_({ fallback: "parent" }), D("design:type", Object)], Pa.prototype, "effectMode", void 0), O([_({ default: () => [] }), D("design:type", Array)], Pa.prototype, "keyframes", void 0), O([_(), D("design:type", Object)], Pa.prototype, "easing", void 0), Pa = O([x("Animation", {
7932
+ O([_({ fallback: "parent" }), D("design:type", Object)], Fa.prototype, "effectMode", void 0), O([_({ default: () => [] }), D("design:type", Array)], Fa.prototype, "keyframes", void 0), O([_(), D("design:type", Object)], Fa.prototype, "easing", void 0), Fa = O([x("Animation", {
7897
7933
  renderMode: "disabled",
7898
7934
  processSortMode: "parent-before",
7899
7935
  duration: 2e3
7900
- }), D("design:paramtypes", [typeof (Ea = typeof Partial < "u" && Partial) == "function" ? Ea : Object, Array])], Pa);
7936
+ }), D("design:paramtypes", [typeof (Da = typeof Partial < "u" && Partial) == "function" ? Da : Object, Array])], Fa);
7901
7937
  //#endregion
7902
7938
  //#region src/scene/audio/html/HTMLAudioContext.ts
7903
- var Fa = class t extends e {
7939
+ var Ia = class t extends e {
7904
7940
  static _instance;
7905
7941
  static get instance() {
7906
7942
  return this._instance ||= new t(), this._instance;
@@ -7930,7 +7966,7 @@ var Fa = class t extends e {
7930
7966
  togglePause() {
7931
7967
  return this.paused = !this.paused, this.refreshPaused(), this.paused;
7932
7968
  }
7933
- }, Ia = class t extends e {
7969
+ }, La = class t extends e {
7934
7970
  static PADDING = .1;
7935
7971
  _source = null;
7936
7972
  _audio = null;
@@ -8057,7 +8093,7 @@ var Fa = class t extends e {
8057
8093
  let e = this._source;
8058
8094
  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);
8059
8095
  }
8060
- }, La = class {
8096
+ }, Ra = class {
8061
8097
  parent;
8062
8098
  source = new globalThis.Audio();
8063
8099
  _src = "";
@@ -8074,7 +8110,7 @@ var Fa = class t extends e {
8074
8110
  return !!this.source && this.source.readyState === 4;
8075
8111
  }
8076
8112
  get context() {
8077
- return Fa.instance;
8113
+ return Ia.instance;
8078
8114
  }
8079
8115
  constructor(e) {
8080
8116
  this.parent = e;
@@ -8085,9 +8121,9 @@ var Fa = class t extends e {
8085
8121
  });
8086
8122
  }
8087
8123
  createSound() {
8088
- return new Ia();
8124
+ return new La();
8089
8125
  }
8090
- }, Ra = class extends e {
8126
+ }, za = class extends e {
8091
8127
  _input;
8092
8128
  _output;
8093
8129
  _processers = [];
@@ -8109,7 +8145,7 @@ var Fa = class t extends e {
8109
8145
  get destination() {
8110
8146
  return this._input;
8111
8147
  }
8112
- }, za = class {
8148
+ }, Ba = class {
8113
8149
  destination;
8114
8150
  source;
8115
8151
  constructor(e, t = null) {
@@ -8124,21 +8160,21 @@ var Fa = class t extends e {
8124
8160
  };
8125
8161
  //#endregion
8126
8162
  //#region src/scene/audio/web/WebAudioContext.ts
8127
- function Ba() {
8163
+ function Va() {
8128
8164
  if (ze) return new AudioContext();
8129
8165
  if (Be) {
8130
8166
  let e = globalThis.webkitAudioContext;
8131
8167
  return new e();
8132
8168
  } else throw Error("Failed to createAudioContext");
8133
8169
  }
8134
- function Va(e, t, n) {
8170
+ function Ha(e, t, n) {
8135
8171
  if (Ve) return new OfflineAudioContext(e, t, n);
8136
8172
  if (He) {
8137
8173
  let r = globalThis.webkitOfflineAudioContext;
8138
8174
  return new r(e, t, n);
8139
8175
  } else throw Error("Failed to createOfflineAudioContext");
8140
8176
  }
8141
- var Ha = class e extends Ra {
8177
+ var Ua = class e extends za {
8142
8178
  static _instance;
8143
8179
  static get instance() {
8144
8180
  return this._instance ||= new e(), this._instance;
@@ -8179,7 +8215,7 @@ var Ha = class e extends Ra {
8179
8215
  _compressor;
8180
8216
  _analyser;
8181
8217
  constructor() {
8182
- let e = Ba(), t = Va(1, 2, Ve ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
8218
+ let e = Va(), t = Ha(1, 2, Ve ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
8183
8219
  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" && (Ie || Le), We && (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));
8184
8220
  }
8185
8221
  _onFocus() {
@@ -8220,7 +8256,7 @@ var Ha = class e extends Ra {
8220
8256
  setParamValue(e, t) {
8221
8257
  e.setValueAtTime ? e.setValueAtTime(t, this._context.currentTime) : e.value = t;
8222
8258
  }
8223
- }, Ua = class extends e {
8259
+ }, Wa = class extends e {
8224
8260
  _audio = null;
8225
8261
  _sourceNode = null;
8226
8262
  _gain = null;
@@ -8353,7 +8389,7 @@ var Ha = class e extends Ra {
8353
8389
  destroy() {
8354
8390
  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;
8355
8391
  }
8356
- }, Wa = class extends Ra {
8392
+ }, Ga = class extends za {
8357
8393
  parent;
8358
8394
  _sourceBuffer;
8359
8395
  _sourceNode;
@@ -8361,7 +8397,7 @@ var Ha = class e extends Ra {
8361
8397
  gain;
8362
8398
  analyser;
8363
8399
  get context() {
8364
- return Ha.instance;
8400
+ return Ua.instance;
8365
8401
  }
8366
8402
  get isPlayable() {
8367
8403
  return !!this._sourceNode.buffer;
@@ -8376,8 +8412,8 @@ var Ha = class e extends Ra {
8376
8412
  this._sourceNode.buffer = e;
8377
8413
  }
8378
8414
  constructor(e) {
8379
- let t = Ha.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
8380
- n.connect(i), i.connect(r), r.connect(Ha.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
8415
+ let t = Ua.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
8416
+ n.connect(i), i.connect(r), r.connect(Ua.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
8381
8417
  }
8382
8418
  async load() {
8383
8419
  return this._sourceLoad ||= new Promise((e) => {
@@ -8390,7 +8426,7 @@ var Ha = class e extends Ra {
8390
8426
  });
8391
8427
  }
8392
8428
  _decode(e) {
8393
- return Promise.resolve(e instanceof AudioBuffer ? e : Ha.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
8429
+ return Promise.resolve(e instanceof AudioBuffer ? e : Ua.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
8394
8430
  }
8395
8431
  cloneSource() {
8396
8432
  let e = this.context, t = this._sourceNode, n = e.audioContext.createBufferSource(), r = e.audioContext.createGain();
@@ -8400,15 +8436,15 @@ var Ha = class e extends Ra {
8400
8436
  };
8401
8437
  }
8402
8438
  createSound() {
8403
- return new Ua();
8439
+ return new Wa();
8404
8440
  }
8405
- }, Ga, Ka = class extends B {
8441
+ }, Ka, qa = class extends B {
8406
8442
  static {
8407
- Ga = this;
8443
+ Ka = this;
8408
8444
  }
8409
8445
  static _soundPool = [];
8410
8446
  _sounds = [];
8411
- _platformAudio = Ue ? new Wa(this) : new La(this);
8447
+ _platformAudio = Ue ? new Ga(this) : new Ra(this);
8412
8448
  get platformAudio() {
8413
8449
  return this._platformAudio;
8414
8450
  }
@@ -8501,7 +8537,7 @@ var Ha = class e extends Ra {
8501
8537
  this._sounds.length = 0;
8502
8538
  }
8503
8539
  _createSound() {
8504
- return Ga._soundPool.length > 0 ? Ga._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
8540
+ return Ka._soundPool.length > 0 ? Ka._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
8505
8541
  }
8506
8542
  refresh() {
8507
8543
  for (let e = this._sounds.length, t = 0; t < e; t++) this._sounds[t].refresh();
@@ -8517,7 +8553,7 @@ var Ha = class e extends Ra {
8517
8553
  this._recycleSound(e);
8518
8554
  };
8519
8555
  _recycleSound(e) {
8520
- e.destroy(), Ga._soundPool.includes(e) || Ga._soundPool.push(e);
8556
+ e.destroy(), Ka._soundPool.includes(e) || Ka._soundPool.push(e);
8521
8557
  }
8522
8558
  _prevTime = 0;
8523
8559
  _timer = 0;
@@ -8533,10 +8569,10 @@ var Ha = class e extends Ra {
8533
8569
  }, 100);
8534
8570
  }
8535
8571
  };
8536
- Ka = Ga = O([x("Audio"), D("design:paramtypes", [Object])], Ka);
8572
+ qa = Ka = O([x("Audio"), D("design:paramtypes", [Object])], qa);
8537
8573
  //#endregion
8538
8574
  //#region src/scene/audio/AudioSpectrum.ts
8539
- var qa = class extends Pr {}, Ja, Ya = class extends ya {
8575
+ var Ja = class extends Pr {}, Ya, Xa = class extends ba {
8540
8576
  _audioBuffer;
8541
8577
  _src = (() => {
8542
8578
  let e = tt();
@@ -8560,7 +8596,7 @@ var qa = class extends Pr {}, Ja, Ya = class extends ya {
8560
8596
  }
8561
8597
  }
8562
8598
  async _loadSrc(e) {
8563
- await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => Ha.decode(e)).then((e) => {
8599
+ await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => Ua.decode(e)).then((e) => {
8564
8600
  this._audioBuffer = e, this.syncTexture(!0);
8565
8601
  });
8566
8602
  }
@@ -8595,12 +8631,12 @@ var qa = class extends Pr {}, Ja, Ya = class extends ya {
8595
8631
  this.syncTexture(), super._process(e);
8596
8632
  }
8597
8633
  };
8598
- O([_(), D("design:type", Object)], Ya.prototype, "src", void 0), O([_({ fallback: 0 }), D("design:type", Number)], Ya.prototype, "gap", void 0), O([_({ fallback: "#000000" }), D("design:type", String)], Ya.prototype, "color", void 0), Ya = O([x("AudioWaveform"), D("design:paramtypes", [typeof (Ja = typeof Partial < "u" && Partial) == "function" ? Ja : Object])], Ya);
8634
+ O([_(), D("design:type", Object)], Xa.prototype, "src", void 0), O([_({ fallback: 0 }), D("design:type", Number)], Xa.prototype, "gap", void 0), O([_({ fallback: "#000000" }), D("design:type", String)], Xa.prototype, "color", void 0), Xa = O([x("AudioWaveform"), D("design:paramtypes", [typeof (Ya = typeof Partial < "u" && Partial) == "function" ? Ya : Object])], Xa);
8599
8635
  //#endregion
8600
8636
  //#region src/scene/transitions/KawaseTransition.ts
8601
- var Xa, Za = class extends Mr {
8637
+ var Za, Qa = class extends Mr {
8602
8638
  static {
8603
- Xa = this;
8639
+ Za = this;
8604
8640
  }
8605
8641
  blur = 10;
8606
8642
  quality = 10;
@@ -8619,7 +8655,7 @@ var Xa, Za = class extends Mr {
8619
8655
  let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
8620
8656
  for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
8621
8657
  m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
8622
- I.draw(e, Xa.material, {
8658
+ I.draw(e, Za.material, {
8623
8659
  sampler: r,
8624
8660
  progress: i,
8625
8661
  ...t
@@ -8627,31 +8663,31 @@ var Xa, Za = class extends Mr {
8627
8663
  });
8628
8664
  }
8629
8665
  };
8630
- Za = Xa = O([x("KawaseTransition")], Za);
8666
+ Qa = Za = O([x("KawaseTransition")], Qa);
8631
8667
  //#endregion
8632
8668
  //#region src/scene/transitions/LeftEraseTransition.ts
8633
- var Qa, $a = class extends Mr {
8669
+ var $a, eo = class extends Mr {
8634
8670
  static {
8635
- Qa = this;
8671
+ $a = this;
8636
8672
  }
8637
8673
  static material = new F({ gl: {
8638
8674
  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}",
8639
8675
  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}"
8640
8676
  } });
8641
8677
  apply(e) {
8642
- I.draw(e, Qa.material, {
8678
+ I.draw(e, $a.material, {
8643
8679
  previous: 0,
8644
8680
  next: 1,
8645
8681
  progress: this.currentTimeProgress
8646
8682
  });
8647
8683
  }
8648
8684
  };
8649
- $a = Qa = O([x("LeftEraseTransition")], $a);
8685
+ eo = $a = O([x("LeftEraseTransition")], eo);
8650
8686
  //#endregion
8651
8687
  //#region src/scene/transitions/TiltShiftTransition.ts
8652
- var eo, to = class extends Mr {
8688
+ var to, no = class extends Mr {
8653
8689
  static {
8654
- eo = this;
8690
+ to = this;
8655
8691
  }
8656
8692
  blur = 100;
8657
8693
  gradientBlur = 600;
@@ -8663,7 +8699,7 @@ var eo, to = class extends Mr {
8663
8699
  let n = this.currentTimeProgress, r, i;
8664
8700
  n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
8665
8701
  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);
8666
- I.draw(e, eo.material, {
8702
+ I.draw(e, to.material, {
8667
8703
  sampler: r,
8668
8704
  progress: i,
8669
8705
  blur: this.blur,
@@ -8672,7 +8708,7 @@ var eo, to = class extends Mr {
8672
8708
  end: c,
8673
8709
  delta: [u / f, d / f],
8674
8710
  texSize: l
8675
- }), I.draw(e, eo.material, {
8711
+ }), I.draw(e, to.material, {
8676
8712
  sampler: r,
8677
8713
  progress: i,
8678
8714
  blur: this.blur,
@@ -8684,12 +8720,12 @@ var eo, to = class extends Mr {
8684
8720
  });
8685
8721
  }
8686
8722
  };
8687
- to = eo = O([x("TiltShiftTransition")], to);
8723
+ no = to = O([x("TiltShiftTransition")], no);
8688
8724
  //#endregion
8689
8725
  //#region src/scene/transitions/TwistTransition.ts
8690
- var no, ro = class extends Mr {
8726
+ var ro, io = class extends Mr {
8691
8727
  static {
8692
- no = this;
8728
+ ro = this;
8693
8729
  }
8694
8730
  radius;
8695
8731
  angle = 4;
@@ -8703,7 +8739,7 @@ var no, ro = class extends Mr {
8703
8739
  let n = this.currentTimeProgress, r, i;
8704
8740
  n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
8705
8741
  let a = t.width, o = t.height;
8706
- I.draw(e, no.material, {
8742
+ I.draw(e, ro.material, {
8707
8743
  sampler: r,
8708
8744
  progress: i,
8709
8745
  filterArea: [
@@ -8719,10 +8755,10 @@ var no, ro = class extends Mr {
8719
8755
  });
8720
8756
  }
8721
8757
  };
8722
- ro = no = O([x("TwistTransition")], ro);
8758
+ io = ro = O([x("TwistTransition")], io);
8723
8759
  //#endregion
8724
8760
  //#region src/asset/loaders/GifLoader.ts
8725
- var io = class extends Rn {
8761
+ var ao = class extends Rn {
8726
8762
  install(e) {
8727
8763
  let t = async (t) => {
8728
8764
  let { decodeFrames: n } = await import("modern-gif");
@@ -8739,14 +8775,14 @@ var io = class extends Rn {
8739
8775
  e.register(n, t);
8740
8776
  }), e.gif = this, this;
8741
8777
  }
8742
- }, ao = class extends Rn {
8778
+ }, oo = class extends Rn {
8743
8779
  install(e) {
8744
8780
  let t = async (e) => JSON.parse(await e.text());
8745
8781
  return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
8746
8782
  e.register(n, t);
8747
8783
  }), e.json = this, this;
8748
8784
  }
8749
- }, oo = class extends Rn {
8785
+ }, so = class extends Rn {
8750
8786
  install(e) {
8751
8787
  return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
8752
8788
  container: null,
@@ -8757,12 +8793,12 @@ var io = class extends Rn {
8757
8793
  animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
8758
8794
  }), e.lottie = this, this;
8759
8795
  }
8760
- }, so = class extends Rn {
8796
+ }, co = class extends Rn {
8761
8797
  install(e) {
8762
8798
  let t = async (e) => e.text();
8763
8799
  return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
8764
8800
  }
8765
- }, co = class extends Rn {
8801
+ }, lo = class extends Rn {
8766
8802
  install(e) {
8767
8803
  let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new R({
8768
8804
  source: e,
@@ -8786,11 +8822,11 @@ var io = class extends Rn {
8786
8822
  e.register(n, t);
8787
8823
  }), e.texture = this, this;
8788
8824
  }
8789
- }, lo = class extends Rn {
8825
+ }, uo = class extends Rn {
8790
8826
  install(e) {
8791
8827
  return this.load = (t) => e.awaitBy(() => new cr(t).load()), e.video = this, this;
8792
8828
  }
8793
- }, uo = Object.entries({
8829
+ }, fo = Object.entries({
8794
8830
  "font/woff": ["woff"],
8795
8831
  "font/ttf": ["ttf"],
8796
8832
  "font/otf": ["otf"],
@@ -8806,31 +8842,31 @@ var io = class extends Rn {
8806
8842
  "image/webp": ["webp"],
8807
8843
  "application/json": ["json"]
8808
8844
  });
8809
- function fo(e) {
8810
- for (let [t, n] of uo) if (n.includes(e)) return t;
8811
- }
8812
8845
  function po(e) {
8846
+ for (let [t, n] of fo) if (n.includes(e)) return t;
8847
+ }
8848
+ function mo(e) {
8813
8849
  let t;
8814
8850
  if (e.startsWith("data:")) t = e.match(/^data:(.+?);/)?.[1];
8815
8851
  else if (e.startsWith("http")) {
8816
8852
  let n = e.split(/[#?]/)[0].split(".").pop()?.trim();
8817
- n && (t = fo(n));
8853
+ n && (t = po(n));
8818
8854
  }
8819
8855
  return t;
8820
8856
  }
8821
8857
  //#endregion
8822
8858
  //#region src/asset/Assets.ts
8823
- var mo = "WeakRef" in globalThis, ho = class extends e {
8859
+ var ho = "WeakRef" in globalThis, go = class extends e {
8824
8860
  defaultHandler = (e) => e;
8825
8861
  _handlers = /* @__PURE__ */ new Map();
8826
8862
  _handleing = /* @__PURE__ */ new Map();
8827
8863
  _handled = /* @__PURE__ */ new Map();
8828
- _gc = mo ? new FinalizationRegistry((e) => {
8864
+ _gc = ho ? new FinalizationRegistry((e) => {
8829
8865
  let t = this.get(e);
8830
8866
  t && "destroy" in t && t.destroy(), this._handled.delete(e);
8831
8867
  }) : void 0;
8832
8868
  constructor() {
8833
- super(), mo || S.on(this.gc.bind(this), { sort: 2 });
8869
+ super(), ho || S.on(this.gc.bind(this), { sort: 2 });
8834
8870
  }
8835
8871
  use(e) {
8836
8872
  return e.install(this), this;
@@ -8879,11 +8915,11 @@ var mo = "WeakRef" in globalThis, ho = class extends e {
8879
8915
  }
8880
8916
  get(e) {
8881
8917
  let t = this._handled.get(e);
8882
- return mo && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
8918
+ return ho && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
8883
8919
  }
8884
8920
  set(e, t) {
8885
8921
  let n = t;
8886
- mo && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
8922
+ ho && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
8887
8923
  }
8888
8924
  async awaitBy(e) {
8889
8925
  let t = e(), n = c();
@@ -8898,7 +8934,7 @@ var mo = "WeakRef" in globalThis, ho = class extends e {
8898
8934
  return this._handleing.set(e, r), r;
8899
8935
  }
8900
8936
  async load(e, t) {
8901
- let n = await this.loadBy(e), r = po(e);
8937
+ let n = await this.loadBy(e), r = mo(e);
8902
8938
  return r === void 0 && (r = n.type?.split(";")[0] ?? void 0), ((r ? this._handlers.get(r) : void 0) ?? this.defaultHandler)(n, t);
8903
8939
  }
8904
8940
  async waitUntilLoad() {
@@ -8912,14 +8948,14 @@ var mo = "WeakRef" in globalThis, ho = class extends e {
8912
8948
  n && "destroy" in n && n.destroy();
8913
8949
  }), this._handled.clear();
8914
8950
  }
8915
- }, $ = new ho().use(new zn()).use(new io()).use(new ao()).use(new oo()).use(new so()).use(new co()).use(new lo()), go = {
8951
+ }, $ = new go().use(new zn()).use(new ao()).use(new oo()).use(new so()).use(new co()).use(new lo()).use(new uo()), _o = {
8916
8952
  alpha: !0,
8917
8953
  stencil: !0,
8918
8954
  antialias: !1,
8919
8955
  premultipliedAlpha: !0,
8920
8956
  preserveDrawingBuffer: !1,
8921
8957
  powerPreference: "default"
8922
- }, _o = class extends Ar {
8958
+ }, vo = class extends Ar {
8923
8959
  renderer;
8924
8960
  get view() {
8925
8961
  return this.renderer.view;
@@ -8952,12 +8988,12 @@ var mo = "WeakRef" in globalThis, ho = class extends e {
8952
8988
  constructor(e = {}) {
8953
8989
  let { view: t, width: n, height: r, pixelRatio: i = Ke, autoResize: a, data: o } = e;
8954
8990
  super(), this.renderer = new Ln(t, {
8955
- alpha: go.alpha ?? e.alpha,
8956
- stencil: go.stencil ?? e.stencil,
8957
- antialias: go.antialias ?? e.antialias,
8958
- premultipliedAlpha: go.premultipliedAlpha ?? e.premultipliedAlpha,
8959
- preserveDrawingBuffer: go.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
8960
- powerPreference: go.powerPreference ?? e.powerPreference
8991
+ alpha: _o.alpha ?? e.alpha,
8992
+ stencil: _o.stencil ?? e.stencil,
8993
+ antialias: _o.antialias ?? e.antialias,
8994
+ premultipliedAlpha: _o.premultipliedAlpha ?? e.premultipliedAlpha,
8995
+ preserveDrawingBuffer: _o.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
8996
+ powerPreference: _o.powerPreference ?? e.powerPreference
8961
8997
  }), 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);
8962
8998
  }
8963
8999
  _updateProperty(e, t, n) {
@@ -9040,22 +9076,22 @@ var mo = "WeakRef" in globalThis, ho = class extends e {
9040
9076
  super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
9041
9077
  }
9042
9078
  };
9043
- O([_({ fallback: !1 }), D("design:type", Boolean)], _o.prototype, "autoResize", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], _o.prototype, "autoStart", void 0);
9079
+ O([_({ fallback: !1 }), D("design:type", Boolean)], vo.prototype, "autoResize", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], vo.prototype, "autoStart", void 0);
9044
9080
  //#endregion
9045
9081
  //#region src/render.ts
9046
- var vo, yo = [], bo = !1;
9047
- function xo() {
9048
- return vo ??= new _o({
9082
+ var yo, bo = [], xo = !1;
9083
+ function So() {
9084
+ return yo ??= new vo({
9049
9085
  pixelRatio: 1,
9050
9086
  width: 1,
9051
9087
  height: 1,
9052
9088
  preserveDrawingBuffer: !0
9053
9089
  });
9054
9090
  }
9055
- async function So(e = 100) {
9056
- if (!bo) {
9057
- for (bo = !0; yo.length;) {
9058
- let t = yo.shift();
9091
+ async function Co(e = 100) {
9092
+ if (!xo) {
9093
+ for (xo = !0; bo.length;) {
9094
+ let t = bo.shift();
9059
9095
  if (t) try {
9060
9096
  await t();
9061
9097
  } catch (e) {
@@ -9063,11 +9099,11 @@ async function So(e = 100) {
9063
9099
  }
9064
9100
  else await new Promise((t) => setTimeout(t, e));
9065
9101
  }
9066
- bo = !1;
9102
+ xo = !1;
9067
9103
  }
9068
9104
  }
9069
- async function Co(e) {
9070
- 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 = xo();
9105
+ async function wo(e) {
9106
+ 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 = So();
9071
9107
  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) {
9072
9108
  let e = o.length, t = o[e - 1];
9073
9109
  for (let n = 0; n < e; n++) {
@@ -9085,15 +9121,15 @@ async function Co(e) {
9085
9121
  toCanvas2D: () => f.toCanvas2D(new ImageData(p, u, d))
9086
9122
  };
9087
9123
  }
9088
- async function wo(e) {
9124
+ async function To(e) {
9089
9125
  return new Promise((t) => {
9090
- yo.push(async () => t(await Co(e).then((e) => e.toCanvas2D()))), So();
9126
+ bo.push(async () => t(await wo(e).then((e) => e.toCanvas2D()))), Co();
9091
9127
  });
9092
9128
  }
9093
- async function To(e) {
9129
+ async function Eo(e) {
9094
9130
  return new Promise((t) => {
9095
- yo.push(async () => t(await Co(e).then((e) => e.pixels))), So();
9131
+ bo.push(async () => t(await wo(e).then((e) => e.pixels))), Co();
9096
9132
  });
9097
9133
  }
9098
9134
  //#endregion
9099
- export { mt as Aabb2D, nr as AnimatedTexture, Pa as Animation, ho as Assets, Ka as Audio, Ra as AudioPipeline, za as AudioProcessor, qa as AudioSpectrum, Ya as AudioWaveform, k as BufferUsage, Ir as Camera2D, ur as CanvasContext, Cr as CanvasItem, rr as CanvasTexture, T as Color, U as ColorAdjustEffect, Yr as ColorFilterEffect, vt as ColorMatrix, $r as ColorOverlayEffect, ni as ColorRemoveEffect, oi as ColorReplaceEffect, ir as ColorTexture, C as CoreObject, ht as DEG_TO_RAD, Ke as DEVICE_PIXEL_RATIO, W as DrawboardEffect, gi as DropShadowEffect, H as Effect, $n as EffectMaterial, ya as Element2D, Hi as Element2DBackground, Y as Element2DChart, Ki as Element2DConnection, J as Element2DFill, Ji as Element2DForeground, Yi as Element2DOutline, Xi as Element2DShadow, Zi as Element2DShape, Qi as Element2DStyle, na as Element2DTable, X as Element2DText, yi as EmbossEffect, _o as Engine, pa as Flexbox, zn as FontLoader, pi as GaussianBlurEffect, Wn as Geometry, io as GifLoader, on as GlBatch2DSystem, tn as GlBlendMode, Ct as GlBuffer, jt as GlBufferSystem, St as GlBufferTarget, un as GlMaskSystem, Ut as GlProgram, mn as GlRenderTarget, hn as GlRenderTargetSystem, Qt as GlShaderSystem, rn as GlState, an as GlStateSystem, fn as GlStencilSystem, A as GlSystem, pn as GlViewportSystem, G as GlitchEffect, K as GodrayEffect, ar as GradientTexture, La as HTMLAudio, Fa as HTMLAudioContext, Ia as HTMLSound, We as IN_BROWSER, Ge as IN_MAC_OS, Vn as IndexBuffer, ft as Input, ot as InputEvent, ao as JsonLoader, Oi as KawaseBlurEffect, Za as KawaseTransition, st as KeyboardInputEvent, $a as LeftEraseTransition, Rn as Loader, Sa as Lottie2D, oo as LottieLoader, xt as MainLoop, ji as MaskEffect, F as Material, fr as Meta, ct as MouseInputEvent, z as Node, Pr as Node2D, yt as Obb2D, q as OutlineEffect, ye as PI, be as PI_2, Li as PixelateEffect, or as PixelsTexture, lt as PointerInputEvent, bt as Projection2D, qn as QuadGeometry, I as QuadUvGeometry, gt as RAD_TO_DEG, pt as RefCounted, L as RenderTarget, Tt as Renderer, w as Resource, ze as SUPPORTS_AUDIO_CONTEXT, Le as SUPPORTS_CLICK_EVENTS, Re as SUPPORTS_CREATE_IMAGE_BITMAP, je as SUPPORTS_IMAGE_BITMAP, Fe as SUPPORTS_MOUSE_EVENTS, Ve as SUPPORTS_OFFLINE_AUDIO_CONTEXT, Ne as SUPPORTS_POINTER_EVENTS, Me as SUPPORTS_RESIZE_OBSERVER, Ie as SUPPORTS_TOUCH_EVENTS, Ae as SUPPORTS_WEBGL2, Be as SUPPORTS_WEBKIT_AUDIO_CONTEXT, He as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, Ue as SUPPORTS_WEB_AUDIO, Pe as SUPPORTS_WHEEL_EVENTS, Ar as SceneTree, so as TextLoader, R as Texture2D, co as TextureLoader, ba as TextureRect2D, S as Ticker, to as TiltShiftTransition, Or as Timeline, B as TimelineNode, Ca as TransformRect2D, Mr as Transition, ro as TwistTransition, Dt as UniformGroup, tr as UvGeometry, er as UvMaterial, P as VertexAttribute, N as VertexBuffer, Ta as Video2D, lo as VideoLoader, cr as VideoTexture, V as Viewport, lr as ViewportTexture, Wa as WebAudio, Ha as WebAudioContext, Ln as WebGLRenderer, Ua as WebSound, ut as WheelInputEvent, kr as Window, Bi as ZoomBlurEffect, Q as alignMap, $ as assets, Lr as axisDir, fa as boxSizingMap, _t as clamp, Di as clampFrag, tt as createHTMLCanvas, At as createIdFromString, _e as createNode, rt as crossOrigin, Ma as cubicBezier, x as customNode, ge as customNodes, go as defaultOptions, nt as determineCrossOrigin, oa as directionMap, aa as displayMap, Oa as ease, ka as easeIn, ja as easeInOut, Aa as easeOut, Z as edgeMap, sa as flexDirectionMap, ca as flexWrapMap, Ei as frag, et as getCanvasFactory, Te as getDefaultCssPropertyValue, xo as getRenderEngine, ia as gutterMap, at as instanceId, Xe as isCanvasElement, qe as isElementNode, Ye as isImageElement, xe as isPow2, Je as isVideoElement, Ze as isWebgl2, la as justifyMap, E as lerp, Da as linear, cn as log2, nn as mapGlBlendModes, sn as nextPow2, ve as nextTick, ua as overflowMap, Ur as parseCssFilter, De as parseCssFunctions, Ee as parseCssProperty, Wr as parseCssTransformOrigin, da as positionTypeMap, wo as render, To as renderPixels, xr as resetBatchPool, Rr as routeConnection, $e as setCanvasFactory, dn as stencilModeMap, Na as timingFunctions };
9135
+ export { mt as Aabb2D, nr as AnimatedTexture, Fa as Animation, go as Assets, qa as Audio, za as AudioPipeline, Ba as AudioProcessor, Ja as AudioSpectrum, Xa as AudioWaveform, k as BufferUsage, Ir as Camera2D, ur as CanvasContext, Cr as CanvasItem, rr as CanvasTexture, T as Color, U as ColorAdjustEffect, Xr as ColorFilterEffect, vt as ColorMatrix, ei as ColorOverlayEffect, ri as ColorRemoveEffect, si as ColorReplaceEffect, ir as ColorTexture, C as CoreObject, ht as DEG_TO_RAD, Ke as DEVICE_PIXEL_RATIO, W as DrawboardEffect, _i as DropShadowEffect, H as Effect, $n as EffectMaterial, ba as Element2D, Ui as Element2DBackground, Y as Element2DChart, qi as Element2DConnection, J as Element2DFill, Yi as Element2DForeground, Xi as Element2DOutline, Zi as Element2DShadow, Qi as Element2DShape, $i as Element2DStyle, ra as Element2DTable, X as Element2DText, bi as EmbossEffect, vo as Engine, ma as Flexbox, zn as FontLoader, mi as GaussianBlurEffect, Wn as Geometry, ao as GifLoader, on as GlBatch2DSystem, tn as GlBlendMode, Ct as GlBuffer, jt as GlBufferSystem, St as GlBufferTarget, un as GlMaskSystem, Ut as GlProgram, mn as GlRenderTarget, hn as GlRenderTargetSystem, Qt as GlShaderSystem, rn as GlState, an as GlStateSystem, fn as GlStencilSystem, A as GlSystem, pn as GlViewportSystem, G as GlitchEffect, K as GodrayEffect, ar as GradientTexture, Ra as HTMLAudio, Ia as HTMLAudioContext, La as HTMLSound, We as IN_BROWSER, Ge as IN_MAC_OS, Vn as IndexBuffer, ft as Input, ot as InputEvent, oo as JsonLoader, ki as KawaseBlurEffect, Qa as KawaseTransition, st as KeyboardInputEvent, eo as LeftEraseTransition, Rn as Loader, Ca as Lottie2D, so as LottieLoader, xt as MainLoop, Mi as MaskEffect, F as Material, fr as Meta, ct as MouseInputEvent, z as Node, Pr as Node2D, yt as Obb2D, q as OutlineEffect, ye as PI, be as PI_2, Ri as PixelateEffect, or as PixelsTexture, lt as PointerInputEvent, bt as Projection2D, qn as QuadGeometry, I as QuadUvGeometry, gt as RAD_TO_DEG, pt as RefCounted, L as RenderTarget, Tt as Renderer, w as Resource, ze as SUPPORTS_AUDIO_CONTEXT, Le as SUPPORTS_CLICK_EVENTS, Re as SUPPORTS_CREATE_IMAGE_BITMAP, je as SUPPORTS_IMAGE_BITMAP, Fe as SUPPORTS_MOUSE_EVENTS, Ve as SUPPORTS_OFFLINE_AUDIO_CONTEXT, Ne as SUPPORTS_POINTER_EVENTS, Me as SUPPORTS_RESIZE_OBSERVER, Ie as SUPPORTS_TOUCH_EVENTS, Ae as SUPPORTS_WEBGL2, Be as SUPPORTS_WEBKIT_AUDIO_CONTEXT, He as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, Ue as SUPPORTS_WEB_AUDIO, Pe as SUPPORTS_WHEEL_EVENTS, Ar as SceneTree, co as TextLoader, R as Texture2D, lo as TextureLoader, xa as TextureRect2D, S as Ticker, no as TiltShiftTransition, Or as Timeline, B as TimelineNode, wa as TransformRect2D, Mr as Transition, io as TwistTransition, Dt as UniformGroup, tr as UvGeometry, er as UvMaterial, P as VertexAttribute, N as VertexBuffer, Ea as Video2D, uo as VideoLoader, cr as VideoTexture, V as Viewport, lr as ViewportTexture, Ga as WebAudio, Ua as WebAudioContext, Ln as WebGLRenderer, Wa as WebSound, ut as WheelInputEvent, kr as Window, Vi as ZoomBlurEffect, Q as alignMap, $ as assets, Lr as axisDir, pa as boxSizingMap, _t as clamp, Oi as clampFrag, tt as createHTMLCanvas, At as createIdFromString, _e as createNode, rt as crossOrigin, Na as cubicBezier, x as customNode, ge as customNodes, _o as defaultOptions, nt as determineCrossOrigin, sa as directionMap, oa as displayMap, ka as ease, Aa as easeIn, Ma as easeInOut, ja as easeOut, Z as edgeMap, ca as flexDirectionMap, la as flexWrapMap, Di as frag, et as getCanvasFactory, Te as getDefaultCssPropertyValue, So as getRenderEngine, aa as gutterMap, at as instanceId, Xe as isCanvasElement, qe as isElementNode, Ye as isImageElement, xe as isPow2, Je as isVideoElement, Ze as isWebgl2, ua as justifyMap, E as lerp, Oa as linear, cn as log2, nn as mapGlBlendModes, sn as nextPow2, ve as nextTick, da as overflowMap, Wr as parseCssFilter, De as parseCssFunctions, Ee as parseCssProperty, Gr as parseCssTransformOrigin, fa as positionTypeMap, To as render, Eo as renderPixels, xr as resetBatchPool, Rr as routeConnection, $e as setCanvasFactory, dn as stencilModeMap, Pa as timingFunctions };