exodeui 2.6.17 → 2.6.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  var NC = Object.defineProperty;
2
2
  var kC = (i, A, I) => A in i ? NC(i, A, { enumerable: !0, configurable: !0, writable: !0, value: I }) : i[A] = I;
3
- var _ = (i, A, I) => kC(i, typeof A != "symbol" ? A + "" : A, I);
3
+ var V = (i, A, I) => kC(i, typeof A != "symbol" ? A + "" : A, I);
4
4
  import { jsx as yC } from "react/jsx-runtime";
5
- import { forwardRef as FC, useRef as DI, useImperativeHandle as MC, useEffect as jA, useState as JC, useCallback as uA } from "react";
6
- var UC = /* @__PURE__ */ ((i) => (i.Equal = "Equal", i.NotEqual = "NotEqual", i.GreaterThan = "GreaterThan", i.LessThan = "LessThan", i.GreaterEqual = "GreaterEqual", i.LessEqual = "LessEqual", i.IsTrue = "IsTrue", i.IsFalse = "IsFalse", i))(UC || {}), PA = /* @__PURE__ */ ((i) => (i.AND = "AND", i.OR = "OR", i.NOT = "NOT", i.XOR = "XOR", i))(PA || {});
5
+ import { forwardRef as FC, useRef as DI, useImperativeHandle as MC, useEffect as jA, useState as JC, useCallback as xA } from "react";
6
+ var UC = /* @__PURE__ */ ((i) => (i.Equal = "Equal", i.NotEqual = "NotEqual", i.GreaterThan = "GreaterThan", i.LessThan = "LessThan", i.GreaterEqual = "GreaterEqual", i.LessEqual = "LessEqual", i.IsTrue = "IsTrue", i.IsFalse = "IsFalse", i))(UC || {}), VA = /* @__PURE__ */ ((i) => (i.AND = "AND", i.OR = "OR", i.NOT = "NOT", i.XOR = "XOR", i))(VA || {});
7
7
  let B;
8
8
  const f = new Array(128).fill(void 0);
9
- function H(i) {
9
+ function p(i) {
10
10
  return f[i];
11
11
  }
12
12
  f.push(void 0, null, !0, !1);
@@ -27,9 +27,9 @@ const Tg = typeof TextDecoder < "u" ? new TextDecoder("utf-8", { ignoreBOM: !0,
27
27
  throw Error("TextDecoder not available");
28
28
  } };
29
29
  typeof TextDecoder < "u" && Tg.decode();
30
- let VA = null;
30
+ let PA = null;
31
31
  function fI(i, A) {
32
- return i >>>= 0, Tg.decode((VA !== null && VA.byteLength !== 0 || (VA = new Uint8Array(B.memory.buffer)), VA).subarray(i, i + A));
32
+ return i >>>= 0, Tg.decode((PA !== null && PA.byteLength !== 0 || (PA = new Uint8Array(B.memory.buffer)), PA).subarray(i, i + A));
33
33
  }
34
34
  function Y(i) {
35
35
  return i == null;
@@ -39,7 +39,7 @@ function wA() {
39
39
  return (fA === null || fA.buffer.detached === !0 || fA.buffer.detached === void 0 && fA.buffer !== B.memory.buffer) && (fA = new DataView(B.memory.buffer)), fA;
40
40
  }
41
41
  function wI(i) {
42
- const A = H(i);
42
+ const A = p(i);
43
43
  return function(I) {
44
44
  I < 132 || (f[I] = AI, AI = I);
45
45
  }(i), A;
@@ -97,46 +97,46 @@ class dA {
97
97
  const A = B.rawbroadphase_new();
98
98
  return this.__wbg_ptr = A >>> 0, YI.register(this, this.__wbg_ptr, this), this;
99
99
  }
100
- castRay(A, I, g, C, Q, E, D, o, w, h, G, K) {
100
+ castRay(A, I, g, C, Q, E, D, o, w, G, h, K) {
101
101
  try {
102
102
  s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, a);
103
- const N = B.rawbroadphase_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D, o, Y(w) ? 4294967297 : w >>> 0, !Y(h), Y(h) ? 0 : h, !Y(G), Y(G) ? 0 : G, $(K));
103
+ const N = B.rawbroadphase_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D, o, Y(w) ? 4294967297 : w >>> 0, !Y(G), Y(G) ? 0 : G, !Y(h), Y(h) ? 0 : h, $(K));
104
104
  return N === 0 ? void 0 : _I.__wrap(N);
105
105
  } finally {
106
106
  f[X++] = void 0;
107
107
  }
108
108
  }
109
- castRayAndGetNormal(A, I, g, C, Q, E, D, o, w, h, G, K) {
109
+ castRayAndGetNormal(A, I, g, C, Q, E, D, o, w, G, h, K) {
110
110
  try {
111
111
  s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, a);
112
- const N = B.rawbroadphase_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D, o, Y(w) ? 4294967297 : w >>> 0, !Y(h), Y(h) ? 0 : h, !Y(G), Y(G) ? 0 : G, $(K));
112
+ const N = B.rawbroadphase_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D, o, Y(w) ? 4294967297 : w >>> 0, !Y(G), Y(G) ? 0 : G, !Y(h), Y(h) ? 0 : h, $(K));
113
113
  return N === 0 ? void 0 : FI.__wrap(N);
114
114
  } finally {
115
115
  f[X++] = void 0;
116
116
  }
117
117
  }
118
- intersectionsWithRay(A, I, g, C, Q, E, D, o, w, h, G, K, N) {
118
+ intersectionsWithRay(A, I, g, C, Q, E, D, o, w, G, h, K, N) {
119
119
  try {
120
- s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, a), B.rawbroadphase_intersectionsWithRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D, $(o), w, Y(h) ? 4294967297 : h >>> 0, !Y(G), Y(G) ? 0 : G, !Y(K), Y(K) ? 0 : K, $(N));
120
+ s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, a), B.rawbroadphase_intersectionsWithRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D, $(o), w, Y(G) ? 4294967297 : G >>> 0, !Y(h), Y(h) ? 0 : h, !Y(K), Y(K) ? 0 : K, $(N));
121
121
  } finally {
122
122
  f[X++] = void 0, f[X++] = void 0;
123
123
  }
124
124
  }
125
- intersectionWithShape(A, I, g, C, Q, E, D, o, w, h, G) {
125
+ intersectionWithShape(A, I, g, C, Q, E, D, o, w, G, h) {
126
126
  try {
127
127
  const M = B.__wbindgen_add_to_stack_pointer(-16);
128
- s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, b), s(E, e), B.rawbroadphase_intersectionWithShape(M, this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D, Y(o) ? 4294967297 : o >>> 0, !Y(w), Y(w) ? 0 : w, !Y(h), Y(h) ? 0 : h, $(G));
128
+ s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, b), s(E, r), B.rawbroadphase_intersectionWithShape(M, this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D, Y(o) ? 4294967297 : o >>> 0, !Y(w), Y(w) ? 0 : w, !Y(G), Y(G) ? 0 : G, $(h));
129
129
  var K = wA().getInt32(M + 0, !0), N = wA().getFloat64(M + 8, !0);
130
130
  return K === 0 ? void 0 : N;
131
131
  } finally {
132
132
  B.__wbindgen_add_to_stack_pointer(16), f[X++] = void 0;
133
133
  }
134
134
  }
135
- projectPoint(A, I, g, C, Q, E, D, o, w, h) {
135
+ projectPoint(A, I, g, C, Q, E, D, o, w, G) {
136
136
  try {
137
137
  s(A, DA), s(I, P), s(g, gA), s(C, a);
138
- const G = B.rawbroadphase_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, E, Y(D) ? 4294967297 : D >>> 0, !Y(o), Y(o) ? 0 : o, !Y(w), Y(w) ? 0 : w, $(h));
139
- return G === 0 ? void 0 : GI.__wrap(G);
138
+ const h = B.rawbroadphase_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, E, Y(D) ? 4294967297 : D >>> 0, !Y(o), Y(o) ? 0 : o, !Y(w), Y(w) ? 0 : w, $(G));
139
+ return h === 0 ? void 0 : GI.__wrap(h);
140
140
  } finally {
141
141
  f[X++] = void 0;
142
142
  }
@@ -144,31 +144,31 @@ class dA {
144
144
  projectPointAndGetFeature(A, I, g, C, Q, E, D, o, w) {
145
145
  try {
146
146
  s(A, DA), s(I, P), s(g, gA), s(C, a);
147
- const h = B.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, Y(E) ? 4294967297 : E >>> 0, !Y(D), Y(D) ? 0 : D, !Y(o), Y(o) ? 0 : o, $(w));
148
- return h === 0 ? void 0 : GI.__wrap(h);
147
+ const G = B.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, Y(E) ? 4294967297 : E >>> 0, !Y(D), Y(D) ? 0 : D, !Y(o), Y(o) ? 0 : o, $(w));
148
+ return G === 0 ? void 0 : GI.__wrap(G);
149
149
  } finally {
150
150
  f[X++] = void 0;
151
151
  }
152
152
  }
153
- intersectionsWithPoint(A, I, g, C, Q, E, D, o, w, h) {
153
+ intersectionsWithPoint(A, I, g, C, Q, E, D, o, w, G) {
154
154
  try {
155
- s(A, DA), s(I, P), s(g, gA), s(C, a), B.rawbroadphase_intersectionsWithPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, $(Q), E, Y(D) ? 4294967297 : D >>> 0, !Y(o), Y(o) ? 0 : o, !Y(w), Y(w) ? 0 : w, $(h));
155
+ s(A, DA), s(I, P), s(g, gA), s(C, a), B.rawbroadphase_intersectionsWithPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, $(Q), E, Y(D) ? 4294967297 : D >>> 0, !Y(o), Y(o) ? 0 : o, !Y(w), Y(w) ? 0 : w, $(G));
156
156
  } finally {
157
157
  f[X++] = void 0, f[X++] = void 0;
158
158
  }
159
159
  }
160
- castShape(A, I, g, C, Q, E, D, o, w, h, G, K, N, M, F) {
160
+ castShape(A, I, g, C, Q, E, D, o, w, G, h, K, N, M, F) {
161
161
  try {
162
- s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, b), s(E, a), s(D, e);
163
- const J = B.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o, w, h, G, Y(K) ? 4294967297 : K >>> 0, !Y(N), Y(N) ? 0 : N, !Y(M), Y(M) ? 0 : M, $(F));
162
+ s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, b), s(E, a), s(D, r);
163
+ const J = B.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o, w, G, h, Y(K) ? 4294967297 : K >>> 0, !Y(N), Y(N) ? 0 : N, !Y(M), Y(M) ? 0 : M, $(F));
164
164
  return J === 0 ? void 0 : kI.__wrap(J);
165
165
  } finally {
166
166
  f[X++] = void 0;
167
167
  }
168
168
  }
169
- intersectionsWithShape(A, I, g, C, Q, E, D, o, w, h, G, K) {
169
+ intersectionsWithShape(A, I, g, C, Q, E, D, o, w, G, h, K) {
170
170
  try {
171
- s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, b), s(E, e), B.rawbroadphase_intersectionsWithShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, $(D), o, Y(w) ? 4294967297 : w >>> 0, !Y(h), Y(h) ? 0 : h, !Y(G), Y(G) ? 0 : G, $(K));
171
+ s(A, DA), s(I, P), s(g, gA), s(C, a), s(Q, b), s(E, r), B.rawbroadphase_intersectionsWithShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, $(D), o, Y(w) ? 4294967297 : w >>> 0, !Y(G), Y(G) ? 0 : G, !Y(h), Y(h) ? 0 : h, $(K));
172
172
  } finally {
173
173
  f[X++] = void 0, f[X++] = void 0;
174
174
  }
@@ -454,9 +454,9 @@ class gA {
454
454
  return s(I, a), B.rawcolliderset_coContainsPoint(this.__wbg_ptr, A, I.__wbg_ptr) !== 0;
455
455
  }
456
456
  coCastShape(A, I, g, C, Q, E, D, o, w) {
457
- s(I, a), s(g, e), s(C, a), s(Q, b), s(E, a);
458
- const h = B.rawcolliderset_coCastShape(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D, o, w);
459
- return h === 0 ? void 0 : JI.__wrap(h);
457
+ s(I, a), s(g, r), s(C, a), s(Q, b), s(E, a);
458
+ const G = B.rawcolliderset_coCastShape(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D, o, w);
459
+ return G === 0 ? void 0 : JI.__wrap(G);
460
460
  }
461
461
  coCastCollider(A, I, g, C, Q, E, D) {
462
462
  s(I, a), s(C, a);
@@ -464,10 +464,10 @@ class gA {
464
464
  return o === 0 ? void 0 : kI.__wrap(o);
465
465
  }
466
466
  coIntersectsShape(A, I, g, C) {
467
- return s(I, e), s(g, a), s(C, b), B.rawcolliderset_coIntersectsShape(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr) !== 0;
467
+ return s(I, r), s(g, a), s(C, b), B.rawcolliderset_coIntersectsShape(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr) !== 0;
468
468
  }
469
469
  coContactShape(A, I, g, C, Q) {
470
- s(I, e), s(g, a), s(C, b);
470
+ s(I, r), s(g, a), s(C, b);
471
471
  const E = B.rawcolliderset_coContactShape(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q);
472
472
  return E === 0 ? void 0 : II.__wrap(E);
473
473
  }
@@ -528,7 +528,7 @@ class gA {
528
528
  B.rawcolliderset_coSetActiveCollisionTypes(this.__wbg_ptr, A, I);
529
529
  }
530
530
  coSetShape(A, I) {
531
- s(I, e), B.rawcolliderset_coSetShape(this.__wbg_ptr, A, I.__wbg_ptr);
531
+ s(I, r), B.rawcolliderset_coSetShape(this.__wbg_ptr, A, I.__wbg_ptr);
532
532
  }
533
533
  coSetContactForceEventThreshold(A, I) {
534
534
  B.rawcolliderset_coSetContactForceEventThreshold(this.__wbg_ptr, A, I);
@@ -552,10 +552,10 @@ class gA {
552
552
  contains(A) {
553
553
  return B.rawcolliderset_contains(this.__wbg_ptr, A) !== 0;
554
554
  }
555
- createCollider(A, I, g, C, Q, E, D, o, w, h, G, K, N, M, F, J, k, y, U, R, c, L, r, p) {
555
+ createCollider(A, I, g, C, Q, E, D, o, w, G, h, K, N, M, F, J, y, k, U, R, c, e, L, H) {
556
556
  try {
557
557
  const GA = B.__wbindgen_add_to_stack_pointer(-16);
558
- s(I, e), s(g, a), s(C, b), s(D, a), s(p, P), B.rawcolliderset_createCollider(GA, this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, E, D.__wbg_ptr, o, w, h, G, K, N, M, F, J, k, y, U, R, c, L, r, p.__wbg_ptr);
558
+ s(I, r), s(g, a), s(C, b), s(D, a), s(H, P), B.rawcolliderset_createCollider(GA, this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q, E, D.__wbg_ptr, o, w, G, h, K, N, M, F, J, y, k, U, R, c, e, L, H.__wbg_ptr);
559
559
  var q = wA().getInt32(GA + 0, !0), AA = wA().getFloat64(GA + 8, !0);
560
560
  return q === 0 ? void 0 : AA;
561
561
  } finally {
@@ -657,10 +657,10 @@ class uI {
657
657
  const yg = typeof FinalizationRegistry > "u" ? { register: () => {
658
658
  }, unregister: () => {
659
659
  } } : new FinalizationRegistry((i) => B.__wbg_rawcontactmanifold_free(i >>> 0, 1));
660
- class PI {
660
+ class VI {
661
661
  static __wrap(A) {
662
662
  A >>>= 0;
663
- const I = Object.create(PI.prototype);
663
+ const I = Object.create(VI.prototype);
664
664
  return I.__wbg_ptr = A, yg.register(I, I.__wbg_ptr, I), I;
665
665
  }
666
666
  __destroy_into_raw() {
@@ -739,10 +739,10 @@ class PI {
739
739
  const Fg = typeof FinalizationRegistry > "u" ? { register: () => {
740
740
  }, unregister: () => {
741
741
  } } : new FinalizationRegistry((i) => B.__wbg_rawcontactpair_free(i >>> 0, 1));
742
- class VI {
742
+ class PI {
743
743
  static __wrap(A) {
744
744
  A >>>= 0;
745
- const I = Object.create(VI.prototype);
745
+ const I = Object.create(PI.prototype);
746
746
  return I.__wbg_ptr = A, Fg.register(I, I.__wbg_ptr, I), I;
747
747
  }
748
748
  __destroy_into_raw() {
@@ -764,7 +764,7 @@ class VI {
764
764
  }
765
765
  contactManifold(A) {
766
766
  const I = B.rawcontactpair_contactManifold(this.__wbg_ptr, A);
767
- return I === 0 ? void 0 : PI.__wrap(I);
767
+ return I === 0 ? void 0 : VI.__wrap(I);
768
768
  }
769
769
  }
770
770
  const Mg = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -1229,9 +1229,9 @@ class tC {
1229
1229
  snapToGroundEnabled() {
1230
1230
  return B.rawkinematiccharactercontroller_snapToGroundEnabled(this.__wbg_ptr) !== 0;
1231
1231
  }
1232
- computeColliderMovement(A, I, g, C, Q, E, D, o, w, h, G, K) {
1232
+ computeColliderMovement(A, I, g, C, Q, E, D, o, w, G, h, K) {
1233
1233
  try {
1234
- s(I, dA), s(g, DA), s(C, P), s(Q, gA), s(D, a), B.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D.__wbg_ptr, o, Y(w) ? 4294967297 : Math.fround(w), h, Y(G) ? 4294967297 : G >>> 0, $(K));
1234
+ s(I, dA), s(g, DA), s(C, P), s(Q, gA), s(D, a), B.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E, D.__wbg_ptr, o, Y(w) ? 4294967297 : Math.fround(w), G, Y(h) ? 4294967297 : h >>> 0, $(K));
1235
1235
  } finally {
1236
1236
  f[X++] = void 0;
1237
1237
  }
@@ -1355,7 +1355,7 @@ class DA {
1355
1355
  }
1356
1356
  contact_pair(A, I) {
1357
1357
  const g = B.rawnarrowphase_contact_pair(this.__wbg_ptr, A, I);
1358
- return g === 0 ? void 0 : VI.__wrap(g);
1358
+ return g === 0 ? void 0 : PI.__wrap(g);
1359
1359
  }
1360
1360
  intersection_pairs_with(A, I) {
1361
1361
  B.rawnarrowphase_intersection_pairs_with(this.__wbg_ptr, A, O(I));
@@ -1434,11 +1434,11 @@ class YC {
1434
1434
  timing_user_changes() {
1435
1435
  return B.rawphysicspipeline_timing_user_changes(this.__wbg_ptr);
1436
1436
  }
1437
- step(A, I, g, C, Q, E, D, o, w, h) {
1438
- s(A, a), s(I, ZA), s(g, qA), s(C, dA), s(Q, DA), s(E, P), s(D, gA), s(o, rA), s(w, lA), s(h, bI), B.rawphysicspipeline_step(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr, h.__wbg_ptr);
1437
+ step(A, I, g, C, Q, E, D, o, w, G) {
1438
+ s(A, a), s(I, ZA), s(g, qA), s(C, dA), s(Q, DA), s(E, P), s(D, gA), s(o, rA), s(w, lA), s(G, bI), B.rawphysicspipeline_step(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr, G.__wbg_ptr);
1439
1439
  }
1440
- stepWithEvents(A, I, g, C, Q, E, D, o, w, h, G, K, N, M) {
1441
- s(A, a), s(I, ZA), s(g, qA), s(C, dA), s(Q, DA), s(E, P), s(D, gA), s(o, rA), s(w, lA), s(h, bI), s(G, jg), B.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr, h.__wbg_ptr, G.__wbg_ptr, O(K), O(N), O(M));
1440
+ stepWithEvents(A, I, g, C, Q, E, D, o, w, G, h, K, N, M) {
1441
+ s(A, a), s(I, ZA), s(g, qA), s(C, dA), s(Q, DA), s(E, P), s(D, gA), s(o, rA), s(w, lA), s(G, bI), s(h, jg), B.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr, G.__wbg_ptr, h.__wbg_ptr, O(K), O(N), O(M));
1442
1442
  }
1443
1443
  }
1444
1444
  const Yg = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -1871,8 +1871,8 @@ class P {
1871
1871
  const A = B.rawrigidbodyset_new();
1872
1872
  return this.__wbg_ptr = A >>> 0, HI.register(this, this.__wbg_ptr, this), this;
1873
1873
  }
1874
- createRigidBody(A, I, g, C, Q, E, D, o, w, h, G, K, N, M, F, J, k, y, U, R, c, L) {
1875
- return s(I, a), s(g, b), s(D, a), s(o, a), B.rawrigidbodyset_createRigidBody(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C, Q, E, D.__wbg_ptr, o.__wbg_ptr, w, h, G, K, N, M, F, J, k, y, U, R, c, L);
1874
+ createRigidBody(A, I, g, C, Q, E, D, o, w, G, h, K, N, M, F, J, y, k, U, R, c, e) {
1875
+ return s(I, a), s(g, b), s(D, a), s(o, a), B.rawrigidbodyset_createRigidBody(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C, Q, E, D.__wbg_ptr, o.__wbg_ptr, w, G, h, K, N, M, F, J, y, k, U, R, c, e);
1876
1876
  }
1877
1877
  remove(A, I, g, C, Q) {
1878
1878
  s(I, qA), s(g, gA), s(C, rA), s(Q, lA), B.rawrigidbodyset_remove(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr);
@@ -1956,10 +1956,10 @@ class LC {
1956
1956
  const pg = typeof FinalizationRegistry > "u" ? { register: () => {
1957
1957
  }, unregister: () => {
1958
1958
  } } : new FinalizationRegistry((i) => B.__wbg_rawshape_free(i >>> 0, 1));
1959
- class e {
1959
+ class r {
1960
1960
  static __wrap(A) {
1961
1961
  A >>>= 0;
1962
- const I = Object.create(e.prototype);
1962
+ const I = Object.create(r.prototype);
1963
1963
  return I.__wbg_ptr = A, pg.register(I, I.__wbg_ptr, I), I;
1964
1964
  }
1965
1965
  __destroy_into_raw() {
@@ -1972,90 +1972,90 @@ class e {
1972
1972
  }
1973
1973
  static cuboid(A, I) {
1974
1974
  const g = B.rawshape_cuboid(A, I);
1975
- return e.__wrap(g);
1975
+ return r.__wrap(g);
1976
1976
  }
1977
1977
  static roundCuboid(A, I, g) {
1978
1978
  const C = B.rawshape_roundCuboid(A, I, g);
1979
- return e.__wrap(C);
1979
+ return r.__wrap(C);
1980
1980
  }
1981
1981
  static ball(A) {
1982
1982
  const I = B.rawshape_ball(A);
1983
- return e.__wrap(I);
1983
+ return r.__wrap(I);
1984
1984
  }
1985
1985
  static halfspace(A) {
1986
1986
  s(A, a);
1987
1987
  const I = B.rawshape_halfspace(A.__wbg_ptr);
1988
- return e.__wrap(I);
1988
+ return r.__wrap(I);
1989
1989
  }
1990
1990
  static capsule(A, I) {
1991
1991
  const g = B.rawshape_capsule(A, I);
1992
- return e.__wrap(g);
1992
+ return r.__wrap(g);
1993
1993
  }
1994
1994
  static voxels(A, I) {
1995
1995
  s(A, a);
1996
1996
  const g = tI(I, B.__wbindgen_export_2), C = MA, Q = B.rawshape_voxels(A.__wbg_ptr, g, C);
1997
- return e.__wrap(Q);
1997
+ return r.__wrap(Q);
1998
1998
  }
1999
1999
  static voxelsFromPoints(A, I) {
2000
2000
  s(A, a);
2001
2001
  const g = HA(I, B.__wbindgen_export_2), C = MA, Q = B.rawshape_voxelsFromPoints(A.__wbg_ptr, g, C);
2002
- return e.__wrap(Q);
2002
+ return r.__wrap(Q);
2003
2003
  }
2004
2004
  static polyline(A, I) {
2005
2005
  const g = HA(A, B.__wbindgen_export_2), C = MA, Q = tI(I, B.__wbindgen_export_2), E = MA, D = B.rawshape_polyline(g, C, Q, E);
2006
- return e.__wrap(D);
2006
+ return r.__wrap(D);
2007
2007
  }
2008
2008
  static trimesh(A, I, g) {
2009
2009
  const C = HA(A, B.__wbindgen_export_2), Q = MA, E = tI(I, B.__wbindgen_export_2), D = MA, o = B.rawshape_trimesh(C, Q, E, D, g);
2010
- return o === 0 ? void 0 : e.__wrap(o);
2010
+ return o === 0 ? void 0 : r.__wrap(o);
2011
2011
  }
2012
2012
  static heightfield(A, I) {
2013
2013
  const g = HA(A, B.__wbindgen_export_2), C = MA;
2014
2014
  s(I, a);
2015
2015
  const Q = B.rawshape_heightfield(g, C, I.__wbg_ptr);
2016
- return e.__wrap(Q);
2016
+ return r.__wrap(Q);
2017
2017
  }
2018
2018
  static segment(A, I) {
2019
2019
  s(A, a), s(I, a);
2020
2020
  const g = B.rawshape_segment(A.__wbg_ptr, I.__wbg_ptr);
2021
- return e.__wrap(g);
2021
+ return r.__wrap(g);
2022
2022
  }
2023
2023
  static triangle(A, I, g) {
2024
2024
  s(A, a), s(I, a), s(g, a);
2025
2025
  const C = B.rawshape_triangle(A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr);
2026
- return e.__wrap(C);
2026
+ return r.__wrap(C);
2027
2027
  }
2028
2028
  static roundTriangle(A, I, g, C) {
2029
2029
  s(A, a), s(I, a), s(g, a);
2030
2030
  const Q = B.rawshape_roundTriangle(A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C);
2031
- return e.__wrap(Q);
2031
+ return r.__wrap(Q);
2032
2032
  }
2033
2033
  static convexHull(A) {
2034
2034
  const I = HA(A, B.__wbindgen_export_2), g = MA, C = B.rawshape_convexHull(I, g);
2035
- return C === 0 ? void 0 : e.__wrap(C);
2035
+ return C === 0 ? void 0 : r.__wrap(C);
2036
2036
  }
2037
2037
  static roundConvexHull(A, I) {
2038
2038
  const g = HA(A, B.__wbindgen_export_2), C = MA, Q = B.rawshape_roundConvexHull(g, C, I);
2039
- return Q === 0 ? void 0 : e.__wrap(Q);
2039
+ return Q === 0 ? void 0 : r.__wrap(Q);
2040
2040
  }
2041
2041
  static convexPolyline(A) {
2042
2042
  const I = HA(A, B.__wbindgen_export_2), g = MA, C = B.rawshape_convexPolyline(I, g);
2043
- return C === 0 ? void 0 : e.__wrap(C);
2043
+ return C === 0 ? void 0 : r.__wrap(C);
2044
2044
  }
2045
2045
  static roundConvexPolyline(A, I) {
2046
2046
  const g = HA(A, B.__wbindgen_export_2), C = MA, Q = B.rawshape_roundConvexPolyline(g, C, I);
2047
- return Q === 0 ? void 0 : e.__wrap(Q);
2047
+ return Q === 0 ? void 0 : r.__wrap(Q);
2048
2048
  }
2049
- castShape(A, I, g, C, Q, E, D, o, w, h) {
2050
- s(A, a), s(I, b), s(g, a), s(C, e), s(Q, a), s(E, b), s(D, a);
2051
- const G = B.rawshape_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o, w, h);
2052
- return G === 0 ? void 0 : JI.__wrap(G);
2049
+ castShape(A, I, g, C, Q, E, D, o, w, G) {
2050
+ s(A, a), s(I, b), s(g, a), s(C, r), s(Q, a), s(E, b), s(D, a);
2051
+ const h = B.rawshape_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E.__wbg_ptr, D.__wbg_ptr, o, w, G);
2052
+ return h === 0 ? void 0 : JI.__wrap(h);
2053
2053
  }
2054
2054
  intersectsShape(A, I, g, C, Q) {
2055
- return s(A, a), s(I, b), s(g, e), s(C, a), s(Q, b), B.rawshape_intersectsShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr) !== 0;
2055
+ return s(A, a), s(I, b), s(g, r), s(C, a), s(Q, b), B.rawshape_intersectsShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr) !== 0;
2056
2056
  }
2057
2057
  contactShape(A, I, g, C, Q, E) {
2058
- s(A, a), s(I, b), s(g, e), s(C, a), s(Q, b);
2058
+ s(A, a), s(I, b), s(g, r), s(C, a), s(Q, b);
2059
2059
  const D = B.rawshape_contactShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, Q.__wbg_ptr, E);
2060
2060
  return D === 0 ? void 0 : II.__wrap(D);
2061
2061
  }
@@ -2205,51 +2205,51 @@ async function xg(i) {
2205
2205
  const A = function() {
2206
2206
  const C = { wbg: {} };
2207
2207
  return C.wbg.__wbg_bind_c8359b1cba058168 = function(Q, E, D, o) {
2208
- return O(H(Q).bind(H(E), H(D), H(o)));
2208
+ return O(p(Q).bind(p(E), p(D), p(o)));
2209
2209
  }, C.wbg.__wbg_buffer_609cc3eee51ed158 = function(Q) {
2210
- return O(H(Q).buffer);
2210
+ return O(p(Q).buffer);
2211
2211
  }, C.wbg.__wbg_call_672a4d21634d4a24 = function() {
2212
2212
  return oI(function(Q, E) {
2213
- return O(H(Q).call(H(E)));
2213
+ return O(p(Q).call(p(E)));
2214
2214
  }, arguments);
2215
2215
  }, C.wbg.__wbg_call_7cccdd69e0791ae2 = function() {
2216
2216
  return oI(function(Q, E, D) {
2217
- return O(H(Q).call(H(E), H(D)));
2217
+ return O(p(Q).call(p(E), p(D)));
2218
2218
  }, arguments);
2219
2219
  }, C.wbg.__wbg_call_833bed5770ea2041 = function() {
2220
2220
  return oI(function(Q, E, D, o) {
2221
- return O(H(Q).call(H(E), H(D), H(o)));
2221
+ return O(p(Q).call(p(E), p(D), p(o)));
2222
2222
  }, arguments);
2223
2223
  }, C.wbg.__wbg_call_b8adc8b1d0a0d8eb = function() {
2224
2224
  return oI(function(Q, E, D, o, w) {
2225
- return O(H(Q).call(H(E), H(D), H(o), H(w)));
2225
+ return O(p(Q).call(p(E), p(D), p(o), p(w)));
2226
2226
  }, arguments);
2227
2227
  }, C.wbg.__wbg_length_3b4f022188ae8db6 = function(Q) {
2228
- return H(Q).length;
2228
+ return p(Q).length;
2229
2229
  }, C.wbg.__wbg_length_a446193dc22c12f8 = function(Q) {
2230
- return H(Q).length;
2230
+ return p(Q).length;
2231
2231
  }, C.wbg.__wbg_new_a12002a7f91c75be = function(Q) {
2232
- return O(new Uint8Array(H(Q)));
2232
+ return O(new Uint8Array(p(Q)));
2233
2233
  }, C.wbg.__wbg_newnoargs_105ed471475aaf50 = function(Q, E) {
2234
2234
  return O(new Function(fI(Q, E)));
2235
2235
  }, C.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(Q, E, D) {
2236
- return O(new Uint8Array(H(Q), E >>> 0, D >>> 0));
2236
+ return O(new Uint8Array(p(Q), E >>> 0, D >>> 0));
2237
2237
  }, C.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(Q, E, D) {
2238
- return O(new Float32Array(H(Q), E >>> 0, D >>> 0));
2238
+ return O(new Float32Array(p(Q), E >>> 0, D >>> 0));
2239
2239
  }, C.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(Q) {
2240
2240
  return O(new Float32Array(Q >>> 0));
2241
2241
  }, C.wbg.__wbg_now_2c95c9de01293173 = function(Q) {
2242
- return H(Q).now();
2242
+ return p(Q).now();
2243
2243
  }, C.wbg.__wbg_performance_7a3ffd0b17f663ad = function(Q) {
2244
- return O(H(Q).performance);
2244
+ return O(p(Q).performance);
2245
2245
  }, C.wbg.__wbg_rawcontactforceevent_new = function(Q) {
2246
2246
  return O(uI.__wrap(Q));
2247
2247
  }, C.wbg.__wbg_rawraycolliderintersection_new = function(Q) {
2248
2248
  return O(FI.__wrap(Q));
2249
2249
  }, C.wbg.__wbg_set_10bad9bee0e9c58b = function(Q, E, D) {
2250
- H(Q).set(H(E), D >>> 0);
2250
+ p(Q).set(p(E), D >>> 0);
2251
2251
  }, C.wbg.__wbg_set_65595bdd868b3009 = function(Q, E, D) {
2252
- H(Q).set(H(E), D >>> 0);
2252
+ p(Q).set(p(E), D >>> 0);
2253
2253
  }, C.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
2254
2254
  const Q = typeof global > "u" ? null : global;
2255
2255
  return Y(Q) ? 0 : O(Q);
@@ -2263,21 +2263,21 @@ async function xg(i) {
2263
2263
  const Q = typeof window > "u" ? null : window;
2264
2264
  return Y(Q) ? 0 : O(Q);
2265
2265
  }, C.wbg.__wbindgen_boolean_get = function(Q) {
2266
- const E = H(Q);
2266
+ const E = p(Q);
2267
2267
  return typeof E == "boolean" ? E ? 1 : 0 : 2;
2268
2268
  }, C.wbg.__wbindgen_is_function = function(Q) {
2269
- return typeof H(Q) == "function";
2269
+ return typeof p(Q) == "function";
2270
2270
  }, C.wbg.__wbindgen_is_undefined = function(Q) {
2271
- return H(Q) === void 0;
2271
+ return p(Q) === void 0;
2272
2272
  }, C.wbg.__wbindgen_memory = function() {
2273
2273
  return O(B.memory);
2274
2274
  }, C.wbg.__wbindgen_number_get = function(Q, E) {
2275
- const D = H(E), o = typeof D == "number" ? D : void 0;
2275
+ const D = p(E), o = typeof D == "number" ? D : void 0;
2276
2276
  wA().setFloat64(Q + 8, Y(o) ? 0 : o, !0), wA().setInt32(Q + 0, !Y(o), !0);
2277
2277
  }, C.wbg.__wbindgen_number_new = function(Q) {
2278
2278
  return O(Q);
2279
2279
  }, C.wbg.__wbindgen_object_clone_ref = function(Q) {
2280
- return O(H(Q));
2280
+ return O(p(Q));
2281
2281
  }, C.wbg.__wbindgen_object_drop_ref = function(Q) {
2282
2282
  wI(Q);
2283
2283
  }, C.wbg.__wbindgen_throw = function(Q, E) {
@@ -2302,7 +2302,7 @@ async function xg(i) {
2302
2302
  }
2303
2303
  }(await i, A);
2304
2304
  return function(C, Q) {
2305
- return B = C.exports, xg.__wbindgen_wasm_module = Q, fA = null, _A = null, zA = null, $A = null, VA = null, B;
2305
+ return B = C.exports, xg.__wbindgen_wasm_module = Q, fA = null, _A = null, zA = null, $A = null, PA = null, B;
2306
2306
  }(I, g);
2307
2307
  }
2308
2308
  class mg {
@@ -2342,7 +2342,7 @@ class j {
2342
2342
  return b.fromAngle(A);
2343
2343
  }
2344
2344
  }
2345
- var cA, JA, TI, ZI, gI, mA, sA, WI, OI, hI, sI, jI, xI, KI, TA;
2345
+ var cA, JA, TI, ZI, gI, XA, sA, WI, OI, hI, sI, jI, xI, KI, TA;
2346
2346
  (function(i) {
2347
2347
  i[i.Dynamic = 0] = "Dynamic", i[i.Fixed = 1] = "Fixed", i[i.KinematicPositionBased = 2] = "KinematicPositionBased", i[i.KinematicVelocityBased = 3] = "KinematicVelocityBased";
2348
2348
  })(cA || (cA = {}));
@@ -2819,9 +2819,9 @@ class nA {
2819
2819
  case pA.Fixed:
2820
2820
  return new ug(A, I, g);
2821
2821
  case pA.Spring:
2822
- return new Vg(A, I, g);
2823
- case pA.Rope:
2824
2822
  return new Pg(A, I, g);
2823
+ case pA.Rope:
2824
+ return new Vg(A, I, g);
2825
2825
  default:
2826
2826
  return new nA(A, I, g);
2827
2827
  }
@@ -2890,10 +2890,10 @@ class $I extends nA {
2890
2890
  }
2891
2891
  class ug extends nA {
2892
2892
  }
2893
- class Pg extends nA {
2894
- }
2895
2893
  class Vg extends nA {
2896
2894
  }
2895
+ class Pg extends nA {
2896
+ }
2897
2897
  class zg extends $I {
2898
2898
  rawAxis() {
2899
2899
  return NI.LinX;
@@ -3096,7 +3096,7 @@ class BC {
3096
3096
  }
3097
3097
  (function(i) {
3098
3098
  i[i.Vertex = 0] = "Vertex", i[i.Face = 1] = "Face", i[i.Unknown = 2] = "Unknown";
3099
- })(mA || (mA = {}));
3099
+ })(XA || (XA = {}));
3100
3100
  class rC {
3101
3101
  constructor(A, I) {
3102
3102
  this.origin = A, this.dir = I;
@@ -3107,7 +3107,7 @@ class rC {
3107
3107
  }
3108
3108
  class BI {
3109
3109
  constructor(A, I, g, C) {
3110
- this.featureType = mA.Unknown, this.featureId = void 0, this.timeOfImpact = A, this.normal = I, C !== void 0 && (this.featureId = C), g !== void 0 && (this.featureType = g);
3110
+ this.featureType = XA.Unknown, this.featureId = void 0, this.timeOfImpact = A, this.normal = I, C !== void 0 && (this.featureId = C), g !== void 0 && (this.featureType = g);
3111
3111
  }
3112
3112
  static fromRaw(A) {
3113
3113
  if (!A) return null;
@@ -3117,7 +3117,7 @@ class BI {
3117
3117
  }
3118
3118
  class CI {
3119
3119
  constructor(A, I, g, C, Q) {
3120
- this.featureType = mA.Unknown, this.featureId = void 0, this.collider = A, this.timeOfImpact = I, this.normal = g, Q !== void 0 && (this.featureId = Q), C !== void 0 && (this.featureType = C);
3120
+ this.featureType = XA.Unknown, this.featureId = void 0, this.collider = A, this.timeOfImpact = I, this.normal = g, Q !== void 0 && (this.featureId = Q), C !== void 0 && (this.featureType = C);
3121
3121
  }
3122
3122
  static fromRaw(A, I) {
3123
3123
  if (!I) return null;
@@ -3147,7 +3147,7 @@ class EI {
3147
3147
  }
3148
3148
  class QI {
3149
3149
  constructor(A, I, g, C, Q) {
3150
- this.featureType = mA.Unknown, this.featureId = void 0, this.collider = A, this.point = I, this.isInside = g, Q !== void 0 && (this.featureId = Q), C !== void 0 && (this.featureType = C);
3150
+ this.featureType = XA.Unknown, this.featureId = void 0, this.collider = A, this.point = I, this.isInside = g, Q !== void 0 && (this.featureId = Q), C !== void 0 && (this.featureType = C);
3151
3151
  }
3152
3152
  static fromRaw(A, I) {
3153
3153
  if (!I) return null;
@@ -3155,17 +3155,17 @@ class QI {
3155
3155
  return I.free(), g;
3156
3156
  }
3157
3157
  }
3158
- class vA {
3158
+ class uA {
3159
3159
  constructor(A, I, g, C, Q) {
3160
3160
  this.time_of_impact = A, this.witness1 = I, this.witness2 = g, this.normal1 = C, this.normal2 = Q;
3161
3161
  }
3162
3162
  static fromRaw(A, I) {
3163
3163
  if (!I) return null;
3164
- const g = new vA(I.time_of_impact(), S.fromRaw(I.witness1()), S.fromRaw(I.witness2()), S.fromRaw(I.normal1()), S.fromRaw(I.normal2()));
3164
+ const g = new uA(I.time_of_impact(), S.fromRaw(I.witness1()), S.fromRaw(I.witness2()), S.fromRaw(I.normal1()), S.fromRaw(I.normal2()));
3165
3165
  return I.free(), g;
3166
3166
  }
3167
3167
  }
3168
- class iI extends vA {
3168
+ class iI extends uA {
3169
3169
  constructor(A, I, g, C, Q, E) {
3170
3170
  super(I, g, C, Q, E), this.collider = A;
3171
3171
  }
@@ -3182,41 +3182,41 @@ class EC {
3182
3182
  free() {
3183
3183
  this.raw && this.raw.free(), this.raw = void 0;
3184
3184
  }
3185
- castRay(A, I, g, C, Q, E, D, o, w, h, G) {
3186
- let K = S.intoRaw(C.origin), N = S.intoRaw(C.dir), M = RI.fromRaw(g, this.raw.castRay(A.raw, I.raw, g.raw, K, N, Q, E, D, o, w, h, G));
3185
+ castRay(A, I, g, C, Q, E, D, o, w, G, h) {
3186
+ let K = S.intoRaw(C.origin), N = S.intoRaw(C.dir), M = RI.fromRaw(g, this.raw.castRay(A.raw, I.raw, g.raw, K, N, Q, E, D, o, w, G, h));
3187
3187
  return K.free(), N.free(), M;
3188
3188
  }
3189
- castRayAndGetNormal(A, I, g, C, Q, E, D, o, w, h, G) {
3190
- let K = S.intoRaw(C.origin), N = S.intoRaw(C.dir), M = CI.fromRaw(g, this.raw.castRayAndGetNormal(A.raw, I.raw, g.raw, K, N, Q, E, D, o, w, h, G));
3189
+ castRayAndGetNormal(A, I, g, C, Q, E, D, o, w, G, h) {
3190
+ let K = S.intoRaw(C.origin), N = S.intoRaw(C.dir), M = CI.fromRaw(g, this.raw.castRayAndGetNormal(A.raw, I.raw, g.raw, K, N, Q, E, D, o, w, G, h));
3191
3191
  return K.free(), N.free(), M;
3192
3192
  }
3193
- intersectionsWithRay(A, I, g, C, Q, E, D, o, w, h, G, K) {
3193
+ intersectionsWithRay(A, I, g, C, Q, E, D, o, w, G, h, K) {
3194
3194
  let N = S.intoRaw(C.origin), M = S.intoRaw(C.dir);
3195
- this.raw.intersectionsWithRay(A.raw, I.raw, g.raw, N, M, Q, E, (F) => D(CI.fromRaw(g, F)), o, w, h, G, K), N.free(), M.free();
3195
+ this.raw.intersectionsWithRay(A.raw, I.raw, g.raw, N, M, Q, E, (F) => D(CI.fromRaw(g, F)), o, w, G, h, K), N.free(), M.free();
3196
3196
  }
3197
- intersectionWithShape(A, I, g, C, Q, E, D, o, w, h, G) {
3198
- let K = S.intoRaw(C), N = j.intoRaw(Q), M = E.intoRaw(), F = this.raw.intersectionWithShape(A.raw, I.raw, g.raw, K, N, M, D, o, w, h, G);
3197
+ intersectionWithShape(A, I, g, C, Q, E, D, o, w, G, h) {
3198
+ let K = S.intoRaw(C), N = j.intoRaw(Q), M = E.intoRaw(), F = this.raw.intersectionWithShape(A.raw, I.raw, g.raw, K, N, M, D, o, w, G, h);
3199
3199
  return K.free(), N.free(), M.free(), F;
3200
3200
  }
3201
- projectPoint(A, I, g, C, Q, E, D, o, w, h) {
3202
- let G = S.intoRaw(C), K = QI.fromRaw(g, this.raw.projectPoint(A.raw, I.raw, g.raw, G, Q, E, D, o, w, h));
3203
- return G.free(), K;
3201
+ projectPoint(A, I, g, C, Q, E, D, o, w, G) {
3202
+ let h = S.intoRaw(C), K = QI.fromRaw(g, this.raw.projectPoint(A.raw, I.raw, g.raw, h, Q, E, D, o, w, G));
3203
+ return h.free(), K;
3204
3204
  }
3205
3205
  projectPointAndGetFeature(A, I, g, C, Q, E, D, o, w) {
3206
- let h = S.intoRaw(C), G = QI.fromRaw(g, this.raw.projectPointAndGetFeature(A.raw, I.raw, g.raw, h, Q, E, D, o, w));
3207
- return h.free(), G;
3206
+ let G = S.intoRaw(C), h = QI.fromRaw(g, this.raw.projectPointAndGetFeature(A.raw, I.raw, g.raw, G, Q, E, D, o, w));
3207
+ return G.free(), h;
3208
3208
  }
3209
- intersectionsWithPoint(A, I, g, C, Q, E, D, o, w, h) {
3210
- let G = S.intoRaw(C);
3211
- this.raw.intersectionsWithPoint(A.raw, I.raw, g.raw, G, Q, E, D, o, w, h), G.free();
3209
+ intersectionsWithPoint(A, I, g, C, Q, E, D, o, w, G) {
3210
+ let h = S.intoRaw(C);
3211
+ this.raw.intersectionsWithPoint(A.raw, I.raw, g.raw, h, Q, E, D, o, w, G), h.free();
3212
3212
  }
3213
- castShape(A, I, g, C, Q, E, D, o, w, h, G, K, N, M, F) {
3214
- let J = S.intoRaw(C), k = j.intoRaw(Q), y = S.intoRaw(E), U = D.intoRaw(), R = iI.fromRaw(g, this.raw.castShape(A.raw, I.raw, g.raw, J, k, y, U, o, w, h, G, K, N, M, F));
3215
- return J.free(), k.free(), y.free(), U.free(), R;
3213
+ castShape(A, I, g, C, Q, E, D, o, w, G, h, K, N, M, F) {
3214
+ let J = S.intoRaw(C), y = j.intoRaw(Q), k = S.intoRaw(E), U = D.intoRaw(), R = iI.fromRaw(g, this.raw.castShape(A.raw, I.raw, g.raw, J, y, k, U, o, w, G, h, K, N, M, F));
3215
+ return J.free(), y.free(), k.free(), U.free(), R;
3216
3216
  }
3217
- intersectionsWithShape(A, I, g, C, Q, E, D, o, w, h, G, K) {
3217
+ intersectionsWithShape(A, I, g, C, Q, E, D, o, w, G, h, K) {
3218
3218
  let N = S.intoRaw(C), M = j.intoRaw(Q), F = E.intoRaw();
3219
- this.raw.intersectionsWithShape(A.raw, I.raw, g.raw, N, M, F, D, o, w, h, G, K), N.free(), M.free(), F.free();
3219
+ this.raw.intersectionsWithShape(A.raw, I.raw, g.raw, N, M, F, D, o, w, G, h, K), N.free(), M.free(), F.free();
3220
3220
  }
3221
3221
  collidersWithAabbIntersectingAabb(A, I, g, C, Q, E) {
3222
3222
  let D = S.intoRaw(C), o = S.intoRaw(Q);
@@ -3314,20 +3314,20 @@ class DC {
3314
3314
  return S.fromRaw(this.raw.solver_contact_tangent_velocity(A));
3315
3315
  }
3316
3316
  }
3317
- class XA {
3317
+ class vA {
3318
3318
  constructor(A, I, g, C, Q) {
3319
3319
  this.distance = A, this.point1 = I, this.point2 = g, this.normal1 = C, this.normal2 = Q;
3320
3320
  }
3321
3321
  static fromRaw(A) {
3322
3322
  if (!A) return null;
3323
- const I = new XA(A.distance(), S.fromRaw(A.point1()), S.fromRaw(A.point2()), S.fromRaw(A.normal1()), S.fromRaw(A.normal2()));
3323
+ const I = new vA(A.distance(), S.fromRaw(A.point1()), S.fromRaw(A.point2()), S.fromRaw(A.normal1()), S.fromRaw(A.normal2()));
3324
3324
  return A.free(), I;
3325
3325
  }
3326
3326
  }
3327
3327
  class SA {
3328
3328
  static fromRaw(A, I) {
3329
3329
  const g = A.coShapeType(I);
3330
- let C, Q, E, D, o, w, h;
3330
+ let C, Q, E, D, o, w, G;
3331
3331
  switch (g) {
3332
3332
  case aA.Ball:
3333
3333
  return new Ig(A.coRadius(I));
@@ -3346,10 +3346,10 @@ class SA {
3346
3346
  case aA.RoundTriangle:
3347
3347
  return E = A.coVertices(I), Q = A.coRoundRadius(I), new Dg(S.new(E[0], E[1]), S.new(E[2], E[3]), S.new(E[4], E[5]), Q);
3348
3348
  case aA.HalfSpace:
3349
- return h = S.fromRaw(A.coHalfspaceNormal(I)), new gg(h);
3349
+ return G = S.fromRaw(A.coHalfspaceNormal(I)), new gg(G);
3350
3350
  case aA.Voxels:
3351
- const G = A.coVoxelData(I), K = A.coVoxelSize(I);
3352
- return new wg(G, K);
3351
+ const h = A.coVoxelData(I), K = A.coVoxelSize(I);
3352
+ return new wg(h, K);
3353
3353
  case aA.TriMesh:
3354
3354
  E = A.coVertices(I), D = A.coIndices(I);
3355
3355
  const N = A.coTriMeshFlags(I);
@@ -3365,17 +3365,17 @@ class SA {
3365
3365
  throw new Error("unknown shape type: " + g);
3366
3366
  }
3367
3367
  }
3368
- castShape(A, I, g, C, Q, E, D, o, w, h) {
3369
- let G = S.intoRaw(A), K = j.intoRaw(I), N = S.intoRaw(g), M = S.intoRaw(Q), F = j.intoRaw(E), J = S.intoRaw(D), k = this.intoRaw(), y = C.intoRaw(), U = vA.fromRaw(null, k.castShape(G, K, N, y, M, F, J, o, w, h));
3370
- return G.free(), K.free(), N.free(), M.free(), F.free(), J.free(), k.free(), y.free(), U;
3368
+ castShape(A, I, g, C, Q, E, D, o, w, G) {
3369
+ let h = S.intoRaw(A), K = j.intoRaw(I), N = S.intoRaw(g), M = S.intoRaw(Q), F = j.intoRaw(E), J = S.intoRaw(D), y = this.intoRaw(), k = C.intoRaw(), U = uA.fromRaw(null, y.castShape(h, K, N, k, M, F, J, o, w, G));
3370
+ return h.free(), K.free(), N.free(), M.free(), F.free(), J.free(), y.free(), k.free(), U;
3371
3371
  }
3372
3372
  intersectsShape(A, I, g, C, Q) {
3373
- let E = S.intoRaw(A), D = j.intoRaw(I), o = S.intoRaw(C), w = j.intoRaw(Q), h = this.intoRaw(), G = g.intoRaw(), K = h.intersectsShape(E, D, G, o, w);
3374
- return E.free(), D.free(), o.free(), w.free(), h.free(), G.free(), K;
3373
+ let E = S.intoRaw(A), D = j.intoRaw(I), o = S.intoRaw(C), w = j.intoRaw(Q), G = this.intoRaw(), h = g.intoRaw(), K = G.intersectsShape(E, D, h, o, w);
3374
+ return E.free(), D.free(), o.free(), w.free(), G.free(), h.free(), K;
3375
3375
  }
3376
3376
  contactShape(A, I, g, C, Q, E) {
3377
- let D = S.intoRaw(A), o = j.intoRaw(I), w = S.intoRaw(C), h = j.intoRaw(Q), G = this.intoRaw(), K = g.intoRaw(), N = XA.fromRaw(G.contactShape(D, o, K, w, h, E));
3378
- return D.free(), o.free(), w.free(), h.free(), G.free(), K.free(), N;
3377
+ let D = S.intoRaw(A), o = j.intoRaw(I), w = S.intoRaw(C), G = j.intoRaw(Q), h = this.intoRaw(), K = g.intoRaw(), N = vA.fromRaw(h.contactShape(D, o, K, w, G, E));
3378
+ return D.free(), o.free(), w.free(), G.free(), h.free(), K.free(), N;
3379
3379
  }
3380
3380
  containsPoint(A, I, g) {
3381
3381
  let C = S.intoRaw(A), Q = j.intoRaw(I), E = S.intoRaw(g), D = this.intoRaw(), o = D.containsPoint(C, Q, E);
@@ -3386,16 +3386,16 @@ class SA {
3386
3386
  return Q.free(), E.free(), D.free(), o.free(), w;
3387
3387
  }
3388
3388
  intersectsRay(A, I, g, C) {
3389
- let Q = S.intoRaw(I), E = j.intoRaw(g), D = S.intoRaw(A.origin), o = S.intoRaw(A.dir), w = this.intoRaw(), h = w.intersectsRay(Q, E, D, o, C);
3390
- return Q.free(), E.free(), D.free(), o.free(), w.free(), h;
3389
+ let Q = S.intoRaw(I), E = j.intoRaw(g), D = S.intoRaw(A.origin), o = S.intoRaw(A.dir), w = this.intoRaw(), G = w.intersectsRay(Q, E, D, o, C);
3390
+ return Q.free(), E.free(), D.free(), o.free(), w.free(), G;
3391
3391
  }
3392
3392
  castRay(A, I, g, C, Q) {
3393
- let E = S.intoRaw(I), D = j.intoRaw(g), o = S.intoRaw(A.origin), w = S.intoRaw(A.dir), h = this.intoRaw(), G = h.castRay(E, D, o, w, C, Q);
3394
- return E.free(), D.free(), o.free(), w.free(), h.free(), G;
3393
+ let E = S.intoRaw(I), D = j.intoRaw(g), o = S.intoRaw(A.origin), w = S.intoRaw(A.dir), G = this.intoRaw(), h = G.castRay(E, D, o, w, C, Q);
3394
+ return E.free(), D.free(), o.free(), w.free(), G.free(), h;
3395
3395
  }
3396
3396
  castRayAndGetNormal(A, I, g, C, Q) {
3397
- let E = S.intoRaw(I), D = j.intoRaw(g), o = S.intoRaw(A.origin), w = S.intoRaw(A.dir), h = this.intoRaw(), G = BI.fromRaw(h.castRayAndGetNormal(E, D, o, w, C, Q));
3398
- return E.free(), D.free(), o.free(), w.free(), h.free(), G;
3397
+ let E = S.intoRaw(I), D = j.intoRaw(g), o = S.intoRaw(A.origin), w = S.intoRaw(A.dir), G = this.intoRaw(), h = BI.fromRaw(G.castRayAndGetNormal(E, D, o, w, C, Q));
3398
+ return E.free(), D.free(), o.free(), w.free(), G.free(), h;
3399
3399
  }
3400
3400
  }
3401
3401
  (function(i) {
@@ -3408,7 +3408,7 @@ class Ig extends SA {
3408
3408
  super(), this.type = sA.Ball, this.radius = A;
3409
3409
  }
3410
3410
  intoRaw() {
3411
- return e.ball(this.radius);
3411
+ return r.ball(this.radius);
3412
3412
  }
3413
3413
  }
3414
3414
  class gg extends SA {
@@ -3416,7 +3416,7 @@ class gg extends SA {
3416
3416
  super(), this.type = sA.HalfSpace, this.normal = A;
3417
3417
  }
3418
3418
  intoRaw() {
3419
- let A = S.intoRaw(this.normal), I = e.halfspace(A);
3419
+ let A = S.intoRaw(this.normal), I = r.halfspace(A);
3420
3420
  return A.free(), I;
3421
3421
  }
3422
3422
  }
@@ -3425,7 +3425,7 @@ class Cg extends SA {
3425
3425
  super(), this.type = sA.Cuboid, this.halfExtents = S.new(A, I);
3426
3426
  }
3427
3427
  intoRaw() {
3428
- return e.cuboid(this.halfExtents.x, this.halfExtents.y);
3428
+ return r.cuboid(this.halfExtents.x, this.halfExtents.y);
3429
3429
  }
3430
3430
  }
3431
3431
  class Qg extends SA {
@@ -3433,7 +3433,7 @@ class Qg extends SA {
3433
3433
  super(), this.type = sA.RoundCuboid, this.halfExtents = S.new(A, I), this.borderRadius = g;
3434
3434
  }
3435
3435
  intoRaw() {
3436
- return e.roundCuboid(this.halfExtents.x, this.halfExtents.y, this.borderRadius);
3436
+ return r.roundCuboid(this.halfExtents.x, this.halfExtents.y, this.borderRadius);
3437
3437
  }
3438
3438
  }
3439
3439
  class Bg extends SA {
@@ -3441,7 +3441,7 @@ class Bg extends SA {
3441
3441
  super(), this.type = sA.Capsule, this.halfHeight = A, this.radius = I;
3442
3442
  }
3443
3443
  intoRaw() {
3444
- return e.capsule(this.halfHeight, this.radius);
3444
+ return r.capsule(this.halfHeight, this.radius);
3445
3445
  }
3446
3446
  }
3447
3447
  class Eg extends SA {
@@ -3449,7 +3449,7 @@ class Eg extends SA {
3449
3449
  super(), this.type = sA.Segment, this.a = A, this.b = I;
3450
3450
  }
3451
3451
  intoRaw() {
3452
- let A = S.intoRaw(this.a), I = S.intoRaw(this.b), g = e.segment(A, I);
3452
+ let A = S.intoRaw(this.a), I = S.intoRaw(this.b), g = r.segment(A, I);
3453
3453
  return A.free(), I.free(), g;
3454
3454
  }
3455
3455
  }
@@ -3458,7 +3458,7 @@ class ig extends SA {
3458
3458
  super(), this.type = sA.Triangle, this.a = A, this.b = I, this.c = g;
3459
3459
  }
3460
3460
  intoRaw() {
3461
- let A = S.intoRaw(this.a), I = S.intoRaw(this.b), g = S.intoRaw(this.c), C = e.triangle(A, I, g);
3461
+ let A = S.intoRaw(this.a), I = S.intoRaw(this.b), g = S.intoRaw(this.c), C = r.triangle(A, I, g);
3462
3462
  return A.free(), I.free(), g.free(), C;
3463
3463
  }
3464
3464
  }
@@ -3467,7 +3467,7 @@ class Dg extends SA {
3467
3467
  super(), this.type = sA.RoundTriangle, this.a = A, this.b = I, this.c = g, this.borderRadius = C;
3468
3468
  }
3469
3469
  intoRaw() {
3470
- let A = S.intoRaw(this.a), I = S.intoRaw(this.b), g = S.intoRaw(this.c), C = e.roundTriangle(A, I, g, this.borderRadius);
3470
+ let A = S.intoRaw(this.a), I = S.intoRaw(this.b), g = S.intoRaw(this.c), C = r.roundTriangle(A, I, g, this.borderRadius);
3471
3471
  return A.free(), I.free(), g.free(), C;
3472
3472
  }
3473
3473
  }
@@ -3476,7 +3476,7 @@ class og extends SA {
3476
3476
  super(), this.type = sA.Polyline, this.vertices = A, this.indices = I ?? new Uint32Array(0);
3477
3477
  }
3478
3478
  intoRaw() {
3479
- return e.polyline(this.vertices, this.indices);
3479
+ return r.polyline(this.vertices, this.indices);
3480
3480
  }
3481
3481
  }
3482
3482
  class wg extends SA {
@@ -3485,7 +3485,7 @@ class wg extends SA {
3485
3485
  }
3486
3486
  intoRaw() {
3487
3487
  let A, I = S.intoRaw(this.voxelSize);
3488
- return A = this.data instanceof Int32Array ? e.voxels(I, this.data) : e.voxelsFromPoints(I, this.data), I.free(), A;
3488
+ return A = this.data instanceof Int32Array ? r.voxels(I, this.data) : r.voxelsFromPoints(I, this.data), I.free(), A;
3489
3489
  }
3490
3490
  }
3491
3491
  class Gg extends SA {
@@ -3493,7 +3493,7 @@ class Gg extends SA {
3493
3493
  super(), this.type = sA.TriMesh, this.vertices = A, this.indices = I, this.flags = g;
3494
3494
  }
3495
3495
  intoRaw() {
3496
- return e.trimesh(this.vertices, this.indices, this.flags);
3496
+ return r.trimesh(this.vertices, this.indices, this.flags);
3497
3497
  }
3498
3498
  }
3499
3499
  class SI extends SA {
@@ -3501,7 +3501,7 @@ class SI extends SA {
3501
3501
  super(), this.type = sA.ConvexPolygon, this.vertices = A, this.skipConvexHullComputation = !!I;
3502
3502
  }
3503
3503
  intoRaw() {
3504
- return this.skipConvexHullComputation ? e.convexPolyline(this.vertices) : e.convexHull(this.vertices);
3504
+ return this.skipConvexHullComputation ? r.convexPolyline(this.vertices) : r.convexHull(this.vertices);
3505
3505
  }
3506
3506
  }
3507
3507
  class aI extends SA {
@@ -3509,7 +3509,7 @@ class aI extends SA {
3509
3509
  super(), this.type = sA.RoundConvexPolygon, this.vertices = A, this.borderRadius = I, this.skipConvexHullComputation = !!g;
3510
3510
  }
3511
3511
  intoRaw() {
3512
- return this.skipConvexHullComputation ? e.roundConvexPolyline(this.vertices, this.borderRadius) : e.roundConvexHull(this.vertices, this.borderRadius);
3512
+ return this.skipConvexHullComputation ? r.roundConvexPolyline(this.vertices, this.borderRadius) : r.roundConvexHull(this.vertices, this.borderRadius);
3513
3513
  }
3514
3514
  }
3515
3515
  class hg extends SA {
@@ -3517,7 +3517,7 @@ class hg extends SA {
3517
3517
  super(), this.type = sA.HeightField, this.heights = A, this.scale = I;
3518
3518
  }
3519
3519
  intoRaw() {
3520
- let A = S.intoRaw(this.scale), I = e.heightfield(this.heights, A);
3520
+ let A = S.intoRaw(this.scale), I = r.heightfield(this.heights, A);
3521
3521
  return A.free(), I;
3522
3522
  }
3523
3523
  }
@@ -3528,9 +3528,9 @@ class oC {
3528
3528
  free() {
3529
3529
  this.raw && this.raw.free(), this.raw = void 0;
3530
3530
  }
3531
- step(A, I, g, C, Q, E, D, o, w, h, G, K) {
3531
+ step(A, I, g, C, Q, E, D, o, w, G, h, K) {
3532
3532
  let N = S.intoRaw(A);
3533
- G ? this.raw.stepWithEvents(N, I.raw, g.raw, C.raw, Q.raw, E.raw, D.raw, o.raw, w.raw, h.raw, G.raw, K, K ? K.filterContactPair : null, K ? K.filterIntersectionPair : null) : this.raw.step(N, I.raw, g.raw, C.raw, Q.raw, E.raw, D.raw, o.raw, w.raw, h.raw), N.free();
3533
+ h ? this.raw.stepWithEvents(N, I.raw, g.raw, C.raw, Q.raw, E.raw, D.raw, o.raw, w.raw, G.raw, h.raw, K, K ? K.filterContactPair : null, K ? K.filterIntersectionPair : null) : this.raw.step(N, I.raw, g.raw, C.raw, Q.raw, E.raw, D.raw, o.raw, w.raw, G.raw), N.free();
3534
3534
  }
3535
3535
  }
3536
3536
  class XI {
@@ -3541,9 +3541,9 @@ class XI {
3541
3541
  this.raw && this.raw.free(), this.raw = void 0;
3542
3542
  }
3543
3543
  serializeAll(A, I, g, C, Q, E, D, o, w) {
3544
- let h = S.intoRaw(A);
3545
- const G = this.raw.serializeAll(h, I.raw, g.raw, C.raw, Q.raw, E.raw, D.raw, o.raw, w.raw);
3546
- return h.free(), G;
3544
+ let G = S.intoRaw(A);
3545
+ const h = this.raw.serializeAll(G, I.raw, g.raw, C.raw, Q.raw, E.raw, D.raw, o.raw, w.raw);
3546
+ return G.free(), h;
3547
3547
  }
3548
3548
  deserializeAll(A) {
3549
3549
  return cI.fromRaw(this.raw.deserializeAll(A));
@@ -3715,8 +3715,8 @@ class KC {
3715
3715
  }
3716
3716
  }
3717
3717
  class cI {
3718
- constructor(A, I, g, C, Q, E, D, o, w, h, G, K, N) {
3719
- this.gravity = A, this.integrationParameters = new vg(I), this.islands = new BC(g), this.broadPhase = new EC(C), this.narrowPhase = new iC(Q), this.bodies = new Xg(E), this.colliders = new aC(D), this.impulseJoints = new $g(o), this.multibodyJoints = new CC(w), this.ccdSolver = new QC(h), this.physicsPipeline = new oC(G), this.serializationPipeline = new XI(K), this.debugRenderPipeline = new GC(N), this.characterControllers = /* @__PURE__ */ new Set(), this.pidControllers = /* @__PURE__ */ new Set(), this.impulseJoints.finalizeDeserialization(this.bodies), this.bodies.finalizeDeserialization(this.colliders), this.colliders.finalizeDeserialization(this.bodies);
3718
+ constructor(A, I, g, C, Q, E, D, o, w, G, h, K, N) {
3719
+ this.gravity = A, this.integrationParameters = new vg(I), this.islands = new BC(g), this.broadPhase = new EC(C), this.narrowPhase = new iC(Q), this.bodies = new Xg(E), this.colliders = new aC(D), this.impulseJoints = new $g(o), this.multibodyJoints = new CC(w), this.ccdSolver = new QC(G), this.physicsPipeline = new oC(h), this.serializationPipeline = new XI(K), this.debugRenderPipeline = new GC(N), this.characterControllers = /* @__PURE__ */ new Set(), this.pidControllers = /* @__PURE__ */ new Set(), this.impulseJoints.finalizeDeserialization(this.bodies), this.bodies.finalizeDeserialization(this.colliders), this.colliders.finalizeDeserialization(this.bodies);
3720
3720
  }
3721
3721
  free() {
3722
3722
  this.integrationParameters.free(), this.islands.free(), this.broadPhase.free(), this.narrowPhase.free(), this.bodies.free(), this.colliders.free(), this.impulseJoints.free(), this.multibodyJoints.free(), this.ccdSolver.free(), this.physicsPipeline.free(), this.serializationPipeline.free(), this.debugRenderPipeline.free(), this.characterControllers.forEach((A) => A.free()), this.pidControllers.forEach((A) => A.free()), this.integrationParameters = void 0, this.islands = void 0, this.broadPhase = void 0, this.narrowPhase = void 0, this.bodies = void 0, this.colliders = void 0, this.ccdSolver = void 0, this.impulseJoints = void 0, this.multibodyJoints = void 0, this.physicsPipeline = void 0, this.serializationPipeline = void 0, this.debugRenderPipeline = void 0, this.characterControllers = void 0, this.pidControllers = void 0;
@@ -3851,8 +3851,8 @@ class cI {
3851
3851
  intersectionsWithPoint(A, I, g, C, Q, E, D) {
3852
3852
  this.broadPhase.intersectionsWithPoint(this.narrowPhase, this.bodies, this.colliders, A, this.colliders.castClosure(I), g, C, Q ? Q.handle : null, E ? E.handle : null, this.colliders.castClosure(D));
3853
3853
  }
3854
- castShape(A, I, g, C, Q, E, D, o, w, h, G, K) {
3855
- return this.broadPhase.castShape(this.narrowPhase, this.bodies, this.colliders, A, I, g, C, Q, E, D, o, w, h ? h.handle : null, G ? G.handle : null, this.colliders.castClosure(K));
3854
+ castShape(A, I, g, C, Q, E, D, o, w, G, h, K) {
3855
+ return this.broadPhase.castShape(this.narrowPhase, this.bodies, this.colliders, A, I, g, C, Q, E, D, o, w, G ? G.handle : null, h ? h.handle : null, this.colliders.castClosure(K));
3856
3856
  }
3857
3857
  intersectionsWithShape(A, I, g, C, Q, E, D, o, w) {
3858
3858
  this.broadPhase.intersectionsWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, g, this.colliders.castClosure(C), Q, E, D ? D.handle : null, o ? o.handle : null, this.colliders.castClosure(w));
@@ -4192,8 +4192,8 @@ class vI {
4192
4192
  return g.free(), C.free(), Q;
4193
4193
  }
4194
4194
  castShape(A, I, g, C, Q, E, D, o) {
4195
- let w = S.intoRaw(A), h = S.intoRaw(g), G = j.intoRaw(C), K = S.intoRaw(Q), N = I.intoRaw(), M = vA.fromRaw(this.colliderSet, this.colliderSet.raw.coCastShape(this.handle, w, N, h, G, K, E, D, o));
4196
- return w.free(), h.free(), G.free(), K.free(), N.free(), M;
4195
+ let w = S.intoRaw(A), G = S.intoRaw(g), h = j.intoRaw(C), K = S.intoRaw(Q), N = I.intoRaw(), M = uA.fromRaw(this.colliderSet, this.colliderSet.raw.coCastShape(this.handle, w, N, G, h, K, E, D, o));
4196
+ return w.free(), G.free(), h.free(), K.free(), N.free(), M;
4197
4197
  }
4198
4198
  castCollider(A, I, g, C, Q, E) {
4199
4199
  let D = S.intoRaw(A), o = S.intoRaw(g), w = iI.fromRaw(this.colliderSet, this.colliderSet.raw.coCastCollider(this.handle, D, I.handle, o, C, Q, E));
@@ -4204,11 +4204,11 @@ class vI {
4204
4204
  return C.free(), Q.free(), E.free(), D;
4205
4205
  }
4206
4206
  contactShape(A, I, g, C) {
4207
- let Q = S.intoRaw(I), E = j.intoRaw(g), D = A.intoRaw(), o = XA.fromRaw(this.colliderSet.raw.coContactShape(this.handle, D, Q, E, C));
4207
+ let Q = S.intoRaw(I), E = j.intoRaw(g), D = A.intoRaw(), o = vA.fromRaw(this.colliderSet.raw.coContactShape(this.handle, D, Q, E, C));
4208
4208
  return Q.free(), E.free(), D.free(), o;
4209
4209
  }
4210
4210
  contactCollider(A, I) {
4211
- return XA.fromRaw(this.colliderSet.raw.coContactCollider(this.handle, A.handle, I));
4211
+ return vA.fromRaw(this.colliderSet.raw.coContactCollider(this.handle, A.handle, I));
4212
4212
  }
4213
4213
  castRay(A, I, g) {
4214
4214
  let C = S.intoRaw(A.origin), Q = S.intoRaw(A.dir), E = this.colliderSet.raw.coCastRay(this.handle, C, Q, I, g);
@@ -4366,8 +4366,8 @@ class aC {
4366
4366
  if (C && isNaN(g)) throw Error("Cannot create a collider with a parent rigid-body handle that is not a number.");
4367
4367
  let Q = I.shape.intoRaw(), E = S.intoRaw(I.translation), D = j.intoRaw(I.rotation), o = S.intoRaw(I.centerOfMass), w = this.raw.createCollider(I.enabled, Q, E, D, I.massPropsMode, I.mass, o, I.principalAngularInertia, I.density, I.friction, I.restitution, I.frictionCombineRule, I.restitutionCombineRule, I.isSensor, I.collisionGroups, I.solverGroups, I.activeCollisionTypes, I.activeHooks, I.activeEvents, I.contactForceEventThreshold, I.contactSkin, C, C ? g : 0, A.raw);
4368
4368
  Q.free(), E.free(), D.free(), o.free();
4369
- let h = C ? A.get(g) : null, G = new vI(this, w, h, I.shape);
4370
- return this.map.set(w, G), G;
4369
+ let G = C ? A.get(g) : null, h = new vI(this, w, G, I.shape);
4370
+ return this.map.set(w, h), h;
4371
4371
  }
4372
4372
  remove(A, I, g, C) {
4373
4373
  this.raw.remove(A, I.raw, g.raw, C), this.unmap(A);
@@ -4396,21 +4396,21 @@ function lC(i, A, I, g) {
4396
4396
  function E(w) {
4397
4397
  try {
4398
4398
  o(g.next(w));
4399
- } catch (h) {
4400
- Q(h);
4399
+ } catch (G) {
4400
+ Q(G);
4401
4401
  }
4402
4402
  }
4403
4403
  function D(w) {
4404
4404
  try {
4405
4405
  o(g.throw(w));
4406
- } catch (h) {
4407
- Q(h);
4406
+ } catch (G) {
4407
+ Q(G);
4408
4408
  }
4409
4409
  }
4410
4410
  function o(w) {
4411
- var h;
4412
- w.done ? C(w.value) : (h = w.value, h instanceof I ? h : new I(function(G) {
4413
- G(h);
4411
+ var G;
4412
+ w.done ? C(w.value) : (G = w.value, G instanceof I ? G : new I(function(h) {
4413
+ h(G);
4414
4414
  })).then(E, D);
4415
4415
  }
4416
4416
  o((g = g.apply(i, [])).next());
@@ -4420,15 +4420,15 @@ for (var nC = { byteLength: function(i) {
4420
4420
  var A = bg(i), I = A[0], g = A[1];
4421
4421
  return 3 * (I + g) / 4 - g;
4422
4422
  }, toByteArray: function(i) {
4423
- var A, I, g = bg(i), C = g[0], Q = g[1], E = new HC(function(w, h, G) {
4424
- return 3 * (h + G) / 4 - G;
4423
+ var A, I, g = bg(i), C = g[0], Q = g[1], E = new HC(function(w, G, h) {
4424
+ return 3 * (G + h) / 4 - h;
4425
4425
  }(0, C, Q)), D = 0, o = Q > 0 ? C - 4 : C;
4426
4426
  for (I = 0; I < o; I += 4) A = UA[i.charCodeAt(I)] << 18 | UA[i.charCodeAt(I + 1)] << 12 | UA[i.charCodeAt(I + 2)] << 6 | UA[i.charCodeAt(I + 3)], E[D++] = A >> 16 & 255, E[D++] = A >> 8 & 255, E[D++] = 255 & A;
4427
4427
  return Q === 2 && (A = UA[i.charCodeAt(I)] << 2 | UA[i.charCodeAt(I + 1)] >> 4, E[D++] = 255 & A), Q === 1 && (A = UA[i.charCodeAt(I)] << 10 | UA[i.charCodeAt(I + 1)] << 4 | UA[i.charCodeAt(I + 2)] >> 2, E[D++] = A >> 8 & 255, E[D++] = 255 & A), E;
4428
4428
  }, fromByteArray: function(i) {
4429
4429
  for (var A, I = i.length, g = I % 3, C = [], Q = 16383, E = 0, D = I - g; E < D; E += Q) C.push(dC(i, E, E + Q > D ? D : E + Q));
4430
4430
  return g === 1 ? (A = i[I - 1], C.push(LA[A >> 2] + LA[A << 4 & 63] + "==")) : g === 2 && (A = (i[I - 2] << 8) + i[I - 1], C.push(LA[A >> 10] + LA[A >> 4 & 63] + LA[A << 2 & 63] + "=")), C.join("");
4431
- } }, LA = [], UA = [], HC = typeof Uint8Array < "u" ? Uint8Array : Array, dI = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", xA = 0, pC = dI.length; xA < pC; ++xA) LA[xA] = dI[xA], UA[dI.charCodeAt(xA)] = xA;
4431
+ } }, LA = [], UA = [], HC = typeof Uint8Array < "u" ? Uint8Array : Array, dI = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", mA = 0, pC = dI.length; mA < pC; ++mA) LA[mA] = dI[mA], UA[dI.charCodeAt(mA)] = mA;
4432
4432
  function bg(i) {
4433
4433
  var A = i.length;
4434
4434
  if (A % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
@@ -4470,7 +4470,7 @@ var FA = Object.freeze({ __proto__: null, version: bC, reserveMemory: TC, Vector
4470
4470
  return TI;
4471
4471
  }, get JointAxesMask() {
4472
4472
  return ZI;
4473
- }, ImpulseJoint: nA, UnitImpulseJoint: $I, FixedImpulseJoint: ug, RopeImpulseJoint: Pg, SpringImpulseJoint: Vg, PrismaticImpulseJoint: zg, RevoluteImpulseJoint: _g, JointData: bA, ImpulseJointSet: $g, MultibodyJoint: WA, UnitMultibodyJoint: Ag, FixedMultibodyJoint: AC, PrismaticMultibodyJoint: IC, RevoluteMultibodyJoint: gC, MultibodyJointSet: CC, get CoefficientCombineRule() {
4473
+ }, ImpulseJoint: nA, UnitImpulseJoint: $I, FixedImpulseJoint: ug, RopeImpulseJoint: Vg, SpringImpulseJoint: Pg, PrismaticImpulseJoint: zg, RevoluteImpulseJoint: _g, JointData: bA, ImpulseJointSet: $g, MultibodyJoint: WA, UnitMultibodyJoint: Ag, FixedMultibodyJoint: AC, PrismaticMultibodyJoint: IC, RevoluteMultibodyJoint: gC, MultibodyJointSet: CC, get CoefficientCombineRule() {
4474
4474
  return gI;
4475
4475
  }, CCDSolver: QC, IslandManager: BC, BroadPhase: EC, NarrowPhase: iC, TempContactManifold: DC, Shape: SA, get ShapeType() {
4476
4476
  return sA;
@@ -4481,8 +4481,8 @@ var FA = Object.freeze({ __proto__: null, version: bC, reserveMemory: TC, Vector
4481
4481
  }, Collider: vI, get MassPropsMode() {
4482
4482
  return TA;
4483
4483
  }, ColliderDesc: oA, ColliderSet: aC, get FeatureType() {
4484
- return mA;
4485
- }, Ray: rC, RayIntersection: BI, RayColliderIntersection: CI, RayColliderHit: RI, PointProjection: EI, PointColliderProjection: QI, ShapeCastHit: vA, ColliderShapeCastHit: iI, ShapeContact: XA, World: cI, PhysicsPipeline: oC, SerializationPipeline: XI, get ActiveEvents() {
4484
+ return XA;
4485
+ }, Ray: rC, RayIntersection: BI, RayColliderIntersection: CI, RayColliderHit: RI, PointProjection: EI, PointColliderProjection: QI, ShapeCastHit: uA, ColliderShapeCastHit: iI, ShapeContact: vA, World: cI, PhysicsPipeline: oC, SerializationPipeline: XI, get ActiveEvents() {
4486
4486
  return hI;
4487
4487
  }, TempContactForceEvent: SC, EventQueue: qC, get ActiveHooks() {
4488
4488
  return sI;
@@ -4495,10 +4495,10 @@ var FA = Object.freeze({ __proto__: null, version: bC, reserveMemory: TC, Vector
4495
4495
  }, PidController: KC });
4496
4496
  class ZC {
4497
4497
  constructor() {
4498
- _(this, "world", null);
4499
- _(this, "bodies", /* @__PURE__ */ new Map());
4500
- _(this, "colliders", /* @__PURE__ */ new Map());
4501
- _(this, "initialized", !1);
4498
+ V(this, "world", null);
4499
+ V(this, "bodies", /* @__PURE__ */ new Map());
4500
+ V(this, "colliders", /* @__PURE__ */ new Map());
4501
+ V(this, "initialized", !1);
4502
4502
  }
4503
4503
  async init(A) {
4504
4504
  this.initialized || (await FA.init(), this.world = new FA.World(new FA.Vector2(A.x, A.y)), this.initialized = !0);
@@ -4598,33 +4598,35 @@ class ZC {
4598
4598
  }
4599
4599
  class WC {
4600
4600
  constructor() {
4601
- _(this, "artboard", null);
4602
- _(this, "objectStates", /* @__PURE__ */ new Map());
4601
+ V(this, "artboard", null);
4602
+ V(this, "objectStates", /* @__PURE__ */ new Map());
4603
4603
  // Physics State
4604
- _(this, "physicsEngine", null);
4604
+ V(this, "physicsEngine", null);
4605
4605
  // State Machine State
4606
- _(this, "activeStateMachine", null);
4607
- _(this, "inputs", /* @__PURE__ */ new Map());
4606
+ V(this, "activeStateMachine", null);
4607
+ V(this, "inputs", /* @__PURE__ */ new Map());
4608
4608
  // id -> value
4609
- _(this, "inputNameMap", /* @__PURE__ */ new Map());
4609
+ V(this, "inputNameMap", /* @__PURE__ */ new Map());
4610
4610
  // name -> id[] mapping
4611
- _(this, "layerStates", /* @__PURE__ */ new Map());
4612
- _(this, "imageCache", /* @__PURE__ */ new Map());
4613
- _(this, "layout", { fit: "Contain", alignment: "Center" });
4614
- _(this, "onTrigger");
4615
- _(this, "onInputUpdate");
4616
- _(this, "onComponentChange");
4611
+ V(this, "layerStates", /* @__PURE__ */ new Map());
4612
+ V(this, "imageCache", /* @__PURE__ */ new Map());
4613
+ V(this, "layout", { fit: "Contain", alignment: "Center" });
4614
+ V(this, "onTrigger");
4615
+ V(this, "onInputUpdate");
4616
+ V(this, "onComponentChange");
4617
4617
  // Track triggers that were just fired in the current frame
4618
- _(this, "justFiredTriggers", /* @__PURE__ */ new Set());
4618
+ V(this, "justFiredTriggers", /* @__PURE__ */ new Set());
4619
4619
  // Track currently hovered object for Enter/Leave events
4620
- _(this, "lastHoveredObjectId", null);
4621
- _(this, "_lastPointerPos", null);
4620
+ V(this, "lastHoveredObjectId", null);
4621
+ V(this, "_lastPointerPos", null);
4622
4622
  // Interaction State
4623
- _(this, "focusedId", null);
4624
- _(this, "draggingSliderId", null);
4625
- _(this, "activeDropdownId", null);
4623
+ V(this, "focusedId", null);
4624
+ V(this, "draggingSliderId", null);
4625
+ V(this, "activeDropdownId", null);
4626
+ // Physics/Animation State
4627
+ V(this, "objectVelocities", /* @__PURE__ */ new Map());
4626
4628
  // Trigger Management
4627
- _(this, "activeTriggers", /* @__PURE__ */ new Map());
4629
+ V(this, "activeTriggers", /* @__PURE__ */ new Map());
4628
4630
  }
4629
4631
  setTriggerCallback(A) {
4630
4632
  this.onTrigger = A;
@@ -4635,6 +4637,11 @@ class WC {
4635
4637
  setComponentChangeCallback(A) {
4636
4638
  this.onComponentChange = A;
4637
4639
  }
4640
+ updateConstraint(A, I, g) {
4641
+ var Q;
4642
+ const C = (Q = this.artboard) == null ? void 0 : Q.objects.find((E) => E.id === A);
4643
+ C && C.constraints && C.constraints[I] && (C.constraints[I] = { ...C.constraints[I], ...g }, g.useSpring === !1 && this.objectVelocities.delete(A));
4644
+ }
4638
4645
  // ... (setLayout, getActiveStateIds, load, reset skipped for brevity if not changing) ...
4639
4646
  // Helper to update Map AND notify listener
4640
4647
  setInternalInput(A, I) {
@@ -4655,7 +4662,7 @@ class WC {
4655
4662
  }
4656
4663
  reset() {
4657
4664
  if (!this.artboard) return;
4658
- if (this.objectStates.clear(), this.inputs.clear(), this.inputNameMap.clear(), this.layerStates.clear(), this.physicsEngine && (this.physicsEngine.destroy(), this.physicsEngine = null), this.artboard.objects.forEach((I) => {
4665
+ if (this.objectStates.clear(), this.objectVelocities.clear(), this.inputs.clear(), this.inputNameMap.clear(), this.layerStates.clear(), this.physicsEngine && (this.physicsEngine.destroy(), this.physicsEngine = null), this.artboard.objects.forEach((I) => {
4659
4666
  this.objectStates.set(I.id, {
4660
4667
  ...I.transform,
4661
4668
  width: I.width,
@@ -4762,7 +4769,7 @@ class WC {
4762
4769
  const o = E.states.find((w) => w.id === D);
4763
4770
  if (o) {
4764
4771
  let w = null;
4765
- o.animationId && (w = this.artboard.animations.find((h) => h.id === o.animationId) || null), w || (w = this.artboard.animations.find((h) => h.name === o.name || h.id === o.name || o.name === "Entry" && h.name === "Rotate") || null), w && (C.push({ animation: w, state: o }), Q = Math.max(Q, w.duration));
4772
+ o.animationId && (w = this.artboard.animations.find((G) => G.id === o.animationId) || null), w || (w = this.artboard.animations.find((G) => G.name === o.name || G.id === o.name || o.name === "Entry" && G.name === "Rotate") || null), w && (C.push({ animation: w, state: o }), Q = Math.max(Q, w.duration));
4766
4773
  }
4767
4774
  }
4768
4775
  }
@@ -4798,7 +4805,7 @@ class WC {
4798
4805
  } else {
4799
4806
  const o = this.inputNameMap.get(A);
4800
4807
  if (o && o.length > 0) {
4801
- const w = (D = this.activeStateMachine) == null ? void 0 : D.inputs.find((h) => h.id === o[0]);
4808
+ const w = (D = this.activeStateMachine) == null ? void 0 : D.inputs.find((G) => G.id === o[0]);
4802
4809
  w && typeof w.value == "object" && (g = w.value.type);
4803
4810
  }
4804
4811
  }
@@ -4819,10 +4826,10 @@ class WC {
4819
4826
  let D = !1;
4820
4827
  for (const o of E.transitions)
4821
4828
  this.checkConditions(o.conditions) && (g.push(o.targetStateId), D = !0, C = !0, o.conditions && o.conditions.forEach((w) => {
4822
- var G;
4823
- const h = (G = this.activeStateMachine) == null ? void 0 : G.inputs.find((K) => K.id === w.inputId);
4824
- if (h && typeof h.value == "object" && h.value.type === "Number" && (this.setInternalInput(w.inputId, 0), this.inputNameMap.has(h.name))) {
4825
- const K = this.inputNameMap.get(h.name);
4829
+ var h;
4830
+ const G = (h = this.activeStateMachine) == null ? void 0 : h.inputs.find((K) => K.id === w.inputId);
4831
+ if (G && typeof G.value == "object" && G.value.type === "Number" && (this.setInternalInput(w.inputId, 0), this.inputNameMap.has(G.name))) {
4832
+ const K = this.inputNameMap.get(G.name);
4826
4833
  K == null || K.forEach((N) => this.setInternalInput(N, 0));
4827
4834
  }
4828
4835
  }));
@@ -4835,7 +4842,7 @@ class WC {
4835
4842
  const D = (o = this.activeStateMachine) == null ? void 0 : o.inputs.find((w) => w.id === E.inputId);
4836
4843
  if (D && typeof D.value == "object" && D.value.type === "Number" && (this.setInternalInput(E.inputId, 0), this.inputNameMap.has(D.name))) {
4837
4844
  const w = this.inputNameMap.get(D.name);
4838
- w == null || w.forEach((h) => this.setInternalInput(h, 0));
4845
+ w == null || w.forEach((G) => this.setInternalInput(G, 0));
4839
4846
  }
4840
4847
  }));
4841
4848
  }
@@ -4911,18 +4918,18 @@ class WC {
4911
4918
  g.add(A);
4912
4919
  const C = (D = (E = this.activeStateMachine) == null ? void 0 : E.logicNodes) == null ? void 0 : D.find((w) => w.id === A);
4913
4920
  if (C) {
4914
- const w = (h, G) => {
4915
- const K = C.inputs.find((N) => N.id === h);
4916
- return K ? K.sourceId ? this.evaluateLogicTree(K.sourceId, K.sourceHandleId, g) : K.value !== void 0 ? K.value : G : G;
4921
+ const w = (G, h) => {
4922
+ const K = C.inputs.find((N) => N.id === G);
4923
+ return K ? K.sourceId ? this.evaluateLogicTree(K.sourceId, K.sourceHandleId, g) : K.value !== void 0 ? K.value : h : h;
4917
4924
  };
4918
4925
  switch (C.op) {
4919
- case PA.AND:
4926
+ case VA.AND:
4920
4927
  return w("a", !1) && w("b", !1);
4921
- case PA.OR:
4928
+ case VA.OR:
4922
4929
  return w("a", !1) || w("b", !1);
4923
- case PA.NOT:
4930
+ case VA.NOT:
4924
4931
  return !w("in", !1);
4925
- case PA.XOR:
4932
+ case VA.XOR:
4926
4933
  return !!w("a", !1) != !!w("b", !1);
4927
4934
  default:
4928
4935
  return 0;
@@ -4930,12 +4937,12 @@ class WC {
4930
4937
  }
4931
4938
  let Q = this.inputs.get(A);
4932
4939
  if (this.justFiredTriggers.has(A) && (Q = !0), I && Q !== void 0) {
4933
- const w = (o = this.activeStateMachine) == null ? void 0 : o.inputs.find((h) => h.id === A);
4940
+ const w = (o = this.activeStateMachine) == null ? void 0 : o.inputs.find((G) => G.id === A);
4934
4941
  if (w && w.value.type === "Number" && typeof Q == "number") {
4935
- const h = w.value.defaultValue ?? w.value.value;
4936
- if (I === "source-greater") return Q > h;
4937
- if (I === "source-less") return Q < h;
4938
- if (I === "source-equal") return Q === h;
4942
+ const G = w.value.defaultValue ?? w.value.value;
4943
+ if (I === "source-greater") return Q > G;
4944
+ if (I === "source-less") return Q < G;
4945
+ if (I === "source-equal") return Q === G;
4939
4946
  }
4940
4947
  if (I === "source-true") return Q === !0;
4941
4948
  if (I === "source-false") return Q === !1;
@@ -4958,57 +4965,62 @@ class WC {
4958
4965
  }) ? I.time %= I.duration : I.time = I.duration), I.animations.forEach((g) => {
4959
4966
  this.applyAnimation(g.animation, I.time);
4960
4967
  }));
4961
- })), this.solveConstraints(), this.activeTriggers.forEach((I, g) => {
4962
- var C, Q, E, D, o, w, h;
4968
+ })), this.solveConstraints(A), this.activeTriggers.forEach((I, g) => {
4969
+ var C, Q, E, D, o, w, G;
4963
4970
  if (I.phase === "entry")
4964
- I.time += A, I.time >= I.animation.duration && ((E = (Q = (C = this.artboard) == null ? void 0 : C.objects.find((G) => G.id === g)) == null ? void 0 : Q.triggers) == null || E.find((G) => G.id === I.triggerId), I.phase = "hold", I.elapsedHold = 0, I.time = I.animation.duration), this.applyAnimation(I.animation, I.time);
4971
+ I.time += A, I.time >= I.animation.duration && ((E = (Q = (C = this.artboard) == null ? void 0 : C.objects.find((h) => h.id === g)) == null ? void 0 : Q.triggers) == null || E.find((h) => h.id === I.triggerId), I.phase = "hold", I.elapsedHold = 0, I.time = I.animation.duration), this.applyAnimation(I.animation, I.time);
4965
4972
  else if (I.phase === "hold") {
4966
- const G = (w = (o = (D = this.artboard) == null ? void 0 : D.objects.find((N) => N.id === g)) == null ? void 0 : o.triggers) == null ? void 0 : w.find((N) => N.id === I.triggerId), K = (G == null ? void 0 : G.duration) || 0;
4973
+ const h = (w = (o = (D = this.artboard) == null ? void 0 : D.objects.find((N) => N.id === g)) == null ? void 0 : o.triggers) == null ? void 0 : w.find((N) => N.id === I.triggerId), K = (h == null ? void 0 : h.duration) || 0;
4967
4974
  if (I.elapsedHold += A * 1e3, I.elapsedHold >= K)
4968
- if (G != null && G.exitAnimationId) {
4969
- const N = (h = this.artboard) == null ? void 0 : h.animations.find((M) => M.id === G.exitAnimationId);
4975
+ if (h != null && h.exitAnimationId) {
4976
+ const N = (G = this.artboard) == null ? void 0 : G.animations.find((M) => M.id === h.exitAnimationId);
4970
4977
  N ? (I.phase = "exit", I.animation = N, I.time = 0) : this.activeTriggers.delete(g);
4971
4978
  } else
4972
4979
  this.activeTriggers.delete(g);
4973
4980
  } else I.phase === "exit" && (I.time += A, I.time >= I.animation.duration ? this.activeTriggers.delete(g) : this.applyAnimation(I.animation, I.time));
4974
4981
  }));
4975
4982
  }
4976
- solveConstraints() {
4977
- this.artboard && this.artboard.objects.forEach((A) => {
4978
- if (!A.constraints || A.constraints.length === 0) return;
4979
- const I = this.objectStates.get(A.id);
4980
- I && A.constraints.forEach((g) => {
4981
- var Q, E, D, o, w, h;
4982
- const C = g.strength ?? 1;
4983
- if (g.type === "Translation") {
4984
- const G = this.objectStates.get(g.targetId);
4985
- G && (g.copyX && (I.x = I.x + (G.x - I.x) * C), g.copyY && (I.y = I.y + (G.y - I.y) * C), (Q = g.limitX) != null && Q.enabled && (I.x = Math.max(g.limitX.min, Math.min(g.limitX.max, I.x))), (E = g.limitY) != null && E.enabled && (I.y = Math.max(g.limitY.min, Math.min(g.limitY.max, I.y))));
4986
- } else if (g.type === "FollowPointer") {
4987
- const G = ((D = this._lastPointerPos) == null ? void 0 : D.x) ?? I.x, K = ((o = this._lastPointerPos) == null ? void 0 : o.y) ?? I.y;
4988
- I.x = I.x + (G - I.x) * C, I.y = I.y + (K - I.y) * C, (w = g.limitX) != null && w.enabled && (I.x = Math.max(g.limitX.min, Math.min(g.limitX.max, I.x))), (h = g.limitY) != null && h.enabled && (I.y = Math.max(g.limitY.min, Math.min(g.limitY.max, I.y)));
4989
- } else if (g.type === "Distance") {
4990
- const G = this.objectStates.get(g.targetId);
4991
- if (G) {
4992
- const K = I.x - G.x, N = I.y - G.y, M = Math.sqrt(K * K + N * N), F = g.distance || 0;
4993
- let J = M;
4994
- switch (g.mode) {
4983
+ solveConstraints(A) {
4984
+ this.artboard && this.artboard.objects.forEach((I) => {
4985
+ if (!I.constraints || I.constraints.length === 0) return;
4986
+ const g = this.objectStates.get(I.id);
4987
+ g && I.constraints.forEach((C) => {
4988
+ var E, D, o, w, G, h;
4989
+ const Q = C.strength ?? 1;
4990
+ if (C.type === "Translation") {
4991
+ const K = this.objectStates.get(C.targetId);
4992
+ K && (C.copyX && (g.x = g.x + (K.x - g.x) * Q), C.copyY && (g.y = g.y + (K.y - g.y) * Q), (E = C.limitX) != null && E.enabled && (g.x = Math.max(C.limitX.min, Math.min(C.limitX.max, g.x))), (D = C.limitY) != null && D.enabled && (g.y = Math.max(C.limitY.min, Math.min(C.limitY.max, g.y))));
4993
+ } else if (C.type === "FollowPointer") {
4994
+ const K = ((o = this._lastPointerPos) == null ? void 0 : o.x) ?? g.x, N = ((w = this._lastPointerPos) == null ? void 0 : w.y) ?? g.y;
4995
+ if (C.useSpring) {
4996
+ const F = C.stiffness ?? 100, J = C.damping ?? 10, y = C.mass ?? 1, k = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 }, U = -F * (g.x - K), R = -F * (g.y - N), c = -J * k.vx, e = -J * k.vy, L = (U + c) / y, H = (R + e) / y;
4997
+ k.vx += L * A, k.vy += H * A, g.x += k.vx * A, g.y += k.vy * A, this.objectVelocities.set(I.id, k);
4998
+ } else
4999
+ g.x = g.x + (K - g.x) * Q, g.y = g.y + (N - g.y) * Q;
5000
+ (G = C.limitX) != null && G.enabled && (g.x = Math.max(C.limitX.min, Math.min(C.limitX.max, g.x))), (h = C.limitY) != null && h.enabled && (g.y = Math.max(C.limitY.min, Math.min(C.limitY.max, g.y)));
5001
+ } else if (C.type === "Distance") {
5002
+ const K = this.objectStates.get(C.targetId);
5003
+ if (K) {
5004
+ const N = g.x - K.x, M = g.y - K.y, F = Math.sqrt(N * N + M * M), J = C.distance || 0;
5005
+ let y = F;
5006
+ switch (C.mode) {
4995
5007
  case "exact":
4996
- J = F;
5008
+ y = J;
4997
5009
  break;
4998
5010
  case "minimum":
4999
- J = Math.max(F, M);
5011
+ y = Math.max(J, F);
5000
5012
  break;
5001
5013
  case "maximum":
5002
- J = Math.min(F, M);
5014
+ y = Math.min(J, F);
5003
5015
  break;
5004
5016
  case "clamped":
5005
- J = Math.max(0, Math.min(F, M));
5017
+ y = Math.max(0, Math.min(J, F));
5006
5018
  break;
5007
5019
  }
5008
- if (M > 0) {
5009
- const k = J / M;
5010
- I.x = G.x + K * k, I.y = G.y + N * k;
5011
- } else M === 0 && J > 0 && (I.x = G.x + J);
5020
+ if (F > 0) {
5021
+ const k = y / F;
5022
+ g.x = K.x + N * k, g.y = K.y + M * k;
5023
+ } else F === 0 && y > 0 && (g.x = K.x + y);
5012
5024
  }
5013
5025
  }
5014
5026
  });
@@ -5030,17 +5042,17 @@ class WC {
5030
5042
  var o, w;
5031
5043
  if (!this.artboard) return;
5032
5044
  let C = null;
5033
- const Q = (h, G) => {
5034
- let K = G;
5035
- G === "click" ? K = "onClick" : G === "down" ? K = "onPointerDown" : G === "up" ? K = "onPointerUp" : G === "blur" && (K = "onPointerLeave");
5045
+ const Q = (G, h) => {
5046
+ let K = h;
5047
+ h === "click" ? K = "onClick" : h === "down" ? K = "onPointerDown" : h === "up" ? K = "onPointerUp" : h === "blur" && (K = "onPointerLeave");
5036
5048
  const N = /* @__PURE__ */ new Set([K]);
5037
- return G === "move" && N.add("onPointerEnter").add("hover").add("onPointerLeave").add("blur"), K === "onClick" && N.add("click"), K === "onPointerDown" && N.add("pointerDown"), K === "onPointerUp" && N.add("pointerUp"), !!((h.interactions || []).some((J) => N.has(J.event)) || (h.triggers || []).some((J) => N.has(J.eventType)));
5049
+ return h === "move" && N.add("onPointerEnter").add("hover").add("onPointerLeave").add("blur"), K === "onClick" && N.add("click"), K === "onPointerDown" && N.add("pointerDown"), K === "onPointerUp" && N.add("pointerUp"), !!((G.interactions || []).some((J) => N.has(J.event)) || (G.triggers || []).some((J) => N.has(J.eventType)));
5038
5050
  };
5039
5051
  let E = null;
5040
- for (let h = this.artboard.objects.length - 1; h >= 0; h--) {
5041
- const G = this.artboard.objects[h];
5042
- if (this.hitTest(G, I, g) && (E || (E = G), Q(G, A))) {
5043
- C = G;
5052
+ for (let G = this.artboard.objects.length - 1; G >= 0; G--) {
5053
+ const h = this.artboard.objects[G];
5054
+ if (this.hitTest(h, I, g) && (E || (E = h), Q(h, A))) {
5055
+ C = h;
5044
5056
  break;
5045
5057
  }
5046
5058
  }
@@ -5048,44 +5060,44 @@ class WC {
5048
5060
  const D = (C == null ? void 0 : C.id) || null;
5049
5061
  if (A === "move") {
5050
5062
  if (this.draggingSliderId) {
5051
- const h = this.artboard.objects.find((G) => G.id === this.draggingSliderId);
5052
- h && this.updateSliderValueFromPointer(h, I, g);
5063
+ const G = this.artboard.objects.find((h) => h.id === this.draggingSliderId);
5064
+ G && this.updateSliderValueFromPointer(G, I, g);
5053
5065
  return;
5054
5066
  }
5055
5067
  D !== this.lastHoveredObjectId && (console.log(`[Engine] HOVER CHANGE: ${this.lastHoveredObjectId} -> ${D}`), this.lastHoveredObjectId && this.fireEventForObject(this.lastHoveredObjectId, "onPointerLeave"), D && this.fireEventForObject(D, "onPointerEnter"), this.lastHoveredObjectId = D);
5056
5068
  return;
5057
5069
  }
5058
5070
  if ((A === "up" || A === "blur") && (this.draggingSliderId = null), C) {
5059
- let h = A;
5060
- if (A === "click" ? h = "onClick" : A === "down" ? h = "onPointerDown" : A === "up" ? h = "onPointerUp" : A === "blur" && (h = "onPointerLeave"), this.fireEventForObject(C.id, h), C.type === "Component" && C.variant === "toggle_button" && A === "down") {
5061
- const G = C.options || {};
5062
- G.checked = !G.checked, C.inputId && this.setInternalInput(C.inputId, G.checked), this.onComponentChange && this.onComponentChange({
5071
+ let G = A;
5072
+ if (A === "click" ? G = "onClick" : A === "down" ? G = "onPointerDown" : A === "up" ? G = "onPointerUp" : A === "blur" && (G = "onPointerLeave"), this.fireEventForObject(C.id, G), C.type === "Component" && C.variant === "toggle_button" && A === "down") {
5073
+ const h = C.options || {};
5074
+ h.checked = !h.checked, C.inputId && this.setInternalInput(C.inputId, h.checked), this.onComponentChange && this.onComponentChange({
5063
5075
  objectId: C.id,
5064
5076
  componentName: C.name,
5065
5077
  variant: "toggle_button",
5066
5078
  property: "checked",
5067
- value: G.checked
5079
+ value: h.checked
5068
5080
  });
5069
5081
  }
5070
5082
  if (C.type === "Component" && C.variant === "toggle" && A === "down") {
5071
- const G = C.options || {};
5072
- G.checked = !G.checked, C.inputId && this.setInternalInput(C.inputId, G.checked), this.onComponentChange && this.onComponentChange({
5083
+ const h = C.options || {};
5084
+ h.checked = !h.checked, C.inputId && this.setInternalInput(C.inputId, h.checked), this.onComponentChange && this.onComponentChange({
5073
5085
  objectId: C.id,
5074
5086
  componentName: C.name,
5075
5087
  variant: "toggle",
5076
5088
  property: "checked",
5077
- value: G.checked
5089
+ value: h.checked
5078
5090
  });
5079
5091
  }
5080
5092
  if (C.type === "Component" && C.variant === "dropdown" && A === "down") {
5081
- const G = C.options || {}, K = !G.isOpen;
5082
- if (G.isOpen) {
5083
- const N = ((o = C.geometry) == null ? void 0 : o.height) ?? C.height ?? 40, M = G.optionsList || [], F = G.itemHeight || 32, J = G.listPadding ?? 4, k = this.getWorldTransform(C.id), y = g - (k.y + N / 2 + 4);
5084
- if (y >= 0) {
5085
- const U = Math.floor((y - J) / F);
5093
+ const h = C.options || {}, K = !h.isOpen;
5094
+ if (h.isOpen) {
5095
+ const N = ((o = C.geometry) == null ? void 0 : o.height) ?? C.height ?? 40, M = h.optionsList || [], F = h.itemHeight || 32, J = h.listPadding ?? 4, y = this.getWorldTransform(C.id), k = g - (y.y + N / 2 + 4);
5096
+ if (k >= 0) {
5097
+ const U = Math.floor((k - J) / F);
5086
5098
  if (U >= 0 && U < M.length) {
5087
5099
  const R = M[U];
5088
- G.selectedOption = R, G.isOpen = !1, this.activeDropdownId = null, C.inputId && this.setInternalInput(C.inputId, R), this.onComponentChange && this.onComponentChange({
5100
+ h.selectedOption = R, h.isOpen = !1, this.activeDropdownId = null, C.inputId && this.setInternalInput(C.inputId, R), this.onComponentChange && this.onComponentChange({
5089
5101
  objectId: C.id,
5090
5102
  componentName: C.name,
5091
5103
  variant: "dropdown",
@@ -5100,7 +5112,7 @@ class WC {
5100
5112
  const N = this.artboard.objects.find((M) => M.id === this.activeDropdownId);
5101
5113
  N && N.options && (N.options.isOpen = !1);
5102
5114
  }
5103
- G.isOpen = K, this.activeDropdownId = K ? C.id : null;
5115
+ h.isOpen = K, this.activeDropdownId = K ? C.id : null;
5104
5116
  }
5105
5117
  if (C.type === "Component" && C.variant === "button" && A === "down" && this.onComponentChange && this.onComponentChange({
5106
5118
  objectId: C.id,
@@ -5109,8 +5121,8 @@ class WC {
5109
5121
  property: "click",
5110
5122
  value: !0
5111
5123
  }), A === "click") {
5112
- const G = (w = this.artboard) == null ? void 0 : w.objects.find((K) => K.id === C.id);
5113
- (G == null ? void 0 : G.type) === "Component" && G.variant === "inputbox" ? (this.focusedId = C.id, console.log(`[Engine] Focus set to: ${C.id}`)) : this.focusedId = null;
5124
+ const h = (w = this.artboard) == null ? void 0 : w.objects.find((K) => K.id === C.id);
5125
+ (h == null ? void 0 : h.type) === "Component" && h.variant === "inputbox" ? (this.focusedId = C.id, console.log(`[Engine] Focus set to: ${C.id}`)) : this.focusedId = null;
5114
5126
  }
5115
5127
  } else A === "click" && (this.focusedId = null);
5116
5128
  }
@@ -5160,7 +5172,7 @@ class WC {
5160
5172
  const o = (g.triggers || []).find((w) => C.has(w.eventType));
5161
5173
  if (o && o.entryAnimationId) {
5162
5174
  console.log(`[Engine] Trigger matched: ${I} (as ${o.eventType}) -> Animation ${o.entryAnimationId}`);
5163
- const w = this.artboard.animations.find((h) => h.id === o.entryAnimationId);
5175
+ const w = this.artboard.animations.find((G) => G.id === o.entryAnimationId);
5164
5176
  w && (this.activeTriggers.set(g.id, {
5165
5177
  triggerId: o.id,
5166
5178
  animation: w,
@@ -5183,10 +5195,10 @@ class WC {
5183
5195
  scaleY: I.scale_y ?? 1,
5184
5196
  rotation: I.rotation ?? 0
5185
5197
  };
5186
- const C = this.getWorldTransform(g.parentId), Q = C.rotation * (Math.PI / 180), E = Math.cos(Q), D = Math.sin(Q), o = I.x * C.scaleX, w = I.y * C.scaleY, h = C.x + (o * E - w * D), G = C.y + (o * D + w * E);
5198
+ const C = this.getWorldTransform(g.parentId), Q = C.rotation * (Math.PI / 180), E = Math.cos(Q), D = Math.sin(Q), o = I.x * C.scaleX, w = I.y * C.scaleY, G = C.x + (o * E - w * D), h = C.y + (o * D + w * E);
5187
5199
  return {
5188
- x: h,
5189
- y: G,
5200
+ x: G,
5201
+ y: h,
5190
5202
  scaleX: (I.scale_x ?? 1) * C.scaleX,
5191
5203
  scaleY: (I.scale_y ?? 1) * C.scaleY,
5192
5204
  rotation: C.rotation + (I.rotation ?? 0)
@@ -5195,18 +5207,18 @@ class WC {
5195
5207
  hitTest(A, I, g) {
5196
5208
  var U, R;
5197
5209
  if (!this.objectStates.get(A.id)) return !1;
5198
- const Q = ((U = A.geometry) == null ? void 0 : U.width) ?? A.width ?? 100, E = ((R = A.geometry) == null ? void 0 : R.height) ?? A.height ?? 100, D = this.getWorldTransform(A.id), o = I - D.x, w = g - D.y, h = -D.rotation * (Math.PI / 180), G = Math.cos(h), K = Math.sin(h), N = o * G - w * K, M = o * K + w * G, F = D.scaleX, J = D.scaleY, k = Q * Math.abs(F), y = E * Math.abs(J);
5199
- return Math.abs(N) <= k / 2 && Math.abs(M) <= y / 2;
5210
+ const Q = ((U = A.geometry) == null ? void 0 : U.width) ?? A.width ?? 100, E = ((R = A.geometry) == null ? void 0 : R.height) ?? A.height ?? 100, D = this.getWorldTransform(A.id), o = I - D.x, w = g - D.y, G = -D.rotation * (Math.PI / 180), h = Math.cos(G), K = Math.sin(G), N = o * h - w * K, M = o * K + w * h, F = D.scaleX, J = D.scaleY, y = Q * Math.abs(F), k = E * Math.abs(J);
5211
+ return Math.abs(N) <= y / 2 && Math.abs(M) <= k / 2;
5200
5212
  }
5201
5213
  updateSliderValueFromPointer(A, I, g) {
5202
- var L;
5214
+ var e;
5203
5215
  if (!this.objectStates.get(A.id)) return;
5204
- const Q = A.options || {}, E = ((L = A.geometry) == null ? void 0 : L.width) ?? A.width ?? 200, D = this.getWorldTransform(A.id), o = I - D.x, w = g - D.y, h = -D.rotation * (Math.PI / 180), G = Math.cos(h), K = Math.sin(h), N = o * G - w * K, M = Q.thumbWidth ?? 16, F = E - M;
5205
- let k = (N + F / 2) / F;
5206
- k = Math.max(0, Math.min(1, k));
5207
- const y = Q.min ?? 0, U = Q.max ?? 100, R = Q.step || 1;
5208
- let c = y + k * (U - y);
5209
- R > 0 && (c = Math.round(c / R) * R), c = Math.max(y, Math.min(U, c)), Q.value !== c && (Q.value = c, A.inputId && this.setInternalInput(A.inputId, c), this.onComponentChange && this.onComponentChange({
5216
+ const Q = A.options || {}, E = ((e = A.geometry) == null ? void 0 : e.width) ?? A.width ?? 200, D = this.getWorldTransform(A.id), o = I - D.x, w = g - D.y, G = -D.rotation * (Math.PI / 180), h = Math.cos(G), K = Math.sin(G), N = o * h - w * K, M = Q.thumbWidth ?? 16, F = E - M;
5217
+ let y = (N + F / 2) / F;
5218
+ y = Math.max(0, Math.min(1, y));
5219
+ const k = Q.min ?? 0, U = Q.max ?? 100, R = Q.step || 1;
5220
+ let c = k + y * (U - k);
5221
+ R > 0 && (c = Math.round(c / R) * R), c = Math.max(k, Math.min(U, c)), Q.value !== c && (Q.value = c, A.inputId && this.setInternalInput(A.inputId, c), this.onComponentChange && this.onComponentChange({
5210
5222
  objectId: A.id,
5211
5223
  componentName: A.name,
5212
5224
  variant: "slider",
@@ -5216,35 +5228,35 @@ class WC {
5216
5228
  }
5217
5229
  applyAnimation(A, I) {
5218
5230
  A.tracks.forEach((g) => {
5219
- var o, w, h;
5220
- const C = (o = this.artboard) == null ? void 0 : o.objects.find((G) => G.id === g.object_id);
5231
+ var o, w, G;
5232
+ const C = (o = this.artboard) == null ? void 0 : o.objects.find((h) => h.id === g.object_id);
5221
5233
  if (((w = C == null ? void 0 : C.physics) == null ? void 0 : w.enabled) && C.physics.bodyType !== "Static" && (["x", "y", "rotation"].includes(g.property) || g.property.startsWith("transform.")))
5222
5234
  return;
5223
5235
  const E = this.objectStates.get(g.object_id);
5224
5236
  if (!E) return;
5225
5237
  const D = this.interpolate(g.keyframes, I);
5226
5238
  if (g.property.includes(".")) {
5227
- const G = (g.property || "").split(".");
5239
+ const h = (g.property || "").split(".");
5228
5240
  let K = E;
5229
- for (let N = 0; N < G.length - 1; N++) {
5230
- if (!K[G[N]]) {
5241
+ for (let N = 0; N < h.length - 1; N++) {
5242
+ if (!K[h[N]]) {
5231
5243
  let M = C;
5232
5244
  for (let F = 0; F <= N; F++)
5233
- M = M ? M[G[F]] : null;
5234
- K[G[N]] = M ? JSON.parse(JSON.stringify(M)) : {};
5245
+ M = M ? M[h[F]] : null;
5246
+ K[h[N]] = M ? JSON.parse(JSON.stringify(M)) : {};
5235
5247
  }
5236
- K = K[G[N]];
5248
+ K = K[h[N]];
5237
5249
  }
5238
- K[G[G.length - 1]] = D;
5250
+ K[h[h.length - 1]] = D;
5239
5251
  } else
5240
5252
  E[g.property] = D;
5241
- if (this.physicsEngine && ((h = C == null ? void 0 : C.physics) != null && h.enabled) && C.physics.bodyType === "Static")
5253
+ if (this.physicsEngine && ((G = C == null ? void 0 : C.physics) != null && G.enabled) && C.physics.bodyType === "Static")
5242
5254
  if (g.property === "x" || g.property === "transform.x") {
5243
- const G = this.physicsEngine.getPosition(g.object_id);
5244
- G && this.physicsEngine.setPosition(g.object_id, D, G.y);
5255
+ const h = this.physicsEngine.getPosition(g.object_id);
5256
+ h && this.physicsEngine.setPosition(g.object_id, D, h.y);
5245
5257
  } else if (g.property === "y" || g.property === "transform.y") {
5246
- const G = this.physicsEngine.getPosition(g.object_id);
5247
- G && this.physicsEngine.setPosition(g.object_id, G.x, D);
5258
+ const h = this.physicsEngine.getPosition(g.object_id);
5259
+ h && this.physicsEngine.setPosition(g.object_id, h.x, D);
5248
5260
  } else (g.property === "rotation" || g.property === "transform.rotation") && this.physicsEngine.setRotation(g.object_id, D * (Math.PI / 180));
5249
5261
  });
5250
5262
  }
@@ -5268,18 +5280,18 @@ class WC {
5268
5280
  return g.value + (C.value - g.value) * E;
5269
5281
  }
5270
5282
  interpolateColor(A, I, g) {
5271
- const C = (G) => {
5272
- const K = G.replace("#", "");
5283
+ const C = (h) => {
5284
+ const K = h.replace("#", "");
5273
5285
  return {
5274
5286
  r: parseInt(K.substring(0, 2), 16),
5275
5287
  g: parseInt(K.substring(2, 4), 16),
5276
5288
  b: parseInt(K.substring(4, 6), 16)
5277
5289
  };
5278
- }, Q = C(A), E = C(I), D = Math.round(Q.r + (E.r - Q.r) * g), o = Math.round(Q.g + (E.g - Q.g) * g), w = Math.round(Q.b + (E.b - Q.b) * g), h = (G) => {
5279
- const K = Math.max(0, Math.min(255, G)).toString(16);
5290
+ }, Q = C(A), E = C(I), D = Math.round(Q.r + (E.r - Q.r) * g), o = Math.round(Q.g + (E.g - Q.g) * g), w = Math.round(Q.b + (E.b - Q.b) * g), G = (h) => {
5291
+ const K = Math.max(0, Math.min(255, h)).toString(16);
5280
5292
  return K.length === 1 ? "0" + K : K;
5281
5293
  };
5282
- return `#${h(D)}${h(o)}${h(w)}`;
5294
+ return `#${G(D)}${G(o)}${G(w)}`;
5283
5295
  }
5284
5296
  render(A, I, g) {
5285
5297
  if (!this.artboard)
@@ -5295,12 +5307,12 @@ class WC {
5295
5307
  );
5296
5308
  if (A.save(), A.translate(E.tx, E.ty), A.scale(E.scaleX, E.scaleY), A.translate(C / 2, Q / 2), A.fillStyle = this.artboard.backgroundColor || "#000000", A.fillRect(-C / 2, -Q / 2, C, Q), this.artboard.backgroundImage) {
5297
5309
  const w = this.artboard.backgroundImage;
5298
- let h = this.imageCache.get(w);
5299
- if (h || (h = new Image(), h.src = w, this.imageCache.set(w, h)), h.complete && h.naturalWidth > 0) {
5310
+ let G = this.imageCache.get(w);
5311
+ if (G || (G = new Image(), G.src = w, this.imageCache.set(w, G)), G.complete && G.naturalWidth > 0) {
5300
5312
  A.save(), A.globalAlpha = this.artboard.backgroundOpacity ?? 1;
5301
- const G = h.naturalWidth / h.naturalHeight, K = C / Q;
5313
+ const h = G.naturalWidth / G.naturalHeight, K = C / Q;
5302
5314
  let N, M, F, J;
5303
- K > G ? (N = C, M = C / G) : (M = Q, N = Q * G), F = -N / 2, J = -M / 2, A.drawImage(h, F, J, N, M), A.restore();
5315
+ K > h ? (N = C, M = C / h) : (M = Q, N = Q * h), F = -N / 2, J = -M / 2, A.drawImage(G, F, J, N, M), A.restore();
5304
5316
  }
5305
5317
  }
5306
5318
  A.beginPath(), A.rect(-C / 2, -Q / 2, C, Q), A.clip();
@@ -5309,11 +5321,11 @@ class WC {
5309
5321
  let o = 0;
5310
5322
  for (this.artboard.objects.forEach((w) => {
5311
5323
  if (!w.parentId) {
5312
- const h = this.objectStates.get(w.id), G = (h == null ? void 0 : h.geometry) || w.geometry;
5313
- if (G && G.isMask && (h == null ? void 0 : h.visible) !== !1) {
5324
+ const G = this.objectStates.get(w.id), h = (G == null ? void 0 : G.geometry) || w.geometry;
5325
+ if (h && h.isMask && (G == null ? void 0 : G.visible) !== !1) {
5314
5326
  A.save(), this.applyObjectTransform(A, w.id);
5315
- const K = G.width || 0, N = G.height || 0;
5316
- this.applyPath(A, G, K, N), A.clip(), o++;
5327
+ const K = h.width || 0, N = h.height || 0;
5328
+ this.applyPath(A, h, K, N), A.clip(), o++;
5317
5329
  } else
5318
5330
  this.renderObject(A, w, D);
5319
5331
  }
@@ -5323,13 +5335,13 @@ class WC {
5323
5335
  }
5324
5336
  calculateTransform(A, I, g, C, Q, E) {
5325
5337
  let D = 1, o = 1, w = 1;
5326
- const h = g / C, G = A / I;
5338
+ const G = g / C, h = A / I;
5327
5339
  switch (Q) {
5328
5340
  case "Contain":
5329
- G > h ? w = I / C : w = A / g, D = o = w;
5341
+ h > G ? w = I / C : w = A / g, D = o = w;
5330
5342
  break;
5331
5343
  case "Cover":
5332
- G > h ? w = A / g : w = I / C, D = o = w;
5344
+ h > G ? w = A / g : w = I / C, D = o = w;
5333
5345
  break;
5334
5346
  case "Fill":
5335
5347
  D = A / g, o = I / C;
@@ -5365,54 +5377,54 @@ class WC {
5365
5377
  console.warn("No state for object:", I.id);
5366
5378
  return;
5367
5379
  }
5368
- A.roundRect || (A.roundRect = (k, y, U, R, c) => (this.drawRoundRect(A, k, y, U, R, c), A));
5380
+ A.roundRect || (A.roundRect = (y, k, U, R, c) => (this.drawRoundRect(A, y, k, U, R, c), A));
5369
5381
  const Q = C.geometry ? { ...I.geometry, ...C.geometry } : I.geometry, E = C.style ? { ...I.style, ...C.style } : I.style;
5370
5382
  if (C.visible === !1)
5371
5383
  return;
5372
- const D = Q.width || 0, o = Q.height || 0, w = C.x, h = C.y;
5384
+ const D = Q.width || 0, o = Q.height || 0, w = C.x, G = C.y;
5373
5385
  A.save();
5374
- const G = A.globalAlpha, K = C.opacity !== void 0 ? C.opacity : 1;
5375
- A.globalAlpha = G * K;
5386
+ const h = A.globalAlpha, K = C.opacity !== void 0 ? C.opacity : 1;
5387
+ A.globalAlpha = h * K;
5376
5388
  const N = C.compositeOperation || C.blendMode;
5377
5389
  if (N && N !== "Normal") {
5378
- const k = N.toLowerCase();
5379
- ["multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"].includes(k) && (A.globalCompositeOperation = k);
5390
+ const y = N.toLowerCase();
5391
+ ["multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"].includes(y) && (A.globalCompositeOperation = y);
5380
5392
  }
5381
- if (A.translate(w, h), A.rotate(C.rotation * Math.PI / 180), A.scale(C.scale_x, C.scale_y), Q.type === "Text") {
5382
- let k = Q.text || "";
5393
+ if (A.translate(w, G), A.rotate(C.rotation * Math.PI / 180), A.scale(C.scale_x, C.scale_y), Q.type === "Text") {
5394
+ let y = Q.text || "";
5383
5395
  if (Q.textInputId) {
5384
5396
  const t = this.inputs.get(Q.textInputId);
5385
- t !== void 0 && (k = String(t), C.geometry && C.geometry.type === "Text" && (C.geometry.text = k));
5397
+ t !== void 0 && (y = String(t), C.geometry && C.geometry.type === "Text" && (C.geometry.text = y));
5386
5398
  }
5387
- let y = k || "";
5388
- Q.segments && Array.isArray(Q.segments) && (y = Q.segments.map((t) => t && t.text ? t.text : "").join(""));
5399
+ let k = y || "";
5400
+ Q.segments && Array.isArray(Q.segments) && (k = Q.segments.map((t) => t && t.text ? t.text : "").join(""));
5389
5401
  const U = Q.textCase || "none";
5390
- U === "uppercase" ? y = y.toUpperCase() : U === "lowercase" ? y = y.toLowerCase() : U === "capitalize" && (y = y.replace(/\b\w/g, (t) => t.toUpperCase()));
5402
+ U === "uppercase" ? k = k.toUpperCase() : U === "lowercase" ? k = k.toLowerCase() : U === "capitalize" && (k = k.replace(/\b\w/g, (t) => t.toUpperCase()));
5391
5403
  let R = ((J = Q.fontWeight) == null ? void 0 : J.toString()) || "400", c = "normal";
5392
5404
  R.toLowerCase().includes("italic") && (c = "italic", R = R.replace(/italic/gi, "").trim() || "400");
5393
- const L = this.mapFontWeight(R), r = Math.max(1, Q.fontSize || 16);
5394
- A.font = `${c} ${L} ${r}px "${Q.fontFamily || "Inter"}", sans-serif`;
5395
- const p = Q.textVerticalAlign || "top";
5405
+ const e = this.mapFontWeight(R), L = Math.max(1, Q.fontSize || 16);
5406
+ A.font = `${c} ${e} ${L}px "${Q.fontFamily || "Inter"}", sans-serif`;
5407
+ const H = Q.textVerticalAlign || "top";
5396
5408
  let q = -o / 2;
5397
- p === "middle" || p === "center" ? (A.textBaseline = "middle", q = 0) : p === "bottom" ? (A.textBaseline = "bottom", q = o / 2) : (A.textBaseline = "top", q = -o / 2);
5409
+ H === "middle" || H === "center" ? (A.textBaseline = "middle", q = 0) : H === "bottom" ? (A.textBaseline = "bottom", q = o / 2) : (A.textBaseline = "top", q = -o / 2);
5398
5410
  const AA = Q.textAlign || "left";
5399
5411
  A.textAlign = AA;
5400
5412
  let GA = -D / 2;
5401
5413
  AA === "center" && (GA = 0), AA === "right" && (GA = D / 2);
5402
- const v = Q.letterSpacing || 0, W = Q.paragraphSpacing || 0, T = (Q.lineHeight || 1.2) * r, IA = (Q.width || D || 200) + 15, x = (t) => {
5414
+ const v = Q.letterSpacing || 0, W = Q.paragraphSpacing || 0, T = (Q.lineHeight || 1.2) * L, IA = (Q.width || D || 200) + 15, x = (t) => {
5403
5415
  if (v === 0) return A.measureText(t).width;
5404
5416
  let n = 0;
5405
5417
  for (let l = 0; l < t.length; l++)
5406
5418
  n += A.measureText(t[l]).width + v;
5407
5419
  return n - v;
5408
- }, d = [], hA = String(y || "").split(`
5420
+ }, d = [], hA = String(k || "").split(`
5409
5421
  `);
5410
5422
  hA.forEach((t, n) => {
5411
5423
  const l = String(t || "").split(" ");
5412
5424
  let Z = "";
5413
- for (let V = 0; V < l.length; V++) {
5414
- const BA = Z + l[V] + " ";
5415
- x(BA.trim()) > IA && V > 0 ? (d.push({ text: Z.trim(), isParaEnd: !1 }), Z = l[V] + " ") : Z = BA;
5425
+ for (let z = 0; z < l.length; z++) {
5426
+ const BA = Z + l[z] + " ";
5427
+ x(BA.trim()) > IA && z > 0 ? (d.push({ text: Z.trim(), isParaEnd: !1 }), Z = l[z] + " ") : Z = BA;
5416
5428
  }
5417
5429
  d.push({ text: Z.trim(), isParaEnd: n < hA.length - 1 });
5418
5430
  });
@@ -5421,20 +5433,20 @@ class WC {
5421
5433
  const t = d.filter((n, l) => n.isParaEnd && l < d.length - 1).length;
5422
5434
  u += t * W;
5423
5435
  }
5424
- p === "middle" || p === "center" ? kA -= u / 2 - r / 2 : p === "bottom" && (kA -= u - r);
5425
- const m = (t, n, l, Z, V) => {
5436
+ H === "middle" || H === "center" ? kA -= u / 2 - L / 2 : H === "bottom" && (kA -= u - L);
5437
+ const m = (t, n, l, Z, z) => {
5426
5438
  var BA, RA;
5427
5439
  if (v === 0 && (Q.enableSegments !== !0 || !Q.segments || Q.segments.length === 0))
5428
5440
  Z ? A.strokeText(t, n, l) : A.fillText(t, n, l);
5429
5441
  else {
5430
5442
  const CA = x(t);
5431
- let z = n;
5432
- AA === "center" ? z -= CA / 2 : AA === "right" && (z -= CA);
5433
- let EA = z;
5443
+ let _ = n;
5444
+ AA === "center" ? _ -= CA / 2 : AA === "right" && (_ -= CA);
5445
+ let EA = _;
5434
5446
  for (let iA = 0; iA < t.length; iA++) {
5435
5447
  const yA = t[iA];
5436
5448
  if (Q.enableSegments === !0 && Q.segments && Q.segments.length > 0) {
5437
- const tA = V + iA;
5449
+ const tA = z + iA;
5438
5450
  let YA = 0;
5439
5451
  const QA = Q.segments.find((KA) => {
5440
5452
  if (!KA || typeof KA.text != "string") return !1;
@@ -5447,12 +5459,12 @@ class WC {
5447
5459
  Z ? A.strokeStyle = QA.fill.color || A.strokeStyle : A.fillStyle = KA || QA.fill.color || A.fillStyle;
5448
5460
  }
5449
5461
  if (QA.fontSize || QA.fontFamily || QA.fontWeight) {
5450
- const KA = QA.fontWeight ? this.mapFontWeight(QA.fontWeight.toString()) : L, OA = QA.fontSize || r, sg = QA.fontFamily || Q.fontFamily || "Inter";
5462
+ const KA = QA.fontWeight ? this.mapFontWeight(QA.fontWeight.toString()) : e, OA = QA.fontSize || L, sg = QA.fontFamily || Q.fontFamily || "Inter";
5451
5463
  A.font = `${c} ${KA} ${OA}px "${sg}", sans-serif`;
5452
5464
  }
5453
5465
  }
5454
5466
  }
5455
- Z ? A.strokeText(yA, EA, l) : A.fillText(yA, EA, l), Q.enableSegments === !0 && Q.segments && Q.segments.length > 0 && (A.font = `${c} ${L} ${r}px "${Q.fontFamily || "Inter"}", sans-serif`), EA += A.measureText(yA).width + v;
5467
+ Z ? A.strokeText(yA, EA, l) : A.fillText(yA, EA, l), Q.enableSegments === !0 && Q.segments && Q.segments.length > 0 && (A.font = `${c} ${e} ${L}px "${Q.fontFamily || "Inter"}", sans-serif`), EA += A.measureText(yA).width + v;
5456
5468
  }
5457
5469
  }
5458
5470
  };
@@ -5460,9 +5472,9 @@ class WC {
5460
5472
  const t = A.globalAlpha, n = this.createCanvasFill(A, E.fill, D, o);
5461
5473
  A.fillStyle = n || E.fill.color || "#000000", A.globalAlpha = t * (E.fill.opacity ?? 1);
5462
5474
  let l = 0, Z = kA;
5463
- d.forEach((V) => {
5464
- const BA = y.indexOf(V.text, l);
5465
- BA !== -1 && (m(V.text, GA, Z, !1, BA), l = BA + V.text.length, Z += T + (V.isParaEnd ? W : 0));
5475
+ d.forEach((z) => {
5476
+ const BA = k.indexOf(z.text, l);
5477
+ BA !== -1 && (m(z.text, GA, Z, !1, BA), l = BA + z.text.length, Z += T + (z.isParaEnd ? W : 0));
5466
5478
  }), A.globalAlpha = t;
5467
5479
  }
5468
5480
  if (E.stroke && E.stroke.width > 0) {
@@ -5470,38 +5482,38 @@ class WC {
5470
5482
  A.strokeStyle = E.stroke.color, A.lineWidth = E.stroke.width, A.globalAlpha = t * (E.stroke.opacity ?? 1);
5471
5483
  let n = 0, l = kA;
5472
5484
  d.forEach((Z) => {
5473
- const V = y.indexOf(Z.text, n);
5474
- V !== -1 && (m(Z.text, GA, l, !0, V), n = V + Z.text.length, l += T + (Z.isParaEnd ? W : 0));
5485
+ const z = k.indexOf(Z.text, n);
5486
+ z !== -1 && (m(Z.text, GA, l, !0, z), n = z + Z.text.length, l += T + (Z.isParaEnd ? W : 0));
5475
5487
  }), A.globalAlpha = t;
5476
5488
  }
5477
5489
  } else if (Q.type === "Image") {
5478
- const k = Q.src;
5479
- if (k) {
5480
- let y = this.imageCache.get(k);
5481
- if (y || (y = new Image(), y.onload = () => {
5482
- }, y.onerror = () => {
5483
- console.error(`[ExodeUI] Image load failed: ${k.substring(0, 100)}${k.length > 100 ? "..." : ""}`);
5484
- }, y.src = k, this.imageCache.set(k, y)), y.complete && y.naturalWidth > 0) {
5490
+ const y = Q.src;
5491
+ if (y) {
5492
+ let k = this.imageCache.get(y);
5493
+ if (k || (k = new Image(), k.onload = () => {
5494
+ }, k.onerror = () => {
5495
+ console.error(`[ExodeUI] Image load failed: ${y.substring(0, 100)}${y.length > 100 ? "..." : ""}`);
5496
+ }, k.src = y, this.imageCache.set(y, k)), k.complete && k.naturalWidth > 0) {
5485
5497
  const U = Q.corner_radius ?? Q.cornerRadius ?? 0;
5486
- U !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: U }, D, o), A.clip(), A.drawImage(y, -D / 2, -o / 2, D, o), A.restore()) : A.drawImage(y, -D / 2, -o / 2, D, o);
5498
+ U !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: U }, D, o), A.clip(), A.drawImage(k, -D / 2, -o / 2, D, o), A.restore()) : A.drawImage(k, -D / 2, -o / 2, D, o);
5487
5499
  }
5488
5500
  }
5489
5501
  } else if (Q.type === "SVG") {
5490
- const k = Q.svgContent;
5491
- if (k) {
5492
- const y = E.palette || [], U = I.id + "_" + y.join("_");
5502
+ const y = Q.svgContent;
5503
+ if (y) {
5504
+ const k = E.palette || [], U = I.id + "_" + k.join("_");
5493
5505
  let R = this.imageCache.get(U);
5494
5506
  if (!R) {
5495
5507
  R = new Image();
5496
- let c = k;
5497
- Q.colors && Q.colors.length > 0 && y.length > 0 && Q.colors.forEach((p, q) => {
5498
- if (y[q]) {
5499
- const AA = p.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), GA = new RegExp(AA, "gi");
5500
- c = c.replace(GA, y[q]);
5508
+ let c = y;
5509
+ Q.colors && Q.colors.length > 0 && k.length > 0 && Q.colors.forEach((H, q) => {
5510
+ if (k[q]) {
5511
+ const AA = H.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), GA = new RegExp(AA, "gi");
5512
+ c = c.replace(GA, k[q]);
5501
5513
  }
5502
5514
  });
5503
- const L = new Blob([c], { type: "image/svg+xml" }), r = URL.createObjectURL(L);
5504
- R.src = r, this.imageCache.set(U, R);
5515
+ const e = new Blob([c], { type: "image/svg+xml" }), L = URL.createObjectURL(e);
5516
+ R.src = L, this.imageCache.set(U, R);
5505
5517
  }
5506
5518
  if (R.complete && R.naturalWidth > 0) {
5507
5519
  const c = Q.corner_radius ?? Q.cornerRadius ?? 0;
@@ -5513,54 +5525,54 @@ class WC {
5513
5525
  else if (I.type === "Shape") {
5514
5526
  if (this.applyPath(A, Q, D, o), A.save(), E.shadow && E.shadow.opacity > 0) {
5515
5527
  if (A.shadowColor = E.shadow.color, E.shadow.opacity < 1 && E.shadow.color.startsWith("#")) {
5516
- const k = parseInt(E.shadow.color.slice(1, 3), 16), y = parseInt(E.shadow.color.slice(3, 5), 16), U = parseInt(E.shadow.color.slice(5, 7), 16);
5517
- A.shadowColor = `rgba(${k}, ${y}, ${U}, ${E.shadow.opacity})`;
5528
+ const y = parseInt(E.shadow.color.slice(1, 3), 16), k = parseInt(E.shadow.color.slice(3, 5), 16), U = parseInt(E.shadow.color.slice(5, 7), 16);
5529
+ A.shadowColor = `rgba(${y}, ${k}, ${U}, ${E.shadow.opacity})`;
5518
5530
  }
5519
5531
  A.shadowBlur = E.shadow.blur, A.shadowOffsetX = E.shadow.offsetX, A.shadowOffsetY = E.shadow.offsetY;
5520
5532
  }
5521
5533
  if (E.blur && E.blur.amount > 0 && (A.filter = `blur(${E.blur.amount}px)`), E.fill) {
5522
- const k = A.globalAlpha, y = this.createCanvasFill(A, E.fill, D, o);
5523
- y ? A.fillStyle = y : A.fillStyle = E.fill.color || "transparent", A.globalAlpha = k * (E.fill.opacity ?? 1), A.fill(), A.globalAlpha = k;
5534
+ const y = A.globalAlpha, k = this.createCanvasFill(A, E.fill, D, o);
5535
+ k ? A.fillStyle = k : A.fillStyle = E.fill.color || "transparent", A.globalAlpha = y * (E.fill.opacity ?? 1), A.fill(), A.globalAlpha = y;
5524
5536
  }
5525
5537
  if (E.stroke && E.stroke.width > 0) {
5526
- const k = A.globalAlpha;
5527
- A.strokeStyle = E.stroke.color, A.lineWidth = E.stroke.width, A.globalAlpha = k * (E.stroke.opacity ?? 1), A.stroke(), A.globalAlpha = k;
5538
+ const y = A.globalAlpha;
5539
+ A.strokeStyle = E.stroke.color, A.lineWidth = E.stroke.width, A.globalAlpha = y * (E.stroke.opacity ?? 1), A.stroke(), A.globalAlpha = y;
5528
5540
  }
5529
5541
  A.restore();
5530
5542
  } else if (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) {
5531
- const k = C.width !== void 0 ? C.width : I.width || D, y = C.height !== void 0 ? C.height : I.height || o, U = C.cornerRadius !== void 0 ? C.cornerRadius : I.cornerRadius ?? I.corner_radius ?? 0;
5543
+ const y = C.width !== void 0 ? C.width : I.width || D, k = C.height !== void 0 ? C.height : I.height || o, U = C.cornerRadius !== void 0 ? C.cornerRadius : I.cornerRadius ?? I.corner_radius ?? 0;
5532
5544
  if (A.save(), E.shadow && E.shadow.opacity > 0) {
5533
5545
  if (A.shadowColor = E.shadow.color, E.shadow.opacity < 1 && E.shadow.color.startsWith("#")) {
5534
- const c = parseInt(E.shadow.color.slice(1, 3), 16), L = parseInt(E.shadow.color.slice(3, 5), 16), r = parseInt(E.shadow.color.slice(5, 7), 16);
5535
- A.shadowColor = `rgba(${c}, ${L}, ${r}, ${E.shadow.opacity})`;
5546
+ const c = parseInt(E.shadow.color.slice(1, 3), 16), e = parseInt(E.shadow.color.slice(3, 5), 16), L = parseInt(E.shadow.color.slice(5, 7), 16);
5547
+ A.shadowColor = `rgba(${c}, ${e}, ${L}, ${E.shadow.opacity})`;
5536
5548
  }
5537
5549
  A.shadowBlur = E.shadow.blur, A.shadowOffsetX = E.shadow.offsetX, A.shadowOffsetY = E.shadow.offsetY;
5538
5550
  }
5539
- if (A.beginPath(), A.roundRect(-k / 2, -y / 2, k, y, U), E.fill && E.fill.type !== "None") {
5540
- const c = A.globalAlpha, L = this.createCanvasFill(A, E.fill, k, y);
5541
- A.fillStyle = L || E.fill.color || "transparent", A.globalAlpha = c * (E.fill.opacity ?? 1), A.fill(), A.globalAlpha = c;
5551
+ if (A.beginPath(), A.roundRect(-y / 2, -k / 2, y, k, U), E.fill && E.fill.type !== "None") {
5552
+ const c = A.globalAlpha, e = this.createCanvasFill(A, E.fill, y, k);
5553
+ A.fillStyle = e || E.fill.color || "transparent", A.globalAlpha = c * (E.fill.opacity ?? 1), A.fill(), A.globalAlpha = c;
5542
5554
  }
5543
5555
  if (E.stroke && E.stroke.width > 0 && E.stroke.isEnabled !== !1) {
5544
5556
  const c = A.globalAlpha;
5545
5557
  A.strokeStyle = E.stroke.color || "#000000", A.lineWidth = E.stroke.width, A.globalAlpha = c * (E.stroke.opacity ?? 1), A.stroke(), A.globalAlpha = c;
5546
5558
  }
5547
- A.restore(), (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0 && (A.save(), A.beginPath(), A.roundRect(-k / 2, -y / 2, k, y, U), A.clip());
5559
+ A.restore(), (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0 && (A.save(), A.beginPath(), A.roundRect(-y / 2, -k / 2, y, k, U), A.clip());
5548
5560
  } else I.type === "Component" && I.variant === "inputbox" ? this.renderInputBox(A, I) : I.type === "Component" && I.variant === "button" ? this.renderButton(A, I) : I.type === "Component" && I.variant === "toggle_button" ? this.renderToggleButton(A, I) : I.type === "Component" && I.variant === "toggle" ? this.renderToggle(A, I) : I.type === "Component" && I.variant === "slider" ? this.renderSlider(A, I) : I.type === "Component" && I.variant === "dropdown" && this.renderDropdown(A, I);
5549
5561
  const M = (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) && (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0;
5550
5562
  if (I.children && I.children.length > 0) {
5551
- let k = 0;
5552
- for (I.children.forEach((y) => {
5553
- const U = g.get(y);
5563
+ let y = 0;
5564
+ for (I.children.forEach((k) => {
5565
+ const U = g.get(k);
5554
5566
  if (!U) return;
5555
- const R = this.objectStates.get(y), c = (R == null ? void 0 : R.geometry) || U.geometry;
5567
+ const R = this.objectStates.get(k), c = (R == null ? void 0 : R.geometry) || U.geometry;
5556
5568
  if (c && c.isMask && (R == null ? void 0 : R.visible) !== !1) {
5557
- A.save(), this.applyObjectTransform(A, y);
5558
- const L = c.width || 0, r = c.height || 0;
5559
- this.applyPath(A, c, L, r), A.clip(), k++;
5569
+ A.save(), this.applyObjectTransform(A, k);
5570
+ const e = c.width || 0, L = c.height || 0;
5571
+ this.applyPath(A, c, e, L), A.clip(), y++;
5560
5572
  } else
5561
5573
  this.renderObject(A, U, g);
5562
- }); k > 0; )
5563
- A.restore(), k--;
5574
+ }); y > 0; )
5575
+ A.restore(), y--;
5564
5576
  }
5565
5577
  const F = I.clipsContent !== !1 || I.clipContent === !0;
5566
5578
  (M || F) && M && A.restore(), A.restore();
@@ -5580,8 +5592,8 @@ class WC {
5580
5592
  else if (I.type === "Star") {
5581
5593
  const Q = I.inner_radius || 20, E = I.outer_radius || 50, D = I.points || 5;
5582
5594
  for (let o = 0; o < D * 2; o++) {
5583
- const w = o * Math.PI / D - Math.PI / 2, h = o % 2 === 0 ? E : Q, G = h * Math.cos(w), K = h * Math.sin(w);
5584
- o === 0 ? A.moveTo(G, K) : A.lineTo(G, K);
5595
+ const w = o * Math.PI / D - Math.PI / 2, G = o % 2 === 0 ? E : Q, h = G * Math.cos(w), K = G * Math.sin(w);
5596
+ o === 0 ? A.moveTo(h, K) : A.lineTo(h, K);
5585
5597
  }
5586
5598
  A.closePath();
5587
5599
  } else I.type === "Path" && I.points && (I.points.forEach((Q, E) => {
@@ -5589,14 +5601,14 @@ class WC {
5589
5601
  }), I.is_closed && A.closePath());
5590
5602
  }
5591
5603
  renderInputBox(A, I) {
5592
- var Z, V, BA, RA;
5593
- const g = ((V = (Z = I.objectStates) == null ? void 0 : Z.get(I.id)) == null ? void 0 : V.options) || I.options || {}, C = ((BA = I.geometry) == null ? void 0 : BA.width) || 250, Q = ((RA = I.geometry) == null ? void 0 : RA.height) || 45, E = this.focusedId === I.id, D = this.lastHoveredObjectId === I.id, o = g.previewState || "default", w = o !== "default" ? o : E ? "focused" : D ? "hovered" : "default", h = g.label || { visible: !0, text: "Label" }, G = g.helperText || { visible: !1, text: "Helper text" }, K = g.leftIcon || { visible: !1 }, N = g.rightIcon || { visible: !1 }, M = g.multiline === !0, F = g.cornerRadius ?? 8, J = g.corners || { tl: F, tr: F, bl: F, br: F }, k = [J.tl, J.tr, J.br, J.bl];
5594
- let y = g.backgroundColor || "rgba(31, 41, 55, 1)", U = g.borderColor || "rgba(55, 65, 81, 1)", R = g.borderWidth ?? 1.5, c = g.color || "#ffffff", L = g.placeholderColor || "rgba(156, 163, 175, 1)", r = g.fontSize || 14;
5595
- const p = `${w}Style`, q = g[p];
5596
- q ? (q.backgroundColor !== void 0 && (y = q.backgroundColor), q.borderColor !== void 0 && (U = q.borderColor), q.borderWidth !== void 0 && (R = q.borderWidth), q.color !== void 0 && (c = q.color), q.placeholderColor !== void 0 && (L = q.placeholderColor), q.fontSize !== void 0 && (r = q.fontSize)) : w === "focused" ? (U = g.focusBorderColor || "rgba(59, 130, 246, 1)", R = Math.max(R, 2)) : w === "hovered" || w === "hover" ? (U = g.hoverBorderColor || U, y = g.hoverBackgroundColor || y) : w === "disabled" ? (y = g.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", U = g.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : w === "error" && (U = "rgba(239, 68, 68, 1)", R = Math.max(R, 2)), A.beginPath(), A.roundRect(-C / 2, -Q / 2, C, Q, k), A.fillStyle = y, A.fill(), R > 0 && (A.strokeStyle = U, A.lineWidth = R, A.stroke(), (w === "focused" || w === "focus") && (A.save(), A.beginPath(), A.roundRect(-C / 2 - 2, -Q / 2 - 2, C + 4, Q + 4, k.map((CA) => CA + 2)), A.strokeStyle = "rgba(59, 130, 246, 0.3)", A.lineWidth = 2, A.stroke(), A.restore()));
5597
- const AA = (CA, z) => {
5604
+ var Z, z, BA, RA;
5605
+ const g = ((z = (Z = I.objectStates) == null ? void 0 : Z.get(I.id)) == null ? void 0 : z.options) || I.options || {}, C = ((BA = I.geometry) == null ? void 0 : BA.width) || 250, Q = ((RA = I.geometry) == null ? void 0 : RA.height) || 45, E = this.focusedId === I.id, D = this.lastHoveredObjectId === I.id, o = g.previewState || "default", w = o !== "default" ? o : E ? "focused" : D ? "hovered" : "default", G = g.label || { visible: !0, text: "Label" }, h = g.helperText || { visible: !1, text: "Helper text" }, K = g.leftIcon || { visible: !1 }, N = g.rightIcon || { visible: !1 }, M = g.multiline === !0, F = g.cornerRadius ?? 8, J = g.corners || { tl: F, tr: F, bl: F, br: F }, y = [J.tl, J.tr, J.br, J.bl];
5606
+ let k = g.backgroundColor || "rgba(31, 41, 55, 1)", U = g.borderColor || "rgba(55, 65, 81, 1)", R = g.borderWidth ?? 1.5, c = g.color || "#ffffff", e = g.placeholderColor || "rgba(156, 163, 175, 1)", L = g.fontSize || 14;
5607
+ const H = `${w}Style`, q = g[H];
5608
+ q ? (q.backgroundColor !== void 0 && (k = q.backgroundColor), q.borderColor !== void 0 && (U = q.borderColor), q.borderWidth !== void 0 && (R = q.borderWidth), q.color !== void 0 && (c = q.color), q.placeholderColor !== void 0 && (e = q.placeholderColor), q.fontSize !== void 0 && (L = q.fontSize)) : w === "focused" ? (U = g.focusBorderColor || "rgba(59, 130, 246, 1)", R = Math.max(R, 2)) : w === "hovered" || w === "hover" ? (U = g.hoverBorderColor || U, k = g.hoverBackgroundColor || k) : w === "disabled" ? (k = g.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", U = g.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : w === "error" && (U = "rgba(239, 68, 68, 1)", R = Math.max(R, 2)), A.beginPath(), A.roundRect(-C / 2, -Q / 2, C, Q, y), A.fillStyle = k, A.fill(), R > 0 && (A.strokeStyle = U, A.lineWidth = R, A.stroke(), (w === "focused" || w === "focus") && (A.save(), A.beginPath(), A.roundRect(-C / 2 - 2, -Q / 2 - 2, C + 4, Q + 4, y.map((CA) => CA + 2)), A.strokeStyle = "rgba(59, 130, 246, 0.3)", A.lineWidth = 2, A.stroke(), A.restore()));
5609
+ const AA = (CA, _) => {
5598
5610
  if (!CA.visible || !CA.svgPath) return;
5599
- const EA = CA.size || 14, iA = CA.offset ?? 16, yA = CA.color || "#ffffff", tA = z ? -(C / 2) + iA : C / 2 - iA, YA = CA.svgPath;
5611
+ const EA = CA.size || 14, iA = CA.offset ?? 16, yA = CA.color || "#ffffff", tA = _ ? -(C / 2) + iA : C / 2 - iA, YA = CA.svgPath;
5600
5612
  if (A.save(), A.translate(tA, 0), !YA.startsWith("<svg")) {
5601
5613
  const QA = new Path2D(YA), KA = EA / 24;
5602
5614
  A.scale(KA, KA), A.translate(-12, -12), A.fillStyle = yA, A.fill(QA);
@@ -5604,13 +5616,13 @@ class WC {
5604
5616
  A.restore();
5605
5617
  };
5606
5618
  AA(K, !0), AA(N, !1);
5607
- const GA = g.text || "", v = g.placeholder || "Enter text...", W = !GA, T = GA || v, IA = W ? L : c, x = r, d = g.fontFamily || "Inter", hA = g.fontWeight || 400;
5619
+ const GA = g.text || "", v = g.placeholder || "Enter text...", W = !GA, T = GA || v, IA = W ? e : c, x = L, d = g.fontFamily || "Inter", hA = g.fontWeight || 400;
5608
5620
  A.font = `${hA} ${x}px "${d}", sans-serif`, A.fillStyle = IA, A.textAlign = "left", A.textBaseline = M ? "top" : "middle";
5609
5621
  const kA = g.inputPadding ?? 16, u = K.visible ? (K.offset ?? 16) + (K.size || 14) / 2 + 8 : kA, m = N.visible ? (N.offset ?? 16) + (N.size || 14) / 2 + 8 : kA, t = -(C / 2) + u, n = C - u - m, l = g.inputType === "password" ? "•".repeat(T.length) : T;
5610
5622
  if (A.save(), A.beginPath(), A.rect(t - 2, -Q / 2 + 4, n + 4, Q - 8), A.clip(), M) {
5611
5623
  const CA = l.split(`
5612
5624
  `);
5613
- let z = -Q / 2 + kA;
5625
+ let _ = -Q / 2 + kA;
5614
5626
  const EA = x * 1.2;
5615
5627
  let iA = 0;
5616
5628
  CA.forEach((yA, tA) => {
@@ -5618,36 +5630,36 @@ class WC {
5618
5630
  let QA = "";
5619
5631
  for (let KA = 0; KA < YA.length; KA++) {
5620
5632
  const OA = QA + YA[KA] + " ";
5621
- A.measureText(OA).width > n && KA > 0 ? (A.fillText(QA, t, z), QA = YA[KA] + " ", z += EA) : QA = OA;
5633
+ A.measureText(OA).width > n && KA > 0 ? (A.fillText(QA, t, _), QA = YA[KA] + " ", _ += EA) : QA = OA;
5622
5634
  }
5623
- A.fillText(QA, t, z), iA = A.measureText(QA).width, tA < CA.length - 1 && (z += EA, iA = 0);
5624
- }), E && !W && Math.floor(performance.now() / 500) % 2 === 0 && A.fillRect(t + iA, z, 1.5, x);
5635
+ A.fillText(QA, t, _), iA = A.measureText(QA).width, tA < CA.length - 1 && (_ += EA, iA = 0);
5636
+ }), E && !W && Math.floor(performance.now() / 500) % 2 === 0 && A.fillRect(t + iA, _, 1.5, x);
5625
5637
  } else {
5626
- const z = A.measureText(l).width;
5638
+ const _ = A.measureText(l).width;
5627
5639
  let EA = 0;
5628
- if (z > n && (EA = z - n), A.fillText(l, t - EA, 0), E && !W && Math.floor(performance.now() / 500) % 2 === 0) {
5629
- const yA = t + z - EA;
5640
+ if (_ > n && (EA = _ - n), A.fillText(l, t - EA, 0), E && !W && Math.floor(performance.now() / 500) % 2 === 0) {
5641
+ const yA = t + _ - EA;
5630
5642
  A.fillRect(yA, -(x / 2), 1.5, x);
5631
5643
  }
5632
5644
  }
5633
- if (A.restore(), h.visible !== !1) {
5634
- const CA = h.text || "Label", z = h.fontSize || 12, EA = h.color || "rgba(156, 163, 175, 1)", iA = h.offset ?? 8;
5635
- A.font = `600 ${z}px "${d}", sans-serif`, A.fillStyle = EA, A.textAlign = "left", A.textBaseline = "bottom";
5645
+ if (A.restore(), G.visible !== !1) {
5646
+ const CA = G.text || "Label", _ = G.fontSize || 12, EA = G.color || "rgba(156, 163, 175, 1)", iA = G.offset ?? 8;
5647
+ A.font = `600 ${_}px "${d}", sans-serif`, A.fillStyle = EA, A.textAlign = "left", A.textBaseline = "bottom";
5636
5648
  const yA = -(C / 2), tA = -(Q / 2) - iA;
5637
5649
  A.fillText(CA, yA, tA);
5638
5650
  }
5639
- if (G.visible === !0) {
5640
- const CA = G.text || "Helper text", z = G.fontSize || 11, EA = w === "error" ? "rgba(239, 68, 68, 1)" : G.color || "rgba(156, 163, 175, 1)", iA = G.offset ?? 6;
5641
- A.font = `400 ${z}px "${d}", sans-serif`, A.fillStyle = EA, A.textAlign = "left", A.textBaseline = "top";
5651
+ if (h.visible === !0) {
5652
+ const CA = h.text || "Helper text", _ = h.fontSize || 11, EA = w === "error" ? "rgba(239, 68, 68, 1)" : h.color || "rgba(156, 163, 175, 1)", iA = h.offset ?? 6;
5653
+ A.font = `400 ${_}px "${d}", sans-serif`, A.fillStyle = EA, A.textAlign = "left", A.textBaseline = "top";
5642
5654
  const yA = -(C / 2), tA = Q / 2 + iA;
5643
5655
  A.fillText(CA, yA, tA);
5644
5656
  }
5645
5657
  }
5646
5658
  renderSlider(A, I) {
5647
- const { geometry: g, options: C } = I, Q = g.width || 200, E = C || {}, D = E.value ?? 50, o = E.min ?? 0, h = (E.max ?? 100) - o, G = h === 0 ? 0 : (D - o) / h, K = E.trackHeight || 4, N = E.trackRoundedness ?? 2, M = E.trackShape ?? "Rectangle", F = E.trackPath || "", J = E.activeColor || "#3b82f6", k = E.inactiveColor || "#374151", y = E.thumbShape || "Ellipse", U = E.thumbWidth ?? 16, R = E.thumbHeight ?? 16, c = E.thumbRoundedness ?? 0, L = E.thumbColor || "#ffffff", r = E.thumbPath || "", p = E.thumbIcon || "", q = E.showValueTooltip ?? !1, AA = E.tooltipBgColor || "#333333", GA = E.tooltipColor || "#ffffff", v = E.tooltipOffsetX ?? 0, W = E.tooltipOffsetY ?? -25, T = (u, m, t, n, l, Z, V) => {
5648
- if ((u === "Custom" || u === "Icon") && V)
5659
+ const { geometry: g, options: C } = I, Q = g.width || 200, E = C || {}, D = E.value ?? 50, o = E.min ?? 0, G = (E.max ?? 100) - o, h = G === 0 ? 0 : (D - o) / G, K = E.trackHeight || 4, N = E.trackRoundedness ?? 2, M = E.trackShape ?? "Rectangle", F = E.trackPath || "", J = E.activeColor || "#3b82f6", y = E.inactiveColor || "#374151", k = E.thumbShape || "Ellipse", U = E.thumbWidth ?? 16, R = E.thumbHeight ?? 16, c = E.thumbRoundedness ?? 0, e = E.thumbColor || "#ffffff", L = E.thumbPath || "", H = E.thumbIcon || "", q = E.showValueTooltip ?? !1, AA = E.tooltipBgColor || "#333333", GA = E.tooltipColor || "#ffffff", v = E.tooltipOffsetX ?? 0, W = E.tooltipOffsetY ?? -25, T = (u, m, t, n, l, Z, z) => {
5660
+ if ((u === "Custom" || u === "Icon") && z)
5649
5661
  try {
5650
- const BA = new Path2D(V);
5662
+ const BA = new Path2D(z);
5651
5663
  if (A.save(), A.translate(m, t), u === "Icon") {
5652
5664
  const RA = Math.min(n, l) / 24;
5653
5665
  A.scale(RA, RA), A.translate(-12, -12);
@@ -5667,17 +5679,17 @@ class WC {
5667
5679
  A.moveTo(m, t - l / 2), A.lineTo(m + n / 2, t), A.lineTo(m, t + l / 2), A.lineTo(m - n / 2, t), A.closePath();
5668
5680
  else if (u === "Star") {
5669
5681
  const RA = Math.min(n, l) / 2, CA = RA / 2;
5670
- for (let z = 0; z < 5 * 2; z++) {
5671
- const EA = z % 2 === 0 ? RA : CA, iA = z * Math.PI / 5 - Math.PI / 2;
5682
+ for (let _ = 0; _ < 5 * 2; _++) {
5683
+ const EA = _ % 2 === 0 ? RA : CA, iA = _ * Math.PI / 5 - Math.PI / 2;
5672
5684
  A.lineTo(m + EA * Math.cos(iA), t + EA * Math.sin(iA));
5673
5685
  }
5674
5686
  A.closePath();
5675
5687
  } else u === "Line" && (A.moveTo(m - n / 2, t), A.lineTo(m + n / 2, t));
5676
5688
  A.fill();
5677
5689
  };
5678
- A.fillStyle = k, M === "Line" ? (A.strokeStyle = k, A.lineWidth = K, A.beginPath(), A.moveTo(-Q / 2, 0), A.lineTo(Q / 2, 0), A.stroke()) : T(M, 0, 0, Q, K, N, F);
5679
- const IA = Q * G, x = -Q / 2 + IA;
5680
- if (IA > 0 && (A.fillStyle = J, M === "Line" ? (A.strokeStyle = J, A.lineWidth = K, A.beginPath(), A.moveTo(-Q / 2, 0), A.lineTo(x, 0), A.stroke()) : M === "Rectangle" && (A.beginPath(), A.roundRect(-Q / 2, -K / 2, IA, K, N), A.fill())), A.save(), A.translate(x, 0), A.shadowColor = "rgba(0,0,0,0.2)", A.shadowBlur = 4, A.shadowOffsetY = 1, A.fillStyle = L, T(y, 0, 0, U, R, c, y === "Icon" ? p : r), A.restore(), q) {
5690
+ A.fillStyle = y, M === "Line" ? (A.strokeStyle = y, A.lineWidth = K, A.beginPath(), A.moveTo(-Q / 2, 0), A.lineTo(Q / 2, 0), A.stroke()) : T(M, 0, 0, Q, K, N, F);
5691
+ const IA = Q * h, x = -Q / 2 + IA;
5692
+ if (IA > 0 && (A.fillStyle = J, M === "Line" ? (A.strokeStyle = J, A.lineWidth = K, A.beginPath(), A.moveTo(-Q / 2, 0), A.lineTo(x, 0), A.stroke()) : M === "Rectangle" && (A.beginPath(), A.roundRect(-Q / 2, -K / 2, IA, K, N), A.fill())), A.save(), A.translate(x, 0), A.shadowColor = "rgba(0,0,0,0.2)", A.shadowBlur = 4, A.shadowOffsetY = 1, A.fillStyle = e, T(k, 0, 0, U, R, c, k === "Icon" ? H : L), A.restore(), q) {
5681
5693
  A.save(), A.translate(x + v, W);
5682
5694
  const u = Math.round(D).toString();
5683
5695
  A.font = "10px Inter, sans-serif";
@@ -5700,24 +5712,24 @@ class WC {
5700
5712
  }
5701
5713
  renderDropdown(A, I) {
5702
5714
  if (!this.objectStates.get(I.id)) return;
5703
- const C = I.options || {}, Q = I.geometry.width || 160, E = I.geometry.height || 40, D = -Q / 2, o = -E / 2, w = C.cornerRadius ?? 6, h = C.isOpen || !1, G = C.disabled || !1, K = this.lastHoveredObjectId === I.id;
5715
+ const C = I.options || {}, Q = I.geometry.width || 160, E = I.geometry.height || 40, D = -Q / 2, o = -E / 2, w = C.cornerRadius ?? 6, G = C.isOpen || !1, h = C.disabled || !1, K = this.lastHoveredObjectId === I.id;
5704
5716
  let N = C.backgroundColor || "#ffffff", M = C.borderColor || "#e5e7eb", F = C.color || "#333333";
5705
- G ? (N = C.disabledBackgroundColor || "#f3f4f6", M = C.disabledBorderColor || "#e5e7eb", F = C.disabledColor || "#9ca3af") : h ? (N = C.activeBackgroundColor || N, M = C.activeBorderColor || M, F = C.activeColor || F) : K && (N = C.hoverBackgroundColor || N, M = C.hoverBorderColor || M, F = C.hoverColor || F), A.beginPath();
5717
+ h ? (N = C.disabledBackgroundColor || "#f3f4f6", M = C.disabledBorderColor || "#e5e7eb", F = C.disabledColor || "#9ca3af") : G ? (N = C.activeBackgroundColor || N, M = C.activeBorderColor || M, F = C.activeColor || F) : K && (N = C.hoverBackgroundColor || N, M = C.hoverBorderColor || M, F = C.hoverColor || F), A.beginPath();
5706
5718
  const J = (v, W, T, IA, x, d) => {
5707
5719
  IA < 0 && (IA = 0), x < 0 && (x = 0), d = Math.min(d, Math.min(IA, x) / 2), v.moveTo(W + d, T), v.lineTo(W + IA - d, T), v.arcTo(W + IA, T, W + IA, T + d, d), v.lineTo(W + IA, T + x - d), v.arcTo(W + IA, T + x, W + IA - d, T + x, d), v.lineTo(W + d, T + x), v.arcTo(W, T + x, W, T + x - d, d), v.lineTo(W, T + d), v.arcTo(W, T, W + d, T, d), v.closePath();
5708
5720
  };
5709
5721
  J(A, D, o, Q, E, w), A.fillStyle = N, A.fill();
5710
- const k = C.borderWidth ?? 1;
5711
- k > 0 && (A.strokeStyle = M, A.lineWidth = k, A.stroke());
5712
- const y = 12, U = C.chevronType || "chevron", R = C.chevronSize || 16, c = (h ? C.openIconColor : C.closedIconColor) || C.chevronColor || "#6b7280";
5722
+ const y = C.borderWidth ?? 1;
5723
+ y > 0 && (A.strokeStyle = M, A.lineWidth = y, A.stroke());
5724
+ const k = 12, U = C.chevronType || "chevron", R = C.chevronSize || 16, c = (G ? C.openIconColor : C.closedIconColor) || C.chevronColor || "#6b7280";
5713
5725
  if (U !== "none") {
5714
- const v = D + Q - y - R / 2;
5726
+ const v = D + Q - k - R / 2;
5715
5727
  A.save(), A.translate(v, 0);
5716
- const W = h ? C.openIconAngle ?? 180 : C.closedIconAngle ?? 0;
5728
+ const W = G ? C.openIconAngle ?? 180 : C.closedIconAngle ?? 0;
5717
5729
  if (A.rotate(W * Math.PI / 180), A.strokeStyle = c, A.fillStyle = c, A.lineWidth = 1.5, A.lineCap = "round", A.lineJoin = "round", U === "chevron")
5718
5730
  A.beginPath(), A.moveTo(-R / 2, -R * 0.2), A.lineTo(0, R * 0.2), A.lineTo(R / 2, -R * 0.2), A.stroke();
5719
5731
  else if (U === "custom" || U === "path") {
5720
- const T = h && C.openIconPath || C.closedIconPath;
5732
+ const T = G && C.openIconPath || C.closedIconPath;
5721
5733
  if (T) {
5722
5734
  const IA = new Path2D(T);
5723
5735
  A.save();
@@ -5727,63 +5739,63 @@ class WC {
5727
5739
  }
5728
5740
  A.restore();
5729
5741
  }
5730
- const L = C.selectedOption || C.placeholder || "Select...", r = C.fontSize || 14, p = C.fontWeight || 400, q = C.fontFamily || "Inter, sans-serif";
5731
- A.font = `${p} ${r}px ${q}`, A.fillStyle = !C.selectedOption && C.placeholder ? "#9ca3af" : F, G && (A.fillStyle = C.disabledColor || "#9ca3af"), A.textAlign = "left", A.textBaseline = "middle";
5732
- const AA = U === "none" ? 0 : R + 8, GA = Q - y * 2 - AA;
5733
- if (A.save(), A.beginPath(), A.rect(D + y, o, GA, E), A.clip(), A.fillText(L, D + y, 0), A.restore(), h && !G) {
5742
+ const e = C.selectedOption || C.placeholder || "Select...", L = C.fontSize || 14, H = C.fontWeight || 400, q = C.fontFamily || "Inter, sans-serif";
5743
+ A.font = `${H} ${L}px ${q}`, A.fillStyle = !C.selectedOption && C.placeholder ? "#9ca3af" : F, h && (A.fillStyle = C.disabledColor || "#9ca3af"), A.textAlign = "left", A.textBaseline = "middle";
5744
+ const AA = U === "none" ? 0 : R + 8, GA = Q - k * 2 - AA;
5745
+ if (A.save(), A.beginPath(), A.rect(D + k, o, GA, E), A.clip(), A.fillText(e, D + k, 0), A.restore(), G && !h) {
5734
5746
  const v = o + E + 4, W = C.optionsList || [], T = C.itemHeight || 32, IA = C.listPadding ?? 4, x = W.length * T + IA * 2, d = C.listCornerRadius ?? w;
5735
5747
  A.save(), A.shadowColor = "rgba(0,0,0,0.15)", A.shadowBlur = 12, A.shadowOffsetY = 6, A.beginPath(), J(A, D, v, Q, x, d), A.fillStyle = C.listBackgroundColor || "#ffffff", A.fill();
5736
5748
  const hA = C.listBorderWidth ?? 1;
5737
5749
  hA > 0 && (A.shadowColor = "transparent", A.strokeStyle = C.listBorderColor || M, A.lineWidth = hA, A.stroke()), A.restore();
5738
- const kA = C.itemFontSize || r, u = C.itemFontFamily || q;
5739
- A.font = `${p} ${kA}px ${u}`, W.forEach((m, t) => {
5750
+ const kA = C.itemFontSize || L, u = C.itemFontFamily || q;
5751
+ A.font = `${H} ${kA}px ${u}`, W.forEach((m, t) => {
5740
5752
  const n = v + IA + t * T;
5741
5753
  if (m === C.selectedOption)
5742
5754
  A.fillStyle = C.itemSelectedBackgroundColor || C.listHoverColor || "#f3f4f6", A.fillRect(D + hA, n, Q - hA * 2, T), A.fillStyle = C.itemSelectedColor || C.activeColor || F || "#374151";
5743
5755
  else if (A.fillStyle = C.listTextColor || F || "#333333", this.activeDropdownId === I.id && this._lastPointerPos) {
5744
5756
  const Z = this.objectStates.get(I.id);
5745
5757
  if (Z) {
5746
- const V = this._lastPointerPos.y - (Z.y + E / 2 + 4 + IA), BA = Math.floor(V / T);
5758
+ const z = this._lastPointerPos.y - (Z.y + E / 2 + 4 + IA), BA = Math.floor(z / T);
5747
5759
  t === BA && (A.fillStyle = C.itemHoverBackgroundColor || C.listHoverColor || "#f9fafb", A.fillRect(D + hA, n, Q - hA * 2, T), A.fillStyle = C.itemHoverColor || F);
5748
5760
  }
5749
5761
  }
5750
- A.fillText(m, D + y, n + T / 2);
5762
+ A.fillText(m, D + k, n + T / 2);
5751
5763
  });
5752
5764
  }
5753
5765
  }
5754
5766
  renderButton(A, I) {
5755
- var y, U, R, c;
5756
- const g = I.options || {}, C = ((y = I.geometry) == null ? void 0 : y.width) || 120, Q = ((U = I.geometry) == null ? void 0 : U.height) || 40, E = -C / 2, D = -Q / 2, o = this.lastHoveredObjectId === I.id, w = g.cornerRadius ?? 8, h = g.bgShape || "Rectangle", G = o ? ((R = g.hoverStyle) == null ? void 0 : R.backgroundColor) || g.buttonBgColor || "#3b82f6" : g.buttonBgColor || "#3b82f6", K = g.label || {}, N = o ? ((c = g.hoverStyle) == null ? void 0 : c.textColor) || K.color || "#ffffff" : K.color || "#ffffff", M = g.icon || { enabled: !1 };
5757
- A.save(), A.beginPath(), h === "Rectangle" ? A.roundRect(E, D, C, Q, w) : h === "Ellipse" || h === "Circle" ? A.ellipse(0, 0, C / 2, Q / 2, 0, 0, Math.PI * 2) : h === "Pill" && A.roundRect(E, D, C, Q, Q / 2), A.fillStyle = G, A.fill();
5767
+ var k, U, R, c;
5768
+ const g = I.options || {}, C = ((k = I.geometry) == null ? void 0 : k.width) || 120, Q = ((U = I.geometry) == null ? void 0 : U.height) || 40, E = -C / 2, D = -Q / 2, o = this.lastHoveredObjectId === I.id, w = g.cornerRadius ?? 8, G = g.bgShape || "Rectangle", h = o ? ((R = g.hoverStyle) == null ? void 0 : R.backgroundColor) || g.buttonBgColor || "#3b82f6" : g.buttonBgColor || "#3b82f6", K = g.label || {}, N = o ? ((c = g.hoverStyle) == null ? void 0 : c.textColor) || K.color || "#ffffff" : K.color || "#ffffff", M = g.icon || { enabled: !1 };
5769
+ A.save(), A.beginPath(), G === "Rectangle" ? A.roundRect(E, D, C, Q, w) : G === "Ellipse" || G === "Circle" ? A.ellipse(0, 0, C / 2, Q / 2, 0, 0, Math.PI * 2) : G === "Pill" && A.roundRect(E, D, C, Q, Q / 2), A.fillStyle = h, A.fill();
5758
5770
  const F = K.fontSize || 14, J = K.fontFamily || "Inter";
5759
5771
  A.font = `${K.fontWeight || 400} ${F}px "${J}", sans-serif`, A.fillStyle = N, A.textAlign = "center", A.textBaseline = "middle";
5760
- let k = 0;
5772
+ let y = 0;
5761
5773
  if (M.enabled && M.svgPath) {
5762
- const L = M.size || 16, r = M.gap || 8, p = M.position === "left" ? -(A.measureText(K.text || "").width / 2 + L / 2 + r / 2) : A.measureText(K.text || "").width / 2 + L / 2 + r / 2;
5763
- A.save(), A.translate(p, 0);
5764
- const q = new Path2D(M.svgPath), AA = L / 24;
5765
- A.scale(AA, AA), A.translate(-12, -12), A.fillStyle = M.color || N, A.fill(q), A.restore(), k = M.position === "left" ? L / 2 + r / 2 : -(L / 2 + r / 2);
5774
+ const e = M.size || 16, L = M.gap || 8, H = M.position === "left" ? -(A.measureText(K.text || "").width / 2 + e / 2 + L / 2) : A.measureText(K.text || "").width / 2 + e / 2 + L / 2;
5775
+ A.save(), A.translate(H, 0);
5776
+ const q = new Path2D(M.svgPath), AA = e / 24;
5777
+ A.scale(AA, AA), A.translate(-12, -12), A.fillStyle = M.color || N, A.fill(q), A.restore(), y = M.position === "left" ? e / 2 + L / 2 : -(e / 2 + L / 2);
5766
5778
  }
5767
- A.fillText(K.text || "Button", k, 0), A.restore();
5779
+ A.fillText(K.text || "Button", y, 0), A.restore();
5768
5780
  }
5769
5781
  renderToggleButton(A, I) {
5770
5782
  var F, J;
5771
- const g = I.options || {}, C = g.checked ?? !1, Q = ((F = I.geometry) == null ? void 0 : F.width) || 120, E = ((J = I.geometry) == null ? void 0 : J.height) || 40, D = -Q / 2, o = -E / 2, w = g.cornerRadius ?? 8, h = g.label || {}, G = C ? g.activeColor || "#3b82f6" : g.inactiveColor || "#374151", K = C ? g.activeTextColor || "#ffffff" : g.inactiveTextColor || "#9ca3af";
5772
- A.save(), A.beginPath(), A.roundRect(D, o, Q, E, w), A.fillStyle = G, A.fill();
5773
- const N = h.fontSize || 14, M = h.fontFamily || "Inter";
5774
- A.font = `${h.fontWeight || 600} ${N}px "${M}", sans-serif`, A.fillStyle = K, A.textAlign = "center", A.textBaseline = "middle", A.fillText(h.text || "Toggle", 0, 0), A.restore();
5783
+ const g = I.options || {}, C = g.checked ?? !1, Q = ((F = I.geometry) == null ? void 0 : F.width) || 120, E = ((J = I.geometry) == null ? void 0 : J.height) || 40, D = -Q / 2, o = -E / 2, w = g.cornerRadius ?? 8, G = g.label || {}, h = C ? g.activeColor || "#3b82f6" : g.inactiveColor || "#374151", K = C ? g.activeTextColor || "#ffffff" : g.inactiveTextColor || "#9ca3af";
5784
+ A.save(), A.beginPath(), A.roundRect(D, o, Q, E, w), A.fillStyle = h, A.fill();
5785
+ const N = G.fontSize || 14, M = G.fontFamily || "Inter";
5786
+ A.font = `${G.fontWeight || 600} ${N}px "${M}", sans-serif`, A.fillStyle = K, A.textAlign = "center", A.textBaseline = "middle", A.fillText(G.text || "Toggle", 0, 0), A.restore();
5775
5787
  }
5776
5788
  renderToggle(A, I) {
5777
- var k, y;
5778
- const g = I.options || {}, C = ((k = I.geometry) == null ? void 0 : k.width) || 52, Q = ((y = I.geometry) == null ? void 0 : y.height) || 30, E = -C / 2, D = -Q / 2, o = g.checked ?? !1, w = g.cornerRadius ?? Q / 2;
5789
+ var y, k;
5790
+ const g = I.options || {}, C = ((y = I.geometry) == null ? void 0 : y.width) || 52, Q = ((k = I.geometry) == null ? void 0 : k.height) || 30, E = -C / 2, D = -Q / 2, o = g.checked ?? !1, w = g.cornerRadius ?? Q / 2;
5779
5791
  A.beginPath(), A.roundRect(E, D, C, Q, w), A.fillStyle = o ? g.activeColor || "#10b981" : g.inactiveColor || "#374151", g.disabled && (A.globalAlpha *= 0.5), A.fill();
5780
- const h = 3, G = Q - h * 2, K = G / 2, N = E + h, M = E + C - h - G, F = o ? M : N, J = D + h;
5792
+ const G = 3, h = Q - G * 2, K = h / 2, N = E + G, M = E + C - G - h, F = o ? M : N, J = D + G;
5781
5793
  if (A.beginPath(), A.arc(F + K, J + K, K, 0, Math.PI * 2), A.fillStyle = g.knobColor || "#ffffff", A.fill(), g.disabled && (A.globalAlpha *= 2), g.label && g.label.text) {
5782
- const U = g.label, R = U.fontSize || 14, c = U.fontWeight || 400, L = U.fontFamily || "Inter";
5783
- A.font = `${c} ${R}px "${L}", sans-serif`, A.fillStyle = U.color || "#f3f4f6", A.textBaseline = "middle";
5784
- const r = U.gap || 10;
5785
- let p = 0, q = 0;
5786
- U.position === "left" ? (A.textAlign = "right", p = E - r, q = 0) : U.position === "right" ? (A.textAlign = "left", p = E + C + r, q = 0) : U.position === "top" ? (A.textAlign = "center", p = 0, q = D - r, A.textBaseline = "bottom") : U.position === "bottom" ? (A.textAlign = "center", p = 0, q = D + Q + r, A.textBaseline = "top") : (A.textAlign = "left", p = E + C + r, q = 0), A.fillText(U.text, p, q);
5794
+ const U = g.label, R = U.fontSize || 14, c = U.fontWeight || 400, e = U.fontFamily || "Inter";
5795
+ A.font = `${c} ${R}px "${e}", sans-serif`, A.fillStyle = U.color || "#f3f4f6", A.textBaseline = "middle";
5796
+ const L = U.gap || 10;
5797
+ let H = 0, q = 0;
5798
+ U.position === "left" ? (A.textAlign = "right", H = E - L, q = 0) : U.position === "right" ? (A.textAlign = "left", H = E + C + L, q = 0) : U.position === "top" ? (A.textAlign = "center", H = 0, q = D - L, A.textBaseline = "bottom") : U.position === "bottom" ? (A.textAlign = "center", H = 0, q = D + Q + L, A.textBaseline = "top") : (A.textAlign = "left", H = E + C + L, q = 0), A.fillText(U.text, H, q);
5787
5799
  }
5788
5800
  }
5789
5801
  renderLineGraph(A, I, g, C) {
@@ -5810,23 +5822,23 @@ class WC {
5810
5822
  if (Q.forEach((F) => {
5811
5823
  let J = F.data;
5812
5824
  if (F.isVarEnabled && F.inputId) {
5813
- let k = this.inputs.get(F.inputId);
5814
- if (k === void 0) {
5815
- const y = this.inputNameMap.get(F.inputId);
5816
- y && y.length > 0 && (k = this.inputs.get(y[0]));
5825
+ let y = this.inputs.get(F.inputId);
5826
+ if (y === void 0) {
5827
+ const k = this.inputNameMap.get(F.inputId);
5828
+ k && k.length > 0 && (y = this.inputs.get(k[0]));
5817
5829
  }
5818
- k && Array.isArray(k) && (J = k);
5830
+ y && Array.isArray(y) && (J = y);
5819
5831
  }
5820
5832
  if (J && J.length > 0) {
5821
- const k = J.filter((y) => typeof y == "number" && !isNaN(y));
5822
- k.length > 0 && (E = Math.min(E, ...k), D = Math.max(D, ...k), o = Math.max(o, J.length));
5833
+ const y = J.filter((k) => typeof k == "number" && !isNaN(k));
5834
+ y.length > 0 && (E = Math.min(E, ...y), D = Math.max(D, ...y), o = Math.max(o, J.length));
5823
5835
  }
5824
5836
  F._resolvedData = J;
5825
5837
  }), o < 2) return;
5826
- const w = D - E, h = g / (o - 1), G = (F) => {
5838
+ const w = D - E, G = g / (o - 1), h = (F) => {
5827
5839
  const J = w === 0 ? 0.5 : (F - E) / w;
5828
5840
  return C / 2 - J * C;
5829
- }, K = (F) => F * h - g / 2, N = I.axisColor || "#333333";
5841
+ }, K = (F) => F * G - g / 2, N = I.axisColor || "#333333";
5830
5842
  if (I.showXAxis && (A.beginPath(), A.strokeStyle = I.xAxisColor || N, A.lineWidth = 1, A.moveTo(-g / 2, C / 2), A.lineTo(g / 2, C / 2), A.stroke()), I.showYAxis && (A.beginPath(), A.strokeStyle = I.yAxisColor || N, A.lineWidth = 1, A.moveTo(-g / 2, -C / 2), A.lineTo(-g / 2, C / 2), A.stroke()), A.fillStyle = I.axisLabelColor || "#333333", A.font = `${I.axisLabelFontSize || 10}px Inter, sans-serif`, I.showXLabels) {
5831
5843
  A.textAlign = "center", A.textBaseline = "top";
5832
5844
  for (let F = 0; F < o; F++) {
@@ -5837,51 +5849,51 @@ class WC {
5837
5849
  if (I.showYLabels) {
5838
5850
  A.textAlign = "right", A.textBaseline = "middle";
5839
5851
  const F = -g / 2 - 5, J = (D + E) / 2;
5840
- A.fillText(D.toFixed(1), F, G(D)), A.fillText(J.toFixed(1), F, G(J)), A.fillText(E.toFixed(1), F, G(E));
5852
+ A.fillText(D.toFixed(1), F, h(D)), A.fillText(J.toFixed(1), F, h(J)), A.fillText(E.toFixed(1), F, h(E));
5841
5853
  }
5842
5854
  const M = 10;
5843
5855
  if (Q.forEach((F) => {
5844
5856
  const J = F._resolvedData;
5845
5857
  if (!(!J || J.length < 2)) {
5846
5858
  if (F.showArea) {
5847
- if (A.beginPath(), A.moveTo(K(0), C / 2), A.lineTo(K(0), G(J[0])), F.smoothing && J.length > 2)
5848
- for (let y = 0; y < J.length - 1; y++) {
5849
- const U = J[y === 0 ? y : y - 1], R = J[y], c = J[y + 1], L = J[y + 1 === J.length - 1 ? y + 1 : y + 2];
5850
- for (let r = 1; r <= M; r++) {
5851
- const p = r / M, q = this._catmullRom(U, R, c, L, p);
5852
- A.lineTo(K(y + p), G(q));
5859
+ if (A.beginPath(), A.moveTo(K(0), C / 2), A.lineTo(K(0), h(J[0])), F.smoothing && J.length > 2)
5860
+ for (let k = 0; k < J.length - 1; k++) {
5861
+ const U = J[k === 0 ? k : k - 1], R = J[k], c = J[k + 1], e = J[k + 1 === J.length - 1 ? k + 1 : k + 2];
5862
+ for (let L = 1; L <= M; L++) {
5863
+ const H = L / M, q = this._catmullRom(U, R, c, e, H);
5864
+ A.lineTo(K(k + H), h(q));
5853
5865
  }
5854
5866
  }
5855
5867
  else
5856
- for (let y = 1; y < J.length; y++)
5857
- A.lineTo(K(y), G(J[y]));
5868
+ for (let k = 1; k < J.length; k++)
5869
+ A.lineTo(K(k), h(J[k]));
5858
5870
  A.lineTo(K(J.length - 1), C / 2), A.closePath();
5859
- const k = A.globalAlpha;
5860
- A.globalAlpha = k * (I.areaOpacity ?? 0.3), A.fillStyle = F.areaColor || "rgba(139, 92, 246, 0.2)", A.fill(), A.globalAlpha = k;
5871
+ const y = A.globalAlpha;
5872
+ A.globalAlpha = y * (I.areaOpacity ?? 0.3), A.fillStyle = F.areaColor || "rgba(139, 92, 246, 0.2)", A.fill(), A.globalAlpha = y;
5861
5873
  }
5862
- if (A.beginPath(), A.strokeStyle = F.lineColor || "#3b82f6", A.lineWidth = F.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(K(0), G(J[0])), F.smoothing && J.length > 2)
5863
- for (let k = 0; k < J.length - 1; k++) {
5864
- const y = J[k === 0 ? k : k - 1], U = J[k], R = J[k + 1], c = J[k + 1 === J.length - 1 ? k + 1 : k + 2];
5865
- for (let L = 1; L <= M; L++) {
5866
- const r = L / M, p = this._catmullRom(y, U, R, c, r);
5867
- A.lineTo(K(k + r), G(p));
5874
+ if (A.beginPath(), A.strokeStyle = F.lineColor || "#3b82f6", A.lineWidth = F.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(K(0), h(J[0])), F.smoothing && J.length > 2)
5875
+ for (let y = 0; y < J.length - 1; y++) {
5876
+ const k = J[y === 0 ? y : y - 1], U = J[y], R = J[y + 1], c = J[y + 1 === J.length - 1 ? y + 1 : y + 2];
5877
+ for (let e = 1; e <= M; e++) {
5878
+ const L = e / M, H = this._catmullRom(k, U, R, c, L);
5879
+ A.lineTo(K(y + L), h(H));
5868
5880
  }
5869
5881
  }
5870
5882
  else
5871
- for (let k = 1; k < J.length; k++)
5872
- A.lineTo(K(k), G(J[k]));
5873
- A.stroke(), F.showPoints && J.forEach((k, y) => {
5874
- const U = K(y), R = G(k);
5883
+ for (let y = 1; y < J.length; y++)
5884
+ A.lineTo(K(y), h(J[y]));
5885
+ A.stroke(), F.showPoints && J.forEach((y, k) => {
5886
+ const U = K(k), R = h(y);
5875
5887
  A.beginPath(), A.arc(U, R, (F.pointSize || 6) / 2, 0, Math.PI * 2), A.fillStyle = F.pointFill || "#ffffff", A.fill(), A.strokeStyle = F.pointStrokeColor || F.lineColor || "#3b82f6", A.lineWidth = F.pointStrokeWidth || 1, A.stroke();
5876
5888
  });
5877
5889
  }
5878
5890
  }), I.showLegend && Q.length > 0) {
5879
5891
  const F = g / 2 - 10;
5880
5892
  let J = -C / 2 + 15;
5881
- const k = I.legendFontSize || 10, y = k + 5;
5882
- A.font = `${k}px Inter, sans-serif`, A.textAlign = "right", A.textBaseline = "alphabetic", Q.forEach((U) => {
5883
- const c = U.label || "Series", L = A.measureText(c).width;
5884
- A.beginPath(), A.rect(F - L - 8 - 5, J - (8 / 2 + 2), 8, 8), A.fillStyle = U.lineColor || "#3b82f6", A.fill(), A.fillStyle = I.legendColor || "#333333", A.fillText(c, F, J), J += y;
5893
+ const y = I.legendFontSize || 10, k = y + 5;
5894
+ A.font = `${y}px Inter, sans-serif`, A.textAlign = "right", A.textBaseline = "alphabetic", Q.forEach((U) => {
5895
+ const c = U.label || "Series", e = A.measureText(c).width;
5896
+ A.beginPath(), A.rect(F - e - 8 - 5, J - (8 / 2 + 2), 8, 8), A.fillStyle = U.lineColor || "#3b82f6", A.fill(), A.fillStyle = I.legendColor || "#333333", A.fillText(c, F, J), J += k;
5885
5897
  });
5886
5898
  }
5887
5899
  }
@@ -5890,25 +5902,25 @@ class WC {
5890
5902
  return (2 * I - 2 * g + E + D) * w + (-3 * I + 3 * g - 2 * E - D) * o + E * Q + I;
5891
5903
  }
5892
5904
  createCanvasFill(A, I, g, C) {
5893
- var Q, E, D, o, w, h;
5905
+ var Q, E, D, o, w, G;
5894
5906
  if (!I || I.type === "None") return null;
5895
5907
  if (I.type === "Solid")
5896
5908
  return I.color;
5897
5909
  if (I.type === "LinearGradient" && I.stops) {
5898
- const G = (((Q = I.start) == null ? void 0 : Q[0]) ?? 0) * g - g / 2, K = (((E = I.start) == null ? void 0 : E[1]) ?? 0) * C - C / 2, N = (((D = I.end) == null ? void 0 : D[0]) ?? 1) * g - g / 2, M = (((o = I.end) == null ? void 0 : o[1]) ?? 0) * C - C / 2, F = A.createLinearGradient(G, K, N, M);
5910
+ const h = (((Q = I.start) == null ? void 0 : Q[0]) ?? 0) * g - g / 2, K = (((E = I.start) == null ? void 0 : E[1]) ?? 0) * C - C / 2, N = (((D = I.end) == null ? void 0 : D[0]) ?? 1) * g - g / 2, M = (((o = I.end) == null ? void 0 : o[1]) ?? 0) * C - C / 2, F = A.createLinearGradient(h, K, N, M);
5899
5911
  return I.stops.forEach((J) => F.addColorStop(J.offset, J.color)), F;
5900
5912
  }
5901
5913
  if (I.type === "RadialGradient" && I.stops) {
5902
- const G = (((w = I.center) == null ? void 0 : w[0]) ?? 0.5) * g - g / 2, K = (((h = I.center) == null ? void 0 : h[1]) ?? 0.5) * C - C / 2, N = (I.radius ?? 0.5) * Math.max(g, C), M = A.createRadialGradient(G, K, 0, G, K, N);
5914
+ const h = (((w = I.center) == null ? void 0 : w[0]) ?? 0.5) * g - g / 2, K = (((G = I.center) == null ? void 0 : G[1]) ?? 0.5) * C - C / 2, N = (I.radius ?? 0.5) * Math.max(g, C), M = A.createRadialGradient(h, K, 0, h, K, N);
5903
5915
  return I.stops.forEach((F) => M.addColorStop(F.offset, F.color)), M;
5904
5916
  }
5905
5917
  if (I.type === "Pattern" && I.url) {
5906
- let G = this.imageCache.get(I.url);
5907
- if (G || (G = new Image(), G.src = I.url, this.imageCache.set(I.url, G)), G.complete && G.naturalWidth > 0) {
5908
- const K = A.createPattern(G, "repeat");
5918
+ let h = this.imageCache.get(I.url);
5919
+ if (h || (h = new Image(), h.src = I.url, this.imageCache.set(I.url, h)), h.complete && h.naturalWidth > 0) {
5920
+ const K = A.createPattern(h, "repeat");
5909
5921
  if (K && (I.scaleX !== void 0 || I.offsetX !== void 0)) {
5910
- const N = new DOMMatrix(), M = I.scaleX ?? 1, F = I.scaleY ?? 1, J = I.offsetX ?? 0, k = I.offsetY ?? 0, y = I.rotation ?? 0;
5911
- N.translateSelf(J, k), N.rotateSelf(y), N.scaleSelf(M, F), K.setTransform(N);
5922
+ const N = new DOMMatrix(), M = I.scaleX ?? 1, F = I.scaleY ?? 1, J = I.offsetX ?? 0, y = I.offsetY ?? 0, k = I.rotation ?? 0;
5923
+ N.translateSelf(J, y), N.rotateSelf(k), N.scaleSelf(M, F), K.setTransform(N);
5912
5924
  }
5913
5925
  return K;
5914
5926
  }
@@ -5925,24 +5937,24 @@ class WC {
5925
5937
  }
5926
5938
  let o = [0, 0, 0, 0];
5927
5939
  typeof D == "number" ? o = [D, D, D, D] : Array.isArray(D) && (D.length === 1 ? o = [D[0], D[0], D[0], D[0]] : D.length === 2 ? o = [D[0], D[1], D[0], D[1]] : D.length === 4 && (o = D));
5928
- const w = Math.min(Math.abs(C) / 2, Math.abs(Q) / 2), h = Math.max(0, Math.min(Number(o[0]) || 0, w)), G = Math.max(0, Math.min(Number(o[1]) || 0, w)), K = Math.max(0, Math.min(Number(o[2]) || 0, w)), N = Math.max(0, Math.min(Number(o[3]) || 0, w));
5929
- A.moveTo(I + h, g), A.lineTo(I + C - G, g), G > 0 ? A.arcTo(I + C, g, I + C, g + G, G) : A.lineTo(I + C, g), A.lineTo(I + C, g + Q - K), K > 0 ? A.arcTo(I + C, g + Q, I + C - K, g + Q, K) : A.lineTo(I + C, g + Q), A.lineTo(I + N, g + Q), N > 0 ? A.arcTo(I, g + Q, I, g + Q - N, N) : A.lineTo(I, g + Q), A.lineTo(I, g + h), h > 0 ? A.arcTo(I, g, I + h, g, h) : A.lineTo(I, g), A.closePath();
5940
+ const w = Math.min(Math.abs(C) / 2, Math.abs(Q) / 2), G = Math.max(0, Math.min(Number(o[0]) || 0, w)), h = Math.max(0, Math.min(Number(o[1]) || 0, w)), K = Math.max(0, Math.min(Number(o[2]) || 0, w)), N = Math.max(0, Math.min(Number(o[3]) || 0, w));
5941
+ A.moveTo(I + G, g), A.lineTo(I + C - h, g), h > 0 ? A.arcTo(I + C, g, I + C, g + h, h) : A.lineTo(I + C, g), A.lineTo(I + C, g + Q - K), K > 0 ? A.arcTo(I + C, g + Q, I + C - K, g + Q, K) : A.lineTo(I + C, g + Q), A.lineTo(I + N, g + Q), N > 0 ? A.arcTo(I, g + Q, I, g + Q - N, N) : A.lineTo(I, g + Q), A.lineTo(I, g + G), G > 0 ? A.arcTo(I, g, I + G, g, G) : A.lineTo(I, g), A.closePath();
5930
5942
  }
5931
5943
  }
5932
5944
  const XC = FC(
5933
- ({ artboard: i, src: A, className: I, style: g, autoPlay: C = !0, fit: Q = "Contain", alignment: E = "Center", onReady: D, onTrigger: o, onInputUpdate: w, onComponentChange: h }, G) => {
5945
+ ({ artboard: i, src: A, className: I, style: g, autoPlay: C = !0, fit: Q = "Contain", alignment: E = "Center", onReady: D, onTrigger: o, onInputUpdate: w, onComponentChange: G }, h) => {
5934
5946
  const K = DI(null), N = DI(new WC()), M = DI(), F = DI(0);
5935
- MC(G, () => K.current), jA(() => {
5947
+ MC(h, () => K.current), jA(() => {
5936
5948
  console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"), N.current.setLayout(Q, E);
5937
5949
  }, [Q, E]), jA(() => {
5938
5950
  o && N.current.setTriggerCallback(o);
5939
5951
  }, [o]), jA(() => {
5940
5952
  w && N.current.setInputUpdateCallback(w);
5941
5953
  }, [w]), jA(() => {
5942
- h && N.current.setComponentChangeCallback(h);
5943
- }, [h]), jA(() => {
5954
+ G && N.current.setComponentChangeCallback(G);
5955
+ }, [G]), jA(() => {
5944
5956
  (async () => {
5945
- const y = N.current;
5957
+ const k = N.current;
5946
5958
  let U = i;
5947
5959
  if (!U && A)
5948
5960
  try {
@@ -5951,27 +5963,27 @@ const XC = FC(
5951
5963
  console.error("Failed to load ExodeUI animation:", R);
5952
5964
  return;
5953
5965
  }
5954
- U && (y.load(U), D && D(y));
5966
+ U && (k.load(U), D && D(k));
5955
5967
  })();
5956
5968
  }, [i, A]), jA(() => {
5957
- const k = N.current, y = K.current;
5958
- if (!y) return;
5959
- const U = y.getContext("2d");
5969
+ const y = N.current, k = K.current;
5970
+ if (!k) return;
5971
+ const U = k.getContext("2d");
5960
5972
  if (!U) return;
5961
5973
  const R = (c) => {
5962
5974
  F.current || (F.current = c);
5963
- const L = (c - F.current) / 1e3;
5964
- F.current = c, C && k.advance(L);
5965
- const r = window.devicePixelRatio || 1, p = y.getBoundingClientRect(), q = Math.floor(p.width * r), AA = Math.floor(p.height * r);
5966
- (y.width !== q || y.height !== AA) && (y.width = q, y.height = AA), k.render(U, q, AA), M.current = requestAnimationFrame(R);
5975
+ const e = (c - F.current) / 1e3;
5976
+ F.current = c, C && y.advance(e);
5977
+ const L = window.devicePixelRatio || 1, H = k.getBoundingClientRect(), q = Math.floor(H.width * L), AA = Math.floor(H.height * L);
5978
+ (k.width !== q || k.height !== AA) && (k.width = q, k.height = AA), y.render(U, q, AA), M.current = requestAnimationFrame(R);
5967
5979
  };
5968
5980
  return M.current = requestAnimationFrame(R), () => {
5969
5981
  M.current && cancelAnimationFrame(M.current);
5970
5982
  };
5971
5983
  }, [C]);
5972
- const J = (k, y) => {
5973
- const U = k.currentTarget.getBoundingClientRect(), R = k.clientX - U.left, c = k.clientY - U.top, L = U.width, r = U.height;
5974
- N.current.handlePointerInput(y, R, c, L, r);
5984
+ const J = (y, k) => {
5985
+ const U = y.currentTarget.getBoundingClientRect(), R = y.clientX - U.left, c = y.clientY - U.top, e = U.width, L = U.height;
5986
+ N.current.handlePointerInput(k, R, c, e, L);
5975
5987
  };
5976
5988
  return /* @__PURE__ */ yC(
5977
5989
  "canvas",
@@ -5980,32 +5992,34 @@ const XC = FC(
5980
5992
  style: { width: "100%", height: "100%", outline: "none", ...g },
5981
5993
  className: I,
5982
5994
  tabIndex: 0,
5983
- onPointerDown: (k) => {
5984
- var y;
5985
- J(k, "down"), (y = K.current) == null || y.focus();
5995
+ onPointerDown: (y) => {
5996
+ var k;
5997
+ J(y, "down"), (k = K.current) == null || k.focus();
5986
5998
  },
5987
- onPointerUp: (k) => J(k, "up"),
5988
- onPointerMove: (k) => J(k, "move"),
5989
- onPointerLeave: (k) => J(k, "blur"),
5990
- onClick: (k) => J(k, "click"),
5991
- onKeyDown: (k) => {
5992
- k.key === "Backspace" || k.key === "Enter" || k.key, N.current.handleKeyDown(k.nativeEvent);
5999
+ onPointerUp: (y) => J(y, "up"),
6000
+ onPointerMove: (y) => J(y, "move"),
6001
+ onPointerLeave: (y) => J(y, "blur"),
6002
+ onClick: (y) => J(y, "click"),
6003
+ onKeyDown: (y) => {
6004
+ y.key === "Backspace" || y.key === "Enter" || y.key, N.current.handleKeyDown(y.nativeEvent);
5993
6005
  }
5994
6006
  }
5995
6007
  );
5996
6008
  }
5997
6009
  );
5998
6010
  function vC() {
5999
- const [i, A] = JC(null), I = uA((D, o) => {
6000
- i == null || i.setInputBool(D, o);
6001
- }, [i]), g = uA((D, o) => {
6002
- i == null || i.setInputNumber(D, o);
6003
- }, [i]), C = uA((D) => {
6004
- i == null || i.fireTrigger(D);
6005
- }, [i]), Q = uA((D, o) => {
6006
- i == null || i.setInputText(D, o);
6007
- }, [i]), E = uA((D, o) => {
6008
- i == null || i.setInputNumberArray(D, o);
6011
+ const [i, A] = JC(null), I = xA((o, w) => {
6012
+ i == null || i.setInputBool(o, w);
6013
+ }, [i]), g = xA((o, w) => {
6014
+ i == null || i.setInputNumber(o, w);
6015
+ }, [i]), C = xA((o) => {
6016
+ i == null || i.fireTrigger(o);
6017
+ }, [i]), Q = xA((o, w) => {
6018
+ i == null || i.setInputText(o, w);
6019
+ }, [i]), E = xA((o, w) => {
6020
+ i == null || i.setInputNumberArray(o, w);
6021
+ }, [i]), D = xA((o, w, G) => {
6022
+ i == null || i.updateConstraint(o, w, G);
6009
6023
  }, [i]);
6010
6024
  return {
6011
6025
  setEngine: A,
@@ -6015,13 +6029,14 @@ function vC() {
6015
6029
  setInputNumber: g,
6016
6030
  fireTrigger: C,
6017
6031
  setInputText: Q,
6018
- setInputNumberArray: E
6032
+ setInputNumberArray: E,
6033
+ updateConstraint: D
6019
6034
  };
6020
6035
  }
6021
6036
  export {
6022
6037
  UC as ConditionOp,
6023
6038
  XC as ExodeUICanvas,
6024
6039
  WC as ExodeUIEngine,
6025
- PA as LogicOp,
6040
+ VA as LogicOp,
6026
6041
  vC as useExodeUI
6027
6042
  };