modern-canvas 0.10.3 → 0.11.0

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
@@ -1131,6 +1131,9 @@ class Vector extends Observable {
1131
1131
  toArray() {
1132
1132
  return this._array.slice();
1133
1133
  }
1134
+ toFloat32Array() {
1135
+ return new Float32Array(this._array);
1136
+ }
1134
1137
  toJSON() {
1135
1138
  return this.toArray();
1136
1139
  }
@@ -1268,6 +1271,9 @@ class Matrix extends Observable {
1268
1271
  }
1269
1272
  return array.slice();
1270
1273
  }
1274
+ toFloat32Array(transpose) {
1275
+ return new Float32Array(this.toArray(transpose));
1276
+ }
1271
1277
  toName() {
1272
1278
  return `Matrix${this.rows}(${this.rows}x${this.cols})`;
1273
1279
  }
@@ -2091,13 +2097,13 @@ class Vector3 extends Vector {
2091
2097
  }
2092
2098
  }
2093
2099
 
2094
- var __defProp$T = Object.defineProperty;
2095
- var __decorateClass$$ = (decorators, target, key, kind) => {
2100
+ var __defProp$R = Object.defineProperty;
2101
+ var __decorateClass$V = (decorators, target, key, kind) => {
2096
2102
  var result = void 0 ;
2097
2103
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
2098
2104
  if (decorator = decorators[i])
2099
2105
  result = (decorator(target, key, result) ) || result;
2100
- if (result) __defProp$T(target, key, result);
2106
+ if (result) __defProp$R(target, key, result);
2101
2107
  return result;
2102
2108
  };
2103
2109
  class MainLoop extends CoreObject {
@@ -2145,20 +2151,20 @@ class MainLoop extends CoreObject {
2145
2151
  super.destroy();
2146
2152
  }
2147
2153
  }
2148
- __decorateClass$$([
2154
+ __decorateClass$V([
2149
2155
  property({ fallback: 60 })
2150
2156
  ], MainLoop.prototype, "fps");
2151
- __decorateClass$$([
2157
+ __decorateClass$V([
2152
2158
  property({ fallback: 1 })
2153
2159
  ], MainLoop.prototype, "speed");
2154
2160
 
2155
- var __defProp$S = Object.defineProperty;
2156
- var __decorateClass$_ = (decorators, target, key, kind) => {
2161
+ var __defProp$Q = Object.defineProperty;
2162
+ var __decorateClass$U = (decorators, target, key, kind) => {
2157
2163
  var result = void 0 ;
2158
2164
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
2159
2165
  if (decorator = decorators[i])
2160
2166
  result = (decorator(target, key, result) ) || result;
2161
- if (result) __defProp$S(target, key, result);
2167
+ if (result) __defProp$Q(target, key, result);
2162
2168
  return result;
2163
2169
  };
2164
2170
  class Renderer extends Reactivable {
@@ -2202,10 +2208,10 @@ class Renderer extends Reactivable {
2202
2208
  super.destroy();
2203
2209
  }
2204
2210
  }
2205
- __decorateClass$_([
2211
+ __decorateClass$U([
2206
2212
  property({ fallback: DEVICE_PIXEL_RATIO })
2207
2213
  ], Renderer.prototype, "pixelRatio");
2208
- __decorateClass$_([
2214
+ __decorateClass$U([
2209
2215
  property({ internal: true })
2210
2216
  ], Renderer.prototype, "view");
2211
2217
 
@@ -2437,6 +2443,8 @@ class WebGLBatch2DModule extends WebGLModule {
2437
2443
  // 1
2438
2444
  aPosition: { size: 2, normalized: false, type: "float" },
2439
2445
  // 2
2446
+ aDimension: { size: 2, normalized: false, type: "float" },
2447
+ // 2
2440
2448
  aUv: { size: 2, normalized: false, type: "float" },
2441
2449
  // 2
2442
2450
  aModulate: { size: 4, normalized: true, type: "unsigned_byte" },
@@ -2446,7 +2454,7 @@ class WebGLBatch2DModule extends WebGLModule {
2446
2454
  aDisableWrapMode: { size: 1, normalized: true, type: "float" }
2447
2455
  // 1
2448
2456
  };
2449
- _vertexSize = 1 + 2 + 2 + 1 + 1 + 1;
2457
+ _vertexSize = 1 + 2 + 2 + 2 + 1 + 1 + 1;
2450
2458
  _getShader(maxTextureUnits) {
2451
2459
  let shader = this._shaders.get(maxTextureUnits);
2452
2460
  if (!shader) {
@@ -2460,6 +2468,7 @@ class WebGLBatch2DModule extends WebGLModule {
2460
2468
  vert: `precision highp float;
2461
2469
  attribute float aTextureId;
2462
2470
  attribute vec2 aPosition;
2471
+ attribute vec2 aDimension;
2463
2472
  attribute vec2 aUv;
2464
2473
  attribute vec4 aModulate;
2465
2474
  attribute vec4 aBackgroundColor;
@@ -2468,30 +2477,20 @@ attribute float aDisableWrapMode;
2468
2477
  uniform mat3 projectionMatrix;
2469
2478
  uniform mat3 viewMatrix;
2470
2479
  uniform vec4 modulate;
2471
- uniform float canvasWidth;
2472
- uniform float canvasHeight;
2473
2480
 
2474
2481
  varying float vTextureId;
2482
+ varying vec2 vDimension;
2475
2483
  varying vec2 vUv;
2476
2484
  varying vec4 vModulate;
2477
2485
  varying vec4 vBackgroundColor;
2478
2486
  varying float vDisableWrapMode;
2479
2487
 
2480
- vec2 roundPixels(vec2 position, vec2 targetSize) {
2481
- return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
2482
- }
2483
-
2484
2488
  void main(void) {
2485
- mat3 modelMatrix = mat3(
2486
- 1.0, 0.0, 0.0,
2487
- 0.0, 1.0, 0.0,
2488
- 0.0, 0.0, 1.0
2489
- );
2490
- vTextureId = aTextureId;
2491
- vec3 pos = projectionMatrix * viewMatrix * modelMatrix * vec3(aPosition, 1.0);
2492
- gl_Position = vec4(roundPixels(pos.xy, vec2(canvasWidth, canvasHeight)), 0.0, 1.0);
2493
- // gl_Position = vec4(pos.xy, 0.0, 1.0);
2489
+ vec3 pos3 = projectionMatrix * viewMatrix * vec3(aPosition.xy, 1.0);
2490
+ gl_Position = vec4(pos3.xy, 0.0, 1.0);
2494
2491
 
2492
+ vTextureId = aTextureId;
2493
+ vDimension = aDimension;
2495
2494
  vUv = aUv;
2496
2495
  vModulate = aModulate * modulate;
2497
2496
  vBackgroundColor = aBackgroundColor;
@@ -2499,16 +2498,27 @@ void main(void) {
2499
2498
  }`,
2500
2499
  frag: `precision highp float;
2501
2500
  varying float vTextureId;
2501
+ varying vec2 vDimension;
2502
2502
  varying vec2 vUv;
2503
2503
  varying vec4 vModulate;
2504
2504
  varying vec4 vBackgroundColor;
2505
2505
  varying float vDisableWrapMode;
2506
2506
 
2507
+ uniform mat3 viewMatrix;
2507
2508
  uniform sampler2D samplers[${maxTextureUnits}];
2509
+ uniform vec2 zoom;
2510
+ uniform vec2 translate;
2508
2511
 
2509
2512
  void main(void) {
2513
+ vec2 uv = vUv;
2514
+
2515
+ if (vDimension.x > 0.0 && vDimension.y > 0.0) {
2516
+ uv = floor(uv * vDimension);
2517
+ uv = uv / vDimension;
2518
+ }
2519
+
2510
2520
  vec4 color = vec4(0.0, 0.0, 0.0, 0.0);
2511
- if (vDisableWrapMode > 0.0 && (vUv.x < 0.0 || vUv.y < 0.0 || vUv.x > 1.0 || vUv.y > 1.0))
2521
+ if (vDisableWrapMode > 0.0 && (uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0 || uv.y > 1.0))
2512
2522
  {
2513
2523
  //
2514
2524
  }
@@ -2527,7 +2537,7 @@ void main(void) {
2527
2537
  }
2528
2538
  return `${text}
2529
2539
  {
2530
- color = texture2D(samplers[${i}], vUv);
2540
+ color = texture2D(samplers[${i}], uv);
2531
2541
  }`;
2532
2542
  }).join("")}
2533
2543
 
@@ -2573,11 +2583,12 @@ void main(void) {
2573
2583
  draw: (options) => {
2574
2584
  const renderer2 = this._renderer;
2575
2585
  renderer2.program.bind(program);
2586
+ const viewMatrix = renderer2.program.uniforms.viewMatrix;
2576
2587
  renderer2.program.updateUniforms(program, {
2577
2588
  samplers,
2578
2589
  modulate: [1, 1, 1, 1],
2579
- canvasWidth: renderer2.gl.drawingBufferWidth,
2580
- canvasHeight: renderer2.gl.drawingBufferHeight,
2590
+ zoom: [viewMatrix[0], viewMatrix[4]],
2591
+ translate: [viewMatrix[6], viewMatrix[7]],
2581
2592
  ...renderer2.program.uniforms
2582
2593
  });
2583
2594
  renderer2.vertexArray.bind(vao ?? vertexArray);
@@ -2634,7 +2645,8 @@ void main(void) {
2634
2645
  const {
2635
2646
  indices,
2636
2647
  vertices,
2637
- uvs = [],
2648
+ uvs = new Float32Array(0),
2649
+ dimension = new Float32Array(0),
2638
2650
  texture: texture2,
2639
2651
  modulate = this._defaultModulate,
2640
2652
  backgroundColor = this._defaultBackgroundColor,
@@ -2656,6 +2668,8 @@ void main(void) {
2656
2668
  float32View[aIndex++] = textureLocation;
2657
2669
  float32View[aIndex++] = vertices[i2];
2658
2670
  float32View[aIndex++] = vertices[i2 + 1];
2671
+ float32View[aIndex++] = dimension[0];
2672
+ float32View[aIndex++] = dimension[1];
2659
2673
  float32View[aIndex++] = uvs[i2];
2660
2674
  float32View[aIndex++] = uvs[i2 + 1];
2661
2675
  if (modulate) {
@@ -2713,11 +2727,6 @@ void main(void) {
2713
2727
  });
2714
2728
  }
2715
2729
  }
2716
- /**
2717
- * Fetches an attribute buffer from `this._attributeBuffer` that can hold atleast `size` floats.
2718
- * @param size - minimum capacity required
2719
- * @returns - buffer than can hold atleast `size` floats
2720
- */
2721
2730
  _getAttributeBuffer(size) {
2722
2731
  const roundedP2 = nextPow2(Math.ceil(size / 8));
2723
2732
  const roundedSizeIndex = log2(roundedP2);
@@ -2731,12 +2740,6 @@ void main(void) {
2731
2740
  }
2732
2741
  return buffer;
2733
2742
  }
2734
- /**
2735
- * Fetches an index buffer from `this._indexBuffers` that can
2736
- * have at least `size` capacity.
2737
- * @param size - minimum required capacity
2738
- * @returns - buffer that can fit `size` indices.
2739
- */
2740
2743
  _getIndexBuffer(size) {
2741
2744
  const roundedP2 = nextPow2(Math.ceil(size / 12));
2742
2745
  const roundedSizeIndex = log2(roundedP2);
@@ -4405,13 +4408,13 @@ class Geometry extends Resource {
4405
4408
  }
4406
4409
  }
4407
4410
 
4408
- var __defProp$R = Object.defineProperty;
4409
- var __decorateClass$Z = (decorators, target, key, kind) => {
4411
+ var __defProp$P = Object.defineProperty;
4412
+ var __decorateClass$T = (decorators, target, key, kind) => {
4410
4413
  var result = void 0 ;
4411
4414
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4412
4415
  if (decorator = decorators[i])
4413
4416
  result = (decorator(target, key, result) ) || result;
4414
- if (result) __defProp$R(target, key, result);
4417
+ if (result) __defProp$P(target, key, result);
4415
4418
  return result;
4416
4419
  };
4417
4420
  class IndexBuffer extends Resource {
@@ -4455,20 +4458,20 @@ class IndexBuffer extends Resource {
4455
4458
  return result;
4456
4459
  }
4457
4460
  }
4458
- __decorateClass$Z([
4461
+ __decorateClass$T([
4459
4462
  property({ internal: true, fallback: null })
4460
4463
  ], IndexBuffer.prototype, "data");
4461
- __decorateClass$Z([
4464
+ __decorateClass$T([
4462
4465
  property({ internal: true, fallback: false })
4463
4466
  ], IndexBuffer.prototype, "dynamic");
4464
4467
 
4465
- var __defProp$Q = Object.defineProperty;
4466
- var __decorateClass$Y = (decorators, target, key, kind) => {
4468
+ var __defProp$O = Object.defineProperty;
4469
+ var __decorateClass$S = (decorators, target, key, kind) => {
4467
4470
  var result = void 0 ;
4468
4471
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4469
4472
  if (decorator = decorators[i])
4470
4473
  result = (decorator(target, key, result) ) || result;
4471
- if (result) __defProp$Q(target, key, result);
4474
+ if (result) __defProp$O(target, key, result);
4472
4475
  return result;
4473
4476
  };
4474
4477
  class VertexBuffer extends Resource {
@@ -4512,20 +4515,20 @@ class VertexBuffer extends Resource {
4512
4515
  return result;
4513
4516
  }
4514
4517
  }
4515
- __decorateClass$Y([
4518
+ __decorateClass$S([
4516
4519
  property({ internal: true, default: null })
4517
4520
  ], VertexBuffer.prototype, "data");
4518
- __decorateClass$Y([
4521
+ __decorateClass$S([
4519
4522
  property({ internal: true, fallback: false })
4520
4523
  ], VertexBuffer.prototype, "dynamic");
4521
4524
 
4522
- var __defProp$P = Object.defineProperty;
4523
- var __decorateClass$X = (decorators, target, key, kind) => {
4525
+ var __defProp$N = Object.defineProperty;
4526
+ var __decorateClass$R = (decorators, target, key, kind) => {
4524
4527
  var result = void 0 ;
4525
4528
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4526
4529
  if (decorator = decorators[i])
4527
4530
  result = (decorator(target, key, result) ) || result;
4528
- if (result) __defProp$P(target, key, result);
4531
+ if (result) __defProp$N(target, key, result);
4529
4532
  return result;
4530
4533
  };
4531
4534
  class VertexAttribute extends Resource {
@@ -4559,25 +4562,25 @@ class VertexAttribute extends Resource {
4559
4562
  return result;
4560
4563
  }
4561
4564
  }
4562
- __decorateClass$X([
4565
+ __decorateClass$R([
4563
4566
  property({ internal: true })
4564
4567
  ], VertexAttribute.prototype, "buffer");
4565
- __decorateClass$X([
4568
+ __decorateClass$R([
4566
4569
  property({ fallback: 0 })
4567
4570
  ], VertexAttribute.prototype, "size");
4568
- __decorateClass$X([
4571
+ __decorateClass$R([
4569
4572
  property({ fallback: false })
4570
4573
  ], VertexAttribute.prototype, "normalized");
4571
- __decorateClass$X([
4574
+ __decorateClass$R([
4572
4575
  property({ fallback: "float" })
4573
4576
  ], VertexAttribute.prototype, "type");
4574
- __decorateClass$X([
4577
+ __decorateClass$R([
4575
4578
  property()
4576
4579
  ], VertexAttribute.prototype, "stride");
4577
- __decorateClass$X([
4580
+ __decorateClass$R([
4578
4581
  property()
4579
4582
  ], VertexAttribute.prototype, "offset");
4580
- __decorateClass$X([
4583
+ __decorateClass$R([
4581
4584
  property()
4582
4585
  ], VertexAttribute.prototype, "divisor");
4583
4586
 
@@ -4821,13 +4824,13 @@ class UvGeometry extends Geometry {
4821
4824
  }
4822
4825
  }
4823
4826
 
4824
- var __defProp$O = Object.defineProperty;
4825
- var __decorateClass$W = (decorators, target, key, kind) => {
4827
+ var __defProp$M = Object.defineProperty;
4828
+ var __decorateClass$Q = (decorators, target, key, kind) => {
4826
4829
  var result = void 0 ;
4827
4830
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4828
4831
  if (decorator = decorators[i])
4829
4832
  result = (decorator(target, key, result) ) || result;
4830
- if (result) __defProp$O(target, key, result);
4833
+ if (result) __defProp$M(target, key, result);
4831
4834
  return result;
4832
4835
  };
4833
4836
  class Texture2D extends Resource {
@@ -4955,22 +4958,22 @@ class Texture2D extends Resource {
4955
4958
  }
4956
4959
  }
4957
4960
  }
4958
- __decorateClass$W([
4961
+ __decorateClass$Q([
4959
4962
  property({ internal: true })
4960
4963
  ], Texture2D.prototype, "source");
4961
- __decorateClass$W([
4964
+ __decorateClass$Q([
4962
4965
  property({ fallback: 0 })
4963
4966
  ], Texture2D.prototype, "width");
4964
- __decorateClass$W([
4967
+ __decorateClass$Q([
4965
4968
  property({ fallback: 0 })
4966
4969
  ], Texture2D.prototype, "height");
4967
- __decorateClass$W([
4970
+ __decorateClass$Q([
4968
4971
  property({ fallback: "linear" })
4969
4972
  ], Texture2D.prototype, "filterMode");
4970
- __decorateClass$W([
4973
+ __decorateClass$Q([
4971
4974
  property({ fallback: "clamp_to_edge" })
4972
4975
  ], Texture2D.prototype, "wrapMode");
4973
- __decorateClass$W([
4976
+ __decorateClass$Q([
4974
4977
  property({ fallback: 1 })
4975
4978
  ], Texture2D.prototype, "pixelRatio");
4976
4979
 
@@ -5004,13 +5007,13 @@ class AnimatedTexture extends Resource {
5004
5007
  }
5005
5008
  }
5006
5009
 
5007
- var __defProp$N = Object.defineProperty;
5008
- var __decorateClass$V = (decorators, target, key, kind) => {
5010
+ var __defProp$L = Object.defineProperty;
5011
+ var __decorateClass$P = (decorators, target, key, kind) => {
5009
5012
  var result = void 0 ;
5010
5013
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5011
5014
  if (decorator = decorators[i])
5012
5015
  result = (decorator(target, key, result) ) || result;
5013
- if (result) __defProp$N(target, key, result);
5016
+ if (result) __defProp$L(target, key, result);
5014
5017
  return result;
5015
5018
  };
5016
5019
  class CanvasTexture extends Texture2D {
@@ -5029,7 +5032,7 @@ class CanvasTexture extends Texture2D {
5029
5032
  super._updateProperty(key, value, oldValue);
5030
5033
  }
5031
5034
  }
5032
- __decorateClass$V([
5035
+ __decorateClass$P([
5033
5036
  property({ fallback: 2 })
5034
5037
  ], CanvasTexture.prototype, "pixelRatio");
5035
5038
 
@@ -5251,13 +5254,13 @@ class PixelsTexture extends Texture2D {
5251
5254
  }
5252
5255
  }
5253
5256
 
5254
- var __defProp$M = Object.defineProperty;
5255
- var __decorateClass$U = (decorators, target, key, kind) => {
5257
+ var __defProp$K = Object.defineProperty;
5258
+ var __decorateClass$O = (decorators, target, key, kind) => {
5256
5259
  var result = void 0 ;
5257
5260
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5258
5261
  if (decorator = decorators[i])
5259
5262
  result = (decorator(target, key, result) ) || result;
5260
- if (result) __defProp$M(target, key, result);
5263
+ if (result) __defProp$K(target, key, result);
5261
5264
  return result;
5262
5265
  };
5263
5266
  function resolveOptions(options) {
@@ -5501,10 +5504,10 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5501
5504
  }
5502
5505
  }
5503
5506
  };
5504
- __decorateClass$U([
5507
+ __decorateClass$O([
5505
5508
  property({ internal: true, fallback: true })
5506
5509
  ], _VideoTexture.prototype, "autoUpdate");
5507
- __decorateClass$U([
5510
+ __decorateClass$O([
5508
5511
  property({ internal: true, fallback: 0 })
5509
5512
  ], _VideoTexture.prototype, "fps");
5510
5513
  let VideoTexture = _VideoTexture;
@@ -5639,7 +5642,6 @@ class CanvasContext extends Path2D {
5639
5642
  }
5640
5643
  buildUvs(start, vertices, uvs, texture, uvTransform) {
5641
5644
  if (texture) {
5642
- const _uvTransform = uvTransform ? typeof uvTransform === "function" ? uvTransform : (x, y) => uvTransform.apply({ x, y }).toArray() : uvTransform;
5643
5645
  const w = texture.width;
5644
5646
  const h = texture.height;
5645
5647
  for (let len = vertices.length, i = start; i < len; i += 2) {
@@ -5647,8 +5649,8 @@ class CanvasContext extends Path2D {
5647
5649
  const y = vertices[i + 1];
5648
5650
  let uvX;
5649
5651
  let uvY;
5650
- if (_uvTransform) {
5651
- [uvX, uvY] = _uvTransform(x, y);
5652
+ if (uvTransform) {
5653
+ [uvX, uvY] = uvTransform.apply({ x, y }).toArray();
5652
5654
  } else {
5653
5655
  [uvX, uvY] = [x / w, y / h];
5654
5656
  }
@@ -5684,6 +5686,7 @@ class CanvasContext extends Path2D {
5684
5686
  if (current.texture) {
5685
5687
  this.buildUvs(0, vertices, uvs, current.texture, current.uvTransform);
5686
5688
  }
5689
+ const box = current.path.getBoundingBox();
5687
5690
  batchables.push({
5688
5691
  vertices: new Float32Array(vertices),
5689
5692
  indices: new Float32Array(indices),
@@ -5692,7 +5695,9 @@ class CanvasContext extends Path2D {
5692
5695
  backgroundColor: current.backgroundColor,
5693
5696
  type: current.type,
5694
5697
  disableWrapMode: current.disableWrapMode,
5695
- vertTransform: current.vertTransform
5698
+ uvTransform: current.uvTransform,
5699
+ vertTransform: current.vertTransform,
5700
+ dimension: new Float32Array([box.width, box.height])
5696
5701
  });
5697
5702
  }
5698
5703
  return batchables;
@@ -5794,14 +5799,14 @@ class Meta extends CoreObject {
5794
5799
  }
5795
5800
  }
5796
5801
 
5797
- var __defProp$L = Object.defineProperty;
5798
- var __getOwnPropDesc$J = Object.getOwnPropertyDescriptor;
5799
- var __decorateClass$T = (decorators, target, key, kind) => {
5800
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$J(target, key) : target;
5802
+ var __defProp$J = Object.defineProperty;
5803
+ var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor;
5804
+ var __decorateClass$N = (decorators, target, key, kind) => {
5805
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$D(target, key) : target;
5801
5806
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5802
5807
  if (decorator = decorators[i])
5803
5808
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5804
- if (kind && result) __defProp$L(target, key, result);
5809
+ if (kind && result) __defProp$J(target, key, result);
5805
5810
  return result;
5806
5811
  };
5807
5812
  const iidMap = {};
@@ -6315,42 +6320,42 @@ let Node = class extends CoreObject {
6315
6320
  return node;
6316
6321
  }
6317
6322
  };
6318
- __decorateClass$T([
6323
+ __decorateClass$N([
6319
6324
  property({ fallback: idGenerator() })
6320
6325
  ], Node.prototype, "id", 2);
6321
- __decorateClass$T([
6326
+ __decorateClass$N([
6322
6327
  property({ fallback: idGenerator() })
6323
6328
  ], Node.prototype, "name", 2);
6324
- __decorateClass$T([
6329
+ __decorateClass$N([
6325
6330
  property({ internal: true, fallback: "inherit" })
6326
6331
  ], Node.prototype, "processMode", 2);
6327
- __decorateClass$T([
6332
+ __decorateClass$N([
6328
6333
  property({ internal: true, fallback: "default" })
6329
6334
  ], Node.prototype, "processSortMode", 2);
6330
- __decorateClass$T([
6335
+ __decorateClass$N([
6331
6336
  property({ internal: true, fallback: "inherit" })
6332
6337
  ], Node.prototype, "renderMode", 2);
6333
- __decorateClass$T([
6338
+ __decorateClass$N([
6334
6339
  property({ internal: true, fallback: "inherit" })
6335
6340
  ], Node.prototype, "inputMode", 2);
6336
- __decorateClass$T([
6341
+ __decorateClass$N([
6337
6342
  property({ internal: true, fallback: "default" })
6338
6343
  ], Node.prototype, "internalMode", 2);
6339
- __decorateClass$T([
6344
+ __decorateClass$N([
6340
6345
  property({ internal: true })
6341
6346
  ], Node.prototype, "mask", 2);
6342
- Node = __decorateClass$T([
6347
+ Node = __decorateClass$N([
6343
6348
  customNode("Node")
6344
6349
  ], Node);
6345
6350
 
6346
- var __defProp$K = Object.defineProperty;
6347
- var __getOwnPropDesc$I = Object.getOwnPropertyDescriptor;
6348
- var __decorateClass$S = (decorators, target, key, kind) => {
6349
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$I(target, key) : target;
6351
+ var __defProp$I = Object.defineProperty;
6352
+ var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
6353
+ var __decorateClass$M = (decorators, target, key, kind) => {
6354
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$C(target, key) : target;
6350
6355
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6351
6356
  if (decorator = decorators[i])
6352
6357
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6353
- if (kind && result) __defProp$K(target, key, result);
6358
+ if (kind && result) __defProp$I(target, key, result);
6354
6359
  return result;
6355
6360
  };
6356
6361
  let TimelineNode = class extends Node {
@@ -6410,30 +6415,30 @@ let TimelineNode = class extends Node {
6410
6415
  this._updateCurrentTime();
6411
6416
  }
6412
6417
  };
6413
- __decorateClass$S([
6418
+ __decorateClass$M([
6414
6419
  property({ fallback: 0 })
6415
6420
  ], TimelineNode.prototype, "delay", 2);
6416
- __decorateClass$S([
6421
+ __decorateClass$M([
6417
6422
  property({ fallback: 0 })
6418
6423
  ], TimelineNode.prototype, "duration", 2);
6419
- __decorateClass$S([
6424
+ __decorateClass$M([
6420
6425
  property({ fallback: false })
6421
6426
  ], TimelineNode.prototype, "paused", 2);
6422
- __decorateClass$S([
6427
+ __decorateClass$M([
6423
6428
  property({ internal: true, fallback: false })
6424
6429
  ], TimelineNode.prototype, "insideTimeRange", 2);
6425
- TimelineNode = __decorateClass$S([
6430
+ TimelineNode = __decorateClass$M([
6426
6431
  customNode("TimelineNode")
6427
6432
  ], TimelineNode);
6428
6433
 
6429
- var __defProp$J = Object.defineProperty;
6430
- var __getOwnPropDesc$H = Object.getOwnPropertyDescriptor;
6431
- var __decorateClass$R = (decorators, target, key, kind) => {
6432
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$H(target, key) : target;
6434
+ var __defProp$H = Object.defineProperty;
6435
+ var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
6436
+ var __decorateClass$L = (decorators, target, key, kind) => {
6437
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$B(target, key) : target;
6433
6438
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6434
6439
  if (decorator = decorators[i])
6435
6440
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6436
- if (kind && result) __defProp$J(target, key, result);
6441
+ if (kind && result) __defProp$H(target, key, result);
6437
6442
  return result;
6438
6443
  };
6439
6444
  let CanvasItem = class extends TimelineNode {
@@ -6586,30 +6591,30 @@ let CanvasItem = class extends TimelineNode {
6586
6591
  super._render(renderer);
6587
6592
  }
6588
6593
  };
6589
- __decorateClass$R([
6594
+ __decorateClass$L([
6590
6595
  property()
6591
6596
  ], CanvasItem.prototype, "modulate", 2);
6592
- __decorateClass$R([
6597
+ __decorateClass$L([
6593
6598
  property()
6594
6599
  ], CanvasItem.prototype, "blendMode", 2);
6595
- __decorateClass$R([
6600
+ __decorateClass$L([
6596
6601
  property({ internal: true, fallback: true })
6597
6602
  ], CanvasItem.prototype, "visible", 2);
6598
- __decorateClass$R([
6603
+ __decorateClass$L([
6599
6604
  property({ internal: true, fallback: 1 })
6600
6605
  ], CanvasItem.prototype, "opacity", 2);
6601
- CanvasItem = __decorateClass$R([
6606
+ CanvasItem = __decorateClass$L([
6602
6607
  customNode("CanvasItem")
6603
6608
  ], CanvasItem);
6604
6609
 
6605
- var __defProp$I = Object.defineProperty;
6606
- var __getOwnPropDesc$G = Object.getOwnPropertyDescriptor;
6607
- var __decorateClass$Q = (decorators, target, key, kind) => {
6608
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$G(target, key) : target;
6610
+ var __defProp$G = Object.defineProperty;
6611
+ var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
6612
+ var __decorateClass$K = (decorators, target, key, kind) => {
6613
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$A(target, key) : target;
6609
6614
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6610
6615
  if (decorator = decorators[i])
6611
6616
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6612
- if (kind && result) __defProp$I(target, key, result);
6617
+ if (kind && result) __defProp$G(target, key, result);
6613
6618
  return result;
6614
6619
  };
6615
6620
  let Viewport = class extends Node {
@@ -6760,33 +6765,33 @@ let Viewport = class extends Node {
6760
6765
  return this.canvasTransform.apply(globalPos, newPos);
6761
6766
  }
6762
6767
  };
6763
- __decorateClass$Q([
6768
+ __decorateClass$K([
6764
6769
  property({ fallback: 0 })
6765
6770
  ], Viewport.prototype, "x", 2);
6766
- __decorateClass$Q([
6771
+ __decorateClass$K([
6767
6772
  property({ fallback: 0 })
6768
6773
  ], Viewport.prototype, "y", 2);
6769
- __decorateClass$Q([
6774
+ __decorateClass$K([
6770
6775
  property({ fallback: 0 })
6771
6776
  ], Viewport.prototype, "width", 2);
6772
- __decorateClass$Q([
6777
+ __decorateClass$K([
6773
6778
  property({ fallback: 0 })
6774
6779
  ], Viewport.prototype, "height", 2);
6775
- __decorateClass$Q([
6780
+ __decorateClass$K([
6776
6781
  property({ internal: true, fallback: false })
6777
6782
  ], Viewport.prototype, "msaa", 2);
6778
- Viewport = __decorateClass$Q([
6783
+ Viewport = __decorateClass$K([
6779
6784
  customNode("Viewport")
6780
6785
  ], Viewport);
6781
6786
 
6782
- var __defProp$H = Object.defineProperty;
6783
- var __getOwnPropDesc$F = Object.getOwnPropertyDescriptor;
6784
- var __decorateClass$P = (decorators, target, key, kind) => {
6785
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$F(target, key) : target;
6787
+ var __defProp$F = Object.defineProperty;
6788
+ var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
6789
+ var __decorateClass$J = (decorators, target, key, kind) => {
6790
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target;
6786
6791
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6787
6792
  if (decorator = decorators[i])
6788
6793
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6789
- if (kind && result) __defProp$H(target, key, result);
6794
+ if (kind && result) __defProp$F(target, key, result);
6790
6795
  return result;
6791
6796
  };
6792
6797
  let Effect = class extends TimelineNode {
@@ -7028,19 +7033,19 @@ let Effect = class extends TimelineNode {
7028
7033
  }
7029
7034
  }
7030
7035
  };
7031
- __decorateClass$P([
7036
+ __decorateClass$J([
7032
7037
  property({ internal: true })
7033
7038
  ], Effect.prototype, "material", 2);
7034
- __decorateClass$P([
7039
+ __decorateClass$J([
7035
7040
  property()
7036
7041
  ], Effect.prototype, "effectMode", 2);
7037
- __decorateClass$P([
7038
- property({ fallback: "" })
7042
+ __decorateClass$J([
7043
+ property()
7039
7044
  ], Effect.prototype, "glsl", 2);
7040
- __decorateClass$P([
7041
- property({ fallback: "" })
7045
+ __decorateClass$J([
7046
+ property()
7042
7047
  ], Effect.prototype, "glslSrc", 2);
7043
- Effect = __decorateClass$P([
7048
+ Effect = __decorateClass$J([
7044
7049
  customNode("Effect")
7045
7050
  ], Effect);
7046
7051
 
@@ -7070,14 +7075,14 @@ class RenderStack {
7070
7075
  }
7071
7076
  }
7072
7077
 
7073
- var __defProp$G = Object.defineProperty;
7074
- var __getOwnPropDesc$E = Object.getOwnPropertyDescriptor;
7075
- var __decorateClass$O = (decorators, target, key, kind) => {
7076
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$E(target, key) : target;
7078
+ var __defProp$E = Object.defineProperty;
7079
+ var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
7080
+ var __decorateClass$I = (decorators, target, key, kind) => {
7081
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target;
7077
7082
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7078
7083
  if (decorator = decorators[i])
7079
7084
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7080
- if (kind && result) __defProp$G(target, key, result);
7085
+ if (kind && result) __defProp$E(target, key, result);
7081
7086
  return result;
7082
7087
  };
7083
7088
  let Timeline = class extends Node {
@@ -7122,48 +7127,48 @@ let Timeline = class extends Node {
7122
7127
  this.addTime(delta);
7123
7128
  }
7124
7129
  };
7125
- __decorateClass$O([
7130
+ __decorateClass$I([
7126
7131
  property({ fallback: 0 })
7127
7132
  ], Timeline.prototype, "startTime", 2);
7128
- __decorateClass$O([
7133
+ __decorateClass$I([
7129
7134
  property({ fallback: 0 })
7130
7135
  ], Timeline.prototype, "currentTime", 2);
7131
- __decorateClass$O([
7136
+ __decorateClass$I([
7132
7137
  property({ fallback: Number.MAX_SAFE_INTEGER })
7133
7138
  ], Timeline.prototype, "endTime", 2);
7134
- __decorateClass$O([
7139
+ __decorateClass$I([
7135
7140
  property({ fallback: false })
7136
7141
  ], Timeline.prototype, "loop", 2);
7137
- Timeline = __decorateClass$O([
7142
+ Timeline = __decorateClass$I([
7138
7143
  customNode("Timeline")
7139
7144
  ], Timeline);
7140
7145
 
7141
- var __defProp$F = Object.defineProperty;
7142
- var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor;
7143
- var __decorateClass$N = (decorators, target, key, kind) => {
7144
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$D(target, key) : target;
7146
+ var __defProp$D = Object.defineProperty;
7147
+ var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
7148
+ var __decorateClass$H = (decorators, target, key, kind) => {
7149
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target;
7145
7150
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7146
7151
  if (decorator = decorators[i])
7147
7152
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7148
- if (kind && result) __defProp$F(target, key, result);
7153
+ if (kind && result) __defProp$D(target, key, result);
7149
7154
  return result;
7150
7155
  };
7151
7156
  let Window = class extends Viewport {
7152
7157
  };
7153
- __decorateClass$N([
7158
+ __decorateClass$H([
7154
7159
  property({ fallback: false })
7155
7160
  ], Window.prototype, "msaa", 2);
7156
- Window = __decorateClass$N([
7161
+ Window = __decorateClass$H([
7157
7162
  customNode("Window")
7158
7163
  ], Window);
7159
7164
 
7160
- var __defProp$E = Object.defineProperty;
7161
- var __decorateClass$M = (decorators, target, key, kind) => {
7165
+ var __defProp$C = Object.defineProperty;
7166
+ var __decorateClass$G = (decorators, target, key, kind) => {
7162
7167
  var result = void 0 ;
7163
7168
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7164
7169
  if (decorator = decorators[i])
7165
7170
  result = (decorator(target, key, result) ) || result;
7166
- if (result) __defProp$E(target, key, result);
7171
+ if (result) __defProp$C(target, key, result);
7167
7172
  return result;
7168
7173
  };
7169
7174
  class SceneTree extends MainLoop {
@@ -7243,25 +7248,25 @@ class SceneTree extends MainLoop {
7243
7248
  super.destroy();
7244
7249
  }
7245
7250
  }
7246
- __decorateClass$M([
7251
+ __decorateClass$G([
7247
7252
  property()
7248
7253
  ], SceneTree.prototype, "backgroundColor");
7249
- __decorateClass$M([
7254
+ __decorateClass$G([
7250
7255
  property({ internal: true, fallback: false })
7251
7256
  ], SceneTree.prototype, "debug");
7252
- __decorateClass$M([
7257
+ __decorateClass$G([
7253
7258
  property({ internal: true, fallback: false })
7254
7259
  ], SceneTree.prototype, "processPaused");
7255
- __decorateClass$M([
7260
+ __decorateClass$G([
7256
7261
  property({ internal: true, default: () => fonts })
7257
7262
  ], SceneTree.prototype, "fonts");
7258
- __decorateClass$M([
7263
+ __decorateClass$G([
7259
7264
  property({ internal: true, default: () => new Timeline() })
7260
7265
  ], SceneTree.prototype, "timeline");
7261
7266
 
7262
- var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
7263
- var __decorateClass$L = (decorators, target, key, kind) => {
7264
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$C(target, key) : target;
7267
+ var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
7268
+ var __decorateClass$F = (decorators, target, key, kind) => {
7269
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target;
7265
7270
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7266
7271
  if (decorator = decorators[i])
7267
7272
  result = (decorator(result)) || result;
@@ -7273,7 +7278,7 @@ let Transition = class extends Effect {
7273
7278
  this.setProperties(properties).append(children);
7274
7279
  }
7275
7280
  };
7276
- Transition = __decorateClass$L([
7281
+ Transition = __decorateClass$F([
7277
7282
  customNode("Transition", {
7278
7283
  effectMode: "transition",
7279
7284
  processMode: "pausable",
@@ -7281,14 +7286,14 @@ Transition = __decorateClass$L([
7281
7286
  })
7282
7287
  ], Transition);
7283
7288
 
7284
- var __defProp$D = Object.defineProperty;
7285
- var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
7286
- var __decorateClass$K = (decorators, target, key, kind) => {
7287
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$B(target, key) : target;
7289
+ var __defProp$B = Object.defineProperty;
7290
+ var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
7291
+ var __decorateClass$E = (decorators, target, key, kind) => {
7292
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target;
7288
7293
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7289
7294
  if (decorator = decorators[i])
7290
7295
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7291
- if (kind && result) __defProp$D(target, key, result);
7296
+ if (kind && result) __defProp$B(target, key, result);
7292
7297
  return result;
7293
7298
  };
7294
7299
  let Node2D = class extends CanvasItem {
@@ -7352,9 +7357,7 @@ let Node2D = class extends CanvasItem {
7352
7357
  let a, c, tx, b, d, ty;
7353
7358
  if (vertTransform) {
7354
7359
  const globalTransform = this.globalTransform.clone();
7355
- globalTransform.multiply(
7356
- typeof vertTransform === "function" ? vertTransform?.() : vertTransform
7357
- );
7360
+ globalTransform.multiply(vertTransform);
7358
7361
  [a, c, tx, b, d, ty] = globalTransform.toArray();
7359
7362
  } else {
7360
7363
  [a, c, tx, b, d, ty] = this.globalTransform.toArray();
@@ -7392,46 +7395,81 @@ let Node2D = class extends CanvasItem {
7392
7395
  return this.globalTransform.apply(localPos, newPos);
7393
7396
  }
7394
7397
  };
7395
- __decorateClass$K([
7398
+ __decorateClass$E([
7396
7399
  property({ internal: true, fallback: 0 })
7397
7400
  ], Node2D.prototype, "rotation", 2);
7398
- __decorateClass$K([
7401
+ __decorateClass$E([
7399
7402
  property({ internal: true, fallback: 0 })
7400
7403
  ], Node2D.prototype, "globalRotation", 2);
7401
- Node2D = __decorateClass$K([
7404
+ Node2D = __decorateClass$E([
7402
7405
  customNode("Node2D")
7403
7406
  ], Node2D);
7404
7407
 
7405
- var __defProp$C = Object.defineProperty;
7406
- var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
7407
- var __decorateClass$J = (decorators, target, key, kind) => {
7408
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$A(target, key) : target;
7408
+ var __defProp$A = Object.defineProperty;
7409
+ var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
7410
+ var __decorateClass$D = (decorators, target, key, kind) => {
7411
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target;
7409
7412
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7410
7413
  if (decorator = decorators[i])
7411
7414
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7412
- if (kind && result) __defProp$C(target, key, result);
7415
+ if (kind && result) __defProp$A(target, key, result);
7413
7416
  return result;
7414
7417
  };
7415
7418
  let Camera2D = class extends Node2D {
7416
- zoom = new Vector2(1, 1).on("update", () => this.updateCanvasTransform());
7417
- maxZoom = new Vector2(6, 6);
7418
- minZoom = new Vector2(0.1, 0.1);
7419
7419
  _screenOffset = { x: 0, y: 0 };
7420
+ _zoom = new Vector2(1, 1).on("update", () => this.updateCanvasTransform());
7421
+ get zoom() {
7422
+ return this._zoom;
7423
+ }
7424
+ set zoom(val) {
7425
+ this._zoom.set(val.x, val.y);
7426
+ }
7427
+ _minZoom = new Vector2(0.02, 0.02);
7428
+ get minZoom() {
7429
+ return this._minZoom;
7430
+ }
7431
+ set minZoom(val) {
7432
+ this._minZoom.set(val.x, val.y);
7433
+ }
7434
+ _maxZoom = new Vector2(256, 256);
7435
+ get maxZoom() {
7436
+ return this._maxZoom;
7437
+ }
7438
+ set maxZoom(val) {
7439
+ this._maxZoom.set(val.x, val.y);
7440
+ }
7420
7441
  constructor(properties, nodes = []) {
7421
7442
  super();
7422
7443
  this.setProperties(properties).append(nodes);
7423
7444
  }
7445
+ setProperties(properties) {
7446
+ if (properties) {
7447
+ const {
7448
+ zoom,
7449
+ minZoom,
7450
+ maxZoom,
7451
+ ...restProperties
7452
+ } = properties;
7453
+ if (zoom)
7454
+ this.zoom = zoom;
7455
+ if (minZoom)
7456
+ this.minZoom = minZoom;
7457
+ if (maxZoom)
7458
+ this.maxZoom = maxZoom;
7459
+ super.setProperties(restProperties);
7460
+ }
7461
+ return this;
7462
+ }
7424
7463
  addZoom(x, y = x) {
7425
- this.zoom.set(
7426
- clamp(this.zoom.x + x, this.minZoom.x, this.maxZoom.x),
7427
- clamp(this.zoom.y + y, this.minZoom.y, this.maxZoom.y)
7464
+ return this.setZoom(
7465
+ this._zoom.x + x,
7466
+ this._zoom.y + y
7428
7467
  );
7429
- return this;
7430
7468
  }
7431
7469
  setZoom(x, y = x) {
7432
- this.zoom.set(
7433
- clamp(x, this.minZoom.x, this.maxZoom.x),
7434
- clamp(y, this.minZoom.y, this.maxZoom.y)
7470
+ this._zoom.set(
7471
+ clamp(x, this._minZoom.x, this._maxZoom.x),
7472
+ clamp(y, this._minZoom.y, this._maxZoom.y)
7435
7473
  );
7436
7474
  return this;
7437
7475
  }
@@ -7485,9 +7523,9 @@ let Camera2D = class extends Node2D {
7485
7523
  const isTouchPad = e.wheelDeltaY ? Math.abs(Math.abs(e.wheelDeltaY) - Math.abs(3 * e.deltaY)) < 3 : e.deltaMode === 0;
7486
7524
  if (!isTouchPad) {
7487
7525
  e.preventDefault();
7488
- const oldZoom = this.zoom.x;
7489
- this.addZoom(e.deltaY * -0.015);
7490
- const ratio = 1 - this.zoom.x / oldZoom;
7526
+ const oldZoom = this._zoom.x;
7527
+ this.zoomWithWheel(e.deltaY);
7528
+ const ratio = 1 - this._zoom.x / oldZoom;
7491
7529
  this.position.add(
7492
7530
  (e.screenX - this.position.x) * ratio,
7493
7531
  (e.screenY - this.position.y) * ratio
@@ -7498,6 +7536,12 @@ let Camera2D = class extends Node2D {
7498
7536
  this.position.add(-e.deltaX, -e.deltaY);
7499
7537
  }
7500
7538
  }
7539
+ zoomWithWheel(wheelDeltaY) {
7540
+ const logCur = Math.log(this._zoom.x);
7541
+ const logDelta = -wheelDeltaY * this.wheelSensitivity;
7542
+ const logNew = logCur + logDelta;
7543
+ this.setZoom(Math.exp(logNew));
7544
+ }
7501
7545
  updateTransform() {
7502
7546
  super.updateTransform();
7503
7547
  this.updateCanvasTransform();
@@ -7506,7 +7550,7 @@ let Camera2D = class extends Node2D {
7506
7550
  const viewport = this.getViewport();
7507
7551
  if (!viewport)
7508
7552
  return;
7509
- viewport.canvasTransform.identity().scale(this.zoom.x, this.zoom.y).translate(this.position.x, this.position.y);
7553
+ viewport.canvasTransform.identity().scale(this._zoom.x, this._zoom.y).translate(this.position.x, this.position.y);
7510
7554
  this.emit("updateCanvasTransform");
7511
7555
  }
7512
7556
  toGlobal(screenPos, newPos) {
@@ -7521,14 +7565,25 @@ let Camera2D = class extends Node2D {
7521
7565
  throw new Error("Failed to toScreen, viewport is empty");
7522
7566
  return viewport.toCanvasScreen(globalPos, newPos);
7523
7567
  }
7524
- };
7525
- __decorateClass$J([
7568
+ toJSON() {
7569
+ return {
7570
+ zoom: this._zoom.toJSON(),
7571
+ minZoom: this._minZoom.toJSON(),
7572
+ maxZoom: this._maxZoom.toJSON(),
7573
+ ...super.toJSON()
7574
+ };
7575
+ }
7576
+ };
7577
+ __decorateClass$D([
7578
+ property({ fallback: 0.02 })
7579
+ ], Camera2D.prototype, "wheelSensitivity", 2);
7580
+ __decorateClass$D([
7526
7581
  property({ internal: true, fallback: false })
7527
7582
  ], Camera2D.prototype, "spaceKey", 2);
7528
- __decorateClass$J([
7583
+ __decorateClass$D([
7529
7584
  property({ internal: true, fallback: false })
7530
7585
  ], Camera2D.prototype, "grabbing", 2);
7531
- Camera2D = __decorateClass$J([
7586
+ Camera2D = __decorateClass$D([
7532
7587
  customNode("Camera2D", {
7533
7588
  processMode: "disabled",
7534
7589
  renderMode: "disabled"
@@ -7681,18 +7736,18 @@ function parseCSSTransformOrigin(transformOrigin) {
7681
7736
  });
7682
7737
  }
7683
7738
 
7684
- var __defProp$B = Object.defineProperty;
7685
- var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
7686
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7687
- var __decorateClass$I = (decorators, target, key, kind) => {
7688
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target;
7739
+ var __defProp$z = Object.defineProperty;
7740
+ var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
7741
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7742
+ var __decorateClass$C = (decorators, target, key, kind) => {
7743
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target;
7689
7744
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7690
7745
  if (decorator = decorators[i])
7691
7746
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7692
- if (kind && result) __defProp$B(target, key, result);
7747
+ if (kind && result) __defProp$z(target, key, result);
7693
7748
  return result;
7694
7749
  };
7695
- var __publicField$i = (obj, key, value) => __defNormalProp$i(obj, key + "" , value);
7750
+ var __publicField$j = (obj, key, value) => __defNormalProp$j(obj, key + "" , value);
7696
7751
  let ColorAdjustEffect = class extends Effect {
7697
7752
  constructor(properties, children = []) {
7698
7753
  super();
@@ -7714,7 +7769,7 @@ let ColorAdjustEffect = class extends Effect {
7714
7769
  });
7715
7770
  }
7716
7771
  };
7717
- __publicField$i(ColorAdjustEffect, "material", new Material({
7772
+ __publicField$j(ColorAdjustEffect, "material", new Material({
7718
7773
  vert: `precision mediump float;
7719
7774
  attribute vec2 position;
7720
7775
  attribute vec2 uv;
@@ -7749,46 +7804,46 @@ void main(void) {
7749
7804
  gl_FragColor = c * alpha;
7750
7805
  }`
7751
7806
  }));
7752
- __decorateClass$I([
7807
+ __decorateClass$C([
7753
7808
  property({ fallback: 1 })
7754
7809
  ], ColorAdjustEffect.prototype, "saturation", 2);
7755
- __decorateClass$I([
7810
+ __decorateClass$C([
7756
7811
  property({ fallback: 1 })
7757
7812
  ], ColorAdjustEffect.prototype, "contrast", 2);
7758
- __decorateClass$I([
7813
+ __decorateClass$C([
7759
7814
  property({ fallback: 1 })
7760
7815
  ], ColorAdjustEffect.prototype, "brightness", 2);
7761
- __decorateClass$I([
7816
+ __decorateClass$C([
7762
7817
  property({ fallback: 1 })
7763
7818
  ], ColorAdjustEffect.prototype, "red", 2);
7764
- __decorateClass$I([
7819
+ __decorateClass$C([
7765
7820
  property({ fallback: 1 })
7766
7821
  ], ColorAdjustEffect.prototype, "green", 2);
7767
- __decorateClass$I([
7822
+ __decorateClass$C([
7768
7823
  property({ fallback: 1 })
7769
7824
  ], ColorAdjustEffect.prototype, "blue", 2);
7770
- __decorateClass$I([
7825
+ __decorateClass$C([
7771
7826
  property({ fallback: 1 })
7772
7827
  ], ColorAdjustEffect.prototype, "alpha", 2);
7773
- __decorateClass$I([
7828
+ __decorateClass$C([
7774
7829
  property({ fallback: 1 })
7775
7830
  ], ColorAdjustEffect.prototype, "gamma", 2);
7776
- ColorAdjustEffect = __decorateClass$I([
7831
+ ColorAdjustEffect = __decorateClass$C([
7777
7832
  customNode("ColorAdjustEffect")
7778
7833
  ], ColorAdjustEffect);
7779
7834
 
7780
- var __defProp$A = Object.defineProperty;
7781
- var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
7782
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7783
- var __decorateClass$H = (decorators, target, key, kind) => {
7784
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target;
7835
+ var __defProp$y = Object.defineProperty;
7836
+ var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
7837
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7838
+ var __decorateClass$B = (decorators, target, key, kind) => {
7839
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target;
7785
7840
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7786
7841
  if (decorator = decorators[i])
7787
7842
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7788
- if (kind && result) __defProp$A(target, key, result);
7843
+ if (kind && result) __defProp$y(target, key, result);
7789
7844
  return result;
7790
7845
  };
7791
- var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, key + "" , value);
7846
+ var __publicField$i = (obj, key, value) => __defNormalProp$i(obj, key + "" , value);
7792
7847
  let ColorFilterEffect = class extends Effect {
7793
7848
  _colorMatrix = new ColorMatrix();
7794
7849
  constructor(properties, children = []) {
@@ -7838,7 +7893,7 @@ let ColorFilterEffect = class extends Effect {
7838
7893
  });
7839
7894
  }
7840
7895
  };
7841
- __publicField$h(ColorFilterEffect, "material", new Material({
7896
+ __publicField$i(ColorFilterEffect, "material", new Material({
7842
7897
  vert: `precision mediump float;
7843
7898
  attribute vec2 position;
7844
7899
  attribute vec2 uv;
@@ -7865,25 +7920,25 @@ void main(void) {
7865
7920
  );
7866
7921
  }`
7867
7922
  }));
7868
- __decorateClass$H([
7923
+ __decorateClass$B([
7869
7924
  property()
7870
7925
  ], ColorFilterEffect.prototype, "filter", 2);
7871
- ColorFilterEffect = __decorateClass$H([
7926
+ ColorFilterEffect = __decorateClass$B([
7872
7927
  customNode("ColorFilterEffect")
7873
7928
  ], ColorFilterEffect);
7874
7929
 
7875
- var __defProp$z = Object.defineProperty;
7876
- var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
7877
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7878
- var __decorateClass$G = (decorators, target, key, kind) => {
7879
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target;
7930
+ var __defProp$x = Object.defineProperty;
7931
+ var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
7932
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7933
+ var __decorateClass$A = (decorators, target, key, kind) => {
7934
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target;
7880
7935
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7881
7936
  if (decorator = decorators[i])
7882
7937
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7883
- if (kind && result) __defProp$z(target, key, result);
7938
+ if (kind && result) __defProp$x(target, key, result);
7884
7939
  return result;
7885
7940
  };
7886
- var __publicField$g = (obj, key, value) => __defNormalProp$g(obj, key + "" , value);
7941
+ var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, key + "" , value);
7887
7942
  const MAX_COLORS$1 = 50;
7888
7943
  let ColorOverlayEffect = class extends Effect {
7889
7944
  _color = new Color();
@@ -7909,7 +7964,7 @@ let ColorOverlayEffect = class extends Effect {
7909
7964
  });
7910
7965
  }
7911
7966
  };
7912
- __publicField$g(ColorOverlayEffect, "material", new Material({
7967
+ __publicField$h(ColorOverlayEffect, "material", new Material({
7913
7968
  vert: `precision mediump float;
7914
7969
  attribute vec2 position;
7915
7970
  attribute vec2 uv;
@@ -7956,28 +8011,28 @@ void main(void) {
7956
8011
  gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
7957
8012
  }`
7958
8013
  }));
7959
- __decorateClass$G([
8014
+ __decorateClass$A([
7960
8015
  property({ default: () => [] })
7961
8016
  ], ColorOverlayEffect.prototype, "colors", 2);
7962
- __decorateClass$G([
8017
+ __decorateClass$A([
7963
8018
  property({ fallback: 0.5 })
7964
8019
  ], ColorOverlayEffect.prototype, "alpha", 2);
7965
- ColorOverlayEffect = __decorateClass$G([
8020
+ ColorOverlayEffect = __decorateClass$A([
7966
8021
  customNode("ColorOverlayEffect")
7967
8022
  ], ColorOverlayEffect);
7968
8023
 
7969
- var __defProp$y = Object.defineProperty;
7970
- var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
7971
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7972
- var __decorateClass$F = (decorators, target, key, kind) => {
7973
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target;
8024
+ var __defProp$w = Object.defineProperty;
8025
+ var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
8026
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8027
+ var __decorateClass$z = (decorators, target, key, kind) => {
8028
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target;
7974
8029
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7975
8030
  if (decorator = decorators[i])
7976
8031
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7977
- if (kind && result) __defProp$y(target, key, result);
8032
+ if (kind && result) __defProp$w(target, key, result);
7978
8033
  return result;
7979
8034
  };
7980
- var __publicField$f = (obj, key, value) => __defNormalProp$f(obj, key + "" , value);
8035
+ var __publicField$g = (obj, key, value) => __defNormalProp$g(obj, key + "" , value);
7981
8036
  let ColorRemoveEffect = class extends Effect {
7982
8037
  _color = new Color();
7983
8038
  constructor(properties, children = []) {
@@ -8008,7 +8063,7 @@ let ColorRemoveEffect = class extends Effect {
8008
8063
  });
8009
8064
  }
8010
8065
  };
8011
- __publicField$f(ColorRemoveEffect, "material", new Material({
8066
+ __publicField$g(ColorRemoveEffect, "material", new Material({
8012
8067
  vert: `precision mediump float;
8013
8068
  attribute vec2 position;
8014
8069
  attribute vec2 uv;
@@ -8041,28 +8096,28 @@ void main(void) {
8041
8096
  gl_FragColor = color;
8042
8097
  }`
8043
8098
  }));
8044
- __decorateClass$F([
8099
+ __decorateClass$z([
8045
8100
  property({ default: () => [] })
8046
8101
  ], ColorRemoveEffect.prototype, "colors", 2);
8047
- __decorateClass$F([
8102
+ __decorateClass$z([
8048
8103
  property({ fallback: 0.5 })
8049
8104
  ], ColorRemoveEffect.prototype, "epsilon", 2);
8050
- ColorRemoveEffect = __decorateClass$F([
8105
+ ColorRemoveEffect = __decorateClass$z([
8051
8106
  customNode("ColorRemoveEffect")
8052
8107
  ], ColorRemoveEffect);
8053
8108
 
8054
- var __defProp$x = Object.defineProperty;
8055
- var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
8056
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8057
- var __decorateClass$E = (decorators, target, key, kind) => {
8058
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target;
8109
+ var __defProp$v = Object.defineProperty;
8110
+ var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
8111
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8112
+ var __decorateClass$y = (decorators, target, key, kind) => {
8113
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
8059
8114
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8060
8115
  if (decorator = decorators[i])
8061
8116
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8062
- if (kind && result) __defProp$x(target, key, result);
8117
+ if (kind && result) __defProp$v(target, key, result);
8063
8118
  return result;
8064
8119
  };
8065
- var __publicField$e = (obj, key, value) => __defNormalProp$e(obj, key + "" , value);
8120
+ var __publicField$f = (obj, key, value) => __defNormalProp$f(obj, key + "" , value);
8066
8121
  const MAX_COLORS = 50;
8067
8122
  let ColorReplaceEffect = class extends Effect {
8068
8123
  _color = new Color();
@@ -8108,7 +8163,7 @@ let ColorReplaceEffect = class extends Effect {
8108
8163
  });
8109
8164
  }
8110
8165
  };
8111
- __publicField$e(ColorReplaceEffect, "material", new Material({
8166
+ __publicField$f(ColorReplaceEffect, "material", new Material({
8112
8167
  vert: `precision mediump float;
8113
8168
  attribute vec2 position;
8114
8169
  attribute vec2 uv;
@@ -8148,25 +8203,139 @@ void main(void) {
8148
8203
  }
8149
8204
  }`
8150
8205
  }));
8151
- __decorateClass$E([
8206
+ __decorateClass$y([
8152
8207
  property({ default: () => [] })
8153
8208
  ], ColorReplaceEffect.prototype, "colors", 2);
8154
- __decorateClass$E([
8209
+ __decorateClass$y([
8155
8210
  property({ fallback: 0.05 })
8156
8211
  ], ColorReplaceEffect.prototype, "epsilon", 2);
8157
- ColorReplaceEffect = __decorateClass$E([
8212
+ ColorReplaceEffect = __decorateClass$y([
8158
8213
  customNode("ColorReplaceEffect")
8159
8214
  ], ColorReplaceEffect);
8160
8215
 
8161
- var __defProp$w = Object.defineProperty;
8162
- var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
8163
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8164
- var __decorateClass$D = (decorators, target, key, kind) => {
8165
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target;
8216
+ var __defProp$u = Object.defineProperty;
8217
+ var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
8218
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8219
+ var __decorateClass$x = (decorators, target, key, kind) => {
8220
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
8166
8221
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8167
8222
  if (decorator = decorators[i])
8168
8223
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8169
- if (kind && result) __defProp$w(target, key, result);
8224
+ if (kind && result) __defProp$u(target, key, result);
8225
+ return result;
8226
+ };
8227
+ var __publicField$e = (obj, key, value) => __defNormalProp$e(obj, key + "" , value);
8228
+ let DrawboardEffect = class extends Effect {
8229
+ constructor(properties, children = []) {
8230
+ super();
8231
+ this.setProperties(properties).append(children);
8232
+ }
8233
+ apply(renderer, source) {
8234
+ source.redraw(renderer, () => {
8235
+ const viewMatrix = renderer.program.uniforms.viewMatrix;
8236
+ QuadUvGeometry.draw(renderer, DrawboardEffect.material, {
8237
+ sampler: 0,
8238
+ inputSize: [source.width, source.height],
8239
+ zoom: [viewMatrix[0], viewMatrix[4]],
8240
+ translate: [viewMatrix[6], viewMatrix[7]],
8241
+ checkerboard: this.checkerboard ? 1 : 0,
8242
+ checkerboardScale: this.checkerboardScale,
8243
+ pixelGrid: this.pixelGrid ? 1 : 0,
8244
+ pixelGridSize: [
8245
+ viewMatrix[0] > 4 ? Math.ceil(0.5 / viewMatrix[0] * 1e4) / 1e4 : 0,
8246
+ viewMatrix[4] > 4 ? Math.ceil(0.5 / viewMatrix[4] * 1e4) / 1e4 : 0
8247
+ ]
8248
+ });
8249
+ });
8250
+ }
8251
+ };
8252
+ __publicField$e(DrawboardEffect, "material", new Material({
8253
+ vert: `precision mediump float;
8254
+ attribute vec2 position;
8255
+ attribute vec2 uv;
8256
+ uniform mat3 projectionMatrix;
8257
+ uniform mat3 viewMatrix;
8258
+ varying vec2 vUv;
8259
+ void main() {
8260
+ gl_Position = vec4(position.xy, 0.0, 1.0);
8261
+ vUv = uv;
8262
+ }`,
8263
+ frag: `varying vec2 vUv;
8264
+ uniform sampler2D sampler;
8265
+ uniform int checkerboard;
8266
+ uniform float checkerboardScale;
8267
+ uniform int pixelGrid;
8268
+ uniform vec2 pixelGridSize;
8269
+ uniform vec2 inputSize;
8270
+ uniform vec2 zoom;
8271
+ uniform vec2 translate;
8272
+
8273
+ vec4 renderCheckerboard(vec2 coord, vec4 color, vec2 scale) {
8274
+ vec2 fractValue = fract(coord * scale) - 0.5;
8275
+ float value = fractValue.x * fractValue.y < 0.0 ? 1.0 : 0.95;
8276
+ return vec4(value * (1.0 - color.a) + color.rgb, 1);
8277
+ }
8278
+
8279
+ vec3 renderPixelGrid(vec2 coord, vec3 rgb, vec2 size) {
8280
+ vec2 corner = fract(coord);
8281
+ float gridWeight = max(float(corner.x < size.x), float(corner.y < size.y));
8282
+ vec3 gridColor;
8283
+ vec3 weights = vec3(0.299, 0.587, 0.114);
8284
+ float c2 = dot(rgb * rgb, weights);
8285
+ float luminance = sqrt(c2);
8286
+ if (luminance > 0.5) {
8287
+ float target = (luminance - 0.05) / luminance;
8288
+ gridColor = rgb * target;
8289
+ }
8290
+ else {
8291
+ float target = luminance * 0.8 + 0.15;
8292
+ float c1 = dot(rgb, weights);
8293
+ float a = 1.0 - 2.0 * c1 + c2;
8294
+ float b = c2 - c1;
8295
+ gridColor = mix(rgb, vec3(1), (b + sqrt(b * b - a * (c2 - target * target))) / a);
8296
+ }
8297
+ return mix(rgb, gridColor, gridWeight);
8298
+ }
8299
+
8300
+ void main(void) {
8301
+ vec4 color = texture2D(sampler, vUv);
8302
+ vec2 coord = vec2(vUv.x, 1.0 - vUv.y);
8303
+ coord = (coord * inputSize - translate) / zoom;
8304
+
8305
+ if (checkerboard > 0) {
8306
+ color = renderCheckerboard(coord, color, vec2(checkerboardScale) * zoom);
8307
+ }
8308
+ if (pixelGrid > 0) {
8309
+ color = vec4(
8310
+ renderPixelGrid(coord, color.rgb, pixelGridSize),
8311
+ color.a
8312
+ );
8313
+ }
8314
+ gl_FragColor = color;
8315
+ }`
8316
+ }));
8317
+ __decorateClass$x([
8318
+ property({ fallback: false })
8319
+ ], DrawboardEffect.prototype, "checkerboard", 2);
8320
+ __decorateClass$x([
8321
+ property({ fallback: 1 / 16 })
8322
+ ], DrawboardEffect.prototype, "checkerboardScale", 2);
8323
+ __decorateClass$x([
8324
+ property({ fallback: false })
8325
+ ], DrawboardEffect.prototype, "pixelGrid", 2);
8326
+ DrawboardEffect = __decorateClass$x([
8327
+ customNode("DrawboardEffect")
8328
+ ], DrawboardEffect);
8329
+
8330
+ var __defProp$t = Object.defineProperty;
8331
+ var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
8332
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8333
+ var __decorateClass$w = (decorators, target, key, kind) => {
8334
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
8335
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
8336
+ if (decorator = decorators[i])
8337
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8338
+ if (kind && result) __defProp$t(target, key, result);
8170
8339
  return result;
8171
8340
  };
8172
8341
  var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -8272,25 +8441,25 @@ void main(void) {
8272
8441
  }`,
8273
8442
  frag: frag$2
8274
8443
  }));
8275
- __decorateClass$D([
8444
+ __decorateClass$w([
8276
8445
  property({ fallback: 4 })
8277
8446
  ], GaussianBlurEffect.prototype, "strength", 2);
8278
- __decorateClass$D([
8447
+ __decorateClass$w([
8279
8448
  property({ fallback: 3 })
8280
8449
  ], GaussianBlurEffect.prototype, "quality", 2);
8281
- GaussianBlurEffect = __decorateClass$D([
8450
+ GaussianBlurEffect = __decorateClass$w([
8282
8451
  customNode("GaussianBlurEffect")
8283
8452
  ], GaussianBlurEffect);
8284
8453
 
8285
- var __defProp$v = Object.defineProperty;
8286
- var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
8287
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8288
- var __decorateClass$C = (decorators, target, key, kind) => {
8289
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target;
8454
+ var __defProp$s = Object.defineProperty;
8455
+ var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
8456
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8457
+ var __decorateClass$v = (decorators, target, key, kind) => {
8458
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target;
8290
8459
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8291
8460
  if (decorator = decorators[i])
8292
8461
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8293
- if (kind && result) __defProp$v(target, key, result);
8462
+ if (kind && result) __defProp$s(target, key, result);
8294
8463
  return result;
8295
8464
  };
8296
8465
  var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, key + "" , value);
@@ -8354,34 +8523,34 @@ void main(void) {
8354
8523
  gl_FragColor = sample;
8355
8524
  }`
8356
8525
  }));
8357
- __decorateClass$C([
8526
+ __decorateClass$v([
8358
8527
  property({ fallback: "#000000FF" })
8359
8528
  ], DropShadowEffect.prototype, "color", 2);
8360
- __decorateClass$C([
8529
+ __decorateClass$v([
8361
8530
  property({ fallback: 4 })
8362
8531
  ], DropShadowEffect.prototype, "blur", 2);
8363
- __decorateClass$C([
8532
+ __decorateClass$v([
8364
8533
  property({ fallback: 4 })
8365
8534
  ], DropShadowEffect.prototype, "offsetX", 2);
8366
- __decorateClass$C([
8535
+ __decorateClass$v([
8367
8536
  property({ fallback: 4 })
8368
8537
  ], DropShadowEffect.prototype, "offsetY", 2);
8369
- __decorateClass$C([
8538
+ __decorateClass$v([
8370
8539
  property({ fallback: false })
8371
8540
  ], DropShadowEffect.prototype, "shadowOnly", 2);
8372
- DropShadowEffect = __decorateClass$C([
8541
+ DropShadowEffect = __decorateClass$v([
8373
8542
  customNode("DropShadowEffect")
8374
8543
  ], DropShadowEffect);
8375
8544
 
8376
- var __defProp$u = Object.defineProperty;
8377
- var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
8378
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8379
- var __decorateClass$B = (decorators, target, key, kind) => {
8380
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target;
8545
+ var __defProp$r = Object.defineProperty;
8546
+ var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
8547
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8548
+ var __decorateClass$u = (decorators, target, key, kind) => {
8549
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$l(target, key) : target;
8381
8550
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8382
8551
  if (decorator = decorators[i])
8383
8552
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8384
- if (kind && result) __defProp$u(target, key, result);
8553
+ if (kind && result) __defProp$r(target, key, result);
8385
8554
  return result;
8386
8555
  };
8387
8556
  var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, key + "" , value);
@@ -8426,22 +8595,22 @@ void main(void) {
8426
8595
  gl_FragColor = vec4(color.rgb * alpha, alpha);
8427
8596
  }`
8428
8597
  }));
8429
- __decorateClass$B([
8598
+ __decorateClass$u([
8430
8599
  property({ fallback: 5 })
8431
8600
  ], EmbossEffect.prototype, "strength", 2);
8432
- EmbossEffect = __decorateClass$B([
8601
+ EmbossEffect = __decorateClass$u([
8433
8602
  customNode("EmbossEffect")
8434
8603
  ], EmbossEffect);
8435
8604
 
8436
- var __defProp$t = Object.defineProperty;
8437
- var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
8438
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8439
- var __decorateClass$A = (decorators, target, key, kind) => {
8440
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target;
8605
+ var __defProp$q = Object.defineProperty;
8606
+ var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
8607
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8608
+ var __decorateClass$t = (decorators, target, key, kind) => {
8609
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target;
8441
8610
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8442
8611
  if (decorator = decorators[i])
8443
8612
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8444
- if (kind && result) __defProp$t(target, key, result);
8613
+ if (kind && result) __defProp$q(target, key, result);
8445
8614
  return result;
8446
8615
  };
8447
8616
  var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, key + "" , value);
@@ -8615,46 +8784,46 @@ void main(void) {
8615
8784
  gl_FragColor.a = texture2D(sampler, coord).a;
8616
8785
  }`
8617
8786
  }));
8618
- __decorateClass$A([
8787
+ __decorateClass$t([
8619
8788
  property({ fallback: 10 })
8620
8789
  ], GlitchEffect.prototype, "slices", 2);
8621
- __decorateClass$A([
8790
+ __decorateClass$t([
8622
8791
  property({ fallback: 512 })
8623
8792
  ], GlitchEffect.prototype, "sampleSize", 2);
8624
- __decorateClass$A([
8793
+ __decorateClass$t([
8625
8794
  property({ fallback: 100 })
8626
8795
  ], GlitchEffect.prototype, "offset", 2);
8627
- __decorateClass$A([
8796
+ __decorateClass$t([
8628
8797
  property({ fallback: 0 })
8629
8798
  ], GlitchEffect.prototype, "direction", 2);
8630
- __decorateClass$A([
8799
+ __decorateClass$t([
8631
8800
  property({ fallback: 2 })
8632
8801
  ], GlitchEffect.prototype, "fillMode", 2);
8633
- __decorateClass$A([
8802
+ __decorateClass$t([
8634
8803
  property({ fallback: 0 })
8635
8804
  ], GlitchEffect.prototype, "seed", 2);
8636
- __decorateClass$A([
8805
+ __decorateClass$t([
8637
8806
  property({ default: () => [2, 2] })
8638
8807
  ], GlitchEffect.prototype, "red", 2);
8639
- __decorateClass$A([
8808
+ __decorateClass$t([
8640
8809
  property({ default: () => [-10, 4] })
8641
8810
  ], GlitchEffect.prototype, "green", 2);
8642
- __decorateClass$A([
8811
+ __decorateClass$t([
8643
8812
  property({ default: () => [10, -4] })
8644
8813
  ], GlitchEffect.prototype, "blue", 2);
8645
- GlitchEffect = __decorateClass$A([
8814
+ GlitchEffect = __decorateClass$t([
8646
8815
  customNode("GlitchEffect")
8647
8816
  ], GlitchEffect);
8648
8817
 
8649
- var __defProp$s = Object.defineProperty;
8650
- var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
8651
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8652
- var __decorateClass$z = (decorators, target, key, kind) => {
8653
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target;
8818
+ var __defProp$p = Object.defineProperty;
8819
+ var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
8820
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8821
+ var __decorateClass$s = (decorators, target, key, kind) => {
8822
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target;
8654
8823
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8655
8824
  if (decorator = decorators[i])
8656
8825
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8657
- if (kind && result) __defProp$s(target, key, result);
8826
+ if (kind && result) __defProp$p(target, key, result);
8658
8827
  return result;
8659
8828
  };
8660
8829
  var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, key + "" , value);
@@ -8832,39 +9001,39 @@ void main(void) {
8832
9001
  gl_FragColor = vec4(color.rgb + mist.rgb, color.a);
8833
9002
  }`
8834
9003
  }));
8835
- __decorateClass$z([
9004
+ __decorateClass$s([
8836
9005
  property({ fallback: 0 })
8837
9006
  ], GodrayEffect.prototype, "time", 2);
8838
- __decorateClass$z([
9007
+ __decorateClass$s([
8839
9008
  property({ fallback: 30 })
8840
9009
  ], GodrayEffect.prototype, "angle", 2);
8841
- __decorateClass$z([
9010
+ __decorateClass$s([
8842
9011
  property({ fallback: 0.5 })
8843
9012
  ], GodrayEffect.prototype, "gain", 2);
8844
- __decorateClass$z([
9013
+ __decorateClass$s([
8845
9014
  property({ fallback: 2.5 })
8846
9015
  ], GodrayEffect.prototype, "lacunarity", 2);
8847
- __decorateClass$z([
9016
+ __decorateClass$s([
8848
9017
  property({ fallback: true })
8849
9018
  ], GodrayEffect.prototype, "parallel", 2);
8850
- __decorateClass$z([
9019
+ __decorateClass$s([
8851
9020
  property({ default: () => [0, 0] })
8852
9021
  ], GodrayEffect.prototype, "center", 2);
8853
- __decorateClass$z([
9022
+ __decorateClass$s([
8854
9023
  property({ fallback: 1 })
8855
9024
  ], GodrayEffect.prototype, "alpha", 2);
8856
- GodrayEffect = __decorateClass$z([
9025
+ GodrayEffect = __decorateClass$s([
8857
9026
  customNode("GodrayEffect")
8858
9027
  ], GodrayEffect);
8859
9028
 
8860
- var __defProp$r = Object.defineProperty;
8861
- var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
8862
- var __decorateClass$y = (decorators, target, key, kind) => {
8863
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
9029
+ var __defProp$o = Object.defineProperty;
9030
+ var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
9031
+ var __decorateClass$r = (decorators, target, key, kind) => {
9032
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
8864
9033
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8865
9034
  if (decorator = decorators[i])
8866
9035
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8867
- if (kind && result) __defProp$r(target, key, result);
9036
+ if (kind && result) __defProp$o(target, key, result);
8868
9037
  return result;
8869
9038
  };
8870
9039
  const frag$1 = `varying vec2 vUv;
@@ -8954,28 +9123,28 @@ void main() {
8954
9123
  });
8955
9124
  }
8956
9125
  };
8957
- __decorateClass$y([
9126
+ __decorateClass$r([
8958
9127
  property({ fallback: 4 })
8959
9128
  ], KawaseBlurEffect.prototype, "strength", 2);
8960
- __decorateClass$y([
9129
+ __decorateClass$r([
8961
9130
  property({ fallback: 3 })
8962
9131
  ], KawaseBlurEffect.prototype, "quality", 2);
8963
- __decorateClass$y([
9132
+ __decorateClass$r([
8964
9133
  property({ default: () => [1, 1] })
8965
9134
  ], KawaseBlurEffect.prototype, "pixelSize", 2);
8966
- KawaseBlurEffect = __decorateClass$y([
9135
+ KawaseBlurEffect = __decorateClass$r([
8967
9136
  customNode("KawaseBlurEffect")
8968
9137
  ], KawaseBlurEffect);
8969
9138
 
8970
- var __defProp$q = Object.defineProperty;
8971
- var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
8972
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8973
- var __decorateClass$x = (decorators, target, key, kind) => {
8974
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
9139
+ var __defProp$n = Object.defineProperty;
9140
+ var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
9141
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9142
+ var __decorateClass$q = (decorators, target, key, kind) => {
9143
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
8975
9144
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8976
9145
  if (decorator = decorators[i])
8977
9146
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8978
- if (kind && result) __defProp$q(target, key, result);
9147
+ if (kind && result) __defProp$n(target, key, result);
8979
9148
  return result;
8980
9149
  };
8981
9150
  var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, key + "" , value);
@@ -9063,25 +9232,25 @@ void main(void) {
9063
9232
  }
9064
9233
  }`
9065
9234
  }));
9066
- __decorateClass$x([
9235
+ __decorateClass$q([
9067
9236
  property({ internal: true })
9068
9237
  ], MaskEffect.prototype, "texture", 2);
9069
- __decorateClass$x([
9238
+ __decorateClass$q([
9070
9239
  property({ fallback: "" })
9071
9240
  ], MaskEffect.prototype, "src", 2);
9072
- MaskEffect = __decorateClass$x([
9241
+ MaskEffect = __decorateClass$q([
9073
9242
  customNode("MaskEffect")
9074
9243
  ], MaskEffect);
9075
9244
 
9076
- var __defProp$p = Object.defineProperty;
9077
- var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
9078
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9079
- var __decorateClass$w = (decorators, target, key, kind) => {
9080
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
9245
+ var __defProp$m = Object.defineProperty;
9246
+ var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
9247
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9248
+ var __decorateClass$p = (decorators, target, key, kind) => {
9249
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
9081
9250
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9082
9251
  if (decorator = decorators[i])
9083
9252
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9084
- if (kind && result) __defProp$p(target, key, result);
9253
+ if (kind && result) __defProp$m(target, key, result);
9085
9254
  return result;
9086
9255
  };
9087
9256
  var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -9168,40 +9337,40 @@ void main() {
9168
9337
  };
9169
9338
  __publicField$7(OutlineEffect, "MIN_SAMPLES", 1);
9170
9339
  __publicField$7(OutlineEffect, "MAX_SAMPLES", 100);
9171
- __decorateClass$w([
9340
+ __decorateClass$p([
9172
9341
  property({ fallback: "#000000ff" })
9173
9342
  ], OutlineEffect.prototype, "color", 2);
9174
- __decorateClass$w([
9343
+ __decorateClass$p([
9175
9344
  property({ fallback: 1 })
9176
9345
  ], OutlineEffect.prototype, "width", 2);
9177
- __decorateClass$w([
9346
+ __decorateClass$p([
9178
9347
  property({ fallback: "solid" })
9179
9348
  ], OutlineEffect.prototype, "style", 2);
9180
- __decorateClass$w([
9349
+ __decorateClass$p([
9181
9350
  property()
9182
9351
  ], OutlineEffect.prototype, "image", 2);
9183
- __decorateClass$w([
9352
+ __decorateClass$p([
9184
9353
  property({ fallback: 1 })
9185
9354
  ], OutlineEffect.prototype, "opacity", 2);
9186
- __decorateClass$w([
9355
+ __decorateClass$p([
9187
9356
  property({ fallback: 0.1 })
9188
9357
  ], OutlineEffect.prototype, "quality", 2);
9189
- __decorateClass$w([
9358
+ __decorateClass$p([
9190
9359
  property({ fallback: false })
9191
9360
  ], OutlineEffect.prototype, "knockout", 2);
9192
- OutlineEffect = __decorateClass$w([
9361
+ OutlineEffect = __decorateClass$p([
9193
9362
  customNode("OutlineEffect")
9194
9363
  ], OutlineEffect);
9195
9364
 
9196
- var __defProp$o = Object.defineProperty;
9197
- var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
9198
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9199
- var __decorateClass$v = (decorators, target, key, kind) => {
9200
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target;
9365
+ var __defProp$l = Object.defineProperty;
9366
+ var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
9367
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9368
+ var __decorateClass$o = (decorators, target, key, kind) => {
9369
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
9201
9370
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9202
9371
  if (decorator = decorators[i])
9203
9372
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9204
- if (kind && result) __defProp$o(target, key, result);
9373
+ if (kind && result) __defProp$l(target, key, result);
9205
9374
  return result;
9206
9375
  };
9207
9376
  var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, key + "" , value);
@@ -9257,22 +9426,22 @@ void main(void) {
9257
9426
  gl_FragColor = texture2D(sampler, coord);
9258
9427
  }`
9259
9428
  }));
9260
- __decorateClass$v([
9429
+ __decorateClass$o([
9261
9430
  property({ fallback: 10 })
9262
9431
  ], PixelateEffect.prototype, "strength", 2);
9263
- PixelateEffect = __decorateClass$v([
9432
+ PixelateEffect = __decorateClass$o([
9264
9433
  customNode("PixelateEffect")
9265
9434
  ], PixelateEffect);
9266
9435
 
9267
- var __defProp$n = Object.defineProperty;
9268
- var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
9269
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9270
- var __decorateClass$u = (decorators, target, key, kind) => {
9271
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$l(target, key) : target;
9436
+ var __defProp$k = Object.defineProperty;
9437
+ var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
9438
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9439
+ var __decorateClass$n = (decorators, target, key, kind) => {
9440
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
9272
9441
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9273
9442
  if (decorator = decorators[i])
9274
9443
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9275
- if (kind && result) __defProp$n(target, key, result);
9444
+ if (kind && result) __defProp$k(target, key, result);
9276
9445
  return result;
9277
9446
  };
9278
9447
  var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, key + "" , value);
@@ -9385,19 +9554,19 @@ void main() {
9385
9554
  gl_FragColor = color;
9386
9555
  }`
9387
9556
  }));
9388
- __decorateClass$u([
9557
+ __decorateClass$n([
9389
9558
  property()
9390
9559
  ], ZoomBlurEffect.prototype, "center", 2);
9391
- __decorateClass$u([
9560
+ __decorateClass$n([
9392
9561
  property({ fallback: 20 })
9393
9562
  ], ZoomBlurEffect.prototype, "innerRadius", 2);
9394
- __decorateClass$u([
9563
+ __decorateClass$n([
9395
9564
  property({ fallback: -1 })
9396
9565
  ], ZoomBlurEffect.prototype, "radius", 2);
9397
- __decorateClass$u([
9566
+ __decorateClass$n([
9398
9567
  property({ fallback: 0.1 })
9399
9568
  ], ZoomBlurEffect.prototype, "strength", 2);
9400
- ZoomBlurEffect = __decorateClass$u([
9569
+ ZoomBlurEffect = __decorateClass$n([
9401
9570
  customNode("ZoomBlurEffect")
9402
9571
  ], ZoomBlurEffect);
9403
9572
 
@@ -9445,13 +9614,13 @@ function getDrawOptions(fill, box) {
9445
9614
  return { disableWrapMode, uvTransform };
9446
9615
  }
9447
9616
 
9448
- var __defProp$m = Object.defineProperty;
9449
- var __decorateClass$t = (decorators, target, key, kind) => {
9617
+ var __defProp$j = Object.defineProperty;
9618
+ var __decorateClass$m = (decorators, target, key, kind) => {
9450
9619
  var result = void 0 ;
9451
9620
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9452
9621
  if (decorator = decorators[i])
9453
9622
  result = (decorator(target, key, result) ) || result;
9454
- if (result) __defProp$m(target, key, result);
9623
+ if (result) __defProp$j(target, key, result);
9455
9624
  return result;
9456
9625
  };
9457
9626
  class BaseElement2DFill extends CoreObject {
@@ -9561,47 +9730,47 @@ class BaseElement2DFill extends CoreObject {
9561
9730
  return this;
9562
9731
  }
9563
9732
  }
9564
- __decorateClass$t([
9733
+ __decorateClass$m([
9565
9734
  property({ fallback: true })
9566
9735
  ], BaseElement2DFill.prototype, "enabled");
9567
- __decorateClass$t([
9736
+ __decorateClass$m([
9568
9737
  property()
9569
9738
  ], BaseElement2DFill.prototype, "color");
9570
- __decorateClass$t([
9739
+ __decorateClass$m([
9571
9740
  property()
9572
9741
  ], BaseElement2DFill.prototype, "image");
9573
- __decorateClass$t([
9742
+ __decorateClass$m([
9574
9743
  property()
9575
9744
  ], BaseElement2DFill.prototype, "linearGradient");
9576
- __decorateClass$t([
9745
+ __decorateClass$m([
9577
9746
  property()
9578
9747
  ], BaseElement2DFill.prototype, "radialGradient");
9579
- __decorateClass$t([
9748
+ __decorateClass$m([
9580
9749
  property()
9581
9750
  ], BaseElement2DFill.prototype, "cropRect");
9582
- __decorateClass$t([
9751
+ __decorateClass$m([
9583
9752
  property()
9584
9753
  ], BaseElement2DFill.prototype, "stretchRect");
9585
- __decorateClass$t([
9754
+ __decorateClass$m([
9586
9755
  property()
9587
9756
  ], BaseElement2DFill.prototype, "dpi");
9588
- __decorateClass$t([
9757
+ __decorateClass$m([
9589
9758
  property()
9590
9759
  ], BaseElement2DFill.prototype, "rotateWithShape");
9591
- __decorateClass$t([
9760
+ __decorateClass$m([
9592
9761
  property()
9593
9762
  ], BaseElement2DFill.prototype, "tile");
9594
- __decorateClass$t([
9763
+ __decorateClass$m([
9595
9764
  property()
9596
9765
  ], BaseElement2DFill.prototype, "opacity");
9597
9766
 
9598
- var __defProp$l = Object.defineProperty;
9599
- var __decorateClass$s = (decorators, target, key, kind) => {
9767
+ var __defProp$i = Object.defineProperty;
9768
+ var __decorateClass$l = (decorators, target, key, kind) => {
9600
9769
  var result = void 0 ;
9601
9770
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9602
9771
  if (decorator = decorators[i])
9603
9772
  result = (decorator(target, key, result) ) || result;
9604
- if (result) __defProp$l(target, key, result);
9773
+ if (result) __defProp$i(target, key, result);
9605
9774
  return result;
9606
9775
  };
9607
9776
  class BaseElement2DBackground extends BaseElement2DFill {
@@ -9619,17 +9788,17 @@ class BaseElement2DBackground extends BaseElement2DFill {
9619
9788
  }
9620
9789
  }
9621
9790
  }
9622
- __decorateClass$s([
9791
+ __decorateClass$l([
9623
9792
  property()
9624
9793
  ], BaseElement2DBackground.prototype, "fillWithShape");
9625
9794
 
9626
- var __defProp$k = Object.defineProperty;
9627
- var __decorateClass$r = (decorators, target, key, kind) => {
9795
+ var __defProp$h = Object.defineProperty;
9796
+ var __decorateClass$k = (decorators, target, key, kind) => {
9628
9797
  var result = void 0 ;
9629
9798
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9630
9799
  if (decorator = decorators[i])
9631
9800
  result = (decorator(target, key, result) ) || result;
9632
- if (result) __defProp$k(target, key, result);
9801
+ if (result) __defProp$h(target, key, result);
9633
9802
  return result;
9634
9803
  };
9635
9804
  class BaseElement2DForeground extends BaseElement2DFill {
@@ -9647,17 +9816,17 @@ class BaseElement2DForeground extends BaseElement2DFill {
9647
9816
  }
9648
9817
  }
9649
9818
  }
9650
- __decorateClass$r([
9819
+ __decorateClass$k([
9651
9820
  property()
9652
9821
  ], BaseElement2DForeground.prototype, "fillWithShape");
9653
9822
 
9654
- var __defProp$j = Object.defineProperty;
9655
- var __decorateClass$q = (decorators, target, key, kind) => {
9823
+ var __defProp$g = Object.defineProperty;
9824
+ var __decorateClass$j = (decorators, target, key, kind) => {
9656
9825
  var result = void 0 ;
9657
9826
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9658
9827
  if (decorator = decorators[i])
9659
9828
  result = (decorator(target, key, result) ) || result;
9660
- if (result) __defProp$j(target, key, result);
9829
+ if (result) __defProp$g(target, key, result);
9661
9830
  return result;
9662
9831
  };
9663
9832
  class BaseElement2DOutline extends BaseElement2DFill {
@@ -9700,29 +9869,29 @@ class BaseElement2DOutline extends BaseElement2DFill {
9700
9869
  ctx.stroke({ disableWrapMode });
9701
9870
  }
9702
9871
  }
9703
- __decorateClass$q([
9872
+ __decorateClass$j([
9704
9873
  property({ fallback: "#00000000" })
9705
9874
  ], BaseElement2DOutline.prototype, "color");
9706
- __decorateClass$q([
9875
+ __decorateClass$j([
9707
9876
  property({ fallback: 0 })
9708
9877
  ], BaseElement2DOutline.prototype, "width");
9709
- __decorateClass$q([
9878
+ __decorateClass$j([
9710
9879
  property({ fallback: "solid" })
9711
9880
  ], BaseElement2DOutline.prototype, "style");
9712
- __decorateClass$q([
9881
+ __decorateClass$j([
9713
9882
  property({ fallback: "butt" })
9714
9883
  ], BaseElement2DOutline.prototype, "lineCap");
9715
- __decorateClass$q([
9884
+ __decorateClass$j([
9716
9885
  property({ fallback: "miter" })
9717
9886
  ], BaseElement2DOutline.prototype, "lineJoin");
9718
9887
 
9719
- var __defProp$i = Object.defineProperty;
9720
- var __decorateClass$p = (decorators, target, key, kind) => {
9888
+ var __defProp$f = Object.defineProperty;
9889
+ var __decorateClass$i = (decorators, target, key, kind) => {
9721
9890
  var result = void 0 ;
9722
9891
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9723
9892
  if (decorator = decorators[i])
9724
9893
  result = (decorator(target, key, result) ) || result;
9725
- if (result) __defProp$i(target, key, result);
9894
+ if (result) __defProp$f(target, key, result);
9726
9895
  return result;
9727
9896
  };
9728
9897
  class BaseElement2DShadow extends CoreObject {
@@ -9762,29 +9931,29 @@ class BaseElement2DShadow extends CoreObject {
9762
9931
  }
9763
9932
  }
9764
9933
  }
9765
- __decorateClass$p([
9934
+ __decorateClass$i([
9766
9935
  property({ fallback: true })
9767
9936
  ], BaseElement2DShadow.prototype, "enabled");
9768
- __decorateClass$p([
9937
+ __decorateClass$i([
9769
9938
  property({ fallback: "#000000FF" })
9770
9939
  ], BaseElement2DShadow.prototype, "color");
9771
- __decorateClass$p([
9940
+ __decorateClass$i([
9772
9941
  property({ fallback: 0 })
9773
9942
  ], BaseElement2DShadow.prototype, "blur");
9774
- __decorateClass$p([
9943
+ __decorateClass$i([
9775
9944
  property({ fallback: 0 })
9776
9945
  ], BaseElement2DShadow.prototype, "offsetY");
9777
- __decorateClass$p([
9946
+ __decorateClass$i([
9778
9947
  property({ fallback: 0 })
9779
9948
  ], BaseElement2DShadow.prototype, "offsetX");
9780
9949
 
9781
- var __defProp$h = Object.defineProperty;
9782
- var __decorateClass$o = (decorators, target, key, kind) => {
9950
+ var __defProp$e = Object.defineProperty;
9951
+ var __decorateClass$h = (decorators, target, key, kind) => {
9783
9952
  var result = void 0 ;
9784
9953
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9785
9954
  if (decorator = decorators[i])
9786
9955
  result = (decorator(target, key, result) ) || result;
9787
- if (result) __defProp$h(target, key, result);
9956
+ if (result) __defProp$e(target, key, result);
9788
9957
  return result;
9789
9958
  };
9790
9959
  class BaseElement2DShape extends CoreObject {
@@ -9859,19 +10028,19 @@ class BaseElement2DShape extends CoreObject {
9859
10028
  }
9860
10029
  }
9861
10030
  }
9862
- __decorateClass$o([
10031
+ __decorateClass$h([
9863
10032
  property({ fallback: true })
9864
10033
  ], BaseElement2DShape.prototype, "enabled");
9865
- __decorateClass$o([
10034
+ __decorateClass$h([
9866
10035
  property()
9867
10036
  ], BaseElement2DShape.prototype, "preset");
9868
- __decorateClass$o([
10037
+ __decorateClass$h([
9869
10038
  property()
9870
10039
  ], BaseElement2DShape.prototype, "svg");
9871
- __decorateClass$o([
10040
+ __decorateClass$h([
9872
10041
  property()
9873
10042
  ], BaseElement2DShape.prototype, "viewBox");
9874
- __decorateClass$o([
10043
+ __decorateClass$h([
9875
10044
  property()
9876
10045
  ], BaseElement2DShape.prototype, "paths");
9877
10046
 
@@ -9887,13 +10056,13 @@ for (const key in defaultStyles$1) {
9887
10056
  defineProperty(BaseElement2DStyle, key, { fallback });
9888
10057
  }
9889
10058
 
9890
- var __defProp$g = Object.defineProperty;
9891
- var __decorateClass$n = (decorators, target, key, kind) => {
10059
+ var __defProp$d = Object.defineProperty;
10060
+ var __decorateClass$g = (decorators, target, key, kind) => {
9892
10061
  var result = void 0 ;
9893
10062
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9894
10063
  if (decorator = decorators[i])
9895
10064
  result = (decorator(target, key, result) ) || result;
9896
- if (result) __defProp$g(target, key, result);
10065
+ if (result) __defProp$d(target, key, result);
9897
10066
  return result;
9898
10067
  };
9899
10068
  class BaseElement2DText extends CoreObject {
@@ -10083,34 +10252,34 @@ class BaseElement2DText extends CoreObject {
10083
10252
  });
10084
10253
  }
10085
10254
  }
10086
- __decorateClass$n([
10255
+ __decorateClass$g([
10087
10256
  property({ fallback: true })
10088
10257
  ], BaseElement2DText.prototype, "enabled");
10089
- __decorateClass$n([
10258
+ __decorateClass$g([
10090
10259
  property({ fallback: () => [] })
10091
10260
  ], BaseElement2DText.prototype, "content");
10092
- __decorateClass$n([
10261
+ __decorateClass$g([
10093
10262
  property({ alias: "parent.style.json" })
10094
10263
  ], BaseElement2DText.prototype, "style");
10095
- __decorateClass$n([
10264
+ __decorateClass$g([
10096
10265
  property()
10097
10266
  ], BaseElement2DText.prototype, "effects");
10098
- __decorateClass$n([
10267
+ __decorateClass$g([
10099
10268
  property()
10100
10269
  ], BaseElement2DText.prototype, "fill");
10101
- __decorateClass$n([
10270
+ __decorateClass$g([
10102
10271
  property()
10103
10272
  ], BaseElement2DText.prototype, "outline");
10104
- __decorateClass$n([
10273
+ __decorateClass$g([
10105
10274
  property({ alias: "base.measureDom" })
10106
10275
  ], BaseElement2DText.prototype, "measureDom");
10107
- __decorateClass$n([
10276
+ __decorateClass$g([
10108
10277
  property({ alias: "base.fonts" })
10109
10278
  ], BaseElement2DText.prototype, "fonts");
10110
10279
 
10111
- var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
10112
- var __decorateClass$m = (decorators, target, key, kind) => {
10113
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target;
10280
+ var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
10281
+ var __decorateClass$f = (decorators, target, key, kind) => {
10282
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
10114
10283
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
10115
10284
  if (decorator = decorators[i])
10116
10285
  result = (decorator(result)) || result;
@@ -10317,6 +10486,14 @@ let BaseElement2D = class extends Node2D {
10317
10486
  super.updateGlobalTransform();
10318
10487
  this._updateOverflow();
10319
10488
  }
10489
+ _relayout(batchables) {
10490
+ return super._relayout(batchables).map((batchable) => {
10491
+ return {
10492
+ ...batchable,
10493
+ dimension: this.size.toFloat32Array()
10494
+ };
10495
+ });
10496
+ }
10320
10497
  getRect() {
10321
10498
  return this.getGlobalAabb();
10322
10499
  }
@@ -10529,7 +10706,7 @@ let BaseElement2D = class extends Node2D {
10529
10706
  });
10530
10707
  }
10531
10708
  };
10532
- BaseElement2D = __decorateClass$m([
10709
+ BaseElement2D = __decorateClass$f([
10533
10710
  customNode("BaseElement2D")
10534
10711
  ], BaseElement2D);
10535
10712
 
@@ -10556,9 +10733,9 @@ class FlexElement2DStyle extends BaseElement2DStyle {
10556
10733
  }
10557
10734
  }
10558
10735
 
10559
- var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
10560
- var __decorateClass$l = (decorators, target, key, kind) => {
10561
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target;
10736
+ var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
10737
+ var __decorateClass$e = (decorators, target, key, kind) => {
10738
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
10562
10739
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
10563
10740
  if (decorator = decorators[i])
10564
10741
  result = (decorator(result)) || result;
@@ -10609,7 +10786,7 @@ let Element2D = class extends BaseElement2D {
10609
10786
  }
10610
10787
  }
10611
10788
  };
10612
- Element2D = __decorateClass$l([
10789
+ Element2D = __decorateClass$e([
10613
10790
  customNode("Element2D")
10614
10791
  ], Element2D);
10615
10792
 
@@ -10919,9 +11096,9 @@ class FlexLayout {
10919
11096
  }
10920
11097
  }
10921
11098
 
10922
- var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
10923
- var __decorateClass$k = (decorators, target, key, kind) => {
10924
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
11099
+ var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
11100
+ var __decorateClass$d = (decorators, target, key, kind) => {
11101
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
10925
11102
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
10926
11103
  if (decorator = decorators[i])
10927
11104
  result = (decorator(result)) || result;
@@ -10998,18 +11175,18 @@ let FlexElement2D = class extends BaseElement2D {
10998
11175
  }
10999
11176
  }
11000
11177
  };
11001
- FlexElement2D = __decorateClass$k([
11178
+ FlexElement2D = __decorateClass$d([
11002
11179
  customNode("FlexElement2D")
11003
11180
  ], FlexElement2D);
11004
11181
 
11005
- var __defProp$f = Object.defineProperty;
11006
- var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
11007
- var __decorateClass$j = (decorators, target, key, kind) => {
11008
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
11182
+ var __defProp$c = Object.defineProperty;
11183
+ var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
11184
+ var __decorateClass$c = (decorators, target, key, kind) => {
11185
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
11009
11186
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11010
11187
  if (decorator = decorators[i])
11011
11188
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11012
- if (kind && result) __defProp$f(target, key, result);
11189
+ if (kind && result) __defProp$c(target, key, result);
11013
11190
  return result;
11014
11191
  };
11015
11192
  let Image2D = class extends Element2D {
@@ -11145,19 +11322,19 @@ let Image2D = class extends Element2D {
11145
11322
  });
11146
11323
  }
11147
11324
  };
11148
- __decorateClass$j([
11325
+ __decorateClass$c([
11149
11326
  property({ internal: true })
11150
11327
  ], Image2D.prototype, "texture", 2);
11151
- __decorateClass$j([
11328
+ __decorateClass$c([
11152
11329
  property({ fallback: "" })
11153
11330
  ], Image2D.prototype, "src", 2);
11154
- __decorateClass$j([
11331
+ __decorateClass$c([
11155
11332
  property()
11156
11333
  ], Image2D.prototype, "srcRect", 2);
11157
- __decorateClass$j([
11334
+ __decorateClass$c([
11158
11335
  property({ fallback: false })
11159
11336
  ], Image2D.prototype, "gif", 2);
11160
- Image2D = __decorateClass$j([
11337
+ Image2D = __decorateClass$c([
11161
11338
  customNode("Image2D")
11162
11339
  ], Image2D);
11163
11340
 
@@ -11181,14 +11358,14 @@ class TextureRect2D extends Element2D {
11181
11358
  }
11182
11359
  }
11183
11360
 
11184
- var __defProp$e = Object.defineProperty;
11185
- var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
11186
- var __decorateClass$i = (decorators, target, key, kind) => {
11187
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
11361
+ var __defProp$b = Object.defineProperty;
11362
+ var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
11363
+ var __decorateClass$b = (decorators, target, key, kind) => {
11364
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
11188
11365
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11189
11366
  if (decorator = decorators[i])
11190
11367
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11191
- if (kind && result) __defProp$e(target, key, result);
11368
+ if (kind && result) __defProp$b(target, key, result);
11192
11369
  return result;
11193
11370
  };
11194
11371
  let Lottie2D = class extends TextureRect2D {
@@ -11231,20 +11408,20 @@ let Lottie2D = class extends TextureRect2D {
11231
11408
  super._process(delta);
11232
11409
  }
11233
11410
  };
11234
- __decorateClass$i([
11411
+ __decorateClass$b([
11235
11412
  property({ fallback: "" })
11236
11413
  ], Lottie2D.prototype, "src", 2);
11237
- Lottie2D = __decorateClass$i([
11414
+ Lottie2D = __decorateClass$b([
11238
11415
  customNode("Lottie2D")
11239
11416
  ], Lottie2D);
11240
11417
 
11241
- var __defProp$d = Object.defineProperty;
11242
- var __decorateClass$h = (decorators, target, key, kind) => {
11418
+ var __defProp$a = Object.defineProperty;
11419
+ var __decorateClass$a = (decorators, target, key, kind) => {
11243
11420
  var result = void 0 ;
11244
11421
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11245
11422
  if (decorator = decorators[i])
11246
11423
  result = (decorator(target, key, result) ) || result;
11247
- if (result) __defProp$d(target, key, result);
11424
+ if (result) __defProp$a(target, key, result);
11248
11425
  return result;
11249
11426
  };
11250
11427
  class TransformRect2D extends Element2D {
@@ -11290,18 +11467,18 @@ class TransformRect2D extends Element2D {
11290
11467
  this._drawEllipse(width, height / 2);
11291
11468
  }
11292
11469
  }
11293
- __decorateClass$h([
11470
+ __decorateClass$a([
11294
11471
  property({ fallback: 6 })
11295
11472
  ], TransformRect2D.prototype, "handleSize");
11296
11473
 
11297
- var __defProp$c = Object.defineProperty;
11298
- var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
11299
- var __decorateClass$g = (decorators, target, key, kind) => {
11300
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
11474
+ var __defProp$9 = Object.defineProperty;
11475
+ var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
11476
+ var __decorateClass$9 = (decorators, target, key, kind) => {
11477
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
11301
11478
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11302
11479
  if (decorator = decorators[i])
11303
11480
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11304
- if (kind && result) __defProp$c(target, key, result);
11481
+ if (kind && result) __defProp$9(target, key, result);
11305
11482
  return result;
11306
11483
  };
11307
11484
  let Video2D = class extends TextureRect2D {
@@ -11354,21 +11531,21 @@ let Video2D = class extends TextureRect2D {
11354
11531
  super._process(delta);
11355
11532
  }
11356
11533
  };
11357
- __decorateClass$g([
11534
+ __decorateClass$9([
11358
11535
  property({ fallback: "" })
11359
11536
  ], Video2D.prototype, "src", 2);
11360
- Video2D = __decorateClass$g([
11537
+ Video2D = __decorateClass$9([
11361
11538
  customNode("Video2D")
11362
11539
  ], Video2D);
11363
11540
 
11364
- var __defProp$b = Object.defineProperty;
11365
- var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
11366
- var __decorateClass$f = (decorators, target, key, kind) => {
11367
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
11541
+ var __defProp$8 = Object.defineProperty;
11542
+ var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
11543
+ var __decorateClass$8 = (decorators, target, key, kind) => {
11544
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
11368
11545
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11369
11546
  if (decorator = decorators[i])
11370
11547
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11371
- if (kind && result) __defProp$b(target, key, result);
11548
+ if (kind && result) __defProp$8(target, key, result);
11372
11549
  return result;
11373
11550
  };
11374
11551
  const linear = (amount) => amount;
@@ -11687,19 +11864,19 @@ let Animation = class extends TimelineNode {
11687
11864
  });
11688
11865
  }
11689
11866
  };
11690
- __decorateClass$f([
11867
+ __decorateClass$8([
11691
11868
  property({ fallback: "parent" })
11692
11869
  ], Animation.prototype, "effectMode", 2);
11693
- __decorateClass$f([
11870
+ __decorateClass$8([
11694
11871
  property({ fallback: false })
11695
11872
  ], Animation.prototype, "loop", 2);
11696
- __decorateClass$f([
11873
+ __decorateClass$8([
11697
11874
  property({ default: () => [] })
11698
11875
  ], Animation.prototype, "keyframes", 2);
11699
- __decorateClass$f([
11876
+ __decorateClass$8([
11700
11877
  property()
11701
11878
  ], Animation.prototype, "easing", 2);
11702
- Animation = __decorateClass$f([
11879
+ Animation = __decorateClass$8([
11703
11880
  customNode("Animation", {
11704
11881
  renderMode: "disabled",
11705
11882
  processMode: "pausable",
@@ -12580,11 +12757,11 @@ class WebAudio extends AudioPipeline {
12580
12757
  }
12581
12758
  }
12582
12759
 
12583
- var __defProp$a = Object.defineProperty;
12584
- var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
12585
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12586
- var __decorateClass$e = (decorators, target, key, kind) => {
12587
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
12760
+ var __defProp$7 = Object.defineProperty;
12761
+ var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
12762
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12763
+ var __decorateClass$7 = (decorators, target, key, kind) => {
12764
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
12588
12765
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
12589
12766
  if (decorator = decorators[i])
12590
12767
  result = (decorator(result)) || result;
@@ -12795,7 +12972,7 @@ let Audio = class extends TimelineNode {
12795
12972
  }
12796
12973
  };
12797
12974
  __publicField$4(Audio, "_soundPool", []);
12798
- Audio = __decorateClass$e([
12975
+ Audio = __decorateClass$7([
12799
12976
  customNode("Audio")
12800
12977
  ], Audio);
12801
12978
 
@@ -12803,14 +12980,14 @@ class AudioSpectrum extends Node2D {
12803
12980
  //
12804
12981
  }
12805
12982
 
12806
- var __defProp$9 = Object.defineProperty;
12807
- var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
12808
- var __decorateClass$d = (decorators, target, key, kind) => {
12809
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
12810
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
12983
+ var __defProp$6 = Object.defineProperty;
12984
+ var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
12985
+ var __decorateClass$6 = (decorators, target, key, kind) => {
12986
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
12987
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
12811
12988
  if (decorator = decorators[i])
12812
12989
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
12813
- if (kind && result) __defProp$9(target, key, result);
12990
+ if (kind && result) __defProp$6(target, key, result);
12814
12991
  return result;
12815
12992
  };
12816
12993
  let AudioWaveform = class extends Element2D {
@@ -12901,430 +13078,23 @@ let AudioWaveform = class extends Element2D {
12901
13078
  }
12902
13079
  }
12903
13080
  };
12904
- __decorateClass$d([
13081
+ __decorateClass$6([
12905
13082
  property()
12906
13083
  ], AudioWaveform.prototype, "src", 2);
12907
- __decorateClass$d([
13084
+ __decorateClass$6([
12908
13085
  property({ fallback: 0 })
12909
13086
  ], AudioWaveform.prototype, "gap", 2);
12910
- __decorateClass$d([
13087
+ __decorateClass$6([
12911
13088
  property({ fallback: "#000000" })
12912
13089
  ], AudioWaveform.prototype, "color", 2);
12913
- AudioWaveform = __decorateClass$d([
13090
+ AudioWaveform = __decorateClass$6([
12914
13091
  customNode("AudioWaveform")
12915
13092
  ], AudioWaveform);
12916
13093
 
12917
- var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
12918
- var __decorateClass$c = (decorators, target, key, kind) => {
12919
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
12920
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
12921
- if (decorator = decorators[i])
12922
- result = (decorator(result)) || result;
12923
- return result;
12924
- };
12925
- let Control = class extends Element2D {
12926
- constructor(properties, children = []) {
12927
- super();
12928
- this._parentUpdateRect = this._parentUpdateRect.bind(this);
12929
- this.setProperties(properties);
12930
- this.append(children);
12931
- }
12932
- _parented(parent) {
12933
- super._parented(parent);
12934
- parent.on("updateRect", this._parentUpdateRect);
12935
- }
12936
- _unparented(oldParent) {
12937
- super._unparented(oldParent);
12938
- oldParent.off("updateRect", this._parentUpdateRect);
12939
- }
12940
- _parentUpdateRect() {
12941
- const rect = this._parent.getRect();
12942
- this.style.left = rect.left;
12943
- this.style.top = rect.top;
12944
- this.style.width = rect.width;
12945
- this.style.height = rect.height;
12946
- }
12947
- _input(event, key) {
12948
- super._input(event, key);
12949
- this._guiInput(event, key);
12950
- }
12951
- _updateStyleProperty(key, value, oldValue) {
12952
- super._updateStyleProperty(key, value, oldValue);
12953
- switch (key) {
12954
- case "width":
12955
- case "height":
12956
- case "left":
12957
- case "top":
12958
- this.emit("updateRect");
12959
- break;
12960
- }
12961
- }
12962
- // eslint-disable-next-line unused-imports/no-unused-vars
12963
- _guiInput(event, key) {
12964
- }
12965
- };
12966
- Control = __decorateClass$c([
12967
- customNode("Control")
12968
- ], Control);
12969
-
12970
- var __defProp$8 = Object.defineProperty;
12971
- var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
12972
- var __decorateClass$b = (decorators, target, key, kind) => {
12973
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
12974
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
12975
- if (decorator = decorators[i])
12976
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
12977
- if (kind && result) __defProp$8(target, key, result);
12978
- return result;
12979
- };
12980
- let Range = class extends Control {
12981
- constructor(properties, children = []) {
12982
- super();
12983
- this.setProperties(properties).append(children);
12984
- }
12985
- _updateProperty(key, value, oldValue) {
12986
- super._updateProperty(key, value, oldValue);
12987
- switch (key) {
12988
- case "allowGreater":
12989
- case "allowLesser":
12990
- case "page":
12991
- case "minValue":
12992
- case "maxValue":
12993
- case "step":
12994
- case "value":
12995
- this.requestRedraw();
12996
- break;
12997
- }
12998
- }
12999
- };
13000
- __decorateClass$b([
13001
- property({ fallback: false })
13002
- ], Range.prototype, "allowGreater", 2);
13003
- __decorateClass$b([
13004
- property({ fallback: false })
13005
- ], Range.prototype, "allowLesser", 2);
13006
- __decorateClass$b([
13007
- property({ fallback: 1 })
13008
- ], Range.prototype, "page", 2);
13009
- __decorateClass$b([
13010
- property({ fallback: 0 })
13011
- ], Range.prototype, "minValue", 2);
13012
- __decorateClass$b([
13013
- property({ fallback: 100 })
13014
- ], Range.prototype, "maxValue", 2);
13015
- __decorateClass$b([
13016
- property({ fallback: 0.01 })
13017
- ], Range.prototype, "step", 2);
13018
- __decorateClass$b([
13019
- property({ fallback: 0 })
13020
- ], Range.prototype, "value", 2);
13021
- Range = __decorateClass$b([
13022
- customNode("Range")
13023
- ], Range);
13024
-
13025
- var __defProp$7 = Object.defineProperty;
13026
- var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
13027
- var __decorateClass$a = (decorators, target, key, kind) => {
13028
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
13029
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
13030
- if (decorator = decorators[i])
13031
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
13032
- if (kind && result) __defProp$7(target, key, result);
13033
- return result;
13034
- };
13035
- let Ruler = class extends Control {
13036
- texture = new CanvasTexture();
13037
- constructor(properties, children = []) {
13038
- super();
13039
- this.setProperties(properties);
13040
- this.append(children);
13041
- }
13042
- _updateProperty(key, value, oldValue) {
13043
- super._updateProperty(key, value, oldValue);
13044
- switch (key) {
13045
- case "offsetX":
13046
- case "offsetY":
13047
- case "thickness":
13048
- case "markHeight":
13049
- case "color":
13050
- case "markBackgroundColor":
13051
- case "markColor":
13052
- case "gap":
13053
- case "scale":
13054
- this.requestRedraw();
13055
- break;
13056
- }
13057
- }
13058
- _updateStyleProperty(key, value, oldValue) {
13059
- super._updateStyleProperty(key, value, oldValue);
13060
- switch (key) {
13061
- case "width":
13062
- case "height":
13063
- this.texture[key] = value;
13064
- this.requestRedraw();
13065
- break;
13066
- }
13067
- }
13068
- _drawTexture() {
13069
- const { width, height } = this.size;
13070
- const {
13071
- offsetX,
13072
- offsetY,
13073
- thickness,
13074
- markHeight,
13075
- markBackgroundColor,
13076
- markColor,
13077
- color,
13078
- gap: _gap,
13079
- gapScale: _scale
13080
- } = this;
13081
- const canvas = this.texture.source;
13082
- const ctx = canvas.getContext("2d");
13083
- ctx.reset();
13084
- ctx.scale(this.texture.pixelRatio, this.texture.pixelRatio);
13085
- const x = Math.round(offsetX);
13086
- const y = Math.round(offsetY);
13087
- ctx.beginPath();
13088
- ctx.fillStyle = markBackgroundColor || "#EEE";
13089
- ctx.fillRect(0, 0, width, thickness);
13090
- ctx.fillRect(0, 0, thickness, height);
13091
- ctx.fill();
13092
- ctx.strokeStyle = markColor || "#000";
13093
- ctx.moveTo(thickness, 0);
13094
- ctx.lineTo(thickness, height);
13095
- ctx.moveTo(0, thickness);
13096
- ctx.lineTo(width, thickness);
13097
- ctx.stroke();
13098
- const originGap = _gap;
13099
- const curGap = _gap * _scale;
13100
- let scale;
13101
- let gap;
13102
- let markSize;
13103
- let axis;
13104
- let i;
13105
- if (originGap >= curGap) {
13106
- scale = originGap / curGap;
13107
- gap = Math.floor(scale) * originGap / 20;
13108
- markSize = originGap / 20 * Math.floor(scale) / scale;
13109
- } else {
13110
- scale = curGap / originGap;
13111
- gap = Math.floor(originGap / 20 / scale);
13112
- if (gap >= 2) {
13113
- gap = Math.floor(gap / 2) * 2;
13114
- } else {
13115
- gap = 1;
13116
- }
13117
- markSize = gap * scale;
13118
- }
13119
- ctx.fillStyle = ctx.strokeStyle;
13120
- for (axis = x, i = 0; axis < width; i++, axis += markSize) {
13121
- ctx.moveTo(axis, thickness - (i % 5 ? markHeight : 2 * markHeight));
13122
- ctx.lineTo(axis, thickness);
13123
- }
13124
- for (axis = x, i = 0; axis > thickness; i++, axis -= markSize) {
13125
- ctx.moveTo(axis, thickness - (i % 5 ? markHeight : 2 * markHeight));
13126
- ctx.lineTo(axis, thickness);
13127
- }
13128
- let textOffset = 0;
13129
- for (axis = y, i = 0; axis > thickness; i++, axis -= markSize) {
13130
- ctx.moveTo(thickness - (i % 5 ? markHeight : 2 * markHeight), axis);
13131
- ctx.lineTo(thickness, axis);
13132
- }
13133
- for (axis = y, i = 0; axis < height; i++, axis += markSize) {
13134
- ctx.moveTo(thickness - (i % 5 ? markHeight : 2 * markHeight), axis);
13135
- ctx.lineTo(thickness, axis);
13136
- }
13137
- ctx.save();
13138
- ctx.fillStyle = color;
13139
- ctx.scale(0.8, 0.8);
13140
- textOffset = thickness - 8;
13141
- for (axis = x, i = 0; axis < width; i++, axis += markSize) {
13142
- if (i % 10 === 0) {
13143
- ctx.fillText(String(Math.ceil(gap * i)), axis * 1.25 - 3, textOffset * 1.25);
13144
- }
13145
- }
13146
- for (axis = x, i = 0; axis > thickness; i++, axis -= markSize) {
13147
- if (i % 10 === 0) {
13148
- ctx.fillText(String(Math.ceil(-gap * i)), axis * 1.25 - 3, textOffset * 1.25);
13149
- }
13150
- }
13151
- textOffset = 0;
13152
- for (axis = y, i = 0; axis > thickness; i++, axis -= markSize) {
13153
- if (i % 10 === 0) {
13154
- ctx.fillText(String(Math.ceil(gap * i)), textOffset * 1.25, axis * 1.25 + 3);
13155
- }
13156
- }
13157
- for (axis = y, i = 0; axis < height; i++, axis += markSize) {
13158
- if (i % 10 === 0) {
13159
- ctx.fillText(String(Math.ceil(-gap * i)), textOffset * 1.25, axis * 1.25 + 3);
13160
- }
13161
- }
13162
- ctx.restore();
13163
- ctx.stroke();
13164
- this.texture.requestUpload();
13165
- }
13166
- _draw() {
13167
- this._drawTexture();
13168
- const texture = this.texture;
13169
- if (texture?.valid) {
13170
- this.context.fillStyle = texture;
13171
- this.context.uvTransform = new Transform2D().scale(
13172
- 1 / this.size.width,
13173
- 1 / this.size.height
13174
- );
13175
- this.context.rect(0, 0, texture.width, texture.height);
13176
- this.context.fill();
13177
- }
13178
- }
13179
- };
13180
- __decorateClass$a([
13181
- property({ fallback: 0 })
13182
- ], Ruler.prototype, "offsetX", 2);
13183
- __decorateClass$a([
13184
- property({ fallback: 0 })
13185
- ], Ruler.prototype, "offsetY", 2);
13186
- __decorateClass$a([
13187
- property({ fallback: 20 })
13188
- ], Ruler.prototype, "thickness", 2);
13189
- __decorateClass$a([
13190
- property({ fallback: 3 })
13191
- ], Ruler.prototype, "markHeight", 2);
13192
- __decorateClass$a([
13193
- property({ fallback: "#b2b6bc" })
13194
- ], Ruler.prototype, "color", 2);
13195
- __decorateClass$a([
13196
- property({ fallback: "#f9f9fa" })
13197
- ], Ruler.prototype, "markBackgroundColor", 2);
13198
- __decorateClass$a([
13199
- property({ fallback: "#b2b6bc" })
13200
- ], Ruler.prototype, "markColor", 2);
13201
- __decorateClass$a([
13202
- property({ fallback: 300 })
13203
- ], Ruler.prototype, "gap", 2);
13204
- __decorateClass$a([
13205
- property({ fallback: 1 })
13206
- ], Ruler.prototype, "gapScale", 2);
13207
- Ruler = __decorateClass$a([
13208
- customNode("Ruler")
13209
- ], Ruler);
13210
-
13211
- var __defProp$6 = Object.defineProperty;
13212
- var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
13213
- var __decorateClass$9 = (decorators, target, key, kind) => {
13214
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
13215
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
13216
- if (decorator = decorators[i])
13217
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
13218
- if (kind && result) __defProp$6(target, key, result);
13219
- return result;
13220
- };
13221
- let ScrollBar = class extends Range {
13222
- constructor(properties, children = []) {
13223
- super();
13224
- this.setProperties(properties).append(children);
13225
- }
13226
- _updateStyleProperty(key, value, oldValue) {
13227
- super._updateStyleProperty(key, value, oldValue);
13228
- switch (key) {
13229
- case "width":
13230
- case "height":
13231
- case "left":
13232
- case "top":
13233
- this.requestRedraw();
13234
- break;
13235
- }
13236
- }
13237
- _rect() {
13238
- const { size, position } = this;
13239
- let left, top, width, height, radii;
13240
- if (this.direction === "vertical") {
13241
- width = 10;
13242
- height = size.height * (this.page / (this.maxValue - this.minValue));
13243
- left = position.left + size.width - width;
13244
- top = size.height * (this.value / (this.maxValue - this.minValue));
13245
- radii = width / 2;
13246
- } else {
13247
- width = size.width * (this.page / (this.maxValue - this.minValue));
13248
- height = 10;
13249
- left = size.width * (this.value / (this.maxValue - this.minValue));
13250
- top = position.top + size.height - height;
13251
- radii = height / 2;
13252
- }
13253
- return { left, top, width, height, radii };
13254
- }
13255
- _draw() {
13256
- const { left, top, width, height, radii } = this._rect();
13257
- this.context.roundRect(left, top, width, height, radii);
13258
- this.context.fillStyle = 34;
13259
- this.context.fill();
13260
- }
13261
- _pointerInput(point, key) {
13262
- const { left, top, width, height } = this._rect();
13263
- const flag = point.x >= left && point.x < left + width && point.y >= top && point.y < top + height;
13264
- switch (key) {
13265
- case "pointerdown":
13266
- case "pointermove":
13267
- if (flag) {
13268
- this._tree?.input.setCursor("pointer");
13269
- } else {
13270
- this._tree?.input.setCursor(void 0);
13271
- }
13272
- break;
13273
- }
13274
- return false;
13275
- }
13276
- };
13277
- __decorateClass$9([
13278
- property({ fallback: "vertical" })
13279
- ], ScrollBar.prototype, "direction", 2);
13280
- ScrollBar = __decorateClass$9([
13281
- customNode("ScrollBar")
13282
- ], ScrollBar);
13283
-
13284
- var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
13285
- var __decorateClass$8 = (decorators, target, key, kind) => {
13286
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
13287
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
13288
- if (decorator = decorators[i])
13289
- result = (decorator(result)) || result;
13290
- return result;
13291
- };
13292
- let XScrollBar = class extends ScrollBar {
13293
- constructor(properties, children = []) {
13294
- super();
13295
- this.setProperties(properties).append(children);
13296
- }
13297
- };
13298
- XScrollBar = __decorateClass$8([
13299
- customNode("XScrollBar", {
13300
- direction: "horizontal"
13301
- })
13302
- ], XScrollBar);
13303
-
13304
- var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
13305
- var __decorateClass$7 = (decorators, target, key, kind) => {
13306
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
13307
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
13308
- if (decorator = decorators[i])
13309
- result = (decorator(result)) || result;
13310
- return result;
13311
- };
13312
- let YScrollBar = class extends ScrollBar {
13313
- constructor(properties, children = []) {
13314
- super();
13315
- this.setProperties(properties).append(children);
13316
- }
13317
- };
13318
- YScrollBar = __decorateClass$7([
13319
- customNode("YScrollBar", {
13320
- direction: "vertical"
13321
- })
13322
- ], YScrollBar);
13323
-
13324
13094
  var __defProp$5 = Object.defineProperty;
13325
- var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
13326
- var __decorateClass$6 = (decorators, target, key, kind) => {
13327
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
13095
+ var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
13096
+ var __decorateClass$5 = (decorators, target, key, kind) => {
13097
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
13328
13098
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
13329
13099
  if (decorator = decorators[i])
13330
13100
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
@@ -13389,22 +13159,22 @@ let Scaler = class extends Node {
13389
13159
  }
13390
13160
  }
13391
13161
  };
13392
- __decorateClass$6([
13162
+ __decorateClass$5([
13393
13163
  property({ default: 1 })
13394
13164
  ], Scaler.prototype, "translateX", 2);
13395
- __decorateClass$6([
13165
+ __decorateClass$5([
13396
13166
  property({ default: 1 })
13397
13167
  ], Scaler.prototype, "translateY", 2);
13398
- __decorateClass$6([
13168
+ __decorateClass$5([
13399
13169
  property({ default: 1 })
13400
13170
  ], Scaler.prototype, "scale", 2);
13401
- __decorateClass$6([
13171
+ __decorateClass$5([
13402
13172
  property({ default: 0.05 })
13403
13173
  ], Scaler.prototype, "minScale", 2);
13404
- __decorateClass$6([
13174
+ __decorateClass$5([
13405
13175
  property({ default: 10 })
13406
13176
  ], Scaler.prototype, "maxScale", 2);
13407
- Scaler = __decorateClass$6([
13177
+ Scaler = __decorateClass$5([
13408
13178
  customNode("Scaler", {
13409
13179
  processMode: "disabled",
13410
13180
  renderMode: "disabled"
@@ -13412,10 +13182,10 @@ Scaler = __decorateClass$6([
13412
13182
  ], Scaler);
13413
13183
 
13414
13184
  var __defProp$4 = Object.defineProperty;
13415
- var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
13185
+ var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
13416
13186
  var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13417
- var __decorateClass$5 = (decorators, target, key, kind) => {
13418
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
13187
+ var __decorateClass$4 = (decorators, target, key, kind) => {
13188
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
13419
13189
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
13420
13190
  if (decorator = decorators[i])
13421
13191
  result = (decorator(result)) || result;
@@ -13503,15 +13273,15 @@ void main(void) {
13503
13273
  gl_FragColor = color;
13504
13274
  }`
13505
13275
  }));
13506
- KawaseTransition = __decorateClass$5([
13276
+ KawaseTransition = __decorateClass$4([
13507
13277
  customNode("KawaseTransition")
13508
13278
  ], KawaseTransition);
13509
13279
 
13510
13280
  var __defProp$3 = Object.defineProperty;
13511
- var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
13281
+ var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
13512
13282
  var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13513
- var __decorateClass$4 = (decorators, target, key, kind) => {
13514
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
13283
+ var __decorateClass$3 = (decorators, target, key, kind) => {
13284
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
13515
13285
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
13516
13286
  if (decorator = decorators[i])
13517
13287
  result = (decorator(result)) || result;
@@ -13556,15 +13326,15 @@ void main() {
13556
13326
  gl_FragColor = mix(src2Color, src1Color, mixPercent);
13557
13327
  }`
13558
13328
  }));
13559
- LeftEraseTransition = __decorateClass$4([
13329
+ LeftEraseTransition = __decorateClass$3([
13560
13330
  customNode("LeftEraseTransition")
13561
13331
  ], LeftEraseTransition);
13562
13332
 
13563
13333
  var __defProp$2 = Object.defineProperty;
13564
- var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
13334
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
13565
13335
  var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13566
- var __decorateClass$3 = (decorators, target, key, kind) => {
13567
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
13336
+ var __decorateClass$2 = (decorators, target, key, kind) => {
13337
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
13568
13338
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
13569
13339
  if (decorator = decorators[i])
13570
13340
  result = (decorator(result)) || result;
@@ -13663,15 +13433,15 @@ void main(void) {
13663
13433
  gl_FragColor = color;
13664
13434
  }`
13665
13435
  }));
13666
- TiltShiftTransition = __decorateClass$3([
13436
+ TiltShiftTransition = __decorateClass$2([
13667
13437
  customNode("TiltShiftTransition")
13668
13438
  ], TiltShiftTransition);
13669
13439
 
13670
13440
  var __defProp$1 = Object.defineProperty;
13671
- var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
13441
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13672
13442
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13673
- var __decorateClass$2 = (decorators, target, key, kind) => {
13674
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
13443
+ var __decorateClass$1 = (decorators, target, key, kind) => {
13444
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
13675
13445
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
13676
13446
  if (decorator = decorators[i])
13677
13447
  result = (decorator(result)) || result;
@@ -13757,7 +13527,7 @@ void main(void) {
13757
13527
  gl_FragColor = texture2D(sampler, coord);
13758
13528
  }`
13759
13529
  }));
13760
- TwistTransition = __decorateClass$2([
13530
+ TwistTransition = __decorateClass$1([
13761
13531
  customNode("TwistTransition")
13762
13532
  ], TwistTransition);
13763
13533
 
@@ -14121,220 +13891,6 @@ class Assets {
14121
13891
  }
14122
13892
  const assets = new Assets().use(new FontLoader()).use(new GifLoader()).use(new JsonLoader()).use(new LottieLoader()).use(new TextLoader()).use(new TextureLoader()).use(new VideoLoader());
14123
13893
 
14124
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
14125
- var __decorateClass$1 = (decorators, target, key, kind) => {
14126
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
14127
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
14128
- if (decorator = decorators[i])
14129
- result = (decorator(result)) || result;
14130
- return result;
14131
- };
14132
- let CanvasItemEditor = class extends Control {
14133
- _pointerStart;
14134
- _pointerOffset;
14135
- selected;
14136
- dragging;
14137
- hovered;
14138
- hover = new Element2D({
14139
- name: "hover",
14140
- internalMode: "back",
14141
- style: {
14142
- visibility: "hidden",
14143
- outlineStyle: "solid",
14144
- outlineColor: "#00FF00FF",
14145
- outlineWidth: 2,
14146
- pointerEvents: "none"
14147
- }
14148
- });
14149
- transformRect = new TransformRect2D({
14150
- name: "transformRect",
14151
- internalMode: "back",
14152
- style: {
14153
- visibility: "hidden",
14154
- pointerEvents: "none"
14155
- }
14156
- });
14157
- scaler = new Scaler({
14158
- name: "Scaler",
14159
- internalMode: "back"
14160
- }).on("updateScale", (scale) => {
14161
- this.ruler.gapScale = scale;
14162
- this._updateScrollbars();
14163
- this._updateSelectionRect();
14164
- });
14165
- xScrollBar = new XScrollBar({
14166
- name: "XScrollBar",
14167
- internalMode: "back",
14168
- style: {
14169
- visibility: "hidden"
14170
- }
14171
- });
14172
- yScrollBar = new YScrollBar({
14173
- name: "yScrollBar",
14174
- internalMode: "back",
14175
- style: {
14176
- visibility: "hidden"
14177
- }
14178
- });
14179
- drawboard = new Element2D({
14180
- name: "drawboard",
14181
- style: {
14182
- width: 500,
14183
- height: 500,
14184
- backgroundColor: "#00FFFFFF",
14185
- // overflow: 'hidden',
14186
- pointerEvents: "none"
14187
- // boxShadow: '2px 2px 2px 1px rgba(0, 0, 0, 0.2)',
14188
- }
14189
- }, [
14190
- this.scaler
14191
- ]);
14192
- ruler = new Ruler({
14193
- name: "ruler",
14194
- offsetX: 100,
14195
- offsetY: 100,
14196
- style: {
14197
- pointerEvents: "none"
14198
- }
14199
- }, [
14200
- this.drawboard,
14201
- this.hover,
14202
- this.transformRect,
14203
- this.xScrollBar,
14204
- this.yScrollBar
14205
- ]);
14206
- constructor() {
14207
- super();
14208
- this._onPointerdown = this._onPointerdown.bind(this);
14209
- this._onPointermove = this._onPointermove.bind(this);
14210
- this._onPointerup = this._onPointerup.bind(this);
14211
- this.append(this.ruler);
14212
- }
14213
- _updateStyleProperty(key, value, oldValue) {
14214
- super._updateStyleProperty(key, value, oldValue);
14215
- switch (key) {
14216
- case "width":
14217
- this.drawboard.style.left = (this.size.width - this.drawboard.size.width) / 2;
14218
- this.ruler.offsetX = this.drawboard.style.left;
14219
- break;
14220
- case "height":
14221
- this.drawboard.style.top = (this.size.height - this.drawboard.size.height) / 2;
14222
- this.ruler.offsetY = this.drawboard.style.top;
14223
- break;
14224
- }
14225
- }
14226
- _guiInput(event, key) {
14227
- super._guiInput(event, key);
14228
- switch (key) {
14229
- case "pointerdown":
14230
- this._onPointerdown(event);
14231
- break;
14232
- case "pointermove":
14233
- this._onPointermove(event);
14234
- break;
14235
- case "pointerup":
14236
- this._onPointerup();
14237
- break;
14238
- }
14239
- }
14240
- _onPointerdown(e) {
14241
- let target = e.target;
14242
- if (target?.equal(this)) {
14243
- target = void 0;
14244
- }
14245
- if (target?.equal(this.transformRect)) {
14246
- target = this.selected;
14247
- }
14248
- this._pointerOffset = { x: e.offsetX, y: e.offsetY };
14249
- this.selected = target;
14250
- this.dragging = target;
14251
- if (target instanceof Element2D) {
14252
- this._pointerStart = target.style.clone();
14253
- } else {
14254
- this._pointerStart = void 0;
14255
- }
14256
- this._updateHover();
14257
- this._updateSelectionRect();
14258
- }
14259
- _onPointermove(e) {
14260
- let target = e.target;
14261
- if (target?.equal(this)) {
14262
- target = void 0;
14263
- }
14264
- if (target?.equal(this.transformRect)) {
14265
- target = this.selected;
14266
- }
14267
- const { selected, dragging, _pointerStart, _pointerOffset } = this;
14268
- if (selected && target?.equal(selected)) {
14269
- this.hovered = void 0;
14270
- } else {
14271
- this.hovered = target;
14272
- }
14273
- const offset = _pointerOffset ? { x: e.offsetX - _pointerOffset.x, y: e.offsetY - _pointerOffset.y } : { x: 0, y: 0 };
14274
- if (dragging && _pointerStart) {
14275
- dragging.style.left = _pointerStart.left + offset.x / this.scaler.scale;
14276
- dragging.style.top = _pointerStart.top + offset.y / this.scaler.scale;
14277
- dragging.update();
14278
- }
14279
- this._updateHover();
14280
- this._updateSelectionRect();
14281
- }
14282
- _onPointerup() {
14283
- this.dragging = void 0;
14284
- this._updateHover();
14285
- this._updateSelectionRect();
14286
- }
14287
- _copyGlobalTransform(a, b) {
14288
- a.style.visibility = "visible";
14289
- a.style.width = b.globalScale.x * b.size.x;
14290
- a.style.height = b.globalScale.y * b.size.y;
14291
- a.style.left = b.globalPosition.x;
14292
- a.style.top = b.globalPosition.y;
14293
- a.style.rotate = b.globalRotation;
14294
- a.update();
14295
- }
14296
- _updateHover() {
14297
- const hovered = this.hovered;
14298
- if (hovered instanceof Element2D) {
14299
- this.hover.style.visibility = "visible";
14300
- this._copyGlobalTransform(this.hover, hovered);
14301
- this.hover.requestRedraw();
14302
- } else {
14303
- this.hover.style.visibility = "hidden";
14304
- }
14305
- }
14306
- _updateSelectionRect() {
14307
- if (this.selected) {
14308
- this.transformRect.style.visibility = "visible";
14309
- this._copyGlobalTransform(this.transformRect, this.selected);
14310
- } else {
14311
- this.transformRect.style.visibility = "hidden";
14312
- }
14313
- }
14314
- _updateScrollbars() {
14315
- const scale = this.ruler.gapScale;
14316
- const scrollHeight = this.drawboard.size.height * scale;
14317
- const scrollWidth = this.drawboard.size.width * scale;
14318
- if (scrollHeight > this.size.height) {
14319
- this.yScrollBar.style.visibility = "visible";
14320
- this.yScrollBar.maxValue = scrollHeight;
14321
- this.yScrollBar.page = this.size.height;
14322
- } else {
14323
- this.yScrollBar.style.visibility = "hidden";
14324
- }
14325
- if (scrollWidth > this.size.width) {
14326
- this.xScrollBar.style.visibility = "visible";
14327
- this.xScrollBar.maxValue = scrollWidth;
14328
- this.xScrollBar.page = this.size.width;
14329
- } else {
14330
- this.xScrollBar.style.visibility = "hidden";
14331
- }
14332
- }
14333
- };
14334
- CanvasItemEditor = __decorateClass$1([
14335
- customNode("CanvasItemEditor")
14336
- ], CanvasItemEditor);
14337
-
14338
13894
  var __defProp = Object.defineProperty;
14339
13895
  var __decorateClass = (decorators, target, key, kind) => {
14340
13896
  var result = void 0 ;
@@ -14600,4 +14156,4 @@ async function render(options) {
14600
14156
  });
14601
14157
  }
14602
14158
 
14603
- export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DBackground, BaseElement2DFill, BaseElement2DForeground, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DShape, BaseElement2DStyle, BaseElement2DText, Camera2D, 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, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GaussianBlurEffect, Geometry, GifLoader, GlitchEffect, GodrayEffect, GradientTexture, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JsonLoader, KawaseBlurEffect, KawaseTransition, KeyboardInputEvent, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, Meta, 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, 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, Window, XScrollBar, YScrollBar, ZoomBlurEffect, alignMap, assets, boxSizingMap, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, determineCrossOrigin, directionMap, displayMap, ease, easeIn, easeInOut, easeOut, edgeMap, flexDirectionMap, flexWrapMap, frag$1 as frag, getDefaultCssPropertyValue, gutterMap, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, justifyMap, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, overflowMap, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, positionTypeMap, render, timingFunctions, uid };
14159
+ export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DBackground, BaseElement2DFill, BaseElement2DForeground, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DShape, BaseElement2DStyle, BaseElement2DText, Camera2D, CanvasContext, CanvasItem, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DrawboardEffect, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GaussianBlurEffect, Geometry, GifLoader, GlitchEffect, GodrayEffect, GradientTexture, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JsonLoader, KawaseBlurEffect, KawaseTransition, KeyboardInputEvent, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, Meta, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, RawWeakMap, Rect2, RefCounted, Renderer, Resource, 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, 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, Window, ZoomBlurEffect, alignMap, assets, boxSizingMap, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, determineCrossOrigin, directionMap, displayMap, ease, easeIn, easeInOut, easeOut, edgeMap, flexDirectionMap, flexWrapMap, frag$1 as frag, getDefaultCssPropertyValue, gutterMap, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, justifyMap, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, overflowMap, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, positionTypeMap, render, timingFunctions, uid };