exodeui 2.6.21 → 2.6.23

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,26 +1,26 @@
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 $ = (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 OA, useState as JC, useCallback as jA } from "react";
5
+ import { forwardRef as FC, useRef as DI, useImperativeHandle as MC, useEffect as jA, useState as JC, useCallback as HA } from "react";
6
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 || {}), uA = /* @__PURE__ */ ((i) => (i.AND = "AND", i.OR = "OR", i.NOT = "NOT", i.XOR = "XOR", i))(uA || {});
7
7
  let E;
8
- const m = new Array(128).fill(void 0);
9
- function T(i) {
10
- return m[i];
8
+ const j = new Array(128).fill(void 0);
9
+ function W(i) {
10
+ return j[i];
11
11
  }
12
- m.push(void 0, null, !0, !1);
13
- let $A = m.length;
14
- function V(i) {
15
- $A === m.length && m.push(m.length + 1);
12
+ j.push(void 0, null, !0, !1);
13
+ let $A = j.length;
14
+ function P(i) {
15
+ $A === j.length && j.push(j.length + 1);
16
16
  const A = $A;
17
- return $A = m[A], m[A] = i, A;
17
+ return $A = j[A], j[A] = i, A;
18
18
  }
19
19
  function oI(i, A) {
20
20
  try {
21
21
  return i.apply(this, A);
22
22
  } catch (I) {
23
- E.__wbindgen_export_0(V(I));
23
+ E.__wbindgen_export_0(P(I));
24
24
  }
25
25
  }
26
26
  const Tg = typeof TextDecoder < "u" ? new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }) : { decode: () => {
@@ -31,26 +31,26 @@ let VA = null;
31
31
  function fI(i, A) {
32
32
  return i >>>= 0, Tg.decode((VA !== null && VA.byteLength !== 0 || (VA = new Uint8Array(E.memory.buffer)), VA).subarray(i, i + A));
33
33
  }
34
- function Y(i) {
34
+ function L(i) {
35
35
  return i == null;
36
36
  }
37
- let fA = null;
38
- function sA() {
39
- return (fA === null || fA.buffer.detached === !0 || fA.buffer.detached === void 0 && fA.buffer !== E.memory.buffer) && (fA = new DataView(E.memory.buffer)), fA;
37
+ let bA = null;
38
+ function GA() {
39
+ return (bA === null || bA.buffer.detached === !0 || bA.buffer.detached === void 0 && bA.buffer !== E.memory.buffer) && (bA = new DataView(E.memory.buffer)), bA;
40
40
  }
41
41
  function wI(i) {
42
- const A = T(i);
42
+ const A = W(i);
43
43
  return function(I) {
44
- I < 132 || (m[I] = $A, $A = I);
44
+ I < 132 || (j[I] = $A, $A = I);
45
45
  }(i), A;
46
46
  }
47
- function s(i, A) {
47
+ function K(i, A) {
48
48
  if (!(i instanceof A)) throw new Error(`expected instance of ${A.name}`);
49
49
  }
50
- let $ = 128;
50
+ let AA = 128;
51
51
  function CA(i) {
52
- if ($ == 1) throw new Error("out of js stack");
53
- return m[--$] = i, $;
52
+ if (AA == 1) throw new Error("out of js stack");
53
+ return j[--AA] = i, AA;
54
54
  }
55
55
  let PA = null;
56
56
  function RC(i, A) {
@@ -64,25 +64,25 @@ function Kg(i, A) {
64
64
  return i >>>= 0, Zg().subarray(i / 4, i / 4 + A);
65
65
  }
66
66
  let _A = null;
67
- function Wg() {
67
+ function Og() {
68
68
  return _A !== null && _A.byteLength !== 0 || (_A = new Uint32Array(E.memory.buffer)), _A;
69
69
  }
70
70
  let FA = 0;
71
71
  function tI(i, A) {
72
72
  const I = A(4 * i.length, 4) >>> 0;
73
- return Wg().set(i, I / 4), FA = i.length, I;
73
+ return Og().set(i, I / 4), FA = i.length, I;
74
74
  }
75
- function HA(i, A) {
75
+ function pA(i, A) {
76
76
  const I = A(4 * i.length, 4) >>> 0;
77
77
  return Zg().set(i, I / 4), FA = i.length, I;
78
78
  }
79
- const NI = Object.freeze({ LinX: 0, 0: "LinX", LinY: 1, 1: "LinY", AngX: 2, 2: "AngX" }), pA = Object.freeze({ Revolute: 0, 0: "Revolute", Fixed: 1, 1: "Fixed", Prismatic: 2, 2: "Prismatic", Rope: 3, 3: "Rope", Spring: 4, 4: "Spring", Generic: 5, 5: "Generic" }), NA = Object.freeze({ Ball: 0, 0: "Ball", Cuboid: 1, 1: "Cuboid", Capsule: 2, 2: "Capsule", Segment: 3, 3: "Segment", Polyline: 4, 4: "Polyline", Triangle: 5, 5: "Triangle", TriMesh: 6, 6: "TriMesh", HeightField: 7, 7: "HeightField", Compound: 8, 8: "Compound", ConvexPolygon: 9, 9: "ConvexPolygon", RoundCuboid: 10, 10: "RoundCuboid", RoundTriangle: 11, 11: "RoundTriangle", RoundConvexPolygon: 12, 12: "RoundConvexPolygon", HalfSpace: 13, 13: "HalfSpace", Voxels: 14, 14: "Voxels" }), YI = typeof FinalizationRegistry > "u" ? { register: () => {
79
+ const NI = Object.freeze({ LinX: 0, 0: "LinX", LinY: 1, 1: "LinY", AngX: 2, 2: "AngX" }), dA = Object.freeze({ Revolute: 0, 0: "Revolute", Fixed: 1, 1: "Fixed", Prismatic: 2, 2: "Prismatic", Rope: 3, 3: "Rope", Spring: 4, 4: "Spring", Generic: 5, 5: "Generic" }), NA = Object.freeze({ Ball: 0, 0: "Ball", Cuboid: 1, 1: "Cuboid", Capsule: 2, 2: "Capsule", Segment: 3, 3: "Segment", Polyline: 4, 4: "Polyline", Triangle: 5, 5: "Triangle", TriMesh: 6, 6: "TriMesh", HeightField: 7, 7: "HeightField", Compound: 8, 8: "Compound", ConvexPolygon: 9, 9: "ConvexPolygon", RoundCuboid: 10, 10: "RoundCuboid", RoundTriangle: 11, 11: "RoundTriangle", RoundConvexPolygon: 12, 12: "RoundConvexPolygon", HalfSpace: 13, 13: "HalfSpace", Voxels: 14, 14: "Voxels" }), YI = typeof FinalizationRegistry > "u" ? { register: () => {
80
80
  }, unregister: () => {
81
81
  } } : new FinalizationRegistry((i) => E.__wbg_rawbroadphase_free(i >>> 0, 1));
82
- class dA {
82
+ class fA {
83
83
  static __wrap(A) {
84
84
  A >>>= 0;
85
- const I = Object.create(dA.prototype);
85
+ const I = Object.create(fA.prototype);
86
86
  return I.__wbg_ptr = A, YI.register(I, I.__wbg_ptr, I), I;
87
87
  }
88
88
  __destroy_into_raw() {
@@ -97,87 +97,87 @@ class dA {
97
97
  const A = E.rawbroadphase_new();
98
98
  return this.__wbg_ptr = A >>> 0, YI.register(this, this.__wbg_ptr, this), this;
99
99
  }
100
- castRay(A, I, C, g, Q, B, D, o, w, h, G, K) {
100
+ castRay(A, I, C, g, Q, B, D, w, o, h, G, s) {
101
101
  try {
102
- s(A, wA), s(I, IA), s(C, QA), s(g, N), s(Q, N);
103
- const a = E.rawbroadphase_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, D, o, Y(w) ? 4294967297 : w >>> 0, !Y(h), Y(h) ? 0 : h, !Y(G), Y(G) ? 0 : G, CA(K));
102
+ K(A, oA), K(I, IA), K(C, EA), K(g, k), K(Q, k);
103
+ const a = E.rawbroadphase_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, D, w, L(o) ? 4294967297 : o >>> 0, !L(h), L(h) ? 0 : h, !L(G), L(G) ? 0 : G, CA(s));
104
104
  return a === 0 ? void 0 : _I.__wrap(a);
105
105
  } finally {
106
- m[$++] = void 0;
106
+ j[AA++] = void 0;
107
107
  }
108
108
  }
109
- castRayAndGetNormal(A, I, C, g, Q, B, D, o, w, h, G, K) {
109
+ castRayAndGetNormal(A, I, C, g, Q, B, D, w, o, h, G, s) {
110
110
  try {
111
- s(A, wA), s(I, IA), s(C, QA), s(g, N), s(Q, N);
112
- const a = E.rawbroadphase_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, D, o, Y(w) ? 4294967297 : w >>> 0, !Y(h), Y(h) ? 0 : h, !Y(G), Y(G) ? 0 : G, CA(K));
111
+ K(A, oA), K(I, IA), K(C, EA), K(g, k), K(Q, k);
112
+ const a = E.rawbroadphase_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, D, w, L(o) ? 4294967297 : o >>> 0, !L(h), L(h) ? 0 : h, !L(G), L(G) ? 0 : G, CA(s));
113
113
  return a === 0 ? void 0 : FI.__wrap(a);
114
114
  } finally {
115
- m[$++] = void 0;
115
+ j[AA++] = void 0;
116
116
  }
117
117
  }
118
- intersectionsWithRay(A, I, C, g, Q, B, D, o, w, h, G, K, a) {
118
+ intersectionsWithRay(A, I, C, g, Q, B, D, w, o, h, G, s, a) {
119
119
  try {
120
- s(A, wA), s(I, IA), s(C, QA), s(g, N), s(Q, N), E.rawbroadphase_intersectionsWithRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, D, CA(o), w, Y(h) ? 4294967297 : h >>> 0, !Y(G), Y(G) ? 0 : G, !Y(K), Y(K) ? 0 : K, CA(a));
120
+ K(A, oA), K(I, IA), K(C, EA), K(g, k), K(Q, k), E.rawbroadphase_intersectionsWithRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, D, CA(w), o, L(h) ? 4294967297 : h >>> 0, !L(G), L(G) ? 0 : G, !L(s), L(s) ? 0 : s, CA(a));
121
121
  } finally {
122
- m[$++] = void 0, m[$++] = void 0;
122
+ j[AA++] = void 0, j[AA++] = void 0;
123
123
  }
124
124
  }
125
- intersectionWithShape(A, I, C, g, Q, B, D, o, w, h, G) {
125
+ intersectionWithShape(A, I, C, g, Q, B, D, w, o, h, G) {
126
126
  try {
127
127
  const M = E.__wbindgen_add_to_stack_pointer(-16);
128
- s(A, wA), s(I, IA), s(C, QA), s(g, N), s(Q, x), s(B, n), E.rawbroadphase_intersectionWithShape(M, this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D, Y(o) ? 4294967297 : o >>> 0, !Y(w), Y(w) ? 0 : w, !Y(h), Y(h) ? 0 : h, CA(G));
129
- var K = sA().getInt32(M + 0, !0), a = sA().getFloat64(M + 8, !0);
130
- return K === 0 ? void 0 : a;
128
+ K(A, oA), K(I, IA), K(C, EA), K(g, k), K(Q, m), K(B, d), E.rawbroadphase_intersectionWithShape(M, this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D, L(w) ? 4294967297 : w >>> 0, !L(o), L(o) ? 0 : o, !L(h), L(h) ? 0 : h, CA(G));
129
+ var s = GA().getInt32(M + 0, !0), a = GA().getFloat64(M + 8, !0);
130
+ return s === 0 ? void 0 : a;
131
131
  } finally {
132
- E.__wbindgen_add_to_stack_pointer(16), m[$++] = void 0;
132
+ E.__wbindgen_add_to_stack_pointer(16), j[AA++] = void 0;
133
133
  }
134
134
  }
135
- projectPoint(A, I, C, g, Q, B, D, o, w, h) {
135
+ projectPoint(A, I, C, g, Q, B, D, w, o, h) {
136
136
  try {
137
- s(A, wA), s(I, IA), s(C, QA), s(g, N);
138
- const G = E.rawbroadphase_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, Y(D) ? 4294967297 : D >>> 0, !Y(o), Y(o) ? 0 : o, !Y(w), Y(w) ? 0 : w, CA(h));
139
- return G === 0 ? void 0 : GI.__wrap(G);
137
+ K(A, oA), K(I, IA), K(C, EA), K(g, k);
138
+ const G = E.rawbroadphase_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, L(D) ? 4294967297 : D >>> 0, !L(w), L(w) ? 0 : w, !L(o), L(o) ? 0 : o, CA(h));
139
+ return G === 0 ? void 0 : hI.__wrap(G);
140
140
  } finally {
141
- m[$++] = void 0;
141
+ j[AA++] = void 0;
142
142
  }
143
143
  }
144
- projectPointAndGetFeature(A, I, C, g, Q, B, D, o, w) {
144
+ projectPointAndGetFeature(A, I, C, g, Q, B, D, w, o) {
145
145
  try {
146
- s(A, wA), s(I, IA), s(C, QA), s(g, N);
147
- const h = E.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, Y(B) ? 4294967297 : B >>> 0, !Y(D), Y(D) ? 0 : D, !Y(o), Y(o) ? 0 : o, CA(w));
148
- return h === 0 ? void 0 : GI.__wrap(h);
146
+ K(A, oA), K(I, IA), K(C, EA), K(g, k);
147
+ const h = E.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, L(B) ? 4294967297 : B >>> 0, !L(D), L(D) ? 0 : D, !L(w), L(w) ? 0 : w, CA(o));
148
+ return h === 0 ? void 0 : hI.__wrap(h);
149
149
  } finally {
150
- m[$++] = void 0;
150
+ j[AA++] = void 0;
151
151
  }
152
152
  }
153
- intersectionsWithPoint(A, I, C, g, Q, B, D, o, w, h) {
153
+ intersectionsWithPoint(A, I, C, g, Q, B, D, w, o, h) {
154
154
  try {
155
- s(A, wA), s(I, IA), s(C, QA), s(g, N), E.rawbroadphase_intersectionsWithPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, CA(Q), B, Y(D) ? 4294967297 : D >>> 0, !Y(o), Y(o) ? 0 : o, !Y(w), Y(w) ? 0 : w, CA(h));
155
+ K(A, oA), K(I, IA), K(C, EA), K(g, k), E.rawbroadphase_intersectionsWithPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, CA(Q), B, L(D) ? 4294967297 : D >>> 0, !L(w), L(w) ? 0 : w, !L(o), L(o) ? 0 : o, CA(h));
156
156
  } finally {
157
- m[$++] = void 0, m[$++] = void 0;
157
+ j[AA++] = void 0, j[AA++] = void 0;
158
158
  }
159
159
  }
160
- castShape(A, I, C, g, Q, B, D, o, w, h, G, K, a, M, y) {
160
+ castShape(A, I, C, g, Q, B, D, w, o, h, G, s, a, M, y) {
161
161
  try {
162
- s(A, wA), s(I, IA), s(C, QA), s(g, N), s(Q, x), s(B, N), s(D, n);
163
- const J = E.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D.__wbg_ptr, o, w, h, G, Y(K) ? 4294967297 : K >>> 0, !Y(a), Y(a) ? 0 : a, !Y(M), Y(M) ? 0 : M, CA(y));
162
+ K(A, oA), K(I, IA), K(C, EA), K(g, k), K(Q, m), K(B, k), K(D, d);
163
+ const J = E.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D.__wbg_ptr, w, o, h, G, L(s) ? 4294967297 : s >>> 0, !L(a), L(a) ? 0 : a, !L(M), L(M) ? 0 : M, CA(y));
164
164
  return J === 0 ? void 0 : kI.__wrap(J);
165
165
  } finally {
166
- m[$++] = void 0;
166
+ j[AA++] = void 0;
167
167
  }
168
168
  }
169
- intersectionsWithShape(A, I, C, g, Q, B, D, o, w, h, G, K) {
169
+ intersectionsWithShape(A, I, C, g, Q, B, D, w, o, h, G, s) {
170
170
  try {
171
- s(A, wA), s(I, IA), s(C, QA), s(g, N), s(Q, x), s(B, n), E.rawbroadphase_intersectionsWithShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, CA(D), o, Y(w) ? 4294967297 : w >>> 0, !Y(h), Y(h) ? 0 : h, !Y(G), Y(G) ? 0 : G, CA(K));
171
+ K(A, oA), K(I, IA), K(C, EA), K(g, k), K(Q, m), K(B, d), E.rawbroadphase_intersectionsWithShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, CA(D), w, L(o) ? 4294967297 : o >>> 0, !L(h), L(h) ? 0 : h, !L(G), L(G) ? 0 : G, CA(s));
172
172
  } finally {
173
- m[$++] = void 0, m[$++] = void 0;
173
+ j[AA++] = void 0, j[AA++] = void 0;
174
174
  }
175
175
  }
176
176
  collidersWithAabbIntersectingAabb(A, I, C, g, Q, B) {
177
177
  try {
178
- s(A, wA), s(I, IA), s(C, QA), s(g, N), s(Q, N), E.rawbroadphase_collidersWithAabbIntersectingAabb(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, CA(B));
178
+ K(A, oA), K(I, IA), K(C, EA), K(g, k), K(Q, k), E.rawbroadphase_collidersWithAabbIntersectingAabb(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, CA(B));
179
179
  } finally {
180
- m[$++] = void 0;
180
+ j[AA++] = void 0;
181
181
  }
182
182
  }
183
183
  }
@@ -201,7 +201,7 @@ class bI {
201
201
  const Sg = typeof FinalizationRegistry > "u" ? { register: () => {
202
202
  }, unregister: () => {
203
203
  } } : new FinalizationRegistry((i) => E.__wbg_rawcharactercollision_free(i >>> 0, 1));
204
- class Og {
204
+ class Wg {
205
205
  __destroy_into_raw() {
206
206
  const A = this.__wbg_ptr;
207
207
  return this.__wbg_ptr = 0, Sg.unregister(this), A;
@@ -219,39 +219,39 @@ class Og {
219
219
  }
220
220
  translationDeltaApplied() {
221
221
  const A = E.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
222
- return N.__wrap(A);
222
+ return k.__wrap(A);
223
223
  }
224
224
  translationDeltaRemaining() {
225
225
  const A = E.rawcharactercollision_translationDeltaRemaining(this.__wbg_ptr);
226
- return N.__wrap(A);
226
+ return k.__wrap(A);
227
227
  }
228
228
  toi() {
229
229
  return E.rawcharactercollision_toi(this.__wbg_ptr);
230
230
  }
231
231
  worldWitness1() {
232
232
  const A = E.rawcharactercollision_worldWitness1(this.__wbg_ptr);
233
- return N.__wrap(A);
233
+ return k.__wrap(A);
234
234
  }
235
235
  worldWitness2() {
236
236
  const A = E.rawcharactercollision_worldWitness2(this.__wbg_ptr);
237
- return N.__wrap(A);
237
+ return k.__wrap(A);
238
238
  }
239
239
  worldNormal1() {
240
240
  const A = E.rawcharactercollision_worldNormal1(this.__wbg_ptr);
241
- return N.__wrap(A);
241
+ return k.__wrap(A);
242
242
  }
243
243
  worldNormal2() {
244
244
  const A = E.rawcharactercollision_worldNormal2(this.__wbg_ptr);
245
- return N.__wrap(A);
245
+ return k.__wrap(A);
246
246
  }
247
247
  }
248
248
  const eI = typeof FinalizationRegistry > "u" ? { register: () => {
249
249
  }, unregister: () => {
250
250
  } } : new FinalizationRegistry((i) => E.__wbg_rawcolliderset_free(i >>> 0, 1));
251
- class QA {
251
+ class EA {
252
252
  static __wrap(A) {
253
253
  A >>>= 0;
254
- const I = Object.create(QA.prototype);
254
+ const I = Object.create(EA.prototype);
255
255
  return I.__wbg_ptr = A, eI.register(I, I.__wbg_ptr, I), I;
256
256
  }
257
257
  __destroy_into_raw() {
@@ -264,19 +264,19 @@ class QA {
264
264
  }
265
265
  coTranslation(A) {
266
266
  const I = E.rawcolliderset_coTranslation(this.__wbg_ptr, A);
267
- return N.__wrap(I);
267
+ return k.__wrap(I);
268
268
  }
269
269
  coRotation(A) {
270
270
  const I = E.rawcolliderset_coRotation(this.__wbg_ptr, A);
271
- return x.__wrap(I);
271
+ return m.__wrap(I);
272
272
  }
273
273
  coTranslationWrtParent(A) {
274
274
  const I = E.rawcolliderset_coTranslationWrtParent(this.__wbg_ptr, A);
275
- return I === 0 ? void 0 : N.__wrap(I);
275
+ return I === 0 ? void 0 : k.__wrap(I);
276
276
  }
277
277
  coRotationWrtParent(A) {
278
278
  const I = E.rawcolliderset_coRotationWrtParent(this.__wbg_ptr, A);
279
- return I === 0 ? void 0 : x.__wrap(I);
279
+ return I === 0 ? void 0 : m.__wrap(I);
280
280
  }
281
281
  coSetTranslation(A, I, C) {
282
282
  E.rawcolliderset_coSetTranslation(this.__wbg_ptr, A, I, C);
@@ -298,14 +298,14 @@ class QA {
298
298
  }
299
299
  coHalfspaceNormal(A) {
300
300
  const I = E.rawcolliderset_coHalfspaceNormal(this.__wbg_ptr, A);
301
- return I === 0 ? void 0 : N.__wrap(I);
301
+ return I === 0 ? void 0 : k.__wrap(I);
302
302
  }
303
303
  coHalfExtents(A) {
304
304
  const I = E.rawcolliderset_coHalfExtents(this.__wbg_ptr, A);
305
- return I === 0 ? void 0 : N.__wrap(I);
305
+ return I === 0 ? void 0 : k.__wrap(I);
306
306
  }
307
307
  coSetHalfExtents(A, I) {
308
- s(I, N), E.rawcolliderset_coSetHalfExtents(this.__wbg_ptr, A, I.__wbg_ptr);
308
+ K(I, k), E.rawcolliderset_coSetHalfExtents(this.__wbg_ptr, A, I.__wbg_ptr);
309
309
  }
310
310
  coRadius(A) {
311
311
  const I = E.rawcolliderset_coRadius(this.__wbg_ptr, A);
@@ -332,7 +332,7 @@ class QA {
332
332
  try {
333
333
  const g = E.__wbindgen_add_to_stack_pointer(-16);
334
334
  E.rawcolliderset_coVoxelData(g, this.__wbg_ptr, A);
335
- var I = sA().getInt32(g + 0, !0), C = sA().getInt32(g + 4, !0);
335
+ var I = GA().getInt32(g + 0, !0), C = GA().getInt32(g + 4, !0);
336
336
  let Q;
337
337
  return I !== 0 && (Q = RC(I, C).slice(), E.__wbindgen_export_1(I, 4 * C, 4)), Q;
338
338
  } finally {
@@ -341,7 +341,7 @@ class QA {
341
341
  }
342
342
  coVoxelSize(A) {
343
343
  const I = E.rawcolliderset_coVoxelSize(this.__wbg_ptr, A);
344
- return I === 0 ? void 0 : N.__wrap(I);
344
+ return I === 0 ? void 0 : k.__wrap(I);
345
345
  }
346
346
  coSetVoxel(A, I, C, g) {
347
347
  E.rawcolliderset_coSetVoxel(this.__wbg_ptr, A, I, C, g);
@@ -356,7 +356,7 @@ class QA {
356
356
  try {
357
357
  const g = E.__wbindgen_add_to_stack_pointer(-16);
358
358
  E.rawcolliderset_coVertices(g, this.__wbg_ptr, A);
359
- var I = sA().getInt32(g + 0, !0), C = sA().getInt32(g + 4, !0);
359
+ var I = GA().getInt32(g + 0, !0), C = GA().getInt32(g + 4, !0);
360
360
  let Q;
361
361
  return I !== 0 && (Q = Kg(I, C).slice(), E.__wbindgen_export_1(I, 4 * C, 4)), Q;
362
362
  } finally {
@@ -367,10 +367,10 @@ class QA {
367
367
  try {
368
368
  const g = E.__wbindgen_add_to_stack_pointer(-16);
369
369
  E.rawcolliderset_coIndices(g, this.__wbg_ptr, A);
370
- var I = sA().getInt32(g + 0, !0), C = sA().getInt32(g + 4, !0);
370
+ var I = GA().getInt32(g + 0, !0), C = GA().getInt32(g + 4, !0);
371
371
  let Q;
372
372
  return I !== 0 && (Q = function(B, D) {
373
- return B >>>= 0, Wg().subarray(B / 4, B / 4 + D);
373
+ return B >>>= 0, Og().subarray(B / 4, B / 4 + D);
374
374
  }(I, C).slice(), E.__wbindgen_export_1(I, 4 * C, 4)), Q;
375
375
  } finally {
376
376
  E.__wbindgen_add_to_stack_pointer(16);
@@ -384,7 +384,7 @@ class QA {
384
384
  try {
385
385
  const g = E.__wbindgen_add_to_stack_pointer(-16);
386
386
  E.rawcolliderset_coHeightfieldHeights(g, this.__wbg_ptr, A);
387
- var I = sA().getInt32(g + 0, !0), C = sA().getInt32(g + 4, !0);
387
+ var I = GA().getInt32(g + 0, !0), C = GA().getInt32(g + 4, !0);
388
388
  let Q;
389
389
  return I !== 0 && (Q = Kg(I, C).slice(), E.__wbindgen_export_1(I, 4 * C, 4)), Q;
390
390
  } finally {
@@ -393,13 +393,13 @@ class QA {
393
393
  }
394
394
  coHeightfieldScale(A) {
395
395
  const I = E.rawcolliderset_coHeightfieldScale(this.__wbg_ptr, A);
396
- return I === 0 ? void 0 : N.__wrap(I);
396
+ return I === 0 ? void 0 : k.__wrap(I);
397
397
  }
398
398
  coParent(A) {
399
399
  try {
400
400
  const g = E.__wbindgen_add_to_stack_pointer(-16);
401
401
  E.rawcolliderset_coParent(g, this.__wbg_ptr, A);
402
- var I = sA().getInt32(g + 0, !0), C = sA().getFloat64(g + 8, !0);
402
+ var I = GA().getInt32(g + 0, !0), C = GA().getFloat64(g + 8, !0);
403
403
  return I === 0 ? void 0 : C;
404
404
  } finally {
405
405
  E.__wbindgen_add_to_stack_pointer(16);
@@ -451,23 +451,23 @@ class QA {
451
451
  return E.rawcolliderset_coContactForceEventThreshold(this.__wbg_ptr, A);
452
452
  }
453
453
  coContainsPoint(A, I) {
454
- return s(I, N), E.rawcolliderset_coContainsPoint(this.__wbg_ptr, A, I.__wbg_ptr) !== 0;
454
+ return K(I, k), E.rawcolliderset_coContainsPoint(this.__wbg_ptr, A, I.__wbg_ptr) !== 0;
455
455
  }
456
- coCastShape(A, I, C, g, Q, B, D, o, w) {
457
- s(I, N), s(C, n), s(g, N), s(Q, x), s(B, N);
458
- const h = E.rawcolliderset_coCastShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D, o, w);
456
+ coCastShape(A, I, C, g, Q, B, D, w, o) {
457
+ K(I, k), K(C, d), K(g, k), K(Q, m), K(B, k);
458
+ const h = E.rawcolliderset_coCastShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D, w, o);
459
459
  return h === 0 ? void 0 : JI.__wrap(h);
460
460
  }
461
461
  coCastCollider(A, I, C, g, Q, B, D) {
462
- s(I, N), s(g, N);
463
- const o = E.rawcolliderset_coCastCollider(this.__wbg_ptr, A, I.__wbg_ptr, C, g.__wbg_ptr, Q, B, D);
464
- return o === 0 ? void 0 : kI.__wrap(o);
462
+ K(I, k), K(g, k);
463
+ const w = E.rawcolliderset_coCastCollider(this.__wbg_ptr, A, I.__wbg_ptr, C, g.__wbg_ptr, Q, B, D);
464
+ return w === 0 ? void 0 : kI.__wrap(w);
465
465
  }
466
466
  coIntersectsShape(A, I, C, g) {
467
- return s(I, n), s(C, N), s(g, x), E.rawcolliderset_coIntersectsShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr) !== 0;
467
+ return K(I, d), K(C, k), K(g, m), E.rawcolliderset_coIntersectsShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr) !== 0;
468
468
  }
469
469
  coContactShape(A, I, C, g, Q) {
470
- s(I, n), s(C, N), s(g, x);
470
+ K(I, d), K(C, k), K(g, m);
471
471
  const B = E.rawcolliderset_coContactShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q);
472
472
  return B === 0 ? void 0 : AI.__wrap(B);
473
473
  }
@@ -476,18 +476,18 @@ class QA {
476
476
  return g === 0 ? void 0 : AI.__wrap(g);
477
477
  }
478
478
  coProjectPoint(A, I, C) {
479
- s(I, N);
479
+ K(I, k);
480
480
  const g = E.rawcolliderset_coProjectPoint(this.__wbg_ptr, A, I.__wbg_ptr, C);
481
481
  return yI.__wrap(g);
482
482
  }
483
483
  coIntersectsRay(A, I, C, g) {
484
- return s(I, N), s(C, N), E.rawcolliderset_coIntersectsRay(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g) !== 0;
484
+ return K(I, k), K(C, k), E.rawcolliderset_coIntersectsRay(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g) !== 0;
485
485
  }
486
486
  coCastRay(A, I, C, g, Q) {
487
- return s(I, N), s(C, N), E.rawcolliderset_coCastRay(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q);
487
+ return K(I, k), K(C, k), E.rawcolliderset_coCastRay(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q);
488
488
  }
489
489
  coCastRayAndGetNormal(A, I, C, g, Q) {
490
- s(I, N), s(C, N);
490
+ K(I, k), K(C, k);
491
491
  const B = E.rawcolliderset_coCastRayAndGetNormal(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q);
492
492
  return B === 0 ? void 0 : MI.__wrap(B);
493
493
  }
@@ -528,7 +528,7 @@ class QA {
528
528
  E.rawcolliderset_coSetActiveCollisionTypes(this.__wbg_ptr, A, I);
529
529
  }
530
530
  coSetShape(A, I) {
531
- s(I, n), E.rawcolliderset_coSetShape(this.__wbg_ptr, A, I.__wbg_ptr);
531
+ K(I, d), E.rawcolliderset_coSetShape(this.__wbg_ptr, A, I.__wbg_ptr);
532
532
  }
533
533
  coSetContactForceEventThreshold(A, I) {
534
534
  E.rawcolliderset_coSetContactForceEventThreshold(this.__wbg_ptr, A, I);
@@ -540,7 +540,7 @@ class QA {
540
540
  E.rawcolliderset_coSetMass(this.__wbg_ptr, A, I);
541
541
  }
542
542
  coSetMassProperties(A, I, C, g) {
543
- s(C, N), E.rawcolliderset_coSetMassProperties(this.__wbg_ptr, A, I, C.__wbg_ptr, g);
543
+ K(C, k), E.rawcolliderset_coSetMassProperties(this.__wbg_ptr, A, I, C.__wbg_ptr, g);
544
544
  }
545
545
  constructor() {
546
546
  const A = E.rawcolliderset_new();
@@ -552,18 +552,18 @@ class QA {
552
552
  contains(A) {
553
553
  return E.rawcolliderset_contains(this.__wbg_ptr, A) !== 0;
554
554
  }
555
- createCollider(A, I, C, g, Q, B, D, o, w, h, G, K, a, M, y, J, k, F, R, U, c, l, r, d) {
555
+ createCollider(A, I, C, g, Q, B, D, w, o, h, G, s, a, M, y, J, S, F, U, R, c, r, n, p) {
556
556
  try {
557
- const gA = E.__wbindgen_add_to_stack_pointer(-16);
558
- s(I, n), s(C, N), s(g, x), s(D, N), s(d, IA), E.rawcolliderset_createCollider(gA, this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, D.__wbg_ptr, o, w, h, G, K, a, M, y, J, k, F, R, U, c, l, r, d.__wbg_ptr);
559
- var Z = sA().getInt32(gA + 0, !0), q = sA().getFloat64(gA + 8, !0);
560
- return Z === 0 ? void 0 : q;
557
+ const X = E.__wbindgen_add_to_stack_pointer(-16);
558
+ K(I, d), K(C, k), K(g, m), K(D, k), K(p, IA), E.rawcolliderset_createCollider(X, this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, D.__wbg_ptr, w, o, h, G, s, a, M, y, J, S, F, U, R, c, r, n, p.__wbg_ptr);
559
+ var Z = GA().getInt32(X + 0, !0), H = GA().getFloat64(X + 8, !0);
560
+ return Z === 0 ? void 0 : H;
561
561
  } finally {
562
562
  E.__wbindgen_add_to_stack_pointer(16);
563
563
  }
564
564
  }
565
565
  remove(A, I, C, g) {
566
- s(I, qA), s(C, IA), E.rawcolliderset_remove(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g);
566
+ K(I, qA), K(C, IA), E.rawcolliderset_remove(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g);
567
567
  }
568
568
  isHandleValid(A) {
569
569
  return E.rawcolliderset_contains(this.__wbg_ptr, A) !== 0;
@@ -572,7 +572,7 @@ class QA {
572
572
  try {
573
573
  E.rawcolliderset_forEachColliderHandle(this.__wbg_ptr, CA(A));
574
574
  } finally {
575
- m[$++] = void 0;
575
+ j[AA++] = void 0;
576
576
  }
577
577
  }
578
578
  }
@@ -601,19 +601,19 @@ class kI {
601
601
  }
602
602
  witness1() {
603
603
  const A = E.rawcollidershapecasthit_witness1(this.__wbg_ptr);
604
- return N.__wrap(A);
604
+ return k.__wrap(A);
605
605
  }
606
606
  witness2() {
607
607
  const A = E.rawcollidershapecasthit_witness2(this.__wbg_ptr);
608
- return N.__wrap(A);
608
+ return k.__wrap(A);
609
609
  }
610
610
  normal1() {
611
611
  const A = E.rawcollidershapecasthit_normal1(this.__wbg_ptr);
612
- return N.__wrap(A);
612
+ return k.__wrap(A);
613
613
  }
614
614
  normal2() {
615
615
  const A = E.rawcollidershapecasthit_normal2(this.__wbg_ptr);
616
- return N.__wrap(A);
616
+ return k.__wrap(A);
617
617
  }
618
618
  }
619
619
  const kg = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -641,14 +641,14 @@ class uI {
641
641
  }
642
642
  total_force() {
643
643
  const A = E.rawcontactforceevent_total_force(this.__wbg_ptr);
644
- return N.__wrap(A);
644
+ return k.__wrap(A);
645
645
  }
646
646
  total_force_magnitude() {
647
647
  return E.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr);
648
648
  }
649
649
  max_force_direction() {
650
650
  const A = E.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
651
- return N.__wrap(A);
651
+ return k.__wrap(A);
652
652
  }
653
653
  max_force_magnitude() {
654
654
  return E.rawcontactforceevent_max_force_magnitude(this.__wbg_ptr);
@@ -673,15 +673,15 @@ class VI {
673
673
  }
674
674
  normal() {
675
675
  const A = E.rawcontactmanifold_normal(this.__wbg_ptr);
676
- return N.__wrap(A);
676
+ return k.__wrap(A);
677
677
  }
678
678
  local_n1() {
679
679
  const A = E.rawcontactmanifold_local_n1(this.__wbg_ptr);
680
- return N.__wrap(A);
680
+ return k.__wrap(A);
681
681
  }
682
682
  local_n2() {
683
683
  const A = E.rawcontactmanifold_local_n2(this.__wbg_ptr);
684
- return N.__wrap(A);
684
+ return k.__wrap(A);
685
685
  }
686
686
  subshape1() {
687
687
  return E.rawcontactmanifold_subshape1(this.__wbg_ptr) >>> 0;
@@ -694,11 +694,11 @@ class VI {
694
694
  }
695
695
  contact_local_p1(A) {
696
696
  const I = E.rawcontactmanifold_contact_local_p1(this.__wbg_ptr, A);
697
- return I === 0 ? void 0 : N.__wrap(I);
697
+ return I === 0 ? void 0 : k.__wrap(I);
698
698
  }
699
699
  contact_local_p2(A) {
700
700
  const I = E.rawcontactmanifold_contact_local_p2(this.__wbg_ptr, A);
701
- return I === 0 ? void 0 : N.__wrap(I);
701
+ return I === 0 ? void 0 : k.__wrap(I);
702
702
  }
703
703
  contact_dist(A) {
704
704
  return E.rawcontactmanifold_contact_dist(this.__wbg_ptr, A);
@@ -720,7 +720,7 @@ class VI {
720
720
  }
721
721
  solver_contact_point(A) {
722
722
  const I = E.rawcontactmanifold_solver_contact_point(this.__wbg_ptr, A);
723
- return I === 0 ? void 0 : N.__wrap(I);
723
+ return I === 0 ? void 0 : k.__wrap(I);
724
724
  }
725
725
  solver_contact_dist(A) {
726
726
  return E.rawcontactmanifold_solver_contact_dist(this.__wbg_ptr, A);
@@ -733,7 +733,7 @@ class VI {
733
733
  }
734
734
  solver_contact_tangent_velocity(A) {
735
735
  const I = E.rawcontactmanifold_solver_contact_tangent_velocity(this.__wbg_ptr, A);
736
- return N.__wrap(I);
736
+ return k.__wrap(I);
737
737
  }
738
738
  }
739
739
  const Fg = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -791,9 +791,9 @@ class cC {
791
791
  }
792
792
  render(A, I, C, g, Q, B, D) {
793
793
  try {
794
- s(A, IA), s(I, QA), s(C, rA), s(g, lA), s(Q, wA), E.rawdebugrenderpipeline_render(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, CA(D));
794
+ K(A, IA), K(I, EA), K(C, rA), K(g, lA), K(Q, oA), E.rawdebugrenderpipeline_render(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, CA(D));
795
795
  } finally {
796
- m[$++] = void 0;
796
+ j[AA++] = void 0;
797
797
  }
798
798
  }
799
799
  }
@@ -816,11 +816,11 @@ class zI {
816
816
  }
817
817
  takeGravity() {
818
818
  const A = E.rawdeserializedworld_takeGravity(this.__wbg_ptr);
819
- return A === 0 ? void 0 : N.__wrap(A);
819
+ return A === 0 ? void 0 : k.__wrap(A);
820
820
  }
821
821
  takeIntegrationParameters() {
822
822
  const A = E.rawdeserializedworld_takeIntegrationParameters(this.__wbg_ptr);
823
- return A === 0 ? void 0 : ZA.__wrap(A);
823
+ return A === 0 ? void 0 : OA.__wrap(A);
824
824
  }
825
825
  takeIslandManager() {
826
826
  const A = E.rawdeserializedworld_takeIslandManager(this.__wbg_ptr);
@@ -828,11 +828,11 @@ class zI {
828
828
  }
829
829
  takeBroadPhase() {
830
830
  const A = E.rawdeserializedworld_takeBroadPhase(this.__wbg_ptr);
831
- return A === 0 ? void 0 : dA.__wrap(A);
831
+ return A === 0 ? void 0 : fA.__wrap(A);
832
832
  }
833
833
  takeNarrowPhase() {
834
834
  const A = E.rawdeserializedworld_takeNarrowPhase(this.__wbg_ptr);
835
- return A === 0 ? void 0 : wA.__wrap(A);
835
+ return A === 0 ? void 0 : oA.__wrap(A);
836
836
  }
837
837
  takeBodies() {
838
838
  const A = E.rawdeserializedworld_takeBodies(this.__wbg_ptr);
@@ -840,7 +840,7 @@ class zI {
840
840
  }
841
841
  takeColliders() {
842
842
  const A = E.rawdeserializedworld_takeColliders(this.__wbg_ptr);
843
- return A === 0 ? void 0 : QA.__wrap(A);
843
+ return A === 0 ? void 0 : EA.__wrap(A);
844
844
  }
845
845
  takeImpulseJoints() {
846
846
  const A = E.rawdeserializedworld_takeImpulseJoints(this.__wbg_ptr);
@@ -871,14 +871,14 @@ class jg {
871
871
  try {
872
872
  E.raweventqueue_drainCollisionEvents(this.__wbg_ptr, CA(A));
873
873
  } finally {
874
- m[$++] = void 0;
874
+ j[AA++] = void 0;
875
875
  }
876
876
  }
877
877
  drainContactForceEvents(A) {
878
878
  try {
879
879
  E.raweventqueue_drainContactForceEvents(this.__wbg_ptr, CA(A));
880
880
  } finally {
881
- m[$++] = void 0;
881
+ j[AA++] = void 0;
882
882
  }
883
883
  }
884
884
  clear() {
@@ -903,27 +903,27 @@ class kA {
903
903
  E.__wbg_rawgenericjoint_free(A, 0);
904
904
  }
905
905
  static spring(A, I, C, g, Q) {
906
- s(g, N), s(Q, N);
906
+ K(g, k), K(Q, k);
907
907
  const B = E.rawgenericjoint_spring(A, I, C, g.__wbg_ptr, Q.__wbg_ptr);
908
908
  return kA.__wrap(B);
909
909
  }
910
910
  static rope(A, I, C) {
911
- s(I, N), s(C, N);
911
+ K(I, k), K(C, k);
912
912
  const g = E.rawgenericjoint_rope(A, I.__wbg_ptr, C.__wbg_ptr);
913
913
  return kA.__wrap(g);
914
914
  }
915
915
  static prismatic(A, I, C, g, Q, B) {
916
- s(A, N), s(I, N), s(C, N);
916
+ K(A, k), K(I, k), K(C, k);
917
917
  const D = E.rawgenericjoint_prismatic(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g, Q, B);
918
918
  return D === 0 ? void 0 : kA.__wrap(D);
919
919
  }
920
920
  static fixed(A, I, C, g) {
921
- s(A, N), s(I, x), s(C, N), s(g, x);
921
+ K(A, k), K(I, m), K(C, k), K(g, m);
922
922
  const Q = E.rawgenericjoint_fixed(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr);
923
923
  return kA.__wrap(Q);
924
924
  }
925
925
  static revolute(A, I) {
926
- s(A, N), s(I, N);
926
+ K(A, k), K(I, k);
927
927
  const C = E.rawgenericjoint_revolute(A.__wbg_ptr, I.__wbg_ptr);
928
928
  return C === 0 ? void 0 : kA.__wrap(C);
929
929
  }
@@ -956,25 +956,25 @@ class rA {
956
956
  }
957
957
  jointFrameX1(A) {
958
958
  const I = E.rawimpulsejointset_jointFrameX1(this.__wbg_ptr, A);
959
- return x.__wrap(I);
959
+ return m.__wrap(I);
960
960
  }
961
961
  jointFrameX2(A) {
962
962
  const I = E.rawimpulsejointset_jointFrameX2(this.__wbg_ptr, A);
963
- return x.__wrap(I);
963
+ return m.__wrap(I);
964
964
  }
965
965
  jointAnchor1(A) {
966
966
  const I = E.rawimpulsejointset_jointAnchor1(this.__wbg_ptr, A);
967
- return N.__wrap(I);
967
+ return k.__wrap(I);
968
968
  }
969
969
  jointAnchor2(A) {
970
970
  const I = E.rawimpulsejointset_jointAnchor2(this.__wbg_ptr, A);
971
- return N.__wrap(I);
971
+ return k.__wrap(I);
972
972
  }
973
973
  jointSetAnchor1(A, I) {
974
- s(I, N), E.rawimpulsejointset_jointSetAnchor1(this.__wbg_ptr, A, I.__wbg_ptr);
974
+ K(I, k), E.rawimpulsejointset_jointSetAnchor1(this.__wbg_ptr, A, I.__wbg_ptr);
975
975
  }
976
976
  jointSetAnchor2(A, I) {
977
- s(I, N), E.rawimpulsejointset_jointSetAnchor2(this.__wbg_ptr, A, I.__wbg_ptr);
977
+ K(I, k), E.rawimpulsejointset_jointSetAnchor2(this.__wbg_ptr, A, I.__wbg_ptr);
978
978
  }
979
979
  jointContactsEnabled(A) {
980
980
  return E.rawimpulsejointset_jointContactsEnabled(this.__wbg_ptr, A) !== 0;
@@ -1011,7 +1011,7 @@ class rA {
1011
1011
  return this.__wbg_ptr = A >>> 0, LI.register(this, this.__wbg_ptr, this), this;
1012
1012
  }
1013
1013
  createJoint(A, I, C, g) {
1014
- return s(A, kA), E.rawimpulsejointset_createJoint(this.__wbg_ptr, A.__wbg_ptr, I, C, g);
1014
+ return K(A, kA), E.rawimpulsejointset_createJoint(this.__wbg_ptr, A.__wbg_ptr, I, C, g);
1015
1015
  }
1016
1016
  remove(A, I) {
1017
1017
  E.rawimpulsejointset_remove(this.__wbg_ptr, A, I);
@@ -1026,24 +1026,24 @@ class rA {
1026
1026
  try {
1027
1027
  E.rawimpulsejointset_forEachJointHandle(this.__wbg_ptr, CA(A));
1028
1028
  } finally {
1029
- m[$++] = void 0;
1029
+ j[AA++] = void 0;
1030
1030
  }
1031
1031
  }
1032
1032
  forEachJointAttachedToRigidBody(A, I) {
1033
1033
  try {
1034
1034
  E.rawimpulsejointset_forEachJointAttachedToRigidBody(this.__wbg_ptr, A, CA(I));
1035
1035
  } finally {
1036
- m[$++] = void 0;
1036
+ j[AA++] = void 0;
1037
1037
  }
1038
1038
  }
1039
1039
  }
1040
1040
  const rI = typeof FinalizationRegistry > "u" ? { register: () => {
1041
1041
  }, unregister: () => {
1042
1042
  } } : new FinalizationRegistry((i) => E.__wbg_rawintegrationparameters_free(i >>> 0, 1));
1043
- class ZA {
1043
+ class OA {
1044
1044
  static __wrap(A) {
1045
1045
  A >>>= 0;
1046
- const I = Object.create(ZA.prototype);
1046
+ const I = Object.create(OA.prototype);
1047
1047
  return I.__wbg_ptr = A, rI.register(I, I.__wbg_ptr, I), I;
1048
1048
  }
1049
1049
  __destroy_into_raw() {
@@ -1138,7 +1138,7 @@ class qA {
1138
1138
  try {
1139
1139
  E.rawislandmanager_forEachActiveRigidBodyHandle(this.__wbg_ptr, CA(A));
1140
1140
  } finally {
1141
- m[$++] = void 0;
1141
+ j[AA++] = void 0;
1142
1142
  }
1143
1143
  }
1144
1144
  }
@@ -1160,10 +1160,10 @@ class tC {
1160
1160
  }
1161
1161
  up() {
1162
1162
  const A = E.rawcollidershapecasthit_normal2(this.__wbg_ptr);
1163
- return N.__wrap(A);
1163
+ return k.__wrap(A);
1164
1164
  }
1165
1165
  setUp(A) {
1166
- s(A, N), E.rawkinematiccharactercontroller_setUp(this.__wbg_ptr, A.__wbg_ptr);
1166
+ K(A, k), E.rawkinematiccharactercontroller_setUp(this.__wbg_ptr, A.__wbg_ptr);
1167
1167
  }
1168
1168
  normalNudgeFactor() {
1169
1169
  return E.rawkinematiccharactercontroller_normalNudgeFactor(this.__wbg_ptr);
@@ -1229,16 +1229,16 @@ class tC {
1229
1229
  snapToGroundEnabled() {
1230
1230
  return E.rawkinematiccharactercontroller_snapToGroundEnabled(this.__wbg_ptr) !== 0;
1231
1231
  }
1232
- computeColliderMovement(A, I, C, g, Q, B, D, o, w, h, G, K) {
1232
+ computeColliderMovement(A, I, C, g, Q, B, D, w, o, h, G, s) {
1233
1233
  try {
1234
- s(I, dA), s(C, wA), s(g, IA), s(Q, QA), s(D, N), E.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, D.__wbg_ptr, o, Y(w) ? 4294967297 : Math.fround(w), h, Y(G) ? 4294967297 : G >>> 0, CA(K));
1234
+ K(I, fA), K(C, oA), K(g, IA), K(Q, EA), K(D, k), E.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, D.__wbg_ptr, w, L(o) ? 4294967297 : Math.fround(o), h, L(G) ? 4294967297 : G >>> 0, CA(s));
1235
1235
  } finally {
1236
- m[$++] = void 0;
1236
+ j[AA++] = void 0;
1237
1237
  }
1238
1238
  }
1239
1239
  computedMovement() {
1240
1240
  const A = E.rawkinematiccharactercontroller_computedMovement(this.__wbg_ptr);
1241
- return N.__wrap(A);
1241
+ return k.__wrap(A);
1242
1242
  }
1243
1243
  computedGrounded() {
1244
1244
  return E.rawkinematiccharactercontroller_computedGrounded(this.__wbg_ptr) !== 0;
@@ -1247,7 +1247,7 @@ class tC {
1247
1247
  return E.rawkinematiccharactercontroller_numComputedCollisions(this.__wbg_ptr) >>> 0;
1248
1248
  }
1249
1249
  computedCollision(A, I) {
1250
- return s(I, Og), E.rawkinematiccharactercontroller_computedCollision(this.__wbg_ptr, A, I.__wbg_ptr) !== 0;
1250
+ return K(I, Wg), E.rawkinematiccharactercontroller_computedCollision(this.__wbg_ptr, A, I.__wbg_ptr) !== 0;
1251
1251
  }
1252
1252
  }
1253
1253
  const lI = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -1272,19 +1272,19 @@ class lA {
1272
1272
  }
1273
1273
  jointFrameX1(A) {
1274
1274
  const I = E.rawmultibodyjointset_jointFrameX1(this.__wbg_ptr, A);
1275
- return x.__wrap(I);
1275
+ return m.__wrap(I);
1276
1276
  }
1277
1277
  jointFrameX2(A) {
1278
1278
  const I = E.rawmultibodyjointset_jointFrameX2(this.__wbg_ptr, A);
1279
- return x.__wrap(I);
1279
+ return m.__wrap(I);
1280
1280
  }
1281
1281
  jointAnchor1(A) {
1282
1282
  const I = E.rawmultibodyjointset_jointAnchor1(this.__wbg_ptr, A);
1283
- return N.__wrap(I);
1283
+ return k.__wrap(I);
1284
1284
  }
1285
1285
  jointAnchor2(A) {
1286
1286
  const I = E.rawmultibodyjointset_jointAnchor2(this.__wbg_ptr, A);
1287
- return N.__wrap(I);
1287
+ return k.__wrap(I);
1288
1288
  }
1289
1289
  jointContactsEnabled(A) {
1290
1290
  return E.rawmultibodyjointset_jointContactsEnabled(this.__wbg_ptr, A) !== 0;
@@ -1306,7 +1306,7 @@ class lA {
1306
1306
  return this.__wbg_ptr = A >>> 0, lI.register(this, this.__wbg_ptr, this), this;
1307
1307
  }
1308
1308
  createJoint(A, I, C, g) {
1309
- return s(A, kA), E.rawmultibodyjointset_createJoint(this.__wbg_ptr, A.__wbg_ptr, I, C, g);
1309
+ return K(A, kA), E.rawmultibodyjointset_createJoint(this.__wbg_ptr, A.__wbg_ptr, I, C, g);
1310
1310
  }
1311
1311
  remove(A, I) {
1312
1312
  E.rawmultibodyjointset_remove(this.__wbg_ptr, A, I);
@@ -1318,24 +1318,24 @@ class lA {
1318
1318
  try {
1319
1319
  E.rawmultibodyjointset_forEachJointHandle(this.__wbg_ptr, CA(A));
1320
1320
  } finally {
1321
- m[$++] = void 0;
1321
+ j[AA++] = void 0;
1322
1322
  }
1323
1323
  }
1324
1324
  forEachJointAttachedToRigidBody(A, I) {
1325
1325
  try {
1326
1326
  E.rawmultibodyjointset_forEachJointAttachedToRigidBody(this.__wbg_ptr, A, CA(I));
1327
1327
  } finally {
1328
- m[$++] = void 0;
1328
+ j[AA++] = void 0;
1329
1329
  }
1330
1330
  }
1331
1331
  }
1332
1332
  const nI = typeof FinalizationRegistry > "u" ? { register: () => {
1333
1333
  }, unregister: () => {
1334
1334
  } } : new FinalizationRegistry((i) => E.__wbg_rawnarrowphase_free(i >>> 0, 1));
1335
- class wA {
1335
+ class oA {
1336
1336
  static __wrap(A) {
1337
1337
  A >>>= 0;
1338
- const I = Object.create(wA.prototype);
1338
+ const I = Object.create(oA.prototype);
1339
1339
  return I.__wbg_ptr = A, nI.register(I, I.__wbg_ptr, I), I;
1340
1340
  }
1341
1341
  __destroy_into_raw() {
@@ -1351,14 +1351,14 @@ class wA {
1351
1351
  return this.__wbg_ptr = A >>> 0, nI.register(this, this.__wbg_ptr, this), this;
1352
1352
  }
1353
1353
  contact_pairs_with(A, I) {
1354
- E.rawnarrowphase_contact_pairs_with(this.__wbg_ptr, A, V(I));
1354
+ E.rawnarrowphase_contact_pairs_with(this.__wbg_ptr, A, P(I));
1355
1355
  }
1356
1356
  contact_pair(A, I) {
1357
1357
  const C = E.rawnarrowphase_contact_pair(this.__wbg_ptr, A, I);
1358
1358
  return C === 0 ? void 0 : PI.__wrap(C);
1359
1359
  }
1360
1360
  intersection_pairs_with(A, I) {
1361
- E.rawnarrowphase_intersection_pairs_with(this.__wbg_ptr, A, V(I));
1361
+ E.rawnarrowphase_intersection_pairs_with(this.__wbg_ptr, A, P(I));
1362
1362
  }
1363
1363
  intersection_pair(A, I) {
1364
1364
  return E.rawnarrowphase_intersection_pair(this.__wbg_ptr, A, I) !== 0;
@@ -1434,11 +1434,11 @@ class YC {
1434
1434
  timing_user_changes() {
1435
1435
  return E.rawphysicspipeline_timing_user_changes(this.__wbg_ptr);
1436
1436
  }
1437
- step(A, I, C, g, Q, B, D, o, w, h) {
1438
- s(A, N), s(I, ZA), s(C, qA), s(g, dA), s(Q, wA), s(B, IA), s(D, QA), s(o, rA), s(w, lA), s(h, bI), E.rawphysicspipeline_step(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr, h.__wbg_ptr);
1437
+ step(A, I, C, g, Q, B, D, w, o, h) {
1438
+ K(A, k), K(I, OA), K(C, qA), K(g, fA), K(Q, oA), K(B, IA), K(D, EA), K(w, rA), K(o, lA), K(h, bI), E.rawphysicspipeline_step(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D.__wbg_ptr, w.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr);
1439
1439
  }
1440
- stepWithEvents(A, I, C, g, Q, B, D, o, w, h, G, K, a, M) {
1441
- s(A, N), s(I, ZA), s(C, qA), s(g, dA), s(Q, wA), s(B, IA), s(D, QA), s(o, rA), s(w, lA), s(h, bI), s(G, jg), E.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr, h.__wbg_ptr, G.__wbg_ptr, V(K), V(a), V(M));
1440
+ stepWithEvents(A, I, C, g, Q, B, D, w, o, h, G, s, a, M) {
1441
+ K(A, k), K(I, OA), K(C, qA), K(g, fA), K(Q, oA), K(B, IA), K(D, EA), K(w, rA), K(o, lA), K(h, bI), K(G, jg), E.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D.__wbg_ptr, w.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr, G.__wbg_ptr, P(s), P(a), P(M));
1442
1442
  }
1443
1443
  }
1444
1444
  const Yg = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -1473,27 +1473,27 @@ class eC {
1473
1473
  E.rawpidcontroller_reset_integrals(this.__wbg_ptr);
1474
1474
  }
1475
1475
  apply_linear_correction(A, I, C, g, Q) {
1476
- s(I, IA), s(g, N), s(Q, N), E.rawpidcontroller_apply_linear_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g.__wbg_ptr, Q.__wbg_ptr);
1476
+ K(I, IA), K(g, k), K(Q, k), E.rawpidcontroller_apply_linear_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g.__wbg_ptr, Q.__wbg_ptr);
1477
1477
  }
1478
1478
  apply_angular_correction(A, I, C, g, Q) {
1479
- s(I, IA), E.rawpidcontroller_apply_angular_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g, Q);
1479
+ K(I, IA), E.rawpidcontroller_apply_angular_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g, Q);
1480
1480
  }
1481
1481
  linear_correction(A, I, C, g, Q) {
1482
- s(I, IA), s(g, N), s(Q, N);
1482
+ K(I, IA), K(g, k), K(Q, k);
1483
1483
  const B = E.rawpidcontroller_linear_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g.__wbg_ptr, Q.__wbg_ptr);
1484
- return N.__wrap(B);
1484
+ return k.__wrap(B);
1485
1485
  }
1486
1486
  angular_correction(A, I, C, g, Q) {
1487
- return s(I, IA), E.rawpidcontroller_angular_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g, Q);
1487
+ return K(I, IA), E.rawpidcontroller_angular_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g, Q);
1488
1488
  }
1489
1489
  }
1490
1490
  const eg = typeof FinalizationRegistry > "u" ? { register: () => {
1491
1491
  }, unregister: () => {
1492
1492
  } } : new FinalizationRegistry((i) => E.__wbg_rawpointcolliderprojection_free(i >>> 0, 1));
1493
- class GI {
1493
+ class hI {
1494
1494
  static __wrap(A) {
1495
1495
  A >>>= 0;
1496
- const I = Object.create(GI.prototype);
1496
+ const I = Object.create(hI.prototype);
1497
1497
  return I.__wbg_ptr = A, eg.register(I, I.__wbg_ptr, I), I;
1498
1498
  }
1499
1499
  __destroy_into_raw() {
@@ -1509,7 +1509,7 @@ class GI {
1509
1509
  }
1510
1510
  point() {
1511
1511
  const A = E.rawpointcolliderprojection_point(this.__wbg_ptr);
1512
- return N.__wrap(A);
1512
+ return k.__wrap(A);
1513
1513
  }
1514
1514
  isInside() {
1515
1515
  return E.rawpointcolliderprojection_isInside(this.__wbg_ptr) !== 0;
@@ -1541,7 +1541,7 @@ class yI {
1541
1541
  }
1542
1542
  point() {
1543
1543
  const A = E.rawpointprojection_point(this.__wbg_ptr);
1544
- return N.__wrap(A);
1544
+ return k.__wrap(A);
1545
1545
  }
1546
1546
  isInside() {
1547
1547
  return E.rawpointprojection_isInside(this.__wbg_ptr) !== 0;
@@ -1593,7 +1593,7 @@ class FI {
1593
1593
  }
1594
1594
  normal() {
1595
1595
  const A = E.rawcollidershapecasthit_witness1(this.__wbg_ptr);
1596
- return N.__wrap(A);
1596
+ return k.__wrap(A);
1597
1597
  }
1598
1598
  time_of_impact() {
1599
1599
  return E.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);
@@ -1625,7 +1625,7 @@ class MI {
1625
1625
  }
1626
1626
  normal() {
1627
1627
  const A = E.rawcollidershapecasthit_witness1(this.__wbg_ptr);
1628
- return N.__wrap(A);
1628
+ return k.__wrap(A);
1629
1629
  }
1630
1630
  time_of_impact() {
1631
1631
  return E.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);
@@ -1657,11 +1657,11 @@ class IA {
1657
1657
  }
1658
1658
  rbTranslation(A) {
1659
1659
  const I = E.rawrigidbodyset_rbTranslation(this.__wbg_ptr, A);
1660
- return N.__wrap(I);
1660
+ return k.__wrap(I);
1661
1661
  }
1662
1662
  rbRotation(A) {
1663
1663
  const I = E.rawrigidbodyset_rbRotation(this.__wbg_ptr, A);
1664
- return x.__wrap(I);
1664
+ return m.__wrap(I);
1665
1665
  }
1666
1666
  rbSleep(A) {
1667
1667
  E.rawrigidbodyset_rbSleep(this.__wbg_ptr, A);
@@ -1674,11 +1674,11 @@ class IA {
1674
1674
  }
1675
1675
  rbNextTranslation(A) {
1676
1676
  const I = E.rawrigidbodyset_rbNextTranslation(this.__wbg_ptr, A);
1677
- return N.__wrap(I);
1677
+ return k.__wrap(I);
1678
1678
  }
1679
1679
  rbNextRotation(A) {
1680
1680
  const I = E.rawrigidbodyset_rbNextRotation(this.__wbg_ptr, A);
1681
- return x.__wrap(I);
1681
+ return m.__wrap(I);
1682
1682
  }
1683
1683
  rbSetTranslation(A, I, C, g) {
1684
1684
  E.rawrigidbodyset_rbSetTranslation(this.__wbg_ptr, A, I, C, g);
@@ -1687,7 +1687,7 @@ class IA {
1687
1687
  E.rawrigidbodyset_rbSetRotation(this.__wbg_ptr, A, I, C);
1688
1688
  }
1689
1689
  rbSetLinvel(A, I, C) {
1690
- s(I, N), E.rawrigidbodyset_rbSetLinvel(this.__wbg_ptr, A, I.__wbg_ptr, C);
1690
+ K(I, k), E.rawrigidbodyset_rbSetLinvel(this.__wbg_ptr, A, I.__wbg_ptr, C);
1691
1691
  }
1692
1692
  rbSetAngvel(A, I, C) {
1693
1693
  E.rawrigidbodyset_rbSetAngvel(this.__wbg_ptr, A, I, C);
@@ -1699,25 +1699,25 @@ class IA {
1699
1699
  E.rawrigidbodyset_rbSetNextKinematicRotation(this.__wbg_ptr, A, I);
1700
1700
  }
1701
1701
  rbRecomputeMassPropertiesFromColliders(A, I) {
1702
- s(I, QA), E.rawrigidbodyset_rbRecomputeMassPropertiesFromColliders(this.__wbg_ptr, A, I.__wbg_ptr);
1702
+ K(I, EA), E.rawrigidbodyset_rbRecomputeMassPropertiesFromColliders(this.__wbg_ptr, A, I.__wbg_ptr);
1703
1703
  }
1704
1704
  rbSetAdditionalMass(A, I, C) {
1705
1705
  E.rawrigidbodyset_rbSetAdditionalMass(this.__wbg_ptr, A, I, C);
1706
1706
  }
1707
1707
  rbSetAdditionalMassProperties(A, I, C, g, Q) {
1708
- s(C, N), E.rawrigidbodyset_rbSetAdditionalMassProperties(this.__wbg_ptr, A, I, C.__wbg_ptr, g, Q);
1708
+ K(C, k), E.rawrigidbodyset_rbSetAdditionalMassProperties(this.__wbg_ptr, A, I, C.__wbg_ptr, g, Q);
1709
1709
  }
1710
1710
  rbLinvel(A) {
1711
1711
  const I = E.rawrigidbodyset_rbLinvel(this.__wbg_ptr, A);
1712
- return N.__wrap(I);
1712
+ return k.__wrap(I);
1713
1713
  }
1714
1714
  rbAngvel(A) {
1715
1715
  return E.rawrigidbodyset_rbAngvel(this.__wbg_ptr, A);
1716
1716
  }
1717
1717
  rbVelocityAtPoint(A, I) {
1718
- s(I, N);
1718
+ K(I, k);
1719
1719
  const C = E.rawrigidbodyset_rbVelocityAtPoint(this.__wbg_ptr, A, I.__wbg_ptr);
1720
- return N.__wrap(C);
1720
+ return k.__wrap(C);
1721
1721
  }
1722
1722
  rbLockTranslations(A, I, C) {
1723
1723
  E.rawrigidbodyset_rbLockTranslations(this.__wbg_ptr, A, I, C);
@@ -1748,15 +1748,15 @@ class IA {
1748
1748
  }
1749
1749
  rbEffectiveInvMass(A) {
1750
1750
  const I = E.rawrigidbodyset_rbEffectiveInvMass(this.__wbg_ptr, A);
1751
- return N.__wrap(I);
1751
+ return k.__wrap(I);
1752
1752
  }
1753
1753
  rbLocalCom(A) {
1754
1754
  const I = E.rawrigidbodyset_rbLocalCom(this.__wbg_ptr, A);
1755
- return N.__wrap(I);
1755
+ return k.__wrap(I);
1756
1756
  }
1757
1757
  rbWorldCom(A) {
1758
1758
  const I = E.rawrigidbodyset_rbWorldCom(this.__wbg_ptr, A);
1759
- return N.__wrap(I);
1759
+ return k.__wrap(I);
1760
1760
  }
1761
1761
  rbInvPrincipalInertia(A) {
1762
1762
  return E.rawrigidbodyset_rbInvPrincipalInertia(this.__wbg_ptr, A);
@@ -1831,10 +1831,10 @@ class IA {
1831
1831
  E.rawrigidbodyset_rbResetTorques(this.__wbg_ptr, A, I);
1832
1832
  }
1833
1833
  rbAddForce(A, I, C) {
1834
- s(I, N), E.rawrigidbodyset_rbAddForce(this.__wbg_ptr, A, I.__wbg_ptr, C);
1834
+ K(I, k), E.rawrigidbodyset_rbAddForce(this.__wbg_ptr, A, I.__wbg_ptr, C);
1835
1835
  }
1836
1836
  rbApplyImpulse(A, I, C) {
1837
- s(I, N), E.rawrigidbodyset_rbApplyImpulse(this.__wbg_ptr, A, I.__wbg_ptr, C);
1837
+ K(I, k), E.rawrigidbodyset_rbApplyImpulse(this.__wbg_ptr, A, I.__wbg_ptr, C);
1838
1838
  }
1839
1839
  rbAddTorque(A, I, C) {
1840
1840
  E.rawrigidbodyset_rbAddTorque(this.__wbg_ptr, A, I, C);
@@ -1843,10 +1843,10 @@ class IA {
1843
1843
  E.rawrigidbodyset_rbApplyTorqueImpulse(this.__wbg_ptr, A, I, C);
1844
1844
  }
1845
1845
  rbAddForceAtPoint(A, I, C, g) {
1846
- s(I, N), s(C, N), E.rawrigidbodyset_rbAddForceAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g);
1846
+ K(I, k), K(C, k), E.rawrigidbodyset_rbAddForceAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g);
1847
1847
  }
1848
1848
  rbApplyImpulseAtPoint(A, I, C, g) {
1849
- s(I, N), s(C, N), E.rawrigidbodyset_rbApplyImpulseAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g);
1849
+ K(I, k), K(C, k), E.rawrigidbodyset_rbApplyImpulseAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g);
1850
1850
  }
1851
1851
  rbAdditionalSolverIterations(A) {
1852
1852
  return E.rawrigidbodyset_rbAdditionalSolverIterations(this.__wbg_ptr, A) >>> 0;
@@ -1862,7 +1862,7 @@ class IA {
1862
1862
  }
1863
1863
  rbUserForce(A) {
1864
1864
  const I = E.rawrigidbodyset_rbUserForce(this.__wbg_ptr, A);
1865
- return N.__wrap(I);
1865
+ return k.__wrap(I);
1866
1866
  }
1867
1867
  rbUserTorque(A) {
1868
1868
  return E.rawrigidbodyset_rbUserTorque(this.__wbg_ptr, A);
@@ -1871,11 +1871,11 @@ class IA {
1871
1871
  const A = E.rawrigidbodyset_new();
1872
1872
  return this.__wbg_ptr = A >>> 0, HI.register(this, this.__wbg_ptr, this), this;
1873
1873
  }
1874
- createRigidBody(A, I, C, g, Q, B, D, o, w, h, G, K, a, M, y, J, k, F, R, U, c, l) {
1875
- return s(I, N), s(C, x), s(D, N), s(o, N), E.rawrigidbodyset_createRigidBody(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q, B, D.__wbg_ptr, o.__wbg_ptr, w, h, G, K, a, M, y, J, k, F, R, U, c, l);
1874
+ createRigidBody(A, I, C, g, Q, B, D, w, o, h, G, s, a, M, y, J, S, F, U, R, c, r) {
1875
+ return K(I, k), K(C, m), K(D, k), K(w, k), E.rawrigidbodyset_createRigidBody(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q, B, D.__wbg_ptr, w.__wbg_ptr, o, h, G, s, a, M, y, J, S, F, U, R, c, r);
1876
1876
  }
1877
1877
  remove(A, I, C, g, Q) {
1878
- s(I, qA), s(C, QA), s(g, rA), s(Q, lA), E.rawrigidbodyset_remove(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr);
1878
+ K(I, qA), K(C, EA), K(g, rA), K(Q, lA), E.rawrigidbodyset_remove(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr);
1879
1879
  }
1880
1880
  len() {
1881
1881
  return E.rawrigidbodyset_len(this.__wbg_ptr) >>> 0;
@@ -1887,20 +1887,20 @@ class IA {
1887
1887
  try {
1888
1888
  E.rawrigidbodyset_forEachRigidBodyHandle(this.__wbg_ptr, CA(A));
1889
1889
  } finally {
1890
- m[$++] = void 0;
1890
+ j[AA++] = void 0;
1891
1891
  }
1892
1892
  }
1893
1893
  propagateModifiedBodyPositionsToColliders(A) {
1894
- s(A, QA), E.rawrigidbodyset_propagateModifiedBodyPositionsToColliders(this.__wbg_ptr, A.__wbg_ptr);
1894
+ K(A, EA), E.rawrigidbodyset_propagateModifiedBodyPositionsToColliders(this.__wbg_ptr, A.__wbg_ptr);
1895
1895
  }
1896
1896
  }
1897
1897
  const ng = typeof FinalizationRegistry > "u" ? { register: () => {
1898
1898
  }, unregister: () => {
1899
1899
  } } : new FinalizationRegistry((i) => E.__wbg_rawrotation_free(i >>> 0, 1));
1900
- class x {
1900
+ class m {
1901
1901
  static __wrap(A) {
1902
1902
  A >>>= 0;
1903
- const I = Object.create(x.prototype);
1903
+ const I = Object.create(m.prototype);
1904
1904
  return I.__wbg_ptr = A, ng.register(I, I.__wbg_ptr, I), I;
1905
1905
  }
1906
1906
  __destroy_into_raw() {
@@ -1913,11 +1913,11 @@ class x {
1913
1913
  }
1914
1914
  static identity() {
1915
1915
  const A = E.rawrotation_identity();
1916
- return x.__wrap(A);
1916
+ return m.__wrap(A);
1917
1917
  }
1918
1918
  static fromAngle(A) {
1919
1919
  const I = E.rawrotation_fromAngle(A);
1920
- return x.__wrap(I);
1920
+ return m.__wrap(I);
1921
1921
  }
1922
1922
  get im() {
1923
1923
  return E.rawkinematiccharactercontroller_offset(this.__wbg_ptr);
@@ -1945,21 +1945,21 @@ class LC {
1945
1945
  const A = E.rawccdsolver_new();
1946
1946
  return this.__wbg_ptr = A >>> 0, Hg.register(this, this.__wbg_ptr, this), this;
1947
1947
  }
1948
- serializeAll(A, I, C, g, Q, B, D, o, w) {
1949
- return s(A, N), s(I, ZA), s(C, qA), s(g, dA), s(Q, wA), s(B, IA), s(D, QA), s(o, rA), s(w, lA), wI(E.rawserializationpipeline_serializeAll(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr));
1948
+ serializeAll(A, I, C, g, Q, B, D, w, o) {
1949
+ return K(A, k), K(I, OA), K(C, qA), K(g, fA), K(Q, oA), K(B, IA), K(D, EA), K(w, rA), K(o, lA), wI(E.rawserializationpipeline_serializeAll(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D.__wbg_ptr, w.__wbg_ptr, o.__wbg_ptr));
1950
1950
  }
1951
1951
  deserializeAll(A) {
1952
- const I = E.rawserializationpipeline_deserializeAll(this.__wbg_ptr, V(A));
1952
+ const I = E.rawserializationpipeline_deserializeAll(this.__wbg_ptr, P(A));
1953
1953
  return I === 0 ? void 0 : zI.__wrap(I);
1954
1954
  }
1955
1955
  }
1956
1956
  const pg = typeof FinalizationRegistry > "u" ? { register: () => {
1957
1957
  }, unregister: () => {
1958
1958
  } } : new FinalizationRegistry((i) => E.__wbg_rawshape_free(i >>> 0, 1));
1959
- class n {
1959
+ class d {
1960
1960
  static __wrap(A) {
1961
1961
  A >>>= 0;
1962
- const I = Object.create(n.prototype);
1962
+ const I = Object.create(d.prototype);
1963
1963
  return I.__wbg_ptr = A, pg.register(I, I.__wbg_ptr, I), I;
1964
1964
  }
1965
1965
  __destroy_into_raw() {
@@ -1972,109 +1972,109 @@ class n {
1972
1972
  }
1973
1973
  static cuboid(A, I) {
1974
1974
  const C = E.rawshape_cuboid(A, I);
1975
- return n.__wrap(C);
1975
+ return d.__wrap(C);
1976
1976
  }
1977
1977
  static roundCuboid(A, I, C) {
1978
1978
  const g = E.rawshape_roundCuboid(A, I, C);
1979
- return n.__wrap(g);
1979
+ return d.__wrap(g);
1980
1980
  }
1981
1981
  static ball(A) {
1982
1982
  const I = E.rawshape_ball(A);
1983
- return n.__wrap(I);
1983
+ return d.__wrap(I);
1984
1984
  }
1985
1985
  static halfspace(A) {
1986
- s(A, N);
1986
+ K(A, k);
1987
1987
  const I = E.rawshape_halfspace(A.__wbg_ptr);
1988
- return n.__wrap(I);
1988
+ return d.__wrap(I);
1989
1989
  }
1990
1990
  static capsule(A, I) {
1991
1991
  const C = E.rawshape_capsule(A, I);
1992
- return n.__wrap(C);
1992
+ return d.__wrap(C);
1993
1993
  }
1994
1994
  static voxels(A, I) {
1995
- s(A, N);
1995
+ K(A, k);
1996
1996
  const C = tI(I, E.__wbindgen_export_2), g = FA, Q = E.rawshape_voxels(A.__wbg_ptr, C, g);
1997
- return n.__wrap(Q);
1997
+ return d.__wrap(Q);
1998
1998
  }
1999
1999
  static voxelsFromPoints(A, I) {
2000
- s(A, N);
2001
- const C = HA(I, E.__wbindgen_export_2), g = FA, Q = E.rawshape_voxelsFromPoints(A.__wbg_ptr, C, g);
2002
- return n.__wrap(Q);
2000
+ K(A, k);
2001
+ const C = pA(I, E.__wbindgen_export_2), g = FA, Q = E.rawshape_voxelsFromPoints(A.__wbg_ptr, C, g);
2002
+ return d.__wrap(Q);
2003
2003
  }
2004
2004
  static polyline(A, I) {
2005
- const C = HA(A, E.__wbindgen_export_2), g = FA, Q = tI(I, E.__wbindgen_export_2), B = FA, D = E.rawshape_polyline(C, g, Q, B);
2006
- return n.__wrap(D);
2005
+ const C = pA(A, E.__wbindgen_export_2), g = FA, Q = tI(I, E.__wbindgen_export_2), B = FA, D = E.rawshape_polyline(C, g, Q, B);
2006
+ return d.__wrap(D);
2007
2007
  }
2008
2008
  static trimesh(A, I, C) {
2009
- const g = HA(A, E.__wbindgen_export_2), Q = FA, B = tI(I, E.__wbindgen_export_2), D = FA, o = E.rawshape_trimesh(g, Q, B, D, C);
2010
- return o === 0 ? void 0 : n.__wrap(o);
2009
+ const g = pA(A, E.__wbindgen_export_2), Q = FA, B = tI(I, E.__wbindgen_export_2), D = FA, w = E.rawshape_trimesh(g, Q, B, D, C);
2010
+ return w === 0 ? void 0 : d.__wrap(w);
2011
2011
  }
2012
2012
  static heightfield(A, I) {
2013
- const C = HA(A, E.__wbindgen_export_2), g = FA;
2014
- s(I, N);
2013
+ const C = pA(A, E.__wbindgen_export_2), g = FA;
2014
+ K(I, k);
2015
2015
  const Q = E.rawshape_heightfield(C, g, I.__wbg_ptr);
2016
- return n.__wrap(Q);
2016
+ return d.__wrap(Q);
2017
2017
  }
2018
2018
  static segment(A, I) {
2019
- s(A, N), s(I, N);
2019
+ K(A, k), K(I, k);
2020
2020
  const C = E.rawshape_segment(A.__wbg_ptr, I.__wbg_ptr);
2021
- return n.__wrap(C);
2021
+ return d.__wrap(C);
2022
2022
  }
2023
2023
  static triangle(A, I, C) {
2024
- s(A, N), s(I, N), s(C, N);
2024
+ K(A, k), K(I, k), K(C, k);
2025
2025
  const g = E.rawshape_triangle(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr);
2026
- return n.__wrap(g);
2026
+ return d.__wrap(g);
2027
2027
  }
2028
2028
  static roundTriangle(A, I, C, g) {
2029
- s(A, N), s(I, N), s(C, N);
2029
+ K(A, k), K(I, k), K(C, k);
2030
2030
  const Q = E.rawshape_roundTriangle(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g);
2031
- return n.__wrap(Q);
2031
+ return d.__wrap(Q);
2032
2032
  }
2033
2033
  static convexHull(A) {
2034
- const I = HA(A, E.__wbindgen_export_2), C = FA, g = E.rawshape_convexHull(I, C);
2035
- return g === 0 ? void 0 : n.__wrap(g);
2034
+ const I = pA(A, E.__wbindgen_export_2), C = FA, g = E.rawshape_convexHull(I, C);
2035
+ return g === 0 ? void 0 : d.__wrap(g);
2036
2036
  }
2037
2037
  static roundConvexHull(A, I) {
2038
- const C = HA(A, E.__wbindgen_export_2), g = FA, Q = E.rawshape_roundConvexHull(C, g, I);
2039
- return Q === 0 ? void 0 : n.__wrap(Q);
2038
+ const C = pA(A, E.__wbindgen_export_2), g = FA, Q = E.rawshape_roundConvexHull(C, g, I);
2039
+ return Q === 0 ? void 0 : d.__wrap(Q);
2040
2040
  }
2041
2041
  static convexPolyline(A) {
2042
- const I = HA(A, E.__wbindgen_export_2), C = FA, g = E.rawshape_convexPolyline(I, C);
2043
- return g === 0 ? void 0 : n.__wrap(g);
2042
+ const I = pA(A, E.__wbindgen_export_2), C = FA, g = E.rawshape_convexPolyline(I, C);
2043
+ return g === 0 ? void 0 : d.__wrap(g);
2044
2044
  }
2045
2045
  static roundConvexPolyline(A, I) {
2046
- const C = HA(A, E.__wbindgen_export_2), g = FA, Q = E.rawshape_roundConvexPolyline(C, g, I);
2047
- return Q === 0 ? void 0 : n.__wrap(Q);
2046
+ const C = pA(A, E.__wbindgen_export_2), g = FA, Q = E.rawshape_roundConvexPolyline(C, g, I);
2047
+ return Q === 0 ? void 0 : d.__wrap(Q);
2048
2048
  }
2049
- castShape(A, I, C, g, Q, B, D, o, w, h) {
2050
- s(A, N), s(I, x), s(C, N), s(g, n), s(Q, N), s(B, x), s(D, N);
2051
- const G = E.rawshape_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D.__wbg_ptr, o, w, h);
2049
+ castShape(A, I, C, g, Q, B, D, w, o, h) {
2050
+ K(A, k), K(I, m), K(C, k), K(g, d), K(Q, k), K(B, m), K(D, k);
2051
+ const G = E.rawshape_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, D.__wbg_ptr, w, o, h);
2052
2052
  return G === 0 ? void 0 : JI.__wrap(G);
2053
2053
  }
2054
2054
  intersectsShape(A, I, C, g, Q) {
2055
- return s(A, N), s(I, x), s(C, n), s(g, N), s(Q, x), E.rawshape_intersectsShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr) !== 0;
2055
+ return K(A, k), K(I, m), K(C, d), K(g, k), K(Q, m), E.rawshape_intersectsShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr) !== 0;
2056
2056
  }
2057
2057
  contactShape(A, I, C, g, Q, B) {
2058
- s(A, N), s(I, x), s(C, n), s(g, N), s(Q, x);
2058
+ K(A, k), K(I, m), K(C, d), K(g, k), K(Q, m);
2059
2059
  const D = E.rawshape_contactShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B);
2060
2060
  return D === 0 ? void 0 : AI.__wrap(D);
2061
2061
  }
2062
2062
  containsPoint(A, I, C) {
2063
- return s(A, N), s(I, x), s(C, N), E.rawshape_containsPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr) !== 0;
2063
+ return K(A, k), K(I, m), K(C, k), E.rawshape_containsPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr) !== 0;
2064
2064
  }
2065
2065
  projectPoint(A, I, C, g) {
2066
- s(A, N), s(I, x), s(C, N);
2066
+ K(A, k), K(I, m), K(C, k);
2067
2067
  const Q = E.rawshape_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g);
2068
2068
  return yI.__wrap(Q);
2069
2069
  }
2070
2070
  intersectsRay(A, I, C, g, Q) {
2071
- return s(A, N), s(I, x), s(C, N), s(g, N), E.rawshape_intersectsRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q) !== 0;
2071
+ return K(A, k), K(I, m), K(C, k), K(g, k), E.rawshape_intersectsRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q) !== 0;
2072
2072
  }
2073
2073
  castRay(A, I, C, g, Q, B) {
2074
- return s(A, N), s(I, x), s(C, N), s(g, N), E.rawshape_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B);
2074
+ return K(A, k), K(I, m), K(C, k), K(g, k), E.rawshape_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B);
2075
2075
  }
2076
2076
  castRayAndGetNormal(A, I, C, g, Q, B) {
2077
- s(A, N), s(I, x), s(C, N), s(g, N);
2077
+ K(A, k), K(I, m), K(C, k), K(g, k);
2078
2078
  const D = E.rawshape_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B);
2079
2079
  return D === 0 ? void 0 : MI.__wrap(D);
2080
2080
  }
@@ -2101,19 +2101,19 @@ class JI {
2101
2101
  }
2102
2102
  witness1() {
2103
2103
  const A = E.rawshapecasthit_witness1(this.__wbg_ptr);
2104
- return N.__wrap(A);
2104
+ return k.__wrap(A);
2105
2105
  }
2106
2106
  witness2() {
2107
2107
  const A = E.rawcollidershapecasthit_witness1(this.__wbg_ptr);
2108
- return N.__wrap(A);
2108
+ return k.__wrap(A);
2109
2109
  }
2110
2110
  normal1() {
2111
2111
  const A = E.rawcollidershapecasthit_witness2(this.__wbg_ptr);
2112
- return N.__wrap(A);
2112
+ return k.__wrap(A);
2113
2113
  }
2114
2114
  normal2() {
2115
2115
  const A = E.rawcollidershapecasthit_normal1(this.__wbg_ptr);
2116
- return N.__wrap(A);
2116
+ return k.__wrap(A);
2117
2117
  }
2118
2118
  }
2119
2119
  const fg = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -2138,28 +2138,28 @@ class AI {
2138
2138
  }
2139
2139
  point1() {
2140
2140
  const A = E.rawpointprojection_point(this.__wbg_ptr);
2141
- return N.__wrap(A);
2141
+ return k.__wrap(A);
2142
2142
  }
2143
2143
  point2() {
2144
2144
  const A = E.rawpointcolliderprojection_point(this.__wbg_ptr);
2145
- return N.__wrap(A);
2145
+ return k.__wrap(A);
2146
2146
  }
2147
2147
  normal1() {
2148
2148
  const A = E.rawcontactforceevent_total_force(this.__wbg_ptr);
2149
- return N.__wrap(A);
2149
+ return k.__wrap(A);
2150
2150
  }
2151
2151
  normal2() {
2152
2152
  const A = E.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
2153
- return N.__wrap(A);
2153
+ return k.__wrap(A);
2154
2154
  }
2155
2155
  }
2156
2156
  const pI = typeof FinalizationRegistry > "u" ? { register: () => {
2157
2157
  }, unregister: () => {
2158
2158
  } } : new FinalizationRegistry((i) => E.__wbg_rawvector_free(i >>> 0, 1));
2159
- class N {
2159
+ class k {
2160
2160
  static __wrap(A) {
2161
2161
  A >>>= 0;
2162
- const I = Object.create(N.prototype);
2162
+ const I = Object.create(k.prototype);
2163
2163
  return I.__wbg_ptr = A, pI.register(I, I.__wbg_ptr, I), I;
2164
2164
  }
2165
2165
  __destroy_into_raw() {
@@ -2172,7 +2172,7 @@ class N {
2172
2172
  }
2173
2173
  static zero() {
2174
2174
  const A = E.rawvector_zero();
2175
- return N.__wrap(A);
2175
+ return k.__wrap(A);
2176
2176
  }
2177
2177
  constructor(A, I) {
2178
2178
  const C = E.rawvector_new(A, I);
@@ -2192,11 +2192,11 @@ class N {
2192
2192
  }
2193
2193
  xy() {
2194
2194
  const A = E.rawvector_xy(this.__wbg_ptr);
2195
- return N.__wrap(A);
2195
+ return k.__wrap(A);
2196
2196
  }
2197
2197
  yx() {
2198
2198
  const A = E.rawvector_yx(this.__wbg_ptr);
2199
- return N.__wrap(A);
2199
+ return k.__wrap(A);
2200
2200
  }
2201
2201
  }
2202
2202
  async function mg(i) {
@@ -2204,80 +2204,80 @@ async function mg(i) {
2204
2204
  i !== void 0 && (Object.getPrototypeOf(i) === Object.prototype ? { module_or_path: i } = i : console.warn("using deprecated parameters for the initialization function; pass a single object instead")), i === void 0 && (i = new URL("rapier_wasm2d_bg.wasm", "<deleted>"));
2205
2205
  const A = function() {
2206
2206
  const g = { wbg: {} };
2207
- return g.wbg.__wbg_bind_c8359b1cba058168 = function(Q, B, D, o) {
2208
- return V(T(Q).bind(T(B), T(D), T(o)));
2207
+ return g.wbg.__wbg_bind_c8359b1cba058168 = function(Q, B, D, w) {
2208
+ return P(W(Q).bind(W(B), W(D), W(w)));
2209
2209
  }, g.wbg.__wbg_buffer_609cc3eee51ed158 = function(Q) {
2210
- return V(T(Q).buffer);
2210
+ return P(W(Q).buffer);
2211
2211
  }, g.wbg.__wbg_call_672a4d21634d4a24 = function() {
2212
2212
  return oI(function(Q, B) {
2213
- return V(T(Q).call(T(B)));
2213
+ return P(W(Q).call(W(B)));
2214
2214
  }, arguments);
2215
2215
  }, g.wbg.__wbg_call_7cccdd69e0791ae2 = function() {
2216
2216
  return oI(function(Q, B, D) {
2217
- return V(T(Q).call(T(B), T(D)));
2217
+ return P(W(Q).call(W(B), W(D)));
2218
2218
  }, arguments);
2219
2219
  }, g.wbg.__wbg_call_833bed5770ea2041 = function() {
2220
- return oI(function(Q, B, D, o) {
2221
- return V(T(Q).call(T(B), T(D), T(o)));
2220
+ return oI(function(Q, B, D, w) {
2221
+ return P(W(Q).call(W(B), W(D), W(w)));
2222
2222
  }, arguments);
2223
2223
  }, g.wbg.__wbg_call_b8adc8b1d0a0d8eb = function() {
2224
- return oI(function(Q, B, D, o, w) {
2225
- return V(T(Q).call(T(B), T(D), T(o), T(w)));
2224
+ return oI(function(Q, B, D, w, o) {
2225
+ return P(W(Q).call(W(B), W(D), W(w), W(o)));
2226
2226
  }, arguments);
2227
2227
  }, g.wbg.__wbg_length_3b4f022188ae8db6 = function(Q) {
2228
- return T(Q).length;
2228
+ return W(Q).length;
2229
2229
  }, g.wbg.__wbg_length_a446193dc22c12f8 = function(Q) {
2230
- return T(Q).length;
2230
+ return W(Q).length;
2231
2231
  }, g.wbg.__wbg_new_a12002a7f91c75be = function(Q) {
2232
- return V(new Uint8Array(T(Q)));
2232
+ return P(new Uint8Array(W(Q)));
2233
2233
  }, g.wbg.__wbg_newnoargs_105ed471475aaf50 = function(Q, B) {
2234
- return V(new Function(fI(Q, B)));
2234
+ return P(new Function(fI(Q, B)));
2235
2235
  }, g.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(Q, B, D) {
2236
- return V(new Uint8Array(T(Q), B >>> 0, D >>> 0));
2236
+ return P(new Uint8Array(W(Q), B >>> 0, D >>> 0));
2237
2237
  }, g.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(Q, B, D) {
2238
- return V(new Float32Array(T(Q), B >>> 0, D >>> 0));
2238
+ return P(new Float32Array(W(Q), B >>> 0, D >>> 0));
2239
2239
  }, g.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(Q) {
2240
- return V(new Float32Array(Q >>> 0));
2240
+ return P(new Float32Array(Q >>> 0));
2241
2241
  }, g.wbg.__wbg_now_2c95c9de01293173 = function(Q) {
2242
- return T(Q).now();
2242
+ return W(Q).now();
2243
2243
  }, g.wbg.__wbg_performance_7a3ffd0b17f663ad = function(Q) {
2244
- return V(T(Q).performance);
2244
+ return P(W(Q).performance);
2245
2245
  }, g.wbg.__wbg_rawcontactforceevent_new = function(Q) {
2246
- return V(uI.__wrap(Q));
2246
+ return P(uI.__wrap(Q));
2247
2247
  }, g.wbg.__wbg_rawraycolliderintersection_new = function(Q) {
2248
- return V(FI.__wrap(Q));
2248
+ return P(FI.__wrap(Q));
2249
2249
  }, g.wbg.__wbg_set_10bad9bee0e9c58b = function(Q, B, D) {
2250
- T(Q).set(T(B), D >>> 0);
2250
+ W(Q).set(W(B), D >>> 0);
2251
2251
  }, g.wbg.__wbg_set_65595bdd868b3009 = function(Q, B, D) {
2252
- T(Q).set(T(B), D >>> 0);
2252
+ W(Q).set(W(B), D >>> 0);
2253
2253
  }, g.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
2254
2254
  const Q = typeof global > "u" ? null : global;
2255
- return Y(Q) ? 0 : V(Q);
2255
+ return L(Q) ? 0 : P(Q);
2256
2256
  }, g.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
2257
2257
  const Q = typeof globalThis > "u" ? null : globalThis;
2258
- return Y(Q) ? 0 : V(Q);
2258
+ return L(Q) ? 0 : P(Q);
2259
2259
  }, g.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
2260
2260
  const Q = typeof self > "u" ? null : self;
2261
- return Y(Q) ? 0 : V(Q);
2261
+ return L(Q) ? 0 : P(Q);
2262
2262
  }, g.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
2263
2263
  const Q = typeof window > "u" ? null : window;
2264
- return Y(Q) ? 0 : V(Q);
2264
+ return L(Q) ? 0 : P(Q);
2265
2265
  }, g.wbg.__wbindgen_boolean_get = function(Q) {
2266
- const B = T(Q);
2266
+ const B = W(Q);
2267
2267
  return typeof B == "boolean" ? B ? 1 : 0 : 2;
2268
2268
  }, g.wbg.__wbindgen_is_function = function(Q) {
2269
- return typeof T(Q) == "function";
2269
+ return typeof W(Q) == "function";
2270
2270
  }, g.wbg.__wbindgen_is_undefined = function(Q) {
2271
- return T(Q) === void 0;
2271
+ return W(Q) === void 0;
2272
2272
  }, g.wbg.__wbindgen_memory = function() {
2273
- return V(E.memory);
2273
+ return P(E.memory);
2274
2274
  }, g.wbg.__wbindgen_number_get = function(Q, B) {
2275
- const D = T(B), o = typeof D == "number" ? D : void 0;
2276
- sA().setFloat64(Q + 8, Y(o) ? 0 : o, !0), sA().setInt32(Q + 0, !Y(o), !0);
2275
+ const D = W(B), w = typeof D == "number" ? D : void 0;
2276
+ GA().setFloat64(Q + 8, L(w) ? 0 : w, !0), GA().setInt32(Q + 0, !L(w), !0);
2277
2277
  }, g.wbg.__wbindgen_number_new = function(Q) {
2278
- return V(Q);
2278
+ return P(Q);
2279
2279
  }, g.wbg.__wbindgen_object_clone_ref = function(Q) {
2280
- return V(T(Q));
2280
+ return P(W(Q));
2281
2281
  }, g.wbg.__wbindgen_object_drop_ref = function(Q) {
2282
2282
  wI(Q);
2283
2283
  }, g.wbg.__wbindgen_throw = function(Q, B) {
@@ -2302,7 +2302,7 @@ async function mg(i) {
2302
2302
  }
2303
2303
  }(await i, A);
2304
2304
  return function(g, Q) {
2305
- return E = g.exports, mg.__wbindgen_wasm_module = Q, fA = null, zA = null, PA = null, _A = null, VA = null, E;
2305
+ return E = g.exports, mg.__wbindgen_wasm_module = Q, bA = null, zA = null, PA = null, _A = null, VA = null, E;
2306
2306
  }(I, C);
2307
2307
  }
2308
2308
  class xg {
@@ -2310,26 +2310,26 @@ class xg {
2310
2310
  this.x = A, this.y = I;
2311
2311
  }
2312
2312
  }
2313
- class S {
2313
+ class N {
2314
2314
  static new(A, I) {
2315
2315
  return new xg(A, I);
2316
2316
  }
2317
2317
  static zeros() {
2318
- return S.new(0, 0);
2318
+ return N.new(0, 0);
2319
2319
  }
2320
2320
  static fromRaw(A) {
2321
2321
  if (!A) return null;
2322
- let I = S.new(A.x, A.y);
2322
+ let I = N.new(A.x, A.y);
2323
2323
  return A.free(), I;
2324
2324
  }
2325
2325
  static intoRaw(A) {
2326
- return new N(A.x, A.y);
2326
+ return new k(A.x, A.y);
2327
2327
  }
2328
2328
  static copy(A, I) {
2329
2329
  A.x = I.x, A.y = I.y;
2330
2330
  }
2331
2331
  }
2332
- class P {
2332
+ class z {
2333
2333
  static identity() {
2334
2334
  return 0;
2335
2335
  }
@@ -2339,10 +2339,10 @@ class P {
2339
2339
  return A.free(), I;
2340
2340
  }
2341
2341
  static intoRaw(A) {
2342
- return x.fromAngle(A);
2342
+ return m.fromAngle(A);
2343
2343
  }
2344
2344
  }
2345
- var cA, MA, TI, ZI, II, xA, aA, WI, OI, hI, sI, jI, mI, KI, TA;
2345
+ var cA, MA, TI, ZI, II, xA, KA, OI, WI, GI, sI, jI, mI, KI, ZA;
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 = {}));
@@ -2391,25 +2391,25 @@ class xI {
2391
2391
  }
2392
2392
  translation() {
2393
2393
  let A = this.rawSet.rbTranslation(this.handle);
2394
- return S.fromRaw(A);
2394
+ return N.fromRaw(A);
2395
2395
  }
2396
2396
  rotation() {
2397
2397
  let A = this.rawSet.rbRotation(this.handle);
2398
- return P.fromRaw(A);
2398
+ return z.fromRaw(A);
2399
2399
  }
2400
2400
  nextTranslation() {
2401
2401
  let A = this.rawSet.rbNextTranslation(this.handle);
2402
- return S.fromRaw(A);
2402
+ return N.fromRaw(A);
2403
2403
  }
2404
2404
  nextRotation() {
2405
2405
  let A = this.rawSet.rbNextRotation(this.handle);
2406
- return P.fromRaw(A);
2406
+ return z.fromRaw(A);
2407
2407
  }
2408
2408
  setTranslation(A, I) {
2409
2409
  this.rawSet.rbSetTranslation(this.handle, A.x, A.y, I);
2410
2410
  }
2411
2411
  setLinvel(A, I) {
2412
- let C = S.intoRaw(A);
2412
+ let C = N.intoRaw(A);
2413
2413
  this.rawSet.rbSetLinvel(this.handle, C, I), C.free();
2414
2414
  }
2415
2415
  gravityScale() {
@@ -2431,11 +2431,11 @@ class xI {
2431
2431
  this.rawSet.rbSetNextKinematicRotation(this.handle, A);
2432
2432
  }
2433
2433
  linvel() {
2434
- return S.fromRaw(this.rawSet.rbLinvel(this.handle));
2434
+ return N.fromRaw(this.rawSet.rbLinvel(this.handle));
2435
2435
  }
2436
2436
  velocityAtPoint(A) {
2437
- const I = S.intoRaw(A);
2438
- let C = S.fromRaw(this.rawSet.rbVelocityAtPoint(this.handle, I));
2437
+ const I = N.intoRaw(A);
2438
+ let C = N.fromRaw(this.rawSet.rbVelocityAtPoint(this.handle, I));
2439
2439
  return I.free(), C;
2440
2440
  }
2441
2441
  angvel() {
@@ -2445,16 +2445,16 @@ class xI {
2445
2445
  return this.rawSet.rbMass(this.handle);
2446
2446
  }
2447
2447
  effectiveInvMass() {
2448
- return S.fromRaw(this.rawSet.rbEffectiveInvMass(this.handle));
2448
+ return N.fromRaw(this.rawSet.rbEffectiveInvMass(this.handle));
2449
2449
  }
2450
2450
  invMass() {
2451
2451
  return this.rawSet.rbInvMass(this.handle);
2452
2452
  }
2453
2453
  localCom() {
2454
- return S.fromRaw(this.rawSet.rbLocalCom(this.handle));
2454
+ return N.fromRaw(this.rawSet.rbLocalCom(this.handle));
2455
2455
  }
2456
2456
  worldCom() {
2457
- return S.fromRaw(this.rawSet.rbWorldCom(this.handle));
2457
+ return N.fromRaw(this.rawSet.rbWorldCom(this.handle));
2458
2458
  }
2459
2459
  invPrincipalInertia() {
2460
2460
  return this.rawSet.rbInvPrincipalInertia(this.handle);
@@ -2526,7 +2526,7 @@ class xI {
2526
2526
  this.rawSet.rbSetAdditionalMass(this.handle, A, I);
2527
2527
  }
2528
2528
  setAdditionalMassProperties(A, I, C, g) {
2529
- let Q = S.intoRaw(I);
2529
+ let Q = N.intoRaw(I);
2530
2530
  this.rawSet.rbSetAdditionalMassProperties(this.handle, A, Q, C, g), Q.free();
2531
2531
  }
2532
2532
  setAngularDamping(A) {
@@ -2539,11 +2539,11 @@ class xI {
2539
2539
  this.rawSet.rbResetTorques(this.handle, A);
2540
2540
  }
2541
2541
  addForce(A, I) {
2542
- const C = S.intoRaw(A);
2542
+ const C = N.intoRaw(A);
2543
2543
  this.rawSet.rbAddForce(this.handle, C, I), C.free();
2544
2544
  }
2545
2545
  applyImpulse(A, I) {
2546
- const C = S.intoRaw(A);
2546
+ const C = N.intoRaw(A);
2547
2547
  this.rawSet.rbApplyImpulse(this.handle, C, I), C.free();
2548
2548
  }
2549
2549
  addTorque(A, I) {
@@ -2553,15 +2553,15 @@ class xI {
2553
2553
  this.rawSet.rbApplyTorqueImpulse(this.handle, A, I);
2554
2554
  }
2555
2555
  addForceAtPoint(A, I, C) {
2556
- const g = S.intoRaw(A), Q = S.intoRaw(I);
2556
+ const g = N.intoRaw(A), Q = N.intoRaw(I);
2557
2557
  this.rawSet.rbAddForceAtPoint(this.handle, g, Q, C), g.free(), Q.free();
2558
2558
  }
2559
2559
  applyImpulseAtPoint(A, I, C) {
2560
- const g = S.intoRaw(A), Q = S.intoRaw(I);
2560
+ const g = N.intoRaw(A), Q = N.intoRaw(I);
2561
2561
  this.rawSet.rbApplyImpulseAtPoint(this.handle, g, Q, C), g.free(), Q.free();
2562
2562
  }
2563
2563
  userForce() {
2564
- return S.fromRaw(this.rawSet.rbUserForce(this.handle));
2564
+ return N.fromRaw(this.rawSet.rbUserForce(this.handle));
2565
2565
  }
2566
2566
  userTorque() {
2567
2567
  return this.rawSet.rbUserTorque(this.handle);
@@ -2569,7 +2569,7 @@ class xI {
2569
2569
  }
2570
2570
  class YA {
2571
2571
  constructor(A) {
2572
- this.enabled = !0, this.status = A, this.translation = S.zeros(), this.rotation = P.identity(), this.gravityScale = 1, this.linvel = S.zeros(), this.mass = 0, this.massOnly = !1, this.centerOfMass = S.zeros(), this.translationsEnabledX = !0, this.translationsEnabledY = !0, this.angvel = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0, this.linearDamping = 0, this.angularDamping = 0, this.canSleep = !0, this.sleeping = !1, this.ccdEnabled = !1, this.softCcdPrediction = 0, this.dominanceGroup = 0, this.additionalSolverIterations = 0;
2572
+ this.enabled = !0, this.status = A, this.translation = N.zeros(), this.rotation = z.identity(), this.gravityScale = 1, this.linvel = N.zeros(), this.mass = 0, this.massOnly = !1, this.centerOfMass = N.zeros(), this.translationsEnabledX = !0, this.translationsEnabledY = !0, this.angvel = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0, this.linearDamping = 0, this.angularDamping = 0, this.canSleep = !0, this.sleeping = !1, this.ccdEnabled = !1, this.softCcdPrediction = 0, this.dominanceGroup = 0, this.additionalSolverIterations = 0;
2573
2573
  }
2574
2574
  static dynamic() {
2575
2575
  return new YA(cA.Dynamic);
@@ -2625,7 +2625,7 @@ class YA {
2625
2625
  return this.angvel = A, this;
2626
2626
  }
2627
2627
  setAdditionalMassProperties(A, I, C) {
2628
- return this.mass = A, S.copy(this.centerOfMass, I), this.principalAngularInertia = C, this.massOnly = !1, this;
2628
+ return this.mass = A, N.copy(this.centerOfMass, I), this.principalAngularInertia = C, this.massOnly = !1, this;
2629
2629
  }
2630
2630
  enabledTranslations(A, I) {
2631
2631
  return this.translationsEnabledX = A, this.translationsEnabledY = I, this;
@@ -2707,10 +2707,10 @@ class Xg {
2707
2707
  this.map.forEach((I) => I.finalizeDeserialization(A));
2708
2708
  }
2709
2709
  createRigidBody(A, I) {
2710
- let C = S.intoRaw(I.translation), g = P.intoRaw(I.rotation), Q = S.intoRaw(I.linvel), B = S.intoRaw(I.centerOfMass), D = this.raw.createRigidBody(I.enabled, C, g, I.gravityScale, I.mass, I.massOnly, B, Q, I.angvel, I.principalAngularInertia, I.translationsEnabledX, I.translationsEnabledY, I.rotationsEnabled, I.linearDamping, I.angularDamping, I.status, I.canSleep, I.sleeping, I.softCcdPrediction, I.ccdEnabled, I.dominanceGroup, I.additionalSolverIterations);
2710
+ let C = N.intoRaw(I.translation), g = z.intoRaw(I.rotation), Q = N.intoRaw(I.linvel), B = N.intoRaw(I.centerOfMass), D = this.raw.createRigidBody(I.enabled, C, g, I.gravityScale, I.mass, I.massOnly, B, Q, I.angvel, I.principalAngularInertia, I.translationsEnabledX, I.translationsEnabledY, I.rotationsEnabled, I.linearDamping, I.angularDamping, I.status, I.canSleep, I.sleeping, I.softCcdPrediction, I.ccdEnabled, I.dominanceGroup, I.additionalSolverIterations);
2711
2711
  C.free(), g.free(), Q.free(), B.free();
2712
- const o = new xI(this.raw, A, D);
2713
- return o.userData = I.userData, this.map.set(D, o), o;
2712
+ const w = new xI(this.raw, A, D);
2713
+ return w.userData = I.userData, this.map.set(D, w), w;
2714
2714
  }
2715
2715
  remove(A, I, C, g, Q) {
2716
2716
  for (let B = 0; B < this.raw.rbNumColliders(A); B += 1) C.unmap(this.raw.rbCollider(A, B));
@@ -2739,7 +2739,7 @@ class Xg {
2739
2739
  }
2740
2740
  class vg {
2741
2741
  constructor(A) {
2742
- this.raw = A || new ZA();
2742
+ this.raw = A || new OA();
2743
2743
  }
2744
2744
  free() {
2745
2745
  this.raw && this.raw.free(), this.raw = void 0;
@@ -2812,15 +2812,15 @@ class nA {
2812
2812
  }
2813
2813
  static newTyped(A, I, C) {
2814
2814
  switch (A.jointType(C)) {
2815
- case pA.Revolute:
2815
+ case dA.Revolute:
2816
2816
  return new _g(A, I, C);
2817
- case pA.Prismatic:
2817
+ case dA.Prismatic:
2818
2818
  return new zg(A, I, C);
2819
- case pA.Fixed:
2819
+ case dA.Fixed:
2820
2820
  return new ug(A, I, C);
2821
- case pA.Spring:
2821
+ case dA.Spring:
2822
2822
  return new Pg(A, I, C);
2823
- case pA.Rope:
2823
+ case dA.Rope:
2824
2824
  return new Vg(A, I, C);
2825
2825
  default:
2826
2826
  return new nA(A, I, C);
@@ -2842,17 +2842,17 @@ class nA {
2842
2842
  return this.rawSet.jointType(this.handle);
2843
2843
  }
2844
2844
  anchor1() {
2845
- return S.fromRaw(this.rawSet.jointAnchor1(this.handle));
2845
+ return N.fromRaw(this.rawSet.jointAnchor1(this.handle));
2846
2846
  }
2847
2847
  anchor2() {
2848
- return S.fromRaw(this.rawSet.jointAnchor2(this.handle));
2848
+ return N.fromRaw(this.rawSet.jointAnchor2(this.handle));
2849
2849
  }
2850
2850
  setAnchor1(A) {
2851
- const I = S.intoRaw(A);
2851
+ const I = N.intoRaw(A);
2852
2852
  this.rawSet.jointSetAnchor1(this.handle, I), I.free();
2853
2853
  }
2854
2854
  setAnchor2(A) {
2855
- const I = S.intoRaw(A);
2855
+ const I = N.intoRaw(A);
2856
2856
  this.rawSet.jointSetAnchor2(this.handle, I), I.free();
2857
2857
  }
2858
2858
  setContactsEnabled(A) {
@@ -2904,35 +2904,35 @@ class _g extends $I {
2904
2904
  return NI.AngX;
2905
2905
  }
2906
2906
  }
2907
- class bA {
2907
+ class TA {
2908
2908
  constructor() {
2909
2909
  }
2910
2910
  static fixed(A, I, C, g) {
2911
- let Q = new bA();
2911
+ let Q = new TA();
2912
2912
  return Q.anchor1 = A, Q.anchor2 = C, Q.frame1 = I, Q.frame2 = g, Q.jointType = MA.Fixed, Q;
2913
2913
  }
2914
2914
  static spring(A, I, C, g, Q) {
2915
- let B = new bA();
2915
+ let B = new TA();
2916
2916
  return B.anchor1 = g, B.anchor2 = Q, B.length = A, B.stiffness = I, B.damping = C, B.jointType = MA.Spring, B;
2917
2917
  }
2918
2918
  static rope(A, I, C) {
2919
- let g = new bA();
2919
+ let g = new TA();
2920
2920
  return g.anchor1 = I, g.anchor2 = C, g.length = A, g.jointType = MA.Rope, g;
2921
2921
  }
2922
2922
  static revolute(A, I) {
2923
- let C = new bA();
2923
+ let C = new TA();
2924
2924
  return C.anchor1 = A, C.anchor2 = I, C.jointType = MA.Revolute, C;
2925
2925
  }
2926
2926
  static prismatic(A, I, C) {
2927
- let g = new bA();
2927
+ let g = new TA();
2928
2928
  return g.anchor1 = A, g.anchor2 = I, g.axis = C, g.jointType = MA.Prismatic, g;
2929
2929
  }
2930
2930
  intoRaw() {
2931
- let A, I, C = S.intoRaw(this.anchor1), g = S.intoRaw(this.anchor2), Q = !1, B = 0, D = 0;
2931
+ let A, I, C = N.intoRaw(this.anchor1), g = N.intoRaw(this.anchor2), Q = !1, B = 0, D = 0;
2932
2932
  switch (this.jointType) {
2933
2933
  case MA.Fixed:
2934
- let o = P.intoRaw(this.frame1), w = P.intoRaw(this.frame2);
2935
- I = kA.fixed(C, o, g, w), o.free(), w.free();
2934
+ let w = z.intoRaw(this.frame1), o = z.intoRaw(this.frame2);
2935
+ I = kA.fixed(C, w, g, o), w.free(), o.free();
2936
2936
  break;
2937
2937
  case MA.Spring:
2938
2938
  I = kA.spring(this.length, this.stiffness, this.damping, C, g);
@@ -2941,7 +2941,7 @@ class bA {
2941
2941
  I = kA.rope(this.length, C, g);
2942
2942
  break;
2943
2943
  case MA.Prismatic:
2944
- A = S.intoRaw(this.axis), this.limitsEnabled && (Q = !0, B = this.limits[0], D = this.limits[1]), I = kA.prismatic(C, g, A, Q, B, D), A.free();
2944
+ A = N.intoRaw(this.axis), this.limitsEnabled && (Q = !0, B = this.limits[0], D = this.limits[1]), I = kA.prismatic(C, g, A, Q, B, D), A.free();
2945
2945
  break;
2946
2946
  case MA.Revolute:
2947
2947
  I = kA.revolute(C, g);
@@ -2964,8 +2964,8 @@ class $g {
2964
2964
  createJoint(A, I, C, g, Q) {
2965
2965
  const B = I.intoRaw(), D = this.raw.createJoint(B, C, g, Q);
2966
2966
  B.free();
2967
- let o = nA.newTyped(this.raw, A, D);
2968
- return this.map.set(D, o), o;
2967
+ let w = nA.newTyped(this.raw, A, D);
2968
+ return this.map.set(D, w), w;
2969
2969
  }
2970
2970
  remove(A, I) {
2971
2971
  this.raw.remove(A, I), this.unmap(A);
@@ -2998,11 +2998,11 @@ class WA {
2998
2998
  }
2999
2999
  static newTyped(A, I) {
3000
3000
  switch (A.jointType(I)) {
3001
- case pA.Revolute:
3001
+ case dA.Revolute:
3002
3002
  return new gC(A, I);
3003
- case pA.Prismatic:
3003
+ case dA.Prismatic:
3004
3004
  return new IC(A, I);
3005
- case pA.Fixed:
3005
+ case dA.Fixed:
3006
3006
  return new AC(A, I);
3007
3007
  default:
3008
3008
  return new WA(A, I);
@@ -3111,7 +3111,7 @@ class QI {
3111
3111
  }
3112
3112
  static fromRaw(A) {
3113
3113
  if (!A) return null;
3114
- const I = new QI(A.time_of_impact(), S.fromRaw(A.normal()), A.featureType(), A.featureId());
3114
+ const I = new QI(A.time_of_impact(), N.fromRaw(A.normal()), A.featureType(), A.featureId());
3115
3115
  return A.free(), I;
3116
3116
  }
3117
3117
  }
@@ -3121,7 +3121,7 @@ class gI {
3121
3121
  }
3122
3122
  static fromRaw(A, I) {
3123
3123
  if (!I) return null;
3124
- const C = new gI(A.get(I.colliderHandle()), I.time_of_impact(), S.fromRaw(I.normal()), I.featureType(), I.featureId());
3124
+ const C = new gI(A.get(I.colliderHandle()), I.time_of_impact(), N.fromRaw(I.normal()), I.featureType(), I.featureId());
3125
3125
  return I.free(), C;
3126
3126
  }
3127
3127
  }
@@ -3141,7 +3141,7 @@ class BI {
3141
3141
  }
3142
3142
  static fromRaw(A) {
3143
3143
  if (!A) return null;
3144
- const I = new BI(S.fromRaw(A.point()), A.isInside());
3144
+ const I = new BI(N.fromRaw(A.point()), A.isInside());
3145
3145
  return A.free(), I;
3146
3146
  }
3147
3147
  }
@@ -3151,7 +3151,7 @@ class CI {
3151
3151
  }
3152
3152
  static fromRaw(A, I) {
3153
3153
  if (!I) return null;
3154
- const C = new CI(A.get(I.colliderHandle()), S.fromRaw(I.point()), I.isInside(), I.featureType(), I.featureId());
3154
+ const C = new CI(A.get(I.colliderHandle()), N.fromRaw(I.point()), I.isInside(), I.featureType(), I.featureId());
3155
3155
  return I.free(), C;
3156
3156
  }
3157
3157
  }
@@ -3161,7 +3161,7 @@ class vA {
3161
3161
  }
3162
3162
  static fromRaw(A, I) {
3163
3163
  if (!I) return null;
3164
- const C = new vA(I.time_of_impact(), S.fromRaw(I.witness1()), S.fromRaw(I.witness2()), S.fromRaw(I.normal1()), S.fromRaw(I.normal2()));
3164
+ const C = new vA(I.time_of_impact(), N.fromRaw(I.witness1()), N.fromRaw(I.witness2()), N.fromRaw(I.normal1()), N.fromRaw(I.normal2()));
3165
3165
  return I.free(), C;
3166
3166
  }
3167
3167
  }
@@ -3171,61 +3171,61 @@ class EI extends vA {
3171
3171
  }
3172
3172
  static fromRaw(A, I) {
3173
3173
  if (!I) return null;
3174
- const C = new EI(A.get(I.colliderHandle()), I.time_of_impact(), S.fromRaw(I.witness1()), S.fromRaw(I.witness2()), S.fromRaw(I.normal1()), S.fromRaw(I.normal2()));
3174
+ const C = new EI(A.get(I.colliderHandle()), I.time_of_impact(), N.fromRaw(I.witness1()), N.fromRaw(I.witness2()), N.fromRaw(I.normal1()), N.fromRaw(I.normal2()));
3175
3175
  return I.free(), C;
3176
3176
  }
3177
3177
  }
3178
3178
  class EC {
3179
3179
  constructor(A) {
3180
- this.raw = A || new dA();
3180
+ this.raw = A || new fA();
3181
3181
  }
3182
3182
  free() {
3183
3183
  this.raw && this.raw.free(), this.raw = void 0;
3184
3184
  }
3185
- castRay(A, I, C, g, Q, B, D, o, w, h, G) {
3186
- let K = S.intoRaw(g.origin), a = S.intoRaw(g.dir), M = RI.fromRaw(C, this.raw.castRay(A.raw, I.raw, C.raw, K, a, Q, B, D, o, w, h, G));
3187
- return K.free(), a.free(), M;
3185
+ castRay(A, I, C, g, Q, B, D, w, o, h, G) {
3186
+ let s = N.intoRaw(g.origin), a = N.intoRaw(g.dir), M = RI.fromRaw(C, this.raw.castRay(A.raw, I.raw, C.raw, s, a, Q, B, D, w, o, h, G));
3187
+ return s.free(), a.free(), M;
3188
3188
  }
3189
- castRayAndGetNormal(A, I, C, g, Q, B, D, o, w, h, G) {
3190
- let K = S.intoRaw(g.origin), a = S.intoRaw(g.dir), M = gI.fromRaw(C, this.raw.castRayAndGetNormal(A.raw, I.raw, C.raw, K, a, Q, B, D, o, w, h, G));
3191
- return K.free(), a.free(), M;
3189
+ castRayAndGetNormal(A, I, C, g, Q, B, D, w, o, h, G) {
3190
+ let s = N.intoRaw(g.origin), a = N.intoRaw(g.dir), M = gI.fromRaw(C, this.raw.castRayAndGetNormal(A.raw, I.raw, C.raw, s, a, Q, B, D, w, o, h, G));
3191
+ return s.free(), a.free(), M;
3192
3192
  }
3193
- intersectionsWithRay(A, I, C, g, Q, B, D, o, w, h, G, K) {
3194
- let a = S.intoRaw(g.origin), M = S.intoRaw(g.dir);
3195
- this.raw.intersectionsWithRay(A.raw, I.raw, C.raw, a, M, Q, B, (y) => D(gI.fromRaw(C, y)), o, w, h, G, K), a.free(), M.free();
3193
+ intersectionsWithRay(A, I, C, g, Q, B, D, w, o, h, G, s) {
3194
+ let a = N.intoRaw(g.origin), M = N.intoRaw(g.dir);
3195
+ this.raw.intersectionsWithRay(A.raw, I.raw, C.raw, a, M, Q, B, (y) => D(gI.fromRaw(C, y)), w, o, h, G, s), a.free(), M.free();
3196
3196
  }
3197
- intersectionWithShape(A, I, C, g, Q, B, D, o, w, h, G) {
3198
- let K = S.intoRaw(g), a = P.intoRaw(Q), M = B.intoRaw(), y = this.raw.intersectionWithShape(A.raw, I.raw, C.raw, K, a, M, D, o, w, h, G);
3199
- return K.free(), a.free(), M.free(), y;
3197
+ intersectionWithShape(A, I, C, g, Q, B, D, w, o, h, G) {
3198
+ let s = N.intoRaw(g), a = z.intoRaw(Q), M = B.intoRaw(), y = this.raw.intersectionWithShape(A.raw, I.raw, C.raw, s, a, M, D, w, o, h, G);
3199
+ return s.free(), a.free(), M.free(), y;
3200
3200
  }
3201
- projectPoint(A, I, C, g, Q, B, D, o, w, h) {
3202
- let G = S.intoRaw(g), K = CI.fromRaw(C, this.raw.projectPoint(A.raw, I.raw, C.raw, G, Q, B, D, o, w, h));
3203
- return G.free(), K;
3201
+ projectPoint(A, I, C, g, Q, B, D, w, o, h) {
3202
+ let G = N.intoRaw(g), s = CI.fromRaw(C, this.raw.projectPoint(A.raw, I.raw, C.raw, G, Q, B, D, w, o, h));
3203
+ return G.free(), s;
3204
3204
  }
3205
- projectPointAndGetFeature(A, I, C, g, Q, B, D, o, w) {
3206
- let h = S.intoRaw(g), G = CI.fromRaw(C, this.raw.projectPointAndGetFeature(A.raw, I.raw, C.raw, h, Q, B, D, o, w));
3205
+ projectPointAndGetFeature(A, I, C, g, Q, B, D, w, o) {
3206
+ let h = N.intoRaw(g), G = CI.fromRaw(C, this.raw.projectPointAndGetFeature(A.raw, I.raw, C.raw, h, Q, B, D, w, o));
3207
3207
  return h.free(), G;
3208
3208
  }
3209
- intersectionsWithPoint(A, I, C, g, Q, B, D, o, w, h) {
3210
- let G = S.intoRaw(g);
3211
- this.raw.intersectionsWithPoint(A.raw, I.raw, C.raw, G, Q, B, D, o, w, h), G.free();
3209
+ intersectionsWithPoint(A, I, C, g, Q, B, D, w, o, h) {
3210
+ let G = N.intoRaw(g);
3211
+ this.raw.intersectionsWithPoint(A.raw, I.raw, C.raw, G, Q, B, D, w, o, h), G.free();
3212
3212
  }
3213
- castShape(A, I, C, g, Q, B, D, o, w, h, G, K, a, M, y) {
3214
- let J = S.intoRaw(g), k = P.intoRaw(Q), F = S.intoRaw(B), R = D.intoRaw(), U = EI.fromRaw(C, this.raw.castShape(A.raw, I.raw, C.raw, J, k, F, R, o, w, h, G, K, a, M, y));
3215
- return J.free(), k.free(), F.free(), R.free(), U;
3213
+ castShape(A, I, C, g, Q, B, D, w, o, h, G, s, a, M, y) {
3214
+ let J = N.intoRaw(g), S = z.intoRaw(Q), F = N.intoRaw(B), U = D.intoRaw(), R = EI.fromRaw(C, this.raw.castShape(A.raw, I.raw, C.raw, J, S, F, U, w, o, h, G, s, a, M, y));
3215
+ return J.free(), S.free(), F.free(), U.free(), R;
3216
3216
  }
3217
- intersectionsWithShape(A, I, C, g, Q, B, D, o, w, h, G, K) {
3218
- let a = S.intoRaw(g), M = P.intoRaw(Q), y = B.intoRaw();
3219
- this.raw.intersectionsWithShape(A.raw, I.raw, C.raw, a, M, y, D, o, w, h, G, K), a.free(), M.free(), y.free();
3217
+ intersectionsWithShape(A, I, C, g, Q, B, D, w, o, h, G, s) {
3218
+ let a = N.intoRaw(g), M = z.intoRaw(Q), y = B.intoRaw();
3219
+ this.raw.intersectionsWithShape(A.raw, I.raw, C.raw, a, M, y, D, w, o, h, G, s), a.free(), M.free(), y.free();
3220
3220
  }
3221
3221
  collidersWithAabbIntersectingAabb(A, I, C, g, Q, B) {
3222
- let D = S.intoRaw(g), o = S.intoRaw(Q);
3223
- this.raw.collidersWithAabbIntersectingAabb(A.raw, I.raw, C.raw, D, o, B), D.free(), o.free();
3222
+ let D = N.intoRaw(g), w = N.intoRaw(Q);
3223
+ this.raw.collidersWithAabbIntersectingAabb(A.raw, I.raw, C.raw, D, w, B), D.free(), w.free();
3224
3224
  }
3225
3225
  }
3226
3226
  class iC {
3227
3227
  constructor(A) {
3228
- this.raw = A || new wA(), this.tempManifold = new DC(null);
3228
+ this.raw = A || new oA(), this.tempManifold = new DC(null);
3229
3229
  }
3230
3230
  free() {
3231
3231
  this.raw && this.raw.free(), this.raw = void 0;
@@ -3257,13 +3257,13 @@ class DC {
3257
3257
  this.raw && this.raw.free(), this.raw = void 0;
3258
3258
  }
3259
3259
  normal() {
3260
- return S.fromRaw(this.raw.normal());
3260
+ return N.fromRaw(this.raw.normal());
3261
3261
  }
3262
3262
  localNormal1() {
3263
- return S.fromRaw(this.raw.local_n1());
3263
+ return N.fromRaw(this.raw.local_n1());
3264
3264
  }
3265
3265
  localNormal2() {
3266
- return S.fromRaw(this.raw.local_n2());
3266
+ return N.fromRaw(this.raw.local_n2());
3267
3267
  }
3268
3268
  subshape1() {
3269
3269
  return this.raw.subshape1();
@@ -3275,10 +3275,10 @@ class DC {
3275
3275
  return this.raw.num_contacts();
3276
3276
  }
3277
3277
  localContactPoint1(A) {
3278
- return S.fromRaw(this.raw.contact_local_p1(A));
3278
+ return N.fromRaw(this.raw.contact_local_p1(A));
3279
3279
  }
3280
3280
  localContactPoint2(A) {
3281
- return S.fromRaw(this.raw.contact_local_p2(A));
3281
+ return N.fromRaw(this.raw.contact_local_p2(A));
3282
3282
  }
3283
3283
  contactDist(A) {
3284
3284
  return this.raw.contact_dist(A);
@@ -3299,7 +3299,7 @@ class DC {
3299
3299
  return this.raw.num_solver_contacts();
3300
3300
  }
3301
3301
  solverContactPoint(A) {
3302
- return S.fromRaw(this.raw.solver_contact_point(A));
3302
+ return N.fromRaw(this.raw.solver_contact_point(A));
3303
3303
  }
3304
3304
  solverContactDist(A) {
3305
3305
  return this.raw.solver_contact_dist(A);
@@ -3311,7 +3311,7 @@ class DC {
3311
3311
  return this.raw.solver_contact_restitution(A);
3312
3312
  }
3313
3313
  solverContactTangentVelocity(A) {
3314
- return S.fromRaw(this.raw.solver_contact_tangent_velocity(A));
3314
+ return N.fromRaw(this.raw.solver_contact_tangent_velocity(A));
3315
3315
  }
3316
3316
  }
3317
3317
  class XA {
@@ -3320,14 +3320,14 @@ class XA {
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 XA(A.distance(), N.fromRaw(A.point1()), N.fromRaw(A.point2()), N.fromRaw(A.normal1()), N.fromRaw(A.normal2()));
3324
3324
  return A.free(), I;
3325
3325
  }
3326
3326
  }
3327
- class SA {
3327
+ class aA {
3328
3328
  static fromRaw(A, I) {
3329
3329
  const C = A.coShapeType(I);
3330
- let g, Q, B, D, o, w, h;
3330
+ let g, Q, B, D, w, o, h;
3331
3331
  switch (C) {
3332
3332
  case NA.Ball:
3333
3333
  return new Ig(A.coRadius(I));
@@ -3336,27 +3336,27 @@ class SA {
3336
3336
  case NA.RoundCuboid:
3337
3337
  return g = A.coHalfExtents(I), Q = A.coRoundRadius(I), new Qg(g.x, g.y, Q);
3338
3338
  case NA.Capsule:
3339
- return o = A.coHalfHeight(I), w = A.coRadius(I), new Bg(o, w);
3339
+ return w = A.coHalfHeight(I), o = A.coRadius(I), new Bg(w, o);
3340
3340
  case NA.Segment:
3341
- return B = A.coVertices(I), new Eg(S.new(B[0], B[1]), S.new(B[2], B[3]));
3341
+ return B = A.coVertices(I), new Eg(N.new(B[0], B[1]), N.new(B[2], B[3]));
3342
3342
  case NA.Polyline:
3343
3343
  return B = A.coVertices(I), D = A.coIndices(I), new og(B, D);
3344
3344
  case NA.Triangle:
3345
- return B = A.coVertices(I), new ig(S.new(B[0], B[1]), S.new(B[2], B[3]), S.new(B[4], B[5]));
3345
+ return B = A.coVertices(I), new ig(N.new(B[0], B[1]), N.new(B[2], B[3]), N.new(B[4], B[5]));
3346
3346
  case NA.RoundTriangle:
3347
- return B = A.coVertices(I), Q = A.coRoundRadius(I), new Dg(S.new(B[0], B[1]), S.new(B[2], B[3]), S.new(B[4], B[5]), Q);
3347
+ return B = A.coVertices(I), Q = A.coRoundRadius(I), new Dg(N.new(B[0], B[1]), N.new(B[2], B[3]), N.new(B[4], B[5]), Q);
3348
3348
  case NA.HalfSpace:
3349
- return h = S.fromRaw(A.coHalfspaceNormal(I)), new gg(h);
3349
+ return h = N.fromRaw(A.coHalfspaceNormal(I)), new gg(h);
3350
3350
  case NA.Voxels:
3351
- const G = A.coVoxelData(I), K = A.coVoxelSize(I);
3352
- return new wg(G, K);
3351
+ const G = A.coVoxelData(I), s = A.coVoxelSize(I);
3352
+ return new wg(G, s);
3353
3353
  case NA.TriMesh:
3354
3354
  B = A.coVertices(I), D = A.coIndices(I);
3355
3355
  const a = A.coTriMeshFlags(I);
3356
- return new Gg(B, D, a);
3356
+ return new hg(B, D, a);
3357
3357
  case NA.HeightField:
3358
3358
  const M = A.coHeightfieldScale(I), y = A.coHeightfieldHeights(I);
3359
- return new hg(y, M);
3359
+ return new Gg(y, M);
3360
3360
  case NA.ConvexPolygon:
3361
3361
  return B = A.coVertices(I), new aI(B, !1);
3362
3362
  case NA.RoundConvexPolygon:
@@ -3365,159 +3365,159 @@ class SA {
3365
3365
  throw new Error("unknown shape type: " + C);
3366
3366
  }
3367
3367
  }
3368
- castShape(A, I, C, g, Q, B, D, o, w, h) {
3369
- let G = S.intoRaw(A), K = P.intoRaw(I), a = S.intoRaw(C), M = S.intoRaw(Q), y = P.intoRaw(B), J = S.intoRaw(D), k = this.intoRaw(), F = g.intoRaw(), R = vA.fromRaw(null, k.castShape(G, K, a, F, M, y, J, o, w, h));
3370
- return G.free(), K.free(), a.free(), M.free(), y.free(), J.free(), k.free(), F.free(), R;
3368
+ castShape(A, I, C, g, Q, B, D, w, o, h) {
3369
+ let G = N.intoRaw(A), s = z.intoRaw(I), a = N.intoRaw(C), M = N.intoRaw(Q), y = z.intoRaw(B), J = N.intoRaw(D), S = this.intoRaw(), F = g.intoRaw(), U = vA.fromRaw(null, S.castShape(G, s, a, F, M, y, J, w, o, h));
3370
+ return G.free(), s.free(), a.free(), M.free(), y.free(), J.free(), S.free(), F.free(), U;
3371
3371
  }
3372
3372
  intersectsShape(A, I, C, g, Q) {
3373
- let B = S.intoRaw(A), D = P.intoRaw(I), o = S.intoRaw(g), w = P.intoRaw(Q), h = this.intoRaw(), G = C.intoRaw(), K = h.intersectsShape(B, D, G, o, w);
3374
- return B.free(), D.free(), o.free(), w.free(), h.free(), G.free(), K;
3373
+ let B = N.intoRaw(A), D = z.intoRaw(I), w = N.intoRaw(g), o = z.intoRaw(Q), h = this.intoRaw(), G = C.intoRaw(), s = h.intersectsShape(B, D, G, w, o);
3374
+ return B.free(), D.free(), w.free(), o.free(), h.free(), G.free(), s;
3375
3375
  }
3376
3376
  contactShape(A, I, C, g, Q, B) {
3377
- let D = S.intoRaw(A), o = P.intoRaw(I), w = S.intoRaw(g), h = P.intoRaw(Q), G = this.intoRaw(), K = C.intoRaw(), a = XA.fromRaw(G.contactShape(D, o, K, w, h, B));
3378
- return D.free(), o.free(), w.free(), h.free(), G.free(), K.free(), a;
3377
+ let D = N.intoRaw(A), w = z.intoRaw(I), o = N.intoRaw(g), h = z.intoRaw(Q), G = this.intoRaw(), s = C.intoRaw(), a = XA.fromRaw(G.contactShape(D, w, s, o, h, B));
3378
+ return D.free(), w.free(), o.free(), h.free(), G.free(), s.free(), a;
3379
3379
  }
3380
3380
  containsPoint(A, I, C) {
3381
- let g = S.intoRaw(A), Q = P.intoRaw(I), B = S.intoRaw(C), D = this.intoRaw(), o = D.containsPoint(g, Q, B);
3382
- return g.free(), Q.free(), B.free(), D.free(), o;
3381
+ let g = N.intoRaw(A), Q = z.intoRaw(I), B = N.intoRaw(C), D = this.intoRaw(), w = D.containsPoint(g, Q, B);
3382
+ return g.free(), Q.free(), B.free(), D.free(), w;
3383
3383
  }
3384
3384
  projectPoint(A, I, C, g) {
3385
- let Q = S.intoRaw(A), B = P.intoRaw(I), D = S.intoRaw(C), o = this.intoRaw(), w = BI.fromRaw(o.projectPoint(Q, B, D, g));
3386
- return Q.free(), B.free(), D.free(), o.free(), w;
3385
+ let Q = N.intoRaw(A), B = z.intoRaw(I), D = N.intoRaw(C), w = this.intoRaw(), o = BI.fromRaw(w.projectPoint(Q, B, D, g));
3386
+ return Q.free(), B.free(), D.free(), w.free(), o;
3387
3387
  }
3388
3388
  intersectsRay(A, I, C, g) {
3389
- let Q = S.intoRaw(I), B = P.intoRaw(C), D = S.intoRaw(A.origin), o = S.intoRaw(A.dir), w = this.intoRaw(), h = w.intersectsRay(Q, B, D, o, g);
3390
- return Q.free(), B.free(), D.free(), o.free(), w.free(), h;
3389
+ let Q = N.intoRaw(I), B = z.intoRaw(C), D = N.intoRaw(A.origin), w = N.intoRaw(A.dir), o = this.intoRaw(), h = o.intersectsRay(Q, B, D, w, g);
3390
+ return Q.free(), B.free(), D.free(), w.free(), o.free(), h;
3391
3391
  }
3392
3392
  castRay(A, I, C, g, Q) {
3393
- let B = S.intoRaw(I), D = P.intoRaw(C), o = S.intoRaw(A.origin), w = S.intoRaw(A.dir), h = this.intoRaw(), G = h.castRay(B, D, o, w, g, Q);
3394
- return B.free(), D.free(), o.free(), w.free(), h.free(), G;
3393
+ let B = N.intoRaw(I), D = z.intoRaw(C), w = N.intoRaw(A.origin), o = N.intoRaw(A.dir), h = this.intoRaw(), G = h.castRay(B, D, w, o, g, Q);
3394
+ return B.free(), D.free(), w.free(), o.free(), h.free(), G;
3395
3395
  }
3396
3396
  castRayAndGetNormal(A, I, C, g, Q) {
3397
- let B = S.intoRaw(I), D = P.intoRaw(C), o = S.intoRaw(A.origin), w = S.intoRaw(A.dir), h = this.intoRaw(), G = QI.fromRaw(h.castRayAndGetNormal(B, D, o, w, g, Q));
3398
- return B.free(), D.free(), o.free(), w.free(), h.free(), G;
3397
+ let B = N.intoRaw(I), D = z.intoRaw(C), w = N.intoRaw(A.origin), o = N.intoRaw(A.dir), h = this.intoRaw(), G = QI.fromRaw(h.castRayAndGetNormal(B, D, w, o, g, Q));
3398
+ return B.free(), D.free(), w.free(), o.free(), h.free(), G;
3399
3399
  }
3400
3400
  }
3401
3401
  (function(i) {
3402
3402
  i[i.Ball = 0] = "Ball", i[i.Cuboid = 1] = "Cuboid", i[i.Capsule = 2] = "Capsule", i[i.Segment = 3] = "Segment", i[i.Polyline = 4] = "Polyline", i[i.Triangle = 5] = "Triangle", i[i.TriMesh = 6] = "TriMesh", i[i.HeightField = 7] = "HeightField", i[i.ConvexPolygon = 9] = "ConvexPolygon", i[i.RoundCuboid = 10] = "RoundCuboid", i[i.RoundTriangle = 11] = "RoundTriangle", i[i.RoundConvexPolygon = 12] = "RoundConvexPolygon", i[i.HalfSpace = 13] = "HalfSpace", i[i.Voxels = 14] = "Voxels";
3403
- })(aA || (aA = {})), function(i) {
3403
+ })(KA || (KA = {})), function(i) {
3404
3404
  i[i.DELETE_BAD_TOPOLOGY_TRIANGLES = 4] = "DELETE_BAD_TOPOLOGY_TRIANGLES", i[i.ORIENTED = 8] = "ORIENTED", i[i.MERGE_DUPLICATE_VERTICES = 16] = "MERGE_DUPLICATE_VERTICES", i[i.DELETE_DEGENERATE_TRIANGLES = 32] = "DELETE_DEGENERATE_TRIANGLES", i[i.DELETE_DUPLICATE_TRIANGLES = 64] = "DELETE_DUPLICATE_TRIANGLES", i[i.FIX_INTERNAL_EDGES = 144] = "FIX_INTERNAL_EDGES";
3405
- }(WI || (WI = {}));
3406
- class Ig extends SA {
3405
+ }(OI || (OI = {}));
3406
+ class Ig extends aA {
3407
3407
  constructor(A) {
3408
- super(), this.type = aA.Ball, this.radius = A;
3408
+ super(), this.type = KA.Ball, this.radius = A;
3409
3409
  }
3410
3410
  intoRaw() {
3411
- return n.ball(this.radius);
3411
+ return d.ball(this.radius);
3412
3412
  }
3413
3413
  }
3414
- class gg extends SA {
3414
+ class gg extends aA {
3415
3415
  constructor(A) {
3416
- super(), this.type = aA.HalfSpace, this.normal = A;
3416
+ super(), this.type = KA.HalfSpace, this.normal = A;
3417
3417
  }
3418
3418
  intoRaw() {
3419
- let A = S.intoRaw(this.normal), I = n.halfspace(A);
3419
+ let A = N.intoRaw(this.normal), I = d.halfspace(A);
3420
3420
  return A.free(), I;
3421
3421
  }
3422
3422
  }
3423
- class Cg extends SA {
3423
+ class Cg extends aA {
3424
3424
  constructor(A, I) {
3425
- super(), this.type = aA.Cuboid, this.halfExtents = S.new(A, I);
3425
+ super(), this.type = KA.Cuboid, this.halfExtents = N.new(A, I);
3426
3426
  }
3427
3427
  intoRaw() {
3428
- return n.cuboid(this.halfExtents.x, this.halfExtents.y);
3428
+ return d.cuboid(this.halfExtents.x, this.halfExtents.y);
3429
3429
  }
3430
3430
  }
3431
- class Qg extends SA {
3431
+ class Qg extends aA {
3432
3432
  constructor(A, I, C) {
3433
- super(), this.type = aA.RoundCuboid, this.halfExtents = S.new(A, I), this.borderRadius = C;
3433
+ super(), this.type = KA.RoundCuboid, this.halfExtents = N.new(A, I), this.borderRadius = C;
3434
3434
  }
3435
3435
  intoRaw() {
3436
- return n.roundCuboid(this.halfExtents.x, this.halfExtents.y, this.borderRadius);
3436
+ return d.roundCuboid(this.halfExtents.x, this.halfExtents.y, this.borderRadius);
3437
3437
  }
3438
3438
  }
3439
- class Bg extends SA {
3439
+ class Bg extends aA {
3440
3440
  constructor(A, I) {
3441
- super(), this.type = aA.Capsule, this.halfHeight = A, this.radius = I;
3441
+ super(), this.type = KA.Capsule, this.halfHeight = A, this.radius = I;
3442
3442
  }
3443
3443
  intoRaw() {
3444
- return n.capsule(this.halfHeight, this.radius);
3444
+ return d.capsule(this.halfHeight, this.radius);
3445
3445
  }
3446
3446
  }
3447
- class Eg extends SA {
3447
+ class Eg extends aA {
3448
3448
  constructor(A, I) {
3449
- super(), this.type = aA.Segment, this.a = A, this.b = I;
3449
+ super(), this.type = KA.Segment, this.a = A, this.b = I;
3450
3450
  }
3451
3451
  intoRaw() {
3452
- let A = S.intoRaw(this.a), I = S.intoRaw(this.b), C = n.segment(A, I);
3452
+ let A = N.intoRaw(this.a), I = N.intoRaw(this.b), C = d.segment(A, I);
3453
3453
  return A.free(), I.free(), C;
3454
3454
  }
3455
3455
  }
3456
- class ig extends SA {
3456
+ class ig extends aA {
3457
3457
  constructor(A, I, C) {
3458
- super(), this.type = aA.Triangle, this.a = A, this.b = I, this.c = C;
3458
+ super(), this.type = KA.Triangle, this.a = A, this.b = I, this.c = C;
3459
3459
  }
3460
3460
  intoRaw() {
3461
- let A = S.intoRaw(this.a), I = S.intoRaw(this.b), C = S.intoRaw(this.c), g = n.triangle(A, I, C);
3461
+ let A = N.intoRaw(this.a), I = N.intoRaw(this.b), C = N.intoRaw(this.c), g = d.triangle(A, I, C);
3462
3462
  return A.free(), I.free(), C.free(), g;
3463
3463
  }
3464
3464
  }
3465
- class Dg extends SA {
3465
+ class Dg extends aA {
3466
3466
  constructor(A, I, C, g) {
3467
- super(), this.type = aA.RoundTriangle, this.a = A, this.b = I, this.c = C, this.borderRadius = g;
3467
+ super(), this.type = KA.RoundTriangle, this.a = A, this.b = I, this.c = C, this.borderRadius = g;
3468
3468
  }
3469
3469
  intoRaw() {
3470
- let A = S.intoRaw(this.a), I = S.intoRaw(this.b), C = S.intoRaw(this.c), g = n.roundTriangle(A, I, C, this.borderRadius);
3470
+ let A = N.intoRaw(this.a), I = N.intoRaw(this.b), C = N.intoRaw(this.c), g = d.roundTriangle(A, I, C, this.borderRadius);
3471
3471
  return A.free(), I.free(), C.free(), g;
3472
3472
  }
3473
3473
  }
3474
- class og extends SA {
3474
+ class og extends aA {
3475
3475
  constructor(A, I) {
3476
- super(), this.type = aA.Polyline, this.vertices = A, this.indices = I ?? new Uint32Array(0);
3476
+ super(), this.type = KA.Polyline, this.vertices = A, this.indices = I ?? new Uint32Array(0);
3477
3477
  }
3478
3478
  intoRaw() {
3479
- return n.polyline(this.vertices, this.indices);
3479
+ return d.polyline(this.vertices, this.indices);
3480
3480
  }
3481
3481
  }
3482
- class wg extends SA {
3482
+ class wg extends aA {
3483
3483
  constructor(A, I) {
3484
- super(), this.type = aA.Voxels, this.data = A, this.voxelSize = I;
3484
+ super(), this.type = KA.Voxels, this.data = A, this.voxelSize = I;
3485
3485
  }
3486
3486
  intoRaw() {
3487
- let A, I = S.intoRaw(this.voxelSize);
3488
- return A = this.data instanceof Int32Array ? n.voxels(I, this.data) : n.voxelsFromPoints(I, this.data), I.free(), A;
3487
+ let A, I = N.intoRaw(this.voxelSize);
3488
+ return A = this.data instanceof Int32Array ? d.voxels(I, this.data) : d.voxelsFromPoints(I, this.data), I.free(), A;
3489
3489
  }
3490
3490
  }
3491
- class Gg extends SA {
3491
+ class hg extends aA {
3492
3492
  constructor(A, I, C) {
3493
- super(), this.type = aA.TriMesh, this.vertices = A, this.indices = I, this.flags = C;
3493
+ super(), this.type = KA.TriMesh, this.vertices = A, this.indices = I, this.flags = C;
3494
3494
  }
3495
3495
  intoRaw() {
3496
- return n.trimesh(this.vertices, this.indices, this.flags);
3496
+ return d.trimesh(this.vertices, this.indices, this.flags);
3497
3497
  }
3498
3498
  }
3499
- class aI extends SA {
3499
+ class aI extends aA {
3500
3500
  constructor(A, I) {
3501
- super(), this.type = aA.ConvexPolygon, this.vertices = A, this.skipConvexHullComputation = !!I;
3501
+ super(), this.type = KA.ConvexPolygon, this.vertices = A, this.skipConvexHullComputation = !!I;
3502
3502
  }
3503
3503
  intoRaw() {
3504
- return this.skipConvexHullComputation ? n.convexPolyline(this.vertices) : n.convexHull(this.vertices);
3504
+ return this.skipConvexHullComputation ? d.convexPolyline(this.vertices) : d.convexHull(this.vertices);
3505
3505
  }
3506
3506
  }
3507
- class SI extends SA {
3507
+ class SI extends aA {
3508
3508
  constructor(A, I, C) {
3509
- super(), this.type = aA.RoundConvexPolygon, this.vertices = A, this.borderRadius = I, this.skipConvexHullComputation = !!C;
3509
+ super(), this.type = KA.RoundConvexPolygon, this.vertices = A, this.borderRadius = I, this.skipConvexHullComputation = !!C;
3510
3510
  }
3511
3511
  intoRaw() {
3512
- return this.skipConvexHullComputation ? n.roundConvexPolyline(this.vertices, this.borderRadius) : n.roundConvexHull(this.vertices, this.borderRadius);
3512
+ return this.skipConvexHullComputation ? d.roundConvexPolyline(this.vertices, this.borderRadius) : d.roundConvexHull(this.vertices, this.borderRadius);
3513
3513
  }
3514
3514
  }
3515
- class hg extends SA {
3515
+ class Gg extends aA {
3516
3516
  constructor(A, I) {
3517
- super(), this.type = aA.HeightField, this.heights = A, this.scale = I;
3517
+ super(), this.type = KA.HeightField, this.heights = A, this.scale = I;
3518
3518
  }
3519
3519
  intoRaw() {
3520
- let A = S.intoRaw(this.scale), I = n.heightfield(this.heights, A);
3520
+ let A = N.intoRaw(this.scale), I = d.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, C, g, Q, B, D, o, w, h, G, K) {
3532
- let a = S.intoRaw(A);
3533
- G ? this.raw.stepWithEvents(a, I.raw, C.raw, g.raw, Q.raw, B.raw, D.raw, o.raw, w.raw, h.raw, G.raw, K, K ? K.filterContactPair : null, K ? K.filterIntersectionPair : null) : this.raw.step(a, I.raw, C.raw, g.raw, Q.raw, B.raw, D.raw, o.raw, w.raw, h.raw), a.free();
3531
+ step(A, I, C, g, Q, B, D, w, o, h, G, s) {
3532
+ let a = N.intoRaw(A);
3533
+ G ? this.raw.stepWithEvents(a, I.raw, C.raw, g.raw, Q.raw, B.raw, D.raw, w.raw, o.raw, h.raw, G.raw, s, s ? s.filterContactPair : null, s ? s.filterIntersectionPair : null) : this.raw.step(a, I.raw, C.raw, g.raw, Q.raw, B.raw, D.raw, w.raw, o.raw, h.raw), a.free();
3534
3534
  }
3535
3535
  }
3536
3536
  class XI {
@@ -3540,9 +3540,9 @@ class XI {
3540
3540
  free() {
3541
3541
  this.raw && this.raw.free(), this.raw = void 0;
3542
3542
  }
3543
- serializeAll(A, I, C, g, Q, B, D, o, w) {
3544
- let h = S.intoRaw(A);
3545
- const G = this.raw.serializeAll(h, I.raw, C.raw, g.raw, Q.raw, B.raw, D.raw, o.raw, w.raw);
3543
+ serializeAll(A, I, C, g, Q, B, D, w, o) {
3544
+ let h = N.intoRaw(A);
3545
+ const G = this.raw.serializeAll(h, I.raw, C.raw, g.raw, Q.raw, B.raw, D.raw, w.raw, o.raw);
3546
3546
  return h.free(), G;
3547
3547
  }
3548
3548
  deserializeAll(A) {
@@ -3554,7 +3554,7 @@ class wC {
3554
3554
  this.vertices = A, this.colors = I;
3555
3555
  }
3556
3556
  }
3557
- class GC {
3557
+ class hC {
3558
3558
  constructor(A) {
3559
3559
  this.raw = A || new cC();
3560
3560
  }
@@ -3565,11 +3565,11 @@ class GC {
3565
3565
  this.raw.render(A.raw, I.raw, C.raw, g.raw, Q.raw, B, I.castClosure(D)), this.vertices = this.raw.vertices(), this.colors = this.raw.colors();
3566
3566
  }
3567
3567
  }
3568
- class hC {
3568
+ class GC {
3569
3569
  }
3570
3570
  class sC {
3571
3571
  constructor(A, I, C, g, Q, B) {
3572
- this.params = I, this.bodies = Q, this.colliders = B, this.broadPhase = C, this.narrowPhase = g, this.raw = new tC(A), this.rawCharacterCollision = new Og(), this._applyImpulsesToDynamicBodies = !1, this._characterMass = null;
3572
+ this.params = I, this.bodies = Q, this.colliders = B, this.broadPhase = C, this.narrowPhase = g, this.raw = new tC(A), this.rawCharacterCollision = new Wg(), this._applyImpulsesToDynamicBodies = !1, this._characterMass = null;
3573
3573
  }
3574
3574
  free() {
3575
3575
  this.raw && (this.raw.free(), this.rawCharacterCollision.free()), this.raw = void 0, this.rawCharacterCollision = void 0;
@@ -3578,7 +3578,7 @@ class sC {
3578
3578
  return this.raw.up();
3579
3579
  }
3580
3580
  setUp(A) {
3581
- let I = S.intoRaw(A);
3581
+ let I = N.intoRaw(A);
3582
3582
  return this.raw.setUp(I);
3583
3583
  }
3584
3584
  applyImpulsesToDynamicBodies() {
@@ -3654,11 +3654,11 @@ class sC {
3654
3654
  return this.raw.snapToGroundEnabled();
3655
3655
  }
3656
3656
  computeColliderMovement(A, I, C, g, Q) {
3657
- let B = S.intoRaw(I);
3657
+ let B = N.intoRaw(I);
3658
3658
  this.raw.computeColliderMovement(this.params.dt, this.broadPhase.raw, this.narrowPhase.raw, this.bodies.raw, this.colliders.raw, A.handle, B, this._applyImpulsesToDynamicBodies, this._characterMass, C, g, this.colliders.castClosure(Q)), B.free();
3659
3659
  }
3660
3660
  computedMovement() {
3661
- return S.fromRaw(this.raw.computedMovement());
3661
+ return N.fromRaw(this.raw.computedMovement());
3662
3662
  }
3663
3663
  computedGrounded() {
3664
3664
  return this.raw.computedGrounded();
@@ -3669,14 +3669,14 @@ class sC {
3669
3669
  computedCollision(A, I) {
3670
3670
  if (this.raw.computedCollision(A, this.rawCharacterCollision)) {
3671
3671
  let C = this.rawCharacterCollision;
3672
- return (I = I ?? new hC()).translationDeltaApplied = S.fromRaw(C.translationDeltaApplied()), I.translationDeltaRemaining = S.fromRaw(C.translationDeltaRemaining()), I.toi = C.toi(), I.witness1 = S.fromRaw(C.worldWitness1()), I.witness2 = S.fromRaw(C.worldWitness2()), I.normal1 = S.fromRaw(C.worldNormal1()), I.normal2 = S.fromRaw(C.worldNormal2()), I.collider = this.colliders.get(C.handle()), I;
3672
+ return (I = I ?? new GC()).translationDeltaApplied = N.fromRaw(C.translationDeltaApplied()), I.translationDeltaRemaining = N.fromRaw(C.translationDeltaRemaining()), I.toi = C.toi(), I.witness1 = N.fromRaw(C.worldWitness1()), I.witness2 = N.fromRaw(C.worldWitness2()), I.normal1 = N.fromRaw(C.worldNormal1()), I.normal2 = N.fromRaw(C.worldNormal2()), I.collider = this.colliders.get(C.handle()), I;
3673
3673
  }
3674
3674
  return null;
3675
3675
  }
3676
3676
  }
3677
3677
  (function(i) {
3678
3678
  i[i.None = 0] = "None", i[i.LinX = 1] = "LinX", i[i.LinY = 2] = "LinY", i[i.LinZ = 4] = "LinZ", i[i.AngZ = 32] = "AngZ", i[i.AllLin = 3] = "AllLin", i[i.AllAng = 32] = "AllAng", i[i.All = 35] = "All";
3679
- })(OI || (OI = {}));
3679
+ })(WI || (WI = {}));
3680
3680
  class KC {
3681
3681
  constructor(A, I, C, g, Q, B) {
3682
3682
  this.params = A, this.bodies = I, this.raw = new eC(C, g, Q, B);
@@ -3700,29 +3700,29 @@ class KC {
3700
3700
  this.raw.reset_integrals();
3701
3701
  }
3702
3702
  applyLinearCorrection(A, I, C) {
3703
- let g = S.intoRaw(I), Q = S.intoRaw(C);
3703
+ let g = N.intoRaw(I), Q = N.intoRaw(C);
3704
3704
  this.raw.apply_linear_correction(this.params.dt, this.bodies.raw, A.handle, g, Q), g.free(), Q.free();
3705
3705
  }
3706
3706
  applyAngularCorrection(A, I, C) {
3707
3707
  this.raw.apply_angular_correction(this.params.dt, this.bodies.raw, A.handle, I, C);
3708
3708
  }
3709
3709
  linearCorrection(A, I, C) {
3710
- let g = S.intoRaw(I), Q = S.intoRaw(C), B = this.raw.linear_correction(this.params.dt, this.bodies.raw, A.handle, g, Q);
3711
- return g.free(), Q.free(), S.fromRaw(B);
3710
+ let g = N.intoRaw(I), Q = N.intoRaw(C), B = this.raw.linear_correction(this.params.dt, this.bodies.raw, A.handle, g, Q);
3711
+ return g.free(), Q.free(), N.fromRaw(B);
3712
3712
  }
3713
3713
  angularCorrection(A, I, C) {
3714
3714
  return this.raw.angular_correction(this.params.dt, this.bodies.raw, A.handle, I, C);
3715
3715
  }
3716
3716
  }
3717
3717
  class cI {
3718
- constructor(A, I, C, g, Q, B, D, o, w, h, G, K, a) {
3719
- this.gravity = A, this.integrationParameters = new vg(I), this.islands = new BC(C), this.broadPhase = new EC(g), this.narrowPhase = new iC(Q), this.bodies = new Xg(B), this.colliders = new SC(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(a), 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, C, g, Q, B, D, w, o, h, G, s, a) {
3719
+ this.gravity = A, this.integrationParameters = new vg(I), this.islands = new BC(C), this.broadPhase = new EC(g), this.narrowPhase = new iC(Q), this.bodies = new Xg(B), this.colliders = new SC(D), this.impulseJoints = new $g(w), this.multibodyJoints = new CC(o), this.ccdSolver = new QC(h), this.physicsPipeline = new oC(G), this.serializationPipeline = new XI(s), this.debugRenderPipeline = new hC(a), 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;
3723
3723
  }
3724
3724
  static fromRaw(A) {
3725
- return A ? new cI(S.fromRaw(A.takeGravity()), A.takeIntegrationParameters(), A.takeIslandManager(), A.takeBroadPhase(), A.takeNarrowPhase(), A.takeBodies(), A.takeColliders(), A.takeImpulseJoints(), A.takeMultibodyJoints()) : null;
3725
+ return A ? new cI(N.fromRaw(A.takeGravity()), A.takeIntegrationParameters(), A.takeIslandManager(), A.takeBroadPhase(), A.takeNarrowPhase(), A.takeBodies(), A.takeColliders(), A.takeImpulseJoints(), A.takeMultibodyJoints()) : null;
3726
3726
  }
3727
3727
  takeSnapshot() {
3728
3728
  return this.serializationPipeline.serializeAll(this.gravity, this.integrationParameters, this.islands, this.broadPhase, this.narrowPhase, this.bodies, this.colliders, this.impulseJoints, this.multibodyJoints);
@@ -3829,18 +3829,18 @@ class cI {
3829
3829
  forEachActiveRigidBody(A) {
3830
3830
  this.bodies.forEachActiveRigidBody(this.islands, A);
3831
3831
  }
3832
- castRay(A, I, C, g, Q, B, D, o) {
3833
- return this.broadPhase.castRay(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B ? B.handle : null, D ? D.handle : null, this.colliders.castClosure(o));
3832
+ castRay(A, I, C, g, Q, B, D, w) {
3833
+ return this.broadPhase.castRay(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B ? B.handle : null, D ? D.handle : null, this.colliders.castClosure(w));
3834
3834
  }
3835
- castRayAndGetNormal(A, I, C, g, Q, B, D, o) {
3836
- return this.broadPhase.castRayAndGetNormal(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B ? B.handle : null, D ? D.handle : null, this.colliders.castClosure(o));
3835
+ castRayAndGetNormal(A, I, C, g, Q, B, D, w) {
3836
+ return this.broadPhase.castRayAndGetNormal(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B ? B.handle : null, D ? D.handle : null, this.colliders.castClosure(w));
3837
3837
  }
3838
- intersectionsWithRay(A, I, C, g, Q, B, D, o, w) {
3839
- this.broadPhase.intersectionsWithRay(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B, D ? D.handle : null, o ? o.handle : null, this.colliders.castClosure(w));
3838
+ intersectionsWithRay(A, I, C, g, Q, B, D, w, o) {
3839
+ this.broadPhase.intersectionsWithRay(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B, D ? D.handle : null, w ? w.handle : null, this.colliders.castClosure(o));
3840
3840
  }
3841
- intersectionWithShape(A, I, C, g, Q, B, D, o) {
3842
- let w = this.broadPhase.intersectionWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B ? B.handle : null, D ? D.handle : null, this.colliders.castClosure(o));
3843
- return w != null ? this.colliders.get(w) : null;
3841
+ intersectionWithShape(A, I, C, g, Q, B, D, w) {
3842
+ let o = this.broadPhase.intersectionWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B ? B.handle : null, D ? D.handle : null, this.colliders.castClosure(w));
3843
+ return o != null ? this.colliders.get(o) : null;
3844
3844
  }
3845
3845
  projectPoint(A, I, C, g, Q, B, D) {
3846
3846
  return this.broadPhase.projectPoint(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q ? Q.handle : null, B ? B.handle : null, this.colliders.castClosure(D));
@@ -3851,11 +3851,11 @@ class cI {
3851
3851
  intersectionsWithPoint(A, I, C, g, Q, B, D) {
3852
3852
  this.broadPhase.intersectionsWithPoint(this.narrowPhase, this.bodies, this.colliders, A, this.colliders.castClosure(I), C, g, Q ? Q.handle : null, B ? B.handle : null, this.colliders.castClosure(D));
3853
3853
  }
3854
- castShape(A, I, C, g, Q, B, D, o, w, h, G, K) {
3855
- return this.broadPhase.castShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B, D, o, w, h ? h.handle : null, G ? G.handle : null, this.colliders.castClosure(K));
3854
+ castShape(A, I, C, g, Q, B, D, w, o, h, G, s) {
3855
+ return this.broadPhase.castShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B, D, w, o, h ? h.handle : null, G ? G.handle : null, this.colliders.castClosure(s));
3856
3856
  }
3857
- intersectionsWithShape(A, I, C, g, Q, B, D, o, w) {
3858
- this.broadPhase.intersectionsWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, this.colliders.castClosure(g), Q, B, D ? D.handle : null, o ? o.handle : null, this.colliders.castClosure(w));
3857
+ intersectionsWithShape(A, I, C, g, Q, B, D, w, o) {
3858
+ this.broadPhase.intersectionsWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, this.colliders.castClosure(g), Q, B, D ? D.handle : null, w ? w.handle : null, this.colliders.castClosure(o));
3859
3859
  }
3860
3860
  collidersWithAabbIntersectingAabb(A, I, C) {
3861
3861
  this.broadPhase.collidersWithAabbIntersectingAabb(this.narrowPhase, this.bodies, this.colliders, A, I, this.colliders.castClosure(C));
@@ -3929,7 +3929,7 @@ class cI {
3929
3929
  }
3930
3930
  (function(i) {
3931
3931
  i[i.NONE = 0] = "NONE", i[i.COLLISION_EVENTS = 1] = "COLLISION_EVENTS", i[i.CONTACT_FORCE_EVENTS = 2] = "CONTACT_FORCE_EVENTS";
3932
- })(hI || (hI = {}));
3932
+ })(GI || (GI = {}));
3933
3933
  class aC {
3934
3934
  free() {
3935
3935
  this.raw && this.raw.free(), this.raw = void 0;
@@ -3941,13 +3941,13 @@ class aC {
3941
3941
  return this.raw.collider2();
3942
3942
  }
3943
3943
  totalForce() {
3944
- return S.fromRaw(this.raw.total_force());
3944
+ return N.fromRaw(this.raw.total_force());
3945
3945
  }
3946
3946
  totalForceMagnitude() {
3947
3947
  return this.raw.total_force_magnitude();
3948
3948
  }
3949
3949
  maxForceDirection() {
3950
- return S.fromRaw(this.raw.max_force_direction());
3950
+ return N.fromRaw(this.raw.max_force_direction());
3951
3951
  }
3952
3952
  maxForceMagnitude() {
3953
3953
  return this.raw.max_force_magnitude();
@@ -3990,7 +3990,7 @@ class vI {
3990
3990
  this.handle != null && (this._parent = A.get(this.colliderSet.raw.coParent(this.handle)));
3991
3991
  }
3992
3992
  ensureShapeIsCached() {
3993
- this._shape || (this._shape = SA.fromRaw(this.colliderSet.raw, this.handle));
3993
+ this._shape || (this._shape = aA.fromRaw(this.colliderSet.raw, this.handle));
3994
3994
  }
3995
3995
  get shape() {
3996
3996
  return this.ensureShapeIsCached(), this._shape;
@@ -4002,16 +4002,16 @@ class vI {
4002
4002
  return this.colliderSet.raw.contains(this.handle);
4003
4003
  }
4004
4004
  translation() {
4005
- return S.fromRaw(this.colliderSet.raw.coTranslation(this.handle));
4005
+ return N.fromRaw(this.colliderSet.raw.coTranslation(this.handle));
4006
4006
  }
4007
4007
  translationWrtParent() {
4008
- return S.fromRaw(this.colliderSet.raw.coTranslationWrtParent(this.handle));
4008
+ return N.fromRaw(this.colliderSet.raw.coTranslationWrtParent(this.handle));
4009
4009
  }
4010
4010
  rotation() {
4011
- return P.fromRaw(this.colliderSet.raw.coRotation(this.handle));
4011
+ return z.fromRaw(this.colliderSet.raw.coRotation(this.handle));
4012
4012
  }
4013
4013
  rotationWrtParent() {
4014
- return P.fromRaw(this.colliderSet.raw.coRotationWrtParent(this.handle));
4014
+ return z.fromRaw(this.colliderSet.raw.coRotationWrtParent(this.handle));
4015
4015
  }
4016
4016
  isSensor() {
4017
4017
  return this.colliderSet.raw.coIsSensor(this.handle);
@@ -4090,7 +4090,7 @@ class vI {
4090
4090
  this.colliderSet.raw.coSetMass(this.handle, A);
4091
4091
  }
4092
4092
  setMassProperties(A, I, C) {
4093
- let g = S.intoRaw(I);
4093
+ let g = N.intoRaw(I);
4094
4094
  this.colliderSet.raw.coSetMassProperties(this.handle, A, g, C), g.free();
4095
4095
  }
4096
4096
  setTranslation(A) {
@@ -4109,10 +4109,10 @@ class vI {
4109
4109
  return this.colliderSet.raw.coShapeType(this.handle);
4110
4110
  }
4111
4111
  halfExtents() {
4112
- return S.fromRaw(this.colliderSet.raw.coHalfExtents(this.handle));
4112
+ return N.fromRaw(this.colliderSet.raw.coHalfExtents(this.handle));
4113
4113
  }
4114
4114
  setHalfExtents(A) {
4115
- const I = S.intoRaw(A);
4115
+ const I = N.intoRaw(A);
4116
4116
  this.colliderSet.raw.coSetHalfExtents(this.handle, I);
4117
4117
  }
4118
4118
  radius() {
@@ -4153,7 +4153,7 @@ class vI {
4153
4153
  }
4154
4154
  heightfieldScale() {
4155
4155
  let A = this.colliderSet.raw.coHeightfieldScale(this.handle);
4156
- return S.fromRaw(A);
4156
+ return N.fromRaw(A);
4157
4157
  }
4158
4158
  parent() {
4159
4159
  return this._parent;
@@ -4180,51 +4180,51 @@ class vI {
4180
4180
  return this.colliderSet.raw.coSolverGroups(this.handle);
4181
4181
  }
4182
4182
  containsPoint(A) {
4183
- let I = S.intoRaw(A), C = this.colliderSet.raw.coContainsPoint(this.handle, I);
4183
+ let I = N.intoRaw(A), C = this.colliderSet.raw.coContainsPoint(this.handle, I);
4184
4184
  return I.free(), C;
4185
4185
  }
4186
4186
  projectPoint(A, I) {
4187
- let C = S.intoRaw(A), g = BI.fromRaw(this.colliderSet.raw.coProjectPoint(this.handle, C, I));
4187
+ let C = N.intoRaw(A), g = BI.fromRaw(this.colliderSet.raw.coProjectPoint(this.handle, C, I));
4188
4188
  return C.free(), g;
4189
4189
  }
4190
4190
  intersectsRay(A, I) {
4191
- let C = S.intoRaw(A.origin), g = S.intoRaw(A.dir), Q = this.colliderSet.raw.coIntersectsRay(this.handle, C, g, I);
4191
+ let C = N.intoRaw(A.origin), g = N.intoRaw(A.dir), Q = this.colliderSet.raw.coIntersectsRay(this.handle, C, g, I);
4192
4192
  return C.free(), g.free(), Q;
4193
4193
  }
4194
- castShape(A, I, C, g, Q, B, D, o) {
4195
- let w = S.intoRaw(A), h = S.intoRaw(C), G = P.intoRaw(g), K = S.intoRaw(Q), a = I.intoRaw(), M = vA.fromRaw(this.colliderSet, this.colliderSet.raw.coCastShape(this.handle, w, a, h, G, K, B, D, o));
4196
- return w.free(), h.free(), G.free(), K.free(), a.free(), M;
4194
+ castShape(A, I, C, g, Q, B, D, w) {
4195
+ let o = N.intoRaw(A), h = N.intoRaw(C), G = z.intoRaw(g), s = N.intoRaw(Q), a = I.intoRaw(), M = vA.fromRaw(this.colliderSet, this.colliderSet.raw.coCastShape(this.handle, o, a, h, G, s, B, D, w));
4196
+ return o.free(), h.free(), G.free(), s.free(), a.free(), M;
4197
4197
  }
4198
4198
  castCollider(A, I, C, g, Q, B) {
4199
- let D = S.intoRaw(A), o = S.intoRaw(C), w = EI.fromRaw(this.colliderSet, this.colliderSet.raw.coCastCollider(this.handle, D, I.handle, o, g, Q, B));
4200
- return D.free(), o.free(), w;
4199
+ let D = N.intoRaw(A), w = N.intoRaw(C), o = EI.fromRaw(this.colliderSet, this.colliderSet.raw.coCastCollider(this.handle, D, I.handle, w, g, Q, B));
4200
+ return D.free(), w.free(), o;
4201
4201
  }
4202
4202
  intersectsShape(A, I, C) {
4203
- let g = S.intoRaw(I), Q = P.intoRaw(C), B = A.intoRaw(), D = this.colliderSet.raw.coIntersectsShape(this.handle, B, g, Q);
4203
+ let g = N.intoRaw(I), Q = z.intoRaw(C), B = A.intoRaw(), D = this.colliderSet.raw.coIntersectsShape(this.handle, B, g, Q);
4204
4204
  return g.free(), Q.free(), B.free(), D;
4205
4205
  }
4206
4206
  contactShape(A, I, C, g) {
4207
- let Q = S.intoRaw(I), B = P.intoRaw(C), D = A.intoRaw(), o = XA.fromRaw(this.colliderSet.raw.coContactShape(this.handle, D, Q, B, g));
4208
- return Q.free(), B.free(), D.free(), o;
4207
+ let Q = N.intoRaw(I), B = z.intoRaw(C), D = A.intoRaw(), w = XA.fromRaw(this.colliderSet.raw.coContactShape(this.handle, D, Q, B, g));
4208
+ return Q.free(), B.free(), D.free(), w;
4209
4209
  }
4210
4210
  contactCollider(A, I) {
4211
4211
  return XA.fromRaw(this.colliderSet.raw.coContactCollider(this.handle, A.handle, I));
4212
4212
  }
4213
4213
  castRay(A, I, C) {
4214
- let g = S.intoRaw(A.origin), Q = S.intoRaw(A.dir), B = this.colliderSet.raw.coCastRay(this.handle, g, Q, I, C);
4214
+ let g = N.intoRaw(A.origin), Q = N.intoRaw(A.dir), B = this.colliderSet.raw.coCastRay(this.handle, g, Q, I, C);
4215
4215
  return g.free(), Q.free(), B;
4216
4216
  }
4217
4217
  castRayAndGetNormal(A, I, C) {
4218
- let g = S.intoRaw(A.origin), Q = S.intoRaw(A.dir), B = QI.fromRaw(this.colliderSet.raw.coCastRayAndGetNormal(this.handle, g, Q, I, C));
4218
+ let g = N.intoRaw(A.origin), Q = N.intoRaw(A.dir), B = QI.fromRaw(this.colliderSet.raw.coCastRayAndGetNormal(this.handle, g, Q, I, C));
4219
4219
  return g.free(), Q.free(), B;
4220
4220
  }
4221
4221
  }
4222
4222
  (function(i) {
4223
4223
  i[i.Density = 0] = "Density", i[i.Mass = 1] = "Mass", i[i.MassProps = 2] = "MassProps";
4224
- })(TA || (TA = {}));
4224
+ })(ZA || (ZA = {}));
4225
4225
  class hA {
4226
4226
  constructor(A) {
4227
- this.enabled = !0, this.shape = A, this.massPropsMode = TA.Density, this.density = 1, this.friction = 0.5, this.restitution = 0, this.rotation = P.identity(), this.translation = S.zeros(), this.isSensor = !1, this.collisionGroups = 4294967295, this.solverGroups = 4294967295, this.frictionCombineRule = II.Average, this.restitutionCombineRule = II.Average, this.activeCollisionTypes = KI.DEFAULT, this.activeEvents = hI.NONE, this.activeHooks = sI.NONE, this.mass = 0, this.centerOfMass = S.zeros(), this.contactForceEventThreshold = 0, this.contactSkin = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0;
4227
+ this.enabled = !0, this.shape = A, this.massPropsMode = ZA.Density, this.density = 1, this.friction = 0.5, this.restitution = 0, this.rotation = z.identity(), this.translation = N.zeros(), this.isSensor = !1, this.collisionGroups = 4294967295, this.solverGroups = 4294967295, this.frictionCombineRule = II.Average, this.restitutionCombineRule = II.Average, this.activeCollisionTypes = KI.DEFAULT, this.activeEvents = GI.NONE, this.activeHooks = sI.NONE, this.mass = 0, this.centerOfMass = N.zeros(), this.contactForceEventThreshold = 0, this.contactSkin = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0;
4228
4228
  }
4229
4229
  static ball(A) {
4230
4230
  const I = new Ig(A);
@@ -4255,7 +4255,7 @@ class hA {
4255
4255
  return new hA(C);
4256
4256
  }
4257
4257
  static trimesh(A, I, C) {
4258
- const g = new Gg(A, I, C);
4258
+ const g = new hg(A, I, C);
4259
4259
  return new hA(g);
4260
4260
  }
4261
4261
  static cuboid(A, I) {
@@ -4271,7 +4271,7 @@ class hA {
4271
4271
  return new hA(I);
4272
4272
  }
4273
4273
  static heightfield(A, I) {
4274
- const C = new hg(A, I);
4274
+ const C = new Gg(A, I);
4275
4275
  return new hA(C);
4276
4276
  }
4277
4277
  static convexHull(A) {
@@ -4307,13 +4307,13 @@ class hA {
4307
4307
  return this.contactSkin = A, this;
4308
4308
  }
4309
4309
  setDensity(A) {
4310
- return this.massPropsMode = TA.Density, this.density = A, this;
4310
+ return this.massPropsMode = ZA.Density, this.density = A, this;
4311
4311
  }
4312
4312
  setMass(A) {
4313
- return this.massPropsMode = TA.Mass, this.mass = A, this;
4313
+ return this.massPropsMode = ZA.Mass, this.mass = A, this;
4314
4314
  }
4315
4315
  setMassProperties(A, I, C) {
4316
- return this.massPropsMode = TA.MassProps, this.mass = A, S.copy(this.centerOfMass, I), this.principalAngularInertia = C, this;
4316
+ return this.massPropsMode = ZA.MassProps, this.mass = A, N.copy(this.centerOfMass, I), this.principalAngularInertia = C, this;
4317
4317
  }
4318
4318
  setRestitution(A) {
4319
4319
  return this.restitution = A, this;
@@ -4348,7 +4348,7 @@ class hA {
4348
4348
  }
4349
4349
  class SC {
4350
4350
  constructor(A) {
4351
- this.raw = A || new QA(), this.map = new UI(), A && A.forEachColliderHandle((I) => {
4351
+ this.raw = A || new EA(), this.map = new UI(), A && A.forEachColliderHandle((I) => {
4352
4352
  this.map.set(I, new vI(this, I, null));
4353
4353
  });
4354
4354
  }
@@ -4364,10 +4364,10 @@ class SC {
4364
4364
  createCollider(A, I, C) {
4365
4365
  let g = C != null && C != null;
4366
4366
  if (g && isNaN(C)) throw Error("Cannot create a collider with a parent rigid-body handle that is not a number.");
4367
- let Q = I.shape.intoRaw(), B = S.intoRaw(I.translation), D = P.intoRaw(I.rotation), o = S.intoRaw(I.centerOfMass), w = this.raw.createCollider(I.enabled, Q, B, 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, g, g ? C : 0, A.raw);
4368
- Q.free(), B.free(), D.free(), o.free();
4369
- let h = g ? A.get(C) : null, G = new vI(this, w, h, I.shape);
4370
- return this.map.set(w, G), G;
4367
+ let Q = I.shape.intoRaw(), B = N.intoRaw(I.translation), D = z.intoRaw(I.rotation), w = N.intoRaw(I.centerOfMass), o = this.raw.createCollider(I.enabled, Q, B, D, I.massPropsMode, I.mass, w, 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, g, g ? C : 0, A.raw);
4368
+ Q.free(), B.free(), D.free(), w.free();
4369
+ let h = g ? A.get(C) : null, G = new vI(this, o, h, I.shape);
4370
+ return this.map.set(o, G), G;
4371
4371
  }
4372
4372
  remove(A, I, C, g) {
4373
4373
  this.raw.remove(A, I.raw, C.raw, g), this.unmap(A);
@@ -4393,37 +4393,37 @@ class SC {
4393
4393
  }
4394
4394
  function lC(i, A, I, C) {
4395
4395
  return new (I || (I = Promise))(function(g, Q) {
4396
- function B(w) {
4396
+ function B(o) {
4397
4397
  try {
4398
- o(C.next(w));
4398
+ w(C.next(o));
4399
4399
  } catch (h) {
4400
4400
  Q(h);
4401
4401
  }
4402
4402
  }
4403
- function D(w) {
4403
+ function D(o) {
4404
4404
  try {
4405
- o(C.throw(w));
4405
+ w(C.throw(o));
4406
4406
  } catch (h) {
4407
4407
  Q(h);
4408
4408
  }
4409
4409
  }
4410
- function o(w) {
4410
+ function w(o) {
4411
4411
  var h;
4412
- w.done ? g(w.value) : (h = w.value, h instanceof I ? h : new I(function(G) {
4412
+ o.done ? g(o.value) : (h = o.value, h instanceof I ? h : new I(function(G) {
4413
4413
  G(h);
4414
4414
  })).then(B, D);
4415
4415
  }
4416
- o((C = C.apply(i, [])).next());
4416
+ w((C = C.apply(i, [])).next());
4417
4417
  });
4418
4418
  }
4419
4419
  for (var nC = { byteLength: function(i) {
4420
4420
  var A = bg(i), I = A[0], C = A[1];
4421
4421
  return 3 * (I + C) / 4 - C;
4422
4422
  }, toByteArray: function(i) {
4423
- var A, I, C = bg(i), g = C[0], Q = C[1], B = new HC(function(w, h, G) {
4423
+ var A, I, C = bg(i), g = C[0], Q = C[1], B = new HC(function(o, h, G) {
4424
4424
  return 3 * (h + G) / 4 - G;
4425
- }(0, g, Q)), D = 0, o = Q > 0 ? g - 4 : g;
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)], B[D++] = A >> 16 & 255, B[D++] = A >> 8 & 255, B[D++] = 255 & A;
4425
+ }(0, g, Q)), D = 0, w = Q > 0 ? g - 4 : g;
4426
+ for (I = 0; I < w; 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)], B[D++] = A >> 16 & 255, B[D++] = A >> 8 & 255, B[D++] = 255 & A;
4427
4427
  return Q === 2 && (A = UA[i.charCodeAt(I)] << 2 | UA[i.charCodeAt(I + 1)] >> 4, B[D++] = 255 & A), Q === 1 && (A = UA[i.charCodeAt(I)] << 10 | UA[i.charCodeAt(I + 1)] << 4 | UA[i.charCodeAt(I + 2)] >> 2, B[D++] = A >> 8 & 255, B[D++] = 255 & A), B;
4428
4428
  }, fromByteArray: function(i) {
4429
4429
  for (var A, I = i.length, C = I % 3, g = [], Q = 16383, B = 0, D = I - C; B < D; B += Q) g.push(dC(i, B, B + Q > D ? D : B + Q));
@@ -4450,7 +4450,7 @@ function bC() {
4450
4450
  try {
4451
4451
  const g = E.__wbindgen_add_to_stack_pointer(-16);
4452
4452
  E.version(g);
4453
- var I = sA().getInt32(g + 0, !0), C = sA().getInt32(g + 4, !0);
4453
+ var I = GA().getInt32(g + 0, !0), C = GA().getInt32(g + 4, !0);
4454
4454
  return i = I, A = C, fI(I, C);
4455
4455
  } finally {
4456
4456
  E.__wbindgen_add_to_stack_pointer(16), E.__wbindgen_export_1(i, A, 1);
@@ -4462,7 +4462,7 @@ function TC(i) {
4462
4462
  A = i, E.reserve_memory(A);
4463
4463
  }
4464
4464
  UA[45] = 62, UA[95] = 63;
4465
- var yA = Object.freeze({ __proto__: null, version: bC, reserveMemory: TC, Vector2: xg, VectorOps: S, RotationOps: P, get RigidBodyType() {
4465
+ var yA = Object.freeze({ __proto__: null, version: bC, reserveMemory: TC, Vector2: xg, VectorOps: N, RotationOps: z, get RigidBodyType() {
4466
4466
  return cA;
4467
4467
  }, RigidBody: xI, RigidBodyDesc: YA, RigidBodySet: Xg, IntegrationParameters: vg, get JointType() {
4468
4468
  return MA;
@@ -4470,35 +4470,35 @@ var yA = 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: 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() {
4473
+ }, ImpulseJoint: nA, UnitImpulseJoint: $I, FixedImpulseJoint: ug, RopeImpulseJoint: Vg, SpringImpulseJoint: Pg, PrismaticImpulseJoint: zg, RevoluteImpulseJoint: _g, JointData: TA, ImpulseJointSet: $g, MultibodyJoint: WA, UnitMultibodyJoint: Ag, FixedMultibodyJoint: AC, PrismaticMultibodyJoint: IC, RevoluteMultibodyJoint: gC, MultibodyJointSet: CC, get CoefficientCombineRule() {
4474
4474
  return II;
4475
- }, CCDSolver: QC, IslandManager: BC, BroadPhase: EC, NarrowPhase: iC, TempContactManifold: DC, Shape: SA, get ShapeType() {
4476
- return aA;
4475
+ }, CCDSolver: QC, IslandManager: BC, BroadPhase: EC, NarrowPhase: iC, TempContactManifold: DC, Shape: aA, get ShapeType() {
4476
+ return KA;
4477
4477
  }, get TriMeshFlags() {
4478
- return WI;
4479
- }, Ball: Ig, HalfSpace: gg, Cuboid: Cg, RoundCuboid: Qg, Capsule: Bg, Segment: Eg, Triangle: ig, RoundTriangle: Dg, Polyline: og, Voxels: wg, TriMesh: Gg, ConvexPolygon: aI, RoundConvexPolygon: SI, Heightfield: hg, get ActiveCollisionTypes() {
4478
+ return OI;
4479
+ }, Ball: Ig, HalfSpace: gg, Cuboid: Cg, RoundCuboid: Qg, Capsule: Bg, Segment: Eg, Triangle: ig, RoundTriangle: Dg, Polyline: og, Voxels: wg, TriMesh: hg, ConvexPolygon: aI, RoundConvexPolygon: SI, Heightfield: Gg, get ActiveCollisionTypes() {
4480
4480
  return KI;
4481
4481
  }, Collider: vI, get MassPropsMode() {
4482
- return TA;
4482
+ return ZA;
4483
4483
  }, ColliderDesc: hA, ColliderSet: SC, get FeatureType() {
4484
4484
  return xA;
4485
4485
  }, Ray: rC, RayIntersection: QI, RayColliderIntersection: gI, RayColliderHit: RI, PointProjection: BI, PointColliderProjection: CI, ShapeCastHit: vA, ColliderShapeCastHit: EI, ShapeContact: XA, World: cI, PhysicsPipeline: oC, SerializationPipeline: XI, get ActiveEvents() {
4486
- return hI;
4486
+ return GI;
4487
4487
  }, TempContactForceEvent: aC, EventQueue: qC, get ActiveHooks() {
4488
4488
  return sI;
4489
4489
  }, get SolverFlags() {
4490
4490
  return jI;
4491
- }, DebugRenderBuffers: wC, DebugRenderPipeline: GC, get QueryFilterFlags() {
4491
+ }, DebugRenderBuffers: wC, DebugRenderPipeline: hC, get QueryFilterFlags() {
4492
4492
  return mI;
4493
- }, init: fC, CharacterCollision: hC, KinematicCharacterController: sC, get PidAxesMask() {
4494
- return OI;
4493
+ }, init: fC, CharacterCollision: GC, KinematicCharacterController: sC, get PidAxesMask() {
4494
+ return WI;
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
+ $(this, "world", null);
4499
+ $(this, "bodies", /* @__PURE__ */ new Map());
4500
+ $(this, "colliders", /* @__PURE__ */ new Map());
4501
+ $(this, "initialized", !1);
4502
4502
  }
4503
4503
  async init(A) {
4504
4504
  this.initialized || (await yA.init(), this.world = new yA.World(new yA.Vector2(A.x, A.y)), this.initialized = !0);
@@ -4596,39 +4596,39 @@ class ZC {
4596
4596
  g && g.applyImpulse(new yA.Vector2(I, C), !0);
4597
4597
  }
4598
4598
  }
4599
- class WC {
4599
+ class OC {
4600
4600
  constructor() {
4601
- _(this, "artboard", null);
4602
- _(this, "objectStates", /* @__PURE__ */ new Map());
4601
+ $(this, "artboard", null);
4602
+ $(this, "objectStates", /* @__PURE__ */ new Map());
4603
4603
  // Physics State
4604
- _(this, "physicsEngine", null);
4604
+ $(this, "physicsEngine", null);
4605
4605
  // State Machine State
4606
- _(this, "activeStateMachine", null);
4607
- _(this, "inputs", /* @__PURE__ */ new Map());
4606
+ $(this, "activeStateMachine", null);
4607
+ $(this, "inputs", /* @__PURE__ */ new Map());
4608
4608
  // id -> value
4609
- _(this, "inputNameMap", /* @__PURE__ */ new Map());
4609
+ $(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
+ $(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");
4617
4617
  // Track triggers that were just fired in the current frame
4618
- _(this, "justFiredTriggers", /* @__PURE__ */ new Set());
4618
+ $(this, "justFiredTriggers", /* @__PURE__ */ new Set());
4619
4619
  // Track currently hovered object for Enter/Leave events
4620
- _(this, "lastHoveredObjectId", null);
4621
- _(this, "_lastPointerPos", null);
4622
- _(this, "_prevPointerPos", null);
4620
+ $(this, "lastHoveredObjectId", null);
4621
+ $(this, "_lastPointerPos", null);
4622
+ $(this, "_prevPointerPos", null);
4623
4623
  // Interaction State
4624
- _(this, "focusedId", null);
4625
- _(this, "draggingSliderId", null);
4626
- _(this, "activeDropdownId", null);
4627
- _(this, "draggingListViewId", null);
4624
+ $(this, "focusedId", null);
4625
+ $(this, "draggingSliderId", null);
4626
+ $(this, "activeDropdownId", null);
4627
+ $(this, "draggingListViewId", null);
4628
4628
  // Physics/Animation State
4629
- _(this, "objectVelocities", /* @__PURE__ */ new Map());
4629
+ $(this, "objectVelocities", /* @__PURE__ */ new Map());
4630
4630
  // Trigger Management
4631
- _(this, "activeTriggers", /* @__PURE__ */ new Map());
4631
+ $(this, "activeTriggers", /* @__PURE__ */ new Map());
4632
4632
  }
4633
4633
  setTriggerCallback(A) {
4634
4634
  this.onTrigger = A;
@@ -4659,6 +4659,10 @@ class WC {
4659
4659
  getObjectState(A) {
4660
4660
  return this.objectStates.get(A);
4661
4661
  }
4662
+ updateObjectOptions(A, I) {
4663
+ const C = this.objectStates.get(A);
4664
+ C && (C.options = { ...C.options, ...I });
4665
+ }
4662
4666
  load(A) {
4663
4667
  this.artboard = A, this.loadFonts(), this.reset(), this.advance(0);
4664
4668
  }
@@ -4693,14 +4697,14 @@ class WC {
4693
4697
  if ((Q = g.physics) != null && Q.enabled && g.type === "Shape") {
4694
4698
  const B = this.objectStates.get(g.id);
4695
4699
  if (!B) return;
4696
- const D = g.geometry.width || 100, o = g.geometry.height || 100;
4700
+ const D = g.geometry.width || 100, w = g.geometry.height || 100;
4697
4701
  this.physicsEngine.createBody({
4698
4702
  id: g.id,
4699
4703
  type: g.geometry.type,
4700
4704
  x: B.x,
4701
4705
  y: B.y,
4702
4706
  width: D,
4703
- height: o,
4707
+ height: w,
4704
4708
  rotation: B.rotation * (Math.PI / 180),
4705
4709
  // Convert deg to rad
4706
4710
  isStatic: g.physics.bodyType === "Static",
@@ -4770,10 +4774,10 @@ class WC {
4770
4774
  const B = this.activeStateMachine.layers.find((D) => D.name === A);
4771
4775
  if (B)
4772
4776
  for (const D of I) {
4773
- const o = B.states.find((w) => w.id === D);
4774
- if (o) {
4775
- let w = null;
4776
- 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 && (g.push({ animation: w, state: o }), Q = Math.max(Q, w.duration));
4777
+ const w = B.states.find((o) => o.id === D);
4778
+ if (w) {
4779
+ let o = null;
4780
+ w.animationId && (o = this.artboard.animations.find((h) => h.id === w.animationId) || null), o || (o = this.artboard.animations.find((h) => h.name === w.name || h.id === w.name || w.name === "Entry" && h.name === "Rotate") || null), o && (g.push({ animation: o, state: w }), Q = Math.max(Q, o.duration));
4777
4781
  }
4778
4782
  }
4779
4783
  }
@@ -4800,23 +4804,31 @@ class WC {
4800
4804
  setInputNumberArray(A, I) {
4801
4805
  this.updateInput(A, I);
4802
4806
  }
4807
+ setInputStringArray(A, I) {
4808
+ this.updateInput(A, I);
4809
+ }
4803
4810
  updateInput(A, I) {
4804
- var B, D;
4811
+ var B, D, w;
4805
4812
  let C;
4806
4813
  if (this.inputs.has(A)) {
4807
- const o = (B = this.activeStateMachine) == null ? void 0 : B.inputs.find((w) => w.id === A);
4814
+ const o = (B = this.activeStateMachine) == null ? void 0 : B.inputs.find((h) => h.id === A);
4808
4815
  o && typeof o.value == "object" && (C = o.value.type);
4809
4816
  } else {
4810
4817
  const o = this.inputNameMap.get(A);
4811
4818
  if (o && o.length > 0) {
4812
- const w = (D = this.activeStateMachine) == null ? void 0 : D.inputs.find((h) => h.id === o[0]);
4813
- w && typeof w.value == "object" && (C = w.value.type);
4819
+ const h = (D = this.activeStateMachine) == null ? void 0 : D.inputs.find((G) => G.id === o[0]);
4820
+ h && typeof h.value == "object" && (C = h.value.type);
4814
4821
  }
4815
4822
  }
4816
4823
  let g = I;
4817
4824
  C === "Trigger" && (I === 1 ? g = !0 : I === 0 && (g = !1)), this.inputs.has(A) && this.setInternalInput(A, g);
4818
4825
  const Q = this.inputNameMap.get(A);
4819
- Q && Q.forEach((o) => this.setInternalInput(o, g)), C === "Trigger" && g === !0 && (this.justFiredTriggers.add(A), Q && Q.forEach((o) => this.justFiredTriggers.add(o))), this.evaluateTransitions();
4826
+ Q && Q.forEach((o) => this.setInternalInput(o, g)), C === "Trigger" && g === !0 && (this.justFiredTriggers.add(A), Q && Q.forEach((o) => this.justFiredTriggers.add(o))), Array.isArray(g) && ((w = this.artboard) == null || w.objects.forEach((o) => {
4827
+ if (o.inputId === A || o.name === A) {
4828
+ const h = this.objectStates.get(o.id);
4829
+ h && h.options && (o.type === "ListView" || o.variant === "listview" ? h.options.items = g : (o.type === "Dropdown" || o.variant === "dropdown") && (h.options.optionsList = g));
4830
+ }
4831
+ })), this.evaluateTransitions();
4820
4832
  }
4821
4833
  evaluateTransitions() {
4822
4834
  this.activeStateMachine && (this.activeStateMachine.layers.forEach((A) => {
@@ -4825,16 +4837,16 @@ class WC {
4825
4837
  const C = [];
4826
4838
  let g = !1;
4827
4839
  for (const Q of I.currentStateIds) {
4828
- const B = A.states.find((o) => o.id === Q);
4840
+ const B = A.states.find((w) => w.id === Q);
4829
4841
  if (!B) continue;
4830
4842
  let D = !1;
4831
- for (const o of B.transitions)
4832
- this.checkConditions(o.conditions) && (C.push(o.targetStateId), D = !0, g = !0, o.conditions && o.conditions.forEach((w) => {
4843
+ for (const w of B.transitions)
4844
+ this.checkConditions(w.conditions) && (C.push(w.targetStateId), D = !0, g = !0, w.conditions && w.conditions.forEach((o) => {
4833
4845
  var G;
4834
- const h = (G = this.activeStateMachine) == null ? void 0 : G.inputs.find((K) => K.id === w.inputId);
4835
- if (h && typeof h.value == "object" && h.value.type === "Number" && (this.setInternalInput(w.inputId, 0), this.inputNameMap.has(h.name))) {
4836
- const K = this.inputNameMap.get(h.name);
4837
- K == null || K.forEach((a) => this.setInternalInput(a, 0));
4846
+ const h = (G = this.activeStateMachine) == null ? void 0 : G.inputs.find((s) => s.id === o.inputId);
4847
+ if (h && typeof h.value == "object" && h.value.type === "Number" && (this.setInternalInput(o.inputId, 0), this.inputNameMap.has(h.name))) {
4848
+ const s = this.inputNameMap.get(h.name);
4849
+ s == null || s.forEach((a) => this.setInternalInput(a, 0));
4838
4850
  }
4839
4851
  }));
4840
4852
  D || C.push(Q);
@@ -4842,11 +4854,11 @@ class WC {
4842
4854
  if (!g) {
4843
4855
  const Q = this.findGlobalTransition(A, I.currentStateIds);
4844
4856
  Q && (C.length = 0, C.push(Q.targetStateId), g = !0, Q.conditions && Q.conditions.forEach((B) => {
4845
- var o;
4846
- const D = (o = this.activeStateMachine) == null ? void 0 : o.inputs.find((w) => w.id === B.inputId);
4857
+ var w;
4858
+ const D = (w = this.activeStateMachine) == null ? void 0 : w.inputs.find((o) => o.id === B.inputId);
4847
4859
  if (D && typeof D.value == "object" && D.value.type === "Number" && (this.setInternalInput(B.inputId, 0), this.inputNameMap.has(D.name))) {
4848
- const w = this.inputNameMap.get(D.name);
4849
- w == null || w.forEach((h) => this.setInternalInput(h, 0));
4860
+ const o = this.inputNameMap.get(D.name);
4861
+ o == null || o.forEach((h) => this.setInternalInput(h, 0));
4850
4862
  }
4851
4863
  }));
4852
4864
  }
@@ -4917,33 +4929,33 @@ class WC {
4917
4929
  });
4918
4930
  }
4919
4931
  evaluateLogicTree(A, I, C = /* @__PURE__ */ new Set()) {
4920
- var B, D, o;
4932
+ var B, D, w;
4921
4933
  if (C.has(A)) return !1;
4922
4934
  C.add(A);
4923
- const g = (D = (B = this.activeStateMachine) == null ? void 0 : B.logicNodes) == null ? void 0 : D.find((w) => w.id === A);
4935
+ const g = (D = (B = this.activeStateMachine) == null ? void 0 : B.logicNodes) == null ? void 0 : D.find((o) => o.id === A);
4924
4936
  if (g) {
4925
- const w = (h, G) => {
4926
- const K = g.inputs.find((a) => a.id === h);
4927
- return K ? K.sourceId ? this.evaluateLogicTree(K.sourceId, K.sourceHandleId, C) : K.value !== void 0 ? K.value : G : G;
4937
+ const o = (h, G) => {
4938
+ const s = g.inputs.find((a) => a.id === h);
4939
+ return s ? s.sourceId ? this.evaluateLogicTree(s.sourceId, s.sourceHandleId, C) : s.value !== void 0 ? s.value : G : G;
4928
4940
  };
4929
4941
  switch (g.op) {
4930
4942
  case uA.AND:
4931
- return w("a", !1) && w("b", !1);
4943
+ return o("a", !1) && o("b", !1);
4932
4944
  case uA.OR:
4933
- return w("a", !1) || w("b", !1);
4945
+ return o("a", !1) || o("b", !1);
4934
4946
  case uA.NOT:
4935
- return !w("in", !1);
4947
+ return !o("in", !1);
4936
4948
  case uA.XOR:
4937
- return !!w("a", !1) != !!w("b", !1);
4949
+ return !!o("a", !1) != !!o("b", !1);
4938
4950
  default:
4939
4951
  return 0;
4940
4952
  }
4941
4953
  }
4942
4954
  let Q = this.inputs.get(A);
4943
4955
  if (this.justFiredTriggers.has(A) && (Q = !0), I && Q !== void 0) {
4944
- const w = (o = this.activeStateMachine) == null ? void 0 : o.inputs.find((h) => h.id === A);
4945
- if (w && w.value.type === "Number" && typeof Q == "number") {
4946
- const h = w.value.defaultValue ?? w.value.value;
4956
+ const o = (w = this.activeStateMachine) == null ? void 0 : w.inputs.find((h) => h.id === A);
4957
+ if (o && o.value.type === "Number" && typeof Q == "number") {
4958
+ const h = o.value.defaultValue ?? o.value.value;
4947
4959
  if (I === "source-greater") return Q > h;
4948
4960
  if (I === "source-less") return Q < h;
4949
4961
  if (I === "source-equal") return Q === h;
@@ -4970,12 +4982,12 @@ class WC {
4970
4982
  this.applyAnimation(C.animation, I.time);
4971
4983
  }));
4972
4984
  })), this.solveConstraints(A), this.activeTriggers.forEach((I, C) => {
4973
- var g, Q, B, D, o, w, h;
4985
+ var g, Q, B, D, w, o, h;
4974
4986
  if (I.phase === "entry")
4975
4987
  I.time += A, I.time >= I.animation.duration && ((B = (Q = (g = this.artboard) == null ? void 0 : g.objects.find((G) => G.id === C)) == null ? void 0 : Q.triggers) == null || B.find((G) => G.id === I.triggerId), I.phase = "hold", I.elapsedHold = 0, I.time = I.animation.duration), this.applyAnimation(I.animation, I.time);
4976
4988
  else if (I.phase === "hold") {
4977
- const G = (w = (o = (D = this.artboard) == null ? void 0 : D.objects.find((a) => a.id === C)) == null ? void 0 : o.triggers) == null ? void 0 : w.find((a) => a.id === I.triggerId), K = (G == null ? void 0 : G.duration) || 0;
4978
- if (I.elapsedHold += A * 1e3, I.elapsedHold >= K)
4989
+ const G = (o = (w = (D = this.artboard) == null ? void 0 : D.objects.find((a) => a.id === C)) == null ? void 0 : w.triggers) == null ? void 0 : o.find((a) => a.id === I.triggerId), s = (G == null ? void 0 : G.duration) || 0;
4990
+ if (I.elapsedHold += A * 1e3, I.elapsedHold >= s)
4979
4991
  if (G != null && G.exitAnimationId) {
4980
4992
  const a = (h = this.artboard) == null ? void 0 : h.animations.find((M) => M.id === G.exitAnimationId);
4981
4993
  a ? (I.phase = "exit", I.animation = a, I.time = 0) : this.activeTriggers.delete(C);
@@ -4989,58 +5001,58 @@ class WC {
4989
5001
  if (!I.constraints || I.constraints.length === 0) return;
4990
5002
  const C = this.objectStates.get(I.id);
4991
5003
  C && I.constraints.forEach((g) => {
4992
- var B, D, o, w, h, G;
5004
+ var B, D, w, o, h, G;
4993
5005
  const Q = g.strength ?? 1;
4994
5006
  if (g.type === "Translation") {
4995
- const K = this.objectStates.get(g.targetId);
4996
- if (K) {
5007
+ const s = this.objectStates.get(g.targetId);
5008
+ if (s) {
4997
5009
  const a = g.useSpring, M = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 };
4998
5010
  if (a) {
4999
- const { x: y, y: J, vx: k, vy: F } = this.computeSpring(C.x, C.y, M.vx, M.vy, K.x, K.y, g, A);
5000
- g.copyX && (C.x = y), g.copyY && (C.y = J), this.objectVelocities.set(I.id, { vx: k, vy: F });
5011
+ const { x: y, y: J, vx: S, vy: F } = this.computeSpring(C.x, C.y, M.vx, M.vy, s.x, s.y, g, A);
5012
+ g.copyX && (C.x = y), g.copyY && (C.y = J), this.objectVelocities.set(I.id, { vx: S, vy: F });
5001
5013
  } else
5002
- g.copyX && (C.x = C.x + (K.x - C.x) * Q), g.copyY && (C.y = C.y + (K.y - C.y) * Q);
5014
+ g.copyX && (C.x = C.x + (s.x - C.x) * Q), g.copyY && (C.y = C.y + (s.y - C.y) * Q);
5003
5015
  (B = g.limitX) != null && B.enabled && (C.x = Math.max(g.limitX.min, Math.min(g.limitX.max, C.x))), (D = g.limitY) != null && D.enabled && (C.y = Math.max(g.limitY.min, Math.min(g.limitY.max, C.y)));
5004
5016
  }
5005
5017
  } else if (g.type === "FollowPointer") {
5006
- const K = ((o = this._lastPointerPos) == null ? void 0 : o.x) ?? C.x, a = ((w = this._lastPointerPos) == null ? void 0 : w.y) ?? C.y;
5018
+ const s = ((w = this._lastPointerPos) == null ? void 0 : w.x) ?? C.x, a = ((o = this._lastPointerPos) == null ? void 0 : o.y) ?? C.y;
5007
5019
  if (g.useSpring) {
5008
- const y = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 }, { x: J, y: k, vx: F, vy: R } = this.computeSpring(C.x, C.y, y.vx, y.vy, K, a, g, A);
5009
- C.x = J, C.y = k, this.objectVelocities.set(I.id, { vx: F, vy: R });
5020
+ const y = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 }, { x: J, y: S, vx: F, vy: U } = this.computeSpring(C.x, C.y, y.vx, y.vy, s, a, g, A);
5021
+ C.x = J, C.y = S, this.objectVelocities.set(I.id, { vx: F, vy: U });
5010
5022
  } else
5011
- C.x = C.x + (K - C.x) * Q, C.y = C.y + (a - C.y) * Q;
5023
+ C.x = C.x + (s - C.x) * Q, C.y = C.y + (a - C.y) * Q;
5012
5024
  (h = g.limitX) != null && h.enabled && (C.x = Math.max(g.limitX.min, Math.min(g.limitX.max, C.x))), (G = g.limitY) != null && G.enabled && (C.y = Math.max(g.limitY.min, Math.min(g.limitY.max, C.y)));
5013
5025
  } else if (g.type === "Distance") {
5014
- const K = this.objectStates.get(g.targetId);
5015
- if (K) {
5016
- const a = C.x - K.x, M = C.y - K.y, y = Math.sqrt(a * a + M * M), J = g.distance || 0;
5017
- let k = y;
5026
+ const s = this.objectStates.get(g.targetId);
5027
+ if (s) {
5028
+ const a = C.x - s.x, M = C.y - s.y, y = Math.sqrt(a * a + M * M), J = g.distance || 0;
5029
+ let S = y;
5018
5030
  switch (g.mode) {
5019
5031
  case "exact":
5020
- k = J;
5032
+ S = J;
5021
5033
  break;
5022
5034
  case "minimum":
5023
- k = Math.max(J, y);
5035
+ S = Math.max(J, y);
5024
5036
  break;
5025
5037
  case "maximum":
5026
- k = Math.min(J, y);
5038
+ S = Math.min(J, y);
5027
5039
  break;
5028
5040
  case "clamped":
5029
- k = Math.max(0, Math.min(J, y));
5041
+ S = Math.max(0, Math.min(J, y));
5030
5042
  break;
5031
5043
  }
5032
5044
  if (y > 0) {
5033
- const F = k / y;
5034
- C.x = K.x + a * F, C.y = K.y + M * F;
5035
- } else y === 0 && k > 0 && (C.x = K.x + k);
5045
+ const F = S / y;
5046
+ C.x = s.x + a * F, C.y = s.y + M * F;
5047
+ } else y === 0 && S > 0 && (C.x = s.x + S);
5036
5048
  }
5037
5049
  }
5038
5050
  });
5039
5051
  });
5040
5052
  }
5041
- computeSpring(A, I, C, g, Q, B, D, o) {
5042
- const w = D.stiffness ?? 100, h = D.damping ?? 10, G = D.mass ?? 1, K = -w * (A - Q), a = -w * (I - B), M = -h * C, y = -h * g, J = (K + M) / G, k = (a + y) / G, F = C + J * o, R = g + k * o, U = A + F * o, c = I + R * o;
5043
- return { x: U, y: c, vx: F, vy: R };
5053
+ computeSpring(A, I, C, g, Q, B, D, w) {
5054
+ const o = D.stiffness ?? 100, h = D.damping ?? 10, G = D.mass ?? 1, s = -o * (A - Q), a = -o * (I - B), M = -h * C, y = -h * g, J = (s + M) / G, S = (a + y) / G, F = C + J * w, U = g + S * w, R = A + F * w, c = I + U * w;
5055
+ return { x: R, y: c, vx: F, vy: U };
5044
5056
  }
5045
5057
  handlePointerInput(A, I, C, g, Q) {
5046
5058
  if (!this.artboard) return;
@@ -5051,24 +5063,27 @@ class WC {
5051
5063
  this.artboard.height,
5052
5064
  this.layout.fit,
5053
5065
  this.layout.alignment
5054
- ), D = (I - B.tx) / B.scaleX - this.artboard.width / 2, o = (C - B.ty) / B.scaleY - this.artboard.height / 2;
5055
- this._prevPointerPos = this._lastPointerPos, this._lastPointerPos = { x: D, y: o }, this.updateInput("mouseX", D), this.updateInput("mouseY", o), this.handlePointerEvent(A, D, o);
5066
+ ), D = (I - B.tx) / B.scaleX - this.artboard.width / 2, w = (C - B.ty) / B.scaleY - this.artboard.height / 2;
5067
+ this._prevPointerPos = this._lastPointerPos, this._lastPointerPos = { x: D, y: w }, this.updateInput("mouseX", D), this.updateInput("mouseY", w), this.handlePointerEvent(A, D, w);
5056
5068
  }
5057
5069
  handlePointerEvent(A, I, C) {
5058
- var o, w;
5070
+ var w;
5059
5071
  if (!this.artboard) return;
5060
5072
  let g = null;
5061
- const Q = (h, G) => {
5062
- let K = G;
5063
- G === "click" ? K = "onClick" : G === "down" ? K = "onPointerDown" : G === "up" ? K = "onPointerUp" : G === "blur" && (K = "onPointerLeave");
5064
- const a = /* @__PURE__ */ new Set([K]);
5065
- return G === "move" && a.add("onPointerEnter").add("hover").add("onPointerLeave").add("blur"), K === "onClick" && a.add("click"), K === "onPointerDown" && a.add("pointerDown"), K === "onPointerUp" && a.add("pointerUp"), !!((h.interactions || []).some((J) => a.has(J.event)) || (h.triggers || []).some((J) => a.has(J.eventType)));
5073
+ const Q = (o, h) => {
5074
+ var J;
5075
+ let G = h;
5076
+ h === "click" ? G = "onClick" : h === "down" ? G = "onPointerDown" : h === "up" ? G = "onPointerUp" : h === "blur" && (G = "onPointerLeave");
5077
+ const s = /* @__PURE__ */ new Set([G]);
5078
+ h === "move" && s.add("onPointerEnter").add("hover").add("onPointerLeave").add("blur"), G === "onClick" && s.add("click"), G === "onPointerDown" && s.add("pointerDown"), G === "onPointerUp" && s.add("pointerUp");
5079
+ const a = ["button", "toggle", "toggle_button", "dropdown", "listview", "inputbox", "slider"];
5080
+ return !!(o.type === "Component" && a.includes(o.variant) || a.includes((J = o.type) == null ? void 0 : J.toLowerCase()) || (o.interactions || []).some((S) => s.has(S.event)) || (o.triggers || []).some((S) => s.has(S.eventType)));
5066
5081
  };
5067
5082
  let B = null;
5068
- for (let h = this.artboard.objects.length - 1; h >= 0; h--) {
5069
- const G = this.artboard.objects[h];
5070
- if (this.hitTest(G, I, C) && (B || (B = G), Q(G, A))) {
5071
- g = G;
5083
+ for (let o = this.artboard.objects.length - 1; o >= 0; o--) {
5084
+ const h = this.artboard.objects[o], G = this.objectStates.get(h.id);
5085
+ if (G && G.visible !== !1 && G.opacity > 0 && this.hitTest(h, I, C) && (B || (B = h), Q(h, A))) {
5086
+ g = h;
5072
5087
  break;
5073
5088
  }
5074
5089
  }
@@ -5076,64 +5091,76 @@ class WC {
5076
5091
  const D = (g == null ? void 0 : g.id) || null;
5077
5092
  if (A === "move") {
5078
5093
  if (this.draggingSliderId) {
5079
- const h = this.artboard.objects.find((G) => G.id === this.draggingSliderId);
5080
- h && this.updateSliderValueFromPointer(h, I, C);
5094
+ const o = this.artboard.objects.find((h) => h.id === this.draggingSliderId);
5095
+ o && this.updateSliderValueFromPointer(o, I, C);
5081
5096
  return;
5082
5097
  }
5083
5098
  if (this.draggingListViewId) {
5084
- const h = this.artboard.objects.find((G) => G.id === this.draggingListViewId);
5085
- h && this.updateListViewScrollFromPointer(h);
5099
+ const o = this.artboard.objects.find((h) => h.id === this.draggingListViewId);
5100
+ o && this.updateListViewScrollFromPointer(o);
5086
5101
  return;
5087
5102
  }
5088
5103
  g && g.type === "Component" && g.variant === "listview" && this.updateListViewHoverFromPointer(g, I, C), 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);
5089
5104
  return;
5090
5105
  }
5091
- if ((A === "up" || A === "blur") && (this.draggingSliderId = null, this.draggingListViewId = null), g) {
5092
- let h = A;
5093
- if (A === "click" ? h = "onClick" : A === "down" ? h = "onPointerDown" : A === "up" ? h = "onPointerUp" : A === "blur" && (h = "onPointerLeave"), this.fireEventForObject(g.id, h), g.type === "Component" && g.variant === "toggle_button" && A === "down") {
5094
- const G = g.options || {};
5095
- G.checked = !G.checked, g.inputId && this.setInternalInput(g.inputId, G.checked), this.onComponentChange && this.onComponentChange({
5096
- objectId: g.id,
5097
- componentName: g.name,
5106
+ if ((A === "up" || A === "blur") && (this.draggingSliderId = null, this.draggingListViewId = null), this.activeDropdownId && A === "down") {
5107
+ const o = this.artboard.objects.find((h) => h.id === this.activeDropdownId);
5108
+ if (o && (o.type === "Dropdown" || o.variant === "dropdown")) {
5109
+ const h = this.objectStates.get(o.id), G = (h == null ? void 0 : h.options) || o.options || {}, s = o.geometry || {}, a = s.width ?? o.width ?? 200, M = s.height ?? o.height ?? 40, y = G.optionsList || [], J = G.itemHeight || 32, S = G.listPadding ?? 4, F = y.length * J + S * 2, U = this.getWorldTransform(o.id), R = a * Math.abs(U.scaleX), c = M * Math.abs(U.scaleY), r = U.y + c / 2 + 4, n = Math.abs(I - U.x) <= R / 2, p = C >= r && C <= r + F * Math.abs(U.scaleY);
5110
+ if (n && p) {
5111
+ const Z = Math.abs(U.scaleY), H = C - (r + S * Z), X = Math.floor(H / (J * Z));
5112
+ if (X >= 0 && X < y.length) {
5113
+ const QA = y[X];
5114
+ G.selectedOption = QA, G.isOpen = !1, this.activeDropdownId = null, o.inputId && this.setInternalInput(o.inputId, QA), this.onComponentChange && this.onComponentChange({
5115
+ objectId: o.id,
5116
+ componentName: o.name,
5117
+ variant: "dropdown",
5118
+ property: "selectedOption",
5119
+ value: QA
5120
+ });
5121
+ }
5122
+ return;
5123
+ } else D !== this.activeDropdownId && (G.isOpen = !1, this.activeDropdownId = null);
5124
+ }
5125
+ }
5126
+ if (g) {
5127
+ let o = g, h = g;
5128
+ for (; h && h.parentId; ) {
5129
+ const s = this.artboard.objects.find((a) => a.id === h.parentId);
5130
+ if (s && s.type === "Component") {
5131
+ o = s;
5132
+ break;
5133
+ }
5134
+ h = s;
5135
+ }
5136
+ let G = A;
5137
+ if (A === "click" ? G = "onClick" : A === "down" ? G = "onPointerDown" : A === "up" ? G = "onPointerUp" : A === "blur" && (G = "onPointerLeave"), this.fireEventForObject(g.id, G), o !== g && this.fireEventForObject(o.id, G), o.type === "Component" && o.variant === "toggle_button" && A === "down") {
5138
+ const s = this.objectStates.get(o.id), a = (s == null ? void 0 : s.options) || o.options || {};
5139
+ a.checked = !a.checked, o.inputId && this.setInternalInput(o.inputId, a.checked), this.onComponentChange && this.onComponentChange({
5140
+ objectId: o.id,
5141
+ componentName: o.name,
5098
5142
  variant: "toggle_button",
5099
5143
  property: "checked",
5100
- value: G.checked
5144
+ value: a.checked
5101
5145
  });
5102
5146
  }
5103
- if (g.type === "Component" && g.variant === "toggle" && A === "down") {
5104
- const G = g.options || {};
5105
- G.checked = !G.checked, g.inputId && this.setInternalInput(g.inputId, G.checked), this.onComponentChange && this.onComponentChange({
5106
- objectId: g.id,
5107
- componentName: g.name,
5147
+ if (o.type === "Component" && o.variant === "toggle" && A === "down") {
5148
+ const s = this.objectStates.get(o.id), a = (s == null ? void 0 : s.options) || o.options || {};
5149
+ a.checked = !a.checked, o.inputId && this.setInternalInput(o.inputId, a.checked), this.onComponentChange && this.onComponentChange({
5150
+ objectId: o.id,
5151
+ componentName: o.name,
5108
5152
  variant: "toggle",
5109
5153
  property: "checked",
5110
- value: G.checked
5154
+ value: a.checked
5111
5155
  });
5112
5156
  }
5113
- if (g.type === "Component" && g.variant === "dropdown" && A === "down") {
5114
- const G = g.options || {}, K = !G.isOpen;
5115
- if (G.isOpen) {
5116
- const a = ((o = g.geometry) == null ? void 0 : o.height) ?? g.height ?? 40, M = G.optionsList || [], y = G.itemHeight || 32, J = G.listPadding ?? 4, k = this.getWorldTransform(g.id), F = C - (k.y + a / 2 + 4);
5117
- if (F >= 0) {
5118
- const R = Math.floor((F - J) / y);
5119
- if (R >= 0 && R < M.length) {
5120
- const U = M[R];
5121
- G.selectedOption = U, G.isOpen = !1, this.activeDropdownId = null, g.inputId && this.setInternalInput(g.inputId, U), this.onComponentChange && this.onComponentChange({
5122
- objectId: g.id,
5123
- componentName: g.name,
5124
- variant: "dropdown",
5125
- property: "selectedOption",
5126
- value: U
5127
- });
5128
- return;
5129
- }
5130
- }
5131
- }
5132
- if (K && this.activeDropdownId && this.activeDropdownId !== g.id) {
5133
- const a = this.artboard.objects.find((M) => M.id === this.activeDropdownId);
5134
- a && a.options && (a.options.isOpen = !1);
5157
+ if (o.type === "Component" && o.variant === "dropdown" && A === "down") {
5158
+ const s = this.objectStates.get(o.id), a = (s == null ? void 0 : s.options) || o.options || {}, M = !a.isOpen;
5159
+ if (M && this.activeDropdownId && this.activeDropdownId !== o.id) {
5160
+ const y = this.artboard.objects.find((J) => J.id === this.activeDropdownId);
5161
+ y && y.options && (y.options.isOpen = !1);
5135
5162
  }
5136
- G.isOpen = K, this.activeDropdownId = K ? g.id : null;
5163
+ a.isOpen = M, this.activeDropdownId = M ? o.id : null;
5137
5164
  }
5138
5165
  if (g.type === "Component" && g.variant === "button" && A === "down" && this.onComponentChange && this.onComponentChange({
5139
5166
  objectId: g.id,
@@ -5143,31 +5170,31 @@ class WC {
5143
5170
  value: !0
5144
5171
  }), g.type === "Component" && g.variant === "listview" && A === "down") {
5145
5172
  this.draggingListViewId = g.id;
5146
- const G = this.getListViewItemIndexAtPointer(g, I, C);
5147
- if (G !== null) {
5148
- const K = g.options || {};
5149
- K.activeItemIndex = G;
5150
- const a = this.objectStates.get(g.id);
5151
- a && a.options && (a.options.activeItemIndex = G);
5152
- const M = (K.items || [])[G], y = typeof M == "string" ? M : M.label || M.value || G;
5153
- a && a.options && (a.options.selectedValue = y), g.inputId && this.setInternalInput(g.inputId, y), this.onComponentChange && (this.onComponentChange({
5173
+ const s = this.getListViewItemIndexAtPointer(g, I, C);
5174
+ if (s !== null) {
5175
+ const a = g.options || {};
5176
+ a.activeItemIndex = s;
5177
+ const M = this.objectStates.get(g.id);
5178
+ M && M.options && (M.options.activeItemIndex = s);
5179
+ const y = (a.items || [])[s], J = typeof y == "string" ? y : y.label || y.value || s;
5180
+ M && M.options && (M.options.selectedValue = J), g.inputId && this.setInternalInput(g.inputId, J), this.onComponentChange && (this.onComponentChange({
5154
5181
  objectId: g.id,
5155
5182
  componentName: g.name,
5156
5183
  variant: "listview",
5157
5184
  property: "activeItemIndex",
5158
- value: G
5185
+ value: s
5159
5186
  }), this.onComponentChange({
5160
5187
  objectId: g.id,
5161
5188
  componentName: g.name,
5162
5189
  variant: "listview",
5163
5190
  property: "selected",
5164
- value: y
5191
+ value: J
5165
5192
  }));
5166
5193
  }
5167
5194
  }
5168
5195
  if (A === "click") {
5169
- const G = (w = this.artboard) == null ? void 0 : w.objects.find((K) => K.id === g.id);
5170
- (G == null ? void 0 : G.type) === "Component" && G.variant === "inputbox" ? (this.focusedId = g.id, console.log(`[Engine] Focus set to: ${g.id}`)) : this.focusedId = null;
5196
+ const s = (w = this.artboard) == null ? void 0 : w.objects.find((a) => a.id === g.id);
5197
+ (s == null ? void 0 : s.type) === "Component" && s.variant === "inputbox" ? (this.focusedId = g.id, console.log(`[Engine] Focus set to: ${g.id}`)) : this.focusedId = null;
5171
5198
  }
5172
5199
  } else A === "click" && (this.focusedId = null);
5173
5200
  }
@@ -5203,35 +5230,35 @@ class WC {
5203
5230
  }
5204
5231
  fireEventForObject(A, I) {
5205
5232
  if (!this.artboard) return;
5206
- const C = this.artboard.objects.find((w) => w.id === A);
5233
+ const C = this.artboard.objects.find((o) => o.id === A);
5207
5234
  if (!C) return;
5208
5235
  console.log(`[Engine] Firing event ${I} on ${C.name}`);
5209
5236
  const g = /* @__PURE__ */ new Set([I]);
5210
5237
  I === "onPointerEnter" && g.add("hover"), I === "onPointerLeave" && g.add("blur"), I === "onPointerDown" && g.add("pointerDown"), I === "onPointerUp" && g.add("pointerUp");
5211
- const B = (C.interactions || []).find((w) => g.has(w.event));
5238
+ const B = (C.interactions || []).find((o) => g.has(o.event));
5212
5239
  if (B)
5213
5240
  if (console.log(`[Engine] Interaction matched: ${I} (as ${B.event}) -> ${B.targetInputId}`), B.action === "setInput") {
5214
- let w = B.value;
5215
- w === "toggle" && (w = !this.inputs.get(B.targetInputId)), this.updateInput(B.targetInputId, w);
5241
+ let o = B.value;
5242
+ o === "toggle" && (o = !this.inputs.get(B.targetInputId)), this.updateInput(B.targetInputId, o);
5216
5243
  } else B.action === "fireTrigger" && this.updateInput(B.targetInputId, !0);
5217
- const o = (C.triggers || []).find((w) => g.has(w.eventType));
5218
- if (o && o.entryAnimationId) {
5219
- console.log(`[Engine] Trigger matched: ${I} (as ${o.eventType}) -> Animation ${o.entryAnimationId}`);
5220
- const w = this.artboard.animations.find((h) => h.id === o.entryAnimationId);
5221
- w && (this.activeTriggers.set(C.id, {
5222
- triggerId: o.id,
5223
- animation: w,
5244
+ const w = (C.triggers || []).find((o) => g.has(o.eventType));
5245
+ if (w && w.entryAnimationId) {
5246
+ console.log(`[Engine] Trigger matched: ${I} (as ${w.eventType}) -> Animation ${w.entryAnimationId}`);
5247
+ const o = this.artboard.animations.find((h) => h.id === w.entryAnimationId);
5248
+ o && (this.activeTriggers.set(C.id, {
5249
+ triggerId: w.id,
5250
+ animation: o,
5224
5251
  time: 0,
5225
5252
  phase: "entry",
5226
5253
  elapsedHold: 0
5227
- }), this.onTrigger && this.onTrigger(o.name, w.name));
5254
+ }), this.onTrigger && this.onTrigger(w.name, o.name));
5228
5255
  }
5229
5256
  }
5230
5257
  getWorldTransform(A) {
5231
- var K;
5258
+ var s;
5232
5259
  const I = this.objectStates.get(A);
5233
5260
  if (!I) return { x: 0, y: 0, scaleX: 1, scaleY: 1, rotation: 0 };
5234
- const C = (K = this.artboard) == null ? void 0 : K.objects.find((a) => a.id === A);
5261
+ const C = (s = this.artboard) == null ? void 0 : s.objects.find((a) => a.id === A);
5235
5262
  if (!C || !C.parentId)
5236
5263
  return {
5237
5264
  x: I.x,
@@ -5240,7 +5267,7 @@ class WC {
5240
5267
  scaleY: I.scale_y ?? 1,
5241
5268
  rotation: I.rotation ?? 0
5242
5269
  };
5243
- const g = this.getWorldTransform(C.parentId), Q = g.rotation * (Math.PI / 180), B = Math.cos(Q), D = Math.sin(Q), o = I.x * g.scaleX, w = I.y * g.scaleY, h = g.x + (o * B - w * D), G = g.y + (o * D + w * B);
5270
+ const g = this.getWorldTransform(C.parentId), Q = g.rotation * (Math.PI / 180), B = Math.cos(Q), D = Math.sin(Q), w = I.x * g.scaleX, o = I.y * g.scaleY, h = g.x + (w * B - o * D), G = g.y + (w * D + o * B);
5244
5271
  return {
5245
5272
  x: h,
5246
5273
  y: G,
@@ -5250,20 +5277,20 @@ class WC {
5250
5277
  };
5251
5278
  }
5252
5279
  hitTest(A, I, C) {
5253
- var R, U;
5280
+ var U, R;
5254
5281
  if (!this.objectStates.get(A.id)) return !1;
5255
- const Q = ((R = A.geometry) == null ? void 0 : R.width) ?? A.width ?? 100, B = ((U = A.geometry) == null ? void 0 : U.height) ?? A.height ?? 100, D = this.getWorldTransform(A.id), o = I - D.x, w = C - D.y, h = -D.rotation * (Math.PI / 180), G = Math.cos(h), K = Math.sin(h), a = o * G - w * K, M = o * K + w * G, y = D.scaleX, J = D.scaleY, k = Q * Math.abs(y), F = B * Math.abs(J);
5256
- return Math.abs(a) <= k / 2 && Math.abs(M) <= F / 2;
5282
+ const Q = ((U = A.geometry) == null ? void 0 : U.width) ?? A.width ?? 100, B = ((R = A.geometry) == null ? void 0 : R.height) ?? A.height ?? 100, D = this.getWorldTransform(A.id), w = I - D.x, o = C - D.y, h = -D.rotation * (Math.PI / 180), G = Math.cos(h), s = Math.sin(h), a = w * G - o * s, M = w * s + o * G, y = D.scaleX, J = D.scaleY, S = Q * Math.abs(y), F = B * Math.abs(J);
5283
+ return Math.abs(a) <= S / 2 && Math.abs(M) <= F / 2;
5257
5284
  }
5258
5285
  updateSliderValueFromPointer(A, I, C) {
5259
- var l;
5286
+ var r;
5260
5287
  if (!this.objectStates.get(A.id)) return;
5261
- const Q = A.options || {}, B = ((l = A.geometry) == null ? void 0 : l.width) ?? A.width ?? 200, D = this.getWorldTransform(A.id), o = I - D.x, w = C - D.y, h = -D.rotation * (Math.PI / 180), G = Math.cos(h), K = Math.sin(h), a = o * G - w * K, M = Q.thumbWidth ?? 16, y = B - M;
5262
- let k = (a + y / 2) / y;
5263
- k = Math.max(0, Math.min(1, k));
5264
- const F = Q.min ?? 0, R = Q.max ?? 100, U = Q.step || 1;
5265
- let c = F + k * (R - F);
5266
- U > 0 && (c = Math.round(c / U) * U), c = Math.max(F, Math.min(R, c)), Q.value !== c && (Q.value = c, A.inputId && this.setInternalInput(A.inputId, c), this.onComponentChange && this.onComponentChange({
5288
+ const Q = A.options || {}, B = ((r = A.geometry) == null ? void 0 : r.width) ?? A.width ?? 200, D = this.getWorldTransform(A.id), w = I - D.x, o = C - D.y, h = -D.rotation * (Math.PI / 180), G = Math.cos(h), s = Math.sin(h), a = w * G - o * s, M = Q.thumbWidth ?? 16, y = B - M;
5289
+ let S = (a + y / 2) / y;
5290
+ S = Math.max(0, Math.min(1, S));
5291
+ const F = Q.min ?? 0, U = Q.max ?? 100, R = Q.step || 1;
5292
+ let c = F + S * (U - F);
5293
+ R > 0 && (c = Math.round(c / R) * R), c = Math.max(F, Math.min(U, c)), Q.value !== c && (Q.value = c, A.inputId && this.setInternalInput(A.inputId, c), this.onComponentChange && this.onComponentChange({
5267
5294
  objectId: A.id,
5268
5295
  componentName: A.name,
5269
5296
  variant: "slider",
@@ -5273,26 +5300,26 @@ class WC {
5273
5300
  }
5274
5301
  applyAnimation(A, I) {
5275
5302
  A.tracks.forEach((C) => {
5276
- var o, w, h;
5277
- const g = (o = this.artboard) == null ? void 0 : o.objects.find((G) => G.id === C.object_id);
5278
- if (((w = g == null ? void 0 : g.physics) == null ? void 0 : w.enabled) && g.physics.bodyType !== "Static" && (["x", "y", "rotation"].includes(C.property) || C.property.startsWith("transform.")))
5303
+ var w, o, h;
5304
+ const g = (w = this.artboard) == null ? void 0 : w.objects.find((G) => G.id === C.object_id);
5305
+ if (((o = g == null ? void 0 : g.physics) == null ? void 0 : o.enabled) && g.physics.bodyType !== "Static" && (["x", "y", "rotation"].includes(C.property) || C.property.startsWith("transform.")))
5279
5306
  return;
5280
5307
  const B = this.objectStates.get(C.object_id);
5281
5308
  if (!B) return;
5282
5309
  const D = this.interpolate(C.keyframes, I);
5283
5310
  if (C.property.includes(".")) {
5284
5311
  const G = (C.property || "").split(".");
5285
- let K = B;
5312
+ let s = B;
5286
5313
  for (let a = 0; a < G.length - 1; a++) {
5287
- if (!K[G[a]]) {
5314
+ if (!s[G[a]]) {
5288
5315
  let M = g;
5289
5316
  for (let y = 0; y <= a; y++)
5290
5317
  M = M ? M[G[y]] : null;
5291
- K[G[a]] = M ? JSON.parse(JSON.stringify(M)) : {};
5318
+ s[G[a]] = M ? JSON.parse(JSON.stringify(M)) : {};
5292
5319
  }
5293
- K = K[G[a]];
5320
+ s = s[G[a]];
5294
5321
  }
5295
- K[G[G.length - 1]] = D;
5322
+ s[G[G.length - 1]] = D;
5296
5323
  } else
5297
5324
  B[C.property] = D;
5298
5325
  if (this.physicsEngine && ((h = g == null ? void 0 : g.physics) != null && h.enabled) && g.physics.bodyType === "Static")
@@ -5319,24 +5346,24 @@ class WC {
5319
5346
  if (typeof C.value == "string") {
5320
5347
  if (C.value.startsWith("#"))
5321
5348
  return this.interpolateColor(C.value, g.value, B);
5322
- const D = parseFloat(C.value), o = parseFloat(g.value);
5323
- return !isNaN(D) && !isNaN(o) ? Math.round(D + (o - D) * B).toString() : C.value;
5349
+ const D = parseFloat(C.value), w = parseFloat(g.value);
5350
+ return !isNaN(D) && !isNaN(w) ? Math.round(D + (w - D) * B).toString() : C.value;
5324
5351
  }
5325
5352
  return C.value + (g.value - C.value) * B;
5326
5353
  }
5327
5354
  interpolateColor(A, I, C) {
5328
5355
  const g = (G) => {
5329
- const K = G.replace("#", "");
5356
+ const s = G.replace("#", "");
5330
5357
  return {
5331
- r: parseInt(K.substring(0, 2), 16),
5332
- g: parseInt(K.substring(2, 4), 16),
5333
- b: parseInt(K.substring(4, 6), 16)
5358
+ r: parseInt(s.substring(0, 2), 16),
5359
+ g: parseInt(s.substring(2, 4), 16),
5360
+ b: parseInt(s.substring(4, 6), 16)
5334
5361
  };
5335
- }, Q = g(A), B = g(I), D = Math.round(Q.r + (B.r - Q.r) * C), o = Math.round(Q.g + (B.g - Q.g) * C), w = Math.round(Q.b + (B.b - Q.b) * C), h = (G) => {
5336
- const K = Math.max(0, Math.min(255, G)).toString(16);
5337
- return K.length === 1 ? "0" + K : K;
5362
+ }, Q = g(A), B = g(I), D = Math.round(Q.r + (B.r - Q.r) * C), w = Math.round(Q.g + (B.g - Q.g) * C), o = Math.round(Q.b + (B.b - Q.b) * C), h = (G) => {
5363
+ const s = Math.max(0, Math.min(255, G)).toString(16);
5364
+ return s.length === 1 ? "0" + s : s;
5338
5365
  };
5339
- return `#${h(D)}${h(o)}${h(w)}`;
5366
+ return `#${h(D)}${h(w)}${h(o)}`;
5340
5367
  }
5341
5368
  render(A, I, C) {
5342
5369
  if (!this.artboard)
@@ -5351,65 +5378,65 @@ class WC {
5351
5378
  this.layout.alignment
5352
5379
  );
5353
5380
  if (A.save(), A.translate(B.tx, B.ty), A.scale(B.scaleX, B.scaleY), A.translate(g / 2, Q / 2), A.fillStyle = this.artboard.backgroundColor || "#000000", A.fillRect(-g / 2, -Q / 2, g, Q), this.artboard.backgroundImage) {
5354
- const w = this.artboard.backgroundImage;
5355
- let h = this.imageCache.get(w);
5356
- if (h || (h = new Image(), h.src = w, this.imageCache.set(w, h)), h.complete && h.naturalWidth > 0) {
5381
+ const o = this.artboard.backgroundImage;
5382
+ let h = this.imageCache.get(o);
5383
+ if (h || (h = new Image(), h.src = o, this.imageCache.set(o, h)), h.complete && h.naturalWidth > 0) {
5357
5384
  A.save(), A.globalAlpha = this.artboard.backgroundOpacity ?? 1;
5358
- const G = h.naturalWidth / h.naturalHeight, K = g / Q;
5385
+ const G = h.naturalWidth / h.naturalHeight, s = g / Q;
5359
5386
  let a, M, y, J;
5360
- K > G ? (a = g, M = g / G) : (M = Q, a = Q * G), y = -a / 2, J = -M / 2, A.drawImage(h, y, J, a, M), A.restore();
5387
+ s > G ? (a = g, M = g / G) : (M = Q, a = Q * G), y = -a / 2, J = -M / 2, A.drawImage(h, y, J, a, M), A.restore();
5361
5388
  }
5362
5389
  }
5363
5390
  A.beginPath(), A.rect(-g / 2, -Q / 2, g, Q), A.clip();
5364
5391
  const D = /* @__PURE__ */ new Map();
5365
- this.artboard.objects.forEach((w) => D.set(w.id, w));
5366
- let o = 0;
5367
- for (this.artboard.objects.forEach((w) => {
5368
- if (!w.parentId) {
5369
- const h = this.objectStates.get(w.id), G = (h == null ? void 0 : h.geometry) || w.geometry;
5392
+ this.artboard.objects.forEach((o) => D.set(o.id, o));
5393
+ let w = 0;
5394
+ for (this.artboard.objects.forEach((o) => {
5395
+ if (!o.parentId) {
5396
+ const h = this.objectStates.get(o.id), G = (h == null ? void 0 : h.geometry) || o.geometry;
5370
5397
  if (G && G.isMask && (h == null ? void 0 : h.visible) !== !1) {
5371
- A.save(), this.applyObjectTransform(A, w.id);
5372
- const K = G.width || 0, a = G.height || 0;
5373
- this.applyPath(A, G, K, a), A.clip(), o++;
5398
+ A.save(), this.applyObjectTransform(A, o.id);
5399
+ const s = G.width || 0, a = G.height || 0;
5400
+ this.applyPath(A, G, s, a), A.clip(), w++;
5374
5401
  } else
5375
- this.renderObject(A, w, D);
5402
+ this.renderObject(A, o, D);
5376
5403
  }
5377
- }); o > 0; )
5378
- A.restore(), o--;
5404
+ }); w > 0; )
5405
+ A.restore(), w--;
5379
5406
  A.restore();
5380
5407
  }
5381
5408
  calculateTransform(A, I, C, g, Q, B) {
5382
- let D = 1, o = 1, w = 1;
5409
+ let D = 1, w = 1, o = 1;
5383
5410
  const h = C / g, G = A / I;
5384
5411
  switch (Q) {
5385
5412
  case "Contain":
5386
- G > h ? w = I / g : w = A / C, D = o = w;
5413
+ G > h ? o = I / g : o = A / C, D = w = o;
5387
5414
  break;
5388
5415
  case "Cover":
5389
- G > h ? w = A / C : w = I / g, D = o = w;
5416
+ G > h ? o = A / C : o = I / g, D = w = o;
5390
5417
  break;
5391
5418
  case "Fill":
5392
- D = A / C, o = I / g;
5419
+ D = A / C, w = I / g;
5393
5420
  break;
5394
5421
  case "FitWidth":
5395
- w = A / C, D = o = w;
5422
+ o = A / C, D = w = o;
5396
5423
  break;
5397
5424
  case "FitHeight":
5398
- w = I / g, D = o = w;
5425
+ o = I / g, D = w = o;
5399
5426
  break;
5400
5427
  case "None":
5401
- D = o = 1;
5428
+ D = w = 1;
5402
5429
  break;
5403
5430
  case "ScaleDown":
5404
- w = Math.min(A / C, I / g), w > 1 && (w = 1), D = o = w;
5431
+ o = Math.min(A / C, I / g), o > 1 && (o = 1), D = w = o;
5405
5432
  break;
5406
5433
  default:
5407
- D = o = 1;
5434
+ D = w = 1;
5408
5435
  break;
5409
5436
  }
5410
- const K = C * D, a = g * o;
5437
+ const s = C * D, a = g * w;
5411
5438
  let M = 0, y = 0;
5412
- return B.includes("Left") ? M = 0 : B.includes("Right") ? M = A - K : M = (A - K) / 2, B.includes("Top") ? y = 0 : B.includes("Bottom") ? y = I - a : y = (I - a) / 2, { scaleX: D, scaleY: o, tx: M, ty: y };
5439
+ return B.includes("Left") ? M = 0 : B.includes("Right") ? M = A - s : M = (A - s) / 2, B.includes("Top") ? y = 0 : B.includes("Bottom") ? y = I - a : y = (I - a) / 2, { scaleX: D, scaleY: w, tx: M, ty: y };
5413
5440
  }
5414
5441
  mapFontWeight(A) {
5415
5442
  const I = A.toLowerCase();
@@ -5422,17 +5449,17 @@ class WC {
5422
5449
  console.warn("No state for object:", I.id);
5423
5450
  return;
5424
5451
  }
5425
- A.roundRect || (A.roundRect = (k, F, R, U, c) => (this.drawRoundRect(A, k, F, R, U, c), A));
5452
+ A.roundRect || (A.roundRect = (S, F, U, R, c) => (this.drawRoundRect(A, S, F, U, R, c), A));
5426
5453
  const Q = g.geometry ? { ...I.geometry, ...g.geometry } : I.geometry, B = g.style ? { ...I.style, ...g.style } : I.style;
5427
5454
  if (g.visible === !1)
5428
5455
  return;
5429
- const D = Q.width || 0, o = Q.height || 0, w = g.x, h = g.y;
5456
+ const D = Q.width || 0, w = Q.height || 0, o = g.x, h = g.y;
5430
5457
  A.save();
5431
- const G = A.globalAlpha, K = g.opacity !== void 0 ? g.opacity : 1;
5432
- A.globalAlpha = G * K;
5458
+ const G = A.globalAlpha, s = g.opacity !== void 0 ? g.opacity : 1;
5459
+ A.globalAlpha = G * s;
5433
5460
  const a = g.compositeOperation || g.blendMode;
5434
5461
  if (a && a !== "Normal") {
5435
- const k = a.toLowerCase();
5462
+ const S = a.toLowerCase();
5436
5463
  [
5437
5464
  "multiply",
5438
5465
  "screen",
@@ -5462,65 +5489,65 @@ class WC {
5462
5489
  "xor",
5463
5490
  "multiply",
5464
5491
  "screen"
5465
- ].includes(k) && (A.globalCompositeOperation = k);
5492
+ ].includes(S) && (A.globalCompositeOperation = S);
5466
5493
  }
5467
- if (A.translate(w, h), A.rotate(g.rotation * Math.PI / 180), A.scale(g.scale_x, g.scale_y), Q.type === "Text") {
5468
- let k = Q.text || "";
5494
+ if (A.translate(o, h), A.rotate(g.rotation * Math.PI / 180), A.scale(g.scale_x, g.scale_y), Q.type === "Text") {
5495
+ let S = Q.text || "";
5469
5496
  if (Q.textInputId) {
5470
5497
  const t = this.inputs.get(Q.textInputId);
5471
- t !== void 0 && (k = String(t), g.geometry && g.geometry.type === "Text" && (g.geometry.text = k));
5498
+ t !== void 0 && (S = String(t), g.geometry && g.geometry.type === "Text" && (g.geometry.text = S));
5472
5499
  }
5473
- let F = k || "";
5500
+ let F = S || "";
5474
5501
  Q.segments && Array.isArray(Q.segments) && (F = Q.segments.map((t) => t && t.text ? t.text : "").join(""));
5475
- const R = Q.textCase || "none";
5476
- R === "uppercase" ? F = F.toUpperCase() : R === "lowercase" ? F = F.toLowerCase() : R === "capitalize" && (F = F.replace(/\b\w/g, (t) => t.toUpperCase()));
5477
- let U = ((J = Q.fontWeight) == null ? void 0 : J.toString()) || "400", c = "normal";
5478
- U.toLowerCase().includes("italic") && (c = "italic", U = U.replace(/italic/gi, "").trim() || "400");
5479
- const l = this.mapFontWeight(U), r = Math.max(1, Q.fontSize || 16);
5480
- A.font = `${c} ${l} ${r}px "${Q.fontFamily || "Inter"}", sans-serif`;
5481
- const d = Q.textVerticalAlign || "top";
5482
- let Z = -o / 2;
5483
- d === "middle" || d === "center" ? (A.textBaseline = "middle", Z = 0) : d === "bottom" ? (A.textBaseline = "bottom", Z = o / 2) : (A.textBaseline = "top", Z = -o / 2);
5484
- const q = Q.textAlign || "left";
5485
- A.textAlign = q;
5486
- let gA = -D / 2;
5487
- q === "center" && (gA = 0), q === "right" && (gA = D / 2);
5488
- const v = Q.letterSpacing || 0, j = Q.paragraphSpacing || 0, e = (Q.lineHeight || 1.2) * r, f = (Q.width || D || 200) + 15, b = (t) => {
5489
- if (v === 0) return A.measureText(t).width;
5490
- let H = 0;
5491
- for (let p = 0; p < t.length; p++)
5492
- H += A.measureText(t[p]).width + v;
5493
- return H - v;
5494
- }, L = [], u = String(F || "").split(`
5502
+ const U = Q.textCase || "none";
5503
+ U === "uppercase" ? F = F.toUpperCase() : U === "lowercase" ? F = F.toLowerCase() : U === "capitalize" && (F = F.replace(/\b\w/g, (t) => t.toUpperCase()));
5504
+ let R = ((J = Q.fontWeight) == null ? void 0 : J.toString()) || "400", c = "normal";
5505
+ R.toLowerCase().includes("italic") && (c = "italic", R = R.replace(/italic/gi, "").trim() || "400");
5506
+ const r = this.mapFontWeight(R), n = Math.max(1, Q.fontSize || 16);
5507
+ A.font = `${c} ${r} ${n}px "${Q.fontFamily || "Inter"}", sans-serif`;
5508
+ const p = Q.textVerticalAlign || "top";
5509
+ let Z = -w / 2;
5510
+ p === "middle" || p === "center" ? (A.textBaseline = "middle", Z = 0) : p === "bottom" ? (A.textBaseline = "bottom", Z = w / 2) : (A.textBaseline = "top", Z = -w / 2);
5511
+ const H = Q.textAlign || "left";
5512
+ A.textAlign = H;
5513
+ let X = -D / 2;
5514
+ H === "center" && (X = 0), H === "right" && (X = D / 2);
5515
+ const QA = Q.letterSpacing || 0, SA = Q.paragraphSpacing || 0, wA = (Q.lineHeight || 1.2) * n, v = (Q.width || D || 200) + 15, x = (t) => {
5516
+ if (QA === 0) return A.measureText(t).width;
5517
+ let l = 0;
5518
+ for (let e = 0; e < t.length; e++)
5519
+ l += A.measureText(t[e]).width + QA;
5520
+ return l - QA;
5521
+ }, q = [], b = String(F || "").split(`
5495
5522
  `);
5496
- u.forEach((t, H) => {
5497
- const p = String(t || "").split(" ");
5523
+ b.forEach((t, l) => {
5524
+ const e = String(t || "").split(" ");
5498
5525
  let O = "";
5499
- for (let z = 0; z < p.length; z++) {
5500
- const oA = O + p[z] + " ";
5501
- b(oA.trim()) > f && z > 0 ? (L.push({ text: O.trim(), isParaEnd: !1 }), O = p[z] + " ") : O = oA;
5526
+ for (let _ = 0; _ < e.length; _++) {
5527
+ const BA = O + e[_] + " ";
5528
+ x(BA.trim()) > v && _ > 0 ? (q.push({ text: O.trim(), isParaEnd: !1 }), O = e[_] + " ") : O = BA;
5502
5529
  }
5503
- L.push({ text: O.trim(), isParaEnd: H < u.length - 1 });
5530
+ q.push({ text: O.trim(), isParaEnd: l < b.length - 1 });
5504
5531
  });
5505
- let EA = Z, W = L.length * e;
5506
- if (j > 0) {
5507
- const t = L.filter((H, p) => H.isParaEnd && p < L.length - 1).length;
5508
- W += t * j;
5532
+ let T = Z, Y = q.length * wA;
5533
+ if (SA > 0) {
5534
+ const t = q.filter((l, e) => l.isParaEnd && e < q.length - 1).length;
5535
+ Y += t * SA;
5509
5536
  }
5510
- d === "middle" || d === "center" ? EA -= W / 2 - r / 2 : d === "bottom" && (EA -= W - r);
5511
- const X = (t, H, p, O, z) => {
5512
- var oA, AA;
5513
- if (v === 0 && (Q.enableSegments !== !0 || !Q.segments || Q.segments.length === 0))
5514
- O ? A.strokeText(t, H, p) : A.fillText(t, H, p);
5537
+ p === "middle" || p === "center" ? T -= Y / 2 - n / 2 : p === "bottom" && (T -= Y - n);
5538
+ const f = (t, l, e, O, _) => {
5539
+ var BA, V;
5540
+ if (QA === 0 && (Q.enableSegments !== !0 || !Q.segments || Q.segments.length === 0))
5541
+ O ? A.strokeText(t, l, e) : A.fillText(t, l, e);
5515
5542
  else {
5516
- const iA = b(t);
5517
- let BA = H;
5518
- q === "center" ? BA -= iA / 2 : q === "right" && (BA -= iA);
5519
- let GA = BA;
5520
- for (let KA = 0; KA < t.length; KA++) {
5521
- const RA = t[KA];
5543
+ const gA = x(t);
5544
+ let u = l;
5545
+ H === "center" ? u -= gA / 2 : H === "right" && (u -= gA);
5546
+ let iA = u;
5547
+ for (let sA = 0; sA < t.length; sA++) {
5548
+ const RA = t[sA];
5522
5549
  if (Q.enableSegments === !0 && Q.segments && Q.segments.length > 0) {
5523
- const LA = z + KA;
5550
+ const LA = _ + sA;
5524
5551
  let JA = 0;
5525
5552
  const DA = Q.segments.find((tA) => {
5526
5553
  if (!tA || typeof tA.text != "string") return !1;
@@ -5529,124 +5556,124 @@ class WC {
5529
5556
  });
5530
5557
  if (DA) {
5531
5558
  if (DA.fill) {
5532
- const tA = ((AA = (oA = g == null ? void 0 : g.style) == null ? void 0 : oA.fill) == null ? void 0 : AA.color) || null;
5559
+ const tA = ((V = (BA = g == null ? void 0 : g.style) == null ? void 0 : BA.fill) == null ? void 0 : V.color) || null;
5533
5560
  O ? A.strokeStyle = DA.fill.color || A.strokeStyle : A.fillStyle = tA || DA.fill.color || A.fillStyle;
5534
5561
  }
5535
5562
  if (DA.fontSize || DA.fontFamily || DA.fontWeight) {
5536
- const tA = DA.fontWeight ? this.mapFontWeight(DA.fontWeight.toString()) : l, iI = DA.fontSize || r, sg = DA.fontFamily || Q.fontFamily || "Inter";
5563
+ const tA = DA.fontWeight ? this.mapFontWeight(DA.fontWeight.toString()) : r, iI = DA.fontSize || n, sg = DA.fontFamily || Q.fontFamily || "Inter";
5537
5564
  A.font = `${c} ${tA} ${iI}px "${sg}", sans-serif`;
5538
5565
  }
5539
5566
  }
5540
5567
  }
5541
- O ? A.strokeText(RA, GA, p) : A.fillText(RA, GA, p), Q.enableSegments === !0 && Q.segments && Q.segments.length > 0 && (A.font = `${c} ${l} ${r}px "${Q.fontFamily || "Inter"}", sans-serif`), GA += A.measureText(RA).width + v;
5568
+ O ? A.strokeText(RA, iA, e) : A.fillText(RA, iA, e), Q.enableSegments === !0 && Q.segments && Q.segments.length > 0 && (A.font = `${c} ${r} ${n}px "${Q.fontFamily || "Inter"}", sans-serif`), iA += A.measureText(RA).width + QA;
5542
5569
  }
5543
5570
  }
5544
5571
  };
5545
5572
  if (B.fill) {
5546
- const t = A.globalAlpha, H = this.createCanvasFill(A, B.fill, D, o);
5547
- A.fillStyle = H || B.fill.color || "#000000", A.globalAlpha = t * (B.fill.opacity ?? 1);
5548
- let p = 0, O = EA;
5549
- L.forEach((z) => {
5550
- const oA = F.indexOf(z.text, p);
5551
- oA !== -1 && (X(z.text, gA, O, !1, oA), p = oA + z.text.length, O += e + (z.isParaEnd ? j : 0));
5573
+ const t = A.globalAlpha, l = this.createCanvasFill(A, B.fill, D, w);
5574
+ A.fillStyle = l || B.fill.color || "#000000", A.globalAlpha = t * (B.fill.opacity ?? 1);
5575
+ let e = 0, O = T;
5576
+ q.forEach((_) => {
5577
+ const BA = F.indexOf(_.text, e);
5578
+ BA !== -1 && (f(_.text, X, O, !1, BA), e = BA + _.text.length, O += wA + (_.isParaEnd ? SA : 0));
5552
5579
  }), A.globalAlpha = t;
5553
5580
  }
5554
5581
  if (B.stroke && B.stroke.width > 0) {
5555
5582
  const t = A.globalAlpha;
5556
5583
  A.strokeStyle = B.stroke.color, A.lineWidth = B.stroke.width, A.globalAlpha = t * (B.stroke.opacity ?? 1);
5557
- let H = 0, p = EA;
5558
- L.forEach((O) => {
5559
- const z = F.indexOf(O.text, H);
5560
- z !== -1 && (X(O.text, gA, p, !0, z), H = z + O.text.length, p += e + (O.isParaEnd ? j : 0));
5584
+ let l = 0, e = T;
5585
+ q.forEach((O) => {
5586
+ const _ = F.indexOf(O.text, l);
5587
+ _ !== -1 && (f(O.text, X, e, !0, _), l = _ + O.text.length, e += wA + (O.isParaEnd ? SA : 0));
5561
5588
  }), A.globalAlpha = t;
5562
5589
  }
5563
5590
  } else if (Q.type === "Image") {
5564
- const k = Q.src;
5565
- if (k) {
5566
- let F = this.imageCache.get(k);
5591
+ const S = Q.src;
5592
+ if (S) {
5593
+ let F = this.imageCache.get(S);
5567
5594
  if (F || (F = new Image(), F.onload = () => {
5568
5595
  }, F.onerror = () => {
5569
- console.error(`[ExodeUI] Image load failed: ${k.substring(0, 100)}${k.length > 100 ? "..." : ""}`);
5570
- }, F.src = k, this.imageCache.set(k, F)), F.complete && F.naturalWidth > 0) {
5571
- const R = Q.corner_radius ?? Q.cornerRadius ?? 0;
5572
- R !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: R }, D, o), A.clip(), A.drawImage(F, -D / 2, -o / 2, D, o), A.restore()) : A.drawImage(F, -D / 2, -o / 2, D, o);
5596
+ console.error(`[ExodeUI] Image load failed: ${S.substring(0, 100)}${S.length > 100 ? "..." : ""}`);
5597
+ }, F.src = S, this.imageCache.set(S, F)), F.complete && F.naturalWidth > 0) {
5598
+ const U = Q.corner_radius ?? Q.cornerRadius ?? 0;
5599
+ U !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: U }, D, w), A.clip(), A.drawImage(F, -D / 2, -w / 2, D, w), A.restore()) : A.drawImage(F, -D / 2, -w / 2, D, w);
5573
5600
  }
5574
5601
  }
5575
5602
  } else if (Q.type === "SVG") {
5576
- const k = Q.svgContent;
5577
- if (k) {
5578
- const F = B.palette || [], R = I.id + "_" + F.join("_");
5579
- let U = this.imageCache.get(R);
5580
- if (!U) {
5581
- U = new Image();
5582
- let c = k;
5583
- Q.colors && Q.colors.length > 0 && F.length > 0 && Q.colors.forEach((d, Z) => {
5603
+ const S = Q.svgContent;
5604
+ if (S) {
5605
+ const F = B.palette || [], U = I.id + "_" + F.join("_");
5606
+ let R = this.imageCache.get(U);
5607
+ if (!R) {
5608
+ R = new Image();
5609
+ let c = S;
5610
+ Q.colors && Q.colors.length > 0 && F.length > 0 && Q.colors.forEach((p, Z) => {
5584
5611
  if (F[Z]) {
5585
- const q = d.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), gA = new RegExp(q, "gi");
5586
- c = c.replace(gA, F[Z]);
5612
+ const H = p.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), X = new RegExp(H, "gi");
5613
+ c = c.replace(X, F[Z]);
5587
5614
  }
5588
5615
  });
5589
- const l = new Blob([c], { type: "image/svg+xml" }), r = URL.createObjectURL(l);
5590
- U.src = r, this.imageCache.set(R, U);
5616
+ const r = new Blob([c], { type: "image/svg+xml" }), n = URL.createObjectURL(r);
5617
+ R.src = n, this.imageCache.set(U, R);
5591
5618
  }
5592
- if (U.complete && U.naturalWidth > 0) {
5619
+ if (R.complete && R.naturalWidth > 0) {
5593
5620
  const c = Q.corner_radius ?? Q.cornerRadius ?? 0;
5594
- c !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: c }, D, o), A.clip(), A.drawImage(U, -D / 2, -o / 2, D, o), A.restore()) : A.drawImage(U, -D / 2, -o / 2, D, o);
5621
+ c !== 0 ? (A.save(), this.applyPath(A, { type: "Rectangle", corner_radius: c }, D, w), A.clip(), A.drawImage(R, -D / 2, -w / 2, D, w), A.restore()) : A.drawImage(R, -D / 2, -w / 2, D, w);
5595
5622
  }
5596
5623
  }
5597
5624
  } else if (Q.type === "LineGraph")
5598
- this.renderLineGraph(A, Q, D, o);
5625
+ this.renderLineGraph(A, Q, D, w);
5599
5626
  else if (I.type === "Shape") {
5600
- if (this.applyPath(A, Q, D, o), A.save(), B.shadow && B.shadow.opacity > 0) {
5627
+ if (this.applyPath(A, Q, D, w), A.save(), B.shadow && B.shadow.opacity > 0) {
5601
5628
  if (A.shadowColor = B.shadow.color, B.shadow.opacity < 1 && B.shadow.color.startsWith("#")) {
5602
- const k = parseInt(B.shadow.color.slice(1, 3), 16), F = parseInt(B.shadow.color.slice(3, 5), 16), R = parseInt(B.shadow.color.slice(5, 7), 16);
5603
- A.shadowColor = `rgba(${k}, ${F}, ${R}, ${B.shadow.opacity})`;
5629
+ const S = parseInt(B.shadow.color.slice(1, 3), 16), F = parseInt(B.shadow.color.slice(3, 5), 16), U = parseInt(B.shadow.color.slice(5, 7), 16);
5630
+ A.shadowColor = `rgba(${S}, ${F}, ${U}, ${B.shadow.opacity})`;
5604
5631
  }
5605
5632
  A.shadowBlur = B.shadow.blur, A.shadowOffsetX = B.shadow.offsetX, A.shadowOffsetY = B.shadow.offsetY;
5606
5633
  }
5607
5634
  if (B.blur && B.blur.amount > 0 && (A.filter = `blur(${B.blur.amount}px)`), B.fill) {
5608
- const k = A.globalAlpha, F = this.createCanvasFill(A, B.fill, D, o);
5609
- F ? A.fillStyle = F : A.fillStyle = B.fill.color || "transparent", A.globalAlpha = k * (B.fill.opacity ?? 1), A.fill(), A.globalAlpha = k;
5635
+ const S = A.globalAlpha, F = this.createCanvasFill(A, B.fill, D, w);
5636
+ F ? A.fillStyle = F : A.fillStyle = B.fill.color || "transparent", A.globalAlpha = S * (B.fill.opacity ?? 1), A.fill(), A.globalAlpha = S;
5610
5637
  }
5611
5638
  if (B.stroke && B.stroke.width > 0) {
5612
- const k = A.globalAlpha;
5613
- A.strokeStyle = B.stroke.color, A.lineWidth = B.stroke.width, A.globalAlpha = k * (B.stroke.opacity ?? 1), A.stroke(), A.globalAlpha = k;
5639
+ const S = A.globalAlpha;
5640
+ A.strokeStyle = B.stroke.color, A.lineWidth = B.stroke.width, A.globalAlpha = S * (B.stroke.opacity ?? 1), A.stroke(), A.globalAlpha = S;
5614
5641
  }
5615
5642
  A.restore();
5616
5643
  } else if (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) {
5617
- const k = g.width !== void 0 ? g.width : I.width || D, F = g.height !== void 0 ? g.height : I.height || o, R = g.cornerRadius !== void 0 ? g.cornerRadius : I.cornerRadius ?? I.corner_radius ?? 0;
5644
+ const S = g.width !== void 0 ? g.width : I.width || D, F = g.height !== void 0 ? g.height : I.height || w, U = g.cornerRadius !== void 0 ? g.cornerRadius : I.cornerRadius ?? I.corner_radius ?? 0;
5618
5645
  if (A.save(), B.shadow && B.shadow.opacity > 0) {
5619
5646
  if (A.shadowColor = B.shadow.color, B.shadow.opacity < 1 && B.shadow.color.startsWith("#")) {
5620
- const c = parseInt(B.shadow.color.slice(1, 3), 16), l = parseInt(B.shadow.color.slice(3, 5), 16), r = parseInt(B.shadow.color.slice(5, 7), 16);
5621
- A.shadowColor = `rgba(${c}, ${l}, ${r}, ${B.shadow.opacity})`;
5647
+ const c = parseInt(B.shadow.color.slice(1, 3), 16), r = parseInt(B.shadow.color.slice(3, 5), 16), n = parseInt(B.shadow.color.slice(5, 7), 16);
5648
+ A.shadowColor = `rgba(${c}, ${r}, ${n}, ${B.shadow.opacity})`;
5622
5649
  }
5623
5650
  A.shadowBlur = B.shadow.blur, A.shadowOffsetX = B.shadow.offsetX, A.shadowOffsetY = B.shadow.offsetY;
5624
5651
  }
5625
- if (A.beginPath(), A.roundRect(-k / 2, -F / 2, k, F, R), B.fill && B.fill.type !== "None") {
5626
- const c = A.globalAlpha, l = this.createCanvasFill(A, B.fill, k, F);
5627
- A.fillStyle = l || B.fill.color || "transparent", A.globalAlpha = c * (B.fill.opacity ?? 1), A.fill(), A.globalAlpha = c;
5652
+ if (A.beginPath(), A.roundRect(-S / 2, -F / 2, S, F, U), B.fill && B.fill.type !== "None") {
5653
+ const c = A.globalAlpha, r = this.createCanvasFill(A, B.fill, S, F);
5654
+ A.fillStyle = r || B.fill.color || "transparent", A.globalAlpha = c * (B.fill.opacity ?? 1), A.fill(), A.globalAlpha = c;
5628
5655
  }
5629
5656
  if (B.stroke && B.stroke.width > 0 && B.stroke.isEnabled !== !1) {
5630
5657
  const c = A.globalAlpha;
5631
5658
  A.strokeStyle = B.stroke.color || "#000000", A.lineWidth = B.stroke.width, A.globalAlpha = c * (B.stroke.opacity ?? 1), A.stroke(), A.globalAlpha = c;
5632
5659
  }
5633
- A.restore(), (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0 && (A.save(), A.beginPath(), A.roundRect(-k / 2, -F / 2, k, F, R), A.clip());
5660
+ A.restore(), (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0 && (A.save(), A.beginPath(), A.roundRect(-S / 2, -F / 2, S, F, U), A.clip());
5634
5661
  } 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 === "Toggle" || I.type === "Component" && I.variant === "toggle" ? this.renderToggle(A, I) : I.type === "Slider" || I.type === "Component" && I.variant === "slider" ? this.renderSlider(A, I) : I.type === "Dropdown" || I.type === "Component" && I.variant === "dropdown" ? this.renderDropdown(A, I) : (I.type === "ListView" || I.type === "Component" && I.variant === "listview") && this.renderListView(A, I);
5635
5662
  const M = (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) && (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0;
5636
5663
  if (I.children && I.children.length > 0) {
5637
- let k = 0;
5664
+ let S = 0;
5638
5665
  for (I.children.forEach((F) => {
5639
- const R = C.get(F);
5640
- if (!R) return;
5641
- const U = this.objectStates.get(F), c = (U == null ? void 0 : U.geometry) || R.geometry;
5642
- if (c && c.isMask && (U == null ? void 0 : U.visible) !== !1) {
5666
+ const U = C.get(F);
5667
+ if (!U) return;
5668
+ const R = this.objectStates.get(F), c = (R == null ? void 0 : R.geometry) || U.geometry;
5669
+ if (c && c.isMask && (R == null ? void 0 : R.visible) !== !1) {
5643
5670
  A.save(), this.applyObjectTransform(A, F);
5644
- const l = c.width || 0, r = c.height || 0;
5645
- this.applyPath(A, c, l, r), A.clip(), k++;
5671
+ const r = c.width || 0, n = c.height || 0;
5672
+ this.applyPath(A, c, r, n), A.clip(), S++;
5646
5673
  } else
5647
- this.renderObject(A, R, C);
5648
- }); k > 0; )
5649
- A.restore(), k--;
5674
+ this.renderObject(A, U, C);
5675
+ }); S > 0; )
5676
+ A.restore(), S--;
5650
5677
  }
5651
5678
  const y = I.clipsContent !== !1 || I.clipContent === !0;
5652
5679
  (M || y) && M && A.restore(), A.restore();
@@ -5665,9 +5692,9 @@ class WC {
5665
5692
  A.moveTo(0, -g / 2), A.lineTo(C / 2, g / 2), A.lineTo(-C / 2, g / 2), A.closePath();
5666
5693
  else if (I.type === "Star") {
5667
5694
  const Q = I.inner_radius || 20, B = I.outer_radius || 50, D = I.points || 5;
5668
- for (let o = 0; o < D * 2; o++) {
5669
- const w = o * Math.PI / D - Math.PI / 2, h = o % 2 === 0 ? B : Q, G = h * Math.cos(w), K = h * Math.sin(w);
5670
- o === 0 ? A.moveTo(G, K) : A.lineTo(G, K);
5695
+ for (let w = 0; w < D * 2; w++) {
5696
+ const o = w * Math.PI / D - Math.PI / 2, h = w % 2 === 0 ? B : Q, G = h * Math.cos(o), s = h * Math.sin(o);
5697
+ w === 0 ? A.moveTo(G, s) : A.lineTo(G, s);
5671
5698
  }
5672
5699
  A.closePath();
5673
5700
  } else I.type === "Path" && I.points && (I.points.forEach((Q, B) => {
@@ -5675,202 +5702,207 @@ class WC {
5675
5702
  }), I.is_closed && A.closePath());
5676
5703
  }
5677
5704
  renderInputBox(A, I) {
5678
- var z, oA;
5679
- const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((z = I.geometry) == null ? void 0 : z.width) || 250, B = ((oA = I.geometry) == null ? void 0 : oA.height) || 45, D = this.focusedId === I.id, o = this.lastHoveredObjectId === I.id, w = g.previewState || "default", h = w !== "default" ? w : D ? "focused" : o ? "hovered" : "default", G = g.label || { visible: !0, text: "Label" }, K = g.helperText || { visible: !1, text: "Helper text" }, a = g.leftIcon || { visible: !1 }, M = g.rightIcon || { visible: !1 }, y = g.multiline === !0, J = g.cornerRadius ?? 8, k = g.corners || { tl: J, tr: J, bl: J, br: J }, F = [k.tl, k.tr, k.br, k.bl];
5680
- let R = g.backgroundColor || "rgba(31, 41, 55, 1)", U = g.borderColor || "rgba(55, 65, 81, 1)", c = g.borderWidth ?? 1.5, l = g.color || "#ffffff", r = g.placeholderColor || "rgba(156, 163, 175, 1)", d = g.fontSize || 14;
5681
- const Z = `${h}Style`, q = g[Z];
5682
- q ? (q.backgroundColor !== void 0 && (R = q.backgroundColor), q.borderColor !== void 0 && (U = q.borderColor), q.borderWidth !== void 0 && (c = q.borderWidth), q.color !== void 0 && (l = q.color), q.placeholderColor !== void 0 && (r = q.placeholderColor), q.fontSize !== void 0 && (d = q.fontSize)) : h === "focused" ? (U = g.focusBorderColor || "rgba(59, 130, 246, 1)", c = Math.max(c, 2)) : h === "hovered" || h === "hover" ? (U = g.hoverBorderColor || U, R = g.hoverBackgroundColor || R) : h === "disabled" ? (R = g.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", U = g.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : h === "error" && (U = "rgba(239, 68, 68, 1)", c = Math.max(c, 2)), A.beginPath(), A.roundRect(-Q / 2, -B / 2, Q, B, F), A.fillStyle = R, A.fill(), c > 0 && (A.strokeStyle = U, A.lineWidth = c, A.stroke(), (h === "focused" || h === "focus") && (A.save(), A.beginPath(), A.roundRect(-Q / 2 - 2, -B / 2 - 2, Q + 4, B + 4, F.map((AA) => AA + 2)), A.strokeStyle = "rgba(59, 130, 246, 0.3)", A.lineWidth = 2, A.stroke(), A.restore()));
5683
- const gA = (AA, iA) => {
5684
- if (!AA.visible || !AA.svgPath) return;
5685
- const BA = AA.size || 14, GA = AA.offset ?? 16, KA = AA.color || "#ffffff", RA = iA ? -(Q / 2) + GA : Q / 2 - GA, LA = AA.svgPath;
5705
+ var _, BA;
5706
+ const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((_ = I.geometry) == null ? void 0 : _.width) || 250, B = ((BA = I.geometry) == null ? void 0 : BA.height) || 45, D = this.focusedId === I.id, w = this.lastHoveredObjectId === I.id, o = g.previewState || "default", h = o !== "default" ? o : D ? "focused" : w ? "hovered" : "default", G = g.label || { visible: !0, text: "Label" }, s = g.helperText || { visible: !1, text: "Helper text" }, a = g.leftIcon || { visible: !1 }, M = g.rightIcon || { visible: !1 }, y = g.multiline === !0, J = g.cornerRadius ?? 8, S = g.corners || { tl: J, tr: J, bl: J, br: J }, F = [S.tl, S.tr, S.br, S.bl];
5707
+ let U = g.backgroundColor || "rgba(31, 41, 55, 1)", R = g.borderColor || "rgba(55, 65, 81, 1)", c = g.borderWidth ?? 1.5, r = g.color || "#ffffff", n = g.placeholderColor || "rgba(156, 163, 175, 1)", p = g.fontSize || 14;
5708
+ const Z = `${h}Style`, H = g[Z];
5709
+ H ? (H.backgroundColor !== void 0 && (U = H.backgroundColor), H.borderColor !== void 0 && (R = H.borderColor), H.borderWidth !== void 0 && (c = H.borderWidth), H.color !== void 0 && (r = H.color), H.placeholderColor !== void 0 && (n = H.placeholderColor), H.fontSize !== void 0 && (p = H.fontSize)) : h === "focused" ? (R = g.focusBorderColor || "rgba(59, 130, 246, 1)", c = Math.max(c, 2)) : h === "hovered" || h === "hover" ? (R = g.hoverBorderColor || R, U = g.hoverBackgroundColor || U) : h === "disabled" ? (U = g.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", R = g.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : h === "error" && (R = "rgba(239, 68, 68, 1)", c = Math.max(c, 2)), A.beginPath(), A.roundRect(-Q / 2, -B / 2, Q, B, F), A.fillStyle = U, A.fill(), c > 0 && (A.strokeStyle = R, A.lineWidth = c, A.stroke(), (h === "focused" || h === "focus") && (A.save(), A.beginPath(), A.roundRect(-Q / 2 - 2, -B / 2 - 2, Q + 4, B + 4, F.map((V) => V + 2)), A.strokeStyle = "rgba(59, 130, 246, 0.3)", A.lineWidth = 2, A.stroke(), A.restore()));
5710
+ const X = (V, gA) => {
5711
+ if (!V.visible || !V.svgPath) return;
5712
+ const u = V.size || 14, iA = V.offset ?? 16, sA = V.color || "#ffffff", RA = gA ? -(Q / 2) + iA : Q / 2 - iA, LA = V.svgPath;
5686
5713
  if (A.save(), A.translate(RA, 0), !LA.startsWith("<svg")) {
5687
- const JA = new Path2D(LA), DA = BA / 24;
5688
- A.scale(DA, DA), A.translate(-12, -12), A.fillStyle = KA, A.fill(JA);
5714
+ const JA = new Path2D(LA), DA = u / 24;
5715
+ A.scale(DA, DA), A.translate(-12, -12), A.fillStyle = sA, A.fill(JA);
5689
5716
  }
5690
5717
  A.restore();
5691
5718
  };
5692
- gA(a, !0), gA(M, !1);
5693
- const v = g.text || "", j = g.placeholder || "Enter text...", e = !v, f = v || j, b = e ? r : l, L = d, u = g.fontFamily || "Inter", EA = g.fontWeight || 400;
5694
- A.font = `${EA} ${L}px "${u}", sans-serif`, A.fillStyle = b, A.textAlign = "left", A.textBaseline = y ? "top" : "middle";
5695
- const W = g.inputPadding ?? 16, X = a.visible ? (a.offset ?? 16) + (a.size || 14) / 2 + 8 : W, t = M.visible ? (M.offset ?? 16) + (M.size || 14) / 2 + 8 : W, H = -(Q / 2) + X, p = Q - X - t, O = g.inputType === "password" ? "•".repeat(f.length) : f;
5696
- if (A.save(), A.beginPath(), A.rect(H - 2, -B / 2 + 4, p + 4, B - 8), A.clip(), y) {
5697
- const AA = O.split(`
5719
+ X(a, !0), X(M, !1);
5720
+ const QA = g.text || "", SA = g.placeholder || "Enter text...", wA = !QA, v = QA || SA, x = wA ? n : r, q = p, b = g.fontFamily || "Inter", T = g.fontWeight || 400;
5721
+ A.font = `${T} ${q}px "${b}", sans-serif`, A.fillStyle = x, A.textAlign = "left", A.textBaseline = y ? "top" : "middle";
5722
+ const Y = g.inputPadding ?? 16, f = a.visible ? (a.offset ?? 16) + (a.size || 14) / 2 + 8 : Y, t = M.visible ? (M.offset ?? 16) + (M.size || 14) / 2 + 8 : Y, l = -(Q / 2) + f, e = Q - f - t, O = g.inputType === "password" ? "•".repeat(v.length) : v;
5723
+ if (A.save(), A.beginPath(), A.rect(l - 2, -B / 2 + 4, e + 4, B - 8), A.clip(), y) {
5724
+ const V = O.split(`
5698
5725
  `);
5699
- let iA = -B / 2 + W;
5700
- const BA = L * 1.2;
5701
- let GA = 0;
5702
- AA.forEach((KA, RA) => {
5703
- const LA = KA.split(" ");
5726
+ let gA = -B / 2 + Y;
5727
+ const u = q * 1.2;
5728
+ let iA = 0;
5729
+ V.forEach((sA, RA) => {
5730
+ const LA = sA.split(" ");
5704
5731
  let JA = "";
5705
5732
  for (let DA = 0; DA < LA.length; DA++) {
5706
5733
  const tA = JA + LA[DA] + " ";
5707
- A.measureText(tA).width > p && DA > 0 ? (A.fillText(JA, H, iA), JA = LA[DA] + " ", iA += BA) : JA = tA;
5734
+ A.measureText(tA).width > e && DA > 0 ? (A.fillText(JA, l, gA), JA = LA[DA] + " ", gA += u) : JA = tA;
5708
5735
  }
5709
- A.fillText(JA, H, iA), GA = A.measureText(JA).width, RA < AA.length - 1 && (iA += BA, GA = 0);
5710
- }), D && !e && Math.floor(performance.now() / 500) % 2 === 0 && A.fillRect(H + GA, iA, 1.5, L);
5736
+ A.fillText(JA, l, gA), iA = A.measureText(JA).width, RA < V.length - 1 && (gA += u, iA = 0);
5737
+ }), D && !wA && Math.floor(performance.now() / 500) % 2 === 0 && A.fillRect(l + iA, gA, 1.5, q);
5711
5738
  } else {
5712
- const iA = A.measureText(O).width;
5713
- let BA = 0;
5714
- if (iA > p && (BA = iA - p), A.fillText(O, H - BA, 0), D && !e && Math.floor(performance.now() / 500) % 2 === 0) {
5715
- const KA = H + iA - BA;
5716
- A.fillRect(KA, -(L / 2), 1.5, L);
5739
+ const gA = A.measureText(O).width;
5740
+ let u = 0;
5741
+ if (gA > e && (u = gA - e), A.fillText(O, l - u, 0), D && !wA && Math.floor(performance.now() / 500) % 2 === 0) {
5742
+ const sA = l + gA - u;
5743
+ A.fillRect(sA, -(q / 2), 1.5, q);
5717
5744
  }
5718
5745
  }
5719
5746
  if (A.restore(), G.visible !== !1) {
5720
- const AA = G.text || "Label", iA = G.fontSize || 12, BA = G.color || "rgba(156, 163, 175, 1)", GA = G.offset ?? 8;
5721
- A.font = `600 ${iA}px "${u}", sans-serif`, A.fillStyle = BA, A.textAlign = "left", A.textBaseline = "bottom";
5722
- const KA = -(Q / 2), RA = -(B / 2) - GA;
5723
- A.fillText(AA, KA, RA);
5747
+ const V = G.text || "Label", gA = G.fontSize || 12, u = G.color || "rgba(156, 163, 175, 1)", iA = G.offset ?? 8;
5748
+ A.font = `600 ${gA}px "${b}", sans-serif`, A.fillStyle = u, A.textAlign = "left", A.textBaseline = "bottom";
5749
+ const sA = -(Q / 2), RA = -(B / 2) - iA;
5750
+ A.fillText(V, sA, RA);
5724
5751
  }
5725
- if (K.visible === !0) {
5726
- const AA = K.text || "Helper text", iA = K.fontSize || 11, BA = h === "error" ? "rgba(239, 68, 68, 1)" : K.color || "rgba(156, 163, 175, 1)", GA = K.offset ?? 6;
5727
- A.font = `400 ${iA}px "${u}", sans-serif`, A.fillStyle = BA, A.textAlign = "left", A.textBaseline = "top";
5728
- const KA = -(Q / 2), RA = B / 2 + GA;
5729
- A.fillText(AA, KA, RA);
5752
+ if (s.visible === !0) {
5753
+ const V = s.text || "Helper text", gA = s.fontSize || 11, u = h === "error" ? "rgba(239, 68, 68, 1)" : s.color || "rgba(156, 163, 175, 1)", iA = s.offset ?? 6;
5754
+ A.font = `400 ${gA}px "${b}", sans-serif`, A.fillStyle = u, A.textAlign = "left", A.textBaseline = "top";
5755
+ const sA = -(Q / 2), RA = B / 2 + iA;
5756
+ A.fillText(V, sA, RA);
5730
5757
  }
5731
5758
  }
5732
5759
  renderSlider(A, I) {
5733
- const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.geometry) || I.geometry, Q = (C == null ? void 0 : C.options) || I.options || {}, B = g.width || 200, D = Q.value ?? 50, o = Q.min ?? 0, h = (Q.max ?? 100) - o, G = h === 0 ? 0 : (D - o) / h, K = Q.trackHeight || 4, a = Q.trackRoundedness ?? 2, M = Q.trackShape ?? "Rectangle", y = Q.trackPath || "", J = Q.activeColor || "#3b82f6", k = Q.inactiveColor || "#374151", F = Q.thumbShape || "Ellipse", R = Q.thumbWidth ?? 16, U = Q.thumbHeight ?? 16, c = Q.thumbRoundedness ?? 0, l = Q.thumbColor || "#ffffff", r = Q.thumbPath || "", d = Q.thumbIcon || "", Z = Q.showValueTooltip ?? !1, q = Q.tooltipBgColor || "#333333", gA = Q.tooltipColor || "#ffffff", v = Q.tooltipOffsetX ?? 0, j = Q.tooltipOffsetY ?? -25, e = (W, X, t, H, p, O, z) => {
5734
- if ((W === "Custom" || W === "Icon") && z)
5760
+ const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.geometry) || I.geometry, Q = (C == null ? void 0 : C.options) || I.options || {}, B = g.width || 200, D = Q.value ?? 50, w = Q.min ?? 0, h = (Q.max ?? 100) - w, G = h === 0 ? 0 : (D - w) / h, s = Q.trackHeight || 4, a = Q.trackRoundedness ?? 2, M = Q.trackShape ?? "Rectangle", y = Q.trackPath || "", J = Q.activeColor || "#3b82f6", S = Q.inactiveColor || "#374151", F = Q.thumbShape || "Ellipse", U = Q.thumbWidth ?? 16, R = Q.thumbHeight ?? 16, c = Q.thumbRoundedness ?? 0, r = Q.thumbColor || "#ffffff", n = Q.thumbPath || "", p = Q.thumbIcon || "", Z = Q.showValueTooltip ?? !1, H = Q.tooltipBgColor || "#333333", X = Q.tooltipColor || "#ffffff", QA = Q.tooltipOffsetX ?? 0, SA = Q.tooltipOffsetY ?? -25, wA = (Y, f, t, l, e, O, _) => {
5761
+ if ((Y === "Custom" || Y === "Icon") && _)
5735
5762
  try {
5736
- const oA = new Path2D(z);
5737
- if (A.save(), A.translate(X, t), W === "Icon") {
5738
- const AA = Math.min(H, p) / 24;
5739
- A.scale(AA, AA), A.translate(-12, -12);
5763
+ const BA = new Path2D(_);
5764
+ if (A.save(), A.translate(f, t), Y === "Icon") {
5765
+ const V = Math.min(l, e) / 24;
5766
+ A.scale(V, V), A.translate(-12, -12);
5740
5767
  }
5741
- A.fill(oA), A.restore();
5768
+ A.fill(BA), A.restore();
5742
5769
  return;
5743
- } catch (oA) {
5744
- console.error("Error drawing slider shape in engine:", oA);
5770
+ } catch (BA) {
5771
+ console.error("Error drawing slider shape in engine:", BA);
5745
5772
  }
5746
- if (A.beginPath(), W === "Ellipse")
5747
- A.ellipse(X, t, H / 2, p / 2, 0, 0, Math.PI * 2);
5748
- else if (W === "Rectangle")
5749
- A.roundRect(X - H / 2, t - p / 2, H, p, O);
5750
- else if (W === "Triangle")
5751
- A.moveTo(X, t - p / 2), A.lineTo(X + H / 2, t + p / 2), A.lineTo(X - H / 2, t + p / 2), A.closePath();
5752
- else if (W === "Diamond")
5753
- A.moveTo(X, t - p / 2), A.lineTo(X + H / 2, t), A.lineTo(X, t + p / 2), A.lineTo(X - H / 2, t), A.closePath();
5754
- else if (W === "Star") {
5755
- const AA = Math.min(H, p) / 2, iA = AA / 2;
5756
- for (let BA = 0; BA < 5 * 2; BA++) {
5757
- const GA = BA % 2 === 0 ? AA : iA, KA = BA * Math.PI / 5 - Math.PI / 2;
5758
- A.lineTo(X + GA * Math.cos(KA), t + GA * Math.sin(KA));
5773
+ if (A.beginPath(), Y === "Ellipse")
5774
+ A.ellipse(f, t, l / 2, e / 2, 0, 0, Math.PI * 2);
5775
+ else if (Y === "Rectangle")
5776
+ A.roundRect(f - l / 2, t - e / 2, l, e, O);
5777
+ else if (Y === "Triangle")
5778
+ A.moveTo(f, t - e / 2), A.lineTo(f + l / 2, t + e / 2), A.lineTo(f - l / 2, t + e / 2), A.closePath();
5779
+ else if (Y === "Diamond")
5780
+ A.moveTo(f, t - e / 2), A.lineTo(f + l / 2, t), A.lineTo(f, t + e / 2), A.lineTo(f - l / 2, t), A.closePath();
5781
+ else if (Y === "Star") {
5782
+ const V = Math.min(l, e) / 2, gA = V / 2;
5783
+ for (let u = 0; u < 5 * 2; u++) {
5784
+ const iA = u % 2 === 0 ? V : gA, sA = u * Math.PI / 5 - Math.PI / 2;
5785
+ A.lineTo(f + iA * Math.cos(sA), t + iA * Math.sin(sA));
5759
5786
  }
5760
5787
  A.closePath();
5761
- } else W === "Line" && (A.moveTo(X - H / 2, t), A.lineTo(X + H / 2, t));
5788
+ } else Y === "Line" && (A.moveTo(f - l / 2, t), A.lineTo(f + l / 2, t));
5762
5789
  A.fill();
5763
5790
  };
5764
- A.fillStyle = k, M === "Line" ? (A.strokeStyle = k, A.lineWidth = K, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(B / 2, 0), A.stroke()) : e(M, 0, 0, B, K, a, y);
5765
- const f = B * G, b = -B / 2 + f;
5766
- if (f > 0 && (A.fillStyle = J, M === "Line" ? (A.strokeStyle = J, A.lineWidth = K, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(b, 0), A.stroke()) : M === "Rectangle" && (A.beginPath(), A.roundRect(-B / 2, -K / 2, f, K, a), A.fill())), A.save(), A.translate(b, 0), A.shadowColor = "rgba(0,0,0,0.2)", A.shadowBlur = 4, A.shadowOffsetY = 1, A.fillStyle = l, e(F, 0, 0, R, U, c, F === "Icon" ? d : r), A.restore(), Z) {
5767
- A.save(), A.translate(b + v, j);
5768
- const W = Math.round(D).toString();
5791
+ A.fillStyle = S, M === "Line" ? (A.strokeStyle = S, A.lineWidth = s, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(B / 2, 0), A.stroke()) : wA(M, 0, 0, B, s, a, y);
5792
+ const v = B * G, x = -B / 2 + v;
5793
+ if (v > 0 && (A.fillStyle = J, M === "Line" ? (A.strokeStyle = J, A.lineWidth = s, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(x, 0), A.stroke()) : M === "Rectangle" && (A.beginPath(), A.roundRect(-B / 2, -s / 2, v, s, a), A.fill())), A.save(), A.translate(x, 0), A.shadowColor = "rgba(0,0,0,0.2)", A.shadowBlur = 4, A.shadowOffsetY = 1, A.fillStyle = r, wA(F, 0, 0, U, R, c, F === "Icon" ? p : n), A.restore(), Z) {
5794
+ A.save(), A.translate(x + QA, SA);
5795
+ const Y = Math.round(D).toString();
5769
5796
  A.font = "10px Inter, sans-serif";
5770
- const X = A.measureText(W), t = 6, H = 4, p = X.width + t * 2, O = 14 + H;
5771
- A.beginPath(), A.roundRect(-p / 2, -O / 2, p, O, 4), A.fillStyle = q, A.fill(), A.fillStyle = gA, A.textAlign = "center", A.textBaseline = "middle", A.fillText(W, 0, 0), A.restore();
5797
+ const f = A.measureText(Y), t = 6, l = 4, e = f.width + t * 2, O = 14 + l;
5798
+ A.beginPath(), A.roundRect(-e / 2, -O / 2, e, O, 4), A.fillStyle = H, A.fill(), A.fillStyle = X, A.textAlign = "center", A.textBaseline = "middle", A.fillText(Y, 0, 0), A.restore();
5772
5799
  }
5773
- const L = Q.label || {}, u = Q.helperText || {}, EA = Q.fontFamily || "Inter";
5774
- if (L.visible !== !1) {
5775
- const W = L.text || "Label", X = L.fontSize || 12, t = L.color || "rgba(156, 163, 175, 1)", H = L.offset ?? 8;
5776
- A.font = `600 ${X}px "${EA}", sans-serif`, A.fillStyle = t, A.textAlign = "left", A.textBaseline = "bottom";
5777
- const p = -(B / 2), O = -(K / 2) - H;
5778
- A.fillText(W, p, O);
5800
+ const q = Q.label || {}, b = Q.helperText || {}, T = Q.fontFamily || "Inter";
5801
+ if (q.visible !== !1) {
5802
+ const Y = q.text || "Label", f = q.fontSize || 12, t = q.color || "rgba(156, 163, 175, 1)", l = q.offset ?? 8;
5803
+ A.font = `600 ${f}px "${T}", sans-serif`, A.fillStyle = t, A.textAlign = "left", A.textBaseline = "bottom";
5804
+ const e = -(B / 2), O = -(s / 2) - l;
5805
+ A.fillText(Y, e, O);
5779
5806
  }
5780
- if (u.visible === !0) {
5781
- const W = u.text || "Helper text", X = u.fontSize || 11, t = u.color || "rgba(156, 163, 175, 1)", H = u.offset ?? 6;
5782
- A.font = `400 ${X}px "${EA}", sans-serif`, A.fillStyle = t, A.textAlign = "left", A.textBaseline = "top";
5783
- const p = -(B / 2), O = K / 2 + H;
5784
- A.fillText(W, p, O);
5807
+ if (b.visible === !0) {
5808
+ const Y = b.text || "Helper text", f = b.fontSize || 11, t = b.color || "rgba(156, 163, 175, 1)", l = b.offset ?? 6;
5809
+ A.font = `400 ${f}px "${T}", sans-serif`, A.fillStyle = t, A.textAlign = "left", A.textBaseline = "top";
5810
+ const e = -(B / 2), O = s / 2 + l;
5811
+ A.fillText(Y, e, O);
5785
5812
  }
5786
5813
  }
5787
5814
  renderDropdown(A, I) {
5815
+ var wA;
5788
5816
  const C = this.objectStates.get(I.id);
5789
5817
  if (!C) return;
5790
- const g = C.options || I.options || {}, Q = I.geometry.width || 160, B = I.geometry.height || 40, D = -Q / 2, o = -B / 2, w = g.cornerRadius ?? 6, h = g.isOpen || !1, G = g.disabled || !1, K = this.lastHoveredObjectId === I.id;
5791
- let a = g.backgroundColor || "#ffffff", M = g.borderColor || "#e5e7eb", y = g.color || "#333333";
5792
- G ? (a = g.disabledBackgroundColor || "#f3f4f6", M = g.disabledBorderColor || "#e5e7eb", y = g.disabledColor || "#9ca3af") : h ? (a = g.activeBackgroundColor || a, M = g.activeBorderColor || M, y = g.activeColor || y) : K && (a = g.hoverBackgroundColor || a, M = g.hoverBorderColor || M, y = g.hoverColor || y), A.beginPath();
5793
- const J = (v, j, e, f, b, L) => {
5794
- f < 0 && (f = 0), b < 0 && (b = 0), L = Math.min(L, Math.min(f, b) / 2), v.moveTo(j + L, e), v.lineTo(j + f - L, e), v.arcTo(j + f, e, j + f, e + L, L), v.lineTo(j + f, e + b - L), v.arcTo(j + f, e + b, j + f - L, e + b, L), v.lineTo(j + L, e + b), v.arcTo(j, e + b, j, e + b - L, L), v.lineTo(j, e + L), v.arcTo(j, e, j + L, e, L), v.closePath();
5818
+ const g = C.options || I.options || {}, Q = I.geometry.width || 160, B = I.geometry.height || 40, D = -Q / 2, w = -B / 2, o = g.cornerRadius ?? 6, h = g.disabled || g.previewState === "disabled", G = this.lastHoveredObjectId === I.id || g.previewState === "hover", s = (g.isOpen || g.previewState === "active") && !h;
5819
+ let a = g.backgroundColor, M = g.borderColor, y = g.color || "#333333";
5820
+ h ? (a = g.disabledBackgroundColor || "#f3f4f6", M = g.disabledBorderColor || "#e5e7eb", y = g.disabledColor || "#9ca3af") : s ? (a = g.activeBackgroundColor || a, M = g.activeBorderColor || M, y = g.activeColor || y) : G && (a = g.hoverBackgroundColor || a, M = g.hoverBorderColor || M, y = g.hoverColor || y), a || (a = "#ffffff"), M || (M = "#e5e7eb");
5821
+ const J = A.globalAlpha;
5822
+ A.globalAlpha = J * (g.opacity ?? 1), A.beginPath();
5823
+ const S = (v, x, q, b, T, Y) => {
5824
+ b < 0 && (b = 0), T < 0 && (T = 0), Y = Math.min(Y, Math.min(b, T) / 2), v.moveTo(x + Y, q), v.lineTo(x + b - Y, q), v.arcTo(x + b, q, x + b, q + Y, Y), v.lineTo(x + b, q + T - Y), v.arcTo(x + b, q + T, x + b - Y, q + T, Y), v.lineTo(x + Y, q + T), v.arcTo(x, q + T, x, q + T - Y, Y), v.lineTo(x, q + Y), v.arcTo(x, q, x + Y, q, Y), v.closePath();
5795
5825
  };
5796
- J(A, D, o, Q, B, w), A.fillStyle = a, A.fill();
5797
- const k = g.borderWidth ?? 1;
5798
- k > 0 && (A.strokeStyle = M, A.lineWidth = k, A.stroke());
5799
- const F = 12, R = g.chevronType || "chevron", U = g.chevronSize || 16, c = (h ? g.openIconColor : g.closedIconColor) || g.chevronColor || "#6b7280";
5826
+ S(A, D, w, Q, B, o), A.fillStyle = this.createCanvasFill(A, typeof a == "string" ? { type: "Solid", color: a } : a, Q, B) || "#ffffff", A.fill();
5827
+ const F = g.borderWidth ?? 1;
5828
+ F > 0 && (A.strokeStyle = this.createCanvasFill(A, typeof M == "string" ? { type: "Solid", color: M } : M, Q, B) || "#e5e7eb", A.lineWidth = F, A.stroke());
5829
+ const U = 12, R = g.chevronType || "chevron", c = g.chevronSize || 16, r = (s ? g.openIconColor : g.closedIconColor) || g.chevronColor || "#6b7280";
5800
5830
  if (R !== "none") {
5801
- const v = D + Q - F - U / 2;
5831
+ const v = D + Q - U - c / 2;
5802
5832
  A.save(), A.translate(v, 0);
5803
- const j = h ? g.openIconAngle ?? 180 : g.closedIconAngle ?? 0;
5804
- if (A.rotate(j * Math.PI / 180), A.strokeStyle = c, A.fillStyle = c, A.lineWidth = 1.5, A.lineCap = "round", A.lineJoin = "round", R === "chevron")
5805
- A.beginPath(), A.moveTo(-U / 2, -U * 0.2), A.lineTo(0, U * 0.2), A.lineTo(U / 2, -U * 0.2), A.stroke();
5833
+ const x = s ? g.openIconAngle ?? 180 : g.closedIconAngle ?? 0;
5834
+ if (A.rotate(x * Math.PI / 180), A.strokeStyle = r, A.fillStyle = r, A.lineWidth = 1.5, A.lineCap = "round", A.lineJoin = "round", R === "chevron")
5835
+ A.beginPath(), A.moveTo(-c / 2, -c * 0.2), A.lineTo(0, c * 0.2), A.lineTo(c / 2, -c * 0.2), A.stroke();
5806
5836
  else if (R === "custom" || R === "path") {
5807
- const e = h && g.openIconPath || g.closedIconPath;
5808
- if (e) {
5809
- const f = new Path2D(e);
5837
+ const q = s && g.openIconPath || g.closedIconPath;
5838
+ if (q) {
5839
+ const b = new Path2D(q);
5810
5840
  A.save();
5811
- const b = U / 24;
5812
- A.scale(b, b), A.translate(-12, -12), A.fill(f), A.restore();
5841
+ const T = c / 24;
5842
+ A.scale(T, T), A.translate(-12, -12), A.fill(b), A.restore();
5813
5843
  }
5814
5844
  }
5815
5845
  A.restore();
5816
5846
  }
5817
- const l = g.selectedOption || g.placeholder || "Select...", r = g.fontSize || 14, d = g.fontWeight || 400, Z = g.fontFamily || "Inter, sans-serif";
5818
- A.font = `${d} ${r}px ${Z}`, A.fillStyle = !g.selectedOption && g.placeholder ? "#9ca3af" : y, G && (A.fillStyle = g.disabledColor || "#9ca3af"), A.textAlign = "left", A.textBaseline = "middle";
5819
- const q = R === "none" ? 0 : U + 8, gA = Q - F * 2 - q;
5820
- if (A.save(), A.beginPath(), A.rect(D + F, o, gA, B), A.clip(), A.fillText(l, D + F, 0), A.restore(), h && !G) {
5821
- const v = o + B + 4, j = g.optionsList || [], e = g.itemHeight || 32, f = g.listPadding ?? 4, b = j.length * e + f * 2, L = g.listCornerRadius ?? w;
5822
- A.save(), A.shadowColor = "rgba(0,0,0,0.15)", A.shadowBlur = 12, A.shadowOffsetY = 6, A.beginPath(), J(A, D, v, Q, b, L), A.fillStyle = g.listBackgroundColor || "#ffffff", A.fill();
5823
- const u = g.listBorderWidth ?? 1;
5824
- u > 0 && (A.shadowColor = "transparent", A.strokeStyle = g.listBorderColor || M, A.lineWidth = u, A.stroke()), A.restore();
5825
- const EA = g.itemFontSize || r, W = g.itemFontFamily || Z;
5826
- A.font = `${d} ${EA}px ${W}`, j.forEach((X, t) => {
5827
- const H = v + f + t * e;
5828
- if (X === g.selectedOption)
5829
- A.fillStyle = g.itemSelectedBackgroundColor || g.listHoverColor || "#f3f4f6", A.fillRect(D + u, H, Q - u * 2, e), A.fillStyle = g.itemSelectedColor || g.activeColor || y || "#374151";
5847
+ const n = g.selectedOption || g.placeholder || "Select...", p = g.fontSize || 14, Z = g.fontWeight || 400, H = g.fontFamily || "Inter, sans-serif";
5848
+ A.font = `${Z} ${p}px ${H}`;
5849
+ const X = h ? g.disabledColor || "#9ca3af" : !g.selectedOption && g.placeholder ? "#9ca3af" : y;
5850
+ A.fillStyle = this.createCanvasFill(A, typeof X == "string" ? { type: "Solid", color: X } : X, Q, B) || "#333333", A.textAlign = "left", A.textBaseline = "middle";
5851
+ const QA = R === "none" ? 0 : c + 8, SA = Q - U * 2 - QA;
5852
+ if (A.save(), A.beginPath(), A.rect(D + U, w, SA, B), A.clip(), A.fillText(n, D + U, 0), A.restore(), s && !h) {
5853
+ const v = w + B + 4, x = g.optionsList || [], q = g.itemHeight || 32, b = g.listPadding ?? 4, T = x.length * q + b * 2, Y = g.listCornerRadius ?? o;
5854
+ A.save();
5855
+ const f = g.listShadow || {};
5856
+ A.shadowColor = typeof f.color == "string" ? f.color : ((wA = f.color) == null ? void 0 : wA.color) || "rgba(0,0,0,0.15)", A.shadowBlur = f.blur ?? 12, A.shadowOffsetY = f.offsetY ?? 6, A.beginPath(), S(A, D, v, Q, T, Y), A.fillStyle = this.createCanvasFill(A, typeof g.listBackgroundColor == "string" ? { type: "Solid", color: g.listBackgroundColor } : g.listBackgroundColor || { type: "Solid", color: "#ffffff" }, Q, T) || "#ffffff", A.fill();
5857
+ const t = g.listBorderWidth ?? 1;
5858
+ t > 0 && (A.shadowColor = "transparent", A.strokeStyle = this.createCanvasFill(A, typeof g.listBorderColor == "string" ? { type: "Solid", color: g.listBorderColor } : g.listBorderColor || { type: "Solid", color: M }, Q, T) || "#e5e7eb", A.lineWidth = t, A.stroke()), A.restore();
5859
+ const l = g.itemFontSize || p, e = g.itemFontFamily || H;
5860
+ A.font = `${Z} ${l}px ${e}`, x.forEach((O, _) => {
5861
+ const BA = v + b + _ * q;
5862
+ if (O === g.selectedOption)
5863
+ A.fillStyle = this.createCanvasFill(A, typeof g.itemSelectedBackgroundColor == "string" ? { type: "Solid", color: g.itemSelectedBackgroundColor } : g.itemSelectedBackgroundColor || { type: "Solid", color: "#f3f4f6" }, Q, q) || "#f3f4f6", A.fillRect(D + t, BA, Q - t * 2, q), A.fillStyle = g.itemSelectedColor || g.activeColor || y || "#374151";
5830
5864
  else if (A.fillStyle = g.listTextColor || y || "#333333", this.activeDropdownId === I.id && this._lastPointerPos) {
5831
- const O = this.objectStates.get(I.id);
5832
- if (O) {
5833
- const z = this._lastPointerPos.y - (O.y + B / 2 + 4 + f), oA = Math.floor(z / e);
5834
- t === oA && (A.fillStyle = g.itemHoverBackgroundColor || g.listHoverColor || "#f9fafb", A.fillRect(D + u, H, Q - u * 2, e), A.fillStyle = g.itemHoverColor || y);
5835
- }
5865
+ const gA = this._lastPointerPos.y - (v + b), u = Math.floor(gA / q);
5866
+ _ === u && (A.fillStyle = this.createCanvasFill(A, typeof g.itemHoverBackgroundColor == "string" ? { type: "Solid", color: g.itemHoverBackgroundColor } : g.itemHoverBackgroundColor || { type: "Solid", color: "#f9fafb" }, Q, q) || "#f9fafb", A.fillRect(D + t, BA, Q - t * 2, q), A.fillStyle = g.itemHoverColor || y);
5836
5867
  }
5837
- A.fillText(X, D + F, H + e / 2);
5868
+ A.fillText(O, D + U, BA + q / 2);
5838
5869
  });
5839
5870
  }
5871
+ A.globalAlpha = J;
5840
5872
  }
5841
5873
  renderButton(A, I) {
5842
- var R, U, c, l;
5843
- const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((R = I.geometry) == null ? void 0 : R.width) || 120, B = ((U = I.geometry) == null ? void 0 : U.height) || 40, D = -Q / 2, o = -B / 2, w = this.lastHoveredObjectId === I.id, h = g.cornerRadius ?? 8, G = g.bgShape || "Rectangle", K = w ? ((c = g.hoverStyle) == null ? void 0 : c.backgroundColor) || g.buttonBgColor || "#3b82f6" : g.buttonBgColor || "#3b82f6", a = g.label || {}, M = w ? ((l = g.hoverStyle) == null ? void 0 : l.textColor) || a.color || "#ffffff" : a.color || "#ffffff", y = g.icon || { enabled: !1 };
5844
- A.save(), A.beginPath(), G === "Rectangle" ? A.roundRect(D, o, Q, B, h) : G === "Ellipse" || G === "Circle" ? A.ellipse(0, 0, Q / 2, B / 2, 0, 0, Math.PI * 2) : G === "Pill" && A.roundRect(D, o, Q, B, B / 2), A.fillStyle = K, A.fill();
5845
- const J = a.fontSize || 14, k = a.fontFamily || "Inter";
5846
- A.font = `${a.fontWeight || 400} ${J}px "${k}", sans-serif`, A.fillStyle = M, A.textAlign = "center", A.textBaseline = "middle";
5874
+ var U, R, c, r;
5875
+ const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((U = I.geometry) == null ? void 0 : U.width) || 120, B = ((R = I.geometry) == null ? void 0 : R.height) || 40, D = -Q / 2, w = -B / 2, o = this.lastHoveredObjectId === I.id, h = g.cornerRadius ?? 8, G = g.bgShape || "Rectangle", s = o ? ((c = g.hoverStyle) == null ? void 0 : c.backgroundColor) || g.buttonBgColor || "#3b82f6" : g.buttonBgColor || "#3b82f6", a = g.label || {}, M = o ? ((r = g.hoverStyle) == null ? void 0 : r.textColor) || a.color || "#ffffff" : a.color || "#ffffff", y = g.icon || { enabled: !1 };
5876
+ A.save(), A.beginPath(), G === "Rectangle" ? A.roundRect(D, w, Q, B, h) : G === "Ellipse" || G === "Circle" ? A.ellipse(0, 0, Q / 2, B / 2, 0, 0, Math.PI * 2) : G === "Pill" && A.roundRect(D, w, Q, B, B / 2), A.fillStyle = s, A.fill();
5877
+ const J = a.fontSize || 14, S = a.fontFamily || "Inter";
5878
+ A.font = `${a.fontWeight || 400} ${J}px "${S}", sans-serif`, A.fillStyle = M, A.textAlign = "center", A.textBaseline = "middle";
5847
5879
  let F = 0;
5848
5880
  if (y.enabled && y.svgPath) {
5849
- const r = y.size || 16, d = y.gap || 8, Z = y.position === "left" ? -(A.measureText(a.text || "").width / 2 + r / 2 + d / 2) : A.measureText(a.text || "").width / 2 + r / 2 + d / 2;
5881
+ const n = y.size || 16, p = y.gap || 8, Z = y.position === "left" ? -(A.measureText(a.text || "").width / 2 + n / 2 + p / 2) : A.measureText(a.text || "").width / 2 + n / 2 + p / 2;
5850
5882
  A.save(), A.translate(Z, 0);
5851
- const q = new Path2D(y.svgPath), gA = r / 24;
5852
- A.scale(gA, gA), A.translate(-12, -12), A.fillStyle = y.color || M, A.fill(q), A.restore(), F = y.position === "left" ? r / 2 + d / 2 : -(r / 2 + d / 2);
5883
+ const H = new Path2D(y.svgPath), X = n / 24;
5884
+ A.scale(X, X), A.translate(-12, -12), A.fillStyle = y.color || M, A.fill(H), A.restore(), F = y.position === "left" ? n / 2 + p / 2 : -(n / 2 + p / 2);
5853
5885
  }
5854
5886
  A.fillText(a.text || "Button", F, 0), A.restore();
5855
5887
  }
5856
5888
  renderToggleButton(A, I) {
5857
- var J, k;
5858
- const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = g.checked ?? !1, B = ((J = I.geometry) == null ? void 0 : J.width) || 120, D = ((k = I.geometry) == null ? void 0 : k.height) || 40, o = -B / 2, w = -D / 2, h = g.cornerRadius ?? 8, G = g.label || {}, K = Q ? g.activeColor || "#3b82f6" : g.inactiveColor || "#374151", a = Q ? g.activeTextColor || "#ffffff" : g.inactiveTextColor || "#9ca3af";
5859
- A.save(), A.beginPath(), A.roundRect(o, w, B, D, h), A.fillStyle = K, A.fill();
5889
+ var J, S;
5890
+ const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = g.checked ?? !1, B = ((J = I.geometry) == null ? void 0 : J.width) || 120, D = ((S = I.geometry) == null ? void 0 : S.height) || 40, w = -B / 2, o = -D / 2, h = g.cornerRadius ?? 8, G = g.label || {}, s = Q ? g.activeColor || "#3b82f6" : g.inactiveColor || "#374151", a = Q ? g.activeTextColor || "#ffffff" : g.inactiveTextColor || "#9ca3af";
5891
+ A.save(), A.beginPath(), A.roundRect(w, o, B, D, h), A.fillStyle = s, A.fill();
5860
5892
  const M = G.fontSize || 14, y = G.fontFamily || "Inter";
5861
5893
  A.font = `${G.fontWeight || 600} ${M}px "${y}", sans-serif`, A.fillStyle = a, A.textAlign = "center", A.textBaseline = "middle", A.fillText(G.text || "Toggle", 0, 0), A.restore();
5862
5894
  }
5863
5895
  renderToggle(A, I) {
5864
- var F, R;
5865
- const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((F = I.geometry) == null ? void 0 : F.width) || 52, B = ((R = I.geometry) == null ? void 0 : R.height) || 30, D = -Q / 2, o = -B / 2, w = g.checked ?? !1, h = g.cornerRadius ?? B / 2;
5866
- A.beginPath(), A.roundRect(D, o, Q, B, h), A.fillStyle = w ? g.activeColor || "#10b981" : g.inactiveColor || "#374151", g.disabled && (A.globalAlpha *= 0.5), A.fill();
5867
- const G = 3, K = B - G * 2, a = K / 2, M = D + G, y = D + Q - G - K, J = w ? y : M, k = o + G;
5868
- if (A.beginPath(), A.arc(J + a, k + a, a, 0, Math.PI * 2), A.fillStyle = g.knobColor || "#ffffff", A.fill(), g.disabled && (A.globalAlpha *= 2), g.label && g.label.text) {
5869
- const U = g.label, c = U.fontSize || 14, l = U.fontWeight || 400, r = U.fontFamily || "Inter";
5870
- A.font = `${l} ${c}px "${r}", sans-serif`, A.fillStyle = U.color || "#f3f4f6", A.textBaseline = "middle";
5871
- const d = U.gap || 10;
5872
- let Z = 0, q = 0;
5873
- U.position === "left" ? (A.textAlign = "right", Z = D - d, q = 0) : U.position === "right" ? (A.textAlign = "left", Z = D + Q + d, q = 0) : U.position === "top" ? (A.textAlign = "center", Z = 0, q = o - d, A.textBaseline = "bottom") : U.position === "bottom" ? (A.textAlign = "center", Z = 0, q = o + B + d, A.textBaseline = "top") : (A.textAlign = "left", Z = D + Q + d, q = 0), A.fillText(U.text, Z, q);
5896
+ var F, U;
5897
+ const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((F = I.geometry) == null ? void 0 : F.width) || 52, B = ((U = I.geometry) == null ? void 0 : U.height) || 30, D = -Q / 2, w = -B / 2, o = g.checked ?? !1, h = g.cornerRadius ?? B / 2;
5898
+ A.beginPath(), A.roundRect(D, w, Q, B, h), A.fillStyle = o ? g.activeColor || "#10b981" : g.inactiveColor || "#374151", g.disabled && (A.globalAlpha *= 0.5), A.fill();
5899
+ const G = 3, s = B - G * 2, a = s / 2, M = D + G, y = D + Q - G - s, J = o ? y : M, S = w + G;
5900
+ if (A.beginPath(), A.arc(J + a, S + a, a, 0, Math.PI * 2), A.fillStyle = g.knobColor || "#ffffff", A.fill(), g.disabled && (A.globalAlpha *= 2), g.label && g.label.text) {
5901
+ const R = g.label, c = R.fontSize || 14, r = R.fontWeight || 400, n = R.fontFamily || "Inter";
5902
+ A.font = `${r} ${c}px "${n}", sans-serif`, A.fillStyle = R.color || "#f3f4f6", A.textBaseline = "middle";
5903
+ const p = R.gap || 10;
5904
+ let Z = 0, H = 0;
5905
+ R.position === "left" ? (A.textAlign = "right", Z = D - p, H = 0) : R.position === "right" ? (A.textAlign = "left", Z = D + Q + p, H = 0) : R.position === "top" ? (A.textAlign = "center", Z = 0, H = w - p, A.textBaseline = "bottom") : R.position === "bottom" ? (A.textAlign = "center", Z = 0, H = w + B + p, A.textBaseline = "top") : (A.textAlign = "left", Z = D + Q + p, H = 0), A.fillText(R.text, Z, H);
5874
5906
  }
5875
5907
  }
5876
5908
  renderLineGraph(A, I, C, g) {
@@ -5893,31 +5925,31 @@ class WC {
5893
5925
  A.save(), A.fillStyle = "#6366f1", A.font = "12px Inter, system-ui, sans-serif", A.textAlign = "center", A.textBaseline = "middle", A.fillText("NO DATA", 0, 0), A.restore();
5894
5926
  return;
5895
5927
  }
5896
- let B = 1 / 0, D = -1 / 0, o = 0;
5928
+ let B = 1 / 0, D = -1 / 0, w = 0;
5897
5929
  if (Q.forEach((y) => {
5898
5930
  let J = y.data;
5899
5931
  if (y.isVarEnabled && y.inputId) {
5900
- let k = this.inputs.get(y.inputId);
5901
- if (k === void 0) {
5932
+ let S = this.inputs.get(y.inputId);
5933
+ if (S === void 0) {
5902
5934
  const F = this.inputNameMap.get(y.inputId);
5903
- F && F.length > 0 && (k = this.inputs.get(F[0]));
5935
+ F && F.length > 0 && (S = this.inputs.get(F[0]));
5904
5936
  }
5905
- k && Array.isArray(k) && (J = k);
5937
+ S && Array.isArray(S) && (J = S);
5906
5938
  }
5907
5939
  if (J && J.length > 0) {
5908
- const k = J.filter((F) => typeof F == "number" && !isNaN(F));
5909
- k.length > 0 && (B = Math.min(B, ...k), D = Math.max(D, ...k), o = Math.max(o, J.length));
5940
+ const S = J.filter((F) => typeof F == "number" && !isNaN(F));
5941
+ S.length > 0 && (B = Math.min(B, ...S), D = Math.max(D, ...S), w = Math.max(w, J.length));
5910
5942
  }
5911
5943
  y._resolvedData = J;
5912
- }), o < 2) return;
5913
- const w = D - B, h = C / (o - 1), G = (y) => {
5914
- const J = w === 0 ? 0.5 : (y - B) / w;
5944
+ }), w < 2) return;
5945
+ const o = D - B, h = C / (w - 1), G = (y) => {
5946
+ const J = o === 0 ? 0.5 : (y - B) / o;
5915
5947
  return g / 2 - J * g;
5916
- }, K = (y) => y * h - C / 2, a = I.axisColor || "#333333";
5948
+ }, s = (y) => y * h - C / 2, a = I.axisColor || "#333333";
5917
5949
  if (I.showXAxis && (A.beginPath(), A.strokeStyle = I.xAxisColor || a, A.lineWidth = 1, A.moveTo(-C / 2, g / 2), A.lineTo(C / 2, g / 2), A.stroke()), I.showYAxis && (A.beginPath(), A.strokeStyle = I.yAxisColor || a, A.lineWidth = 1, A.moveTo(-C / 2, -g / 2), A.lineTo(-C / 2, g / 2), A.stroke()), A.fillStyle = I.axisLabelColor || "#333333", A.font = `${I.axisLabelFontSize || 10}px Inter, sans-serif`, I.showXLabels) {
5918
5950
  A.textAlign = "center", A.textBaseline = "top";
5919
- for (let y = 0; y < o; y++) {
5920
- const J = K(y);
5951
+ for (let y = 0; y < w; y++) {
5952
+ const J = s(y);
5921
5953
  A.fillText(`${y + 1}`, J, g / 2 + 5);
5922
5954
  }
5923
5955
  }
@@ -5931,73 +5963,73 @@ class WC {
5931
5963
  const J = y._resolvedData;
5932
5964
  if (!(!J || J.length < 2)) {
5933
5965
  if (y.showArea) {
5934
- if (A.beginPath(), A.moveTo(K(0), g / 2), A.lineTo(K(0), G(J[0])), y.smoothing && J.length > 2)
5966
+ if (A.beginPath(), A.moveTo(s(0), g / 2), A.lineTo(s(0), G(J[0])), y.smoothing && J.length > 2)
5935
5967
  for (let F = 0; F < J.length - 1; F++) {
5936
- const R = J[F === 0 ? F : F - 1], U = J[F], c = J[F + 1], l = J[F + 1 === J.length - 1 ? F + 1 : F + 2];
5937
- for (let r = 1; r <= M; r++) {
5938
- const d = r / M, Z = this._catmullRom(R, U, c, l, d);
5939
- A.lineTo(K(F + d), G(Z));
5968
+ const U = J[F === 0 ? F : F - 1], R = J[F], c = J[F + 1], r = J[F + 1 === J.length - 1 ? F + 1 : F + 2];
5969
+ for (let n = 1; n <= M; n++) {
5970
+ const p = n / M, Z = this._catmullRom(U, R, c, r, p);
5971
+ A.lineTo(s(F + p), G(Z));
5940
5972
  }
5941
5973
  }
5942
5974
  else
5943
5975
  for (let F = 1; F < J.length; F++)
5944
- A.lineTo(K(F), G(J[F]));
5945
- A.lineTo(K(J.length - 1), g / 2), A.closePath();
5946
- const k = A.globalAlpha;
5947
- A.globalAlpha = k * (I.areaOpacity ?? 0.3), A.fillStyle = y.areaColor || "rgba(139, 92, 246, 0.2)", A.fill(), A.globalAlpha = k;
5976
+ A.lineTo(s(F), G(J[F]));
5977
+ A.lineTo(s(J.length - 1), g / 2), A.closePath();
5978
+ const S = A.globalAlpha;
5979
+ A.globalAlpha = S * (I.areaOpacity ?? 0.3), A.fillStyle = y.areaColor || "rgba(139, 92, 246, 0.2)", A.fill(), A.globalAlpha = S;
5948
5980
  }
5949
- if (A.beginPath(), A.strokeStyle = y.lineColor || "#3b82f6", A.lineWidth = y.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(K(0), G(J[0])), y.smoothing && J.length > 2)
5950
- for (let k = 0; k < J.length - 1; k++) {
5951
- const F = J[k === 0 ? k : k - 1], R = J[k], U = J[k + 1], c = J[k + 1 === J.length - 1 ? k + 1 : k + 2];
5952
- for (let l = 1; l <= M; l++) {
5953
- const r = l / M, d = this._catmullRom(F, R, U, c, r);
5954
- A.lineTo(K(k + r), G(d));
5981
+ if (A.beginPath(), A.strokeStyle = y.lineColor || "#3b82f6", A.lineWidth = y.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(s(0), G(J[0])), y.smoothing && J.length > 2)
5982
+ for (let S = 0; S < J.length - 1; S++) {
5983
+ const F = J[S === 0 ? S : S - 1], U = J[S], R = J[S + 1], c = J[S + 1 === J.length - 1 ? S + 1 : S + 2];
5984
+ for (let r = 1; r <= M; r++) {
5985
+ const n = r / M, p = this._catmullRom(F, U, R, c, n);
5986
+ A.lineTo(s(S + n), G(p));
5955
5987
  }
5956
5988
  }
5957
5989
  else
5958
- for (let k = 1; k < J.length; k++)
5959
- A.lineTo(K(k), G(J[k]));
5960
- A.stroke(), y.showPoints && J.forEach((k, F) => {
5961
- const R = K(F), U = G(k);
5962
- A.beginPath(), A.arc(R, U, (y.pointSize || 6) / 2, 0, Math.PI * 2), A.fillStyle = y.pointFill || "#ffffff", A.fill(), A.strokeStyle = y.pointStrokeColor || y.lineColor || "#3b82f6", A.lineWidth = y.pointStrokeWidth || 1, A.stroke();
5990
+ for (let S = 1; S < J.length; S++)
5991
+ A.lineTo(s(S), G(J[S]));
5992
+ A.stroke(), y.showPoints && J.forEach((S, F) => {
5993
+ const U = s(F), R = G(S);
5994
+ A.beginPath(), A.arc(U, R, (y.pointSize || 6) / 2, 0, Math.PI * 2), A.fillStyle = y.pointFill || "#ffffff", A.fill(), A.strokeStyle = y.pointStrokeColor || y.lineColor || "#3b82f6", A.lineWidth = y.pointStrokeWidth || 1, A.stroke();
5963
5995
  });
5964
5996
  }
5965
5997
  }), I.showLegend && Q.length > 0) {
5966
5998
  const y = C / 2 - 10;
5967
5999
  let J = -g / 2 + 15;
5968
- const k = I.legendFontSize || 10, F = k + 5;
5969
- A.font = `${k}px Inter, sans-serif`, A.textAlign = "right", A.textBaseline = "alphabetic", Q.forEach((R) => {
5970
- const c = R.label || "Series", l = A.measureText(c).width;
5971
- A.beginPath(), A.rect(y - l - 8 - 5, J - (8 / 2 + 2), 8, 8), A.fillStyle = R.lineColor || "#3b82f6", A.fill(), A.fillStyle = I.legendColor || "#333333", A.fillText(c, y, J), J += F;
6000
+ const S = I.legendFontSize || 10, F = S + 5;
6001
+ A.font = `${S}px Inter, sans-serif`, A.textAlign = "right", A.textBaseline = "alphabetic", Q.forEach((U) => {
6002
+ const c = U.label || "Series", r = A.measureText(c).width;
6003
+ A.beginPath(), A.rect(y - r - 8 - 5, J - (8 / 2 + 2), 8, 8), A.fillStyle = U.lineColor || "#3b82f6", A.fill(), A.fillStyle = I.legendColor || "#333333", A.fillText(c, y, J), J += F;
5972
6004
  });
5973
6005
  }
5974
6006
  }
5975
6007
  _catmullRom(A, I, C, g, Q) {
5976
- const B = (C - A) * 0.5, D = (g - I) * 0.5, o = Q * Q, w = Q * o;
5977
- return (2 * I - 2 * C + B + D) * w + (-3 * I + 3 * C - 2 * B - D) * o + B * Q + I;
6008
+ const B = (C - A) * 0.5, D = (g - I) * 0.5, w = Q * Q, o = Q * w;
6009
+ return (2 * I - 2 * C + B + D) * o + (-3 * I + 3 * C - 2 * B - D) * w + B * Q + I;
5978
6010
  }
5979
6011
  createCanvasFill(A, I, C, g) {
5980
- var Q, B, D, o, w, h;
6012
+ var Q, B, D, w, o, h;
5981
6013
  if (!I || I.type === "None") return null;
5982
6014
  if (I.type === "Solid")
5983
6015
  return I.color;
5984
6016
  if (I.type === "LinearGradient" && I.stops) {
5985
- const G = (((Q = I.start) == null ? void 0 : Q[0]) ?? 0) * C - C / 2, K = (((B = I.start) == null ? void 0 : B[1]) ?? 0) * g - g / 2, a = (((D = I.end) == null ? void 0 : D[0]) ?? 1) * C - C / 2, M = (((o = I.end) == null ? void 0 : o[1]) ?? 0) * g - g / 2, y = A.createLinearGradient(G, K, a, M);
6017
+ const G = (((Q = I.start) == null ? void 0 : Q[0]) ?? 0) * C - C / 2, s = (((B = I.start) == null ? void 0 : B[1]) ?? 0) * g - g / 2, a = (((D = I.end) == null ? void 0 : D[0]) ?? 1) * C - C / 2, M = (((w = I.end) == null ? void 0 : w[1]) ?? 0) * g - g / 2, y = A.createLinearGradient(G, s, a, M);
5986
6018
  return I.stops.forEach((J) => y.addColorStop(J.offset, J.color)), y;
5987
6019
  }
5988
6020
  if (I.type === "RadialGradient" && I.stops) {
5989
- const G = (((w = I.center) == null ? void 0 : w[0]) ?? 0.5) * C - C / 2, K = (((h = I.center) == null ? void 0 : h[1]) ?? 0.5) * g - g / 2, a = (I.radius ?? 0.5) * Math.max(C, g), M = A.createRadialGradient(G, K, 0, G, K, a);
6021
+ const G = (((o = I.center) == null ? void 0 : o[0]) ?? 0.5) * C - C / 2, s = (((h = I.center) == null ? void 0 : h[1]) ?? 0.5) * g - g / 2, a = (I.radius ?? 0.5) * Math.max(C, g), M = A.createRadialGradient(G, s, 0, G, s, a);
5990
6022
  return I.stops.forEach((y) => M.addColorStop(y.offset, y.color)), M;
5991
6023
  }
5992
6024
  if (I.type === "Pattern" && I.url) {
5993
6025
  let G = this.imageCache.get(I.url);
5994
6026
  if (G || (G = new Image(), G.src = I.url, this.imageCache.set(I.url, G)), G.complete && G.naturalWidth > 0) {
5995
- const K = A.createPattern(G, "repeat");
5996
- if (K && (I.scaleX !== void 0 || I.offsetX !== void 0)) {
5997
- const a = new DOMMatrix(), M = I.scaleX ?? 1, y = I.scaleY ?? 1, J = I.offsetX ?? 0, k = I.offsetY ?? 0, F = I.rotation ?? 0;
5998
- a.translateSelf(J, k), a.rotateSelf(F), a.scaleSelf(M, y), K.setTransform(a);
6027
+ const s = A.createPattern(G, "repeat");
6028
+ if (s && (I.scaleX !== void 0 || I.offsetX !== void 0)) {
6029
+ const a = new DOMMatrix(), M = I.scaleX ?? 1, y = I.scaleY ?? 1, J = I.offsetX ?? 0, S = I.offsetY ?? 0, F = I.rotation ?? 0;
6030
+ a.translateSelf(J, S), a.rotateSelf(F), a.scaleSelf(M, y), s.setTransform(a);
5999
6031
  }
6000
- return K;
6032
+ return s;
6001
6033
  }
6002
6034
  }
6003
6035
  return I.color || null;
@@ -6010,53 +6042,64 @@ class WC {
6010
6042
  } catch {
6011
6043
  D = parseFloat(D) || 0;
6012
6044
  }
6013
- let o = [0, 0, 0, 0];
6014
- 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));
6015
- const w = Math.min(Math.abs(g) / 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)), a = Math.max(0, Math.min(Number(o[3]) || 0, w));
6016
- A.moveTo(I + h, C), A.lineTo(I + g - G, C), G > 0 ? A.arcTo(I + g, C, I + g, C + G, G) : A.lineTo(I + g, C), A.lineTo(I + g, C + Q - K), K > 0 ? A.arcTo(I + g, C + Q, I + g - K, C + Q, K) : A.lineTo(I + g, C + Q), A.lineTo(I + a, C + Q), a > 0 ? A.arcTo(I, C + Q, I, C + Q - a, a) : A.lineTo(I, C + Q), A.lineTo(I, C + h), h > 0 ? A.arcTo(I, C, I + h, C, h) : A.lineTo(I, C), A.closePath();
6045
+ let w = [0, 0, 0, 0];
6046
+ typeof D == "number" ? w = [D, D, D, D] : Array.isArray(D) && (D.length === 1 ? w = [D[0], D[0], D[0], D[0]] : D.length === 2 ? w = [D[0], D[1], D[0], D[1]] : D.length === 4 && (w = D));
6047
+ const o = Math.min(Math.abs(g) / 2, Math.abs(Q) / 2), h = Math.max(0, Math.min(Number(w[0]) || 0, o)), G = Math.max(0, Math.min(Number(w[1]) || 0, o)), s = Math.max(0, Math.min(Number(w[2]) || 0, o)), a = Math.max(0, Math.min(Number(w[3]) || 0, o));
6048
+ A.moveTo(I + h, C), A.lineTo(I + g - G, C), G > 0 ? A.arcTo(I + g, C, I + g, C + G, G) : A.lineTo(I + g, C), A.lineTo(I + g, C + Q - s), s > 0 ? A.arcTo(I + g, C + Q, I + g - s, C + Q, s) : A.lineTo(I + g, C + Q), A.lineTo(I + a, C + Q), a > 0 ? A.arcTo(I, C + Q, I, C + Q - a, a) : A.lineTo(I, C + Q), A.lineTo(I, C + h), h > 0 ? A.arcTo(I, C, I + h, C, h) : A.lineTo(I, C), A.closePath();
6017
6049
  }
6018
6050
  renderListView(A, I) {
6019
- var v, j;
6020
- const C = this.objectStates.get(I.id) || {}, g = C.options || I.options || {}, Q = C.width !== void 0 ? C.width : ((v = I.geometry) == null ? void 0 : v.width) || 200, B = C.height !== void 0 ? C.height : ((j = I.geometry) == null ? void 0 : j.height) || 300, D = -Q / 2, o = -B / 2, w = C.cornerRadius !== void 0 ? C.cornerRadius : g.cornerRadius ?? 0, h = g.orientation || "vertical", G = g.items || [], K = g.itemGap ?? 10, a = g.itemHeight ?? 50, M = g.itemWidth ?? 200, y = g.scrollOffset ?? 0, J = g.padding ?? 0, k = g.glassEffect !== !1, F = g.accentColor || "#3b82f6", R = g.itemTextColor || "#333333", U = g.itemBackgroundColor || "#ffffff", c = g.hoveredIndex ?? null, l = g.activeItemIndex ?? null, r = g.glowIntensity ?? 0, d = g.glowColor || "#3b82f6";
6021
- if (A.save(), r > 0 && (A.shadowColor = d, A.shadowBlur = r * 2), k) {
6022
- const e = g.listBackgroundColor || { color: "rgba(31, 41, 55, 0.4)" }, f = typeof e == "string" ? e : e.color || "rgba(31, 41, 55, 0.4)";
6023
- A.fillStyle = f, this.drawListViewRect(A, D, o, Q, B, w), A.fill();
6024
- const b = A.createLinearGradient(D, o, D + Q, o + B);
6025
- b.addColorStop(0, "rgba(255, 255, 255, 0.15)"), b.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), b.addColorStop(1, "rgba(255, 255, 255, 0.03)"), A.fillStyle = b, this.drawListViewRect(A, D, o, Q, B, w), A.fill(), A.strokeStyle = "rgba(255, 255, 255, 0.25)", A.lineWidth = 1, this.drawListViewRect(A, D, o, Q, B, w), A.stroke();
6051
+ var wA, v, x, q;
6052
+ const C = this.objectStates.get(I.id) || {}, g = C.options || I.options || {}, Q = C.width !== void 0 ? C.width : ((wA = I.geometry) == null ? void 0 : wA.width) || 200, B = C.height !== void 0 ? C.height : ((v = I.geometry) == null ? void 0 : v.height) || 300, D = -Q / 2, w = -B / 2, o = C.cornerRadius !== void 0 ? C.cornerRadius : g.cornerRadius ?? 0, h = g.orientation || "vertical", G = g.items || [], s = g.itemGap ?? 10, a = g.itemHeight ?? 50, M = g.itemWidth ?? 200, y = g.scrollOffset ?? 0, J = g.padding ?? 0, S = g.glassEffect !== !1, F = g.accentColor || "#3b82f6", U = g.itemTextColor || "#333333", R = g.itemBackgroundColor || "#ffffff", c = g.hoveredIndex ?? null, r = g.activeItemIndex ?? null, n = g.glowIntensity ?? 0, p = g.glowColor || "#3b82f6", Z = typeof p == "string" ? p : p.color || ((q = (x = p.stops) == null ? void 0 : x[0]) == null ? void 0 : q.color) || "#3b82f6", H = g.opacity !== void 0 ? g.opacity : I.opacity !== void 0 ? I.opacity : 1;
6053
+ if (A.save(), A.globalAlpha *= H, n > 0 && (A.shadowColor = Z, A.shadowBlur = n * 2, A.shadowOffsetX = 0, A.shadowOffsetY = 0), S) {
6054
+ const b = g.listBackgroundColor || "rgba(31, 41, 55, 0.4)", T = this.createCanvasFill(A, b, Q, B);
6055
+ A.fillStyle = T || "rgba(31, 41, 55, 0.4)", this.drawListViewRect(A, D, w, Q, B, o), A.fill();
6056
+ const Y = A.createLinearGradient(D, w, D + Q, w + B);
6057
+ Y.addColorStop(0, "rgba(255, 255, 255, 0.15)"), Y.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), Y.addColorStop(1, "rgba(255, 255, 255, 0.03)"), A.fillStyle = Y, this.drawListViewRect(A, D, w, Q, B, o), A.fill(), A.strokeStyle = "rgba(255, 255, 255, 0.25)", A.lineWidth = 1, this.drawListViewRect(A, D, w, Q, B, o), A.stroke();
6026
6058
  } else {
6027
- const e = g.listBackgroundColor || "transparent", f = typeof e == "string" ? e : e.color || "transparent";
6028
- f !== "transparent" && (A.fillStyle = f, this.drawListViewRect(A, D, o, Q, B, w), A.fill()), g.borderWidth > 0 && (A.strokeStyle = g.borderColor || "#cccccc", A.lineWidth = g.borderWidth, this.drawListViewRect(A, D, o, Q, B, w), A.stroke());
6059
+ const b = g.listBackgroundColor || "transparent", T = this.createCanvasFill(A, b, Q, B);
6060
+ T && (A.fillStyle = T, this.drawListViewRect(A, D, w, Q, B, o), A.fill());
6061
+ const Y = g.borderWidth ?? 0;
6062
+ Y > 0 && (A.strokeStyle = g.borderColor || "#cccccc", A.lineWidth = Y, this.drawListViewRect(A, D, w, Q, B, o), A.stroke());
6029
6063
  }
6030
- A.shadowBlur = 0, A.save(), this.drawListViewRect(A, D, o, Q, B, w), A.clip();
6031
- const Z = typeof J == "number" ? J : h === "vertical" ? J[0] : J[3];
6032
- let q = (h === "vertical" ? o : D) + y + Z;
6033
- if (A.textBaseline = "middle", G.forEach((e, f) => {
6034
- const b = h === "vertical" ? Q : M, L = h === "vertical" ? a : B, u = h === "vertical" ? D : q, EA = h === "vertical" ? q : o, W = c === f, X = l === f;
6035
- if (X) {
6036
- A.fillStyle = F;
6037
- const z = A.globalAlpha;
6038
- A.globalAlpha = z * 0.8, A.fillRect(u, EA, b, L), A.globalAlpha = z;
6039
- } else W ? (A.fillStyle = k ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)", A.fillRect(u, EA, b, L)) : U !== "transparent" && (A.fillStyle = U, A.fillRect(u, EA, b, L));
6040
- (X || W) && (A.fillStyle = F, h === "vertical" ? A.fillRect(u, EA, 3, L) : A.fillRect(u, EA + L - 3, b, 3));
6041
- const t = X ? "#ffffff" : k ? "rgba(255, 255, 255, 0.9)" : R;
6042
- A.fillStyle = t, A.font = X || W ? "600 14px Inter, sans-serif" : "400 14px Inter, sans-serif";
6043
- const H = typeof e == "string" ? e : e.label || `Item ${f + 1}`, p = u + (h === "vertical" ? 16 : b / 2), O = EA + L / 2;
6044
- h === "horizontal" ? A.textAlign = "center" : A.textAlign = "left", A.fillText(H, p, O), q += (h === "vertical" ? a : M) + K;
6064
+ A.shadowBlur = 0, A.save(), this.drawListViewRect(A, D, w, Q, B, o), A.clip();
6065
+ const X = typeof J == "number" ? J : h === "vertical" ? J[0] : J[3];
6066
+ let QA = (h === "vertical" ? w : D) + y + X;
6067
+ if (A.textBaseline = "middle", G.forEach((b, T) => {
6068
+ const Y = h === "vertical" ? Q : M, f = h === "vertical" ? a : B, t = h === "vertical" ? D : QA, l = h === "vertical" ? QA : w, e = c === T, O = r === T;
6069
+ if (O) {
6070
+ const u = this.createCanvasFill(A, F, Y, f);
6071
+ A.fillStyle = u || F;
6072
+ const iA = A.globalAlpha;
6073
+ A.globalAlpha = iA * 0.8, A.fillRect(t, l, Y, f), A.globalAlpha = iA;
6074
+ } else if (e)
6075
+ A.fillStyle = S ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)", A.fillRect(t, l, Y, f);
6076
+ else if (R !== "transparent") {
6077
+ const u = this.createCanvasFill(A, R, Y, f);
6078
+ A.fillStyle = u || R, A.fillRect(t, l, Y, f);
6079
+ }
6080
+ if (O || e) {
6081
+ const u = this.createCanvasFill(A, F, h === "vertical" ? 3 : Y, h === "vertical" ? f : 3);
6082
+ A.fillStyle = u || F, h === "vertical" ? A.fillRect(t, l, 3, f) : A.fillRect(t, l + f - 3, Y, 3);
6083
+ }
6084
+ const _ = O ? "#ffffff" : S ? "rgba(255, 255, 255, 0.9)" : U;
6085
+ A.fillStyle = _, A.font = O || e ? "600 14px Inter, sans-serif" : "400 14px Inter, sans-serif";
6086
+ const BA = typeof b == "string" ? b : b.label || `Item ${T + 1}`, V = t + (h === "vertical" ? 16 : Y / 2), gA = l + f / 2;
6087
+ h === "horizontal" ? A.textAlign = "center" : A.textAlign = "left", A.fillText(BA, V, gA), QA += (h === "vertical" ? a : M) + s;
6045
6088
  }), A.restore(), g.showScrollbar !== !1) {
6046
- const e = (G.length || 0) * (h === "vertical" ? a : M) + ((G.length || 0) - 1) * K, f = h === "vertical" ? B : Q;
6047
- if (e > f) {
6048
- const b = f / e, L = f * b, u = -y / e * f, EA = g.scrollbarColor || "rgba(255,255,255,0.3)", W = g.scrollbarWidth || 4;
6049
- A.fillStyle = EA, h === "vertical" ? A.fillRect(D + Q - W - 2, o + u, W, L) : A.fillRect(D + u, o + B - W - 2, L, W);
6089
+ const b = (G.length || 0) * (h === "vertical" ? a : M) + ((G.length || 0) - 1) * s, T = h === "vertical" ? B : Q;
6090
+ if (b > T) {
6091
+ const Y = T / b, f = T * Y, t = -y / b * T, l = g.scrollbarColor || "rgba(255,255,255,0.3)", e = g.scrollbarWidth || 4;
6092
+ A.fillStyle = l, h === "vertical" ? A.fillRect(D + Q - e - 2, w + t, e, f) : A.fillRect(D + t, w + B - e - 2, f, e);
6050
6093
  }
6051
6094
  }
6052
6095
  A.restore();
6053
6096
  }
6054
6097
  updateListViewScrollFromPointer(A) {
6055
- var J, k;
6098
+ var J, S;
6056
6099
  if (!this._lastPointerPos || !this._prevPointerPos) return;
6057
6100
  const I = A.options || {}, C = I.orientation || "vertical", g = this._lastPointerPos.x - this._prevPointerPos.x, Q = this._lastPointerPos.y - this._prevPointerPos.y;
6058
6101
  C === "vertical" ? I.scrollOffset = (I.scrollOffset || 0) + Q : I.scrollOffset = (I.scrollOffset || 0) + g;
6059
- const B = this.objectStates.get(A.id) || {}, D = I.items || [], o = I.itemGap ?? 10, w = I.itemHeight ?? 50, h = I.itemWidth ?? 200, G = B.width !== void 0 ? B.width : ((J = A.geometry) == null ? void 0 : J.width) || 200, K = B.height !== void 0 ? B.height : ((k = A.geometry) == null ? void 0 : k.height) || 300, a = (D.length || 0) * (C === "vertical" ? w : h) + ((D.length || 0) - 1) * o, y = Math.max(0, a - (C === "vertical" ? K : G) + (I.padding * 2 || 0));
6102
+ const B = this.objectStates.get(A.id) || {}, D = I.items || [], w = I.itemGap ?? 10, o = I.itemHeight ?? 50, h = I.itemWidth ?? 200, G = B.width !== void 0 ? B.width : ((J = A.geometry) == null ? void 0 : J.width) || 200, s = B.height !== void 0 ? B.height : ((S = A.geometry) == null ? void 0 : S.height) || 300, a = (D.length || 0) * (C === "vertical" ? o : h) + ((D.length || 0) - 1) * w, y = Math.max(0, a - (C === "vertical" ? s : G) + (I.padding * 2 || 0));
6060
6103
  I.scrollOffset > 0 && (I.scrollOffset = 0), I.scrollOffset < -y && (I.scrollOffset = -y);
6061
6104
  }
6062
6105
  updateListViewHoverFromPointer(A, I, C) {
@@ -6064,16 +6107,16 @@ class WC {
6064
6107
  Q.hoveredIndex !== g && (Q.hoveredIndex = g);
6065
6108
  }
6066
6109
  getListViewItemIndexAtPointer(A, I, C) {
6067
- var gA, v;
6110
+ var X, QA;
6068
6111
  const g = A.options || {}, Q = this.objectStates.get(A.id) || {}, B = g.items || [];
6069
6112
  if (B.length === 0) return null;
6070
- const D = Q.width !== void 0 ? Q.width : ((gA = A.geometry) == null ? void 0 : gA.width) || 200, o = Q.height !== void 0 ? Q.height : ((v = A.geometry) == null ? void 0 : v.height) || 300, w = g.orientation || "vertical", h = g.itemGap ?? 10, G = g.itemHeight ?? 50, K = g.itemWidth ?? 200, a = g.scrollOffset ?? 0, M = g.padding ?? 0, y = this.getWorldTransform(A.id), J = I - y.x, k = C - y.y, F = -y.rotation * (Math.PI / 180), R = Math.cos(F), U = Math.sin(F), c = J * R - k * U, l = J * U + k * R, r = -D / 2, d = -o / 2, Z = typeof M == "number" ? M : w === "vertical" ? M[0] : M[3];
6071
- let q = (w === "vertical" ? d : r) + a + Z;
6072
- for (let j = 0; j < B.length; j++) {
6073
- const e = w === "vertical" ? D : K, f = w === "vertical" ? G : o, b = w === "vertical" ? r : q, L = w === "vertical" ? q : d;
6074
- if (c >= b && c <= b + e && l >= L && l <= L + f)
6075
- return j;
6076
- q += (w === "vertical" ? G : K) + h;
6113
+ const D = Q.width !== void 0 ? Q.width : ((X = A.geometry) == null ? void 0 : X.width) || 200, w = Q.height !== void 0 ? Q.height : ((QA = A.geometry) == null ? void 0 : QA.height) || 300, o = g.orientation || "vertical", h = g.itemGap ?? 10, G = g.itemHeight ?? 50, s = g.itemWidth ?? 200, a = g.scrollOffset ?? 0, M = g.padding ?? 0, y = this.getWorldTransform(A.id), J = I - y.x, S = C - y.y, F = -y.rotation * (Math.PI / 180), U = Math.cos(F), R = Math.sin(F), c = J * U - S * R, r = J * R + S * U, n = -D / 2, p = -w / 2, Z = typeof M == "number" ? M : o === "vertical" ? M[0] : M[3];
6114
+ let H = (o === "vertical" ? p : n) + a + Z;
6115
+ for (let SA = 0; SA < B.length; SA++) {
6116
+ const wA = o === "vertical" ? D : s, v = o === "vertical" ? G : w, x = o === "vertical" ? n : H, q = o === "vertical" ? H : p;
6117
+ if (c >= x && c <= x + wA && r >= q && r <= q + v)
6118
+ return SA;
6119
+ H += (o === "vertical" ? G : s) + h;
6077
6120
  }
6078
6121
  return null;
6079
6122
  }
@@ -6082,84 +6125,88 @@ class WC {
6082
6125
  }
6083
6126
  }
6084
6127
  const xC = FC(
6085
- ({ artboard: i, src: A, className: I, style: C, autoPlay: g = !0, fit: Q = "Contain", alignment: B = "Center", onReady: D, onTrigger: o, onInputUpdate: w, onComponentChange: h }, G) => {
6086
- const K = DI(null), a = DI(new WC()), M = DI(), y = DI(0);
6087
- MC(G, () => K.current), OA(() => {
6128
+ ({ artboard: i, src: A, className: I, style: C, autoPlay: g = !0, fit: Q = "Contain", alignment: B = "Center", onReady: D, onTrigger: w, onInputUpdate: o, onComponentChange: h }, G) => {
6129
+ const s = DI(null), a = DI(new OC()), M = DI(), y = DI(0);
6130
+ MC(G, () => s.current), jA(() => {
6088
6131
  console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"), a.current.setLayout(Q, B);
6089
- }, [Q, B]), OA(() => {
6090
- o && a.current.setTriggerCallback(o);
6091
- }, [o]), OA(() => {
6092
- w && a.current.setInputUpdateCallback(w);
6093
- }, [w]), OA(() => {
6132
+ }, [Q, B]), jA(() => {
6133
+ w && a.current.setTriggerCallback(w);
6134
+ }, [w]), jA(() => {
6135
+ o && a.current.setInputUpdateCallback(o);
6136
+ }, [o]), jA(() => {
6094
6137
  h && a.current.setComponentChangeCallback(h);
6095
- }, [h]), OA(() => {
6138
+ }, [h]), jA(() => {
6096
6139
  (async () => {
6097
6140
  const F = a.current;
6098
- let R = i;
6099
- if (!R && A)
6141
+ let U = i;
6142
+ if (!U && A)
6100
6143
  try {
6101
- R = await (await fetch(A)).json();
6102
- } catch (U) {
6103
- console.error("Failed to load ExodeUI animation:", U);
6144
+ U = await (await fetch(A)).json();
6145
+ } catch (R) {
6146
+ console.error("Failed to load ExodeUI animation:", R);
6104
6147
  return;
6105
6148
  }
6106
- R && (F.load(R), D && D(F));
6149
+ U && (F.load(U), D && D(F));
6107
6150
  })();
6108
- }, [i, A]), OA(() => {
6109
- const k = a.current, F = K.current;
6151
+ }, [i, A]), jA(() => {
6152
+ const S = a.current, F = s.current;
6110
6153
  if (!F) return;
6111
- const R = F.getContext("2d");
6112
- if (!R) return;
6113
- const U = (c) => {
6154
+ const U = F.getContext("2d");
6155
+ if (!U) return;
6156
+ const R = (c) => {
6114
6157
  y.current || (y.current = c);
6115
- const l = (c - y.current) / 1e3;
6116
- y.current = c, g && k.advance(l);
6117
- const r = window.devicePixelRatio || 1, d = F.getBoundingClientRect(), Z = Math.floor(d.width * r), q = Math.floor(d.height * r);
6118
- (F.width !== Z || F.height !== q) && (F.width = Z, F.height = q), k.render(R, Z, q), M.current = requestAnimationFrame(U);
6158
+ const r = (c - y.current) / 1e3;
6159
+ y.current = c, g && S.advance(r);
6160
+ const n = window.devicePixelRatio || 1, p = F.getBoundingClientRect(), Z = Math.floor(p.width * n), H = Math.floor(p.height * n);
6161
+ (F.width !== Z || F.height !== H) && (F.width = Z, F.height = H), S.render(U, Z, H), M.current = requestAnimationFrame(R);
6119
6162
  };
6120
- return M.current = requestAnimationFrame(U), () => {
6163
+ return M.current = requestAnimationFrame(R), () => {
6121
6164
  M.current && cancelAnimationFrame(M.current);
6122
6165
  };
6123
6166
  }, [g]);
6124
- const J = (k, F) => {
6125
- const R = k.currentTarget.getBoundingClientRect(), U = k.clientX - R.left, c = k.clientY - R.top, l = R.width, r = R.height;
6126
- a.current.handlePointerInput(F, U, c, l, r);
6167
+ const J = (S, F) => {
6168
+ const U = S.currentTarget.getBoundingClientRect(), R = S.clientX - U.left, c = S.clientY - U.top, r = U.width, n = U.height;
6169
+ a.current.handlePointerInput(F, R, c, r, n);
6127
6170
  };
6128
6171
  return /* @__PURE__ */ yC(
6129
6172
  "canvas",
6130
6173
  {
6131
- ref: K,
6174
+ ref: s,
6132
6175
  style: { width: "100%", height: "100%", outline: "none", ...C },
6133
6176
  className: I,
6134
6177
  tabIndex: 0,
6135
- onPointerDown: (k) => {
6178
+ onPointerDown: (S) => {
6136
6179
  var F;
6137
- J(k, "down"), (F = K.current) == null || F.focus();
6180
+ J(S, "down"), (F = s.current) == null || F.focus();
6138
6181
  },
6139
- onPointerUp: (k) => J(k, "up"),
6140
- onPointerMove: (k) => J(k, "move"),
6141
- onPointerLeave: (k) => J(k, "blur"),
6142
- onClick: (k) => J(k, "click"),
6143
- onKeyDown: (k) => {
6144
- k.key === "Backspace" || k.key === "Enter" || k.key, a.current.handleKeyDown(k.nativeEvent);
6182
+ onPointerUp: (S) => J(S, "up"),
6183
+ onPointerMove: (S) => J(S, "move"),
6184
+ onPointerLeave: (S) => J(S, "blur"),
6185
+ onClick: (S) => J(S, "click"),
6186
+ onKeyDown: (S) => {
6187
+ S.key === "Backspace" || S.key === "Enter" || S.key, a.current.handleKeyDown(S.nativeEvent);
6145
6188
  }
6146
6189
  }
6147
6190
  );
6148
6191
  }
6149
6192
  );
6150
6193
  function XC() {
6151
- const [i, A] = JC(null), I = jA((o, w) => {
6152
- i == null || i.setInputBool(o, w);
6153
- }, [i]), C = jA((o, w) => {
6154
- i == null || i.setInputNumber(o, w);
6155
- }, [i]), g = jA((o) => {
6156
- i == null || i.fireTrigger(o);
6157
- }, [i]), Q = jA((o, w) => {
6158
- i == null || i.setInputText(o, w);
6159
- }, [i]), B = jA((o, w) => {
6160
- i == null || i.setInputNumberArray(o, w);
6161
- }, [i]), D = jA((o, w, h) => {
6162
- i == null || i.updateConstraint(o, w, h);
6194
+ const [i, A] = JC(null), I = HA((h, G) => {
6195
+ i == null || i.setInputBool(h, G);
6196
+ }, [i]), C = HA((h, G) => {
6197
+ i == null || i.setInputNumber(h, G);
6198
+ }, [i]), g = HA((h) => {
6199
+ i == null || i.fireTrigger(h);
6200
+ }, [i]), Q = HA((h, G) => {
6201
+ i == null || i.setInputText(h, G);
6202
+ }, [i]), B = HA((h, G) => {
6203
+ i == null || i.setInputNumberArray(h, G);
6204
+ }, [i]), D = HA((h, G) => {
6205
+ i == null || i.setInputStringArray(h, G);
6206
+ }, [i]), w = HA((h, G) => {
6207
+ i == null || i.updateObjectOptions(h, G);
6208
+ }, [i]), o = HA((h, G, s) => {
6209
+ i == null || i.updateConstraint(h, G, s);
6163
6210
  }, [i]);
6164
6211
  return {
6165
6212
  setEngine: A,
@@ -6170,13 +6217,15 @@ function XC() {
6170
6217
  fireTrigger: g,
6171
6218
  setInputText: Q,
6172
6219
  setInputNumberArray: B,
6173
- updateConstraint: D
6220
+ setInputStringArray: D,
6221
+ updateConstraint: o,
6222
+ updateObjectOptions: w
6174
6223
  };
6175
6224
  }
6176
6225
  export {
6177
6226
  UC as ConditionOp,
6178
6227
  xC as ExodeUICanvas,
6179
- WC as ExodeUIEngine,
6228
+ OC as ExodeUIEngine,
6180
6229
  uA as LogicOp,
6181
6230
  XC as useExodeUI
6182
6231
  };