modern-canvas 0.4.28 → 0.4.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { colord, extend } from 'colord';
2
2
  import namesPlugin from 'colord/plugins/names';
3
+ import { normalizeFill, normalizeBackground, normalizeForeground, normalizeGeometry, normalizeOutline, normalizeShadow, getDefaultStyle, normalizeText } from 'modern-idoc';
3
4
  import { Path2D, Path2DSet, svgToDOM, svgToPath2DSet, Matrix3 as Matrix3$1 } from 'modern-path2d';
4
- import { getDefaultStyle } from 'modern-idoc';
5
5
  import { Text, textDefaultStyle } from 'modern-text';
6
6
  import { loadYoga, BoxSizing, PositionType, Edge, Overflow, Gutter, Justify, Wrap, FlexDirection, Display, Direction, Align } from 'yoga-layout/load';
7
7
 
@@ -528,7 +528,7 @@ class CoreObject extends EventEmitter {
528
528
  return properties;
529
529
  }
530
530
  setProperties(properties) {
531
- if (properties) {
531
+ if (properties && typeof properties === "object") {
532
532
  for (const [name] of this.getPropertyDeclarations()) {
533
533
  if (name in properties) {
534
534
  this.setProperty(name, properties[name]);
@@ -2150,13 +2150,13 @@ class Vector3 extends Vector {
2150
2150
  }
2151
2151
  }
2152
2152
 
2153
- var __defProp$O = Object.defineProperty;
2154
- var __decorateClass$W = (decorators, target, key, kind) => {
2153
+ var __defProp$Q = Object.defineProperty;
2154
+ var __decorateClass$Y = (decorators, target, key, kind) => {
2155
2155
  var result = void 0 ;
2156
2156
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
2157
2157
  if (decorator = decorators[i])
2158
2158
  result = (decorator(target, key, result) ) || result;
2159
- if (result) __defProp$O(target, key, result);
2159
+ if (result) __defProp$Q(target, key, result);
2160
2160
  return result;
2161
2161
  };
2162
2162
  class MainLoop extends CoreObject {
@@ -2199,10 +2199,10 @@ class MainLoop extends CoreObject {
2199
2199
  this.stop();
2200
2200
  }
2201
2201
  }
2202
- __decorateClass$W([
2202
+ __decorateClass$Y([
2203
2203
  property({ default: 24 })
2204
2204
  ], MainLoop.prototype, "fps");
2205
- __decorateClass$W([
2205
+ __decorateClass$Y([
2206
2206
  property({ default: 1 })
2207
2207
  ], MainLoop.prototype, "speed");
2208
2208
 
@@ -4504,13 +4504,13 @@ class Geometry extends Resource {
4504
4504
  }
4505
4505
  }
4506
4506
 
4507
- var __defProp$N = Object.defineProperty;
4508
- var __decorateClass$V = (decorators, target, key, kind) => {
4507
+ var __defProp$P = Object.defineProperty;
4508
+ var __decorateClass$X = (decorators, target, key, kind) => {
4509
4509
  var result = void 0 ;
4510
4510
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4511
4511
  if (decorator = decorators[i])
4512
4512
  result = (decorator(target, key, result) ) || result;
4513
- if (result) __defProp$N(target, key, result);
4513
+ if (result) __defProp$P(target, key, result);
4514
4514
  return result;
4515
4515
  };
4516
4516
  class IndexBuffer extends Resource {
@@ -4554,20 +4554,20 @@ class IndexBuffer extends Resource {
4554
4554
  return result;
4555
4555
  }
4556
4556
  }
4557
- __decorateClass$V([
4557
+ __decorateClass$X([
4558
4558
  protectedProperty({ default: null })
4559
4559
  ], IndexBuffer.prototype, "data");
4560
- __decorateClass$V([
4560
+ __decorateClass$X([
4561
4561
  protectedProperty({ default: false })
4562
4562
  ], IndexBuffer.prototype, "dynamic");
4563
4563
 
4564
- var __defProp$M = Object.defineProperty;
4565
- var __decorateClass$U = (decorators, target, key, kind) => {
4564
+ var __defProp$O = Object.defineProperty;
4565
+ var __decorateClass$W = (decorators, target, key, kind) => {
4566
4566
  var result = void 0 ;
4567
4567
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4568
4568
  if (decorator = decorators[i])
4569
4569
  result = (decorator(target, key, result) ) || result;
4570
- if (result) __defProp$M(target, key, result);
4570
+ if (result) __defProp$O(target, key, result);
4571
4571
  return result;
4572
4572
  };
4573
4573
  class VertexBuffer extends Resource {
@@ -4611,20 +4611,20 @@ class VertexBuffer extends Resource {
4611
4611
  return result;
4612
4612
  }
4613
4613
  }
4614
- __decorateClass$U([
4614
+ __decorateClass$W([
4615
4615
  protectedProperty({ default: null })
4616
4616
  ], VertexBuffer.prototype, "data");
4617
- __decorateClass$U([
4617
+ __decorateClass$W([
4618
4618
  protectedProperty({ default: false })
4619
4619
  ], VertexBuffer.prototype, "dynamic");
4620
4620
 
4621
- var __defProp$L = Object.defineProperty;
4622
- var __decorateClass$T = (decorators, target, key, kind) => {
4621
+ var __defProp$N = Object.defineProperty;
4622
+ var __decorateClass$V = (decorators, target, key, kind) => {
4623
4623
  var result = void 0 ;
4624
4624
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4625
4625
  if (decorator = decorators[i])
4626
4626
  result = (decorator(target, key, result) ) || result;
4627
- if (result) __defProp$L(target, key, result);
4627
+ if (result) __defProp$N(target, key, result);
4628
4628
  return result;
4629
4629
  };
4630
4630
  class VertexAttribute extends Resource {
@@ -4661,25 +4661,25 @@ class VertexAttribute extends Resource {
4661
4661
  return result;
4662
4662
  }
4663
4663
  }
4664
- __decorateClass$T([
4664
+ __decorateClass$V([
4665
4665
  protectedProperty()
4666
4666
  ], VertexAttribute.prototype, "buffer");
4667
- __decorateClass$T([
4667
+ __decorateClass$V([
4668
4668
  protectedProperty({ default: 0 })
4669
4669
  ], VertexAttribute.prototype, "size");
4670
- __decorateClass$T([
4670
+ __decorateClass$V([
4671
4671
  protectedProperty({ default: false })
4672
4672
  ], VertexAttribute.prototype, "normalized");
4673
- __decorateClass$T([
4673
+ __decorateClass$V([
4674
4674
  protectedProperty({ default: "float" })
4675
4675
  ], VertexAttribute.prototype, "type");
4676
- __decorateClass$T([
4676
+ __decorateClass$V([
4677
4677
  protectedProperty()
4678
4678
  ], VertexAttribute.prototype, "stride");
4679
- __decorateClass$T([
4679
+ __decorateClass$V([
4680
4680
  protectedProperty()
4681
4681
  ], VertexAttribute.prototype, "offset");
4682
- __decorateClass$T([
4682
+ __decorateClass$V([
4683
4683
  protectedProperty()
4684
4684
  ], VertexAttribute.prototype, "divisor");
4685
4685
 
@@ -4923,13 +4923,13 @@ class UvGeometry extends Geometry {
4923
4923
  }
4924
4924
  }
4925
4925
 
4926
- var __defProp$K = Object.defineProperty;
4927
- var __decorateClass$S = (decorators, target, key, kind) => {
4926
+ var __defProp$M = Object.defineProperty;
4927
+ var __decorateClass$U = (decorators, target, key, kind) => {
4928
4928
  var result = void 0 ;
4929
4929
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4930
4930
  if (decorator = decorators[i])
4931
4931
  result = (decorator(target, key, result) ) || result;
4932
- if (result) __defProp$K(target, key, result);
4932
+ if (result) __defProp$M(target, key, result);
4933
4933
  return result;
4934
4934
  };
4935
4935
  class Texture2D extends Resource {
@@ -5055,22 +5055,22 @@ class Texture2D extends Resource {
5055
5055
  }
5056
5056
  }
5057
5057
  }
5058
- __decorateClass$S([
5058
+ __decorateClass$U([
5059
5059
  protectedProperty()
5060
5060
  ], Texture2D.prototype, "source");
5061
- __decorateClass$S([
5061
+ __decorateClass$U([
5062
5062
  property({ default: 0 })
5063
5063
  ], Texture2D.prototype, "width");
5064
- __decorateClass$S([
5064
+ __decorateClass$U([
5065
5065
  property({ default: 0 })
5066
5066
  ], Texture2D.prototype, "height");
5067
- __decorateClass$S([
5067
+ __decorateClass$U([
5068
5068
  property({ default: "linear" })
5069
5069
  ], Texture2D.prototype, "filterMode");
5070
- __decorateClass$S([
5070
+ __decorateClass$U([
5071
5071
  property({ default: "clamp_to_edge" })
5072
5072
  ], Texture2D.prototype, "wrapMode");
5073
- __decorateClass$S([
5073
+ __decorateClass$U([
5074
5074
  property({ default: 1 })
5075
5075
  ], Texture2D.prototype, "pixelRatio");
5076
5076
 
@@ -5100,13 +5100,13 @@ class AnimatedTexture extends Resource {
5100
5100
  }
5101
5101
  }
5102
5102
 
5103
- var __defProp$J = Object.defineProperty;
5104
- var __decorateClass$R = (decorators, target, key, kind) => {
5103
+ var __defProp$L = Object.defineProperty;
5104
+ var __decorateClass$T = (decorators, target, key, kind) => {
5105
5105
  var result = void 0 ;
5106
5106
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5107
5107
  if (decorator = decorators[i])
5108
5108
  result = (decorator(target, key, result) ) || result;
5109
- if (result) __defProp$J(target, key, result);
5109
+ if (result) __defProp$L(target, key, result);
5110
5110
  return result;
5111
5111
  };
5112
5112
  class CanvasTexture extends Texture2D {
@@ -5125,7 +5125,7 @@ class CanvasTexture extends Texture2D {
5125
5125
  super._updateProperty(key, value, oldValue, declaration);
5126
5126
  }
5127
5127
  }
5128
- __decorateClass$R([
5128
+ __decorateClass$T([
5129
5129
  property({ default: 2 })
5130
5130
  ], CanvasTexture.prototype, "pixelRatio");
5131
5131
 
@@ -5287,13 +5287,13 @@ class PixelsTexture extends Texture2D {
5287
5287
  }
5288
5288
  }
5289
5289
 
5290
- var __defProp$I = Object.defineProperty;
5291
- var __decorateClass$Q = (decorators, target, key, kind) => {
5290
+ var __defProp$K = Object.defineProperty;
5291
+ var __decorateClass$S = (decorators, target, key, kind) => {
5292
5292
  var result = void 0 ;
5293
5293
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5294
5294
  if (decorator = decorators[i])
5295
5295
  result = (decorator(target, key, result) ) || result;
5296
- if (result) __defProp$I(target, key, result);
5296
+ if (result) __defProp$K(target, key, result);
5297
5297
  return result;
5298
5298
  };
5299
5299
  function resolveOptions(options) {
@@ -5537,10 +5537,10 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5537
5537
  }
5538
5538
  }
5539
5539
  };
5540
- __decorateClass$Q([
5540
+ __decorateClass$S([
5541
5541
  protectedProperty({ default: true })
5542
5542
  ], _VideoTexture.prototype, "autoUpdate");
5543
- __decorateClass$Q([
5543
+ __decorateClass$S([
5544
5544
  protectedProperty({ default: 0 })
5545
5545
  ], _VideoTexture.prototype, "fps");
5546
5546
  let VideoTexture = _VideoTexture;
@@ -5549,14 +5549,14 @@ class ViewportTexture extends PixelsTexture {
5549
5549
  //
5550
5550
  }
5551
5551
 
5552
- var __defProp$H = Object.defineProperty;
5552
+ var __defProp$J = Object.defineProperty;
5553
5553
  var __getOwnPropDesc$I = Object.getOwnPropertyDescriptor;
5554
- var __decorateClass$P = (decorators, target, key, kind) => {
5554
+ var __decorateClass$R = (decorators, target, key, kind) => {
5555
5555
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$I(target, key) : target;
5556
5556
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5557
5557
  if (decorator = decorators[i])
5558
5558
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5559
- if (kind && result) __defProp$H(target, key, result);
5559
+ if (kind && result) __defProp$J(target, key, result);
5560
5560
  return result;
5561
5561
  };
5562
5562
  const tagUidMap = {};
@@ -6059,36 +6059,36 @@ let Node = class extends CoreObject {
6059
6059
  return node;
6060
6060
  }
6061
6061
  };
6062
- __decorateClass$P([
6062
+ __decorateClass$R([
6063
6063
  protectedProperty()
6064
6064
  ], Node.prototype, "name", 2);
6065
- __decorateClass$P([
6065
+ __decorateClass$R([
6066
6066
  property()
6067
6067
  ], Node.prototype, "mask", 2);
6068
- __decorateClass$P([
6068
+ __decorateClass$R([
6069
6069
  property({ default: "inherit" })
6070
6070
  ], Node.prototype, "processMode", 2);
6071
- __decorateClass$P([
6071
+ __decorateClass$R([
6072
6072
  property({ default: "default" })
6073
6073
  ], Node.prototype, "processSortMode", 2);
6074
- __decorateClass$P([
6074
+ __decorateClass$R([
6075
6075
  property({ default: "inherit" })
6076
6076
  ], Node.prototype, "renderMode", 2);
6077
- __decorateClass$P([
6077
+ __decorateClass$R([
6078
6078
  property({ default: "default" })
6079
6079
  ], Node.prototype, "internalMode", 2);
6080
- Node = __decorateClass$P([
6080
+ Node = __decorateClass$R([
6081
6081
  customNode("Node")
6082
6082
  ], Node);
6083
6083
 
6084
- var __defProp$G = Object.defineProperty;
6084
+ var __defProp$I = Object.defineProperty;
6085
6085
  var __getOwnPropDesc$H = Object.getOwnPropertyDescriptor;
6086
- var __decorateClass$O = (decorators, target, key, kind) => {
6086
+ var __decorateClass$Q = (decorators, target, key, kind) => {
6087
6087
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$H(target, key) : target;
6088
6088
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6089
6089
  if (decorator = decorators[i])
6090
6090
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6091
- if (kind && result) __defProp$G(target, key, result);
6091
+ if (kind && result) __defProp$I(target, key, result);
6092
6092
  return result;
6093
6093
  };
6094
6094
  let TimelineNode = class extends Node {
@@ -6148,30 +6148,30 @@ let TimelineNode = class extends Node {
6148
6148
  this._updateCurrentTime();
6149
6149
  }
6150
6150
  };
6151
- __decorateClass$O([
6151
+ __decorateClass$Q([
6152
6152
  property({ default: 0 })
6153
6153
  ], TimelineNode.prototype, "delay", 2);
6154
- __decorateClass$O([
6154
+ __decorateClass$Q([
6155
6155
  property({ default: 0 })
6156
6156
  ], TimelineNode.prototype, "duration", 2);
6157
- __decorateClass$O([
6157
+ __decorateClass$Q([
6158
6158
  property({ default: false })
6159
6159
  ], TimelineNode.prototype, "paused", 2);
6160
- __decorateClass$O([
6160
+ __decorateClass$Q([
6161
6161
  protectedProperty()
6162
6162
  ], TimelineNode.prototype, "insideTimeRange", 2);
6163
- TimelineNode = __decorateClass$O([
6163
+ TimelineNode = __decorateClass$Q([
6164
6164
  customNode("TimelineNode")
6165
6165
  ], TimelineNode);
6166
6166
 
6167
- var __defProp$F = Object.defineProperty;
6167
+ var __defProp$H = Object.defineProperty;
6168
6168
  var __getOwnPropDesc$G = Object.getOwnPropertyDescriptor;
6169
- var __decorateClass$N = (decorators, target, key, kind) => {
6169
+ var __decorateClass$P = (decorators, target, key, kind) => {
6170
6170
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$G(target, key) : target;
6171
6171
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6172
6172
  if (decorator = decorators[i])
6173
6173
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6174
- if (kind && result) __defProp$F(target, key, result);
6174
+ if (kind && result) __defProp$H(target, key, result);
6175
6175
  return result;
6176
6176
  };
6177
6177
  let Viewport = class extends Node {
@@ -6309,30 +6309,30 @@ let Viewport = class extends Node {
6309
6309
  return this._projection.toArray(transpose);
6310
6310
  }
6311
6311
  };
6312
- __decorateClass$N([
6312
+ __decorateClass$P([
6313
6313
  property({ default: 0 })
6314
6314
  ], Viewport.prototype, "x", 2);
6315
- __decorateClass$N([
6315
+ __decorateClass$P([
6316
6316
  property({ default: 0 })
6317
6317
  ], Viewport.prototype, "y", 2);
6318
- __decorateClass$N([
6318
+ __decorateClass$P([
6319
6319
  property({ default: 0 })
6320
6320
  ], Viewport.prototype, "width", 2);
6321
- __decorateClass$N([
6321
+ __decorateClass$P([
6322
6322
  property({ default: 0 })
6323
6323
  ], Viewport.prototype, "height", 2);
6324
- Viewport = __decorateClass$N([
6324
+ Viewport = __decorateClass$P([
6325
6325
  customNode("Viewport")
6326
6326
  ], Viewport);
6327
6327
 
6328
- var __defProp$E = Object.defineProperty;
6328
+ var __defProp$G = Object.defineProperty;
6329
6329
  var __getOwnPropDesc$F = Object.getOwnPropertyDescriptor;
6330
- var __decorateClass$M = (decorators, target, key, kind) => {
6330
+ var __decorateClass$O = (decorators, target, key, kind) => {
6331
6331
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$F(target, key) : target;
6332
6332
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6333
6333
  if (decorator = decorators[i])
6334
6334
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6335
- if (kind && result) __defProp$E(target, key, result);
6335
+ if (kind && result) __defProp$G(target, key, result);
6336
6336
  return result;
6337
6337
  };
6338
6338
  let Effect = class extends TimelineNode {
@@ -6573,31 +6573,31 @@ let Effect = class extends TimelineNode {
6573
6573
  }
6574
6574
  }
6575
6575
  };
6576
- __decorateClass$M([
6576
+ __decorateClass$O([
6577
6577
  protectedProperty()
6578
6578
  ], Effect.prototype, "material", 2);
6579
- __decorateClass$M([
6579
+ __decorateClass$O([
6580
6580
  property()
6581
6581
  ], Effect.prototype, "effectMode", 2);
6582
- __decorateClass$M([
6582
+ __decorateClass$O([
6583
6583
  property({ default: "" })
6584
6584
  ], Effect.prototype, "glsl", 2);
6585
- __decorateClass$M([
6585
+ __decorateClass$O([
6586
6586
  property({ default: "" })
6587
6587
  ], Effect.prototype, "glslSrc", 2);
6588
- Effect = __decorateClass$M([
6588
+ Effect = __decorateClass$O([
6589
6589
  customNode("Effect")
6590
6590
  ], Effect);
6591
6591
 
6592
- var __defProp$D = Object.defineProperty;
6592
+ var __defProp$F = Object.defineProperty;
6593
6593
  var __getOwnPropDesc$E = Object.getOwnPropertyDescriptor;
6594
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6595
- var __decorateClass$L = (decorators, target, key, kind) => {
6594
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6595
+ var __decorateClass$N = (decorators, target, key, kind) => {
6596
6596
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$E(target, key) : target;
6597
6597
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6598
6598
  if (decorator = decorators[i])
6599
6599
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6600
- if (kind && result) __defProp$D(target, key, result);
6600
+ if (kind && result) __defProp$F(target, key, result);
6601
6601
  return result;
6602
6602
  };
6603
6603
  var __publicField$i = (obj, key, value) => __defNormalProp$i(obj, key + "" , value);
@@ -6657,43 +6657,43 @@ void main(void) {
6657
6657
  gl_FragColor = c * alpha;
6658
6658
  }`
6659
6659
  }));
6660
- __decorateClass$L([
6660
+ __decorateClass$N([
6661
6661
  property({ default: 1 })
6662
6662
  ], ColorAdjustEffect.prototype, "saturation", 2);
6663
- __decorateClass$L([
6663
+ __decorateClass$N([
6664
6664
  property({ default: 1 })
6665
6665
  ], ColorAdjustEffect.prototype, "contrast", 2);
6666
- __decorateClass$L([
6666
+ __decorateClass$N([
6667
6667
  property({ default: 1 })
6668
6668
  ], ColorAdjustEffect.prototype, "brightness", 2);
6669
- __decorateClass$L([
6669
+ __decorateClass$N([
6670
6670
  property({ default: 1 })
6671
6671
  ], ColorAdjustEffect.prototype, "red", 2);
6672
- __decorateClass$L([
6672
+ __decorateClass$N([
6673
6673
  property({ default: 1 })
6674
6674
  ], ColorAdjustEffect.prototype, "green", 2);
6675
- __decorateClass$L([
6675
+ __decorateClass$N([
6676
6676
  property({ default: 1 })
6677
6677
  ], ColorAdjustEffect.prototype, "blue", 2);
6678
- __decorateClass$L([
6678
+ __decorateClass$N([
6679
6679
  property({ default: 1 })
6680
6680
  ], ColorAdjustEffect.prototype, "alpha", 2);
6681
- __decorateClass$L([
6681
+ __decorateClass$N([
6682
6682
  property({ default: 1 })
6683
6683
  ], ColorAdjustEffect.prototype, "gamma", 2);
6684
- ColorAdjustEffect = __decorateClass$L([
6684
+ ColorAdjustEffect = __decorateClass$N([
6685
6685
  customNode("ColorAdjustEffect")
6686
6686
  ], ColorAdjustEffect);
6687
6687
 
6688
- var __defProp$C = Object.defineProperty;
6688
+ var __defProp$E = Object.defineProperty;
6689
6689
  var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor;
6690
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6691
- var __decorateClass$K = (decorators, target, key, kind) => {
6690
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6691
+ var __decorateClass$M = (decorators, target, key, kind) => {
6692
6692
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$D(target, key) : target;
6693
6693
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6694
6694
  if (decorator = decorators[i])
6695
6695
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6696
- if (kind && result) __defProp$C(target, key, result);
6696
+ if (kind && result) __defProp$E(target, key, result);
6697
6697
  return result;
6698
6698
  };
6699
6699
  var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, key + "" , value);
@@ -6773,22 +6773,22 @@ void main(void) {
6773
6773
  );
6774
6774
  }`
6775
6775
  }));
6776
- __decorateClass$K([
6776
+ __decorateClass$M([
6777
6777
  property()
6778
6778
  ], ColorFilterEffect.prototype, "filter", 2);
6779
- ColorFilterEffect = __decorateClass$K([
6779
+ ColorFilterEffect = __decorateClass$M([
6780
6780
  customNode("ColorFilterEffect")
6781
6781
  ], ColorFilterEffect);
6782
6782
 
6783
- var __defProp$B = Object.defineProperty;
6783
+ var __defProp$D = Object.defineProperty;
6784
6784
  var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
6785
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6786
- var __decorateClass$J = (decorators, target, key, kind) => {
6785
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6786
+ var __decorateClass$L = (decorators, target, key, kind) => {
6787
6787
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$C(target, key) : target;
6788
6788
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6789
6789
  if (decorator = decorators[i])
6790
6790
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6791
- if (kind && result) __defProp$B(target, key, result);
6791
+ if (kind && result) __defProp$D(target, key, result);
6792
6792
  return result;
6793
6793
  };
6794
6794
  var __publicField$g = (obj, key, value) => __defNormalProp$g(obj, key + "" , value);
@@ -6864,25 +6864,25 @@ void main(void) {
6864
6864
  gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
6865
6865
  }`
6866
6866
  }));
6867
- __decorateClass$J([
6867
+ __decorateClass$L([
6868
6868
  property({ default: [] })
6869
6869
  ], ColorOverlayEffect.prototype, "colors", 2);
6870
- __decorateClass$J([
6870
+ __decorateClass$L([
6871
6871
  property({ default: 0.5 })
6872
6872
  ], ColorOverlayEffect.prototype, "alpha", 2);
6873
- ColorOverlayEffect = __decorateClass$J([
6873
+ ColorOverlayEffect = __decorateClass$L([
6874
6874
  customNode("ColorOverlayEffect")
6875
6875
  ], ColorOverlayEffect);
6876
6876
 
6877
- var __defProp$A = Object.defineProperty;
6877
+ var __defProp$C = Object.defineProperty;
6878
6878
  var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
6879
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6880
- var __decorateClass$I = (decorators, target, key, kind) => {
6879
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6880
+ var __decorateClass$K = (decorators, target, key, kind) => {
6881
6881
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$B(target, key) : target;
6882
6882
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6883
6883
  if (decorator = decorators[i])
6884
6884
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6885
- if (kind && result) __defProp$A(target, key, result);
6885
+ if (kind && result) __defProp$C(target, key, result);
6886
6886
  return result;
6887
6887
  };
6888
6888
  var __publicField$f = (obj, key, value) => __defNormalProp$f(obj, key + "" , value);
@@ -6949,25 +6949,25 @@ void main(void) {
6949
6949
  gl_FragColor = color;
6950
6950
  }`
6951
6951
  }));
6952
- __decorateClass$I([
6952
+ __decorateClass$K([
6953
6953
  property({ default: [] })
6954
6954
  ], ColorRemoveEffect.prototype, "colors", 2);
6955
- __decorateClass$I([
6955
+ __decorateClass$K([
6956
6956
  property({ default: 0.5 })
6957
6957
  ], ColorRemoveEffect.prototype, "epsilon", 2);
6958
- ColorRemoveEffect = __decorateClass$I([
6958
+ ColorRemoveEffect = __decorateClass$K([
6959
6959
  customNode("ColorRemoveEffect")
6960
6960
  ], ColorRemoveEffect);
6961
6961
 
6962
- var __defProp$z = Object.defineProperty;
6962
+ var __defProp$B = Object.defineProperty;
6963
6963
  var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
6964
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6965
- var __decorateClass$H = (decorators, target, key, kind) => {
6964
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6965
+ var __decorateClass$J = (decorators, target, key, kind) => {
6966
6966
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$A(target, key) : target;
6967
6967
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6968
6968
  if (decorator = decorators[i])
6969
6969
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6970
- if (kind && result) __defProp$z(target, key, result);
6970
+ if (kind && result) __defProp$B(target, key, result);
6971
6971
  return result;
6972
6972
  };
6973
6973
  var __publicField$e = (obj, key, value) => __defNormalProp$e(obj, key + "" , value);
@@ -7056,13 +7056,13 @@ void main(void) {
7056
7056
  }
7057
7057
  }`
7058
7058
  }));
7059
- __decorateClass$H([
7059
+ __decorateClass$J([
7060
7060
  property({ default: [] })
7061
7061
  ], ColorReplaceEffect.prototype, "colors", 2);
7062
- __decorateClass$H([
7062
+ __decorateClass$J([
7063
7063
  property({ default: 0.05 })
7064
7064
  ], ColorReplaceEffect.prototype, "epsilon", 2);
7065
- ColorReplaceEffect = __decorateClass$H([
7065
+ ColorReplaceEffect = __decorateClass$J([
7066
7066
  customNode("ColorReplaceEffect")
7067
7067
  ], ColorReplaceEffect);
7068
7068
 
@@ -7233,14 +7233,14 @@ class CanvasContext extends Path2D {
7233
7233
  }
7234
7234
  }
7235
7235
 
7236
- var __defProp$y = Object.defineProperty;
7236
+ var __defProp$A = Object.defineProperty;
7237
7237
  var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
7238
- var __decorateClass$G = (decorators, target, key, kind) => {
7238
+ var __decorateClass$I = (decorators, target, key, kind) => {
7239
7239
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target;
7240
7240
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7241
7241
  if (decorator = decorators[i])
7242
7242
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7243
- if (kind && result) __defProp$y(target, key, result);
7243
+ if (kind && result) __defProp$A(target, key, result);
7244
7244
  return result;
7245
7245
  };
7246
7246
  let CanvasItem = class extends TimelineNode {
@@ -7401,19 +7401,19 @@ let CanvasItem = class extends TimelineNode {
7401
7401
  super._render(renderer);
7402
7402
  }
7403
7403
  };
7404
- __decorateClass$G([
7404
+ __decorateClass$I([
7405
7405
  property()
7406
7406
  ], CanvasItem.prototype, "modulate", 2);
7407
- __decorateClass$G([
7407
+ __decorateClass$I([
7408
7408
  property()
7409
7409
  ], CanvasItem.prototype, "blendMode", 2);
7410
- __decorateClass$G([
7410
+ __decorateClass$I([
7411
7411
  protectedProperty({ default: true })
7412
7412
  ], CanvasItem.prototype, "visible", 2);
7413
- __decorateClass$G([
7413
+ __decorateClass$I([
7414
7414
  protectedProperty({ default: 1 })
7415
7415
  ], CanvasItem.prototype, "opacity", 2);
7416
- CanvasItem = __decorateClass$G([
7416
+ CanvasItem = __decorateClass$I([
7417
7417
  customNode("CanvasItem")
7418
7418
  ], CanvasItem);
7419
7419
 
@@ -7443,14 +7443,14 @@ class RenderStack {
7443
7443
  }
7444
7444
  }
7445
7445
 
7446
- var __defProp$x = Object.defineProperty;
7446
+ var __defProp$z = Object.defineProperty;
7447
7447
  var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
7448
- var __decorateClass$F = (decorators, target, key, kind) => {
7448
+ var __decorateClass$H = (decorators, target, key, kind) => {
7449
7449
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target;
7450
7450
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7451
7451
  if (decorator = decorators[i])
7452
7452
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7453
- if (kind && result) __defProp$x(target, key, result);
7453
+ if (kind && result) __defProp$z(target, key, result);
7454
7454
  return result;
7455
7455
  };
7456
7456
  let Timeline = class extends Node {
@@ -7495,29 +7495,29 @@ let Timeline = class extends Node {
7495
7495
  this.addTime(delta);
7496
7496
  }
7497
7497
  };
7498
- __decorateClass$F([
7498
+ __decorateClass$H([
7499
7499
  property({ default: 0 })
7500
7500
  ], Timeline.prototype, "startTime", 2);
7501
- __decorateClass$F([
7501
+ __decorateClass$H([
7502
7502
  property({ default: 0 })
7503
7503
  ], Timeline.prototype, "currentTime", 2);
7504
- __decorateClass$F([
7504
+ __decorateClass$H([
7505
7505
  property({ default: Number.MAX_SAFE_INTEGER })
7506
7506
  ], Timeline.prototype, "endTime", 2);
7507
- __decorateClass$F([
7507
+ __decorateClass$H([
7508
7508
  property({ default: false })
7509
7509
  ], Timeline.prototype, "loop", 2);
7510
- Timeline = __decorateClass$F([
7510
+ Timeline = __decorateClass$H([
7511
7511
  customNode("Timeline")
7512
7512
  ], Timeline);
7513
7513
 
7514
- var __defProp$w = Object.defineProperty;
7515
- var __decorateClass$E = (decorators, target, key, kind) => {
7514
+ var __defProp$y = Object.defineProperty;
7515
+ var __decorateClass$G = (decorators, target, key, kind) => {
7516
7516
  var result = void 0 ;
7517
7517
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7518
7518
  if (decorator = decorators[i])
7519
7519
  result = (decorator(target, key, result) ) || result;
7520
- if (result) __defProp$w(target, key, result);
7520
+ if (result) __defProp$y(target, key, result);
7521
7521
  return result;
7522
7522
  };
7523
7523
  class SceneTree extends MainLoop {
@@ -7590,18 +7590,18 @@ class SceneTree extends MainLoop {
7590
7590
  this.input.removeEventListeners();
7591
7591
  }
7592
7592
  }
7593
- __decorateClass$E([
7593
+ __decorateClass$G([
7594
7594
  property({ default: false })
7595
7595
  ], SceneTree.prototype, "processPaused");
7596
- __decorateClass$E([
7596
+ __decorateClass$G([
7597
7597
  property()
7598
7598
  ], SceneTree.prototype, "backgroundColor");
7599
- __decorateClass$E([
7599
+ __decorateClass$G([
7600
7600
  protectedProperty({ default: false })
7601
7601
  ], SceneTree.prototype, "debug");
7602
7602
 
7603
7603
  var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
7604
- var __decorateClass$D = (decorators, target, key, kind) => {
7604
+ var __decorateClass$F = (decorators, target, key, kind) => {
7605
7605
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target;
7606
7606
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7607
7607
  if (decorator = decorators[i])
@@ -7614,7 +7614,7 @@ let Transition = class extends Effect {
7614
7614
  this.setProperties(properties).append(children);
7615
7615
  }
7616
7616
  };
7617
- Transition = __decorateClass$D([
7617
+ Transition = __decorateClass$F([
7618
7618
  customNode("Transition", {
7619
7619
  effectMode: "transition",
7620
7620
  processMode: "pausable",
@@ -7622,15 +7622,15 @@ Transition = __decorateClass$D([
7622
7622
  })
7623
7623
  ], Transition);
7624
7624
 
7625
- var __defProp$v = Object.defineProperty;
7625
+ var __defProp$x = Object.defineProperty;
7626
7626
  var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
7627
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7628
- var __decorateClass$C = (decorators, target, key, kind) => {
7627
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7628
+ var __decorateClass$E = (decorators, target, key, kind) => {
7629
7629
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target;
7630
7630
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7631
7631
  if (decorator = decorators[i])
7632
7632
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7633
- if (kind && result) __defProp$v(target, key, result);
7633
+ if (kind && result) __defProp$x(target, key, result);
7634
7634
  return result;
7635
7635
  };
7636
7636
  var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -7736,25 +7736,25 @@ void main(void) {
7736
7736
  }`,
7737
7737
  frag: frag$2
7738
7738
  }));
7739
- __decorateClass$C([
7739
+ __decorateClass$E([
7740
7740
  property({ default: 4 })
7741
7741
  ], GaussianBlurEffect.prototype, "strength", 2);
7742
- __decorateClass$C([
7742
+ __decorateClass$E([
7743
7743
  property({ default: 3 })
7744
7744
  ], GaussianBlurEffect.prototype, "quality", 2);
7745
- GaussianBlurEffect = __decorateClass$C([
7745
+ GaussianBlurEffect = __decorateClass$E([
7746
7746
  customNode("GaussianBlurEffect")
7747
7747
  ], GaussianBlurEffect);
7748
7748
 
7749
- var __defProp$u = Object.defineProperty;
7749
+ var __defProp$w = Object.defineProperty;
7750
7750
  var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
7751
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7752
- var __decorateClass$B = (decorators, target, key, kind) => {
7751
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7752
+ var __decorateClass$D = (decorators, target, key, kind) => {
7753
7753
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target;
7754
7754
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7755
7755
  if (decorator = decorators[i])
7756
7756
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7757
- if (kind && result) __defProp$u(target, key, result);
7757
+ if (kind && result) __defProp$w(target, key, result);
7758
7758
  return result;
7759
7759
  };
7760
7760
  var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, key + "" , value);
@@ -7818,34 +7818,34 @@ void main(void) {
7818
7818
  gl_FragColor = sample;
7819
7819
  }`
7820
7820
  }));
7821
- __decorateClass$B([
7821
+ __decorateClass$D([
7822
7822
  property({ default: 0 })
7823
7823
  ], DropShadowEffect.prototype, "color", 2);
7824
- __decorateClass$B([
7824
+ __decorateClass$D([
7825
7825
  property({ default: 4 })
7826
7826
  ], DropShadowEffect.prototype, "blur", 2);
7827
- __decorateClass$B([
7827
+ __decorateClass$D([
7828
7828
  property({ default: 4 })
7829
7829
  ], DropShadowEffect.prototype, "offsetX", 2);
7830
- __decorateClass$B([
7830
+ __decorateClass$D([
7831
7831
  property({ default: 4 })
7832
7832
  ], DropShadowEffect.prototype, "offsetY", 2);
7833
- __decorateClass$B([
7833
+ __decorateClass$D([
7834
7834
  property({ default: false })
7835
7835
  ], DropShadowEffect.prototype, "shadowOnly", 2);
7836
- DropShadowEffect = __decorateClass$B([
7836
+ DropShadowEffect = __decorateClass$D([
7837
7837
  customNode("DropShadowEffect")
7838
7838
  ], DropShadowEffect);
7839
7839
 
7840
- var __defProp$t = Object.defineProperty;
7840
+ var __defProp$v = Object.defineProperty;
7841
7841
  var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
7842
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7843
- var __decorateClass$A = (decorators, target, key, kind) => {
7842
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7843
+ var __decorateClass$C = (decorators, target, key, kind) => {
7844
7844
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target;
7845
7845
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7846
7846
  if (decorator = decorators[i])
7847
7847
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7848
- if (kind && result) __defProp$t(target, key, result);
7848
+ if (kind && result) __defProp$v(target, key, result);
7849
7849
  return result;
7850
7850
  };
7851
7851
  var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, key + "" , value);
@@ -7890,22 +7890,22 @@ void main(void) {
7890
7890
  gl_FragColor = vec4(color.rgb * alpha, alpha);
7891
7891
  }`
7892
7892
  }));
7893
- __decorateClass$A([
7893
+ __decorateClass$C([
7894
7894
  property({ default: 5 })
7895
7895
  ], EmbossEffect.prototype, "strength", 2);
7896
- EmbossEffect = __decorateClass$A([
7896
+ EmbossEffect = __decorateClass$C([
7897
7897
  customNode("EmbossEffect")
7898
7898
  ], EmbossEffect);
7899
7899
 
7900
- var __defProp$s = Object.defineProperty;
7900
+ var __defProp$u = Object.defineProperty;
7901
7901
  var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
7902
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7903
- var __decorateClass$z = (decorators, target, key, kind) => {
7902
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7903
+ var __decorateClass$B = (decorators, target, key, kind) => {
7904
7904
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target;
7905
7905
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7906
7906
  if (decorator = decorators[i])
7907
7907
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7908
- if (kind && result) __defProp$s(target, key, result);
7908
+ if (kind && result) __defProp$u(target, key, result);
7909
7909
  return result;
7910
7910
  };
7911
7911
  var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, key + "" , value);
@@ -8079,46 +8079,46 @@ void main(void) {
8079
8079
  gl_FragColor.a = texture2D(sampler, coord).a;
8080
8080
  }`
8081
8081
  }));
8082
- __decorateClass$z([
8082
+ __decorateClass$B([
8083
8083
  property({ default: 10 })
8084
8084
  ], GlitchEffect.prototype, "slices", 2);
8085
- __decorateClass$z([
8085
+ __decorateClass$B([
8086
8086
  property({ default: 512 })
8087
8087
  ], GlitchEffect.prototype, "sampleSize", 2);
8088
- __decorateClass$z([
8088
+ __decorateClass$B([
8089
8089
  property({ default: 100 })
8090
8090
  ], GlitchEffect.prototype, "offset", 2);
8091
- __decorateClass$z([
8091
+ __decorateClass$B([
8092
8092
  property({ default: 0 })
8093
8093
  ], GlitchEffect.prototype, "direction", 2);
8094
- __decorateClass$z([
8094
+ __decorateClass$B([
8095
8095
  property({ default: 2 })
8096
8096
  ], GlitchEffect.prototype, "fillMode", 2);
8097
- __decorateClass$z([
8097
+ __decorateClass$B([
8098
8098
  property({ default: 0 })
8099
8099
  ], GlitchEffect.prototype, "seed", 2);
8100
- __decorateClass$z([
8100
+ __decorateClass$B([
8101
8101
  property({ default: [2, 2] })
8102
8102
  ], GlitchEffect.prototype, "red", 2);
8103
- __decorateClass$z([
8103
+ __decorateClass$B([
8104
8104
  property({ default: [-10, 4] })
8105
8105
  ], GlitchEffect.prototype, "green", 2);
8106
- __decorateClass$z([
8106
+ __decorateClass$B([
8107
8107
  property({ default: [10, -4] })
8108
8108
  ], GlitchEffect.prototype, "blue", 2);
8109
- GlitchEffect = __decorateClass$z([
8109
+ GlitchEffect = __decorateClass$B([
8110
8110
  customNode("GlitchEffect")
8111
8111
  ], GlitchEffect);
8112
8112
 
8113
- var __defProp$r = Object.defineProperty;
8113
+ var __defProp$t = Object.defineProperty;
8114
8114
  var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
8115
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8116
- var __decorateClass$y = (decorators, target, key, kind) => {
8115
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8116
+ var __decorateClass$A = (decorators, target, key, kind) => {
8117
8117
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target;
8118
8118
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8119
8119
  if (decorator = decorators[i])
8120
8120
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8121
- if (kind && result) __defProp$r(target, key, result);
8121
+ if (kind && result) __defProp$t(target, key, result);
8122
8122
  return result;
8123
8123
  };
8124
8124
  var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, key + "" , value);
@@ -8296,39 +8296,39 @@ void main(void) {
8296
8296
  gl_FragColor = vec4(color.rgb + mist.rgb, color.a);
8297
8297
  }`
8298
8298
  }));
8299
- __decorateClass$y([
8299
+ __decorateClass$A([
8300
8300
  property({ default: 0 })
8301
8301
  ], GodrayEffect.prototype, "time", 2);
8302
- __decorateClass$y([
8302
+ __decorateClass$A([
8303
8303
  property({ default: 30 })
8304
8304
  ], GodrayEffect.prototype, "angle", 2);
8305
- __decorateClass$y([
8305
+ __decorateClass$A([
8306
8306
  property({ default: 0.5 })
8307
8307
  ], GodrayEffect.prototype, "gain", 2);
8308
- __decorateClass$y([
8308
+ __decorateClass$A([
8309
8309
  property({ default: 2.5 })
8310
8310
  ], GodrayEffect.prototype, "lacunarity", 2);
8311
- __decorateClass$y([
8311
+ __decorateClass$A([
8312
8312
  property({ default: true })
8313
8313
  ], GodrayEffect.prototype, "parallel", 2);
8314
- __decorateClass$y([
8314
+ __decorateClass$A([
8315
8315
  property({ default: [0, 0] })
8316
8316
  ], GodrayEffect.prototype, "center", 2);
8317
- __decorateClass$y([
8317
+ __decorateClass$A([
8318
8318
  property({ default: 1 })
8319
8319
  ], GodrayEffect.prototype, "alpha", 2);
8320
- GodrayEffect = __decorateClass$y([
8320
+ GodrayEffect = __decorateClass$A([
8321
8321
  customNode("GodrayEffect")
8322
8322
  ], GodrayEffect);
8323
8323
 
8324
- var __defProp$q = Object.defineProperty;
8324
+ var __defProp$s = Object.defineProperty;
8325
8325
  var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
8326
- var __decorateClass$x = (decorators, target, key, kind) => {
8326
+ var __decorateClass$z = (decorators, target, key, kind) => {
8327
8327
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target;
8328
8328
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8329
8329
  if (decorator = decorators[i])
8330
8330
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8331
- if (kind && result) __defProp$q(target, key, result);
8331
+ if (kind && result) __defProp$s(target, key, result);
8332
8332
  return result;
8333
8333
  };
8334
8334
  const frag$1 = `varying vec2 vUv;
@@ -8419,28 +8419,28 @@ void main() {
8419
8419
  });
8420
8420
  }
8421
8421
  };
8422
- __decorateClass$x([
8422
+ __decorateClass$z([
8423
8423
  property({ default: 4 })
8424
8424
  ], KawaseBlurEffect.prototype, "strength", 2);
8425
- __decorateClass$x([
8425
+ __decorateClass$z([
8426
8426
  property({ default: 3 })
8427
8427
  ], KawaseBlurEffect.prototype, "quality", 2);
8428
- __decorateClass$x([
8428
+ __decorateClass$z([
8429
8429
  property({ default: [1, 1] })
8430
8430
  ], KawaseBlurEffect.prototype, "pixelSize", 2);
8431
- KawaseBlurEffect = __decorateClass$x([
8431
+ KawaseBlurEffect = __decorateClass$z([
8432
8432
  customNode("KawaseBlurEffect")
8433
8433
  ], KawaseBlurEffect);
8434
8434
 
8435
- var __defProp$p = Object.defineProperty;
8435
+ var __defProp$r = Object.defineProperty;
8436
8436
  var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
8437
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8438
- var __decorateClass$w = (decorators, target, key, kind) => {
8437
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8438
+ var __decorateClass$y = (decorators, target, key, kind) => {
8439
8439
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target;
8440
8440
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8441
8441
  if (decorator = decorators[i])
8442
8442
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8443
- if (kind && result) __defProp$p(target, key, result);
8443
+ if (kind && result) __defProp$r(target, key, result);
8444
8444
  return result;
8445
8445
  };
8446
8446
  var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, key + "" , value);
@@ -8529,25 +8529,25 @@ void main(void) {
8529
8529
  }
8530
8530
  }`
8531
8531
  }));
8532
- __decorateClass$w([
8532
+ __decorateClass$y([
8533
8533
  protectedProperty()
8534
8534
  ], MaskEffect.prototype, "texture", 2);
8535
- __decorateClass$w([
8535
+ __decorateClass$y([
8536
8536
  property({ default: "" })
8537
8537
  ], MaskEffect.prototype, "src", 2);
8538
- MaskEffect = __decorateClass$w([
8538
+ MaskEffect = __decorateClass$y([
8539
8539
  customNode("MaskEffect")
8540
8540
  ], MaskEffect);
8541
8541
 
8542
- var __defProp$o = Object.defineProperty;
8542
+ var __defProp$q = Object.defineProperty;
8543
8543
  var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
8544
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8545
- var __decorateClass$v = (decorators, target, key, kind) => {
8544
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8545
+ var __decorateClass$x = (decorators, target, key, kind) => {
8546
8546
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
8547
8547
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8548
8548
  if (decorator = decorators[i])
8549
8549
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8550
- if (kind && result) __defProp$o(target, key, result);
8550
+ if (kind && result) __defProp$q(target, key, result);
8551
8551
  return result;
8552
8552
  };
8553
8553
  var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -8635,40 +8635,40 @@ void main() {
8635
8635
  };
8636
8636
  __publicField$7(OutlineEffect, "MIN_SAMPLES", 1);
8637
8637
  __publicField$7(OutlineEffect, "MAX_SAMPLES", 100);
8638
- __decorateClass$v([
8638
+ __decorateClass$x([
8639
8639
  property({ default: 0 })
8640
8640
  ], OutlineEffect.prototype, "color", 2);
8641
- __decorateClass$v([
8641
+ __decorateClass$x([
8642
8642
  property({ default: 1 })
8643
8643
  ], OutlineEffect.prototype, "width", 2);
8644
- __decorateClass$v([
8644
+ __decorateClass$x([
8645
8645
  property({ default: "solid" })
8646
8646
  ], OutlineEffect.prototype, "style", 2);
8647
- __decorateClass$v([
8647
+ __decorateClass$x([
8648
8648
  property()
8649
8649
  ], OutlineEffect.prototype, "image", 2);
8650
- __decorateClass$v([
8650
+ __decorateClass$x([
8651
8651
  property({ default: 1 })
8652
8652
  ], OutlineEffect.prototype, "opacity", 2);
8653
- __decorateClass$v([
8653
+ __decorateClass$x([
8654
8654
  property({ default: 0.1 })
8655
8655
  ], OutlineEffect.prototype, "quality", 2);
8656
- __decorateClass$v([
8656
+ __decorateClass$x([
8657
8657
  property({ default: false })
8658
8658
  ], OutlineEffect.prototype, "knockout", 2);
8659
- OutlineEffect = __decorateClass$v([
8659
+ OutlineEffect = __decorateClass$x([
8660
8660
  customNode("OutlineEffect")
8661
8661
  ], OutlineEffect);
8662
8662
 
8663
- var __defProp$n = Object.defineProperty;
8663
+ var __defProp$p = Object.defineProperty;
8664
8664
  var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
8665
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8666
- var __decorateClass$u = (decorators, target, key, kind) => {
8665
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8666
+ var __decorateClass$w = (decorators, target, key, kind) => {
8667
8667
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
8668
8668
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8669
8669
  if (decorator = decorators[i])
8670
8670
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8671
- if (kind && result) __defProp$n(target, key, result);
8671
+ if (kind && result) __defProp$p(target, key, result);
8672
8672
  return result;
8673
8673
  };
8674
8674
  var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, key + "" , value);
@@ -8724,22 +8724,22 @@ void main(void) {
8724
8724
  gl_FragColor = texture2D(sampler, coord);
8725
8725
  }`
8726
8726
  }));
8727
- __decorateClass$u([
8727
+ __decorateClass$w([
8728
8728
  property({ default: 10 })
8729
8729
  ], PixelateEffect.prototype, "strength", 2);
8730
- PixelateEffect = __decorateClass$u([
8730
+ PixelateEffect = __decorateClass$w([
8731
8731
  customNode("PixelateEffect")
8732
8732
  ], PixelateEffect);
8733
8733
 
8734
- var __defProp$m = Object.defineProperty;
8734
+ var __defProp$o = Object.defineProperty;
8735
8735
  var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
8736
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8737
- var __decorateClass$t = (decorators, target, key, kind) => {
8736
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8737
+ var __decorateClass$v = (decorators, target, key, kind) => {
8738
8738
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
8739
8739
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8740
8740
  if (decorator = decorators[i])
8741
8741
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8742
- if (kind && result) __defProp$m(target, key, result);
8742
+ if (kind && result) __defProp$o(target, key, result);
8743
8743
  return result;
8744
8744
  };
8745
8745
  var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, key + "" , value);
@@ -8852,38 +8852,40 @@ void main() {
8852
8852
  gl_FragColor = color;
8853
8853
  }`
8854
8854
  }));
8855
- __decorateClass$t([
8855
+ __decorateClass$v([
8856
8856
  property()
8857
8857
  ], ZoomBlurEffect.prototype, "center", 2);
8858
- __decorateClass$t([
8858
+ __decorateClass$v([
8859
8859
  property({ default: 20 })
8860
8860
  ], ZoomBlurEffect.prototype, "innerRadius", 2);
8861
- __decorateClass$t([
8861
+ __decorateClass$v([
8862
8862
  property({ default: -1 })
8863
8863
  ], ZoomBlurEffect.prototype, "radius", 2);
8864
- __decorateClass$t([
8864
+ __decorateClass$v([
8865
8865
  property({ default: 0.1 })
8866
8866
  ], ZoomBlurEffect.prototype, "strength", 2);
8867
- ZoomBlurEffect = __decorateClass$t([
8867
+ ZoomBlurEffect = __decorateClass$v([
8868
8868
  customNode("ZoomBlurEffect")
8869
8869
  ], ZoomBlurEffect);
8870
8870
 
8871
- var __defProp$l = Object.defineProperty;
8872
- var __decorateClass$s = (decorators, target, key, kind) => {
8871
+ var __defProp$n = Object.defineProperty;
8872
+ var __decorateClass$u = (decorators, target, key, kind) => {
8873
8873
  var result = void 0 ;
8874
8874
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8875
8875
  if (decorator = decorators[i])
8876
8876
  result = (decorator(target, key, result) ) || result;
8877
- if (result) __defProp$l(target, key, result);
8877
+ if (result) __defProp$n(target, key, result);
8878
8878
  return result;
8879
8879
  };
8880
8880
  class BaseElement2DFill extends CoreObject {
8881
- constructor(parent, properties) {
8881
+ constructor(parent) {
8882
8882
  super();
8883
8883
  this.parent = parent;
8884
- this.setProperties(properties);
8885
8884
  }
8886
- _image;
8885
+ _src;
8886
+ setProperties(properties) {
8887
+ return super.setProperties(normalizeFill(properties));
8888
+ }
8887
8889
  _updateProperty(key, value, oldValue, declaration) {
8888
8890
  super._updateProperty(key, value, oldValue, declaration);
8889
8891
  switch (key) {
@@ -8893,31 +8895,47 @@ class BaseElement2DFill extends CoreObject {
8893
8895
  case "tile":
8894
8896
  this.parent.requestRedraw();
8895
8897
  break;
8896
- case "image":
8897
- this._updateImage();
8898
+ case "src":
8899
+ this._updateSource();
8898
8900
  break;
8899
8901
  }
8900
8902
  }
8901
- async loadImage() {
8902
- if (this.image && this.image !== "none") {
8903
- return await assets.texture.load(this.image);
8903
+ async loadSource() {
8904
+ if (this.src && this.src !== "none") {
8905
+ return await assets.texture.load(this.src);
8904
8906
  }
8905
8907
  }
8906
- async _updateImage() {
8907
- this._image = await this.loadImage();
8908
+ async _updateSource() {
8909
+ this._src = await this.loadSource();
8908
8910
  this.parent.requestRedraw();
8909
8911
  }
8910
8912
  canDraw() {
8911
8913
  return Boolean(
8912
- this._image || this.color
8914
+ this._src || this.color
8913
8915
  );
8914
8916
  }
8915
8917
  draw() {
8916
8918
  const ctx = this.parent.context;
8917
- if (this._image) {
8918
- const { width: imageWidth, height: imageHeight } = this._image;
8919
+ if (this._src) {
8920
+ const { width: imageWidth, height: imageHeight } = this._src;
8919
8921
  const { width, height } = this.parent.size;
8920
8922
  const transform = new Transform2D();
8923
+ let disableWrapMode = false;
8924
+ if (this.srcRect) {
8925
+ const {
8926
+ left = 0,
8927
+ top = 0,
8928
+ right = 0,
8929
+ bottom = 0
8930
+ } = this.srcRect;
8931
+ const w = Math.abs(1 + (left + right)) * width;
8932
+ const h = Math.abs(1 + (top + bottom)) * height;
8933
+ const sx = 1 / w;
8934
+ const sy = 1 / h;
8935
+ const tx = left * width * sx;
8936
+ const ty = top * height * sy;
8937
+ transform.scale(sx, sy).translate(tx, ty);
8938
+ }
8921
8939
  if (this.tile) {
8922
8940
  const {
8923
8941
  translateX = 0,
@@ -8928,6 +8946,7 @@ class BaseElement2DFill extends CoreObject {
8928
8946
  // alignment, TODO
8929
8947
  } = this.tile;
8930
8948
  transform.scale(1 / imageWidth, 1 / imageHeight).scale(1 / scaleX, 1 / scaleY).translate(-translateX / imageWidth, -translateY / imageHeight);
8949
+ disableWrapMode = true;
8931
8950
  } else if (this.stretch) {
8932
8951
  const { left = 0, top = 0, right = 0, bottom = 0 } = this.stretch.rect ?? {};
8933
8952
  const w = Math.abs(1 + (-left + -right)) * width;
@@ -8937,13 +8956,14 @@ class BaseElement2DFill extends CoreObject {
8937
8956
  const translateX = -left * width * scaleX;
8938
8957
  const translateY = -top * height * scaleY;
8939
8958
  transform.scale(scaleX, scaleY).translate(translateX, translateY);
8959
+ disableWrapMode = true;
8940
8960
  } else {
8941
8961
  transform.scale(1 / width, 1 / height);
8942
8962
  }
8943
8963
  ctx.textureTransform = transform;
8944
- ctx.fillStyle = this._image;
8964
+ ctx.fillStyle = this._src;
8945
8965
  ctx.fill({
8946
- disableWrapMode: true
8966
+ disableWrapMode
8947
8967
  });
8948
8968
  } else {
8949
8969
  ctx.fillStyle = this.color;
@@ -8951,24 +8971,99 @@ class BaseElement2DFill extends CoreObject {
8951
8971
  }
8952
8972
  }
8953
8973
  }
8954
- __decorateClass$s([
8974
+ __decorateClass$u([
8955
8975
  property()
8956
8976
  ], BaseElement2DFill.prototype, "color");
8977
+ __decorateClass$u([
8978
+ property()
8979
+ ], BaseElement2DFill.prototype, "src");
8980
+ __decorateClass$u([
8981
+ property()
8982
+ ], BaseElement2DFill.prototype, "dpi");
8983
+ __decorateClass$u([
8984
+ property()
8985
+ ], BaseElement2DFill.prototype, "rotateWithShape");
8986
+ __decorateClass$u([
8987
+ property()
8988
+ ], BaseElement2DFill.prototype, "tile");
8989
+ __decorateClass$u([
8990
+ property()
8991
+ ], BaseElement2DFill.prototype, "stretch");
8992
+ __decorateClass$u([
8993
+ property()
8994
+ ], BaseElement2DFill.prototype, "opacity");
8995
+
8996
+ var __defProp$m = Object.defineProperty;
8997
+ var __decorateClass$t = (decorators, target, key, kind) => {
8998
+ var result = void 0 ;
8999
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
9000
+ if (decorator = decorators[i])
9001
+ result = (decorator(target, key, result) ) || result;
9002
+ if (result) __defProp$m(target, key, result);
9003
+ return result;
9004
+ };
9005
+ class BaseElement2DBackground extends BaseElement2DFill {
9006
+ setProperties(properties) {
9007
+ return super.setProperties(normalizeBackground(properties));
9008
+ }
9009
+ }
9010
+ __decorateClass$t([
9011
+ property()
9012
+ ], BaseElement2DBackground.prototype, "color");
9013
+ __decorateClass$t([
9014
+ property()
9015
+ ], BaseElement2DBackground.prototype, "src");
9016
+ __decorateClass$t([
9017
+ property()
9018
+ ], BaseElement2DBackground.prototype, "dpi");
9019
+ __decorateClass$t([
9020
+ property()
9021
+ ], BaseElement2DBackground.prototype, "rotateWithShape");
9022
+ __decorateClass$t([
9023
+ property()
9024
+ ], BaseElement2DBackground.prototype, "tile");
9025
+ __decorateClass$t([
9026
+ property()
9027
+ ], BaseElement2DBackground.prototype, "stretch");
9028
+ __decorateClass$t([
9029
+ property()
9030
+ ], BaseElement2DBackground.prototype, "opacity");
9031
+
9032
+ var __defProp$l = Object.defineProperty;
9033
+ var __decorateClass$s = (decorators, target, key, kind) => {
9034
+ var result = void 0 ;
9035
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
9036
+ if (decorator = decorators[i])
9037
+ result = (decorator(target, key, result) ) || result;
9038
+ if (result) __defProp$l(target, key, result);
9039
+ return result;
9040
+ };
9041
+ class BaseElement2DForeground extends BaseElement2DFill {
9042
+ setProperties(properties) {
9043
+ return super.setProperties(normalizeForeground(properties));
9044
+ }
9045
+ }
8957
9046
  __decorateClass$s([
8958
9047
  property()
8959
- ], BaseElement2DFill.prototype, "image");
9048
+ ], BaseElement2DForeground.prototype, "color");
8960
9049
  __decorateClass$s([
8961
9050
  property()
8962
- ], BaseElement2DFill.prototype, "dpi");
9051
+ ], BaseElement2DForeground.prototype, "src");
8963
9052
  __decorateClass$s([
8964
9053
  property()
8965
- ], BaseElement2DFill.prototype, "rotateWithShape");
9054
+ ], BaseElement2DForeground.prototype, "dpi");
8966
9055
  __decorateClass$s([
8967
9056
  property()
8968
- ], BaseElement2DFill.prototype, "tile");
9057
+ ], BaseElement2DForeground.prototype, "rotateWithShape");
8969
9058
  __decorateClass$s([
8970
9059
  property()
8971
- ], BaseElement2DFill.prototype, "stretch");
9060
+ ], BaseElement2DForeground.prototype, "tile");
9061
+ __decorateClass$s([
9062
+ property()
9063
+ ], BaseElement2DForeground.prototype, "stretch");
9064
+ __decorateClass$s([
9065
+ property()
9066
+ ], BaseElement2DForeground.prototype, "opacity");
8972
9067
 
8973
9068
  var __defProp$k = Object.defineProperty;
8974
9069
  var __decorateClass$r = (decorators, target, key, kind) => {
@@ -8980,13 +9075,15 @@ var __decorateClass$r = (decorators, target, key, kind) => {
8980
9075
  return result;
8981
9076
  };
8982
9077
  class BaseElement2DGeometry extends CoreObject {
8983
- constructor(parent, properties) {
9078
+ constructor(parent) {
8984
9079
  super();
8985
9080
  this.parent = parent;
8986
- this.setProperties(properties);
8987
9081
  this._updatePath2DSet();
8988
9082
  }
8989
9083
  _path2DSet = new Path2DSet();
9084
+ setProperties(properties) {
9085
+ return super.setProperties(normalizeGeometry(properties));
9086
+ }
8990
9087
  _updateProperty(key, value, oldValue, declaration) {
8991
9088
  super._updateProperty(key, value, oldValue, declaration);
8992
9089
  switch (key) {
@@ -9066,10 +9163,12 @@ var __decorateClass$q = (decorators, target, key, kind) => {
9066
9163
  return result;
9067
9164
  };
9068
9165
  class BaseElement2DOutline extends CoreObject {
9069
- constructor(parent, properties) {
9166
+ constructor(parent) {
9070
9167
  super();
9071
9168
  this.parent = parent;
9072
- this.setProperties(properties);
9169
+ }
9170
+ setProperties(properties) {
9171
+ return super.setProperties(normalizeOutline(properties));
9073
9172
  }
9074
9173
  _updateProperty(key, value, oldValue, declaration) {
9075
9174
  super._updateProperty(key, value, oldValue, declaration);
@@ -9077,7 +9176,7 @@ class BaseElement2DOutline extends CoreObject {
9077
9176
  case "color":
9078
9177
  case "width":
9079
9178
  case "style":
9080
- case "image":
9179
+ case "src":
9081
9180
  case "opacity":
9082
9181
  this.parent.requestRedraw();
9083
9182
  break;
@@ -9106,7 +9205,7 @@ __decorateClass$q([
9106
9205
  ], BaseElement2DOutline.prototype, "style");
9107
9206
  __decorateClass$q([
9108
9207
  property()
9109
- ], BaseElement2DOutline.prototype, "image");
9208
+ ], BaseElement2DOutline.prototype, "src");
9110
9209
  __decorateClass$q([
9111
9210
  property({ default: 1 })
9112
9211
  ], BaseElement2DOutline.prototype, "opacity");
@@ -9121,10 +9220,12 @@ var __decorateClass$p = (decorators, target, key, kind) => {
9121
9220
  return result;
9122
9221
  };
9123
9222
  class BaseElement2DShadow extends CoreObject {
9124
- constructor(parent, properties) {
9223
+ constructor(parent) {
9125
9224
  super();
9126
9225
  this.parent = parent;
9127
- this.setProperties(properties);
9226
+ }
9227
+ setProperties(properties) {
9228
+ return super.setProperties(normalizeShadow(properties));
9128
9229
  }
9129
9230
  _updateProperty(key, value, oldValue, declaration) {
9130
9231
  super._updateProperty(key, value, oldValue, declaration);
@@ -9193,10 +9294,9 @@ var __decorateClass$o = (decorators, target, key, kind) => {
9193
9294
  return result;
9194
9295
  };
9195
9296
  class BaseElement2DText extends CoreObject {
9196
- constructor(parent, properties) {
9297
+ constructor(parent) {
9197
9298
  super();
9198
9299
  this.parent = parent;
9199
- this.setProperties(properties);
9200
9300
  }
9201
9301
  effects;
9202
9302
  measureDom;
@@ -9204,6 +9304,9 @@ class BaseElement2DText extends CoreObject {
9204
9304
  texture = new CanvasTexture();
9205
9305
  baseText = new Text();
9206
9306
  measureResult;
9307
+ setProperties(properties) {
9308
+ return super.setProperties(normalizeText(properties));
9309
+ }
9207
9310
  _updateProperty(key, value, oldValue, declaration) {
9208
9311
  super._updateProperty(key, value, oldValue, declaration);
9209
9312
  switch (key) {
@@ -9382,12 +9485,12 @@ let BaseElement2D = class extends Node2D {
9382
9485
  this._style?.off("updateProperty", cb);
9383
9486
  this._style = style;
9384
9487
  }
9385
- _text = new BaseElement2DText(this);
9386
- get text() {
9387
- return this._text;
9488
+ _background = new BaseElement2DBackground(this);
9489
+ get background() {
9490
+ return this._background;
9388
9491
  }
9389
- set text(value) {
9390
- this._text.setProperties(value);
9492
+ set background(value) {
9493
+ this._background.setProperties(value);
9391
9494
  }
9392
9495
  _geometry = new BaseElement2DGeometry(this);
9393
9496
  get geometry() {
@@ -9410,6 +9513,20 @@ let BaseElement2D = class extends Node2D {
9410
9513
  set outline(value) {
9411
9514
  this._outline.setProperties(value);
9412
9515
  }
9516
+ _foreground = new BaseElement2DForeground(this);
9517
+ get foreground() {
9518
+ return this._foreground;
9519
+ }
9520
+ set foreground(value) {
9521
+ this._foreground.setProperties(value);
9522
+ }
9523
+ _text = new BaseElement2DText(this);
9524
+ get text() {
9525
+ return this._text;
9526
+ }
9527
+ set text(value) {
9528
+ this._text.setProperties(value);
9529
+ }
9413
9530
  _shadow = new BaseElement2DShadow(this);
9414
9531
  get shadow() {
9415
9532
  return this._shadow;
@@ -9429,16 +9546,20 @@ let BaseElement2D = class extends Node2D {
9429
9546
  style,
9430
9547
  text,
9431
9548
  geometry,
9549
+ background,
9432
9550
  fill,
9433
9551
  outline,
9552
+ foreground,
9434
9553
  shadow,
9435
9554
  ...restProperties
9436
9555
  } = properties;
9437
9556
  style && this.style.setProperties(style);
9438
- text && this.text.setProperties(text);
9557
+ background && this.background.setProperties(background);
9439
9558
  geometry && this.geometry.setProperties(geometry);
9440
9559
  fill && this.fill.setProperties(fill);
9441
9560
  outline && this.outline.setProperties(outline);
9561
+ text && this.text.setProperties(text);
9562
+ foreground && this.foreground.setProperties(foreground);
9442
9563
  shadow && this.shadow.setProperties(shadow);
9443
9564
  super.setProperties(restProperties);
9444
9565
  }
@@ -9497,10 +9618,10 @@ let BaseElement2D = class extends Node2D {
9497
9618
  this.requestRedraw();
9498
9619
  break;
9499
9620
  case "backgroundColor":
9500
- this.fill.color = this.style.backgroundColor;
9621
+ this.background.color = this.style.backgroundColor;
9501
9622
  break;
9502
9623
  case "backgroundImage":
9503
- this.fill.image = this.style.backgroundImage;
9624
+ this.background.src = this.style.backgroundImage;
9504
9625
  break;
9505
9626
  case "borderStyle":
9506
9627
  case "outlineStyle":
@@ -9595,6 +9716,11 @@ let BaseElement2D = class extends Node2D {
9595
9716
  if (this.text.canDraw()) {
9596
9717
  this.text.updateMeasure();
9597
9718
  }
9719
+ if (this.background.canDraw()) {
9720
+ this._tree?.log(this.name, "draw background");
9721
+ this.geometry.drawRect();
9722
+ this.background.draw();
9723
+ }
9598
9724
  if (this.fill.canDraw()) {
9599
9725
  this._tree?.log(this.name, "draw fill");
9600
9726
  this.geometry.draw();
@@ -9605,6 +9731,11 @@ let BaseElement2D = class extends Node2D {
9605
9731
  this.geometry.draw();
9606
9732
  this.outline.draw();
9607
9733
  }
9734
+ if (this.foreground.canDraw()) {
9735
+ this._tree?.log(this.name, "draw foreground");
9736
+ this.geometry.drawRect();
9737
+ this.foreground.draw();
9738
+ }
9608
9739
  if (this.text.canDraw()) {
9609
9740
  this._tree?.log(this.name, "draw text");
9610
9741
  this.geometry.drawRect();
@@ -10443,13 +10574,18 @@ let Text2D = class extends TextureRect2D {
10443
10574
  measureDom;
10444
10575
  fonts;
10445
10576
  texture = new CanvasTexture();
10446
- _baseText = new Text();
10577
+ base = new Text();
10447
10578
  measureResult;
10448
10579
  _subTextsCount = 0;
10449
10580
  constructor(properties, children = []) {
10450
10581
  super();
10451
10582
  this.setProperties(properties);
10452
10583
  this.append(children);
10584
+ if (properties?.plugins) {
10585
+ properties.plugins.forEach((plugin) => {
10586
+ this.base.use(plugin);
10587
+ });
10588
+ }
10453
10589
  }
10454
10590
  _updateProperty(key, value, oldValue, declaration) {
10455
10591
  super._updateProperty(key, value, oldValue, declaration);
@@ -10469,13 +10605,14 @@ let Text2D = class extends TextureRect2D {
10469
10605
  });
10470
10606
  }
10471
10607
  }
10472
- _updateText() {
10473
- this._baseText.style = this.style.toJSON();
10474
- this._baseText.content = this.content ?? "";
10475
- this._baseText.effects = this.effects;
10476
- this._baseText.fonts = this.fonts;
10477
- this._baseText.measureDom = this.measureDom;
10478
- this._baseText.requestUpdate();
10608
+ _updateBase() {
10609
+ this.base.style = this.style.toJSON();
10610
+ this.base.content = this.content ?? "";
10611
+ this.base.effects = this.effects;
10612
+ this.base.fonts = this.fonts;
10613
+ this.base.measureDom = this.measureDom;
10614
+ this.emit("updateBase", this.base);
10615
+ this.base.requestUpdate();
10479
10616
  }
10480
10617
  _updateStyleProperty(key, value, oldValue) {
10481
10618
  switch (key) {
@@ -10527,8 +10664,8 @@ let Text2D = class extends TextureRect2D {
10527
10664
  }
10528
10665
  }
10529
10666
  measure() {
10530
- this._updateText();
10531
- return this._baseText.measure();
10667
+ this._updateBase();
10668
+ return this.base.measure();
10532
10669
  }
10533
10670
  updateMeasure() {
10534
10671
  this.measureResult = this.measure();
@@ -10579,7 +10716,7 @@ let Text2D = class extends TextureRect2D {
10579
10716
  if (onText2DRender) {
10580
10717
  onText2DRender();
10581
10718
  } else {
10582
- this._baseText.render({
10719
+ this.base.render({
10583
10720
  pixelRatio: this.texture.pixelRatio,
10584
10721
  view: this.texture.source
10585
10722
  });
@@ -13891,4 +14028,4 @@ async function render(options) {
13891
14028
  });
13892
14029
  }
13893
14030
 
13894
- export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DFill, BaseElement2DGeometry, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DStyle, BaseElement2DText, CanvasContext, CanvasItem, CanvasItemEditor, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, Control, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, EventEmitter, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GIFLoader, GaussianBlurEffect, Geometry, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JSONLoader, KawaseBlurEffect, KawaseTransition, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, RawWeakMap, Rect2, RefCounted, Renderer, Resource, Ruler, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, SceneTree, ScrollBar, Text2D, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, XScrollBar, YScrollBar, ZoomBlurEffect, assets, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, frag$1 as frag, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
14031
+ export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DBackground, BaseElement2DFill, BaseElement2DForeground, BaseElement2DGeometry, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DStyle, BaseElement2DText, CanvasContext, CanvasItem, CanvasItemEditor, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, Control, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, EventEmitter, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GIFLoader, GaussianBlurEffect, Geometry, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JSONLoader, KawaseBlurEffect, KawaseTransition, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, RawWeakMap, Rect2, RefCounted, Renderer, Resource, Ruler, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, SceneTree, ScrollBar, Text2D, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, XScrollBar, YScrollBar, ZoomBlurEffect, assets, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, frag$1 as frag, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };