@solid-labs/fab-one-widget 1.1.1 → 1.1.2

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.
@@ -1,14 +1,14 @@
1
- import { jsxs as v, jsx as i, Fragment as Ie } from "react/jsx-runtime";
2
- import { createContext as mo, Component as xo, useCallback as ie, useMemo as Y, useState as I, memo as bo, useEffect as q, useRef as ae, forwardRef as yo, createElement as xn } from "react";
3
- import { useFrame as An, useThree as Mn, Canvas as wo } from "@react-three/fiber";
4
- import { Html as Xe, Line as we, OrbitControls as kn } from "@react-three/drei";
1
+ import { jsxs as S, jsx as i, Fragment as Ie } from "react/jsx-runtime";
2
+ import { createContext as mo, Component as xo, useCallback as re, useMemo as Y, useState as I, memo as bo, useEffect as q, useRef as ae, forwardRef as yo, createElement as bn } from "react";
3
+ import { useFrame as Mn, useThree as kn, Canvas as wo } from "@react-three/fiber";
4
+ import { Html as Ge, Line as we, OrbitControls as Fn } from "@react-three/drei";
5
5
  import * as j from "three";
6
- import { Plane as St, Vector3 as k, Box3 as Fn, Line3 as Pn, Raycaster as vo } from "three";
7
- import { create as So } from "zustand";
8
- import { OBJLoader as Ln } from "three/examples/jsm/loaders/OBJLoader.js";
6
+ import { Plane as vt, Vector3 as k, Box3 as Pn, Line3 as Ln, Raycaster as So } from "three";
7
+ import { create as vo } from "zustand";
8
+ import { OBJLoader as Dn } from "three/examples/jsm/loaders/OBJLoader.js";
9
9
  import { STLLoader as Co } from "three/examples/jsm/loaders/STLLoader.js";
10
10
  import { MeshBVH as Ct } from "three-mesh-bvh";
11
- let Hr, yt, Fr, $n;
11
+ let Hr, yt, Fr, On;
12
12
  let __tla = (async () => {
13
13
  const zo = {
14
14
  showDragDrop: true,
@@ -28,7 +28,7 @@ let __tla = (async () => {
28
28
  showNavigation: false,
29
29
  showToolbar: false,
30
30
  showSaveButton: false
31
- }, Mo = mo(zo), Gt = So((t, r) => ({
31
+ }, Mo = mo(zo), Gt = vo((t, r) => ({
32
32
  landmarkPoints: [],
33
33
  isAligned: false,
34
34
  isCut: false,
@@ -97,45 +97,45 @@ let __tla = (async () => {
97
97
  const D = r[z * 3] * o, B = r[z * 3 + 1] * o, $ = r[z * 3 + 2] * o;
98
98
  D < e && (e = D), D > f && (f = D), B < h && (h = B), B > u && (u = B), $ < d && (d = $), $ > g && (g = $);
99
99
  }
100
- const M = (e + f) * 0.5, p = (h + u) * 0.5, b = (d + g) * 0.5, m = f - e + 1e-6, P = u - h + 1e-6, y = g - d + 1e-6, F = m * 0.5, A = P * 0.5, S = y * 0.5, C = Math.min(128, Math.max(16, Math.round(Math.cbrt(a)))), L = m / C, T = P / C, E = y / C, w = /* @__PURE__ */ new Map();
100
+ const M = (e + f) * 0.5, p = (h + u) * 0.5, b = (d + g) * 0.5, m = f - e + 1e-6, P = u - h + 1e-6, y = g - d + 1e-6, F = m * 0.5, A = P * 0.5, v = y * 0.5, C = Math.min(128, Math.max(16, Math.round(Math.cbrt(a)))), L = m / C, T = P / C, E = y / C, w = /* @__PURE__ */ new Map();
101
101
  for (let z = 0; z < a; z++) {
102
- const D = r[z * 3] * o - M, B = r[z * 3 + 1] * o - p, $ = r[z * 3 + 2] * o - b, ee = Math.min(C - 1, Math.max(0, Math.floor((D + F) / L))), se = Math.min(C - 1, Math.max(0, Math.floor((B + A) / T))), ce = Math.min(C - 1, Math.max(0, Math.floor(($ + S) / E))), U = ee * C * C + se * C + ce;
103
- let oe = w.get(U);
104
- oe || (oe = [], w.set(U, oe)), oe.push(z);
102
+ const D = r[z * 3] * o - M, B = r[z * 3 + 1] * o - p, $ = r[z * 3 + 2] * o - b, ee = Math.min(C - 1, Math.max(0, Math.floor((D + F) / L))), ie = Math.min(C - 1, Math.max(0, Math.floor((B + A) / T))), ce = Math.min(C - 1, Math.max(0, Math.floor(($ + v) / E))), U = ee * C * C + ie * C + ce;
103
+ let ne = w.get(U);
104
+ ne || (ne = [], w.set(U, ne)), ne.push(z);
105
105
  }
106
106
  for (let z = 0; z < l; z++) {
107
- const D = s.getX(z), B = s.getY(z), $ = s.getZ(z), ee = Math.min(C - 1, Math.max(0, Math.floor((D + F) / L))), se = Math.min(C - 1, Math.max(0, Math.floor((B + A) / T))), ce = Math.min(C - 1, Math.max(0, Math.floor(($ + S) / E)));
108
- let U = 1 / 0, oe = 0;
107
+ const D = s.getX(z), B = s.getY(z), $ = s.getZ(z), ee = Math.min(C - 1, Math.max(0, Math.floor((D + F) / L))), ie = Math.min(C - 1, Math.max(0, Math.floor((B + A) / T))), ce = Math.min(C - 1, Math.max(0, Math.floor(($ + v) / E)));
108
+ let U = 1 / 0, ne = 0;
109
109
  for (let J = 0; J <= C && U > 0; J++) {
110
110
  for (let Z = -J; Z <= J; Z++) for (let ge = -J; ge <= J; ge++) for (let de = -J; de <= J; de++) {
111
111
  if (J > 0 && Math.abs(Z) < J && Math.abs(ge) < J && Math.abs(de) < J) continue;
112
- const he = ee + Z, ve = se + ge, te = ce + de;
113
- if (he < 0 || he >= C || ve < 0 || ve >= C || te < 0 || te >= C) continue;
114
- const O = w.get(he * C * C + ve * C + te);
112
+ const he = ee + Z, Se = ie + ge, te = ce + de;
113
+ if (he < 0 || he >= C || Se < 0 || Se >= C || te < 0 || te >= C) continue;
114
+ const O = w.get(he * C * C + Se * C + te);
115
115
  if (O) for (const X of O) {
116
- const Q = r[X * 3] * o - M, ue = r[X * 3 + 1] * o - p, fe = r[X * 3 + 2] * o - b, re = (D - Q) ** 2 + (B - ue) ** 2 + ($ - fe) ** 2;
117
- re < U && (U = re, oe = X);
116
+ const Q = r[X * 3] * o - M, ue = r[X * 3 + 1] * o - p, fe = r[X * 3 + 2] * o - b, oe = (D - Q) ** 2 + (B - ue) ** 2 + ($ - fe) ** 2;
117
+ oe < U && (U = oe, ne = X);
118
118
  }
119
119
  }
120
120
  if (U < 1 / 0) break;
121
121
  }
122
- c[z * 3] = n[oe * 3], c[z * 3 + 1] = n[oe * 3 + 1], c[z * 3 + 2] = n[oe * 3 + 2];
122
+ c[z * 3] = n[ne * 3], c[z * 3 + 1] = n[ne * 3 + 1], c[z * 3 + 2] = n[ne * 3 + 2];
123
123
  }
124
124
  t.setAttribute("color", new j.Float32BufferAttribute(c, 3));
125
125
  }
126
- const bn = {
126
+ const yn = {
127
127
  debug: 0,
128
128
  info: 1,
129
129
  warn: 2,
130
130
  error: 3
131
131
  };
132
- let Dn = "warn", _n = null;
132
+ let _n = "warn", Rn = null;
133
133
  const ye = {
134
134
  setLevel(t) {
135
- Dn = t;
135
+ _n = t;
136
136
  },
137
137
  setHandler(t) {
138
- _n = t;
138
+ Rn = t;
139
139
  },
140
140
  debug(t, r, n) {
141
141
  mt("debug", t, r, n);
@@ -151,7 +151,7 @@ let __tla = (async () => {
151
151
  }
152
152
  };
153
153
  function mt(t, r, n, o) {
154
- if (bn[t] < bn[Dn]) return;
154
+ if (yn[t] < yn[_n]) return;
155
155
  const s = `[${r}]`, l = o !== void 0 ? [
156
156
  s,
157
157
  n,
@@ -174,9 +174,9 @@ let __tla = (async () => {
174
174
  console.error(...l);
175
175
  break;
176
176
  }
177
- _n == null ? void 0 : _n(t, r, n, o);
177
+ Rn == null ? void 0 : Rn(t, r, n, o);
178
178
  }
179
- function vt(t) {
179
+ function St(t) {
180
180
  const r = t.getAttribute("position"), n = new Float32Array(r.array), o = t.getIndex();
181
181
  if (o) return {
182
182
  positions: n,
@@ -189,7 +189,7 @@ let __tla = (async () => {
189
189
  indices: l
190
190
  };
191
191
  }
192
- function Rn(t, r) {
192
+ function Wn(t, r) {
193
193
  const n = new j.BufferGeometry();
194
194
  return n.setAttribute("position", new j.Float32BufferAttribute(t, 3)), n.setIndex(new j.BufferAttribute(r, 1)), n.computeVertexNormals(), n;
195
195
  }
@@ -197,12 +197,12 @@ let __tla = (async () => {
197
197
  try {
198
198
  const o = Po(t);
199
199
  n == null ? void 0 : n("Parsing mesh...");
200
- const l = new Ln().parse(t);
200
+ const l = new Dn().parse(t);
201
201
  let c = null;
202
202
  if (l.traverse((m) => {
203
203
  m.isMesh && !c && (c = m.geometry);
204
204
  }), !c) return null;
205
- const { positions: a, indices: e } = vt(c);
205
+ const { positions: a, indices: e } = St(c);
206
206
  if (a.length < 9 || e.length < 3) return ye.warn("wasm", `Mesh too small: positions=${a.length} indices=${e.length}`), null;
207
207
  for (let m = 0; m < Math.min(a.length, 300); m++) if (!isFinite(a[m])) return ye.error("wasm", `Invalid position data: NaN/Infinity at index ${m}`), null;
208
208
  const h = a.length / 3;
@@ -211,7 +211,7 @@ let __tla = (async () => {
211
211
  const d = r.preprocess_mesh(a, e, 10, 1e-4, 500), f = d.positions(), u = d.indices(), g = d.unit_converted(), M = d.detected_unit(), p = d.log();
212
212
  if (ye.debug("wasm", "preprocess result", p), f.length === 0) return null;
213
213
  n == null ? void 0 : n("Building geometry...");
214
- const b = Rn(f, u);
214
+ const b = Wn(f, u);
215
215
  if (o) {
216
216
  const m = g ? 1e3 : 1;
217
217
  Lo(b, o.positions, o.colors, m);
@@ -227,7 +227,7 @@ let __tla = (async () => {
227
227
  }
228
228
  }
229
229
  function _o(t) {
230
- const n = new Ln().parse(t);
230
+ const n = new Dn().parse(t);
231
231
  let o = null;
232
232
  return n.traverse((s) => {
233
233
  s.isMesh && !o && (o = s.geometry);
@@ -252,12 +252,12 @@ let __tla = (async () => {
252
252
  for (const o of t) (n.length === 0 || n[n.length - 1].distanceTo(o) > r) && n.push(o.clone());
253
253
  return n.length > 2 && n[0].distanceTo(n[n.length - 1]) > r && n.push(n[0].clone()), n;
254
254
  }
255
- function qe(t) {
255
+ function Ke(t) {
256
256
  let r = 0;
257
257
  for (let n = 0; n < t.length - 1; n++) r += t[n].distanceTo(t[n + 1]);
258
258
  return r;
259
259
  }
260
- function Wn(t, r = 1e-3, n = false) {
260
+ function In(t, r = 1e-3, n = false) {
261
261
  if (!t.length) return [];
262
262
  const o = /* @__PURE__ */ new Map(), s = (f) => {
263
263
  const u = Ro(f, r);
@@ -290,8 +290,8 @@ let __tla = (async () => {
290
290
  }
291
291
  if (!c.length) return [];
292
292
  if (n) {
293
- c.sort((g, M) => qe(M) - qe(g));
294
- const f = qe(c[0]), u = c.filter((g) => qe(g) >= f * 0.3);
293
+ c.sort((g, M) => Ke(M) - Ke(g));
294
+ const f = Ke(c[0]), u = c.filter((g) => Ke(g) >= f * 0.3);
295
295
  return u[u.length - 1] ?? c[0];
296
296
  }
297
297
  const a = c.filter((f) => f.length >= 3 && f[0].distanceTo(f[f.length - 1]) < r * 10), e = a.length > 0 ? a : c;
@@ -306,8 +306,8 @@ let __tla = (async () => {
306
306
  }
307
307
  return h;
308
308
  }
309
- function yn(t, r, n, o = false) {
310
- const s = new St(new k(0, 1, 0), -n), l = [], c = new Fn();
309
+ function wn(t, r, n, o = false) {
310
+ const s = new vt(new k(0, 1, 0), -n), l = [], c = new Pn();
311
311
  c.setFromBufferAttribute(r.getAttribute("position"));
312
312
  const a = {
313
313
  linePoints: [],
@@ -315,7 +315,7 @@ let __tla = (async () => {
315
315
  rightmostPoint: new k(0, n, 0)
316
316
  };
317
317
  if (!s.intersectsBox(c)) return a;
318
- const e = new Pn(), h = new k();
318
+ const e = new Ln(), h = new k();
319
319
  t.shapecast({
320
320
  intersectsBounds: (p) => s.intersectsBox(p),
321
321
  intersectsTriangle: (p) => {
@@ -326,9 +326,9 @@ let __tla = (async () => {
326
326
  });
327
327
  }
328
328
  });
329
- const d = Wn(l, Vt, o);
329
+ const d = In(l, Vt, o);
330
330
  if (d.length < 2) return a;
331
- const f = qe(d);
331
+ const f = Ke(d);
332
332
  let u = -1 / 0, g = new k(0, n, 0);
333
333
  for (const p of d) p.x > u && (u = p.x, g = p.clone());
334
334
  const M = d.length > 2 && d[0].distanceTo(d[d.length - 1]) < Vt * 10;
@@ -339,22 +339,22 @@ let __tla = (async () => {
339
339
  isClosed: M
340
340
  };
341
341
  }
342
- function Ge(t, r, n, o = false) {
343
- const s = yn(t, r, n, o);
342
+ function je(t, r, n, o = false) {
343
+ const s = wn(t, r, n, o);
344
344
  if (s.isClosed && s.linePoints.length >= 3) return s;
345
345
  ye.debug("slice", `y=${n.toFixed(2)} failed (pts=${s.linePoints.length}, closed=${s.isClosed}), retrying...`);
346
346
  let l = s;
347
347
  for (const c of Fo) {
348
- const a = yn(t, r, n + c, o);
348
+ const a = wn(t, r, n + c, o);
349
349
  if (a.isClosed && a.linePoints.length >= 3) return ye.debug("slice", `y=${n.toFixed(2)} recovered with offset ${c > 0 ? "+" : ""}${c}mm (pts=${a.linePoints.length}, len=${a.lineLength.toFixed(1)}mm)`), a;
350
350
  a.linePoints.length > l.linePoints.length && (l = a);
351
351
  }
352
352
  return ye.warn("slice", `y=${n.toFixed(2)} all retries exhausted (pts=${l.linePoints.length}, closed=${l.isClosed})`), l;
353
353
  }
354
354
  function Io(t, r, n, o) {
355
- const s = new St().setFromNormalAndCoplanarPoint(o.clone().normalize(), n), l = new Fn();
355
+ const s = new vt().setFromNormalAndCoplanarPoint(o.clone().normalize(), n), l = new Pn();
356
356
  if (l.setFromBufferAttribute(r.getAttribute("position")), !s.intersectsBox(l)) return 0;
357
- const c = [], a = new Pn(), e = new k();
357
+ const c = [], a = new Ln(), e = new k();
358
358
  t.shapecast({
359
359
  intersectsBounds: (d) => s.intersectsBox(d),
360
360
  intersectsTriangle: (d) => {
@@ -365,8 +365,8 @@ let __tla = (async () => {
365
365
  });
366
366
  }
367
367
  });
368
- const h = Wn(c, Vt);
369
- return qe(h);
368
+ const h = In(c, Vt);
369
+ return Ke(h);
370
370
  }
371
371
  function jt(t) {
372
372
  return new Ct(t, {
@@ -390,7 +390,7 @@ let __tla = (async () => {
390
390
  };
391
391
  const a = new Ct(t, {
392
392
  maxLeafTris: zt
393
- }), e = Ge(a, t, r);
393
+ }), e = je(a, t, r);
394
394
  if (e.lineLength === 0) return {
395
395
  valid: false,
396
396
  reason: "No circumference at green point \u2014 mesh may be empty at that height"
@@ -400,7 +400,7 @@ let __tla = (async () => {
400
400
  valid: true,
401
401
  reason: ""
402
402
  };
403
- const d = Ge(a, t, h);
403
+ const d = je(a, t, h);
404
404
  if (e.lineLength > 0 && d.lineLength > 0) {
405
405
  const u = e.lineLength / d.lineLength;
406
406
  if (u < 0.5) return {
@@ -410,7 +410,7 @@ let __tla = (async () => {
410
410
  }
411
411
  const f = r - o * 2;
412
412
  if (f > n) {
413
- const u = Ge(a, t, f);
413
+ const u = je(a, t, f);
414
414
  if (d.lineLength > 0 && u.lineLength > 0) {
415
415
  const g = d.lineLength / u.lineLength;
416
416
  if (g < 0.5) return {
@@ -447,8 +447,8 @@ let __tla = (async () => {
447
447
  }
448
448
  const fe = e[0].clone();
449
449
  a.translate(-fe.x, -fe.y, -fe.z), e = e.map((V) => new k(V.x - fe.x, V.y - fe.y, V.z - fe.z)), a.computeVertexNormals(), a.computeBoundingBox();
450
- const re = new k(e[0].x, e[0].y, e[0].z);
451
- e.push(re), o.addLandmarkPoint({
450
+ const oe = new k(e[0].x, e[0].y, e[0].z);
451
+ e.push(oe), o.addLandmarkPoint({
452
452
  faceIndex: -1,
453
453
  vertexIndices: [
454
454
  0,
@@ -456,9 +456,9 @@ let __tla = (async () => {
456
456
  2
457
457
  ],
458
458
  position: {
459
- x: re.x,
460
- y: re.y,
461
- z: re.z
459
+ x: oe.x,
460
+ y: oe.y,
461
+ z: oe.z
462
462
  },
463
463
  barycentricCoords: {
464
464
  u: 0.33,
@@ -474,7 +474,7 @@ let __tla = (async () => {
474
474
  a.computeBoundingBox(), a.boundingBox.getSize(G), o.setModelSize(Math.max(G.x, G.y, G.z)), s.dispose();
475
475
  return;
476
476
  }
477
- const { positions: f, indices: u } = vt(a), g = new Float32Array([
477
+ const { positions: f, indices: u } = St(a), g = new Float32Array([
478
478
  h.x,
479
479
  h.y,
480
480
  h.z
@@ -496,10 +496,10 @@ let __tla = (async () => {
496
496
  F[0],
497
497
  F[1],
498
498
  F[2]
499
- ]), S = c.align_to_origin(f, g, M, A);
500
- let C = S.positions(), L = S.mpt(), T = S.origin();
501
- const E = S.transform();
502
- ye.info(Me, "Alignment complete", S.details());
499
+ ]), v = c.align_to_origin(f, g, M, A);
500
+ let C = v.positions(), L = v.mpt(), T = v.origin();
501
+ const E = v.transform();
502
+ ye.info(Me, "Alignment complete", v.details());
503
503
  const w = [
504
504
  E[3],
505
505
  E[4],
@@ -518,22 +518,22 @@ let __tla = (async () => {
518
518
  o.onStatus("Generating measurement points...");
519
519
  const D = c.subdivide_origin_to_plane(new Float32Array(T), new Float32Array(L), z);
520
520
  ye.debug(Me, `Subdivide: ${D.count()} pts, spacing=${D.spacing().toFixed(1)}mm`);
521
- const B = D.points(), $ = D.count(), ee = 2, se = 1, ce = [];
522
- for (let O = ee; O < $ - se; O++) ce.push(B[O * 3 + 1]);
521
+ const B = D.points(), $ = D.count(), ee = 2, ie = 1, ce = [];
522
+ for (let O = ee; O < $ - ie; O++) ce.push(B[O * 3 + 1]);
523
523
  o.onStatus("Computing cross-sections...");
524
524
  let U = [];
525
525
  if (ce.length >= 2) {
526
526
  const X = (b ? c.batch_cross_sections_y_inner.bind(c) : c.batch_cross_sections_y.bind(c))(C, u, new Float32Array(ce), 10);
527
527
  ye.debug(Me, "Batch (subdivision)", X.details());
528
528
  const Q = X.all_loop_points(), ue = X.offsets(), fe = X.circumferences();
529
- for (let re = 0; re < ue.length - 1; re++) {
530
- const G = ue[re], V = ue[re + 1];
531
- if (V <= G || fe[re] <= 0) continue;
529
+ for (let oe = 0; oe < ue.length - 1; oe++) {
530
+ const G = ue[oe], V = ue[oe + 1];
531
+ if (V <= G || fe[oe] <= 0) continue;
532
532
  const ke = (V - G) / 3;
533
533
  if (ke < 3) continue;
534
- let Ae = 0, Ye = 0, me = 0;
535
- for (let ze = G; ze < V; ze += 3) Ae += Q[ze], Ye += Q[ze + 1], me += Q[ze + 2];
536
- U.push(Ae / ke, Ye / ke, me / ke);
534
+ let Ae = 0, Xe = 0, me = 0;
535
+ for (let ze = G; ze < V; ze += 3) Ae += Q[ze], Xe += Q[ze + 1], me += Q[ze + 2];
536
+ U.push(Ae / ke, Xe / ke, me / ke);
537
537
  }
538
538
  }
539
539
  if (U.length >= 6) {
@@ -541,8 +541,8 @@ let __tla = (async () => {
541
541
  const O = c.refine_alignment(new Float32Array(U), C, new Float32Array(T), new Float32Array(L));
542
542
  ye.info(Me, "Refinement complete", O.details()), C = O.positions(), L = O.mpt(), T = O.origin();
543
543
  }
544
- const oe = a.getAttribute("color"), J = Rn(C, u);
545
- oe && J.setAttribute("color", oe), a.dispose(), a = J, t.geometry = a, a.computeVertexNormals(), a.computeBoundingBox(), e[0] = new k(T[0], T[1], T[2]), e[1] = new k(L[0], L[1], L[2]), o.onStatus("Setting blue point...");
544
+ const ne = a.getAttribute("color"), J = Wn(C, u);
545
+ ne && J.setAttribute("color", ne), a.dispose(), a = J, t.geometry = a, a.computeVertexNormals(), a.computeBoundingBox(), e[0] = new k(T[0], T[1], T[2]), e[1] = new k(L[0], L[1], L[2]), o.onStatus("Setting blue point...");
546
546
  const Z = new k(e[0].x, e[0].y, e[0].z);
547
547
  e.push(Z), o.addLandmarkPoint({
548
548
  faceIndex: -1,
@@ -569,10 +569,10 @@ let __tla = (async () => {
569
569
  const ge = a.boundingBox, de = new k();
570
570
  ge.getSize(de), o.setModelSize(Math.max(de.x, de.y, de.z)), o.setCut(true), o.setAdjustedStartY(null), o.setAdjustedEndY(null), o.setOriginalEndY(e[1].y + 2 * wt), o.onStatus("Computing final measurements...");
571
571
  {
572
- const O = vt(a), X = e[1].y, Q = e[0].y;
572
+ const O = St(a), X = e[1].y, Q = e[0].y;
573
573
  let ue = 1 / 0, fe = -1 / 0;
574
- const re = O.positions;
575
- for (let me = 1; me < re.length; me += 3) re[me] < ue && (ue = re[me]), re[me] > fe && (fe = re[me]);
574
+ const oe = O.positions;
575
+ for (let me = 1; me < oe.length; me += 3) oe[me] < ue && (ue = oe[me]), oe[me] > fe && (fe = oe[me]);
576
576
  const G = 25.4, V = [];
577
577
  V.push(X);
578
578
  for (let me = 1; me <= 2; me++) {
@@ -583,7 +583,7 @@ let __tla = (async () => {
583
583
  V.sort((me, ze) => me - ze), ye.info(Me, `Horizontal slices: ${V.length} Y planes, range ${(_b = V[0]) == null ? void 0 : _b.toFixed(1)} \u2192 ${(_c = V[V.length - 1]) == null ? void 0 : _c.toFixed(1)} mm`);
584
584
  const Ae = (b ? c.batch_cross_sections_y_inner.bind(c) : c.batch_cross_sections_y.bind(c))(O.positions, O.indices, new Float32Array(V), 10);
585
585
  ye.info(Me, `Horizontal slices (${b ? "inner" : "outer"}): ${Ae.count()}/${V.length} valid`), ye.debug(Me, "Slice details", Ae.details());
586
- const Ye = {
586
+ const Xe = {
587
587
  yValues: V,
588
588
  circumferences: Array.from(Ae.circumferences()),
589
589
  allLoopPoints: new Float32Array(Ae.all_loop_points()),
@@ -591,10 +591,10 @@ let __tla = (async () => {
591
591
  mptY: X,
592
592
  originY: Q
593
593
  };
594
- (_d = o.setWasmSlices) == null ? void 0 : _d.call(o, Ye);
594
+ (_d = o.setWasmSlices) == null ? void 0 : _d.call(o, Xe);
595
595
  }
596
596
  o.onStatus("Validating results...");
597
- const he = e[1].y, ve = e[0].y, te = Bo(a, he, ve, n);
597
+ const he = e[1].y, Se = e[0].y, te = Bo(a, he, Se, n);
598
598
  te.valid || ye.warn(Me, `Validation: ${te.reason}`), o.setClippedReferenceGeometry ? (s.computeVertexNormals(), o.setClippedReferenceGeometry(s)) : s.dispose();
599
599
  } catch (a) {
600
600
  ye.error(Me, "Processing failed", a), o.setError(a instanceof Error ? a.message : "Failed to process mesh."), s.dispose();
@@ -619,7 +619,7 @@ let __tla = (async () => {
619
619
  console.error("[ErrorBoundary] Caught error:", r, n.componentStack);
620
620
  }
621
621
  render() {
622
- return this.state.error ? this.props.fallback ? this.props.fallback(this.state.error, this.reset) : v("div", {
622
+ return this.state.error ? this.props.fallback ? this.props.fallback(this.state.error, this.reset) : S("div", {
623
623
  style: {
624
624
  display: "flex",
625
625
  flexDirection: "column",
@@ -667,7 +667,7 @@ let __tla = (async () => {
667
667
  }) : this.props.children;
668
668
  }
669
669
  }
670
- const $o = ({ message: t, onDismiss: r }) => v("div", {
670
+ const $o = ({ message: t, onDismiss: r }) => S("div", {
671
671
  style: {
672
672
  position: "absolute",
673
673
  top: 16,
@@ -684,7 +684,7 @@ let __tla = (async () => {
684
684
  gap: 12
685
685
  },
686
686
  children: [
687
- v("div", {
687
+ S("div", {
688
688
  style: {
689
689
  flex: 1
690
690
  },
@@ -720,7 +720,7 @@ let __tla = (async () => {
720
720
  children: "x"
721
721
  })
722
722
  ]
723
- }), wn = ({ message: t }) => v("div", {
723
+ }), Sn = ({ message: t }) => S("div", {
724
724
  style: {
725
725
  position: "absolute",
726
726
  top: 0,
@@ -767,7 +767,7 @@ let __tla = (async () => {
767
767
  };
768
768
  }
769
769
  const Ho = ({ mesh: t, maxPoints: r = 2, meshColor: n = "#c8c8c8", meshOpacity: o = 1, frontFaceOnly: s = false, doubleShellTransparency: l = false }) => {
770
- const { addLandmarkPoint: c, landmarkPoints: a } = Gt(), e = ie((g) => {
770
+ const { addLandmarkPoint: c, landmarkPoints: a } = Gt(), e = re((g) => {
771
771
  if (a.length >= r) return;
772
772
  g.stopPropagation();
773
773
  const M = g.intersections[0], p = M == null ? void 0 : M.faceIndex;
@@ -783,9 +783,9 @@ let __tla = (async () => {
783
783
  p * 3 + 1,
784
784
  p * 3 + 2
785
785
  ];
786
- const y = b.getAttribute("position"), F = new k().fromBufferAttribute(y, P[0]), A = new k().fromBufferAttribute(y, P[1]), S = new k().fromBufferAttribute(y, P[2]);
787
- F.applyMatrix4(t.matrixWorld), A.applyMatrix4(t.matrixWorld), S.applyMatrix4(t.matrixWorld);
788
- const C = M.point, L = Oo(C, F, A, S), T = {
786
+ const y = b.getAttribute("position"), F = new k().fromBufferAttribute(y, P[0]), A = new k().fromBufferAttribute(y, P[1]), v = new k().fromBufferAttribute(y, P[2]);
787
+ F.applyMatrix4(t.matrixWorld), A.applyMatrix4(t.matrixWorld), v.applyMatrix4(t.matrixWorld);
788
+ const C = M.point, L = Oo(C, F, A, v), T = {
789
789
  faceIndex: p,
790
790
  vertexIndices: P,
791
791
  position: {
@@ -828,7 +828,7 @@ let __tla = (async () => {
828
828
  });
829
829
  }, No = ({ point: t, index: r, markerSize: n, color: o, label: s }) => {
830
830
  const [l, c] = I(false);
831
- return v("mesh", {
831
+ return S("mesh", {
832
832
  position: [
833
833
  t.position.x,
834
834
  t.position.y,
@@ -847,7 +847,7 @@ let __tla = (async () => {
847
847
  i("meshBasicMaterial", {
848
848
  color: o
849
849
  }),
850
- l && i(Xe, {
850
+ l && i(Ge, {
851
851
  center: true,
852
852
  style: {
853
853
  pointerEvents: "none"
@@ -888,7 +888,7 @@ let __tla = (async () => {
888
888
  }, e))
889
889
  });
890
890
  };
891
- function In(t) {
891
+ function Bn(t) {
892
892
  return Y(() => t ? new Ct(t, {
893
893
  maxLeafTris: zt
894
894
  }) : null, [
@@ -898,14 +898,14 @@ let __tla = (async () => {
898
898
  const vn = (t, r) => {
899
899
  const n = Math.abs(t - r);
900
900
  return n <= 7 ? "#8BC34A" : n <= 20 ? "#FFC107" : "#FF5722";
901
- }, Sn = new j.Color("#8BC34A"), Cn = new j.Color("#FFC107"), jo = new j.Color("#FF5722"), Go = (t) => {
902
- if (t <= 7) return Sn.clone();
901
+ }, Cn = new j.Color("#8BC34A"), zn = new j.Color("#FFC107"), jo = new j.Color("#FF5722"), Go = (t) => {
902
+ if (t <= 7) return Cn.clone();
903
903
  if (t <= 20) {
904
904
  const n = (t - 7) / 13;
905
- return Sn.clone().lerp(Cn, n);
905
+ return Cn.clone().lerp(zn, n);
906
906
  }
907
907
  const r = Math.min((t - 20) / 20, 1);
908
- return Cn.clone().lerp(jo, r);
908
+ return zn.clone().lerp(jo, r);
909
909
  }, Xo = (t, r) => {
910
910
  const n = t.length, o = new Float32Array(n * 2 * 3), s = new Float32Array(n * 2 * 3), l = [];
911
911
  for (let e = 0; e < n; e++) {
@@ -927,7 +927,7 @@ let __tla = (async () => {
927
927
  });
928
928
  return new j.Mesh(c, a);
929
929
  }, Yo = ({ bvh: t, geometry: r, yPosition: n, color: o = "#00ff00", labelX: s, onDataChange: l, displayUnit: c = "mm", useInnerSurface: a = false, formValue: e, lineWidth: h = 1.5, wasmLoopPoints: d, wasmCircumference: f }) => {
930
- const u = Y(() => d && f != null ? null : Ge(t, r, n, a), [
930
+ const u = Y(() => d && f != null ? null : je(t, r, n, a), [
931
931
  t,
932
932
  r,
933
933
  n,
@@ -936,8 +936,8 @@ let __tla = (async () => {
936
936
  f
937
937
  ]), g = d ?? (u == null ? void 0 : u.linePoints) ?? [], M = f ?? (u == null ? void 0 : u.lineLength) ?? 0, p = Y(() => {
938
938
  if (e == null || e === 0 || M <= 0 || g.length < 2) return null;
939
- const y = e / M, F = g.reduce((S, C) => S + C.x, 0) / g.length, A = g.reduce((S, C) => S + C.z, 0) / g.length;
940
- return g.map((S) => new k(F + (S.x - F) * y, S.y, A + (S.z - A) * y));
939
+ const y = e / M, F = g.reduce((v, C) => v + C.x, 0) / g.length, A = g.reduce((v, C) => v + C.z, 0) / g.length;
940
+ return g.map((v) => new k(F + (v.x - F) * y, v.y, A + (v.z - A) * y));
941
941
  }, [
942
942
  g,
943
943
  M,
@@ -976,24 +976,24 @@ let __tla = (async () => {
976
976
  M,
977
977
  n,
978
978
  l
979
- ]), An(({ camera: y }) => {
979
+ ]), Mn(({ camera: y }) => {
980
980
  if (!m.current || g.length < 2) return;
981
981
  const F = new k();
982
982
  y.getWorldDirection(F);
983
983
  const A = new k(F.x, 0, F.z);
984
984
  if (A.lengthSq() < 1e-8) return;
985
985
  A.normalize();
986
- const S = new k().crossVectors(A, new k(0, 1, 0)).normalize();
986
+ const v = new k().crossVectors(A, new k(0, 1, 0)).normalize();
987
987
  let C = -1 / 0, L = g[0];
988
988
  for (const z of g) {
989
- const D = S.x * z.x + S.z * z.z;
989
+ const D = v.x * z.x + v.z * z.z;
990
990
  D > C && (C = D, L = z);
991
991
  }
992
- const T = s * 0.35, E = new k(L.x + S.x * T, n, L.z + S.z * T);
992
+ const T = s * 0.35, E = new k(L.x + v.x * T, n, L.z + v.z * T);
993
993
  m.current.position.copy(E);
994
994
  const w = P.geometry.getAttribute("position");
995
995
  w.setXYZ(0, L.x, L.y, L.z), w.setXYZ(1, E.x, E.y, E.z), w.needsUpdate = true;
996
- }), g.length < 2 ? null : v("group", {
996
+ }), g.length < 2 ? null : S("group", {
997
997
  renderOrder: 10,
998
998
  children: [
999
999
  i(we, {
@@ -1028,7 +1028,7 @@ let __tla = (async () => {
1028
1028
  }),
1029
1029
  i("group", {
1030
1030
  ref: m,
1031
- children: i(Xe, {
1031
+ children: i(Ge, {
1032
1032
  zIndexRange: [
1033
1033
  100,
1034
1034
  0
@@ -1037,7 +1037,7 @@ let __tla = (async () => {
1037
1037
  pointerEvents: "none",
1038
1038
  transform: "translateY(-50%)"
1039
1039
  },
1040
- children: v("div", {
1040
+ children: S("div", {
1041
1041
  style: {
1042
1042
  display: "flex",
1043
1043
  alignItems: "stretch",
@@ -1047,7 +1047,7 @@ let __tla = (async () => {
1047
1047
  whiteSpace: "nowrap"
1048
1048
  },
1049
1049
  children: [
1050
- v("div", {
1050
+ S("div", {
1051
1051
  style: {
1052
1052
  display: "flex",
1053
1053
  alignItems: "center",
@@ -1079,7 +1079,7 @@ let __tla = (async () => {
1079
1079
  }),
1080
1080
  e != null && e !== 0 && M > 0 && (() => {
1081
1081
  const y = M - e, F = y > 0.5 ? "\u25B2" : y < -0.5 ? "\u25BC" : "", A = vn(M, e);
1082
- return v("div", {
1082
+ return S("div", {
1083
1083
  style: {
1084
1084
  display: "flex",
1085
1085
  alignItems: "center",
@@ -1098,7 +1098,7 @@ let __tla = (async () => {
1098
1098
  },
1099
1099
  children: F
1100
1100
  }),
1101
- v("span", {
1101
+ S("span", {
1102
1102
  style: {
1103
1103
  fontSize: 13,
1104
1104
  color: A,
@@ -1110,7 +1110,7 @@ let __tla = (async () => {
1110
1110
  c === "inch" ? (y / 25.4).toFixed(2) : y.toFixed(1)
1111
1111
  ]
1112
1112
  }),
1113
- v("span", {
1113
+ S("span", {
1114
1114
  style: {
1115
1115
  fontSize: 11,
1116
1116
  color: "rgba(255,255,255,0.4)",
@@ -1131,7 +1131,7 @@ let __tla = (async () => {
1131
1131
  ]
1132
1132
  });
1133
1133
  }, Zo = bo(Yo), Ko = ({ mesh: t, startY: r, endY: n, spacing: o, modelSize: s, onMeasurementsChange: l, reverseOrder: c = false, displayUnit: a = "mm", useInnerSurface: e = false, formMeasurements: h, originY: d, wasmSlices: f }) => {
1134
- const u = ae(/* @__PURE__ */ new Map()), g = t.geometry, M = In(g), p = Y(() => {
1134
+ const u = ae(/* @__PURE__ */ new Map()), g = t.geometry, M = Bn(g), p = Y(() => {
1135
1135
  if (f) {
1136
1136
  let C = [
1137
1137
  ...f.yValues
@@ -1146,8 +1146,8 @@ let __tla = (async () => {
1146
1146
  return c ? C.sort((L, T) => T - L) : C.sort((L, T) => L - T), C;
1147
1147
  }
1148
1148
  const A = [];
1149
- if (c) for (let S = n; S >= r; S -= o) A.push(S);
1150
- else for (let S = r; S <= n; S += o) A.push(S);
1149
+ if (c) for (let v = n; v >= r; v -= o) A.push(v);
1150
+ else for (let v = r; v <= n; v += o) A.push(v);
1151
1151
  return A;
1152
1152
  }, [
1153
1153
  r,
@@ -1157,12 +1157,12 @@ let __tla = (async () => {
1157
1157
  f
1158
1158
  ]), b = Y(() => {
1159
1159
  if (!f) return null;
1160
- const A = /* @__PURE__ */ new Map(), { allLoopPoints: S, offsets: C, yValues: L } = f;
1160
+ const A = /* @__PURE__ */ new Map(), { allLoopPoints: v, offsets: C, yValues: L } = f;
1161
1161
  for (let T = 0; T < C.length - 1; T++) {
1162
1162
  const E = C[T], w = C[T + 1];
1163
1163
  if (w <= E) continue;
1164
1164
  const z = [];
1165
- for (let D = E; D < w; D += 3) z.push(new k(S[D], S[D + 1], S[D + 2]));
1165
+ for (let D = E; D < w; D += 3) z.push(new k(v[D], v[D + 1], v[D + 2]));
1166
1166
  z.length >= 3 && A.set(L[T], z);
1167
1167
  }
1168
1168
  return A;
@@ -1171,7 +1171,7 @@ let __tla = (async () => {
1171
1171
  ]), m = Y(() => {
1172
1172
  if (!f) return null;
1173
1173
  const A = /* @__PURE__ */ new Map();
1174
- for (let S = 0; S < f.yValues.length; S++) A.set(f.yValues[S], f.circumferences[S]);
1174
+ for (let v = 0; v < f.yValues.length; v++) A.set(f.yValues[v], f.circumferences[v]);
1175
1175
  return A;
1176
1176
  }, [
1177
1177
  f
@@ -1182,9 +1182,9 @@ let __tla = (async () => {
1182
1182
  p
1183
1183
  ]), q(() => {
1184
1184
  if (!m || !l) return;
1185
- const A = p.filter((S) => (m.get(S) ?? 0) > 0).map((S) => ({
1186
- yPosition: S,
1187
- originalValue: m.get(S) ?? 0,
1185
+ const A = p.filter((v) => (m.get(v) ?? 0) > 0).map((v) => ({
1186
+ yPosition: v,
1187
+ originalValue: m.get(v) ?? 0,
1188
1188
  modifiedValue: null
1189
1189
  }));
1190
1190
  l(A);
@@ -1195,27 +1195,27 @@ let __tla = (async () => {
1195
1195
  ]);
1196
1196
  const P = [
1197
1197
  "#5B9BD5"
1198
- ], y = s * ko, F = ie((A) => {
1198
+ ], y = s * ko, F = re((A) => {
1199
1199
  if (m) return;
1200
1200
  u.current.set(A.yPosition, A);
1201
- const S = Array.from(u.current.values()).sort((C, L) => c ? L.yPosition - C.yPosition : C.yPosition - L.yPosition);
1202
- l == null ? void 0 : l(S);
1201
+ const v = Array.from(u.current.values()).sort((C, L) => c ? L.yPosition - C.yPosition : C.yPosition - L.yPosition);
1202
+ l == null ? void 0 : l(v);
1203
1203
  }, [
1204
1204
  l,
1205
1205
  c,
1206
1206
  m
1207
1207
  ]);
1208
1208
  return M ? i(Ie, {
1209
- children: p.map((A, S) => i(Zo, {
1209
+ children: p.map((A, v) => i(Zo, {
1210
1210
  bvh: M,
1211
1211
  geometry: g,
1212
1212
  yPosition: A,
1213
- color: d != null && Math.abs(A - d) < o * 0.5 ? "#44ff44" : P[S % P.length],
1213
+ color: d != null && Math.abs(A - d) < o * 0.5 ? "#44ff44" : P[v % P.length],
1214
1214
  labelX: y,
1215
1215
  onDataChange: F,
1216
1216
  displayUnit: a,
1217
1217
  useInnerSurface: e,
1218
- formValue: h == null ? void 0 : h[S],
1218
+ formValue: h == null ? void 0 : h[v],
1219
1219
  lineWidth: d != null && Math.abs(A - d) < o * 0.5 ? 4 : 1.5,
1220
1220
  wasmLoopPoints: b == null ? void 0 : b.get(A),
1221
1221
  wasmCircumference: m == null ? void 0 : m.get(A)
@@ -1229,20 +1229,20 @@ let __tla = (async () => {
1229
1229
  const c = t.geometry;
1230
1230
  c.computeBoundingBox();
1231
1231
  const a = s ?? ((_a = c.boundingBox) == null ? void 0 : _a.min.y) ?? 0, e = r - a, h = n * 0.4, d = n * 0.03, f = ae(null);
1232
- An(({ camera: S }) => {
1232
+ Mn(({ camera: v }) => {
1233
1233
  if (!f.current) return;
1234
1234
  const C = new k();
1235
- S.getWorldDirection(C);
1235
+ v.getWorldDirection(C);
1236
1236
  const L = new k(C.x, 0, C.z);
1237
1237
  if (L.lengthSq() < 1e-8) return;
1238
1238
  L.normalize();
1239
1239
  const T = new k().crossVectors(new k(0, 1, 0), L).normalize();
1240
1240
  f.current.position.set(T.x * h, 0, T.z * h);
1241
- const E = S.position.x - f.current.position.x, w = S.position.z - f.current.position.z;
1241
+ const E = v.position.x - f.current.position.x, w = v.position.z - f.current.position.z;
1242
1242
  f.current.rotation.y = Math.atan2(E, w);
1243
1243
  });
1244
1244
  const u = new k(0, r, 0), g = new k(0, a, 0), M = new k(0, (r + a) / 2, 0), p = new k(-d, r, 0), b = new k(d, r, 0), m = new k(-d, a, 0), P = new k(d, a, 0), y = l != null && l > 0, F = y ? e - l : 0, A = y ? qo(e, l) : "#fff";
1245
- return v("group", {
1245
+ return S("group", {
1246
1246
  ref: f,
1247
1247
  children: [
1248
1248
  i(we, {
@@ -1271,7 +1271,7 @@ let __tla = (async () => {
1271
1271
  }),
1272
1272
  i("mesh", {
1273
1273
  position: M,
1274
- children: i(Xe, {
1274
+ children: i(Ge, {
1275
1275
  center: true,
1276
1276
  style: {
1277
1277
  pointerEvents: "none"
@@ -1280,7 +1280,7 @@ let __tla = (async () => {
1280
1280
  0,
1281
1281
  0
1282
1282
  ],
1283
- children: v("div", {
1283
+ children: S("div", {
1284
1284
  style: {
1285
1285
  display: "flex",
1286
1286
  flexDirection: "column",
@@ -1291,7 +1291,7 @@ let __tla = (async () => {
1291
1291
  pointerEvents: "none"
1292
1292
  },
1293
1293
  children: [
1294
- v("div", {
1294
+ S("div", {
1295
1295
  style: {
1296
1296
  padding: "4px 8px",
1297
1297
  backgroundColor: "rgba(0, 0, 0, 0.75)",
@@ -1308,7 +1308,7 @@ let __tla = (async () => {
1308
1308
  o === "inch" ? "in" : "mm"
1309
1309
  ]
1310
1310
  }),
1311
- y && v("div", {
1311
+ y && S("div", {
1312
1312
  style: {
1313
1313
  display: "flex",
1314
1314
  alignItems: "center",
@@ -1329,7 +1329,7 @@ let __tla = (async () => {
1329
1329
  },
1330
1330
  children: F > 0.5 ? "\u25B2" : "\u25BC"
1331
1331
  }),
1332
- v("span", {
1332
+ S("span", {
1333
1333
  style: {
1334
1334
  fontSize: 13,
1335
1335
  color: A,
@@ -1341,7 +1341,7 @@ let __tla = (async () => {
1341
1341
  o === "inch" ? (F / 25.4).toFixed(2) : F.toFixed(1)
1342
1342
  ]
1343
1343
  }),
1344
- v("span", {
1344
+ S("span", {
1345
1345
  style: {
1346
1346
  fontSize: 11,
1347
1347
  color: "rgba(255,255,255,0.4)",
@@ -1361,10 +1361,10 @@ let __tla = (async () => {
1361
1361
  ]
1362
1362
  });
1363
1363
  }, Jo = ({ modelSize: t, isAligned: r, isCut: n, mesh: o, viewMode: s, sliceY: l, landmarkCount: c = 0, measurementGeometry: a, fitYMin: e, fitYMax: h, resetCameraToFrontRef: d }) => {
1364
- const { set: f, size: u, camera: g, invalidate: M } = Mn(), p = ae(false), b = ae(s), m = ae(new k()), P = ae(null), y = ae(c), F = ae(r), A = ae(n), S = ae(a), C = ae({
1364
+ const { set: f, size: u, camera: g, invalidate: M } = kn(), p = ae(false), b = ae(s), m = ae(new k()), P = ae(null), y = ae(c), F = ae(r), A = ae(n), v = ae(a), C = ae({
1365
1365
  min: e,
1366
1366
  max: h
1367
- }), L = ae(0), T = ie(() => {
1367
+ }), L = ae(0), T = re(() => {
1368
1368
  if (!o || t <= 0) return null;
1369
1369
  const w = a ?? o.geometry;
1370
1370
  w.computeBoundingBox();
@@ -1376,21 +1376,21 @@ let __tla = (async () => {
1376
1376
  if ($) {
1377
1377
  const ge = e, de = h, he = w.getAttribute("position");
1378
1378
  if (he) {
1379
- const ve = he.array, te = (de - ge) * 0.08;
1379
+ const Se = he.array, te = (de - ge) * 0.08;
1380
1380
  let O = 1 / 0, X = -1 / 0, Q = ge - te, ue = de + te, fe = false;
1381
- for (let re = 0; re < he.count; re++) {
1382
- const G = ve[re * 3 + 1];
1381
+ for (let oe = 0; oe < he.count; oe++) {
1382
+ const G = Se[oe * 3 + 1];
1383
1383
  if (G < ge - te || G > de + te) continue;
1384
- const V = ve[re * 3];
1384
+ const V = Se[oe * 3];
1385
1385
  V < O && (O = V), V > X && (X = V), fe = true;
1386
1386
  }
1387
1387
  fe && (D.set((O + X) / 2, (Q + ue) / 2, 0), B.set(X - O, ue - Q, 0));
1388
1388
  }
1389
1389
  }
1390
1390
  m.current.copy(B);
1391
- const ee = u.width / u.height, se = 1.35, ce = $ ? 1.15 : 1.6, U = Math.max(B.y * ce, B.x * se / ee), oe = U * ee, J = D.y - B.y * 0.05;
1391
+ const ee = u.width / u.height, ie = 1.35, ce = $ ? 1.15 : 1.6, U = Math.max(B.y * ce, B.x * ie / ee), ne = U * ee, J = D.y - B.y * 0.05;
1392
1392
  L.current = J;
1393
- const Z = new j.OrthographicCamera(-oe / 2, oe / 2, U / 2, -U / 2, 0.1, t * 10);
1393
+ const Z = new j.OrthographicCamera(-ne / 2, ne / 2, U / 2, -U / 2, 0.1, t * 10);
1394
1394
  return Z.position.set(0, J, t * 2), Z.lookAt(0, J, 0), Z;
1395
1395
  }, [
1396
1396
  o,
@@ -1415,9 +1415,9 @@ let __tla = (async () => {
1415
1415
  f,
1416
1416
  M
1417
1417
  ]);
1418
- const E = ie((w) => {
1419
- const z = w.position.clone(), D = z.length(), B = Math.atan2(z.x, z.z), $ = Math.acos(z.y / D), se = B + 0.02;
1420
- w.position.set(D * Math.sin($) * Math.sin(se), D * Math.cos($), D * Math.sin($) * Math.cos(se)), w.lookAt(0, 0, 0), w.updateMatrixWorld(true), M();
1418
+ const E = re((w) => {
1419
+ const z = w.position.clone(), D = z.length(), B = Math.atan2(z.x, z.z), $ = Math.acos(z.y / D), ie = B + 0.02;
1420
+ w.position.set(D * Math.sin($) * Math.sin(ie), D * Math.cos($), D * Math.sin($) * Math.cos(ie)), w.lookAt(0, 0, 0), w.updateMatrixWorld(true), M();
1421
1421
  }, [
1422
1422
  M
1423
1423
  ]);
@@ -1444,8 +1444,8 @@ let __tla = (async () => {
1444
1444
  g,
1445
1445
  E
1446
1446
  ]), q(() => {
1447
- const w = F.current !== r, z = A.current !== n, D = !S.current && !!a, B = (C.current.min == null || C.current.max == null) && e != null && h != null;
1448
- if (F.current = r, A.current = n, S.current = a, C.current = {
1447
+ const w = F.current !== r, z = A.current !== n, D = !v.current && !!a, B = (C.current.min == null || C.current.max == null) && e != null && h != null;
1448
+ if (F.current = r, A.current = n, v.current = a, C.current = {
1449
1449
  min: e,
1450
1450
  max: h
1451
1451
  }, !w && !z && !D && !B || !r || s !== "3D") return;
@@ -1469,19 +1469,19 @@ let __tla = (async () => {
1469
1469
  if (s === "2D" && l != null) {
1470
1470
  P.current = g;
1471
1471
  const z = o.geometry, D = z.getAttribute("position"), B = D.array, $ = t * 0.15;
1472
- let ee = 1 / 0, se = -1 / 0, ce = 1 / 0, U = -1 / 0, oe = false;
1472
+ let ee = 1 / 0, ie = -1 / 0, ce = 1 / 0, U = -1 / 0, ne = false;
1473
1473
  for (let Q = 0; Q < D.count; Q++) if (Math.abs(B[Q * 3 + 1] - l) < $) {
1474
1474
  const ue = B[Q * 3], fe = B[Q * 3 + 2];
1475
- ue < ee && (ee = ue), ue > se && (se = ue), fe < ce && (ce = fe), fe > U && (U = fe), oe = true;
1475
+ ue < ee && (ee = ue), ue > ie && (ie = ue), fe < ce && (ce = fe), fe > U && (U = fe), ne = true;
1476
1476
  }
1477
- if (!oe) {
1477
+ if (!ne) {
1478
1478
  z.computeBoundingBox();
1479
1479
  const Q = z.boundingBox;
1480
- ee = Q.min.x, se = Q.max.x, ce = Q.min.z, U = Q.max.z;
1480
+ ee = Q.min.x, ie = Q.max.x, ce = Q.min.z, U = Q.max.z;
1481
1481
  }
1482
- const J = (ee + se) / 2, Z = (ce + U) / 2, ge = u.width / u.height, de = 1.4, he = (se - ee) * de, ve = (U - ce) * de;
1482
+ const J = (ee + ie) / 2, Z = (ce + U) / 2, ge = u.width / u.height, de = 1.4, he = (ie - ee) * de, Se = (U - ce) * de;
1483
1483
  let te, O;
1484
- he / ve > ge ? (te = he, O = he / ge) : (O = ve, te = ve * ge);
1484
+ he / Se > ge ? (te = he, O = he / ge) : (O = Se, te = Se * ge);
1485
1485
  const X = new j.OrthographicCamera(-te / 2, te / 2, O / 2, -O / 2, 0.1, t * 10);
1486
1486
  X.position.set(J, l + t * 2, Z), X.up.set(0, 0, -1), X.lookAt(J, l, Z), f({
1487
1487
  camera: X
@@ -1512,19 +1512,19 @@ let __tla = (async () => {
1512
1512
  if (s === "2D") {
1513
1513
  if (!o || l == null) return;
1514
1514
  const z = o.geometry, D = z.getAttribute("position"), B = D.array, $ = t * 0.15;
1515
- let ee = 1 / 0, se = -1 / 0, ce = 1 / 0, U = -1 / 0, oe = false;
1515
+ let ee = 1 / 0, ie = -1 / 0, ce = 1 / 0, U = -1 / 0, ne = false;
1516
1516
  for (let te = 0; te < D.count; te++) if (Math.abs(B[te * 3 + 1] - l) < $) {
1517
1517
  const O = B[te * 3], X = B[te * 3 + 2];
1518
- O < ee && (ee = O), O > se && (se = O), X < ce && (ce = X), X > U && (U = X), oe = true;
1518
+ O < ee && (ee = O), O > ie && (ie = O), X < ce && (ce = X), X > U && (U = X), ne = true;
1519
1519
  }
1520
- if (!oe) {
1520
+ if (!ne) {
1521
1521
  z.computeBoundingBox();
1522
1522
  const te = z.boundingBox;
1523
- ee = te.min.x, se = te.max.x, ce = te.min.z, U = te.max.z;
1523
+ ee = te.min.x, ie = te.max.x, ce = te.min.z, U = te.max.z;
1524
1524
  }
1525
- const J = u.width / u.height, Z = 1.4, ge = (se - ee) * Z, de = (U - ce) * Z;
1526
- let he, ve;
1527
- ge / de > J ? (he = ge, ve = ge / J) : (ve = de, he = de * J), w.left = -he / 2, w.right = he / 2, w.top = ve / 2, w.bottom = -ve / 2;
1525
+ const J = u.width / u.height, Z = 1.4, ge = (ie - ee) * Z, de = (U - ce) * Z;
1526
+ let he, Se;
1527
+ ge / de > J ? (he = ge, Se = ge / J) : (Se = de, he = de * J), w.left = -he / 2, w.right = he / 2, w.top = Se / 2, w.bottom = -Se / 2;
1528
1528
  } else {
1529
1529
  const z = m.current, D = u.width / u.height, B = Math.max(z.y, z.x / D) * 1.6, $ = B * D;
1530
1530
  w.left = -$ / 2, w.right = $ / 2, w.top = B / 2, w.bottom = -B / 2;
@@ -1543,7 +1543,7 @@ let __tla = (async () => {
1543
1543
  const n = t.geometry;
1544
1544
  n.computeBoundingBox();
1545
1545
  const o = new k();
1546
- return (_a = n.boundingBox) == null ? void 0 : _a.getCenter(o), i(kn, {
1546
+ return (_a = n.boundingBox) == null ? void 0 : _a.getCenter(o), i(Fn, {
1547
1547
  enableDamping: false,
1548
1548
  enablePan: false,
1549
1549
  minPolarAngle: Math.PI * 0.15,
@@ -1557,7 +1557,7 @@ let __tla = (async () => {
1557
1557
  o.z
1558
1558
  ]
1559
1559
  });
1560
- }, er = ({ wasAutoScaled: t, onDismiss: r }) => v("div", {
1560
+ }, er = ({ wasAutoScaled: t, onDismiss: r }) => S("div", {
1561
1561
  style: {
1562
1562
  position: "absolute",
1563
1563
  top: 16,
@@ -1601,7 +1601,7 @@ let __tla = (async () => {
1601
1601
  }), tr = ({ isDoubleShell: t, onDismiss: r }) => (q(() => {
1602
1602
  const n = setTimeout(r, 1e4);
1603
1603
  return () => clearTimeout(n);
1604
- }, []), v("div", {
1604
+ }, []), S("div", {
1605
1605
  style: {
1606
1606
  position: "absolute",
1607
1607
  top: 64,
@@ -1647,22 +1647,22 @@ let __tla = (async () => {
1647
1647
  maxLeafTris: zt
1648
1648
  }), [
1649
1649
  c
1650
- ]), e = Y(() => Ge(a, c, n), [
1650
+ ]), e = Y(() => je(a, c, n), [
1651
1651
  a,
1652
1652
  c,
1653
1653
  n
1654
- ]), h = Y(() => new St(new k(0, -1, 0), r), [
1654
+ ]), h = Y(() => new vt(new k(0, -1, 0), r), [
1655
1655
  r
1656
1656
  ]), { mlLine: d, apLine: f, mlWidth: u, apWidth: g } = Y(() => {
1657
1657
  let b = null, m = null, P = 0, y = 0;
1658
1658
  if (e.linePoints.length >= 2) {
1659
- let F = e.linePoints[0], A = e.linePoints[0], S = e.linePoints[0], C = e.linePoints[0];
1660
- for (const L of e.linePoints) L.x < F.x && (F = L), L.x > A.x && (A = L), L.z < S.z && (S = L), L.z > C.z && (C = L);
1659
+ let F = e.linePoints[0], A = e.linePoints[0], v = e.linePoints[0], C = e.linePoints[0];
1660
+ for (const L of e.linePoints) L.x < F.x && (F = L), L.x > A.x && (A = L), L.z < v.z && (v = L), L.z > C.z && (C = L);
1661
1661
  b = [
1662
1662
  new k(F.x, n, F.z),
1663
1663
  new k(A.x, n, A.z)
1664
1664
  ], m = [
1665
- new k(S.x, n, S.z),
1665
+ new k(v.x, n, v.z),
1666
1666
  new k(C.x, n, C.z)
1667
1667
  ], P = b[0].distanceTo(b[1]), y = m[0].distanceTo(m[1]);
1668
1668
  }
@@ -1676,7 +1676,7 @@ let __tla = (async () => {
1676
1676
  e,
1677
1677
  n
1678
1678
  ]), M = (b) => l === "inch" ? (b / 25.4).toFixed(2) : b.toFixed(1), p = l === "inch" ? "in" : "mm";
1679
- return v(Ie, {
1679
+ return S(Ie, {
1680
1680
  children: [
1681
1681
  i("mesh", {
1682
1682
  geometry: t.geometry,
@@ -1699,7 +1699,7 @@ let __tla = (async () => {
1699
1699
  depthWrite: false,
1700
1700
  transparent: true
1701
1701
  }),
1702
- d && v(Ie, {
1702
+ d && S(Ie, {
1703
1703
  children: [
1704
1704
  i(we, {
1705
1705
  points: d,
@@ -1709,7 +1709,7 @@ let __tla = (async () => {
1709
1709
  depthWrite: false,
1710
1710
  transparent: true
1711
1711
  }),
1712
- i(Xe, {
1712
+ i(Ge, {
1713
1713
  position: [
1714
1714
  d[0].x,
1715
1715
  n,
@@ -1726,7 +1726,7 @@ let __tla = (async () => {
1726
1726
  backgroundColor: "rgba(0,0,0,0.75)",
1727
1727
  borderRadius: 3
1728
1728
  },
1729
- children: v("span", {
1729
+ children: S("span", {
1730
1730
  style: {
1731
1731
  fontSize: 12,
1732
1732
  color: "#ff8800",
@@ -1743,7 +1743,7 @@ let __tla = (async () => {
1743
1743
  })
1744
1744
  ]
1745
1745
  }),
1746
- f && v(Ie, {
1746
+ f && S(Ie, {
1747
1747
  children: [
1748
1748
  i(we, {
1749
1749
  points: f,
@@ -1753,7 +1753,7 @@ let __tla = (async () => {
1753
1753
  depthWrite: false,
1754
1754
  transparent: true
1755
1755
  }),
1756
- i(Xe, {
1756
+ i(Ge, {
1757
1757
  position: [
1758
1758
  Math.max(f[0].x, f[1].x) + o * 0.02,
1759
1759
  n,
@@ -1770,7 +1770,7 @@ let __tla = (async () => {
1770
1770
  backgroundColor: "rgba(0,0,0,0.75)",
1771
1771
  borderRadius: 3
1772
1772
  },
1773
- children: v("span", {
1773
+ children: S("span", {
1774
1774
  style: {
1775
1775
  fontSize: 12,
1776
1776
  color: "#ff00ff",
@@ -1790,7 +1790,7 @@ let __tla = (async () => {
1790
1790
  ]
1791
1791
  });
1792
1792
  }, or = ({ mesh: t, yPosition: r, onYChange: n, minY: o, maxY: s, modelSize: l, color: c, hoverColor: a, dragColor: e, label: h, onDragStart: d, onDragEnd: f }) => {
1793
- const [u, g] = I(false), [M, p] = I(false), { camera: b, gl: m } = Mn(), P = ae(0), y = ae(null), F = t.geometry, A = In(F), S = Y(() => A ? Ge(A, F, r) : {
1793
+ const [u, g] = I(false), [M, p] = I(false), { camera: b, gl: m } = kn(), P = ae(0), y = ae(null), F = t.geometry, A = Bn(F), v = Y(() => A ? je(A, F, r) : {
1794
1794
  linePoints: [],
1795
1795
  lineLength: 0,
1796
1796
  rightmostPoint: new k()
@@ -1798,22 +1798,22 @@ let __tla = (async () => {
1798
1798
  A,
1799
1799
  F,
1800
1800
  r
1801
- ]), C = ie((D, B, $) => {
1802
- const ee = m.domElement.getBoundingClientRect(), se = (D - ee.left) / ee.width * 2 - 1, ce = -((B - ee.top) / ee.height) * 2 + 1, U = new vo();
1803
- U.setFromCamera(new j.Vector2(se, ce), b);
1804
- const oe = new k();
1805
- return U.ray.intersectPlane($, oe) ? oe.y : null;
1801
+ ]), C = re((D, B, $) => {
1802
+ const ee = m.domElement.getBoundingClientRect(), ie = (D - ee.left) / ee.width * 2 - 1, ce = -((B - ee.top) / ee.height) * 2 + 1, U = new So();
1803
+ U.setFromCamera(new j.Vector2(ie, ce), b);
1804
+ const ne = new k();
1805
+ return U.ray.intersectPlane($, ne) ? ne.y : null;
1806
1806
  }, [
1807
1807
  b,
1808
1808
  m
1809
- ]), L = ie((D) => {
1809
+ ]), L = re((D) => {
1810
1810
  const B = new k();
1811
1811
  b.getWorldDirection(B), B.y = 0, B.lengthSq() < 1e-6 && B.set(0, 0, 1), B.normalize();
1812
1812
  const $ = B.multiplyScalar(-1);
1813
- return new St().setFromNormalAndCoplanarPoint($, new k(0, D, 0));
1813
+ return new vt().setFromNormalAndCoplanarPoint($, new k(0, D, 0));
1814
1814
  }, [
1815
1815
  b
1816
- ]), T = ie((D) => {
1816
+ ]), T = re((D) => {
1817
1817
  D.stopPropagation(), g(true), m.domElement.style.cursor = "ns-resize";
1818
1818
  const B = L(r);
1819
1819
  y.current = B;
@@ -1825,7 +1825,7 @@ let __tla = (async () => {
1825
1825
  L,
1826
1826
  C,
1827
1827
  d
1828
- ]), E = ie((D) => {
1828
+ ]), E = re((D) => {
1829
1829
  if (!u || !y.current) return;
1830
1830
  const B = C(D.clientX, D.clientY, y.current);
1831
1831
  if (B == null) return;
@@ -1837,19 +1837,19 @@ let __tla = (async () => {
1837
1837
  n,
1838
1838
  o,
1839
1839
  s
1840
- ]), w = ie((D) => {
1840
+ ]), w = re((D) => {
1841
1841
  g(false), m.domElement.style.cursor = "auto", y.current = null, D.target.releasePointerCapture(D.pointerId), f == null ? void 0 : f();
1842
1842
  }, [
1843
1843
  m,
1844
1844
  f
1845
1845
  ]);
1846
- if (S.linePoints.length < 2) return null;
1846
+ if (v.linePoints.length < 2) return null;
1847
1847
  const z = u ? e : M ? a : c;
1848
- return v("group", {
1848
+ return S("group", {
1849
1849
  renderOrder: 10,
1850
1850
  children: [
1851
1851
  i(we, {
1852
- points: S.linePoints,
1852
+ points: v.linePoints,
1853
1853
  color: z,
1854
1854
  lineWidth: u ? 6 : M ? 5 : 4,
1855
1855
  depthTest: false,
@@ -1868,11 +1868,11 @@ let __tla = (async () => {
1868
1868
  }),
1869
1869
  (M || u) && i("mesh", {
1870
1870
  position: [
1871
- S.rightmostPoint.x + l * 0.15,
1871
+ v.rightmostPoint.x + l * 0.15,
1872
1872
  r,
1873
1873
  0
1874
1874
  ],
1875
- children: i(Xe, {
1875
+ children: i(Ge, {
1876
1876
  center: true,
1877
1877
  children: i("div", {
1878
1878
  style: {
@@ -1901,7 +1901,7 @@ let __tla = (async () => {
1901
1901
  "color"
1902
1902
  ], sr = yo(function(t, r) {
1903
1903
  var n = t.color, o = n === void 0 ? "currentColor" : n, s = rr(t, ir);
1904
- return xn("svg", Object.assign({
1904
+ return bn("svg", Object.assign({
1905
1905
  width: "15",
1906
1906
  height: "15",
1907
1907
  viewBox: "0 0 15 15",
@@ -1909,14 +1909,14 @@ let __tla = (async () => {
1909
1909
  xmlns: "http://www.w3.org/2000/svg"
1910
1910
  }, s, {
1911
1911
  ref: r
1912
- }), xn("path", {
1912
+ }), bn("path", {
1913
1913
  d: "M7.5 2C7.77614 2 8 2.22386 8 2.5L8 11.2929L11.1464 8.14645C11.3417 7.95118 11.6583 7.95118 11.8536 8.14645C12.0488 8.34171 12.0488 8.65829 11.8536 8.85355L7.85355 12.8536C7.75979 12.9473 7.63261 13 7.5 13C7.36739 13 7.24021 12.9473 7.14645 12.8536L3.14645 8.85355C2.95118 8.65829 2.95118 8.34171 3.14645 8.14645C3.34171 7.95118 3.65829 7.95118 3.85355 8.14645L7 11.2929L7 2.5C7 2.22386 7.22386 2 7.5 2Z",
1914
1914
  fill: o,
1915
1915
  fillRule: "evenodd",
1916
1916
  clipRule: "evenodd"
1917
1917
  }));
1918
1918
  });
1919
- const zn = {
1919
+ const An = {
1920
1920
  padding: "8px 20px",
1921
1921
  borderRadius: 4,
1922
1922
  fontSize: 14,
@@ -1962,7 +1962,7 @@ let __tla = (async () => {
1962
1962
  return g.forEach((z, D) => {
1963
1963
  e[D] != null && e[D] !== 0 && (w[z] = e[D].toFixed(1));
1964
1964
  }), w;
1965
- }), [m, P] = I(h && h > 0 ? h.toFixed(1) : ""), [y, F] = I(""), [A, S] = I(""), C = Y(() => g.map((w) => {
1965
+ }), [m, P] = I(h && h > 0 ? h.toFixed(1) : ""), [y, F] = I(""), [A, v] = I(""), C = Y(() => g.map((w) => {
1966
1966
  const z = p[w];
1967
1967
  return z != null && z !== "" && !isNaN(parseFloat(z)) ? parseFloat(z) : 0;
1968
1968
  }), [
@@ -1995,7 +1995,7 @@ let __tla = (async () => {
1995
1995
  t,
1996
1996
  y,
1997
1997
  A
1998
- ]), T = ie(() => {
1998
+ ]), T = re(() => {
1999
1999
  if (!L) return;
2000
2000
  const w = m !== "" && !isNaN(parseFloat(m)) ? parseFloat(m) : 0, z = y !== "" && !isNaN(parseFloat(y)) ? parseFloat(y) : void 0, D = A !== "" && !isNaN(parseFloat(A)) ? parseFloat(A) : void 0;
2001
2001
  s({
@@ -2011,7 +2011,7 @@ let __tla = (async () => {
2011
2011
  y,
2012
2012
  A,
2013
2013
  s
2014
- ]), E = ie(() => {
2014
+ ]), E = re(() => {
2015
2015
  const w = {};
2016
2016
  g.forEach((z, D) => {
2017
2017
  const B = n[D];
@@ -2025,7 +2025,7 @@ let __tla = (async () => {
2025
2025
  n,
2026
2026
  o
2027
2027
  ]);
2028
- return v("div", {
2028
+ return S("div", {
2029
2029
  style: {
2030
2030
  display: "flex",
2031
2031
  flexDirection: "column",
@@ -2034,7 +2034,7 @@ let __tla = (async () => {
2034
2034
  fontFamily: "system-ui, sans-serif"
2035
2035
  },
2036
2036
  children: [
2037
- v("div", {
2037
+ S("div", {
2038
2038
  style: {
2039
2039
  padding: "20px 22px 16px",
2040
2040
  backgroundColor: "#fff",
@@ -2045,7 +2045,7 @@ let __tla = (async () => {
2045
2045
  flexShrink: 0
2046
2046
  },
2047
2047
  children: [
2048
- v("div", {
2048
+ S("div", {
2049
2049
  style: {
2050
2050
  display: "flex",
2051
2051
  alignItems: "center",
@@ -2079,7 +2079,7 @@ let __tla = (async () => {
2079
2079
  })
2080
2080
  ]
2081
2081
  }),
2082
- v("div", {
2082
+ S("div", {
2083
2083
  style: {
2084
2084
  display: "flex",
2085
2085
  alignItems: "center",
@@ -2096,7 +2096,7 @@ let __tla = (async () => {
2096
2096
  boxShadow: "0 0 0 3px rgba(12, 67, 173, 0.13)"
2097
2097
  }
2098
2098
  }),
2099
- v("div", {
2099
+ S("div", {
2100
2100
  style: {
2101
2101
  fontSize: 17,
2102
2102
  fontWeight: 600,
@@ -2111,7 +2111,7 @@ let __tla = (async () => {
2111
2111
  })
2112
2112
  ]
2113
2113
  }),
2114
- v("div", {
2114
+ S("div", {
2115
2115
  style: {
2116
2116
  fontSize: 13,
2117
2117
  color: "rgba(0,0,0,0.6)",
@@ -2134,7 +2134,7 @@ let __tla = (async () => {
2134
2134
  i("button", {
2135
2135
  onClick: E,
2136
2136
  style: {
2137
- ...zn,
2137
+ ...An,
2138
2138
  backgroundColor: "#fff",
2139
2139
  border: "2px solid rgb(12, 67, 173)",
2140
2140
  color: "rgb(12, 67, 173)",
@@ -2143,7 +2143,7 @@ let __tla = (async () => {
2143
2143
  fontSize: 12,
2144
2144
  width: "100%"
2145
2145
  },
2146
- children: v("span", {
2146
+ children: S("span", {
2147
2147
  style: {
2148
2148
  display: "flex",
2149
2149
  alignItems: "center",
@@ -2163,7 +2163,7 @@ let __tla = (async () => {
2163
2163
  })
2164
2164
  ]
2165
2165
  }),
2166
- v("div", {
2166
+ S("div", {
2167
2167
  style: {
2168
2168
  flex: 1,
2169
2169
  minHeight: 0,
@@ -2190,7 +2190,7 @@ let __tla = (async () => {
2190
2190
  },
2191
2191
  children: g.map((w, z) => {
2192
2192
  const D = M.has(w), B = !!p[w];
2193
- return v("div", {
2193
+ return S("div", {
2194
2194
  style: {
2195
2195
  display: "flex",
2196
2196
  flexDirection: "column",
@@ -2198,7 +2198,7 @@ let __tla = (async () => {
2198
2198
  minWidth: 0
2199
2199
  },
2200
2200
  children: [
2201
- v("label", {
2201
+ S("label", {
2202
2202
  style: {
2203
2203
  fontSize: 11,
2204
2204
  fontWeight: 500,
@@ -2241,7 +2241,7 @@ let __tla = (async () => {
2241
2241
  }, z);
2242
2242
  })
2243
2243
  }),
2244
- t === "AK" && v(Ie, {
2244
+ t === "AK" && S(Ie, {
2245
2245
  children: [
2246
2246
  i("div", {
2247
2247
  style: {
@@ -2252,7 +2252,7 @@ let __tla = (async () => {
2252
2252
  },
2253
2253
  children: "Perineum"
2254
2254
  }),
2255
- v("div", {
2255
+ S("div", {
2256
2256
  style: {
2257
2257
  display: "grid",
2258
2258
  gridTemplateColumns: "repeat(auto-fill, minmax(180px, 1fr))",
@@ -2260,7 +2260,7 @@ let __tla = (async () => {
2260
2260
  marginBottom: 20
2261
2261
  },
2262
2262
  children: [
2263
- v("div", {
2263
+ S("div", {
2264
2264
  style: {
2265
2265
  display: "flex",
2266
2266
  flexDirection: "column",
@@ -2268,7 +2268,7 @@ let __tla = (async () => {
2268
2268
  minWidth: 0
2269
2269
  },
2270
2270
  children: [
2271
- v("label", {
2271
+ S("label", {
2272
2272
  style: {
2273
2273
  fontSize: 11,
2274
2274
  fontWeight: 500,
@@ -2302,7 +2302,7 @@ let __tla = (async () => {
2302
2302
  })
2303
2303
  ]
2304
2304
  }),
2305
- v("div", {
2305
+ S("div", {
2306
2306
  style: {
2307
2307
  display: "flex",
2308
2308
  flexDirection: "column",
@@ -2310,7 +2310,7 @@ let __tla = (async () => {
2310
2310
  minWidth: 0
2311
2311
  },
2312
2312
  children: [
2313
- v("label", {
2313
+ S("label", {
2314
2314
  style: {
2315
2315
  fontSize: 11,
2316
2316
  fontWeight: 500,
@@ -2332,7 +2332,7 @@ let __tla = (async () => {
2332
2332
  type: "number",
2333
2333
  step: "0.1",
2334
2334
  value: A,
2335
- onChange: (w) => S(w.target.value),
2335
+ onChange: (w) => v(w.target.value),
2336
2336
  style: {
2337
2337
  ...xt,
2338
2338
  padding: "6px 8px",
@@ -2363,7 +2363,7 @@ let __tla = (async () => {
2363
2363
  gridTemplateColumns: "repeat(auto-fill, minmax(180px, 1fr))",
2364
2364
  gap: 10
2365
2365
  },
2366
- children: v("div", {
2366
+ children: S("div", {
2367
2367
  style: {
2368
2368
  display: "flex",
2369
2369
  flexDirection: "column",
@@ -2413,7 +2413,7 @@ let __tla = (async () => {
2413
2413
  onClick: T,
2414
2414
  disabled: !L,
2415
2415
  style: {
2416
- ...zn,
2416
+ ...An,
2417
2417
  backgroundColor: L ? "rgb(12, 67, 173)" : "#e0e0e0",
2418
2418
  border: "none",
2419
2419
  color: L ? "#fff" : "#9e9e9e",
@@ -2452,14 +2452,14 @@ let __tla = (async () => {
2452
2452
  boxSizing: "border-box",
2453
2453
  fontFamily: "system-ui, sans-serif"
2454
2454
  }, dr = ({ onSkip: t, onCancel: r }) => {
2455
- const [n, o] = I("confirm"), [s, l] = I(null), [c, a] = I(""), e = ie(() => {
2455
+ const [n, o] = I("confirm"), [s, l] = I(null), [c, a] = I(""), e = re(() => {
2456
2456
  o("reasons");
2457
- }, []), h = ie(() => {
2457
+ }, []), h = re(() => {
2458
2458
  n === "reasons" ? (o("confirm"), l(null), a("")) : r();
2459
2459
  }, [
2460
2460
  n,
2461
2461
  r
2462
- ]), d = s != null && (s !== "Other" || c.trim() !== ""), f = ie(() => {
2462
+ ]), d = s != null && (s !== "Other" || c.trim() !== ""), f = re(() => {
2463
2463
  !d || !s || t(s === "Other" ? `Other: ${c.trim()}` : s);
2464
2464
  }, [
2465
2465
  d,
@@ -2480,7 +2480,7 @@ let __tla = (async () => {
2480
2480
  zIndex: 9999,
2481
2481
  fontFamily: "system-ui, sans-serif"
2482
2482
  },
2483
- children: v("div", {
2483
+ children: S("div", {
2484
2484
  style: {
2485
2485
  backgroundColor: "#fff",
2486
2486
  borderRadius: 12,
@@ -2488,7 +2488,7 @@ let __tla = (async () => {
2488
2488
  boxShadow: "0 24px 38px 3px rgba(0,0,0,0.14)"
2489
2489
  },
2490
2490
  children: [
2491
- v("div", {
2491
+ S("div", {
2492
2492
  style: {
2493
2493
  padding: "24px 24px 0"
2494
2494
  },
@@ -2511,7 +2511,7 @@ let __tla = (async () => {
2511
2511
  })
2512
2512
  ]
2513
2513
  }),
2514
- v("div", {
2514
+ S("div", {
2515
2515
  style: {
2516
2516
  padding: "20px 24px",
2517
2517
  display: "flex",
@@ -2522,7 +2522,7 @@ let __tla = (async () => {
2522
2522
  [
2523
2523
  ...ar,
2524
2524
  "Other"
2525
- ].map((u) => v("label", {
2525
+ ].map((u) => S("label", {
2526
2526
  style: {
2527
2527
  display: "flex",
2528
2528
  alignItems: "center",
@@ -2576,7 +2576,7 @@ let __tla = (async () => {
2576
2576
  })
2577
2577
  ]
2578
2578
  }),
2579
- v("div", {
2579
+ S("div", {
2580
2580
  style: {
2581
2581
  display: "flex",
2582
2582
  justifyContent: "flex-end",
@@ -2624,7 +2624,7 @@ let __tla = (async () => {
2624
2624
  zIndex: 9999,
2625
2625
  fontFamily: "system-ui, sans-serif"
2626
2626
  },
2627
- children: v("div", {
2627
+ children: S("div", {
2628
2628
  style: {
2629
2629
  backgroundColor: "#fff",
2630
2630
  borderRadius: 8,
@@ -2650,7 +2650,7 @@ let __tla = (async () => {
2650
2650
  },
2651
2651
  children: "Your measurements will be submitted without comparing to the scan. Are you sure?"
2652
2652
  }),
2653
- v("div", {
2653
+ S("div", {
2654
2654
  style: {
2655
2655
  display: "flex",
2656
2656
  justifyContent: "flex-end",
@@ -2683,18 +2683,18 @@ let __tla = (async () => {
2683
2683
  })
2684
2684
  });
2685
2685
  };
2686
- function Bn(t, r, n) {
2686
+ function En(t, r, n) {
2687
2687
  const o = t.getAttribute("position"), s = n - r;
2688
2688
  if (s < 1) return null;
2689
2689
  const l = 30, c = s / l, a = [];
2690
2690
  for (let b = 0; b < l; b++) {
2691
2691
  const m = r + b * c, P = r + (b + 1) * c;
2692
- let y = 0, F = 0, A = 0, S = 0;
2692
+ let y = 0, F = 0, A = 0, v = 0;
2693
2693
  for (let C = 0; C < o.count; C++) {
2694
2694
  const L = o.getY(C);
2695
- L >= m && L < P && (y += o.getX(C), F += L, A += o.getZ(C), S++);
2695
+ L >= m && L < P && (y += o.getX(C), F += L, A += o.getZ(C), v++);
2696
2696
  }
2697
- S > 20 && a.push(new k(y / S, F / S, A / S));
2697
+ v > 20 && a.push(new k(y / v, F / v, A / v));
2698
2698
  }
2699
2699
  if (a.length < 5) return null;
2700
2700
  const e = new k();
@@ -2728,7 +2728,7 @@ let __tla = (async () => {
2728
2728
  "#44cc44",
2729
2729
  "#4488ff"
2730
2730
  ];
2731
- function En(t) {
2731
+ function Tn(t) {
2732
2732
  const r = t.getAttribute("position"), n = r.count, o = new k();
2733
2733
  for (let p = 0; p < n; p++) o.x += r.getX(p), o.y += r.getY(p), o.z += r.getZ(p);
2734
2734
  o.divideScalar(n);
@@ -2758,13 +2758,13 @@ let __tla = (async () => {
2758
2758
  for (let p = 0; p < 3; p++) {
2759
2759
  let b = new k(1 + p * 0.1, 1 - p * 0.1, 0.5 + p * 0.3).normalize(), m = 0;
2760
2760
  for (let P = 0; P < 100; P++) {
2761
- const y = u[0][0] * b.x + u[0][1] * b.y + u[0][2] * b.z, F = u[1][0] * b.x + u[1][1] * b.y + u[1][2] * b.z, A = u[2][0] * b.x + u[2][1] * b.y + u[2][2] * b.z, S = new k(y, F, A);
2762
- if (m = S.length(), m < 1e-12) break;
2763
- if (S.divideScalar(m), b.distanceTo(S) < 1e-10) {
2764
- b = S;
2761
+ const y = u[0][0] * b.x + u[0][1] * b.y + u[0][2] * b.z, F = u[1][0] * b.x + u[1][1] * b.y + u[1][2] * b.z, A = u[2][0] * b.x + u[2][1] * b.y + u[2][2] * b.z, v = new k(y, F, A);
2762
+ if (m = v.length(), m < 1e-12) break;
2763
+ if (v.divideScalar(m), b.distanceTo(v) < 1e-10) {
2764
+ b = v;
2765
2765
  break;
2766
2766
  }
2767
- b = S;
2767
+ b = v;
2768
2768
  }
2769
2769
  d.push(b.clone()), f.push(m);
2770
2770
  for (let P = 0; P < 3; P++) for (let y = 0; y < 3; y++) {
@@ -2792,7 +2792,7 @@ let __tla = (async () => {
2792
2792
  let b = 1 / 0, m = -1 / 0;
2793
2793
  const P = d[p];
2794
2794
  for (let y = 0; y < n; y++) {
2795
- const F = r.getX(y) - g.x, A = r.getY(y) - g.y, S = r.getZ(y) - g.z, C = F * P.x + A * P.y + S * P.z;
2795
+ const F = r.getX(y) - g.x, A = r.getY(y) - g.y, v = r.getZ(y) - g.z, C = F * P.x + A * P.y + v * P.z;
2796
2796
  C < b && (b = C), C > m && (m = C);
2797
2797
  }
2798
2798
  M[p] = (m - b) / 2;
@@ -2899,7 +2899,7 @@ let __tla = (async () => {
2899
2899
  }, [
2900
2900
  n
2901
2901
  ]), s = o < 1 ? "#44ff44" : o < 5 ? "#ffcc00" : "#ff4444";
2902
- return v("group", {
2902
+ return S("group", {
2903
2903
  children: [
2904
2904
  i(we, {
2905
2905
  points: [
@@ -2909,7 +2909,7 @@ let __tla = (async () => {
2909
2909
  color: s,
2910
2910
  lineWidth: 3
2911
2911
  }),
2912
- v("mesh", {
2912
+ S("mesh", {
2913
2913
  position: t,
2914
2914
  children: [
2915
2915
  i("sphereGeometry", {
@@ -2924,7 +2924,7 @@ let __tla = (async () => {
2924
2924
  })
2925
2925
  ]
2926
2926
  }),
2927
- v("mesh", {
2927
+ S("mesh", {
2928
2928
  position: r,
2929
2929
  children: [
2930
2930
  i("sphereGeometry", {
@@ -2948,7 +2948,7 @@ let __tla = (async () => {
2948
2948
  let e = n - 10;
2949
2949
  const h = new k(0, 1, 0);
2950
2950
  for (; e > r; ) {
2951
- const d = Math.min(e, n), f = Math.max(e, n), u = Bn(t, d, f);
2951
+ const d = Math.min(e, n), f = Math.max(e, n), u = En(t, d, f);
2952
2952
  if (u) {
2953
2953
  const g = u.dot(h), M = Math.acos(Math.min(1, Math.abs(g))) * 180 / Math.PI;
2954
2954
  a.push({
@@ -2969,7 +2969,7 @@ let __tla = (async () => {
2969
2969
  return i("group", {
2970
2970
  children: c.map((a, e) => {
2971
2971
  const h = (a.regionMin + a.regionMax) / 2, d = new k(0, h, 0), f = d.clone().addScaledVector(a.axis, l), u = d.clone().addScaledVector(a.axis, -l), g = e / Math.max(1, c.length - 1), M = a.angleDeg < 0.5 ? `hsl(${120 - g * 120}, 80%, 60%)` : `hsl(${40 - a.angleDeg * 2}, 90%, 55%)`;
2972
- return v("group", {
2972
+ return S("group", {
2973
2973
  children: [
2974
2974
  i(we, {
2975
2975
  points: [
@@ -2998,7 +2998,7 @@ let __tla = (async () => {
2998
2998
  }
2999
2999
  function xr({ geometry: t, redY: r, greenY: n, modelSize: o }) {
3000
3000
  const s = Y(() => {
3001
- const f = Bn(t, r, n);
3001
+ const f = En(t, r, n);
3002
3002
  if (!f) return null;
3003
3003
  const u = f.dot(new k(0, 1, 0)), g = Math.acos(Math.min(1, Math.abs(u))) * 180 / Math.PI;
3004
3004
  return {
@@ -3053,10 +3053,10 @@ let __tla = (async () => {
3053
3053
  if (b.length < 5) return null;
3054
3054
  const m = n - r, P = r + m * 0.3, y = r + m * 0.7, F = b.filter((L) => L.y >= P && L.y <= y);
3055
3055
  if (F.length < 3) return null;
3056
- const A = F.map((L) => L.circ).sort((L, T) => L - T), S = A[Math.floor(A.length / 2)], C = Math.max(...b.map((L) => L.circ));
3056
+ const A = F.map((L) => L.circ).sort((L, T) => L - T), v = A[Math.floor(A.length / 2)], C = Math.max(...b.map((L) => L.circ));
3057
3057
  return {
3058
3058
  circumferences: b,
3059
- baseline: S,
3059
+ baseline: v,
3060
3060
  maxCirc: C
3061
3061
  };
3062
3062
  }, [
@@ -3066,7 +3066,7 @@ let __tla = (async () => {
3066
3066
  ]);
3067
3067
  if (!l) return null;
3068
3068
  const { circumferences: c, baseline: a, maxCirc: e } = l, h = o * 0.3 / e;
3069
- return v("group", {
3069
+ return S("group", {
3070
3070
  children: [
3071
3071
  c.map(({ y: d, circ: f }, u) => {
3072
3072
  const g = f / a, M = g > 1.6 ? "#ff4444" : g > 1.3 ? "#ffcc00" : "#22cc66", p = f * h;
@@ -3083,7 +3083,7 @@ let __tla = (async () => {
3083
3083
  }),
3084
3084
  (() => {
3085
3085
  const d = a * 1.6 * h, f = c[0].y, u = c[c.length - 1].y;
3086
- return v(Ie, {
3086
+ return S(Ie, {
3087
3087
  children: [
3088
3088
  i(we, {
3089
3089
  points: [
@@ -3123,7 +3123,7 @@ let __tla = (async () => {
3123
3123
  const o = t.colors[n] ?? "#888888", s = n === t.innerIdx;
3124
3124
  r.computeBoundingBox();
3125
3125
  const l = new k();
3126
- return r.boundingBox.getCenter(l), v("group", {
3126
+ return r.boundingBox.getCenter(l), S("group", {
3127
3127
  children: [
3128
3128
  i("mesh", {
3129
3129
  geometry: r,
@@ -3151,7 +3151,7 @@ let __tla = (async () => {
3151
3151
  }),
3152
3152
  i("group", {
3153
3153
  position: l,
3154
- children: i(Xe, {
3154
+ children: i(Ge, {
3155
3155
  center: true,
3156
3156
  style: {
3157
3157
  pointerEvents: "none"
@@ -3181,7 +3181,7 @@ let __tla = (async () => {
3181
3181
  })
3182
3182
  });
3183
3183
  }
3184
- function vr({ geometry: t, aoData: r }) {
3184
+ function Sr({ geometry: t, aoData: r }) {
3185
3185
  const n = Y(() => {
3186
3186
  const o = t.toNonIndexed(), s = o.getAttribute("position"), l = r.length, c = s.count, a = new Float32Array(c * 3);
3187
3187
  for (let e = 0; e < l && e * 3 + 2 < c; e++) {
@@ -3210,8 +3210,8 @@ let __tla = (async () => {
3210
3210
  })
3211
3211
  });
3212
3212
  }
3213
- function Sr({ mesh: t, layers: r, landmarkPoints: n, componentDebug: o, aoData: s, aoGeometry: l, measurementGeometry: c }) {
3214
- const a = t.geometry, e = Y(() => a.getAttribute("position") ? En(a) : null, [
3213
+ function vr({ mesh: t, layers: r, landmarkPoints: n, componentDebug: o, aoData: s, aoGeometry: l, measurementGeometry: c }) {
3214
+ const a = t.geometry, e = Y(() => a.getAttribute("position") ? Tn(a) : null, [
3215
3215
  a
3216
3216
  ]), h = Y(() => !n || n.length < 2 ? null : {
3217
3217
  red: new k(n[1].position.x, n[1].position.y, n[1].position.z),
@@ -3219,7 +3219,7 @@ let __tla = (async () => {
3219
3219
  }, [
3220
3220
  n
3221
3221
  ]);
3222
- return v("group", {
3222
+ return S("group", {
3223
3223
  children: [
3224
3224
  r.pcaAxes && e && i(pr, {
3225
3225
  pca: e
@@ -3234,7 +3234,7 @@ let __tla = (async () => {
3234
3234
  r.shellComponents && o && i(wr, {
3235
3235
  componentDebug: o
3236
3236
  }),
3237
- r.ambientOcclusion && s && s.length > 0 && i(vr, {
3237
+ r.ambientOcclusion && s && s.length > 0 && i(Sr, {
3238
3238
  geometry: l ?? a,
3239
3239
  aoData: s
3240
3240
  }),
@@ -3278,7 +3278,7 @@ let __tla = (async () => {
3278
3278
  function Cr({ mesh: t }) {
3279
3279
  const r = t.geometry, n = Y(() => {
3280
3280
  if (!r.getAttribute("position")) return null;
3281
- const l = En(r), c = l.axes[0], a = l.halfExtents[0] * 1.3;
3281
+ const l = Tn(r), c = l.axes[0], a = l.halfExtents[0] * 1.3;
3282
3282
  return {
3283
3283
  axis: c,
3284
3284
  center: l.center,
@@ -3305,7 +3305,7 @@ let __tla = (async () => {
3305
3305
  renderOrder: 999
3306
3306
  });
3307
3307
  }
3308
- const Tn = [
3308
+ const $n = [
3309
3309
  {
3310
3310
  key: "pcaAxes",
3311
3311
  label: "PCA Axes (full mesh)",
@@ -3362,10 +3362,10 @@ let __tla = (async () => {
3362
3362
  group: "Alignment"
3363
3363
  }
3364
3364
  ], zr = [
3365
- ...new Set(Tn.map((t) => t.group))
3365
+ ...new Set($n.map((t) => t.group))
3366
3366
  ];
3367
3367
  function Ar({ layers: t, onToggleLayer: r, isDoubleShell: n }) {
3368
- return v("div", {
3368
+ return S("div", {
3369
3369
  style: {
3370
3370
  position: "absolute",
3371
3371
  top: 16,
@@ -3394,8 +3394,8 @@ let __tla = (async () => {
3394
3394
  children: "Debug Layers"
3395
3395
  }),
3396
3396
  zr.map((o) => {
3397
- const s = Tn.filter((l) => l.group === o && !(l.hideWhenDoubleShell && n));
3398
- return s.length === 0 ? null : v("div", {
3397
+ const s = $n.filter((l) => l.group === o && !(l.hideWhenDoubleShell && n));
3398
+ return s.length === 0 ? null : S("div", {
3399
3399
  children: [
3400
3400
  i("div", {
3401
3401
  style: {
@@ -3409,7 +3409,7 @@ let __tla = (async () => {
3409
3409
  },
3410
3410
  children: o
3411
3411
  }),
3412
- s.map(({ key: l, label: c, color: a }) => v("label", {
3412
+ s.map(({ key: l, label: c, color: a }) => S("label", {
3413
3413
  style: {
3414
3414
  display: "flex",
3415
3415
  alignItems: "center",
@@ -3455,7 +3455,7 @@ let __tla = (async () => {
3455
3455
  });
3456
3456
  }
3457
3457
  const Mr = ({ config: t, spacingType: r, scanUrl: n, formMeasurements: o, onComplete: s, isDebugUser: l = false, onAnalyticsEvent: c, wasmModule: a }) => {
3458
- const [e, h] = I(null), [d, f] = I(0), [u, g] = I(false), [M, p] = I(false), [b, m] = I(""), [P, y] = I("3D"), [F, A] = I(r === "AK" ? 2 : 1), [S, C] = I(false), [L, T] = I(null), [E, w] = I(r ?? null), [z, D] = I("mm"), [B, $] = I(false), [ee, se] = I(""), [ce, U] = I(false), [oe, J] = I(false), [Z, ge] = I(false), [de, he] = I(false), [ve, te] = I(null), [O, X] = I(null), [Q, ue] = I(null), [fe, re] = I(false), [G, V] = I([]), [ke, Ae] = I(null), [Ye, me] = I(null), [ze, At] = I(null), [rt, Xt] = I(null), [On, Yt] = I(false), [it, Zt] = I(null), [Mt, Fe] = I(null), [_e, Hn] = I(false), [Kt, Nn] = I(fr), [$e, qt] = I("obj"), [Se, kt] = I(o), [Ue, Ft] = I(true), [Oe, Je] = I(false), [Pt, Ut] = I(false), [Be, st] = I(false), Ze = ae(false), [Vn, lt] = I(false), [Lt, Jt] = I(() => {
3458
+ const [e, h] = I(null), [d, f] = I(0), [u, g] = I(false), [M, p] = I(false), [b, m] = I(""), [P, y] = I("3D"), [F, A] = I(r === "AK" ? 2 : 1), [v, C] = I(false), [L, T] = I(null), [E, w] = I(r ?? null), [z, D] = I("mm"), [B, $] = I(false), [ee, ie] = I(""), [ce, U] = I(false), [ne, J] = I(false), [Z, ge] = I(false), [de, he] = I(false), [Se, te] = I(null), [O, X] = I(null), [Q, ue] = I(null), [fe, oe] = I(false), [G, V] = I([]), [ke, Ae] = I(null), [Xe, me] = I(null), [ze, At] = I(null), [ot, Xt] = I(null), [Hn, Yt] = I(false), [rt, Zt] = I(null), [Mt, Fe] = I(null), [_e, Nn] = I(false), [Kt, Vn] = I(fr), [$e, qt] = I("obj"), [ve, kt] = I(o), [qe, Ft] = I(true), [it, Ue] = I(false), [Pt, Ut] = I(false), [Be, st] = I(false), Ye = ae(false), [jn, lt] = I(false), [Lt, Jt] = I(() => {
3459
3459
  try {
3460
3460
  return localStorage.getItem("gm_helpTipDismissed") !== "1";
3461
3461
  } catch {
@@ -3475,21 +3475,21 @@ let __tla = (async () => {
3475
3475
  }, [
3476
3476
  Lt
3477
3477
  ]), q(() => {
3478
- if (!oe) return;
3478
+ if (!ne) return;
3479
3479
  const x = setTimeout(() => J(false), 5e3);
3480
3480
  return () => clearTimeout(x);
3481
3481
  }, [
3482
- oe
3482
+ ne
3483
3483
  ]);
3484
- const Dt = ae(null), [He, jn] = I(0);
3484
+ const Dt = ae(null), [Oe, Gn] = I(0);
3485
3485
  q(() => {
3486
3486
  if (!Dt.current) return;
3487
3487
  const x = new ResizeObserver((_) => {
3488
- for (const W of _) jn(W.contentRect.width);
3488
+ for (const W of _) Gn(W.contentRect.width);
3489
3489
  });
3490
3490
  return x.observe(Dt.current), () => x.disconnect();
3491
3491
  }, []);
3492
- const [Ne, Gn] = I(null), [Xn, Yn] = I(void 0), [Zn, Kn] = I(void 0), [Qt] = I("#c8c8c8"), [qn] = I(1), [Ee, Un] = I(false), [_t, en] = I([]), at = ae(null), Ve = ae(null), ct = ae(false), Jn = ae(null), Rt = ae(null), Wt = ae(null), Qe = ie(async (x) => {
3492
+ const [He, Xn] = I(null), [Yn, Zn] = I(void 0), [Kn, qn] = I(void 0), [Qt] = I("#c8c8c8"), [Un] = I(1), [Ee, Jn] = I(false), [_t, en] = I([]), at = ae(null), Ne = ae(null), ct = ae(false), Qn = ae(null), Rt = ae(null), Wt = ae(null), Je = re(async (x) => {
3493
3493
  if (!Wt.current) return;
3494
3494
  const _ = (x == null ? void 0 : x.restoreView) ?? true;
3495
3495
  try {
@@ -3500,39 +3500,39 @@ let __tla = (async () => {
3500
3500
  We.width = pe, We.height = Pe;
3501
3501
  const le = We.getContext("2d");
3502
3502
  return le.drawImage(K, 0, 0), W.querySelectorAll("[style*='pointer-events']").forEach((co) => {
3503
- const cn = co;
3504
- if (cn.hasAttribute("data-finalizing-overlay")) return;
3505
- const dn = cn.querySelectorAll("div[style*='background']");
3506
- dn.length !== 0 && dn.forEach((Ke) => {
3503
+ const dn = co;
3504
+ if (dn.hasAttribute("data-finalizing-overlay")) return;
3505
+ const fn = dn.querySelectorAll("div[style*='background']");
3506
+ fn.length !== 0 && fn.forEach((Ze) => {
3507
3507
  var _a;
3508
- const De = Ke.getBoundingClientRect();
3508
+ const De = Ze.getBoundingClientRect();
3509
3509
  if (De.width === 0 || De.height === 0) return;
3510
- let $t = 0, nt = Ke;
3511
- for (; nt && nt !== W; ) {
3512
- const ht = (nt.style.transform || "").match(/rotate\((-?\d+)deg\)/);
3510
+ let $t = 0, tt = Ze;
3511
+ for (; tt && tt !== W; ) {
3512
+ const ht = (tt.style.transform || "").match(/rotate\((-?\d+)deg\)/);
3513
3513
  if (ht) {
3514
3514
  $t = parseFloat(ht[1]);
3515
3515
  break;
3516
3516
  }
3517
- nt = nt.parentElement;
3517
+ tt = tt.parentElement;
3518
3518
  }
3519
- const fn = (De.left + De.width / 2 - be.left) * Re, un = (De.top + De.height / 2 - be.top) * Le, pt = Math.abs($t) > 1, pn = (pt ? De.height : De.width) * Re, gn = (pt ? De.width : De.height) * Le;
3520
- le.save(), le.translate(fn, un), pt && le.rotate($t * Math.PI / 180);
3521
- const fo = Ke.style.backgroundColor || "rgba(0,0,0,0.75)";
3519
+ const un = (De.left + De.width / 2 - be.left) * Re, pn = (De.top + De.height / 2 - be.top) * Le, pt = Math.abs($t) > 1, gn = (pt ? De.height : De.width) * Re, hn = (pt ? De.width : De.height) * Le;
3520
+ le.save(), le.translate(un, pn), pt && le.rotate($t * Math.PI / 180);
3521
+ const fo = Ze.style.backgroundColor || "rgba(0,0,0,0.75)";
3522
3522
  le.fillStyle = fo;
3523
3523
  const uo = 4 * Re;
3524
- le.beginPath(), le.roundRect(-pn / 2, -gn / 2, pn, gn, uo), le.fill();
3525
- const hn = ((_a = Ke.textContent) == null ? void 0 : _a.trim()) || "";
3526
- if (hn) {
3527
- const gt = window.getComputedStyle(Ke), ht = parseFloat(gt.fontSize || "14") * Le;
3524
+ le.beginPath(), le.roundRect(-gn / 2, -hn / 2, gn, hn, uo), le.fill();
3525
+ const mn = ((_a = Ze.textContent) == null ? void 0 : _a.trim()) || "";
3526
+ if (mn) {
3527
+ const gt = window.getComputedStyle(Ze), ht = parseFloat(gt.fontSize || "14") * Le;
3528
3528
  le.font = `${gt.fontWeight || "normal"} ${ht}px monospace`, le.fillStyle = gt.color || "#fff", le.textAlign = "center", le.textBaseline = "middle";
3529
- const mn = Ke.querySelectorAll("span");
3530
- mn.length > 0 && !pt ? mn.forEach((Ot) => {
3531
- const ot = Ot.getBoundingClientRect();
3532
- if (ot.width === 0) return;
3533
- const po = (ot.left + ot.width / 2 - be.left) * Re - fn, go = (ot.top + ot.height / 2 - be.top) * Le - un, Ht = window.getComputedStyle(Ot), ho = parseFloat(Ht.fontSize) * Le;
3529
+ const xn = Ze.querySelectorAll("span");
3530
+ xn.length > 0 && !pt ? xn.forEach((Ot) => {
3531
+ const nt = Ot.getBoundingClientRect();
3532
+ if (nt.width === 0) return;
3533
+ const po = (nt.left + nt.width / 2 - be.left) * Re - un, go = (nt.top + nt.height / 2 - be.top) * Le - pn, Ht = window.getComputedStyle(Ot), ho = parseFloat(Ht.fontSize) * Le;
3534
3534
  le.font = `${Ht.fontWeight || "normal"} ${ho}px monospace`, le.fillStyle = Ht.color || "#fff", le.fillText(Ot.textContent || "", po, go);
3535
- }) : le.fillText(hn, 0, 0);
3535
+ }) : le.fillText(mn, 0, 0);
3536
3536
  }
3537
3537
  le.restore();
3538
3538
  });
@@ -3549,13 +3549,13 @@ let __tla = (async () => {
3549
3549
  } catch {
3550
3550
  return;
3551
3551
  }
3552
- }, []), Ce = ie((x) => {
3552
+ }, []), Ce = re((x) => {
3553
3553
  const _ = /* @__PURE__ */ new Date(), W = `${String(_.getHours()).padStart(2, "0")}:${String(_.getMinutes()).padStart(2, "0")}:${String(_.getSeconds()).padStart(2, "0")}.${String(_.getMilliseconds()).padStart(3, "0")}`;
3554
3554
  en((R) => [
3555
3555
  ...R.slice(-200),
3556
3556
  `[${W}] ${x}`
3557
3557
  ]);
3558
- }, []), { landmarkPoints: H, clearLandmarkPoints: Qn, addLandmarkPoint: tn, removeLandmarkPoint: nn, updateLandmarkPositions: on, setAligned: rn, isAligned: ne, setCut: sn, isCut: It, reset: dt } = Gt();
3558
+ }, []), { landmarkPoints: H, clearLandmarkPoints: eo, addLandmarkPoint: tn, removeLandmarkPoint: nn, updateLandmarkPositions: on, setAligned: rn, isAligned: se, setCut: sn, isCut: It, reset: dt } = Gt();
3559
3559
  q(() => {
3560
3560
  dt();
3561
3561
  }, [
@@ -3571,9 +3571,9 @@ let __tla = (async () => {
3571
3571
  l,
3572
3572
  Ce
3573
3573
  ]), q(() => {
3574
- l && ne && Ce("STATE: mesh aligned");
3574
+ l && se && Ce("STATE: mesh aligned");
3575
3575
  }, [
3576
- ne,
3576
+ se,
3577
3577
  l,
3578
3578
  Ce
3579
3579
  ]), q(() => {
@@ -3587,7 +3587,7 @@ let __tla = (async () => {
3587
3587
  }, [
3588
3588
  _t
3589
3589
  ]);
3590
- const je = Y(() => Q ? new j.Mesh(Q) : null, [
3590
+ const Ve = Y(() => Q ? new j.Mesh(Q) : null, [
3591
3591
  Q
3592
3592
  ]);
3593
3593
  q(() => {
@@ -3601,7 +3601,7 @@ let __tla = (async () => {
3601
3601
  ]);
3602
3602
  const ut = ae(false);
3603
3603
  q(() => {
3604
- if (!ne || G.length === 0 || ut.current || !c) return;
3604
+ if (!se || G.length === 0 || ut.current || !c) return;
3605
3605
  ut.current = true;
3606
3606
  const x = H.length >= 3 ? Math.abs(H[2].position.y - H[0].position.y) : null;
3607
3607
  c("dimensions_calculated", {
@@ -3611,23 +3611,23 @@ let __tla = (async () => {
3611
3611
  measurement_source: "scan_derived",
3612
3612
  is_double_wall: Z,
3613
3613
  is_unit_converted: false,
3614
- form_measurements: (Se == null ? void 0 : Se.filter((_) => _ != null)) ?? null,
3614
+ form_measurements: (ve == null ? void 0 : ve.filter((_) => _ != null)) ?? null,
3615
3615
  scan_measurements: G.map((_) => +(_.modifiedValue ?? _.originalValue).toFixed(1)),
3616
- measurement_variance: Se ? G.map((_, W) => {
3617
- const R = Se[W];
3616
+ measurement_variance: ve ? G.map((_, W) => {
3617
+ const R = ve[W];
3618
3618
  return R == null ? null : +((_.modifiedValue ?? _.originalValue) - R).toFixed(1);
3619
3619
  }) : null,
3620
3620
  frontal_height: x !== null ? +x.toFixed(1) : null
3621
3621
  });
3622
3622
  }, [
3623
- ne,
3623
+ se,
3624
3624
  G
3625
3625
  ]), q(() => {
3626
- a !== void 0 && (Ve.current = a), a !== void 0 && Un(true);
3626
+ a !== void 0 && (Ne.current = a), a !== void 0 && Jn(true);
3627
3627
  }, [
3628
3628
  a
3629
3629
  ]);
3630
- const et = ie((x, _) => {
3630
+ const Qe = re((x, _) => {
3631
3631
  x.computeBoundingBox();
3632
3632
  const W = x.boundingBox, R = new k();
3633
3633
  W.getCenter(R), x.translate(-R.x, -R.y, -R.z), x.computeBoundingBox();
@@ -3638,7 +3638,7 @@ let __tla = (async () => {
3638
3638
  side: j.DoubleSide
3639
3639
  }));
3640
3640
  h(K), U(_), J(true), he(false), ct.current = false;
3641
- }, []), Te = ie(async (x, _) => {
3641
+ }, []), Te = re(async (x, _) => {
3642
3642
  Fe(null);
3643
3643
  const W = _.toLowerCase(), R = W.endsWith(".stl");
3644
3644
  if (!W.endsWith(".obj") && !R) {
@@ -3664,17 +3664,17 @@ let __tla = (async () => {
3664
3664
  N = await Nt(Pe);
3665
3665
  }
3666
3666
  else N = typeof x == "string" ? x : new TextDecoder().decode(x);
3667
- const K = performance.now(), be = Ve.current ? await Do(N, Ve.current, (pe) => {
3667
+ const K = performance.now(), be = Ne.current ? await Do(N, Ne.current, (pe) => {
3668
3668
  m(pe), Ce(`PREPROCESS: ${pe}`);
3669
3669
  }) : null;
3670
- if (be) Ce(`PREPROCESS: done in ${(performance.now() - K).toFixed(0)}ms \u2014 unit=${be.detectedUnit}, scaled=${be.wasScaled}`), t.showAmputationModal && !r ? (T(be), C(true)) : et(be.geometry, be.wasScaled);
3670
+ if (be) Ce(`PREPROCESS: done in ${(performance.now() - K).toFixed(0)}ms \u2014 unit=${be.detectedUnit}, scaled=${be.wasScaled}`), t.showAmputationModal && !r ? (T(be), C(true)) : Qe(be.geometry, be.wasScaled);
3671
3671
  else {
3672
3672
  m("Using fallback loader...");
3673
3673
  const pe = _o(N);
3674
3674
  pe ? t.showAmputationModal && !r ? (T({
3675
3675
  geometry: pe,
3676
3676
  wasScaled: false
3677
- }), C(true)) : et(pe, false) : Fe("Failed to parse the mesh.");
3677
+ }), C(true)) : Qe(pe, false) : Fe("Failed to parse the mesh.");
3678
3678
  }
3679
3679
  } catch (N) {
3680
3680
  Fe(N instanceof Error ? N.message : "Failed to process the mesh file.");
@@ -3685,7 +3685,7 @@ let __tla = (async () => {
3685
3685
  Ee,
3686
3686
  t.showAmputationModal,
3687
3687
  r,
3688
- et
3688
+ Qe
3689
3689
  ]);
3690
3690
  q(() => {
3691
3691
  if (!n || !Ee) return;
@@ -3710,11 +3710,11 @@ let __tla = (async () => {
3710
3710
  n,
3711
3711
  Ee
3712
3712
  ]);
3713
- const eo = ie((x) => {
3713
+ const to = re((x) => {
3714
3714
  x.preventDefault(), g(true);
3715
- }, []), to = ie((x) => {
3715
+ }, []), no = re((x) => {
3716
3716
  x.preventDefault(), g(false);
3717
- }, []), no = ie(async (x) => {
3717
+ }, []), oo = re(async (x) => {
3718
3718
  if (x.preventDefault(), g(false), !Ee) {
3719
3719
  Fe("WASM module is still loading. Please wait.");
3720
3720
  return;
@@ -3741,35 +3741,35 @@ let __tla = (async () => {
3741
3741
  }, [
3742
3742
  Ee,
3743
3743
  Te
3744
- ]), oo = ie((x) => {
3745
- w(x), A(x === "AK" ? 2 : 1), C(false), L && (et(L.geometry, L.wasScaled), T(null)), c == null ? void 0 : c("file_loaded", {
3744
+ ]), ro = re((x) => {
3745
+ w(x), A(x === "AK" ? 2 : 1), C(false), L && (Qe(L.geometry, L.wasScaled), T(null)), c == null ? void 0 : c("file_loaded", {
3746
3746
  spacing_type: x,
3747
3747
  file_format: $e,
3748
3748
  is_double_wall: false
3749
3749
  });
3750
3750
  }, [
3751
3751
  L,
3752
- et,
3752
+ Qe,
3753
3753
  c,
3754
3754
  $e
3755
3755
  ]);
3756
3756
  q(() => {
3757
- if (!e || H.length !== 1 || !Ve.current || ct.current) return;
3757
+ if (!e || H.length !== 1 || !Ne.current || ct.current) return;
3758
3758
  ct.current = true;
3759
- const x = H[0], _ = Ve.current, W = e.geometry, { positions: R, indices: xe } = vt(W), N = new Float32Array([
3759
+ const x = H[0], _ = Ne.current, W = e.geometry, { positions: R, indices: xe } = St(W), N = new Float32Array([
3760
3760
  x.position.x,
3761
3761
  x.position.y,
3762
3762
  x.position.z
3763
3763
  ]), K = _.detect_shell(R, xe, N, 40), be = K.details(), pe = K.is_double_shell();
3764
- Ce(`SHELL_DETECT: ${pe ? "DOUBLE" : "SINGLE"} \u2014 ${be}`), pe && (ge(true), re(true), Ce(`SHELL_DETECT: double shell, thickness=${K.thickness().toFixed(1)}mm`));
3764
+ Ce(`SHELL_DETECT: ${pe ? "DOUBLE" : "SINGLE"} \u2014 ${be}`), pe && (ge(true), oe(true), Ce(`SHELL_DETECT: double shell, thickness=${K.thickness().toFixed(1)}mm`));
3765
3765
  }, [
3766
3766
  e,
3767
3767
  H,
3768
3768
  Ce
3769
3769
  ]);
3770
- const ro = ie(() => {
3770
+ const io = re(() => {
3771
3771
  if (!e || H.length < 2) return;
3772
- $(true), se("Please wait..."), Ce("PIPELINE: starting processing pipeline...");
3772
+ $(true), ie("Please wait..."), Ce("PIPELINE: starting processing pipeline...");
3773
3773
  const x = performance.now();
3774
3774
  setTimeout(() => {
3775
3775
  const _ = [
@@ -3779,7 +3779,7 @@ let __tla = (async () => {
3779
3779
  ];
3780
3780
  Eo(e, _, wt, {
3781
3781
  onStatus: (W) => {
3782
- se(W), Ce(`PIPELINE: ${W}`);
3782
+ ie(W), Ce(`PIPELINE: ${W}`);
3783
3783
  },
3784
3784
  addLandmarkPoint: tn,
3785
3785
  removeLandmarkPoint: nn,
@@ -3799,7 +3799,7 @@ let __tla = (async () => {
3799
3799
  setAdjustedEndY: At,
3800
3800
  setError: Fe,
3801
3801
  setDoubleShell: (W) => {
3802
- ge(W), re(true);
3802
+ ge(W), oe(true);
3803
3803
  },
3804
3804
  setAoData: (W, R) => {
3805
3805
  te(W), X(R ?? null);
@@ -3807,7 +3807,7 @@ let __tla = (async () => {
3807
3807
  setInnerShellExtracted: he,
3808
3808
  setMeasurementGeometry: ue,
3809
3809
  setWasmSlices: Ae,
3810
- wasmModule: Ve.current ?? void 0
3810
+ wasmModule: Ne.current ?? void 0
3811
3811
  }), Ce(`PIPELINE: completed in ${(performance.now() - x).toFixed(0)}ms`), ut.current = false, $(false);
3812
3812
  }, 50);
3813
3813
  }, [
@@ -3819,8 +3819,8 @@ let __tla = (async () => {
3819
3819
  nn,
3820
3820
  sn,
3821
3821
  de
3822
- ]), Bt = ae(false), io = ie(async () => {
3823
- if (dt(), V([]), Ae(null), ue(null), me(null), At(null), Zt(null), Xt(null), Je(false), Ut(false), Ft(true), ge(false), he(false), ct.current = false, Bt.current = false, ut.current = false, y("3D"), n && Ee) {
3822
+ ]), Bt = ae(false), so = re(async () => {
3823
+ if (dt(), V([]), Ae(null), ue(null), me(null), At(null), Zt(null), Xt(null), Ue(false), Ut(false), Ft(true), ge(false), he(false), ct.current = false, Bt.current = false, ut.current = false, y("3D"), n && Ee) {
3824
3824
  h(null);
3825
3825
  try {
3826
3826
  const x = await fetch(n);
@@ -3838,12 +3838,12 @@ let __tla = (async () => {
3838
3838
  dt
3839
3839
  ]);
3840
3840
  q(() => {
3841
- ne && G.length > 0 && !Bt.current && (Bt.current = true, Je(true));
3841
+ se && G.length > 0 && !Bt.current && (Bt.current = true, Ue(true));
3842
3842
  }, [
3843
- ne,
3843
+ se,
3844
3844
  G.length
3845
3845
  ]);
3846
- const tt = Y(() => {
3846
+ const et = Y(() => {
3847
3847
  var _a;
3848
3848
  if (!e || H.length < 3) return 0;
3849
3849
  if (Z) return Math.abs(H[0].position.y - H[2].position.y);
@@ -3855,12 +3855,12 @@ let __tla = (async () => {
3855
3855
  e,
3856
3856
  H,
3857
3857
  Z
3858
- ]), so = ie((x) => {
3859
- Gn(x), kt(x.circumferences), Ft(true), Ut(true), Je(false);
3860
- }, []), ln = ie(async (x) => {
3861
- if (!s || Ze.current) return;
3862
- Ze.current = true, Je(false), lt(false), st(true), await new Promise((W) => requestAnimationFrame(() => requestAnimationFrame(() => W())));
3863
- const _ = e ? await Qe({
3858
+ ]), lo = re((x) => {
3859
+ Xn(x), kt(x.circumferences), Ft(true), Ut(true), Ue(false);
3860
+ }, []), ln = re(async (x) => {
3861
+ if (!s || Ye.current) return;
3862
+ Ye.current = true, Ue(false), lt(false), st(true), await new Promise((W) => requestAnimationFrame(() => requestAnimationFrame(() => W())));
3863
+ const _ = e ? await Je({
3864
3864
  restoreView: false
3865
3865
  }).catch(() => {
3866
3866
  }) : void 0;
@@ -3872,9 +3872,9 @@ let __tla = (async () => {
3872
3872
  measurementSource: "form_provided",
3873
3873
  isDoubleWall: Z,
3874
3874
  isUnitConverted: false,
3875
- formMeasurements: Se,
3875
+ formMeasurements: ve,
3876
3876
  scanMeasurements: G,
3877
- frontalHeight: tt,
3877
+ frontalHeight: et,
3878
3878
  transverseML: 0,
3879
3879
  transverseAP: 0,
3880
3880
  scanUrl: n,
@@ -3884,7 +3884,7 @@ let __tla = (async () => {
3884
3884
  alignedGeometry: e == null ? void 0 : e.geometry
3885
3885
  });
3886
3886
  } finally {
3887
- Ze.current = false, st(false);
3887
+ Ye.current = false, st(false);
3888
3888
  }
3889
3889
  }, [
3890
3890
  s,
@@ -3892,37 +3892,37 @@ let __tla = (async () => {
3892
3892
  E,
3893
3893
  $e,
3894
3894
  Z,
3895
- Se,
3895
+ ve,
3896
3896
  G,
3897
- tt,
3897
+ et,
3898
3898
  n,
3899
- Qe
3899
+ Je
3900
3900
  ]), Et = ae(null);
3901
3901
  q(() => {
3902
- if (!e || !ne) {
3902
+ if (!e || !se) {
3903
3903
  Et.current = null;
3904
3904
  return;
3905
3905
  }
3906
- const x = (je ?? e).geometry;
3906
+ const x = (Ve ?? e).geometry;
3907
3907
  Et.current = jt(x);
3908
3908
  }, [
3909
3909
  e,
3910
- ne,
3911
- je
3910
+ se,
3911
+ Ve
3912
3912
  ]);
3913
- const Tt = ie(async (x) => {
3914
- if (!s || !e || G.length === 0 || !E || Ze.current) return;
3915
- Ze.current = true, st(true), await new Promise((W) => requestAnimationFrame(() => requestAnimationFrame(() => W())));
3916
- const _ = await Qe({
3913
+ const Tt = re(async (x) => {
3914
+ if (!s || !e || G.length === 0 || !E || Ye.current) return;
3915
+ Ye.current = true, st(true), await new Promise((W) => requestAnimationFrame(() => requestAnimationFrame(() => W())));
3916
+ const _ = await Je({
3917
3917
  restoreView: false
3918
3918
  }).catch(() => {
3919
3919
  });
3920
3920
  try {
3921
3921
  let W = 0, R = 0;
3922
3922
  if (H.length >= 2) {
3923
- const xe = (je ?? e).geometry, K = H[0].position.y;
3923
+ const xe = (Ve ?? e).geometry, K = H[0].position.y;
3924
3924
  try {
3925
- const be = Et.current ?? jt(xe), pe = Ge(be, xe, K);
3925
+ const be = Et.current ?? jt(xe), pe = je(be, xe, K);
3926
3926
  if (pe.linePoints.length >= 2) {
3927
3927
  let Pe = pe.linePoints[0], Re = pe.linePoints[0], Le = pe.linePoints[0], We = pe.linePoints[0];
3928
3928
  for (const le of pe.linePoints) le.x < Pe.x && (Pe = le), le.x > Re.x && (Re = le), le.z < Le.z && (Le = le), le.z > We.z && (We = le);
@@ -3938,55 +3938,55 @@ let __tla = (async () => {
3938
3938
  measurementSource: x === "use_form_measurements" ? "form_provided" : "scan_derived",
3939
3939
  isDoubleWall: Z,
3940
3940
  isUnitConverted: false,
3941
- formMeasurements: Se,
3941
+ formMeasurements: ve,
3942
3942
  scanMeasurements: G,
3943
- frontalHeight: (Ne == null ? void 0 : Ne.frontalHeight) ?? tt,
3943
+ frontalHeight: (He == null ? void 0 : He.frontalHeight) ?? et,
3944
3944
  transverseML: W,
3945
3945
  transverseAP: R,
3946
- perineumML: Ne == null ? void 0 : Ne.perineumML,
3947
- perineumAP: Ne == null ? void 0 : Ne.perineumAP,
3946
+ perineumML: He == null ? void 0 : He.perineumML,
3947
+ perineumAP: He == null ? void 0 : He.perineumAP,
3948
3948
  scanUrl: n,
3949
3949
  decision: x,
3950
- userEnteredMeasurements: Ne ?? void 0,
3950
+ userEnteredMeasurements: He ?? void 0,
3951
3951
  screenshots: _,
3952
- alignedGeometry: (je ?? e).geometry
3952
+ alignedGeometry: (Ve ?? e).geometry
3953
3953
  });
3954
3954
  } finally {
3955
- Ze.current = false, st(false);
3955
+ Ye.current = false, st(false);
3956
3956
  }
3957
3957
  }, [
3958
3958
  s,
3959
3959
  e,
3960
- je,
3960
+ Ve,
3961
3961
  G,
3962
3962
  E,
3963
3963
  H,
3964
3964
  $e,
3965
3965
  Z,
3966
- Se,
3966
+ ve,
3967
3967
  n,
3968
- Ne,
3969
- tt,
3970
- Qe
3971
- ]), lo = Y(() => {
3972
- if (!Se || G.length === 0) return false;
3973
- const x = Math.min(Se.length, G.length);
3968
+ He,
3969
+ et,
3970
+ Je
3971
+ ]), ao = Y(() => {
3972
+ if (!ve || G.length === 0) return false;
3973
+ const x = Math.min(ve.length, G.length);
3974
3974
  if (x === 0) return false;
3975
3975
  for (let _ = 0; _ < x; _++) {
3976
- const W = Se[_], R = G[_];
3976
+ const W = ve[_], R = G[_];
3977
3977
  if (!R || W == null || W === 0) continue;
3978
3978
  const xe = R.modifiedValue ?? R.originalValue;
3979
3979
  if (Math.abs(xe - W) > 7) return false;
3980
3980
  }
3981
3981
  return true;
3982
3982
  }, [
3983
- Se,
3983
+ ve,
3984
3984
  G
3985
- ]), ao = He === 0 ? 320 : He < 520 ? Math.max(200, Math.round(He * 0.42)) : He < 900 ? 280 : He < 1400 ? 340 : 400, an = He < 520 ? 16 : He < 900 ? 20 : 24;
3986
- return v(Mo.Provider, {
3985
+ ]), an = Oe === 0 ? 320 : Oe < 520 ? Math.max(200, Math.round(Oe * 0.42)) : Oe < 900 ? 280 : Oe < 1400 ? 340 : 400, cn = Oe < 520 ? 16 : Oe < 900 ? 20 : 24;
3986
+ return S(Mo.Provider, {
3987
3987
  value: t,
3988
3988
  children: [
3989
- v("div", {
3989
+ S("div", {
3990
3990
  style: {
3991
3991
  flex: 1,
3992
3992
  display: "flex",
@@ -4015,7 +4015,7 @@ let __tla = (async () => {
4015
4015
  }
4016
4016
  })
4017
4017
  }),
4018
- v("div", {
4018
+ S("div", {
4019
4019
  style: {
4020
4020
  flex: 1,
4021
4021
  display: "flex",
@@ -4023,7 +4023,7 @@ let __tla = (async () => {
4023
4023
  minHeight: 0
4024
4024
  },
4025
4025
  children: [
4026
- v("div", {
4026
+ S("div", {
4027
4027
  ref: Dt,
4028
4028
  style: {
4029
4029
  flex: 1,
@@ -4032,15 +4032,15 @@ let __tla = (async () => {
4032
4032
  minHeight: 0
4033
4033
  },
4034
4034
  children: [
4035
- e && !ne && (() => {
4035
+ e && !se && (() => {
4036
4036
  const x = H.length === 0 ? 1 : H.length === 1 ? 2 : 3, _ = E === "AK" ? "Perineum" : "MPT", W = x === 1 ? `Place Point at ${_}` : x === 2 ? "Place Point at Distal Most Point" : "Ready to Continue", R = x === 1 ? `Click on the model to mark the ${_}.` : x === 2 ? "Click on the model to mark the Distal Most Point." : "Both points are placed. Click Continue to process the scan.", xe = x === 1 ? "#2fbf4a" : x === 2 ? "#e53935" : "#2fbf4a", N = H.length >= 2;
4037
- return v("div", {
4037
+ return S("div", {
4038
4038
  style: {
4039
- width: ao,
4039
+ width: an,
4040
4040
  flexShrink: 0,
4041
4041
  display: "flex",
4042
4042
  flexDirection: "column",
4043
- padding: an,
4043
+ padding: cn,
4044
4044
  gap: 20,
4045
4045
  fontFamily: "system-ui, sans-serif",
4046
4046
  boxSizing: "border-box",
@@ -4050,7 +4050,7 @@ let __tla = (async () => {
4050
4050
  i("style", {
4051
4051
  children: "@keyframes gm-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(12, 67, 173, 0.45) } 50% { box-shadow: 0 0 0 6px rgba(12, 67, 173, 0) } }"
4052
4052
  }),
4053
- v("div", {
4053
+ S("div", {
4054
4054
  style: {
4055
4055
  position: "relative",
4056
4056
  display: "flex",
@@ -4098,7 +4098,7 @@ let __tla = (async () => {
4098
4098
  },
4099
4099
  children: "i"
4100
4100
  }),
4101
- Lt && v("div", {
4101
+ Lt && S("div", {
4102
4102
  role: "tooltip",
4103
4103
  style: {
4104
4104
  position: "absolute",
@@ -4138,7 +4138,7 @@ let __tla = (async () => {
4138
4138
  })
4139
4139
  ]
4140
4140
  }),
4141
- v("div", {
4141
+ S("div", {
4142
4142
  style: {
4143
4143
  display: "flex",
4144
4144
  alignItems: "center",
@@ -4161,7 +4161,7 @@ let __tla = (async () => {
4161
4161
  transition: "background-color 200ms"
4162
4162
  }
4163
4163
  }, K)),
4164
- v("div", {
4164
+ S("div", {
4165
4165
  style: {
4166
4166
  fontSize: 11,
4167
4167
  fontWeight: 500,
@@ -4176,7 +4176,7 @@ let __tla = (async () => {
4176
4176
  })
4177
4177
  ]
4178
4178
  }),
4179
- v("div", {
4179
+ S("div", {
4180
4180
  style: {
4181
4181
  display: "flex",
4182
4182
  alignItems: "center",
@@ -4215,7 +4215,7 @@ let __tla = (async () => {
4215
4215
  }),
4216
4216
  i("button", {
4217
4217
  disabled: !N,
4218
- onClick: ro,
4218
+ onClick: io,
4219
4219
  style: {
4220
4220
  marginTop: 4,
4221
4221
  padding: "11px 14px",
@@ -4270,12 +4270,13 @@ let __tla = (async () => {
4270
4270
  ]
4271
4271
  });
4272
4272
  })(),
4273
- ne && Oe && E && i("div", {
4273
+ se && it && E && i("div", {
4274
4274
  style: {
4275
- flex: 1,
4275
+ width: an,
4276
+ flexShrink: 0,
4276
4277
  display: "flex",
4277
4278
  flexDirection: "column",
4278
- padding: an,
4279
+ padding: cn,
4279
4280
  boxSizing: "border-box",
4280
4281
  minHeight: 0,
4281
4282
  fontFamily: "system-ui, sans-serif"
@@ -4297,29 +4298,27 @@ let __tla = (async () => {
4297
4298
  amputationType: E,
4298
4299
  spacingInches: F,
4299
4300
  scanMeasurements: G,
4300
- scanFrontalHeight: tt,
4301
- onSave: so,
4301
+ scanFrontalHeight: et,
4302
+ onSave: lo,
4302
4303
  onSkip: ln,
4303
- onFormChange: Yn,
4304
- onHeightChange: Kn,
4305
- initialValues: Se,
4306
- initialFrontalHeight: Ne == null ? void 0 : Ne.frontalHeight
4304
+ onFormChange: Zn,
4305
+ onHeightChange: qn,
4306
+ initialValues: ve,
4307
+ initialFrontalHeight: He == null ? void 0 : He.frontalHeight
4307
4308
  })
4308
4309
  })
4309
4310
  }),
4310
- v("div", {
4311
+ S("div", {
4311
4312
  ref: Wt,
4312
4313
  style: {
4313
- flex: ne && Oe ? "0 0 0px" : 1,
4314
- width: ne && Oe ? 0 : void 0,
4315
- visibility: ne && Oe ? "hidden" : "visible",
4314
+ flex: 1,
4316
4315
  position: "relative",
4317
4316
  minHeight: 0,
4318
4317
  overflow: "hidden"
4319
4318
  },
4320
- onDragOver: t.showDragDrop ? eo : void 0,
4321
- onDragLeave: t.showDragDrop ? to : void 0,
4322
- onDrop: t.showDragDrop ? no : void 0,
4319
+ onDragOver: t.showDragDrop ? to : void 0,
4320
+ onDragLeave: t.showDragDrop ? no : void 0,
4321
+ onDrop: t.showDragDrop ? oo : void 0,
4323
4322
  children: [
4324
4323
  t.showDragDrop && !e && !M && i("div", {
4325
4324
  style: {
@@ -4340,7 +4339,7 @@ let __tla = (async () => {
4340
4339
  fontFamily: "system-ui, sans-serif"
4341
4340
  },
4342
4341
  children: "Drag & Drop Files Here"
4343
- }) : v("div", {
4342
+ }) : S("div", {
4344
4343
  style: {
4345
4344
  textAlign: "center"
4346
4345
  },
@@ -4378,7 +4377,7 @@ let __tla = (async () => {
4378
4377
  alignItems: "center",
4379
4378
  justifyContent: "center"
4380
4379
  },
4381
- children: v("div", {
4380
+ children: S("div", {
4382
4381
  style: {
4383
4382
  textAlign: "center"
4384
4383
  },
@@ -4408,17 +4407,17 @@ let __tla = (async () => {
4408
4407
  ]
4409
4408
  })
4410
4409
  }),
4411
- M && i(wn, {
4410
+ M && i(Sn, {
4412
4411
  message: b || "Processing mesh..."
4413
4412
  }),
4414
- B && i(wn, {
4413
+ B && i(Sn, {
4415
4414
  message: ee
4416
4415
  }),
4417
4416
  Mt && i($o, {
4418
4417
  message: Mt,
4419
4418
  onDismiss: () => Fe(null)
4420
4419
  }),
4421
- t.showAmputationModal && S && i("div", {
4420
+ t.showAmputationModal && v && i("div", {
4422
4421
  style: {
4423
4422
  position: "absolute",
4424
4423
  inset: 0,
@@ -4430,7 +4429,7 @@ let __tla = (async () => {
4430
4429
  justifyContent: "center",
4431
4430
  zIndex: 20
4432
4431
  },
4433
- children: v("div", {
4432
+ children: S("div", {
4434
4433
  style: {
4435
4434
  backgroundColor: "#fff",
4436
4435
  borderRadius: 4,
@@ -4439,7 +4438,7 @@ let __tla = (async () => {
4439
4438
  fontFamily: "system-ui, sans-serif"
4440
4439
  },
4441
4440
  children: [
4442
- v("div", {
4441
+ S("div", {
4443
4442
  style: {
4444
4443
  padding: "24px 24px 20px"
4445
4444
  },
@@ -4469,7 +4468,7 @@ let __tla = (async () => {
4469
4468
  children: [
4470
4469
  "AK",
4471
4470
  "BK"
4472
- ].map((x) => v("label", {
4471
+ ].map((x) => S("label", {
4473
4472
  onClick: () => w(x),
4474
4473
  style: {
4475
4474
  flex: 1,
@@ -4505,7 +4504,7 @@ let __tla = (async () => {
4505
4504
  },
4506
4505
  children: x
4507
4506
  }),
4508
- v("span", {
4507
+ S("span", {
4509
4508
  style: {
4510
4509
  fontSize: 13,
4511
4510
  color: "rgba(0,0,0,0.54)"
@@ -4520,7 +4519,7 @@ let __tla = (async () => {
4520
4519
  })
4521
4520
  ]
4522
4521
  }),
4523
- v("div", {
4522
+ S("div", {
4524
4523
  style: {
4525
4524
  display: "flex",
4526
4525
  justifyContent: "flex-end",
@@ -4549,7 +4548,7 @@ let __tla = (async () => {
4549
4548
  children: "Cancel"
4550
4549
  }),
4551
4550
  i("button", {
4552
- onClick: () => E && oo(E),
4551
+ onClick: () => E && ro(E),
4553
4552
  disabled: !E,
4554
4553
  style: {
4555
4554
  padding: "6px 16px",
@@ -4582,7 +4581,7 @@ let __tla = (async () => {
4582
4581
  }
4583
4582
  }),
4584
4583
  i(To, {
4585
- children: v(wo, {
4584
+ children: S(wo, {
4586
4585
  camera: {
4587
4586
  position: [
4588
4587
  0,
@@ -4633,9 +4632,9 @@ let __tla = (async () => {
4633
4632
  mesh: e,
4634
4633
  maxPoints: 2,
4635
4634
  meshColor: Qt,
4636
- meshOpacity: _e ? 0.3 : qn,
4635
+ meshOpacity: _e ? 0.3 : Un,
4637
4636
  frontFaceOnly: de,
4638
- doubleShellTransparency: Z && ne
4637
+ doubleShellTransparency: Z && se
4639
4638
  }),
4640
4639
  e && P === "3D" && i(Vo, {
4641
4640
  modelSize: d,
@@ -4647,39 +4646,39 @@ let __tla = (async () => {
4647
4646
  }),
4648
4647
  i(Jo, {
4649
4648
  modelSize: d,
4650
- isAligned: ne,
4649
+ isAligned: se,
4651
4650
  isCut: It,
4652
4651
  mesh: e,
4653
4652
  viewMode: P,
4654
- sliceY: ne && H.length >= 2 ? ze ?? rt ?? H[0].position.y : void 0,
4653
+ sliceY: se && H.length >= 2 ? ze ?? ot ?? H[0].position.y : void 0,
4655
4654
  landmarkCount: H.length,
4656
4655
  measurementGeometry: Q,
4657
- fitYMin: ne && H.length >= 2 ? ze ?? rt ?? void 0 : void 0,
4658
- fitYMax: ne && H.length >= 2 ? it ?? H[0].position.y : void 0,
4656
+ fitYMin: se && H.length >= 2 ? ze ?? ot ?? void 0 : void 0,
4657
+ fitYMax: se && H.length >= 2 ? rt ?? H[0].position.y : void 0,
4659
4658
  resetCameraToFrontRef: Rt
4660
4659
  }),
4661
- !ne && i(kn, {
4660
+ !se && i(Fn, {
4662
4661
  enableDamping: false
4663
4662
  }),
4664
- ne && G.length > 0 && e && P === "3D" && i(Qo, {
4663
+ se && G.length > 0 && e && P === "3D" && i(Qo, {
4665
4664
  mesh: e,
4666
- isDragging: On
4665
+ isDragging: Hn
4667
4666
  }),
4668
- e && ne && H.length >= 3 && (() => {
4667
+ e && se && H.length >= 3 && (() => {
4669
4668
  const _ = e.geometry.getIndex();
4670
4669
  if (!_ || _.count < 30) return null;
4671
- const W = H[2], R = H[0], xe = Ye ?? W.position.y, N = ze ?? rt ?? R.position.y;
4670
+ const W = H[2], R = H[0], xe = Xe ?? W.position.y, N = ze ?? ot ?? R.position.y;
4672
4671
  return P === "2D" ? i(nr, {
4673
- mesh: je ?? e,
4672
+ mesh: Ve ?? e,
4674
4673
  upperY: N,
4675
4674
  originY: R.position.y,
4676
4675
  modelSize: d,
4677
4676
  meshColor: Qt,
4678
4677
  displayUnit: z
4679
- }) : v(Ie, {
4678
+ }) : S(Ie, {
4680
4679
  children: [
4681
4680
  i(Ko, {
4682
- mesh: je ?? e,
4681
+ mesh: Ve ?? e,
4683
4682
  startY: xe,
4684
4683
  endY: N,
4685
4684
  spacing: ft,
@@ -4688,25 +4687,25 @@ let __tla = (async () => {
4688
4687
  reverseOrder: true,
4689
4688
  displayUnit: z,
4690
4689
  useInnerSurface: Z && !de,
4691
- formMeasurements: Oe ? Xn ?? Se : Ue ? Se : void 0,
4692
- originY: it ?? R.position.y,
4690
+ formMeasurements: it ? Yn ?? ve : qe ? ve : void 0,
4691
+ originY: rt ?? R.position.y,
4693
4692
  wasmSlices: ke
4694
4693
  }),
4695
4694
  i(Uo, {
4696
4695
  mesh: e,
4697
- greenY: it ?? R.position.y,
4696
+ greenY: rt ?? R.position.y,
4698
4697
  modelSize: d,
4699
4698
  displayUnit: z,
4700
4699
  bottomY: Z ? W.position.y : void 0,
4701
- formHeight: Oe ? Zn : Ue ? Ne == null ? void 0 : Ne.frontalHeight : void 0
4700
+ formHeight: it ? Kn : qe ? He == null ? void 0 : He.frontalHeight : void 0
4702
4701
  }),
4703
4702
  i(or, {
4704
4703
  mesh: e,
4705
- yPosition: it ?? R.position.y,
4704
+ yPosition: rt ?? R.position.y,
4706
4705
  onYChange: (K) => {
4707
4706
  Zt(K), Ae(null);
4708
4707
  const be = K - R.position.y;
4709
- At((rt ?? R.position.y + ft * 2) + be);
4708
+ At((ot ?? R.position.y + ft * 2) + be);
4710
4709
  },
4711
4710
  minY: R.position.y - ft,
4712
4711
  maxY: R.position.y + ft,
@@ -4721,21 +4720,21 @@ let __tla = (async () => {
4721
4720
  ]
4722
4721
  });
4723
4722
  })(),
4724
- e && ne && P === "3D" && _e && i(Cr, {
4723
+ e && se && P === "3D" && _e && i(Cr, {
4725
4724
  mesh: e
4726
4725
  }),
4727
- e && t.showDebug && _e && P === "3D" && i(Sr, {
4726
+ e && t.showDebug && _e && P === "3D" && i(vr, {
4728
4727
  mesh: e,
4729
4728
  modelSize: d,
4730
4729
  layers: Kt,
4731
4730
  landmarkPoints: H,
4732
4731
  componentDebug: null,
4733
- aoData: ve,
4732
+ aoData: Se,
4734
4733
  aoGeometry: O,
4735
4734
  measurementGeometry: Q
4736
4735
  }),
4737
4736
  i(kr, {
4738
- screenshotFnRef: Jn,
4737
+ screenshotFnRef: Qn,
4739
4738
  mesh: e,
4740
4739
  modelSize: d,
4741
4740
  measurementGeometry: Q
@@ -4743,7 +4742,7 @@ let __tla = (async () => {
4743
4742
  ]
4744
4743
  })
4745
4744
  }),
4746
- e && v("div", {
4745
+ e && S("div", {
4747
4746
  style: {
4748
4747
  position: "absolute",
4749
4748
  top: 16,
@@ -4753,7 +4752,7 @@ let __tla = (async () => {
4753
4752
  gap: 8
4754
4753
  },
4755
4754
  children: [
4756
- t.showStartOver && ne && i("button", {
4755
+ t.showStartOver && se && i("button", {
4757
4756
  onClick: () => window.location.reload(),
4758
4757
  style: {
4759
4758
  padding: "6px 16px",
@@ -4770,8 +4769,8 @@ let __tla = (async () => {
4770
4769
  },
4771
4770
  children: "Start Over"
4772
4771
  }),
4773
- !ne && H.length >= 1 && i("button", {
4774
- onClick: Qn,
4772
+ !se && H.length >= 1 && i("button", {
4773
+ onClick: eo,
4775
4774
  style: {
4776
4775
  padding: "6px 16px",
4777
4776
  borderRadius: 4,
@@ -4787,8 +4786,8 @@ let __tla = (async () => {
4787
4786
  },
4788
4787
  children: "Reset Points"
4789
4788
  }),
4790
- ne && !Pt && i("button", {
4791
- onClick: io,
4789
+ se && !Pt && i("button", {
4790
+ onClick: so,
4792
4791
  style: {
4793
4792
  padding: "6px 16px",
4794
4793
  borderRadius: 4,
@@ -4808,13 +4807,13 @@ let __tla = (async () => {
4808
4807
  }),
4809
4808
  t.showDebug && _e && e && P === "3D" && i(Ar, {
4810
4809
  layers: Kt,
4811
- onToggleLayer: (x) => Nn((_) => ({
4810
+ onToggleLayer: (x) => Vn((_) => ({
4812
4811
  ..._,
4813
4812
  [x]: !_[x]
4814
4813
  })),
4815
4814
  isDoubleShell: Z
4816
4815
  }),
4817
- ne && G.length > 0 && v("div", {
4816
+ se && G.length > 0 && S("div", {
4818
4817
  style: {
4819
4818
  position: "absolute",
4820
4819
  top: 16,
@@ -4824,7 +4823,7 @@ let __tla = (async () => {
4824
4823
  zIndex: 10
4825
4824
  },
4826
4825
  children: [
4827
- v("div", {
4826
+ S("div", {
4828
4827
  style: {
4829
4828
  display: "flex",
4830
4829
  borderRadius: 6,
@@ -4864,7 +4863,7 @@ let __tla = (async () => {
4864
4863
  })
4865
4864
  ]
4866
4865
  }),
4867
- v("div", {
4866
+ S("div", {
4868
4867
  style: {
4869
4868
  display: "flex",
4870
4869
  borderRadius: 6,
@@ -4904,7 +4903,7 @@ let __tla = (async () => {
4904
4903
  })
4905
4904
  ]
4906
4905
  }),
4907
- t.showSpacingToggle && P === "3D" && v("div", {
4906
+ t.showSpacingToggle && P === "3D" && S("div", {
4908
4907
  style: {
4909
4908
  display: "flex",
4910
4909
  borderRadius: 6,
@@ -4944,7 +4943,7 @@ let __tla = (async () => {
4944
4943
  })
4945
4944
  ]
4946
4945
  }),
4947
- P === "3D" && Se && i("div", {
4946
+ P === "3D" && ve && i("div", {
4948
4947
  style: {
4949
4948
  display: "flex",
4950
4949
  borderRadius: 6,
@@ -4957,9 +4956,9 @@ let __tla = (async () => {
4957
4956
  style: {
4958
4957
  padding: "6px 14px",
4959
4958
  fontSize: 13,
4960
- fontWeight: Ue ? 600 : 400,
4961
- backgroundColor: Ue ? "rgb(12, 67, 173)" : "#fff",
4962
- color: Ue ? "#fff" : "#666",
4959
+ fontWeight: qe ? 600 : 400,
4960
+ backgroundColor: qe ? "rgb(12, 67, 173)" : "#fff",
4961
+ color: qe ? "#fff" : "#666",
4963
4962
  border: "none",
4964
4963
  cursor: "pointer",
4965
4964
  fontFamily: "system-ui, sans-serif"
@@ -4977,7 +4976,7 @@ let __tla = (async () => {
4977
4976
  },
4978
4977
  children: i("button", {
4979
4978
  onClick: async () => {
4980
- const x = await Qe();
4979
+ const x = await Je();
4981
4980
  if (!x) return;
4982
4981
  const _ = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), W = (R, xe) => {
4983
4982
  const N = document.createElement("a");
@@ -5007,7 +5006,7 @@ let __tla = (async () => {
5007
5006
  boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
5008
5007
  },
5009
5008
  children: i("button", {
5010
- onClick: () => Hn((x) => !x),
5009
+ onClick: () => Nn((x) => !x),
5011
5010
  style: {
5012
5011
  padding: "6px 14px",
5013
5012
  fontSize: 13,
@@ -5023,15 +5022,15 @@ let __tla = (async () => {
5023
5022
  })
5024
5023
  ]
5025
5024
  }),
5026
- e && oe && i(er, {
5025
+ e && ne && i(er, {
5027
5026
  wasAutoScaled: ce,
5028
5027
  onDismiss: () => J(false)
5029
5028
  }),
5030
- e && fe && ne && i(tr, {
5029
+ e && fe && se && i(tr, {
5031
5030
  isDoubleShell: Z,
5032
- onDismiss: () => re(false)
5031
+ onDismiss: () => oe(false)
5033
5032
  }),
5034
- s && ne && i("div", {
5033
+ s && se && i("div", {
5035
5034
  className: "gm-action-row-container",
5036
5035
  style: {
5037
5036
  position: "absolute",
@@ -5042,7 +5041,7 @@ let __tla = (async () => {
5042
5041
  containerType: "inline-size",
5043
5042
  pointerEvents: "none"
5044
5043
  },
5045
- children: v("div", {
5044
+ children: S("div", {
5046
5045
  className: "gm-action-row",
5047
5046
  style: {
5048
5047
  display: "flex",
@@ -5085,20 +5084,20 @@ let __tla = (async () => {
5085
5084
  onClick: () => lt(true),
5086
5085
  children: "Have Galileo Check My Measurements"
5087
5086
  }),
5088
- v("div", {
5087
+ S("div", {
5089
5088
  className: "gm-btn-group",
5090
5089
  children: [
5091
- Pt && !Oe && i("button", {
5090
+ Pt && !it && i("button", {
5092
5091
  className: "gm-btn gm-btn-secondary",
5093
- onClick: () => Je(true),
5092
+ onClick: () => Ue(true),
5094
5093
  children: "Edit Measurements"
5095
5094
  }),
5096
- Pt && (lo ? i("button", {
5095
+ Pt && (ao ? i("button", {
5097
5096
  className: "gm-btn gm-btn-primary",
5098
5097
  disabled: Be,
5099
5098
  onClick: () => Tt("continue"),
5100
5099
  children: "Continue \u2192"
5101
- }) : v(Ie, {
5100
+ }) : S(Ie, {
5102
5101
  children: [
5103
5102
  i("button", {
5104
5103
  className: "gm-btn gm-btn-secondary",
@@ -5123,7 +5122,7 @@ let __tla = (async () => {
5123
5122
  })
5124
5123
  ]
5125
5124
  }),
5126
- Be && v("div", {
5125
+ Be && S("div", {
5127
5126
  "data-finalizing-overlay": true,
5128
5127
  style: {
5129
5128
  position: "absolute",
@@ -5162,7 +5161,7 @@ let __tla = (async () => {
5162
5161
  })
5163
5162
  ]
5164
5163
  }),
5165
- l && _t.length > 0 && v("div", {
5164
+ l && _t.length > 0 && S("div", {
5166
5165
  style: {
5167
5166
  height: 120,
5168
5167
  flexShrink: 0,
@@ -5175,7 +5174,7 @@ let __tla = (async () => {
5175
5174
  flexDirection: "column"
5176
5175
  },
5177
5176
  children: [
5178
- v("div", {
5177
+ S("div", {
5179
5178
  style: {
5180
5179
  display: "flex",
5181
5180
  alignItems: "center",
@@ -5195,25 +5194,25 @@ let __tla = (async () => {
5195
5194
  },
5196
5195
  children: "GALILEO DEBUG"
5197
5196
  }),
5198
- v("div", {
5197
+ S("div", {
5199
5198
  style: {
5200
5199
  display: "flex",
5201
5200
  gap: 8,
5202
5201
  alignItems: "center"
5203
5202
  },
5204
5203
  children: [
5205
- v("span", {
5204
+ S("span", {
5206
5205
  style: {
5207
5206
  color: "#484f58",
5208
5207
  fontSize: 9
5209
5208
  },
5210
5209
  children: [
5211
5210
  "WASM ",
5212
- Ve.current ? "v2" : "N/A",
5211
+ Ne.current ? "v2" : "N/A",
5213
5212
  " | ",
5214
5213
  H.length,
5215
5214
  " pts | ",
5216
- ne ? "aligned" : "unaligned",
5215
+ se ? "aligned" : "unaligned",
5217
5216
  " | ",
5218
5217
  G.length,
5219
5218
  " slices"
@@ -5259,7 +5258,7 @@ let __tla = (async () => {
5259
5258
  })
5260
5259
  ]
5261
5260
  }),
5262
- Vn && i(dr, {
5261
+ jn && i(dr, {
5263
5262
  onSkip: ln,
5264
5263
  onCancel: () => lt(false)
5265
5264
  })
@@ -5273,7 +5272,7 @@ let __tla = (async () => {
5273
5272
  t
5274
5273
  ]), null;
5275
5274
  }
5276
- $n = function(t) {
5275
+ On = function(t) {
5277
5276
  const r = t === "AK" ? 2 : 1, n = [];
5278
5277
  for (let o = 2; o >= 1; o -= r) n.push(`${o}_above`);
5279
5278
  n.push("at_ref");
@@ -5293,7 +5292,7 @@ let __tla = (async () => {
5293
5292
  return n;
5294
5293
  };
5295
5294
  yt = function(t, r) {
5296
- const n = $n(r), o = {};
5295
+ const n = On(r), o = {};
5297
5296
  for (let s = 0; s < Math.min(t.length, n.length); s++) {
5298
5297
  const l = t[s];
5299
5298
  l != null && !isNaN(l) && (o[n[s]] = l);
@@ -5302,7 +5301,7 @@ let __tla = (async () => {
5302
5301
  };
5303
5302
  Fr = function(t, r) {
5304
5303
  if (!t) return;
5305
- const o = $n(r).map((s) => {
5304
+ const o = On(r).map((s) => {
5306
5305
  const l = t[s];
5307
5306
  return l ?? void 0;
5308
5307
  });
@@ -5401,8 +5400,8 @@ let __tla = (async () => {
5401
5400
  f = yt(e.formMeasurements, t.spacing_type);
5402
5401
  const y = e.scanMeasurements.map((F, A) => {
5403
5402
  var _a2;
5404
- const S = (_a2 = e.formMeasurements) == null ? void 0 : _a2[A];
5405
- return S == null || isNaN(S) ? null : +((F.modifiedValue ?? F.originalValue) - S).toFixed(1);
5403
+ const v = (_a2 = e.formMeasurements) == null ? void 0 : _a2[A];
5404
+ return v == null || isNaN(v) ? null : +((F.modifiedValue ?? F.originalValue) - v).toFixed(1);
5406
5405
  });
5407
5406
  u = yt(y, t.spacing_type);
5408
5407
  }
@@ -5481,5 +5480,5 @@ export {
5481
5480
  __tla,
5482
5481
  yt as a,
5483
5482
  Fr as c,
5484
- $n as g
5483
+ On as g
5485
5484
  };