canvasengine 2.0.0-beta.53 → 2.0.0-beta.54

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
@@ -1,5 +1,5 @@
1
1
  import * as Fn from "pixi.js";
2
- import { Point as k, Rectangle as _t, Sprite as pe, Texture as ct, WRAP_MODES as Hn, DisplacementFilter as Rn, ObservablePoint as bs, BlurFilter as qi, Container as Ft, Graphics as ai, Assets as St, Mesh as Wn, Geometry as jn, Ticker as ws, Text as Bn, TilingSprite as Nn, NineSliceSprite as Vn, DOMContainer as zn, Application as Un, DOMAdapter as Gn, ImageSource as Xn, Matrix as Yn } from "pixi.js";
2
+ import { Point as k, Rectangle as _t, Sprite as pe, Texture as ct, WRAP_MODES as Hn, DisplacementFilter as Rn, ObservablePoint as bs, BlurFilter as qi, Container as Ft, Graphics as ai, Assets as St, Mesh as jn, Geometry as Wn, Ticker as ws, Text as Bn, TilingSprite as Nn, NineSliceSprite as Vn, DOMContainer as zn, Application as Un, DOMAdapter as Gn, ImageSource as Xn, Matrix as Yn } from "pixi.js";
3
3
  function $n(s, t) {
4
4
  for (var e = 0; e < t.length; e++) {
5
5
  const i = t[e];
@@ -524,7 +524,7 @@ function rr(s) {
524
524
  function or(s) {
525
525
  return F(s?.lift);
526
526
  }
527
- function Wt(s) {
527
+ function jt(s) {
528
528
  return function(t) {
529
529
  if (or(t))
530
530
  return t.lift(function(e) {
@@ -797,7 +797,7 @@ function Fs(s) {
797
797
  function Hs(s) {
798
798
  return F(s?.getReader);
799
799
  }
800
- function jt(s) {
800
+ function Wt(s) {
801
801
  if (s instanceof I)
802
802
  return s;
803
803
  if (s != null) {
@@ -917,8 +917,8 @@ function mt(s, t, e, i, n) {
917
917
  if (s.add(r), !n)
918
918
  return r;
919
919
  }
920
- function Ws(s, t) {
921
- return t === void 0 && (t = 0), Wt(function(e, i) {
920
+ function js(s, t) {
921
+ return t === void 0 && (t = 0), jt(function(e, i) {
922
922
  e.subscribe(we(i, function(n) {
923
923
  return mt(i, s, function() {
924
924
  return i.next(n);
@@ -934,18 +934,18 @@ function Ws(s, t) {
934
934
  }));
935
935
  });
936
936
  }
937
- function js(s, t) {
938
- return t === void 0 && (t = 0), Wt(function(e, i) {
937
+ function Ws(s, t) {
938
+ return t === void 0 && (t = 0), jt(function(e, i) {
939
939
  i.add(s.schedule(function() {
940
940
  return e.subscribe(i);
941
941
  }, t));
942
942
  });
943
943
  }
944
944
  function wr(s, t) {
945
- return jt(s).pipe(js(t), Ws(t));
945
+ return Wt(s).pipe(Ws(t), js(t));
946
946
  }
947
947
  function xr(s, t) {
948
- return jt(s).pipe(js(t), Ws(t));
948
+ return Wt(s).pipe(Ws(t), js(t));
949
949
  }
950
950
  function _r(s, t) {
951
951
  return new I(function(e) {
@@ -1009,13 +1009,13 @@ function Cr(s, t) {
1009
1009
  throw Is(s);
1010
1010
  }
1011
1011
  function me(s, t) {
1012
- return t ? Cr(s, t) : jt(s);
1012
+ return t ? Cr(s, t) : Wt(s);
1013
1013
  }
1014
1014
  function Gl(s) {
1015
1015
  return !!s && (s instanceof I || F(s.lift) && F(s.subscribe));
1016
1016
  }
1017
1017
  function ui(s, t) {
1018
- return Wt(function(e, i) {
1018
+ return jt(function(e, i) {
1019
1019
  var n = 0;
1020
1020
  e.subscribe(we(i, function(r) {
1021
1021
  i.next(s.call(t, r, n++));
@@ -1090,19 +1090,19 @@ function ts(s, t, e) {
1090
1090
  }
1091
1091
  function Rr(s) {
1092
1092
  return new I(function(t) {
1093
- jt(s()).subscribe(t);
1093
+ Wt(s()).subscribe(t);
1094
1094
  });
1095
1095
  }
1096
1096
  function Ut(s, t) {
1097
- return Wt(function(e, i) {
1097
+ return jt(function(e, i) {
1098
1098
  var n = 0;
1099
1099
  e.subscribe(we(i, function(r) {
1100
1100
  return s.call(t, r, n++) && i.next(r);
1101
1101
  }));
1102
1102
  });
1103
1103
  }
1104
- function Wr(s) {
1105
- return Wt(function(t, e) {
1104
+ function jr(s) {
1105
+ return jt(function(t, e) {
1106
1106
  try {
1107
1107
  t.subscribe(e);
1108
1108
  } finally {
@@ -1124,7 +1124,7 @@ function Ns(s) {
1124
1124
  var b = p;
1125
1125
  y(), b?.unsubscribe();
1126
1126
  };
1127
- return Wt(function(b, w) {
1127
+ return jt(function(b, w) {
1128
1128
  u++, !m && !d && g();
1129
1129
  var x = h = h ?? e();
1130
1130
  w.add(function() {
@@ -1139,7 +1139,7 @@ function Ns(s) {
1139
1139
  complete: function() {
1140
1140
  d = !0, g(), o = Le(y, a), x.complete();
1141
1141
  }
1142
- }), jt(b).subscribe(p));
1142
+ }), Wt(b).subscribe(p));
1143
1143
  })(f);
1144
1144
  };
1145
1145
  }
@@ -1156,10 +1156,10 @@ function Le(s, t) {
1156
1156
  n.unsubscribe(), s();
1157
1157
  }
1158
1158
  });
1159
- return jt(t.apply(void 0, qt([], $t(e)))).subscribe(n);
1159
+ return Wt(t.apply(void 0, qt([], $t(e)))).subscribe(n);
1160
1160
  }
1161
1161
  }
1162
- function jr(s, t, e) {
1162
+ function Wr(s, t, e) {
1163
1163
  var i, n, r, a, l = !1;
1164
1164
  return s && typeof s == "object" ? (i = s.bufferSize, a = i === void 0 ? 1 / 0 : i, n = s.windowTime, t = n === void 0 ? 1 / 0 : n, r = s.refCount, l = r === void 0 ? !1 : r, e = s.scheduler) : a = s ?? 1 / 0, Ns({
1165
1165
  connector: function() {
@@ -2135,7 +2135,7 @@ class eo extends pi {
2135
2135
  this.joypad || this.initGamepad();
2136
2136
  }
2137
2137
  }
2138
- const We = {
2138
+ const je = {
2139
2139
  top: "up",
2140
2140
  bottom: "down",
2141
2141
  left: "left",
@@ -2149,7 +2149,7 @@ class io extends pi {
2149
2149
  constructor() {
2150
2150
  super(...arguments), this.joystickEnabled = !0, this.joystickConfig = {
2151
2151
  enabled: !0,
2152
- directionMapping: We,
2152
+ directionMapping: je,
2153
2153
  moveInterval: 50,
2154
2154
  threshold: 0.1
2155
2155
  }, this.joystickMoving = !1, this.joystickDirections = {}, this.joystickLastUpdate = 0, this.joystickMoveInterval = null, this.currentPower = 0;
@@ -2185,7 +2185,7 @@ class io extends pi {
2185
2185
  this.stopAllMovements();
2186
2186
  return;
2187
2187
  }
2188
- const e = this.joystickConfig.directionMapping || We, i = t.direction, n = e[i];
2188
+ const e = this.joystickConfig.directionMapping || je, i = t.direction, n = e[i];
2189
2189
  if (!n) {
2190
2190
  this.stopAllMovements();
2191
2191
  return;
@@ -2256,7 +2256,7 @@ class io extends pi {
2256
2256
  updateJoystickConfig(t) {
2257
2257
  this.joystickConfig = {
2258
2258
  enabled: t.enabled !== void 0 ? t.enabled : !0,
2259
- directionMapping: t.directionMapping || We,
2259
+ directionMapping: t.directionMapping || je,
2260
2260
  moveInterval: t.moveInterval || 50,
2261
2261
  threshold: t.threshold || 0.1
2262
2262
  };
@@ -2532,7 +2532,7 @@ function J(s, t) {
2532
2532
  return new Ct(p()).asObservable();
2533
2533
  }
2534
2534
  return f.observable;
2535
- }), l = xe(a).pipe(Ut(() => !i), ui(() => s()), Wr(() => t?.())), c = /* @__PURE__ */ D(function() {
2535
+ }), l = xe(a).pipe(Ut(() => !i), ui(() => s()), jr(() => t?.())), c = /* @__PURE__ */ D(function() {
2536
2536
  return yi(c), n;
2537
2537
  }, "fn");
2538
2538
  return c.observable = l, c.subscription = l.subscribe((f) => {
@@ -2663,18 +2663,18 @@ function $s(s, t) {
2663
2663
  }
2664
2664
  var ss = function() {
2665
2665
  };
2666
- const Je = (s, t, e) => Math.min(Math.max(e, s), t), je = 1e-3, oo = 0.01, ao = 10, lo = 0.05, ho = 1;
2666
+ const Je = (s, t, e) => Math.min(Math.max(e, s), t), We = 1e-3, oo = 0.01, ao = 10, lo = 0.05, ho = 1;
2667
2667
  function co({ duration: s = 800, bounce: t = 0.25, velocity: e = 0, mass: i = 1 }) {
2668
2668
  let n, r, a = 1 - t;
2669
2669
  a = Je(lo, ho, a), s = Je(oo, ao, s / 1e3), a < 1 ? (n = (f) => {
2670
2670
  const p = f * a, o = p * s, h = p - e, u = Ze(f, a), d = Math.exp(-o);
2671
- return je - h / u * d;
2671
+ return We - h / u * d;
2672
2672
  }, r = (f) => {
2673
2673
  const o = f * a * s, h = o * e + e, u = Math.pow(a, 2) * Math.pow(f, 2) * s, d = Math.exp(-o), m = Ze(Math.pow(f, 2), a);
2674
- return (-n(f) + je > 0 ? -1 : 1) * ((h - u) * d) / m;
2674
+ return (-n(f) + We > 0 ? -1 : 1) * ((h - u) * d) / m;
2675
2675
  }) : (n = (f) => {
2676
2676
  const p = Math.exp(-f * s), o = (f - e) * s + 1;
2677
- return -je + p * o;
2677
+ return -We + p * o;
2678
2678
  }, r = (f) => {
2679
2679
  const p = Math.exp(-f * s), o = (e - f) * (s * s);
2680
2680
  return p * o;
@@ -2957,11 +2957,11 @@ function un(s, t, { clamp: e = !0, ease: i, mixer: n } = {}) {
2957
2957
  const Ce = (s) => (t) => 1 - s(1 - t), wi = (s) => (t) => t <= 0.5 ? s(2 * t) / 2 : (2 - s(2 * (1 - t))) / 2, Lo = (s) => (t) => Math.pow(t, s), fn = (s) => (t) => t * t * ((s + 1) * t - s), Fo = (s) => {
2958
2958
  const t = fn(s);
2959
2959
  return (e) => (e *= 2) < 1 ? 0.5 * t(e) : 0.5 * (2 - Math.pow(2, -10 * (e - 1)));
2960
- }, dn = 1.525, Ho = 4 / 11, Ro = 8 / 11, Wo = 9 / 10, jo = (s) => s, xi = Lo(2), Bo = Ce(xi), pn = wi(xi), mn = (s) => 1 - Math.sin(Math.acos(s)), yn = Ce(mn), No = wi(yn), _i = fn(dn), Vo = Ce(_i), zo = wi(_i), Uo = Fo(dn), Go = 4356 / 361, Xo = 35442 / 1805, Yo = 16061 / 1805, ge = (s) => {
2960
+ }, dn = 1.525, Ho = 4 / 11, Ro = 8 / 11, jo = 9 / 10, Wo = (s) => s, xi = Lo(2), Bo = Ce(xi), pn = wi(xi), mn = (s) => 1 - Math.sin(Math.acos(s)), yn = Ce(mn), No = wi(yn), _i = fn(dn), Vo = Ce(_i), zo = wi(_i), Uo = Fo(dn), Go = 4356 / 361, Xo = 35442 / 1805, Yo = 16061 / 1805, ge = (s) => {
2961
2961
  if (s === 1 || s === 0)
2962
2962
  return s;
2963
2963
  const t = s * s;
2964
- return s < Ho ? 7.5625 * t : s < Ro ? 9.075 * t - 9.9 * s + 3.4 : s < Wo ? Go * t - Xo * s + Yo : 10.8 * s * s - 20.52 * s + 10.72;
2964
+ return s < Ho ? 7.5625 * t : s < Ro ? 9.075 * t - 9.9 * s + 3.4 : s < jo ? Go * t - Xo * s + Yo : 10.8 * s * s - 20.52 * s + 10.72;
2965
2965
  }, $o = Ce(ge), qo = (s) => s < 0.5 ? 0.5 * (1 - ge(1 - s * 2)) : 0.5 * ge(s * 2 - 1) + 0.5;
2966
2966
  function Ko(s, t) {
2967
2967
  return s.map(() => t || pn).splice(0, s.length - 1);
@@ -3085,15 +3085,15 @@ function xn(s) {
3085
3085
  function L() {
3086
3086
  v++, c === "reverse" ? (S = v % 2 === 0, a = la(a, b, f, S)) : (a = wn(a, b, f), c === "mirror" && A.flipTarget()), x = !1, u && u();
3087
3087
  }
3088
- function W() {
3088
+ function j() {
3089
3089
  y.stop(), h && h();
3090
3090
  }
3091
- function Nt(j) {
3092
- if (S || (j = -j), a += j, !x) {
3091
+ function Nt(W) {
3092
+ if (S || (W = -W), a += W, !x) {
3093
3093
  const it = A.next(Math.max(0, a));
3094
3094
  w = it.value, C && (w = C(w)), x = S ? it.done : a <= 0;
3095
3095
  }
3096
- d?.(w), x && (v === 0 && (b ?? (b = a)), v < l ? ha(a, b, f, S) && L() : W());
3096
+ d?.(w), x && (v === 0 && (b ?? (b = a)), v < l ? ha(a, b, f, S) && L() : j());
3097
3097
  }
3098
3098
  function ut() {
3099
3099
  p?.(), y = r(Nt), y.start();
@@ -3610,7 +3610,7 @@ function Kl(s, t) {
3610
3610
  c.unsubscribe(), e.forEach((f) => V(f));
3611
3611
  };
3612
3612
  });
3613
- }).pipe(jr({ bufferSize: 1, refCount: !0 }));
3613
+ }).pipe(Wr({ bufferSize: 1, refCount: !0 }));
3614
3614
  }
3615
3615
  function Jl(s, t, ...e) {
3616
3616
  let i = null, n = -1;
@@ -4283,18 +4283,18 @@ function Sa() {
4283
4283
  if (u._webAudio) {
4284
4284
  var L = function() {
4285
4285
  u._playLock = !1, M(), u._refreshBuffer(y);
4286
- var j = y._muted || u._muted ? 0 : y._volume;
4287
- A.gain.setValueAtTime(j, e.ctx.currentTime), y._playStart = e.ctx.currentTime, typeof A.bufferSource.start > "u" ? y._loop ? A.bufferSource.noteGrainOn(0, b, 86400) : A.bufferSource.noteGrainOn(0, b, w) : y._loop ? A.bufferSource.start(0, b, 86400) : A.bufferSource.start(0, b, w), x !== 1 / 0 && (u._endTimers[y._id] = setTimeout(u._ended.bind(u, y), x)), h || setTimeout(function() {
4286
+ var W = y._muted || u._muted ? 0 : y._volume;
4287
+ A.gain.setValueAtTime(W, e.ctx.currentTime), y._playStart = e.ctx.currentTime, typeof A.bufferSource.start > "u" ? y._loop ? A.bufferSource.noteGrainOn(0, b, 86400) : A.bufferSource.noteGrainOn(0, b, w) : y._loop ? A.bufferSource.start(0, b, 86400) : A.bufferSource.start(0, b, w), x !== 1 / 0 && (u._endTimers[y._id] = setTimeout(u._ended.bind(u, y), x)), h || setTimeout(function() {
4288
4288
  u._emit("play", y._id), u._loadQueue();
4289
4289
  }, 0);
4290
4290
  };
4291
4291
  e.state === "running" && e.ctx.state !== "interrupted" ? L() : (u._playLock = !0, u.once("resume", L), u._clearTimer(y._id));
4292
4292
  } else {
4293
- var W = function() {
4293
+ var j = function() {
4294
4294
  A.currentTime = b, A.muted = y._muted || u._muted || e._muted || A.muted, A.volume = y._volume * e.volume(), A.playbackRate = y._rate;
4295
4295
  try {
4296
- var j = A.play();
4297
- if (j && typeof Promise < "u" && (j instanceof Promise || typeof j.then == "function") ? (u._playLock = !0, M(), j.then(function() {
4296
+ var W = A.play();
4297
+ if (W && typeof Promise < "u" && (W instanceof Promise || typeof W.then == "function") ? (u._playLock = !0, M(), W.then(function() {
4298
4298
  u._playLock = !1, A._unlocked = !0, h ? u._loadQueue() : u._emit("play", y._id);
4299
4299
  }).catch(function() {
4300
4300
  u._playLock = !1, u._emit("playerror", y._id, "Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."), y._ended = !0, y._paused = !0;
@@ -4312,11 +4312,11 @@ function Sa() {
4312
4312
  A.src === "data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA" && (A.src = u._src, A.load());
4313
4313
  var Nt = window && window.ejecta || !A.readyState && e._navigator.isCocoonJS;
4314
4314
  if (A.readyState >= 3 || Nt)
4315
- W();
4315
+ j();
4316
4316
  else {
4317
4317
  u._playLock = !0, u._state = "loading";
4318
4318
  var ut = function() {
4319
- u._state = "loaded", W(), A.removeEventListener(e._canPlayEvent, ut, !1);
4319
+ u._state = "loaded", j(), A.removeEventListener(e._canPlayEvent, ut, !1);
4320
4320
  };
4321
4321
  A.addEventListener(e._canPlayEvent, ut, !1), u._clearTimer(y._id);
4322
4322
  }
@@ -5579,8 +5579,8 @@ class Ia extends $ {
5579
5579
  if (!e || !this.progressSignal || !this.currentFlashConfig) return;
5580
5580
  const h = e.tint;
5581
5581
  if (h === void 0) return;
5582
- const u = _(h), d = this.progressSignal(), m = this.currentFlashConfig, g = d * m.cycles % 1, y = g < 0.5 ? g * 2 : 1 - (g - 0.5) * 2, v = this.originalTint >> 16 & 255, b = this.originalTint >> 8 & 255, w = this.originalTint & 255, x = m.flashTint >> 16 & 255, S = m.flashTint >> 8 & 255, C = m.flashTint & 255, M = Math.round(v + (x - v) * y), A = Math.round(b + (S - b) * y), L = Math.round(w + (C - w) * y), W = M << 16 | A << 8 | L;
5583
- u ? h.set(W) : e.tint = W;
5582
+ const u = _(h), d = this.progressSignal(), m = this.currentFlashConfig, g = d * m.cycles % 1, y = g < 0.5 ? g * 2 : 1 - (g - 0.5) * 2, v = this.originalTint >> 16 & 255, b = this.originalTint >> 8 & 255, w = this.originalTint & 255, x = m.flashTint >> 16 & 255, S = m.flashTint >> 8 & 255, C = m.flashTint & 255, M = Math.round(v + (x - v) * y), A = Math.round(b + (S - b) * y), L = Math.round(w + (C - w) * y), j = M << 16 | A << 8 | L;
5583
+ u ? h.set(j) : e.tint = j;
5584
5584
  }).subscription), await this.progressSignal.set(1, {
5585
5585
  duration: r
5586
5586
  }), this.currentFlashConfig === p && e) {
@@ -5886,7 +5886,23 @@ function at(s) {
5886
5886
  ...this.fullProps,
5887
5887
  ...e
5888
5888
  }, this.destroyed || !this.#t || !this.parent) return;
5889
- e.x !== void 0 && this.setX(e.x), e.y !== void 0 && this.setY(e.y), e.scale !== void 0 && wt(this.scale, e.scale), e.anchor !== void 0 && !this.isCustomAnchor && wt(this.anchor, e.anchor), e.width !== void 0 && this.setWidth(e.width), e.height !== void 0 && this.setHeight(e.height), e.minWidth !== void 0 && this.setMinWidth(e.minWidth), e.minHeight !== void 0 && this.setMinHeight(e.minHeight), e.maxWidth !== void 0 && this.setMaxWidth(e.maxWidth), e.maxHeight !== void 0 && this.setMaxHeight(e.maxHeight), e.aspectRatio !== void 0 && this.setAspectRatio(e.aspectRatio), e.flexGrow !== void 0 && this.setFlexGrow(e.flexGrow), e.flexShrink !== void 0 && this.setFlexShrink(e.flexShrink), e.flexBasis !== void 0 && this.setFlexBasis(e.flexBasis), e.rowGap !== void 0 && this.setRowGap(e.rowGap), e.columnGap !== void 0 && this.setColumnGap(e.columnGap), e.top !== void 0 && this.setTop(e.top), e.left !== void 0 && this.setLeft(e.left), e.right !== void 0 && this.setRight(e.right), e.bottom !== void 0 && this.setBottom(e.bottom), e.objectFit !== void 0 && this.setObjectFit(e.objectFit), e.objectPosition !== void 0 && this.setObjectPosition(e.objectPosition), e.transformOrigin !== void 0 && this.setTransformOrigin(e.transformOrigin), e.skew !== void 0 && wt(this.skew, e.skew), e.tint && (this.tint = e.tint), e.rotation !== void 0 && (this.rotation = e.rotation), e.angle !== void 0 && (this.angle = e.angle), e.zIndex !== void 0 && (this.zIndex = e.zIndex), e.roundPixels !== void 0 && (this.roundPixels = e.roundPixels), e.cursor && (this.cursor = e.cursor), e.visible !== void 0 && (this.visible = e.visible), e.alpha !== void 0 && (this.alpha = e.alpha), e.pivot && wt(this.pivot, e.pivot), e.flexDirection && this.setFlexDirection(e.flexDirection), e.flexWrap && this.setFlexWrap(e.flexWrap), e.justifyContent && this.setJustifyContent(e.justifyContent), e.alignItems && this.setAlignItems(e.alignItems), e.alignContent && this.setAlignContent(e.alignContent), e.alignSelf && this.setAlignSelf(e.alignSelf), e.margin && this.setMargin(e.margin), e.padding && this.setPadding(e.padding), e.gap && this.setGap(e.gap), e.border && this.setBorder(e.border), e.positionType && this.setPositionType(e.positionType), e.filters && (this.filters = e.filters), e.maskOf && G(e.maskOf) && (e.maskOf.componentInstance.mask = this), e.blendMode && (this.blendMode = e.blendMode), e.filterArea && (this.filterArea = e.filterArea);
5889
+ if (e.x !== void 0 && this.setX(e.x), e.y !== void 0 && this.setY(e.y), e.scale !== void 0 && wt(this.scale, e.scale), e.anchor !== void 0 && !this.isCustomAnchor && wt(this.anchor, e.anchor), e.width !== void 0 && this.setWidth(e.width), e.height !== void 0 && this.setHeight(e.height), e.minWidth !== void 0 && this.setMinWidth(e.minWidth), e.minHeight !== void 0 && this.setMinHeight(e.minHeight), e.maxWidth !== void 0 && this.setMaxWidth(e.maxWidth), e.maxHeight !== void 0 && this.setMaxHeight(e.maxHeight), e.aspectRatio !== void 0 && this.setAspectRatio(e.aspectRatio), e.flexGrow !== void 0 && this.setFlexGrow(e.flexGrow), e.flexShrink !== void 0 && this.setFlexShrink(e.flexShrink), e.flexBasis !== void 0 && this.setFlexBasis(e.flexBasis), e.rowGap !== void 0 && this.setRowGap(e.rowGap), e.columnGap !== void 0 && this.setColumnGap(e.columnGap), e.top !== void 0 && this.setTop(e.top), e.left !== void 0 && this.setLeft(e.left), e.right !== void 0 && this.setRight(e.right), e.bottom !== void 0 && this.setBottom(e.bottom), e.objectFit !== void 0 && this.setObjectFit(e.objectFit), e.objectPosition !== void 0 && this.setObjectPosition(e.objectPosition), e.transformOrigin !== void 0 && this.setTransformOrigin(e.transformOrigin), e.skew !== void 0 && wt(this.skew, e.skew), e.tint && (this.tint = e.tint), e.rotation !== void 0 && (this.rotation = e.rotation), e.angle !== void 0 && (this.angle = e.angle), e.zIndex !== void 0 && (this.zIndex = e.zIndex), e.roundPixels !== void 0 && (this.roundPixels = e.roundPixels), e.cursor && (this.cursor = e.cursor), e.visible !== void 0 && (this.visible = e.visible), e.alpha !== void 0 && (this.alpha = e.alpha), e.pivot && wt(this.pivot, e.pivot), e.flexDirection && this.setFlexDirection(e.flexDirection), e.flexWrap && this.setFlexWrap(e.flexWrap), e.justifyContent && this.setJustifyContent(e.justifyContent), e.alignItems && this.setAlignItems(e.alignItems), e.alignContent && this.setAlignContent(e.alignContent), e.alignSelf && this.setAlignSelf(e.alignSelf), e.margin && this.setMargin(e.margin), e.padding && this.setPadding(e.padding), e.gap && this.setGap(e.gap), e.border && this.setBorder(e.border), e.positionType && this.setPositionType(e.positionType), e.filters && (this.filters = e.filters), e.maskOf && G(e.maskOf) && (e.maskOf.componentInstance.mask = this), e.shadowCaster !== void 0) {
5890
+ const n = e.shadowCaster?.value ?? e.shadowCaster;
5891
+ if (n && typeof n == "object" && !Array.isArray(n)) {
5892
+ const r = this.shadowCaster ?? {};
5893
+ this.shadowCaster = { ...r, ...n };
5894
+ } else
5895
+ this.shadowCaster = n;
5896
+ }
5897
+ if (e.footprintCaster !== void 0) {
5898
+ const n = e.footprintCaster?.value ?? e.footprintCaster;
5899
+ if (n && typeof n == "object" && !Array.isArray(n)) {
5900
+ const r = this.footprintCaster ?? {};
5901
+ this.footprintCaster = { ...r, ...n };
5902
+ } else
5903
+ this.footprintCaster = n;
5904
+ }
5905
+ e.blendMode && (this.blendMode = e.blendMode), e.filterArea && (this.filterArea = e.filterArea);
5890
5906
  const i = this.filters || [];
5891
5907
  if (e.blur) {
5892
5908
  let n = i.find(
@@ -6434,7 +6450,7 @@ function An(s) {
6434
6450
  ...s
6435
6451
  });
6436
6452
  }
6437
- function Wa(s) {
6453
+ function ja(s) {
6438
6454
  return An(s);
6439
6455
  }
6440
6456
  function nh(s) {
@@ -6466,7 +6482,7 @@ function rh(s) {
6466
6482
  ...s
6467
6483
  });
6468
6484
  }
6469
- class ja extends at(Wn) {
6485
+ class Wa extends at(jn) {
6470
6486
  /**
6471
6487
  * Constructor for the CanvasMesh component.
6472
6488
  * Initializes the PixiMesh with default geometry and shader to prevent errors.
@@ -6479,7 +6495,7 @@ class ja extends at(Wn) {
6479
6495
  */
6480
6496
  constructor() {
6481
6497
  super({
6482
- geometry: new jn()
6498
+ geometry: new Wn()
6483
6499
  });
6484
6500
  }
6485
6501
  /**
@@ -6547,7 +6563,7 @@ class ja extends at(Wn) {
6547
6563
  await super.onDestroy(t, i);
6548
6564
  }
6549
6565
  }
6550
- R("Mesh", ja);
6566
+ R("Mesh", Wa);
6551
6567
  const oh = (s) => N("Mesh", s);
6552
6568
  let ms = null, ni = null;
6553
6569
  function Cn(s) {
@@ -7042,7 +7058,7 @@ function qa(s) {
7042
7058
  En.indexOf(t[e]) >= 0 && (t[e] = `Math.${t[e]}`);
7043
7059
  return s = t.join(""), new Function("x", `return ${s};`);
7044
7060
  }
7045
- class Wi {
7061
+ class ji {
7046
7062
  constructor(t) {
7047
7063
  if (this.order = E.Late, t.path)
7048
7064
  if (typeof t.path == "function")
@@ -7070,9 +7086,9 @@ class Wi {
7070
7086
  t.config.movement += i * e, Et.x = t.config.movement, Et.y = this.path(Et.x), ht(t.config.initRotation, Et), t.position.x = t.config.initPosition.x + Et.x, t.position.y = t.config.initPosition.y + Et.y;
7071
7087
  }
7072
7088
  }
7073
- Wi.type = "movePath";
7074
- Wi.editorConfig = null;
7075
- class ji {
7089
+ ji.type = "movePath";
7090
+ ji.editorConfig = null;
7091
+ class Wi {
7076
7092
  constructor() {
7077
7093
  this.order = E.Spawn;
7078
7094
  }
@@ -7080,8 +7096,8 @@ class ji {
7080
7096
  initParticles(t) {
7081
7097
  }
7082
7098
  }
7083
- ji.type = "spawnPoint";
7084
- ji.editorConfig = null;
7099
+ Wi.type = "spawnPoint";
7100
+ Wi.editorConfig = null;
7085
7101
  class Bi {
7086
7102
  constructor(t) {
7087
7103
  this.order = E.Normal, this.textures = t.textures.map((e) => typeof e == "string" ? Qt(e) : e);
@@ -7579,8 +7595,8 @@ T.registerBehavior(Li);
7579
7595
  T.registerBehavior(Fi);
7580
7596
  T.registerBehavior(Hi);
7581
7597
  T.registerBehavior(Ri);
7582
- T.registerBehavior(Wi);
7583
7598
  T.registerBehavior(ji);
7599
+ T.registerBehavior(Wi);
7584
7600
  T.registerBehavior(Bi);
7585
7601
  T.registerBehavior(Ni);
7586
7602
  T.registerBehavior(Vi);
@@ -7620,7 +7636,7 @@ function hh(s) {
7620
7636
  const ys = console.log;
7621
7637
  class On extends at(pe) {
7622
7638
  constructor() {
7623
- super(...arguments), this.currentAnimation = null, this.time = 0, this.frameIndex = 0, this.animations = /* @__PURE__ */ new Map(), this.subscriptionSheet = [], this.sheetParams = {}, this.sheetCurrentAnimation = "stand", this.app = null, this.globalLoader = null, this.trackedAssetIds = /* @__PURE__ */ new Set(), this.currentAnimationContainer = null;
7639
+ super(...arguments), this.hitbox = null, this.currentAnimation = null, this.time = 0, this.frameIndex = 0, this.animations = /* @__PURE__ */ new Map(), this.subscriptionSheet = [], this.sheetParams = {}, this.sheetCurrentAnimation = "stand", this.app = null, this.globalLoader = null, this.trackedAssetIds = /* @__PURE__ */ new Set(), this.currentAnimationContainer = null;
7624
7640
  }
7625
7641
  get renderer() {
7626
7642
  return this.app?.renderer;
@@ -7817,7 +7833,7 @@ class On extends at(pe) {
7817
7833
  const r = n.value instanceof Promise ? await n.value : n.value;
7818
7834
  this.spritesheet = r ?? n, await this.resetAnimations();
7819
7835
  }
7820
- if (i?.params && (this.sheetParams = i?.params), i?.playing && this.isMounted && this.spritesheet && this.animations.size > 0 && (this.sheetCurrentAnimation = i?.playing, this.play(this.sheetCurrentAnimation, [this.sheetParams])), t.hitbox && (this.hitbox = t.hitbox.value ?? t.hitbox), t.scaleMode) this.baseTexture.scaleMode = t.scaleMode;
7836
+ if (i?.params && (this.sheetParams = i?.params), i?.playing && this.isMounted && this.spritesheet && this.animations.size > 0 && (this.sheetCurrentAnimation = i?.playing, this.play(this.sheetCurrentAnimation, [this.sheetParams])), t.hitbox !== void 0 && (this.hitbox = this.normalizeHitbox(t.hitbox)), t.scaleMode) this.baseTexture.scaleMode = t.scaleMode;
7821
7837
  else if (t.image && this.fullProps.rectangle === void 0) {
7822
7838
  const r = await e(this.fullProps.image);
7823
7839
  r && (this.texture = r);
@@ -7829,6 +7845,7 @@ class On extends at(pe) {
7829
7845
  frame: new _t(r, a, l, c)
7830
7846
  }));
7831
7847
  }
7848
+ this.hitbox && !this.spritesheet && this.applyHitboxAnchor(this.texture.width, this.texture.height);
7832
7849
  }
7833
7850
  async onDestroy(t, e) {
7834
7851
  const i = async () => {
@@ -7904,30 +7921,23 @@ class On extends at(pe) {
7904
7921
  let l = r[this.frameIndex];
7905
7922
  const c = r[this.frameIndex + 1];
7906
7923
  for (let f of this.currentAnimationContainer.children) {
7907
- let p = function(g, y) {
7908
- const b = o(y || g);
7909
- b !== void 0 && (i[g] = b);
7924
+ let p = function(d, m) {
7925
+ const y = o(m || d);
7926
+ y !== void 0 && (i[d] = y);
7910
7927
  };
7911
7928
  if (!l || l.frameY == null || l.frameX == null)
7912
7929
  continue;
7913
7930
  this.texture = n[l.frameY][l.frameX];
7914
- const o = (g) => l[g] ?? a[g] ?? this.spritesheet[g], h = (g) => {
7915
- const y = o(g);
7916
- y && this[g].set(...y);
7931
+ const o = (d) => l[d] ?? a[d] ?? this.spritesheet[d], h = (d) => {
7932
+ const m = o(d);
7933
+ m && this[d].set(...m);
7917
7934
  };
7918
7935
  this.applyTransform && (l = {
7919
7936
  ...l,
7920
7937
  ...this.applyTransform(l, a, this.spritesheet)
7921
7938
  });
7922
- const u = o("spriteRealSize"), d = typeof u == "number" ? u : u?.height;
7923
- typeof u == "number" || u?.width;
7924
- const m = () => {
7925
- if (d && this.hitbox) {
7926
- const { spriteWidth: g, spriteHeight: y } = a, v = (g - this.hitbox.w) / 2 / g, b = (y - d) / 2, w = (y - this.hitbox.h - b) / y;
7927
- this.anchor.set(v, w);
7928
- }
7929
- };
7930
- l.sound, m(), h("anchor"), h("scale"), h("skew"), h("pivot"), p("alpha", "opacity"), p("x"), p("y"), p("angle"), p("rotation"), p("visible");
7939
+ const u = o("spriteRealSize");
7940
+ l.sound, this.applyHitboxAnchor(a.spriteWidth, a.spriteHeight, u), h("anchor"), h("scale"), h("skew"), h("pivot"), p("alpha", "opacity"), p("x"), p("y"), p("angle"), p("rotation"), p("visible");
7931
7941
  }
7932
7942
  if (!c) {
7933
7943
  this.time = 0, this.frameIndex = 0, this.onFinish && r.length > 1 && this.onFinish();
@@ -7935,6 +7945,43 @@ class On extends at(pe) {
7935
7945
  }
7936
7946
  this.time += t ?? 1, this.time >= c.time && this.frameIndex++;
7937
7947
  }
7948
+ applyHitboxAnchor(t, e, i) {
7949
+ if (!this.hitbox || !t || !e)
7950
+ return;
7951
+ const r = (typeof i == "number" ? i : i?.height) ?? e, a = Math.max(0, (e - r) / 2), l = this.clamp(
7952
+ (t - this.hitbox.w) / 2 / t
7953
+ ), c = this.clamp(
7954
+ (e - this.hitbox.h - a) / e
7955
+ ), f = this.clamp(
7956
+ l + this.hitbox.w / 2 / t
7957
+ ), p = this.clamp(
7958
+ c + this.hitbox.h / 2 / e
7959
+ ), o = this.clamp((e - a) / e);
7960
+ let h = l, u = c;
7961
+ switch (this.hitbox.anchorMode ?? "top-left") {
7962
+ case "center":
7963
+ h = f, u = p;
7964
+ break;
7965
+ case "foot":
7966
+ h = f, u = o;
7967
+ break;
7968
+ }
7969
+ this.anchor.set(h, u);
7970
+ }
7971
+ normalizeHitbox(t) {
7972
+ const e = t?.value ?? t;
7973
+ if (!e || typeof e != "object")
7974
+ return null;
7975
+ const { w: i, h: n, anchorMode: r } = e;
7976
+ return typeof i != "number" || typeof n != "number" ? null : {
7977
+ w: i,
7978
+ h: n,
7979
+ anchorMode: r
7980
+ };
7981
+ }
7982
+ clamp(t) {
7983
+ return Math.min(1, Math.max(0, t));
7984
+ }
7938
7985
  }
7939
7986
  R("Sprite", On);
7940
7987
  const In = (s) => (R("Sprite", On), N("Sprite", s));
@@ -11155,7 +11202,7 @@ class Rl extends Ln {
11155
11202
  }
11156
11203
  R("DOMSprite", Rl);
11157
11204
  const mh = (s) => N("DOMSprite", s);
11158
- var Wl = /* @__PURE__ */ ((s) => (s.Normal = "normal", s.Hover = "hover", s.Pressed = "pressed", s.Disabled = "disabled", s))(Wl || {});
11205
+ var jl = /* @__PURE__ */ ((s) => (s.Normal = "normal", s.Hover = "hover", s.Pressed = "pressed", s.Disabled = "disabled", s))(jl || {});
11159
11206
  function yh(s) {
11160
11207
  const t = P(
11161
11208
  "normal"
@@ -11254,7 +11301,7 @@ function yh(s) {
11254
11301
  y: J(() => c() / 2),
11255
11302
  color: y
11256
11303
  });
11257
- } else return g === "ellipse" ? U(Wa, {
11304
+ } else return g === "ellipse" ? U(ja, {
11258
11305
  width: l,
11259
11306
  height: c,
11260
11307
  color: y
@@ -11335,13 +11382,13 @@ function gh(s = {}) {
11335
11382
  let S = w.getLocalPosition(x), C = S.x - (l?.x ?? 0), M = S.y - (l?.y ?? 0), A = new Fn.Point(0, 0), L = 0;
11336
11383
  if (C == 0 && M == 0)
11337
11384
  return;
11338
- let W = "left";
11385
+ let j = "left";
11339
11386
  if (C == 0) {
11340
- M > 0 ? (A.set(0, M > i ? i : M), L = 270, W = "bottom") : (A.set(
11387
+ M > 0 ? (A.set(0, M > i ? i : M), L = 270, j = "bottom") : (A.set(
11341
11388
  0,
11342
11389
  -(Math.abs(M) > i ? i : Math.abs(M))
11343
- ), L = 90, W = "top"), f.set(A.x), p.set(A.y), c = h(A);
11344
- const gt = { angle: L, direction: W, power: c };
11390
+ ), L = 90, j = "top"), f.set(A.x), p.set(A.y), c = h(A);
11391
+ const gt = { angle: L, direction: j, power: c };
11345
11392
  t.onChange?.(gt);
11346
11393
  const z = e();
11347
11394
  z && (z.handleJoystickChange ? z.handleJoystickChange(gt) : z.joystick && z.joystick.handleJoystickChange && z.joystick.handleJoystickChange(gt));
@@ -11351,11 +11398,11 @@ function gh(s = {}) {
11351
11398
  C > 0 ? (A.set(
11352
11399
  Math.abs(C) > i ? i : Math.abs(C),
11353
11400
  0
11354
- ), L = 0, W = "right") : (A.set(
11401
+ ), L = 0, j = "right") : (A.set(
11355
11402
  -(Math.abs(C) > i ? i : Math.abs(C)),
11356
11403
  0
11357
- ), L = 180, W = "left"), f.set(A.x), p.set(A.y), c = h(A);
11358
- const gt = { angle: L, direction: W, power: c };
11404
+ ), L = 180, j = "left"), f.set(A.x), p.set(A.y), c = h(A);
11405
+ const gt = { angle: L, direction: j, power: c };
11359
11406
  t.onChange?.(gt);
11360
11407
  const z = e();
11361
11408
  z && (z.handleJoystickChange ? z.handleJoystickChange(gt) : z.joystick && z.joystick.handleJoystickChange && z.joystick.handleJoystickChange(gt));
@@ -11363,9 +11410,9 @@ function gh(s = {}) {
11363
11410
  }
11364
11411
  let Nt = Math.abs(M / C), ut = Math.atan(Nt);
11365
11412
  L = ut * 180 / Math.PI;
11366
- let j = 0, it = 0;
11367
- C * C + M * M >= i * i ? (j = i * Math.cos(ut), it = i * Math.sin(ut)) : (j = Math.abs(C) > i ? i : Math.abs(C), it = Math.abs(M) > i ? i : Math.abs(M)), M < 0 && (it = -Math.abs(it)), C < 0 && (j = -Math.abs(j)), C > 0 && M < 0 || (C < 0 && M < 0 ? L = 180 - L : C < 0 && M > 0 ? L = L + 180 : C > 0 && M > 0 && (L = 360 - L)), A.set(j, it), c = h(A), W = u(A), f.set(A.x), p.set(A.y);
11368
- const Ie = { angle: L, direction: W, power: c };
11413
+ let W = 0, it = 0;
11414
+ C * C + M * M >= i * i ? (W = i * Math.cos(ut), it = i * Math.sin(ut)) : (W = Math.abs(C) > i ? i : Math.abs(C), it = Math.abs(M) > i ? i : Math.abs(M)), M < 0 && (it = -Math.abs(it)), C < 0 && (W = -Math.abs(W)), C > 0 && M < 0 || (C < 0 && M < 0 ? L = 180 - L : C < 0 && M > 0 ? L = L + 180 : C > 0 && M > 0 && (L = 360 - L)), A.set(W, it), c = h(A), j = u(A), f.set(A.x), p.set(A.y);
11415
+ const Ie = { angle: L, direction: j, power: c };
11369
11416
  t.onChange?.(Ie);
11370
11417
  const Pt = e();
11371
11418
  Pt && (Pt.handleJoystickChange ? Pt.handleJoystickChange(Ie) : Pt.joystick && Pt.joystick.handleJoystickChange && Pt.joystick.handleJoystickChange(Ie));
@@ -11676,7 +11723,7 @@ const bt = class bt {
11676
11723
  bt.instance = null;
11677
11724
  let oi = bt;
11678
11725
  const Z = oi.getInstance();
11679
- class jl extends $ {
11726
+ class Wl extends $ {
11680
11727
  constructor() {
11681
11728
  super(...arguments), this.element = null, this.controlsDirective = null, this.controlsSubscription = null;
11682
11729
  }
@@ -11728,7 +11775,7 @@ class jl extends $ {
11728
11775
  this.controlsSubscription && (this.controlsSubscription.unsubscribe(), this.controlsSubscription = null), this.element = null, this.controlsDirective = null;
11729
11776
  }
11730
11777
  }
11731
- q("focusNavigation", jl);
11778
+ q("focusNavigation", Wl);
11732
11779
  class Bl {
11733
11780
  constructor() {
11734
11781
  this.containerId = "", this.currentIndexSignal = null, this.focusedElementSignal = null, this.registeredFocusables = /* @__PURE__ */ new Set();
@@ -11930,7 +11977,7 @@ function _h(s, t) {
11930
11977
  };
11931
11978
  }
11932
11979
  const Sh = {
11933
- linear: jo,
11980
+ linear: Wo,
11934
11981
  easeIn: xi,
11935
11982
  easeInOut: pn,
11936
11983
  easeOut: Bo,
@@ -12037,7 +12084,7 @@ const kh = Bt.Howler;
12037
12084
  export {
12038
12085
  ae as ArraySubject,
12039
12086
  yh as Button,
12040
- Wl as ButtonState,
12087
+ jl as ButtonState,
12041
12088
  sh as Canvas,
12042
12089
  An as Circle,
12043
12090
  Te as Container,
@@ -12051,7 +12098,7 @@ export {
12051
12098
  Ta as Drop,
12052
12099
  La as EVENTS,
12053
12100
  Sh as Easing,
12054
- Wa as Ellipse,
12101
+ ja as Ellipse,
12055
12102
  Ia as Flash,
12056
12103
  Nl as FocusContainer,
12057
12104
  oi as FocusManager,