exodeui 6.3.39 → 6.3.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +23 -23
  2. package/dist/index.mjs +690 -685
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -83,9 +83,9 @@ function ps(g) {
83
83
  b.widths[G] = z.widths[Y];
84
84
  const N = z.kinds[Y];
85
85
  if (N === 2) {
86
- const J = _[Y];
87
- J === `
88
- ` || J === "\r" ? b.kinds[G] = 2 : b.kinds[G] = 0;
86
+ const Q = _[Y];
87
+ Q === `
88
+ ` || Q === "\r" ? b.kinds[G] = 2 : b.kinds[G] = 0;
89
89
  } else
90
90
  b.kinds[G] = N;
91
91
  }
@@ -222,15 +222,15 @@ function Es(g, t, i) {
222
222
  return u.forEach((A) => {
223
223
  let W = w, z = M;
224
224
  h ? L ? z = n.top + (p - n.top - n.bottom - A.height) / 2 : P && (z = p - n.bottom - A.height) : k ? W = n.left + (l - n.left - n.right - A.width) / 2 : T && (W = l - n.right - A.width), A.children.forEach((Y) => {
225
- var F, j;
225
+ var F, tt;
226
226
  let G = W, N = z;
227
227
  h ? k ? G += (A.width - Y.w) / 2 : T && (G += A.width - Y.w) : L ? N += (A.height - Y.h) / 2 : P && (N += A.height - Y.h);
228
- const J = ((F = Y.original.layoutProps) == null ? void 0 : F.width) === "fill", x = ((j = Y.original.layoutProps) == null ? void 0 : j.height) === "fill";
228
+ const Q = ((F = Y.original.layoutProps) == null ? void 0 : F.width) === "fill", x = ((tt = Y.original.layoutProps) == null ? void 0 : tt.height) === "fill";
229
229
  C.push({
230
230
  id: Y.id,
231
231
  x: G + Y.w / 2 - l / 2,
232
232
  y: N + Y.h / 2 - p / 2,
233
- width: J && h ? A.width : void 0,
233
+ width: Q && h ? A.width : void 0,
234
234
  height: x ? h ? void 0 : A.height : void 0
235
235
  }), h ? z += Y.h + s : W += Y.w + s;
236
236
  }), h ? w += A.width + s : M += A.height + s;
@@ -246,24 +246,24 @@ function As(g, t, i) {
246
246
  y ? M = (p - v) / 2 : S && (M = p - v), C ? I = (c - b) / 2 : w && (I = c - b);
247
247
  const k = [];
248
248
  return t.forEach((T, L) => {
249
- var j, X;
249
+ var tt, X;
250
250
  const P = L % d.length || 0, _ = Math.floor(L / d.length) || 0;
251
251
  _ >= u.length && u.push(100);
252
252
  const E = d[P], A = u[_];
253
- let W = r.left + M + d.slice(0, P).reduce((tt, R) => tt + R + n, 0), z = r.top + I + u.slice(0, _).reduce((tt, R) => tt + R + a, 0);
253
+ let W = r.left + M + d.slice(0, P).reduce((et, R) => et + R + n, 0), z = r.top + I + u.slice(0, _).reduce((et, R) => et + R + a, 0);
254
254
  const Y = i(T.id), G = T.geometry;
255
- let N = (Y == null ? void 0 : Y.width) ?? G.width ?? 100, J = (Y == null ? void 0 : Y.height) ?? G.height ?? 100;
255
+ let N = (Y == null ? void 0 : Y.width) ?? G.width ?? 100, Q = (Y == null ? void 0 : Y.height) ?? G.height ?? 100;
256
256
  if (G.type === "Ellipse" || G.type === "Polygon" || G.type === "Star") {
257
- const tt = (Y == null ? void 0 : Y.radius) ?? G.radius ?? (Y == null ? void 0 : Y.outer_radius) ?? G.outer_radius ?? 50;
258
- N = tt * 2, J = tt * 2;
257
+ const et = (Y == null ? void 0 : Y.radius) ?? G.radius ?? (Y == null ? void 0 : Y.outer_radius) ?? G.outer_radius ?? 50;
258
+ N = et * 2, Q = et * 2;
259
259
  }
260
- N *= T.transform.scale_x || 1, J *= T.transform.scale_y || 1;
260
+ N *= T.transform.scale_x || 1, Q *= T.transform.scale_y || 1;
261
261
  let x = W, F = z;
262
- y ? x += (E - N) / 2 : S && (x += E - N), C ? F += (A - J) / 2 : w && (F += A - J), k.push({
262
+ y ? x += (E - N) / 2 : S && (x += E - N), C ? F += (A - Q) / 2 : w && (F += A - Q), k.push({
263
263
  id: T.id,
264
264
  x: x + N / 2 - f / 2,
265
- y: F + J / 2 - l / 2,
266
- width: ((j = T.layoutProps) == null ? void 0 : j.width) === "fill" ? E : void 0,
265
+ y: F + Q / 2 - l / 2,
266
+ width: ((tt = T.layoutProps) == null ? void 0 : tt.width) === "fill" ? E : void 0,
267
267
  height: ((X = T.layoutProps) == null ? void 0 : X.height) === "fill" ? A : void 0
268
268
  });
269
269
  }), { childUpdates: k };
@@ -593,22 +593,22 @@ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Rs = (g) => g < 1 ? 0 : 1, os =
593
593
  if (I && k && I.length !== void 0 && k.length !== void 0) {
594
594
  const T = I.length * (I.scale_y ?? 1), L = I.rotation * Math.PI / 180, P = I.x - T * Math.sin(L), _ = I.y + T * Math.cos(L), E = k.length * (k.scale_y ?? 1), A = k.rotation * Math.PI / 180, W = k.x - E * Math.sin(A), z = k.y + E * Math.cos(A);
595
595
  let Y = null, G = null, N = !1;
596
- const J = 1;
597
- if (Math.hypot(I.x - k.x, I.y - k.y) < J || Math.hypot(I.x - W, I.y - z) < J ? (Y = I.x, G = I.y) : (Math.hypot(P - k.x, _ - k.y) < J || Math.hypot(P - W, _ - z) < J) && (Y = P, G = _, N = !0), Y !== null && G !== null) {
596
+ const Q = 1;
597
+ if (Math.hypot(I.x - k.x, I.y - k.y) < Q || Math.hypot(I.x - W, I.y - z) < Q ? (Y = I.x, G = I.y) : (Math.hypot(P - k.x, _ - k.y) < Q || Math.hypot(P - W, _ - z) < Q) && (Y = P, G = _, N = !0), Y !== null && G !== null) {
598
598
  const x = i[m[0].boneId] || [1, 0, 0, 1, 0, 0], F = x[0] * x[3] - x[1] * x[2];
599
- let j = 0, X = 0;
599
+ let tt = 0, X = 0;
600
600
  if (F !== 0) {
601
- const tt = (x[2] * x[5] - x[3] * x[4]) / F, R = (x[1] * x[4] - x[0] * x[5]) / F, O = Math.atan2(-x[1], x[3]);
601
+ const et = (x[2] * x[5] - x[3] * x[4]) / F, R = (x[1] * x[4] - x[0] * x[5]) / F, O = Math.atan2(-x[1], x[3]);
602
602
  if (!N)
603
- j = tt, X = R;
603
+ tt = et, X = R;
604
604
  else {
605
- const ot = -x[2] / F, yt = x[0] / F, bt = Math.hypot(ot, yt), gt = I.length * bt;
606
- j = tt - gt * Math.sin(O), X = R + gt * Math.cos(O);
605
+ const ot = -x[2] / F, yt = x[0] / F, bt = Math.hypot(ot, yt), pt = I.length * bt;
606
+ tt = et - pt * Math.sin(O), X = R + pt * Math.cos(O);
607
607
  }
608
- const D = Math.hypot(v - j, b - X), q = Math.hypot(l - Y, p - G);
608
+ const D = Math.hypot(v - tt, b - X), q = Math.hypot(l - Y, p - G);
609
609
  if (q > 0 && D > 0) {
610
- const ot = Math.max(q, 0.01), yt = Math.min(D / ot, 3), bt = Y + (l - Y) * yt, gt = G + (p - G) * yt, Et = m[0].amount, It = m[1].amount, St = Math.min(Et, It) * 2, Xt = 1 - Math.pow(1 - St, 4);
611
- l = l * (1 - Xt) + bt * Xt, p = p * (1 - Xt) + gt * Xt;
610
+ const ot = Math.max(q, 0.01), yt = Math.min(D / ot, 3), bt = Y + (l - Y) * yt, pt = G + (p - G) * yt, Et = m[0].amount, It = m[1].amount, vt = Math.min(Et, It) * 2, Yt = 1 - Math.pow(1 - vt, 4);
611
+ l = l * (1 - Yt) + bt * Yt, p = p * (1 - Yt) + pt * Yt;
612
612
  }
613
613
  }
614
614
  }
@@ -1992,7 +1992,7 @@ class ci {
1992
1992
  let C = y.geometry;
1993
1993
  if (y.type === "Frame" || y.type === "Group" || !C || C.type !== "Path" && C.type !== "Ellipse" && C.type !== "Rectangle") {
1994
1994
  const F = (m = this.artboard) == null ? void 0 : m.objects.find(
1995
- (j) => j.parentId === y.id && j.type === "Shape" && j.geometry && (j.geometry.type === "Path" || j.geometry.type === "Ellipse" || j.geometry.type === "Rectangle")
1995
+ (tt) => tt.parentId === y.id && tt.type === "Shape" && tt.geometry && (tt.geometry.type === "Path" || tt.geometry.type === "Ellipse" || tt.geometry.type === "Rectangle")
1996
1996
  );
1997
1997
  F && (C = F.geometry);
1998
1998
  }
@@ -2000,11 +2000,11 @@ class ci {
2000
2000
  const w = (r.distance || 0) / 100, M = S.width || C.width || 0, I = S.height || C.height || 0, k = this.getPointOnPath(C, M, I, w), T = S.rotation * Math.PI / 180, L = Math.cos(T), P = Math.sin(T), _ = k.x * S.scale_x * L - k.y * S.scale_y * P, E = k.x * S.scale_x * P + k.y * S.scale_y * L;
2001
2001
  let A = S.rotation + (r.offsetRotation || 0);
2002
2002
  if (r.orient) {
2003
- const F = Math.cos(k.angle), j = Math.sin(k.angle), X = F * S.scale_x * L - j * S.scale_y * P, tt = F * S.scale_x * P + j * S.scale_y * L;
2004
- A = Math.atan2(tt, X) * 180 / Math.PI + (r.offsetRotation || 0);
2003
+ const F = Math.cos(k.angle), tt = Math.sin(k.angle), X = F * S.scale_x * L - tt * S.scale_y * P, et = F * S.scale_x * P + tt * S.scale_y * L;
2004
+ A = Math.atan2(et, X) * 180 / Math.PI + (r.offsetRotation || 0);
2005
2005
  }
2006
- const W = A * Math.PI / 180, z = Math.cos(W), Y = Math.sin(W), G = (r.offsetX || 0) * z - (r.offsetY || 0) * Y, N = (r.offsetX || 0) * Y + (r.offsetY || 0) * z, J = S.x + _ + G, x = S.y + E + N;
2007
- if (e.x = e.x + (J - e.x) * h, e.y = e.y + (x - e.y) * h, r.orient) {
2006
+ const W = A * Math.PI / 180, z = Math.cos(W), Y = Math.sin(W), G = (r.offsetX || 0) * z - (r.offsetY || 0) * Y, N = (r.offsetX || 0) * Y + (r.offsetY || 0) * z, Q = S.x + _ + G, x = S.y + E + N;
2007
+ if (e.x = e.x + (Q - e.x) * h, e.y = e.y + (x - e.y) * h, r.orient) {
2008
2008
  let F = (A - e.rotation) % 360;
2009
2009
  F > 180 && (F -= 360), F < -180 && (F += 360), e.rotation = e.rotation + F * h;
2010
2010
  }
@@ -2284,8 +2284,8 @@ class ci {
2284
2284
  b.forEach((_, E) => {
2285
2285
  const A = _.data || [], W = I / Math.max(A.length - 1, 1);
2286
2286
  A.forEach((z, Y) => {
2287
- const G = C.x - y / 2 + w + Y * W, N = C.y + S / 2 - M - z / T * k, J = Math.sqrt((i - G) ** 2 + (o - N) ** 2);
2288
- J < L && (L = J, P = { dIdx: E, pIdx: Y, val: z, label: _.label || `Dataset ${E + 1}` });
2287
+ const G = C.x - y / 2 + w + Y * W, N = C.y + S / 2 - M - z / T * k, Q = Math.sqrt((i - G) ** 2 + (o - N) ** 2);
2288
+ Q < L && (L = Q, P = { dIdx: E, pIdx: Y, val: z, label: _.label || `Dataset ${E + 1}` });
2289
2289
  });
2290
2290
  }), P && L < 20 && this.onGraphPointClick && this.onGraphPointClick({ objectId: c.id, componentName: c.name, datasetIndex: P.dIdx, pointIndex: P.pIdx, value: P.val, label: P.label }), this.onComponentChange && this.onComponentChange({ objectId: c.id, componentName: c.name, variant: "linegraph", property: "click", value: (P == null ? void 0 : P.val) ?? null });
2291
2291
  }
@@ -2586,14 +2586,14 @@ class ci {
2586
2586
  }
2587
2587
  const _ = this.objectStates.get(c.id);
2588
2588
  if (_) {
2589
- const E = l.isRelative !== !1, A = E ? ((u = c.transform) == null ? void 0 : u.x) ?? 0 : 0, W = E ? ((v = c.transform) == null ? void 0 : v.y) ?? 0 : 0, z = E ? ((b = c.transform) == null ? void 0 : b.rotation) ?? 0 : 0, Y = E ? ((m = c.transform) == null ? void 0 : m.scale_x) ?? 1 : 0, G = E ? ((y = c.transform) == null ? void 0 : y.scale_y) ?? 1 : 0, N = E ? ((S = c.style) == null ? void 0 : S.opacity) ?? 100 : 0, J = t * 60, x = (F, j) => {
2589
+ const E = l.isRelative !== !1, A = E ? ((u = c.transform) == null ? void 0 : u.x) ?? 0 : 0, W = E ? ((v = c.transform) == null ? void 0 : v.y) ?? 0 : 0, z = E ? ((b = c.transform) == null ? void 0 : b.rotation) ?? 0 : 0, Y = E ? ((m = c.transform) == null ? void 0 : m.scale_x) ?? 1 : 0, G = E ? ((y = c.transform) == null ? void 0 : y.scale_y) ?? 1 : 0, N = E ? ((S = c.style) == null ? void 0 : S.opacity) ?? 100 : 0, Q = t * 60, x = (F, tt) => {
2590
2590
  let X = L;
2591
2591
  if (T) {
2592
- const tt = `_internal_${F}_${l.id}`;
2593
- let R = _[tt];
2594
- R === void 0 && (R = _[F] ?? j), X = R + P * J, _[tt] = X, l.step && l.step > 0 && (X = Math.round(X / l.step) * l.step);
2592
+ const et = `_internal_${F}_${l.id}`;
2593
+ let R = _[et];
2594
+ R === void 0 && (R = _[F] ?? tt), X = R + P * Q, _[et] = X, l.step && l.step > 0 && (X = Math.round(X / l.step) * l.step);
2595
2595
  } else
2596
- X = j + L;
2596
+ X = tt + L;
2597
2597
  _[F] = X;
2598
2598
  };
2599
2599
  l.targetProperty === "x" || l.targetProperty === "transform.x" ? x("x", A) : l.targetProperty === "y" || l.targetProperty === "transform.y" ? x("y", W) : l.targetProperty === "rotation" || l.targetProperty === "r" || l.targetProperty === "transform.rotation" ? x("rotation", z) : l.targetProperty === "scaleX" || l.targetProperty === "transform.scale_x" ? x("scale_x", Y) : l.targetProperty === "scaleY" || l.targetProperty === "transform.scale_y" ? x("scale_y", G) : (l.targetProperty === "opacity" || l.targetProperty === "transform.opacity") && x("opacity", N);
@@ -2950,20 +2950,20 @@ class ci {
2950
2950
  }
2951
2951
  */
2952
2952
  renderObject(t, i, o) {
2953
- var u, v, b, m, y, S, C, w, M, I, k, T, L, P, _, E, A, W, z, Y, G, N, J, x, F, j;
2953
+ var u, v, b, m, y, S, C, w, M, I, k, T, L, P, _, E, A, W, z, Y, G, N, Q, x, F, tt;
2954
2954
  const e = this.objectStates.get(i.id);
2955
2955
  if (!e) {
2956
2956
  this.warn("No state for object:", i.id);
2957
2957
  return;
2958
2958
  }
2959
- this.frameCount % 60, t.roundRect || (t.roundRect = (X, tt, R, O, D) => (this.drawRoundRect(t, X, tt, R, O, D), t));
2959
+ this.frameCount % 60, t.roundRect || (t.roundRect = (X, et, R, O, D) => (this.drawRoundRect(t, X, et, R, O, D), t));
2960
2960
  const s = e.geometry ? this.deepMerge(i.geometry, e.geometry) : i.geometry;
2961
2961
  let n = e.style ? this.deepMerge(i.style, e.style) : i.style, a = (s == null ? void 0 : s.width) || ((u = i.geometry) == null ? void 0 : u.width) || i.width || 0, r = (s == null ? void 0 : s.height) || ((v = i.geometry) == null ? void 0 : v.height) || i.height || 0;
2962
2962
  if ((a === 0 || r === 0) && (s != null && s.points) && Array.isArray(s.points) && s.points.length > 0) {
2963
- let X = 1 / 0, tt = -1 / 0, R = 1 / 0, O = -1 / 0;
2963
+ let X = 1 / 0, et = -1 / 0, R = 1 / 0, O = -1 / 0;
2964
2964
  s.points.forEach((D) => {
2965
- X = Math.min(X, D.x), tt = Math.max(tt, D.x), R = Math.min(R, D.y), O = Math.max(O, D.y);
2966
- }), a === 0 && (a = tt - X), r === 0 && (r = O - R);
2965
+ X = Math.min(X, D.x), et = Math.max(et, D.x), R = Math.min(R, D.y), O = Math.max(O, D.y);
2966
+ }), a === 0 && (a = et - X), r === 0 && (r = O - R);
2967
2967
  }
2968
2968
  const h = (X) => {
2969
2969
  if (X)
@@ -2973,48 +2973,48 @@ class ci {
2973
2973
  if (delete l.cornerRadius, l.corner_radius = f, l.type === "Path" && i.weights && i.bindMatrices && l.points) {
2974
2974
  const X = this.getGlobalTransform(i.id);
2975
2975
  if (X) {
2976
- const tt = li(
2976
+ const et = li(
2977
2977
  l.points,
2978
2978
  i.weights,
2979
2979
  i.bindMatrices,
2980
2980
  X,
2981
2981
  (R) => this.getGlobalTransform(R)
2982
2982
  );
2983
- l = { ...l, points: tt };
2983
+ l = { ...l, points: et };
2984
2984
  }
2985
2985
  }
2986
2986
  if (e.visible === !1)
2987
2987
  return;
2988
2988
  const p = i.repeaterConfig, c = p && p.isEnabled && p.count > 1, d = c ? p.count : 1;
2989
2989
  for (let X = 0; X < d; X++) {
2990
- let tt = e.x !== void 0 ? e.x : ((b = e.transform) == null ? void 0 : b.x) ?? 0, R = e.y !== void 0 ? e.y : ((m = e.transform) == null ? void 0 : m.y) ?? 0, O = e.rotation !== void 0 ? e.rotation : ((y = e.transform) == null ? void 0 : y.rotation) ?? 0, D = e.scale_x !== void 0 ? e.scale_x : ((S = e.transform) == null ? void 0 : S.scale_x) ?? 1, q = e.scale_y !== void 0 ? e.scale_y : ((C = e.transform) == null ? void 0 : C.scale_y) ?? 1;
2990
+ let et = e.x !== void 0 ? e.x : ((b = e.transform) == null ? void 0 : b.x) ?? 0, R = e.y !== void 0 ? e.y : ((m = e.transform) == null ? void 0 : m.y) ?? 0, O = e.rotation !== void 0 ? e.rotation : ((y = e.transform) == null ? void 0 : y.rotation) ?? 0, D = e.scale_x !== void 0 ? e.scale_x : ((S = e.transform) == null ? void 0 : S.scale_x) ?? 1, q = e.scale_y !== void 0 ? e.scale_y : ((C = e.transform) == null ? void 0 : C.scale_y) ?? 1;
2991
2991
  if (c && X > 0) {
2992
2992
  if (p.type === "Linear") {
2993
- const ht = p.offsetX || 0, pt = p.offsetY || 0, at = p.rotation || 0, B = p.scale !== void 0 ? p.scale : 1;
2994
- tt += X * ht, R += X * pt, O += X * at, D *= Math.pow(B, X), q *= Math.pow(B, X);
2993
+ const ht = p.offsetX || 0, mt = p.offsetY || 0, at = p.rotation || 0, B = p.scale !== void 0 ? p.scale : 1;
2994
+ et += X * ht, R += X * mt, O += X * at, D *= Math.pow(B, X), q *= Math.pow(B, X);
2995
2995
  } else if (p.type === "Grid") {
2996
- const ht = p.cols || Math.ceil(Math.sqrt(p.count)), pt = p.gapX || 0, at = p.gapY || 0, B = Math.floor(X / ht), nt = X % ht, Z = a + pt, Pt = r + at;
2997
- tt += nt * Z, R += B * Pt;
2996
+ const ht = p.cols || Math.ceil(Math.sqrt(p.count)), mt = p.gapX || 0, at = p.gapY || 0, B = Math.floor(X / ht), K = X % ht, j = a + mt, kt = r + at;
2997
+ et += K * j, R += B * kt;
2998
2998
  } else if (p.type === "Radial") {
2999
- const ht = p.radius || 100, pt = p.startAngle || 0, B = (p.endAngle || 360) - pt, nt = p.count > 1 ? B / (B === 360 ? p.count : p.count - 1) : 0, Z = pt + X * nt, Pt = Z * Math.PI / 180;
3000
- tt = e.x + ht * Math.cos(Pt), R = e.y + ht * Math.sin(Pt), O += Z;
2999
+ const ht = p.radius || 100, mt = p.startAngle || 0, B = (p.endAngle || 360) - mt, K = p.count > 1 ? B / (B === 360 ? p.count : p.count - 1) : 0, j = mt + X * K, kt = j * Math.PI / 180;
3000
+ et = e.x + ht * Math.cos(kt), R = e.y + ht * Math.sin(kt), O += j;
3001
3001
  }
3002
3002
  }
3003
3003
  const ot = i.type === "Group" || i.type === "Frame" || i.type === "Component", yt = a > 0 && r > 0;
3004
3004
  if (!ot && yt) {
3005
3005
  const ht = (((w = n.shadow) == null ? void 0 : w.isEnabled) !== !1 ? (((M = n.shadow) == null ? void 0 : M.blur) || 0) + 10 : 0) + (((I = n.blur) == null ? void 0 : I.isEnabled) !== !1 && ((k = n.blur) == null ? void 0 : k.radius) || 0) + 20;
3006
- if (!this.isObjectInView(t, tt, R, a, r, ht))
3006
+ if (!this.isObjectInView(t, et, R, a, r, ht))
3007
3007
  continue;
3008
3008
  }
3009
3009
  this.debug_objectsRendered++, t.save();
3010
- const bt = [], gt = n.blur || ((T = i.style) == null ? void 0 : T.blur);
3011
- gt && gt.amount > 0 && bt.push(`blur(${gt.amount}px)`);
3010
+ const bt = [], pt = n.blur || ((T = i.style) == null ? void 0 : T.blur);
3011
+ pt && pt.amount > 0 && bt.push(`blur(${pt.amount}px)`);
3012
3012
  const Et = n.effects || ((L = i.style) == null ? void 0 : L.effects) || [];
3013
3013
  let It = Et.find((ht) => ht.isEnabled !== !1 && (ht.type === "BackgroundBlur" || ht.type === "LayerBlur"));
3014
3014
  It || (It = n.effect || ((P = i.style) == null ? void 0 : P.effect) || Et.find((ht) => ht.isEnabled !== !1));
3015
- const St = It, Xt = (St == null ? void 0 : St.isEnabled) !== !1, le = St == null ? void 0 : St.type, fe = (St == null ? void 0 : St.radius) ?? 10;
3016
- Xt && le === "LayerBlur" ? bt.push(`blur(${fe}px)`) : Xt && le === "BackgroundBlur" && (n === i.style && (n = { ...n }), n.fill = { type: "None" });
3017
- const et = ((_ = s == null ? void 0 : s.type) == null ? void 0 : _.toLowerCase().includes("image")) || ((E = i.type) == null ? void 0 : E.toLowerCase().includes("image")), mt = n.adjustments && Object.keys(n.adjustments).length > 0 ? n.adjustments : null, Rt = s != null && s.adjustments && Object.keys(s.adjustments).length > 0 ? s.adjustments : null, _t = et ? Rt || mt : mt || Rt, dt = et && !_t ? {
3015
+ const vt = It, Yt = (vt == null ? void 0 : vt.isEnabled) !== !1, se = vt == null ? void 0 : vt.type, fe = (vt == null ? void 0 : vt.radius) ?? 10;
3016
+ Yt && se === "LayerBlur" ? bt.push(`blur(${fe}px)`) : Yt && se === "BackgroundBlur" && (n === i.style && (n = { ...n }), n.fill = { type: "None" });
3017
+ const st = ((_ = s == null ? void 0 : s.type) == null ? void 0 : _.toLowerCase().includes("image")) || ((E = i.type) == null ? void 0 : E.toLowerCase().includes("image")), gt = n.adjustments && Object.keys(n.adjustments).length > 0 ? n.adjustments : null, Rt = s != null && s.adjustments && Object.keys(s.adjustments).length > 0 ? s.adjustments : null, Pt = st ? Rt || gt : gt || Rt, dt = st && !Pt ? {
3018
3018
  exposure: 0,
3019
3019
  contrast: 0,
3020
3020
  saturation: 100,
@@ -3025,35 +3025,35 @@ class ci {
3025
3025
  blur: 0,
3026
3026
  negative: 0,
3027
3027
  hue: 0
3028
- } : _t;
3028
+ } : Pt;
3029
3029
  if (e && dt && (e.geometry = e.geometry || {}, e.geometry.adjustments = { ...dt }), dt) {
3030
- const ht = (dt.exposure || 0) / 100, pt = dt.contrast || 0, at = 1 + (dt.saturation || 0) / 100, B = (dt.temperature || 0) / 200, nt = (dt.tint || 0) / 200, Z = (dt.highlights || 0) / 500, Pt = (dt.shadows || 0) / 500;
3031
- let xt = "", kt = "SourceGraphic";
3032
- if (ht !== 0 && (xt += `
3033
- <feComponentTransfer in="${kt}" result="exposure">
3030
+ const ht = (dt.exposure || 0) / 100, mt = dt.contrast || 0, at = 1 + (dt.saturation || 0) / 100, B = (dt.temperature || 0) / 200, K = (dt.tint || 0) / 200, j = (dt.highlights || 0) / 500, kt = (dt.shadows || 0) / 500;
3031
+ let At = "", Tt = "SourceGraphic";
3032
+ if (ht !== 0 && (At += `
3033
+ <feComponentTransfer in="${Tt}" result="exposure">
3034
3034
  <feFuncR type="linear" slope="1" intercept="${ht}"/>
3035
3035
  <feFuncG type="linear" slope="1" intercept="${ht}"/>
3036
3036
  <feFuncB type="linear" slope="1" intercept="${ht}"/>
3037
- </feComponentTransfer>`, kt = "exposure"), pt !== 0) {
3038
- const Mt = (pt + 100) / 100, $ = 0.5 * (1 - Mt);
3039
- xt += `
3040
- <feComponentTransfer in="${kt}" result="contrast">
3037
+ </feComponentTransfer>`, Tt = "exposure"), mt !== 0) {
3038
+ const Mt = (mt + 100) / 100, $ = 0.5 * (1 - Mt);
3039
+ At += `
3040
+ <feComponentTransfer in="${Tt}" result="contrast">
3041
3041
  <feFuncR type="linear" slope="${Mt}" intercept="${$}"/>
3042
3042
  <feFuncG type="linear" slope="${Mt}" intercept="${$}"/>
3043
3043
  <feFuncB type="linear" slope="${Mt}" intercept="${$}"/>
3044
- </feComponentTransfer>`, kt = "contrast";
3044
+ </feComponentTransfer>`, Tt = "contrast";
3045
3045
  }
3046
- if (at !== 1 && (xt += `<feColorMatrix in="${kt}" type="saturate" values="${at}" result="saturate"/>`, kt = "saturate"), dt.hue && (xt += `<feColorMatrix in="${kt}" type="hueRotate" values="${dt.hue}" result="hue"/>`, kt = "hue"), dt.negative) {
3046
+ if (at !== 1 && (At += `<feColorMatrix in="${Tt}" type="saturate" values="${at}" result="saturate"/>`, Tt = "saturate"), dt.hue && (At += `<feColorMatrix in="${Tt}" type="hueRotate" values="${dt.hue}" result="hue"/>`, Tt = "hue"), dt.negative) {
3047
3047
  const Mt = 1 - dt.negative / 50;
3048
- xt += `
3049
- <feColorMatrix in="${kt}" type="matrix" result="invert"
3048
+ At += `
3049
+ <feColorMatrix in="${Tt}" type="matrix" result="invert"
3050
3050
  values="${Mt} 0 0 0 ${1 - Mt}
3051
3051
  0 ${Mt} 0 0 ${1 - Mt}
3052
3052
  0 0 ${Mt} 0 ${1 - Mt}
3053
- 0 0 0 1 0"/>`, kt = "invert";
3053
+ 0 0 0 1 0"/>`, Tt = "invert";
3054
3054
  }
3055
- if (B !== 0 || nt !== 0 || Z !== 0 || Pt !== 0) {
3056
- const Mt = 1 + Z + Pt, $ = Mt * (1 + B - nt / 2), Wt = Mt * (1 + nt), Kt = Mt * (1 - B - nt / 2), te = dt.shadows * 0.1 / 255, Jt = [
3055
+ if (B !== 0 || K !== 0 || j !== 0 || kt !== 0) {
3056
+ const Mt = 1 + j + kt, $ = Mt * (1 + B - K / 2), Wt = Mt * (1 + K), Kt = Mt * (1 - B - K / 2), te = dt.shadows * 0.1 / 255, Jt = [
3057
3057
  $,
3058
3058
  0,
3059
3059
  0,
@@ -3075,10 +3075,10 @@ class ci {
3075
3075
  1,
3076
3076
  0
3077
3077
  ].join(" ");
3078
- xt += `<feColorMatrix in="${kt}" type="matrix" values="${Jt}" result="advanced"/>`, kt = "advanced";
3078
+ At += `<feColorMatrix in="${Tt}" type="matrix" values="${Jt}" result="advanced"/>`, Tt = "advanced";
3079
3079
  }
3080
- if (dt.blur && (xt += `<feGaussianBlur in="${kt}" stdDeviation="${dt.blur}" result="blur"/>`, kt = "blur"), xt) {
3081
- const Mt = `<svg xmlns="http://www.w3.org/2000/svg"><filter id="f" color-interpolation-filters="sRGB">${xt}</filter></svg>`, $ = btoa(Mt);
3080
+ if (dt.blur && (At += `<feGaussianBlur in="${Tt}" stdDeviation="${dt.blur}" result="blur"/>`, Tt = "blur"), At) {
3081
+ const Mt = `<svg xmlns="http://www.w3.org/2000/svg"><filter id="f" color-interpolation-filters="sRGB">${At}</filter></svg>`, $ = btoa(Mt);
3082
3082
  bt.push(`url('data:image/svg+xml;base64,${$}#f')`);
3083
3083
  }
3084
3084
  }
@@ -3127,41 +3127,41 @@ class ci {
3127
3127
  feather: i.maskFeather || 0,
3128
3128
  isVisible: !0
3129
3129
  }] : []);
3130
- let ie = !1;
3130
+ let ne = !1;
3131
3131
  const me = Vt.filter((ht) => ht.isVisible !== !1 && o.has(ht.maskId));
3132
3132
  if (me.length > 0) {
3133
- const ht = me[0], pt = o.get(ht.maskId), at = this.objectStates.get(pt.id);
3134
- at && at.visible !== !1 && (ie = !0, (!this.maskBuffer || this.maskBuffer.width !== this.canvasWidth || this.maskBuffer.height !== this.canvasHeight) && (this.maskBuffer = document.createElement("canvas"), this.maskBuffer.width = this.canvasWidth, this.maskBuffer.height = this.canvasHeight, this.maskCtx = this.maskBuffer.getContext("2d", { willReadFrequently: !0 }), this.maskCtx && (this.maskCtx.imageSmoothingEnabled = !0, this.maskCtx.imageSmoothingQuality = "high")), this.maskCtx.setTransform(1, 0, 0, 1, 0, 0), this.maskCtx.globalCompositeOperation = "source-over", this.maskCtx.globalAlpha = 1, this.maskCtx.filter = "none", this.maskCtx.clearRect(0, 0, this.maskBuffer.width, this.maskBuffer.height), this.rootTransform && this.maskCtx.setTransform(this.rootTransform), i.parentId && this.applyAbsoluteTransform(this.maskCtx, i.parentId, o), this.maskCtx.save(), this.maskCtx.globalAlpha = 1, t = this.maskCtx, t.filter = Ot.filter);
3133
+ const ht = me[0], mt = o.get(ht.maskId), at = this.objectStates.get(mt.id);
3134
+ at && at.visible !== !1 && (ne = !0, (!this.maskBuffer || this.maskBuffer.width !== this.canvasWidth || this.maskBuffer.height !== this.canvasHeight) && (this.maskBuffer = document.createElement("canvas"), this.maskBuffer.width = this.canvasWidth, this.maskBuffer.height = this.canvasHeight, this.maskCtx = this.maskBuffer.getContext("2d", { willReadFrequently: !0 }), this.maskCtx && (this.maskCtx.imageSmoothingEnabled = !0, this.maskCtx.imageSmoothingQuality = "high")), this.maskCtx.setTransform(1, 0, 0, 1, 0, 0), this.maskCtx.globalCompositeOperation = "source-over", this.maskCtx.globalAlpha = 1, this.maskCtx.filter = "none", this.maskCtx.clearRect(0, 0, this.maskBuffer.width, this.maskBuffer.height), this.rootTransform && this.maskCtx.setTransform(this.rootTransform), i.parentId && this.applyAbsoluteTransform(this.maskCtx, i.parentId, o), this.maskCtx.save(), this.maskCtx.globalAlpha = 1, t = this.maskCtx, t.filter = Ot.filter);
3135
3135
  }
3136
- t.translate(Math.round(tt), Math.round(R)), t.rotate(O * Math.PI / 180);
3136
+ t.translate(Math.round(et), Math.round(R)), t.rotate(O * Math.PI / 180);
3137
3137
  const ye = e.skew_x || 0, Ut = e.skew_y || 0;
3138
3138
  if (ye !== 0 || Ut !== 0) {
3139
- const ht = Math.tan(ye * Math.PI / 180), pt = Math.tan(Ut * Math.PI / 180);
3140
- t.transform(1 + ht * pt, pt, ht, 1, 0, 0);
3139
+ const ht = Math.tan(ye * Math.PI / 180), mt = Math.tan(Ut * Math.PI / 180);
3140
+ t.transform(1 + ht * mt, mt, ht, 1, 0, 0);
3141
3141
  }
3142
3142
  const Se = e.rotate_x !== void 0 ? e.rotate_x : ((A = e.transform) == null ? void 0 : A.rotate_x) ?? 0, Pe = e.rotate_y !== void 0 ? e.rotate_y : ((W = e.transform) == null ? void 0 : W.rotate_y) ?? 0, Ce = 1 + (e.translate_z !== void 0 ? e.translate_z : ((z = e.transform) == null ? void 0 : z.translate_z) ?? 0) / 1e3, Ae = (e.flip_x === !0 ? -1 : 1) * Math.cos(Pe * Math.PI / 180) * Ce, xe = (e.flip_y === !0 ? -1 : 1) * Math.cos(Se * Math.PI / 180) * Ce;
3143
3143
  t.scale(
3144
3144
  D * Ae,
3145
3145
  q * xe
3146
3146
  ), n.shadow && n.shadow.isEnabled !== !0 && ((n.shadow.blur || 0) > 0 || Math.abs(n.shadow.offsetX || 0) > 0 || Math.abs(n.shadow.offsetY || 0) > 0) && (n.shadow.isEnabled = !0);
3147
- const se = n.shadow;
3148
- if (se && se.isEnabled !== !1) {
3149
- let ht = se.color || "#000000";
3147
+ const ie = n.shadow;
3148
+ if (ie && ie.isEnabled !== !1) {
3149
+ let ht = ie.color || "#000000";
3150
3150
  (G = (Y = this.artboard) == null ? void 0 : Y.tokens) != null && G.colors && this.artboard.tokens.colors[ht] && (ht = this.artboard.tokens.colors[ht]);
3151
- const pt = this.normalizeOpacity(se.opacity ?? 100), at = se.spread || 0, nt = (se.blur || 0) + at * 1.5;
3152
- let Z = ht;
3151
+ const mt = this.normalizeOpacity(ie.opacity ?? 100), at = ie.spread || 0, K = (ie.blur || 0) + at * 1.5;
3152
+ let j = ht;
3153
3153
  if (ht.startsWith("#")) {
3154
- const kt = ht.replace("#", ""), At = parseInt(kt.substring(0, 2), 16), Mt = parseInt(kt.substring(2, 4), 16), $ = parseInt(kt.substring(4, 6), 16);
3155
- Z = `rgba(${At}, ${Mt}, ${$}, ${pt})`;
3154
+ const Tt = ht.replace("#", ""), xt = parseInt(Tt.substring(0, 2), 16), Mt = parseInt(Tt.substring(2, 4), 16), $ = parseInt(Tt.substring(4, 6), 16);
3155
+ j = `rgba(${xt}, ${Mt}, ${$}, ${mt})`;
3156
3156
  } else if (ht.startsWith("rgba")) {
3157
- const kt = ht.match(/[\d.]+/g);
3158
- if (kt && kt.length >= 4) {
3159
- const At = kt[0], Mt = kt[1], $ = kt[2], Wt = kt[3];
3160
- Z = `rgba(${At}, ${Mt}, ${$}, ${parseFloat(Wt) * pt})`;
3157
+ const Tt = ht.match(/[\d.]+/g);
3158
+ if (Tt && Tt.length >= 4) {
3159
+ const xt = Tt[0], Mt = Tt[1], $ = Tt[2], Wt = Tt[3];
3160
+ j = `rgba(${xt}, ${Mt}, ${$}, ${parseFloat(Wt) * mt})`;
3161
3161
  }
3162
3162
  }
3163
- const Pt = t.getTransform(), xt = Math.sqrt(Pt.a * Pt.a + Pt.b * Pt.b) || 1;
3164
- t.shadowColor = Z, t.shadowBlur = nt * xt, t.shadowOffsetX = (se.offsetX || 0) * xt, t.shadowOffsetY = (se.offsetY || 0) * xt;
3163
+ const kt = t.getTransform(), At = Math.sqrt(kt.a * kt.a + kt.b * kt.b) || 1;
3164
+ t.shadowColor = j, t.shadowBlur = K * At, t.shadowOffsetX = (ie.offsetX || 0) * At, t.shadowOffsetY = (ie.offsetY || 0) * At;
3165
3165
  } else
3166
3166
  t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetX = 0, t.shadowOffsetY = 0;
3167
3167
  const jt = i.liquidFill || ((N = i.style) == null ? void 0 : N.liquidFill);
@@ -3169,32 +3169,32 @@ class ci {
3169
3169
  t.save();
3170
3170
  const ht = jt.fillLevel ?? 0.5;
3171
3171
  t.beginPath();
3172
- const pt = r / 2 - r * ht;
3173
- t.rect(-a / 2, pt, a, r * ht), t.clip(), t.fillStyle = jt.color || "#3b82f6", t.globalAlpha = t.globalAlpha * (jt.opacity ?? 1);
3172
+ const mt = r / 2 - r * ht;
3173
+ t.rect(-a / 2, mt, a, r * ht), t.clip(), t.fillStyle = jt.color || "#3b82f6", t.globalAlpha = t.globalAlpha * (jt.opacity ?? 1);
3174
3174
  }
3175
3175
  if ((s == null ? void 0 : s.type) === "Text")
3176
3176
  this._renderText(t, i, l, n, e, a, r, !1, !1, D, q);
3177
3177
  else if ((s == null ? void 0 : s.type) === "Image") {
3178
3178
  const ht = s.originalSrc || s.src;
3179
3179
  if (ht) {
3180
- let pt = this.imageCache.get(ht);
3181
- pt || (pt = new Image(), pt.onload = () => {
3182
- this.log(`[ExodeUI] Image loaded successfully, size: ${pt.naturalWidth}x${pt.naturalHeight}`);
3183
- }, pt.onerror = (nt) => {
3184
- console.error("[ExodeUI] Image load failed:", nt, `Src preview: ${ht.substring(0, 100)}...`);
3185
- }, pt.src = ht, this.imageCache.set(ht, pt));
3186
- const at = n.stroke && n.stroke.width > 0 && n.stroke.isEnabled !== !1, B = (((J = n.stroke) == null ? void 0 : J.alignment) || "center").toLowerCase();
3180
+ let mt = this.imageCache.get(ht);
3181
+ mt || (mt = new Image(), mt.onload = () => {
3182
+ this.log(`[ExodeUI] Image loaded successfully, size: ${mt.naturalWidth}x${mt.naturalHeight}`);
3183
+ }, mt.onerror = (K) => {
3184
+ console.error("[ExodeUI] Image load failed:", K, `Src preview: ${ht.substring(0, 100)}...`);
3185
+ }, mt.src = ht, this.imageCache.set(ht, mt));
3186
+ const at = n.stroke && n.stroke.width > 0 && n.stroke.isEnabled !== !1, B = (((Q = n.stroke) == null ? void 0 : Q.alignment) || "center").toLowerCase();
3187
3187
  if (at && (B === "outside" || B === "center") && this.applyStrokeAlignment(t, n, l, a, r, f, D, q), n.fill && n.fill.type !== "None") {
3188
3188
  t.save();
3189
- const nt = t.globalAlpha, Z = this.createCanvasFill(t, n.fill, a, r);
3190
- t.fillStyle = Z || n.fill.color || "transparent", t.globalAlpha = nt * this.normalizeOpacity(n.fill.opacity ?? 100), f !== 0 ? (this.drawRoundRect(t, -a / 2, -r / 2, a, r, f), t.fill()) : t.fillRect(-a / 2, -r / 2, a, r), t.globalAlpha = nt, t.restore();
3189
+ const K = t.globalAlpha, j = this.createCanvasFill(t, n.fill, a, r);
3190
+ t.fillStyle = j || n.fill.color || "transparent", t.globalAlpha = K * this.normalizeOpacity(n.fill.opacity ?? 100), f !== 0 ? (this.drawRoundRect(t, -a / 2, -r / 2, a, r, f), t.fill()) : t.fillRect(-a / 2, -r / 2, a, r), t.globalAlpha = K, t.restore();
3191
3191
  }
3192
- pt.complete && pt.naturalWidth > 0 ? (f !== 0 ? (t.save(), this.drawRoundRect(t, -a / 2, -r / 2, a, r, f), t.clip(), t.drawImage(pt, -a / 2, -r / 2, a, r), t.restore()) : t.drawImage(pt, -a / 2, -r / 2, a, r), at && B === "inside" && this.applyStrokeAlignment(t, n, l, a, r, f, D, q)) : at && B === "inside" && this.applyStrokeAlignment(t, n, l, a, r, f, D, q);
3192
+ mt.complete && mt.naturalWidth > 0 ? (f !== 0 ? (t.save(), this.drawRoundRect(t, -a / 2, -r / 2, a, r, f), t.clip(), t.drawImage(mt, -a / 2, -r / 2, a, r), t.restore()) : t.drawImage(mt, -a / 2, -r / 2, a, r), at && B === "inside" && this.applyStrokeAlignment(t, n, l, a, r, f, D, q)) : at && B === "inside" && this.applyStrokeAlignment(t, n, l, a, r, f, D, q);
3193
3193
  }
3194
3194
  } else if (s.type === "SVG") {
3195
3195
  const ht = s.svgContent;
3196
3196
  if (ht) {
3197
- const pt = n.palette || [], at = n.fill, B = n.stroke, nt = at ? this.normalizeOpacity(at.opacity ?? 100) : 1, Z = (at == null ? void 0 : at.type) === "Solid" && (!B || B.isEnabled === !1 || B.type === "Solid" && B.color === at.color), Pt = at && at.type !== "None" ? Z ? "monochrome" : at.type === "Solid" ? (at.color || "") + "|opacity:" + nt : JSON.stringify(at.stops || []) + "|opacity:" + nt : "", xt = B && B.isEnabled !== !1 && (B.width || 0) > 0 ? Z ? [
3197
+ const mt = n.palette || [], at = n.fill, B = n.stroke, K = at ? this.normalizeOpacity(at.opacity ?? 100) : 1, j = (at == null ? void 0 : at.type) === "Solid" && (!B || B.isEnabled === !1 || B.type === "Solid" && B.color === at.color), kt = at && at.type !== "None" ? j ? "monochrome" : at.type === "Solid" ? (at.color || "") + "|opacity:" + K : JSON.stringify(at.stops || []) + "|opacity:" + K : "", At = B && B.isEnabled !== !1 && (B.width || 0) > 0 ? j ? [
3198
3198
  "monochrome",
3199
3199
  B.width || 0,
3200
3200
  B.trimStart ?? 0,
@@ -3213,87 +3213,87 @@ class ci {
3213
3213
  B.trimEnd ?? 1,
3214
3214
  B.trimOffset ?? 0,
3215
3215
  B.dashOffset ?? 0
3216
- ].join("|") : "nostroke", kt = [
3216
+ ].join("|") : "nostroke", Tt = [
3217
3217
  i.id,
3218
- pt.join("_"),
3219
- Pt,
3220
- xt,
3218
+ mt.join("_"),
3219
+ kt,
3220
+ At,
3221
3221
  e.opacity ?? 100,
3222
3222
  e.visible !== !1 ? "v" : "h"
3223
3223
  ].join("_");
3224
- let At = this.imageCache.get(kt);
3225
- if (!At) {
3226
- At = new Image(), At.crossOrigin = "anonymous";
3224
+ let xt = this.imageCache.get(Tt);
3225
+ if (!xt) {
3226
+ xt = new Image(), xt.crossOrigin = "anonymous";
3227
3227
  let $ = ht;
3228
3228
  $.match(/xmlns=["']http:\/\/www\.w3\.org\/2000\/svg["']/i) || ($ = $.replace(/<svg([^>]*)>/i, (rt, V) => `<svg xmlns="http://www.w3.org/2000/svg"${V}>`));
3229
3229
  let Wt = s.width || a || 100, Kt = s.height || r || 100;
3230
3230
  const te = $.match(/viewBox=["']\s*0\s+0\s+([\d.]+)\s+([\d.]+)\s*["']/i);
3231
3231
  if (te && (Wt = parseFloat(te[1]), Kt = parseFloat(te[2])), $ = $.replace(/<svg([^>]*)>/i, (rt, V) => {
3232
- let st = V.replace(/\b(?:width|height)=["'][^"']*["']/gi, " ");
3233
- return st.match(/\bviewBox=/i) || (st += ` viewBox="0 0 ${Wt} ${Kt}"`), st.match(/\bpreserveAspectRatio=/i) || (st += ' preserveAspectRatio="none"'), st += ' width="100%" height="100%"', `<svg${st}>`;
3234
- }), s.colors && s.colors.length > 0 && pt.length > 0 && s.colors.forEach((rt, V) => {
3235
- if (pt[V]) {
3236
- const st = rt.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), it = new RegExp(st, "gi");
3237
- $ = $.replace(it, pt[V]);
3232
+ let it = V.replace(/\b(?:width|height)=["'][^"']*["']/gi, " ");
3233
+ return it.match(/\bviewBox=/i) || (it += ` viewBox="0 0 ${Wt} ${Kt}"`), it.match(/\bpreserveAspectRatio=/i) || (it += ' preserveAspectRatio="none"'), it += ' width="100%" height="100%"', `<svg${it}>`;
3234
+ }), s.colors && s.colors.length > 0 && mt.length > 0 && s.colors.forEach((rt, V) => {
3235
+ if (mt[V]) {
3236
+ const it = rt.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), nt = new RegExp(it, "gi");
3237
+ $ = $.replace(nt, mt[V]);
3238
3238
  }
3239
3239
  }), at && at.type && at.type !== "None") {
3240
3240
  if (at.type === "Solid" && at.color) {
3241
- const rt = Z ? "#FFFFFF" : at.color, V = Z ? 1 : this.normalizeOpacity(at.opacity ?? 100);
3242
- $ = $.replace(/\bfill\s*=\s*["'][^"']*["']/gi, (st) => /fill\s*=\s*["']\s*(none|transparent)\s*["']/i.test(st) ? st : `fill="${rt}"`), $ = $.replace(/fill\s*:\s*[^;"')]+/gi, (st) => /fill\s*:\s*(none|transparent)/i.test(st) ? st : `fill:${rt}`), V < 1 && ($ = $.replace(/\bfill-opacity\s*=\s*["'][^"']*["']/gi, `fill-opacity="${V}"`), $ = $.replace(/fill-opacity\s*:\s*[^;"')]+/gi, `fill-opacity:${V}`), $.match(/\bfill-opacity\s*=/i) || ($ = $.replace(/(<svg[^>]*>)/i, `$1<g fill-opacity="${V}">`), $ = $.replace(/<\/svg>/i, "</g></svg>")));
3241
+ const rt = j ? "#FFFFFF" : at.color, V = j ? 1 : this.normalizeOpacity(at.opacity ?? 100);
3242
+ $ = $.replace(/\bfill\s*=\s*["'][^"']*["']/gi, (it) => /fill\s*=\s*["']\s*(none|transparent)\s*["']/i.test(it) ? it : `fill="${rt}"`), $ = $.replace(/fill\s*:\s*[^;"')]+/gi, (it) => /fill\s*:\s*(none|transparent)/i.test(it) ? it : `fill:${rt}`), V < 1 && ($ = $.replace(/\bfill-opacity\s*=\s*["'][^"']*["']/gi, `fill-opacity="${V}"`), $ = $.replace(/fill-opacity\s*:\s*[^;"')]+/gi, `fill-opacity:${V}`), $.match(/\bfill-opacity\s*=/i) || ($ = $.replace(/(<svg[^>]*>)/i, `$1<g fill-opacity="${V}">`), $ = $.replace(/<\/svg>/i, "</g></svg>")));
3243
3243
  } else if (at.type === "LinearGradient" || at.type === "RadialGradient" || at.type === "Linear" || at.type === "Radial") {
3244
- const rt = "exode-fill", V = this.normalizeOpacity(at.opacity ?? 100), st = (at.stops || []).map((vt) => {
3245
- const Yt = vt.offset !== void 0 ? vt.offset : vt.pos ?? 0, Qt = this.normalizeOpacity(vt.opacity ?? 100) * V;
3246
- return `<stop offset="${Yt * 100}%" stop-color="${vt.color || "#000"}" stop-opacity="${Qt}"/>`;
3244
+ const rt = "exode-fill", V = this.normalizeOpacity(at.opacity ?? 100), it = (at.stops || []).map((St) => {
3245
+ const Xt = St.offset !== void 0 ? St.offset : St.pos ?? 0, Qt = this.normalizeOpacity(St.opacity ?? 100) * V;
3246
+ return `<stop offset="${Xt * 100}%" stop-color="${St.color || "#000"}" stop-opacity="${Qt}"/>`;
3247
3247
  }).join("");
3248
- let it = "";
3248
+ let nt = "";
3249
3249
  if (at.type === "LinearGradient" || at.type === "Linear") {
3250
- const vt = (Ht, Nt) => Array.isArray(Ht) ? Ht[Nt] ?? (Nt === 0 ? 0 : 1) : Ht && typeof Ht == "object" ? Ht[Nt === 0 ? "x" : "y"] ?? (Nt === 0 ? 0 : 1) : Nt === 0 ? 0 : 1, Yt = vt(at.start, 0) * 100, Qt = vt(at.start, 1) * 100, ne = vt(at.end, 0) * 100, Gt = vt(at.end, 1) * 100;
3251
- it = `<linearGradient id="${rt}" x1="${Yt}%" y1="${Qt}%" x2="${ne}%" y2="${Gt}%" gradientUnits="objectBoundingBox">${st}</linearGradient>`;
3250
+ const St = (Ht, Nt) => Array.isArray(Ht) ? Ht[Nt] ?? (Nt === 0 ? 0 : 1) : Ht && typeof Ht == "object" ? Ht[Nt === 0 ? "x" : "y"] ?? (Nt === 0 ? 0 : 1) : Nt === 0 ? 0 : 1, Xt = St(at.start, 0) * 100, Qt = St(at.start, 1) * 100, oe = St(at.end, 0) * 100, Gt = St(at.end, 1) * 100;
3251
+ nt = `<linearGradient id="${rt}" x1="${Xt}%" y1="${Qt}%" x2="${oe}%" y2="${Gt}%" gradientUnits="objectBoundingBox">${it}</linearGradient>`;
3252
3252
  } else {
3253
- const vt = (Gt, Ht) => Array.isArray(Gt) ? Gt[Ht] ?? 0.5 : Gt && typeof Gt == "object" ? Gt[Ht === 0 ? "x" : "y"] ?? 0.5 : 0.5, Yt = vt(at.center, 0) * 100, Qt = vt(at.center, 1) * 100, ne = (at.radius ?? 0.5) * 100;
3254
- it = `<radialGradient id="${rt}" cx="${Yt}%" cy="${Qt}%" r="${ne}%" gradientUnits="objectBoundingBox">${st}</radialGradient>`;
3253
+ const St = (Gt, Ht) => Array.isArray(Gt) ? Gt[Ht] ?? 0.5 : Gt && typeof Gt == "object" ? Gt[Ht === 0 ? "x" : "y"] ?? 0.5 : 0.5, Xt = St(at.center, 0) * 100, Qt = St(at.center, 1) * 100, oe = (at.radius ?? 0.5) * 100;
3254
+ nt = `<radialGradient id="${rt}" cx="${Xt}%" cy="${Qt}%" r="${oe}%" gradientUnits="objectBoundingBox">${it}</radialGradient>`;
3255
3255
  }
3256
- /<defs>/i.test($) ? $ = $.replace(/<defs>/i, `<defs>${it}`) : $ = $.replace(/<svg([^>]*)>/i, `<svg$1><defs>${it}</defs>`), $ = $.replace(/\bfill\s*=\s*["'][^"']*["']/gi, (vt) => /fill\s*=\s*["']\s*(none|transparent)\s*["']/i.test(vt) ? vt : `fill="url(#${rt})"`), $ = $.replace(/fill\s*:\s*[^;"')]+/gi, (vt) => /fill\s*:\s*(none|transparent)/i.test(vt) ? vt : `fill:url(#${rt})`);
3256
+ /<defs>/i.test($) ? $ = $.replace(/<defs>/i, `<defs>${nt}`) : $ = $.replace(/<svg([^>]*)>/i, `<svg$1><defs>${nt}</defs>`), $ = $.replace(/\bfill\s*=\s*["'][^"']*["']/gi, (St) => /fill\s*=\s*["']\s*(none|transparent)\s*["']/i.test(St) ? St : `fill="url(#${rt})"`), $ = $.replace(/fill\s*:\s*[^;"')]+/gi, (St) => /fill\s*:\s*(none|transparent)/i.test(St) ? St : `fill:url(#${rt})`);
3257
3257
  }
3258
3258
  }
3259
- const Jt = (rt, V, st = 1) => {
3260
- const it = (rt.stops || []).map((Gt) => {
3261
- const Ht = Gt.offset !== void 0 ? Gt.offset : Gt.pos ?? 0, Nt = this.normalizeOpacity(Gt.opacity ?? 100) * st;
3259
+ const Jt = (rt, V, it = 1) => {
3260
+ const nt = (rt.stops || []).map((Gt) => {
3261
+ const Ht = Gt.offset !== void 0 ? Gt.offset : Gt.pos ?? 0, Nt = this.normalizeOpacity(Gt.opacity ?? 100) * it;
3262
3262
  return `<stop offset="${Ht * 100}%" stop-color="${Gt.color || "#000"}" stop-opacity="${Nt}"/>`;
3263
- }).join(""), vt = (Gt, Ht, Nt = 0.5) => Array.isArray(Gt) ? Gt[Ht] ?? Nt : Gt && typeof Gt == "object" ? Gt[Ht === 0 ? "x" : "y"] ?? Nt : Nt;
3263
+ }).join(""), St = (Gt, Ht, Nt = 0.5) => Array.isArray(Gt) ? Gt[Ht] ?? Nt : Gt && typeof Gt == "object" ? Gt[Ht === 0 ? "x" : "y"] ?? Nt : Nt;
3264
3264
  if (rt.type === "LinearGradient" || rt.type === "Linear") {
3265
- const Gt = vt(rt.start, 0, 0) * 100, Ht = vt(rt.start, 1, 0) * 100, Nt = vt(rt.end, 0, 1) * 100, Ie = vt(rt.end, 1, 1) * 100;
3266
- return `<linearGradient id="${V}" x1="${Gt}%" y1="${Ht}%" x2="${Nt}%" y2="${Ie}%" gradientUnits="objectBoundingBox">${it}</linearGradient>`;
3265
+ const Gt = St(rt.start, 0, 0) * 100, Ht = St(rt.start, 1, 0) * 100, Nt = St(rt.end, 0, 1) * 100, Ie = St(rt.end, 1, 1) * 100;
3266
+ return `<linearGradient id="${V}" x1="${Gt}%" y1="${Ht}%" x2="${Nt}%" y2="${Ie}%" gradientUnits="objectBoundingBox">${nt}</linearGradient>`;
3267
3267
  }
3268
- const Yt = vt(rt.center, 0, 0.5) * 100, Qt = vt(rt.center, 1, 0.5) * 100, ne = (rt.radius ?? 0.5) * 100;
3269
- return `<radialGradient id="${V}" cx="${Yt}%" cy="${Qt}%" r="${ne}%" gradientUnits="objectBoundingBox">${it}</radialGradient>`;
3268
+ const Xt = St(rt.center, 0, 0.5) * 100, Qt = St(rt.center, 1, 0.5) * 100, oe = (rt.radius ?? 0.5) * 100;
3269
+ return `<radialGradient id="${V}" cx="${Xt}%" cy="${Qt}%" r="${oe}%" gradientUnits="objectBoundingBox">${nt}</radialGradient>`;
3270
3270
  }, ut = (rt, V) => /<defs>/i.test(rt) ? rt.replace(/<defs>/i, `<defs>${V}`) : rt.replace(/(<svg[^>]*>)/i, `$1<defs>${V}</defs>`);
3271
3271
  if (B && B.isEnabled !== !1 && (B.width || 0) > 0) {
3272
- const rt = Z ? 1 : this.normalizeOpacity(B.opacity ?? 100), V = Z ? "#FFFFFF" : B.color || (at == null ? void 0 : at.color) || "#000000";
3273
- let st = "";
3274
- const it = B.fill;
3275
- if (it && it.type) {
3276
- if (it.type === "Solid")
3277
- st = it.color || B.color || "#000000";
3278
- else if (it.type === "LinearGradient" || it.type === "RadialGradient" || it.type === "Linear" || it.type === "Radial") {
3272
+ const rt = j ? 1 : this.normalizeOpacity(B.opacity ?? 100), V = j ? "#FFFFFF" : B.color || (at == null ? void 0 : at.color) || "#000000";
3273
+ let it = "";
3274
+ const nt = B.fill;
3275
+ if (nt && nt.type) {
3276
+ if (nt.type === "Solid")
3277
+ it = nt.color || B.color || "#000000";
3278
+ else if (nt.type === "LinearGradient" || nt.type === "RadialGradient" || nt.type === "Linear" || nt.type === "Radial") {
3279
3279
  const zt = "exode-stroke";
3280
- $ = ut($, Jt(it, zt, rt)), st = `url(#${zt})`;
3280
+ $ = ut($, Jt(nt, zt, rt)), it = `url(#${zt})`;
3281
3281
  }
3282
3282
  }
3283
- st || (st = V), $.match(/\bstroke\s*=\s*["']/i) ? $ = $.replace(
3283
+ it || (it = V), $.match(/\bstroke\s*=\s*["']/i) ? $ = $.replace(
3284
3284
  /\bstroke\s*=\s*["'][^"']*["']/gi,
3285
- (zt) => /stroke\s*=\s*["']\s*(none|transparent)\s*["']/i.test(zt) ? zt : `stroke="${st}"`
3286
- ) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke="${st}"`), $ = $.replace(
3285
+ (zt) => /stroke\s*=\s*["']\s*(none|transparent)\s*["']/i.test(zt) ? zt : `stroke="${it}"`
3286
+ ) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke="${it}"`), $ = $.replace(
3287
3287
  new RegExp(`(?<![a-z-])stroke\\s*:\\s*(?!none|transparent)[^;"')]+`, "gi"),
3288
- `stroke:${st}`
3288
+ `stroke:${it}`
3289
3289
  );
3290
- let vt = s.width || a || 100, Yt = s.height || r || 100;
3290
+ let St = s.width || a || 100, Xt = s.height || r || 100;
3291
3291
  const Qt = ht.match(/viewBox=["']\s*0\s+0\s+([\d.]+)\s+([\d.]+)\s*["']/i);
3292
3292
  if (Qt) {
3293
- const zt = parseFloat(Qt[1]), oe = parseFloat(Qt[2]);
3294
- !isNaN(zt) && !isNaN(oe) && (vt = zt, Yt = oe);
3293
+ const zt = parseFloat(Qt[1]), ae = parseFloat(Qt[2]);
3294
+ !isNaN(zt) && !isNaN(ae) && (St = zt, Xt = ae);
3295
3295
  }
3296
- const ne = Math.max(1e-3, a / vt), Gt = Math.max(1e-3, r / Yt), Ht = (ne + Gt) / 2, Nt = (B.width || 1) / Ht;
3296
+ const oe = Math.max(1e-3, a / St), Gt = Math.max(1e-3, r / Xt), Ht = (oe + Gt) / 2, Nt = (B.width || 1) / Ht;
3297
3297
  $.match(/\bstroke-width\s*=\s*["']/i) ? $ = $.replace(/\bstroke-width\s*=\s*["'][^"']*["']/gi, `stroke-width="${Nt}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-width="${Nt}"`), $ = $.replace(/stroke-width\s*:\s*[^;"')]+/gi, `stroke-width:${Nt}`), $.match(/\bstroke-opacity\s*=\s*["']/i) ? $ = $.replace(/\bstroke-opacity\s*=\s*["'][^"']*["']/gi, `stroke-opacity="${rt}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-opacity="${rt}"`), $ = $.replace(/stroke-opacity\s*:\s*[^;"')]+/gi, `stroke-opacity:${rt}`);
3298
3298
  const Ie = B.lineCap || "round";
3299
3299
  $.match(/\bstroke-linecap\s*=\s*["']/i) ? $ = $.replace(/\bstroke-linecap\s*=\s*["'][^"']*["']/gi, `stroke-linecap="${Ie}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-linecap="${Ie}"`), $ = $.replace(/stroke-linecap\s*:\s*[^;"')]+/gi, `stroke-linecap:${Ie}`);
@@ -3301,14 +3301,14 @@ class ci {
3301
3301
  $.match(/\bstroke-linejoin\s*=\s*["']/i) ? $ = $.replace(/\bstroke-linejoin\s*=\s*["'][^"']*["']/gi, `stroke-linejoin="${Le}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-linejoin="${Le}"`), $ = $.replace(/stroke-linejoin\s*:\s*[^;"')]+/gi, `stroke-linejoin:${Le}`);
3302
3302
  const Re = B.trimStart ?? 0, Oe = B.trimEnd ?? 1, Fe = B.trimOffset ?? 0, $e = B.dashOffset ?? 0, Ye = Re !== 0 || Oe !== 1 || Fe !== 0 || $e !== 0;
3303
3303
  if (Ye) {
3304
- const zt = Math.max(0, Math.min(1, Re)), oe = Math.max(0, Math.min(1, Oe));
3305
- this.frameCount % 600 === 0 && this.debugLog(`SVG Trim - Object: ${i.name || i.id}, Start: ${zt}, End: ${oe}`);
3306
- const we = (vt + Yt) * 2, Be = (Fe % 1 + 1) % 1, We = ($e % 1 + 1) % 1;
3304
+ const zt = Math.max(0, Math.min(1, Re)), ae = Math.max(0, Math.min(1, Oe));
3305
+ this.frameCount % 600 === 0 && this.debugLog(`SVG Trim - Object: ${i.name || i.id}, Start: ${zt}, End: ${ae}`);
3306
+ const we = (St + Xt) * 2, Be = (Fe % 1 + 1) % 1, We = ($e % 1 + 1) % 1;
3307
3307
  let de = "", ce = 0;
3308
- if (zt >= oe)
3308
+ if (zt >= ae)
3309
3309
  de = `0 ${we}`, ce = 0;
3310
3310
  else {
3311
- const he = we * (oe - zt), ke = we - he;
3311
+ const he = we * (ae - zt), ke = we - he;
3312
3312
  ce = -(we * (zt + Be + We)), de = `${he} ${ke}`;
3313
3313
  }
3314
3314
  $.match(/\bstroke-dasharray\s*=/i) ? $ = $.replace(/\bstroke-dasharray\s*=\s*["'][^"']*["']/gi, `stroke-dasharray="${de}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-dasharray="${de}"`), $ = $.replace(/stroke-dasharray\s*:\s*[^;"')]+/gi, `stroke-dasharray:${de}`), $.match(/\bstroke-dashoffset\s*=/i) ? $ = $.replace(/\bstroke-dashoffset\s*=\s*["'][^"']*["']/gi, `stroke-dashoffset="${ce}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-dashoffset="${ce}"`), $ = $.replace(/stroke-dashoffset\s*:\s*[^;"')]+/gi, `stroke-dashoffset:${ce}`);
@@ -3317,17 +3317,17 @@ class ci {
3317
3317
  $ = $.replace(/\bstroke-dasharray\s*=\s*["'][^"']*["']/gi, `stroke-dasharray="${zt}"`), $ = $.replace(/stroke-dasharray\s*:\s*[^;"')]+/gi, `stroke-dasharray:${zt}`), B.dashOffset && ($ = $.replace(/\bstroke-dashoffset\s*=\s*["'][^"']*["']/gi, `stroke-dashoffset="${B.dashOffset}"`), $ = $.replace(/stroke-dashoffset\s*:\s*[^;"')]+/gi, `stroke-dashoffset:${B.dashOffset}`));
3318
3318
  }
3319
3319
  if (!/\bstroke\s*=\s*["']/i.test(ht) && !new RegExp("(?<![a-z-])stroke\\s*:", "i").test(ht)) {
3320
- let zt = "", oe = "";
3320
+ let zt = "", ae = "";
3321
3321
  if (Ye) {
3322
3322
  const de = s.width || a || 100, ce = s.height || r || 100, he = (de + ce) * 2, ke = Math.max(0, Math.min(1, Re)), Xe = Math.max(0, Math.min(1, Oe)), Ve = (Fe % 1 + 1) % 1, Ne = ($e % 1 + 1) % 1;
3323
3323
  if (ke >= Xe)
3324
- zt = ` stroke-dasharray="0 ${he}"`, oe = ' stroke-dashoffset="0"';
3324
+ zt = ` stroke-dasharray="0 ${he}"`, ae = ' stroke-dashoffset="0"';
3325
3325
  else {
3326
3326
  const De = he * (Xe - ke), He = he - De, H = -(he * (ke + Ve + Ne));
3327
- zt = ` stroke-dasharray="${De} ${He}"`, oe = ` stroke-dashoffset="${H}"`;
3327
+ zt = ` stroke-dasharray="${De} ${He}"`, ae = ` stroke-dashoffset="${H}"`;
3328
3328
  }
3329
- } else (x = B.dashArray) != null && x.length && (zt = ` stroke-dasharray="${B.dashArray.join(" ")}"`, B.dashOffset && (oe = ` stroke-dashoffset="${B.dashOffset}"`));
3330
- const we = ` stroke-linecap="${B.lineCap || "round"}"`, Be = ` stroke-linejoin="${B.lineJoin || "round"}"`, We = `stroke="${st}" stroke-width="${Nt}" stroke-opacity="${rt}"${we}${Be}${zt}${oe}`;
3329
+ } else (x = B.dashArray) != null && x.length && (zt = ` stroke-dasharray="${B.dashArray.join(" ")}"`, B.dashOffset && (ae = ` stroke-dashoffset="${B.dashOffset}"`));
3330
+ const we = ` stroke-linecap="${B.lineCap || "round"}"`, Be = ` stroke-linejoin="${B.lineJoin || "round"}"`, We = `stroke="${it}" stroke-width="${Nt}" stroke-opacity="${rt}"${we}${Be}${zt}${ae}`;
3331
3331
  $ = $.replace(
3332
3332
  /(<svg[^>]*>)(\s*(?:<defs>[\s\S]*?<\/defs>)?)/i,
3333
3333
  (de, ce, he) => `${ce}${he}<g ${We}>`
@@ -3335,19 +3335,19 @@ class ci {
3335
3335
  }
3336
3336
  } else B && B.isEnabled === !1 && ($ = $.replace(/\bstroke\s*=\s*["'][^"']*["']/gi, 'stroke="none"'), $ = $.replace(new RegExp(`(?<![a-z-])stroke\\s*:\\s*(?!none|transparent)[^;"')]+`, "gi"), "stroke:none"));
3337
3337
  const ct = new Blob([$], { type: "image/svg+xml" }), Ct = URL.createObjectURL(ct);
3338
- At.onload = () => {
3338
+ xt.onload = () => {
3339
3339
  if (URL.revokeObjectURL(Ct), this.frameCount % 900 === 0) {
3340
- const rt = this.imageCache.get(kt);
3340
+ const rt = this.imageCache.get(Tt);
3341
3341
  rt && this.debugLog(`SVG Payload Ready: ${i.name || i.id} (${rt.naturalWidth}x${rt.naturalHeight})`);
3342
3342
  }
3343
- }, At.onerror = () => {
3343
+ }, xt.onerror = () => {
3344
3344
  URL.revokeObjectURL(Ct), this.debugLog(`SVG Error: Failed to load payload for ${i.name || i.id}`);
3345
- }, At.src = Ct, this.imageCache.set(kt, At);
3345
+ }, xt.src = Ct, this.imageCache.set(Tt, xt);
3346
3346
  }
3347
3347
  let Mt = null;
3348
- if (At.complete && At.naturalWidth > 0 ? (Mt = At, this.lastValidSvgImgMap.set(i.id, At)) : Mt = this.lastValidSvgImgMap.get(i.id) || null, Mt && Mt.complete && Mt.naturalWidth > 0) {
3348
+ if (xt.complete && xt.naturalWidth > 0 ? (Mt = xt, this.lastValidSvgImgMap.set(i.id, xt)) : Mt = this.lastValidSvgImgMap.get(i.id) || null, Mt && Mt.complete && Mt.naturalWidth > 0) {
3349
3349
  const $ = Math.max(1, a), Wt = Math.max(1, r);
3350
- if (Z && (at == null ? void 0 : at.type) === "Solid") {
3350
+ if (j && (at == null ? void 0 : at.type) === "Solid") {
3351
3351
  this.maskBuffer || (this.maskBuffer = document.createElement("canvas"), this.maskCtx = this.maskBuffer.getContext("2d")), this.maskBuffer.width = $, this.maskBuffer.height = Wt, this.maskCtx.setTransform(1, 0, 0, 1, 0, 0), this.maskCtx.globalCompositeOperation = "source-over", this.maskCtx.globalAlpha = 1, this.maskCtx.filter = "none", this.maskCtx.clearRect(0, 0, $, Wt), this.maskCtx.drawImage(Mt, 0, 0, $, Wt), this.maskCtx.globalCompositeOperation = "source-in";
3352
3352
  const Kt = at.color || "#000000", te = this.normalizeOpacity(at.opacity ?? 100);
3353
3353
  this.maskCtx.fillStyle = Kt, this.maskCtx.globalAlpha = te, this.maskCtx.fillRect(0, 0, $, Wt), t.drawImage(this.maskBuffer, -$ / 2, -Wt / 2, $, Wt);
@@ -3357,54 +3357,59 @@ class ci {
3357
3357
  } else if (l.type === "LineGraph")
3358
3358
  this.renderLineGraph(t, l, a, r);
3359
3359
  else if (i.type === "Shape") {
3360
- if (this.applyPath(t, l, a, r, f), t.save(), n.blur && n.blur.amount > 0 && (t.filter = `blur(${n.blur.amount}px)`), n.fill) {
3361
- const ht = t.globalAlpha;
3360
+ this.applyPath(t, l, a, r, f), t.save(), n.blur && n.blur.amount > 0 && (t.filter = `blur(${n.blur.amount}px)`);
3361
+ const ht = Yt && se === "BackgroundBlur";
3362
+ if (ht)
3363
+ this.applyBackgroundBlurGlass(t, l, a, r, f, vt);
3364
+ else if (n.fill) {
3365
+ const at = t.globalAlpha;
3362
3366
  if (((F = n.fill) == null ? void 0 : F.type) === "Image" && (n.fill.originalSrc || n.fill.src)) {
3363
- const pt = n.fill.originalSrc || n.fill.src;
3364
- let at = this.imageCache.get(pt);
3365
- at || (at = new Image(), at.src = pt, this.imageCache.set(pt, at)), at.complete && at.naturalWidth > 0 && (t.save(), this.applyPath(t, l, a, r, f), t.clip(), this.renderFittedImage(t, at, -a / 2, -r / 2, a, r, n.fill.fillMode), t.restore());
3367
+ const B = n.fill.originalSrc || n.fill.src;
3368
+ let K = this.imageCache.get(B);
3369
+ K || (K = new Image(), K.src = B, this.imageCache.set(B, K)), K.complete && K.naturalWidth > 0 && (t.save(), this.applyPath(t, l, a, r, f), t.clip(), this.renderFittedImage(t, K, -a / 2, -r / 2, a, r, n.fill.fillMode), t.restore());
3366
3370
  } else {
3367
- const pt = this.createCanvasFill(t, n.fill, a, r);
3368
- t.fillStyle = pt || (typeof n.fill == "string" ? n.fill : n.fill.color || "transparent"), t.globalAlpha = ht * this.normalizeOpacity(n.fill.opacity ?? 100), this.applyPath(t, l, a, r, f), t.fill();
3371
+ const B = this.createCanvasFill(t, n.fill, a, r);
3372
+ t.fillStyle = B || (typeof n.fill == "string" ? n.fill : n.fill.color || "transparent"), t.globalAlpha = at * this.normalizeOpacity(n.fill.opacity ?? 100), this.applyPath(t, l, a, r, f), t.fill();
3369
3373
  }
3370
- t.globalAlpha = ht;
3374
+ t.globalAlpha = at;
3371
3375
  }
3372
- t.restore(), n.stroke && n.stroke.width > 0 && this.applyStrokeAlignment(t, n, l, a, r, f, D, q);
3376
+ t.restore(), n.stroke && n.stroke.width > 0 && n.stroke.isEnabled !== !1 ? this.applyStrokeAlignment(t, n, l, a, r, f, D, q) : ht && (t.save(), t.globalAlpha = 1, t.strokeStyle = "rgba(255, 255, 255, 0.25)", t.lineWidth = 1.5, this.applyPath(t, l, a, r, f), t.stroke(), t.restore());
3373
3377
  } else if (i.type === "Frame" || i.type === "Group" && !i.isStructuralGroup) {
3374
- const ht = e.width ?? s.width ?? i.width ?? a, pt = e.height ?? s.height ?? i.height ?? r, at = f;
3375
- if (t.save(), t.beginPath(), this.drawRoundRect(t, -ht / 2, -pt / 2, ht, pt, at), n.fill && n.fill.type !== "None") {
3376
- const B = t.globalAlpha, nt = this.createCanvasFill(t, n.fill, ht, pt);
3377
- t.fillStyle = nt || n.fill.color || "transparent", t.globalAlpha = B * this.normalizeOpacity(n.fill.opacity ?? 100), t.fill(), t.globalAlpha = B;
3378
+ const ht = e.width ?? s.width ?? i.width ?? a, mt = e.height ?? s.height ?? i.height ?? r, at = f;
3379
+ t.save(), t.beginPath(), this.drawRoundRect(t, -ht / 2, -mt / 2, ht, mt, at);
3380
+ const B = Yt && se === "BackgroundBlur", K = { type: "Rectangle" };
3381
+ if (B)
3382
+ this.applyBackgroundBlurGlass(t, K, ht, mt, at, vt);
3383
+ else if (n.fill && n.fill.type !== "None") {
3384
+ const kt = t.globalAlpha, At = this.createCanvasFill(t, n.fill, ht, mt);
3385
+ t.fillStyle = At || n.fill.color || "transparent", t.globalAlpha = kt * this.normalizeOpacity(n.fill.opacity ?? 100), t.fill(), t.globalAlpha = kt;
3378
3386
  }
3379
- if (t.restore(), n.stroke && n.stroke.width > 0 && n.stroke.isEnabled !== !1) {
3380
- const B = { type: "Rectangle" };
3381
- this.applyStrokeAlignment(t, n, B, ht, pt, at, D, q);
3382
- }
3383
- } else i.type === "Group" && i.isStructuralGroup || (i.type === "Component" && i.variant === "inputbox" ? this.renderInputBox(t, i) : i.type === "Component" && i.variant === "button" ? this.renderButton(t, i) : i.type === "Component" && i.variant === "toggle_button" ? this.renderToggleButton(t, i) : i.type === "Toggle" || i.type === "Component" && i.variant === "toggle" ? this.renderToggle(t, i) : i.type === "Slider" || i.type === "Component" && i.variant === "slider" ? this.renderSlider(t, i) : i.type === "Dropdown" || i.type === "Component" && i.variant === "dropdown" ? this.renderDropdown(t, i) : i.type === "ListView" || i.type === "Component" && i.variant === "listview" ? this.renderListView(t, i) : i.type === "Checkbox" || i.type === "Component" && i.variant === "checkbox" ? this.renderCheckbox(t, i) : i.type === "RadioGroup" || i.type === "Component" && i.variant === "radiogroup" ? this.renderRadioGroup(t, i) : i.type === "BarChart" || i.type === "Component" && i.variant === "barchart" ? this.renderBarChart(t, i) : i.type === "PieChart" || i.type === "Component" && i.variant === "piechart" ? this.renderPieChart(t, i) : i.type === "Joystick" || i.type === "Component" && i.variant === "joystick" ? this.renderJoystick(t, i) : this.frameCount % 300 === 0 && this.warn("[Engine] Unhandled object type in renderObject:", i.type, "Geo:", (j = i.geometry) == null ? void 0 : j.type));
3384
- if (this.applyArtEffectOverlay(t, i, l, a, r, f), Xt && le === "BackgroundBlur" && this.applyBackgroundBlurGlass(t, l, a, r, f, St), jt && jt.enabled && t.restore(), i.children && i.children.length > 0) {
3385
- const pt = i.type === "Frame", at = i.clipsContent !== void 0 ? i.clipsContent : i.clipContent !== void 0 ? i.clipContent : pt;
3387
+ t.restore(), n.stroke && n.stroke.width > 0 && n.stroke.isEnabled !== !1 ? this.applyStrokeAlignment(t, n, K, ht, mt, at, D, q) : B && (t.save(), t.globalAlpha = 1, t.strokeStyle = "rgba(255, 255, 255, 0.25)", t.lineWidth = 1.5, this.applyPath(t, K, ht, mt, at), t.stroke(), t.restore());
3388
+ } else i.type === "Group" && i.isStructuralGroup || (i.type === "Component" && i.variant === "inputbox" ? this.renderInputBox(t, i) : i.type === "Component" && i.variant === "button" ? this.renderButton(t, i) : i.type === "Component" && i.variant === "toggle_button" ? this.renderToggleButton(t, i) : i.type === "Toggle" || i.type === "Component" && i.variant === "toggle" ? this.renderToggle(t, i) : i.type === "Slider" || i.type === "Component" && i.variant === "slider" ? this.renderSlider(t, i) : i.type === "Dropdown" || i.type === "Component" && i.variant === "dropdown" ? this.renderDropdown(t, i) : i.type === "ListView" || i.type === "Component" && i.variant === "listview" ? this.renderListView(t, i) : i.type === "Checkbox" || i.type === "Component" && i.variant === "checkbox" ? this.renderCheckbox(t, i) : i.type === "RadioGroup" || i.type === "Component" && i.variant === "radiogroup" ? this.renderRadioGroup(t, i) : i.type === "BarChart" || i.type === "Component" && i.variant === "barchart" ? this.renderBarChart(t, i) : i.type === "PieChart" || i.type === "Component" && i.variant === "piechart" ? this.renderPieChart(t, i) : i.type === "Joystick" || i.type === "Component" && i.variant === "joystick" ? this.renderJoystick(t, i) : this.frameCount % 300 === 0 && this.warn("[Engine] Unhandled object type in renderObject:", i.type, "Geo:", (tt = i.geometry) == null ? void 0 : tt.type));
3389
+ if (this.applyArtEffectOverlay(t, i, l, a, r, f), Yt && se === "BackgroundBlur" && i.type !== "Shape" && i.type !== "Frame" && i.type !== "Group" && (this.applyBackgroundBlurGlass(t, l, a, r, f, vt), (!n.stroke || n.stroke.width === 0 || n.stroke.isEnabled === !1) && (t.save(), t.globalAlpha = 1, t.strokeStyle = "rgba(255, 255, 255, 0.25)", t.lineWidth = 1.5, this.applyPath(t, l, a, r, f), t.stroke(), t.restore())), jt && jt.enabled && t.restore(), i.children && i.children.length > 0) {
3390
+ const mt = i.type === "Frame", at = i.clipsContent !== void 0 ? i.clipsContent : i.clipContent !== void 0 ? i.clipContent : mt;
3386
3391
  if (t.save(), at) {
3387
3392
  t.beginPath();
3388
- const nt = e.width ?? (s == null ? void 0 : s.width) ?? i.width ?? 0, Z = e.height ?? (s == null ? void 0 : s.height) ?? i.height ?? 0, Pt = e.cornerRadius ?? (s == null ? void 0 : s.corner_radius) ?? i.cornerRadius ?? 0;
3389
- this.drawRoundRect(t, -nt / 2, -Z / 2, nt, Z, Pt), t.clip();
3393
+ const K = e.width ?? (s == null ? void 0 : s.width) ?? i.width ?? 0, j = e.height ?? (s == null ? void 0 : s.height) ?? i.height ?? 0, kt = e.cornerRadius ?? (s == null ? void 0 : s.corner_radius) ?? i.cornerRadius ?? 0;
3394
+ this.drawRoundRect(t, -K / 2, -j / 2, K, j, kt), t.clip();
3390
3395
  }
3391
3396
  let B = 0;
3392
- for (i.children.forEach((nt) => {
3393
- const Z = o.get(nt);
3394
- if (!Z) return;
3395
- const Pt = this.objectStates.get(nt), xt = (Pt == null ? void 0 : Pt.geometry) || Z.geometry;
3396
- if (xt && xt.isMask && (Pt == null ? void 0 : Pt.visible) !== !1) {
3397
- const kt = xt.width || 0, At = xt.height || 0;
3398
- this.applyObjectTransform(t, nt);
3399
- const Mt = (Pt == null ? void 0 : Pt.corner_radius) ?? (xt == null ? void 0 : xt.corner_radius) ?? 0;
3400
- this.applyPath(t, xt, kt, At, Mt), t.clip(), B++;
3397
+ for (i.children.forEach((K) => {
3398
+ const j = o.get(K);
3399
+ if (!j) return;
3400
+ const kt = this.objectStates.get(K), At = (kt == null ? void 0 : kt.geometry) || j.geometry;
3401
+ if (At && At.isMask && (kt == null ? void 0 : kt.visible) !== !1) {
3402
+ const Tt = At.width || 0, xt = At.height || 0;
3403
+ this.applyObjectTransform(t, K);
3404
+ const Mt = (kt == null ? void 0 : kt.corner_radius) ?? (At == null ? void 0 : At.corner_radius) ?? 0;
3405
+ this.applyPath(t, At, Tt, xt, Mt), t.clip(), B++;
3401
3406
  } else
3402
- this.renderObject(t, Z, o);
3407
+ this.renderObject(t, j, o);
3403
3408
  }); B > 0; )
3404
3409
  t.restore(), B--;
3405
3410
  t.restore();
3406
3411
  }
3407
- if (ie) {
3412
+ if (ne) {
3408
3413
  this.maskCtx.restore(), (e.masks || (i.maskedBy ? [{
3409
3414
  maskId: i.maskedBy,
3410
3415
  inverted: i.maskInverted === !0,
@@ -3414,71 +3419,71 @@ class ci {
3414
3419
  isVisible: !0
3415
3420
  }] : [])).filter((B) => B.isVisible !== !1 && o.has(B.maskId)).forEach((B) => {
3416
3421
  var Mt, $, Wt, Kt, te, Jt;
3417
- const nt = o.get(B.maskId), Z = this.objectStates.get(nt.id), Pt = B.feather || 0, xt = B.inverted === !0, kt = B.opacity !== void 0 ? typeof B.opacity == "number" ? B.opacity : B.opacity / 100 : 1;
3422
+ const K = o.get(B.maskId), j = this.objectStates.get(K.id), kt = B.feather || 0, At = B.inverted === !0, Tt = B.opacity !== void 0 ? typeof B.opacity == "number" ? B.opacity : B.opacity / 100 : 1;
3418
3423
  if ((B.type || "alpha") === "luma") {
3419
- (!this.lumaBuffer || this.lumaBuffer.width !== this.maskBuffer.width || this.lumaBuffer.height !== this.maskBuffer.height) && (this.lumaBuffer = document.createElement("canvas"), this.lumaBuffer.width = this.maskBuffer.width, this.lumaBuffer.height = this.maskBuffer.height, this.lumaCtx = this.lumaBuffer.getContext("2d", { willReadFrequently: !0 }), this.lumaCtx && (this.lumaCtx.imageSmoothingEnabled = !0, this.lumaCtx.imageSmoothingQuality = "high")), this.lumaCtx.setTransform(1, 0, 0, 1, 0, 0), this.lumaCtx.globalCompositeOperation = "source-over", this.lumaCtx.globalAlpha = 1, this.lumaCtx.filter = "none", this.lumaCtx.clearRect(0, 0, this.lumaBuffer.width, this.lumaBuffer.height), this.lumaCtx.save(), this.rootTransform && this.lumaCtx.setTransform(this.rootTransform), this.applyAbsoluteTransform(this.lumaCtx, nt.id, o), Pt > 0 && (this.lumaCtx.filter = `blur(${Pt}px)`), this.lumaCtx.globalAlpha = kt;
3420
- const ut = (Z == null ? void 0 : Z.width) || nt.geometry.width || 0, ct = (Z == null ? void 0 : Z.height) || nt.geometry.height || 0, Ct = (Z == null ? void 0 : Z.corner_radius) ?? nt.corner_radius ?? 0;
3421
- if (((Mt = nt.geometry) == null ? void 0 : Mt.type) === "Text") {
3422
- const it = Z != null && Z.geometry ? this.deepMerge(nt.geometry, Z.geometry) : nt.geometry, vt = Z != null && Z.style ? this.deepMerge(nt.style, Z.style) : nt.style;
3423
- this._renderText(this.lumaCtx, nt, { ...it, width: ut, height: ct, corner_radius: Ct }, vt, Z, ut, ct, !0, !1, D, q);
3424
- } else if ((($ = nt.geometry) == null ? void 0 : $.type) === "Image") {
3425
- const it = nt.geometry.src;
3426
- if (it) {
3427
- let vt = this.imageCache.get(it);
3428
- vt || (vt = new Image(), vt.src = it, this.imageCache.set(it, vt)), vt.complete && vt.naturalWidth > 0 ? this.lumaCtx.drawImage(vt, -ut / 2, -ct / 2, ut, ct) : (this.applyPath(this.lumaCtx, nt.geometry, ut, ct, Ct), this.lumaCtx.fillStyle = "#ffffff", this.lumaCtx.fill());
3424
+ (!this.lumaBuffer || this.lumaBuffer.width !== this.maskBuffer.width || this.lumaBuffer.height !== this.maskBuffer.height) && (this.lumaBuffer = document.createElement("canvas"), this.lumaBuffer.width = this.maskBuffer.width, this.lumaBuffer.height = this.maskBuffer.height, this.lumaCtx = this.lumaBuffer.getContext("2d", { willReadFrequently: !0 }), this.lumaCtx && (this.lumaCtx.imageSmoothingEnabled = !0, this.lumaCtx.imageSmoothingQuality = "high")), this.lumaCtx.setTransform(1, 0, 0, 1, 0, 0), this.lumaCtx.globalCompositeOperation = "source-over", this.lumaCtx.globalAlpha = 1, this.lumaCtx.filter = "none", this.lumaCtx.clearRect(0, 0, this.lumaBuffer.width, this.lumaBuffer.height), this.lumaCtx.save(), this.rootTransform && this.lumaCtx.setTransform(this.rootTransform), this.applyAbsoluteTransform(this.lumaCtx, K.id, o), kt > 0 && (this.lumaCtx.filter = `blur(${kt}px)`), this.lumaCtx.globalAlpha = Tt;
3425
+ const ut = (j == null ? void 0 : j.width) || K.geometry.width || 0, ct = (j == null ? void 0 : j.height) || K.geometry.height || 0, Ct = (j == null ? void 0 : j.corner_radius) ?? K.corner_radius ?? 0;
3426
+ if (((Mt = K.geometry) == null ? void 0 : Mt.type) === "Text") {
3427
+ const nt = j != null && j.geometry ? this.deepMerge(K.geometry, j.geometry) : K.geometry, St = j != null && j.style ? this.deepMerge(K.style, j.style) : K.style;
3428
+ this._renderText(this.lumaCtx, K, { ...nt, width: ut, height: ct, corner_radius: Ct }, St, j, ut, ct, !0, !1, D, q);
3429
+ } else if ((($ = K.geometry) == null ? void 0 : $.type) === "Image") {
3430
+ const nt = K.geometry.src;
3431
+ if (nt) {
3432
+ let St = this.imageCache.get(nt);
3433
+ St || (St = new Image(), St.src = nt, this.imageCache.set(nt, St)), St.complete && St.naturalWidth > 0 ? this.lumaCtx.drawImage(St, -ut / 2, -ct / 2, ut, ct) : (this.applyPath(this.lumaCtx, K.geometry, ut, ct, Ct), this.lumaCtx.fillStyle = "#ffffff", this.lumaCtx.fill());
3429
3434
  }
3430
- } else if (((Wt = nt.geometry) == null ? void 0 : Wt.type) === "SVG") {
3431
- const it = nt.geometry.svgContent;
3432
- if (it) {
3433
- const vt = `__lumamask_${nt.id}`;
3434
- let Yt = this.imageCache.get(vt);
3435
- if (!Yt) {
3436
- Yt = new Image();
3437
- const Qt = new Blob([it], { type: "image/svg+xml" });
3438
- Yt.src = URL.createObjectURL(Qt), Yt.onload = () => {
3435
+ } else if (((Wt = K.geometry) == null ? void 0 : Wt.type) === "SVG") {
3436
+ const nt = K.geometry.svgContent;
3437
+ if (nt) {
3438
+ const St = `__lumamask_${K.id}`;
3439
+ let Xt = this.imageCache.get(St);
3440
+ if (!Xt) {
3441
+ Xt = new Image();
3442
+ const Qt = new Blob([nt], { type: "image/svg+xml" });
3443
+ Xt.src = URL.createObjectURL(Qt), Xt.onload = () => {
3439
3444
  this.artboard && this.reset();
3440
- }, this.imageCache.set(vt, Yt);
3445
+ }, this.imageCache.set(St, Xt);
3441
3446
  }
3442
- Yt.complete && Yt.naturalWidth > 0 ? this.lumaCtx.drawImage(Yt, -ut / 2, -ct / 2, ut, ct) : (this.applyPath(this.lumaCtx, nt.geometry, ut, ct, Ct), this.lumaCtx.fillStyle = "#ffffff", this.lumaCtx.fill());
3447
+ Xt.complete && Xt.naturalWidth > 0 ? this.lumaCtx.drawImage(Xt, -ut / 2, -ct / 2, ut, ct) : (this.applyPath(this.lumaCtx, K.geometry, ut, ct, Ct), this.lumaCtx.fillStyle = "#ffffff", this.lumaCtx.fill());
3443
3448
  }
3444
3449
  } else
3445
- this.applyPath(this.lumaCtx, nt.geometry, ut, ct, Ct), this.lumaCtx.fillStyle = "#ffffff", this.lumaCtx.fill();
3450
+ this.applyPath(this.lumaCtx, K.geometry, ut, ct, Ct), this.lumaCtx.fillStyle = "#ffffff", this.lumaCtx.fill();
3446
3451
  this.lumaCtx.restore();
3447
- const rt = this.maskCtx.getImageData(0, 0, this.canvasWidth, this.canvasHeight), V = this.lumaCtx.getImageData(0, 0, this.canvasWidth, this.canvasHeight).data, st = rt.data;
3448
- for (let it = 0; it < st.length; it += 4) {
3449
- const vt = V[it], Yt = V[it + 1], Qt = V[it + 2];
3450
- let ne = (0.299 * vt + 0.587 * Yt + 0.114 * Qt) / 255;
3451
- xt && (ne = 1 - ne), st[it + 3] *= ne;
3452
+ const rt = this.maskCtx.getImageData(0, 0, this.canvasWidth, this.canvasHeight), V = this.lumaCtx.getImageData(0, 0, this.canvasWidth, this.canvasHeight).data, it = rt.data;
3453
+ for (let nt = 0; nt < it.length; nt += 4) {
3454
+ const St = V[nt], Xt = V[nt + 1], Qt = V[nt + 2];
3455
+ let oe = (0.299 * St + 0.587 * Xt + 0.114 * Qt) / 255;
3456
+ At && (oe = 1 - oe), it[nt + 3] *= oe;
3452
3457
  }
3453
3458
  this.maskCtx.putImageData(rt, 0, 0);
3454
3459
  } else {
3455
- this.maskCtx.save(), this.rootTransform && this.maskCtx.setTransform(this.rootTransform), this.maskCtx.globalCompositeOperation = xt ? "destination-out" : "destination-in", Pt > 0 && (this.maskCtx.filter = `blur(${Pt}px)`), this.maskCtx.globalAlpha = kt, this.applyAbsoluteTransform(this.maskCtx, nt.id, o);
3456
- const ut = (Z == null ? void 0 : Z.width) || nt.geometry.width || 0, ct = (Z == null ? void 0 : Z.height) || nt.geometry.height || 0, Ct = (Z == null ? void 0 : Z.corner_radius) ?? nt.corner_radius ?? 0;
3457
- if (((Kt = nt.geometry) == null ? void 0 : Kt.type) === "Text") {
3458
- const rt = Z != null && Z.geometry ? this.deepMerge(nt.geometry, Z.geometry) : nt.geometry, V = Z != null && Z.style ? this.deepMerge(nt.style, Z.style) : nt.style;
3459
- this._renderText(this.maskCtx, nt, { ...rt, width: ut, height: ct, corner_radius: Ct }, V, Z, ut, ct, !0, !1, D, q);
3460
- } else if (((te = nt.geometry) == null ? void 0 : te.type) === "Image") {
3461
- const rt = nt.geometry.src;
3460
+ this.maskCtx.save(), this.rootTransform && this.maskCtx.setTransform(this.rootTransform), this.maskCtx.globalCompositeOperation = At ? "destination-out" : "destination-in", kt > 0 && (this.maskCtx.filter = `blur(${kt}px)`), this.maskCtx.globalAlpha = Tt, this.applyAbsoluteTransform(this.maskCtx, K.id, o);
3461
+ const ut = (j == null ? void 0 : j.width) || K.geometry.width || 0, ct = (j == null ? void 0 : j.height) || K.geometry.height || 0, Ct = (j == null ? void 0 : j.corner_radius) ?? K.corner_radius ?? 0;
3462
+ if (((Kt = K.geometry) == null ? void 0 : Kt.type) === "Text") {
3463
+ const rt = j != null && j.geometry ? this.deepMerge(K.geometry, j.geometry) : K.geometry, V = j != null && j.style ? this.deepMerge(K.style, j.style) : K.style;
3464
+ this._renderText(this.maskCtx, K, { ...rt, width: ut, height: ct, corner_radius: Ct }, V, j, ut, ct, !0, !1, D, q);
3465
+ } else if (((te = K.geometry) == null ? void 0 : te.type) === "Image") {
3466
+ const rt = K.geometry.src;
3462
3467
  if (rt) {
3463
3468
  let V = this.imageCache.get(rt);
3464
- V || (V = new Image(), V.src = rt, this.imageCache.set(rt, V)), V.complete && V.naturalWidth > 0 ? this.maskCtx.drawImage(V, -ut / 2, -ct / 2, ut, ct) : (this.applyPath(this.maskCtx, nt.geometry, ut, ct, Ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill());
3469
+ V || (V = new Image(), V.src = rt, this.imageCache.set(rt, V)), V.complete && V.naturalWidth > 0 ? this.maskCtx.drawImage(V, -ut / 2, -ct / 2, ut, ct) : (this.applyPath(this.maskCtx, K.geometry, ut, ct, Ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill());
3465
3470
  }
3466
- } else if (((Jt = nt.geometry) == null ? void 0 : Jt.type) === "SVG") {
3467
- const rt = nt.geometry.svgContent;
3471
+ } else if (((Jt = K.geometry) == null ? void 0 : Jt.type) === "SVG") {
3472
+ const rt = K.geometry.svgContent;
3468
3473
  if (rt) {
3469
- const V = `__alphamask_${nt.id}`;
3470
- let st = this.imageCache.get(V);
3471
- if (!st) {
3472
- st = new Image();
3473
- const it = new Blob([rt], { type: "image/svg+xml" });
3474
- st.src = URL.createObjectURL(it), st.onload = () => {
3474
+ const V = `__alphamask_${K.id}`;
3475
+ let it = this.imageCache.get(V);
3476
+ if (!it) {
3477
+ it = new Image();
3478
+ const nt = new Blob([rt], { type: "image/svg+xml" });
3479
+ it.src = URL.createObjectURL(nt), it.onload = () => {
3475
3480
  this.artboard && this.reset();
3476
- }, this.imageCache.set(V, st);
3481
+ }, this.imageCache.set(V, it);
3477
3482
  }
3478
- st.complete && st.naturalWidth > 0 ? this.maskCtx.drawImage(st, -ut / 2, -ct / 2, ut, ct) : (this.applyPath(this.maskCtx, nt.geometry, ut, ct, Ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill());
3483
+ it.complete && it.naturalWidth > 0 ? this.maskCtx.drawImage(it, -ut / 2, -ct / 2, ut, ct) : (this.applyPath(this.maskCtx, K.geometry, ut, ct, Ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill());
3479
3484
  }
3480
3485
  } else
3481
- this.applyPath(this.maskCtx, nt.geometry, ut, ct, Ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill();
3486
+ this.applyPath(this.maskCtx, K.geometry, ut, ct, Ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill();
3482
3487
  this.maskCtx.restore();
3483
3488
  }
3484
3489
  }), Ot.save(), Ot.setTransform(1, 0, 0, 1, 0, 0);
@@ -3489,33 +3494,33 @@ class ci {
3489
3494
  }
3490
3495
  }
3491
3496
  _renderText(t, i, o, e, s, n, a, r = !1, h = !1, f = 1, l = 1) {
3492
- var yt, bt, gt, Et, It, St, Xt, le, fe;
3497
+ var yt, bt, pt, Et, It, vt, Yt, se, fe;
3493
3498
  let p = o.text || "";
3494
3499
  if (o.textInputId && !r) {
3495
- const et = this.inputs.get(o.textInputId);
3496
- et !== void 0 && (p = String(et), s.geometry && s.geometry.type === "Text" && (s.geometry.text = p));
3500
+ const st = this.inputs.get(o.textInputId);
3501
+ st !== void 0 && (p = String(st), s.geometry && s.geometry.type === "Text" && (s.geometry.text = p));
3497
3502
  }
3498
3503
  if (o.svgPath) {
3499
- const et = o.svgPath;
3504
+ const st = o.svgPath;
3500
3505
  t.save();
3501
- const mt = ((yt = e == null ? void 0 : e.fill) == null ? void 0 : yt.color) || "#000000", Rt = ((bt = e == null ? void 0 : e.fill) == null ? void 0 : bt.opacity) !== void 0 ? (gt = e == null ? void 0 : e.fill) == null ? void 0 : gt.opacity : 1;
3502
- t.fillStyle = mt, t.globalAlpha *= Rt;
3503
- const _t = new Path2D(et);
3504
- t.fill(_t), t.restore();
3506
+ const gt = ((yt = e == null ? void 0 : e.fill) == null ? void 0 : yt.color) || "#000000", Rt = ((bt = e == null ? void 0 : e.fill) == null ? void 0 : bt.opacity) !== void 0 ? (pt = e == null ? void 0 : e.fill) == null ? void 0 : pt.opacity : 1;
3507
+ t.fillStyle = gt, t.globalAlpha *= Rt;
3508
+ const Pt = new Path2D(st);
3509
+ t.fill(Pt), t.restore();
3505
3510
  return;
3506
3511
  }
3507
3512
  let c = p || "";
3508
- o.enableSegments === !0 && o.segments && Array.isArray(o.segments) && (c = o.segments.map((et) => et && et.text ? et.text : "").join(""));
3513
+ o.enableSegments === !0 && o.segments && Array.isArray(o.segments) && (c = o.segments.map((st) => st && st.text ? st.text : "").join(""));
3509
3514
  const d = o.textCase || "none";
3510
- d === "uppercase" ? c = c.toUpperCase() : d === "lowercase" ? c = c.toLowerCase() : d === "capitalize" && (c = c.replace(/\b\w/g, (et) => et.toUpperCase()));
3515
+ d === "uppercase" ? c = c.toUpperCase() : d === "lowercase" ? c = c.toLowerCase() : d === "capitalize" && (c = c.replace(/\b\w/g, (st) => st.toUpperCase()));
3511
3516
  let u = ((Et = o.fontWeight) == null ? void 0 : Et.toString()) || "400", v = o.fontStyle || "normal";
3512
3517
  u.toLowerCase().includes("italic") && (v = "italic", u = u.replace(/italic/gi, "").trim() || "400");
3513
3518
  const b = this.mapFontWeight(u), m = Math.max(1, o.fontSize || 32);
3514
3519
  let y = o.fontFamily || "Inter";
3515
3520
  const S = ["Bold", "SemiBold", "Medium", "Regular", "Light", "Thin", "ExtraBold", "Black", "Italic"];
3516
- S.forEach((et) => {
3517
- const mt = new RegExp(`[\\s-]${et}$`, "i");
3518
- mt.test(y) && (y = y.replace(mt, "").trim());
3521
+ S.forEach((st) => {
3522
+ const gt = new RegExp(`[\\s-]${st}$`, "i");
3523
+ gt.test(y) && (y = y.replace(gt, "").trim());
3519
3524
  });
3520
3525
  const M = `${o.smallCaps === !0 ? "small-caps " : ""}${v} ${b} ${m}px "${y}", sans-serif`;
3521
3526
  t.font = M;
@@ -3527,8 +3532,8 @@ class ci {
3527
3532
  if (typeof o.letterSpacing == "number")
3528
3533
  T = o.letterSpacing;
3529
3534
  else if (typeof o.letterSpacing == "object" && o.letterSpacing.value !== void 0) {
3530
- const et = o.letterSpacing;
3531
- T = et.unit === "PERCENT" ? et.value / 100 * m : et.value;
3535
+ const st = o.letterSpacing;
3536
+ T = st.unit === "PERCENT" ? st.value / 100 * m : st.value;
3532
3537
  }
3533
3538
  t.letterSpacing !== void 0 && (t.letterSpacing = `${T}px`);
3534
3539
  const L = o.kerning || "auto", P = o.kerningValue || 0;
@@ -3536,7 +3541,7 @@ class ci {
3536
3541
  const _ = o.paragraphSpacing || 0;
3537
3542
  let E = o.lineHeight ?? 1.2;
3538
3543
  typeof E == "string" && (E = parseFloat(E)), E > 5 && m > 0 && (E = E / m);
3539
- const A = (E || 1.2) * m, W = o.isPointText === !0 || !o.width || o.width <= 0, z = ((It = o.padding) == null ? void 0 : It.left) || ((St = o.padding) == null ? void 0 : St.right) || 0, Y = W ? 1e5 : o.width && o.width > 0 ? Math.ceil(o.width) - z * 2 : 1e5;
3544
+ const A = (E || 1.2) * m, W = o.isPointText === !0 || !o.width || o.width <= 0, z = ((It = o.padding) == null ? void 0 : It.left) || ((vt = o.padding) == null ? void 0 : vt.right) || 0, Y = W ? 1e5 : o.width && o.width > 0 ? Math.ceil(o.width) - z * 2 : 1e5;
3540
3545
  o.autoHeight;
3541
3546
  const G = ps({
3542
3547
  text: c,
@@ -3555,87 +3560,87 @@ class ci {
3555
3560
  hyphenation: o.hyphenation,
3556
3561
  composer: o.composer,
3557
3562
  balanceRaggedLines: o.balanceRaggedLines
3558
- }), N = G.lines || [], J = G.maxFontSize || m, x = this.fontLeadingFactors[y] ?? 0.5, F = (A - m) * x;
3559
- let j = G.height, X = n, tt = a;
3560
- if (X === 0 || tt === 0 || X >= 1e5) {
3561
- let et = 0, mt = 0;
3563
+ }), N = G.lines || [], Q = G.maxFontSize || m, x = this.fontLeadingFactors[y] ?? 0.5, F = (A - m) * x;
3564
+ let tt = G.height, X = n, et = a;
3565
+ if (X === 0 || et === 0 || X >= 1e5) {
3566
+ let st = 0, gt = 0;
3562
3567
  const Rt = G.fullText || c;
3563
- (N || []).forEach((_t) => {
3564
- const dt = _t.text || "", Ft = t.measureText(dt).width + (dt.length > 0 ? (dt.length - 1) * T : 0);
3565
- Ft > et && (et = Ft), mt += dt.length, mt < Rt.length && (Rt[mt] === `
3566
- ` || Rt[mt] === "\r") && (mt++, Rt[mt - 1] === "\r" && Rt[mt] === `
3567
- ` && mt++);
3568
- }), (X === 0 || X >= 1e5) && (X = et), tt === 0 && (tt = j || 0);
3568
+ (N || []).forEach((Pt) => {
3569
+ const dt = Pt.text || "", Ft = t.measureText(dt).width + (dt.length > 0 ? (dt.length - 1) * T : 0);
3570
+ Ft > st && (st = Ft), gt += dt.length, gt < Rt.length && (Rt[gt] === `
3571
+ ` || Rt[gt] === "\r") && (gt++, Rt[gt - 1] === "\r" && Rt[gt] === `
3572
+ ` && gt++);
3573
+ }), (X === 0 || X >= 1e5) && (X = st), et === 0 && (et = tt || 0);
3569
3574
  }
3570
- let R = -j / 2;
3571
- a > 0 && a > j && (I === "top" ? R = -a / 2 : I === "middle" || I === "center" ? R = -j / 2 : I === "bottom" && (R = a / 2 - j)), R += F;
3575
+ let R = -tt / 2;
3576
+ a > 0 && a > tt && (I === "top" ? R = -a / 2 : I === "middle" || I === "center" ? R = -tt / 2 : I === "bottom" && (R = a / 2 - tt)), R += F;
3572
3577
  let O = null, D = 0;
3573
3578
  if (o.pathId && this.artboard) {
3574
- const et = this.artboard.objects.find((mt) => mt.id === o.pathId);
3575
- if (et && et.type === "Shape" && ((Xt = et.geometry) == null ? void 0 : Xt.type) === "Path") {
3576
- const mt = this.objectStates.get(et.id), Rt = mt != null && mt.geometry ? this.deepMerge(et.geometry, mt.geometry) : et.geometry, _t = (mt == null ? void 0 : mt.scale_x) !== void 0 ? (et.width || 0) * mt.scale_x : et.width || 0, dt = (mt == null ? void 0 : mt.scale_y) !== void 0 ? (et.height || 0) * mt.scale_y : et.height || 0;
3577
- O = { geo: Rt, obj: et, w: _t, h: dt }, D = this.getPerimeter(Rt, _t, dt);
3579
+ const st = this.artboard.objects.find((gt) => gt.id === o.pathId);
3580
+ if (st && st.type === "Shape" && ((Yt = st.geometry) == null ? void 0 : Yt.type) === "Path") {
3581
+ const gt = this.objectStates.get(st.id), Rt = gt != null && gt.geometry ? this.deepMerge(st.geometry, gt.geometry) : st.geometry, Pt = (gt == null ? void 0 : gt.scale_x) !== void 0 ? (st.width || 0) * gt.scale_x : st.width || 0, dt = (gt == null ? void 0 : gt.scale_y) !== void 0 ? (st.height || 0) * gt.scale_y : st.height || 0;
3582
+ O = { geo: Rt, obj: st, w: Pt, h: dt }, D = this.getPerimeter(Rt, Pt, dt);
3578
3583
  }
3579
3584
  }
3580
- const q = (et, mt) => {
3581
- var _t, dt;
3582
- if (T === 0 && (!o.enableSegments || !((_t = o.segments) != null && _t.length))) return t.measureText(et).width;
3585
+ const q = (st, gt) => {
3586
+ var Pt, dt;
3587
+ if (T === 0 && (!o.enableSegments || !((Pt = o.segments) != null && Pt.length))) return t.measureText(st).width;
3583
3588
  let Rt = 0;
3584
- for (let Ft = 0; Ft < et.length; Ft++) {
3585
- const Dt = mt + Ft;
3589
+ for (let Ft = 0; Ft < st.length; Ft++) {
3590
+ const Dt = gt + Ft;
3586
3591
  let $t = 0;
3587
3592
  if (o.enableSegments === !0 && ((dt = o.segments) == null ? void 0 : dt.length) > 0) {
3588
3593
  let Ot = 0, Vt = null;
3589
- for (const ie of o.segments) {
3590
- if (Dt < Ot + (ie.text || "").length) {
3591
- Vt = ie;
3594
+ for (const ne of o.segments) {
3595
+ if (Dt < Ot + (ne.text || "").length) {
3596
+ Vt = ne;
3592
3597
  break;
3593
3598
  }
3594
- Ot += (ie.text || "").length;
3599
+ Ot += (ne.text || "").length;
3595
3600
  }
3596
3601
  if (Vt) {
3597
3602
  t.save();
3598
- let ie = Vt.fontFamily || o.fontFamily || "Inter";
3603
+ let ne = Vt.fontFamily || o.fontFamily || "Inter";
3599
3604
  const me = this.mapFontWeight((Vt.fontWeight || o.fontWeight || "400").toString()), ye = Vt.fontStyle || v, Ut = Vt.fontSize || m;
3600
- t.font = `${ye} ${me} ${Ut}px "${ie}", sans-serif`, $t = t.measureText(et[Ft]).width, t.restore();
3605
+ t.font = `${ye} ${me} ${Ut}px "${ne}", sans-serif`, $t = t.measureText(st[Ft]).width, t.restore();
3601
3606
  } else
3602
- $t = t.measureText(et[Ft]).width;
3607
+ $t = t.measureText(st[Ft]).width;
3603
3608
  } else
3604
- $t = t.measureText(et[Ft]).width;
3609
+ $t = t.measureText(st[Ft]).width;
3605
3610
  Rt += $t + T;
3606
3611
  }
3607
- return Rt - (et.length > 0 ? T : 0);
3608
- }, ot = (et, mt, Rt, _t, dt) => {
3612
+ return Rt - (st.length > 0 ? T : 0);
3613
+ }, ot = (st, gt, Rt, Pt, dt) => {
3609
3614
  var me, ye;
3610
3615
  const Dt = (dt === 0 || c[dt - 1] === `
3611
3616
  ` || c[dt - 1] === "\r") && o.paragraphIndent ? o.paragraphIndent : 0, $t = (!r || h) && (i.behaviors || []).some(
3612
3617
  (Ut) => Ut.enabled && (Ut.type.toString().includes("Text") || ["Typewriter", "Scramble", "Wave", "Bounce", "GlitchText", "Reveal3D", "RevealSlide", "RevealBlur"].includes(Ut.type))
3613
- ), Ot = !o.pathId && !$t && (o.enableSegments !== !0 || !o.segments || o.segments.length === 0), Vt = o.baselineShift || 0, ie = Rt + Vt;
3618
+ ), Ot = !o.pathId && !$t && (o.enableSegments !== !0 || !o.segments || o.segments.length === 0), Vt = o.baselineShift || 0, ne = Rt + Vt;
3614
3619
  if (Ot)
3615
- t.font = M, _t ? t.strokeText(et, mt + Dt, ie) : t.fillText(et, mt + Dt, ie);
3620
+ t.font = M, Pt ? t.strokeText(st, gt + Dt, ne) : t.fillText(st, gt + Dt, ne);
3616
3621
  else {
3617
- const Ut = q(et, dt);
3618
- let Se = mt + Dt;
3622
+ const Ut = q(st, dt);
3623
+ let Se = gt + Dt;
3619
3624
  k === "center" ? Se -= Ut / 2 : k === "right" && (Se -= Ut);
3620
- const Pe = dt + et.length >= c.length || c[dt + et.length] === `
3621
- ` || c[dt + et.length] === "\r";
3625
+ const Pe = dt + st.length >= c.length || c[dt + st.length] === `
3626
+ ` || c[dt + st.length] === "\r";
3622
3627
  let Ee = 0, Ce = 0;
3623
3628
  const Ae = o.justifyMinWordSpacing, xe = o.justifyMaxWordSpacing;
3624
3629
  if (k === "justify" && !Pe && Ut > 0 && !o.pathId) {
3625
- const pt = W ? Ut : Y - z * 2 + 0, at = Math.max(0, pt - Ut);
3626
- for (let B = 0; B < et.length; B++)
3627
- et[B] === " " && Ce++;
3630
+ const mt = W ? Ut : Y - z * 2 + 0, at = Math.max(0, mt - Ut);
3631
+ for (let B = 0; B < st.length; B++)
3632
+ st[B] === " " && Ce++;
3628
3633
  if (Ce > 0) {
3629
3634
  const B = t.measureText(" ").width;
3630
- let nt = Ae || B * 0.5, Z = xe || B * 2.5;
3631
- Ee = Math.max(0, Math.min(at / Ce, Z - nt));
3635
+ let K = Ae || B * 0.5, j = xe || B * 2.5;
3636
+ Ee = Math.max(0, Math.min(at / Ce, j - K));
3632
3637
  }
3633
3638
  }
3634
- let se = o.pathOffset || 0;
3635
- o.pathId && D > 0 && O && (k === "center" ? se += D / 2 - Ut / 2 : k === "right" && (se += D - Ut));
3639
+ let ie = o.pathOffset || 0;
3640
+ o.pathId && D > 0 && O && (k === "center" ? ie += D / 2 - Ut / 2 : k === "right" && (ie += D - Ut));
3636
3641
  let jt = Se;
3637
3642
  const ht = r && !h ? [] : ((me = i.behaviors) == null ? void 0 : me.filter(
3638
- (pt) => [
3643
+ (mt) => [
3639
3644
  U.Typewriter,
3640
3645
  U.Scramble,
3641
3646
  U.Wave,
@@ -3665,106 +3670,106 @@ class ci {
3665
3670
  U.TextZing,
3666
3671
  U.TextPerspective,
3667
3672
  U.TextMirror
3668
- ].includes(pt.type) && pt.enabled
3673
+ ].includes(mt.type) && mt.enabled
3669
3674
  )) || [];
3670
- for (let pt = 0; pt < et.length; pt++) {
3671
- let at = et[pt];
3672
- const B = dt + pt;
3673
- let nt = 0, Z = 0, Pt = 1, xt = 1, kt = 0, At = 1, Mt = at;
3675
+ for (let mt = 0; mt < st.length; mt++) {
3676
+ let at = st[mt];
3677
+ const B = dt + mt;
3678
+ let K = 0, j = 0, kt = 1, At = 1, Tt = 0, xt = 1, Mt = at;
3674
3679
  ht.forEach((ut) => {
3675
3680
  const ct = ut.settings || {}, Ct = ct.strength || 1, rt = Date.now();
3676
3681
  if (ut.type === U.Typewriter)
3677
- this.currentTime * (ct.speed || 1) - B * (ct.stagger || 0.05) < 0 && (At = 0);
3682
+ this.currentTime * (ct.speed || 1) - B * (ct.stagger || 0.05) < 0 && (xt = 0);
3678
3683
  else if (ut.type === U.Scramble)
3679
3684
  Math.max(0, Math.min(1, this.currentTime / (ct.duration || 1.5)) - B * 0.02) < 1 && Math.random() < 0.3 && (Mt = "$%#@!*&"[Math.floor(Math.random() * 7)]);
3680
3685
  else if (ut.type === U.Wave)
3681
- Z += Math.sin(this.currentTime * 5 * (ct.speed || 1) + B * (ct.frequency || 1)) * (ct.amplitude || 20) * Ct;
3686
+ j += Math.sin(this.currentTime * 5 * (ct.speed || 1) + B * (ct.frequency || 1)) * (ct.amplitude || 20) * Ct;
3682
3687
  else if (ut.type === U.Bounce) {
3683
3688
  const V = Math.max(0, this.currentTime % 2 - B * (ct.stagger || 0.1));
3684
- V < 1 && (Z -= Math.abs(Math.sin(V * Math.PI)) * (ct.height || 50) * Ct);
3689
+ V < 1 && (j -= Math.abs(Math.sin(V * Math.PI)) * (ct.height || 50) * Ct);
3685
3690
  } else if (ut.type === U.TextTrail) {
3686
3691
  const V = this.pointerHistory[Math.max(0, this.pointerHistory.length - 1 - B * (ct.delay || 5))];
3687
- V && (nt += (V.x - (s.x + jt)) * Ct * 0.2, Z += (V.y - (s.y + Rt + Z)) * Ct * 0.2);
3692
+ V && (K += (V.x - (s.x + jt)) * Ct * 0.2, j += (V.y - (s.y + Rt + j)) * Ct * 0.2);
3688
3693
  } else if (ut.type === U.Reveal3D) {
3689
3694
  const V = Math.max(0, Math.min(1, this.currentTime * (ct.speed || 1) - B * (ct.stagger || 0.1)));
3690
- Pt *= V, xt *= V, At = V;
3695
+ kt *= V, At *= V, xt = V;
3691
3696
  } else if (ut.type === U.RevealSlide) {
3692
- const V = Math.max(0, Math.min(1, this.currentTime * 1.5 - B * 0.05)), st = (1 - V) * (ct.distance || 40) * Ct, it = ct.direction || "up";
3693
- it === "up" ? Z -= st : it === "down" ? Z += st : it === "left" ? nt -= st : it === "right" && (nt += st), At = V;
3697
+ const V = Math.max(0, Math.min(1, this.currentTime * 1.5 - B * 0.05)), it = (1 - V) * (ct.distance || 40) * Ct, nt = ct.direction || "up";
3698
+ nt === "up" ? j -= it : nt === "down" ? j += it : nt === "left" ? K -= it : nt === "right" && (K += it), xt = V;
3694
3699
  } else if (ut.type === U.RevealBlur) {
3695
3700
  const V = Math.max(0, Math.min(1, this.currentTime * 1.2 - B * 0.1));
3696
- At = V, nt += (1 - V) * 5;
3701
+ xt = V, K += (1 - V) * 5;
3697
3702
  } else if (ut.type === U.TextLiquid) {
3698
3703
  const V = Math.max(0, Math.sin(rt * 1e-3 * (ct.speed || 1) + B * 0.5));
3699
- Z += V * (ct.amplitude || 10) * Ct, xt *= 1 + V * 0.2;
3704
+ j += V * (ct.amplitude || 10) * Ct, At *= 1 + V * 0.2;
3700
3705
  } else if (ut.type === U.TextVortex) {
3701
- const V = rt * 2e-3 * (ct.speed || 1) + B * 0.2, st = (1 - (Math.sin(rt * 1e-3) * 0.5 + 0.5)) * (ct.radius || 50);
3702
- nt += Math.cos(V) * st * Ct, Z += Math.sin(V) * st * Ct;
3706
+ const V = rt * 2e-3 * (ct.speed || 1) + B * 0.2, it = (1 - (Math.sin(rt * 1e-3) * 0.5 + 0.5)) * (ct.radius || 50);
3707
+ K += Math.cos(V) * it * Ct, j += Math.sin(V) * it * Ct;
3703
3708
  } else if (ut.type === U.TextExplosion) {
3704
- const V = ct.force || 1, st = this.currentTime % 2;
3705
- if (st < 1) {
3706
- const it = (B / et.length - 0.5) * Math.PI * 2, vt = st * 100 * V;
3707
- nt += Math.cos(it) * vt * Ct, Z += Math.sin(it) * vt * Ct, At = 1 - st;
3709
+ const V = ct.force || 1, it = this.currentTime % 2;
3710
+ if (it < 1) {
3711
+ const nt = (B / st.length - 0.5) * Math.PI * 2, St = it * 100 * V;
3712
+ K += Math.cos(nt) * St * Ct, j += Math.sin(nt) * St * Ct, xt = 1 - it;
3708
3713
  }
3709
3714
  } else if (ut.type === U.TextRain) {
3710
- const V = ct.speed || 1, st = ct.height || 100, it = (rt * 1e-3 * V + B * 0.1) % 1;
3711
- Z -= (1 - it) * st * Ct, At = it > 0.1 ? 1 : it * 10;
3715
+ const V = ct.speed || 1, it = ct.height || 100, nt = (rt * 1e-3 * V + B * 0.1) % 1;
3716
+ j -= (1 - nt) * it * Ct, xt = nt > 0.1 ? 1 : nt * 10;
3712
3717
  } else if (ut.type === U.TextGravity) {
3713
- const V = ct.gravity || 9.8, st = this.currentTime % 3 / 3, it = 0.5 * V * Math.pow(st * 10, 2);
3714
- it < 100 ? Z += it * Ct : Z += 100 * Ct;
3718
+ const V = ct.gravity || 9.8, it = this.currentTime % 3 / 3, nt = 0.5 * V * Math.pow(it * 10, 2);
3719
+ nt < 100 ? j += nt * Ct : j += 100 * Ct;
3715
3720
  } else if (ut.type === U.TextMatrix) {
3716
3721
  const V = ct.speed || 1;
3717
3722
  if (Math.random() < 0.1 * V) {
3718
- const it = "0123456789ABCDEF!@#$%^&*";
3719
- Mt = it[Math.floor(Math.random() * it.length)];
3723
+ const nt = "0123456789ABCDEF!@#$%^&*";
3724
+ Mt = nt[Math.floor(Math.random() * nt.length)];
3720
3725
  }
3721
- At = 0.3 + (Math.sin(rt * 0.01 * V + B) + 1) / 2 * 0.7;
3726
+ xt = 0.3 + (Math.sin(rt * 0.01 * V + B) + 1) / 2 * 0.7;
3722
3727
  } else if (ut.type === U.TextNeon) {
3723
3728
  const V = Math.random() > 0.95 ? 0.5 : 1;
3724
- At = (0.7 + (Math.sin(rt * 5e-3) + 1) / 2 * 0.3) * V;
3729
+ xt = (0.7 + (Math.sin(rt * 5e-3) + 1) / 2 * 0.3) * V;
3725
3730
  } else if (ut.type === U.TextDissolve)
3726
- Math.sin(B * 1.5 + rt * 2e-3 * (ct.speed || 1)) > 0.5 && (At = 0);
3731
+ Math.sin(B * 1.5 + rt * 2e-3 * (ct.speed || 1)) > 0.5 && (xt = 0);
3727
3732
  else if (ut.type === U.TextOrganic) {
3728
- const V = ct.speed || 1, st = ct.amplitude || 10;
3729
- nt += Math.sin(rt * 2e-3 * V + B) * st * Ct, Z += Math.cos(rt * 15e-4 * V + B * 0.7) * st * Ct;
3733
+ const V = ct.speed || 1, it = ct.amplitude || 10;
3734
+ K += Math.sin(rt * 2e-3 * V + B) * it * Ct, j += Math.cos(rt * 15e-4 * V + B * 0.7) * it * Ct;
3730
3735
  } else if (ut.type === U.TextBreathe) {
3731
- const st = 1 + (Math.sin(rt * 3e-3 + B * 0.2) + 1) / 2 * 0.2 * Ct;
3732
- Pt *= st, xt *= st;
3736
+ const it = 1 + (Math.sin(rt * 3e-3 + B * 0.2) + 1) / 2 * 0.2 * Ct;
3737
+ kt *= it, At *= it;
3733
3738
  } else if (ut.type === U.TextSpin) {
3734
3739
  const V = ct.speed || 1;
3735
- kt += rt * 0.01 * V + B;
3740
+ Tt += rt * 0.01 * V + B;
3736
3741
  } else if (ut.type === U.TextMagnet) {
3737
3742
  const V = this.pointerHistory[this.pointerHistory.length - 1];
3738
3743
  if (V) {
3739
- const st = V.x - (s.x + jt), it = V.y - (s.y + Rt);
3740
- kt = Math.atan2(it, st);
3744
+ const it = V.x - (s.x + jt), nt = V.y - (s.y + Rt);
3745
+ Tt = Math.atan2(nt, it);
3741
3746
  }
3742
3747
  } else if (ut.type === U.TextPerspective) {
3743
- const V = et.length / 2, st = (B - V) / V, it = 1 - Math.abs(st) * 0.3 * Ct;
3744
- Pt *= it, xt *= it, nt += st * 20 * Ct;
3748
+ const V = st.length / 2, it = (B - V) / V, nt = 1 - Math.abs(it) * 0.3 * Ct;
3749
+ kt *= nt, At *= nt, K += it * 20 * Ct;
3745
3750
  } else if (ut.type === U.TextMirror)
3746
- At *= 0.8;
3751
+ xt *= 0.8;
3747
3752
  else if (ut.type === U.TextFloral) {
3748
- const V = ct.speed || 1, st = ct.stagger || 0.1, it = (rt * 1e-3 * V + B * st) % 2;
3749
- it < 1 && (Pt *= it, xt *= it, kt += it * Math.PI);
3753
+ const V = ct.speed || 1, it = ct.stagger || 0.1, nt = (rt * 1e-3 * V + B * it) % 2;
3754
+ nt < 1 && (kt *= nt, At *= nt, Tt += nt * Math.PI);
3750
3755
  } else if (ut.type === U.TextSmoke) {
3751
- const V = ct.speed || 1, st = ct.height || 50, it = (rt * 5e-4 * V + B * 0.2) % 1;
3752
- Z -= it * st * Ct, nt += Math.sin(rt * 2e-3 + B) * 5 * Ct, At = 1 - it;
3756
+ const V = ct.speed || 1, it = ct.height || 50, nt = (rt * 5e-4 * V + B * 0.2) % 1;
3757
+ j -= nt * it * Ct, K += Math.sin(rt * 2e-3 + B) * 5 * Ct, xt = 1 - nt;
3753
3758
  } else if (ut.type === U.TextVariable) {
3754
- const V = ct.speed || 1, st = ct.intensity || 1.5, it = (Math.sin(rt * 4e-3 * V + B * 0.3) + 1) / 2;
3755
- Pt *= 1 + it * (st - 1) * Ct;
3759
+ const V = ct.speed || 1, it = ct.intensity || 1.5, nt = (Math.sin(rt * 4e-3 * V + B * 0.3) + 1) / 2;
3760
+ kt *= 1 + nt * (it - 1) * Ct;
3756
3761
  } else if (ut.type === U.TextZing) {
3757
- const V = ct.speed || 2, st = ct.distance || 100, it = (rt * 2e-3 * V + B * 0.05) % 1;
3758
- nt += (1 - it) * st * Ct, At = it;
3762
+ const V = ct.speed || 2, it = ct.distance || 100, nt = (rt * 2e-3 * V + B * 0.05) % 1;
3763
+ K += (1 - nt) * it * Ct, xt = nt;
3759
3764
  } else if (ut.type === U.TextElastic) {
3760
- const V = ct.stiffness || 0.2, st = ct.damping || 0.1, it = Math.sin(rt * 0.01) * Math.exp(-rt * 1e-3 * st);
3761
- xt *= 1 + it * V * Ct;
3765
+ const V = ct.stiffness || 0.2, it = ct.damping || 0.1, nt = Math.sin(rt * 0.01) * Math.exp(-rt * 1e-3 * it);
3766
+ At *= 1 + nt * V * Ct;
3762
3767
  } else if (ut.type === U.TextGlitch3D) {
3763
3768
  const V = ct.intensity || 5;
3764
- Math.random() < 0.2 && (nt += (Math.random() - 0.5) * V, Z += (Math.random() - 0.5) * V, At = 0.8);
3769
+ Math.random() < 0.2 && (K += (Math.random() - 0.5) * V, j += (Math.random() - 0.5) * V, xt = 0.8);
3765
3770
  } else if (ut.type === U.GlitchText) {
3766
3771
  const V = ct.intensity || 5;
3767
- Math.random() < 0.1 && (nt += (Math.random() - 0.5) * V, Z += (Math.random() - 0.5) * V, Math.random() < 0.05 && (At = 0.5));
3772
+ Math.random() < 0.1 && (K += (Math.random() - 0.5) * V, j += (Math.random() - 0.5) * V, Math.random() < 0.05 && (xt = 0.5));
3768
3773
  }
3769
3774
  });
3770
3775
  let $ = null, Wt = o.textDecoration || "none", Kt = m;
@@ -3779,61 +3784,61 @@ class ci {
3779
3784
  }
3780
3785
  if (ct) {
3781
3786
  let Ct = ct.fontFamily || o.fontFamily || "Inter";
3782
- S.forEach((st) => {
3783
- const it = new RegExp(`[\\s-]${st}$`, "i");
3784
- it.test(Ct) && (Ct = Ct.replace(it, "").trim());
3787
+ S.forEach((it) => {
3788
+ const nt = new RegExp(`[\\s-]${it}$`, "i");
3789
+ nt.test(Ct) && (Ct = Ct.replace(nt, "").trim());
3785
3790
  });
3786
3791
  const rt = this.mapFontWeight((ct.fontWeight || o.fontWeight || "400").toString()), V = ct.fontStyle || v;
3787
- Kt = ct.fontSize || m, t.font = `${V} ${rt} ${Kt}px "${Ct}", sans-serif`, ct.fill && ($ = ct.fill), ct.textDecoration && (Wt = ct.textDecoration), Kt < J && (Z += (J - Kt) * 0.85);
3792
+ Kt = ct.fontSize || m, t.font = `${V} ${rt} ${Kt}px "${Ct}", sans-serif`, ct.fill && ($ = ct.fill), ct.textDecoration && (Wt = ct.textDecoration), Kt < Q && (j += (Q - Kt) * 0.85);
3788
3793
  }
3789
3794
  } else
3790
3795
  t.font = M;
3791
3796
  const te = t.globalAlpha;
3792
- t.globalAlpha *= At, t.save();
3797
+ t.globalAlpha *= xt, t.save();
3793
3798
  const Jt = t.measureText(Mt).width;
3794
3799
  if (O && D > 0) {
3795
- const ut = jt - Se + Jt / 2, Ct = (se + ut) / D, rt = this.getPointOnPath(O.geo, O.w, O.h, Math.abs(Ct % 1)), V = rt.angle, st = Rt + Z + (o.pathOffsetY || 0), it = o.pathSide === "right" ? -1 : 1, vt = Math.cos(V + Math.PI / 2) * st * it, Yt = Math.sin(V + Math.PI / 2) * st * it;
3796
- t.translate(rt.x + vt + nt, rt.y + Yt), t.rotate(V + kt + (it === -1 ? Math.PI : 0));
3800
+ const ut = jt - Se + Jt / 2, Ct = (ie + ut) / D, rt = this.getPointOnPath(O.geo, O.w, O.h, Math.abs(Ct % 1)), V = rt.angle, it = Rt + j + (o.pathOffsetY || 0), nt = o.pathSide === "right" ? -1 : 1, St = Math.cos(V + Math.PI / 2) * it * nt, Xt = Math.sin(V + Math.PI / 2) * it * nt;
3801
+ t.translate(rt.x + St + K, rt.y + Xt), t.rotate(V + Tt + (nt === -1 ? Math.PI : 0));
3797
3802
  } else
3798
- t.translate(jt + nt + Jt / 2, Rt + Z), kt !== 0 && t.rotate(kt);
3799
- if (t.scale(Pt, xt), $ && !r && !h) {
3800
- const ut = this.createCanvasFill(t, $, X, tt);
3803
+ t.translate(jt + K + Jt / 2, Rt + j), Tt !== 0 && t.rotate(Tt);
3804
+ if (t.scale(kt, At), $ && !r && !h) {
3805
+ const ut = this.createCanvasFill(t, $, X, et);
3801
3806
  t.fillStyle = ut || $.color || "#000000";
3802
3807
  } else if (!r && !h) {
3803
- const ut = this.createCanvasFill(t, e.fill, X, tt);
3808
+ const ut = this.createCanvasFill(t, e.fill, X, et);
3804
3809
  t.fillStyle = ut || e.fill.color || "#000000";
3805
3810
  }
3806
- if (At > 0)
3811
+ if (xt > 0)
3807
3812
  if (r || h) {
3808
- const ut = h ? "#000000" : this.createCanvasFill(t, e.fill, X, tt);
3813
+ const ut = h ? "#000000" : this.createCanvasFill(t, e.fill, X, et);
3809
3814
  t.fillStyle = ut || e.fill.color || "#ffffff", t.fillText(Mt, -Jt / 2, 0);
3810
- } else _t ? t.strokeText(Mt, -Jt / 2, 0) : t.fillText(Mt, -Jt / 2, 0);
3815
+ } else Pt ? t.strokeText(Mt, -Jt / 2, 0) : t.fillText(Mt, -Jt / 2, 0);
3811
3816
  Wt !== "none" && !r && this.drawTextDecoration(t, Wt, 0, 0, Jt, Kt), t.restore(), t.globalAlpha = te, k === "justify" && Ee > 0 && Mt === " " && !Pe ? jt += Jt + T + Ee : jt += Jt + T;
3812
3817
  }
3813
3818
  }
3814
3819
  };
3815
3820
  if (r) {
3816
- let et = 0, mt = R;
3821
+ let st = 0, gt = R;
3817
3822
  (N || []).forEach((Rt) => {
3818
- const _t = Rt.text || "", dt = c.indexOf(_t, et);
3819
- dt !== -1 && (et = dt);
3823
+ const Pt = Rt.text || "", dt = c.indexOf(Pt, st);
3824
+ dt !== -1 && (st = dt);
3820
3825
  let Ft = -X / 2;
3821
- k === "center" ? Ft = 0 : k === "right" && (Ft = X / 2), ot(_t, Ft, mt, !1, et), et += _t.length, mt += A;
3826
+ k === "center" ? Ft = 0 : k === "right" && (Ft = X / 2), ot(Pt, Ft, gt, !1, st), st += Pt.length, gt += A;
3822
3827
  });
3823
3828
  } else if (h) {
3824
- let et = 0, mt = R;
3829
+ let st = 0, gt = R;
3825
3830
  (N || []).forEach((Rt) => {
3826
- const _t = Rt.text || "";
3831
+ const Pt = Rt.text || "";
3827
3832
  let dt = -X / 2;
3828
- k === "center" ? dt = 0 : k === "right" && (dt = X / 2), ot(_t, dt, mt, !1, et), et += _t.length, et < c.length && (c[et] === `
3829
- ` || c[et] === "\r") && (et++, c[et - 1] === "\r" && c[et] === `
3830
- ` && et++), mt += A;
3833
+ k === "center" ? dt = 0 : k === "right" && (dt = X / 2), ot(Pt, dt, gt, !1, st), st += Pt.length, st < c.length && (c[st] === `
3834
+ ` || c[st] === "\r") && (st++, c[st - 1] === "\r" && c[st] === `
3835
+ ` && st++), gt += A;
3831
3836
  });
3832
3837
  } else {
3833
3838
  if (e.fill) {
3834
- const mt = t.globalAlpha, Rt = this.createCanvasFill(t, e.fill, X, tt);
3835
- t.fillStyle = Rt || e.fill.color || "#000000", t.globalAlpha = mt * this.normalizeOpacity(e.fill.opacity ?? 100);
3836
- const _t = G.fullText || (o.enableSegments ? (o.segments || []).map((Dt) => {
3839
+ const gt = t.globalAlpha, Rt = this.createCanvasFill(t, e.fill, X, et);
3840
+ t.fillStyle = Rt || e.fill.color || "#000000", t.globalAlpha = gt * this.normalizeOpacity(e.fill.opacity ?? 100);
3841
+ const Pt = G.fullText || (o.enableSegments ? (o.segments || []).map((Dt) => {
3837
3842
  let $t = Dt.text || "";
3838
3843
  const Ot = Dt.textCase || o.textCase || "none";
3839
3844
  return Ot === "uppercase" ? $t.toUpperCase() : Ot === "lowercase" ? $t.toLowerCase() : Ot === "capitalize" ? $t.replace(/\b\w/g, (Vt) => Vt.toUpperCase()) : $t;
@@ -3842,52 +3847,52 @@ class ci {
3842
3847
  (N || []).forEach((Dt) => {
3843
3848
  const $t = Dt.text || "";
3844
3849
  let Ot = -X / 2;
3845
- k === "center" ? Ot = 0 : k === "right" && (Ot = X / 2), ot($t, Ot, Ft, !1, dt), dt += $t.length, Ft += A, dt < _t.length && (_t[dt] === `
3846
- ` || _t[dt] === "\r") && (_ > 0 && (Ft += _), dt++, _t[dt - 1] === "\r" && _t[dt] === `
3850
+ k === "center" ? Ot = 0 : k === "right" && (Ot = X / 2), ot($t, Ot, Ft, !1, dt), dt += $t.length, Ft += A, dt < Pt.length && (Pt[dt] === `
3851
+ ` || Pt[dt] === "\r") && (_ > 0 && (Ft += _), dt++, Pt[dt - 1] === "\r" && Pt[dt] === `
3847
3852
  ` && dt++);
3848
- }), t.globalAlpha = mt;
3853
+ }), t.globalAlpha = gt;
3849
3854
  }
3850
- const et = o.paragraphRule;
3851
- if (et && (((le = et.top) == null ? void 0 : le.width) > 0 || ((fe = et.bottom) == null ? void 0 : fe.width) > 0)) {
3852
- let mt = 0;
3853
- (N || []).forEach((Rt, _t) => {
3855
+ const st = o.paragraphRule;
3856
+ if (st && (((se = st.top) == null ? void 0 : se.width) > 0 || ((fe = st.bottom) == null ? void 0 : fe.width) > 0)) {
3857
+ let gt = 0;
3858
+ (N || []).forEach((Rt, Pt) => {
3854
3859
  var Dt, $t;
3855
- const Ft = mt === 0 || mt < c.length && (c[mt] === `
3856
- ` || c[mt] === "\r");
3857
- if (Ft && _t > 0 && mt++, Ft) {
3858
- if (((Dt = et.top) == null ? void 0 : Dt.width) > 0) {
3859
- const Ot = R + _t * A - et.top.offset;
3860
- t.strokeStyle = et.top.color || "#000000", t.lineWidth = et.top.width, t.beginPath();
3860
+ const Ft = gt === 0 || gt < c.length && (c[gt] === `
3861
+ ` || c[gt] === "\r");
3862
+ if (Ft && Pt > 0 && gt++, Ft) {
3863
+ if (((Dt = st.top) == null ? void 0 : Dt.width) > 0) {
3864
+ const Ot = R + Pt * A - st.top.offset;
3865
+ t.strokeStyle = st.top.color || "#000000", t.lineWidth = st.top.width, t.beginPath();
3861
3866
  const Vt = -n / 2 + A * 0.2;
3862
3867
  t.moveTo(Vt, Ot), t.lineTo(n / 2 - A * 0.2, Ot), t.stroke();
3863
3868
  }
3864
- if ((($t = et.bottom) == null ? void 0 : $t.width) > 0) {
3865
- const Ot = R + (_t + 1) * A - et.bottom.offset;
3866
- t.strokeStyle = et.bottom.color || "#000000", t.lineWidth = et.bottom.width, t.beginPath();
3869
+ if ((($t = st.bottom) == null ? void 0 : $t.width) > 0) {
3870
+ const Ot = R + (Pt + 1) * A - st.bottom.offset;
3871
+ t.strokeStyle = st.bottom.color || "#000000", t.lineWidth = st.bottom.width, t.beginPath();
3867
3872
  const Vt = -n / 2 + A * 0.2;
3868
3873
  t.moveTo(Vt, Ot), t.lineTo(n / 2 - A * 0.2, Ot), t.stroke();
3869
3874
  }
3870
3875
  }
3871
- mt += (Rt.text || "").length;
3876
+ gt += (Rt.text || "").length;
3872
3877
  });
3873
3878
  }
3874
3879
  if (e.stroke && e.stroke.width > 0) {
3875
- const mt = t.globalAlpha;
3880
+ const gt = t.globalAlpha;
3876
3881
  e.fill && e.fill.type !== "None" && e.fill.isEnabled !== !1 && e.fill.opacity !== 0 && e.fill.color !== "transparent" && e.fill.color !== "rgba(0,0,0,0)" && (t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetX = 0, t.shadowOffsetY = 0), t.strokeStyle = e.stroke.color;
3877
- let _t = 1;
3882
+ let Pt = 1;
3878
3883
  if (this.rootTransform) {
3879
3884
  const Dt = t.getTransform(), $t = Math.sqrt(Dt.a * Dt.a + Dt.b * Dt.b) || 1, Ot = this.rootTransform, Vt = Math.sqrt(Ot.a * Ot.a + Ot.b * Ot.b) || 1;
3880
- _t = $t / Vt;
3885
+ Pt = $t / Vt;
3881
3886
  } else
3882
- _t = (Math.abs(f) + Math.abs(l)) / 2 || 1;
3883
- t.lineWidth = (e.stroke.width || 1) / (_t || 1), t.globalAlpha = mt * this.normalizeOpacity(e.stroke.opacity ?? 100);
3887
+ Pt = (Math.abs(f) + Math.abs(l)) / 2 || 1;
3888
+ t.lineWidth = (e.stroke.width || 1) / (Pt || 1), t.globalAlpha = gt * this.normalizeOpacity(e.stroke.opacity ?? 100);
3884
3889
  let dt = 0, Ft = R;
3885
3890
  (N || []).forEach((Dt) => {
3886
3891
  let $t = -X / 2;
3887
3892
  k === "center" ? $t = 0 : k === "right" && ($t = X / 2), ot(Dt.text, $t, Ft, !0, dt), dt += (Dt.text || "").length, Ft += A, dt < c.length && (c[dt] === `
3888
3893
  ` || c[dt] === "\r") && (_ > 0 && (Ft += _), dt++, c[dt - 1] === "\r" && c[dt] === `
3889
3894
  ` && dt++);
3890
- }), t.globalAlpha = mt;
3895
+ }), t.globalAlpha = gt;
3891
3896
  }
3892
3897
  }
3893
3898
  }
@@ -4254,7 +4259,7 @@ class ci {
4254
4259
  const d = t.createPattern(this._noiseTileCanvas, "repeat");
4255
4260
  d && (t.fillStyle = d, t.fillRect(-o / 2, -e / 2, o, e));
4256
4261
  }
4257
- t.restore(), t.save(), t.globalAlpha = 1, t.strokeStyle = "rgba(255, 255, 255, 0.25)", t.lineWidth = 1.5, this.applyPath(t, i, o, e, s), t.stroke(), t.restore();
4262
+ t.restore();
4258
4263
  }
4259
4264
  applyPath(t, i, o, e, s) {
4260
4265
  i != null && i.data && (i.type === "Path" || i.type === "Subtract" || i.type === "Union" || i.type === "Intersect" || i.type === "Exclude" || i.type), t.beginPath(), this._tracePath(t, i, o, e, s);
@@ -4360,59 +4365,59 @@ class ci {
4360
4365
  }
4361
4366
  const P = (D, q) => {
4362
4367
  if (!D.visible || !D.svgPath) return;
4363
- const ot = D.size || 14, yt = D.offset ?? 16, bt = D.color || "#ffffff", gt = q ? -(s / 2) + yt : s / 2 - yt, Et = D.svgPath;
4364
- if (t.save(), t.translate(gt, 0), !Et.startsWith("<svg")) {
4365
- const It = new Path2D(Et), St = ot / 24;
4366
- t.scale(St, St), t.translate(-12, -12), t.fillStyle = bt, t.fill(It);
4368
+ const ot = D.size || 14, yt = D.offset ?? 16, bt = D.color || "#ffffff", pt = q ? -(s / 2) + yt : s / 2 - yt, Et = D.svgPath;
4369
+ if (t.save(), t.translate(pt, 0), !Et.startsWith("<svg")) {
4370
+ const It = new Path2D(Et), vt = ot / 24;
4371
+ t.scale(vt, vt), t.translate(-12, -12), t.fillStyle = bt, t.fill(It);
4367
4372
  }
4368
4373
  t.restore();
4369
4374
  };
4370
4375
  P(c, !0), P(d, !1);
4371
4376
  const _ = e.text || "", E = e.placeholder || "Enter text...", A = !_, W = _ || E, z = A ? M : w, Y = I, G = e.fontFamily || "Inter", N = e.fontWeight || 400;
4372
4377
  t.font = `${N} ${Y}px "${G}", sans-serif`, t.fillStyle = z, t.textAlign = "left", t.textBaseline = u ? "top" : "middle";
4373
- const J = e.inputPadding ?? 16, x = c.visible ? (c.offset ?? 16) + (c.size || 14) / 2 + 8 : J, F = d.visible ? (d.offset ?? 16) + (d.size || 14) / 2 + 8 : J, j = -(s / 2) + x, X = s - x - F, tt = e.inputType === "password" ? "•".repeat(W.length) : W;
4374
- if (t.save(), t.beginPath(), t.rect(j - 2, -n / 2 + 4, X + 4, n - 8), t.clip(), u) {
4375
- const D = tt.split(`
4378
+ const Q = e.inputPadding ?? 16, x = c.visible ? (c.offset ?? 16) + (c.size || 14) / 2 + 8 : Q, F = d.visible ? (d.offset ?? 16) + (d.size || 14) / 2 + 8 : Q, tt = -(s / 2) + x, X = s - x - F, et = e.inputType === "password" ? "•".repeat(W.length) : W;
4379
+ if (t.save(), t.beginPath(), t.rect(tt - 2, -n / 2 + 4, X + 4, n - 8), t.clip(), u) {
4380
+ const D = et.split(`
4376
4381
  `);
4377
- let q = -n / 2 + J;
4382
+ let q = -n / 2 + Q;
4378
4383
  const ot = Y * 1.2;
4379
4384
  let yt = 0;
4380
- D.forEach((bt, gt) => {
4385
+ D.forEach((bt, pt) => {
4381
4386
  const Et = bt.split(" ");
4382
4387
  let It = "";
4383
- for (let St = 0; St < Et.length; St++) {
4384
- const Xt = It + Et[St] + " ";
4385
- t.measureText(Xt).width > X && St > 0 ? (t.fillText(It, j, q), It = Et[St] + " ", q += ot) : It = Xt;
4388
+ for (let vt = 0; vt < Et.length; vt++) {
4389
+ const Yt = It + Et[vt] + " ";
4390
+ t.measureText(Yt).width > X && vt > 0 ? (t.fillText(It, tt, q), It = Et[vt] + " ", q += ot) : It = Yt;
4386
4391
  }
4387
- t.fillText(It, j, q), yt = t.measureText(It).width, gt < D.length - 1 && (q += ot, yt = 0);
4388
- }), a && !A && Math.floor(performance.now() / 500) % 2 === 0 && t.fillRect(j + yt, q, 1.5, Y);
4392
+ t.fillText(It, tt, q), yt = t.measureText(It).width, pt < D.length - 1 && (q += ot, yt = 0);
4393
+ }), a && !A && Math.floor(performance.now() / 500) % 2 === 0 && t.fillRect(tt + yt, q, 1.5, Y);
4389
4394
  } else {
4390
- const q = t.measureText(tt).width;
4395
+ const q = t.measureText(et).width;
4391
4396
  let ot = 0;
4392
- if (q > X && (ot = q - X), t.fillText(tt, j - ot, 0), a && !A && Math.floor(performance.now() / 500) % 2 === 0) {
4393
- const bt = j + q - ot;
4397
+ if (q > X && (ot = q - X), t.fillText(et, tt - ot, 0), a && !A && Math.floor(performance.now() / 500) % 2 === 0) {
4398
+ const bt = tt + q - ot;
4394
4399
  t.fillRect(bt, -(Y / 2), 1.5, Y);
4395
4400
  }
4396
4401
  }
4397
4402
  if (t.restore(), l.visible !== !1) {
4398
4403
  const D = l.text || "Label", q = l.fontSize || 12, ot = l.color || "rgba(156, 163, 175, 1)", yt = l.offset ?? 8;
4399
4404
  t.font = `600 ${q}px "${G}", sans-serif`, t.fillStyle = ot, t.textAlign = "left", t.textBaseline = "bottom";
4400
- const bt = -(s / 2), gt = -(n / 2) - yt;
4401
- t.fillText(D, bt, gt);
4405
+ const bt = -(s / 2), pt = -(n / 2) - yt;
4406
+ t.fillText(D, bt, pt);
4402
4407
  }
4403
4408
  if (p.visible === !0) {
4404
4409
  const D = p.text || "Helper text", q = p.fontSize || 11, ot = f === "error" ? "rgba(239, 68, 68, 1)" : p.color || "rgba(156, 163, 175, 1)", yt = p.offset ?? 6;
4405
4410
  t.font = `400 ${q}px "${G}", sans-serif`, t.fillStyle = ot, t.textAlign = "left", t.textBaseline = "top";
4406
- const bt = -(s / 2), gt = n / 2 + yt;
4407
- t.fillText(D, bt, gt);
4411
+ const bt = -(s / 2), pt = n / 2 + yt;
4412
+ t.fillText(D, bt, pt);
4408
4413
  }
4409
4414
  }
4410
4415
  renderSlider(t, i) {
4411
- const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.geometry) || i.geometry, s = (o == null ? void 0 : o.options) || i.options || {}, n = e.width || 200, a = s.value ?? 50, r = s.min ?? 0, f = (s.max ?? 100) - r, l = f === 0 ? 0 : (a - r) / f, p = s.trackHeight || 4, c = s.trackRoundedness ?? 2, d = s.trackShape ?? "Rectangle", u = s.trackPath || "", v = s.accentColor || "#3b82f6", b = s.inactiveColor || "#374151", m = s.thumbShape || "Ellipse", y = s.thumbWidth ?? 16, S = s.thumbHeight ?? 16, C = s.thumbRoundedness ?? 0, w = s.thumbColor || "#ffffff", M = s.thumbPath || "", I = s.thumbIcon || "", k = s.showValueTooltip ?? !1, T = s.tooltipBgColor || "#333333", L = s.tooltipColor || "#ffffff", P = s.tooltipOffsetX ?? 0, _ = s.tooltipOffsetY ?? -25, E = (X, tt, R, O, D, q, ot) => {
4416
+ const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.geometry) || i.geometry, s = (o == null ? void 0 : o.options) || i.options || {}, n = e.width || 200, a = s.value ?? 50, r = s.min ?? 0, f = (s.max ?? 100) - r, l = f === 0 ? 0 : (a - r) / f, p = s.trackHeight || 4, c = s.trackRoundedness ?? 2, d = s.trackShape ?? "Rectangle", u = s.trackPath || "", v = s.accentColor || "#3b82f6", b = s.inactiveColor || "#374151", m = s.thumbShape || "Ellipse", y = s.thumbWidth ?? 16, S = s.thumbHeight ?? 16, C = s.thumbRoundedness ?? 0, w = s.thumbColor || "#ffffff", M = s.thumbPath || "", I = s.thumbIcon || "", k = s.showValueTooltip ?? !1, T = s.tooltipBgColor || "#333333", L = s.tooltipColor || "#ffffff", P = s.tooltipOffsetX ?? 0, _ = s.tooltipOffsetY ?? -25, E = (X, et, R, O, D, q, ot) => {
4412
4417
  if ((X === "Custom" || X === "Icon") && ot)
4413
4418
  try {
4414
4419
  const yt = new Path2D(ot);
4415
- if (t.save(), t.translate(tt, R), X === "Icon") {
4420
+ if (t.save(), t.translate(et, R), X === "Icon") {
4416
4421
  const bt = Math.min(O, D) / 24;
4417
4422
  t.scale(bt, bt), t.translate(-12, -12);
4418
4423
  }
@@ -4422,28 +4427,28 @@ class ci {
4422
4427
  console.error("Error drawing slider shape in engine:", yt);
4423
4428
  }
4424
4429
  if (t.beginPath(), X === "Ellipse")
4425
- t.ellipse(tt, R, O / 2, D / 2, 0, 0, Math.PI * 2);
4430
+ t.ellipse(et, R, O / 2, D / 2, 0, 0, Math.PI * 2);
4426
4431
  else if (X === "Rectangle")
4427
- this.drawRoundRect(t, tt - O / 2, R - D / 2, O, D, q);
4432
+ this.drawRoundRect(t, et - O / 2, R - D / 2, O, D, q);
4428
4433
  else if (X === "Triangle")
4429
- t.moveTo(tt, R - D / 2), t.lineTo(tt + O / 2, R + D / 2), t.lineTo(tt - O / 2, R + D / 2), t.closePath();
4434
+ t.moveTo(et, R - D / 2), t.lineTo(et + O / 2, R + D / 2), t.lineTo(et - O / 2, R + D / 2), t.closePath();
4430
4435
  else if (X === "Diamond")
4431
- t.moveTo(tt, R - D / 2), t.lineTo(tt + O / 2, R), t.lineTo(tt, R + D / 2), t.lineTo(tt - O / 2, R), t.closePath();
4436
+ t.moveTo(et, R - D / 2), t.lineTo(et + O / 2, R), t.lineTo(et, R + D / 2), t.lineTo(et - O / 2, R), t.closePath();
4432
4437
  else if (X === "Polygon") {
4433
4438
  const yt = i.geometry.sides || 3, bt = i.geometry.radius || Math.min(O, D) / 2;
4434
- for (let gt = 0; gt < yt; gt++) {
4435
- const Et = gt * 2 * Math.PI / yt - Math.PI / 2, It = tt + bt * Math.cos(Et), St = R + bt * Math.sin(Et);
4436
- gt === 0 ? t.moveTo(It, St) : t.lineTo(It, St);
4439
+ for (let pt = 0; pt < yt; pt++) {
4440
+ const Et = pt * 2 * Math.PI / yt - Math.PI / 2, It = et + bt * Math.cos(Et), vt = R + bt * Math.sin(Et);
4441
+ pt === 0 ? t.moveTo(It, vt) : t.lineTo(It, vt);
4437
4442
  }
4438
4443
  t.closePath();
4439
4444
  } else if (X === "Star") {
4440
- const bt = Math.min(O, D) / 2, gt = bt / 2;
4445
+ const bt = Math.min(O, D) / 2, pt = bt / 2;
4441
4446
  for (let Et = 0; Et < 10; Et++) {
4442
- const It = Et % 2 === 0 ? bt : gt, St = Et * Math.PI / 5 - Math.PI / 2;
4443
- t.lineTo(tt + It * Math.cos(St), R + It * Math.sin(St));
4447
+ const It = Et % 2 === 0 ? bt : pt, vt = Et * Math.PI / 5 - Math.PI / 2;
4448
+ t.lineTo(et + It * Math.cos(vt), R + It * Math.sin(vt));
4444
4449
  }
4445
4450
  t.closePath();
4446
- } else X === "Line" && (t.moveTo(tt - O / 2, R), t.lineTo(tt + O / 2, R));
4451
+ } else X === "Line" && (t.moveTo(et - O / 2, R), t.lineTo(et + O / 2, R));
4447
4452
  t.fill();
4448
4453
  }, A = this.createCanvasFill(t, b, n, p);
4449
4454
  A && (t.fillStyle = A, t.strokeStyle = A), d === "Line" ? (t.lineWidth = p, t.beginPath(), t.moveTo(-n / 2, 0), t.lineTo(n / 2, 0), t.stroke()) : E(d, 0, 0, n, p, c, u);
@@ -4455,24 +4460,24 @@ class ci {
4455
4460
  t.save(), t.translate(z, 0);
4456
4461
  const G = t.getTransform(), N = Math.sqrt(G.a * G.a + G.b * G.b) || 1;
4457
4462
  t.shadowColor = "rgba(0,0,0,0.2)", t.shadowBlur = 4 * N, t.shadowOffsetY = 1 * N;
4458
- const J = this.createCanvasFill(t, w, y, S);
4459
- if (J && (t.fillStyle = J), E(m, 0, 0, y, S, C, m === "Icon" ? I : M), t.restore(), k) {
4463
+ const Q = this.createCanvasFill(t, w, y, S);
4464
+ if (Q && (t.fillStyle = Q), E(m, 0, 0, y, S, C, m === "Icon" ? I : M), t.restore(), k) {
4460
4465
  t.save(), t.translate(z + P, _);
4461
4466
  const X = Math.round(a).toString();
4462
4467
  t.font = "10px Inter, sans-serif";
4463
- const tt = t.measureText(X), R = 6, O = 4, D = tt.width + R * 2, q = 14 + O;
4468
+ const et = t.measureText(X), R = 6, O = 4, D = et.width + R * 2, q = 14 + O;
4464
4469
  t.beginPath(), this.drawRoundRect(t, -D / 2, -q / 2, D, q, 4), t.fillStyle = T, t.fill(), t.fillStyle = L, t.textAlign = "center", t.textBaseline = "middle", t.fillText(X, 0, 0), t.restore();
4465
4470
  }
4466
- const x = s.label || {}, F = s.helperText || {}, j = s.fontFamily || "Inter";
4471
+ const x = s.label || {}, F = s.helperText || {}, tt = s.fontFamily || "Inter";
4467
4472
  if (x.visible !== !1) {
4468
- const X = x.text || "Label", tt = x.fontSize || 12, R = x.color || "rgba(156, 163, 175, 1)", O = x.offset ?? 8;
4469
- t.font = `600 ${tt}px "${j}", sans-serif`, t.fillStyle = R, t.textAlign = "left", t.textBaseline = "bottom";
4473
+ const X = x.text || "Label", et = x.fontSize || 12, R = x.color || "rgba(156, 163, 175, 1)", O = x.offset ?? 8;
4474
+ t.font = `600 ${et}px "${tt}", sans-serif`, t.fillStyle = R, t.textAlign = "left", t.textBaseline = "bottom";
4470
4475
  const D = -(n / 2), q = -(p / 2) - O;
4471
4476
  t.fillText(X, D, q);
4472
4477
  }
4473
4478
  if (F.visible === !0) {
4474
- const X = F.text || "Helper text", tt = F.fontSize || 11, R = F.color || "rgba(156, 163, 175, 1)", O = F.offset ?? 6;
4475
- t.font = `400 ${tt}px "${j}", sans-serif`, t.fillStyle = R, t.textAlign = "left", t.textBaseline = "top";
4479
+ const X = F.text || "Helper text", et = F.fontSize || 11, R = F.color || "rgba(156, 163, 175, 1)", O = F.offset ?? 6;
4480
+ t.font = `400 ${et}px "${tt}", sans-serif`, t.fillStyle = R, t.textAlign = "left", t.textBaseline = "top";
4476
4481
  const D = -(n / 2), q = p / 2 + O;
4477
4482
  t.fillText(X, D, q);
4478
4483
  }
@@ -4514,20 +4519,20 @@ class ci {
4514
4519
  if (t.save(), t.beginPath(), t.rect(a + m, r, P, n), t.clip(), t.fillText(w, a + m, 0), t.restore(), p && !f) {
4515
4520
  const E = r + n + 4, A = e.optionsList || [], W = e.itemHeight || 32, z = e.listPadding ?? 4, Y = A.length * W + z * 2, G = e.listCornerRadius ?? h;
4516
4521
  t.save();
4517
- const N = e.listShadow || {}, J = t.getTransform(), x = Math.sqrt(J.a * J.a + J.b * J.b) || 1;
4522
+ const N = e.listShadow || {}, Q = t.getTransform(), x = Math.sqrt(Q.a * Q.a + Q.b * Q.b) || 1;
4518
4523
  t.shadowColor = typeof N.color == "string" ? N.color : ((_ = N.color) == null ? void 0 : _.color) || "rgba(0,0,0,0.15)", t.shadowBlur = (N.blur ?? 12) * x, t.shadowOffsetY = (N.offsetY ?? 6) * x, t.shadowOffsetX = (N.offsetX ?? 0) * x, t.beginPath(), this.drawRoundRect(t, a, E, s, Y, G), t.fillStyle = this.createCanvasFill(t, typeof e.listBackgroundColor == "string" ? { type: "Solid", color: e.listBackgroundColor } : e.listBackgroundColor || { type: "Solid", color: "#ffffff" }, s, Y) || "#ffffff", t.fill();
4519
4524
  const F = e.listBorderWidth ?? 1;
4520
4525
  F > 0 && (t.shadowColor = "transparent", t.strokeStyle = this.createCanvasFill(t, typeof e.listBorderColor == "string" ? { type: "Solid", color: e.listBorderColor } : e.listBorderColor || { type: "Solid", color: d }, s, Y) || "#e5e7eb", t.lineWidth = F, t.stroke()), t.restore();
4521
- const j = e.itemFontSize || M, X = e.itemFontFamily || k;
4522
- t.font = `${I} ${j}px ${X}`, A.forEach((tt, R) => {
4526
+ const tt = e.itemFontSize || M, X = e.itemFontFamily || k;
4527
+ t.font = `${I} ${tt}px ${X}`, A.forEach((et, R) => {
4523
4528
  const O = E + z + R * W;
4524
- if (tt === e.selectedOption)
4529
+ if (et === e.selectedOption)
4525
4530
  t.fillStyle = this.createCanvasFill(t, typeof e.itemSelectedBackgroundColor == "string" ? { type: "Solid", color: e.itemSelectedBackgroundColor } : e.itemSelectedBackgroundColor || { type: "Solid", color: "#f3f4f6" }, s, W) || "#f3f4f6", t.fillRect(a + F, O, s - F * 2, W), t.fillStyle = e.itemSelectedColor || e.accentColor || u || "#374151";
4526
4531
  else if (t.fillStyle = e.listTextColor || u || "#333333", this.activeDropdownId === i.id && this._lastPointerPos) {
4527
4532
  const q = this._lastPointerPos.y - (E + z), ot = Math.floor(q / W);
4528
4533
  R === ot && (t.fillStyle = this.createCanvasFill(t, typeof e.itemHoverBackgroundColor == "string" ? { type: "Solid", color: e.itemHoverBackgroundColor } : e.itemHoverBackgroundColor || { type: "Solid", color: "#f9fafb" }, s, W) || "#f9fafb", t.fillRect(a + F, O, s - F * 2, W), t.fillStyle = e.itemHoverColor || u);
4529
4534
  }
4530
- t.fillText(tt, a + m, O + W / 2);
4535
+ t.fillText(et, a + m, O + W / 2);
4531
4536
  });
4532
4537
  }
4533
4538
  t.globalAlpha = v;
@@ -4560,7 +4565,7 @@ class ci {
4560
4565
  t.font = `${l.fontWeight || 600} ${d}px "${u}", sans-serif`, t.fillStyle = c, t.textAlign = "center", t.textBaseline = "middle", t.fillText(l.text || "Toggle", 0, 0), t.restore();
4561
4566
  }
4562
4567
  renderToggle(t, i) {
4563
- var G, N, J, x, F, j, X, tt, R, O, D, q;
4568
+ var G, N, Q, x, F, tt, X, et, R, O, D, q;
4564
4569
  const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((G = i.geometry) == null ? void 0 : G.width) || 52, n = ((N = i.geometry) == null ? void 0 : N.height) || 30, a = -s / 2, r = -n / 2, h = e.checked ?? !1, f = e.cornerRadius ?? e.corner_radius ?? n / 2, l = e.toggleStyle || {}, p = l.backgroundColor || e.activeColor || "#10b981", c = l.borderColor || e.borderColor || "transparent", d = l.borderWidth ?? e.borderWidth ?? 0, u = l.knobColor || e.knobColor || "#ffffff", v = h ? p : e.inactiveColor || "#374151", b = h ? c : e.borderColor || "transparent", m = h ? d : e.borderWidth ?? 0, y = h ? u : e.knobColor || "#ffffff";
4565
4570
  e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, s, n, f);
4566
4571
  const S = this.createCanvasFill(t, v, s, n);
@@ -4574,22 +4579,22 @@ class ci {
4574
4579
  const P = this.createCanvasFill(t, y, w, w);
4575
4580
  P && (t.fillStyle = P, t.fill()), e.disabled && (t.globalAlpha *= 2);
4576
4581
  let _ = !1, E = !1;
4577
- const A = (h ? (J = l.leftLabel) == null ? void 0 : J.text : null) || ((x = e.leftLabel) == null ? void 0 : x.text) || "", W = (h ? (F = l.leftLabel) == null ? void 0 : F.color : null) || ((j = e.leftLabel) == null ? void 0 : j.color) || "#f3f4f6";
4582
+ const A = (h ? (Q = l.leftLabel) == null ? void 0 : Q.text : null) || ((x = e.leftLabel) == null ? void 0 : x.text) || "", W = (h ? (F = l.leftLabel) == null ? void 0 : F.color : null) || ((tt = e.leftLabel) == null ? void 0 : tt.color) || "#f3f4f6";
4578
4583
  if ((X = e.leftLabel) != null && X.enabled && A) {
4579
4584
  const ot = e.leftLabel;
4580
4585
  t.font = `${ot.fontWeight || 400} ${ot.fontSize || 12}px "${ot.fontFamily || "Inter"}", sans-serif`, t.fillStyle = W, t.textBaseline = "middle", t.textAlign = "right", t.fillText(A, a - (ot.gap || 8), 0), _ = !0;
4581
4586
  }
4582
- const z = (h ? (tt = l.rightLabel) == null ? void 0 : tt.text : null) || ((R = e.rightLabel) == null ? void 0 : R.text) || "", Y = (h ? (O = l.rightLabel) == null ? void 0 : O.color : null) || ((D = e.rightLabel) == null ? void 0 : D.color) || "#f3f4f6";
4587
+ const z = (h ? (et = l.rightLabel) == null ? void 0 : et.text : null) || ((R = e.rightLabel) == null ? void 0 : R.text) || "", Y = (h ? (O = l.rightLabel) == null ? void 0 : O.color : null) || ((D = e.rightLabel) == null ? void 0 : D.color) || "#f3f4f6";
4583
4588
  if ((q = e.rightLabel) != null && q.enabled && z) {
4584
4589
  const ot = e.rightLabel;
4585
4590
  t.font = `${ot.fontWeight || 400} ${ot.fontSize || 12}px "${ot.fontFamily || "Inter"}", sans-serif`, t.fillStyle = Y, t.textBaseline = "middle", t.textAlign = "left", t.fillText(z, a + s + (ot.gap || 8), 0), E = !0;
4586
4591
  }
4587
4592
  if (!_ && !E && e.label && e.label.text) {
4588
- const ot = e.label, yt = ot.fontSize || 14, bt = ot.fontWeight || 400, gt = ot.fontFamily || "Inter";
4589
- t.font = `${bt} ${yt}px "${gt}", sans-serif`, t.fillStyle = ot.color || "#f3f4f6", t.textBaseline = "middle";
4593
+ const ot = e.label, yt = ot.fontSize || 14, bt = ot.fontWeight || 400, pt = ot.fontFamily || "Inter";
4594
+ t.font = `${bt} ${yt}px "${pt}", sans-serif`, t.fillStyle = ot.color || "#f3f4f6", t.textBaseline = "middle";
4590
4595
  const Et = ot.gap || 10;
4591
- let It = 0, St = 0;
4592
- ot.position === "left" ? (t.textAlign = "right", It = a - Et, St = 0) : ot.position === "right" ? (t.textAlign = "left", It = a + s + Et, St = 0) : ot.position === "top" ? (t.textAlign = "center", It = 0, St = r - Et, t.textBaseline = "bottom") : ot.position === "bottom" ? (t.textAlign = "center", It = 0, St = r + n + Et, t.textBaseline = "top") : (t.textAlign = "left", It = a + s + Et, St = 0), t.fillText(ot.text, It, St);
4596
+ let It = 0, vt = 0;
4597
+ ot.position === "left" ? (t.textAlign = "right", It = a - Et, vt = 0) : ot.position === "right" ? (t.textAlign = "left", It = a + s + Et, vt = 0) : ot.position === "top" ? (t.textAlign = "center", It = 0, vt = r - Et, t.textBaseline = "bottom") : ot.position === "bottom" ? (t.textAlign = "center", It = 0, vt = r + n + Et, t.textBaseline = "top") : (t.textAlign = "left", It = a + s + Et, vt = 0), t.fillText(ot.text, It, vt);
4593
4598
  }
4594
4599
  }
4595
4600
  renderCheckbox(t, i) {
@@ -4784,10 +4789,10 @@ class ci {
4784
4789
  s.datasets.forEach((W, z) => {
4785
4790
  const Y = W.data[_] ?? 0;
4786
4791
  if (Y === 0) return;
4787
- const G = Y / u * M, N = Math.min(s.barWidth * d + s.barGap, P - 8), J = E - N / 2, x = A;
4792
+ const G = Y / u * M, N = Math.min(s.barWidth * d + s.barGap, P - 8), Q = E - N / 2, x = A;
4788
4793
  A += G;
4789
4794
  const F = s._resolveColor(W.color, z);
4790
- t.beginPath(), t.fillStyle = s._makeGradient(t, F, x, J, x + G, J), s._drawRoundedBar(t, x, J, G, N, z === d - 1 ? s.barCornerRadius : 0, !1), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? F : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill();
4795
+ t.beginPath(), t.fillStyle = s._makeGradient(t, F, x, Q, x + G, Q), s._drawRoundedBar(t, x, Q, G, N, z === d - 1 ? s.barCornerRadius : 0, !1), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? F : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill();
4791
4796
  });
4792
4797
  }
4793
4798
  } else {
@@ -4799,10 +4804,10 @@ class ci {
4799
4804
  s.datasets.forEach((W, z) => {
4800
4805
  const Y = W.data[_] ?? 0;
4801
4806
  if (Y === 0) return;
4802
- const G = Y / u * I, N = Math.min(s.barWidth * d + s.barGap, P - 8), J = E - N / 2, x = A - G;
4807
+ const G = Y / u * I, N = Math.min(s.barWidth * d + s.barGap, P - 8), Q = E - N / 2, x = A - G;
4803
4808
  A -= G;
4804
4809
  const F = s._resolveColor(W.color, z);
4805
- t.beginPath(), t.fillStyle = s._makeGradient(t, F, J, x, J, x + G), s._drawRoundedBar(t, J, x, N, G, z === d - 1 ? s.barCornerRadius : 0, !0), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? F : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill();
4810
+ t.beginPath(), t.fillStyle = s._makeGradient(t, F, Q, x, Q, x + G), s._drawRoundedBar(t, Q, x, N, G, z === d - 1 ? s.barCornerRadius : 0, !0), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? F : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill();
4806
4811
  });
4807
4812
  }
4808
4813
  }
@@ -4813,10 +4818,10 @@ class ci {
4813
4818
  s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = f.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[A] || "", C - 5, W), s.enableShadows && (t.shadowColor = s.shadowColor));
4814
4819
  const z = W - _ / 2;
4815
4820
  s.datasets.forEach((Y, G) => {
4816
- const N = Y.data[A] ?? 0, J = Math.abs(N / u * M);
4817
- if (J < 1) return;
4818
- const x = z + G * (s.barWidth + s.barGap), F = N >= 0 ? E : E - J, j = s._resolveColor(Y.color, G);
4819
- t.beginPath(), t.fillStyle = s._makeGradient(t, j, F, x, F + J, x), s._drawRoundedBar(t, F, x, J, s.barWidth, s.barCornerRadius, !1), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? j : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill(), s.showValueOnTop && N !== 0 && (t.font = (s.valueFontWeight || "bold") + " " + (s.valueFontSize || 10) + "px Inter, sans-serif", t.textAlign = N >= 0 ? "left" : "right", t.textBaseline = "middle", t.fillStyle = s.valueColor === "auto" ? j : s.valueColor || "#fff", t.shadowColor = "transparent", t.fillText(N.toString(), N >= 0 ? F + J + 4 : F - 4, x + s.barWidth / 2), s.enableShadows && (t.shadowColor = s.shadowColor));
4821
+ const N = Y.data[A] ?? 0, Q = Math.abs(N / u * M);
4822
+ if (Q < 1) return;
4823
+ const x = z + G * (s.barWidth + s.barGap), F = N >= 0 ? E : E - Q, tt = s._resolveColor(Y.color, G);
4824
+ t.beginPath(), t.fillStyle = s._makeGradient(t, tt, F, x, F + Q, x), s._drawRoundedBar(t, F, x, Q, s.barWidth, s.barCornerRadius, !1), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? tt : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill(), s.showValueOnTop && N !== 0 && (t.font = (s.valueFontWeight || "bold") + " " + (s.valueFontSize || 10) + "px Inter, sans-serif", t.textAlign = N >= 0 ? "left" : "right", t.textBaseline = "middle", t.fillStyle = s.valueColor === "auto" ? tt : s.valueColor || "#fff", t.shadowColor = "transparent", t.fillText(N.toString(), N >= 0 ? F + Q + 4 : F - 4, x + s.barWidth / 2), s.enableShadows && (t.shadowColor = s.shadowColor));
4820
4825
  });
4821
4826
  }
4822
4827
  } else {
@@ -4826,10 +4831,10 @@ class ci {
4826
4831
  s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "top", t.fillStyle = f.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[A] || "", W, w + I + 5), s.enableShadows && (t.shadowColor = s.shadowColor));
4827
4832
  const z = W - _ / 2;
4828
4833
  s.datasets.forEach((Y, G) => {
4829
- const N = Y.data[A] ?? 0, J = Math.abs(N / u * I);
4830
- if (J < 1) return;
4831
- const x = z + G * (s.barWidth + s.barGap), F = N >= 0 ? E - J : E, j = s._resolveColor(Y.color, G);
4832
- t.beginPath(), t.fillStyle = s._makeGradient(t, j, x, F, x, F + J), s._drawRoundedBar(t, x, F, s.barWidth, J, s.barCornerRadius, !0), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? j : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill(), s.showValueOnTop && N !== 0 && (t.font = (s.valueFontWeight || "bold") + " " + (s.valueFontSize || 10) + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = N >= 0 ? "bottom" : "top", t.fillStyle = s.valueColor === "auto" ? j : s.valueColor || "#fff", t.shadowColor = "transparent", t.fillText(N.toString(), x + s.barWidth / 2, N >= 0 ? F - 4 : F + J + 4), s.enableShadows && (t.shadowColor = s.shadowColor));
4834
+ const N = Y.data[A] ?? 0, Q = Math.abs(N / u * I);
4835
+ if (Q < 1) return;
4836
+ const x = z + G * (s.barWidth + s.barGap), F = N >= 0 ? E - Q : E, tt = s._resolveColor(Y.color, G);
4837
+ t.beginPath(), t.fillStyle = s._makeGradient(t, tt, x, F, x, F + Q), s._drawRoundedBar(t, x, F, s.barWidth, Q, s.barCornerRadius, !0), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? tt : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill(), s.showValueOnTop && N !== 0 && (t.font = (s.valueFontWeight || "bold") + " " + (s.valueFontSize || 10) + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = N >= 0 ? "bottom" : "top", t.fillStyle = s.valueColor === "auto" ? tt : s.valueColor || "#fff", t.shadowColor = "transparent", t.fillText(N.toString(), x + s.barWidth / 2, N >= 0 ? F - 4 : F + Q + 4), s.enableShadows && (t.shadowColor = s.shadowColor));
4833
4838
  });
4834
4839
  }
4835
4840
  }
@@ -5182,9 +5187,9 @@ class ci {
5182
5187
  const x = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, h);
5183
5188
  t.fill();
5184
5189
  }
5185
- const J = e.borderWidth ?? 0;
5186
- if (J > 0) {
5187
- t.strokeStyle = e.borderColor || "#cccccc", t.lineWidth = J, t.beginPath();
5190
+ const Q = e.borderWidth ?? 0;
5191
+ if (Q > 0) {
5192
+ t.strokeStyle = e.borderColor || "#cccccc", t.lineWidth = Q, t.beginPath();
5188
5193
  const x = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, h);
5189
5194
  t.stroke();
5190
5195
  }
@@ -5203,52 +5208,52 @@ class ci {
5203
5208
  const P = typeof v == "number" ? v : f === "vertical" ? v[0] : v[3];
5204
5209
  let _ = (f === "vertical" ? r : a) + u + P;
5205
5210
  if (t.textBaseline = "middle", l.forEach((G, N) => {
5206
- const J = e.listLayout || "linear", x = J === "circular" ? d : f === "vertical" ? s : d, F = J === "circular" || f === "vertical" ? c : n;
5207
- let j = 0, X = 0, tt = 0;
5208
- if (J === "circular") {
5209
- const St = l.length || 1, Xt = Math.PI * 2 / St, le = e.circularStartAngle || 0, fe = e.circularRadius || 100, et = u * 0.01 + le * Math.PI / 180, mt = N * Xt + et, Rt = a + s / 2, _t = r + n / 2;
5210
- j = Rt + Math.cos(mt) * fe - x / 2, X = _t + Math.sin(mt) * fe - F / 2, tt = mt + (e.itemRotation || 0) * Math.PI / 180;
5211
+ const Q = e.listLayout || "linear", x = Q === "circular" ? d : f === "vertical" ? s : d, F = Q === "circular" || f === "vertical" ? c : n;
5212
+ let tt = 0, X = 0, et = 0;
5213
+ if (Q === "circular") {
5214
+ const vt = l.length || 1, Yt = Math.PI * 2 / vt, se = e.circularStartAngle || 0, fe = e.circularRadius || 100, st = u * 0.01 + se * Math.PI / 180, gt = N * Yt + st, Rt = a + s / 2, Pt = r + n / 2;
5215
+ tt = Rt + Math.cos(gt) * fe - x / 2, X = Pt + Math.sin(gt) * fe - F / 2, et = gt + (e.itemRotation || 0) * Math.PI / 180;
5211
5216
  } else
5212
- j = f === "vertical" ? a : _, X = f === "vertical" ? _ : r, tt = (e.itemRotation || 0) * Math.PI / 180;
5217
+ tt = f === "vertical" ? a : _, X = f === "vertical" ? _ : r, et = (e.itemRotation || 0) * Math.PI / 180;
5213
5218
  const R = C === N, O = w === N, D = O && e.activeItemShape ? e.activeItemShape : e.itemShape || "rectangle", q = O && e.activeItemShape ? e.activeItemPath : e.itemPath || "", ot = e.itemCornerRadius || 0;
5214
- if (t.save(), tt !== 0 && (t.translate(j + x / 2, X + F / 2), t.rotate(tt), t.translate(-(j + x / 2), -(X + F / 2))), O) {
5215
- const St = this.createCanvasFill(t, m, x, F);
5216
- t.fillStyle = St || m;
5217
- const Xt = t.globalAlpha;
5218
- t.globalAlpha = Xt * 0.8, t.beginPath(), this.drawCustomShape(t, D, q, j, X, x, F, ot) || (t.rect(j, X, x, F), t.fill()), t.globalAlpha = Xt;
5219
+ if (t.save(), et !== 0 && (t.translate(tt + x / 2, X + F / 2), t.rotate(et), t.translate(-(tt + x / 2), -(X + F / 2))), O) {
5220
+ const vt = this.createCanvasFill(t, m, x, F);
5221
+ t.fillStyle = vt || m;
5222
+ const Yt = t.globalAlpha;
5223
+ t.globalAlpha = Yt * 0.8, t.beginPath(), this.drawCustomShape(t, D, q, tt, X, x, F, ot) || (t.rect(tt, X, x, F), t.fill()), t.globalAlpha = Yt;
5219
5224
  } else if (R)
5220
- t.fillStyle = b ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)", t.beginPath(), this.drawCustomShape(t, D, q, j, X, x, F, ot) || (t.rect(j, X, x, F), t.fill());
5225
+ t.fillStyle = b ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)", t.beginPath(), this.drawCustomShape(t, D, q, tt, X, x, F, ot) || (t.rect(tt, X, x, F), t.fill());
5221
5226
  else if (S !== "transparent") {
5222
- const St = this.createCanvasFill(t, S, x, F);
5223
- t.fillStyle = St || S, t.beginPath(), this.drawCustomShape(t, D, q, j, X, x, F, ot) || (t.rect(j, X, x, F), t.fill());
5227
+ const vt = this.createCanvasFill(t, S, x, F);
5228
+ t.fillStyle = vt || S, t.beginPath(), this.drawCustomShape(t, D, q, tt, X, x, F, ot) || (t.rect(tt, X, x, F), t.fill());
5224
5229
  }
5225
5230
  if (O || R) {
5226
- const St = this.createCanvasFill(t, m, f === "vertical" ? 3 : x, f === "vertical" ? F : 3);
5227
- t.fillStyle = St || m, f === "vertical" ? t.fillRect(j, X, 3, F) : t.fillRect(j, X + F - 3, x, 3);
5231
+ const vt = this.createCanvasFill(t, m, f === "vertical" ? 3 : x, f === "vertical" ? F : 3);
5232
+ t.fillStyle = vt || m, f === "vertical" ? t.fillRect(tt, X, 3, F) : t.fillRect(tt, X + F - 3, x, 3);
5228
5233
  }
5229
5234
  const yt = O ? "#ffffff" : b ? "rgba(255, 255, 255, 0.9)" : y;
5230
5235
  t.fillStyle = yt, t.font = O || R ? "600 14px Inter, sans-serif" : "400 14px Inter, sans-serif";
5231
- const bt = typeof G == "string" ? G : (G == null ? void 0 : G.label) || `Item ${N + 1}`, gt = j + (f === "vertical" ? 16 : x / 2), Et = X + F / 2;
5232
- f === "horizontal" || J === "circular" ? t.textAlign = "center" : t.textAlign = "left";
5233
- const It = J === "circular" ? j + x / 2 : gt;
5236
+ const bt = typeof G == "string" ? G : (G == null ? void 0 : G.label) || `Item ${N + 1}`, pt = tt + (f === "vertical" ? 16 : x / 2), Et = X + F / 2;
5237
+ f === "horizontal" || Q === "circular" ? t.textAlign = "center" : t.textAlign = "left";
5238
+ const It = Q === "circular" ? tt + x / 2 : pt;
5234
5239
  t.fillText(bt, It, Et), t.restore(), _ += (f === "vertical" ? c : d) + p;
5235
5240
  }), t.restore(), e.showScrollbar !== !1) {
5236
- const G = (l.length || 0) * (f === "vertical" ? c : d) + ((l.length || 0) - 1) * p, N = f === "vertical" ? n : s, J = e.listLayout || "linear", x = e.containerShape === "circle" || J === "circular";
5237
- if (G > N || J === "circular" && l.length > 0) {
5238
- const F = e.scrollbarColor || "rgba(255,255,255,0.3)", j = e.scrollbarWidth || 4;
5241
+ const G = (l.length || 0) * (f === "vertical" ? c : d) + ((l.length || 0) - 1) * p, N = f === "vertical" ? n : s, Q = e.listLayout || "linear", x = e.containerShape === "circle" || Q === "circular";
5242
+ if (G > N || Q === "circular" && l.length > 0) {
5243
+ const F = e.scrollbarColor || "rgba(255,255,255,0.3)", tt = e.scrollbarWidth || 4;
5239
5244
  if (x) {
5240
- const X = Math.min(s, n) / 2 - j / 2 - 2, tt = a + s / 2, R = r + n / 2;
5241
- if (t.strokeStyle = F, t.lineWidth = j, t.lineCap = "round", t.beginPath(), J === "circular") {
5245
+ const X = Math.min(s, n) / 2 - tt / 2 - 2, et = a + s / 2, R = r + n / 2;
5246
+ if (t.strokeStyle = F, t.lineWidth = tt, t.lineCap = "round", t.beginPath(), Q === "circular") {
5242
5247
  const O = Math.PI / 4, D = -(u * 0.01) - Math.PI / 2;
5243
- t.arc(tt, R, X, D, D + O);
5248
+ t.arc(et, R, X, D, D + O);
5244
5249
  } else {
5245
5250
  const O = Math.PI / 2, D = N / G, q = O * D, ot = -u / G * O, bt = -Math.PI / 4 + ot;
5246
- t.arc(tt, R, X, bt, bt + q);
5251
+ t.arc(et, R, X, bt, bt + q);
5247
5252
  }
5248
5253
  t.stroke();
5249
5254
  } else {
5250
- const X = N / G, tt = N * X, R = -u / G * N;
5251
- t.fillStyle = F, f === "vertical" ? t.fillRect(a + s - j - 2, r + R, j, tt) : t.fillRect(a + R, r + n - j - 2, tt, j);
5255
+ const X = N / G, et = N * X, R = -u / G * N;
5256
+ t.fillStyle = F, f === "vertical" ? t.fillRect(a + s - tt - 2, r + R, tt, et) : t.fillRect(a + R, r + n - tt - 2, et, tt);
5252
5257
  }
5253
5258
  }
5254
5259
  }
@@ -5293,18 +5298,18 @@ class ci {
5293
5298
  let T = (h === "vertical" ? I : M) + c + k;
5294
5299
  const L = e.listLayout || "linear", P = n.length || 1, _ = Math.PI * 2 / P, E = e.circularStartAngle || 0, A = e.circularRadius || 100, W = c * 0.01 + E * Math.PI / 180;
5295
5300
  for (let G = 0; G < n.length; G++) {
5296
- const N = L === "circular" ? p : h === "vertical" ? a : p, J = L === "circular" || h === "vertical" ? l : r;
5297
- let x = 0, F = 0, j = 0;
5301
+ const N = L === "circular" ? p : h === "vertical" ? a : p, Q = L === "circular" || h === "vertical" ? l : r;
5302
+ let x = 0, F = 0, tt = 0;
5298
5303
  if (L === "circular") {
5299
- const X = G * _ + W, tt = M + a / 2, R = I + r / 2;
5300
- x = tt + Math.cos(X) * A - N / 2, F = R + Math.sin(X) * A - J / 2, j = X + (e.itemRotation || 0) * Math.PI / 180;
5304
+ const X = G * _ + W, et = M + a / 2, R = I + r / 2;
5305
+ x = et + Math.cos(X) * A - N / 2, F = R + Math.sin(X) * A - Q / 2, tt = X + (e.itemRotation || 0) * Math.PI / 180;
5301
5306
  } else
5302
- x = h === "vertical" ? M : T, F = h === "vertical" ? T : I, j = (e.itemRotation || 0) * Math.PI / 180;
5303
- if (j !== 0) {
5304
- const X = x + N / 2, tt = F + J / 2, R = C - X, O = w - tt, D = -j, q = R * Math.cos(D) - O * Math.sin(D) + X, ot = R * Math.sin(D) + O * Math.cos(D) + tt;
5305
- if (q >= x && q <= x + N && ot >= F && ot <= F + J)
5307
+ x = h === "vertical" ? M : T, F = h === "vertical" ? T : I, tt = (e.itemRotation || 0) * Math.PI / 180;
5308
+ if (tt !== 0) {
5309
+ const X = x + N / 2, et = F + Q / 2, R = C - X, O = w - et, D = -tt, q = R * Math.cos(D) - O * Math.sin(D) + X, ot = R * Math.sin(D) + O * Math.cos(D) + et;
5310
+ if (q >= x && q <= x + N && ot >= F && ot <= F + Q)
5306
5311
  return G;
5307
- } else if (C >= x && C <= x + N && w >= F && w <= F + J)
5312
+ } else if (C >= x && C <= x + N && w >= F && w <= F + Q)
5308
5313
  return G;
5309
5314
  T += (h === "vertical" ? l : p) + f;
5310
5315
  }
@@ -5324,120 +5329,120 @@ class ci {
5324
5329
  if (!e.behaviors || e.behaviors.length === 0) return;
5325
5330
  const s = this.objectStates.get(e.id);
5326
5331
  s && e.behaviors.forEach((n) => {
5327
- var p, c, d, u, v, b, m, y, S, C, w, M, I, k, T, L, P, _, E, A, W, z, Y, G, N, J, x, F, j, X, tt, R, O, D, q, ot, yt, bt, gt, Et, It, St, Xt, le, fe, et, mt, Rt, _t, dt, Ft, Dt, $t, Ot, Vt, ie, me, ye, Ut, Se, Pe, Ee, Ce, Ae, xe, se, jt, ht, pt, at, B, nt, Z, Pt, xt, kt, At, Mt, $, Wt, Kt, te, Jt, ut, ct, Ct, rt, V, st, it, vt, Yt, Qt, ne, Gt, Ht, Nt, Ie, Le, Re, Oe, Fe, $e, Ye, zt, oe, we, Be, We, de, ce, he, ke, Xe, Ve, Ne, De, He;
5332
+ var p, c, d, u, v, b, m, y, S, C, w, M, I, k, T, L, P, _, E, A, W, z, Y, G, N, Q, x, F, tt, X, et, R, O, D, q, ot, yt, bt, pt, Et, It, vt, Yt, se, fe, st, gt, Rt, Pt, dt, Ft, Dt, $t, Ot, Vt, ne, me, ye, Ut, Se, Pe, Ee, Ce, Ae, xe, ie, jt, ht, mt, at, B, K, j, kt, At, Tt, xt, Mt, $, Wt, Kt, te, Jt, ut, ct, Ct, rt, V, it, nt, St, Xt, Qt, oe, Gt, Ht, Nt, Ie, Le, Re, Oe, Fe, $e, Ye, zt, ae, we, Be, We, de, ce, he, ke, Xe, Ve, Ne, De, He;
5328
5333
  if (!n.enabled) return;
5329
5334
  const a = n.startTime || 0, r = n.endTime || 1 / 0;
5330
5335
  if (this.currentTime < a || this.currentTime > r) return;
5331
5336
  const h = s.x - i, f = s.y - o, l = Math.sqrt(h * h + f * f);
5332
5337
  if (this.frameCount % 240 === 0 && Math.random() < 0.1 && this.log(`[ExodeUI] Executing ${n.type} on ${e.name}`), n.type === U.Proximity) {
5333
- const H = ((p = n.settings) == null ? void 0 : p.radius) || 300, Q = ((c = n.settings) == null ? void 0 : c.falloff) || "smooth";
5334
- let K = 0;
5335
- l < H && (Q === "linear" ? K = 1 - l / H : K = Math.pow(1 - l / H, 2)), n.sensors.forEach((ft) => {
5336
- this.applyBehaviorSensor(s, ft, K, t, n.settings, e, h, f, l);
5338
+ const H = ((p = n.settings) == null ? void 0 : p.radius) || 300, Z = ((c = n.settings) == null ? void 0 : c.falloff) || "smooth";
5339
+ let J = 0;
5340
+ l < H && (Z === "linear" ? J = 1 - l / H : J = Math.pow(1 - l / H, 2)), n.sensors.forEach((ft) => {
5341
+ this.applyBehaviorSensor(s, ft, J, t, n.settings, e, h, f, l);
5337
5342
  });
5338
5343
  } else if (n.type === U.Magnetic) {
5339
- const H = ((d = n.settings) == null ? void 0 : d.radius) || 400, Q = ((u = n.settings) == null ? void 0 : u.strength) || 0.5;
5344
+ const H = ((d = n.settings) == null ? void 0 : d.radius) || 400, Z = ((u = n.settings) == null ? void 0 : u.strength) || 0.5;
5340
5345
  if (l < H && l > 5) {
5341
- const K = 1 - l / H, ft = h * K * Q, Tt = f * K * Q;
5342
- s.x -= ft * t * 10, s.y -= Tt * t * 10;
5346
+ const J = 1 - l / H, ft = h * J * Z, _t = f * J * Z;
5347
+ s.x -= ft * t * 10, s.y -= _t * t * 10;
5343
5348
  }
5344
5349
  } else if (n.type === U.Repel) {
5345
- const H = ((v = n.settings) == null ? void 0 : v.radius) || 300, Q = ((b = n.settings) == null ? void 0 : b.strength) || 1;
5350
+ const H = ((v = n.settings) == null ? void 0 : v.radius) || 300, Z = ((b = n.settings) == null ? void 0 : b.strength) || 1;
5346
5351
  if (l < H) {
5347
- const K = Math.pow(1 - l / H, 2);
5348
- s.x += h / (l || 1) * K * 60 * Q * t * 5, s.y += f / (l || 1) * K * 60 * Q * t * 5;
5352
+ const J = Math.pow(1 - l / H, 2);
5353
+ s.x += h / (l || 1) * J * 60 * Z * t * 5, s.y += f / (l || 1) * J * 60 * Z * t * 5;
5349
5354
  }
5350
5355
  } else if (n.type === U.Orbit) {
5351
- const H = ((m = n.settings) == null ? void 0 : m.speed) || 1, Q = ((y = n.settings) == null ? void 0 : y.radius) || 30, K = this.currentTime * H * Math.PI * 2;
5352
- s.x += Math.cos(K) * Q * t * 5, s.y += Math.sin(K) * Q * t * 5, s.rotation += 2 * t * 5;
5356
+ const H = ((m = n.settings) == null ? void 0 : m.speed) || 1, Z = ((y = n.settings) == null ? void 0 : y.radius) || 30, J = this.currentTime * H * Math.PI * 2;
5357
+ s.x += Math.cos(J) * Z * t * 5, s.y += Math.sin(J) * Z * t * 5, s.rotation += 2 * t * 5;
5353
5358
  } else if (n.type === U.Vortex) {
5354
- const H = ((S = n.settings) == null ? void 0 : S.radius) || 400, Q = ((C = n.settings) == null ? void 0 : C.speed) || 2, K = ((w = n.settings) == null ? void 0 : w.strength) || 1;
5359
+ const H = ((S = n.settings) == null ? void 0 : S.radius) || 400, Z = ((C = n.settings) == null ? void 0 : C.speed) || 2, J = ((w = n.settings) == null ? void 0 : w.strength) || 1;
5355
5360
  if (l < H) {
5356
- const ft = Math.pow(1 - l / H, 1.5), Tt = this.currentTime * Q * Math.PI * 2, Lt = Math.cos(Tt) * 30 - h * 0.4, Bt = Math.sin(Tt) * 30 - f * 0.4;
5357
- s.x += Lt * ft * K * t * 5, s.y += Bt * ft * K * t * 5, s.rotation += 5 * ft * K * t * 5, s.scale_x *= 1 - ft * 0.1 * K * t, s.scale_y *= 1 - ft * 0.1 * K * t;
5361
+ const ft = Math.pow(1 - l / H, 1.5), _t = this.currentTime * Z * Math.PI * 2, Lt = Math.cos(_t) * 30 - h * 0.4, Bt = Math.sin(_t) * 30 - f * 0.4;
5362
+ s.x += Lt * ft * J * t * 5, s.y += Bt * ft * J * t * 5, s.rotation += 5 * ft * J * t * 5, s.scale_x *= 1 - ft * 0.1 * J * t, s.scale_y *= 1 - ft * 0.1 * J * t;
5358
5363
  }
5359
5364
  } else if (n.type === U.Fluid) {
5360
- const H = ((M = n.settings) == null ? void 0 : M.radius) || 300, Q = ((I = n.settings) == null ? void 0 : I.strength) || 1;
5365
+ const H = ((M = n.settings) == null ? void 0 : M.radius) || 300, Z = ((I = n.settings) == null ? void 0 : I.strength) || 1;
5361
5366
  if (l < H) {
5362
- const K = Math.pow(1 - l / H, 1.2), ft = h / (l || 1) * K * 1.2 * Q, Tt = f / (l || 1) * K * 1.2 * Q;
5363
- s.x += ft * 10 * t * 5, s.y += Tt * 10 * t * 5, s.scale_x *= 1 + K * 0.3 * Q * t, s.scale_y *= 1 + K * 0.3 * Q * t;
5367
+ const J = Math.pow(1 - l / H, 1.2), ft = h / (l || 1) * J * 1.2 * Z, _t = f / (l || 1) * J * 1.2 * Z;
5368
+ s.x += ft * 10 * t * 5, s.y += _t * 10 * t * 5, s.scale_x *= 1 + J * 0.3 * Z * t, s.scale_y *= 1 + J * 0.3 * Z * t;
5364
5369
  }
5365
5370
  } else if (n.type === U.Elastic) {
5366
- const H = ((k = n.settings) == null ? void 0 : k.radius) || 300, Q = ((T = n.settings) == null ? void 0 : T.strength) || 1;
5371
+ const H = ((k = n.settings) == null ? void 0 : k.radius) || 300, Z = ((T = n.settings) == null ? void 0 : T.strength) || 1;
5367
5372
  if (l < H) {
5368
- const K = 1 - l / H;
5369
- s.scale_x *= 1 + K * 0.4 * Q * t, s.scale_y *= 1 + K * 0.4 * Q * t;
5373
+ const J = 1 - l / H;
5374
+ s.scale_x *= 1 + J * 0.4 * Z * t, s.scale_y *= 1 + J * 0.4 * Z * t;
5370
5375
  }
5371
5376
  } else if (n.type === U.Holographic) {
5372
- const H = s.x - this.canvasWidth / 2, Q = s.y - this.canvasHeight / 2, K = ((L = n.settings) == null ? void 0 : L.factor) || 25;
5373
- if (s.x -= H / 1e3 * K * t * 5, s.y -= Q / 1e3 * K * t * 5, s.style) {
5377
+ const H = s.x - this.canvasWidth / 2, Z = s.y - this.canvasHeight / 2, J = ((L = n.settings) == null ? void 0 : L.factor) || 25;
5378
+ if (s.x -= H / 1e3 * J * t * 5, s.y -= Z / 1e3 * J * t * 5, s.style) {
5374
5379
  const ft = 1 - Math.min(1, l / 400);
5375
5380
  s.style.exposure = (s.style.exposure || 1) + ft * 0.5 * t;
5376
5381
  }
5377
5382
  } else if (n.type === U.Sticky) {
5378
- const H = ((P = n.settings) == null ? void 0 : P.radius) || 80, Q = ((_ = n.settings) == null ? void 0 : _.strength) || 1;
5383
+ const H = ((P = n.settings) == null ? void 0 : P.radius) || 80, Z = ((_ = n.settings) == null ? void 0 : _.strength) || 1;
5379
5384
  if (l < H) {
5380
- const K = Math.pow(1 - l / H, 2);
5381
- s.x -= h * K * Q * t * 10, s.y -= f * K * Q * t * 10, s.scale_x *= 1 - K * 0.1 * Q * t, s.scale_y *= 1 - K * 0.1 * Q * t;
5385
+ const J = Math.pow(1 - l / H, 2);
5386
+ s.x -= h * J * Z * t * 10, s.y -= f * J * Z * t * 10, s.scale_x *= 1 - J * 0.1 * Z * t, s.scale_y *= 1 - J * 0.1 * Z * t;
5382
5387
  }
5383
5388
  } else if (n.type === U.Dilation) {
5384
- const H = ((E = n.settings) == null ? void 0 : E.size) || 120, Q = ((A = n.settings) == null ? void 0 : A.strength) || 1;
5389
+ const H = ((E = n.settings) == null ? void 0 : E.size) || 120, Z = ((A = n.settings) == null ? void 0 : A.strength) || 1;
5385
5390
  if (l < H) {
5386
- const K = 1 - l / H;
5387
- s.scale_x *= 1 + K * 0.5 * Q * t, s.scale_y *= 1 + K * 0.5 * Q * t;
5391
+ const J = 1 - l / H;
5392
+ s.scale_x *= 1 + J * 0.5 * Z * t, s.scale_y *= 1 + J * 0.5 * Z * t;
5388
5393
  }
5389
5394
  } else if (n.type === U.Parallax) {
5390
- const H = ((W = n.settings) == null ? void 0 : W.factor) || 15, Q = ((z = n.settings) == null ? void 0 : z.strength) || 1, K = this.canvasWidth / 2, ft = this.canvasHeight / 2, Tt = this._lastPointerPos || { x: K, y: ft }, Lt = (Tt.x - K) / K, Bt = (Tt.y - ft) / ft, ee = (((Y = e.transform) == null ? void 0 : Y.x) ?? 0) + Lt * H * Q, ue = (((G = e.transform) == null ? void 0 : G.y) ?? 0) + Bt * H * Q, Te = (((N = e.transform) == null ? void 0 : N.rotate_x) ?? 0) - Bt * H * 1.5 * Q, ae = (((J = e.transform) == null ? void 0 : J.rotate_y) ?? 0) + Lt * H * 1.5 * Q, be = Math.min(1, 10 * t);
5391
- s.x = this.lerp(s.x ?? ((x = e.transform) == null ? void 0 : x.x) ?? 0, ee, be), s.y = this.lerp(s.y ?? ((F = e.transform) == null ? void 0 : F.y) ?? 0, ue, be), s.rotate_x = this.lerp(s.rotate_x ?? ((j = e.transform) == null ? void 0 : j.rotate_x) ?? 0, Te, be), s.rotate_y = this.lerp(s.rotate_y ?? ((X = e.transform) == null ? void 0 : X.rotate_y) ?? 0, ae, be);
5395
+ const H = ((W = n.settings) == null ? void 0 : W.factor) || 15, Z = ((z = n.settings) == null ? void 0 : z.strength) || 1, J = this.canvasWidth / 2, ft = this.canvasHeight / 2, _t = this._lastPointerPos || { x: J, y: ft }, Lt = (_t.x - J) / J, Bt = (_t.y - ft) / ft, ee = (((Y = e.transform) == null ? void 0 : Y.x) ?? 0) + Lt * H * Z, ue = (((G = e.transform) == null ? void 0 : G.y) ?? 0) + Bt * H * Z, Te = (((N = e.transform) == null ? void 0 : N.rotate_x) ?? 0) - Bt * H * 1.5 * Z, re = (((Q = e.transform) == null ? void 0 : Q.rotate_y) ?? 0) + Lt * H * 1.5 * Z, be = Math.min(1, 10 * t);
5396
+ s.x = this.lerp(s.x ?? ((x = e.transform) == null ? void 0 : x.x) ?? 0, ee, be), s.y = this.lerp(s.y ?? ((F = e.transform) == null ? void 0 : F.y) ?? 0, ue, be), s.rotate_x = this.lerp(s.rotate_x ?? ((tt = e.transform) == null ? void 0 : tt.rotate_x) ?? 0, Te, be), s.rotate_y = this.lerp(s.rotate_y ?? ((X = e.transform) == null ? void 0 : X.rotate_y) ?? 0, re, be);
5392
5397
  } else if (n.type === U.Fold) {
5393
5398
  if (l < 300) {
5394
- const H = 1 - l / 300, Q = (h > 0 ? -1 : 1) * H * 10, K = 1 - H * 0.1, ft = f / 300 * H * 20, Tt = -(h / 300) * H * 20, Lt = Math.min(1, 10 * t);
5395
- s.skew_x = this.lerp(s.skew_x ?? ((tt = e.transform) == null ? void 0 : tt.skew_x) ?? 0, Q, Lt), s.scale_y = this.lerp(s.scale_y ?? ((R = e.transform) == null ? void 0 : R.scale_y) ?? 1, (((O = e.transform) == null ? void 0 : O.scale_y) ?? 1) * K, Lt), s.rotate_x = this.lerp(s.rotate_x ?? ((D = e.transform) == null ? void 0 : D.rotate_x) ?? 0, ft, Lt), s.rotate_y = this.lerp(s.rotate_y ?? ((q = e.transform) == null ? void 0 : q.rotate_y) ?? 0, Tt, Lt), s.style = s.style || { ...e.style }, s.style.artEffect = { enabled: !0, type: "fold_overlay", intensity: ((ot = n.settings) == null ? void 0 : ot.opacity) ?? 0.5 };
5399
+ const H = 1 - l / 300, Z = (h > 0 ? -1 : 1) * H * 10, J = 1 - H * 0.1, ft = f / 300 * H * 20, _t = -(h / 300) * H * 20, Lt = Math.min(1, 10 * t);
5400
+ s.skew_x = this.lerp(s.skew_x ?? ((et = e.transform) == null ? void 0 : et.skew_x) ?? 0, Z, Lt), s.scale_y = this.lerp(s.scale_y ?? ((R = e.transform) == null ? void 0 : R.scale_y) ?? 1, (((O = e.transform) == null ? void 0 : O.scale_y) ?? 1) * J, Lt), s.rotate_x = this.lerp(s.rotate_x ?? ((D = e.transform) == null ? void 0 : D.rotate_x) ?? 0, ft, Lt), s.rotate_y = this.lerp(s.rotate_y ?? ((q = e.transform) == null ? void 0 : q.rotate_y) ?? 0, _t, Lt), s.style = s.style || { ...e.style }, s.style.artEffect = { enabled: !0, type: "fold_overlay", intensity: ((ot = n.settings) == null ? void 0 : ot.opacity) ?? 0.5 };
5396
5401
  }
5397
5402
  } else if (n.type === U.Crumple) {
5398
5403
  if (l < 300) {
5399
- const H = 1 - l / 300, Q = H * (Math.random() - 0.5) * 5, K = H * (Math.random() - 0.5) * 0.05, ft = Math.min(1, 15 * t);
5400
- s.skew_x = this.lerp(s.skew_x ?? ((yt = e.transform) == null ? void 0 : yt.skew_x) ?? 0, Q, ft), s.scale_x = this.lerp(s.scale_x ?? ((bt = e.transform) == null ? void 0 : bt.scale_x) ?? 1, (((gt = e.transform) == null ? void 0 : gt.scale_x) ?? 1) * (1 + K), ft), s.scale_y = this.lerp(s.scale_y ?? ((Et = e.transform) == null ? void 0 : Et.scale_y) ?? 1, (((It = e.transform) == null ? void 0 : It.scale_y) ?? 1) * (1 + K), ft), s.style = s.style || { ...e.style }, s.style.artEffect = { enabled: !0, type: "crumple_overlay", intensity: ((St = n.settings) == null ? void 0 : St.intensity) ?? 1, scale: ((Xt = n.settings) == null ? void 0 : Xt.scale) ?? 2 };
5404
+ const H = 1 - l / 300, Z = H * (Math.random() - 0.5) * 5, J = H * (Math.random() - 0.5) * 0.05, ft = Math.min(1, 15 * t);
5405
+ s.skew_x = this.lerp(s.skew_x ?? ((yt = e.transform) == null ? void 0 : yt.skew_x) ?? 0, Z, ft), s.scale_x = this.lerp(s.scale_x ?? ((bt = e.transform) == null ? void 0 : bt.scale_x) ?? 1, (((pt = e.transform) == null ? void 0 : pt.scale_x) ?? 1) * (1 + J), ft), s.scale_y = this.lerp(s.scale_y ?? ((Et = e.transform) == null ? void 0 : Et.scale_y) ?? 1, (((It = e.transform) == null ? void 0 : It.scale_y) ?? 1) * (1 + J), ft), s.style = s.style || { ...e.style }, s.style.artEffect = { enabled: !0, type: "crumple_overlay", intensity: ((vt = n.settings) == null ? void 0 : vt.intensity) ?? 1, scale: ((Yt = n.settings) == null ? void 0 : Yt.scale) ?? 2 };
5401
5406
  }
5402
5407
  } else if (n.type === U.Squash) {
5403
- const H = ((le = n.settings) == null ? void 0 : le.strength) || 0.8;
5404
- l < (e.width || 100) && this.isMouseDown ? (s.scale_y = this.lerp(s.scale_y ?? 1, (((fe = e.transform) == null ? void 0 : fe.scale_y) ?? 1) * H, 0.3), s.scale_x = this.lerp(s.scale_x ?? 1, (((et = e.transform) == null ? void 0 : et.scale_x) ?? 1) * (1 + (1 - H) * 0.4), 0.3)) : (s.scale_y = this.lerp(s.scale_y ?? 1, ((mt = e.transform) == null ? void 0 : mt.scale_y) ?? 1, 0.2), s.scale_x = this.lerp(s.scale_x ?? 1, ((Rt = e.transform) == null ? void 0 : Rt.scale_x) ?? 1, 0.2));
5408
+ const H = ((se = n.settings) == null ? void 0 : se.strength) || 0.8;
5409
+ l < (e.width || 100) && this.isMouseDown ? (s.scale_y = this.lerp(s.scale_y ?? 1, (((fe = e.transform) == null ? void 0 : fe.scale_y) ?? 1) * H, 0.3), s.scale_x = this.lerp(s.scale_x ?? 1, (((st = e.transform) == null ? void 0 : st.scale_x) ?? 1) * (1 + (1 - H) * 0.4), 0.3)) : (s.scale_y = this.lerp(s.scale_y ?? 1, ((gt = e.transform) == null ? void 0 : gt.scale_y) ?? 1, 0.2), s.scale_x = this.lerp(s.scale_x ?? 1, ((Rt = e.transform) == null ? void 0 : Rt.scale_x) ?? 1, 0.2));
5405
5410
  } else if (n.type === U.TextCounter) {
5406
- const H = ((_t = n.settings) == null ? void 0 : _t.duration) || 2, Q = ((dt = n.settings) == null ? void 0 : dt.from) || 0, K = ((Ft = n.settings) == null ? void 0 : Ft.to) || 100;
5411
+ const H = ((Pt = n.settings) == null ? void 0 : Pt.duration) || 2, Z = ((dt = n.settings) == null ? void 0 : dt.from) || 0, J = ((Ft = n.settings) == null ? void 0 : Ft.to) || 100;
5407
5412
  n._runtimeStart === void 0 && (n._runtimeStart = this.currentTime);
5408
- const ft = this.currentTime - n._runtimeStart, Tt = Math.min(1, ft / H), Lt = Math.floor(Q + (K - Q) * Tt);
5413
+ const ft = this.currentTime - n._runtimeStart, _t = Math.min(1, ft / H), Lt = Math.floor(Z + (J - Z) * _t);
5409
5414
  if (((Dt = e.geometry) == null ? void 0 : Dt.type) === "Text") {
5410
5415
  const Bt = (($t = n.settings) == null ? void 0 : $t.prefix) || "", ee = ((Ot = n.settings) == null ? void 0 : Ot.suffix) || "";
5411
5416
  s.geometry || (s.geometry = { ...e.geometry }), s.geometry.text = `${Bt}${Lt}${ee}`;
5412
5417
  }
5413
5418
  } else if (n.type === U.Spotlight) {
5414
- const H = ((Vt = n.settings) == null ? void 0 : Vt.radius) || 250, Q = ((ie = n.settings) == null ? void 0 : ie.strength) || 1.5;
5419
+ const H = ((Vt = n.settings) == null ? void 0 : Vt.radius) || 250, Z = ((ne = n.settings) == null ? void 0 : ne.strength) || 1.5;
5415
5420
  if (l < H) {
5416
- const K = Math.pow(1 - l / H, 2);
5417
- s.style || (s.style = { ...e.style }), s.style.adjustments || (s.style.adjustments = { ...(me = e.style) == null ? void 0 : me.adjustments }), s.style.adjustments.exposure = (((Ut = (ye = e.style) == null ? void 0 : ye.adjustments) == null ? void 0 : Ut.exposure) || 0) + K * Q * 50;
5421
+ const J = Math.pow(1 - l / H, 2);
5422
+ s.style || (s.style = { ...e.style }), s.style.adjustments || (s.style.adjustments = { ...(me = e.style) == null ? void 0 : me.adjustments }), s.style.adjustments.exposure = (((Ut = (ye = e.style) == null ? void 0 : ye.adjustments) == null ? void 0 : Ut.exposure) || 0) + J * Z * 50;
5418
5423
  } else
5419
5424
  (Se = s.style) != null && Se.adjustments && (s.style.adjustments.exposure = this.lerp(s.style.adjustments.exposure || 0, ((Ee = (Pe = e.style) == null ? void 0 : Pe.adjustments) == null ? void 0 : Ee.exposure) || 0, 0.1));
5420
5425
  } else if (n.type === U.Noise || n.type === U.Float) {
5421
- const H = (((Ce = n.settings) == null ? void 0 : Ce.frequency) || ((Ae = n.settings) == null ? void 0 : Ae.speed) || 1) * 2e-3, Q = (((xe = n.settings) == null ? void 0 : xe.amplitude) || ((se = n.settings) == null ? void 0 : se.range) || 50) * (((jt = n.settings) == null ? void 0 : jt.strength) || 1), K = Date.now();
5422
- s.x += Math.sin(K * H) * Q * t, s.y += Math.cos(K * H * 0.8) * Q * t, s.rotation += Math.sin(K * H * 0.5) * 5 * t;
5426
+ const H = (((Ce = n.settings) == null ? void 0 : Ce.frequency) || ((Ae = n.settings) == null ? void 0 : Ae.speed) || 1) * 2e-3, Z = (((xe = n.settings) == null ? void 0 : xe.amplitude) || ((ie = n.settings) == null ? void 0 : ie.range) || 50) * (((jt = n.settings) == null ? void 0 : jt.strength) || 1), J = Date.now();
5427
+ s.x += Math.sin(J * H) * Z * t, s.y += Math.cos(J * H * 0.8) * Z * t, s.rotation += Math.sin(J * H * 0.5) * 5 * t;
5423
5428
  } else if (n.type === U.Pulse) {
5424
- const H = (((ht = n.settings) == null ? void 0 : ht.speed) || 1) * 5e-3, Q = (((pt = n.settings) == null ? void 0 : pt.scale) || 1.2) - 1, K = Math.sin(Date.now() * H), ft = ((at = n.settings) == null ? void 0 : at.strength) || 1;
5425
- s.scale_x *= 1 + K * Q * ft * t, s.scale_y *= 1 + K * Q * ft * t, s.style && (s.style.exposure = (s.style.exposure || 1) + Math.max(0, K) * 0.1 * ft * t);
5429
+ const H = (((ht = n.settings) == null ? void 0 : ht.speed) || 1) * 5e-3, Z = (((mt = n.settings) == null ? void 0 : mt.scale) || 1.2) - 1, J = Math.sin(Date.now() * H), ft = ((at = n.settings) == null ? void 0 : at.strength) || 1;
5430
+ s.scale_x *= 1 + J * Z * ft * t, s.scale_y *= 1 + J * Z * ft * t, s.style && (s.style.exposure = (s.style.exposure || 1) + Math.max(0, J) * 0.1 * ft * t);
5426
5431
  } else if (n.type === U.Draggable) {
5427
- const H = ((B = n.settings) == null ? void 0 : B.radius) || 150, Q = this.draggingBehaviors.has(e.id);
5428
- if (l < H || Q) {
5429
- const K = ((nt = n.settings) == null ? void 0 : nt.strength) || 1, ft = Q ? 1 : Math.max(0, 1 - l / H);
5430
- this.applyBehaviorSensor(s, Zt.PositionX, ft * K, t, n.settings), this.applyBehaviorSensor(s, Zt.PositionY, ft * K, t, n.settings);
5432
+ const H = ((B = n.settings) == null ? void 0 : B.radius) || 150, Z = this.draggingBehaviors.has(e.id);
5433
+ if (l < H || Z) {
5434
+ const J = ((K = n.settings) == null ? void 0 : K.strength) || 1, ft = Z ? 1 : Math.max(0, 1 - l / H);
5435
+ this.applyBehaviorSensor(s, Zt.PositionX, ft * J, t, n.settings), this.applyBehaviorSensor(s, Zt.PositionY, ft * J, t, n.settings);
5431
5436
  }
5432
5437
  } else if (n.type === U.Scroll) {
5433
- const H = ((Z = n.settings) == null ? void 0 : Z.axis) || "vertical", Q = ((Pt = n.settings) == null ? void 0 : Pt.factor) || 0.5, K = ((xt = n.settings) == null ? void 0 : xt.strength) || 1, ft = ((kt = n.settings) == null ? void 0 : kt.scaleFactor) || 0;
5434
- (H === "vertical" || H === "both") && (s.y += this.scrollOffset.y * Q * K * t), (H === "horizontal" || H === "both") && (s.x += this.scrollOffset.x * Q * K * t), ft !== 0 && (s.scale_x *= 1 + this.scrollOffset.y * ft * t, s.scale_y *= 1 + this.scrollOffset.y * ft * t);
5438
+ const H = ((j = n.settings) == null ? void 0 : j.axis) || "vertical", Z = ((kt = n.settings) == null ? void 0 : kt.factor) || 0.5, J = ((At = n.settings) == null ? void 0 : At.strength) || 1, ft = ((Tt = n.settings) == null ? void 0 : Tt.scaleFactor) || 0;
5439
+ (H === "vertical" || H === "both") && (s.y += this.scrollOffset.y * Z * J * t), (H === "horizontal" || H === "both") && (s.x += this.scrollOffset.x * Z * J * t), ft !== 0 && (s.scale_x *= 1 + this.scrollOffset.y * ft * t, s.scale_y *= 1 + this.scrollOffset.y * ft * t);
5435
5440
  } else if (n.type === U.LookAt) {
5436
- const H = ((At = n.settings) == null ? void 0 : At.factor) || 1, Q = ((Mt = n.settings) == null ? void 0 : Mt.strength) || 1, K = Math.atan2(-f, -h) * (180 / Math.PI), ft = s.rotation, Tt = (K - ft + 180) % 360 - 180;
5437
- s.rotation += Tt * H * Q * t * 10;
5441
+ const H = ((xt = n.settings) == null ? void 0 : xt.factor) || 1, Z = ((Mt = n.settings) == null ? void 0 : Mt.strength) || 1, J = Math.atan2(-f, -h) * (180 / Math.PI), ft = s.rotation, _t = (J - ft + 180) % 360 - 180;
5442
+ s.rotation += _t * H * Z * t * 10;
5438
5443
  } else if (n.type === U.Scan) {
5439
- const H = ((($ = n.settings) == null ? void 0 : $.speed) || 1) * 4e-3, Q = ((Wt = n.settings) == null ? void 0 : Wt.strength) || 1, K = (Math.sin(Date.now() * H) + 1) / 2;
5440
- s.style && (s.style.exposure = (s.style.exposure || 1) + K * Q * t * 5), s.x += (K - 0.5) * 20 * Q * t;
5444
+ const H = ((($ = n.settings) == null ? void 0 : $.speed) || 1) * 4e-3, Z = ((Wt = n.settings) == null ? void 0 : Wt.strength) || 1, J = (Math.sin(Date.now() * H) + 1) / 2;
5445
+ s.style && (s.style.exposure = (s.style.exposure || 1) + J * Z * t * 5), s.x += (J - 0.5) * 20 * Z * t;
5441
5446
  } else if (n.type === U.Glint)
5442
5447
  s.style = s.style || { ...e.style }, s.style.artEffect = {
5443
5448
  enabled: !0,
@@ -5445,18 +5450,18 @@ class ci {
5445
5450
  intensity: ((Kt = n.settings) == null ? void 0 : Kt.strength) ?? 0.8
5446
5451
  };
5447
5452
  else if (n.type === U.Ratchet) {
5448
- const H = ((te = n.settings) == null ? void 0 : te.steps) || 12, Q = (((Jt = n.settings) == null ? void 0 : Jt.speed) || 1) * 30, K = Math.floor(s.rotation / (360 / H)) * (360 / H);
5449
- s.rotation = this.lerp(s.rotation, K + Q * t, 0.1);
5453
+ const H = ((te = n.settings) == null ? void 0 : te.steps) || 12, Z = (((Jt = n.settings) == null ? void 0 : Jt.speed) || 1) * 30, J = Math.floor(s.rotation / (360 / H)) * (360 / H);
5454
+ s.rotation = this.lerp(s.rotation, J + Z * t, 0.1);
5450
5455
  } else if (n.type === U.Jitter && l < 300) {
5451
- const H = ((ut = n.settings) == null ? void 0 : ut.strength) || 1, Q = (((ct = n.settings) == null ? void 0 : ct.intensity) || 5) * H;
5452
- s.x += (Math.random() - 0.5) * Q * t * 60, s.y += (Math.random() - 0.5) * Q * t * 60, s.rotation += (Math.random() - 0.5) * Q * t * 120;
5456
+ const H = ((ut = n.settings) == null ? void 0 : ut.strength) || 1, Z = (((ct = n.settings) == null ? void 0 : ct.intensity) || 5) * H;
5457
+ s.x += (Math.random() - 0.5) * Z * t * 60, s.y += (Math.random() - 0.5) * Z * t * 60, s.rotation += (Math.random() - 0.5) * Z * t * 120;
5453
5458
  } else if (n.type === U.Follower) {
5454
5459
  const H = (Ct = n.settings) == null ? void 0 : Ct.targetId;
5455
5460
  if (H) {
5456
- const Q = this.objectStates.get(H);
5457
- if (Q) {
5458
- const K = ((rt = n.settings) == null ? void 0 : rt.stiffness) || 0.1, ft = Q.x - s.x, Tt = Q.y - s.y;
5459
- s.x += ft * K * t * 60, s.y += Tt * K * t * 60;
5461
+ const Z = this.objectStates.get(H);
5462
+ if (Z) {
5463
+ const J = ((rt = n.settings) == null ? void 0 : rt.stiffness) || 0.1, ft = Z.x - s.x, _t = Z.y - s.y;
5464
+ s.x += ft * J * t * 60, s.y += _t * J * t * 60;
5460
5465
  }
5461
5466
  }
5462
5467
  } else if (n.type === U.Wrap)
@@ -5465,55 +5470,55 @@ class ci {
5465
5470
  const H = ((V = n.settings) == null ? void 0 : V.strength) || 9.8;
5466
5471
  s.y += H * t * 10;
5467
5472
  } else if (n.type === U.Velocity) {
5468
- const H = ((st = n.settings) == null ? void 0 : st.vx) || 0, Q = ((it = n.settings) == null ? void 0 : it.vy) || 0;
5469
- s.x += H * t * 10, s.y += Q * t * 10;
5473
+ const H = ((it = n.settings) == null ? void 0 : it.vx) || 0, Z = ((nt = n.settings) == null ? void 0 : nt.vy) || 0;
5474
+ s.x += H * t * 10, s.y += Z * t * 10;
5470
5475
  } else if (n.type === U.Shear) {
5471
- const H = ((vt = n.settings) == null ? void 0 : vt.strength) || 1, Q = ((Yt = n.settings) == null ? void 0 : Yt.radius) || 300;
5472
- if (l < Q) {
5473
- const K = 1 - l / Q;
5474
- s.skew_x = this.lerp(s.skew_x || 0, (((Qt = e.transform) == null ? void 0 : Qt.skew_x) || 0) + K * H * 30, 0.1);
5476
+ const H = ((St = n.settings) == null ? void 0 : St.strength) || 1, Z = ((Xt = n.settings) == null ? void 0 : Xt.radius) || 300;
5477
+ if (l < Z) {
5478
+ const J = 1 - l / Z;
5479
+ s.skew_x = this.lerp(s.skew_x || 0, (((Qt = e.transform) == null ? void 0 : Qt.skew_x) || 0) + J * H * 30, 0.1);
5475
5480
  } else
5476
- s.skew_x = this.lerp(s.skew_x || 0, ((ne = e.transform) == null ? void 0 : ne.skew_x) || 0, 0.05);
5481
+ s.skew_x = this.lerp(s.skew_x || 0, ((oe = e.transform) == null ? void 0 : oe.skew_x) || 0, 0.05);
5477
5482
  } else if (n.type === U.Lens) {
5478
- const H = ((Gt = n.settings) == null ? void 0 : Gt.radius) || 200, Q = ((Ht = n.settings) == null ? void 0 : Ht.strength) || 0.5;
5483
+ const H = ((Gt = n.settings) == null ? void 0 : Gt.radius) || 200, Z = ((Ht = n.settings) == null ? void 0 : Ht.strength) || 0.5;
5479
5484
  if (l < H) {
5480
- const K = Math.pow(1 - l / H, 2);
5481
- s.scale_x = this.lerp(s.scale_x ?? 1, (((Nt = e.transform) == null ? void 0 : Nt.scale_x) ?? 1) * (1 + K * Q), 0.2), s.scale_y = this.lerp(s.scale_y ?? 1, (((Ie = e.transform) == null ? void 0 : Ie.scale_y) ?? 1) * (1 + K * Q), 0.2);
5485
+ const J = Math.pow(1 - l / H, 2);
5486
+ s.scale_x = this.lerp(s.scale_x ?? 1, (((Nt = e.transform) == null ? void 0 : Nt.scale_x) ?? 1) * (1 + J * Z), 0.2), s.scale_y = this.lerp(s.scale_y ?? 1, (((Ie = e.transform) == null ? void 0 : Ie.scale_y) ?? 1) * (1 + J * Z), 0.2);
5482
5487
  } else
5483
5488
  s.scale_x = this.lerp(s.scale_x ?? 1, ((Le = e.transform) == null ? void 0 : Le.scale_x) ?? 1, 0.1), s.scale_y = this.lerp(s.scale_y ?? 1, ((Re = e.transform) == null ? void 0 : Re.scale_y) ?? 1, 0.1);
5484
5489
  } else if (n.type === U.LayoutAnimation) {
5485
- const H = ((Oe = n.settings) == null ? void 0 : Oe.watchProperties) || ["x", "y", "scale_x", "scale_y", "opacity", "rotation"], Q = ((Fe = n.settings) == null ? void 0 : Fe.duration) || 0.3;
5490
+ const H = ((Oe = n.settings) == null ? void 0 : Oe.watchProperties) || ["x", "y", "scale_x", "scale_y", "opacity", "rotation"], Z = ((Fe = n.settings) == null ? void 0 : Fe.duration) || 0.3;
5486
5491
  this._layoutAnimCache.has(e.id) || this._layoutAnimCache.set(e.id, /* @__PURE__ */ new Map());
5487
- const K = this._layoutAnimCache.get(e.id);
5492
+ const J = this._layoutAnimCache.get(e.id);
5488
5493
  for (const ft of H) {
5489
- const Tt = this.getObjectProperty(s, e, ft);
5490
- if (Tt === void 0) continue;
5491
- const Lt = K.get(ft);
5494
+ const _t = this.getObjectProperty(s, e, ft);
5495
+ if (_t === void 0) continue;
5496
+ const Lt = J.get(ft);
5492
5497
  if (!Lt)
5493
- K.set(ft, {
5494
- from: Tt,
5495
- to: Tt,
5498
+ J.set(ft, {
5499
+ from: _t,
5500
+ to: _t,
5496
5501
  startTime: this.currentTime,
5497
5502
  duration: 0
5498
5503
  });
5499
- else if (Lt.to !== Tt) {
5504
+ else if (Lt.to !== _t) {
5500
5505
  const ee = this.getObjectProperty(s, e, ft);
5501
- K.set(ft, {
5506
+ J.set(ft, {
5502
5507
  from: ee ?? Lt.from,
5503
- to: Tt,
5508
+ to: _t,
5504
5509
  startTime: this.currentTime,
5505
- duration: (($e = n.settings) == null ? void 0 : $e.duration) ?? Q
5510
+ duration: (($e = n.settings) == null ? void 0 : $e.duration) ?? Z
5506
5511
  });
5507
5512
  }
5508
- const Bt = K.get(ft);
5513
+ const Bt = J.get(ft);
5509
5514
  if (Bt.duration > 0 && Bt.from !== Bt.to) {
5510
- const ee = this.currentTime - Bt.startTime, ue = Math.min(1, ee / Bt.duration), Te = this.applyEasing(ue, ((Ye = n.settings) == null ? void 0 : Ye.easing) || "easeOutCubic"), ae = Bt.from + (Bt.to - Bt.from) * Te;
5511
- this.setObjectProperty(s, e, ft, ae);
5515
+ const ee = this.currentTime - Bt.startTime, ue = Math.min(1, ee / Bt.duration), Te = this.applyEasing(ue, ((Ye = n.settings) == null ? void 0 : Ye.easing) || "easeOutCubic"), re = Bt.from + (Bt.to - Bt.from) * Te;
5516
+ this.setObjectProperty(s, e, ft, re);
5512
5517
  }
5513
5518
  }
5514
5519
  } else if (n.type === U.StateReactive) {
5515
5520
  this._layoutAnimCache.has(e.id) || this._layoutAnimCache.set(e.id, /* @__PURE__ */ new Map());
5516
- const H = this._layoutAnimCache.get(e.id), Q = ((zt = n.settings) == null ? void 0 : zt.defaultDuration) || 0.3, K = [
5521
+ const H = this._layoutAnimCache.get(e.id), Z = ((zt = n.settings) == null ? void 0 : zt.defaultDuration) || 0.3, J = [
5517
5522
  "x",
5518
5523
  "y",
5519
5524
  "scale_x",
@@ -5528,97 +5533,97 @@ class ci {
5528
5533
  "style.shadow.offsetX",
5529
5534
  "style.shadow.offsetY"
5530
5535
  ];
5531
- for (const ft of K) {
5532
- const Tt = this.getObjectProperty(s, e, ft);
5533
- if (Tt === void 0 || typeof Tt != "number") continue;
5536
+ for (const ft of J) {
5537
+ const _t = this.getObjectProperty(s, e, ft);
5538
+ if (_t === void 0 || typeof _t != "number") continue;
5534
5539
  const Lt = H.get(ft);
5535
5540
  if (!Lt)
5536
5541
  H.set(ft, {
5537
- from: Tt,
5538
- to: Tt,
5542
+ from: _t,
5543
+ to: _t,
5539
5544
  startTime: this.currentTime,
5540
5545
  duration: 0
5541
5546
  });
5542
- else if (Lt.to !== Tt) {
5547
+ else if (Lt.to !== _t) {
5543
5548
  const ee = this.getObjectProperty(s, e, ft);
5544
5549
  H.set(ft, {
5545
5550
  from: ee ?? Lt.from,
5546
- to: Tt,
5551
+ to: _t,
5547
5552
  startTime: this.currentTime,
5548
- duration: Q
5553
+ duration: Z
5549
5554
  });
5550
5555
  }
5551
5556
  const Bt = H.get(ft);
5552
5557
  if (Bt.duration > 0 && Bt.from !== Bt.to) {
5553
- const ee = this.currentTime - Bt.startTime, ue = Math.min(1, ee / Bt.duration), Te = this.applyEasing(ue, ((oe = n.settings) == null ? void 0 : oe.defaultEasing) || "easeOutCubic"), ae = Bt.from + (Bt.to - Bt.from) * Te;
5554
- this.setObjectProperty(s, e, ft, ae);
5558
+ const ee = this.currentTime - Bt.startTime, ue = Math.min(1, ee / Bt.duration), Te = this.applyEasing(ue, ((ae = n.settings) == null ? void 0 : ae.defaultEasing) || "easeOutCubic"), re = Bt.from + (Bt.to - Bt.from) * Te;
5559
+ this.setObjectProperty(s, e, ft, re);
5555
5560
  }
5556
5561
  }
5557
5562
  } else if (n.type === U.SpringChain) {
5558
- const H = ((we = n.settings) == null ? void 0 : we.connections) || [], Q = ((Be = n.settings) == null ? void 0 : Be.globalDamping) || 0.3;
5563
+ const H = ((we = n.settings) == null ? void 0 : we.connections) || [], Z = ((Be = n.settings) == null ? void 0 : Be.globalDamping) || 0.3;
5559
5564
  this._springChainState.has(e.id) || this._springChainState.set(e.id, /* @__PURE__ */ new Map());
5560
- const K = this._springChainState.get(e.id);
5561
- for (const Tt of H) {
5562
- if (!K.has(Tt.targetId)) {
5563
- const Lt = this.objectStates.get(Tt.targetId);
5564
- K.set(Tt.targetId, {
5565
+ const J = this._springChainState.get(e.id);
5566
+ for (const _t of H) {
5567
+ if (!J.has(_t.targetId)) {
5568
+ const Lt = this.objectStates.get(_t.targetId);
5569
+ J.set(_t.targetId, {
5565
5570
  x: (Lt == null ? void 0 : Lt.x) ?? 0,
5566
5571
  y: (Lt == null ? void 0 : Lt.y) ?? 0,
5567
5572
  vx: 0,
5568
5573
  vy: 0
5569
5574
  });
5570
5575
  }
5571
- K.has(e.id) || K.set(e.id, { x: s.x, y: s.y, vx: 0, vy: 0 });
5576
+ J.has(e.id) || J.set(e.id, { x: s.x, y: s.y, vx: 0, vy: 0 });
5572
5577
  }
5573
- const ft = K.get(e.id);
5578
+ const ft = J.get(e.id);
5574
5579
  if (ft) {
5575
5580
  ft.x = s.x, ft.y = s.y;
5576
- for (const Tt of H) {
5577
- const Lt = K.get(Tt.targetId);
5581
+ for (const _t of H) {
5582
+ const Lt = J.get(_t.targetId);
5578
5583
  if (!Lt) continue;
5579
- const Bt = Lt.x - ft.x, ee = Lt.y - ft.y, ue = Math.sqrt(Bt * Bt + ee * ee) || 1e-3, ae = (ue - (Tt.restLength || 50)) * (Tt.stiffness || 0.8), be = Bt / ue * ae, Ue = ee / ue * ae;
5580
- ft.vx += be * t * 10, ft.vy += Ue * t * 10, Lt.vx -= be * t * 10, Lt.vy -= Ue * t * 10, ft.vx *= 1 - Q * t * 10, ft.vy *= 1 - Q * t * 10, Lt.vx *= 1 - Q * t * 10, Lt.vy *= 1 - Q * t * 10;
5581
- const pe = this.objectStates.get(Tt.targetId);
5584
+ const Bt = Lt.x - ft.x, ee = Lt.y - ft.y, ue = Math.sqrt(Bt * Bt + ee * ee) || 1e-3, re = (ue - (_t.restLength || 50)) * (_t.stiffness || 0.8), be = Bt / ue * re, Ue = ee / ue * re;
5585
+ ft.vx += be * t * 10, ft.vy += Ue * t * 10, Lt.vx -= be * t * 10, Lt.vy -= Ue * t * 10, ft.vx *= 1 - Z * t * 10, ft.vy *= 1 - Z * t * 10, Lt.vx *= 1 - Z * t * 10, Lt.vy *= 1 - Z * t * 10;
5586
+ const pe = this.objectStates.get(_t.targetId);
5582
5587
  pe && (pe.x += Lt.vx * t, pe.y += Lt.vy * t);
5583
5588
  }
5584
5589
  s.x += ft.vx * t, s.y += ft.vy * t;
5585
5590
  }
5586
5591
  } else if (n.type === U.ParticleEmitter) {
5587
- const H = ((We = n.settings) == null ? void 0 : We.rate) || 10, Q = ((de = n.settings) == null ? void 0 : de.speed) || 100, K = ((ce = n.settings) == null ? void 0 : ce.size) || 5, ft = ((he = n.settings) == null ? void 0 : he.lifetime) || 2, Tt = ((ke = n.settings) == null ? void 0 : ke.gravity) || 0, Lt = ((Xe = n.settings) == null ? void 0 : Xe.color) || "#ffffff", Bt = ((Ve = n.settings) == null ? void 0 : Ve.maxParticles) || 200, ee = (Ne = n.settings) != null && Ne.rateInputId ? this.inputs.get(n.settings.rateInputId) ?? H : H, ue = (De = n.settings) != null && De.gravityInputId ? this.inputs.get(n.settings.gravityInputId) ?? Tt : Tt, Te = (He = n.settings) != null && He.speedInputId ? this.inputs.get(n.settings.speedInputId) ?? Q : Q;
5592
+ const H = ((We = n.settings) == null ? void 0 : We.rate) || 10, Z = ((de = n.settings) == null ? void 0 : de.speed) || 100, J = ((ce = n.settings) == null ? void 0 : ce.size) || 5, ft = ((he = n.settings) == null ? void 0 : he.lifetime) || 2, _t = ((ke = n.settings) == null ? void 0 : ke.gravity) || 0, Lt = ((Xe = n.settings) == null ? void 0 : Xe.color) || "#ffffff", Bt = ((Ve = n.settings) == null ? void 0 : Ve.maxParticles) || 200, ee = (Ne = n.settings) != null && Ne.rateInputId ? this.inputs.get(n.settings.rateInputId) ?? H : H, ue = (De = n.settings) != null && De.gravityInputId ? this.inputs.get(n.settings.gravityInputId) ?? _t : _t, Te = (He = n.settings) != null && He.speedInputId ? this.inputs.get(n.settings.speedInputId) ?? Z : Z;
5588
5593
  this._emitterPools.has(e.id) || this._emitterPools.set(e.id, []);
5589
- const ae = this._emitterPools.get(e.id);
5594
+ const re = this._emitterPools.get(e.id);
5590
5595
  let be = 0;
5591
5596
  n._pendingBurst && n._pendingBurst > 0 && (be = n._pendingBurst, n._pendingBurst = 0);
5592
5597
  const Ue = Math.floor(ee * t) + (be || 0);
5593
- for (let pe = 0; pe < Math.min(Ue, Bt - ae.length); pe++) {
5594
- const re = Math.random() * Math.PI * 2, ss = Te * (0.5 + Math.random() * 0.5);
5595
- ae.push({
5598
+ for (let pe = 0; pe < Math.min(Ue, Bt - re.length); pe++) {
5599
+ const le = Math.random() * Math.PI * 2, ss = Te * (0.5 + Math.random() * 0.5);
5600
+ re.push({
5596
5601
  x: s.x,
5597
5602
  y: s.y,
5598
- vx: Math.cos(re) * ss,
5599
- vy: Math.sin(re) * ss,
5603
+ vx: Math.cos(le) * ss,
5604
+ vy: Math.sin(le) * ss,
5600
5605
  life: 0,
5601
5606
  maxLife: ft * (0.5 + Math.random() * 0.5),
5602
- size: K * (0.5 + Math.random()),
5607
+ size: J * (0.5 + Math.random()),
5603
5608
  color: Lt,
5604
5609
  opacity: 1
5605
5610
  });
5606
5611
  }
5607
- for (let pe = ae.length - 1; pe >= 0; pe--) {
5608
- const re = ae[pe];
5609
- re.vy += ue * t * 10, re.x += re.vx * t, re.y += re.vy * t, re.life += t, re.opacity = Math.max(0, 1 - re.life / re.maxLife), re.life >= re.maxLife && ae.splice(pe, 1);
5612
+ for (let pe = re.length - 1; pe >= 0; pe--) {
5613
+ const le = re[pe];
5614
+ le.vy += ue * t * 10, le.x += le.vx * t, le.y += le.vy * t, le.life += t, le.opacity = Math.max(0, 1 - le.life / le.maxLife), le.life >= le.maxLife && re.splice(pe, 1);
5610
5615
  }
5611
5616
  }
5612
5617
  });
5613
5618
  });
5614
5619
  }
5615
5620
  applyBehaviorSensor(t, i, o, e, s, n, a = 0, r = 0, h = 1) {
5616
- var d, u, v, b, m, y, S, C, w, M, I, k, T, L, P, _, E, A, W, z, Y, G, N, J;
5621
+ var d, u, v, b, m, y, S, C, w, M, I, k, T, L, P, _, E, A, W, z, Y, G, N, Q;
5617
5622
  const f = (s == null ? void 0 : s.intensity) || (s == null ? void 0 : s.strength) || 1, l = Math.min(1, 15 * e), p = h > 0 ? a / h : 0, c = h > 0 ? r / h : 0;
5618
5623
  switch (i) {
5619
5624
  case Zt.Scale: {
5620
- const x = ((d = n == null ? void 0 : n.transform) == null ? void 0 : d.scale_x) ?? 1, F = ((u = n == null ? void 0 : n.transform) == null ? void 0 : u.scale_y) ?? 1, j = x * (1 + o * f * 0.4), X = F * (1 + o * f * 0.4);
5621
- t.scale_x = (t.scale_x ?? x) * (1 - l) + j * l, t.scale_y = (t.scale_y ?? F) * (1 - l) + X * l;
5625
+ const x = ((d = n == null ? void 0 : n.transform) == null ? void 0 : d.scale_x) ?? 1, F = ((u = n == null ? void 0 : n.transform) == null ? void 0 : u.scale_y) ?? 1, tt = x * (1 + o * f * 0.4), X = F * (1 + o * f * 0.4);
5626
+ t.scale_x = (t.scale_x ?? x) * (1 - l) + tt * l, t.scale_y = (t.scale_y ?? F) * (1 - l) + X * l;
5622
5627
  break;
5623
5628
  }
5624
5629
  case Zt.Opacity: {
@@ -5693,7 +5698,7 @@ class ci {
5693
5698
  }
5694
5699
  case Zt.LetterSpacing: {
5695
5700
  t.geometry || (t.geometry = {});
5696
- const x = ((J = n == null ? void 0 : n.geometry) == null ? void 0 : J.letterSpacing) || 0, F = x + o * f * 10;
5701
+ const x = ((Q = n == null ? void 0 : n.geometry) == null ? void 0 : Q.letterSpacing) || 0, F = x + o * f * 10;
5697
5702
  t.geometry.letterSpacing = (t.geometry.letterSpacing ?? x) * (1 - l) + F * l;
5698
5703
  break;
5699
5704
  }
@@ -5806,9 +5811,9 @@ const yi = Ss(({
5806
5811
  }, P) => {
5807
5812
  const _ = _e(null), E = _e(null);
5808
5813
  E.current || (E.current = new ci());
5809
- const A = _e(void 0), W = _e(0), z = _e(null), Y = _e(y), G = _e(null), [, N] = Qe(g || null), J = _e(!0);
5810
- Cs(P, () => _.current), ve(() => (J.current = !0, () => {
5811
- J.current = !1, A.current && cancelAnimationFrame(A.current);
5814
+ const A = _e(void 0), W = _e(0), z = _e(null), Y = _e(y), G = _e(null), [, N] = Qe(g || null), Q = _e(!0);
5815
+ Cs(P, () => _.current), ve(() => (Q.current = !0, () => {
5816
+ Q.current = !1, A.current && cancelAnimationFrame(A.current);
5812
5817
  }), []), ve(() => {
5813
5818
  E.current.setLayout(e, s);
5814
5819
  }, [e, s]), ve(() => {
@@ -5830,7 +5835,7 @@ const yi = Ss(({
5830
5835
  })();
5831
5836
  }, [g, t, y]), ve(() => {
5832
5837
  const R = (O) => {
5833
- if (!E.current || !J.current) return;
5838
+ if (!E.current || !Q.current) return;
5834
5839
  const D = E.current, q = _.current;
5835
5840
  if (!q) return;
5836
5841
  const ot = q.getContext("2d");
@@ -5839,12 +5844,12 @@ const yi = Ss(({
5839
5844
  W.current === 0 && (W.current = yt);
5840
5845
  let bt = yt - W.current;
5841
5846
  bt > 0.1 && (bt = 0.1), W.current = yt;
5842
- const gt = q.getBoundingClientRect(), Et = window.devicePixelRatio || 1, It = Math.round(gt.width * Et), St = Math.round(gt.height * Et);
5843
- (q.width !== It || q.height !== St) && (q.width = It, q.height = St);
5847
+ const pt = q.getBoundingClientRect(), Et = window.devicePixelRatio || 1, It = Math.round(pt.width * Et), vt = Math.round(pt.height * Et);
5848
+ (q.width !== It || q.height !== vt) && (q.width = It, q.height = vt);
5844
5849
  try {
5845
5850
  o ? D.advance(bt) : m !== void 0 && D.seek(m), D.render(ot, q.width, q.height);
5846
- } catch (Xt) {
5847
- console.error("[ExodeUICanvas] Error in animation loop:", Xt), d && d(`[Error] Animation loop crashed: ${Xt}`, "error");
5851
+ } catch (Yt) {
5852
+ console.error("[ExodeUICanvas] Error in animation loop:", Yt), d && d(`[Error] Animation loop crashed: ${Yt}`, "error");
5848
5853
  }
5849
5854
  A.current = requestAnimationFrame(R);
5850
5855
  };
@@ -5874,14 +5879,14 @@ const yi = Ss(({
5874
5879
  window.removeEventListener("keydown", R), window.removeEventListener("keyup", O);
5875
5880
  };
5876
5881
  }, [T]);
5877
- const [F, j] = Qe([]);
5882
+ const [F, tt] = Qe([]);
5878
5883
  ve(() => {
5879
5884
  if (g && g.objects) {
5880
5885
  const R = g.objects.filter((O) => {
5881
5886
  var D, q;
5882
5887
  return O.type === "Joystick" && ((D = O.inputBinding) == null ? void 0 : D.type) === "keyboard" && ((q = O.inputBinding.keyboardConfig) == null ? void 0 : q.showVirtualKeyboard);
5883
5888
  });
5884
- j(R);
5889
+ tt(R);
5885
5890
  }
5886
5891
  }, [g]);
5887
5892
  const [, X] = Qe(0);
@@ -5893,21 +5898,21 @@ const yi = Ss(({
5893
5898
  };
5894
5899
  return R = requestAnimationFrame(O), () => cancelAnimationFrame(R);
5895
5900
  }, [F.length]);
5896
- const tt = () => F.map((R) => {
5897
- const O = R.inputBinding.keyboardConfig, D = (gt) => {
5901
+ const et = () => F.map((R) => {
5902
+ const O = R.inputBinding.keyboardConfig, D = (pt) => {
5898
5903
  var It;
5899
- const Et = { key: gt, code: gt, preventDefault: () => {
5904
+ const Et = { key: pt, code: pt, preventDefault: () => {
5900
5905
  } };
5901
5906
  (It = E.current) == null || It.handleKeyDown(Et);
5902
- }, q = (gt) => {
5907
+ }, q = (pt) => {
5903
5908
  var It;
5904
- const Et = { key: gt, code: gt, preventDefault: () => {
5909
+ const Et = { key: pt, code: pt, preventDefault: () => {
5905
5910
  } };
5906
5911
  (It = E.current) == null || It.handleKeyUp(Et);
5907
- }, ot = E.current, yt = (gt) => ot && ot.activeKeys ? ot.activeKeys.has(gt.toLowerCase()) : !1, bt = (gt) => ({
5912
+ }, ot = E.current, yt = (pt) => ot && ot.activeKeys ? ot.activeKeys.has(pt.toLowerCase()) : !1, bt = (pt) => ({
5908
5913
  width: "50px",
5909
5914
  height: "50px",
5910
- background: gt ? "rgba(255, 255, 255, 0.4)" : "rgba(0, 0, 0, 0.4)",
5915
+ background: pt ? "rgba(255, 255, 255, 0.4)" : "rgba(0, 0, 0, 0.4)",
5911
5916
  border: "1px solid rgba(255, 255, 255, 0.2)",
5912
5917
  borderRadius: "12px",
5913
5918
  display: "flex",
@@ -5920,7 +5925,7 @@ const yi = Ss(({
5920
5925
  cursor: "pointer",
5921
5926
  backdropFilter: "blur(8px)",
5922
5927
  transition: "background 0.1s",
5923
- boxShadow: gt ? "none" : "0 4px 6px rgba(0,0,0,0.1)"
5928
+ boxShadow: pt ? "none" : "0 4px 6px rgba(0,0,0,0.1)"
5924
5929
  });
5925
5930
  return /* @__PURE__ */ Je("div", { style: {
5926
5931
  position: "absolute",
@@ -5940,11 +5945,11 @@ const yi = Ss(({
5940
5945
  onMouseDown: () => D(O.upKey),
5941
5946
  onMouseUp: () => q(O.upKey),
5942
5947
  onMouseLeave: () => q(O.upKey),
5943
- onTouchStart: (gt) => {
5944
- gt.preventDefault(), D(O.upKey);
5948
+ onTouchStart: (pt) => {
5949
+ pt.preventDefault(), D(O.upKey);
5945
5950
  },
5946
- onTouchEnd: (gt) => {
5947
- gt.preventDefault(), q(O.upKey);
5951
+ onTouchEnd: (pt) => {
5952
+ pt.preventDefault(), q(O.upKey);
5948
5953
  },
5949
5954
  children: O.upKey.toUpperCase()
5950
5955
  }
@@ -5957,11 +5962,11 @@ const yi = Ss(({
5957
5962
  onMouseDown: () => D(O.leftKey),
5958
5963
  onMouseUp: () => q(O.leftKey),
5959
5964
  onMouseLeave: () => q(O.leftKey),
5960
- onTouchStart: (gt) => {
5961
- gt.preventDefault(), D(O.leftKey);
5965
+ onTouchStart: (pt) => {
5966
+ pt.preventDefault(), D(O.leftKey);
5962
5967
  },
5963
- onTouchEnd: (gt) => {
5964
- gt.preventDefault(), q(O.leftKey);
5968
+ onTouchEnd: (pt) => {
5969
+ pt.preventDefault(), q(O.leftKey);
5965
5970
  },
5966
5971
  children: O.leftKey.toUpperCase()
5967
5972
  }
@@ -5973,11 +5978,11 @@ const yi = Ss(({
5973
5978
  onMouseDown: () => D(O.downKey),
5974
5979
  onMouseUp: () => q(O.downKey),
5975
5980
  onMouseLeave: () => q(O.downKey),
5976
- onTouchStart: (gt) => {
5977
- gt.preventDefault(), D(O.downKey);
5981
+ onTouchStart: (pt) => {
5982
+ pt.preventDefault(), D(O.downKey);
5978
5983
  },
5979
- onTouchEnd: (gt) => {
5980
- gt.preventDefault(), q(O.downKey);
5984
+ onTouchEnd: (pt) => {
5985
+ pt.preventDefault(), q(O.downKey);
5981
5986
  },
5982
5987
  children: O.downKey.toUpperCase()
5983
5988
  }
@@ -5989,11 +5994,11 @@ const yi = Ss(({
5989
5994
  onMouseDown: () => D(O.rightKey),
5990
5995
  onMouseUp: () => q(O.rightKey),
5991
5996
  onMouseLeave: () => q(O.rightKey),
5992
- onTouchStart: (gt) => {
5993
- gt.preventDefault(), D(O.rightKey);
5997
+ onTouchStart: (pt) => {
5998
+ pt.preventDefault(), D(O.rightKey);
5994
5999
  },
5995
- onTouchEnd: (gt) => {
5996
- gt.preventDefault(), q(O.rightKey);
6000
+ onTouchEnd: (pt) => {
6001
+ pt.preventDefault(), q(O.rightKey);
5997
6002
  },
5998
6003
  children: O.rightKey.toUpperCase()
5999
6004
  }
@@ -6032,7 +6037,7 @@ const yi = Ss(({
6032
6037
  }
6033
6038
  }
6034
6039
  ),
6035
- tt()
6040
+ et()
6036
6041
  ] });
6037
6042
  });
6038
6043
  function bi() {
@@ -6139,7 +6144,7 @@ const vi = ({ artboard: g, config: t }) => {
6139
6144
  ]
6140
6145
  }
6141
6146
  );
6142
- }, hi = "6.3.38", fi = {
6147
+ }, hi = "6.3.39", fi = {
6143
6148
  version: hi
6144
6149
  }, Si = fi.version;
6145
6150
  export {