@sage-rsc/talking-head-react 1.9.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,21 +1,21 @@
1
- import { jsxs as Ee, jsx as le } from "react/jsx-runtime";
2
- import { forwardRef as Ke, useRef as V, useState as ge, useEffect as ze, useCallback as W, useImperativeHandle as $e, useLayoutEffect as ft } from "react";
1
+ import { jsxs as Be, jsx as le } from "react/jsx-runtime";
2
+ import { forwardRef as $e, useRef as V, useState as pe, useEffect as ke, useCallback as W, useImperativeHandle as Je, useLayoutEffect as xt } from "react";
3
3
  import * as A from "three";
4
- import { OrbitControls as xt } from "three/addons/controls/OrbitControls.js";
5
- import { GLTFLoader as bt } from "three/addons/loaders/GLTFLoader.js";
6
- import { DRACOLoader as At } from "three/addons/loaders/DRACOLoader.js";
7
- import { FBXLoader as ot } from "three/addons/loaders/FBXLoader.js";
8
- import { RoomEnvironment as Rt } from "three/addons/environments/RoomEnvironment.js";
9
- import vt from "three/addons/libs/stats.module.js";
10
- let m, Ce, He;
11
- const T = [0, 0, 0, 0], U = new A.Vector3(), Qe = new A.Vector3(), ve = new A.Vector3(), Ye = new A.Vector3();
4
+ import { OrbitControls as bt } from "three/addons/controls/OrbitControls.js";
5
+ import { GLTFLoader as At } from "three/addons/loaders/GLTFLoader.js";
6
+ import { DRACOLoader as Rt } from "three/addons/loaders/DRACOLoader.js";
7
+ import { FBXLoader as st } from "three/addons/loaders/FBXLoader.js";
8
+ import { RoomEnvironment as vt } from "three/addons/environments/RoomEnvironment.js";
9
+ import It from "three/addons/libs/stats.module.js";
10
+ let m, we, He;
11
+ const T = [0, 0, 0, 0], U = new A.Vector3(), Ye = new A.Vector3(), Re = new A.Vector3(), qe = new A.Vector3();
12
12
  new A.Plane();
13
13
  new A.Ray();
14
14
  new A.Euler();
15
- const Ie = new A.Quaternion(), st = new A.Quaternion(), Pe = new A.Matrix4(), Be = new A.Matrix4();
15
+ const ve = new A.Quaternion(), rt = new A.Quaternion(), Oe = new A.Matrix4(), De = new A.Matrix4();
16
16
  new A.Vector3();
17
- const qe = new A.Vector3(0, 0, 1), It = new A.Vector3(1, 0, 0), Lt = new A.Vector3(0, 1, 0), St = new A.Vector3(0, 0, 1);
18
- class kt {
17
+ const _e = new A.Vector3(0, 0, 1), Lt = new A.Vector3(1, 0, 0), St = new A.Vector3(0, 1, 0), kt = new A.Vector3(0, 0, 1);
18
+ class wt {
19
19
  constructor(n = null) {
20
20
  this.opt = Object.assign({
21
21
  warmupMs: 2e3,
@@ -338,7 +338,7 @@ class kt {
338
338
  ea: [0, 0, 0, 0]
339
339
  // External acceleration [m/s^2]
340
340
  };
341
- c.boneParent.matrixWorld.decompose(U, Ie, ve), U.copy(qe).applyQuaternion(Ie).setY(0).normalize(), Ie.premultiply(st.setFromUnitVectors(qe, U).invert()).normalize(), c.qWorldInverseYaw = Ie.clone().normalize(), this.data.push(c), this.dict[u] = c;
341
+ c.boneParent.matrixWorld.decompose(U, ve, Re), U.copy(_e).applyQuaternion(ve).setY(0).normalize(), ve.premultiply(rt.setFromUnitVectors(_e, U).invert()).normalize(), c.qWorldInverseYaw = ve.clone().normalize(), this.data.push(c), this.dict[u] = c;
342
342
  try {
343
343
  this.setValue(u, "type", s.type), this.setValue(u, "stiffness", s.stiffness), this.setValue(u, "damping", s.damping), this.setValue(u, "external", s.external), this.setValue(u, "limits", s.limits), this.setValue(u, "excludes", s.excludes), this.setValue(u, "deltaLocal", s.deltaLocal), this.setValue(u, "deltaWorld", s.deltaWorld), this.setValue(u, "pivot", s.pivot), this.setValue(u, "helper", s.helper);
344
344
  } catch (r) {
@@ -356,22 +356,22 @@ class kt {
356
356
  for (this.timerMs += n, n > 1e3 && (this.timerMs = 0), n /= 1e3, e = 0, o = this.objectsUpdate.length; e < o; e++)
357
357
  i = this.objectsUpdate[e], i.updateMatrix(), i.parent === null ? i.matrixWorld.copy(i.matrix) : i.matrixWorld.multiplyMatrices(i.parent.matrixWorld, i.matrix), i.matrixWorldNeedsUpdate = !1;
358
358
  for (e = 0, o = this.data.length; e < o; e++) {
359
- if (i = this.data[e], U.copy(i.vWorld), Pe.copy(i.boneParent.matrixWorld), Be.copy(Pe).invert(), i.vWorld.setFromMatrixPosition(Pe), U.applyMatrix4(Be), U.length() > 0.5 && (console.info("Info: Unrealistic jump of " + U.length().toFixed(2) + " meters."), U.setLength(0.5)), U.applyQuaternion(i.bone.quaternion), T[0] = U.x, T[1] = U.y, T[2] = -U.z, T[3] = U.length() / 3, i.children)
359
+ if (i = this.data[e], U.copy(i.vWorld), Oe.copy(i.boneParent.matrixWorld), De.copy(Oe).invert(), i.vWorld.setFromMatrixPosition(Oe), U.applyMatrix4(De), U.length() > 0.5 && (console.info("Info: Unrealistic jump of " + U.length().toFixed(2) + " meters."), U.setLength(0.5)), U.applyQuaternion(i.bone.quaternion), T[0] = U.x, T[1] = U.y, T[2] = -U.z, T[3] = U.length() / 3, i.children)
360
360
  for (t = 0, s = i.children.length; t < s; t++)
361
361
  m = i.children[t], T[0] -= m.v[0] * n / 3, T[1] -= m.v[1] * n / 3, T[2] += m.v[2] * n / 3, T[3] -= m.v[3] * n / 3;
362
362
  if (m = this.opt.sensitivityFactor, T[0] *= i.ext * m, T[1] *= i.ext * m, T[2] *= i.ext * m, T[3] *= i.ext * m, i.isX && (m = T[0] / n, i.ea[0] = (m - i.ev[0]) / n, i.ev[0] = m, i.a[0] = -i.k[0] * i.p[0] - i.c[0] * i.v[0] - i.ea[0], i.p[0] += i.v[0] * n + i.a[0] * n * n / 2 + T[0], m = i.v[0] + i.a[0] * n / 2, m = -i.k[0] * i.p[0] - i.c[0] * m - i.ea[0], i.v[0] = i.v[0] + (m + i.a[0]) * n / 2), i.isY && (m = T[1] / n, i.ea[1] = (m - i.ev[1]) / n, i.ev[1] = m, i.a[1] = -i.k[1] * i.p[1] - i.c[1] * i.v[1] - i.ea[1], i.p[1] += i.v[1] * n + i.a[1] * n * n / 2 + T[1], m = i.v[1] + i.a[1] * n / 2, m = -i.k[1] * i.p[1] - i.c[1] * m - i.ea[1], i.v[1] = i.v[1] + (m + i.a[1]) * n / 2), i.isZ && (m = T[2] / n, i.ea[2] = (m - i.ev[2]) / n, i.ev[2] = m, i.a[2] = -i.k[2] * i.p[2] - i.c[2] * i.v[2] - i.ea[2], i.p[2] += i.v[2] * n + i.a[2] * n * n / 2 + T[2], m = i.v[2] + i.a[2] * n / 2, m = -i.k[2] * i.p[2] - i.c[2] * m - i.ea[2], i.v[2] = i.v[2] + (m + i.a[2]) * n / 2), i.isT && (m = T[3] / n, i.ea[3] = (m - i.ev[3]) / n, i.ev[3] = m, i.a[3] = -i.k[3] * i.p[3] - i.c[3] * i.v[3] - i.ea[3], i.p[3] += i.v[3] * n + i.a[3] * n * n / 2 + T[3], m = i.v[3] + i.a[3] * n / 2, m = -i.k[3] * i.p[3] - i.c[3] * m - i.ea[3], i.v[3] = i.v[3] + (m + i.a[3]) * n / 2), this.timerMs < this.opt.warmupMs && (i.v[0] *= 1e-4, i.p[0] *= 1e-4, i.v[1] *= 1e-4, i.p[1] *= 1e-4, i.v[2] *= 1e-4, i.p[2] *= 1e-4, i.v[3] *= 1e-4, i.p[3] *= 1e-4), T[0] = i.p[0], T[1] = i.p[1], T[2] = i.p[2], T[3] = i.p[3], m = this.opt.movementFactor, T[0] *= m, T[1] *= m, T[2] *= m, T[3] *= m, i.dl && (m = i.dl, T[0] += m[0], T[1] += m[1], T[2] += m[2]), i.dw && (m = i.dw, U.set(
363
363
  i.vBasis.x + T[0],
364
364
  i.vBasis.y + T[1],
365
365
  i.vBasis.z + T[2]
366
- ), U.applyMatrix4(Pe), U.x += m[0], U.y += m[1], U.z += m[2], U.applyMatrix4(Be), T[0] += U.x - i.vBasis.x, T[1] += U.y - i.vBasis.y, T[2] += U.z - i.vBasis.z), i.limits && this.opt.isLimits && (m = i.limits, m[0] && (m[0][0] !== null && T[0] < m[0][0] && (T[0] = m[0][0]), m[0][1] !== null && T[0] > m[0][1] && (T[0] = m[0][1])), m[1] && (m[1][0] !== null && T[1] < m[1][0] && (T[1] = m[1][0]), m[1][1] !== null && T[1] > m[1][1] && (T[1] = m[1][1])), m[2] && (m[2][0] !== null && T[2] < m[2][0] && (T[2] = m[2][0]), m[2][1] !== null && T[2] > m[2][1] && (T[2] = m[2][1])), m[3] && (m[3][0] !== null && T[3] < m[3][0] && (T[3] = m[3][0]), m[3][1] !== null && T[3] > m[3][1] && (T[3] = m[3][1]))), i.isPoint)
366
+ ), U.applyMatrix4(Oe), U.x += m[0], U.y += m[1], U.z += m[2], U.applyMatrix4(De), T[0] += U.x - i.vBasis.x, T[1] += U.y - i.vBasis.y, T[2] += U.z - i.vBasis.z), i.limits && this.opt.isLimits && (m = i.limits, m[0] && (m[0][0] !== null && T[0] < m[0][0] && (T[0] = m[0][0]), m[0][1] !== null && T[0] > m[0][1] && (T[0] = m[0][1])), m[1] && (m[1][0] !== null && T[1] < m[1][0] && (T[1] = m[1][0]), m[1][1] !== null && T[1] > m[1][1] && (T[1] = m[1][1])), m[2] && (m[2][0] !== null && T[2] < m[2][0] && (T[2] = m[2][0]), m[2][1] !== null && T[2] > m[2][1] && (T[2] = m[2][1])), m[3] && (m[3][0] !== null && T[3] < m[3][0] && (T[3] = m[3][0]), m[3][1] !== null && T[3] > m[3][1] && (T[3] = m[3][1]))), i.isPoint)
367
367
  i.bone.position.set(
368
368
  i.vBasis.x + T[0],
369
369
  i.vBasis.y + T[1],
370
370
  i.vBasis.z - T[2]
371
371
  );
372
- else if (i.boneParent.quaternion.copy(i.qBasis), i.pivot && this.opt.isPivots && (i.boneParent.updateWorldMatrix(!1, !1), i.boneParent.matrixWorld.decompose(U, Ie, ve), U.copy(qe).applyQuaternion(Ie).setY(0).normalize(), Ie.premultiply(st.setFromUnitVectors(qe, U).invert()).normalize(), i.boneParent.quaternion.multiply(Ie.invert()), i.boneParent.quaternion.multiply(i.qWorldInverseYaw)), i.isZ && (m = Math.atan(T[0] / i.l), Ie.setFromAxisAngle(St, -m), i.boneParent.quaternion.multiply(Ie)), i.isY && (m = i.l / 3, m = m * Math.tanh(T[1] / m), i.bone.position.setLength(i.l + m)), i.isX && (m = Math.atan(T[2] / i.l), Ie.setFromAxisAngle(It, -m), i.boneParent.quaternion.multiply(Ie)), i.isT && (m = 1.5 * Math.tanh(T[3] * 1.5), Ie.setFromAxisAngle(Lt, -m), i.boneParent.quaternion.multiply(Ie)), i.boneParent.updateWorldMatrix(!1, !0), i.excludes && this.opt.isExcludes)
372
+ else if (i.boneParent.quaternion.copy(i.qBasis), i.pivot && this.opt.isPivots && (i.boneParent.updateWorldMatrix(!1, !1), i.boneParent.matrixWorld.decompose(U, ve, Re), U.copy(_e).applyQuaternion(ve).setY(0).normalize(), ve.premultiply(rt.setFromUnitVectors(_e, U).invert()).normalize(), i.boneParent.quaternion.multiply(ve.invert()), i.boneParent.quaternion.multiply(i.qWorldInverseYaw)), i.isZ && (m = Math.atan(T[0] / i.l), ve.setFromAxisAngle(kt, -m), i.boneParent.quaternion.multiply(ve)), i.isY && (m = i.l / 3, m = m * Math.tanh(T[1] / m), i.bone.position.setLength(i.l + m)), i.isX && (m = Math.atan(T[2] / i.l), ve.setFromAxisAngle(Lt, -m), i.boneParent.quaternion.multiply(ve)), i.isT && (m = 1.5 * Math.tanh(T[3] * 1.5), ve.setFromAxisAngle(St, -m), i.boneParent.quaternion.multiply(ve)), i.boneParent.updateWorldMatrix(!1, !0), i.excludes && this.opt.isExcludes)
373
373
  for (t = 0, s = i.excludes.length; t < s; t++)
374
- m = i.excludes[t], ve.set(0, 0, 0), m.deltaLocal && (ve.x += m.deltaLocal[0], ve.y += m.deltaLocal[1], ve.z += m.deltaLocal[2]), ve.applyMatrix4(m.bone.matrixWorld), Be.copy(i.boneParent.matrixWorld).invert(), ve.applyMatrix4(Be), U.copy(i.bone.position), !(U.distanceToSquared(ve) >= m.radiusSq) && (He = U.length(), Ce = ve.length(), !(Ce > m.radius + He) && (Ce < Math.abs(m.radius - He) || (Ce = (Ce * Ce + He * He - m.radiusSq) / (2 * Ce), ve.normalize(), Ye.copy(ve).multiplyScalar(Ce), Ce = Math.sqrt(He * He - Ce * Ce), U.subVectors(U, Ye).projectOnPlane(ve).normalize().multiplyScalar(Ce), Qe.subVectors(i.vBasis, Ye).projectOnPlane(ve).normalize(), He = Qe.dot(U), He < 0 && (He = Math.sqrt(Ce * Ce - He * He), Qe.multiplyScalar(He), U.add(Qe)), U.add(Ye).normalize(), ve.copy(i.bone.position).normalize(), Ie.setFromUnitVectors(ve, U), i.boneParent.quaternion.premultiply(Ie), i.boneParent.updateWorldMatrix(!1, !0))));
374
+ m = i.excludes[t], Re.set(0, 0, 0), m.deltaLocal && (Re.x += m.deltaLocal[0], Re.y += m.deltaLocal[1], Re.z += m.deltaLocal[2]), Re.applyMatrix4(m.bone.matrixWorld), De.copy(i.boneParent.matrixWorld).invert(), Re.applyMatrix4(De), U.copy(i.bone.position), !(U.distanceToSquared(Re) >= m.radiusSq) && (He = U.length(), we = Re.length(), !(we > m.radius + He) && (we < Math.abs(m.radius - He) || (we = (we * we + He * He - m.radiusSq) / (2 * we), Re.normalize(), qe.copy(Re).multiplyScalar(we), we = Math.sqrt(He * He - we * we), U.subVectors(U, qe).projectOnPlane(Re).normalize().multiplyScalar(we), Ye.subVectors(i.vBasis, qe).projectOnPlane(Re).normalize(), He = Ye.dot(U), He < 0 && (He = Math.sqrt(we * we - He * He), Ye.multiplyScalar(He), U.add(Ye)), U.add(qe).normalize(), Re.copy(i.bone.position).normalize(), ve.setFromUnitVectors(Re, U), i.boneParent.quaternion.premultiply(ve), i.boneParent.updateWorldMatrix(!1, !0))));
375
375
  }
376
376
  this.helpers.isActive && this.updateHelpers();
377
377
  }
@@ -442,17 +442,17 @@ class kt {
442
442
  */
443
443
  updateHelpers() {
444
444
  if (m = this.helpers.points, m.bones.length) {
445
- Be.copy(this.armature.matrixWorld).invert();
445
+ De.copy(this.armature.matrixWorld).invert();
446
446
  const n = m.object.geometry.getAttribute("position");
447
447
  for (let e = 0, t = m.bones.length; e < t; e++)
448
- Pe.multiplyMatrices(Be, m.bones[e].matrixWorld), U.setFromMatrixPosition(Pe), n.setXYZ(e, U.x, U.y, U.z);
448
+ Oe.multiplyMatrices(De, m.bones[e].matrixWorld), U.setFromMatrixPosition(Oe), n.setXYZ(e, U.x, U.y, U.z);
449
449
  n.needsUpdate = !0, m.object.updateMatrixWorld();
450
450
  }
451
451
  if (m = this.helpers.lines, m.bones.length) {
452
- Be.copy(this.armature.matrixWorld).invert();
452
+ De.copy(this.armature.matrixWorld).invert();
453
453
  const n = m.object.geometry.getAttribute("position");
454
454
  for (let e = 0, t = 0, o = m.bones.length; e < o; e++, t += 2)
455
- Pe.multiplyMatrices(Be, m.bones[e].matrixWorld), U.setFromMatrixPosition(Pe), n.setXYZ(t, U.x, U.y, U.z), Pe.multiplyMatrices(Be, m.bones[e].parent.matrixWorld), U.setFromMatrixPosition(Pe), n.setXYZ(t + 1, U.x, U.y, U.z);
455
+ Oe.multiplyMatrices(De, m.bones[e].matrixWorld), U.setFromMatrixPosition(Oe), n.setXYZ(t, U.x, U.y, U.z), Oe.multiplyMatrices(De, m.bones[e].parent.matrixWorld), U.setFromMatrixPosition(Oe), n.setXYZ(t + 1, U.x, U.y, U.z);
456
456
  n.needsUpdate = !0, m.object.updateMatrixWorld();
457
457
  }
458
458
  }
@@ -489,7 +489,7 @@ class kt {
489
489
  this.stop(), this.scene = null, this.armature = null, this.config = [], this.data = [], this.dict = {}, this.objectsUpdate = [], this.timerMs = 0;
490
490
  }
491
491
  }
492
- class wt {
492
+ class Ct {
493
493
  constructor(n) {
494
494
  this.audioContext = n, this.analyzer = null, this.dataArray = null, this.bufferLength = 0;
495
495
  }
@@ -814,7 +814,7 @@ class wt {
814
814
  return o * s;
815
815
  }
816
816
  }
817
- class Ct {
817
+ class zt {
818
818
  /**
819
819
  * @constructor
820
820
  */
@@ -1396,11 +1396,11 @@ class Ct {
1396
1396
  return e;
1397
1397
  }
1398
1398
  }
1399
- const zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1399
+ const Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1400
1400
  __proto__: null,
1401
- LipsyncEn: Ct
1401
+ LipsyncEn: zt
1402
1402
  }, Symbol.toStringTag, { value: "Module" }));
1403
- class Ht {
1403
+ class Tt {
1404
1404
  /**
1405
1405
  * @constructor
1406
1406
  */
@@ -1754,11 +1754,11 @@ class Ht {
1754
1754
  return e;
1755
1755
  }
1756
1756
  }
1757
- const Tt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1757
+ const Ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1758
1758
  __proto__: null,
1759
- LipsyncDe: Ht
1759
+ LipsyncDe: Tt
1760
1760
  }, Symbol.toStringTag, { value: "Module" }));
1761
- class Ft {
1761
+ class Mt {
1762
1762
  /**
1763
1763
  * @constructor
1764
1764
  */
@@ -2289,11 +2289,11 @@ class Ft {
2289
2289
  return e;
2290
2290
  }
2291
2291
  }
2292
- const Mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2292
+ const Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2293
2293
  __proto__: null,
2294
- LipsyncFr: Ft
2294
+ LipsyncFr: Mt
2295
2295
  }, Symbol.toStringTag, { value: "Module" }));
2296
- class Et {
2296
+ class Pt {
2297
2297
  /**
2298
2298
  * @constructor
2299
2299
  */
@@ -2436,11 +2436,11 @@ class Et {
2436
2436
  return e;
2437
2437
  }
2438
2438
  }
2439
- const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2439
+ const Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2440
2440
  __proto__: null,
2441
- LipsyncFi: Et
2441
+ LipsyncFi: Pt
2442
2442
  }, Symbol.toStringTag, { value: "Module" }));
2443
- class Bt {
2443
+ class Ot {
2444
2444
  /**
2445
2445
  * @constructor
2446
2446
  */
@@ -2620,24 +2620,24 @@ class Bt {
2620
2620
  return e;
2621
2621
  }
2622
2622
  }
2623
- const Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2623
+ const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2624
2624
  __proto__: null,
2625
- LipsyncLt: Bt
2626
- }, Symbol.toStringTag, { value: "Module" })), Dt = new URL("data:text/javascript;base64,Y2xhc3MgUGxheWJhY2tXb3JrbGV0IGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgRlNNID0gewogICAgSURMRTogMCwKICAgIFBMQVlJTkc6IDEsCiAgfTsKCiAgY29uc3RydWN0b3Iob3B0aW9ucykgewogICAgc3VwZXIoKTsKICAgIHRoaXMucG9ydC5vbm1lc3NhZ2UgPSB0aGlzLmhhbmRsZU1lc3NhZ2UuYmluZCh0aGlzKTsKCiAgICB0aGlzLl9zYW1wbGVSYXRlID0gb3B0aW9ucz8ucHJvY2Vzc29yT3B0aW9ucz8uc2FtcGxlUmF0ZSB8fCBzYW1wbGVSYXRlOwogICAgdGhpcy5fc2NhbGUgPSAxIC8gMzI3Njg7IC8vIFBDTTE2IC0+IGZsb2F0CgogICAgLy8gU2lsZW5jZSBkZXRlY3Rpb24gdGhyZXNob2xkICgxIHNlY29uZCkgYXMgYSBmYWxsYmFjayBzYWZldHkgbmV0CiAgICBjb25zdCBzaWxlbmNlRHVyYXRpb25TZWNvbmRzID0gMS4wOwogICAgdGhpcy5fc2lsZW5jZVRocmVzaG9sZEJsb2NrcyA9IE1hdGguY2VpbCgodGhpcy5fc2FtcGxlUmF0ZSAqIHNpbGVuY2VEdXJhdGlvblNlY29uZHMpIC8gMTI4KTsKCiAgICAvLyBNZXRyaWNzIGNvbmZpZ3VyYXRpb24gdmlhIG9wdGlvbnM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NvbnN0IGlzVGltZWRPdXQgPSB0aGlzLl9zaWxlbmNlRnJhbWVzQ291bnQgPiB0aGlzLl9zaWxlbmNlVGhyZXNob2xkQmxvY2tzOwoKICAgICAgICAgIGlmICh0aGlzLl9ub01vcmVEYXRhUmVjZWl2ZWQgfHwgaXNUaW1lZE91dCkgewogICAgICAgICAgICAvLyBFTkQgT0YgUExBWUJBQ0s6IEVpdGhlciBleHBsaWNpdGx5IHNpZ25hbGVkIG9yIHRpbWVkIG91dC4KICAgICAgICAgICAgaWYgKCF0aGlzLl9oYXNTZW50RW5kZWQpIHsKICAgICAgICAgICAgICB0aGlzLnBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiAicGxheWJhY2stZW5kZWQiIH0pOwogICAgICAgICAgICAgIHRoaXMuX2hhc1NlbnRFbmRlZCA9IHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy8gU2VuZCBmaW5hbCBtZXRyaWNzIHNob3dpbmcgY2xlYXJlZCBzdGF0ZQogICAgICAgICAgICBpZiAodGhpcy5fbWV0cmljc0VuYWJsZWQpIHsKICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgdGhpcy5wb3J0LnBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgICAgdHlwZTogIm1ldHJpY3MiLAogICAgICAgICAgICAgICAgICBkYXRhOiB7CiAgICAgICAgICAgICAgICAgICAgc3RhdGU6IFBsYXliYWNrV29ya2xldC5GU00uSURMRSwKICAgICAgICAgICAgICAgICAgICBxdWV1ZWRTYW1wbGVzOiAwLAogICAgICAgICAgICAgICAgICAgIHF1ZXVlZE1zOiAwLAogICAgICAgICAgICAgICAgICAgIG1heFF1ZXVlZE1zOiBNYXRoLnJvdW5kKCh0aGlzLl9tYXhRdWV1ZVNhbXBsZXMgLyB0aGlzLl9zYW1wbGVSYXRlKSAqIDEwMDApLAogICAgICAgICAgICAgICAgICAgIHVuZGVycnVuQmxvY2tzOiB0aGlzLl91bmRlcnJ1bkJs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2Vzc2VkOiB0aGlzLl9mcmFtZXNQcm9jZXNzZWQKICAgICAgICAgICAgfQogICAgICAgICAgfSk7CiAgICAgICAgfSBjYXRjaCAoXykgeyB9CiAgICAgICAgLy8gRG9uJ3QgcmVzZXQgbWF4IHRyYWNrZXIgLSBrZWVwIHNlc3Npb24gcGVhayB1bnRpbCBpZGxlCiAgICAgIH0KICAgIH0KCiAgICAvLyBBTFdBWVMgcmV0dXJuIHRydWUgdG8ga2VlcCB0aGUgcHJvY2Vzc29yIGFsaXZlIGZvciByZXVzZS4KICAgIHJldHVybiB0cnVlOwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoInBsYXliYWNrLXdvcmtsZXQiLCBQbGF5YmFja1dvcmtsZXQpOwo=", import.meta.url), rt = {
2627
- en: zt,
2628
- de: Tt,
2629
- fr: Mt,
2630
- fi: Pt,
2631
- lt: Ot
2632
- }, he = new A.Quaternion(), re = new A.Euler(), Ne = new A.Vector3(), We = new A.Vector3(), at = new A.Box3();
2625
+ LipsyncLt: Ot
2626
+ }, Symbol.toStringTag, { value: "Module" })), Nt = new URL("data:text/javascript;base64,Y2xhc3MgUGxheWJhY2tXb3JrbGV0IGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgRlNNID0gewogICAgSURMRTogMCwKICAgIFBMQVlJTkc6IDEsCiAgfTsKCiAgY29uc3RydWN0b3Iob3B0aW9ucykgewogICAgc3VwZXIoKTsKICAgIHRoaXMucG9ydC5vbm1lc3NhZ2UgPSB0aGlzLmhhbmRsZU1lc3NhZ2UuYmluZCh0aGlzKTsKCiAgICB0aGlzLl9zYW1wbGVSYXRlID0gb3B0aW9ucz8ucHJvY2Vzc29yT3B0aW9ucz8uc2FtcGxlUmF0ZSB8fCBzYW1wbGVSYXRlOwogICAgdGhpcy5fc2NhbGUgPSAxIC8gMzI3Njg7IC8vIFBDTTE2IC0+IGZsb2F0CgogICAgLy8gU2lsZW5jZSBkZXRlY3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WNrV29ya2xldC5GU00uSURMRSwKICAgICAgICAgICAgICAgICAgICBxdWV1ZWRTYW1wbGVzOiAwLAogICAgICAgICAgICAgICAgICAgIHF1ZXVlZE1zOiAwLAogICAgICAgICAgICAgICAgICAgIG1heFF1ZXVlZE1zOiBNYXRoLnJvdW5kKCh0aGlzLl9tYXhRdWV1ZVNhbXBsZXMgLyB0aGlzLl9zYW1wbGVSYXRlKSAqIDEwMDApLAogICAgICAgICAgICAgICAgICAgIHVuZGVycnVuQmxvY2tzOiB0aGlzLl91bmRlcnJ1bkJsb2NrcywKICAgICAgICAgICAgICAgICAgICBmcmFtZXNQcm9jZXNzZWQ6IHRoaXMuX2ZyYW1lc1Byb2Nlc3NlZAogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICB9IGNhdGNoIChfKSB7IH0KICAgICAgICAgICAgfQogICAgICAgICAgICB0aGlzLnJlc2V0KCk7IC8vIFJlc2V0IHRvIElETEUgc3RhdGUgZm9yIHJldXNlCiAgICAgICAgICAgIGJyZWFrOyAvLyBFeGl0IHdoaWxlIGxvb3AKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIC8vIEJVRkZFUiBVTkRFUlJVTiAoTEFHKTogUGxheSBzaWxlbmNlIGFuZCB3YWl0IGZvciBtb3JlIGRhdGEuCiAgICAgICAgICAgIHRoaXMuX3NpbGVuY2VGcmFtZXNDb3VudCsrOwogICAgICAgICAgICBpZiAodGhpcy5fbWV0cmljc0VuYWJsZWQpIHRoaXMuX3VuZGVycnVuQmxvY2tzKys7CiAgICAgICAgICAgIGJyZWFrOyAvLyBFeGl0IHdoaWxlIGxvb3AKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0KCiAgICAgIC8vIElmIHdlIGhhdmUgYSBjaHVuayAoY291bGQgYmUgYSBuZXcgb25lIGZyb20gdGhlIGxvZ2ljIGFib3ZlKSwgcHJvY2VzcyBpdC4KICAgICAgaWYgKHRoaXMuX2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ZXVlZE1zOiBNYXRoLnJvdW5kKChxdWV1ZWRTYW1wbGVzIC8gdGhpcy5fc2FtcGxlUmF0ZSkgKiAxMDAwKSwKICAgICAgICAgICAgICBtYXhRdWV1ZWRNczogTWF0aC5yb3VuZCgodGhpcy5fbWF4UXVldWVTYW1wbGVzIC8gdGhpcy5fc2FtcGxlUmF0ZSkgKiAxMDAwKSwKICAgICAgICAgICAgICB1bmRlcnJ1bkJsb2NrczogdGhpcy5fdW5kZXJydW5CbG9ja3MsCiAgICAgICAgICAgICAgZnJhbWVzUHJvY2Vzc2VkOiB0aGlzLl9mcmFtZXNQcm9jZXNzZWQKICAgICAgICAgICAgfQogICAgICAgICAgfSk7CiAgICAgICAgfSBjYXRjaCAoXykgeyB9CiAgICAgICAgLy8gRG9uJ3QgcmVzZXQgbWF4IHRyYWNrZXIgLSBrZWVwIHNlc3Npb24gcGVhayB1bnRpbCBpZGxlCiAgICAgIH0KICAgIH0KCiAgICAvLyBBTFdBWVMgcmV0dXJuIHRydWUgdG8ga2VlcCB0aGUgcHJvY2Vzc29yIGFsaXZlIGZvciByZXVzZS4KICAgIHJldHVybiB0cnVlOwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoInBsYXliYWNrLXdvcmtsZXQiLCBQbGF5YmFja1dvcmtsZXQpOwo=", import.meta.url), at = {
2627
+ en: Ht,
2628
+ de: Ft,
2629
+ fr: Et,
2630
+ fi: Bt,
2631
+ lt: Dt
2632
+ }, he = new A.Quaternion(), se = new A.Euler(), We = new A.Vector3(), Ve = new A.Vector3(), lt = new A.Box3();
2633
2633
  new A.Matrix4();
2634
2634
  new A.Matrix4();
2635
2635
  new A.Vector3();
2636
2636
  new A.Vector3(0, 0, 1);
2637
- const Nt = new A.Vector3(1, 0, 0);
2637
+ const Ut = new A.Vector3(1, 0, 0);
2638
2638
  new A.Vector3(0, 1, 0);
2639
2639
  new A.Vector3(0, 0, 1);
2640
- class it {
2640
+ class ot {
2641
2641
  /**
2642
2642
  * Avatar.
2643
2643
  * @typedef {Object} Avatar
@@ -2763,7 +2763,7 @@ class it {
2763
2763
  avatarOnlyCamera: null,
2764
2764
  statsNode: null,
2765
2765
  statsStyle: null
2766
- }, Object.assign(this.opt, e || {}), this.opt.statsNode && (this.stats = new vt(), this.opt.statsStyle && (this.stats.dom.style.cssText = this.opt.statsStyle), this.opt.statsNode.appendChild(this.stats.dom)), this.poseTemplates = {
2766
+ }, Object.assign(this.opt, e || {}), this.opt.statsNode && (this.stats = new It(), this.opt.statsStyle && (this.stats.dom.style.cssText = this.opt.statsStyle), this.opt.statsNode.appendChild(this.stats.dom)), this.poseTemplates = {
2767
2767
  side: {
2768
2768
  standing: !0,
2769
2769
  props: {
@@ -4086,7 +4086,7 @@ class it {
4086
4086
  this.opt.lightSpotDispersion
4087
4087
  ), this.setLighting(this.opt);
4088
4088
  const a = new A.PMREMGenerator(this.renderer);
4089
- a.compileEquirectangularShader(), this.scene.environment = a.fromScene(new Rt()).texture, this.resizeobserver = new ResizeObserver(this.onResize.bind(this)), this.resizeobserver.observe(this.nodeAvatar), this.controls = new xt(this.camera, this.renderer.domElement), this.controls.enableZoom = this.opt.cameraZoomEnable, this.controls.enableRotate = this.opt.cameraRotateEnable, this.controls.enablePan = this.opt.cameraPanEnable, this.controls.minDistance = 2, this.controls.maxDistance = 2e3, this.controls.autoRotateSpeed = 0, this.controls.autoRotate = !1, this.controls.update(), this.cameraClock = null;
4089
+ a.compileEquirectangularShader(), this.scene.environment = a.fromScene(new vt()).texture, this.resizeobserver = new ResizeObserver(this.onResize.bind(this)), this.resizeobserver.observe(this.nodeAvatar), this.controls = new bt(this.camera, this.renderer.domElement), this.controls.enableZoom = this.opt.cameraZoomEnable, this.controls.enableRotate = this.opt.cameraRotateEnable, this.controls.enablePan = this.opt.cameraPanEnable, this.controls.minDistance = 2, this.controls.maxDistance = 2e3, this.controls.autoRotateSpeed = 0, this.controls.autoRotate = !1, this.controls.update(), this.cameraClock = null;
4090
4090
  }
4091
4091
  this.ikMesh = new A.SkinnedMesh();
4092
4092
  const s = {
@@ -4104,14 +4104,14 @@ class it {
4104
4104
  Object.entries(s).forEach((a, u) => {
4105
4105
  const l = new A.Bone();
4106
4106
  l.name = a[0], a[1] ? this.ikMesh.getObjectByName(a[1]).add(l) : this.ikMesh.add(l), i.push(l);
4107
- }), this.ikMesh.bind(new A.Skeleton(i)), this.dynamicbones = new kt(), this.isStreaming = !1, this.streamWorkletNode = null, this.streamAudioStartTime = null, this.streamWaitForAudioChunks = !0, this.streamLipsyncLang = null, this.streamLipsyncType = "visemes", this.streamLipsyncQueue = [];
4107
+ }), this.ikMesh.bind(new A.Skeleton(i)), this.dynamicbones = new wt(), this.isStreaming = !1, this.streamWorkletNode = null, this.streamAudioStartTime = null, this.streamWaitForAudioChunks = !0, this.streamLipsyncLang = null, this.streamLipsyncType = "visemes", this.streamLipsyncQueue = [];
4108
4108
  }
4109
4109
  /**
4110
4110
  * Helper that re/creates the audio context and the other nodes.
4111
4111
  * @param {number} sampleRate
4112
4112
  */
4113
4113
  initAudioGraph(n = null) {
4114
- if (this.audioCtx && this.audioCtx.state !== "closed" && this.audioCtx.close(), n ? this.audioCtx = new AudioContext({ sampleRate: n }) : this.audioCtx = new AudioContext(), this.audioSpeechSource = this.audioCtx.createBufferSource(), this.audioBackgroundSource = this.audioCtx.createBufferSource(), this.audioBackgroundGainNode = this.audioCtx.createGain(), this.audioSpeechGainNode = this.audioCtx.createGain(), this.audioStreamGainNode = this.audioCtx.createGain(), this.audioAnalyzerNode = this.audioCtx.createAnalyser(), this.audioAnalyzerNode.fftSize = 256, this.audioAnalyzerNode.smoothingTimeConstant = 0.1, this.audioAnalyzerNode.minDecibels = -70, this.audioAnalyzerNode.maxDecibels = -10, this.audioAnalyzer = new wt(this.audioCtx), this.audioReverbNode = this.audioCtx.createConvolver(), this.audioBackgroundGainNode.connect(this.audioReverbNode), this.audioAnalyzerNode.connect(this.audioSpeechGainNode), this.audioSpeechGainNode.connect(this.audioReverbNode), this.audioStreamGainNode.connect(this.audioReverbNode), this.audioReverbNode.connect(this.audioCtx.destination), this.setReverb(this.currentReverb || null), this.setMixerGain(
4114
+ if (this.audioCtx && this.audioCtx.state !== "closed" && this.audioCtx.close(), n ? this.audioCtx = new AudioContext({ sampleRate: n }) : this.audioCtx = new AudioContext(), this.audioSpeechSource = this.audioCtx.createBufferSource(), this.audioBackgroundSource = this.audioCtx.createBufferSource(), this.audioBackgroundGainNode = this.audioCtx.createGain(), this.audioSpeechGainNode = this.audioCtx.createGain(), this.audioStreamGainNode = this.audioCtx.createGain(), this.audioAnalyzerNode = this.audioCtx.createAnalyser(), this.audioAnalyzerNode.fftSize = 256, this.audioAnalyzerNode.smoothingTimeConstant = 0.1, this.audioAnalyzerNode.minDecibels = -70, this.audioAnalyzerNode.maxDecibels = -10, this.audioAnalyzer = new Ct(this.audioCtx), this.audioReverbNode = this.audioCtx.createConvolver(), this.audioBackgroundGainNode.connect(this.audioReverbNode), this.audioAnalyzerNode.connect(this.audioSpeechGainNode), this.audioSpeechGainNode.connect(this.audioReverbNode), this.audioStreamGainNode.connect(this.audioReverbNode), this.audioReverbNode.connect(this.audioCtx.destination), this.setReverb(this.currentReverb || null), this.setMixerGain(
4115
4115
  this.opt.mixerGainSpeech,
4116
4116
  this.opt.mixerGainBackground
4117
4117
  ), this.workletLoaded = !1, this.streamWorkletNode) {
@@ -4252,9 +4252,9 @@ class it {
4252
4252
  async showAvatar(n, e = null) {
4253
4253
  if (!n || !n.hasOwnProperty("url"))
4254
4254
  throw new Error("Invalid parameter. The avatar must have at least 'url' specified.");
4255
- const t = new bt();
4255
+ const t = new At();
4256
4256
  if (this.dracoEnabled) {
4257
- const l = new At();
4257
+ const l = new Rt();
4258
4258
  l.setDecoderPath(this.dracoDecoderPath), t.setDRACOLoader(l);
4259
4259
  }
4260
4260
  let o = await t.loadAsync(n.url, e);
@@ -4412,9 +4412,9 @@ class it {
4412
4412
  updatePoseDelta() {
4413
4413
  for (const [n, e] of Object.entries(this.poseDelta.props)) {
4414
4414
  if (e.x === 0 && e.y === 0 && e.z === 0) continue;
4415
- re.set(e.x, e.y, e.z);
4415
+ se.set(e.x, e.y, e.z);
4416
4416
  const t = this.poseAvatar.props[n];
4417
- t.isQuaternion ? (he.setFromEuler(re), t.multiply(he)) : t.isVector3 && t.add(re);
4417
+ t.isQuaternion ? (he.setFromEuler(se), t.multiply(he)) : t.isVector3 && t.add(se);
4418
4418
  }
4419
4419
  }
4420
4420
  /**
@@ -5179,7 +5179,7 @@ class it {
5179
5179
  }, o.x ? new A.Vector3(o.x, o.y, o.z) : null, !0, o.d);
5180
5180
  break;
5181
5181
  }
5182
- if ((u || l) && (re.setFromQuaternion(this.poseAvatar.props["Head.quaternion"]), re.x = Math.max(-0.9, Math.min(0.9, 2 * re.x - 0.5)), re.y = Math.max(-0.9, Math.min(0.9, -2.5 * re.y)), u ? (Object.assign(this.mtAvatar.eyesLookDown, { system: re.x < 0 ? -re.x : 0, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyesLookUp, { system: re.x < 0 ? 0 : re.x, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookInLeft, { system: re.y < 0 ? -re.y : 0, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookOutLeft, { system: re.y < 0 ? 0 : re.y, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookInRight, { system: re.y < 0 ? 0 : re.y, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookOutRight, { system: re.y < 0 ? -re.y : 0, needsUpdate: !0 }), l && (t = -this.mtAvatar.bodyRotateY.value, o = this.gaussianRandom(-0.2, 0.2), this.animQueue.push(this.animFactory({
5182
+ if ((u || l) && (se.setFromQuaternion(this.poseAvatar.props["Head.quaternion"]), se.x = Math.max(-0.9, Math.min(0.9, 2 * se.x - 0.5)), se.y = Math.max(-0.9, Math.min(0.9, -2.5 * se.y)), u ? (Object.assign(this.mtAvatar.eyesLookDown, { system: se.x < 0 ? -se.x : 0, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyesLookUp, { system: se.x < 0 ? 0 : se.x, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookInLeft, { system: se.y < 0 ? -se.y : 0, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookOutLeft, { system: se.y < 0 ? 0 : se.y, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookInRight, { system: se.y < 0 ? 0 : se.y, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookOutRight, { system: se.y < 0 ? -se.y : 0, needsUpdate: !0 }), l && (t = -this.mtAvatar.bodyRotateY.value, o = this.gaussianRandom(-0.2, 0.2), this.animQueue.push(this.animFactory({
5183
5183
  name: "headmove",
5184
5184
  dt: [[1e3, 2e3], [1e3, 2e3, 1, 2], [1e3, 2e3], [1e3, 2e3, 1, 2]],
5185
5185
  vs: {
@@ -5208,7 +5208,7 @@ class it {
5208
5208
  this.animationFinishedCallback = null, this.currentFBXActionCallback = null, this.currentFBXActionForCallback = null, this.currentFBXActionStartTime = null, this.currentFBXActionClipDuration = null, b();
5209
5209
  } else this.currentFBXActionCallback && (this.currentFBXActionCallback = null, this.currentFBXActionForCallback = null, this.currentFBXActionStartTime = null, this.currentFBXActionClipDuration = null);
5210
5210
  }
5211
- if (this.updatePoseDelta(), (this.isSpeaking || this.isListening) && u ? a > this.volumeMax ? (this.volumeHeadBase = 0.05, Math.random() > 0.6 && (this.volumeHeadTarget = -0.05 - Math.random() / 15), this.volumeMax = a) : (this.volumeMax *= 0.92, this.volumeHeadTarget = this.volumeHeadBase - 0.9 * (this.volumeHeadBase - this.volumeHeadTarget)) : (this.volumeHeadTarget = 0, this.volumeMax = 0), t = this.volumeHeadTarget - this.volumeHeadCurrent, o = Math.abs(t), o > 1e-4 && (i = o * (this.volumeHeadEasing(Math.min(1, this.volumeHeadVelocity * e / 1e3 / o) / 2 + 0.5) - 0.5), this.volumeHeadCurrent += Math.sign(t) * Math.min(o, i)), Math.abs(this.volumeHeadCurrent) > 1e-4 && (he.setFromAxisAngle(Nt, this.volumeHeadCurrent), this.objectNeck.quaternion.multiply(he)), at.setFromObject(this.armature), this.objectLeftToeBase.getWorldPosition(Ne), Ne.sub(this.armature.position), this.objectRightToeBase.getWorldPosition(We), We.sub(this.armature.position), this.objectHips.position.y -= at.min.y / 2, this.objectHips.position.x -= (Ne.x + We.x) / 4, this.objectHips.position.z -= (Ne.z + We.z) / 2, this.dynamicbones.update(e), this.fbxAnimationLoader && this.fbxAnimationLoader.update(), this.opt.update && this.opt.update(e), this.updateMorphTargets(e), this.isAvatarOnly)
5211
+ if (this.updatePoseDelta(), (this.isSpeaking || this.isListening) && u ? a > this.volumeMax ? (this.volumeHeadBase = 0.05, Math.random() > 0.6 && (this.volumeHeadTarget = -0.05 - Math.random() / 15), this.volumeMax = a) : (this.volumeMax *= 0.92, this.volumeHeadTarget = this.volumeHeadBase - 0.9 * (this.volumeHeadBase - this.volumeHeadTarget)) : (this.volumeHeadTarget = 0, this.volumeMax = 0), t = this.volumeHeadTarget - this.volumeHeadCurrent, o = Math.abs(t), o > 1e-4 && (i = o * (this.volumeHeadEasing(Math.min(1, this.volumeHeadVelocity * e / 1e3 / o) / 2 + 0.5) - 0.5), this.volumeHeadCurrent += Math.sign(t) * Math.min(o, i)), Math.abs(this.volumeHeadCurrent) > 1e-4 && (he.setFromAxisAngle(Ut, this.volumeHeadCurrent), this.objectNeck.quaternion.multiply(he)), lt.setFromObject(this.armature), this.objectLeftToeBase.getWorldPosition(We), We.sub(this.armature.position), this.objectRightToeBase.getWorldPosition(Ve), Ve.sub(this.armature.position), this.objectHips.position.y -= lt.min.y / 2, this.objectHips.position.x -= (We.x + Ve.x) / 4, this.objectHips.position.z -= (We.z + Ve.z) / 2, this.dynamicbones.update(e), this.fbxAnimationLoader && this.fbxAnimationLoader.update(), this.opt.update && this.opt.update(e), this.updateMorphTargets(e), this.isAvatarOnly)
5212
5212
  this.stats && this.stats.end();
5213
5213
  else {
5214
5214
  if (this.cameraClock !== null && this.cameraClock < 1e3) {
@@ -5239,8 +5239,8 @@ class it {
5239
5239
  if (!this.lipsync.hasOwnProperty(n)) {
5240
5240
  const t = n.toLowerCase(), o = "Lipsync" + n.charAt(0).toUpperCase() + n.slice(1);
5241
5241
  try {
5242
- const s = rt[t];
5243
- s && s[o] ? this.lipsync[n] = new s[o]() : console.warn(`Lip-sync module for ${n} not found. Available modules:`, Object.keys(rt));
5242
+ const s = at[t];
5243
+ s && s[o] ? this.lipsync[n] = new s[o]() : console.warn(`Lip-sync module for ${n} not found. Available modules:`, Object.keys(at));
5244
5244
  } catch (s) {
5245
5245
  console.warn(`Failed to load lip-sync module for ${n}:`, s);
5246
5246
  }
@@ -5981,7 +5981,7 @@ class it {
5981
5981
  }
5982
5982
  if (!this.workletLoaded)
5983
5983
  try {
5984
- const a = this.audioCtx.audioWorklet.addModule(Dt.href), u = new Promise(
5984
+ const a = this.audioCtx.audioWorklet.addModule(Nt.href), u = new Promise(
5985
5985
  (l, c) => setTimeout(() => c(new Error("Worklet loading timed out")), 5e3)
5986
5986
  );
5987
5987
  await Promise.race([a, u]), this.workletLoaded = !0;
@@ -6219,7 +6219,7 @@ class it {
6219
6219
  */
6220
6220
  lookAtCamera(n) {
6221
6221
  let e;
6222
- if (this.speakTo && (e = new A.Vector3(), this.speakTo.objectLeftEye?.isObject3D ? (this.speakTo.armature.objectHead, this.speakTo.objectLeftEye.updateMatrixWorld(!0), this.speakTo.objectRightEye.updateMatrixWorld(!0), Ne.setFromMatrixPosition(this.speakTo.objectLeftEye.matrixWorld), We.setFromMatrixPosition(this.speakTo.objectRightEye.matrixWorld), e.addVectors(Ne, We).divideScalar(2)) : this.speakTo.isObject3D ? this.speakTo.getWorldPosition(e) : this.speakTo.isVector3 ? e.set(this.speakTo) : this.speakTo.x && this.speakTo.y && this.speakTo.z && e.set(this.speakTo.x, this.speakTo.y, this.speakTo.z)), !e) {
6222
+ if (this.speakTo && (e = new A.Vector3(), this.speakTo.objectLeftEye?.isObject3D ? (this.speakTo.armature.objectHead, this.speakTo.objectLeftEye.updateMatrixWorld(!0), this.speakTo.objectRightEye.updateMatrixWorld(!0), We.setFromMatrixPosition(this.speakTo.objectLeftEye.matrixWorld), Ve.setFromMatrixPosition(this.speakTo.objectRightEye.matrixWorld), e.addVectors(We, Ve).divideScalar(2)) : this.speakTo.isObject3D ? this.speakTo.getWorldPosition(e) : this.speakTo.isVector3 ? e.set(this.speakTo) : this.speakTo.x && this.speakTo.y && this.speakTo.z && e.set(this.speakTo.x, this.speakTo.y, this.speakTo.z)), !e) {
6223
6223
  if (this.avatar.hasOwnProperty("avatarIgnoreCamera")) {
6224
6224
  if (this.avatar.avatarIgnoreCamera) {
6225
6225
  this.lookAhead(n);
@@ -6232,12 +6232,12 @@ class it {
6232
6232
  this.lookAt(null, null, n);
6233
6233
  return;
6234
6234
  }
6235
- this.objectLeftEye.updateMatrixWorld(!0), this.objectRightEye.updateMatrixWorld(!0), Ne.setFromMatrixPosition(this.objectLeftEye.matrixWorld), We.setFromMatrixPosition(this.objectRightEye.matrixWorld), Ne.add(We).divideScalar(2), he.copy(this.armature.quaternion), he.multiply(this.poseTarget.props["Hips.quaternion"]), he.multiply(this.poseTarget.props["Spine.quaternion"]), he.multiply(this.poseTarget.props["Spine1.quaternion"]), he.multiply(this.poseTarget.props["Spine2.quaternion"]), he.multiply(this.poseTarget.props["Neck.quaternion"]), he.multiply(this.poseTarget.props["Head.quaternion"]);
6236
- const t = new A.Vector3().subVectors(e, Ne).normalize(), o = Math.atan2(t.x, t.z), s = Math.asin(-t.y);
6237
- re.set(s, o, 0, "YXZ");
6238
- const a = new A.Quaternion().setFromEuler(re), u = new A.Quaternion().copy(a).multiply(he.clone().invert());
6239
- re.setFromQuaternion(u, "YXZ");
6240
- let l = re.x / (40 / 24) + 0.2, c = re.y / (9 / 4), r = Math.min(0.6, Math.max(-0.3, l)), h = Math.min(0.8, Math.max(-0.8, c)), d = (Math.random() - 0.5) / 4, p = (Math.random() - 0.5) / 4;
6235
+ this.objectLeftEye.updateMatrixWorld(!0), this.objectRightEye.updateMatrixWorld(!0), We.setFromMatrixPosition(this.objectLeftEye.matrixWorld), Ve.setFromMatrixPosition(this.objectRightEye.matrixWorld), We.add(Ve).divideScalar(2), he.copy(this.armature.quaternion), he.multiply(this.poseTarget.props["Hips.quaternion"]), he.multiply(this.poseTarget.props["Spine.quaternion"]), he.multiply(this.poseTarget.props["Spine1.quaternion"]), he.multiply(this.poseTarget.props["Spine2.quaternion"]), he.multiply(this.poseTarget.props["Neck.quaternion"]), he.multiply(this.poseTarget.props["Head.quaternion"]);
6236
+ const t = new A.Vector3().subVectors(e, We).normalize(), o = Math.atan2(t.x, t.z), s = Math.asin(-t.y);
6237
+ se.set(s, o, 0, "YXZ");
6238
+ const a = new A.Quaternion().setFromEuler(se), u = new A.Quaternion().copy(a).multiply(he.clone().invert());
6239
+ se.setFromQuaternion(u, "YXZ");
6240
+ let l = se.x / (40 / 24) + 0.2, c = se.y / (9 / 4), r = Math.min(0.6, Math.max(-0.3, l)), h = Math.min(0.8, Math.max(-0.8, c)), d = (Math.random() - 0.5) / 4, p = (Math.random() - 0.5) / 4;
6241
6241
  if (n) {
6242
6242
  let b = this.animQueue.findIndex((L) => L.template.name === "lookat");
6243
6243
  b !== -1 && this.animQueue.splice(b, 1);
@@ -6272,8 +6272,8 @@ class it {
6272
6272
  const s = new A.Vector3().setFromMatrixPosition(this.objectLeftEye.matrixWorld), i = new A.Vector3().setFromMatrixPosition(this.objectRightEye.matrixWorld), a = new A.Vector3().addVectors(s, i).divideScalar(2);
6273
6273
  a.project(this.camera);
6274
6274
  let u = (a.x + 1) / 2 * o.width + o.left, l = -(a.y - 1) / 2 * o.height + o.top;
6275
- n === null && (n = u), e === null && (e = l), he.copy(this.armature.quaternion), he.multiply(this.poseTarget.props["Hips.quaternion"]), he.multiply(this.poseTarget.props["Spine.quaternion"]), he.multiply(this.poseTarget.props["Spine1.quaternion"]), he.multiply(this.poseTarget.props["Spine2.quaternion"]), he.multiply(this.poseTarget.props["Neck.quaternion"]), he.multiply(this.poseTarget.props["Head.quaternion"]), re.setFromQuaternion(he);
6276
- let c = re.x / (40 / 24), r = re.y / (9 / 4), h = Math.min(0.4, Math.max(-0.4, this.camera.rotation.x)), d = Math.min(0.4, Math.max(-0.4, this.camera.rotation.y)), p = Math.max(window.innerWidth - u, u), b = Math.max(window.innerHeight - l, l), f = this.convertRange(e, [l - b, l + b], [-0.3, 0.6]) - c + h, L = this.convertRange(n, [u - p, u + p], [-0.8, 0.8]) - r + d;
6275
+ n === null && (n = u), e === null && (e = l), he.copy(this.armature.quaternion), he.multiply(this.poseTarget.props["Hips.quaternion"]), he.multiply(this.poseTarget.props["Spine.quaternion"]), he.multiply(this.poseTarget.props["Spine1.quaternion"]), he.multiply(this.poseTarget.props["Spine2.quaternion"]), he.multiply(this.poseTarget.props["Neck.quaternion"]), he.multiply(this.poseTarget.props["Head.quaternion"]), se.setFromQuaternion(he);
6276
+ let c = se.x / (40 / 24), r = se.y / (9 / 4), h = Math.min(0.4, Math.max(-0.4, this.camera.rotation.x)), d = Math.min(0.4, Math.max(-0.4, this.camera.rotation.y)), p = Math.max(window.innerWidth - u, u), b = Math.max(window.innerHeight - l, l), f = this.convertRange(e, [l - b, l + b], [-0.3, 0.6]) - c + h, L = this.convertRange(n, [u - p, u + p], [-0.8, 0.8]) - r + d;
6277
6277
  f = Math.min(0.6, Math.max(-0.3, f)), L = Math.min(0.8, Math.max(-0.8, L));
6278
6278
  let Q = (Math.random() - 0.5) / 4, g = (Math.random() - 0.5) / 4;
6279
6279
  if (t) {
@@ -6518,7 +6518,7 @@ class it {
6518
6518
  } catch (d) {
6519
6519
  console.warn(`Could not verify file existence for ${n}, attempting to load anyway:`, d);
6520
6520
  }
6521
- const r = new ot();
6521
+ const r = new st();
6522
6522
  let h;
6523
6523
  try {
6524
6524
  h = await r.loadAsync(n, e);
@@ -6701,7 +6701,7 @@ class it {
6701
6701
  let a = this.animQueue.find((u) => u.template.name === "pose");
6702
6702
  a && (a.ts[0] = this.animClock + t * 1e3 + 2e3), this.setPoseFromTemplate(i);
6703
6703
  } else {
6704
- let u = await new ot().loadAsync(n, e);
6704
+ let u = await new st().loadAsync(n, e);
6705
6705
  if (u && u.animations && u.animations[o]) {
6706
6706
  let l = u.animations[o];
6707
6707
  const c = {};
@@ -6826,7 +6826,7 @@ class it {
6826
6826
  this.isRunning = !1, this.stop(), this.stopSpeaking(), this.streamStop(), this.isAvatarOnly ? this.armature && (this.armature.parent && this.armature.parent.remove(this.armature), this.clearThree(this.armature)) : (this.clearThree(this.scene), this.resizeobserver.disconnect(), this.renderer && (this.renderer.dispose(), this.renderer.domElement && this.renderer.domElement.parentNode && this.renderer.domElement.parentNode.removeChild(this.renderer.domElement), this.renderer = null)), this.clearThree(this.ikMesh), this.dynamicbones.dispose();
6827
6827
  }
6828
6828
  }
6829
- const Ve = {
6829
+ const Xe = {
6830
6830
  apiKey: "sk_ace57ef3ef65a92b9d3bee2a00183b78ca790bc3e10964f2",
6831
6831
  // Replace with your actual API key (should start with sk_)
6832
6832
  endpoint: "https://api.elevenlabs.io/v1/text-to-speech",
@@ -6846,7 +6846,7 @@ const Ve = {
6846
6846
  josh: "VR6AewLTigWG4xSOukaG"
6847
6847
  // Male, American
6848
6848
  }
6849
- }, _e = {
6849
+ }, Ke = {
6850
6850
  defaultVoice: "aura-2-thalia-en",
6851
6851
  // Thalia (Female, English)
6852
6852
  voices: {
@@ -6866,17 +6866,17 @@ const Ve = {
6866
6866
  // Male, English - Powerful
6867
6867
  }
6868
6868
  };
6869
- function Je() {
6869
+ function et() {
6870
6870
  return {
6871
6871
  service: "elevenlabs",
6872
- endpoint: Ve.endpoint,
6873
- apiKey: Ve.apiKey,
6874
- defaultVoice: Ve.defaultVoice,
6875
- voices: Ve.voices
6872
+ endpoint: Xe.endpoint,
6873
+ apiKey: Xe.apiKey,
6874
+ defaultVoice: Xe.defaultVoice,
6875
+ voices: Xe.voices
6876
6876
  };
6877
6877
  }
6878
- function $t() {
6879
- const Y = Je(), n = [];
6878
+ function Jt() {
6879
+ const Y = et(), n = [];
6880
6880
  return Object.entries(Y.voices).forEach(([e, t]) => {
6881
6881
  n.push({
6882
6882
  value: t,
@@ -6884,7 +6884,7 @@ function $t() {
6884
6884
  });
6885
6885
  }), n;
6886
6886
  }
6887
- const ct = Ke(({
6887
+ const ut = $e(({
6888
6888
  avatarUrl: Y = "/avatars/brunette.glb",
6889
6889
  avatarBody: n = "F",
6890
6890
  mood: e = "neutral",
@@ -6906,98 +6906,98 @@ const ct = Ke(({
6906
6906
  style: b = {},
6907
6907
  animations: f = {}
6908
6908
  }, L) => {
6909
- const Q = V(null), g = V(null), H = V(l), M = V(null), y = V(null), E = V(!1), S = V({ remainingText: null, originalText: null, options: null }), C = V([]), x = V(0), [I, G] = ge(!0), [P, D] = ge(null), [K, fe] = ge(!1), [xe, Te] = ge(!1);
6910
- ze(() => {
6911
- E.current = xe;
6912
- }, [xe]), ze(() => {
6909
+ const Q = V(null), g = V(null), H = V(l), M = V(null), y = V(null), E = V(!1), S = V({ remainingText: null, originalText: null, options: null }), C = V([]), x = V(0), [I, G] = pe(!0), [P, D] = pe(null), [$, ye] = pe(!1), [fe, Te] = pe(!1);
6910
+ ke(() => {
6911
+ E.current = fe;
6912
+ }, [fe]), ke(() => {
6913
6913
  H.current = l;
6914
6914
  }, [l]);
6915
- const Le = Je(), Me = o || Le.service;
6916
- let ae;
6917
- Me === "browser" ? ae = {
6915
+ const Ie = et(), Me = o || Ie.service;
6916
+ let re;
6917
+ Me === "browser" ? re = {
6918
6918
  service: "browser",
6919
6919
  endpoint: "",
6920
6920
  apiKey: null,
6921
6921
  defaultVoice: "Google US English"
6922
- } : Me === "elevenlabs" ? ae = {
6922
+ } : Me === "elevenlabs" ? re = {
6923
6923
  service: "elevenlabs",
6924
6924
  endpoint: "https://api.elevenlabs.io/v1/text-to-speech",
6925
- apiKey: i || Le.apiKey,
6926
- defaultVoice: s || Le.defaultVoice || Ve.defaultVoice,
6927
- voices: Le.voices || Ve.voices
6928
- } : Me === "deepgram" ? ae = {
6925
+ apiKey: i || Ie.apiKey,
6926
+ defaultVoice: s || Ie.defaultVoice || Xe.defaultVoice,
6927
+ voices: Ie.voices || Xe.voices
6928
+ } : Me === "deepgram" ? re = {
6929
6929
  service: "deepgram",
6930
6930
  endpoint: "https://api.deepgram.com/v1/speak",
6931
- apiKey: i || Le.apiKey,
6932
- defaultVoice: s || Le.defaultVoice || _e.defaultVoice,
6933
- voices: Le.voices || _e.voices
6934
- } : ae = {
6935
- ...Le,
6931
+ apiKey: i || Ie.apiKey,
6932
+ defaultVoice: s || Ie.defaultVoice || Ke.defaultVoice,
6933
+ voices: Ie.voices || Ke.voices
6934
+ } : re = {
6935
+ ...Ie,
6936
6936
  // Override API key if provided via props
6937
- apiKey: i !== null ? i : Le.apiKey
6937
+ apiKey: i !== null ? i : Ie.apiKey
6938
6938
  };
6939
6939
  const R = {
6940
6940
  url: Y,
6941
6941
  body: n,
6942
6942
  avatarMood: e,
6943
6943
  ttsLang: Me === "browser" ? "en-US" : t,
6944
- ttsVoice: s || ae.defaultVoice,
6944
+ ttsVoice: s || re.defaultVoice,
6945
6945
  lipsyncLang: "en",
6946
6946
  showFullAvatar: l,
6947
6947
  bodyMovement: a,
6948
6948
  movementIntensity: u
6949
6949
  }, v = {
6950
- ttsEndpoint: ae.endpoint,
6951
- ttsApikey: ae.apiKey,
6950
+ ttsEndpoint: re.endpoint,
6951
+ ttsApikey: re.apiKey,
6952
6952
  ttsService: Me,
6953
6953
  lipsyncModules: ["en"],
6954
6954
  cameraView: c
6955
6955
  }, N = W(async () => {
6956
6956
  if (!(!Q.current || g.current))
6957
6957
  try {
6958
- if (G(!0), D(null), g.current = new it(Q.current, v), g.current.controls && (g.current.controls.enableRotate = !1, g.current.controls.enableZoom = !1, g.current.controls.enablePan = !1, g.current.controls.enableDamping = !1), f && Object.keys(f).length > 0 && (g.current.customAnimations = f), await g.current.showAvatar(R, (te) => {
6959
- if (te.lengthComputable) {
6960
- const ue = Math.min(100, Math.round(te.loaded / te.total * 100));
6961
- h(ue);
6958
+ if (G(!0), D(null), g.current = new ot(Q.current, v), g.current.controls && (g.current.controls.enableRotate = !1, g.current.controls.enableZoom = !1, g.current.controls.enablePan = !1, g.current.controls.enableDamping = !1), f && Object.keys(f).length > 0 && (g.current.customAnimations = f), await g.current.showAvatar(R, (ce) => {
6959
+ if (ce.lengthComputable) {
6960
+ const ae = Math.min(100, Math.round(ce.loaded / ce.total * 100));
6961
+ h(ae);
6962
6962
  }
6963
- }), await new Promise((te) => {
6964
- const ue = () => {
6965
- g.current.lipsync && Object.keys(g.current.lipsync).length > 0 ? te() : setTimeout(ue, 100);
6963
+ }), await new Promise((ce) => {
6964
+ const ae = () => {
6965
+ g.current.lipsync && Object.keys(g.current.lipsync).length > 0 ? ce() : setTimeout(ae, 100);
6966
6966
  };
6967
- ue();
6967
+ ae();
6968
6968
  }), g.current && g.current.setShowFullAvatar)
6969
6969
  try {
6970
6970
  g.current.setShowFullAvatar(l);
6971
- } catch (te) {
6972
- console.warn("Error setting full body mode on initialization:", te);
6971
+ } catch (ce) {
6972
+ console.warn("Error setting full body mode on initialization:", ce);
6973
6973
  }
6974
- g.current && g.current.controls && (g.current.controls.enableRotate = !1, g.current.controls.enableZoom = !1, g.current.controls.enablePan = !1, g.current.controls.enableDamping = !1, g.current.controls.update()), G(!1), fe(!0), r(g.current);
6975
- const _ = () => {
6974
+ g.current && g.current.controls && (g.current.controls.enableRotate = !1, g.current.controls.enableZoom = !1, g.current.controls.enablePan = !1, g.current.controls.enableDamping = !1, g.current.controls.update()), G(!1), ye(!0), r(g.current);
6975
+ const K = () => {
6976
6976
  document.visibilityState === "visible" ? g.current?.start() : g.current?.stop();
6977
6977
  };
6978
- return document.addEventListener("visibilitychange", _), () => {
6979
- document.removeEventListener("visibilitychange", _);
6978
+ return document.addEventListener("visibilitychange", K), () => {
6979
+ document.removeEventListener("visibilitychange", K);
6980
6980
  };
6981
6981
  } catch (w) {
6982
6982
  console.error("Error initializing TalkingHead:", w), D(w.message || "Failed to initialize avatar"), G(!1), d(w);
6983
6983
  }
6984
6984
  }, [Y, n, e, t, o, s, i, l, a, u, c]);
6985
- ze(() => (N(), () => {
6985
+ ke(() => (N(), () => {
6986
6986
  g.current && (g.current.stop(), g.current.dispose(), g.current = null);
6987
- }), [N]), ze(() => {
6987
+ }), [N]), ke(() => {
6988
6988
  if (!Q.current || !g.current) return;
6989
- const w = new ResizeObserver((te) => {
6990
- for (const ue of te)
6989
+ const w = new ResizeObserver((ce) => {
6990
+ for (const ae of ce)
6991
6991
  g.current && g.current.onResize && g.current.onResize();
6992
6992
  });
6993
6993
  w.observe(Q.current);
6994
- const _ = () => {
6994
+ const K = () => {
6995
6995
  g.current && g.current.onResize && g.current.onResize();
6996
6996
  };
6997
- return window.addEventListener("resize", _), () => {
6998
- w.disconnect(), window.removeEventListener("resize", _);
6997
+ return window.addEventListener("resize", K), () => {
6998
+ w.disconnect(), window.removeEventListener("resize", K);
6999
6999
  };
7000
- }, [K]);
7000
+ }, [$]);
7001
7001
  const B = W(async () => {
7002
7002
  if (g.current && g.current.audioCtx)
7003
7003
  try {
@@ -7005,162 +7005,162 @@ const ct = Ke(({
7005
7005
  } catch (w) {
7006
7006
  console.warn("Failed to resume audio context:", w);
7007
7007
  }
7008
- }, []), j = W(async (w, _ = {}) => {
7009
- if (g.current && K)
7008
+ }, []), j = W(async (w, K = {}) => {
7009
+ if (g.current && $)
7010
7010
  try {
7011
- y.current && (clearInterval(y.current), y.current = null), M.current = { text: w, options: _ }, S.current = { remainingText: null, originalText: null, options: null };
7012
- const te = /[!\.\?\n\p{Extended_Pictographic}]/ug, ue = w.split(te).map((ne) => ne.trim()).filter((ne) => ne.length > 0);
7013
- C.current = ue, x.current = 0, Te(!1), E.current = !1, await B();
7014
- const de = {
7015
- ..._,
7016
- lipsyncLang: _.lipsyncLang || R.lipsyncLang || "en"
7011
+ y.current && (clearInterval(y.current), y.current = null), M.current = { text: w, options: K }, S.current = { remainingText: null, originalText: null, options: null };
7012
+ const ce = /[!\.\?\n\p{Extended_Pictographic}]/ug, ae = w.split(ce).map((J) => J.trim()).filter((J) => J.length > 0);
7013
+ C.current = ae, x.current = 0, Te(!1), E.current = !1, await B();
7014
+ const Ae = {
7015
+ ...K,
7016
+ lipsyncLang: K.lipsyncLang || R.lipsyncLang || "en"
7017
7017
  };
7018
- if (_.onSpeechEnd && g.current) {
7019
- const ne = g.current;
7020
- let me = null, Xe = 0;
7021
- const Oe = 1200;
7022
- let Fe = !1;
7018
+ if (K.onSpeechEnd && g.current) {
7019
+ const J = g.current;
7020
+ let me = null, Ce = 0;
7021
+ const Ne = 1200;
7022
+ let Ee = !1;
7023
7023
  me = setInterval(() => {
7024
- if (Xe++, E.current)
7024
+ if (Ce++, E.current)
7025
7025
  return;
7026
- if (Xe > Oe) {
7027
- if (me && (clearInterval(me), me = null, y.current = null), !Fe && !E.current) {
7028
- Fe = !0;
7026
+ if (Ce > Ne) {
7027
+ if (me && (clearInterval(me), me = null, y.current = null), !Ee && !E.current) {
7028
+ Ee = !0;
7029
7029
  try {
7030
- _.onSpeechEnd();
7030
+ K.onSpeechEnd();
7031
7031
  } catch (Ge) {
7032
7032
  console.error("Error in onSpeechEnd callback (timeout):", Ge);
7033
7033
  }
7034
7034
  }
7035
7035
  return;
7036
7036
  }
7037
- const Re = !ne.speechQueue || ne.speechQueue.length === 0, Ue = !ne.audioPlaylist || ne.audioPlaylist.length === 0;
7038
- ne && ne.isSpeaking === !1 && Re && Ue && ne.isAudioPlaying === !1 && !Fe && !E.current && setTimeout(() => {
7039
- if (ne && !E.current && ne.isSpeaking === !1 && (!ne.speechQueue || ne.speechQueue.length === 0) && (!ne.audioPlaylist || ne.audioPlaylist.length === 0) && ne.isAudioPlaying === !1 && !Fe && !E.current) {
7040
- Fe = !0, me && (clearInterval(me), me = null, y.current = null);
7037
+ const ze = !J.speechQueue || J.speechQueue.length === 0, Pe = !J.audioPlaylist || J.audioPlaylist.length === 0;
7038
+ J && J.isSpeaking === !1 && ze && Pe && J.isAudioPlaying === !1 && !Ee && !E.current && setTimeout(() => {
7039
+ if (J && !E.current && J.isSpeaking === !1 && (!J.speechQueue || J.speechQueue.length === 0) && (!J.audioPlaylist || J.audioPlaylist.length === 0) && J.isAudioPlaying === !1 && !Ee && !E.current) {
7040
+ Ee = !0, me && (clearInterval(me), me = null, y.current = null);
7041
7041
  try {
7042
- _.onSpeechEnd();
7043
- } catch (we) {
7044
- console.error("Error in onSpeechEnd callback:", we);
7042
+ K.onSpeechEnd();
7043
+ } catch (Qe) {
7044
+ console.error("Error in onSpeechEnd callback:", Qe);
7045
7045
  }
7046
7046
  }
7047
7047
  }, 100);
7048
7048
  }, 100), y.current = me;
7049
7049
  }
7050
- g.current.lipsync && Object.keys(g.current.lipsync).length > 0 ? (g.current.setSlowdownRate && g.current.setSlowdownRate(1.05), g.current.speakText(w, de)) : setTimeout(async () => {
7051
- await B(), g.current && g.current.lipsync && (g.current.setSlowdownRate && g.current.setSlowdownRate(1.05), g.current.speakText(w, de));
7050
+ g.current.lipsync && Object.keys(g.current.lipsync).length > 0 ? (g.current.setSlowdownRate && g.current.setSlowdownRate(1.05), g.current.speakText(w, Ae)) : setTimeout(async () => {
7051
+ await B(), g.current && g.current.lipsync && (g.current.setSlowdownRate && g.current.setSlowdownRate(1.05), g.current.speakText(w, Ae));
7052
7052
  }, 100);
7053
- } catch (te) {
7054
- console.error("Error speaking text:", te), D(te.message || "Failed to speak text");
7053
+ } catch (ce) {
7054
+ console.error("Error speaking text:", ce), D(ce.message || "Failed to speak text");
7055
7055
  }
7056
- }, [K, B, R.lipsyncLang]), oe = W(() => {
7056
+ }, [$, B, R.lipsyncLang]), ie = W(() => {
7057
7057
  g.current && (g.current.stopSpeaking(), g.current.setSlowdownRate && g.current.setSlowdownRate(1), M.current = null, Te(!1));
7058
7058
  }, []), X = W(() => {
7059
7059
  if (g.current && g.current.pauseSpeaking) {
7060
7060
  const w = g.current;
7061
7061
  if (w.isSpeaking || w.audioPlaylist && w.audioPlaylist.length > 0 || w.speechQueue && w.speechQueue.length > 0) {
7062
7062
  y.current && (clearInterval(y.current), y.current = null);
7063
- let te = "";
7063
+ let ce = "";
7064
7064
  if (M.current && C.current.length > 0) {
7065
- const ue = C.current.length, de = w.speechQueue ? w.speechQueue.filter((Oe) => Oe && Oe.text && Array.isArray(Oe.text) && Oe.text.length > 0).length : 0, ne = w.audioPlaylist && w.audioPlaylist.length > 0, me = de + (ne ? 1 : 0), Xe = ue - me;
7066
- if (me > 0 && Xe < ue && (te = C.current.slice(Xe).join(". ").trim(), !te && de > 0 && w.speechQueue)) {
7067
- const Fe = w.speechQueue.filter((Re) => Re && Re.text && Array.isArray(Re.text) && Re.text.length > 0).map((Re) => Re.text.map((Ue) => Ue.word || "").filter((Ue) => Ue.length > 0).join(" ")).filter((Re) => Re.length > 0).join(" ");
7068
- Fe && Fe.trim() && (te = Fe.trim());
7065
+ const ae = C.current.length, Ae = w.speechQueue ? w.speechQueue.filter((Ne) => Ne && Ne.text && Array.isArray(Ne.text) && Ne.text.length > 0).length : 0, J = w.audioPlaylist && w.audioPlaylist.length > 0, me = Ae + (J ? 1 : 0), Ce = ae - me;
7066
+ if (me > 0 && Ce < ae && (ce = C.current.slice(Ce).join(". ").trim(), !ce && Ae > 0 && w.speechQueue)) {
7067
+ const Ee = w.speechQueue.filter((ze) => ze && ze.text && Array.isArray(ze.text) && ze.text.length > 0).map((ze) => ze.text.map((Pe) => Pe.word || "").filter((Pe) => Pe.length > 0).join(" ")).filter((ze) => ze.length > 0).join(" ");
7068
+ Ee && Ee.trim() && (ce = Ee.trim());
7069
7069
  }
7070
7070
  }
7071
7071
  M.current && (S.current = {
7072
- remainingText: te || null,
7072
+ remainingText: ce || null,
7073
7073
  originalText: M.current.text,
7074
7074
  options: M.current.options
7075
7075
  }), w.speechQueue && (w.speechQueue.length = 0), g.current.pauseSpeaking(), E.current = !0, Te(!0);
7076
7076
  }
7077
7077
  }
7078
- }, []), q = W(async () => {
7079
- if (!g.current || !xe)
7078
+ }, []), _ = W(async () => {
7079
+ if (!g.current || !fe)
7080
7080
  return;
7081
- let w = "", _ = {};
7081
+ let w = "", K = {};
7082
7082
  if (S.current && S.current.remainingText)
7083
- w = S.current.remainingText, _ = S.current.options || {}, S.current = { remainingText: null, originalText: null, options: null };
7083
+ w = S.current.remainingText, K = S.current.options || {}, S.current = { remainingText: null, originalText: null, options: null };
7084
7084
  else if (M.current && M.current.text)
7085
- w = M.current.text, _ = M.current.options || {};
7085
+ w = M.current.text, K = M.current.options || {};
7086
7086
  else {
7087
7087
  console.warn("Resume called but no paused speech found"), Te(!1), E.current = !1;
7088
7088
  return;
7089
7089
  }
7090
7090
  Te(!1), E.current = !1, await B();
7091
- const te = {
7092
- ..._,
7093
- lipsyncLang: _.lipsyncLang || R.lipsyncLang || "en"
7091
+ const ce = {
7092
+ ...K,
7093
+ lipsyncLang: K.lipsyncLang || R.lipsyncLang || "en"
7094
7094
  };
7095
7095
  try {
7096
- await j(w, te);
7097
- } catch (ue) {
7098
- console.error("Error resuming speech:", ue), Te(!1), E.current = !1;
7096
+ await j(w, ce);
7097
+ } catch (ae) {
7098
+ console.error("Error resuming speech:", ae), Te(!1), E.current = !1;
7099
7099
  }
7100
- }, [B, xe, j, R]), Se = W((w) => {
7100
+ }, [B, fe, j, R]), Le = W((w) => {
7101
7101
  g.current && g.current.setMood(w);
7102
- }, []), be = W((w) => {
7102
+ }, []), xe = W((w) => {
7103
7103
  g.current && g.current.setSlowdownRate && g.current.setSlowdownRate(w);
7104
- }, []), Ae = W((w, _ = !1) => {
7104
+ }, []), be = W((w, K = !1) => {
7105
7105
  if (g.current && g.current.playAnimation) {
7106
7106
  if (f && f[w] && (w = f[w]), g.current.setShowFullAvatar)
7107
7107
  try {
7108
7108
  g.current.setShowFullAvatar(H.current);
7109
- } catch (ue) {
7110
- console.warn("Error setting full body mode:", ue);
7109
+ } catch (ae) {
7110
+ console.warn("Error setting full body mode:", ae);
7111
7111
  }
7112
7112
  if (w.includes("."))
7113
7113
  try {
7114
- g.current.playAnimation(w, null, 10, 0, 0.01, _);
7115
- } catch (ue) {
7116
- console.warn(`Failed to play ${w}:`, ue);
7114
+ g.current.playAnimation(w, null, 10, 0, 0.01, K);
7115
+ } catch (ae) {
7116
+ console.warn(`Failed to play ${w}:`, ae);
7117
7117
  try {
7118
7118
  g.current.setBodyMovement("idle");
7119
- } catch (de) {
7120
- console.warn("Fallback animation also failed:", de);
7119
+ } catch (Ae) {
7120
+ console.warn("Fallback animation also failed:", Ae);
7121
7121
  }
7122
7122
  }
7123
7123
  else {
7124
- const ue = [".fbx", ".glb", ".gltf"];
7125
- let de = !1;
7126
- for (const ne of ue)
7124
+ const ae = [".fbx", ".glb", ".gltf"];
7125
+ let Ae = !1;
7126
+ for (const J of ae)
7127
7127
  try {
7128
- g.current.playAnimation(w + ne, null, 10, 0, 0.01, _), de = !0;
7128
+ g.current.playAnimation(w + J, null, 10, 0, 0.01, K), Ae = !0;
7129
7129
  break;
7130
7130
  } catch {
7131
7131
  }
7132
- if (!de) {
7132
+ if (!Ae) {
7133
7133
  console.warn("Animation not found:", w);
7134
7134
  try {
7135
7135
  g.current.setBodyMovement("idle");
7136
- } catch (ne) {
7137
- console.warn("Fallback animation also failed:", ne);
7136
+ } catch (J) {
7137
+ console.warn("Fallback animation also failed:", J);
7138
7138
  }
7139
7139
  }
7140
7140
  }
7141
7141
  }
7142
- }, [f]), et = W(() => {
7142
+ }, [f]), tt = W(() => {
7143
7143
  g.current && g.current.onResize && g.current.onResize();
7144
7144
  }, []);
7145
- return $e(L, () => ({
7145
+ return Je(L, () => ({
7146
7146
  speakText: j,
7147
- stopSpeaking: oe,
7147
+ stopSpeaking: ie,
7148
7148
  pauseSpeaking: X,
7149
- resumeSpeaking: q,
7149
+ resumeSpeaking: _,
7150
7150
  resumeAudioContext: B,
7151
- setMood: Se,
7152
- setTimingAdjustment: be,
7153
- playAnimation: Ae,
7154
- isReady: K,
7155
- isPaused: xe,
7151
+ setMood: Le,
7152
+ setTimingAdjustment: xe,
7153
+ playAnimation: be,
7154
+ isReady: $,
7155
+ isPaused: fe,
7156
7156
  talkingHead: g.current,
7157
- handleResize: et,
7157
+ handleResize: tt,
7158
7158
  setBodyMovement: (w) => {
7159
7159
  if (g.current && g.current.setShowFullAvatar && g.current.setBodyMovement)
7160
7160
  try {
7161
7161
  g.current.setShowFullAvatar(H.current), g.current.setBodyMovement(w);
7162
- } catch (_) {
7163
- console.warn("Error setting body movement:", _);
7162
+ } catch (K) {
7163
+ console.warn("Error setting body movement:", K);
7164
7164
  }
7165
7165
  },
7166
7166
  setMovementIntensity: (w) => g.current?.setMovementIntensity(w),
@@ -7176,8 +7176,8 @@ const ct = Ke(({
7176
7176
  if (g.current && g.current.setShowFullAvatar && g.current.playReaction)
7177
7177
  try {
7178
7178
  g.current.setShowFullAvatar(H.current), g.current.playReaction(w);
7179
- } catch (_) {
7180
- console.warn("Error playing reaction:", _);
7179
+ } catch (K) {
7180
+ console.warn("Error playing reaction:", K);
7181
7181
  }
7182
7182
  },
7183
7183
  playCelebration: () => {
@@ -7192,8 +7192,8 @@ const ct = Ke(({
7192
7192
  if (g.current && g.current.setShowFullAvatar)
7193
7193
  try {
7194
7194
  H.current = w, g.current.setShowFullAvatar(w);
7195
- } catch (_) {
7196
- console.warn("Error setting showFullAvatar:", _);
7195
+ } catch (K) {
7196
+ console.warn("Error setting showFullAvatar:", K);
7197
7197
  }
7198
7198
  },
7199
7199
  lockAvatarPosition: () => {
@@ -7212,7 +7212,7 @@ const ct = Ke(({
7212
7212
  console.warn("Error unlocking avatar position:", w);
7213
7213
  }
7214
7214
  }
7215
- })), /* @__PURE__ */ Ee(
7215
+ })), /* @__PURE__ */ Be(
7216
7216
  "div",
7217
7217
  {
7218
7218
  className: `talking-head-avatar ${p}`,
@@ -7260,8 +7260,8 @@ const ct = Ke(({
7260
7260
  }
7261
7261
  );
7262
7262
  });
7263
- ct.displayName = "TalkingHeadAvatar";
7264
- const Ut = Ke(({
7263
+ ut.displayName = "TalkingHeadAvatar";
7264
+ const Wt = $e(({
7265
7265
  text: Y = "Hello! I'm a talking avatar. How are you today?",
7266
7266
  onLoading: n = () => {
7267
7267
  },
@@ -7273,7 +7273,7 @@ const Ut = Ke(({
7273
7273
  style: s = {},
7274
7274
  avatarConfig: i = {}
7275
7275
  }, a) => {
7276
- const u = V(null), l = V(null), [c, r] = ge(!0), [h, d] = ge(null), [p, b] = ge(!1), f = Je(), L = i.ttsService || f.service, Q = L === "browser" ? {
7276
+ const u = V(null), l = V(null), [c, r] = pe(!0), [h, d] = pe(null), [p, b] = pe(!1), f = et(), L = i.ttsService || f.service, Q = L === "browser" ? {
7277
7277
  endpoint: "",
7278
7278
  apiKey: null,
7279
7279
  defaultVoice: "Google US English"
@@ -7306,7 +7306,7 @@ const Ut = Ke(({
7306
7306
  }, M = W(async () => {
7307
7307
  if (!(!u.current || l.current))
7308
7308
  try {
7309
- if (r(!0), d(null), l.current = new it(u.current, H), await l.current.showAvatar(g, (P) => {
7309
+ if (r(!0), d(null), l.current = new ot(u.current, H), await l.current.showAvatar(g, (P) => {
7310
7310
  if (P.lengthComputable) {
7311
7311
  const D = Math.min(100, Math.round(P.loaded / P.total * 100));
7312
7312
  n(D);
@@ -7314,7 +7314,7 @@ const Ut = Ke(({
7314
7314
  }), l.current.morphs && l.current.morphs.length > 0) {
7315
7315
  const P = l.current.morphs[0].morphTargetDictionary;
7316
7316
  console.log("Available morph targets:", Object.keys(P));
7317
- const D = Object.keys(P).filter((K) => K.startsWith("viseme_"));
7317
+ const D = Object.keys(P).filter(($) => $.startsWith("viseme_"));
7318
7318
  console.log("Viseme morph targets found:", D), D.length === 0 && (console.warn("No viseme morph targets found! Lip-sync will not work properly."), console.log("Expected viseme targets: viseme_aa, viseme_E, viseme_I, viseme_O, viseme_U, viseme_PP, viseme_SS, viseme_TH, viseme_DD, viseme_FF, viseme_kk, viseme_nn, viseme_RR, viseme_CH, viseme_sil"));
7319
7319
  }
7320
7320
  if (await new Promise((P) => {
@@ -7339,7 +7339,7 @@ const Ut = Ke(({
7339
7339
  console.error("Error initializing TalkingHead:", I), d(I.message || "Failed to initialize avatar"), r(!1), e(I);
7340
7340
  }
7341
7341
  }, []);
7342
- ze(() => (M(), () => {
7342
+ ke(() => (M(), () => {
7343
7343
  l.current && (l.current.stop(), l.current.dispose(), l.current = null);
7344
7344
  }), [M]);
7345
7345
  const y = W((I) => {
@@ -7374,33 +7374,33 @@ const Ut = Ke(({
7374
7374
  console.log(`Failed to play ${I}:`, D);
7375
7375
  try {
7376
7376
  l.current.setBodyMovement("idle"), console.log("Fallback to idle animation");
7377
- } catch (K) {
7378
- console.warn("Fallback animation also failed:", K);
7377
+ } catch ($) {
7378
+ console.warn("Fallback animation also failed:", $);
7379
7379
  }
7380
7380
  }
7381
7381
  else {
7382
7382
  const D = [".fbx", ".glb", ".gltf"];
7383
- let K = !1;
7384
- for (const fe of D)
7383
+ let $ = !1;
7384
+ for (const ye of D)
7385
7385
  try {
7386
- l.current.playAnimation(I + fe, null, 10, 0, 0.01, G), console.log("Playing animation:", I + fe), K = !0;
7386
+ l.current.playAnimation(I + ye, null, 10, 0, 0.01, G), console.log("Playing animation:", I + ye), $ = !0;
7387
7387
  break;
7388
7388
  } catch {
7389
- console.log(`Failed to play ${I}${fe}, trying next format...`);
7389
+ console.log(`Failed to play ${I}${ye}, trying next format...`);
7390
7390
  }
7391
- if (!K) {
7391
+ if (!$) {
7392
7392
  console.warn("Animation system not available or animation not found:", I);
7393
7393
  try {
7394
7394
  l.current.setBodyMovement("idle"), console.log("Fallback to idle animation");
7395
- } catch (fe) {
7396
- console.warn("Fallback animation also failed:", fe);
7395
+ } catch (ye) {
7396
+ console.warn("Fallback animation also failed:", ye);
7397
7397
  }
7398
7398
  }
7399
7399
  }
7400
7400
  } else
7401
7401
  console.warn("Animation system not available or animation not found:", I);
7402
7402
  }, []);
7403
- return $e(a, () => ({
7403
+ return Je(a, () => ({
7404
7404
  speakText: y,
7405
7405
  stopSpeaking: E,
7406
7406
  setMood: S,
@@ -7465,7 +7465,7 @@ const Ut = Ke(({
7465
7465
  console.warn("Error unlocking avatar position:", I);
7466
7466
  }
7467
7467
  }
7468
- })), /* @__PURE__ */ Ee("div", { className: `talking-head-container ${o}`, style: s, children: [
7468
+ })), /* @__PURE__ */ Be("div", { className: `talking-head-container ${o}`, style: s, children: [
7469
7469
  /* @__PURE__ */ le(
7470
7470
  "div",
7471
7471
  {
@@ -7501,7 +7501,7 @@ const Ut = Ke(({
7501
7501
  }, children: h })
7502
7502
  ] });
7503
7503
  });
7504
- Ut.displayName = "TalkingHeadComponent";
7504
+ Wt.displayName = "TalkingHeadComponent";
7505
7505
  async function je(Y) {
7506
7506
  try {
7507
7507
  const n = await fetch(Y);
@@ -7519,7 +7519,7 @@ async function je(Y) {
7519
7519
  return n instanceof SyntaxError || console.warn("⚠️ Could not load animation manifest (this is optional):", Y), {};
7520
7520
  }
7521
7521
  }
7522
- async function Wt(Y, n = "F") {
7522
+ async function Vt(Y, n = "F") {
7523
7523
  const e = [], t = Y.replace(/\/$/, "");
7524
7524
  try {
7525
7525
  const i = [
@@ -7563,18 +7563,18 @@ async function Wt(Y, n = "F") {
7563
7563
  }
7564
7564
  return e.length > 0, e;
7565
7565
  }
7566
- async function lt(Y, n = "F") {
7566
+ async function ct(Y, n = "F") {
7567
7567
  const e = {};
7568
7568
  for (const [t, o] of Object.entries(Y))
7569
7569
  try {
7570
- const s = await Wt(o, n);
7570
+ const s = await Vt(o, n);
7571
7571
  s.length > 0 && (e[t] = s);
7572
7572
  } catch (s) {
7573
7573
  console.error(`❌ Failed to auto-load animations from ${o}:`, s);
7574
7574
  }
7575
7575
  return e;
7576
7576
  }
7577
- const Vt = Ke(({
7577
+ const Xt = $e(({
7578
7578
  text: Y = null,
7579
7579
  avatarUrl: n = "/avatars/brunette.glb",
7580
7580
  avatarBody: e = "F",
@@ -7607,11 +7607,13 @@ const Vt = Ke(({
7607
7607
  // e.g., "idle" - will select from this group in order when idle
7608
7608
  autoSpeak: E = !1
7609
7609
  }, S) => {
7610
- const C = V(null), x = V(null), I = V(c), G = V(null), P = V(null), D = V(!1), K = V({ remainingText: null, originalText: null, options: null }), fe = V([]), [xe, Te] = ge(!0), [Le, Me] = ge(null), [ae, R] = ge(!1), [v, N] = ge(!1), [B, j] = ge(H), oe = V(null), X = V(!1), q = V(null), Se = V(!1), be = V([]), Ae = V([]), et = V(0), w = V(null), _ = V(null), te = V("");
7611
- ze(() => {
7610
+ const C = V(null), x = V(null), I = V(c), G = V(null), P = V(null), D = V(!1), $ = V({ remainingText: null, originalText: null, options: null }), ye = V([]), [fe, Te] = pe(!0), [Ie, Me] = pe(null), [re, R] = pe(!1), [v, N] = pe(!1), [B, j] = pe(H), ie = V(null), X = V(!1), _ = V(null), Le = V(!1), xe = V([]), be = V([]), tt = V(0), w = V(null), K = V(null), ce = V(L), ae = V("");
7611
+ ke(() => {
7612
7612
  D.current = v;
7613
- }, [v]);
7614
- const ue = W((k) => {
7613
+ }, [v]), ke(() => {
7614
+ ce.current = L;
7615
+ }, [L]);
7616
+ const Ae = W((k) => {
7615
7617
  let z = "F";
7616
7618
  if (k) {
7617
7619
  const F = k.toString().toUpperCase().trim();
@@ -7619,7 +7621,7 @@ const Vt = Ke(({
7619
7621
  }
7620
7622
  return z === "M" ? "male" : "female";
7621
7623
  }, []);
7622
- ze(() => {
7624
+ ke(() => {
7623
7625
  (async () => {
7624
7626
  if (H.manifest && H.auto)
7625
7627
  try {
@@ -7640,38 +7642,38 @@ const Vt = Ke(({
7640
7642
  } catch {
7641
7643
  }
7642
7644
  if (typeof H.auto == "string") {
7643
- const F = H.auto, se = {
7645
+ const F = H.auto, oe = {
7644
7646
  talking: `${F}/talking`,
7645
7647
  idle: `${F}/idle`
7646
- }, Z = ue(e);
7647
- se[`${Z}_talking`] = `${F}/${Z}/talking`, se[`${Z}_idle`] = `${F}/${Z}/idle`, se.shared_talking = `${F}/shared/talking`, se.shared_idle = `${F}/shared/idle`;
7648
- const ke = await lt(se, e);
7649
- if (!Object.values(ke).some(($) => Array.isArray($) && $.length > 0) && z) {
7648
+ }, Z = Ae(e);
7649
+ oe[`${Z}_talking`] = `${F}/${Z}/talking`, oe[`${Z}_idle`] = `${F}/${Z}/idle`, oe.shared_talking = `${F}/shared/talking`, oe.shared_idle = `${F}/shared/idle`;
7650
+ const Se = await ct(oe, e);
7651
+ if (!Object.values(Se).some((q) => Array.isArray(q) && q.length > 0) && z) {
7650
7652
  j(z);
7651
7653
  return;
7652
7654
  }
7653
- const ee = {
7655
+ const te = {
7654
7656
  _genderSpecific: {
7655
7657
  [Z]: {},
7656
7658
  shared: {}
7657
7659
  }
7658
7660
  };
7659
- Object.entries(ke).forEach(([$, ie]) => {
7660
- if ($.includes("_")) {
7661
- const [J, ...ye] = $.split("_"), pe = ye.join("_");
7662
- J === "shared" ? (ee._genderSpecific.shared[pe] || (ee._genderSpecific.shared[pe] = []), ee._genderSpecific.shared[pe].push(...ie)) : J === Z && (ee._genderSpecific[Z][pe] || (ee._genderSpecific[Z][pe] = []), ee._genderSpecific[Z][pe].push(...ie));
7661
+ Object.entries(Se).forEach(([q, ne]) => {
7662
+ if (q.includes("_")) {
7663
+ const [ee, ...ge] = q.split("_"), de = ge.join("_");
7664
+ ee === "shared" ? (te._genderSpecific.shared[de] || (te._genderSpecific.shared[de] = []), te._genderSpecific.shared[de].push(...ne)) : ee === Z && (te._genderSpecific[Z][de] || (te._genderSpecific[Z][de] = []), te._genderSpecific[Z][de].push(...ne));
7663
7665
  } else
7664
- ee[$] = ie;
7665
- }), z && (z._genderSpecific && Object.keys(z._genderSpecific).forEach(($) => {
7666
- ee._genderSpecific[$] || (ee._genderSpecific[$] = {}), Object.entries(z._genderSpecific[$]).forEach(([ie, J]) => {
7667
- ee._genderSpecific[$][ie] || (ee._genderSpecific[$][ie] = J);
7666
+ te[q] = ne;
7667
+ }), z && (z._genderSpecific && Object.keys(z._genderSpecific).forEach((q) => {
7668
+ te._genderSpecific[q] || (te._genderSpecific[q] = {}), Object.entries(z._genderSpecific[q]).forEach(([ne, ee]) => {
7669
+ te._genderSpecific[q][ne] || (te._genderSpecific[q][ne] = ee);
7668
7670
  });
7669
- }), Object.entries(z).forEach(([$, ie]) => {
7670
- $ !== "_genderSpecific" && !ee[$] && (ee[$] = ie);
7671
- })), j(ee);
7671
+ }), Object.entries(z).forEach(([q, ne]) => {
7672
+ q !== "_genderSpecific" && !te[q] && (te[q] = ne);
7673
+ })), j(te);
7672
7674
  } else if (typeof H.auto == "object") {
7673
- const F = await lt(H.auto, e), se = Object.values(F).some((Z) => Array.isArray(Z) && Z.length > 0);
7674
- j(!se && z ? z : F);
7675
+ const F = await ct(H.auto, e), oe = Object.values(F).some((Z) => Array.isArray(Z) && Z.length > 0);
7676
+ j(!oe && z ? z : F);
7675
7677
  }
7676
7678
  } catch (z) {
7677
7679
  if (console.error("Failed to auto-discover animations:", z), H.manifest)
@@ -7687,52 +7689,52 @@ const Vt = Ke(({
7687
7689
  else
7688
7690
  j(H);
7689
7691
  })();
7690
- }, [H, e, ue]), ze(() => {
7692
+ }, [H, e, Ae]), ke(() => {
7691
7693
  I.current = c;
7692
7694
  }, [c]);
7693
- const de = Je(), ne = s || de.service;
7694
- let me;
7695
- ne === "browser" ? me = {
7695
+ const J = et(), me = s || J.service;
7696
+ let Ce;
7697
+ me === "browser" ? Ce = {
7696
7698
  service: "browser",
7697
7699
  endpoint: "",
7698
7700
  apiKey: null,
7699
7701
  defaultVoice: "Google US English"
7700
- } : ne === "elevenlabs" ? me = {
7702
+ } : me === "elevenlabs" ? Ce = {
7701
7703
  service: "elevenlabs",
7702
7704
  endpoint: "https://api.elevenlabs.io/v1/text-to-speech",
7703
- apiKey: a || de.apiKey,
7704
- defaultVoice: i || de.defaultVoice || Ve.defaultVoice,
7705
- voices: de.voices || Ve.voices
7706
- } : ne === "deepgram" ? me = {
7705
+ apiKey: a || J.apiKey,
7706
+ defaultVoice: i || J.defaultVoice || Xe.defaultVoice,
7707
+ voices: J.voices || Xe.voices
7708
+ } : me === "deepgram" ? Ce = {
7707
7709
  service: "deepgram",
7708
7710
  endpoint: "https://api.deepgram.com/v1/speak",
7709
- apiKey: a || de.apiKey,
7710
- defaultVoice: i || de.defaultVoice || _e.defaultVoice,
7711
- voices: de.voices || _e.voices
7712
- } : me = {
7713
- ...de,
7714
- apiKey: a !== null ? a : de.apiKey
7711
+ apiKey: a || J.apiKey,
7712
+ defaultVoice: i || J.defaultVoice || Ke.defaultVoice,
7713
+ voices: J.voices || Ke.voices
7714
+ } : Ce = {
7715
+ ...J,
7716
+ apiKey: a !== null ? a : J.apiKey
7715
7717
  };
7716
- const Xe = {
7718
+ const Ne = {
7717
7719
  url: n,
7718
7720
  body: e,
7719
7721
  avatarMood: t,
7720
- ttsLang: ne === "browser" ? "en-US" : o,
7721
- ttsVoice: i || me.defaultVoice,
7722
+ ttsLang: me === "browser" ? "en-US" : o,
7723
+ ttsVoice: i || Ce.defaultVoice,
7722
7724
  lipsyncLang: "en",
7723
7725
  showFullAvatar: c,
7724
7726
  bodyMovement: u,
7725
7727
  movementIntensity: l
7726
- }, Oe = {
7727
- ttsEndpoint: me.endpoint,
7728
- ttsApikey: me.apiKey,
7729
- ttsService: ne,
7728
+ }, Ee = {
7729
+ ttsEndpoint: Ce.endpoint,
7730
+ ttsApikey: Ce.apiKey,
7731
+ ttsService: me,
7730
7732
  lipsyncModules: ["en"],
7731
7733
  cameraView: r
7732
- }, Fe = W(async () => {
7734
+ }, ze = W(async () => {
7733
7735
  if (!(!C.current || x.current))
7734
7736
  try {
7735
- Te(!0), Me(null), x.current = new it(C.current, Oe), await x.current.showAvatar(Xe, (z) => {
7737
+ Te(!0), Me(null), x.current = new ot(C.current, Ee), await x.current.showAvatar(Ne, (z) => {
7736
7738
  if (z.lengthComputable) {
7737
7739
  const F = Math.min(100, Math.round(z.loaded / z.total * 100));
7738
7740
  d(F);
@@ -7748,10 +7750,10 @@ const Vt = Ke(({
7748
7750
  console.error("Error initializing TalkingHead:", k), Me(k.message || "Failed to initialize avatar"), Te(!1), p(k);
7749
7751
  }
7750
7752
  }, []);
7751
- ze(() => (Fe(), () => {
7753
+ ke(() => (ze(), () => {
7752
7754
  x.current && (x.current.stop(), x.current.dispose(), x.current = null);
7753
- }), [Fe]);
7754
- const Re = W(async () => {
7755
+ }), [ze]);
7756
+ const Pe = W(async () => {
7755
7757
  if (x.current)
7756
7758
  try {
7757
7759
  const k = x.current.audioCtx || x.current.audioContext;
@@ -7759,13 +7761,13 @@ const Vt = Ke(({
7759
7761
  } catch (k) {
7760
7762
  console.warn("Failed to resume audio context:", k);
7761
7763
  }
7762
- }, []), Ue = W((k) => {
7764
+ }, []), nt = W((k) => {
7763
7765
  if (!B)
7764
7766
  return [];
7765
7767
  let z = null;
7766
7768
  if (B._genderSpecific) {
7767
- const F = ue(e), se = B._genderSpecific[F];
7768
- if (se && se[k] && Array.isArray(se[k]) && se[k].length > 0 && (z = se[k]), !z && B._genderSpecific.shared && B._genderSpecific.shared[k]) {
7769
+ const F = Ae(e), oe = B._genderSpecific[F];
7770
+ if (oe && oe[k] && Array.isArray(oe[k]) && oe[k].length > 0 && (z = oe[k]), !z && B._genderSpecific.shared && B._genderSpecific.shared[k]) {
7769
7771
  const Z = B._genderSpecific.shared[k];
7770
7772
  Array.isArray(Z) && Z.length > 0 && (z = Z);
7771
7773
  }
@@ -7774,251 +7776,257 @@ const Vt = Ke(({
7774
7776
  const F = B[k];
7775
7777
  Array.isArray(F) && F.length > 0 ? z = F : typeof F == "string" && (z = [F]);
7776
7778
  }
7777
- return !z || Array.isArray(z) && z.length === 0 ? ((Object.keys(B).length > 0 || B._genderSpecific && Object.keys(B._genderSpecific).length > 0) && console.warn(`⚠️ No animations found for group "${k}" (gender: ${ue(e)}). Make sure animations are configured correctly.`), []) : Array.isArray(z) ? [...z] : typeof z == "string" ? [z] : [];
7778
- }, [B, e, ue]), tt = W((k) => {
7779
- if (Ae.current.length === 0) {
7780
- const F = Ue(k);
7779
+ return !z || Array.isArray(z) && z.length === 0 ? ((Object.keys(B).length > 0 || B._genderSpecific && Object.keys(B._genderSpecific).length > 0) && console.warn(`⚠️ No animations found for group "${k}" (gender: ${Ae(e)}). Make sure animations are configured correctly.`), []) : Array.isArray(z) ? [...z] : typeof z == "string" ? [z] : [];
7780
+ }, [B, e, Ae]), Ge = W((k) => {
7781
+ if (be.current.length === 0) {
7782
+ const F = nt(k);
7781
7783
  if (F.length === 0)
7782
7784
  return null;
7783
- Ae.current = [...F], be.current = [];
7785
+ be.current = [...F], xe.current = [];
7784
7786
  }
7785
- const z = Ae.current.shift();
7786
- return z && be.current.push(z), z;
7787
- }, [Ue]), Ge = W((k) => k ? k.split("/").pop().replace(".fbx", "").replace(/[-_]/g, " ") : "Unknown", []), we = W((k, z = !1, F = null) => {
7788
- if (!x.current || !X.current || q.current !== k)
7787
+ const z = be.current.shift();
7788
+ return z && xe.current.push(z), z;
7789
+ }, [nt]), Qe = W((k) => k ? k.split("/").pop().replace(".fbx", "").replace(/[-_]/g, " ") : "Unknown", []), Fe = W((k, z = !1, F = null) => {
7790
+ if (!x.current || !X.current || _.current !== k)
7789
7791
  return null;
7790
- const se = tt(k);
7791
- if (se)
7792
+ const oe = Ge(k);
7793
+ if (oe)
7792
7794
  try {
7793
- const Z = Ge(se);
7795
+ const Z = Qe(oe);
7794
7796
  console.log(`🎬 Playing animation: "${Z}"`);
7795
- const ke = () => {
7797
+ const Se = () => {
7796
7798
  console.log("🎬 Animation finished, checking if should continue...");
7797
7799
  const O = () => {
7798
7800
  if (!x.current)
7799
7801
  return console.log("🎬 No talkingHeadRef, stopping animations"), !1;
7800
7802
  if (!X.current)
7801
7803
  return console.log("🎬 isSpeakingRef is false, stopping animations"), !1;
7802
- if (q.current !== k)
7803
- return console.log(`🎬 Animation group mismatch (${q.current} !== ${k}), stopping animations`), !1;
7804
- const $ = x.current, ie = $.isAudioPlaying === !0, J = $.audioPlaylist && $.audioPlaylist.length > 0, ye = $.speechQueue && $.speechQueue.length > 0, pe = $.isSpeaking === !0, De = pe || ie || J || ye;
7804
+ if (_.current !== k)
7805
+ return console.log(`🎬 Animation group mismatch (${_.current} !== ${k}), stopping animations`), !1;
7806
+ const q = x.current, ne = q.isAudioPlaying === !0, ee = q.audioPlaylist && q.audioPlaylist.length > 0, ge = q.speechQueue && q.speechQueue.length > 0, de = q.isSpeaking === !0, Ue = de || ne || ee || ge;
7805
7807
  return console.log("🎬 Still speaking check:", {
7806
7808
  isSpeakingRef: X.current,
7807
- isTalkingHeadSpeaking: pe,
7808
- hasAudioPlaying: ie,
7809
- hasAudioInPlaylist: J,
7810
- hasItemsInQueue: ye,
7811
- shouldContinue: De
7812
- }), De;
7809
+ isTalkingHeadSpeaking: de,
7810
+ hasAudioPlaying: ne,
7811
+ hasAudioInPlaylist: ee,
7812
+ hasItemsInQueue: ge,
7813
+ shouldContinue: Ue
7814
+ }), Ue;
7813
7815
  };
7814
7816
  O() ? (console.log("🎬 Still speaking, continuing to next animation..."), requestAnimationFrame(() => {
7815
- O() ? (console.log("🎬 Playing next animation..."), we(k, z, F)) : (console.log("🎬 Speech ended, stopping animations"), X.current = !1, q.current = null, x.current && x.current.stopAnimation(), F && F());
7816
- })) : (console.log("🎬 Speech has ended, stopping animations"), X.current = !1, q.current = null, x.current && x.current.stopAnimation(), F && F());
7817
+ O() ? (console.log("🎬 Playing next animation..."), Fe(k, z, F)) : (console.log("🎬 Speech ended, stopping animations"), X.current = !1, _.current = null, x.current && x.current.stopAnimation(), F && F());
7818
+ })) : (console.log("🎬 Speech has ended, stopping animations"), X.current = !1, _.current = null, x.current && x.current.stopAnimation(), F && F());
7817
7819
  };
7818
- return x.current.playAnimation(se, null, 0, 0, 0.01, z, ke), se;
7820
+ return x.current.playAnimation(oe, null, 0, 0, 0.01, z, Se), oe;
7819
7821
  } catch (Z) {
7820
7822
  return console.error("Failed to play animation:", Z), null;
7821
7823
  }
7822
7824
  else {
7823
7825
  const Z = () => {
7824
- if (!x.current || !X.current || q.current !== k)
7826
+ if (!x.current || !X.current || _.current !== k)
7825
7827
  return !1;
7826
- const O = x.current, ee = O.isAudioPlaying === !0, $ = O.audioPlaylist && O.audioPlaylist.length > 0, ie = O.speechQueue && O.speechQueue.length > 0;
7827
- return O.isSpeaking === !0 || ee || $ || ie;
7828
+ const O = x.current, te = O.isAudioPlaying === !0, q = O.audioPlaylist && O.audioPlaylist.length > 0, ne = O.speechQueue && O.speechQueue.length > 0;
7829
+ return O.isSpeaking === !0 || te || q || ne;
7828
7830
  };
7829
- Z() && (Ae.current = [], be.current = [], Z() ? we(k, z, F) : (X.current = !1, q.current = null, x.current && x.current.stopAnimation()));
7831
+ Z() && (be.current = [], xe.current = [], Z() ? Fe(k, z, F) : (X.current = !1, _.current = null, x.current && x.current.stopAnimation()));
7830
7832
  }
7831
7833
  return null;
7832
- }, [tt, Ge]), ht = W(() => {
7833
- y && x.current && !X.current && (oe.current && (clearInterval(oe.current), oe.current = null), Ae.current = [], be.current = [], we(y, !1, null), oe.current = setInterval(() => {
7834
- !X.current && !D.current && y && (Ae.current = [], be.current = [], we(y, !1, null));
7834
+ }, [Ge, Qe]), dt = W(() => {
7835
+ y && x.current && !X.current && (ie.current && (clearInterval(ie.current), ie.current = null), be.current = [], xe.current = [], Fe(y, !1, null), ie.current = setInterval(() => {
7836
+ !X.current && !D.current && y && (be.current = [], xe.current = [], Fe(y, !1, null));
7835
7837
  }, 12e3 + Math.random() * 3e3));
7836
- }, [y, we]);
7837
- _.current = ht;
7838
+ }, [y, Fe]);
7839
+ K.current = dt;
7838
7840
  const Ze = W(async (k, z = {}) => {
7839
- if (!x.current || !ae || !k || k.trim() === "")
7841
+ if (!x.current || !re || !k || k.trim() === "")
7840
7842
  return;
7841
- await Re(), oe.current && (clearInterval(oe.current), oe.current = null);
7843
+ await Pe(), ie.current && (clearInterval(ie.current), ie.current = null);
7842
7844
  const F = z.animationGroup || M;
7843
- F && !z.skipAnimation && (X.current = !0, q.current = F, Ae.current = [], be.current = [], we(F));
7845
+ F && !z.skipAnimation && (X.current = !0, _.current = F, be.current = [], xe.current = [], Fe(F));
7844
7846
  try {
7845
7847
  b(k), z.onSpeechStart && z.onSpeechStart(k);
7846
7848
  } catch (O) {
7847
7849
  console.warn("Error in onSpeechStart callback:", O);
7848
7850
  }
7849
- K.current = { remainingText: null, originalText: null, options: null }, fe.current = [], G.current = { text: k, options: z }, P.current && (clearInterval(P.current), P.current = null), N(!1), D.current = !1, Se.current = !1;
7850
- const se = k.split(/[.!?]+/).filter((O) => O.trim().length > 0);
7851
- fe.current = se, et.current = 0, te.current = "";
7851
+ $.current = { remainingText: null, originalText: null, options: null }, ye.current = [], G.current = { text: k, options: z }, P.current && (clearInterval(P.current), P.current = null), N(!1), D.current = !1, Le.current = !1;
7852
+ const oe = k.split(/[.!?]+/).filter((O) => O.trim().length > 0);
7853
+ ye.current = oe, tt.current = 0, ae.current = "";
7852
7854
  const Z = (O) => {
7853
- let ee = "";
7854
- if (O && (O.text ? ee = O.text : O.vs && O.vs.subtitles ? Array.isArray(O.vs.subtitles) ? ee = O.vs.subtitles.join("") : typeof O.vs.subtitles == "string" && (ee = O.vs.subtitles) : O.subtitles && (Array.isArray(O.subtitles) ? ee = O.subtitles.join("") : typeof O.subtitles == "string" && (ee = O.subtitles))), ee.trim() && (te.current += ee, L && typeof L == "function"))
7855
- try {
7856
- L(te.current.trim());
7857
- } catch ($) {
7858
- console.warn("Error in onSubtitle callback:", $);
7859
- }
7860
- }, ke = {
7855
+ let te = "";
7856
+ if (O && (O.text ? te = O.text : O.vs && O.vs.subtitles ? Array.isArray(O.vs.subtitles) ? te = O.vs.subtitles.join("") : typeof O.vs.subtitles == "string" && (te = O.vs.subtitles) : O.subtitles && (Array.isArray(O.subtitles) ? te = O.subtitles.join("") : typeof O.subtitles == "string" && (te = O.subtitles))), te.trim()) {
7857
+ ae.current += te;
7858
+ const q = ce.current;
7859
+ if (q && typeof q == "function")
7860
+ try {
7861
+ setTimeout(() => {
7862
+ q(ae.current.trim());
7863
+ }, 0);
7864
+ } catch (ne) {
7865
+ console.warn("Error in onSubtitle callback:", ne);
7866
+ }
7867
+ }
7868
+ }, Se = {
7861
7869
  lipsyncLang: z.lipsyncLang || "en",
7862
7870
  onSubtitles: L ? Z : null
7863
7871
  };
7864
7872
  if (x.current) {
7865
7873
  const O = x.current;
7866
- let ee = 0;
7867
- const $ = 1200;
7874
+ let te = 0;
7875
+ const q = 1200;
7868
7876
  P.current && (clearInterval(P.current), P.current = null);
7869
- const ie = { current: !1 }, J = setInterval(() => {
7870
- if (ee++, D.current)
7877
+ const ne = { current: !1 }, ee = setInterval(() => {
7878
+ if (te++, D.current)
7871
7879
  return;
7872
- if (ee > $) {
7873
- if (J && (clearInterval(J), P.current = null), !ie.current && !D.current) {
7874
- ie.current = !0, X.current = !1, q.current = null, Ae.current = [], be.current = [], x.current && (x.current.stopAnimation(), x.current.isSpeaking = !1);
7880
+ if (te > q) {
7881
+ if (ee && (clearInterval(ee), P.current = null), !ne.current && !D.current) {
7882
+ ne.current = !0, X.current = !1, _.current = null, be.current = [], xe.current = [], x.current && (x.current.stopAnimation(), x.current.isSpeaking = !1);
7875
7883
  try {
7876
7884
  z.onSpeechEnd && z.onSpeechEnd(), f();
7877
- } catch (ce) {
7878
- console.error("Error in onSpeechEnd callback (timeout):", ce);
7885
+ } catch (ue) {
7886
+ console.error("Error in onSpeechEnd callback (timeout):", ue);
7879
7887
  }
7880
7888
  }
7881
7889
  return;
7882
7890
  }
7883
- const ye = !O.speechQueue || O.speechQueue.length === 0, pe = !O.audioPlaylist || O.audioPlaylist.length === 0, De = O.isAudioPlaying === !1;
7884
- O && !D.current && ye && pe && De && O.isSpeaking === !1 && !ie.current && !D.current && setTimeout(() => {
7885
- const ce = x.current;
7886
- if (!ce)
7891
+ const ge = !O.speechQueue || O.speechQueue.length === 0, de = !O.audioPlaylist || O.audioPlaylist.length === 0, Ue = O.isAudioPlaying === !1;
7892
+ O && !D.current && ge && de && Ue && O.isSpeaking === !1 && !ne.current && !D.current && setTimeout(() => {
7893
+ const ue = x.current;
7894
+ if (!ue)
7887
7895
  return;
7888
- !D.current && (!ce.speechQueue || ce.speechQueue.length === 0) && (!ce.audioPlaylist || ce.audioPlaylist.length === 0) && ce.isAudioPlaying === !1 && ce.isSpeaking === !1 && !ie.current && !D.current && (ie.current = !0, J && (clearInterval(J), P.current = null), X.current = !1, q.current = null, Ae.current = [], be.current = [], te.current = "", ce && (ce.stopAnimation(), ce.isSpeaking = !1), Se.current = !0, setTimeout(() => {
7889
- _.current && _.current();
7896
+ !D.current && (!ue.speechQueue || ue.speechQueue.length === 0) && (!ue.audioPlaylist || ue.audioPlaylist.length === 0) && ue.isAudioPlaying === !1 && ue.isSpeaking === !1 && !ne.current && !D.current && (ne.current = !0, ee && (clearInterval(ee), P.current = null), X.current = !1, _.current = null, be.current = [], xe.current = [], ae.current = "", ue && (ue.stopAnimation(), ue.isSpeaking = !1), Le.current = !0, setTimeout(() => {
7897
+ K.current && K.current();
7890
7898
  }, 500), setTimeout(() => {
7891
7899
  try {
7892
7900
  z.onSpeechEnd && z.onSpeechEnd(), f(), setTimeout(() => {
7893
- Se.current = !1;
7901
+ Le.current = !1;
7894
7902
  }, 500);
7895
- } catch (nt) {
7896
- console.error("Error in onSpeechEnd callback:", nt), Se.current = !1;
7903
+ } catch (it) {
7904
+ console.error("Error in onSpeechEnd callback:", it), Le.current = !1;
7897
7905
  }
7898
7906
  }, 100));
7899
7907
  }, 200);
7900
7908
  }, 50);
7901
- P.current = J;
7909
+ P.current = ee;
7902
7910
  }
7903
7911
  try {
7904
- x.current.speakText(k, ke);
7912
+ x.current.speakText(k, Se);
7905
7913
  } catch (O) {
7906
7914
  console.error("Error speaking text:", O), Me(O.message || "Failed to speak text");
7907
7915
  }
7908
- }, [ae, f, Re, M, we]);
7909
- ze(() => {
7910
- if (!ae || !y || !x.current)
7916
+ }, [re, f, Pe, M, Fe]);
7917
+ ke(() => {
7918
+ if (!re || !y || !x.current)
7911
7919
  return;
7912
- oe.current && (clearInterval(oe.current), oe.current = null);
7920
+ ie.current && (clearInterval(ie.current), ie.current = null);
7913
7921
  const k = () => {
7914
- x.current && !D.current && !X.current && (Ae.current = [], be.current = [], we(y, !1, null));
7922
+ x.current && !D.current && !X.current && (be.current = [], xe.current = [], Fe(y, !1, null));
7915
7923
  };
7916
- return X.current || k(), oe.current = setInterval(() => {
7924
+ return X.current || k(), ie.current = setInterval(() => {
7917
7925
  X.current || k();
7918
7926
  }, 12e3 + Math.random() * 3e3), () => {
7919
- oe.current && (clearInterval(oe.current), oe.current = null);
7927
+ ie.current && (clearInterval(ie.current), ie.current = null);
7920
7928
  };
7921
- }, [ae, y, we, X]), ze(() => {
7922
- ae && Y && E && x.current && !X.current && !D.current && !Se.current && Ze(Y);
7923
- }, [ae, Y, E, Ze]);
7924
- const dt = W(() => {
7929
+ }, [re, y, Fe, X]), ke(() => {
7930
+ re && Y && E && x.current && !X.current && !D.current && !Le.current && Ze(Y);
7931
+ }, [re, Y, E, Ze]);
7932
+ const mt = W(() => {
7925
7933
  if (x.current)
7926
7934
  try {
7927
7935
  const k = x.current.isSpeaking || !1, z = [...x.current.audioPlaylist || []], F = [...x.current.speechQueue || []];
7928
7936
  if (k || z.length > 0 || F.length > 0) {
7929
7937
  P.current && (clearInterval(P.current), P.current = null);
7930
- const se = fe.current;
7938
+ const oe = ye.current;
7931
7939
  let Z = [];
7932
- const ke = x.current.isAudioPlaying || !1;
7933
- if (se.length > 0) {
7934
- const J = z.length + F.length, ye = ke ? 1 : 0, pe = se.length - J - ye, De = ke ? pe : pe + ye;
7935
- De < se.length && (Z = se.slice(De));
7940
+ const Se = x.current.isAudioPlaying || !1;
7941
+ if (oe.length > 0) {
7942
+ const ee = z.length + F.length, ge = Se ? 1 : 0, de = oe.length - ee - ge, Ue = Se ? de : de + ge;
7943
+ Ue < oe.length && (Z = oe.slice(Ue));
7936
7944
  } else
7937
- z.length > 0 && z.forEach((J) => {
7938
- if (J.text)
7939
- if (Array.isArray(J.text)) {
7940
- const ye = J.text.map((pe) => pe.word).join(" ");
7941
- ye.trim() && Z.push(ye);
7942
- } else J.text.trim() && Z.push(J.text);
7943
- }), F.length > 0 && F.forEach((J) => {
7944
- if (J.text)
7945
- if (Array.isArray(J.text)) {
7946
- const ye = J.text.map((pe) => pe.word).join(" ");
7947
- ye.trim() && Z.push(ye);
7948
- } else J.text.trim() && Z.push(J.text);
7945
+ z.length > 0 && z.forEach((ee) => {
7946
+ if (ee.text)
7947
+ if (Array.isArray(ee.text)) {
7948
+ const ge = ee.text.map((de) => de.word).join(" ");
7949
+ ge.trim() && Z.push(ge);
7950
+ } else ee.text.trim() && Z.push(ee.text);
7951
+ }), F.length > 0 && F.forEach((ee) => {
7952
+ if (ee.text)
7953
+ if (Array.isArray(ee.text)) {
7954
+ const ge = ee.text.map((de) => de.word).join(" ");
7955
+ ge.trim() && Z.push(ge);
7956
+ } else ee.text.trim() && Z.push(ee.text);
7949
7957
  });
7950
7958
  const O = Z.join(" ");
7951
- K.current = {
7959
+ $.current = {
7952
7960
  remainingText: O || null,
7953
7961
  originalText: G.current?.text || null,
7954
7962
  options: G.current?.options || null,
7955
7963
  // Track if we're pausing mid-sentence (has currently playing audio)
7956
7964
  isMidSentence: z.length > 0
7957
7965
  };
7958
- const $ = x.current.isAudioPlaying || !1 ? [...x.current.speechQueue || []] : null;
7966
+ const q = x.current.isAudioPlaying || !1 ? [...x.current.speechQueue || []] : null;
7959
7967
  x.current.speechQueue.length = 0;
7960
- const ie = x.current.pauseSpeaking();
7961
- x.current.isSpeaking = !1, X.current = !1, q.current = null, ie && ie.audio && $ ? (w.current = ie, w.current.savedSpeechQueue = $) : w.current = ie, N(!0), D.current = !0;
7968
+ const ne = x.current.pauseSpeaking();
7969
+ x.current.isSpeaking = !1, X.current = !1, _.current = null, ne && ne.audio && q ? (w.current = ne, w.current.savedSpeechQueue = q) : w.current = ne, N(!0), D.current = !0;
7962
7970
  }
7963
7971
  } catch (k) {
7964
7972
  console.warn("Error pausing speech:", k);
7965
7973
  }
7966
- }, []), mt = W(async () => {
7974
+ }, []), pt = W(async () => {
7967
7975
  if (!(!x.current || !v))
7968
7976
  try {
7969
- if (await Re(), N(!1), D.current = !1, w.current && w.current.audio) {
7977
+ if (await Pe(), N(!1), D.current = !1, w.current && w.current.audio) {
7970
7978
  X.current = !0;
7971
- const Z = K.current?.options || G.current?.options || {}, ke = Z.animationGroup || M;
7972
- if (ke && (q.current = ke), w.current.savedSpeechQueue && (x.current.speechQueue.length = 0, x.current.speechQueue.push(...w.current.savedSpeechQueue)), x.current.isSpeaking = !0, x.current) {
7979
+ const Z = $.current?.options || G.current?.options || {}, Se = Z.animationGroup || M;
7980
+ if (Se && (_.current = Se), w.current.savedSpeechQueue && (x.current.speechQueue.length = 0, x.current.speechQueue.push(...w.current.savedSpeechQueue)), x.current.isSpeaking = !0, x.current) {
7973
7981
  const O = x.current;
7974
- let ee = 0;
7975
- const $ = 1200, ie = { current: !1 };
7982
+ let te = 0;
7983
+ const q = 1200, ne = { current: !1 };
7976
7984
  P.current && (clearInterval(P.current), P.current = null);
7977
- const J = setInterval(() => {
7978
- if (ee++, D.current)
7985
+ const ee = setInterval(() => {
7986
+ if (te++, D.current)
7979
7987
  return;
7980
- if (ee > $) {
7981
- if (J && (clearInterval(J), P.current = null), !ie.current && !D.current) {
7982
- ie.current = !0, X.current = !1, q.current = null, Ae.current = [], be.current = [], x.current && (x.current.stopAnimation(), x.current.isSpeaking = !1);
7988
+ if (te > q) {
7989
+ if (ee && (clearInterval(ee), P.current = null), !ne.current && !D.current) {
7990
+ ne.current = !0, X.current = !1, _.current = null, be.current = [], xe.current = [], x.current && (x.current.stopAnimation(), x.current.isSpeaking = !1);
7983
7991
  try {
7984
7992
  Z.onSpeechEnd && Z.onSpeechEnd(), f();
7985
- } catch (ce) {
7986
- console.error("Error in onSpeechEnd callback (timeout):", ce);
7993
+ } catch (ue) {
7994
+ console.error("Error in onSpeechEnd callback (timeout):", ue);
7987
7995
  }
7988
7996
  }
7989
7997
  return;
7990
7998
  }
7991
- const ye = !O.speechQueue || O.speechQueue.length === 0, pe = !O.audioPlaylist || O.audioPlaylist.length === 0, De = O.isAudioPlaying === !1;
7992
- O && !D.current && ye && pe && De && O.isSpeaking === !1 && !ie.current && !D.current && setTimeout(() => {
7993
- const ce = x.current;
7994
- if (!ce) return;
7995
- !D.current && (!ce.speechQueue || ce.speechQueue.length === 0) && (!ce.audioPlaylist || ce.audioPlaylist.length === 0) && ce.isAudioPlaying === !1 && ce.isSpeaking === !1 && !ie.current && !D.current && (ie.current = !0, J && (clearInterval(J), P.current = null), X.current = !1, q.current = null, Ae.current = [], be.current = [], te.current = "", ce && (ce.stopAnimation(), ce.isSpeaking = !1), Se.current = !0, setTimeout(() => {
7996
- _.current && _.current();
7999
+ const ge = !O.speechQueue || O.speechQueue.length === 0, de = !O.audioPlaylist || O.audioPlaylist.length === 0, Ue = O.isAudioPlaying === !1;
8000
+ O && !D.current && ge && de && Ue && O.isSpeaking === !1 && !ne.current && !D.current && setTimeout(() => {
8001
+ const ue = x.current;
8002
+ if (!ue) return;
8003
+ !D.current && (!ue.speechQueue || ue.speechQueue.length === 0) && (!ue.audioPlaylist || ue.audioPlaylist.length === 0) && ue.isAudioPlaying === !1 && ue.isSpeaking === !1 && !ne.current && !D.current && (ne.current = !0, ee && (clearInterval(ee), P.current = null), X.current = !1, _.current = null, be.current = [], xe.current = [], ae.current = "", ue && (ue.stopAnimation(), ue.isSpeaking = !1), Le.current = !0, setTimeout(() => {
8004
+ K.current && K.current();
7997
8005
  }, 500), setTimeout(() => {
7998
8006
  try {
7999
8007
  Z.onSpeechEnd && Z.onSpeechEnd(), f(), setTimeout(() => {
8000
- Se.current = !1;
8008
+ Le.current = !1;
8001
8009
  }, 500);
8002
- } catch (nt) {
8003
- console.error("Error in onSpeechEnd callback:", nt), Se.current = !1;
8010
+ } catch (it) {
8011
+ console.error("Error in onSpeechEnd callback:", it), Le.current = !1;
8004
8012
  }
8005
8013
  }, 100));
8006
8014
  }, 200);
8007
8015
  }, 50);
8008
- P.current = J;
8016
+ P.current = ee;
8009
8017
  }
8010
- await x.current.playAudio(!1, w.current), ke && !Z.skipAnimation && (Ae.current = [], be.current = [], we(ke)), w.current = null;
8018
+ await x.current.playAudio(!1, w.current), Se && !Z.skipAnimation && (be.current = [], xe.current = [], Fe(Se)), w.current = null;
8011
8019
  return;
8012
8020
  }
8013
- const k = K.current?.remainingText, z = K.current?.originalText || G.current?.text, F = K.current?.options || G.current?.options || {}, se = k || z;
8014
- se && Ze(se, F), w.current = null;
8021
+ const k = $.current?.remainingText, z = $.current?.originalText || G.current?.text, F = $.current?.options || G.current?.options || {}, oe = k || z;
8022
+ oe && Ze(oe, F), w.current = null;
8015
8023
  } catch (k) {
8016
8024
  console.warn("Error resuming speech:", k), N(!1), D.current = !1, w.current = null;
8017
8025
  }
8018
- }, [v, Ze, Re, M, we]), pt = W(() => {
8026
+ }, [v, Ze, Pe, M, Fe]), gt = W(() => {
8019
8027
  if (x.current) {
8020
- x.current.stopAnimation(), x.current.stopSpeaking(), P.current && (clearInterval(P.current), P.current = null), X.current = !1, q.current = null, Ae.current = [], be.current = [], te.current = "", N(!1), D.current = !1, w.current = null, Se.current = !1, setTimeout(() => {
8021
- _.current && _.current();
8028
+ x.current.stopAnimation(), x.current.stopSpeaking(), P.current && (clearInterval(P.current), P.current = null), X.current = !1, _.current = null, be.current = [], xe.current = [], ae.current = "", N(!1), D.current = !1, w.current = null, Le.current = !1, setTimeout(() => {
8029
+ K.current && K.current();
8022
8030
  }, 500);
8023
8031
  try {
8024
8032
  f();
@@ -8027,14 +8035,14 @@ const Vt = Ke(({
8027
8035
  }
8028
8036
  }
8029
8037
  }, [f]);
8030
- return $e(S, () => ({
8038
+ return Je(S, () => ({
8031
8039
  speakText: Ze,
8032
- pauseSpeaking: dt,
8033
- resumeSpeaking: mt,
8034
- stopSpeaking: pt,
8035
- resumeAudioContext: Re,
8040
+ pauseSpeaking: mt,
8041
+ resumeSpeaking: pt,
8042
+ stopSpeaking: gt,
8043
+ resumeAudioContext: Pe,
8036
8044
  isPaused: () => v,
8037
- getCurrentSubtitle: () => te.current,
8045
+ getCurrentSubtitle: () => ae.current,
8038
8046
  // Get current subtitle text
8039
8047
  setMood: (k) => x.current?.setMood(k),
8040
8048
  setBodyMovement: (k) => {
@@ -8043,16 +8051,16 @@ const Vt = Ke(({
8043
8051
  playAnimation: (k, z = !1) => {
8044
8052
  x.current && x.current.playAnimation && x.current.playAnimation(k, null, 10, 0, 0.01, z);
8045
8053
  },
8046
- playRandomAnimation: (k, z = !1) => we(k, z),
8054
+ playRandomAnimation: (k, z = !1) => Fe(k, z),
8047
8055
  getRandomAnimation: (k) => getRandomAnimation(k),
8048
8056
  playReaction: (k) => x.current?.playReaction(k),
8049
8057
  playCelebration: () => x.current?.playCelebration(),
8050
8058
  setShowFullAvatar: (k) => {
8051
8059
  x.current && (I.current = k, x.current.setShowFullAvatar(k));
8052
8060
  },
8053
- isReady: ae,
8061
+ isReady: re,
8054
8062
  talkingHead: x.current
8055
- })), /* @__PURE__ */ Ee("div", { className: `simple-talking-avatar-container ${Q}`, style: g, children: [
8063
+ })), /* @__PURE__ */ Be("div", { className: `simple-talking-avatar-container ${Q}`, style: g, children: [
8056
8064
  /* @__PURE__ */ le(
8057
8065
  "div",
8058
8066
  {
@@ -8065,7 +8073,7 @@ const Vt = Ke(({
8065
8073
  }
8066
8074
  }
8067
8075
  ),
8068
- xe && /* @__PURE__ */ le("div", { className: "loading-overlay", style: {
8076
+ fe && /* @__PURE__ */ le("div", { className: "loading-overlay", style: {
8069
8077
  position: "absolute",
8070
8078
  top: "50%",
8071
8079
  left: "50%",
@@ -8074,7 +8082,7 @@ const Vt = Ke(({
8074
8082
  fontSize: "18px",
8075
8083
  zIndex: 10
8076
8084
  }, children: "Loading avatar..." }),
8077
- Le && /* @__PURE__ */ le("div", { className: "error-overlay", style: {
8085
+ Ie && /* @__PURE__ */ le("div", { className: "error-overlay", style: {
8078
8086
  position: "absolute",
8079
8087
  top: "50%",
8080
8088
  left: "50%",
@@ -8085,11 +8093,11 @@ const Vt = Ke(({
8085
8093
  zIndex: 10,
8086
8094
  padding: "20px",
8087
8095
  borderRadius: "8px"
8088
- }, children: Le })
8096
+ }, children: Ie })
8089
8097
  ] });
8090
8098
  });
8091
- Vt.displayName = "SimpleTalkingAvatar";
8092
- const Xt = Ke(({
8099
+ Xt.displayName = "SimpleTalkingAvatar";
8100
+ const Gt = $e(({
8093
8101
  curriculumData: Y = null,
8094
8102
  avatarConfig: n = {},
8095
8103
  animations: e = {},
@@ -8140,7 +8148,7 @@ const Xt = Ke(({
8140
8148
  animations: e,
8141
8149
  lipsyncLang: "en"
8142
8150
  });
8143
- ze(() => {
8151
+ ke(() => {
8144
8152
  h.current = {
8145
8153
  onLessonStart: t,
8146
8154
  onLessonComplete: o,
@@ -8148,7 +8156,7 @@ const Xt = Ke(({
8148
8156
  onCurriculumComplete: i,
8149
8157
  onCustomAction: a
8150
8158
  };
8151
- }, [t, o, s, i, a]), ze(() => {
8159
+ }, [t, o, s, i, a]), ke(() => {
8152
8160
  H.current = Y?.curriculum || {
8153
8161
  title: "Default Curriculum",
8154
8162
  description: "No curriculum data provided",
@@ -8193,9 +8201,9 @@ const Xt = Ke(({
8193
8201
  } catch {
8194
8202
  c.current.playCelebration();
8195
8203
  }
8196
- const N = H.current || { modules: [] }, B = N.modules[r.current.currentModuleIndex], j = r.current.currentLessonIndex < (B?.lessons?.length || 0) - 1, oe = r.current.currentModuleIndex < (N.modules?.length || 0) - 1, X = j || oe, q = M.current || { lipsyncLang: "en" };
8204
+ const N = H.current || { modules: [] }, B = N.modules[r.current.currentModuleIndex], j = r.current.currentLessonIndex < (B?.lessons?.length || 0) - 1, ie = r.current.currentModuleIndex < (N.modules?.length || 0) - 1, X = j || ie, _ = M.current || { lipsyncLang: "en" };
8197
8205
  c.current.speakText(v, {
8198
- lipsyncLang: q.lipsyncLang,
8206
+ lipsyncLang: _.lipsyncLang,
8199
8207
  onSpeechEnd: () => {
8200
8208
  h.current.onCustomAction({
8201
8209
  type: "lessonCompleteFeedbackDone",
@@ -8281,28 +8289,28 @@ const Xt = Ke(({
8281
8289
  if (c.current.setMood("happy"), c.current.setBodyMovement("idle"), e.nextQuestion)
8282
8290
  try {
8283
8291
  c.current.playAnimation(e.nextQuestion, !0);
8284
- } catch (q) {
8285
- console.warn("Failed to play nextQuestion animation:", q);
8292
+ } catch (_) {
8293
+ console.warn("Failed to play nextQuestion animation:", _);
8286
8294
  }
8287
- const B = M.current || { lipsyncLang: "en" }, oe = y()?.questions?.length || 0, X = r.current.currentQuestionIndex >= oe - 1;
8295
+ const B = M.current || { lipsyncLang: "en" }, ie = y()?.questions?.length || 0, X = r.current.currentQuestionIndex >= ie - 1;
8288
8296
  if (v.type === "code_test") {
8289
- const q = X ? `Great! Here's your final coding challenge: ${v.question}` : `Great! Now let's move on to your next coding challenge: ${v.question}`;
8290
- c.current.speakText(q, {
8297
+ const _ = X ? `Great! Here's your final coding challenge: ${v.question}` : `Great! Now let's move on to your next coding challenge: ${v.question}`;
8298
+ c.current.speakText(_, {
8291
8299
  lipsyncLang: B.lipsyncLang
8292
8300
  });
8293
8301
  } else if (v.type === "multiple_choice") {
8294
- const q = X ? `Alright! Here's your final question: ${v.question}` : `Alright! Here's your next question: ${v.question}`;
8295
- c.current.speakText(q, {
8302
+ const _ = X ? `Alright! Here's your final question: ${v.question}` : `Alright! Here's your next question: ${v.question}`;
8303
+ c.current.speakText(_, {
8296
8304
  lipsyncLang: B.lipsyncLang
8297
8305
  });
8298
8306
  } else if (v.type === "true_false") {
8299
- const q = X ? `Now let's try this final one: ${v.question}` : `Now let's try this one: ${v.question}`;
8300
- c.current.speakText(q, {
8307
+ const _ = X ? `Now let's try this final one: ${v.question}` : `Now let's try this one: ${v.question}`;
8308
+ c.current.speakText(_, {
8301
8309
  lipsyncLang: B.lipsyncLang
8302
8310
  });
8303
8311
  } else {
8304
- const q = X ? `Here's your final question: ${v.question}` : `Here's the next question: ${v.question}`;
8305
- c.current.speakText(q, {
8312
+ const _ = X ? `Here's your final question: ${v.question}` : `Here's the next question: ${v.question}`;
8313
+ c.current.speakText(_, {
8306
8314
  lipsyncLang: B.lipsyncLang
8307
8315
  });
8308
8316
  }
@@ -8329,7 +8337,7 @@ const Xt = Ke(({
8329
8337
  const R = H.current || { modules: [] }, v = R.modules[r.current.currentModuleIndex];
8330
8338
  if (r.current.currentLessonIndex < (v?.lessons?.length || 0) - 1) {
8331
8339
  r.current.currentLessonIndex += 1, r.current.currentQuestionIndex = 0, r.current.lessonCompleted = !1, r.current.isQuestionMode = !1, r.current.isTeaching = !1, r.current.score = 0, r.current.totalQuestions = 0;
8332
- const B = R.modules[r.current.currentModuleIndex], j = r.current.currentLessonIndex < (B?.lessons?.length || 0) - 1, oe = r.current.currentModuleIndex < (R.modules?.length || 0) - 1, X = j || oe;
8340
+ const B = R.modules[r.current.currentModuleIndex], j = r.current.currentLessonIndex < (B?.lessons?.length || 0) - 1, ie = r.current.currentModuleIndex < (R.modules?.length || 0) - 1, X = j || ie;
8333
8341
  h.current.onCustomAction({
8334
8342
  type: "lessonStart",
8335
8343
  moduleIndex: r.current.currentModuleIndex,
@@ -8342,12 +8350,12 @@ const Xt = Ke(({
8342
8350
  }), c.current && (c.current.setMood("happy"), c.current.setBodyMovement("idle"));
8343
8351
  } else if (r.current.currentModuleIndex < (R.modules?.length || 0) - 1) {
8344
8352
  r.current.currentModuleIndex += 1, r.current.currentLessonIndex = 0, r.current.currentQuestionIndex = 0, r.current.lessonCompleted = !1, r.current.isQuestionMode = !1, r.current.isTeaching = !1, r.current.score = 0, r.current.totalQuestions = 0;
8345
- const j = R.modules[r.current.currentModuleIndex], oe = r.current.currentLessonIndex < (j?.lessons?.length || 0) - 1, X = r.current.currentModuleIndex < (R.modules?.length || 0) - 1, q = oe || X;
8353
+ const j = R.modules[r.current.currentModuleIndex], ie = r.current.currentLessonIndex < (j?.lessons?.length || 0) - 1, X = r.current.currentModuleIndex < (R.modules?.length || 0) - 1, _ = ie || X;
8346
8354
  h.current.onCustomAction({
8347
8355
  type: "lessonStart",
8348
8356
  moduleIndex: r.current.currentModuleIndex,
8349
8357
  lessonIndex: r.current.currentLessonIndex,
8350
- hasNextLesson: q
8358
+ hasNextLesson: _
8351
8359
  }), h.current.onLessonStart({
8352
8360
  moduleIndex: r.current.currentModuleIndex,
8353
8361
  lessonIndex: r.current.currentLessonIndex,
@@ -8402,7 +8410,7 @@ const Xt = Ke(({
8402
8410
  }
8403
8411
  });
8404
8412
  }
8405
- }, [e.teaching, y]), K = W((R) => {
8413
+ }, [e.teaching, y]), $ = W((R) => {
8406
8414
  const v = E(), N = S(R, v);
8407
8415
  if (N && (r.current.score += 1), h.current.onQuestionAnswer({
8408
8416
  moduleIndex: r.current.currentModuleIndex,
@@ -8422,11 +8430,11 @@ const Xt = Ke(({
8422
8430
  c.current.setBodyMovement("gesturing");
8423
8431
  const j = y()?.questions?.length || 0;
8424
8432
  r.current.currentQuestionIndex >= j - 1;
8425
- const oe = r.current.currentQuestionIndex < j - 1;
8426
- console.log("[CurriculumLearning] Answer feedback - questionIndex:", r.current.currentQuestionIndex, "totalQuestions:", j, "hasNextQuestion:", oe);
8427
- const X = v.type === "code_test" ? `Great job! Your code passed all the tests! ${v.explanation || ""}` : `Excellent! That's correct! ${v.explanation || ""}`, q = M.current || { lipsyncLang: "en" };
8433
+ const ie = r.current.currentQuestionIndex < j - 1;
8434
+ console.log("[CurriculumLearning] Answer feedback - questionIndex:", r.current.currentQuestionIndex, "totalQuestions:", j, "hasNextQuestion:", ie);
8435
+ const X = v.type === "code_test" ? `Great job! Your code passed all the tests! ${v.explanation || ""}` : `Excellent! That's correct! ${v.explanation || ""}`, _ = M.current || { lipsyncLang: "en" };
8428
8436
  c.current.speakText(X, {
8429
- lipsyncLang: q.lipsyncLang,
8437
+ lipsyncLang: _.lipsyncLang,
8430
8438
  onSpeechEnd: () => {
8431
8439
  h.current.onCustomAction({
8432
8440
  type: "answerFeedbackComplete",
@@ -8434,7 +8442,7 @@ const Xt = Ke(({
8434
8442
  lessonIndex: r.current.currentLessonIndex,
8435
8443
  questionIndex: r.current.currentQuestionIndex,
8436
8444
  isCorrect: !0,
8437
- hasNextQuestion: oe,
8445
+ hasNextQuestion: ie,
8438
8446
  score: r.current.score,
8439
8447
  totalQuestions: r.current.totalQuestions
8440
8448
  });
@@ -8448,11 +8456,11 @@ const Xt = Ke(({
8448
8456
  c.current.setBodyMovement("idle");
8449
8457
  }
8450
8458
  c.current.setBodyMovement("gesturing");
8451
- const j = y()?.questions?.length || 0, oe = r.current.currentQuestionIndex >= j - 1, X = r.current.currentQuestionIndex < j - 1;
8459
+ const j = y()?.questions?.length || 0, ie = r.current.currentQuestionIndex >= j - 1, X = r.current.currentQuestionIndex < j - 1;
8452
8460
  console.log("[CurriculumLearning] Answer feedback (incorrect) - questionIndex:", r.current.currentQuestionIndex, "totalQuestions:", j, "hasNextQuestion:", X);
8453
- const q = v.type === "code_test" ? `Your code didn't pass all the tests. ${v.explanation || "Try again!"}` : `Not quite right, but don't worry! ${v.explanation || ""}${oe ? "" : " Let's move on to the next question."}`, Se = M.current || { lipsyncLang: "en" };
8454
- c.current.speakText(q, {
8455
- lipsyncLang: Se.lipsyncLang,
8461
+ const _ = v.type === "code_test" ? `Your code didn't pass all the tests. ${v.explanation || "Try again!"}` : `Not quite right, but don't worry! ${v.explanation || ""}${ie ? "" : " Let's move on to the next question."}`, Le = M.current || { lipsyncLang: "en" };
8462
+ c.current.speakText(_, {
8463
+ lipsyncLang: Le.lipsyncLang,
8456
8464
  onSpeechEnd: () => {
8457
8465
  h.current.onCustomAction({
8458
8466
  type: "answerFeedbackComplete",
@@ -8481,7 +8489,7 @@ const Xt = Ke(({
8481
8489
  avatarNotReady: !0
8482
8490
  });
8483
8491
  }
8484
- }, [e.correct, e.incorrect, E, y, S]), fe = W((R) => {
8492
+ }, [e.correct, e.incorrect, E, y, S]), ye = W((R) => {
8485
8493
  const v = E();
8486
8494
  if (!R || typeof R != "object") {
8487
8495
  console.error("Invalid code test result format. Expected object with {passed: boolean, ...}");
@@ -8509,7 +8517,7 @@ const Xt = Ke(({
8509
8517
  testResult: N,
8510
8518
  question: v
8511
8519
  }), g.current && g.current(N);
8512
- }, [E, S]), xe = W(() => {
8520
+ }, [E, S]), fe = W(() => {
8513
8521
  if (r.current.currentQuestionIndex > 0) {
8514
8522
  r.current.currentQuestionIndex -= 1;
8515
8523
  const R = E();
@@ -8567,7 +8575,7 @@ const Xt = Ke(({
8567
8575
  lesson: y()
8568
8576
  }), c.current && (c.current.setMood("happy"), c.current.setBodyMovement("idle"));
8569
8577
  }
8570
- }, [y]), Le = W(() => {
8578
+ }, [y]), Ie = W(() => {
8571
8579
  r.current.currentModuleIndex = 0, r.current.currentLessonIndex = 0, r.current.currentQuestionIndex = 0, r.current.isTeaching = !1, r.current.isQuestionMode = !1, r.current.lessonCompleted = !1, r.current.curriculumCompleted = !1, r.current.score = 0, r.current.totalQuestions = 0;
8572
8580
  }, []), Me = W((R) => {
8573
8581
  console.log("Avatar is ready!", R);
@@ -8576,21 +8584,21 @@ const Xt = Ke(({
8576
8584
  d.current && d.current();
8577
8585
  }, 10);
8578
8586
  }, [u, y]);
8579
- ft(() => {
8580
- d.current = D, p.current = P, b.current = C, f.current = G, L.current = x, Q.current = I, g.current = K;
8581
- }), $e(l, () => ({
8587
+ xt(() => {
8588
+ d.current = D, p.current = P, b.current = C, f.current = G, L.current = x, Q.current = I, g.current = $;
8589
+ }), Je(l, () => ({
8582
8590
  // Curriculum control methods
8583
8591
  startTeaching: D,
8584
8592
  startQuestions: I,
8585
- handleAnswerSelect: K,
8586
- handleCodeTestResult: fe,
8593
+ handleAnswerSelect: $,
8594
+ handleCodeTestResult: ye,
8587
8595
  nextQuestion: G,
8588
- previousQuestion: xe,
8596
+ previousQuestion: fe,
8589
8597
  nextLesson: P,
8590
8598
  previousLesson: Te,
8591
8599
  completeLesson: C,
8592
8600
  completeCurriculum: x,
8593
- resetCurriculum: Le,
8601
+ resetCurriculum: Ie,
8594
8602
  getState: () => ({ ...r.current }),
8595
8603
  getCurrentQuestion: () => E(),
8596
8604
  getCurrentLesson: () => y(),
@@ -8644,8 +8652,8 @@ const Xt = Ke(({
8644
8652
  handleResize: () => c.current?.handleResize(),
8645
8653
  // Avatar readiness check (always returns current value)
8646
8654
  isAvatarReady: () => c.current?.isReady || !1
8647
- }), [D, I, K, fe, G, P, C, x, Le, E, y]);
8648
- const ae = M.current || {
8655
+ }), [D, I, $, ye, G, P, C, x, Ie, E, y]);
8656
+ const re = M.current || {
8649
8657
  avatarUrl: "/avatars/brunette.glb",
8650
8658
  avatarBody: "F",
8651
8659
  mood: "happy",
@@ -8659,21 +8667,21 @@ const Xt = Ke(({
8659
8667
  animations: e
8660
8668
  };
8661
8669
  return /* @__PURE__ */ le("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ le(
8662
- ct,
8670
+ ut,
8663
8671
  {
8664
8672
  ref: c,
8665
- avatarUrl: ae.avatarUrl,
8666
- avatarBody: ae.avatarBody,
8667
- mood: ae.mood,
8668
- ttsLang: ae.ttsLang,
8669
- ttsService: ae.ttsService,
8670
- ttsVoice: ae.ttsVoice,
8671
- ttsApiKey: ae.ttsApiKey,
8672
- bodyMovement: ae.bodyMovement,
8673
- movementIntensity: ae.movementIntensity,
8674
- showFullAvatar: ae.showFullAvatar,
8673
+ avatarUrl: re.avatarUrl,
8674
+ avatarBody: re.avatarBody,
8675
+ mood: re.mood,
8676
+ ttsLang: re.ttsLang,
8677
+ ttsService: re.ttsService,
8678
+ ttsVoice: re.ttsVoice,
8679
+ ttsApiKey: re.ttsApiKey,
8680
+ bodyMovement: re.bodyMovement,
8681
+ movementIntensity: re.movementIntensity,
8682
+ showFullAvatar: re.showFullAvatar,
8675
8683
  cameraView: "upper",
8676
- animations: ae.animations,
8684
+ animations: re.animations,
8677
8685
  onReady: Me,
8678
8686
  onLoading: () => {
8679
8687
  },
@@ -8683,8 +8691,8 @@ const Xt = Ke(({
8683
8691
  }
8684
8692
  ) });
8685
8693
  });
8686
- Xt.displayName = "CurriculumLearning";
8687
- function Jt({
8694
+ Gt.displayName = "CurriculumLearning";
8695
+ function en({
8688
8696
  manifestPath: Y = "/animations/manifest.json",
8689
8697
  avatarBody: n = "F",
8690
8698
  onAnimationPlay: e = null,
@@ -8692,41 +8700,41 @@ function Jt({
8692
8700
  onDeleteAnimations: o = null,
8693
8701
  style: s = {}
8694
8702
  }) {
8695
- const [i, a] = ge([]), [u, l] = ge(/* @__PURE__ */ new Set()), [c, r] = ge(!0), [h, d] = ge(null), [p, b] = ge("all"), [f, L] = ge("");
8696
- ze(() => {
8703
+ const [i, a] = pe([]), [u, l] = pe(/* @__PURE__ */ new Set()), [c, r] = pe(!0), [h, d] = pe(null), [p, b] = pe("all"), [f, L] = pe("");
8704
+ ke(() => {
8697
8705
  (async () => {
8698
8706
  r(!0), d(null);
8699
8707
  try {
8700
8708
  const x = await je(Y), I = [];
8701
8709
  if (x._genderSpecific) {
8702
8710
  const P = (n?.toUpperCase() || "F") === "M" ? "male" : "female";
8703
- x._genderSpecific[P] && Object.entries(x._genderSpecific[P]).forEach(([D, K]) => {
8704
- (Array.isArray(K) ? K : [K]).forEach((xe) => {
8711
+ x._genderSpecific[P] && Object.entries(x._genderSpecific[P]).forEach(([D, $]) => {
8712
+ (Array.isArray($) ? $ : [$]).forEach((fe) => {
8705
8713
  I.push({
8706
- path: xe,
8714
+ path: fe,
8707
8715
  group: D,
8708
8716
  gender: P,
8709
- name: xe.split("/").pop().replace(".fbx", "")
8717
+ name: fe.split("/").pop().replace(".fbx", "")
8710
8718
  });
8711
8719
  });
8712
- }), x._genderSpecific.shared && Object.entries(x._genderSpecific.shared).forEach(([D, K]) => {
8713
- (Array.isArray(K) ? K : [K]).forEach((xe) => {
8720
+ }), x._genderSpecific.shared && Object.entries(x._genderSpecific.shared).forEach(([D, $]) => {
8721
+ (Array.isArray($) ? $ : [$]).forEach((fe) => {
8714
8722
  I.push({
8715
- path: xe,
8723
+ path: fe,
8716
8724
  group: D,
8717
8725
  gender: "shared",
8718
- name: xe.split("/").pop().replace(".fbx", "")
8726
+ name: fe.split("/").pop().replace(".fbx", "")
8719
8727
  });
8720
8728
  });
8721
8729
  });
8722
8730
  }
8723
8731
  Object.entries(x).forEach(([G, P]) => {
8724
- G !== "_genderSpecific" && (Array.isArray(P) ? P : [P]).forEach((K) => {
8725
- typeof K == "string" && I.push({
8726
- path: K,
8732
+ G !== "_genderSpecific" && (Array.isArray(P) ? P : [P]).forEach(($) => {
8733
+ typeof $ == "string" && I.push({
8734
+ path: $,
8727
8735
  group: G,
8728
8736
  gender: "root",
8729
- name: K.split("/").pop().replace(".fbx", "")
8737
+ name: $.split("/").pop().replace(".fbx", "")
8730
8738
  });
8731
8739
  });
8732
8740
  }), a(I), r(!1);
@@ -8766,10 +8774,10 @@ ${x.slice(0, 5).join(`
8766
8774
  }, S = (C) => {
8767
8775
  e && e(C);
8768
8776
  };
8769
- return c ? /* @__PURE__ */ le("div", { style: { padding: "20px", textAlign: "center", ...s }, children: /* @__PURE__ */ le("p", { children: "Loading animations..." }) }) : h ? /* @__PURE__ */ le("div", { style: { padding: "20px", color: "red", ...s }, children: /* @__PURE__ */ Ee("p", { children: [
8777
+ return c ? /* @__PURE__ */ le("div", { style: { padding: "20px", textAlign: "center", ...s }, children: /* @__PURE__ */ le("p", { children: "Loading animations..." }) }) : h ? /* @__PURE__ */ le("div", { style: { padding: "20px", color: "red", ...s }, children: /* @__PURE__ */ Be("p", { children: [
8770
8778
  "Error loading animations: ",
8771
8779
  h
8772
- ] }) }) : /* @__PURE__ */ Ee("div", { style: {
8780
+ ] }) }) : /* @__PURE__ */ Be("div", { style: {
8773
8781
  padding: "20px",
8774
8782
  backgroundColor: "#2a2a2a",
8775
8783
  borderRadius: "8px",
@@ -8778,7 +8786,7 @@ ${x.slice(0, 5).join(`
8778
8786
  }, children: [
8779
8787
  /* @__PURE__ */ le("h2", { style: { marginTop: 0 }, children: "Animation Selector" }),
8780
8788
  /* @__PURE__ */ le("p", { style: { color: "#aaa", fontSize: "14px" }, children: "Click buttons to play animations. Select animations to keep, then delete will remove the rest." }),
8781
- /* @__PURE__ */ Ee("div", { style: {
8789
+ /* @__PURE__ */ Be("div", { style: {
8782
8790
  display: "flex",
8783
8791
  gap: "10px",
8784
8792
  marginBottom: "20px",
@@ -8852,7 +8860,7 @@ ${x.slice(0, 5).join(`
8852
8860
  children: "Deselect All Visible"
8853
8861
  }
8854
8862
  ),
8855
- /* @__PURE__ */ Ee(
8863
+ /* @__PURE__ */ Be(
8856
8864
  "button",
8857
8865
  {
8858
8866
  onClick: E,
@@ -8874,7 +8882,7 @@ ${x.slice(0, 5).join(`
8874
8882
  }
8875
8883
  )
8876
8884
  ] }),
8877
- /* @__PURE__ */ Ee("div", { style: {
8885
+ /* @__PURE__ */ Be("div", { style: {
8878
8886
  marginBottom: "15px",
8879
8887
  fontSize: "14px",
8880
8888
  color: "#aaa"
@@ -8897,7 +8905,7 @@ ${x.slice(0, 5).join(`
8897
8905
  borderRadius: "6px"
8898
8906
  }, children: g.map((C, x) => {
8899
8907
  const I = u.has(C.path);
8900
- return /* @__PURE__ */ Ee(
8908
+ return /* @__PURE__ */ Be(
8901
8909
  "div",
8902
8910
  {
8903
8911
  style: {
@@ -8910,7 +8918,7 @@ ${x.slice(0, 5).join(`
8910
8918
  },
8911
8919
  onClick: () => H(C.path),
8912
8920
  children: [
8913
- /* @__PURE__ */ Ee("div", { style: { marginBottom: "8px" }, children: [
8921
+ /* @__PURE__ */ Be("div", { style: { marginBottom: "8px" }, children: [
8914
8922
  /* @__PURE__ */ le(
8915
8923
  "input",
8916
8924
  {
@@ -8924,7 +8932,7 @@ ${x.slice(0, 5).join(`
8924
8932
  }
8925
8933
  }
8926
8934
  ),
8927
- /* @__PURE__ */ Ee("span", { style: { fontSize: "12px", color: "#aaa" }, children: [
8935
+ /* @__PURE__ */ Be("span", { style: { fontSize: "12px", color: "#aaa" }, children: [
8928
8936
  C.group,
8929
8937
  " ",
8930
8938
  C.gender !== "root" && `(${C.gender})`
@@ -8967,7 +8975,7 @@ ${x.slice(0, 5).join(`
8967
8975
  }, children: "No animations found matching your filters." })
8968
8976
  ] });
8969
8977
  }
8970
- const ut = {
8978
+ const ht = {
8971
8979
  // Code-based dance animations (no FBX required)
8972
8980
  dance: {
8973
8981
  name: "dance",
@@ -9070,16 +9078,16 @@ const ut = {
9070
9078
  duration: 5e3,
9071
9079
  description: "Excited, energetic movement"
9072
9080
  }
9073
- }, en = (Y) => ut[Y] || null, tn = (Y) => ut.hasOwnProperty(Y);
9081
+ }, tn = (Y) => ht[Y] || null, nn = (Y) => ht.hasOwnProperty(Y);
9074
9082
  export {
9075
- Jt as AnimationSelector,
9076
- Xt as CurriculumLearning,
9077
- Vt as SimpleTalkingAvatar,
9078
- ct as TalkingHeadAvatar,
9079
- Ut as TalkingHeadComponent,
9080
- ut as animations,
9081
- Je as getActiveTTSConfig,
9082
- en as getAnimation,
9083
- $t as getVoiceOptions,
9084
- tn as hasAnimation
9083
+ en as AnimationSelector,
9084
+ Gt as CurriculumLearning,
9085
+ Xt as SimpleTalkingAvatar,
9086
+ ut as TalkingHeadAvatar,
9087
+ Wt as TalkingHeadComponent,
9088
+ ht as animations,
9089
+ et as getActiveTTSConfig,
9090
+ tn as getAnimation,
9091
+ Jt as getVoiceOptions,
9092
+ nn as hasAnimation
9085
9093
  };