modern-canvas 0.18.2 → 0.18.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -184,34 +184,34 @@ function De(e, t, n = {}) {
184
184
  }
185
185
  //#endregion
186
186
  //#region src/core/shared/dom.ts
187
- var Oe = "WebGL2RenderingContext" in globalThis, ke = "ImageBitmap" in globalThis, Ae = "ResizeObserver" in globalThis, je = "PointerEvent" in globalThis, Me = "WheelEvent" in globalThis, Ne = "MouseEvent" in globalThis, C = "ontouchstart" in globalThis, Pe = "onclick" in globalThis, Fe = "createImageBitmap" in globalThis, Ie = "AudioContext" in globalThis, Le = "webkitAudioContext" in globalThis, Re = "OfflineAudioContext" in globalThis, ze = "webkitOfflineAudioContext" in globalThis, Be = Ie || Le, Ve = typeof window < "u", He = typeof navigator < "u" && navigator?.userAgent?.indexOf("Mac") >= 0, Ue = globalThis.devicePixelRatio || 1, We = (e) => typeof e == "object" && !!e && e.nodeType === 1, Ge = (e) => We(e) && e.tagName === "VIDEO", Ke = (e) => We(e) && e.tagName === "IMG";
188
- function qe(e) {
187
+ var Oe = "WebGL2RenderingContext" in globalThis, ke = "ImageBitmap" in globalThis, Ae = "ResizeObserver" in globalThis, je = "PointerEvent" in globalThis, Me = "WheelEvent" in globalThis, Ne = "MouseEvent" in globalThis, Pe = "ontouchstart" in globalThis, Fe = "onclick" in globalThis, Ie = "createImageBitmap" in globalThis, Le = "AudioContext" in globalThis, Re = "webkitAudioContext" in globalThis, ze = "OfflineAudioContext" in globalThis, Be = "webkitOfflineAudioContext" in globalThis, Ve = Le || Re, He = typeof window < "u", Ue = typeof navigator < "u" && navigator?.userAgent?.indexOf("Mac") >= 0, We = globalThis.devicePixelRatio || 1, Ge = (e) => typeof e == "object" && !!e && e.nodeType === 1, Ke = (e) => Ge(e) && e.tagName === "VIDEO", qe = (e) => Ge(e) && e.tagName === "IMG";
188
+ function Je(e) {
189
189
  return typeof e == "object" && !!e && e.nodeType === 1 && e.tagName === "CANVAS";
190
190
  }
191
- function Je(e) {
191
+ function Ye(e) {
192
192
  return Oe && e instanceof globalThis.WebGL2RenderingContext;
193
193
  }
194
- function Ye() {
195
- if (Ve) return globalThis.document.createElement("canvas");
194
+ function Xe() {
195
+ if (He) return globalThis.document.createElement("canvas");
196
196
  }
197
- function Xe(e, t = globalThis.location) {
197
+ function Ze(e, t = globalThis.location) {
198
198
  if (e.startsWith("data:")) return "";
199
199
  t ||= globalThis.location;
200
200
  let n = new URL(e, document.baseURI);
201
201
  return n.hostname !== t.hostname || n.port !== t.port || n.protocol !== t.protocol ? "anonymous" : "";
202
202
  }
203
- function Ze(e, t, n) {
204
- n === null && !t.startsWith("data:") ? e.crossOrigin = Xe(t) : n !== !1 && (e.crossOrigin = typeof n == "string" ? n : "anonymous");
203
+ function Qe(e, t, n) {
204
+ n === null && !t.startsWith("data:") ? e.crossOrigin = Ze(t) : n !== !1 && (e.crossOrigin = typeof n == "string" ? n : "anonymous");
205
205
  }
206
206
  //#endregion
207
207
  //#region src/core/shared/id.ts
208
- var Qe = 0;
209
- function $e() {
210
- return ++Qe;
208
+ var $e = 0;
209
+ function et() {
210
+ return ++$e;
211
211
  }
212
212
  //#endregion
213
213
  //#region src/core/input/InputEvent.ts
214
- var et = class e {
214
+ var tt = class e {
215
215
  cursor;
216
216
  bubbles = !1;
217
217
  cancelBubble = !1;
@@ -246,14 +246,14 @@ var et = class e {
246
246
  initUIEvent(...e) {
247
247
  throw Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
248
248
  }
249
- }, tt = class extends et {
249
+ }, nt = class extends tt {
250
250
  getModifierState(...e) {
251
251
  throw Error("getModifierState() is a legacy DOM API. It is not implemented in the Federated Events API.");
252
252
  }
253
253
  initKeyboardEvent(...e) {
254
254
  throw Error("initKeyboardEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
255
255
  }
256
- }, nt = class extends et {
256
+ }, rt = class extends tt {
257
257
  client = {
258
258
  x: 0,
259
259
  y: 0
@@ -336,7 +336,7 @@ var et = class e {
336
336
  get globalY() {
337
337
  return this.global.y;
338
338
  }
339
- }, rt = class extends nt {
339
+ }, it = class extends rt {
340
340
  width = 0;
341
341
  height = 0;
342
342
  isPrimary = !1;
@@ -346,20 +346,20 @@ var et = class e {
346
346
  getPredictedEvents() {
347
347
  throw Error("getPredictedEvents is not supported!");
348
348
  }
349
- }, it = class extends nt {
349
+ }, at = class extends rt {
350
350
  static DOM_DELTA_PIXEL = 0;
351
351
  DOM_DELTA_PIXEL = 0;
352
352
  static DOM_DELTA_LINE = 1;
353
353
  DOM_DELTA_LINE = 1;
354
354
  static DOM_DELTA_PAGE = 2;
355
355
  DOM_DELTA_PAGE = 2;
356
- }, at = {
356
+ }, ot = {
357
357
  touchstart: "pointerdown",
358
358
  touchend: "pointerup",
359
359
  touchendoutside: "pointerupoutside",
360
360
  touchmove: "pointermove",
361
361
  touchcancel: "pointercancel"
362
- }, ot = class extends e {
362
+ }, st = class extends e {
363
363
  event;
364
364
  target;
365
365
  cursor = "default";
@@ -377,16 +377,16 @@ var et = class e {
377
377
  removeEventListeners() {
378
378
  if (!this.setuped || !this.target) return;
379
379
  let e = this.target.style;
380
- globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") : je && (e.touchAction = ""), je ? (this.target.removeEventListener("pointerdown", this._onPointerDown), this.target.removeEventListener("pointerleave", this._onPointerOver), this.target.removeEventListener("pointerover", this._onPointerOver), this.target.removeEventListener("pointermove", this._onPointerMove), this.target.removeEventListener("pointerup", this._onPointerUp)) : (this.target.removeEventListener("mousedown", this._onPointerDown), this.target.removeEventListener("mouseout", this._onPointerOver), this.target.removeEventListener("mouseover", this._onPointerOver), this.target.removeEventListener("mousemove", this._onPointerMove), this.target.removeEventListener("mouseup", this._onPointerUp)), C && (this.target.removeEventListener("touchstart", this._onPointerDown), this.target.removeEventListener("touchmove", this._onPointerMove), this.target.removeEventListener("touchend", this._onPointerUp)), this.target.removeEventListener("wheel", this._onWheel), document.removeEventListener("keydown", this._onKeyDown), document.removeEventListener("keypress", this._onKeyPress), document.removeEventListener("keyup", this._onKeyUp), this.target = void 0, this.setuped = !1;
380
+ globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") : je && (e.touchAction = ""), je ? (this.target.removeEventListener("pointerdown", this._onPointerDown), this.target.removeEventListener("pointerleave", this._onPointerOver), this.target.removeEventListener("pointerover", this._onPointerOver), this.target.removeEventListener("pointermove", this._onPointerMove), this.target.removeEventListener("pointerup", this._onPointerUp)) : (this.target.removeEventListener("mousedown", this._onPointerDown), this.target.removeEventListener("mouseout", this._onPointerOver), this.target.removeEventListener("mouseover", this._onPointerOver), this.target.removeEventListener("mousemove", this._onPointerMove), this.target.removeEventListener("mouseup", this._onPointerUp)), Pe && (this.target.removeEventListener("touchstart", this._onPointerDown), this.target.removeEventListener("touchmove", this._onPointerMove), this.target.removeEventListener("touchend", this._onPointerUp)), this.target.removeEventListener("wheel", this._onWheel), document.removeEventListener("keydown", this._onKeyDown), document.removeEventListener("keypress", this._onKeyPress), document.removeEventListener("keyup", this._onKeyUp), this.target = void 0, this.setuped = !1;
381
381
  }
382
382
  addEventListeners() {
383
383
  if (this.setuped || !this.target) return;
384
384
  let e = this.target.style;
385
- e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") : je && (e.touchAction = "none")), je ? (this.target.addEventListener("pointerdown", this._onPointerDown), this.target.addEventListener("pointerleave", this._onPointerOver), this.target.addEventListener("pointerover", this._onPointerOver), this.target.addEventListener("pointermove", this._onPointerMove), this.target.addEventListener("pointerup", this._onPointerUp)) : (this.target.addEventListener("mousedown", this._onPointerDown), this.target.addEventListener("mouseout", this._onPointerOver), this.target.addEventListener("mouseover", this._onPointerOver), this.target.addEventListener("mousemove", this._onPointerMove), this.target.addEventListener("mouseup", this._onPointerUp)), C && (this.target.addEventListener("touchstart", this._onPointerDown), this.target.addEventListener("touchmove", this._onPointerMove), this.target.addEventListener("touchend", this._onPointerUp)), this.target.addEventListener("wheel", this._onWheel), document.addEventListener("keydown", this._onKeyDown), document.addEventListener("keypress", this._onKeyPress), document.addEventListener("keyup", this._onKeyUp), this.setuped = !0;
385
+ e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") : je && (e.touchAction = "none")), je ? (this.target.addEventListener("pointerdown", this._onPointerDown), this.target.addEventListener("pointerleave", this._onPointerOver), this.target.addEventListener("pointerover", this._onPointerOver), this.target.addEventListener("pointermove", this._onPointerMove), this.target.addEventListener("pointerup", this._onPointerUp)) : (this.target.addEventListener("mousedown", this._onPointerDown), this.target.addEventListener("mouseout", this._onPointerOver), this.target.addEventListener("mouseover", this._onPointerOver), this.target.addEventListener("mousemove", this._onPointerMove), this.target.addEventListener("mouseup", this._onPointerUp)), Pe && (this.target.addEventListener("touchstart", this._onPointerDown), this.target.addEventListener("touchmove", this._onPointerMove), this.target.addEventListener("touchend", this._onPointerUp)), this.target.addEventListener("wheel", this._onWheel), document.addEventListener("keydown", this._onKeyDown), document.addEventListener("keypress", this._onKeyPress), document.addEventListener("keyup", this._onKeyUp), this.setuped = !0;
386
386
  }
387
387
  normalize(e) {
388
388
  let t = [];
389
- if (C && e instanceof globalThis.TouchEvent) for (let n = 0, r = e.changedTouches.length; n < r; n++) {
389
+ if (Pe && e instanceof globalThis.TouchEvent) for (let n = 0, r = e.changedTouches.length; n < r; n++) {
390
390
  let r = e.changedTouches[n];
391
391
  r.button === void 0 && (r.button = 0), r.buttons === void 0 && (r.buttons = 1), r.isPrimary === void 0 && (r.isPrimary = e.touches.length === 1 && e.type === "touchstart"), r.width === void 0 && (r.width = r.radiusX || 1), r.height === void 0 && (r.height = r.radiusY || 1), r.tiltX === void 0 && (r.tiltX = 0), r.tiltY === void 0 && (r.tiltY = 0), r.pointerType === void 0 && (r.pointerType = "touch"), r.pointerId === void 0 && (r.pointerId = r.identifier || 0), r.pressure === void 0 && (r.pressure = r.force || .5), r.twist === void 0 && (r.twist = 0), r.tangentialPressure === void 0 && (r.tangentialPressure = 0), r.layerX === void 0 && (r.layerX = r.offsetX = r.clientX), r.layerY === void 0 && (r.layerY = r.offsetY = r.clientY), r.type = e.type, t.push(r);
392
392
  }
@@ -399,8 +399,8 @@ var et = class e {
399
399
  return t;
400
400
  }
401
401
  _clonePointerEvent(e) {
402
- let t = new rt();
403
- return t.nativeEvent = e, t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist, t.isTrusted = e.isTrusted, this._copyMouseEvent(t, e), this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t.type === "pointerleave" ? t.type = "pointerout" : t.type.startsWith("mouse") ? t.type = t.type.replace("mouse", "pointer") : t.type.startsWith("touch") && (t.type = at[t.type] || t.type), t;
402
+ let t = new it();
403
+ return t.nativeEvent = e, t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist, t.isTrusted = e.isTrusted, this._copyMouseEvent(t, e), this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t.type === "pointerleave" ? t.type = "pointerout" : t.type.startsWith("mouse") ? t.type = t.type.replace("mouse", "pointer") : t.type.startsWith("touch") && (t.type = ot[t.type] || t.type), t;
404
404
  }
405
405
  _copyInputEvent(e, t) {
406
406
  e.nativeEvent = t, e.bubbles = t.bubbles, e.cancelBubble = t.cancelBubble, e.cancelable = t.cancelable, e.composed = t.composed, e.currentTarget = t.currentTarget, e.defaultPrevented = t.defaultPrevented, e.eventPhase = t.eventPhase, e.isTrusted = t.isTrusted, e.returnValue = t.returnValue, e.srcElement = t.srcElement, e.timeStamp = t.timeStamp, e.type = t.type;
@@ -409,11 +409,11 @@ var et = class e {
409
409
  this._copyInputEvent(e, t), e.altKey = t.altKey, e.button = t.button, e.buttons = t.buttons, e.client.x = t.clientX, e.client.y = t.clientY, e.ctrlKey = t.ctrlKey, e.metaKey = t.metaKey, e.movement.x = t.movementX, e.movement.y = t.movementY, e.page.x = t.pageX, e.page.y = t.pageY, e.relatedTarget = null, e.shiftKey = t.shiftKey;
410
410
  }
411
411
  _cloneWheelEvent(e) {
412
- let t = new it();
412
+ let t = new at();
413
413
  return this._copyMouseEvent(t, e), t.wheelDeltaY = e.wheelDeltaY, t.deltaX = e.deltaX, t.deltaY = e.deltaY, t.deltaZ = e.deltaZ, t.deltaMode = e.deltaMode, this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t;
414
414
  }
415
415
  _cloneKeyboardEvent(e) {
416
- let t = new tt();
416
+ let t = new nt();
417
417
  return this._copyInputEvent(t, e), t.altKey = e.altKey, t.charCode = e.charCode, t.code = e.code, t.ctrlKey = e.ctrlKey, t.isComposing = e.isComposing, t.key = e.key, t.keyCode = e.keyCode, t.location = e.location, t.metaKey = e.metaKey, t.repeat = e.repeat, t.shiftKey = e.shiftKey, t;
418
418
  }
419
419
  setCursor(e = "default") {
@@ -461,25 +461,25 @@ var et = class e {
461
461
  this.event?.cursor && this.setCursor(this.event.cursor);
462
462
  };
463
463
  _onPointerDown = (e) => {
464
- if (C && e.pointerType === "touch") return;
464
+ if (Pe && e.pointerType === "touch") return;
465
465
  let t = this.normalize(e);
466
466
  for (let e = 0, n = t.length; e < n; e++) this.emit("pointerdown", this.event = this._clonePointerEvent(t[e]));
467
467
  this.event?.cursor && this.setCursor(this.event.cursor);
468
468
  };
469
469
  _onPointerOver = (e) => {
470
- if (!this.enableClickEvent || C && e.pointerType === "touch") return;
470
+ if (!this.enableClickEvent || Pe && e.pointerType === "touch") return;
471
471
  let t = this.normalize(e);
472
472
  for (let e = 0, n = t.length; e < n; e++) this.emit("pointerover", this.event = this._clonePointerEvent(t[e]));
473
473
  this.event?.cursor && this.setCursor(this.event.cursor);
474
474
  };
475
475
  _onPointerMove = (e) => {
476
- if (!this.enableMoveEvent || C && e.pointerType === "touch") return;
476
+ if (!this.enableMoveEvent || Pe && e.pointerType === "touch") return;
477
477
  let t = this.normalize(e);
478
478
  for (let e = 0, n = t.length; e < n; e++) this.emit("pointermove", this.event = this._clonePointerEvent(t[e]));
479
479
  this.event?.cursor && this.setCursor(this.event.cursor);
480
480
  };
481
481
  _onPointerUp = (e) => {
482
- if (!this.enableClickEvent || C && e.pointerType === "touch") return;
482
+ if (!this.enableClickEvent || Pe && e.pointerType === "touch") return;
483
483
  let t = e.target;
484
484
  e.composedPath && e.composedPath().length > 0 && (t = e.composedPath()[0]);
485
485
  let n = t === this.target ? "" : "outside", r = this.normalize(e);
@@ -498,8 +498,8 @@ var et = class e {
498
498
  destroy() {
499
499
  this.removeEventListeners(), super.destroy();
500
500
  }
501
- }, w = class extends n {
502
- instanceId = $e();
501
+ }, C = class extends n {
502
+ instanceId = et();
503
503
  destroyed = !1;
504
504
  get json() {
505
505
  return this.toJSON();
@@ -517,7 +517,7 @@ var et = class e {
517
517
  destroy() {
518
518
  this.destroyed || (this.destroyed = !0, this._destroy(), this.emit("destroy"), this.removeAllListeners());
519
519
  }
520
- }, st = class extends w {}, T = class extends st {}, ct = class e {
520
+ }, ct = class extends C {}, w = class extends ct {}, lt = class e {
521
521
  get x() {
522
522
  return this.min.x;
523
523
  }
@@ -651,7 +651,7 @@ var et = class e {
651
651
  //#endregion
652
652
  //#region src/core/math/Color.ts
653
653
  b([ue]);
654
- var E = class {
654
+ var T = class {
655
655
  get value() {
656
656
  return this._value;
657
657
  }
@@ -734,16 +734,16 @@ var E = class {
734
734
  this.a
735
735
  ];
736
736
  }
737
- }, lt = _e / 180, ut = 180 / _e;
738
- function dt(e, t, n) {
737
+ }, ut = _e / 180, dt = 180 / _e;
738
+ function ft(e, t, n) {
739
739
  return Math.max(t, Math.min(e, n));
740
740
  }
741
- function D(e, t, n) {
741
+ function E(e, t, n) {
742
742
  return (1 - n) * e + n * t;
743
743
  }
744
744
  //#endregion
745
745
  //#region src/core/math/ColorMatrix.ts
746
- var ft = class {
746
+ var pt = class {
747
747
  _array = new Float32Array(20);
748
748
  constructor() {
749
749
  this.identity();
@@ -873,7 +873,7 @@ var ft = class {
873
873
  ]);
874
874
  }
875
875
  invert(e = 1) {
876
- let t = D(1, -1, e), n = D(0, 255, e);
876
+ let t = E(1, -1, e), n = E(0, 255, e);
877
877
  return this.multiply([
878
878
  t,
879
879
  0,
@@ -898,21 +898,21 @@ var ft = class {
898
898
  ]);
899
899
  }
900
900
  sepia(e = 1) {
901
- let t = dt(e, 0, 1);
901
+ let t = ft(e, 0, 1);
902
902
  return this.multiply([
903
- D(1, .393, t),
904
- D(0, .7689999, t),
905
- D(0, .18899999, t),
903
+ E(1, .393, t),
904
+ E(0, .7689999, t),
905
+ E(0, .18899999, t),
906
906
  0,
907
907
  0,
908
- D(0, .349, t),
909
- D(1, .6859999, t),
910
- D(0, .16799999, t),
908
+ E(0, .349, t),
909
+ E(1, .6859999, t),
910
+ E(0, .16799999, t),
911
911
  0,
912
912
  0,
913
- D(0, .272, t),
914
- D(0, .5339999, t),
915
- D(1, .13099999, t),
913
+ E(0, .272, t),
914
+ E(0, .5339999, t),
915
+ E(1, .13099999, t),
916
916
  0,
917
917
  0,
918
918
  0,
@@ -947,7 +947,7 @@ var ft = class {
947
947
  ]);
948
948
  }
949
949
  grayscale(e = 1) {
950
- let t = dt(e, 0, 1), n = D(1, .3, t), r = D(0, .3, t), i = D(1, .59, t), a = D(0, .59, t), o = D(1, .11, t), s = D(0, .11, t);
950
+ let t = ft(e, 0, 1), n = E(1, .3, t), r = E(0, .3, t), i = E(1, .59, t), a = E(0, .59, t), o = E(1, .11, t), s = E(0, .11, t);
951
951
  return this.multiply([
952
952
  n,
953
953
  a,
@@ -999,10 +999,10 @@ var ft = class {
999
999
  toArray() {
1000
1000
  return this._array;
1001
1001
  }
1002
- }, pt = class e extends ct {
1002
+ }, mt = class e extends lt {
1003
1003
  rotation;
1004
1004
  get rotationDegrees() {
1005
- return this.rotation / lt;
1005
+ return this.rotation / ut;
1006
1006
  }
1007
1007
  constructor(...e) {
1008
1008
  let t, n;
@@ -1012,7 +1012,7 @@ var ft = class {
1012
1012
  if (!this.rotation && (!("rotation" in e) || !e.rotation)) return super.overlap(e, t);
1013
1013
  {
1014
1014
  let t = (e, t) => Math.abs(e.x * t.x + e.y * t.y), n = (e) => {
1015
- let { width: n, height: r, rotation: i = 0 } = e, a = i / lt;
1015
+ let { width: n, height: r, rotation: i = 0 } = e, a = i / ut;
1016
1016
  a = -a % 180;
1017
1017
  let o = a / 180 * Math.PI, s = {
1018
1018
  x: Math.cos(o),
@@ -1054,7 +1054,7 @@ var ft = class {
1054
1054
  clone() {
1055
1055
  return new e(this.toJSON());
1056
1056
  }
1057
- }, mt = class {
1057
+ }, ht = class {
1058
1058
  _array;
1059
1059
  x = 0;
1060
1060
  y = 0;
@@ -1078,12 +1078,12 @@ var ft = class {
1078
1078
  };
1079
1079
  //#endregion
1080
1080
  //#region \0@oxc-project+runtime@0.130.0/helpers/decorateMetadata.js
1081
- function O(e, t) {
1081
+ function D(e, t) {
1082
1082
  if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
1083
1083
  }
1084
1084
  //#endregion
1085
1085
  //#region \0@oxc-project+runtime@0.130.0/helpers/decorate.js
1086
- function k(e, t, n, r) {
1086
+ function O(e, t, n, r) {
1087
1087
  var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
1088
1088
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
1089
1089
  else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
@@ -1091,7 +1091,7 @@ function k(e, t, n, r) {
1091
1091
  }
1092
1092
  //#endregion
1093
1093
  //#region src/core/os/MainLoop.ts
1094
- var ht = class extends w {
1094
+ var gt = class extends C {
1095
1095
  _starting = !1;
1096
1096
  _nextDeltaTime = 0;
1097
1097
  _startedProcess;
@@ -1121,22 +1121,22 @@ var ht = class extends w {
1121
1121
  super._destroy(), this.stop();
1122
1122
  }
1123
1123
  };
1124
- k([_({ fallback: 60 }), O("design:type", Number)], ht.prototype, "fps", void 0), k([_({ fallback: 1 }), O("design:type", Number)], ht.prototype, "speed", void 0);
1124
+ O([_({ fallback: 60 }), D("design:type", Number)], gt.prototype, "fps", void 0), O([_({ fallback: 1 }), D("design:type", Number)], gt.prototype, "speed", void 0);
1125
1125
  //#endregion
1126
1126
  //#region src/core/renderers/gl/buffer/const.ts
1127
- var gt = /* @__PURE__ */ function(e) {
1127
+ var _t = /* @__PURE__ */ function(e) {
1128
1128
  return e[e.elementArrayBuffer = 34963] = "elementArrayBuffer", e[e.arrayBuffer = 34962] = "arrayBuffer", e[e.uniformBuffer = 35345] = "uniformBuffer", e;
1129
- }({}), _t = class {
1129
+ }({}), vt = class {
1130
1130
  native;
1131
- target = gt.arrayBuffer;
1131
+ target = _t.arrayBuffer;
1132
1132
  byteLength = 0;
1133
1133
  dirty = !0;
1134
1134
  constructor(e) {
1135
1135
  this.native = e;
1136
1136
  }
1137
- }, A = /* @__PURE__ */ function(e) {
1137
+ }, k = /* @__PURE__ */ function(e) {
1138
1138
  return e[e.mapRead = 1] = "mapRead", e[e.mapWrite = 2] = "mapWrite", e[e.copySrc = 4] = "copySrc", e[e.copyDst = 8] = "copyDst", e[e.index = 16] = "index", e[e.vertex = 32] = "vertex", e[e.uniform = 64] = "uniform", e[e.storage = 128] = "storage", e[e.indirect = 256] = "indirect", e[e.queryResolve = 512] = "queryResolve", e[e.static = 1024] = "static", e;
1139
- }({}), vt, yt = class extends n {
1139
+ }({}), yt, bt = class extends n {
1140
1140
  screen = {
1141
1141
  x: 0,
1142
1142
  y: 0,
@@ -1155,12 +1155,12 @@ var gt = /* @__PURE__ */ function(e) {
1155
1155
  this.view && (this.view.width = Math.floor(e * this.pixelRatio), this.view.height = Math.floor(t * this.pixelRatio)), this.screen.width = e, this.screen.height = t, n && this.view && (this.view.style.width = `${e}px`, this.view.style.height = `${t}px`);
1156
1156
  }
1157
1157
  };
1158
- k([_({ fallback: Ue }), O("design:type", Number)], yt.prototype, "pixelRatio", void 0), k([_({ internal: !0 }), O("design:type", typeof (vt = typeof HTMLCanvasElement < "u" && HTMLCanvasElement) == "function" ? vt : Object)], yt.prototype, "view", void 0);
1158
+ O([_({ fallback: We }), D("design:type", Number)], bt.prototype, "pixelRatio", void 0), O([_({ internal: !0 }), D("design:type", typeof (yt = typeof HTMLCanvasElement < "u" && HTMLCanvasElement) == "function" ? yt : Object)], bt.prototype, "view", void 0);
1159
1159
  //#endregion
1160
1160
  //#region src/core/renderers/shared/shader/UniformGroup.ts
1161
- var bt = 0, xt = class {
1161
+ var xt = 0, St = class {
1162
1162
  isUniformGroup = !0;
1163
- uid = ++bt;
1163
+ uid = ++xt;
1164
1164
  uniforms;
1165
1165
  ubo;
1166
1166
  isStatic;
@@ -1171,14 +1171,14 @@ var bt = 0, xt = class {
1171
1171
  update() {
1172
1172
  this._dirtyId++;
1173
1173
  }
1174
- }, St = Object.create(null), Ct = Object.create(null);
1175
- function wt(e, t) {
1176
- let n = Ct[e];
1177
- return n === void 0 && (St[t] === void 0 && (St[t] = 1), Ct[e] = n = St[t]++), n;
1174
+ }, Ct = Object.create(null), wt = Object.create(null);
1175
+ function Tt(e, t) {
1176
+ let n = wt[e];
1177
+ return n === void 0 && (Ct[t] === void 0 && (Ct[t] = 1), wt[e] = n = Ct[t]++), n;
1178
1178
  }
1179
1179
  //#endregion
1180
1180
  //#region src/core/renderers/gl/system/GlSystem.ts
1181
- var j = class extends e {
1181
+ var A = class extends e {
1182
1182
  get _gl() {
1183
1183
  return this._renderer.gl;
1184
1184
  }
@@ -1192,7 +1192,7 @@ var j = class extends e {
1192
1192
  _setup() {}
1193
1193
  flush() {}
1194
1194
  reset() {}
1195
- }, Tt = class extends j {
1195
+ }, Et = class extends A {
1196
1196
  install(e) {
1197
1197
  super.install(e), e.buffer = this;
1198
1198
  }
@@ -1202,8 +1202,8 @@ var j = class extends e {
1202
1202
  return this.glBuffers.get(e.instanceId) || this._createGlBuffer(e);
1203
1203
  }
1204
1204
  _createGlBuffer(e) {
1205
- let t = this._gl, n = new _t(t.createBuffer()), r = gt.arrayBuffer;
1206
- return e.usage & A.index ? r = gt.elementArrayBuffer : e.usage & A.uniform && (r = gt.uniformBuffer), n.target = r, this.glBuffers.set(e.instanceId, n), this.buffers.get(e.instanceId) || ("on" in e && (e.on("updateProperty", (e) => {
1205
+ let t = this._gl, n = new vt(t.createBuffer()), r = _t.arrayBuffer;
1206
+ return e.usage & k.index ? r = _t.elementArrayBuffer : e.usage & k.uniform && (r = _t.uniformBuffer), n.target = r, this.glBuffers.set(e.instanceId, n), this.buffers.get(e.instanceId) || ("on" in e && (e.on("updateProperty", (e) => {
1207
1207
  switch (e) {
1208
1208
  case "usage":
1209
1209
  case "data":
@@ -1226,7 +1226,7 @@ var j = class extends e {
1226
1226
  n.dirty = !1;
1227
1227
  let { _gl: r } = this, { usage: i, data: a } = e;
1228
1228
  r.bindBuffer(n.target, n.native);
1229
- let o = i & A.static ? r.STATIC_DRAW : r.DYNAMIC_DRAW;
1229
+ let o = i & k.static ? r.STATIC_DRAW : r.DYNAMIC_DRAW;
1230
1230
  if (a) if (n.byteLength >= a.byteLength) {
1231
1231
  let e = a.length * a.BYTES_PER_ELEMENT;
1232
1232
  r.bufferSubData(n.target, 0, a, 0, e / a.BYTES_PER_ELEMENT);
@@ -1241,13 +1241,13 @@ var j = class extends e {
1241
1241
  }
1242
1242
  this.buffers.clear(), this.glBuffers.clear();
1243
1243
  }
1244
- }, Et;
1245
- function Dt() {
1246
- return Et ||= "mediump", Et;
1244
+ }, Dt;
1245
+ function Ot() {
1246
+ return Dt ||= "mediump", Dt;
1247
1247
  }
1248
1248
  //#endregion
1249
1249
  //#region src/core/renderers/gl/shader/preprocessors/addProgramDefines.ts
1250
- function Ot(e, t, n) {
1250
+ function kt(e, t, n) {
1251
1251
  return t ? e : n ? (e = e.replace("out vec4 finalColor;", ""), `#ifdef GL_ES
1252
1252
  #define in varying
1253
1253
  #define finalColor gl_FragColor
@@ -1261,7 +1261,7 @@ ${e}`;
1261
1261
  }
1262
1262
  //#endregion
1263
1263
  //#region src/core/renderers/gl/shader/preprocessors/ensurePrecision.ts
1264
- function kt(e, t, n) {
1264
+ function At(e, t, n) {
1265
1265
  let r = n ? t.maxSupportedFragmentPrecision : t.maxSupportedVertexPrecision;
1266
1266
  if (e.substring(0, 9) !== "precision") {
1267
1267
  let i = n ? t.requestedFragmentPrecision : t.requestedVertexPrecision;
@@ -1271,31 +1271,31 @@ function kt(e, t, n) {
1271
1271
  }
1272
1272
  //#endregion
1273
1273
  //#region src/core/renderers/gl/shader/preprocessors/insertVersion.ts
1274
- function At(e, t) {
1274
+ function jt(e, t) {
1275
1275
  return t ? `#version 300 es\n${e}` : e;
1276
1276
  }
1277
1277
  //#endregion
1278
1278
  //#region src/core/renderers/gl/shader/preprocessors/setProgramName.ts
1279
- var jt = {}, Mt = {};
1280
- function Nt(e, { name: t = "program" }, n = !0) {
1279
+ var Mt = {}, Nt = {};
1280
+ function Pt(e, { name: t = "program" }, n = !0) {
1281
1281
  t = t.replace(/\s+/g, "-"), t += n ? "-fragment" : "-vertex";
1282
- let r = n ? jt : Mt;
1282
+ let r = n ? Mt : Nt;
1283
1283
  return r[t] ? (r[t]++, t += `-${r[t]}`) : r[t] = 1, e.includes("#define SHADER_NAME") ? e : `${`#define SHADER_NAME ${t}`}\n${e}`;
1284
1284
  }
1285
1285
  //#endregion
1286
1286
  //#region src/core/renderers/gl/shader/preprocessors/stripVersion.ts
1287
- function Pt(e, t) {
1287
+ function Ft(e, t) {
1288
1288
  return t ? e.replace("#version 300 es", "") : e;
1289
1289
  }
1290
1290
  //#endregion
1291
1291
  //#region src/core/renderers/gl/shader/GlProgram.ts
1292
- var Ft = Object.create(null), It = {
1293
- stripVersion: Pt,
1294
- ensurePrecision: kt,
1295
- addProgramDefines: Ot,
1296
- setProgramName: Nt,
1297
- insertVersion: At
1298
- }, Lt = class e {
1292
+ var It = Object.create(null), Lt = {
1293
+ stripVersion: Ft,
1294
+ ensurePrecision: At,
1295
+ addProgramDefines: kt,
1296
+ setProgramName: Pt,
1297
+ insertVersion: jt
1298
+ }, Rt = class e {
1299
1299
  static defaultOptions = {
1300
1300
  preferredVertexPrecision: "highp",
1301
1301
  preferredFragmentPrecision: "mediump"
@@ -1318,25 +1318,25 @@ var Ft = Object.create(null), It = {
1318
1318
  requestedFragmentPrecision: t.preferredFragmentPrecision,
1319
1319
  requestedVertexPrecision: t.preferredVertexPrecision,
1320
1320
  maxSupportedVertexPrecision: "highp",
1321
- maxSupportedFragmentPrecision: Dt()
1321
+ maxSupportedFragmentPrecision: Ot()
1322
1322
  },
1323
1323
  setProgramName: { name: t.name },
1324
1324
  addProgramDefines: i,
1325
1325
  insertVersion: i
1326
1326
  };
1327
- Object.keys(It).forEach((e) => {
1327
+ Object.keys(Lt).forEach((e) => {
1328
1328
  let t = a[e];
1329
- n = It[e](n, t, !0), r = It[e](r, t, !1);
1330
- }), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id = wt(`${r}:${n}`, "GlProgram");
1329
+ n = Lt[e](n, t, !0), r = Lt[e](r, t, !1);
1330
+ }), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id = Tt(`${r}:${n}`, "GlProgram");
1331
1331
  }
1332
1332
  destroy() {
1333
- this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete Ft[this._cacheKey];
1333
+ this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete It[this._cacheKey];
1334
1334
  }
1335
1335
  static from(t) {
1336
1336
  let n = `${t.vertex}:${t.fragment}`;
1337
- return Ft[n] || (Ft[n] = new e(t), Ft[n]._cacheKey = n), Ft[n];
1337
+ return It[n] || (It[n] = new e(t), It[n]._cacheKey = n), It[n];
1338
1338
  }
1339
- }, Rt = {
1339
+ }, zt = {
1340
1340
  uint8x2: {
1341
1341
  size: 2,
1342
1342
  stride: 2,
@@ -1488,18 +1488,18 @@ var Ft = Object.create(null), It = {
1488
1488
  normalized: !1
1489
1489
  }
1490
1490
  };
1491
- function zt(e) {
1492
- return Rt[e] ?? Rt.float32;
1491
+ function Bt(e) {
1492
+ return zt[e] ?? zt.float32;
1493
1493
  }
1494
1494
  //#endregion
1495
1495
  //#region src/core/renderers/gl/shader/GlProgramData.ts
1496
- var Bt = class {
1496
+ var Vt = class {
1497
1497
  native;
1498
1498
  uniformDirtyGroups = Object.create(null);
1499
1499
  constructor(e) {
1500
1500
  this.native = e;
1501
1501
  }
1502
- }, Vt, Ht = {
1502
+ }, Ht, Ut = {
1503
1503
  FLOAT: "float",
1504
1504
  FLOAT_VEC2: "vec2",
1505
1505
  FLOAT_VEC3: "vec3",
@@ -1528,7 +1528,7 @@ var Bt = class {
1528
1528
  SAMPLER_2D_ARRAY: "sampler2DArray",
1529
1529
  INT_SAMPLER_2D_ARRAY: "sampler2DArray",
1530
1530
  UNSIGNED_INT_SAMPLER_2D_ARRAY: "sampler2DArray"
1531
- }, Ut = {
1531
+ }, Wt = {
1532
1532
  float: "float32",
1533
1533
  vec2: "float32x2",
1534
1534
  vec3: "float32x3",
@@ -1546,29 +1546,29 @@ var Bt = class {
1546
1546
  bvec3: "uint32x3",
1547
1547
  bvec4: "uint32x4"
1548
1548
  };
1549
- function Wt(e, t) {
1550
- if (!Vt) {
1551
- let t = Object.keys(Ht);
1552
- Vt = {};
1549
+ function Gt(e, t) {
1550
+ if (!Ht) {
1551
+ let t = Object.keys(Ut);
1552
+ Ht = {};
1553
1553
  for (let n = 0; n < t.length; ++n) {
1554
1554
  let r = t[n];
1555
- Vt[e[r]] = Ht[r];
1555
+ Ht[e[r]] = Ut[r];
1556
1556
  }
1557
1557
  }
1558
- return Vt[t];
1558
+ return Ht[t];
1559
1559
  }
1560
- function Gt(e, t) {
1561
- return Ut[Wt(e, t)] || "float32";
1560
+ function Kt(e, t) {
1561
+ return Wt[Gt(e, t)] || "float32";
1562
1562
  }
1563
1563
  //#endregion
1564
1564
  //#region src/core/renderers/gl/shader/GlShaderSystem.ts
1565
- var Kt = class extends j {
1565
+ var qt = class extends A {
1566
1566
  install(e) {
1567
1567
  super.install(e), e.shader = this;
1568
1568
  }
1569
1569
  glProgramDatas = /* @__PURE__ */ new Map();
1570
1570
  currentProgram = null;
1571
- globalUniforms = new xt({
1571
+ globalUniforms = new St({
1572
1572
  projectionMatrix: new Float32Array([
1573
1573
  1,
1574
1574
  0,
@@ -1609,7 +1609,7 @@ var Kt = class extends j {
1609
1609
  return this.glProgramDatas.get(e.id) || this._createGlProgramData(e);
1610
1610
  }
1611
1611
  _createGlProgramData(e) {
1612
- let t = this._gl, n = new Bt(t.createProgram());
1612
+ let t = this._gl, n = new Vt(t.createProgram());
1613
1613
  this.glProgramDatas.set(e.id, n), this.useProgram(e);
1614
1614
  let r = this._createGlShader(e.vertex, t.VERTEX_SHADER), i = this._createGlShader(e.fragment, t.FRAGMENT_SHADER);
1615
1615
  if (t.attachShader(n.native, r), t.attachShader(n.native, i), t.linkProgram(n.native), !t.getProgramParameter(n.native, t.LINK_STATUS)) throw Error(`Failed to link program: ${t.getProgramInfoLog(n.native)}`);
@@ -1617,11 +1617,11 @@ var Kt = class extends j {
1617
1617
  for (let e = t.getProgramParameter(n.native, t.ACTIVE_ATTRIBUTES), r = 0; r < e; r++) {
1618
1618
  let e = t.getActiveAttrib(n.native, r);
1619
1619
  if (!e || e.name.startsWith("gl_")) continue;
1620
- let i = Gt(t, e.type);
1620
+ let i = Kt(t, e.type);
1621
1621
  a[e.name] = {
1622
1622
  location: 0,
1623
1623
  format: i,
1624
- stride: zt(i).stride,
1624
+ stride: Bt(i).stride,
1625
1625
  offset: 0,
1626
1626
  instance: !1,
1627
1627
  start: 0
@@ -1638,7 +1638,7 @@ var Kt = class extends j {
1638
1638
  for (let e = t.getProgramParameter(n.native, t.ACTIVE_UNIFORMS), r = 0; r < e; r++) {
1639
1639
  let e = t.getActiveUniform(n.native, r);
1640
1640
  if (!e) continue;
1641
- let i = e.name.replace(/\[.*?\]$/, ""), a = Wt(t, e.type), o = e.size;
1641
+ let i = e.name.replace(/\[.*?\]$/, ""), a = Gt(t, e.type), o = e.size;
1642
1642
  c[i] = {
1643
1643
  name: i,
1644
1644
  index: r,
@@ -1673,7 +1673,7 @@ var Kt = class extends j {
1673
1673
  let { type: s, isArray: c, name: l } = o;
1674
1674
  o.location === void 0 && (o.location = r.getUniformLocation(t.native, l));
1675
1675
  let u = o.location;
1676
- if (qt(o.value, a)) switch (o.value = Jt(o.value, a), s) {
1676
+ if (Jt(o.value, a)) switch (o.value = Yt(o.value, a), s) {
1677
1677
  case "float":
1678
1678
  c ? r.uniform1fv(u, a) : r.uniform1f(u, a);
1679
1679
  break;
@@ -1760,7 +1760,7 @@ var Kt = class extends j {
1760
1760
  super.destroy(), this.bind(null);
1761
1761
  }
1762
1762
  };
1763
- function qt(e, t) {
1763
+ function Jt(e, t) {
1764
1764
  if (typeof t == "object" && t) {
1765
1765
  let n = t.length;
1766
1766
  if (typeof e != "object" || !e || e.length !== n) return !0;
@@ -1769,7 +1769,7 @@ function qt(e, t) {
1769
1769
  }
1770
1770
  return e !== t;
1771
1771
  }
1772
- function Jt(e, t) {
1772
+ function Yt(e, t) {
1773
1773
  if (typeof t == "object" && t) {
1774
1774
  let n = t.length;
1775
1775
  if (typeof e == "object" && e && e.length === n) {
@@ -1782,10 +1782,10 @@ function Jt(e, t) {
1782
1782
  }
1783
1783
  //#endregion
1784
1784
  //#region src/core/renderers/gl/state/GlBlendMode.ts
1785
- var Yt = /* @__PURE__ */ function(e) {
1785
+ var Xt = /* @__PURE__ */ function(e) {
1786
1786
  return e.normal = "normal", e.add = "add", e.multiply = "multiply", e.screen = "screen", e.none = "none", e.normalNpm = "normalNpm", e.addNpm = "add_npm", e.screenNpm = "screenNpm", e.srcIn = "srcIn", e.srcOut = "srcOut", e.srcAtop = "srcAtop", e.dstOver = "dstOver", e.dstIn = "dstIn", e.dstOut = "dstOut", e.dstAtop = "dstAtop", e.xor = "xor", e.subtract = "subtract", e;
1787
1787
  }({});
1788
- function Xt(e) {
1788
+ function Zt(e) {
1789
1789
  return {
1790
1790
  normal: [e.ONE, e.ONE_MINUS_SRC_ALPHA],
1791
1791
  add: [e.ONE, e.ONE],
@@ -1840,7 +1840,7 @@ function Xt(e) {
1840
1840
  }
1841
1841
  //#endregion
1842
1842
  //#region src/core/renderers/gl/state/GlStateSystem.ts
1843
- var Zt = class e {
1843
+ var Qt = class e {
1844
1844
  static _properties = [
1845
1845
  "blend",
1846
1846
  "offsets",
@@ -1867,14 +1867,14 @@ var Zt = class e {
1867
1867
  let t = new e();
1868
1868
  return t.depthTest = !1, t.blend = !0, t;
1869
1869
  }
1870
- _blendMode = Yt.normal;
1870
+ _blendMode = Xt.normal;
1871
1871
  _polygonOffset = 0;
1872
1872
  bitmap = 0;
1873
1873
  get blendMode() {
1874
1874
  return this._blendMode;
1875
1875
  }
1876
1876
  set blendMode(e) {
1877
- this.blend = e !== Yt.none, this._blendMode = e;
1877
+ this.blend = e !== Xt.none, this._blendMode = e;
1878
1878
  }
1879
1879
  get polygonOffset() {
1880
1880
  return this._polygonOffset;
@@ -1886,19 +1886,19 @@ var Zt = class e {
1886
1886
  if (e) for (let t in e) this[t] = e[t];
1887
1887
  }
1888
1888
  };
1889
- Zt._init();
1890
- var Qt = class extends j {
1889
+ Qt._init();
1890
+ var $t = class extends A {
1891
1891
  install(e) {
1892
1892
  super.install(e), e.state = this;
1893
1893
  }
1894
1894
  _blendEq = !1;
1895
- _setters = Zt._properties.map((e) => this[`set${e.replace(/^\S/, (e) => e.toUpperCase())}`]);
1895
+ _setters = Qt._properties.map((e) => this[`set${e.replace(/^\S/, (e) => e.toUpperCase())}`]);
1896
1896
  boundStateBitmap = 0;
1897
1897
  boundBlendMode;
1898
1898
  blendModes;
1899
- defaultState = new Zt({ blend: !0 });
1899
+ defaultState = new Qt({ blend: !0 });
1900
1900
  _updateContext(e) {
1901
- super._updateContext(e), this.blendModes = Xt(e);
1901
+ super._updateContext(e), this.blendModes = Zt(e);
1902
1902
  }
1903
1903
  toggle(e, t) {
1904
1904
  this._renderer.gl[t ? "enable" : "disable"](e);
@@ -1941,14 +1941,14 @@ var Qt = class extends j {
1941
1941
  }
1942
1942
  reset() {
1943
1943
  super.reset();
1944
- let e = (1 << Zt._properties.length) - 1;
1944
+ let e = (1 << Qt._properties.length) - 1;
1945
1945
  this.boundStateBitmap = ~this.defaultState.bitmap & e, this.boundBlendMode = void 0, this._blendEq = !0, this.bind(this.defaultState);
1946
1946
  }
1947
- }, $t = class extends j {
1947
+ }, en = class extends A {
1948
1948
  install(e) {
1949
1949
  super.install(e), e.batch2D = this;
1950
1950
  }
1951
- _state = Zt.for2D();
1951
+ _state = Qt.for2D();
1952
1952
  _batchSize = 4096 * 4;
1953
1953
  _batchables = [];
1954
1954
  _vertexCount = 0;
@@ -1969,8 +1969,8 @@ var Qt = class extends j {
1969
1969
  }
1970
1970
  _createShader(e) {
1971
1971
  let t = this._renderer, n = {
1972
- instanceId: $e(),
1973
- glProgram: new Lt({
1972
+ instanceId: et(),
1973
+ glProgram: new Rt({
1974
1974
  vertex: "precision highp float;\nin vec2 aPosition;\nin vec2 aUv;\nin vec4 aTextureParams;\nin vec4 aModulate;\n\nuniform vec2 size;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\n\nout float vTextureId;\nout float vClipOutsideUv;\nout vec2 vUv;\nout vec4 vModulate;\n\nvec2 roundPixels(vec2 position, vec2 targetSize) {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n}\n\nvoid main(void) {\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n mat3 modelViewProjectionMatrix = projectionMatrix * viewMatrix * modelMatrix;\n gl_Position = vec4((modelViewProjectionMatrix * vec3(aPosition, 1.0)).xy, 0.0, 1.0);\n vTextureId = aTextureParams.x;\n vClipOutsideUv = aTextureParams.y;\n if (aTextureParams.z == 1.) {\n gl_Position.xy = roundPixels(gl_Position.xy, size);\n }\n vUv = aUv;\n vModulate = aModulate;\n}",
1975
1975
  fragment: `precision highp float;
1976
1976
  in float vTextureId;
@@ -1999,15 +1999,15 @@ void main(void) {
1999
1999
  }`
2000
2000
  })
2001
2001
  }, r = {
2002
- instanceId: $e(),
2003
- usage: A.vertex,
2002
+ instanceId: et(),
2003
+ usage: k.vertex,
2004
2004
  data: new Float32Array()
2005
2005
  }, i = {
2006
- instanceId: $e(),
2007
- usage: A.index,
2006
+ instanceId: et(),
2007
+ usage: k.index,
2008
2008
  data: new Uint32Array()
2009
2009
  }, a = {
2010
- instanceId: $e(),
2010
+ instanceId: et(),
2011
2011
  topology: "triangle-list",
2012
2012
  attributes: Object.fromEntries(Object.entries(this._attributes).map(([e, t]) => [e, {
2013
2013
  ...t,
@@ -2047,7 +2047,7 @@ void main(void) {
2047
2047
  let { indices: r, vertices: p, uvs: h = new Float32Array(), size: g = {
2048
2048
  width: 0,
2049
2049
  height: 0
2050
- }, texture: ee, blendMode: te = Yt.normal, clipOutsideUv: ne, roundPixels: re, modulate: ie = [
2050
+ }, texture: ee, blendMode: te = Xt.normal, clipOutsideUv: ne, roundPixels: re, modulate: ie = [
2051
2051
  255,
2052
2052
  255,
2053
2053
  255,
@@ -2077,22 +2077,22 @@ void main(void) {
2077
2077
  }
2078
2078
  }
2079
2079
  _getBufferData(e) {
2080
- let t = en(Math.ceil(e / 8)), n = tn(t), r = t * 8;
2080
+ let t = tn(Math.ceil(e / 8)), n = nn(t), r = t * 8;
2081
2081
  this._attributeBuffer.length <= n && (this._attributeBuffer.length = n + 1);
2082
2082
  let i = this._attributeBuffer[n];
2083
2083
  return i || (this._attributeBuffer[n] = i = /* @__PURE__ */ new ArrayBuffer(r * this._vertexSize * 4)), i;
2084
2084
  }
2085
2085
  _getIndexBufferData(e) {
2086
- let t = en(Math.ceil(e / 12)), n = tn(t), r = t * 12;
2086
+ let t = tn(Math.ceil(e / 12)), n = nn(t), r = t * 12;
2087
2087
  this._indexBuffers.length <= n && (this._indexBuffers.length = n + 1);
2088
2088
  let i = this._indexBuffers[n];
2089
2089
  return i || (this._indexBuffers[n] = i = new Uint32Array(r)), i;
2090
2090
  }
2091
2091
  };
2092
- function en(e) {
2092
+ function tn(e) {
2093
2093
  return e += +(e === 0), --e, e |= e >>> 1, e |= e >>> 2, e |= e >>> 4, e |= e >>> 8, e |= e >>> 16, e + 1;
2094
2094
  }
2095
- function tn(e) {
2095
+ function nn(e) {
2096
2096
  let t = (e > 65535) << 4;
2097
2097
  e >>>= t;
2098
2098
  let n = (e > 255) << 3;
@@ -2100,11 +2100,11 @@ function tn(e) {
2100
2100
  }
2101
2101
  //#endregion
2102
2102
  //#region src/core/renderers/gl/const.ts
2103
- var M = /* @__PURE__ */ function(e) {
2103
+ var j = /* @__PURE__ */ function(e) {
2104
2104
  return e[e.disabled = 0] = "disabled", e[e.renderingMaskAdd = 1] = "renderingMaskAdd", e[e.maskActive = 2] = "maskActive", e[e.inverseMaskActive = 3] = "inverseMaskActive", e[e.renderingMaskRemove = 4] = "renderingMaskRemove", e[e.none = 5] = "none", e;
2105
- }({}), nn = /* @__PURE__ */ function(e) {
2105
+ }({}), rn = /* @__PURE__ */ function(e) {
2106
2106
  return e[e.none = 0] = "none", e[e.color = 16384] = "color", e[e.stencil = 1024] = "stencil", e[e.depth = 256] = "depth", e[e.colorDepth = 16640] = "colorDepth", e[e.colorStencil = 17408] = "colorStencil", e[e.depthStencil = 1280] = "depthStencil", e[e.all = 17664] = "all", e;
2107
- }({}), rn = class extends j {
2107
+ }({}), an = class extends A {
2108
2108
  install(e) {
2109
2109
  super.install(e), e.mask = this;
2110
2110
  }
@@ -2123,16 +2123,16 @@ var M = /* @__PURE__ */ function(e) {
2123
2123
  };
2124
2124
  this.stack.push(n);
2125
2125
  let r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
2126
- "x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(M.renderingMaskAdd, i), this._renderer.colorMask.bind(0), i++, t.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(M.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
2126
+ "x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(j.renderingMaskAdd, i), this._renderer.colorMask.bind(0), i++, t.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(j.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
2127
2127
  }
2128
2128
  pop(e) {
2129
2129
  let t = this.stack.pop();
2130
2130
  if (!t || t.source !== e) return;
2131
2131
  let { mask: n } = t, r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
2132
- "x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(nn.stencil), this._renderer.stencil.bind(M.disabled, i)) : this._renderer.stencil.bind(M.renderingMaskRemove, i), i--, n.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(M.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
2132
+ "x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(rn.stencil), this._renderer.stencil.bind(j.disabled, i)) : this._renderer.stencil.bind(j.renderingMaskRemove, i), i--, n.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(j.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
2133
2133
  }
2134
- }, an = [];
2135
- an[M.none] = {}, an[M.disabled] = {}, an[M.renderingMaskAdd] = {
2134
+ }, on = [];
2135
+ on[j.none] = {}, on[j.disabled] = {}, on[j.renderingMaskAdd] = {
2136
2136
  stencilFront: {
2137
2137
  compare: "equal",
2138
2138
  passOp: "increment-clamp"
@@ -2141,7 +2141,7 @@ an[M.none] = {}, an[M.disabled] = {}, an[M.renderingMaskAdd] = {
2141
2141
  compare: "equal",
2142
2142
  passOp: "increment-clamp"
2143
2143
  }
2144
- }, an[M.renderingMaskRemove] = {
2144
+ }, on[j.renderingMaskRemove] = {
2145
2145
  stencilFront: {
2146
2146
  compare: "equal",
2147
2147
  passOp: "decrement-clamp"
@@ -2150,7 +2150,7 @@ an[M.none] = {}, an[M.disabled] = {}, an[M.renderingMaskAdd] = {
2150
2150
  compare: "equal",
2151
2151
  passOp: "decrement-clamp"
2152
2152
  }
2153
- }, an[M.maskActive] = {
2153
+ }, on[j.maskActive] = {
2154
2154
  stencilFront: {
2155
2155
  compare: "equal",
2156
2156
  passOp: "keep"
@@ -2159,7 +2159,7 @@ an[M.none] = {}, an[M.disabled] = {}, an[M.renderingMaskAdd] = {
2159
2159
  compare: "equal",
2160
2160
  passOp: "keep"
2161
2161
  }
2162
- }, an[M.inverseMaskActive] = {
2162
+ }, on[j.inverseMaskActive] = {
2163
2163
  stencilFront: {
2164
2164
  compare: "not-equal",
2165
2165
  passOp: "keep"
@@ -2169,17 +2169,17 @@ an[M.none] = {}, an[M.disabled] = {}, an[M.renderingMaskAdd] = {
2169
2169
  passOp: "keep"
2170
2170
  }
2171
2171
  };
2172
- var on = class extends j {
2172
+ var sn = class extends A {
2173
2173
  install(e) {
2174
2174
  super.install(e), e.stencil = this;
2175
2175
  }
2176
2176
  _cache = {
2177
2177
  enabled: !1,
2178
- stencilMode: M.none,
2178
+ stencilMode: j.none,
2179
2179
  refCount: 0
2180
2180
  };
2181
2181
  current = { [-1]: {
2182
- stencilMode: M.disabled,
2182
+ stencilMode: j.disabled,
2183
2183
  refCount: 0
2184
2184
  } };
2185
2185
  _passOpMap;
@@ -2209,20 +2209,20 @@ var on = class extends j {
2209
2209
  super._setup(), this._renderer.renderTarget.on("updateRenderTarget", this._updateRenderTarget);
2210
2210
  }
2211
2211
  reset() {
2212
- this._cache.enabled = !1, this._cache.stencilMode = M.none, this._cache.refCount = 0;
2212
+ this._cache.enabled = !1, this._cache.stencilMode = j.none, this._cache.refCount = 0;
2213
2213
  }
2214
2214
  _updateRenderTarget = (e) => {
2215
2215
  if (e) {
2216
2216
  let t = this.current[e.instanceId];
2217
2217
  t ||= this.current[e.instanceId] = {
2218
- stencilMode: M.disabled,
2218
+ stencilMode: j.disabled,
2219
2219
  refCount: 0
2220
2220
  }, this.bind(t.stencilMode, t.refCount);
2221
2221
  }
2222
2222
  };
2223
2223
  bind(e, t) {
2224
- let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i = an[e], a = this._cache;
2225
- if (n.stencilMode = e, n.refCount = t, e === M.disabled) {
2224
+ let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i = on[e], a = this._cache;
2225
+ if (n.stencilMode = e, n.refCount = t, e === j.disabled) {
2226
2226
  this._cache.enabled && (this._cache.enabled = !1, r.disable(r.STENCIL_TEST));
2227
2227
  return;
2228
2228
  }
@@ -2231,8 +2231,8 @@ var on = class extends j {
2231
2231
  destroy() {
2232
2232
  super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
2233
2233
  }
2234
- }, sn = class extends j {
2235
- current = new ct(0, 0, 0, 0);
2234
+ }, cn = class extends A {
2235
+ current = new lt(0, 0, 0, 0);
2236
2236
  install(e) {
2237
2237
  super.install(e), e.viewport = this;
2238
2238
  }
@@ -2240,7 +2240,7 @@ var on = class extends j {
2240
2240
  let t = this.current, n = Math.floor(e.x), r = Math.floor(e.y), i = Math.floor(e.width), a = Math.floor(e.height);
2241
2241
  t.x === n && t.y === r && t.width === i && t.height === a || (this._gl.viewport(n, r, i, a), t.x = n, t.y = r, t.width = i, t.height = a);
2242
2242
  }
2243
- }, cn = class {
2243
+ }, ln = class {
2244
2244
  framebuffer;
2245
2245
  width = -1;
2246
2246
  height = -1;
@@ -2251,7 +2251,7 @@ var on = class extends j {
2251
2251
  constructor(e) {
2252
2252
  this.framebuffer = e;
2253
2253
  }
2254
- }, ln = class extends j {
2254
+ }, un = class extends A {
2255
2255
  install(e) {
2256
2256
  super.install(e), e.renderTarget = this;
2257
2257
  }
@@ -2261,7 +2261,7 @@ var on = class extends j {
2261
2261
  _msaaSamples = [];
2262
2262
  _hasMRT = !0;
2263
2263
  _writeDepthTexture = !0;
2264
- projection = new mt();
2264
+ projection = new ht();
2265
2265
  _updateContext(e) {
2266
2266
  if (super._updateContext(e), this._hasMRT = !0, this._writeDepthTexture = !0, this._renderer.version === 1) {
2267
2267
  let t = this._renderer.extensions.drawBuffers, n = this._renderer.extensions.depthTexture;
@@ -2297,7 +2297,7 @@ var on = class extends j {
2297
2297
  return this.glRenderTargets.get(e.instanceId) || this._createGlRenderTarget(e);
2298
2298
  }
2299
2299
  _createGlRenderTarget(e) {
2300
- let t = this._gl, n = new cn(t.createFramebuffer());
2300
+ let t = this._gl, n = new ln(t.createFramebuffer());
2301
2301
  return this.glRenderTargets.set(e.instanceId, n), this.renderTargets.get(e.instanceId) || (this.renderTargets.set(e.instanceId, e), this._update(e, n), "on" in e && (e.on("updateProperty", (t) => {
2302
2302
  switch (t) {
2303
2303
  case "width":
@@ -2374,28 +2374,28 @@ var on = class extends j {
2374
2374
  reset() {
2375
2375
  super.reset(), this._renderer.contextLost || this.glRenderTargets.forEach((e) => this.destroyGpuRenderTarget(e)), this.renderTargets.clear(), this.glRenderTargets.clear(), this.current = null, this._msaaSamples.length = 0;
2376
2376
  }
2377
- }, un = /* @__PURE__ */ function(e) {
2377
+ }, dn = /* @__PURE__ */ function(e) {
2378
2378
  return e[e.RGBA = 6408] = "RGBA", e[e.RGB = 6407] = "RGB", e[e.RG = 33319] = "RG", e[e.RED = 6403] = "RED", e[e.RGBA_INTEGER = 36249] = "RGBA_INTEGER", e[e.RGB_INTEGER = 36248] = "RGB_INTEGER", e[e.RG_INTEGER = 33320] = "RG_INTEGER", e[e.RED_INTEGER = 36244] = "RED_INTEGER", e[e.ALPHA = 6406] = "ALPHA", e[e.LUMINANCE = 6409] = "LUMINANCE", e[e.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA", e[e.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT", e[e.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL", e;
2379
- }({}), dn = /* @__PURE__ */ function(e) {
2379
+ }({}), fn = /* @__PURE__ */ function(e) {
2380
2380
  return e[e.TEXTURE_2D = 3553] = "TEXTURE_2D", e[e.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP", e[e.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY", e[e.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X", e[e.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X", e[e.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y", e[e.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z", e;
2381
- }({}), N = /* @__PURE__ */ function(e) {
2381
+ }({}), M = /* @__PURE__ */ function(e) {
2382
2382
  return e[e.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", e[e.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", e[e.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5", e[e.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4", e[e.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1", e[e.UNSIGNED_INT = 5125] = "UNSIGNED_INT", e[e.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV", e[e.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV", e[e.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8", e[e.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV", e[e.BYTE = 5120] = "BYTE", e[e.SHORT = 5122] = "SHORT", e[e.INT = 5124] = "INT", e[e.FLOAT = 5126] = "FLOAT", e[e.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV", e[e.HALF_FLOAT = 36193] = "HALF_FLOAT", e;
2383
- }({}), fn = class {
2383
+ }({}), pn = class {
2384
2384
  native;
2385
- target = dn.TEXTURE_2D;
2385
+ target = fn.TEXTURE_2D;
2386
2386
  width = -1;
2387
2387
  height = -1;
2388
2388
  mipmap = !1;
2389
- type = N.UNSIGNED_BYTE;
2390
- internalFormat = un.RGBA;
2391
- format = un.RGBA;
2389
+ type = M.UNSIGNED_BYTE;
2390
+ internalFormat = dn.RGBA;
2391
+ format = dn.RGBA;
2392
2392
  constructor(e) {
2393
2393
  this.native = e;
2394
2394
  }
2395
2395
  };
2396
2396
  //#endregion
2397
2397
  //#region src/core/renderers/gl/texture/mapFormatToGlFormat.ts
2398
- function pn(e) {
2398
+ function mn(e) {
2399
2399
  return {
2400
2400
  r8unorm: e.RED,
2401
2401
  r8snorm: e.RED,
@@ -2443,7 +2443,7 @@ function pn(e) {
2443
2443
  }
2444
2444
  //#endregion
2445
2445
  //#region src/core/renderers/gl/texture/mapFormatToGlInternalFormat.ts
2446
- function mn(e, t) {
2446
+ function hn(e, t) {
2447
2447
  let n = {}, r = e.RGBA;
2448
2448
  return e instanceof WebGLRenderingContext ? t.srgb && (n = {
2449
2449
  "rgba8unorm-srgb": t.srgb.SRGB8_ALPHA8_EXT,
@@ -2559,7 +2559,7 @@ function mn(e, t) {
2559
2559
  }
2560
2560
  //#endregion
2561
2561
  //#region src/core/renderers/gl/texture/mapFormatToGlType.ts
2562
- function hn(e) {
2562
+ function gn(e) {
2563
2563
  return {
2564
2564
  r8unorm: e.UNSIGNED_BYTE,
2565
2565
  r8snorm: e.BYTE,
@@ -2607,7 +2607,7 @@ function hn(e) {
2607
2607
  }
2608
2608
  //#endregion
2609
2609
  //#region src/core/renderers/gl/texture/updateTextureStyle.ts
2610
- var gn = {
2610
+ var _n = {
2611
2611
  linear: {
2612
2612
  linear: 9987,
2613
2613
  nearest: 9985
@@ -2616,10 +2616,10 @@ var gn = {
2616
2616
  linear: 9986,
2617
2617
  nearest: 9984
2618
2618
  }
2619
- }, _n = {
2619
+ }, vn = {
2620
2620
  linear: 9729,
2621
2621
  nearest: 9728
2622
- }, vn = {
2622
+ }, yn = {
2623
2623
  never: 512,
2624
2624
  less: 513,
2625
2625
  equal: 514,
@@ -2628,32 +2628,32 @@ var gn = {
2628
2628
  "not-equal": 517,
2629
2629
  "greater-equal": 518,
2630
2630
  always: 519
2631
- }, yn = {
2631
+ }, bn = {
2632
2632
  "clamp-to-edge": 33071,
2633
2633
  repeat: 10497,
2634
2634
  "mirror-repeat": 33648
2635
2635
  };
2636
- function bn(e, t, n, r, i, a, o, s) {
2636
+ function xn(e, t, n, r, i, a, o, s) {
2637
2637
  let { addressModeU: c = "repeat", addressModeV: l = "repeat", addressModeW: u = "repeat", magFilter: d = "linear", minFilter: f = "linear", mipmapFilter: p = "linear", maxAnisotropy: m = 0, compare: h } = e, g = a;
2638
2638
  if (!s || c !== "repeat" || l !== "repeat" || u !== "repeat") {
2639
- let e = yn[o ? "clamp-to-edge" : c], n = yn[o ? "clamp-to-edge" : l], r = yn[o ? "clamp-to-edge" : u];
2639
+ let e = bn[o ? "clamp-to-edge" : c], n = bn[o ? "clamp-to-edge" : l], r = bn[o ? "clamp-to-edge" : u];
2640
2640
  t[i](g, t.TEXTURE_WRAP_S, e), t[i](g, t.TEXTURE_WRAP_T, n), t.TEXTURE_WRAP_R && t[i](g, t.TEXTURE_WRAP_R, r);
2641
2641
  }
2642
- if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER, _n[d]), n) {
2642
+ if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER, vn[d]), n) {
2643
2643
  if (!s || p !== "linear") {
2644
- let e = gn[f][p];
2644
+ let e = _n[f][p];
2645
2645
  t[i](g, t.TEXTURE_MIN_FILTER, e);
2646
2646
  }
2647
- } else t[i](g, t.TEXTURE_MIN_FILTER, _n[f]);
2647
+ } else t[i](g, t.TEXTURE_MIN_FILTER, vn[f]);
2648
2648
  if (r && m > 1) {
2649
2649
  let e = Math.min(m, t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));
2650
2650
  t[i](g, r.TEXTURE_MAX_ANISOTROPY_EXT, e);
2651
2651
  }
2652
- h && t[i](g, t.TEXTURE_COMPARE_FUNC, vn[h]);
2652
+ h && t[i](g, t.TEXTURE_COMPARE_FUNC, yn[h]);
2653
2653
  }
2654
2654
  //#endregion
2655
2655
  //#region src/core/renderers/gl/texture/uploaders/index.ts
2656
- var xn = {
2656
+ var Sn = {
2657
2657
  buffer: {
2658
2658
  id: "buffer",
2659
2659
  upload: (e, t, n) => {
@@ -2667,8 +2667,8 @@ var xn = {
2667
2667
  c < o || l < s ? ((i !== o || a !== s) && n.texImage2D(t.target, 0, t.internalFormat, o, s, 0, t.format, t.type, null), r === 2 ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, c, l, t.format, t.type, e.source) : n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.format, t.type, e.source)) : i === o && a === s ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.format, t.type, e.source) : r === 2 ? n.texImage2D(t.target, 0, t.internalFormat, o, s, 0, t.format, t.type, e.source) : n.texImage2D(t.target, 0, t.internalFormat, t.format, t.type, e.source), t.width = o, t.height = s;
2668
2668
  }
2669
2669
  }
2670
- }, Sn = class extends j {
2671
- uploaders = { ...xn };
2670
+ }, Cn = class extends A {
2671
+ uploaders = { ...Sn };
2672
2672
  textures = /* @__PURE__ */ new Map();
2673
2673
  glTextures = /* @__PURE__ */ new Map();
2674
2674
  _mapFormatToInternalFormat = Object.create(null);
@@ -2683,14 +2683,14 @@ var xn = {
2683
2683
  super.install(e), e.texture = this;
2684
2684
  }
2685
2685
  _updateContext(e) {
2686
- super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat = mn(e, this._renderer.extensions), this._mapFormatToType = hn(e), this._mapFormatToFormat = pn(e)), this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.maxTextureImageUnits = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);
2686
+ super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat = hn(e, this._renderer.extensions), this._mapFormatToType = gn(e), this._mapFormatToFormat = mn(e)), this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.maxTextureImageUnits = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);
2687
2687
  for (let e = 0; e < this.maxTextureImageUnits; e++) this.unbind(e);
2688
2688
  }
2689
2689
  getGlTexture(e) {
2690
2690
  return this.glTextures.get(e.instanceId) || this._createGlTexture(e);
2691
2691
  }
2692
2692
  _createGlTexture(e) {
2693
- let t = this._gl, n = new fn(t.createTexture());
2693
+ let t = this._gl, n = new pn(t.createTexture());
2694
2694
  if (t.bindTexture(n.target, n.native), n.type = this._mapFormatToType[e.format], n.internalFormat = this._mapFormatToInternalFormat[e.format], n.format = this._mapFormatToFormat[e.format], this.glTextures.set(e.instanceId, n), e.mipmap && (this._renderer.supports.nonPowOf2mipmaps || e.isPowerOfTwo)) {
2695
2695
  let t = Math.max(e.width, e.height);
2696
2696
  e.mipLevelCount = Math.floor(Math.log2(t)) + 1;
@@ -2750,7 +2750,7 @@ var xn = {
2750
2750
  }
2751
2751
  updateStyle(e, t = !1) {
2752
2752
  let n = this._gl;
2753
- bn(e, n, e.mipLevelCount > 1, this._renderer.extensions.anisotropicFiltering, "texParameteri", n.TEXTURE_2D, !this._renderer.supports.nonPowOf2wrapping && !e.isPowerOfTwo, t);
2753
+ xn(e, n, e.mipLevelCount > 1, this._renderer.extensions.anisotropicFiltering, "texParameteri", n.TEXTURE_2D, !this._renderer.supports.nonPowOf2wrapping && !e.isPowerOfTwo, t);
2754
2754
  }
2755
2755
  updateGpuTexture(e) {
2756
2756
  this.bind(e);
@@ -2765,50 +2765,50 @@ var xn = {
2765
2765
  let e = this._gl;
2766
2766
  this._renderer.contextLost || this.glTextures.forEach((t) => e.deleteTexture(t.native)), this.textures.clear(), this.glTextures.clear(), this._location = 0, this.current.length = 0, this._premultiplyAlpha = !1, this._renderer.contextLost || e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this._premultiplyAlpha);
2767
2767
  }
2768
- }, Cn = {
2769
- uint8x2: N.UNSIGNED_BYTE,
2770
- uint8x4: N.UNSIGNED_BYTE,
2771
- sint8x2: N.BYTE,
2772
- sint8x4: N.BYTE,
2773
- unorm8x2: N.UNSIGNED_BYTE,
2774
- unorm8x4: N.UNSIGNED_BYTE,
2775
- snorm8x2: N.BYTE,
2776
- snorm8x4: N.BYTE,
2777
- uint16x2: N.UNSIGNED_SHORT,
2778
- uint16x4: N.UNSIGNED_SHORT,
2779
- sint16x2: N.SHORT,
2780
- sint16x4: N.SHORT,
2781
- unorm16x2: N.UNSIGNED_SHORT,
2782
- unorm16x4: N.UNSIGNED_SHORT,
2783
- snorm16x2: N.SHORT,
2784
- snorm16x4: N.SHORT,
2785
- float16x2: N.HALF_FLOAT,
2786
- float16x4: N.HALF_FLOAT,
2787
- float32: N.FLOAT,
2788
- float32x2: N.FLOAT,
2789
- float32x3: N.FLOAT,
2790
- float32x4: N.FLOAT,
2791
- uint32: N.UNSIGNED_INT,
2792
- uint32x2: N.UNSIGNED_INT,
2793
- uint32x3: N.UNSIGNED_INT,
2794
- uint32x4: N.UNSIGNED_INT,
2795
- sint32: N.INT,
2796
- sint32x2: N.INT,
2797
- sint32x3: N.INT,
2798
- sint32x4: N.INT
2768
+ }, wn = {
2769
+ uint8x2: M.UNSIGNED_BYTE,
2770
+ uint8x4: M.UNSIGNED_BYTE,
2771
+ sint8x2: M.BYTE,
2772
+ sint8x4: M.BYTE,
2773
+ unorm8x2: M.UNSIGNED_BYTE,
2774
+ unorm8x4: M.UNSIGNED_BYTE,
2775
+ snorm8x2: M.BYTE,
2776
+ snorm8x4: M.BYTE,
2777
+ uint16x2: M.UNSIGNED_SHORT,
2778
+ uint16x4: M.UNSIGNED_SHORT,
2779
+ sint16x2: M.SHORT,
2780
+ sint16x4: M.SHORT,
2781
+ unorm16x2: M.UNSIGNED_SHORT,
2782
+ unorm16x4: M.UNSIGNED_SHORT,
2783
+ snorm16x2: M.SHORT,
2784
+ snorm16x4: M.SHORT,
2785
+ float16x2: M.HALF_FLOAT,
2786
+ float16x4: M.HALF_FLOAT,
2787
+ float32: M.FLOAT,
2788
+ float32x2: M.FLOAT,
2789
+ float32x3: M.FLOAT,
2790
+ float32x4: M.FLOAT,
2791
+ uint32: M.UNSIGNED_INT,
2792
+ uint32x2: M.UNSIGNED_INT,
2793
+ uint32x3: M.UNSIGNED_INT,
2794
+ uint32x4: M.UNSIGNED_INT,
2795
+ sint32: M.INT,
2796
+ sint32x2: M.INT,
2797
+ sint32x3: M.INT,
2798
+ sint32x4: M.INT
2799
2799
  };
2800
- function wn(e) {
2801
- return Cn[e] ?? Cn.float32;
2800
+ function Tn(e) {
2801
+ return wn[e] ?? wn.float32;
2802
2802
  }
2803
2803
  //#endregion
2804
2804
  //#region src/core/renderers/gl/geometry/GlGeometrySystem.ts
2805
- var Tn = {
2805
+ var En = {
2806
2806
  "point-list": 0,
2807
2807
  "line-list": 1,
2808
2808
  "line-strip": 3,
2809
2809
  "triangle-list": 4,
2810
2810
  "triangle-strip": 5
2811
- }, En = class extends j {
2811
+ }, Dn = class extends A {
2812
2812
  _geometryVaoHash = {};
2813
2813
  hasInstance = !1;
2814
2814
  current = null;
@@ -2847,11 +2847,11 @@ var Tn = {
2847
2847
  }
2848
2848
  for (let e in r) {
2849
2849
  let t = r[e];
2850
- i[t.buffer.instanceId] += zt(t.format).stride;
2850
+ i[t.buffer.instanceId] += Bt(t.format).stride;
2851
2851
  }
2852
2852
  for (let e in r) {
2853
2853
  let t = r[e];
2854
- t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] += zt(t.format).stride;
2854
+ t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] += Bt(t.format).stride;
2855
2855
  }
2856
2856
  }
2857
2857
  _createVao(e, t) {
@@ -2886,7 +2886,7 @@ var Tn = {
2886
2886
  a !== c && (r.bind(s), a = c);
2887
2887
  let e = l.location;
2888
2888
  n.enableVertexAttribArray(e);
2889
- let t = zt(o.format), i = wn(o.format);
2889
+ let t = Bt(o.format), i = Tn(o.format);
2890
2890
  if (l.format?.substring(1, 4) === "int" ? n.vertexAttribIPointer(e, t.size, i, o.stride ?? 0, o.start ?? 0) : n.vertexAttribPointer(e, t.size, i, t.normalized, o.stride ?? 0, o.start ?? 0), o.instance) if (this.hasInstance) {
2891
2891
  let t = o.divisor ?? 1;
2892
2892
  n.vertexAttribDivisor(e, t);
@@ -2919,7 +2919,7 @@ var Tn = {
2919
2919
  let { topology: t, size: n, start: r = 0, instanceCount: i } = e, { gl: a } = this._renderer, o = this.current;
2920
2920
  if (!o) return this;
2921
2921
  t = t || o.topology || "triangle-list";
2922
- let s = Tn[t];
2922
+ let s = En[t];
2923
2923
  if (i = i || o.instanceCount || 1, o.indexBuffer) {
2924
2924
  n ||= o.indexBuffer.data.length;
2925
2925
  let e = o.indexBuffer.data.BYTES_PER_ELEMENT, t = e === 2 ? a.UNSIGNED_SHORT : a.UNSIGNED_INT;
@@ -2940,7 +2940,7 @@ var Tn = {
2940
2940
  }
2941
2941
  this._geometryVaoHash = {}, this.current = null, this.currentVao = null;
2942
2942
  }
2943
- }, Dn = class extends j {
2943
+ }, On = class extends A {
2944
2944
  install(e) {
2945
2945
  super.install(e), e.colorMask = this;
2946
2946
  }
@@ -2951,19 +2951,19 @@ var Tn = {
2951
2951
  };
2952
2952
  //#endregion
2953
2953
  //#region src/core/renderers/gl/GlScissorSystem.ts
2954
- function On(e, t, n) {
2954
+ function kn(e, t, n) {
2955
2955
  let [r, i, a, o, s, c, l, u, d] = e, f = r * t + o * n + l, p = i * t + s * n + u, m = a * t + c * n + d;
2956
2956
  return {
2957
2957
  x: f / m,
2958
2958
  y: p / m
2959
2959
  };
2960
2960
  }
2961
- function kn(e, t) {
2961
+ function An(e, t) {
2962
2962
  let { x: n, y: r, width: i, height: a } = t, o = [
2963
- On(e, n, r),
2964
- On(e, n + i, r),
2965
- On(e, n + i, r + a),
2966
- On(e, n, r + a)
2963
+ kn(e, n, r),
2964
+ kn(e, n + i, r),
2965
+ kn(e, n + i, r + a),
2966
+ kn(e, n, r + a)
2967
2967
  ], s = o.map((e) => e.x), c = o.map((e) => e.y), l = Math.min(...s), u = Math.max(...s), d = Math.min(...c), f = Math.max(...c);
2968
2968
  return {
2969
2969
  x: l,
@@ -2972,7 +2972,7 @@ function kn(e, t) {
2972
2972
  height: f - d
2973
2973
  };
2974
2974
  }
2975
- var An = class extends j {
2975
+ var jn = class extends A {
2976
2976
  install(e) {
2977
2977
  super.install(e), e.scissor = this;
2978
2978
  }
@@ -2999,28 +2999,28 @@ var An = class extends j {
2999
2999
  bind(e) {
3000
3000
  let t = this._gl;
3001
3001
  if (e) {
3002
- let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } = kn(i, e), l = r.current.height / n - (o + c);
3002
+ let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } = An(i, e), l = r.current.height / n - (o + c);
3003
3003
  t.scissor(a * n, l * n, s * n, c * n);
3004
3004
  } else t.disable(t.SCISSOR_TEST);
3005
3005
  }
3006
3006
  destroy() {
3007
3007
  super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
3008
3008
  }
3009
- }, jn = class extends yt {
3009
+ }, Mn = class extends bt {
3010
3010
  contextLost = !1;
3011
3011
  _systems = [
3012
- new Sn(),
3013
- new Tt(),
3014
- new Kt(),
3015
- new En(),
3016
- new ln(),
3017
- new Qt(),
3018
- new rn(),
3012
+ new Cn(),
3013
+ new Et(),
3014
+ new qt(),
3019
3015
  new Dn(),
3020
- new on(),
3021
- new An(),
3016
+ new un(),
3022
3017
  new $t(),
3023
- new sn()
3018
+ new an(),
3019
+ new On(),
3020
+ new sn(),
3021
+ new jn(),
3022
+ new en(),
3023
+ new cn()
3024
3024
  ];
3025
3025
  bindPoints = /* @__PURE__ */ new Map();
3026
3026
  supports = {
@@ -3032,9 +3032,9 @@ var An = class extends j {
3032
3032
  msaa: !0,
3033
3033
  nonPowOf2mipmaps: !0
3034
3034
  };
3035
- constructor(e = Ye(), t) {
3035
+ constructor(e = Xe(), t) {
3036
3036
  if (super(), !e) throw Error("Failed to createHTMLCanvas");
3037
- qe(e) ? this._setupContext(e, t) : (this.gl = e, this.version = Je(this.gl) ? 2 : 1), this._setupBindPoints()._setupExtensions()._setupPolyfill()._setupSupports(), this._systems.forEach((e) => e.install(this)), this._systems.forEach((e) => e.emit("updateContext", this.gl)), this._systems.forEach((e) => e.emit("setup"));
3037
+ Je(e) ? this._setupContext(e, t) : (this.gl = e, this.version = Ye(this.gl) ? 2 : 1), this._setupBindPoints()._setupExtensions()._setupPolyfill()._setupSupports(), this._systems.forEach((e) => e.install(this)), this._systems.forEach((e) => e.emit("updateContext", this.gl)), this._systems.forEach((e) => e.emit("setup"));
3038
3038
  }
3039
3039
  _setupContext(e, t) {
3040
3040
  this.view = e;
@@ -3114,8 +3114,8 @@ var An = class extends j {
3114
3114
  height: this.screen.height * this.pixelRatio
3115
3115
  });
3116
3116
  }
3117
- clear(e = nn.all) {
3118
- typeof e == "boolean" && (e = e ? nn.all : nn.none), e && this.gl.clear(e);
3117
+ clear(e = rn.all) {
3118
+ typeof e == "boolean" && (e = e ? rn.all : rn.none), e && this.gl.clear(e);
3119
3119
  }
3120
3120
  reset() {
3121
3121
  this._systems.forEach((e) => e.reset());
@@ -3132,7 +3132,7 @@ var An = class extends j {
3132
3132
  for (let e = 0; e < i; e += a) c.set(s.subarray(e, e + a), o - e);
3133
3133
  return c;
3134
3134
  }
3135
- }, Mn = class {}, Nn = class extends Mn {
3135
+ }, Nn = class {}, Pn = class extends Nn {
3136
3136
  install(e) {
3137
3137
  let t = async (e) => {
3138
3138
  let { parseFont: t } = await import("modern-font");
@@ -3146,15 +3146,15 @@ var An = class extends j {
3146
3146
  e.register(n, t);
3147
3147
  }), e.font = this, this;
3148
3148
  }
3149
- }, Pn, Fn = class extends T {
3149
+ }, Fn, In = class extends w {
3150
3150
  constructor(e) {
3151
3151
  super(), this.setProperties(e);
3152
3152
  }
3153
3153
  };
3154
- k([_({ fallback: A.index }), O("design:type", typeof (Pn = A !== void 0 && A) == "function" ? Pn : Object)], Fn.prototype, "usage", void 0), k([_({ default: () => new Uint32Array() }), O("design:type", Object)], Fn.prototype, "data", void 0);
3154
+ O([_({ fallback: k.index }), D("design:type", typeof (Fn = k !== void 0 && k) == "function" ? Fn : Object)], In.prototype, "usage", void 0), O([_({ default: () => new Uint32Array() }), D("design:type", Object)], In.prototype, "data", void 0);
3155
3155
  //#endregion
3156
3156
  //#region src/scene/resources/geometries/Geometry.ts
3157
- var In, Ln, Rn = class extends T {
3157
+ var Ln, Rn, zn = class extends w {
3158
3158
  constructor(e = {}) {
3159
3159
  super(), this.setProperties(e);
3160
3160
  }
@@ -3162,32 +3162,32 @@ var In, Ln, Rn = class extends T {
3162
3162
  e.flush(), t.activate(e, n), e.geometry.bind(this, t.glProgram), e.geometry.draw(), e.geometry.unbind();
3163
3163
  }
3164
3164
  };
3165
- k([_({ fallback: "triangle-list" }), O("design:type", Object)], Rn.prototype, "topology", void 0), k([_({ default: () => ({}) }), O("design:type", typeof (In = typeof Record < "u" && Record) == "function" ? In : Object)], Rn.prototype, "attributes", void 0), k([_({ default: () => new Fn() }), O("design:type", typeof (Ln = Fn !== void 0 && Fn) == "function" ? Ln : Object)], Rn.prototype, "indexBuffer", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Rn.prototype, "instanceCount", void 0);
3165
+ O([_({ fallback: "triangle-list" }), D("design:type", Object)], zn.prototype, "topology", void 0), O([_({ default: () => ({}) }), D("design:type", typeof (Ln = typeof Record < "u" && Record) == "function" ? Ln : Object)], zn.prototype, "attributes", void 0), O([_({ default: () => new In() }), D("design:type", typeof (Rn = In !== void 0 && In) == "function" ? Rn : Object)], zn.prototype, "indexBuffer", void 0), O([_({ fallback: 1 }), D("design:type", Number)], zn.prototype, "instanceCount", void 0);
3166
3166
  //#endregion
3167
3167
  //#region src/scene/resources/geometries/VertexBuffer.ts
3168
- var zn, P = class extends T {
3168
+ var Bn, N = class extends w {
3169
3169
  constructor(e) {
3170
3170
  super(), this.setProperties(e);
3171
3171
  }
3172
3172
  };
3173
- k([_({ fallback: A.vertex }), O("design:type", typeof (zn = A !== void 0 && A) == "function" ? zn : Object)], P.prototype, "usage", void 0), k([_({ default: () => new Float32Array() }), O("design:type", Object)], P.prototype, "data", void 0);
3173
+ O([_({ fallback: k.vertex }), D("design:type", typeof (Bn = k !== void 0 && k) == "function" ? Bn : Object)], N.prototype, "usage", void 0), O([_({ default: () => new Float32Array() }), D("design:type", Object)], N.prototype, "data", void 0);
3174
3174
  //#endregion
3175
3175
  //#region src/scene/resources/geometries/VertexAttribute.ts
3176
- var Bn, F = class extends T {
3176
+ var Vn, P = class extends w {
3177
3177
  constructor(e) {
3178
3178
  super(), this.setProperties(e);
3179
3179
  }
3180
3180
  };
3181
- k([_({ default: () => new P() }), O("design:type", typeof (Bn = P !== void 0 && P) == "function" ? Bn : Object)], F.prototype, "buffer", void 0), k([_({ fallback: "float32" }), O("design:type", Object)], F.prototype, "format", void 0), k([_(), O("design:type", Boolean)], F.prototype, "instance", void 0), k([_(), O("design:type", Number)], F.prototype, "stride", void 0), k([_(), O("design:type", Number)], F.prototype, "offset", void 0), k([_(), O("design:type", Number)], F.prototype, "start", void 0), k([_(), O("design:type", Number)], F.prototype, "divisor", void 0);
3181
+ O([_({ default: () => new N() }), D("design:type", typeof (Vn = N !== void 0 && N) == "function" ? Vn : Object)], P.prototype, "buffer", void 0), O([_({ fallback: "float32" }), D("design:type", Object)], P.prototype, "format", void 0), O([_(), D("design:type", Boolean)], P.prototype, "instance", void 0), O([_(), D("design:type", Number)], P.prototype, "stride", void 0), O([_(), D("design:type", Number)], P.prototype, "offset", void 0), O([_(), D("design:type", Number)], P.prototype, "start", void 0), O([_(), D("design:type", Number)], P.prototype, "divisor", void 0);
3182
3182
  //#endregion
3183
3183
  //#region src/scene/resources/geometries/QuadGeometry.ts
3184
- var Vn = class extends Rn {
3184
+ var Hn = class extends zn {
3185
3185
  constructor() {
3186
3186
  super({
3187
3187
  topology: "triangle-strip",
3188
- attributes: { position: new F({
3188
+ attributes: { position: new P({
3189
3189
  format: "float32x2",
3190
- buffer: new P({ data: new Float32Array([
3190
+ buffer: new N({ data: new Float32Array([
3191
3191
  0,
3192
3192
  0,
3193
3193
  1,
@@ -3198,7 +3198,7 @@ var Vn = class extends Rn {
3198
3198
  1
3199
3199
  ]) })
3200
3200
  }) },
3201
- indexBuffer: new Fn({ data: new Uint32Array([
3201
+ indexBuffer: new In({ data: new Uint32Array([
3202
3202
  0,
3203
3203
  1,
3204
3204
  3,
@@ -3206,8 +3206,8 @@ var Vn = class extends Rn {
3206
3206
  ]) })
3207
3207
  });
3208
3208
  }
3209
- }, Hn;
3210
- function Un() {
3209
+ }, Un;
3210
+ function Wn() {
3211
3211
  return {
3212
3212
  projectionMatrix: new Float32Array([
3213
3213
  1,
@@ -3239,13 +3239,13 @@ function Un() {
3239
3239
  ])
3240
3240
  };
3241
3241
  }
3242
- var I = class extends T {
3242
+ var F = class extends w {
3243
3243
  static instance = new this();
3244
3244
  glProgram;
3245
3245
  constructor(e = {}) {
3246
3246
  super();
3247
3247
  let { uniforms: t, gl: n } = e;
3248
- t && (this.uniforms = t), this.glProgram = new Lt({
3248
+ t && (this.uniforms = t), this.glProgram = new Rt({
3249
3249
  vertex: "in vec2 position;\nuniform mat3 projectionMatrix;\nuniform mat3 modelViewMatrix;\nvoid main(void) {\n gl_Position = vec4((projectionMatrix * modelViewMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}",
3250
3250
  fragment: "uniform vec4 tint;\nvoid main(void) {\n gl_FragColor = tint;\n}",
3251
3251
  ...n
@@ -3258,13 +3258,13 @@ var I = class extends T {
3258
3258
  }, e.shader.updateUniforms(this);
3259
3259
  }
3260
3260
  };
3261
- k([_({ default: Un }), O("design:type", typeof (Hn = typeof Record < "u" && Record) == "function" ? Hn : Object)], I.prototype, "uniforms", void 0);
3261
+ O([_({ default: Wn }), D("design:type", typeof (Un = typeof Record < "u" && Record) == "function" ? Un : Object)], F.prototype, "uniforms", void 0);
3262
3262
  //#endregion
3263
3263
  //#region src/scene/resources/materials/EffectMaterial.ts
3264
- var Wn = /^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm, Gn = /vec(\d)\((.*)\)/;
3265
- function Kn(e) {
3264
+ var Gn = /^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm, Kn = /vec(\d)\((.*)\)/;
3265
+ function qn(e) {
3266
3266
  e = e.trim();
3267
- let t = e.match(Gn);
3267
+ let t = e.match(Kn);
3268
3268
  if (t) {
3269
3269
  let e = Array.from({ length: Number(t[1]) }, () => 0);
3270
3270
  return t[2].split(",").forEach((t, n) => {
@@ -3273,7 +3273,7 @@ function Kn(e) {
3273
3273
  }
3274
3274
  return Number(e);
3275
3275
  }
3276
- var qn = class e extends I {
3276
+ var Jn = class e extends F {
3277
3277
  static RE = {
3278
3278
  getColor: /\sgetColor\s*\(/,
3279
3279
  getFromColor: /\sgetFromColor\s*\(/,
@@ -3309,12 +3309,12 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3309
3309
  progress: 0
3310
3310
  }
3311
3311
  }), this.has = n;
3312
- let r = t.matchAll(Wn);
3312
+ let r = t.matchAll(Gn);
3313
3313
  for (let e of r) e[1] && e[2] && e[1].split(",").forEach((t) => {
3314
- this.uniforms[t.trim()] = Kn(e[2]);
3314
+ this.uniforms[t.trim()] = qn(e[2]);
3315
3315
  });
3316
3316
  }
3317
- }, Jn = class extends I {
3317
+ }, Yn = class extends F {
3318
3318
  static _instance;
3319
3319
  static get instance() {
3320
3320
  return this._instance ??= new this();
@@ -3358,20 +3358,20 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3358
3358
  }
3359
3359
  });
3360
3360
  }
3361
- }, L = class extends Rn {
3361
+ }, I = class extends zn {
3362
3362
  static _instance;
3363
3363
  static get instance() {
3364
3364
  return this._instance ??= new this();
3365
3365
  }
3366
- static draw(e, t = Jn.instance, n) {
3366
+ static draw(e, t = Yn.instance, n) {
3367
3367
  this.instance.draw(e, t, n);
3368
3368
  }
3369
3369
  constructor() {
3370
3370
  super({
3371
3371
  attributes: {
3372
- position: new F({
3372
+ position: new P({
3373
3373
  format: "float32x2",
3374
- buffer: new P({ data: new Float32Array([
3374
+ buffer: new N({ data: new Float32Array([
3375
3375
  -1,
3376
3376
  -1,
3377
3377
  1,
@@ -3382,9 +3382,9 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3382
3382
  1
3383
3383
  ]) })
3384
3384
  }),
3385
- uv: new F({
3385
+ uv: new P({
3386
3386
  format: "float32x2",
3387
- buffer: new P({ data: new Float32Array([
3387
+ buffer: new N({ data: new Float32Array([
3388
3388
  0,
3389
3389
  0,
3390
3390
  1,
@@ -3396,7 +3396,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3396
3396
  ]) })
3397
3397
  })
3398
3398
  },
3399
- indexBuffer: new Fn({ data: new Uint32Array([
3399
+ indexBuffer: new In({ data: new Uint32Array([
3400
3400
  0,
3401
3401
  1,
3402
3402
  2,
@@ -3406,27 +3406,27 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3406
3406
  ]) })
3407
3407
  });
3408
3408
  }
3409
- }, Yn = class extends Rn {
3409
+ }, Xn = class extends zn {
3410
3410
  positionBuffer;
3411
3411
  uvBuffer;
3412
3412
  constructor(e) {
3413
- let t = new P({ data: new Float32Array() }), n = new P({ data: new Float32Array() });
3413
+ let t = new N({ data: new Float32Array() }), n = new N({ data: new Float32Array() });
3414
3414
  super({
3415
3415
  ...e,
3416
3416
  attributes: {
3417
- position: new F({
3417
+ position: new P({
3418
3418
  format: "float32x2",
3419
3419
  buffer: t
3420
3420
  }),
3421
- uv: new F({
3421
+ uv: new P({
3422
3422
  format: "float32x2",
3423
3423
  buffer: n
3424
3424
  })
3425
3425
  },
3426
- indexBuffer: new Fn({ data: new Uint32Array() })
3426
+ indexBuffer: new In({ data: new Uint32Array() })
3427
3427
  }), this.positionBuffer = t, this.uvBuffer = n;
3428
3428
  }
3429
- }, R = class extends T {
3429
+ }, L = class extends w {
3430
3430
  get valid() {
3431
3431
  return !!(this.width && this.height);
3432
3432
  }
@@ -3440,10 +3440,10 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3440
3440
  super._destroy(), this.colorTextures.forEach((e) => e.destroy());
3441
3441
  }
3442
3442
  };
3443
- k([_({ fallback: !1 }), O("design:type", Boolean)], R.prototype, "isRoot", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "x", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "y", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "height", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "mipLevel", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], R.prototype, "msaa", void 0), k([_({ default: () => [new z()] }), O("design:type", Array)], R.prototype, "colorTextures", void 0);
3443
+ O([_({ fallback: !1 }), D("design:type", Boolean)], L.prototype, "isRoot", void 0), O([_({ fallback: 0 }), D("design:type", Number)], L.prototype, "x", void 0), O([_({ fallback: 0 }), D("design:type", Number)], L.prototype, "y", void 0), O([_({ fallback: 0 }), D("design:type", Number)], L.prototype, "width", void 0), O([_({ fallback: 0 }), D("design:type", Number)], L.prototype, "height", void 0), O([_({ fallback: 0 }), D("design:type", Number)], L.prototype, "mipLevel", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], L.prototype, "msaa", void 0), O([_({ default: () => [new R()] }), D("design:type", Array)], L.prototype, "colorTextures", void 0);
3444
3444
  //#endregion
3445
3445
  //#region src/scene/resources/textures/Texture2D.ts
3446
- var z = class extends T {
3446
+ var R = class extends w {
3447
3447
  static get EMPTY() {
3448
3448
  return new this({
3449
3449
  width: 1,
@@ -3554,10 +3554,10 @@ var z = class extends T {
3554
3554
  super._destroy(), ke && this.source instanceof ImageBitmap && this.source.close();
3555
3555
  }
3556
3556
  };
3557
- k([_({ fallback: "unknown" }), O("design:type", String)], z.prototype, "uploadMethodId", void 0), k([_({ internal: !0 }), O("design:type", Object)], z.prototype, "source", void 0), k([_({ fallback: 0 }), O("design:type", Number)], z.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], z.prototype, "height", void 0), k([_({ fallback: 1 }), O("design:type", Number)], z.prototype, "pixelRatio", void 0), k([_({ fallback: "bgra8unorm" }), O("design:type", Object)], z.prototype, "format", void 0), k([_({ fallback: "premultiply-alpha-on-upload" }), O("design:type", Object)], z.prototype, "alphaMode", void 0), k([_({ fallback: 1 }), O("design:type", Number)], z.prototype, "mipLevelCount", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], z.prototype, "mipmap", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeU", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeV", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeW", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "magFilter", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "minFilter", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "mipmapFilter", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], z.prototype, "isPowerOfTwo", void 0);
3557
+ O([_({ fallback: "unknown" }), D("design:type", String)], R.prototype, "uploadMethodId", void 0), O([_({ internal: !0 }), D("design:type", Object)], R.prototype, "source", void 0), O([_({ fallback: 0 }), D("design:type", Number)], R.prototype, "width", void 0), O([_({ fallback: 0 }), D("design:type", Number)], R.prototype, "height", void 0), O([_({ fallback: 1 }), D("design:type", Number)], R.prototype, "pixelRatio", void 0), O([_({ fallback: "bgra8unorm" }), D("design:type", Object)], R.prototype, "format", void 0), O([_({ fallback: "premultiply-alpha-on-upload" }), D("design:type", Object)], R.prototype, "alphaMode", void 0), O([_({ fallback: 1 }), D("design:type", Number)], R.prototype, "mipLevelCount", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], R.prototype, "mipmap", void 0), O([_({ fallback: "clamp-to-edge" }), D("design:type", Object)], R.prototype, "addressModeU", void 0), O([_({ fallback: "clamp-to-edge" }), D("design:type", Object)], R.prototype, "addressModeV", void 0), O([_({ fallback: "clamp-to-edge" }), D("design:type", Object)], R.prototype, "addressModeW", void 0), O([_({ fallback: "linear" }), D("design:type", Object)], R.prototype, "magFilter", void 0), O([_({ fallback: "linear" }), D("design:type", Object)], R.prototype, "minFilter", void 0), O([_({ fallback: "linear" }), D("design:type", Object)], R.prototype, "mipmapFilter", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], R.prototype, "isPowerOfTwo", void 0);
3558
3558
  //#endregion
3559
3559
  //#region src/scene/resources/textures/AnimatedTexture.ts
3560
- var Xn = class extends T {
3560
+ var Zn = class extends w {
3561
3561
  frames;
3562
3562
  frameIndex = 0;
3563
3563
  get currentFrame() {
@@ -3567,7 +3567,7 @@ var Xn = class extends T {
3567
3567
  super();
3568
3568
  let t;
3569
3569
  if (Array.isArray(e)) t = e;
3570
- else if (e instanceof z) t = [{
3570
+ else if (e instanceof R) t = [{
3571
3571
  texture: e,
3572
3572
  duration: 0
3573
3573
  }];
@@ -3582,7 +3582,7 @@ var Xn = class extends T {
3582
3582
  e.texture.destroy();
3583
3583
  });
3584
3584
  }
3585
- }, Zn = class extends z {
3585
+ }, Qn = class extends R {
3586
3586
  constructor(e = {}) {
3587
3587
  super({
3588
3588
  pixelRatio: 2,
@@ -3602,14 +3602,14 @@ var Xn = class extends T {
3602
3602
  }
3603
3603
  super._updateProperty(e, t, n);
3604
3604
  }
3605
- }, Qn = class e extends z {
3605
+ }, $n = class e extends R {
3606
3606
  static _cached = /* @__PURE__ */ new Map();
3607
3607
  static get(t) {
3608
- let n = new E(t), r = n.toHex(), i = this._cached.get(r);
3608
+ let n = new T(t), r = n.toHex(), i = this._cached.get(r);
3609
3609
  return i || (i = new e(n), this._cached.set(r, i)), i;
3610
3610
  }
3611
3611
  constructor(e) {
3612
- let t = e instanceof E ? e : new E(e);
3612
+ let t = e instanceof T ? e : new T(e);
3613
3613
  super({
3614
3614
  width: 1,
3615
3615
  height: 1,
@@ -3623,7 +3623,7 @@ var Xn = class extends T {
3623
3623
  mipmap: !0
3624
3624
  });
3625
3625
  }
3626
- }, $n = class e extends z {
3626
+ }, er = class e extends R {
3627
3627
  static test(e) {
3628
3628
  return u(e);
3629
3629
  }
@@ -3647,7 +3647,7 @@ var Xn = class extends T {
3647
3647
  constructor(t, n, r) {
3648
3648
  super(e.linearGradient(t, n, r));
3649
3649
  }
3650
- }, er = class extends z {
3650
+ }, tr = class extends R {
3651
3651
  constructor(e = {}) {
3652
3652
  super({
3653
3653
  ...e,
@@ -3657,7 +3657,7 @@ var Xn = class extends T {
3657
3657
  };
3658
3658
  //#endregion
3659
3659
  //#region src/scene/resources/textures/VideoTexture.ts
3660
- function tr(e) {
3660
+ function nr(e) {
3661
3661
  return {
3662
3662
  autoLoad: !!(e?.autoLoad ?? !0),
3663
3663
  autoPlay: !!(e?.autoPlay ?? !1),
@@ -3668,7 +3668,7 @@ function tr(e) {
3668
3668
  playsinline: !!(e?.playsinline ?? !0)
3669
3669
  };
3670
3670
  }
3671
- var nr = class e extends z {
3671
+ var rr = class e extends R {
3672
3672
  static mimeTypes = new Map(Object.entries({
3673
3673
  ogv: "video/ogg",
3674
3674
  mov: "video/quicktime",
@@ -3702,11 +3702,11 @@ var nr = class e extends z {
3702
3702
  _reject;
3703
3703
  _seekResolves = [];
3704
3704
  constructor(t, n) {
3705
- let r = tr(n);
3706
- if (!Ge(t)) {
3705
+ let r = nr(n);
3706
+ if (!Ke(t)) {
3707
3707
  typeof t == "string" && (t = [t]);
3708
3708
  let n = t[0].src || t[0], i = document.createElement("video");
3709
- r.autoLoad && i.setAttribute("preload", "auto"), r.playsinline && (i.setAttribute("webkit-playsinline", ""), i.setAttribute("playsinline", "")), r.muted && (i.setAttribute("muted", ""), i.muted = !0), r.loop && i.setAttribute("loop", ""), r.autoPlay && i.setAttribute("autoplay", ""), Ze(i, n, r.crossorigin);
3709
+ r.autoLoad && i.setAttribute("preload", "auto"), r.playsinline && (i.setAttribute("webkit-playsinline", ""), i.setAttribute("playsinline", "")), r.muted && (i.setAttribute("muted", ""), i.muted = !0), r.loop && i.setAttribute("loop", ""), r.autoPlay && i.setAttribute("autoplay", ""), Qe(i, n, r.crossorigin);
3710
3710
  for (let n = 0; n < t.length; ++n) {
3711
3711
  let { src: r, mime: a } = t[n];
3712
3712
  if (r ||= t[n], r.startsWith("data:")) a = r.slice(5, r.indexOf(";"));
@@ -3793,16 +3793,16 @@ var nr = class e extends z {
3793
3793
  e && (e.removeEventListener("play", this._onPlayStart), e.removeEventListener("pause", this._onPlayStop), e.removeEventListener("seeked", this._onSeeked), e.removeEventListener("canplay", this._onCanPlay), e.removeEventListener("canplaythrough", this._onCanPlay), e.removeEventListener("error", this._onError, !0), e.pause(), e.src = "", e.load());
3794
3794
  }
3795
3795
  };
3796
- k([_({
3796
+ O([_({
3797
3797
  internal: !0,
3798
3798
  fallback: !0
3799
- }), O("design:type", Boolean)], nr.prototype, "autoUpdate", void 0), k([_({
3799
+ }), D("design:type", Boolean)], rr.prototype, "autoUpdate", void 0), O([_({
3800
3800
  internal: !0,
3801
3801
  fallback: 0
3802
- }), O("design:type", Number)], nr.prototype, "fps", void 0);
3802
+ }), D("design:type", Number)], rr.prototype, "fps", void 0);
3803
3803
  //#endregion
3804
3804
  //#region src/scene/resources/textures/ViewportTexture.ts
3805
- var rr = class extends z {}, ir = class extends oe {
3805
+ var ir = class extends R {}, ar = class extends oe {
3806
3806
  fillStyle;
3807
3807
  strokeStyle;
3808
3808
  strokeAlignment;
@@ -3814,7 +3814,7 @@ var rr = class extends z {}, ir = class extends oe {
3814
3814
  transformVertex;
3815
3815
  _draws = [];
3816
3816
  _parseDrawStyle(e) {
3817
- return e ? e instanceof z ? { texture: e } : { texture: Qn.get(e) } : {};
3817
+ return e ? e instanceof R ? { texture: e } : { texture: $n.get(e) } : {};
3818
3818
  }
3819
3819
  stroke(e) {
3820
3820
  if (!this.curves.length) return;
@@ -3902,7 +3902,7 @@ var rr = class extends z {}, ir = class extends oe {
3902
3902
  destroy() {
3903
3903
  this.reset();
3904
3904
  }
3905
- }, ar = class {
3905
+ }, or = class {
3906
3906
  front = [];
3907
3907
  default = [];
3908
3908
  back = [];
@@ -3945,7 +3945,7 @@ var rr = class extends z {}, ir = class extends oe {
3945
3945
  toJSON() {
3946
3946
  return [...this.default];
3947
3947
  }
3948
- }, or = class extends w {
3948
+ }, sr = class extends C {
3949
3949
  parent;
3950
3950
  getPropertyDeclarations() {
3951
3951
  super.getPropertyDeclarations();
@@ -3964,22 +3964,22 @@ var rr = class extends z {}, ir = class extends oe {
3964
3964
  deleteProperty: (e, t) => Reflect.has(e, t) || String(t).startsWith("_") ? Reflect.deleteProperty(e, t) : (e.setProperty(String(t), void 0), !0)
3965
3965
  });
3966
3966
  }
3967
- }, sr, cr, lr = {};
3968
- function ur(e) {
3969
- let t = lr[e] ?? 0;
3970
- return t++, lr[e] = t, t;
3967
+ }, cr, lr, ur = {};
3968
+ function dr(e) {
3969
+ let t = ur[e] ?? 0;
3970
+ return t++, ur[e] = t, t;
3971
3971
  }
3972
- var B = cr = class extends w {
3972
+ var z = lr = class extends C {
3973
3973
  static parse(e, t = "Node") {
3974
3974
  if (Array.isArray(e)) return e.map((e) => this.parse(e));
3975
- let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((me.get(n ?? r.inCanvasIs ?? t)) ?? cr)({
3975
+ let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((me.get(n ?? r.inCanvasIs ?? t)) ?? lr)({
3976
3976
  ...a,
3977
3977
  meta: r
3978
3978
  });
3979
3979
  return i?.forEach((e) => o.appendChild(this.parse(e))), o;
3980
3980
  }
3981
3981
  _mask;
3982
- _meta = new or(this);
3982
+ _meta = new sr(this);
3983
3983
  get meta() {
3984
3984
  return this._meta;
3985
3985
  }
@@ -4002,7 +4002,7 @@ var B = cr = class extends w {
4002
4002
  }).append(t), this.on("treeEnter", this._onTreeEnter).on("treeExit", this._onTreeExit).on("parented", this._onParented).on("unparented", this._onUnparented).on("ready", this._onReady).on("process", this._onProcess), this.updateProcessable(), this.updateRenderable();
4003
4003
  }
4004
4004
  _defaultName() {
4005
- return `@${this.is}@${ur(this.is)}`;
4005
+ return `@${this.is}@${dr(this.is)}`;
4006
4006
  }
4007
4007
  setProperties(e) {
4008
4008
  if (e) {
@@ -4069,7 +4069,7 @@ var B = cr = class extends w {
4069
4069
  }
4070
4070
  return this;
4071
4071
  }
4072
- _children = new ar();
4072
+ _children = new or();
4073
4073
  get children() {
4074
4074
  return this._children.default;
4075
4075
  }
@@ -4226,7 +4226,7 @@ var B = cr = class extends w {
4226
4226
  append(...e) {
4227
4227
  let t;
4228
4228
  t = Array.isArray(e[0]) ? e[0] : e, t.forEach((e) => {
4229
- e instanceof cr ? this.appendChild(e) : this.appendChild(cr.parse(e));
4229
+ e instanceof lr ? this.appendChild(e) : this.appendChild(lr.parse(e));
4230
4230
  });
4231
4231
  }
4232
4232
  before(...e) {
@@ -4329,13 +4329,13 @@ var B = cr = class extends w {
4329
4329
  });
4330
4330
  }
4331
4331
  };
4332
- k([_({ default: () => c() }), O("design:type", String)], B.prototype, "id", void 0), k([_({ default: () => c() }), O("design:type", String)], B.prototype, "name", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "processMode", void 0), k([_({ fallback: "default" }), O("design:type", Object)], B.prototype, "processSortMode", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "renderMode", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "inputMode", void 0), k([_({ fallback: "default" }), O("design:type", Object)], B.prototype, "internalMode", void 0), k([_({
4332
+ O([_({ default: () => c() }), D("design:type", String)], z.prototype, "id", void 0), O([_({ default: () => c() }), D("design:type", String)], z.prototype, "name", void 0), O([_({ fallback: "inherit" }), D("design:type", Object)], z.prototype, "processMode", void 0), O([_({ fallback: "default" }), D("design:type", Object)], z.prototype, "processSortMode", void 0), O([_({ fallback: "inherit" }), D("design:type", Object)], z.prototype, "renderMode", void 0), O([_({ fallback: "inherit" }), D("design:type", Object)], z.prototype, "inputMode", void 0), O([_({ fallback: "default" }), D("design:type", Object)], z.prototype, "internalMode", void 0), O([_({
4333
4333
  internal: !0,
4334
4334
  default: !0
4335
- }), O("design:type", Boolean)], B.prototype, "needsRender", void 0), B = cr = k([x("Node"), O("design:paramtypes", [typeof (sr = typeof Partial < "u" && Partial) == "function" ? sr : Object, Array])], B);
4335
+ }), D("design:type", Boolean)], z.prototype, "needsRender", void 0), z = lr = O([x("Node"), D("design:paramtypes", [typeof (cr = typeof Partial < "u" && Partial) == "function" ? cr : Object, Array])], z);
4336
4336
  //#endregion
4337
4337
  //#region src/scene/main/TimelineNode.ts
4338
- var dr, V = class extends B {
4338
+ var fr, B = class extends z {
4339
4339
  insideTimeRange = !1;
4340
4340
  get _timeline() {
4341
4341
  return this._tree?.timeline;
@@ -4366,7 +4366,7 @@ var dr, V = class extends B {
4366
4366
  return this._globalStartTime + this._globalDuration;
4367
4367
  }
4368
4368
  get currentTimeProgress() {
4369
- return this._duration ? dt(this._currentTime / this._duration, 0, 1) : 0;
4369
+ return this._duration ? ft(this._currentTime / this._duration, 0, 1) : 0;
4370
4370
  }
4371
4371
  isInsideTimeRange() {
4372
4372
  let e = this._currentTime;
@@ -4406,10 +4406,10 @@ var dr, V = class extends B {
4406
4406
  super._process(e), this._updateCurrentTime();
4407
4407
  }
4408
4408
  };
4409
- k([_({ fallback: !1 }), O("design:type", Boolean)], V.prototype, "loop", void 0), k([_({ fallback: 0 }), O("design:type", Number)], V.prototype, "delay", void 0), k([_({ fallback: 0 }), O("design:type", Number)], V.prototype, "duration", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], V.prototype, "paused", void 0), V = k([x("TimelineNode"), O("design:paramtypes", [typeof (dr = typeof Partial < "u" && Partial) == "function" ? dr : Object, Array])], V);
4409
+ O([_({ fallback: !1 }), D("design:type", Boolean)], B.prototype, "loop", void 0), O([_({ fallback: 0 }), D("design:type", Number)], B.prototype, "delay", void 0), O([_({ fallback: 0 }), D("design:type", Number)], B.prototype, "duration", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], B.prototype, "paused", void 0), B = O([x("TimelineNode"), D("design:paramtypes", [typeof (fr = typeof Partial < "u" && Partial) == "function" ? fr : Object, Array])], B);
4410
4410
  //#endregion
4411
4411
  //#region src/scene/main/CanvasItem.ts
4412
- var fr, pr = class extends V {
4412
+ var pr, mr = class extends B {
4413
4413
  _blendMode;
4414
4414
  _parentGlobalVisible;
4415
4415
  _globalVisible;
@@ -4427,7 +4427,7 @@ var fr, pr = class extends V {
4427
4427
  255,
4428
4428
  255
4429
4429
  ];
4430
- context = new ir();
4430
+ context = new ar();
4431
4431
  _resetContext = !0;
4432
4432
  needsDraw = !0;
4433
4433
  needsLayout = !1;
@@ -4489,7 +4489,7 @@ var fr, pr = class extends V {
4489
4489
  }
4490
4490
  _updateGlobalOpacity() {
4491
4491
  this._parentGlobalOpacity = this.getParent()?.opacity;
4492
- let e = dt(this.opacity, 0, 1) * (this._parentGlobalOpacity ?? 1);
4492
+ let e = ft(this.opacity, 0, 1) * (this._parentGlobalOpacity ?? 1);
4493
4493
  this._globalOpacity !== e && (this._globalOpacity = e, this._updateModulate(), this.requestPaint(), this.updateRenderable());
4494
4494
  }
4495
4495
  _draw() {
@@ -4554,7 +4554,7 @@ var fr, pr = class extends V {
4554
4554
  _render(e) {
4555
4555
  this._updateBatchables();
4556
4556
  let t = this._tree?.pixelate, n = this._tree?.roundPixels, r = this._batchables;
4557
- for (let i, a, o = r.length, s = 0; s < o; s++) i = r[s], a = i.texture, a instanceof rr && (a = this._handleViewportTexture(i)), e.batch2D.render({
4557
+ for (let i, a, o = r.length, s = 0; s < o; s++) i = r[s], a = i.texture, a instanceof ir && (a = this._handleViewportTexture(i)), e.batch2D.render({
4558
4558
  ...i,
4559
4559
  roundPixels: n,
4560
4560
  size: t ? i.size : void 0,
@@ -4566,19 +4566,19 @@ var fr, pr = class extends V {
4566
4566
  super._destroy(), this.context.destroy(), this._drawBatchables = [], this._layoutBatchables = [], this._batchables = [];
4567
4567
  }
4568
4568
  };
4569
- k([_(), O("design:type", Object)], pr.prototype, "blendMode", void 0), k([_({
4569
+ O([_(), D("design:type", Object)], mr.prototype, "blendMode", void 0), O([_({
4570
4570
  internal: !0,
4571
4571
  fallback: !0
4572
- }), O("design:type", Boolean)], pr.prototype, "visible", void 0), k([_({
4572
+ }), D("design:type", Boolean)], mr.prototype, "visible", void 0), O([_({
4573
4573
  internal: !0,
4574
4574
  fallback: 1
4575
- }), O("design:type", Number)], pr.prototype, "opacity", void 0), pr = k([x("CanvasItem"), O("design:paramtypes", [typeof (fr = typeof Partial < "u" && Partial) == "function" ? fr : Object, Array])], pr);
4575
+ }), D("design:type", Number)], mr.prototype, "opacity", void 0), mr = O([x("CanvasItem"), D("design:paramtypes", [typeof (pr = typeof Partial < "u" && Partial) == "function" ? pr : Object, Array])], mr);
4576
4576
  //#endregion
4577
4577
  //#region src/scene/main/Viewport.ts
4578
- var H = class extends B {
4578
+ var V = class extends z {
4579
4579
  canvasTransform = new v();
4580
4580
  renderTargetIndex = 0;
4581
- renderTargets = [new R(), new R()];
4581
+ renderTargets = [new L(), new L()];
4582
4582
  get valid() {
4583
4583
  return !!(this.width && this.height);
4584
4584
  }
@@ -4625,7 +4625,7 @@ var H = class extends B {
4625
4625
  return !1;
4626
4626
  }
4627
4627
  activateWithCopy(e, t) {
4628
- this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), L.draw(e, Jn.instance, { sampler: 0 }));
4628
+ this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), I.draw(e, Yn.instance, { sampler: 0 }));
4629
4629
  }
4630
4630
  renderStart(e, t) {
4631
4631
  this.activate(e, t) && e.clear();
@@ -4638,7 +4638,7 @@ var H = class extends B {
4638
4638
  this.renderStart(e), super.render(e, t), this.renderEnd(e, n);
4639
4639
  }
4640
4640
  getRect() {
4641
- return new ct(this.x, this.y, this.width, this.height);
4641
+ return new lt(this.x, this.y, this.width, this.height);
4642
4642
  }
4643
4643
  toCanvasGlobal(e, t) {
4644
4644
  return this.canvasTransform.applyAffineInverse(e, t);
@@ -4650,16 +4650,16 @@ var H = class extends B {
4650
4650
  super._destroy(), this.canvasTransform.destroy(), this.renderTargets.forEach((e) => e.destroy());
4651
4651
  }
4652
4652
  };
4653
- k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "x", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "y", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "height", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "mipLevel", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], H.prototype, "msaa", void 0), H = k([x("Viewport")], H);
4653
+ O([_({ fallback: 0 }), D("design:type", Number)], V.prototype, "x", void 0), O([_({ fallback: 0 }), D("design:type", Number)], V.prototype, "y", void 0), O([_({ fallback: 0 }), D("design:type", Number)], V.prototype, "width", void 0), O([_({ fallback: 0 }), D("design:type", Number)], V.prototype, "height", void 0), O([_({ fallback: 0 }), D("design:type", Number)], V.prototype, "mipLevel", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], V.prototype, "msaa", void 0), V = O([x("Viewport")], V);
4654
4654
  //#endregion
4655
4655
  //#region src/scene/main/Effect.ts
4656
- var mr, U = class extends V {
4656
+ var hr, H = class extends B {
4657
4657
  material;
4658
4658
  get _effectMode() {
4659
4659
  return this.effectMode ?? "parent";
4660
4660
  }
4661
- viewport1 = new H();
4662
- viewport2 = new H();
4661
+ viewport1 = new V();
4662
+ viewport2 = new V();
4663
4663
  _renderId = 0;
4664
4664
  _renderViewport;
4665
4665
  _previousSibling;
@@ -4676,7 +4676,7 @@ var mr, U = class extends V {
4676
4676
  _updateProperty(e, t, n) {
4677
4677
  switch (super._updateProperty(e, t, n), e) {
4678
4678
  case "glsl": {
4679
- let e = new qn(t);
4679
+ let e = new Jn(t);
4680
4680
  !this.effectMode && e.has.transition && (this.effectMode = "transition"), this.material = e;
4681
4681
  break;
4682
4682
  }
@@ -4711,7 +4711,7 @@ var mr, U = class extends V {
4711
4711
  }
4712
4712
  }
4713
4713
  getRect() {
4714
- return new ct(this._rect);
4714
+ return new lt(this._rect);
4715
4715
  }
4716
4716
  _processParent() {
4717
4717
  let e = this._tree?.renderStack;
@@ -4864,13 +4864,13 @@ var mr, U = class extends V {
4864
4864
  }
4865
4865
  apply(e, t, n) {
4866
4866
  this.material && (n?.redraw ? t.redraw(e, () => {
4867
- L.draw(e, this.material, {
4867
+ I.draw(e, this.material, {
4868
4868
  from: 0,
4869
4869
  to: 1,
4870
4870
  progress: this.currentTimeProgress,
4871
4871
  ratio: t.width / t.height
4872
4872
  });
4873
- }) : L.draw(e, this.material, {
4873
+ }) : I.draw(e, this.material, {
4874
4874
  from: 0,
4875
4875
  to: 1,
4876
4876
  progress: this.currentTimeProgress,
@@ -4881,10 +4881,10 @@ var mr, U = class extends V {
4881
4881
  super._destroy(), this.viewport1.destroy(), this.viewport2.destroy();
4882
4882
  }
4883
4883
  };
4884
- k([_({ internal: !0 }), O("design:type", Object)], U.prototype, "material", void 0), k([_(), O("design:type", Object)], U.prototype, "effectMode", void 0), k([_(), O("design:type", String)], U.prototype, "glsl", void 0), k([_(), O("design:type", String)], U.prototype, "glslSrc", void 0), U = k([x("Effect"), O("design:paramtypes", [typeof (mr = typeof Partial < "u" && Partial) == "function" ? mr : Object, Array])], U);
4884
+ O([_({ internal: !0 }), D("design:type", Object)], H.prototype, "material", void 0), O([_(), D("design:type", Object)], H.prototype, "effectMode", void 0), O([_(), D("design:type", String)], H.prototype, "glsl", void 0), O([_(), D("design:type", String)], H.prototype, "glslSrc", void 0), H = O([x("Effect"), D("design:paramtypes", [typeof (hr = typeof Partial < "u" && Partial) == "function" ? hr : Object, Array])], H);
4885
4885
  //#endregion
4886
4886
  //#region src/scene/main/RenderStack.ts
4887
- var hr = class {
4887
+ var gr = class {
4888
4888
  currentCall;
4889
4889
  calls = [];
4890
4890
  createCall(e) {
@@ -4906,11 +4906,11 @@ var hr = class {
4906
4906
  });
4907
4907
  }), this.calls = [];
4908
4908
  }
4909
- }, gr, _r, vr = _r = class extends B {
4909
+ }, _r, vr, yr = vr = class extends z {
4910
4910
  currentTime = 0;
4911
4911
  static from(e, t = !1) {
4912
4912
  let [n, r] = e ? Array.isArray(e) ? e : [0, e] : [];
4913
- return new _r({
4913
+ return new vr({
4914
4914
  startTime: n,
4915
4915
  endTime: r,
4916
4916
  loop: t
@@ -4928,16 +4928,16 @@ var hr = class {
4928
4928
  }
4929
4929
  addTime(e) {
4930
4930
  let t = this.endTime, n = Math.min(this.startTime, this.endTime), r = this.currentTime;
4931
- return r += e, this.loop && r > t && (r = n + r % t), r = dt(r, n, t), this.currentTime = r, this.emit("updateCurrentTime", r, e), this;
4931
+ return r += e, this.loop && r > t && (r = n + r % t), r = ft(r, n, t), this.currentTime = r, this.emit("updateCurrentTime", r, e), this;
4932
4932
  }
4933
4933
  _process(e) {
4934
4934
  super._process(e), this.paused || this.addTime(e);
4935
4935
  }
4936
4936
  };
4937
- k([_({ fallback: 0 }), O("design:type", Number)], vr.prototype, "startTime", void 0), k([_({ fallback: 2 ** 53 - 1 }), O("design:type", Number)], vr.prototype, "endTime", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], vr.prototype, "loop", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], vr.prototype, "paused", void 0), vr = _r = k([x("Timeline"), O("design:paramtypes", [typeof (gr = typeof Partial < "u" && Partial) == "function" ? gr : Object])], vr);
4937
+ O([_({ fallback: 0 }), D("design:type", Number)], yr.prototype, "startTime", void 0), O([_({ fallback: 2 ** 53 - 1 }), D("design:type", Number)], yr.prototype, "endTime", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], yr.prototype, "loop", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], yr.prototype, "paused", void 0), yr = vr = O([x("Timeline"), D("design:paramtypes", [typeof (_r = typeof Partial < "u" && Partial) == "function" ? _r : Object])], yr);
4938
4938
  //#endregion
4939
4939
  //#region src/scene/main/Window.ts
4940
- var yr = class extends H {
4940
+ var br = class extends V {
4941
4941
  constructor() {
4942
4942
  super(), this.renderTargets.forEach((e) => e.isRoot = !0);
4943
4943
  }
@@ -4948,19 +4948,19 @@ var yr = class extends H {
4948
4948
  super.flush(e), this.finish(e);
4949
4949
  }
4950
4950
  };
4951
- yr = k([x("Window", {
4951
+ br = O([x("Window", {
4952
4952
  processMode: "always",
4953
4953
  renderMode: "always"
4954
- }), O("design:paramtypes", [])], yr);
4954
+ }), D("design:paramtypes", [])], br);
4955
4955
  //#endregion
4956
4956
  //#region src/scene/main/SceneTree.ts
4957
- var br = class extends ht {
4958
- input = new ot();
4959
- renderStack = new hr();
4960
- root = new yr().setTree(this);
4961
- timeline = new vr().setTree(this);
4957
+ var U = class extends gt {
4958
+ input = new st();
4959
+ renderStack = new gr();
4960
+ root = new br().setTree(this);
4961
+ timeline = new yr().setTree(this);
4962
4962
  nodeMap = /* @__PURE__ */ new Map();
4963
- _backgroundColor = new E();
4963
+ _backgroundColor = new T();
4964
4964
  _previousViewport;
4965
4965
  _currentViewport;
4966
4966
  getPreviousViewport() {
@@ -5004,36 +5004,36 @@ var br = class extends ht {
5004
5004
  _renderScreen(e) {
5005
5005
  this.root.finish(e), e.state.reset(), e.renderTarget.unbind(), this.backgroundColor && e.gl.clearColor(...this._backgroundColor.toArray()), e.clear(), this.backgroundColor && e.gl.clearColor(0, 0, 0, 0);
5006
5006
  let t = this.root.texture;
5007
- t.activate(e, 0), L.draw(e), t.inactivate(e);
5007
+ t.activate(e, 0), I.draw(e), t.inactivate(e);
5008
5008
  }
5009
5009
  _destroy() {
5010
5010
  super._destroy(), this.root.destroy(), this.input.destroy(), this.nodeMap.clear();
5011
5011
  }
5012
5012
  };
5013
- k([_({ alias: "root.msaa" }), O("design:type", Boolean)], br.prototype, "msaa", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], br.prototype, "pixelate", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], br.prototype, "roundPixels", void 0), k([_(), O("design:type", Object)], br.prototype, "backgroundColor", void 0), k([_({
5013
+ O([_({ alias: "root.msaa" }), D("design:type", Boolean)], U.prototype, "msaa", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], U.prototype, "pixelate", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], U.prototype, "roundPixels", void 0), O([_(), D("design:type", Object)], U.prototype, "backgroundColor", void 0), O([_({
5014
5014
  internal: !0,
5015
5015
  fallback: !1
5016
- }), O("design:type", Boolean)], br.prototype, "debug", void 0), k([_({
5016
+ }), D("design:type", Boolean)], U.prototype, "debug", void 0), O([_({
5017
5017
  internal: !0,
5018
5018
  fallback: !1
5019
- }), O("design:type", Boolean)], br.prototype, "processPaused", void 0), k([_({
5019
+ }), D("design:type", Boolean)], U.prototype, "processPaused", void 0), O([_({
5020
5020
  internal: !0,
5021
5021
  default: () => de
5022
- }), O("design:type", Object)], br.prototype, "fonts", void 0);
5022
+ }), D("design:type", Object)], U.prototype, "fonts", void 0);
5023
5023
  //#endregion
5024
5024
  //#region src/scene/main/Transition.ts
5025
- var xr, Sr = class extends U {
5025
+ var xr, Sr = class extends H {
5026
5026
  constructor(e, t = []) {
5027
5027
  super(), this.setProperties(e).append(t);
5028
5028
  }
5029
5029
  };
5030
- Sr = k([x("Transition", {
5030
+ Sr = O([x("Transition", {
5031
5031
  effectMode: "transition",
5032
5032
  duration: 2e3
5033
- }), O("design:paramtypes", [typeof (xr = typeof Partial < "u" && Partial) == "function" ? xr : Object, Array])], Sr);
5033
+ }), D("design:paramtypes", [typeof (xr = typeof Partial < "u" && Partial) == "function" ? xr : Object, Array])], Sr);
5034
5034
  //#endregion
5035
5035
  //#region src/scene/2d/Node2D.ts
5036
- var Cr, wr = class extends pr {
5036
+ var Cr, wr = class extends mr {
5037
5037
  rotation = 0;
5038
5038
  position = new y(0, 0, () => this.updateGlobalTransform());
5039
5039
  scale = new y(1, 1, () => this.updateGlobalTransform());
@@ -5085,7 +5085,7 @@ var Cr, wr = class extends pr {
5085
5085
  super._destroy(), this.position.destroy(), this.scale.destroy(), this.skew.destroy(), this.pivot.destroy(), this.extraTransform.destroy(), this.transform.destroy(), this.globalPosition.destroy(), this.globalScale.destroy(), this.globalSkew.destroy(), this.globalTransform.destroy();
5086
5086
  }
5087
5087
  };
5088
- wr = k([x("Node2D"), O("design:paramtypes", [typeof (Cr = typeof Partial < "u" && Partial) == "function" ? Cr : Object, Array])], wr);
5088
+ wr = O([x("Node2D"), D("design:paramtypes", [typeof (Cr = typeof Partial < "u" && Partial) == "function" ? Cr : Object, Array])], wr);
5089
5089
  //#endregion
5090
5090
  //#region src/scene/2d/Camera2D.ts
5091
5091
  var Tr, Er = class extends wr {
@@ -5129,7 +5129,7 @@ var Tr, Er = class extends wr {
5129
5129
  return this.setZoom(this._zoom.x + e, this._zoom.y + t);
5130
5130
  }
5131
5131
  setZoom(e, t = e) {
5132
- return this._zoom.set(dt(e, this._minZoom.x, this._maxZoom.x), dt(t, this._minZoom.y, this._maxZoom.y)), this;
5132
+ return this._zoom.set(ft(e, this._minZoom.x, this._maxZoom.x), ft(t, this._minZoom.y, this._maxZoom.y)), this;
5133
5133
  }
5134
5134
  setZoomAtOrigin(e, t, n) {
5135
5135
  let r;
@@ -5202,7 +5202,7 @@ var Tr, Er = class extends wr {
5202
5202
  });
5203
5203
  }
5204
5204
  _getZoomByWheel(e, t) {
5205
- let n = e.ctrlKey && He ? 10 : 1, r = -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * n, i = Math.log(t) + r;
5205
+ let n = e.ctrlKey && Ue ? 10 : 1, r = -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * n, i = Math.log(t) + r;
5206
5206
  return Math.round(Math.exp(i) * 1e4) / 1e4;
5207
5207
  }
5208
5208
  _updateTransform() {
@@ -5232,19 +5232,104 @@ var Tr, Er = class extends wr {
5232
5232
  };
5233
5233
  }
5234
5234
  };
5235
- k([_({
5235
+ O([_({
5236
5236
  internal: !0,
5237
5237
  fallback: !1
5238
- }), O("design:type", Boolean)], Er.prototype, "spaceKey", void 0), k([_({
5238
+ }), D("design:type", Boolean)], Er.prototype, "spaceKey", void 0), O([_({
5239
5239
  internal: !0,
5240
5240
  fallback: !1
5241
- }), O("design:type", Boolean)], Er.prototype, "grabbing", void 0), Er = k([x("Camera2D", {
5241
+ }), D("design:type", Boolean)], Er.prototype, "grabbing", void 0), Er = O([x("Camera2D", {
5242
5242
  processMode: "disabled",
5243
5243
  renderMode: "disabled"
5244
- }), O("design:paramtypes", [typeof (Tr = typeof Partial < "u" && Partial) == "function" ? Tr : Object, Array])], Er);
5244
+ }), D("design:paramtypes", [typeof (Tr = typeof Partial < "u" && Partial) == "function" ? Tr : Object, Array])], Er);
5245
+ //#endregion
5246
+ //#region src/scene/2d/element/connectionRouter.ts
5247
+ function Dr(e, t) {
5248
+ return Math.abs(e) >= Math.abs(t) ? {
5249
+ x: Math.sign(e) || 1,
5250
+ y: 0
5251
+ } : {
5252
+ x: 0,
5253
+ y: Math.sign(t) || 1
5254
+ };
5255
+ }
5256
+ function Or(e, t, n, r = {}) {
5257
+ let i = t.point, a = n.point, o = new oe();
5258
+ switch (e) {
5259
+ case "curved": {
5260
+ let e = t.dir ?? Dr(a.x - i.x, a.y - i.y), s = n.dir ?? Dr(i.x - a.x, i.y - a.y), c = Math.hypot(a.x - i.x, a.y - i.y), l = Math.max((r.stub ?? 16) * 2, c * .4), u = i.x + e.x * l, d = i.y + e.y * l, f = a.x + s.x * l, p = a.y + s.y * l;
5261
+ for (let e = 0; e <= 32; e++) {
5262
+ let t = e / 32, n = 1 - t, r = n * n * n, s = 3 * n * n * t, c = 3 * n * t * t, l = t * t * t, m = r * i.x + s * u + c * f + l * a.x, h = r * i.y + s * d + c * p + l * a.y;
5263
+ e === 0 ? o.moveTo(m, h) : o.lineTo(m, h);
5264
+ }
5265
+ break;
5266
+ }
5267
+ case "orthogonal": {
5268
+ let e = Ar(t, n, r);
5269
+ for (let t = 0; t < e.length; t++) t === 0 ? o.moveTo(e[t].x, e[t].y) : o.lineTo(e[t].x, e[t].y);
5270
+ break;
5271
+ }
5272
+ default:
5273
+ o.moveTo(i.x, i.y).lineTo(a.x, a.y);
5274
+ break;
5275
+ }
5276
+ return o;
5277
+ }
5278
+ function kr(e) {
5279
+ return Dr(e.x, e.y);
5280
+ }
5281
+ function Ar(e, t, n) {
5282
+ let r = e.point, i = t.point, a = n.stub ?? 16, o = kr(e.dir ?? Dr(i.x - r.x, i.y - r.y)), s = kr(t.dir ?? Dr(r.x - i.x, r.y - i.y)), c = {
5283
+ x: r.x + o.x * a,
5284
+ y: r.y + o.y * a
5285
+ }, l = {
5286
+ x: i.x + s.x * a,
5287
+ y: i.y + s.y * a
5288
+ }, u = [{
5289
+ x: r.x,
5290
+ y: r.y
5291
+ }, c], d = o.y === 0, f = s.y === 0;
5292
+ if (d && f) {
5293
+ let e = (c.x + l.x) / 2;
5294
+ u.push({
5295
+ x: e,
5296
+ y: c.y
5297
+ }, {
5298
+ x: e,
5299
+ y: l.y
5300
+ });
5301
+ } else if (!d && !f) {
5302
+ let e = (c.y + l.y) / 2;
5303
+ u.push({
5304
+ x: c.x,
5305
+ y: e
5306
+ }, {
5307
+ x: l.x,
5308
+ y: e
5309
+ });
5310
+ } else d ? u.push({
5311
+ x: l.x,
5312
+ y: c.y
5313
+ }) : u.push({
5314
+ x: c.x,
5315
+ y: l.y
5316
+ });
5317
+ return u.push(l, {
5318
+ x: i.x,
5319
+ y: i.y
5320
+ }), jr(u);
5321
+ }
5322
+ function jr(e) {
5323
+ let t = [];
5324
+ for (let n = 0; n < e.length; n++) {
5325
+ let r = e[n], i = t[t.length - 1];
5326
+ (!i || Math.abs(i.x - r.x) > .001 || Math.abs(i.y - r.y) > .001) && t.push(r);
5327
+ }
5328
+ return t;
5329
+ }
5245
5330
  //#endregion
5246
5331
  //#region src/css/parseCssFilter.ts
5247
- var Dr = {
5332
+ var Mr = {
5248
5333
  brightness: 1,
5249
5334
  contrast: 1,
5250
5335
  grayscale: 0,
@@ -5254,12 +5339,12 @@ var Dr = {
5254
5339
  saturate: 1,
5255
5340
  sepia: 0
5256
5341
  };
5257
- function Or(e) {
5258
- let t = new ft();
5342
+ function Nr(e) {
5343
+ let t = new pt();
5259
5344
  if (e === "none") return t;
5260
5345
  let n = Te(e).reduce((e, { name: t, args: n }) => (e[t] = n[0].normalizedIntValue, e), {});
5261
- Object.keys(Dr).forEach((e) => {
5262
- n[e] = n[e] ?? Dr[e];
5346
+ Object.keys(Mr).forEach((e) => {
5347
+ n[e] = n[e] ?? Mr[e];
5263
5348
  });
5264
5349
  for (let e in n) {
5265
5350
  let r = n[e];
@@ -5294,7 +5379,7 @@ function Or(e) {
5294
5379
  }
5295
5380
  //#endregion
5296
5381
  //#region src/css/parseCssTransformOrigin.ts
5297
- function kr(e) {
5382
+ function Pr(e) {
5298
5383
  let [t, n = t] = e.split(" ");
5299
5384
  return [t, n].map((e) => {
5300
5385
  switch (e = e.trim(), e) {
@@ -5309,11 +5394,11 @@ function kr(e) {
5309
5394
  }
5310
5395
  //#endregion
5311
5396
  //#region src/scene/effects/ColorAdjustEffect.ts
5312
- var Ar, jr, W = class extends U {
5397
+ var Fr, Ir, W = class extends H {
5313
5398
  static {
5314
- jr = this;
5399
+ Ir = this;
5315
5400
  }
5316
- static material = new I({ gl: {
5401
+ static material = new F({ gl: {
5317
5402
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5318
5403
  fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform float gamma;\nuniform float contrast;\nuniform float saturation;\nuniform float brightness;\nuniform float red;\nuniform float green;\nuniform float blue;\nuniform float alpha;\n\nvoid main(void) {\n vec4 c = texture2D(sampler, vUv);\n if (c.a > 0.0) {\n c.rgb /= c.a;\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n c.rgb *= c.a;\n }\n gl_FragColor = c * alpha;\n}"
5319
5404
  } });
@@ -5322,7 +5407,7 @@ var Ar, jr, W = class extends U {
5322
5407
  }
5323
5408
  apply(e, t) {
5324
5409
  t.redraw(e, () => {
5325
- L.draw(e, jr.material, {
5410
+ I.draw(e, Ir.material, {
5326
5411
  sampler: 0,
5327
5412
  saturation: this.saturation,
5328
5413
  contrast: this.contrast,
@@ -5336,18 +5421,18 @@ var Ar, jr, W = class extends U {
5336
5421
  });
5337
5422
  }
5338
5423
  };
5339
- k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "saturation", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "contrast", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "brightness", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "red", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "green", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "blue", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "alpha", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "gamma", void 0), W = jr = k([x("ColorAdjustEffect"), O("design:paramtypes", [typeof (Ar = typeof Partial < "u" && Partial) == "function" ? Ar : Object, Array])], W);
5424
+ O([_({ fallback: 1 }), D("design:type", Number)], W.prototype, "saturation", void 0), O([_({ fallback: 1 }), D("design:type", Number)], W.prototype, "contrast", void 0), O([_({ fallback: 1 }), D("design:type", Number)], W.prototype, "brightness", void 0), O([_({ fallback: 1 }), D("design:type", Number)], W.prototype, "red", void 0), O([_({ fallback: 1 }), D("design:type", Number)], W.prototype, "green", void 0), O([_({ fallback: 1 }), D("design:type", Number)], W.prototype, "blue", void 0), O([_({ fallback: 1 }), D("design:type", Number)], W.prototype, "alpha", void 0), O([_({ fallback: 1 }), D("design:type", Number)], W.prototype, "gamma", void 0), W = Ir = O([x("ColorAdjustEffect"), D("design:paramtypes", [typeof (Fr = typeof Partial < "u" && Partial) == "function" ? Fr : Object, Array])], W);
5340
5425
  //#endregion
5341
5426
  //#region src/scene/effects/ColorFilterEffect.ts
5342
- var Mr, Nr, Pr = class extends U {
5427
+ var Lr, Rr, zr = class extends H {
5343
5428
  static {
5344
- Nr = this;
5429
+ Rr = this;
5345
5430
  }
5346
- static material = new I({ gl: {
5431
+ static material = new F({ gl: {
5347
5432
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5348
5433
  fragment: "in vec2 vUv;\nuniform sampler2D sampler;\nuniform float m[20];\n\nvoid main(void) {\n vec4 c = texture2D(sampler, vUv);\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n gl_FragColor = vec4(\n m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4] / 255.0,\n m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9] / 255.0,\n m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14] / 255.0,\n m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19] / 255.0\n );\n}"
5349
5434
  } });
5350
- _colorMatrix = new ft();
5435
+ _colorMatrix = new pt();
5351
5436
  constructor(e, t = []) {
5352
5437
  super(), this.setProperties(e).append(t);
5353
5438
  }
@@ -5391,25 +5476,25 @@ var Mr, Nr, Pr = class extends U {
5391
5476
  break;
5392
5477
  }
5393
5478
  }), t.redraw(e, () => {
5394
- L.draw(e, Nr.material, {
5479
+ I.draw(e, Rr.material, {
5395
5480
  sampler: 0,
5396
5481
  m: r.toArray()
5397
5482
  });
5398
5483
  });
5399
5484
  }
5400
5485
  };
5401
- k([_(), O("design:type", String)], Pr.prototype, "filter", void 0), Pr = Nr = k([x("ColorFilterEffect"), O("design:paramtypes", [typeof (Mr = typeof Partial < "u" && Partial) == "function" ? Mr : Object, Array])], Pr);
5486
+ O([_(), D("design:type", String)], zr.prototype, "filter", void 0), zr = Rr = O([x("ColorFilterEffect"), D("design:paramtypes", [typeof (Lr = typeof Partial < "u" && Partial) == "function" ? Lr : Object, Array])], zr);
5402
5487
  //#endregion
5403
5488
  //#region src/scene/effects/ColorOverlayEffect.ts
5404
- var Fr, Ir, Lr = 50, Rr = class extends U {
5489
+ var Br, Vr, Hr = 50, Ur = class extends H {
5405
5490
  static {
5406
- Ir = this;
5491
+ Vr = this;
5407
5492
  }
5408
- static material = new I({ gl: {
5493
+ static material = new F({ gl: {
5409
5494
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5410
5495
  fragment: `precision mediump float;
5411
5496
  uniform sampler2D sampler;
5412
- uniform vec4 colors[${Lr}];
5497
+ uniform vec4 colors[${Hr}];
5413
5498
  varying vec2 vUv;
5414
5499
 
5415
5500
  float calcWidth() {
@@ -5418,7 +5503,7 @@ float calcWidth() {
5418
5503
 
5419
5504
  int calcCount() {
5420
5505
  int count = 0;
5421
- for (int i = 0; i < ${Lr}; i++) {
5506
+ for (int i = 0; i < ${Hr}; i++) {
5422
5507
  if (colors[i] != vec4(0,0,0,0)){
5423
5508
  count++;
5424
5509
  }
@@ -5430,7 +5515,7 @@ vec4 calcColor(float x) {
5430
5515
  float perUnit = calcWidth() / float(calcCount());
5431
5516
  int index = int(x / perUnit);
5432
5517
 
5433
- for(int i=0; i<${Lr}; i++){
5518
+ for(int i=0; i<${Hr}; i++){
5434
5519
  if(i==index){
5435
5520
  return colors[i];
5436
5521
  }
@@ -5445,7 +5530,7 @@ void main(void) {
5445
5530
  gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
5446
5531
  }`
5447
5532
  } });
5448
- _color = new E();
5533
+ _color = new T();
5449
5534
  constructor(e, t = []) {
5450
5535
  super(), this.setProperties(e).append(t);
5451
5536
  }
@@ -5456,31 +5541,31 @@ void main(void) {
5456
5541
  let t = this._color.toArray();
5457
5542
  return t[3] = this.alpha, t;
5458
5543
  });
5459
- for (; t.length < Lr;) t.push([
5544
+ for (; t.length < Hr;) t.push([
5460
5545
  0,
5461
5546
  0,
5462
5547
  0,
5463
5548
  0
5464
5549
  ]);
5465
- L.draw(e, Ir.material, {
5550
+ I.draw(e, Vr.material, {
5466
5551
  sampler: 0,
5467
- colors: t.slice(0, Lr).flatMap((e) => e)
5552
+ colors: t.slice(0, Hr).flatMap((e) => e)
5468
5553
  });
5469
5554
  });
5470
5555
  }
5471
5556
  };
5472
- k([_({ default: () => [] }), O("design:type", Array)], Rr.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Rr.prototype, "alpha", void 0), Rr = Ir = k([x("ColorOverlayEffect"), O("design:paramtypes", [typeof (Fr = typeof Partial < "u" && Partial) == "function" ? Fr : Object, Array])], Rr);
5557
+ O([_({ default: () => [] }), D("design:type", Array)], Ur.prototype, "colors", void 0), O([_({ fallback: .5 }), D("design:type", Number)], Ur.prototype, "alpha", void 0), Ur = Vr = O([x("ColorOverlayEffect"), D("design:paramtypes", [typeof (Br = typeof Partial < "u" && Partial) == "function" ? Br : Object, Array])], Ur);
5473
5558
  //#endregion
5474
5559
  //#region src/scene/effects/ColorRemoveEffect.ts
5475
- var zr, Br, Vr = class extends U {
5560
+ var Wr, Gr, Kr = class extends H {
5476
5561
  static {
5477
- Br = this;
5562
+ Gr = this;
5478
5563
  }
5479
- static material = new I({ gl: {
5564
+ static material = new F({ gl: {
5480
5565
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5481
5566
  fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform float epsilon;\nconst int MAX_COLORS = 50;\nuniform vec3 originalColors[MAX_COLORS];\n\nvoid main(void) {\n vec4 color = texture2D(sampler, vUv);\n\n for (int i = 0; i < MAX_COLORS; i++) {\n vec3 origColor = originalColors[i];\n if (origColor.r < 0.0) {\n break;\n }\n vec3 colorDiff = origColor - color.rgb;\n if (length(colorDiff) < epsilon) {\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n }\n }\n\n gl_FragColor = color;\n}"
5482
5567
  } });
5483
- _color = new E();
5568
+ _color = new T();
5484
5569
  constructor(e, t = []) {
5485
5570
  super(), this.setProperties(e).append(t);
5486
5571
  }
@@ -5494,7 +5579,7 @@ var zr, Br, Vr = class extends U {
5494
5579
  r.slice(0, 50).forEach((e, t) => {
5495
5580
  n[t * 3] = e[0], n[t * 3 + 1] = e[1], n[t * 3 + 2] = e[2];
5496
5581
  }), t.redraw(e, () => {
5497
- L.draw(e, Br.material, {
5582
+ I.draw(e, Gr.material, {
5498
5583
  sampler: 0,
5499
5584
  epsilon: this.epsilon,
5500
5585
  originalColors: n
@@ -5502,19 +5587,19 @@ var zr, Br, Vr = class extends U {
5502
5587
  });
5503
5588
  }
5504
5589
  };
5505
- k([_({ default: () => [] }), O("design:type", Array)], Vr.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Vr.prototype, "epsilon", void 0), Vr = Br = k([x("ColorRemoveEffect"), O("design:paramtypes", [typeof (zr = typeof Partial < "u" && Partial) == "function" ? zr : Object, Array])], Vr);
5590
+ O([_({ default: () => [] }), D("design:type", Array)], Kr.prototype, "colors", void 0), O([_({ fallback: .5 }), D("design:type", Number)], Kr.prototype, "epsilon", void 0), Kr = Gr = O([x("ColorRemoveEffect"), D("design:paramtypes", [typeof (Wr = typeof Partial < "u" && Partial) == "function" ? Wr : Object, Array])], Kr);
5506
5591
  //#endregion
5507
5592
  //#region src/scene/effects/ColorReplaceEffect.ts
5508
- var Hr, Ur, Wr = 50, Gr = class extends U {
5593
+ var qr, Jr, Yr = 50, Xr = class extends H {
5509
5594
  static {
5510
- Ur = this;
5595
+ Jr = this;
5511
5596
  }
5512
- static material = new I({ gl: {
5597
+ static material = new F({ gl: {
5513
5598
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5514
5599
  fragment: `varying vec2 vUv;
5515
5600
  uniform sampler2D sampler;
5516
5601
  uniform float epsilon;
5517
- const int MAX_COLORS = ${Wr};
5602
+ const int MAX_COLORS = ${Yr};
5518
5603
  uniform vec3 originalColors[MAX_COLORS];
5519
5604
  uniform vec3 targetColors[MAX_COLORS];
5520
5605
 
@@ -5542,7 +5627,7 @@ void main(void) {
5542
5627
  }
5543
5628
  }`
5544
5629
  } });
5545
- _color = new E();
5630
+ _color = new T();
5546
5631
  constructor(e, t = []) {
5547
5632
  super(), this.setProperties(e).append(t);
5548
5633
  }
@@ -5551,8 +5636,8 @@ void main(void) {
5551
5636
  this._color.value = e[0];
5552
5637
  let t = this._color.toArray().slice(0, 3);
5553
5638
  return this._color.value = e[1], [t, this._color.toArray().slice(0, 3)];
5554
- }), r = this.epsilon, i = new Float32Array(Wr * 3), a = new Float32Array(Wr * 3);
5555
- for (; n.length < Wr;) n.push([[
5639
+ }), r = this.epsilon, i = new Float32Array(Yr * 3), a = new Float32Array(Yr * 3);
5640
+ for (; n.length < Yr;) n.push([[
5556
5641
  -1,
5557
5642
  0,
5558
5643
  0
@@ -5562,10 +5647,10 @@ void main(void) {
5562
5647
  0,
5563
5648
  1
5564
5649
  ]]);
5565
- n.slice(0, Wr).forEach(([e, t], n) => {
5650
+ n.slice(0, Yr).forEach(([e, t], n) => {
5566
5651
  i[n * 3] = e[0], i[n * 3 + 1] = e[1], i[n * 3 + 2] = e[2], a[n * 3] = t[0], a[n * 3 + 1] = t[1], a[n * 3 + 2] = t[2];
5567
5652
  }), t.redraw(e, () => {
5568
- L.draw(e, Ur.material, {
5653
+ I.draw(e, Jr.material, {
5569
5654
  sampler: 0,
5570
5655
  epsilon: r,
5571
5656
  originalColors: i,
@@ -5574,17 +5659,17 @@ void main(void) {
5574
5659
  });
5575
5660
  }
5576
5661
  };
5577
- k([_({ default: () => [] }), O("design:type", Array)], Gr.prototype, "colors", void 0), k([_({ fallback: .05 }), O("design:type", Number)], Gr.prototype, "epsilon", void 0), Gr = Ur = k([x("ColorReplaceEffect"), O("design:paramtypes", [typeof (Hr = typeof Partial < "u" && Partial) == "function" ? Hr : Object, Array])], Gr);
5662
+ O([_({ default: () => [] }), D("design:type", Array)], Xr.prototype, "colors", void 0), O([_({ fallback: .05 }), D("design:type", Number)], Xr.prototype, "epsilon", void 0), Xr = Jr = O([x("ColorReplaceEffect"), D("design:paramtypes", [typeof (qr = typeof Partial < "u" && Partial) == "function" ? qr : Object, Array])], Xr);
5578
5663
  //#endregion
5579
5664
  //#region src/scene/effects/DrawboardEffect.frag?raw
5580
- var Kr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nuniform vec2 inputSize;\nuniform vec2 zoom;\nuniform vec2 translate;\nuniform float gridScale;\nuniform vec2 gridSize;\nuniform int checkerboard;\nuniform int checkerboardStyle;\nuniform float dotBackgroundBaseColor;\nuniform float dotBackgroundZoomedOutColor;\nuniform float dotColorDiff;\nuniform int pixelGrid;\nuniform int watermark;\nuniform sampler2D watermarkTexture;\nuniform vec2 watermarkSize;\nuniform vec2 watermarkOffset;\nuniform vec2 watermarkSpacing;\nuniform float watermarkRotation;\nuniform float watermarkAlpha;\n\nconst float VIEWPORT_SPACE_MIN_DOT_RADIUS = 0.5;\nconst float CANVAS_SPACE_DOT_RADIUS = 1.;\nconst float CANVAS_SPACE_DOT_GRID_SIZE_PX = 16.;\n\nconst int CHECKERBOARD_STYLE_NONE = 0;\nconst int CHECKERBOARD_STYLE_GRID = 1;\nconst int CHECKERBOARD_STYLE_GRID_DARK = 2;\nconst int CHECKERBOARD_STYLE_DOTS = 3;\n\nfloat _round(float val) {\n return floor(val + .5);\n}\n\nvec2 _round(vec2 pt) {\n return floor(pt + .5);\n}\n\nfloat scaledGridSize(float zoomScale) {\n if (zoomScale < 0.03125) {\n return 32.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.0625) {\n return 16.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.125) {\n return 8.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.25) {\n return 4.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.5) {\n return 2.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else {\n return CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n}\n\nvec4 renderCheckerboard(vec2 coord, vec4 color) {\n float value;\n if (checkerboardStyle == CHECKERBOARD_STYLE_GRID) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 1.0 : 0.95;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_GRID_DARK) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 0.12 : 0.17;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_DOTS) {\n float zoomScale = zoom.x;\n float gridPixelSize = scaledGridSize(zoomScale);\n float zoomInterpolationFactor = smoothstep(0.5, 1.0, zoomScale);\n float dotColor = dotBackgroundZoomedOutColor + dotColorDiff * zoomInterpolationFactor;\n vec2 nearestGridPoint = _round(coord / gridPixelSize) * gridPixelSize;\n float canvasSpaceDist = length(coord - nearestGridPoint);\n float viewportSpaceDist = canvasSpaceDist * zoomScale;\n float viewportSpaceDotRadius = max(VIEWPORT_SPACE_MIN_DOT_RADIUS, CANVAS_SPACE_DOT_RADIUS * zoomScale);\n float dist = 1.0 - smoothstep(0., 1., (viewportSpaceDist - viewportSpaceDotRadius + .5));\n value = mix(dotBackgroundBaseColor, dotColor, dist);\n }\n return vec4(value * (1.0 - color.a) + color.rgb, 1);\n}\n\nvec4 renderPixelGrid(vec2 coord, vec4 color) {\n vec3 rgb = color.rgb;\n vec2 corner = fract(coord);\n float gridWeight = max(float(corner.x < gridSize.x), float(corner.y < gridSize.y));\n vec3 gridColor;\n vec3 weights = vec3(0.299, 0.587, 0.114);\n float c2 = dot(rgb * rgb, weights);\n float luminance = sqrt(c2);\n if (luminance > 0.5) {\n float target = (luminance - 0.05) / luminance;\n gridColor = rgb * target;\n }\n else {\n float target = luminance * 0.8 + 0.15;\n float c1 = dot(rgb, weights);\n float a = 1.0 - 2.0 * c1 + c2;\n float b = c2 - c1;\n gridColor = mix(rgb, vec3(1), (b + sqrt(b * b - a * (c2 - target * target))) / a);\n }\n return vec4(mix(rgb, gridColor, gridWeight), color.a);\n}\n\nvec4 renderWatermark(vec2 coord, vec4 color) {\n float hw = watermarkSize.x * 0.5;\n float hh = watermarkSize.y * 0.5;\n float c = cos(-watermarkRotation);\n float s = sin(-watermarkRotation);\n vec2 blockSize = watermarkSize + watermarkSpacing;\n vec2 tiles = max(floor(inputSize / blockSize), vec2(1.0));\n vec2 gridCoverage = tiles * blockSize;\n vec2 startPos = watermarkOffset;\n vec2 localPix = coord - startPos;\n vec2 blockIndex = floor(localPix / blockSize);\n vec2 wmCenter = startPos + blockIndex * blockSize + watermarkSize * 0.5 + watermarkSpacing / 2.0;\n vec2 local = coord - wmCenter;\n vec2 inv = vec2(\n local.x * c + local.y * s,\n -local.x * s + local.y * c\n );\n if (inv.x >= -hw && inv.x <= hw && inv.y >= -hh && inv.y <= hh) {\n vec2 wmUV = (inv + vec2(hw, hh)) / watermarkSize;\n vec4 wmColor = texture(watermarkTexture, wmUV);\n float alpha = wmColor.a * watermarkAlpha;\n return mix(color, wmColor, alpha);\n } else {\n return color;\n }\n}\n\nvoid main(void) {\n vec4 color = texture(uTexture, vUv);\n vec2 coord = vec2(vUv.x, 1.0 - vUv.y);\n coord = (coord * inputSize - translate) / zoom;\n if (checkerboard > 0) {\n color = renderCheckerboard(coord, color);\n }\n if (watermark > 0) {\n color = renderWatermark(coord, color);\n }\n if (pixelGrid > 0) {\n color = renderPixelGrid(coord, color);\n }\n gl_FragColor = color;\n}\n", qr, Jr, G = class extends U {
5665
+ var Zr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nuniform vec2 inputSize;\nuniform vec2 zoom;\nuniform vec2 translate;\nuniform float gridScale;\nuniform vec2 gridSize;\nuniform int checkerboard;\nuniform int checkerboardStyle;\nuniform float dotBackgroundBaseColor;\nuniform float dotBackgroundZoomedOutColor;\nuniform float dotColorDiff;\nuniform int pixelGrid;\nuniform int watermark;\nuniform sampler2D watermarkTexture;\nuniform vec2 watermarkSize;\nuniform vec2 watermarkOffset;\nuniform vec2 watermarkSpacing;\nuniform float watermarkRotation;\nuniform float watermarkAlpha;\n\nconst float VIEWPORT_SPACE_MIN_DOT_RADIUS = 0.5;\nconst float CANVAS_SPACE_DOT_RADIUS = 1.;\nconst float CANVAS_SPACE_DOT_GRID_SIZE_PX = 16.;\n\nconst int CHECKERBOARD_STYLE_NONE = 0;\nconst int CHECKERBOARD_STYLE_GRID = 1;\nconst int CHECKERBOARD_STYLE_GRID_DARK = 2;\nconst int CHECKERBOARD_STYLE_DOTS = 3;\n\nfloat _round(float val) {\n return floor(val + .5);\n}\n\nvec2 _round(vec2 pt) {\n return floor(pt + .5);\n}\n\nfloat scaledGridSize(float zoomScale) {\n if (zoomScale < 0.03125) {\n return 32.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.0625) {\n return 16.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.125) {\n return 8.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.25) {\n return 4.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.5) {\n return 2.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else {\n return CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n}\n\nvec4 renderCheckerboard(vec2 coord, vec4 color) {\n float value;\n if (checkerboardStyle == CHECKERBOARD_STYLE_GRID) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 1.0 : 0.95;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_GRID_DARK) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 0.12 : 0.17;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_DOTS) {\n float zoomScale = zoom.x;\n float gridPixelSize = scaledGridSize(zoomScale);\n float zoomInterpolationFactor = smoothstep(0.5, 1.0, zoomScale);\n float dotColor = dotBackgroundZoomedOutColor + dotColorDiff * zoomInterpolationFactor;\n vec2 nearestGridPoint = _round(coord / gridPixelSize) * gridPixelSize;\n float canvasSpaceDist = length(coord - nearestGridPoint);\n float viewportSpaceDist = canvasSpaceDist * zoomScale;\n float viewportSpaceDotRadius = max(VIEWPORT_SPACE_MIN_DOT_RADIUS, CANVAS_SPACE_DOT_RADIUS * zoomScale);\n float dist = 1.0 - smoothstep(0., 1., (viewportSpaceDist - viewportSpaceDotRadius + .5));\n value = mix(dotBackgroundBaseColor, dotColor, dist);\n }\n return vec4(value * (1.0 - color.a) + color.rgb, 1);\n}\n\nvec4 renderPixelGrid(vec2 coord, vec4 color) {\n vec3 rgb = color.rgb;\n vec2 corner = fract(coord);\n float gridWeight = max(float(corner.x < gridSize.x), float(corner.y < gridSize.y));\n vec3 gridColor;\n vec3 weights = vec3(0.299, 0.587, 0.114);\n float c2 = dot(rgb * rgb, weights);\n float luminance = sqrt(c2);\n if (luminance > 0.5) {\n float target = (luminance - 0.05) / luminance;\n gridColor = rgb * target;\n }\n else {\n float target = luminance * 0.8 + 0.15;\n float c1 = dot(rgb, weights);\n float a = 1.0 - 2.0 * c1 + c2;\n float b = c2 - c1;\n gridColor = mix(rgb, vec3(1), (b + sqrt(b * b - a * (c2 - target * target))) / a);\n }\n return vec4(mix(rgb, gridColor, gridWeight), color.a);\n}\n\nvec4 renderWatermark(vec2 coord, vec4 color) {\n float hw = watermarkSize.x * 0.5;\n float hh = watermarkSize.y * 0.5;\n float c = cos(-watermarkRotation);\n float s = sin(-watermarkRotation);\n vec2 blockSize = watermarkSize + watermarkSpacing;\n vec2 tiles = max(floor(inputSize / blockSize), vec2(1.0));\n vec2 gridCoverage = tiles * blockSize;\n vec2 startPos = watermarkOffset;\n vec2 localPix = coord - startPos;\n vec2 blockIndex = floor(localPix / blockSize);\n vec2 wmCenter = startPos + blockIndex * blockSize + watermarkSize * 0.5 + watermarkSpacing / 2.0;\n vec2 local = coord - wmCenter;\n vec2 inv = vec2(\n local.x * c + local.y * s,\n -local.x * s + local.y * c\n );\n if (inv.x >= -hw && inv.x <= hw && inv.y >= -hh && inv.y <= hh) {\n vec2 wmUV = (inv + vec2(hw, hh)) / watermarkSize;\n vec4 wmColor = texture(watermarkTexture, wmUV);\n float alpha = wmColor.a * watermarkAlpha;\n return mix(color, wmColor, alpha);\n } else {\n return color;\n }\n}\n\nvoid main(void) {\n vec4 color = texture(uTexture, vUv);\n vec2 coord = vec2(vUv.x, 1.0 - vUv.y);\n coord = (coord * inputSize - translate) / zoom;\n if (checkerboard > 0) {\n color = renderCheckerboard(coord, color);\n }\n if (watermark > 0) {\n color = renderWatermark(coord, color);\n }\n if (pixelGrid > 0) {\n color = renderPixelGrid(coord, color);\n }\n gl_FragColor = color;\n}\n", Qr, $r, G = class extends H {
5581
5666
  static {
5582
- Jr = this;
5667
+ $r = this;
5583
5668
  }
5584
5669
  _watermark;
5585
- static material = new I({ gl: {
5670
+ static material = new F({ gl: {
5586
5671
  vertex: "attribute vec2 position;\nin vec2 uv;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position.xy, 0.0, 1.0);\n vUv = uv;\n}",
5587
- fragment: Kr
5672
+ fragment: Zr
5588
5673
  } });
5589
5674
  constructor(e, t = []) {
5590
5675
  super(), this.setProperties(e).append(t);
@@ -5608,7 +5693,7 @@ var Kr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
5608
5693
  t.redraw(e, () => {
5609
5694
  this._watermark ? this._watermark.activate(e, 1) : e.texture.unbind(1);
5610
5695
  let n = e.shader.uniforms.viewMatrix, r = this._watermark ? [this.watermarkWidth, this.watermarkWidth * this._watermark.height / this._watermark.width] : [0, 0], i = Math.max(r[0], r[1]);
5611
- L.draw(e, Jr.material, {
5696
+ I.draw(e, $r.material, {
5612
5697
  uTexture: 0,
5613
5698
  inputSize: [t.width, t.height],
5614
5699
  zoom: [n[0], n[4]],
@@ -5632,20 +5717,20 @@ var Kr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
5632
5717
  });
5633
5718
  }
5634
5719
  };
5635
- k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "checkerboard", void 0), k([_({ fallback: "grid" }), O("design:type", Object)], G.prototype, "checkerboardStyle", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "pixelGrid", void 0), k([_(), O("design:type", String)], G.prototype, "watermark", void 0), k([_({ fallback: 100 }), O("design:type", Number)], G.prototype, "watermarkWidth", void 0), k([_({ fallback: .05 }), O("design:type", Number)], G.prototype, "watermarkAlpha", void 0), k([_({ fallback: .5236 }), O("design:type", Number)], G.prototype, "watermarkRotation", void 0), G = Jr = k([x("DrawboardEffect"), O("design:paramtypes", [typeof (qr = typeof Partial < "u" && Partial) == "function" ? qr : Object, Array])], G);
5720
+ O([_({ fallback: !1 }), D("design:type", Boolean)], G.prototype, "checkerboard", void 0), O([_({ fallback: "grid" }), D("design:type", Object)], G.prototype, "checkerboardStyle", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], G.prototype, "pixelGrid", void 0), O([_(), D("design:type", String)], G.prototype, "watermark", void 0), O([_({ fallback: 100 }), D("design:type", Number)], G.prototype, "watermarkWidth", void 0), O([_({ fallback: .05 }), D("design:type", Number)], G.prototype, "watermarkAlpha", void 0), O([_({ fallback: .5236 }), D("design:type", Number)], G.prototype, "watermarkRotation", void 0), G = $r = O([x("DrawboardEffect"), D("design:paramtypes", [typeof (Qr = typeof Partial < "u" && Partial) == "function" ? Qr : Object, Array])], G);
5636
5721
  //#endregion
5637
5722
  //#region src/scene/effects/GaussianBlurEffect.ts
5638
- var Yr, Xr, Zr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void) {\n gl_FragColor = vec4(0.0);\n float flag = 0.0;\n for (int i = 0; i < 9; i++) {\n vec2 uv = vUv[i];\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {\n flag = 1.0;\n break;\n }\n }\n if (flag == 1.0) {\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n } else {\n gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;\n }\n}", Qr = class extends U {
5723
+ var ei, ti, ni = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void) {\n gl_FragColor = vec4(0.0);\n float flag = 0.0;\n for (int i = 0; i < 9; i++) {\n vec2 uv = vUv[i];\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {\n flag = 1.0;\n break;\n }\n }\n if (flag == 1.0) {\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n } else {\n gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;\n }\n}", ri = class extends H {
5639
5724
  static {
5640
- Xr = this;
5725
+ ti = this;
5641
5726
  }
5642
- static materialX = new I({ gl: {
5727
+ static materialX = new F({ gl: {
5643
5728
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(-4.0 * uStrength, 0.0);\n vUv[1] = uv + vec2(-3.0 * uStrength, 0.0);\n vUv[2] = uv + vec2(-2.0 * uStrength, 0.0);\n vUv[3] = uv + vec2(-1.0 * uStrength, 0.0);\n vUv[4] = uv + vec2(0.0 * uStrength, 0.0);\n vUv[5] = uv + vec2(1.0 * uStrength, 0.0);\n vUv[6] = uv + vec2(2.0 * uStrength, 0.0);\n vUv[7] = uv + vec2(3.0 * uStrength, 0.0);\n vUv[8] = uv + vec2(4.0 * uStrength, 0.0);\n}",
5644
- fragment: Zr
5729
+ fragment: ni
5645
5730
  } });
5646
- static materialY = new I({ gl: {
5731
+ static materialY = new F({ gl: {
5647
5732
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(0.0, -4.0 * uStrength);\n vUv[1] = uv + vec2(0.0, -3.0 * uStrength);\n vUv[2] = uv + vec2(0.0, -2.0 * uStrength);\n vUv[3] = uv + vec2(0.0, -1.0 * uStrength);\n vUv[4] = uv + vec2(0.0, 0.0 * uStrength);\n vUv[5] = uv + vec2(0.0, 1.0 * uStrength);\n vUv[6] = uv + vec2(0.0, 2.0 * uStrength);\n vUv[7] = uv + vec2(0.0, 3.0 * uStrength);\n vUv[8] = uv + vec2(0.0, 4.0 * uStrength);\n}",
5648
- fragment: Zr
5733
+ fragment: ni
5649
5734
  } });
5650
5735
  constructor(e, t = []) {
5651
5736
  super(), this.setProperties(e).append(t);
@@ -5653,39 +5738,39 @@ var Yr, Xr, Zr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(
5653
5738
  apply(e, t) {
5654
5739
  let n = 1 / t.width, r = 1 / t.height, i = Math.max(this.quality, 1);
5655
5740
  for (let r = 0; r < i; r++) t.redraw(e, () => {
5656
- L.draw(e, Xr.materialX, {
5741
+ I.draw(e, ti.materialX, {
5657
5742
  sampler: 0,
5658
5743
  uStrength: n * (this.strength / i)
5659
5744
  });
5660
5745
  });
5661
5746
  for (let n = 0; n < i; n++) t.redraw(e, () => {
5662
- L.draw(e, Xr.materialY, {
5747
+ I.draw(e, ti.materialY, {
5663
5748
  sampler: 0,
5664
5749
  uStrength: r * (this.strength / i)
5665
5750
  });
5666
5751
  });
5667
5752
  }
5668
5753
  };
5669
- k([_({ fallback: 4 }), O("design:type", Number)], Qr.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], Qr.prototype, "quality", void 0), Qr = Xr = k([x("GaussianBlurEffect"), O("design:paramtypes", [typeof (Yr = typeof Partial < "u" && Partial) == "function" ? Yr : Object, Array])], Qr);
5754
+ O([_({ fallback: 4 }), D("design:type", Number)], ri.prototype, "strength", void 0), O([_({ fallback: 3 }), D("design:type", Number)], ri.prototype, "quality", void 0), ri = ti = O([x("GaussianBlurEffect"), D("design:paramtypes", [typeof (ei = typeof Partial < "u" && Partial) == "function" ? ei : Object, Array])], ri);
5670
5755
  //#endregion
5671
5756
  //#region src/scene/effects/DropShadowEffect.ts
5672
- var $r, ei, ti = class extends U {
5757
+ var ii, ai, oi = class extends H {
5673
5758
  static {
5674
- ei = this;
5759
+ ai = this;
5675
5760
  }
5676
- static material = new I({ gl: {
5761
+ static material = new F({ gl: {
5677
5762
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5678
5763
  fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float uAlpha;\nuniform vec3 uColor;\nuniform vec2 uOffset;\nuniform vec4 uInputSize;\n\nvoid main(void) {\n vec4 sample = texture2D(sampler, vUv + uOffset * uInputSize.zw);\n sample.rgb = uColor.rgb * sample.a;\n sample *= uAlpha;\n gl_FragColor = sample;\n}"
5679
5764
  } });
5680
- blurEffect = new Qr();
5681
- viewport3 = new H();
5682
- _color = new E();
5765
+ blurEffect = new ri();
5766
+ viewport3 = new V();
5767
+ _color = new T();
5683
5768
  constructor(e, t = []) {
5684
5769
  super(), this.setProperties(e).append(t);
5685
5770
  }
5686
5771
  apply(e, t) {
5687
5772
  this.viewport3.activateWithCopy(e, t), this.viewport3.redraw(e, () => {
5688
- this._color.value = this.color, L.draw(e, ei.material, {
5773
+ this._color.value = this.color, I.draw(e, ai.material, {
5689
5774
  sampler: 0,
5690
5775
  uAlpha: this._color.a,
5691
5776
  uColor: this._color.toArray().slice(0, 3),
@@ -5698,18 +5783,18 @@ var $r, ei, ti = class extends U {
5698
5783
  ]
5699
5784
  });
5700
5785
  }), this.blurEffect.strength = this.blur, this.blurEffect.apply(e, this.viewport3), t.redraw(e, () => {
5701
- this.viewport3.texture.activate(e, 1), L.draw(e, Jn.instance, { sampler: 1 }), this.shadowOnly || L.draw(e, Jn.instance, { sampler: 0 }), e.texture.unbind(1);
5786
+ this.viewport3.texture.activate(e, 1), I.draw(e, Yn.instance, { sampler: 1 }), this.shadowOnly || I.draw(e, Yn.instance, { sampler: 0 }), e.texture.unbind(1);
5702
5787
  });
5703
5788
  }
5704
5789
  };
5705
- k([_({ fallback: "#000000FF" }), O("design:type", Object)], ti.prototype, "color", void 0), k([_({ fallback: 4 }), O("design:type", Number)], ti.prototype, "blur", void 0), k([_({ fallback: 4 }), O("design:type", Number)], ti.prototype, "offsetX", void 0), k([_({ fallback: 4 }), O("design:type", Number)], ti.prototype, "offsetY", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], ti.prototype, "shadowOnly", void 0), ti = ei = k([x("DropShadowEffect"), O("design:paramtypes", [typeof ($r = typeof Partial < "u" && Partial) == "function" ? $r : Object, Array])], ti);
5790
+ O([_({ fallback: "#000000FF" }), D("design:type", Object)], oi.prototype, "color", void 0), O([_({ fallback: 4 }), D("design:type", Number)], oi.prototype, "blur", void 0), O([_({ fallback: 4 }), D("design:type", Number)], oi.prototype, "offsetX", void 0), O([_({ fallback: 4 }), D("design:type", Number)], oi.prototype, "offsetY", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], oi.prototype, "shadowOnly", void 0), oi = ai = O([x("DropShadowEffect"), D("design:paramtypes", [typeof (ii = typeof Partial < "u" && Partial) == "function" ? ii : Object, Array])], oi);
5706
5791
  //#endregion
5707
5792
  //#region src/scene/effects/EmbossEffect.ts
5708
- var ni, ri, ii = class extends U {
5793
+ var si, ci, li = class extends H {
5709
5794
  static {
5710
- ri = this;
5795
+ ci = this;
5711
5796
  }
5712
- static material = new I({ gl: {
5797
+ static material = new F({ gl: {
5713
5798
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5714
5799
  fragment: "precision mediump float;\nuniform sampler2D sampler;\nuniform vec4 inputSize;\nuniform float strength;\nvarying vec2 vUv;\n\nvoid main(void) {\n vec2 onePixel = inputSize.zw;\n vec4 color;\n color.rgb = vec3(0.5);\n color -= texture2D(sampler, vUv - onePixel) * strength;\n color += texture2D(sampler, vUv + onePixel) * strength;\n color.rgb = vec3((color.r + color.g + color.b) / 3.0);\n float alpha = texture2D(sampler, vUv).a;\n gl_FragColor = vec4(color.rgb * alpha, alpha);\n}"
5715
5800
  } });
@@ -5718,7 +5803,7 @@ var ni, ri, ii = class extends U {
5718
5803
  }
5719
5804
  apply(e, t) {
5720
5805
  t.redraw(e, () => {
5721
- L.draw(e, ri.material, {
5806
+ I.draw(e, ci.material, {
5722
5807
  sampler: 0,
5723
5808
  strength: this.strength,
5724
5809
  inputSize: [
@@ -5731,14 +5816,14 @@ var ni, ri, ii = class extends U {
5731
5816
  });
5732
5817
  }
5733
5818
  };
5734
- k([_({ fallback: 5 }), O("design:type", Number)], ii.prototype, "strength", void 0), ii = ri = k([x("EmbossEffect"), O("design:paramtypes", [typeof (ni = typeof Partial < "u" && Partial) == "function" ? ni : Object, Array])], ii);
5819
+ O([_({ fallback: 5 }), D("design:type", Number)], li.prototype, "strength", void 0), li = ci = O([x("EmbossEffect"), D("design:paramtypes", [typeof (si = typeof Partial < "u" && Partial) == "function" ? si : Object, Array])], li);
5735
5820
  //#endregion
5736
5821
  //#region src/scene/effects/GlitchEffect.ts
5737
- var ai, oi, K = class extends U {
5822
+ var ui, di, K = class extends H {
5738
5823
  static {
5739
- oi = this;
5824
+ di = this;
5740
5825
  }
5741
- static material = new I({ gl: {
5826
+ static material = new F({ gl: {
5742
5827
  vertex: "in vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5743
5828
  fragment: "\nin vec2 vUv;\nuniform sampler2D sampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void) {\n vec2 coord = (vUv * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vUv + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if (coord.x > filterClamp.z) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n }\n } else if (coord.x < filterClamp.x) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n }\n }\n\n if (coord.y > filterClamp.w) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n }\n } else if (coord.y < filterClamp.y) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n }\n }\n }\n\n gl_FragColor.r = texture(sampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture(sampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture(sampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture(sampler, coord).a;\n}"
5744
5829
  } });
@@ -5748,7 +5833,7 @@ var ai, oi, K = class extends U {
5748
5833
  _offsets;
5749
5834
  _needsRedraw = !1;
5750
5835
  constructor(e, t = []) {
5751
- super(), this.setProperties(e).append(t), this._canvas = document.createElement("canvas"), this._canvas.width = 4, this._canvas.height = this.sampleSize, this._texture = new z(this._canvas), this._sizes = new Float32Array(this.slices), this._offsets = new Float32Array(this.slices);
5836
+ super(), this.setProperties(e).append(t), this._canvas = document.createElement("canvas"), this._canvas.width = 4, this._canvas.height = this.sampleSize, this._texture = new R(this._canvas), this._sizes = new Float32Array(this.slices), this._offsets = new Float32Array(this.slices);
5752
5837
  }
5753
5838
  redraw() {
5754
5839
  let e = this.sampleSize, t = this._texture, n = this._canvas.getContext("2d");
@@ -5765,7 +5850,7 @@ var ai, oi, K = class extends U {
5765
5850
  this._needsRedraw || (this._needsRedraw = !0, this.redraw());
5766
5851
  let n = t.width, r = t.height, i = this.direction * (Math.PI / 180), a = Math.sin(i), o = Math.cos(i);
5767
5852
  t.redraw(e, () => {
5768
- this._texture.activate(e, 1), L.draw(e, oi.material, {
5853
+ this._texture.activate(e, 1), I.draw(e, di.material, {
5769
5854
  sampler: 0,
5770
5855
  filterClamp: [
5771
5856
  0,
@@ -5794,14 +5879,14 @@ var ai, oi, K = class extends U {
5794
5879
  });
5795
5880
  }
5796
5881
  };
5797
- k([_({ fallback: 10 }), O("design:type", Number)], K.prototype, "slices", void 0), k([_({ fallback: 512 }), O("design:type", Number)], K.prototype, "sampleSize", void 0), k([_({ fallback: 100 }), O("design:type", Number)], K.prototype, "offset", void 0), k([_({ fallback: 0 }), O("design:type", Number)], K.prototype, "direction", void 0), k([_({ fallback: 2 }), O("design:type", Number)], K.prototype, "fillMode", void 0), k([_({ fallback: 0 }), O("design:type", Number)], K.prototype, "seed", void 0), k([_({ default: () => [2, 2] }), O("design:type", Array)], K.prototype, "red", void 0), k([_({ default: () => [-10, 4] }), O("design:type", Array)], K.prototype, "green", void 0), k([_({ default: () => [10, -4] }), O("design:type", Array)], K.prototype, "blue", void 0), K = oi = k([x("GlitchEffect"), O("design:paramtypes", [typeof (ai = typeof Partial < "u" && Partial) == "function" ? ai : Object, Array])], K);
5882
+ O([_({ fallback: 10 }), D("design:type", Number)], K.prototype, "slices", void 0), O([_({ fallback: 512 }), D("design:type", Number)], K.prototype, "sampleSize", void 0), O([_({ fallback: 100 }), D("design:type", Number)], K.prototype, "offset", void 0), O([_({ fallback: 0 }), D("design:type", Number)], K.prototype, "direction", void 0), O([_({ fallback: 2 }), D("design:type", Number)], K.prototype, "fillMode", void 0), O([_({ fallback: 0 }), D("design:type", Number)], K.prototype, "seed", void 0), O([_({ default: () => [2, 2] }), D("design:type", Array)], K.prototype, "red", void 0), O([_({ default: () => [-10, 4] }), D("design:type", Array)], K.prototype, "green", void 0), O([_({ default: () => [10, -4] }), D("design:type", Array)], K.prototype, "blue", void 0), K = di = O([x("GlitchEffect"), D("design:paramtypes", [typeof (ui = typeof Partial < "u" && Partial) == "function" ? ui : Object, Array])], K);
5798
5883
  //#endregion
5799
5884
  //#region src/scene/effects/GodrayEffect.ts
5800
- var si, ci, li = "vec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289(((x * 34.0) + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nvec3 fade(vec3 t) {\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain) {\n float sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i = 0.0; i < 6.0; i++) {\n sum += totalgain * pnoise(P * sc, rep);\n sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}", q = class extends U {
5885
+ var fi, pi, mi = "vec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289(((x * 34.0) + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nvec3 fade(vec3 t) {\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain) {\n float sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i = 0.0; i < 6.0; i++) {\n sum += totalgain * pnoise(P * sc, rep);\n sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}", q = class extends H {
5801
5886
  static {
5802
- ci = this;
5887
+ pi = this;
5803
5888
  }
5804
- static material = new I({ gl: {
5889
+ static material = new F({ gl: {
5805
5890
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5806
5891
  fragment: `precision highp float;
5807
5892
  varying vec2 vUv;
@@ -5814,7 +5899,7 @@ uniform float uTime;
5814
5899
  uniform vec3 uRay;
5815
5900
  uniform vec4 uInputSize;
5816
5901
 
5817
- ${li}
5902
+ ${mi}
5818
5903
 
5819
5904
  void main(void) {
5820
5905
  bool uParallel = uParallel > 0.5;
@@ -5853,7 +5938,7 @@ void main(void) {
5853
5938
  apply(e, t) {
5854
5939
  let n = this.angle * (Math.PI / 180), r = this.parallel ? [Math.cos(n), Math.sin(n)] : this.center;
5855
5940
  t.redraw(e, () => {
5856
- L.draw(e, ci.material, {
5941
+ I.draw(e, pi.material, {
5857
5942
  sampler: 0,
5858
5943
  uDimensions: [t.width, t.height],
5859
5944
  uParallel: +!!this.parallel,
@@ -5875,15 +5960,15 @@ void main(void) {
5875
5960
  });
5876
5961
  }
5877
5962
  };
5878
- k([_({ fallback: 0 }), O("design:type", Number)], q.prototype, "time", void 0), k([_({ fallback: 30 }), O("design:type", Number)], q.prototype, "angle", void 0), k([_({ fallback: .5 }), O("design:type", Number)], q.prototype, "gain", void 0), k([_({ fallback: 2.5 }), O("design:type", Number)], q.prototype, "lacunarity", void 0), k([_({ fallback: !0 }), O("design:type", Boolean)], q.prototype, "parallel", void 0), k([_({ default: () => [0, 0] }), O("design:type", Array)], q.prototype, "center", void 0), k([_({ fallback: 1 }), O("design:type", Number)], q.prototype, "alpha", void 0), q = ci = k([x("GodrayEffect"), O("design:paramtypes", [typeof (si = typeof Partial < "u" && Partial) == "function" ? si : Object, Array])], q);
5963
+ O([_({ fallback: 0 }), D("design:type", Number)], q.prototype, "time", void 0), O([_({ fallback: 30 }), D("design:type", Number)], q.prototype, "angle", void 0), O([_({ fallback: .5 }), D("design:type", Number)], q.prototype, "gain", void 0), O([_({ fallback: 2.5 }), D("design:type", Number)], q.prototype, "lacunarity", void 0), O([_({ fallback: !0 }), D("design:type", Boolean)], q.prototype, "parallel", void 0), O([_({ default: () => [0, 0] }), D("design:type", Array)], q.prototype, "center", void 0), O([_({ fallback: 1 }), D("design:type", Number)], q.prototype, "alpha", void 0), q = pi = O([x("GodrayEffect"), D("design:paramtypes", [typeof (fi = typeof Partial < "u" && Partial) == "function" ? fi : Object, Array])], q);
5879
5964
  //#endregion
5880
5965
  //#region src/scene/effects/KawaseBlurEffect.ts
5881
- var ui, di = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y - uOffset.y));\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));\n color *= 0.25;\n gl_FragColor = color;\n}", fi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\nuniform vec4 uInputClamp;\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color *= 0.25;\n gl_FragColor = color;\n}", pi = class extends U {
5966
+ var hi, gi = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y - uOffset.y));\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));\n color *= 0.25;\n gl_FragColor = color;\n}", _i = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\nuniform vec4 uInputClamp;\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color *= 0.25;\n gl_FragColor = color;\n}", vi = class extends H {
5882
5967
  _kernels = [0];
5883
5968
  constructor(e, t = []) {
5884
- super(), this.material = new I({ gl: {
5969
+ super(), this.material = new F({ gl: {
5885
5970
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5886
- fragment: e?.clamp ? fi : di
5971
+ fragment: e?.clamp ? _i : gi
5887
5972
  } }), this.setProperties(e).append(t), this._generateKernels();
5888
5973
  }
5889
5974
  _updateProperty(e, t, n) {
@@ -5907,7 +5992,7 @@ var ui, di = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffse
5907
5992
  this._kernels.forEach((i) => {
5908
5993
  let a = i + .5;
5909
5994
  t.redraw(e, () => {
5910
- L.draw(e, this.material, {
5995
+ I.draw(e, this.material, {
5911
5996
  sampler: 0,
5912
5997
  uOffset: [a * n, a * r],
5913
5998
  uInputClamp: [
@@ -5921,14 +6006,14 @@ var ui, di = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffse
5921
6006
  });
5922
6007
  }
5923
6008
  };
5924
- k([_({ fallback: 4 }), O("design:type", Number)], pi.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], pi.prototype, "quality", void 0), k([_({ default: () => [1, 1] }), O("design:type", Array)], pi.prototype, "pixelSize", void 0), pi = k([x("KawaseBlurEffect"), O("design:paramtypes", [typeof (ui = typeof Partial < "u" && Partial) == "function" ? ui : Object, Array])], pi);
6009
+ O([_({ fallback: 4 }), D("design:type", Number)], vi.prototype, "strength", void 0), O([_({ fallback: 3 }), D("design:type", Number)], vi.prototype, "quality", void 0), O([_({ default: () => [1, 1] }), D("design:type", Array)], vi.prototype, "pixelSize", void 0), vi = O([x("KawaseBlurEffect"), D("design:paramtypes", [typeof (hi = typeof Partial < "u" && Partial) == "function" ? hi : Object, Array])], vi);
5925
6010
  //#endregion
5926
6011
  //#region src/scene/effects/MaskEffect.ts
5927
- var mi, hi, gi = class extends U {
6012
+ var yi, bi, xi = class extends H {
5928
6013
  static {
5929
- hi = this;
6014
+ bi = this;
5930
6015
  }
5931
- static material = new I({ gl: {
6016
+ static material = new F({ gl: {
5932
6017
  vertex: "attribute vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5933
6018
  fragment: "in vec2 vUv;\n\nuniform sampler2D sampler;\nuniform sampler2D mask;\nuniform float rotation;\n\nvec2 rotateUV(vec2 uv, float angle) {\n uv -= 0.5;\n float cosAngle = cos(angle);\n float sinAngle = sin(angle);\n mat2 rotationMatrix = mat2(\n cosAngle, -sinAngle,\n sinAngle, cosAngle\n );\n uv = rotationMatrix * uv;\n uv += 0.5;\n return uv;\n}\n\nvoid main(void) {\n vec4 color = texture(sampler, vUv);\n vec4 maskColor = texture(mask, rotateUV(vUv, rotation));\n gl_FragColor = mix(vec4(0.), color, maskColor.a);\n}"
5934
6019
  } });
@@ -5948,7 +6033,7 @@ var mi, hi, gi = class extends U {
5948
6033
  }
5949
6034
  apply(e, t, n) {
5950
6035
  this.texture && t.redraw(e, () => {
5951
- this.texture.activate(e, 1), L.draw(e, hi.material, {
6036
+ this.texture.activate(e, 1), I.draw(e, bi.material, {
5952
6037
  sampler: 0,
5953
6038
  mask: 1,
5954
6039
  rotation: n.target?.globalRotation ?? 0
@@ -5956,33 +6041,33 @@ var mi, hi, gi = class extends U {
5956
6041
  });
5957
6042
  }
5958
6043
  };
5959
- k([_({ fallback: "" }), O("design:type", String)], gi.prototype, "image", void 0), gi = hi = k([x("MaskEffect"), O("design:paramtypes", [typeof (mi = typeof Partial < "u" && Partial) == "function" ? mi : Object, Array])], gi);
6044
+ O([_({ fallback: "" }), D("design:type", String)], xi.prototype, "image", void 0), xi = bi = O([x("MaskEffect"), D("design:paramtypes", [typeof (yi = typeof Partial < "u" && Partial) == "function" ? yi : Object, Array])], xi);
5960
6045
  //#endregion
5961
6046
  //#region src/scene/effects/OutlineEffect.ts
5962
- var _i, vi, yi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uThickness;\nuniform vec3 uColor;\nuniform float uAlpha;\nuniform float uKnockout;\nuniform vec4 uInputClamp;\n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP = {ANGLE_STEP};\n\nfloat outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.) {\n return 0.;\n }\n vec4 displacedColor;\n vec2 displacedPos;\n float maxAlpha = 0.;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {\n displacedPos.x = vUv.x + uThickness.x * cos(angle);\n displacedPos.y = vUv.y + uThickness.y * sin(angle);\n displacedColor = texture2D(sampler, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor = texture2D(sampler, vUv);\n vec4 contentColor = sourceColor * float(uKnockout < 0.5);\n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vUv.xy) * (1.-sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n gl_FragColor = contentColor + outlineColor;\n}", J = class extends U {
6047
+ var Si, Ci, wi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uThickness;\nuniform vec3 uColor;\nuniform float uAlpha;\nuniform float uKnockout;\nuniform vec4 uInputClamp;\n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP = {ANGLE_STEP};\n\nfloat outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.) {\n return 0.;\n }\n vec4 displacedColor;\n vec2 displacedPos;\n float maxAlpha = 0.;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {\n displacedPos.x = vUv.x + uThickness.x * cos(angle);\n displacedPos.y = vUv.y + uThickness.y * sin(angle);\n displacedColor = texture2D(sampler, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor = texture2D(sampler, vUv);\n vec4 contentColor = sourceColor * float(uKnockout < 0.5);\n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vUv.xy) * (1.-sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n gl_FragColor = contentColor + outlineColor;\n}", J = class extends H {
5963
6048
  static {
5964
- vi = this;
6049
+ Ci = this;
5965
6050
  }
5966
6051
  static MIN_SAMPLES = 1;
5967
6052
  static MAX_SAMPLES = 100;
5968
6053
  static getAngleStep(e) {
5969
- return Number.parseFloat((Math.PI * 2 / Math.max(e * vi.MAX_SAMPLES, vi.MIN_SAMPLES)).toFixed(7));
6054
+ return Number.parseFloat((Math.PI * 2 / Math.max(e * Ci.MAX_SAMPLES, Ci.MIN_SAMPLES)).toFixed(7));
5970
6055
  }
5971
- _color = new E();
6056
+ _color = new T();
5972
6057
  constructor(e, t = []) {
5973
- super(), this.setProperties(e).append(t), this.material = new I({ gl: {
6058
+ super(), this.setProperties(e).append(t), this.material = new F({ gl: {
5974
6059
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5975
- fragment: yi.replace(/\{ANGLE_STEP\}/, vi.getAngleStep(this.quality).toFixed(7))
6060
+ fragment: wi.replace(/\{ANGLE_STEP\}/, Ci.getAngleStep(this.quality).toFixed(7))
5976
6061
  } });
5977
6062
  }
5978
6063
  apply(e, t) {
5979
6064
  t.redraw(e, () => {
5980
- this._color.value = this.color, L.draw(e, this.material, {
6065
+ this._color.value = this.color, I.draw(e, this.material, {
5981
6066
  sampler: 0,
5982
6067
  uThickness: [this.width / t.width, this.width / t.height],
5983
6068
  uColor: this._color.toArray().slice(0, 3),
5984
6069
  uAlpha: this.opacity === 1 ? this._color.a : this.opacity,
5985
- uAngleStep: vi.getAngleStep(this.quality),
6070
+ uAngleStep: Ci.getAngleStep(this.quality),
5986
6071
  uKnockout: +!!this.knockout,
5987
6072
  uInputClamp: [
5988
6073
  0,
@@ -5994,14 +6079,14 @@ var _i, vi, yi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D s
5994
6079
  });
5995
6080
  }
5996
6081
  };
5997
- k([_({ fallback: "#000000ff" }), O("design:type", Object)], J.prototype, "color", void 0), k([_({ fallback: 1 }), O("design:type", Number)], J.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", String)], J.prototype, "style", void 0), k([_(), O("design:type", Object)], J.prototype, "image", void 0), k([_({ fallback: 1 }), O("design:type", Number)], J.prototype, "opacity", void 0), k([_({ fallback: .1 }), O("design:type", Number)], J.prototype, "quality", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], J.prototype, "knockout", void 0), J = vi = k([x("OutlineEffect"), O("design:paramtypes", [typeof (_i = typeof Partial < "u" && Partial) == "function" ? _i : Object, Array])], J);
6082
+ O([_({ fallback: "#000000ff" }), D("design:type", Object)], J.prototype, "color", void 0), O([_({ fallback: 1 }), D("design:type", Number)], J.prototype, "width", void 0), O([_({ fallback: "solid" }), D("design:type", String)], J.prototype, "style", void 0), O([_(), D("design:type", Object)], J.prototype, "image", void 0), O([_({ fallback: 1 }), D("design:type", Number)], J.prototype, "opacity", void 0), O([_({ fallback: .1 }), D("design:type", Number)], J.prototype, "quality", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], J.prototype, "knockout", void 0), J = Ci = O([x("OutlineEffect"), D("design:paramtypes", [typeof (Si = typeof Partial < "u" && Partial) == "function" ? Si : Object, Array])], J);
5998
6083
  //#endregion
5999
6084
  //#region src/scene/effects/PixelateEffect.ts
6000
- var bi, xi, Si = class extends U {
6085
+ var Ti, Ei, Di = class extends H {
6001
6086
  static {
6002
- xi = this;
6087
+ Ei = this;
6003
6088
  }
6004
- static material = new I({ gl: {
6089
+ static material = new F({ gl: {
6005
6090
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
6006
6091
  fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 offset;\nuniform vec2 step;\n\nvoid main(void) {\n vec2 uv = vUv;\n uv = floor((uv - offset) / step) * step + offset + step / 2.0;\n gl_FragColor = texture2D(sampler, uv);\n}"
6007
6092
  } });
@@ -6015,18 +6100,18 @@ var bi, xi, Si = class extends U {
6015
6100
  offset: [(r[0] + i[0]) / t.width, 1 - (r[1] + i[1]) / t.height],
6016
6101
  step: [this.strength * r[0] / t.width, this.strength * r[1] / t.height]
6017
6102
  };
6018
- L.draw(e, xi.material, a);
6103
+ I.draw(e, Ei.material, a);
6019
6104
  });
6020
6105
  }
6021
6106
  };
6022
- k([_({ fallback: 10 }), O("design:type", Number)], Si.prototype, "strength", void 0), Si = xi = k([x("PixelateEffect"), O("design:paramtypes", [typeof (bi = typeof Partial < "u" && Partial) == "function" ? bi : Object, Array])], Si);
6107
+ O([_({ fallback: 10 }), D("design:type", Number)], Di.prototype, "strength", void 0), Di = Ei = O([x("PixelateEffect"), D("design:paramtypes", [typeof (Ti = typeof Partial < "u" && Partial) == "function" ? Ti : Object, Array])], Di);
6023
6108
  //#endregion
6024
6109
  //#region src/scene/effects/ZoomBlurEffect.ts
6025
- var Ci, wi, Ti = class extends U {
6110
+ var Oi, ki, Ai = class extends H {
6026
6111
  static {
6027
- wi = this;
6112
+ ki = this;
6028
6113
  }
6029
- static material = new I({ gl: {
6114
+ static material = new F({ gl: {
6030
6115
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
6031
6116
  fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec4 uInputSize;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n float minGradient = uInnerRadius * 0.3;\n float innerRadius1 = (uInnerRadius + minGradient * 0.5) / uInputSize.x;\n\n float gradient = uRadius * 0.3;\n float radius1 = (uRadius - gradient * 0.5) / uInputSize.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / uInputSize.xy - vUv);\n float dist = length(vec2(dir.x, dir.y * uInputSize.y / uInputSize.x));\n\n float strength1 = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius1) {\n delta = innerRadius1 - dist;\n gap = minGradient;\n } else if (radius1 >= 0.0 && dist > radius1) { // radius1 < 0 means it's infinity\n delta = dist - radius1;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / uInputSize.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength1 *= delta;\n if (countLimit < 1.0) {\n gl_FragColor = texture2D(sampler, vUv);\n return;\n }\n }\n\n float offset = rand(vUv, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength1;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vUv + dir * percent;\n color += texture2D(sampler, p) * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n\n gl_FragColor = color;\n}"
6032
6117
  } });
@@ -6035,7 +6120,7 @@ var Ci, wi, Ti = class extends U {
6035
6120
  }
6036
6121
  apply(e, t) {
6037
6122
  t.redraw(e, () => {
6038
- L.draw(e, wi.material, {
6123
+ I.draw(e, ki.material, {
6039
6124
  sampler: 0,
6040
6125
  uCenter: [t.width / 2, t.height / 2],
6041
6126
  uInnerRadius: this.innerRadius,
@@ -6051,10 +6136,10 @@ var Ci, wi, Ti = class extends U {
6051
6136
  });
6052
6137
  }
6053
6138
  };
6054
- k([_(), O("design:type", Array)], Ti.prototype, "center", void 0), k([_({ fallback: 20 }), O("design:type", Number)], Ti.prototype, "innerRadius", void 0), k([_({ fallback: -1 }), O("design:type", Number)], Ti.prototype, "radius", void 0), k([_({ fallback: .1 }), O("design:type", Number)], Ti.prototype, "strength", void 0), Ti = wi = k([x("ZoomBlurEffect"), O("design:paramtypes", [typeof (Ci = typeof Partial < "u" && Partial) == "function" ? Ci : Object, Array])], Ti);
6139
+ O([_(), D("design:type", Array)], Ai.prototype, "center", void 0), O([_({ fallback: 20 }), D("design:type", Number)], Ai.prototype, "innerRadius", void 0), O([_({ fallback: -1 }), D("design:type", Number)], Ai.prototype, "radius", void 0), O([_({ fallback: .1 }), D("design:type", Number)], Ai.prototype, "strength", void 0), Ai = ki = O([x("ZoomBlurEffect"), D("design:paramtypes", [typeof (Oi = typeof Partial < "u" && Partial) == "function" ? Oi : Object, Array])], Ai);
6055
6140
  //#endregion
6056
6141
  //#region src/scene/2d/element/utils.ts
6057
- function Ei(e, t) {
6142
+ function ji(e, t) {
6058
6143
  let { x: n, y: r, width: i, height: a } = t, o = !1, s = new v().translate(-n, -r).scale(1 / i, 1 / a);
6059
6144
  if (e.cropRect) {
6060
6145
  let { left: t = 0, top: n = 0, right: r = 0, bottom: i = 0 } = e.cropRect;
@@ -6076,7 +6161,7 @@ function Ei(e, t) {
6076
6161
  }
6077
6162
  //#endregion
6078
6163
  //#region src/scene/2d/element/Element2DFill.ts
6079
- var Y = class extends w {
6164
+ var Y = class extends C {
6080
6165
  _parent;
6081
6166
  texture;
6082
6167
  animatedTexture;
@@ -6109,7 +6194,7 @@ var Y = class extends w {
6109
6194
  }
6110
6195
  }
6111
6196
  async loadTexture() {
6112
- if (this.linearGradient || this.radialGradient) this.texture = new $n(this.linearGradient ?? this.radialGradient, Math.floor(this._parent.size.width), Math.floor(this._parent.size.height));
6197
+ if (this.linearGradient || this.radialGradient) this.texture = new er(this.linearGradient ?? this.radialGradient, Math.floor(this._parent.size.width), Math.floor(this._parent.size.height));
6113
6198
  else if (d(this.image)) this.animatedTexture = void 0, this.texture = void 0;
6114
6199
  else if (this._parent.tree?.log(`load image ${this.image}`), this.image !== "viewport") {
6115
6200
  let e = this.image.split("?")[0].endsWith(".gif"), t = this.image, n = await $.loadBy(t, async () => {
@@ -6130,12 +6215,12 @@ var Y = class extends w {
6130
6215
  width: e,
6131
6216
  height: t
6132
6217
  } };
6133
- if (this.image === "viewport") n.fillStyle = new rr();
6218
+ if (this.image === "viewport") n.fillStyle = new ir();
6134
6219
  else {
6135
6220
  let i = this.animatedTexture?.currentFrame.texture ?? this.texture;
6136
6221
  r = {
6137
6222
  ...r,
6138
- ...Ei(this, this.tile && i ? {
6223
+ ...ji(this, this.tile && i ? {
6139
6224
  x: 0,
6140
6225
  y: 0,
6141
6226
  width: i.sourceWidth,
@@ -6171,10 +6256,10 @@ var Y = class extends w {
6171
6256
  this.updateFrameIndex();
6172
6257
  }
6173
6258
  };
6174
- k([_({ fallback: !0 }), O("design:type", Boolean)], Y.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Y.prototype, "color", void 0), k([_(), O("design:type", Object)], Y.prototype, "image", void 0), k([_(), O("design:type", Object)], Y.prototype, "linearGradient", void 0), k([_(), O("design:type", Object)], Y.prototype, "radialGradient", void 0), k([_(), O("design:type", Object)], Y.prototype, "cropRect", void 0), k([_(), O("design:type", Object)], Y.prototype, "stretchRect", void 0), k([_(), O("design:type", Object)], Y.prototype, "dpi", void 0), k([_(), O("design:type", Object)], Y.prototype, "rotateWithShape", void 0), k([_(), O("design:type", Object)], Y.prototype, "tile", void 0), k([_(), O("design:type", Object)], Y.prototype, "opacity", void 0);
6259
+ O([_({ fallback: !0 }), D("design:type", Boolean)], Y.prototype, "enabled", void 0), O([_(), D("design:type", Object)], Y.prototype, "color", void 0), O([_(), D("design:type", Object)], Y.prototype, "image", void 0), O([_(), D("design:type", Object)], Y.prototype, "linearGradient", void 0), O([_(), D("design:type", Object)], Y.prototype, "radialGradient", void 0), O([_(), D("design:type", Object)], Y.prototype, "cropRect", void 0), O([_(), D("design:type", Object)], Y.prototype, "stretchRect", void 0), O([_(), D("design:type", Object)], Y.prototype, "dpi", void 0), O([_(), D("design:type", Object)], Y.prototype, "rotateWithShape", void 0), O([_(), D("design:type", Object)], Y.prototype, "tile", void 0), O([_(), D("design:type", Object)], Y.prototype, "opacity", void 0);
6175
6260
  //#endregion
6176
6261
  //#region src/scene/2d/element/Element2DBackground.ts
6177
- var Di = class extends Y {
6262
+ var Mi = class extends Y {
6178
6263
  setProperties(e) {
6179
6264
  return super._setProperties(d(e) ? void 0 : f(e));
6180
6265
  }
@@ -6186,10 +6271,10 @@ var Di = class extends Y {
6186
6271
  }
6187
6272
  }
6188
6273
  };
6189
- k([_(), O("design:type", Object)], Di.prototype, "fillWithShape", void 0);
6274
+ O([_(), D("design:type", Object)], Mi.prototype, "fillWithShape", void 0);
6190
6275
  //#endregion
6191
6276
  //#region src/scene/2d/element/Element2DConnection.ts
6192
- var Oi = class extends w {
6277
+ var Ni = class extends C {
6193
6278
  _parent;
6194
6279
  constructor(e) {
6195
6280
  super(), this._parent = e;
@@ -6204,32 +6289,51 @@ var Oi = class extends w {
6204
6289
  switch (super._updateProperty(e, t, n), e) {
6205
6290
  case "start":
6206
6291
  case "end":
6292
+ case "mode":
6207
6293
  this._parent.requestDraw();
6208
6294
  break;
6209
6295
  }
6210
6296
  }
6211
6297
  resolveAnchor(e) {
6298
+ return this.resolveEndpoint(e)?.point;
6299
+ }
6300
+ resolveEndpoint(e) {
6212
6301
  if (!e?.id) return;
6213
6302
  let t = this._parent.tree?.getNodeById(e.id);
6214
6303
  if (!t) return;
6215
6304
  if (e.idx !== void 0) {
6216
6305
  let n = t.shape.connectionPoints?.find((t) => t.idx === e.idx);
6217
6306
  if (n) {
6218
- let e = {
6219
- x: n.x * t.size.x,
6220
- y: n.y * t.size.y
6307
+ let e = t.globalTransform.apply(new y(n.x * t.size.x, n.y * t.size.y)), r;
6308
+ return r = n.ang === void 0 ? Dr(n.x - .5, n.y - .5) : {
6309
+ x: Math.cos(n.ang),
6310
+ y: Math.sin(n.ang)
6311
+ }, {
6312
+ point: e,
6313
+ dir: Pi(r, t.globalRotation)
6221
6314
  };
6222
- return t.globalTransform.apply(new y(e.x, e.y));
6223
6315
  }
6224
6316
  }
6225
6317
  let { min: n, size: r } = t.globalAabb;
6226
- return new y(n.x + r.x / 2, n.y + r.y / 2);
6318
+ return { point: new y(n.x + r.x / 2, n.y + r.y / 2) };
6319
+ }
6320
+ route() {
6321
+ let e = this.resolveEndpoint(this.start), t = this.resolveEndpoint(this.end);
6322
+ if (!(!e && !t)) return Or(this.mode, e ?? t, t ?? e);
6227
6323
  }
6228
6324
  };
6229
- k([_(), O("design:type", Object)], Oi.prototype, "start", void 0), k([_(), O("design:type", Object)], Oi.prototype, "end", void 0);
6325
+ O([_(), D("design:type", Object)], Ni.prototype, "start", void 0), O([_(), D("design:type", Object)], Ni.prototype, "end", void 0), O([_({ fallback: "straight" }), D("design:type", Object)], Ni.prototype, "mode", void 0);
6326
+ function Pi(e, t) {
6327
+ if (!t) return e;
6328
+ let n = Math.cos(t), r = Math.sin(t);
6329
+ return {
6330
+ x: e.x * n - e.y * r,
6331
+ y: e.x * r + e.y * n
6332
+ };
6333
+ }
6230
6334
  //#endregion
6231
6335
  //#region src/scene/2d/element/Element2DForeground.ts
6232
- var ki = class extends Y {
6336
+ var Fi = class extends Y {
6233
6337
  setProperties(e) {
6234
6338
  return super._setProperties(d(e) ? void 0 : h(e));
6235
6339
  }
@@ -6241,10 +6345,10 @@ var ki = class extends Y {
6241
6345
  }
6242
6346
  }
6243
6347
  };
6244
- k([_(), O("design:type", Object)], ki.prototype, "fillWithShape", void 0);
6348
+ O([_(), D("design:type", Object)], Fi.prototype, "fillWithShape", void 0);
6245
6349
  //#endregion
6246
6350
  //#region src/scene/2d/element/Element2DOutline.ts
6247
- var Ai = class extends Y {
6351
+ var Ii = class extends Y {
6248
6352
  setProperties(e) {
6249
6353
  return super._setProperties(d(e) ? void 0 : g(e));
6250
6354
  }
@@ -6264,7 +6368,7 @@ var Ai = class extends Y {
6264
6368
  }
6265
6369
  draw() {
6266
6370
  let { width: e, height: t } = this._parent.size, n = this._parent.context;
6267
- this.image === "viewport" ? n.strokeStyle = new rr() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ...Ei(this, {
6371
+ this.image === "viewport" ? n.strokeStyle = new ir() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ...ji(this, {
6268
6372
  x: 0,
6269
6373
  y: 0,
6270
6374
  width: e,
@@ -6272,10 +6376,10 @@ var Ai = class extends Y {
6272
6376
  }) });
6273
6377
  }
6274
6378
  };
6275
- k([_(), O("design:type", Object)], Ai.prototype, "color", void 0), k([_(), O("design:type", Object)], Ai.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", Object)], Ai.prototype, "style", void 0), k([_({ fallback: "butt" }), O("design:type", Object)], Ai.prototype, "lineCap", void 0), k([_({ fallback: "miter" }), O("design:type", Object)], Ai.prototype, "lineJoin", void 0);
6379
+ O([_(), D("design:type", Object)], Ii.prototype, "color", void 0), O([_(), D("design:type", Object)], Ii.prototype, "width", void 0), O([_({ fallback: "solid" }), D("design:type", Object)], Ii.prototype, "style", void 0), O([_({ fallback: "butt" }), D("design:type", Object)], Ii.prototype, "lineCap", void 0), O([_({ fallback: "miter" }), D("design:type", Object)], Ii.prototype, "lineJoin", void 0);
6276
6380
  //#endregion
6277
6381
  //#region src/scene/2d/element/Element2DShadow.ts
6278
- var ji = class extends w {
6382
+ var Li = class extends C {
6279
6383
  _parent;
6280
6384
  constructor(e) {
6281
6385
  super(), this._parent = e;
@@ -6296,18 +6400,25 @@ var ji = class extends w {
6296
6400
  }
6297
6401
  updateEffect() {
6298
6402
  let e = "__$shadow", t = this._parent.getNode(e);
6299
- this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new ti({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
6403
+ this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new oi({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
6300
6404
  }
6301
6405
  };
6302
- k([_({ fallback: !0 }), O("design:type", Boolean)], ji.prototype, "enabled", void 0), k([_({ fallback: "#000000FF" }), O("design:type", Object)], ji.prototype, "color", void 0), k([_({ fallback: 0 }), O("design:type", Object)], ji.prototype, "blur", void 0), k([_({ fallback: 0 }), O("design:type", Object)], ji.prototype, "offsetY", void 0), k([_({ fallback: 0 }), O("design:type", Object)], ji.prototype, "offsetX", void 0);
6406
+ O([_({ fallback: !0 }), D("design:type", Boolean)], Li.prototype, "enabled", void 0), O([_({ fallback: "#000000FF" }), D("design:type", Object)], Li.prototype, "color", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Li.prototype, "blur", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Li.prototype, "offsetY", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Li.prototype, "offsetX", void 0);
6303
6407
  //#endregion
6304
6408
  //#region src/scene/2d/element/Element2DShape.ts
6305
- var Mi = class extends w {
6409
+ var Ri = class extends C {
6306
6410
  _parent;
6307
6411
  _path2DSet = new se();
6412
+ _localPath;
6308
6413
  constructor(e) {
6309
6414
  super(), this._parent = e, this._updatePath2DSet();
6310
6415
  }
6416
+ setLocalPath(e) {
6417
+ this._localPath = e, this._parent.requestDraw();
6418
+ }
6419
+ get localPath() {
6420
+ return this._localPath;
6421
+ }
6311
6422
  setProperties(e) {
6312
6423
  return super.setProperties(d(e) ? void 0 : te(e));
6313
6424
  }
@@ -6353,7 +6464,8 @@ var Mi = class extends w {
6353
6464
  });
6354
6465
  }
6355
6466
  draw(e = !1) {
6356
- if (!e && this.isValid()) {
6467
+ if (!e && this._localPath && this._localPath.getLength()) this._parent.context.addPath(this._localPath.clone());
6468
+ else if (!e && this.isValid()) {
6357
6469
  let e = this._parent.context, { width: t, height: n } = this._parent.size;
6358
6470
  this._path2DSet.paths.forEach((r) => {
6359
6471
  e.addPath(r.clone().applyTransform(new v().scale(t, n)));
@@ -6365,24 +6477,24 @@ var Mi = class extends w {
6365
6477
  t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
6366
6478
  }
6367
6479
  };
6368
- k([_({ fallback: !0 }), O("design:type", Boolean)], Mi.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Mi.prototype, "preset", void 0), k([_(), O("design:type", Object)], Mi.prototype, "svg", void 0), k([_(), O("design:type", Object)], Mi.prototype, "viewBox", void 0), k([_(), O("design:type", Object)], Mi.prototype, "paths", void 0), k([_(), O("design:type", Object)], Mi.prototype, "connectionPoints", void 0);
6480
+ O([_({ fallback: !0 }), D("design:type", Boolean)], Ri.prototype, "enabled", void 0), O([_(), D("design:type", Object)], Ri.prototype, "preset", void 0), O([_(), D("design:type", Object)], Ri.prototype, "svg", void 0), O([_(), D("design:type", Object)], Ri.prototype, "viewBox", void 0), O([_(), D("design:type", Object)], Ri.prototype, "paths", void 0), O([_(), D("design:type", Object)], Ri.prototype, "connectionPoints", void 0);
6369
6481
  //#endregion
6370
6482
  //#region src/scene/2d/element/Element2DStyle.ts
6371
- var Ni = class extends T {
6483
+ var zi = class extends w {
6372
6484
  constructor(e) {
6373
6485
  super(), this.setProperties(e);
6374
6486
  }
6375
- }, Pi = {
6487
+ }, Bi = {
6376
6488
  ...o(),
6377
6489
  left: 0,
6378
6490
  top: 0,
6379
6491
  width: 0,
6380
6492
  height: 0
6381
6493
  };
6382
- for (let e in Pi) i(Ni, e, { fallback: Pi[e] });
6494
+ for (let e in Bi) i(zi, e, { fallback: Bi[e] });
6383
6495
  //#endregion
6384
6496
  //#region src/scene/2d/element/Element2DText.ts
6385
- var Fi, X = class extends w {
6497
+ var Vi, X = class extends C {
6386
6498
  _parent;
6387
6499
  base;
6388
6500
  get textContent() {
@@ -6393,7 +6505,7 @@ var Fi, X = class extends w {
6393
6505
  }
6394
6506
  _textContent = "";
6395
6507
  _autoDrawMode;
6396
- _texture = new Zn({ mipmap: !0 });
6508
+ _texture = new Qn({ mipmap: !0 });
6397
6509
  _textureMap = /* @__PURE__ */ new Map();
6398
6510
  constructor(e) {
6399
6511
  super(), this._parent = e, this.base = new pe(), this.base.setPropertyAccessor(this);
@@ -6464,7 +6576,7 @@ var Fi, X = class extends w {
6464
6576
  }), this._parent.requestDraw());
6465
6577
  }
6466
6578
  async _loadTexture(e, t) {
6467
- return e.linearGradient || e.radialGradient ? new $n(e.linearGradient ?? e.radialGradient, t.width, t.height) : d(e.image) ? void 0 : (this._parent.tree?.log(`load image ${e.image}`), await $.texture.load(e.image));
6579
+ return e.linearGradient || e.radialGradient ? new er(e.linearGradient ?? e.radialGradient, t.width, t.height) : d(e.image) ? void 0 : (this._parent.tree?.log(`load image ${e.image}`), await $.texture.load(e.image));
6468
6580
  }
6469
6581
  setContent(e) {
6470
6582
  this.content = re(e);
@@ -6493,7 +6605,7 @@ var Fi, X = class extends w {
6493
6605
  if (n.style.fill && !d(n.style.fill)) if (typeof n.style.fill == "object") {
6494
6606
  let r = n.style.fill, o = this._textureMap.get(`${a}.${i}.fill`) ?? this._textureMap.get(`${a}.fill`) ?? this._textureMap.get("fill");
6495
6607
  r.enabled !== !1 && (o || r.color) && (e.addPath(n), e.style = { ...n.style }, e.fillStyle = o?.texture ?? r.color, e.fill({
6496
- ...Ei(r, o?.box ?? {
6608
+ ...ji(r, o?.box ?? {
6497
6609
  x: 0,
6498
6610
  y: 0,
6499
6611
  width: this._parent.size.width,
@@ -6505,7 +6617,7 @@ var Fi, X = class extends w {
6505
6617
  if (n.style.stroke && !d(n.style.stroke)) if (typeof n.style.stroke == "object") {
6506
6618
  let r = n.style.stroke, o = this._textureMap.get(`${a}.${i}.outline`) ?? this._textureMap.get(`${a}.outline`) ?? this._textureMap.get("outline");
6507
6619
  r.enabled !== !1 && (o || r.color) && (r.width === void 0 || r.width) && (e.addPath(n), e.style = { ...n.style }, e.lineWidth = r.width || 1, e.strokeStyle = o?.texture ?? r.color, e.lineCap = r.lineCap, e.lineJoin = r.lineJoin, e.stroke({
6508
- ...Ei(r, o?.box ?? {
6620
+ ...ji(r, o?.box ?? {
6509
6621
  x: 0,
6510
6622
  y: 0,
6511
6623
  width: this._parent.size.width,
@@ -6535,7 +6647,7 @@ var Fi, X = class extends w {
6535
6647
  }
6536
6648
  process(e) {}
6537
6649
  };
6538
- k([_({ fallback: !0 }), O("design:type", Object)], X.prototype, "enabled", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], X.prototype, "content", void 0), k([_({ alias: "_parent.style.json" }), O("design:type", Object)], X.prototype, "style", void 0), k([_(), O("design:type", Object)], X.prototype, "effects", void 0), k([_(), O("design:type", Object)], X.prototype, "fill", void 0), k([_(), O("design:type", Object)], X.prototype, "outline", void 0), k([_({ alias: "base.measureDom" }), O("design:type", typeof (Fi = typeof HTMLElement < "u" && HTMLElement) == "function" ? Fi : Object)], X.prototype, "measureDom", void 0), k([_({ alias: "base.fonts" }), O("design:type", Object)], X.prototype, "fonts", void 0), k([_({ fallback: "auto" }), O("design:type", Object)], X.prototype, "drawMode", void 0);
6650
+ O([_({ fallback: !0 }), D("design:type", Object)], X.prototype, "enabled", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], X.prototype, "content", void 0), O([_({ alias: "_parent.style.json" }), D("design:type", Object)], X.prototype, "style", void 0), O([_(), D("design:type", Object)], X.prototype, "effects", void 0), O([_(), D("design:type", Object)], X.prototype, "fill", void 0), O([_(), D("design:type", Object)], X.prototype, "outline", void 0), O([_({ alias: "base.measureDom" }), D("design:type", typeof (Vi = typeof HTMLElement < "u" && HTMLElement) == "function" ? Vi : Object)], X.prototype, "measureDom", void 0), O([_({ alias: "base.fonts" }), D("design:type", Object)], X.prototype, "fonts", void 0), O([_({ fallback: "auto" }), D("design:type", Object)], X.prototype, "drawMode", void 0);
6539
6651
  //#endregion
6540
6652
  //#region src/scene/2d/element/Flexbox.ts
6541
6653
  var Z = {
@@ -6548,7 +6660,7 @@ var Z = {
6548
6660
  horizontal: 6,
6549
6661
  vertical: 7,
6550
6662
  all: 8
6551
- }, Ii = {
6663
+ }, Hi = {
6552
6664
  column: 0,
6553
6665
  row: 1,
6554
6666
  all: 2
@@ -6562,42 +6674,42 @@ var Z = {
6562
6674
  "space-between": 6,
6563
6675
  "space-around": 7,
6564
6676
  "space-evenly": 8
6565
- }, Li = {
6677
+ }, Ui = {
6566
6678
  flex: 0,
6567
6679
  none: 1,
6568
6680
  contents: 2
6569
- }, Ri = {
6681
+ }, Wi = {
6570
6682
  inherit: 0,
6571
6683
  ltr: 1,
6572
6684
  rtl: 2
6573
- }, zi = {
6685
+ }, Gi = {
6574
6686
  column: 0,
6575
6687
  "column-reverse": 1,
6576
6688
  row: 2,
6577
6689
  "row-reverse": 3
6578
- }, Bi = {
6690
+ }, Ki = {
6579
6691
  "no-wrap": 0,
6580
6692
  wrap: 1,
6581
6693
  "Wrap-reverse": 2
6582
- }, Vi = {
6694
+ }, qi = {
6583
6695
  "flex-start": 0,
6584
6696
  center: 1,
6585
6697
  "flex-end": 2,
6586
6698
  "space-between": 3,
6587
6699
  "space-around": 4,
6588
6700
  "space-evenly": 5
6589
- }, Hi = {
6701
+ }, Ji = {
6590
6702
  visible: 0,
6591
6703
  hidden: 1,
6592
6704
  scroll: 2
6593
- }, Ui = {
6705
+ }, Yi = {
6594
6706
  static: 0,
6595
6707
  relative: 1,
6596
6708
  absolute: 2
6597
- }, Wi = {
6709
+ }, Xi = {
6598
6710
  "border-box": 0,
6599
6711
  "content-box": 1
6600
- }, Gi = class e {
6712
+ }, Zi = class e {
6601
6713
  _parent;
6602
6714
  static _yoga;
6603
6715
  static async load() {
@@ -6609,14 +6721,14 @@ var Z = {
6609
6721
  this._parent = e, this._addChild = this._addChild.bind(this), this._removeChild = this._removeChild.bind(this), this._parent.on("addChild", this._addChild), this._parent.on("removeChild", this._removeChild);
6610
6722
  }
6611
6723
  _addChild(e, t) {
6612
- if (e instanceof Yi && e.flexbox.node && this.node) {
6724
+ if (e instanceof ta && e.flexbox.node && this.node) {
6613
6725
  this.node.insertChild(e.flexbox.node, t);
6614
6726
  let n = e.style.getProperties();
6615
6727
  for (let t in n) e.flexbox.updateStyleProperty(t, n[t]);
6616
6728
  }
6617
6729
  }
6618
6730
  _removeChild(e, t) {
6619
- e instanceof Yi && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
6731
+ e instanceof ta && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
6620
6732
  }
6621
6733
  updateStyleProperty(e, t) {
6622
6734
  let n = this.node;
@@ -6650,10 +6762,10 @@ var Z = {
6650
6762
  n.setBorder(Z.all, this._parent.style.borderWidth);
6651
6763
  break;
6652
6764
  case "direction":
6653
- n.setDirection(t ? Ri[t] ?? Ri.inherit : Ri.inherit);
6765
+ n.setDirection(t ? Wi[t] ?? Wi.inherit : Wi.inherit);
6654
6766
  break;
6655
6767
  case "display":
6656
- n.setDisplay(t ? Li[t] ?? Li.flex : Li.flex);
6768
+ n.setDisplay(t ? Ui[t] ?? Ui.flex : Ui.flex);
6657
6769
  break;
6658
6770
  case "flex":
6659
6771
  n.setFlex(t);
@@ -6662,7 +6774,7 @@ var Z = {
6662
6774
  n.setFlexBasis(t);
6663
6775
  break;
6664
6776
  case "flexDirection":
6665
- n.setFlexDirection(t ? zi[t] ?? zi.row : zi.row);
6777
+ n.setFlexDirection(t ? Gi[t] ?? Gi.row : Gi.row);
6666
6778
  break;
6667
6779
  case "flexGrow":
6668
6780
  n.setFlexGrow(t);
@@ -6671,16 +6783,16 @@ var Z = {
6671
6783
  n.setFlexShrink(t);
6672
6784
  break;
6673
6785
  case "flexWrap":
6674
- n.setFlexWrap(t ? Bi[t] ?? Bi.wrap : Bi.wrap);
6786
+ n.setFlexWrap(t ? Ki[t] ?? Ki.wrap : Ki.wrap);
6675
6787
  break;
6676
6788
  case "height":
6677
6789
  n.setHeight(t);
6678
6790
  break;
6679
6791
  case "justifyContent":
6680
- n.setJustifyContent(t ? Vi[t] ?? Vi["flex-start"] : Vi["flex-start"]);
6792
+ n.setJustifyContent(t ? qi[t] ?? qi["flex-start"] : qi["flex-start"]);
6681
6793
  break;
6682
6794
  case "gap":
6683
- t !== void 0 && n.setGap(Ii.all, t);
6795
+ t !== void 0 && n.setGap(Hi.all, t);
6684
6796
  break;
6685
6797
  case "marginTop":
6686
6798
  n.setMargin(Z.top, t);
@@ -6710,7 +6822,7 @@ var Z = {
6710
6822
  n.setMinWidth(t);
6711
6823
  break;
6712
6824
  case "overflow":
6713
- n.setOverflow(t ? Hi[t] ?? Hi.visible : Hi.visible);
6825
+ n.setOverflow(t ? Ji[t] ?? Ji.visible : Ji.visible);
6714
6826
  break;
6715
6827
  case "paddingTop":
6716
6828
  n.setPadding(Z.top, t);
@@ -6740,10 +6852,10 @@ var Z = {
6740
6852
  n.setPosition(Z.right, t);
6741
6853
  break;
6742
6854
  case "position":
6743
- n.setPositionType(t ? Ui[t] ?? Ui.relative : Ui.relative);
6855
+ n.setPositionType(t ? Yi[t] ?? Yi.relative : Yi.relative);
6744
6856
  break;
6745
6857
  case "boxSizing":
6746
- n.setBoxSizing(t ? Wi[t] ?? Wi["content-box"] : Wi["content-box"]);
6858
+ n.setBoxSizing(t ? Xi[t] ?? Xi["content-box"] : Xi["content-box"]);
6747
6859
  break;
6748
6860
  case "width":
6749
6861
  n.setWidth(t);
@@ -6754,7 +6866,7 @@ var Z = {
6754
6866
  }
6755
6867
  update() {
6756
6868
  let e = this._parent, t = this.node;
6757
- if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, Ri.ltr), t.hasNewLayout())) {
6869
+ if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, Wi.ltr), t.hasNewLayout())) {
6758
6870
  let { left: n, top: r, width: i, height: a } = t.getComputedLayout();
6759
6871
  (!Number.isNaN(n) && n !== e.position.x || !Number.isNaN(r) && r !== e.position.y) && e.position.set(n, r), (!Number.isNaN(i) && i !== e.size.x || !Number.isNaN(a) && a !== e.size.y) && e.size.set(i, a), t.markLayoutSeen();
6760
6872
  }
@@ -6762,10 +6874,10 @@ var Z = {
6762
6874
  destroy() {
6763
6875
  this.node?.free(), this.node = void 0;
6764
6876
  }
6765
- }, Ki, qi = new Set(Object.keys(a())), Ji = new Set(Object.keys(s())), Yi = class extends wr {
6766
- flexbox = new Gi(this);
6767
- aabb = new ct();
6768
- globalAabb = new ct();
6877
+ }, Qi, $i = new Set(Object.keys(a())), ea = new Set(Object.keys(s())), ta = class extends wr {
6878
+ flexbox = new Zi(this);
6879
+ aabb = new lt();
6880
+ globalAabb = new lt();
6769
6881
  _parentGlobalDisplay;
6770
6882
  _globalDisplay;
6771
6883
  get globalDisplay() {
@@ -6776,7 +6888,7 @@ var Z = {
6776
6888
  });
6777
6889
  _allowPointerEvents = !0;
6778
6890
  _overflowHidden = !1;
6779
- _style = new Ni().on("updateProperty", (...e) => {
6891
+ _style = new zi().on("updateProperty", (...e) => {
6780
6892
  this.onUpdateStyleProperty(e[0], e[1], e[2]);
6781
6893
  });
6782
6894
  get style() {
@@ -6785,14 +6897,14 @@ var Z = {
6785
6897
  set style(e) {
6786
6898
  this._style.resetProperties().setProperties(e);
6787
6899
  }
6788
- _background = new Di(this);
6900
+ _background = new Mi(this);
6789
6901
  get background() {
6790
6902
  return this._background;
6791
6903
  }
6792
6904
  set background(e) {
6793
6905
  this._background.resetProperties().setProperties(e);
6794
6906
  }
6795
- _shape = new Mi(this);
6907
+ _shape = new Ri(this);
6796
6908
  get shape() {
6797
6909
  return this._shape;
6798
6910
  }
@@ -6806,14 +6918,14 @@ var Z = {
6806
6918
  set fill(e) {
6807
6919
  this._fill.resetProperties().setProperties(e);
6808
6920
  }
6809
- _outline = new Ai(this);
6921
+ _outline = new Ii(this);
6810
6922
  get outline() {
6811
6923
  return this._outline;
6812
6924
  }
6813
6925
  set outline(e) {
6814
6926
  this._outline.resetProperties().setProperties(e);
6815
6927
  }
6816
- _foreground = new ki(this);
6928
+ _foreground = new Fi(this);
6817
6929
  get foreground() {
6818
6930
  return this._foreground;
6819
6931
  }
@@ -6827,14 +6939,14 @@ var Z = {
6827
6939
  set text(e) {
6828
6940
  this._text.resetProperties().setProperties(e);
6829
6941
  }
6830
- _shadow = new ji(this);
6942
+ _shadow = new Li(this);
6831
6943
  get shadow() {
6832
6944
  return this._shadow;
6833
6945
  }
6834
6946
  set shadow(e) {
6835
6947
  this._shadow.resetProperties().setProperties(e);
6836
6948
  }
6837
- _connection = new Oi(this);
6949
+ _connection = new Ni(this);
6838
6950
  get connection() {
6839
6951
  return this._connection;
6840
6952
  }
@@ -6905,7 +7017,7 @@ var Z = {
6905
7017
  this._updateGlobalDisplay();
6906
7018
  break;
6907
7019
  case "rotate":
6908
- this.rotation = (t || 0) * lt, this.updateGlobalTransform();
7020
+ this.rotation = (t || 0) * ut, this.updateGlobalTransform();
6909
7021
  break;
6910
7022
  case "scaleX":
6911
7023
  this.scale.x = t, this.text.isValid() && (t ^ n) < 0 && this.requestDraw();
@@ -6926,7 +7038,7 @@ var Z = {
6926
7038
  }), this.extraTransform.translate(this.pivot.x, this.pivot.y), this.updateGlobalTransform();
6927
7039
  break;
6928
7040
  case "transformOrigin": {
6929
- let e = kr(t ?? "");
7041
+ let e = Pr(t ?? "");
6930
7042
  this.pivot.set(e[0] * this.size.width, e[1] * this.size.height);
6931
7043
  break;
6932
7044
  }
@@ -6970,7 +7082,7 @@ var Z = {
6970
7082
  this.requestDraw();
6971
7083
  break;
6972
7084
  }
6973
- if ((Ji.has(e) || qi.has(e)) && this.text.isValid() && this.text.update(), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
7085
+ if ((ea.has(e) || $i.has(e)) && this.text.isValid() && this.text.update(), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
6974
7086
  else switch (e) {
6975
7087
  case "left":
6976
7088
  this.position.x = Number(t);
@@ -6990,24 +7102,24 @@ var Z = {
6990
7102
  super.requestLayout(), this.flexbox.update();
6991
7103
  }
6992
7104
  _process(e) {
6993
- super._process(e), this.foreground.process(e), this.fill.process(e), this.text.process(e), this.outline.process(e), this.background.process(e), this._connection.isValid() && this._updateConnectionTransform();
7105
+ super._process(e), this.foreground.process(e), this.fill.process(e), this.text.process(e), this.outline.process(e), this.background.process(e), this._connection.isValid() && this._updateConnection();
6994
7106
  let t = this.getParent();
6995
7107
  this._parentGlobalDisplay !== t?.globalDisplay && this._updateGlobalDisplay(), this.flexbox.update();
6996
7108
  }
6997
- _updateConnectionTransform() {
6998
- let e = this._connection.resolveAnchor(this._connection.start), t = this._connection.resolveAnchor(this._connection.end);
6999
- if (!e && !t) return;
7000
- let n = e ?? t, r = t ?? e, i = Math.min(n.x, r.x), a = Math.min(n.y, r.y), o = Math.max(Math.abs(r.x - n.x), 1), s = Math.max(Math.abs(r.y - n.y), 1);
7001
- this.position.x = i, this.position.y = a, this.size.width = o, this.size.height = s, this.updateGlobalTransform();
7109
+ _updateConnection() {
7110
+ let e = this._connection.route();
7111
+ if (!e || !e.getLength()) return;
7112
+ let t = e.getBoundingBox(), n = Math.max(t.width, 1), r = Math.max(t.height, 1);
7113
+ this.position.x = t.x, this.position.y = t.y, this.size.width = n, this.size.height = r, this.updateGlobalTransform(), e.applyTransform(new v().translate(-t.x, -t.y)), this._shape.setLocalPath(e);
7002
7114
  }
7003
7115
  _updateStyleFilter(e) {
7004
- d(e) ? (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender()) : (this._colorFilterEffect || (this._colorFilterEffect = new Pr({
7116
+ d(e) ? (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender()) : (this._colorFilterEffect || (this._colorFilterEffect = new zr({
7005
7117
  name: "styleFilter",
7006
7118
  internalMode: "front"
7007
7119
  }), this.append(this._colorFilterEffect)), this._colorFilterEffect.filter = e);
7008
7120
  }
7009
7121
  _updateStyleMaskImage(e) {
7010
- d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new gi({
7122
+ d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new xi({
7011
7123
  name: "styleMaskImage",
7012
7124
  internalMode: "back"
7013
7125
  }), this.append(this._maskEffect)), this._maskEffect.image = e);
@@ -7038,11 +7150,11 @@ var Z = {
7038
7150
  }
7039
7151
  getObb() {
7040
7152
  let e = this.pivot, t = this.transform.apply(e).sub(e);
7041
- return new pt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.rotation);
7153
+ return new mt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.rotation);
7042
7154
  }
7043
7155
  getGlobalObb() {
7044
7156
  let e = this.pivot, t = this.globalTransform.apply(e).sub(e);
7045
- return new pt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.globalRotation);
7157
+ return new mt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.globalRotation);
7046
7158
  }
7047
7159
  _draw() {
7048
7160
  super._draw(), this._background.isValid() && (this._shape.draw(!this._background.fillWithShape), this._background.draw()), this._fill.isValid() && (this._shape.draw(), this._fill.draw()), this._outline.isValid() && (this._shape.draw(), this._outline.draw()), this._foreground.isValid() && (this._shape.draw(!this._foreground.fillWithShape), this._foreground.draw()), this._text.isValid() && this._text.draw(), this._drawContent();
@@ -7094,10 +7206,10 @@ var Z = {
7094
7206
  super._destroy(), this.flexbox.destroy(), this.aabb.destroy(), this.globalAabb.destroy(), this.size.destroy(), this.style.destroy(), this.background.destroy(), this.shape.destroy(), this.fill.destroy(), this.outline.destroy(), this.text.destroy(), this.foreground.destroy(), this.shadow.destroy(), this.connection.destroy(), this._colorFilterEffect = void 0, this._maskEffect = void 0;
7095
7207
  }
7096
7208
  };
7097
- Yi = k([x("Element2D"), O("design:paramtypes", [typeof (Ki = typeof Partial < "u" && Partial) == "function" ? Ki : Object, Array])], Yi);
7209
+ ta = O([x("Element2D"), D("design:paramtypes", [typeof (Qi = typeof Partial < "u" && Partial) == "function" ? Qi : Object, Array])], ta);
7098
7210
  //#endregion
7099
7211
  //#region src/scene/2d/TextureRect2D.ts
7100
- var Xi = class extends Yi {
7212
+ var na = class extends ta {
7101
7213
  texture;
7102
7214
  constructor(e, t = []) {
7103
7215
  super(), this.setProperties(e).append(t);
@@ -7111,8 +7223,8 @@ var Xi = class extends Yi {
7111
7223
  } });
7112
7224
  }
7113
7225
  }
7114
- }, Zi, Qi = class extends Xi {
7115
- texture = new Zn();
7226
+ }, ra, ia = class extends na {
7227
+ texture = new Qn();
7116
7228
  animation;
7117
7229
  constructor(e, t = []) {
7118
7230
  super(), this.setProperties(e), this.append(t);
@@ -7141,10 +7253,10 @@ var Xi = class extends Yi {
7141
7253
  this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw(), super._process(e);
7142
7254
  }
7143
7255
  };
7144
- k([_({ fallback: "" }), O("design:type", String)], Qi.prototype, "src", void 0), Qi = k([x("Lottie2D"), O("design:paramtypes", [typeof (Zi = typeof Partial < "u" && Partial) == "function" ? Zi : Object, Array])], Qi);
7256
+ O([_({ fallback: "" }), D("design:type", String)], ia.prototype, "src", void 0), ia = O([x("Lottie2D"), D("design:paramtypes", [typeof (ra = typeof Partial < "u" && Partial) == "function" ? ra : Object, Array])], ia);
7145
7257
  //#endregion
7146
7258
  //#region src/scene/2d/TransformRect2D.ts
7147
- var $i = class extends Yi {
7259
+ var aa = class extends ta {
7148
7260
  constructor(e, t = []) {
7149
7261
  super(), this.setProperties(e).append(t);
7150
7262
  }
@@ -7157,20 +7269,20 @@ var $i = class extends Yi {
7157
7269
  }
7158
7270
  }
7159
7271
  _drawCircle(e, t) {
7160
- this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle = z.WHITE, this.context.fill(), this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
7272
+ this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle = R.WHITE, this.context.fill(), this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
7161
7273
  }
7162
7274
  _drawEllipse(e, t) {
7163
- this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle = z.WHITE, this.context.fill(), this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
7275
+ this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle = R.WHITE, this.context.fill(), this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
7164
7276
  }
7165
7277
  _draw() {
7166
7278
  let { width: e, height: t } = this.getRect();
7167
7279
  this.context.rect(0, 0, e, t), this.context.strokeStyle = "#00FF00", this.context.stroke(), this._drawCircle(0, 0), this._drawCircle(e, t), this._drawCircle(0, t), this._drawEllipse(0, t / 2), this._drawCircle(e, 0), this._drawEllipse(e, t / 2);
7168
7280
  }
7169
7281
  };
7170
- k([_({ fallback: 6 }), O("design:type", Number)], $i.prototype, "handleSize", void 0);
7282
+ O([_({ fallback: 6 }), D("design:type", Number)], aa.prototype, "handleSize", void 0);
7171
7283
  //#endregion
7172
7284
  //#region src/scene/2d/Video2D.ts
7173
- var ea, ta = class extends Xi {
7285
+ var oa, sa = class extends na {
7174
7286
  get videoDuration() {
7175
7287
  return (this.texture?.duration ?? 0) * 1e3;
7176
7288
  }
@@ -7210,11 +7322,11 @@ var ea, ta = class extends Xi {
7210
7322
  super._process(e), this._updateVideoCurrentTime();
7211
7323
  }
7212
7324
  };
7213
- k([_({ fallback: "" }), O("design:type", String)], ta.prototype, "src", void 0), ta = k([x("Video2D"), O("design:paramtypes", [typeof (ea = typeof Partial < "u" && Partial) == "function" ? ea : Object, Array])], ta);
7325
+ O([_({ fallback: "" }), D("design:type", String)], sa.prototype, "src", void 0), sa = O([x("Video2D"), D("design:paramtypes", [typeof (oa = typeof Partial < "u" && Partial) == "function" ? oa : Object, Array])], sa);
7214
7326
  //#endregion
7215
7327
  //#region src/scene/animation/Animation.ts
7216
- var na, ra = (e) => e, ia = ca(.25, .1, .25, 1), aa = ca(.42, 0, 1, 1), oa = ca(0, 0, .58, 1), sa = ca(.42, 0, .58, 1);
7217
- function ca(e, t, n, r) {
7328
+ var ca, la = (e) => e, ua = ma(.25, .1, .25, 1), da = ma(.42, 0, 1, 1), fa = ma(0, 0, .58, 1), pa = ma(.42, 0, .58, 1);
7329
+ function ma(e, t, n, r) {
7218
7330
  let i = 1e-6, a = 3 * e - 3 * n + 1, o = 3 * n - 6 * e, s = 3 * e, c = 3 * t - 3 * r + 1, l = 3 * r - 6 * t, u = 3 * t, d = (e) => (3 * a * e + 2 * o) * e + s, f = (e) => ((a * e + o) * e + s) * e, p = (e) => ((c * e + l) * e + u) * e;
7219
7331
  function m(e) {
7220
7332
  let t = e, n, r;
@@ -7234,13 +7346,13 @@ function ca(e, t, n, r) {
7234
7346
  }
7235
7347
  return (e) => p(m(e));
7236
7348
  }
7237
- var la = {
7238
- linear: ra,
7239
- ease: ia,
7240
- easeIn: aa,
7241
- easeOut: oa,
7242
- easeInOut: sa
7243
- }, ua = class extends V {
7349
+ var ha = {
7350
+ linear: la,
7351
+ ease: ua,
7352
+ easeIn: da,
7353
+ easeOut: fa,
7354
+ easeInOut: pa
7355
+ }, ga = class extends B {
7244
7356
  _keyframes = [];
7245
7357
  _isFirstUpdatePosition = !1;
7246
7358
  _cachedProps = new t();
@@ -7275,7 +7387,7 @@ var la = {
7275
7387
  e = [this.getParent()].filter(Boolean);
7276
7388
  break;
7277
7389
  }
7278
- return e.filter((e) => e instanceof Yi);
7390
+ return e.filter((e) => e instanceof ta);
7279
7391
  }
7280
7392
  _updateKeyframes() {
7281
7393
  let e = [], t = this.keyframes;
@@ -7307,7 +7419,7 @@ var la = {
7307
7419
  }
7308
7420
  let e = this._getTargets(), t = 1 / e.length, n = this.currentTimeProgress;
7309
7421
  e.forEach((e, r) => {
7310
- let i = t === 1 ? n : dt(Math.max(0, n - t * r) / t, 0, 1), a = this._cachedProps.get(e);
7422
+ let i = t === 1 ? n : ft(Math.max(0, n - t * r) / t, 0, 1), a = this._cachedProps.get(e);
7311
7423
  if (!a) return;
7312
7424
  let o = this._parseKeyframes(i, a);
7313
7425
  o?.length && this._commitStyle(i, e, a, o[0], o[1]);
@@ -7323,10 +7435,10 @@ var la = {
7323
7435
  });
7324
7436
  }
7325
7437
  _parseEasing(e) {
7326
- if (!e) return la.linear;
7327
- if (e in la) return la[e];
7438
+ if (!e) return ha.linear;
7439
+ if (e in ha) return ha[e];
7328
7440
  let t = e.replace(/cubic-bezier\((.+)\)/, "$1").split(",").map((e) => Number(e));
7329
- return ca(t[0], t[1], t[2], t[3]);
7441
+ return ma(t[0], t[1], t[2], t[3]);
7330
7442
  }
7331
7443
  _parseKeyframes(e, t) {
7332
7444
  let n, r = this._keyframes;
@@ -7378,10 +7490,10 @@ var la = {
7378
7490
  let a = Math.max(t[e]?.length ?? 0, n[e]?.length ?? 0), o = t[e], s = n[e];
7379
7491
  i += `${e}(${Array.from({ length: a }, (e, t) => {
7380
7492
  let n = o?.[t], i = s?.[t], a = n?.normalizedIntValue ?? 0, c = i?.normalizedIntValue ?? 0;
7381
- return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 : D(a, c, r);
7493
+ return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 : E(a, c, r);
7382
7494
  }).join(", ")}) `;
7383
7495
  }), i;
7384
- } else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value : D(a.normalizedIntValue, o.normalizedIntValue, r);
7496
+ } else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value : E(a.normalizedIntValue, o.normalizedIntValue, r);
7385
7497
  }
7386
7498
  isPlaying() {
7387
7499
  return !this.paused && this.isInsideTimeRange();
@@ -7404,14 +7516,14 @@ var la = {
7404
7516
  });
7405
7517
  }
7406
7518
  };
7407
- k([_({ fallback: "parent" }), O("design:type", Object)], ua.prototype, "effectMode", void 0), k([_({ default: () => [] }), O("design:type", Array)], ua.prototype, "keyframes", void 0), k([_(), O("design:type", Object)], ua.prototype, "easing", void 0), ua = k([x("Animation", {
7519
+ O([_({ fallback: "parent" }), D("design:type", Object)], ga.prototype, "effectMode", void 0), O([_({ default: () => [] }), D("design:type", Array)], ga.prototype, "keyframes", void 0), O([_(), D("design:type", Object)], ga.prototype, "easing", void 0), ga = O([x("Animation", {
7408
7520
  renderMode: "disabled",
7409
7521
  processSortMode: "parent-before",
7410
7522
  duration: 2e3
7411
- }), O("design:paramtypes", [typeof (na = typeof Partial < "u" && Partial) == "function" ? na : Object, Array])], ua);
7523
+ }), D("design:paramtypes", [typeof (ca = typeof Partial < "u" && Partial) == "function" ? ca : Object, Array])], ga);
7412
7524
  //#endregion
7413
7525
  //#region src/scene/audio/html/HTMLAudioContext.ts
7414
- var da = class t extends e {
7526
+ var _a = class t extends e {
7415
7527
  static _instance;
7416
7528
  static get instance() {
7417
7529
  return this._instance ||= new t(), this._instance;
@@ -7441,7 +7553,7 @@ var da = class t extends e {
7441
7553
  togglePause() {
7442
7554
  return this.paused = !this.paused, this.refreshPaused(), this.paused;
7443
7555
  }
7444
- }, fa = class t extends e {
7556
+ }, va = class t extends e {
7445
7557
  static PADDING = .1;
7446
7558
  _source = null;
7447
7559
  _audio = null;
@@ -7568,7 +7680,7 @@ var da = class t extends e {
7568
7680
  let e = this._source;
7569
7681
  e && (e.onended = null, e.onplay = null, e.onpause = null, this._stop()), this._source = null, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._end = 0, this._start = 0, this._duration = 0, this._playing = !1, this._pausedReal = !1, this._paused = !1, this._muted = !1, this._audio &&= (this._audio.context.off("refresh", this.refresh), this._audio.context.off("refreshPaused", this.refreshPaused), null);
7570
7682
  }
7571
- }, pa = class {
7683
+ }, ya = class {
7572
7684
  parent;
7573
7685
  source = new globalThis.Audio();
7574
7686
  _src = "";
@@ -7585,7 +7697,7 @@ var da = class t extends e {
7585
7697
  return !!this.source && this.source.readyState === 4;
7586
7698
  }
7587
7699
  get context() {
7588
- return da.instance;
7700
+ return _a.instance;
7589
7701
  }
7590
7702
  constructor(e) {
7591
7703
  this.parent = e;
@@ -7596,9 +7708,9 @@ var da = class t extends e {
7596
7708
  });
7597
7709
  }
7598
7710
  createSound() {
7599
- return new fa();
7711
+ return new va();
7600
7712
  }
7601
- }, ma = class extends e {
7713
+ }, ba = class extends e {
7602
7714
  _input;
7603
7715
  _output;
7604
7716
  _processers = [];
@@ -7620,7 +7732,7 @@ var da = class t extends e {
7620
7732
  get destination() {
7621
7733
  return this._input;
7622
7734
  }
7623
- }, ha = class {
7735
+ }, xa = class {
7624
7736
  destination;
7625
7737
  source;
7626
7738
  constructor(e, t = null) {
@@ -7635,21 +7747,21 @@ var da = class t extends e {
7635
7747
  };
7636
7748
  //#endregion
7637
7749
  //#region src/scene/audio/web/WebAudioContext.ts
7638
- function ga() {
7639
- if (Ie) return new AudioContext();
7640
- if (Le) {
7750
+ function Sa() {
7751
+ if (Le) return new AudioContext();
7752
+ if (Re) {
7641
7753
  let e = globalThis.webkitAudioContext;
7642
7754
  return new e();
7643
7755
  } else throw Error("Failed to createAudioContext");
7644
7756
  }
7645
- function _a(e, t, n) {
7646
- if (Re) return new OfflineAudioContext(e, t, n);
7647
- if (ze) {
7757
+ function Ca(e, t, n) {
7758
+ if (ze) return new OfflineAudioContext(e, t, n);
7759
+ if (Be) {
7648
7760
  let r = globalThis.webkitOfflineAudioContext;
7649
7761
  return new r(e, t, n);
7650
7762
  } else throw Error("Failed to createOfflineAudioContext");
7651
7763
  }
7652
- var va = class e extends ma {
7764
+ var wa = class e extends ba {
7653
7765
  static _instance;
7654
7766
  static get instance() {
7655
7767
  return this._instance ||= new e(), this._instance;
@@ -7690,8 +7802,8 @@ var va = class e extends ma {
7690
7802
  _compressor;
7691
7803
  _analyser;
7692
7804
  constructor() {
7693
- let e = ga(), t = _a(1, 2, Re ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
7694
- r.connect(n), n.connect(e.destination), super(r, n), this._context = e, this._offlineContext = t, this._compressor = n, this._analyser = r, this._locked = e.state === "suspended" && (C || Pe), Ve && (this._locked && (this._unlock(), document.addEventListener("mousedown", this._unlock, !0), document.addEventListener("touchstart", this._unlock, !0), document.addEventListener("touchend", this._unlock, !0)), globalThis.addEventListener("focus", this._onFocus), globalThis.addEventListener("blur", this._onBlur));
7805
+ let e = Sa(), t = Ca(1, 2, ze ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
7806
+ r.connect(n), n.connect(e.destination), super(r, n), this._context = e, this._offlineContext = t, this._compressor = n, this._analyser = r, this._locked = e.state === "suspended" && (Pe || Fe), He && (this._locked && (this._unlock(), document.addEventListener("mousedown", this._unlock, !0), document.addEventListener("touchstart", this._unlock, !0), document.addEventListener("touchend", this._unlock, !0)), globalThis.addEventListener("focus", this._onFocus), globalThis.addEventListener("blur", this._onBlur));
7695
7807
  }
7696
7808
  _onFocus() {
7697
7809
  if (!this.autoPause) return;
@@ -7731,7 +7843,7 @@ var va = class e extends ma {
7731
7843
  setParamValue(e, t) {
7732
7844
  e.setValueAtTime ? e.setValueAtTime(t, this._context.currentTime) : e.value = t;
7733
7845
  }
7734
- }, ya = class extends e {
7846
+ }, Ta = class extends e {
7735
7847
  _audio = null;
7736
7848
  _sourceNode = null;
7737
7849
  _gain = null;
@@ -7864,7 +7976,7 @@ var va = class e extends ma {
7864
7976
  destroy() {
7865
7977
  super.destroy(), this._stop(), this._gain?.disconnect(), this._gain = null, this._audio?.context.off("refresh", this.refresh), this._audio?.context.off("refreshPaused", this.refreshPaused), this._audio = null, this._processors.forEach((e) => e.disconnect()), this._processors.length = 0, this._end = 0, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._elapsed = 0, this._duration = 0, this._paused = !1, this._muted = !1, this._pausedReal = !1;
7866
7978
  }
7867
- }, ba = class extends ma {
7979
+ }, Ea = class extends ba {
7868
7980
  parent;
7869
7981
  _sourceBuffer;
7870
7982
  _sourceNode;
@@ -7872,7 +7984,7 @@ var va = class e extends ma {
7872
7984
  gain;
7873
7985
  analyser;
7874
7986
  get context() {
7875
- return va.instance;
7987
+ return wa.instance;
7876
7988
  }
7877
7989
  get isPlayable() {
7878
7990
  return !!this._sourceNode.buffer;
@@ -7887,8 +7999,8 @@ var va = class e extends ma {
7887
7999
  this._sourceNode.buffer = e;
7888
8000
  }
7889
8001
  constructor(e) {
7890
- let t = va.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
7891
- n.connect(i), i.connect(r), r.connect(va.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
8002
+ let t = wa.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
8003
+ n.connect(i), i.connect(r), r.connect(wa.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
7892
8004
  }
7893
8005
  async load() {
7894
8006
  return this._sourceLoad ||= new Promise((e) => {
@@ -7901,7 +8013,7 @@ var va = class e extends ma {
7901
8013
  });
7902
8014
  }
7903
8015
  _decode(e) {
7904
- return Promise.resolve(e instanceof AudioBuffer ? e : va.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
8016
+ return Promise.resolve(e instanceof AudioBuffer ? e : wa.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
7905
8017
  }
7906
8018
  cloneSource() {
7907
8019
  let e = this.context, t = this._sourceNode, n = e.audioContext.createBufferSource(), r = e.audioContext.createGain();
@@ -7911,15 +8023,15 @@ var va = class e extends ma {
7911
8023
  };
7912
8024
  }
7913
8025
  createSound() {
7914
- return new ya();
8026
+ return new Ta();
7915
8027
  }
7916
- }, xa, Sa = class extends V {
8028
+ }, Da, Oa = class extends B {
7917
8029
  static {
7918
- xa = this;
8030
+ Da = this;
7919
8031
  }
7920
8032
  static _soundPool = [];
7921
8033
  _sounds = [];
7922
- _platformAudio = Be ? new ba(this) : new pa(this);
8034
+ _platformAudio = Ve ? new Ea(this) : new ya(this);
7923
8035
  get platformAudio() {
7924
8036
  return this._platformAudio;
7925
8037
  }
@@ -8012,7 +8124,7 @@ var va = class e extends ma {
8012
8124
  this._sounds.length = 0;
8013
8125
  }
8014
8126
  _createSound() {
8015
- return xa._soundPool.length > 0 ? xa._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
8127
+ return Da._soundPool.length > 0 ? Da._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
8016
8128
  }
8017
8129
  refresh() {
8018
8130
  for (let e = this._sounds.length, t = 0; t < e; t++) this._sounds[t].refresh();
@@ -8028,7 +8140,7 @@ var va = class e extends ma {
8028
8140
  this._recycleSound(e);
8029
8141
  };
8030
8142
  _recycleSound(e) {
8031
- e.destroy(), xa._soundPool.includes(e) || xa._soundPool.push(e);
8143
+ e.destroy(), Da._soundPool.includes(e) || Da._soundPool.push(e);
8032
8144
  }
8033
8145
  _prevTime = 0;
8034
8146
  _timer = 0;
@@ -8044,12 +8156,12 @@ var va = class e extends ma {
8044
8156
  }, 100);
8045
8157
  }
8046
8158
  };
8047
- Sa = xa = k([x("Audio"), O("design:paramtypes", [Object])], Sa);
8159
+ Oa = Da = O([x("Audio"), D("design:paramtypes", [Object])], Oa);
8048
8160
  //#endregion
8049
8161
  //#region src/scene/audio/AudioSpectrum.ts
8050
- var Ca = class extends wr {}, wa, Ta = class extends Yi {
8162
+ var ka = class extends wr {}, Aa, ja = class extends ta {
8051
8163
  _audioBuffer;
8052
- _src = Ve ? new z({ source: document.createElement("canvas") }) : void 0;
8164
+ _src = He ? new R({ source: document.createElement("canvas") }) : void 0;
8053
8165
  _needsUpdateTexture = !1;
8054
8166
  constructor(e = {}) {
8055
8167
  super(), this.setProperties(e);
@@ -8068,7 +8180,7 @@ var Ca = class extends wr {}, wa, Ta = class extends Yi {
8068
8180
  }
8069
8181
  }
8070
8182
  async _loadSrc(e) {
8071
- await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => va.decode(e)).then((e) => {
8183
+ await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => wa.decode(e)).then((e) => {
8072
8184
  this._audioBuffer = e, this.syncTexture(!0);
8073
8185
  });
8074
8186
  }
@@ -8103,16 +8215,16 @@ var Ca = class extends wr {}, wa, Ta = class extends Yi {
8103
8215
  this.syncTexture(), super._process(e);
8104
8216
  }
8105
8217
  };
8106
- k([_(), O("design:type", Object)], Ta.prototype, "src", void 0), k([_({ fallback: 0 }), O("design:type", Number)], Ta.prototype, "gap", void 0), k([_({ fallback: "#000000" }), O("design:type", String)], Ta.prototype, "color", void 0), Ta = k([x("AudioWaveform"), O("design:paramtypes", [typeof (wa = typeof Partial < "u" && Partial) == "function" ? wa : Object])], Ta);
8218
+ O([_(), D("design:type", Object)], ja.prototype, "src", void 0), O([_({ fallback: 0 }), D("design:type", Number)], ja.prototype, "gap", void 0), O([_({ fallback: "#000000" }), D("design:type", String)], ja.prototype, "color", void 0), ja = O([x("AudioWaveform"), D("design:paramtypes", [typeof (Aa = typeof Partial < "u" && Partial) == "function" ? Aa : Object])], ja);
8107
8219
  //#endregion
8108
8220
  //#region src/scene/transitions/KawaseTransition.ts
8109
- var Ea, Da = class extends Sr {
8221
+ var Ma, Na = class extends Sr {
8110
8222
  static {
8111
- Ea = this;
8223
+ Ma = this;
8112
8224
  }
8113
8225
  blur = 10;
8114
8226
  quality = 10;
8115
- static material = new I({ gl: {
8227
+ static material = new F({ gl: {
8116
8228
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
8117
8229
  fragment: "precision highp float;\nin vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 offset;\nuniform float progress;\n\nvoid main(void) {\n vec2 offset1 = vec2(offset.x - progress * offset.x, offset.y - progress * offset.y);\n vec4 color = vec4(0.0);\n color += texture(sampler, vec2(vUv.x - offset1.x, vUv.y + offset1.y));\n color += texture(sampler, vec2(vUv.x + offset1.x, vUv.y + offset1.y));\n color += texture(sampler, vec2(vUv.x + offset1.x, vUv.y - offset1.y));\n color += texture(sampler, vec2(vUv.x - offset1.x, vUv.y - offset1.y));\n color *= 0.25;\n gl_FragColor = color;\n}"
8118
8230
  } });
@@ -8127,7 +8239,7 @@ var Ea, Da = class extends Sr {
8127
8239
  let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
8128
8240
  for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
8129
8241
  m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
8130
- L.draw(e, Ea.material, {
8242
+ I.draw(e, Ma.material, {
8131
8243
  sampler: r,
8132
8244
  progress: i,
8133
8245
  ...t
@@ -8135,35 +8247,35 @@ var Ea, Da = class extends Sr {
8135
8247
  });
8136
8248
  }
8137
8249
  };
8138
- Da = Ea = k([x("KawaseTransition")], Da);
8250
+ Na = Ma = O([x("KawaseTransition")], Na);
8139
8251
  //#endregion
8140
8252
  //#region src/scene/transitions/LeftEraseTransition.ts
8141
- var Oa, ka = class extends Sr {
8253
+ var Pa, Fa = class extends Sr {
8142
8254
  static {
8143
- Oa = this;
8255
+ Pa = this;
8144
8256
  }
8145
- static material = new I({ gl: {
8257
+ static material = new F({ gl: {
8146
8258
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
8147
8259
  fragment: "precision highp float;\nvarying vec2 vUv;\nuniform float progress;\nuniform sampler2D previous;\nuniform sampler2D next;\n\nfloat easeInOutQuint(float t) {\n return t < 0.5 ? 16.0*t*t*t*t*t : 1.0+16.0*(--t)*t*t*t*t;\n}\n\nvoid main() {\n vec4 src1Color = texture2D(previous, vUv);\n vec4 src2Color = texture2D(next, vUv);\n float mProgress = 1.0 - progress;\n float mixPercent = 0.0;\n if (vUv.x <= mProgress) {\n mixPercent = 1.0;\n }\n gl_FragColor = mix(src2Color, src1Color, mixPercent);\n}"
8148
8260
  } });
8149
8261
  apply(e) {
8150
- L.draw(e, Oa.material, {
8262
+ I.draw(e, Pa.material, {
8151
8263
  previous: 0,
8152
8264
  next: 1,
8153
8265
  progress: this.currentTimeProgress
8154
8266
  });
8155
8267
  }
8156
8268
  };
8157
- ka = Oa = k([x("LeftEraseTransition")], ka);
8269
+ Fa = Pa = O([x("LeftEraseTransition")], Fa);
8158
8270
  //#endregion
8159
8271
  //#region src/scene/transitions/TiltShiftTransition.ts
8160
- var Aa, ja = class extends Sr {
8272
+ var Ia, La = class extends Sr {
8161
8273
  static {
8162
- Aa = this;
8274
+ Ia = this;
8163
8275
  }
8164
8276
  blur = 100;
8165
8277
  gradientBlur = 600;
8166
- static material = new I({ gl: {
8278
+ static material = new F({ gl: {
8167
8279
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
8168
8280
  fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\nuniform float progress;\n\nfloat random(vec3 scale, float seed) {\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void) {\n float blur1 = blur - progress * blur;\n float gradientBlur1 = progress * gradientBlur;\n\n vec4 color = vec4(0.0);\n float total = 0.0;\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vUv * texSize - start, normal)) / gradientBlur1) * blur1;\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample1 = texture2D(sampler, vUv + delta / texSize * percent * radius);\n sample1.rgb *= sample1.a;\n color += sample1 * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}"
8169
8281
  } });
@@ -8171,7 +8283,7 @@ var Aa, ja = class extends Sr {
8171
8283
  let n = this.currentTimeProgress, r, i;
8172
8284
  n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
8173
8285
  let a = t.width, o = t.height, s = [0, o / 2], c = [600, o / 2], l = [a, o], u = c[0] - s[0], d = c[1] - s[1], f = Math.sqrt(u * u + d * d);
8174
- L.draw(e, Aa.material, {
8286
+ I.draw(e, Ia.material, {
8175
8287
  sampler: r,
8176
8288
  progress: i,
8177
8289
  blur: this.blur,
@@ -8180,7 +8292,7 @@ var Aa, ja = class extends Sr {
8180
8292
  end: c,
8181
8293
  delta: [u / f, d / f],
8182
8294
  texSize: l
8183
- }), L.draw(e, Aa.material, {
8295
+ }), I.draw(e, Ia.material, {
8184
8296
  sampler: r,
8185
8297
  progress: i,
8186
8298
  blur: this.blur,
@@ -8192,18 +8304,18 @@ var Aa, ja = class extends Sr {
8192
8304
  });
8193
8305
  }
8194
8306
  };
8195
- ja = Aa = k([x("TiltShiftTransition")], ja);
8307
+ La = Ia = O([x("TiltShiftTransition")], La);
8196
8308
  //#endregion
8197
8309
  //#region src/scene/transitions/TwistTransition.ts
8198
- var Ma, Na = class extends Sr {
8310
+ var Ra, za = class extends Sr {
8199
8311
  static {
8200
- Ma = this;
8312
+ Ra = this;
8201
8313
  }
8202
8314
  radius;
8203
8315
  angle = 4;
8204
8316
  padding = 20;
8205
8317
  offset;
8206
- static material = new I({ gl: {
8318
+ static material = new F({ gl: {
8207
8319
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
8208
8320
  fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\nuniform float progress;\n\nvec2 mapCoord(vec2 coord) {\n coord -= filterArea.zw;\n coord *= filterArea.xy;\n return coord;\n}\n\nvec2 unmapCoord(vec2 coord) {\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n return coord;\n}\n\nvec2 twist(vec2 coord, float radius) {\n coord -= offset;\n float dist = length(coord);\n if (dist < radius) {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n coord += offset;\n return coord;\n}\n\nvoid main(void) {\n vec2 coord = mapCoord(vUv);\n coord = twist(coord, radius - (progress * radius));\n coord = unmapCoord(coord);\n gl_FragColor = texture2D(sampler, coord);\n}"
8209
8321
  } });
@@ -8211,7 +8323,7 @@ var Ma, Na = class extends Sr {
8211
8323
  let n = this.currentTimeProgress, r, i;
8212
8324
  n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
8213
8325
  let a = t.width, o = t.height;
8214
- L.draw(e, Ma.material, {
8326
+ I.draw(e, Ra.material, {
8215
8327
  sampler: r,
8216
8328
  progress: i,
8217
8329
  filterArea: [
@@ -8227,16 +8339,16 @@ var Ma, Na = class extends Sr {
8227
8339
  });
8228
8340
  }
8229
8341
  };
8230
- Na = Ma = k([x("TwistTransition")], Na);
8342
+ za = Ra = O([x("TwistTransition")], za);
8231
8343
  //#endregion
8232
8344
  //#region src/asset/loaders/GifLoader.ts
8233
- var Pa = class extends Mn {
8345
+ var Ba = class extends Nn {
8234
8346
  install(e) {
8235
8347
  let t = async (t) => {
8236
8348
  let { decodeFrames: n } = await import("modern-gif");
8237
- return await t.arrayBuffer().then((t) => n(t, e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0)).then((e) => new Xn(e.map((e) => ({
8349
+ return await t.arrayBuffer().then((t) => n(t, e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0)).then((e) => new Zn(e.map((e) => ({
8238
8350
  duration: e.delay,
8239
- texture: new er({
8351
+ texture: new tr({
8240
8352
  source: e.data,
8241
8353
  width: e.width,
8242
8354
  height: e.height
@@ -8247,14 +8359,14 @@ var Pa = class extends Mn {
8247
8359
  e.register(n, t);
8248
8360
  }), e.gif = this, this;
8249
8361
  }
8250
- }, Fa = class extends Mn {
8362
+ }, Va = class extends Nn {
8251
8363
  install(e) {
8252
8364
  let t = async (e) => JSON.parse(await e.text());
8253
8365
  return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
8254
8366
  e.register(n, t);
8255
8367
  }), e.json = this, this;
8256
8368
  }
8257
- }, Ia = class extends Mn {
8369
+ }, Ha = class extends Nn {
8258
8370
  install(e) {
8259
8371
  return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
8260
8372
  container: null,
@@ -8265,14 +8377,14 @@ var Pa = class extends Mn {
8265
8377
  animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
8266
8378
  }), e.lottie = this, this;
8267
8379
  }
8268
- }, La = class extends Mn {
8380
+ }, Ua = class extends Nn {
8269
8381
  install(e) {
8270
8382
  let t = async (e) => e.text();
8271
8383
  return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
8272
8384
  }
8273
- }, Ra = class extends Mn {
8385
+ }, Wa = class extends Nn {
8274
8386
  install(e) {
8275
- let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new z({
8387
+ let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new R({
8276
8388
  source: e,
8277
8389
  uploadMethodId: "image",
8278
8390
  mipmap: !0,
@@ -8294,11 +8406,11 @@ var Pa = class extends Mn {
8294
8406
  e.register(n, t);
8295
8407
  }), e.texture = this, this;
8296
8408
  }
8297
- }, za = class extends Mn {
8409
+ }, Ga = class extends Nn {
8298
8410
  install(e) {
8299
- return this.load = (t) => e.awaitBy(() => new nr(t).load()), e.video = this, this;
8411
+ return this.load = (t) => e.awaitBy(() => new rr(t).load()), e.video = this, this;
8300
8412
  }
8301
- }, Ba = Object.entries({
8413
+ }, Ka = Object.entries({
8302
8414
  "font/woff": ["woff"],
8303
8415
  "font/ttf": ["ttf"],
8304
8416
  "font/otf": ["otf"],
@@ -8314,31 +8426,31 @@ var Pa = class extends Mn {
8314
8426
  "image/webp": ["webp"],
8315
8427
  "application/json": ["json"]
8316
8428
  });
8317
- function Va(e) {
8318
- for (let [t, n] of Ba) if (n.includes(e)) return t;
8429
+ function qa(e) {
8430
+ for (let [t, n] of Ka) if (n.includes(e)) return t;
8319
8431
  }
8320
- function Ha(e) {
8432
+ function Ja(e) {
8321
8433
  let t;
8322
8434
  if (e.startsWith("data:")) t = e.match(/^data:(.+?);/)?.[1];
8323
8435
  else if (e.startsWith("http")) {
8324
8436
  let n = e.split(/[#?]/)[0].split(".").pop()?.trim();
8325
- n && (t = Va(n));
8437
+ n && (t = qa(n));
8326
8438
  }
8327
8439
  return t;
8328
8440
  }
8329
8441
  //#endregion
8330
8442
  //#region src/asset/Assets.ts
8331
- var Ua = "WeakRef" in globalThis, Wa = class extends e {
8443
+ var Ya = "WeakRef" in globalThis, Xa = class extends e {
8332
8444
  defaultHandler = (e) => e;
8333
8445
  _handlers = /* @__PURE__ */ new Map();
8334
8446
  _handleing = /* @__PURE__ */ new Map();
8335
8447
  _handled = /* @__PURE__ */ new Map();
8336
- _gc = Ua ? new FinalizationRegistry((e) => {
8448
+ _gc = Ya ? new FinalizationRegistry((e) => {
8337
8449
  let t = this.get(e);
8338
8450
  t && "destroy" in t && t.destroy(), this._handled.delete(e);
8339
8451
  }) : void 0;
8340
8452
  constructor() {
8341
- super(), Ua || S.on(this.gc.bind(this), { sort: 2 });
8453
+ super(), Ya || S.on(this.gc.bind(this), { sort: 2 });
8342
8454
  }
8343
8455
  use(e) {
8344
8456
  return e.install(this), this;
@@ -8382,11 +8494,11 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
8382
8494
  }
8383
8495
  get(e) {
8384
8496
  let t = this._handled.get(e);
8385
- return Ua && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
8497
+ return Ya && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
8386
8498
  }
8387
8499
  set(e, t) {
8388
8500
  let n = t;
8389
- Ua && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
8501
+ Ya && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
8390
8502
  }
8391
8503
  async awaitBy(e) {
8392
8504
  let t = e(), n = c();
@@ -8401,7 +8513,7 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
8401
8513
  return this._handleing.set(e, r), r;
8402
8514
  }
8403
8515
  async load(e, t) {
8404
- let n = await this.loadBy(e), r = Ha(e);
8516
+ let n = await this.loadBy(e), r = Ja(e);
8405
8517
  return r === void 0 && (r = n.type?.split(";")[0] ?? void 0), ((r ? this._handlers.get(r) : void 0) ?? this.defaultHandler)(n, t);
8406
8518
  }
8407
8519
  async waitUntilLoad() {
@@ -8415,14 +8527,14 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
8415
8527
  n && "destroy" in n && n.destroy();
8416
8528
  }), this._handled.clear();
8417
8529
  }
8418
- }, $ = new Wa().use(new Nn()).use(new Pa()).use(new Fa()).use(new Ia()).use(new La()).use(new Ra()).use(new za()), Ga = {
8530
+ }, $ = new Xa().use(new Pn()).use(new Ba()).use(new Va()).use(new Ha()).use(new Ua()).use(new Wa()).use(new Ga()), Za = {
8419
8531
  alpha: !0,
8420
8532
  stencil: !0,
8421
8533
  antialias: !1,
8422
8534
  premultipliedAlpha: !0,
8423
8535
  preserveDrawingBuffer: !1,
8424
8536
  powerPreference: "default"
8425
- }, Ka = class extends br {
8537
+ }, Qa = class extends U {
8426
8538
  renderer;
8427
8539
  get view() {
8428
8540
  return this.renderer.view;
@@ -8453,14 +8565,14 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
8453
8565
  }
8454
8566
  }) : void 0;
8455
8567
  constructor(e = {}) {
8456
- let { view: t, width: n, height: r, pixelRatio: i = Ue, autoResize: a, data: o } = e;
8457
- super(), this.renderer = new jn(t, {
8458
- alpha: Ga.alpha ?? e.alpha,
8459
- stencil: Ga.stencil ?? e.stencil,
8460
- antialias: Ga.antialias ?? e.antialias,
8461
- premultipliedAlpha: Ga.premultipliedAlpha ?? e.premultipliedAlpha,
8462
- preserveDrawingBuffer: Ga.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
8463
- powerPreference: Ga.powerPreference ?? e.powerPreference
8568
+ let { view: t, width: n, height: r, pixelRatio: i = We, autoResize: a, data: o } = e;
8569
+ super(), this.renderer = new Mn(t, {
8570
+ alpha: Za.alpha ?? e.alpha,
8571
+ stencil: Za.stencil ?? e.stencil,
8572
+ antialias: Za.antialias ?? e.antialias,
8573
+ premultipliedAlpha: Za.premultipliedAlpha ?? e.premultipliedAlpha,
8574
+ preserveDrawingBuffer: Za.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
8575
+ powerPreference: Za.powerPreference ?? e.powerPreference
8464
8576
  }), this._setupInput(), this.pixelRatio = i, a ? !t && this.renderer.view && (this.renderer.view.style.width = "100%", this.renderer.view.style.height = "100%") : this.resize(n || this.gl.drawingBufferWidth || this.view?.clientWidth || 200, r || this.gl.drawingBufferHeight || this.view?.clientHeight || 200, !t), this.setProperties(e), o && this.root.append(o);
8465
8577
  }
8466
8578
  _updateProperty(e, t, n) {
@@ -8544,22 +8656,22 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
8544
8656
  super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
8545
8657
  }
8546
8658
  };
8547
- k([_({ fallback: !1 }), O("design:type", Boolean)], Ka.prototype, "autoResize", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Ka.prototype, "autoStart", void 0);
8659
+ O([_({ fallback: !1 }), D("design:type", Boolean)], Qa.prototype, "autoResize", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], Qa.prototype, "autoStart", void 0);
8548
8660
  //#endregion
8549
8661
  //#region src/render.ts
8550
- var qa, Ja = [], Ya = !1;
8551
- function Xa() {
8552
- return qa ??= new Ka({
8662
+ var $a, eo = [], to = !1;
8663
+ function no() {
8664
+ return $a ??= new Qa({
8553
8665
  pixelRatio: 1,
8554
8666
  width: 1,
8555
8667
  height: 1,
8556
8668
  preserveDrawingBuffer: !0
8557
8669
  });
8558
8670
  }
8559
- async function Za(e = 100) {
8560
- if (!Ya) {
8561
- for (Ya = !0; Ja.length;) {
8562
- let t = Ja.shift();
8671
+ async function ro(e = 100) {
8672
+ if (!to) {
8673
+ for (to = !0; eo.length;) {
8674
+ let t = eo.shift();
8563
8675
  if (t) try {
8564
8676
  await t();
8565
8677
  } catch (e) {
@@ -8567,11 +8679,11 @@ async function Za(e = 100) {
8567
8679
  }
8568
8680
  else await new Promise((t) => setTimeout(t, e));
8569
8681
  }
8570
- Ya = !1;
8682
+ to = !1;
8571
8683
  }
8572
8684
  }
8573
- async function Qa(e) {
8574
- let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f = Xa();
8685
+ async function io(e) {
8686
+ let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f = no();
8575
8687
  if (f.resetProperties(), f.setProperties(l), f.debug = t, f.fonts = n, f.timeline.currentTime = 0, f.resize(u, d, !0), f.root.removeChildren(!0), f.root.append(a), await s?.(f), await f.waitAndRender(), o.length) {
8576
8688
  let e = o.length, t = o[e - 1];
8577
8689
  for (let n = 0; n < e; n++) {
@@ -8589,15 +8701,15 @@ async function Qa(e) {
8589
8701
  toCanvas2D: () => f.toCanvas2D(new ImageData(p, u, d))
8590
8702
  };
8591
8703
  }
8592
- async function $a(e) {
8704
+ async function ao(e) {
8593
8705
  return new Promise((t) => {
8594
- Ja.push(async () => t(await Qa(e).then((e) => e.toCanvas2D()))), Za();
8706
+ eo.push(async () => t(await io(e).then((e) => e.toCanvas2D()))), ro();
8595
8707
  });
8596
8708
  }
8597
- async function eo(e) {
8709
+ async function oo(e) {
8598
8710
  return new Promise((t) => {
8599
- Ja.push(async () => t(await Qa(e).then((e) => e.pixels))), Za();
8711
+ eo.push(async () => t(await io(e).then((e) => e.pixels))), ro();
8600
8712
  });
8601
8713
  }
8602
8714
  //#endregion
8603
- export { ct as Aabb2D, Xn as AnimatedTexture, ua as Animation, Wa as Assets, Sa as Audio, ma as AudioPipeline, ha as AudioProcessor, Ca as AudioSpectrum, Ta as AudioWaveform, A as BufferUsage, Er as Camera2D, ir as CanvasContext, pr as CanvasItem, Zn as CanvasTexture, E as Color, W as ColorAdjustEffect, Pr as ColorFilterEffect, ft as ColorMatrix, Rr as ColorOverlayEffect, Vr as ColorRemoveEffect, Gr as ColorReplaceEffect, Qn as ColorTexture, w as CoreObject, lt as DEG_TO_RAD, Ue as DEVICE_PIXEL_RATIO, G as DrawboardEffect, ti as DropShadowEffect, U as Effect, qn as EffectMaterial, Yi as Element2D, Di as Element2DBackground, Oi as Element2DConnection, Y as Element2DFill, ki as Element2DForeground, Ai as Element2DOutline, ji as Element2DShadow, Mi as Element2DShape, Ni as Element2DStyle, X as Element2DText, ii as EmbossEffect, Ka as Engine, Gi as Flexbox, Nn as FontLoader, Qr as GaussianBlurEffect, Rn as Geometry, Pa as GifLoader, $t as GlBatch2DSystem, Yt as GlBlendMode, _t as GlBuffer, Tt as GlBufferSystem, gt as GlBufferTarget, rn as GlMaskSystem, Lt as GlProgram, cn as GlRenderTarget, ln as GlRenderTargetSystem, Kt as GlShaderSystem, Zt as GlState, Qt as GlStateSystem, on as GlStencilSystem, j as GlSystem, sn as GlViewportSystem, K as GlitchEffect, q as GodrayEffect, $n as GradientTexture, pa as HTMLAudio, da as HTMLAudioContext, fa as HTMLSound, Ve as IN_BROWSER, He as IN_MAC_OS, Fn as IndexBuffer, ot as Input, et as InputEvent, Fa as JsonLoader, pi as KawaseBlurEffect, Da as KawaseTransition, tt as KeyboardInputEvent, ka as LeftEraseTransition, Mn as Loader, Qi as Lottie2D, Ia as LottieLoader, ht as MainLoop, gi as MaskEffect, I as Material, or as Meta, nt as MouseInputEvent, B as Node, wr as Node2D, pt as Obb2D, J as OutlineEffect, _e as PI, ve as PI_2, Si as PixelateEffect, er as PixelsTexture, rt as PointerInputEvent, mt as Projection2D, Vn as QuadGeometry, L as QuadUvGeometry, ut as RAD_TO_DEG, st as RefCounted, R as RenderTarget, yt as Renderer, T as Resource, Ie as SUPPORTS_AUDIO_CONTEXT, Pe as SUPPORTS_CLICK_EVENTS, Fe as SUPPORTS_CREATE_IMAGE_BITMAP, ke as SUPPORTS_IMAGE_BITMAP, Ne as SUPPORTS_MOUSE_EVENTS, Re as SUPPORTS_OFFLINE_AUDIO_CONTEXT, je as SUPPORTS_POINTER_EVENTS, Ae as SUPPORTS_RESIZE_OBSERVER, C as SUPPORTS_TOUCH_EVENTS, Oe as SUPPORTS_WEBGL2, Le as SUPPORTS_WEBKIT_AUDIO_CONTEXT, ze as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, Be as SUPPORTS_WEB_AUDIO, Me as SUPPORTS_WHEEL_EVENTS, br as SceneTree, La as TextLoader, z as Texture2D, Ra as TextureLoader, Xi as TextureRect2D, S as Ticker, ja as TiltShiftTransition, vr as Timeline, V as TimelineNode, $i as TransformRect2D, Sr as Transition, Na as TwistTransition, xt as UniformGroup, Yn as UvGeometry, Jn as UvMaterial, F as VertexAttribute, P as VertexBuffer, ta as Video2D, za as VideoLoader, nr as VideoTexture, H as Viewport, rr as ViewportTexture, ba as WebAudio, va as WebAudioContext, jn as WebGLRenderer, ya as WebSound, it as WheelInputEvent, yr as Window, Ti as ZoomBlurEffect, Q as alignMap, $ as assets, Wi as boxSizingMap, dt as clamp, fi as clampFrag, Ye as createHTMLCanvas, wt as createIdFromString, he as createNode, Ze as crossOrigin, ca as cubicBezier, x as customNode, me as customNodes, Ga as defaultOptions, Xe as determineCrossOrigin, Ri as directionMap, Li as displayMap, ia as ease, aa as easeIn, sa as easeInOut, oa as easeOut, Z as edgeMap, zi as flexDirectionMap, Bi as flexWrapMap, di as frag, Ce as getDefaultCssPropertyValue, Xa as getRenderEngine, Ii as gutterMap, $e as instanceId, qe as isCanvasElement, We as isElementNode, Ke as isImageElement, ye as isPow2, Ge as isVideoElement, Je as isWebgl2, Vi as justifyMap, D as lerp, ra as linear, tn as log2, Xt as mapGlBlendModes, en as nextPow2, ge as nextTick, Hi as overflowMap, Or as parseCssFilter, Te as parseCssFunctions, we as parseCssProperty, kr as parseCssTransformOrigin, Ui as positionTypeMap, $a as render, eo as renderPixels, an as stencilModeMap, la as timingFunctions };
8715
+ export { lt as Aabb2D, Zn as AnimatedTexture, ga as Animation, Xa as Assets, Oa as Audio, ba as AudioPipeline, xa as AudioProcessor, ka as AudioSpectrum, ja as AudioWaveform, k as BufferUsage, Er as Camera2D, ar as CanvasContext, mr as CanvasItem, Qn as CanvasTexture, T as Color, W as ColorAdjustEffect, zr as ColorFilterEffect, pt as ColorMatrix, Ur as ColorOverlayEffect, Kr as ColorRemoveEffect, Xr as ColorReplaceEffect, $n as ColorTexture, C as CoreObject, ut as DEG_TO_RAD, We as DEVICE_PIXEL_RATIO, G as DrawboardEffect, oi as DropShadowEffect, H as Effect, Jn as EffectMaterial, ta as Element2D, Mi as Element2DBackground, Ni as Element2DConnection, Y as Element2DFill, Fi as Element2DForeground, Ii as Element2DOutline, Li as Element2DShadow, Ri as Element2DShape, zi as Element2DStyle, X as Element2DText, li as EmbossEffect, Qa as Engine, Zi as Flexbox, Pn as FontLoader, ri as GaussianBlurEffect, zn as Geometry, Ba as GifLoader, en as GlBatch2DSystem, Xt as GlBlendMode, vt as GlBuffer, Et as GlBufferSystem, _t as GlBufferTarget, an as GlMaskSystem, Rt as GlProgram, ln as GlRenderTarget, un as GlRenderTargetSystem, qt as GlShaderSystem, Qt as GlState, $t as GlStateSystem, sn as GlStencilSystem, A as GlSystem, cn as GlViewportSystem, K as GlitchEffect, q as GodrayEffect, er as GradientTexture, ya as HTMLAudio, _a as HTMLAudioContext, va as HTMLSound, He as IN_BROWSER, Ue as IN_MAC_OS, In as IndexBuffer, st as Input, tt as InputEvent, Va as JsonLoader, vi as KawaseBlurEffect, Na as KawaseTransition, nt as KeyboardInputEvent, Fa as LeftEraseTransition, Nn as Loader, ia as Lottie2D, Ha as LottieLoader, gt as MainLoop, xi as MaskEffect, F as Material, sr as Meta, rt as MouseInputEvent, z as Node, wr as Node2D, mt as Obb2D, J as OutlineEffect, _e as PI, ve as PI_2, Di as PixelateEffect, tr as PixelsTexture, it as PointerInputEvent, ht as Projection2D, Hn as QuadGeometry, I as QuadUvGeometry, dt as RAD_TO_DEG, ct as RefCounted, L as RenderTarget, bt as Renderer, w as Resource, Le as SUPPORTS_AUDIO_CONTEXT, Fe as SUPPORTS_CLICK_EVENTS, Ie as SUPPORTS_CREATE_IMAGE_BITMAP, ke as SUPPORTS_IMAGE_BITMAP, Ne as SUPPORTS_MOUSE_EVENTS, ze as SUPPORTS_OFFLINE_AUDIO_CONTEXT, je as SUPPORTS_POINTER_EVENTS, Ae as SUPPORTS_RESIZE_OBSERVER, Pe as SUPPORTS_TOUCH_EVENTS, Oe as SUPPORTS_WEBGL2, Re as SUPPORTS_WEBKIT_AUDIO_CONTEXT, Be as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, Ve as SUPPORTS_WEB_AUDIO, Me as SUPPORTS_WHEEL_EVENTS, U as SceneTree, Ua as TextLoader, R as Texture2D, Wa as TextureLoader, na as TextureRect2D, S as Ticker, La as TiltShiftTransition, yr as Timeline, B as TimelineNode, aa as TransformRect2D, Sr as Transition, za as TwistTransition, St as UniformGroup, Xn as UvGeometry, Yn as UvMaterial, P as VertexAttribute, N as VertexBuffer, sa as Video2D, Ga as VideoLoader, rr as VideoTexture, V as Viewport, ir as ViewportTexture, Ea as WebAudio, wa as WebAudioContext, Mn as WebGLRenderer, Ta as WebSound, at as WheelInputEvent, br as Window, Ai as ZoomBlurEffect, Q as alignMap, $ as assets, Dr as axisDir, Xi as boxSizingMap, ft as clamp, _i as clampFrag, Xe as createHTMLCanvas, Tt as createIdFromString, he as createNode, Qe as crossOrigin, ma as cubicBezier, x as customNode, me as customNodes, Za as defaultOptions, Ze as determineCrossOrigin, Wi as directionMap, Ui as displayMap, ua as ease, da as easeIn, pa as easeInOut, fa as easeOut, Z as edgeMap, Gi as flexDirectionMap, Ki as flexWrapMap, gi as frag, Ce as getDefaultCssPropertyValue, no as getRenderEngine, Hi as gutterMap, et as instanceId, Je as isCanvasElement, Ge as isElementNode, qe as isImageElement, ye as isPow2, Ke as isVideoElement, Ye as isWebgl2, qi as justifyMap, E as lerp, la as linear, nn as log2, Zt as mapGlBlendModes, tn as nextPow2, ge as nextTick, Ji as overflowMap, Nr as parseCssFilter, Te as parseCssFunctions, we as parseCssProperty, Pr as parseCssTransformOrigin, Yi as positionTypeMap, ao as render, oo as renderPixels, Or as routeConnection, on as stencilModeMap, ha as timingFunctions };