@sage-rsc/talking-head-react 1.0.66 → 1.0.67

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 de } from "react/jsx-runtime";
2
- import { forwardRef as Le, useRef as Z, useState as ge, useEffect as ye, useCallback as E, useImperativeHandle as Ae, useLayoutEffect as We } from "react";
1
+ import { jsxs as De, jsx as ge } from "react/jsx-runtime";
2
+ import { forwardRef as ze, useRef as N, useState as be, useEffect as ve, useCallback as M, useImperativeHandle as Ce, useLayoutEffect as Xe } from "react";
3
3
  import * as f from "three";
4
- import { OrbitControls as Ve } from "three/addons/controls/OrbitControls.js";
5
- import { GLTFLoader as Ge } from "three/addons/loaders/GLTFLoader.js";
6
- import { DRACOLoader as Ze } from "three/addons/loaders/DRACOLoader.js";
7
- import { FBXLoader as ze } from "three/addons/loaders/FBXLoader.js";
8
- import { RoomEnvironment as Xe } from "three/addons/environments/RoomEnvironment.js";
9
- import Ye from "three/addons/libs/stats.module.js";
10
- let m, $, ne;
11
- const A = [0, 0, 0, 0], k = new f.Vector3(), be = new f.Vector3(), _ = new f.Vector3(), ve = new f.Vector3();
4
+ import { OrbitControls as Ye } from "three/addons/controls/OrbitControls.js";
5
+ import { GLTFLoader as je } from "three/addons/loaders/GLTFLoader.js";
6
+ import { DRACOLoader as Qe } from "three/addons/loaders/DRACOLoader.js";
7
+ import { FBXLoader as Me } from "three/addons/loaders/FBXLoader.js";
8
+ import { RoomEnvironment as qe } from "three/addons/environments/RoomEnvironment.js";
9
+ import _e from "three/addons/libs/stats.module.js";
10
+ let m, ee, ne;
11
+ const A = [0, 0, 0, 0], k = new f.Vector3(), Ae = new f.Vector3(), _ = new f.Vector3(), Se = new f.Vector3();
12
12
  new f.Plane();
13
13
  new f.Ray();
14
14
  new f.Euler();
15
- const K = new f.Quaternion(), Ce = new f.Quaternion(), re = new f.Matrix4(), le = new f.Matrix4();
15
+ const K = new f.Quaternion(), Ee = new f.Quaternion(), le = new f.Matrix4(), he = new f.Matrix4();
16
16
  new f.Vector3();
17
- const Re = new f.Vector3(0, 0, 1), je = new f.Vector3(1, 0, 0), Qe = new f.Vector3(0, 1, 0), qe = new f.Vector3(0, 0, 1);
18
- class _e {
17
+ const ke = new f.Vector3(0, 0, 1), Ke = new f.Vector3(1, 0, 0), Je = new f.Vector3(0, 1, 0), $e = new f.Vector3(0, 0, 1);
18
+ class et {
19
19
  constructor(t = null) {
20
20
  this.opt = Object.assign({
21
21
  warmupMs: 2e3,
@@ -338,7 +338,7 @@ class _e {
338
338
  ea: [0, 0, 0, 0]
339
339
  // External acceleration [m/s^2]
340
340
  };
341
- h.boneParent.matrixWorld.decompose(k, K, _), k.copy(Re).applyQuaternion(K).setY(0).normalize(), K.premultiply(Ce.setFromUnitVectors(Re, k).invert()).normalize(), h.qWorldInverseYaw = K.clone().normalize(), this.data.push(h), this.dict[u] = h;
341
+ h.boneParent.matrixWorld.decompose(k, K, _), k.copy(ke).applyQuaternion(K).setY(0).normalize(), K.premultiply(Ee.setFromUnitVectors(ke, k).invert()).normalize(), h.qWorldInverseYaw = K.clone().normalize(), this.data.push(h), this.dict[u] = h;
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 _e {
356
356
  for (this.timerMs += t, t > 1e3 && (this.timerMs = 0), t /= 1e3, e = 0, i = this.objectsUpdate.length; e < i; e++)
357
357
  o = this.objectsUpdate[e], o.updateMatrix(), o.parent === null ? o.matrixWorld.copy(o.matrix) : o.matrixWorld.multiplyMatrices(o.parent.matrixWorld, o.matrix), o.matrixWorldNeedsUpdate = !1;
358
358
  for (e = 0, i = this.data.length; e < i; e++) {
359
- if (o = this.data[e], k.copy(o.vWorld), re.copy(o.boneParent.matrixWorld), le.copy(re).invert(), o.vWorld.setFromMatrixPosition(re), k.applyMatrix4(le), k.length() > 0.5 && (console.info("Info: Unrealistic jump of " + k.length().toFixed(2) + " meters."), k.setLength(0.5)), k.applyQuaternion(o.bone.quaternion), A[0] = k.x, A[1] = k.y, A[2] = -k.z, A[3] = k.length() / 3, o.children)
359
+ if (o = this.data[e], k.copy(o.vWorld), le.copy(o.boneParent.matrixWorld), he.copy(le).invert(), o.vWorld.setFromMatrixPosition(le), k.applyMatrix4(he), k.length() > 0.5 && (console.info("Info: Unrealistic jump of " + k.length().toFixed(2) + " meters."), k.setLength(0.5)), k.applyQuaternion(o.bone.quaternion), A[0] = k.x, A[1] = k.y, A[2] = -k.z, A[3] = k.length() / 3, o.children)
360
360
  for (n = 0, s = o.children.length; n < s; n++)
361
361
  m = o.children[n], A[0] -= m.v[0] * t / 3, A[1] -= m.v[1] * t / 3, A[2] += m.v[2] * t / 3, A[3] -= m.v[3] * t / 3;
362
362
  if (m = this.opt.sensitivityFactor, A[0] *= o.ext * m, A[1] *= o.ext * m, A[2] *= o.ext * m, A[3] *= o.ext * m, o.isX && (m = A[0] / t, o.ea[0] = (m - o.ev[0]) / t, o.ev[0] = m, o.a[0] = -o.k[0] * o.p[0] - o.c[0] * o.v[0] - o.ea[0], o.p[0] += o.v[0] * t + o.a[0] * t * t / 2 + A[0], m = o.v[0] + o.a[0] * t / 2, m = -o.k[0] * o.p[0] - o.c[0] * m - o.ea[0], o.v[0] = o.v[0] + (m + o.a[0]) * t / 2), o.isY && (m = A[1] / t, o.ea[1] = (m - o.ev[1]) / t, o.ev[1] = m, o.a[1] = -o.k[1] * o.p[1] - o.c[1] * o.v[1] - o.ea[1], o.p[1] += o.v[1] * t + o.a[1] * t * t / 2 + A[1], m = o.v[1] + o.a[1] * t / 2, m = -o.k[1] * o.p[1] - o.c[1] * m - o.ea[1], o.v[1] = o.v[1] + (m + o.a[1]) * t / 2), o.isZ && (m = A[2] / t, o.ea[2] = (m - o.ev[2]) / t, o.ev[2] = m, o.a[2] = -o.k[2] * o.p[2] - o.c[2] * o.v[2] - o.ea[2], o.p[2] += o.v[2] * t + o.a[2] * t * t / 2 + A[2], m = o.v[2] + o.a[2] * t / 2, m = -o.k[2] * o.p[2] - o.c[2] * m - o.ea[2], o.v[2] = o.v[2] + (m + o.a[2]) * t / 2), o.isT && (m = A[3] / t, o.ea[3] = (m - o.ev[3]) / t, o.ev[3] = m, o.a[3] = -o.k[3] * o.p[3] - o.c[3] * o.v[3] - o.ea[3], o.p[3] += o.v[3] * t + o.a[3] * t * t / 2 + A[3], m = o.v[3] + o.a[3] * t / 2, m = -o.k[3] * o.p[3] - o.c[3] * m - o.ea[3], o.v[3] = o.v[3] + (m + o.a[3]) * t / 2), this.timerMs < this.opt.warmupMs && (o.v[0] *= 1e-4, o.p[0] *= 1e-4, o.v[1] *= 1e-4, o.p[1] *= 1e-4, o.v[2] *= 1e-4, o.p[2] *= 1e-4, o.v[3] *= 1e-4, o.p[3] *= 1e-4), A[0] = o.p[0], A[1] = o.p[1], A[2] = o.p[2], A[3] = o.p[3], m = this.opt.movementFactor, A[0] *= m, A[1] *= m, A[2] *= m, A[3] *= m, o.dl && (m = o.dl, A[0] += m[0], A[1] += m[1], A[2] += m[2]), o.dw && (m = o.dw, k.set(
363
363
  o.vBasis.x + A[0],
364
364
  o.vBasis.y + A[1],
365
365
  o.vBasis.z + A[2]
366
- ), k.applyMatrix4(re), k.x += m[0], k.y += m[1], k.z += m[2], k.applyMatrix4(le), A[0] += k.x - o.vBasis.x, A[1] += k.y - o.vBasis.y, A[2] += k.z - o.vBasis.z), o.limits && this.opt.isLimits && (m = o.limits, m[0] && (m[0][0] !== null && A[0] < m[0][0] && (A[0] = m[0][0]), m[0][1] !== null && A[0] > m[0][1] && (A[0] = m[0][1])), m[1] && (m[1][0] !== null && A[1] < m[1][0] && (A[1] = m[1][0]), m[1][1] !== null && A[1] > m[1][1] && (A[1] = m[1][1])), m[2] && (m[2][0] !== null && A[2] < m[2][0] && (A[2] = m[2][0]), m[2][1] !== null && A[2] > m[2][1] && (A[2] = m[2][1])), m[3] && (m[3][0] !== null && A[3] < m[3][0] && (A[3] = m[3][0]), m[3][1] !== null && A[3] > m[3][1] && (A[3] = m[3][1]))), o.isPoint)
366
+ ), k.applyMatrix4(le), k.x += m[0], k.y += m[1], k.z += m[2], k.applyMatrix4(he), A[0] += k.x - o.vBasis.x, A[1] += k.y - o.vBasis.y, A[2] += k.z - o.vBasis.z), o.limits && this.opt.isLimits && (m = o.limits, m[0] && (m[0][0] !== null && A[0] < m[0][0] && (A[0] = m[0][0]), m[0][1] !== null && A[0] > m[0][1] && (A[0] = m[0][1])), m[1] && (m[1][0] !== null && A[1] < m[1][0] && (A[1] = m[1][0]), m[1][1] !== null && A[1] > m[1][1] && (A[1] = m[1][1])), m[2] && (m[2][0] !== null && A[2] < m[2][0] && (A[2] = m[2][0]), m[2][1] !== null && A[2] > m[2][1] && (A[2] = m[2][1])), m[3] && (m[3][0] !== null && A[3] < m[3][0] && (A[3] = m[3][0]), m[3][1] !== null && A[3] > m[3][1] && (A[3] = m[3][1]))), o.isPoint)
367
367
  o.bone.position.set(
368
368
  o.vBasis.x + A[0],
369
369
  o.vBasis.y + A[1],
370
370
  o.vBasis.z - A[2]
371
371
  );
372
- else if (o.boneParent.quaternion.copy(o.qBasis), o.pivot && this.opt.isPivots && (o.boneParent.updateWorldMatrix(!1, !1), o.boneParent.matrixWorld.decompose(k, K, _), k.copy(Re).applyQuaternion(K).setY(0).normalize(), K.premultiply(Ce.setFromUnitVectors(Re, k).invert()).normalize(), o.boneParent.quaternion.multiply(K.invert()), o.boneParent.quaternion.multiply(o.qWorldInverseYaw)), o.isZ && (m = Math.atan(A[0] / o.l), K.setFromAxisAngle(qe, -m), o.boneParent.quaternion.multiply(K)), o.isY && (m = o.l / 3, m = m * Math.tanh(A[1] / m), o.bone.position.setLength(o.l + m)), o.isX && (m = Math.atan(A[2] / o.l), K.setFromAxisAngle(je, -m), o.boneParent.quaternion.multiply(K)), o.isT && (m = 1.5 * Math.tanh(A[3] * 1.5), K.setFromAxisAngle(Qe, -m), o.boneParent.quaternion.multiply(K)), o.boneParent.updateWorldMatrix(!1, !0), o.excludes && this.opt.isExcludes)
372
+ else if (o.boneParent.quaternion.copy(o.qBasis), o.pivot && this.opt.isPivots && (o.boneParent.updateWorldMatrix(!1, !1), o.boneParent.matrixWorld.decompose(k, K, _), k.copy(ke).applyQuaternion(K).setY(0).normalize(), K.premultiply(Ee.setFromUnitVectors(ke, k).invert()).normalize(), o.boneParent.quaternion.multiply(K.invert()), o.boneParent.quaternion.multiply(o.qWorldInverseYaw)), o.isZ && (m = Math.atan(A[0] / o.l), K.setFromAxisAngle($e, -m), o.boneParent.quaternion.multiply(K)), o.isY && (m = o.l / 3, m = m * Math.tanh(A[1] / m), o.bone.position.setLength(o.l + m)), o.isX && (m = Math.atan(A[2] / o.l), K.setFromAxisAngle(Ke, -m), o.boneParent.quaternion.multiply(K)), o.isT && (m = 1.5 * Math.tanh(A[3] * 1.5), K.setFromAxisAngle(Je, -m), o.boneParent.quaternion.multiply(K)), o.boneParent.updateWorldMatrix(!1, !0), o.excludes && this.opt.isExcludes)
373
373
  for (n = 0, s = o.excludes.length; n < s; n++)
374
- m = o.excludes[n], _.set(0, 0, 0), m.deltaLocal && (_.x += m.deltaLocal[0], _.y += m.deltaLocal[1], _.z += m.deltaLocal[2]), _.applyMatrix4(m.bone.matrixWorld), le.copy(o.boneParent.matrixWorld).invert(), _.applyMatrix4(le), k.copy(o.bone.position), !(k.distanceToSquared(_) >= m.radiusSq) && (ne = k.length(), $ = _.length(), !($ > m.radius + ne) && ($ < Math.abs(m.radius - ne) || ($ = ($ * $ + ne * ne - m.radiusSq) / (2 * $), _.normalize(), ve.copy(_).multiplyScalar($), $ = Math.sqrt(ne * ne - $ * $), k.subVectors(k, ve).projectOnPlane(_).normalize().multiplyScalar($), be.subVectors(o.vBasis, ve).projectOnPlane(_).normalize(), ne = be.dot(k), ne < 0 && (ne = Math.sqrt($ * $ - ne * ne), be.multiplyScalar(ne), k.add(be)), k.add(ve).normalize(), _.copy(o.bone.position).normalize(), K.setFromUnitVectors(_, k), o.boneParent.quaternion.premultiply(K), o.boneParent.updateWorldMatrix(!1, !0))));
374
+ m = o.excludes[n], _.set(0, 0, 0), m.deltaLocal && (_.x += m.deltaLocal[0], _.y += m.deltaLocal[1], _.z += m.deltaLocal[2]), _.applyMatrix4(m.bone.matrixWorld), he.copy(o.boneParent.matrixWorld).invert(), _.applyMatrix4(he), k.copy(o.bone.position), !(k.distanceToSquared(_) >= m.radiusSq) && (ne = k.length(), ee = _.length(), !(ee > m.radius + ne) && (ee < Math.abs(m.radius - ne) || (ee = (ee * ee + ne * ne - m.radiusSq) / (2 * ee), _.normalize(), Se.copy(_).multiplyScalar(ee), ee = Math.sqrt(ne * ne - ee * ee), k.subVectors(k, Se).projectOnPlane(_).normalize().multiplyScalar(ee), Ae.subVectors(o.vBasis, Se).projectOnPlane(_).normalize(), ne = Ae.dot(k), ne < 0 && (ne = Math.sqrt(ee * ee - ne * ne), Ae.multiplyScalar(ne), k.add(Ae)), k.add(Se).normalize(), _.copy(o.bone.position).normalize(), K.setFromUnitVectors(_, k), o.boneParent.quaternion.premultiply(K), o.boneParent.updateWorldMatrix(!1, !0))));
375
375
  }
376
376
  this.helpers.isActive && this.updateHelpers();
377
377
  }
@@ -442,17 +442,17 @@ class _e {
442
442
  */
443
443
  updateHelpers() {
444
444
  if (m = this.helpers.points, m.bones.length) {
445
- le.copy(this.armature.matrixWorld).invert();
445
+ he.copy(this.armature.matrixWorld).invert();
446
446
  const t = m.object.geometry.getAttribute("position");
447
447
  for (let e = 0, n = m.bones.length; e < n; e++)
448
- re.multiplyMatrices(le, m.bones[e].matrixWorld), k.setFromMatrixPosition(re), t.setXYZ(e, k.x, k.y, k.z);
448
+ le.multiplyMatrices(he, m.bones[e].matrixWorld), k.setFromMatrixPosition(le), t.setXYZ(e, k.x, k.y, k.z);
449
449
  t.needsUpdate = !0, m.object.updateMatrixWorld();
450
450
  }
451
451
  if (m = this.helpers.lines, m.bones.length) {
452
- le.copy(this.armature.matrixWorld).invert();
452
+ he.copy(this.armature.matrixWorld).invert();
453
453
  const t = m.object.geometry.getAttribute("position");
454
454
  for (let e = 0, n = 0, i = m.bones.length; e < i; e++, n += 2)
455
- re.multiplyMatrices(le, m.bones[e].matrixWorld), k.setFromMatrixPosition(re), t.setXYZ(n, k.x, k.y, k.z), re.multiplyMatrices(le, m.bones[e].parent.matrixWorld), k.setFromMatrixPosition(re), t.setXYZ(n + 1, k.x, k.y, k.z);
455
+ le.multiplyMatrices(he, m.bones[e].matrixWorld), k.setFromMatrixPosition(le), t.setXYZ(n, k.x, k.y, k.z), le.multiplyMatrices(he, m.bones[e].parent.matrixWorld), k.setFromMatrixPosition(le), t.setXYZ(n + 1, k.x, k.y, k.z);
456
456
  t.needsUpdate = !0, m.object.updateMatrixWorld();
457
457
  }
458
458
  }
@@ -489,7 +489,7 @@ class _e {
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 Ke {
492
+ class tt {
493
493
  constructor(t) {
494
494
  this.audioContext = t, this.analyzer = null, this.dataArray = null, this.bufferLength = 0;
495
495
  }
@@ -814,7 +814,7 @@ class Ke {
814
814
  return i * s;
815
815
  }
816
816
  }
817
- class Je {
817
+ class nt {
818
818
  /**
819
819
  * @constructor
820
820
  */
@@ -1396,11 +1396,11 @@ class Je {
1396
1396
  return e;
1397
1397
  }
1398
1398
  }
1399
- const $e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1399
+ const it = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1400
1400
  __proto__: null,
1401
- LipsyncEn: Je
1401
+ LipsyncEn: nt
1402
1402
  }, Symbol.toStringTag, { value: "Module" }));
1403
- class et {
1403
+ class ot {
1404
1404
  /**
1405
1405
  * @constructor
1406
1406
  */
@@ -1754,11 +1754,11 @@ class et {
1754
1754
  return e;
1755
1755
  }
1756
1756
  }
1757
- const tt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1757
+ const st = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1758
1758
  __proto__: null,
1759
- LipsyncDe: et
1759
+ LipsyncDe: ot
1760
1760
  }, Symbol.toStringTag, { value: "Module" }));
1761
- class nt {
1761
+ class at {
1762
1762
  /**
1763
1763
  * @constructor
1764
1764
  */
@@ -2289,11 +2289,11 @@ class nt {
2289
2289
  return e;
2290
2290
  }
2291
2291
  }
2292
- const it = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2292
+ const rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2293
2293
  __proto__: null,
2294
- LipsyncFr: nt
2294
+ LipsyncFr: at
2295
2295
  }, Symbol.toStringTag, { value: "Module" }));
2296
- class ot {
2296
+ class lt {
2297
2297
  /**
2298
2298
  * @constructor
2299
2299
  */
@@ -2436,11 +2436,11 @@ class ot {
2436
2436
  return e;
2437
2437
  }
2438
2438
  }
2439
- const st = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2439
+ const ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2440
2440
  __proto__: null,
2441
- LipsyncFi: ot
2441
+ LipsyncFi: lt
2442
2442
  }, Symbol.toStringTag, { value: "Module" }));
2443
- class at {
2443
+ class ut {
2444
2444
  /**
2445
2445
  * @constructor
2446
2446
  */
@@ -2620,24 +2620,24 @@ class at {
2620
2620
  return e;
2621
2621
  }
2622
2622
  }
2623
- const rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2623
+ const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2624
2624
  __proto__: null,
2625
- LipsyncLt: at
2626
- }, Symbol.toStringTag, { value: "Module" })), lt = new URL("data:text/javascript;base64,Y2xhc3MgUGxheWJhY2tXb3JrbGV0IGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgRlNNID0gewogICAgSURMRTogMCwKICAgIFBMQVlJTkc6IDEsCiAgfTsKCiAgY29uc3RydWN0b3Iob3B0aW9ucykgewogICAgc3VwZXIoKTsKICAgIHRoaXMucG9ydC5vbm1lc3NhZ2UgPSB0aGlzLmhhbmRsZU1lc3NhZ2UuYmluZCh0aGlzKTsKCiAgICB0aGlzLl9zYW1wbGVSYXRlID0gb3B0aW9ucz8ucHJvY2Vzc29yT3B0aW9ucz8uc2FtcGxlUmF0ZSB8fCBzYW1wbGVSYXRlOwogICAgdGhpcy5fc2NhbGUgPSAxIC8gMzI3Njg7IC8vIFBDTTE2IC0+IGZsb2F0CgogICAgLy8gU2lsZW5jZSBkZXRlY3Rpb24gdGhyZXNob2xkICgxIHNlY29uZCkgYXMgYSBmYWxsYmFjayBzYWZldHkgbmV0CiAgICBjb25zdCBzaWxlbmNlRHVyYXRpb25TZWNvbmRzID0gMS4wOwogICAgdGhpcy5fc2lsZW5jZVRocmVzaG9sZEJsb2NrcyA9IE1hdGguY2VpbCgodGhpcy5fc2FtcGxlUmF0ZSAqIHNpbGVuY2VEdXJhdGlvblNlY29uZHMpIC8gMTI4KTsKCiAgICAvLyBNZXRyaWNzIGNvbmZpZ3VyYXRpb24gdmlhIG9wdGlvbnMKICAgIGNvbnN0IG1ldHJpY3NDZmcgPSBvcHRpb25zPy5wcm9jZXNzb3JPcHRpb25zPy5tZXRyaWNzIHx8IHt9OwogICAgdGhpcy5fbWV0cmljc0VuYWJsZWQgPSBtZXRyaWNzQ2ZnLmVuYWJsZWQgIT09IGZhb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NUaW1lZE91dCkgewogICAgICAgICAgICAvLyBFTkQgT0YgUExBWUJBQ0s6IEVpdGhlciBleHBsaWNpdGx5IHNpZ25hbGVkIG9yIHRpbWVkIG91dC4KICAgICAgICAgICAgaWYgKCF0aGlzLl9oYXNTZW50RW5kZWQpIHsKICAgICAgICAgICAgICB0aGlzLnBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiAicGxheWJhY2stZW5kZWQiIH0pOwogICAgICAgICAgICAgIHRoaXMuX2hhc1NlbnRFbmRlZCA9IHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy8gU2VuZCBmaW5hbCBtZXRyaWNzIHNob3dpbmcgY2xlYXJlZCBzdGF0ZQogICAgICAgICAgICBpZiAodGhpcy5fbWV0cmljc0VuYWJsZWQpIHsKICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgdGhpcy5wb3J0LnBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgICAgdHlwZTogIm1ldHJpY3MiLAogICAgICAgICAgICAgICAgICBkYXRhOiB7CiAgICAgICAgICAgICAgICAgICAgc3RhdGU6IFBsYXliYWNrV29ya2xldC5GU00uSURMRSwKICAgICAgICAgICAgICAgICAgICBxdWV1ZWRTYW1wbGVzOiAwLAogICAgICAgICAgICAgICAgICAgIHF1ZXVlZE1zOiAwLAogICAgICAgICAgICAgICAgICAgIG1heFF1ZXVlZE1zOiBNYXRoLnJvdW5kKCh0aGlzLl9tYXhRdWV1ZVNhbXBsZXMgLyB0aGlzLl9zYW1wbGVSYXRlKSAqIDEwMDApLAogICAgICAgICAgICAgICAgICAgIHVuZGVycnVuQmxvY2tzOiB0aGlzLl91bmRlcnJ1bkJsb2NrcywKICAgICAgICAgICAgICAgICAgICBmcmFtZXNQcm9jZXNzZWQ6IHRoaXMuX2ZyYW1lc1Byb2Nlc3NlZAogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICB9IGNhdGNoIChfKSB7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HNlc3Npb24gcGVhayB1bnRpbCBpZGxlCiAgICAgIH0KICAgIH0KCiAgICAvLyBBTFdBWVMgcmV0dXJuIHRydWUgdG8ga2VlcCB0aGUgcHJvY2Vzc29yIGFsaXZlIGZvciByZXVzZS4KICAgIHJldHVybiB0cnVlOwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoInBsYXliYWNrLXdvcmtsZXQiLCBQbGF5YmFja1dvcmtsZXQpOwo=", import.meta.url), He = {
2627
- en: $e,
2628
- de: tt,
2629
- fr: it,
2630
- fi: st,
2631
- lt: rt
2632
- }, V = new f.Quaternion(), F = new f.Euler(), ue = new f.Vector3(), ce = new f.Vector3(), Te = new f.Box3();
2625
+ LipsyncLt: ut
2626
+ }, Symbol.toStringTag, { value: "Module" })), dt = new URL("data:text/javascript;base64,Y2xhc3MgUGxheWJhY2tXb3JrbGV0IGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgRlNNID0gewogICAgSURMRTogMCwKICAgIFBMQVlJTkc6IDEsCiAgfTsKCiAgY29uc3RydWN0b3Iob3B0aW9ucykgewogICAgc3VwZXIoKTsKICAgIHRoaXMucG9ydC5vbm1lc3NhZ2UgPSB0aGlzLmhhbmRsZU1lc3NhZ2UuYmluZCh0aGlzKTsKCiAgICB0aGlzLl9zYW1wbGVSYXRlID0gb3B0aW9ucz8ucHJvY2Vzc29yT3B0aW9ucz8uc2FtcGxlUmF0ZSB8fCBzYW1wbGVSYXRlOwogICAgdGhpcy5fc2NhbGUgPSAxIC8gMzI3Njg7IC8vIFBDTTE2IC0+IGZsb2F0CgogICAgLy8gU2lsZW5jZSBkZXRlY3Rpb24gdGhyZXNob2xkICgxIHNlY29uZCkgYXMgYSBmYWxsYmFjayBzYWZldHkgbmV0CiAgICBjb25zdCBzaWxlbmNlRHVyYXRpb25TZWNvbmRzID0gMS4wOwogICAgdGhpcy5fc2lsZW5jZVRocmVzaG9sZEJsb2NrcyA9IE1hdGguY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yZW50Q2h1bmtPZmZzZXQgPSAwOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAvLyBCdWZmZXIgaXMgZW1wdHkuIENoZWNrIGZvciBlbmQgY29uZGl0aW9ucy4KICAgICAgICAgIGNvbnN0IGlzVGltZWRPdXQgPSB0aGlzLl9zaWxlbmNlRnJhbWVzQ291bnQgPiB0aGlzLl9zaWxlbmNlVGhyZXNob2xkQmxvY2tzOwoKICAgICAgICAgIGlmICh0aGlzLl9ub01vcmVEYXRhUmVjZWl2ZWQgfHwgaXNUaW1lZE91dCkgewogICAgICAgICAgICAvLyBFTkQgT0YgUExBWUJBQ0s6IEVpdGhlciBleHBsaWNpdGx5IHNpZ25hbGVkIG9yIHRpbWVkIG91dC4KICAgICAgICAgICAgaWYgKCF0aGlzLl9oYXNTZW50RW5kZWQpIHsKICAgICAgICAgICAgICB0aGlzLnBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiAicGxheWJhY2stZW5kZWQiIH0pOwogICAgICAgICAgICAgIHRoaXMuX2hhc1NlbnRFbmRlZCA9IHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy8gU2VuZCBmaW5hbCBtZXRyaWNzIHNob3dpbmcgY2xlYXJlZCBzdGF0ZQogICAgICAgICAgICBpZiAodGhpcy5fbWV0cmljc0VuYWJsZWQpIHsKICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgdGhpcy5wb3J0LnBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgICAgdHlwZTogIm1ldHJpY3MiLAogICAgICAgICAgICAgICAgICBkYXRhOiB7CiAgICAgICAgICAgICAgICAgICAgc3RhdGU6IFBsYXliYWNrV29ya2xldC5GU00uSURMRSwKICAgICAgICAgICAgICAgICAgICBxdWV1ZWRTYW1wbGVzOiAwLAogICAgICAgICAgICAgICAgICAgIHF1ZXVlZE1zOiAwLAogICAgICAgICAgICAgICAgICAgIG1heFF1ZXVlZE1zOiBNYXRoLnJvdW5kKCh0a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dGhpcy5fc2FtcGxlUmF0ZSkgKiAxMDAwKSwKICAgICAgICAgICAgICB1bmRlcnJ1bkJsb2NrczogdGhpcy5fdW5kZXJydW5CbG9ja3MsCiAgICAgICAgICAgICAgZnJhbWVzUHJvY2Vzc2VkOiB0aGlzLl9mcmFtZXNQcm9jZXNzZWQKICAgICAgICAgICAgfQogICAgICAgICAgfSk7CiAgICAgICAgfSBjYXRjaCAoXykgeyB9CiAgICAgICAgLy8gRG9uJ3QgcmVzZXQgbWF4IHRyYWNrZXIgLSBrZWVwIHNlc3Npb24gcGVhayB1bnRpbCBpZGxlCiAgICAgIH0KICAgIH0KCiAgICAvLyBBTFdBWVMgcmV0dXJuIHRydWUgdG8ga2VlcCB0aGUgcHJvY2Vzc29yIGFsaXZlIGZvciByZXVzZS4KICAgIHJldHVybiB0cnVlOwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoInBsYXliYWNrLXdvcmtsZXQiLCBQbGF5YmFja1dvcmtsZXQpOwo=", import.meta.url), Fe = {
2627
+ en: it,
2628
+ de: st,
2629
+ fr: rt,
2630
+ fi: ht,
2631
+ lt: ct
2632
+ }, G = new f.Quaternion(), E = new f.Euler(), ce = new f.Vector3(), pe = new f.Vector3(), Pe = new f.Box3();
2633
2633
  new f.Matrix4();
2634
2634
  new f.Matrix4();
2635
2635
  new f.Vector3();
2636
2636
  new f.Vector3(0, 0, 1);
2637
- const ht = new f.Vector3(1, 0, 0);
2637
+ const mt = new f.Vector3(1, 0, 0);
2638
2638
  new f.Vector3(0, 1, 0);
2639
2639
  new f.Vector3(0, 0, 1);
2640
- class Fe {
2640
+ class Oe {
2641
2641
  /**
2642
2642
  * Avatar.
2643
2643
  * @typedef {Object} Avatar
@@ -2763,7 +2763,7 @@ class Fe {
2763
2763
  avatarOnlyCamera: null,
2764
2764
  statsNode: null,
2765
2765
  statsStyle: null
2766
- }, Object.assign(this.opt, e || {}), this.opt.statsNode && (this.stats = new Ye(), 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 _e(), 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: {
@@ -4062,7 +4062,7 @@ class Fe {
4062
4062
  this.opt.lightSpotDispersion
4063
4063
  ), this.setLighting(this.opt);
4064
4064
  const l = new f.PMREMGenerator(this.renderer);
4065
- l.compileEquirectangularShader(), this.scene.environment = l.fromScene(new Xe()).texture, this.resizeobserver = new ResizeObserver(this.onResize.bind(this)), this.resizeobserver.observe(this.nodeAvatar), this.controls = new Ve(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;
4065
+ l.compileEquirectangularShader(), this.scene.environment = l.fromScene(new qe()).texture, this.resizeobserver = new ResizeObserver(this.onResize.bind(this)), this.resizeobserver.observe(this.nodeAvatar), this.controls = new Ye(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;
4066
4066
  }
4067
4067
  this.ikMesh = new f.SkinnedMesh();
4068
4068
  const s = {
@@ -4080,14 +4080,14 @@ class Fe {
4080
4080
  Object.entries(s).forEach((l, u) => {
4081
4081
  const a = new f.Bone();
4082
4082
  a.name = l[0], l[1] ? this.ikMesh.getObjectByName(l[1]).add(a) : this.ikMesh.add(a), o.push(a);
4083
- }), this.ikMesh.bind(new f.Skeleton(o)), this.dynamicbones = new _e(), this.isStreaming = !1, this.streamWorkletNode = null, this.streamAudioStartTime = null, this.streamWaitForAudioChunks = !0, this.streamLipsyncLang = null, this.streamLipsyncType = "visemes", this.streamLipsyncQueue = [];
4083
+ }), this.ikMesh.bind(new f.Skeleton(o)), this.dynamicbones = new et(), this.isStreaming = !1, this.streamWorkletNode = null, this.streamAudioStartTime = null, this.streamWaitForAudioChunks = !0, this.streamLipsyncLang = null, this.streamLipsyncType = "visemes", this.streamLipsyncQueue = [];
4084
4084
  }
4085
4085
  /**
4086
4086
  * Helper that re/creates the audio context and the other nodes.
4087
4087
  * @param {number} sampleRate
4088
4088
  */
4089
4089
  initAudioGraph(t = null) {
4090
- if (this.audioCtx && this.audioCtx.state !== "closed" && this.audioCtx.close(), t ? this.audioCtx = new AudioContext({ sampleRate: t }) : 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 Ke(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(
4090
+ if (this.audioCtx && this.audioCtx.state !== "closed" && this.audioCtx.close(), t ? this.audioCtx = new AudioContext({ sampleRate: t }) : 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 tt(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(
4091
4091
  this.opt.mixerGainSpeech,
4092
4092
  this.opt.mixerGainBackground
4093
4093
  ), this.workletLoaded = !1, this.streamWorkletNode) {
@@ -4228,9 +4228,9 @@ class Fe {
4228
4228
  async showAvatar(t, e = null) {
4229
4229
  if (!t || !t.hasOwnProperty("url"))
4230
4230
  throw new Error("Invalid parameter. The avatar must have at least 'url' specified.");
4231
- const n = new Ge();
4231
+ const n = new je();
4232
4232
  if (this.dracoEnabled) {
4233
- const a = new Ze();
4233
+ const a = new Qe();
4234
4234
  a.setDecoderPath(this.dracoDecoderPath), n.setDRACOLoader(a);
4235
4235
  }
4236
4236
  let i = await n.loadAsync(t.url, e);
@@ -4374,9 +4374,9 @@ class Fe {
4374
4374
  updatePoseDelta() {
4375
4375
  for (const [t, e] of Object.entries(this.poseDelta.props)) {
4376
4376
  if (e.x === 0 && e.y === 0 && e.z === 0) continue;
4377
- F.set(e.x, e.y, e.z);
4377
+ E.set(e.x, e.y, e.z);
4378
4378
  const n = this.poseAvatar.props[t];
4379
- n.isQuaternion ? (V.setFromEuler(F), n.multiply(V)) : n.isVector3 && n.add(F);
4379
+ n.isQuaternion ? (G.setFromEuler(E), n.multiply(G)) : n.isVector3 && n.add(E);
4380
4380
  }
4381
4381
  }
4382
4382
  /**
@@ -5159,7 +5159,7 @@ class Fe {
5159
5159
  }, i.x ? new f.Vector3(i.x, i.y, i.z) : null, !0, i.d);
5160
5160
  break;
5161
5161
  }
5162
- if ((u || a) && (F.setFromQuaternion(this.poseAvatar.props["Head.quaternion"]), F.x = Math.max(-0.9, Math.min(0.9, 2 * F.x - 0.5)), F.y = Math.max(-0.9, Math.min(0.9, -2.5 * F.y)), u ? (Object.assign(this.mtAvatar.eyesLookDown, { system: F.x < 0 ? -F.x : 0, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyesLookUp, { system: F.x < 0 ? 0 : F.x, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookInLeft, { system: F.y < 0 ? -F.y : 0, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookOutLeft, { system: F.y < 0 ? 0 : F.y, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookInRight, { system: F.y < 0 ? 0 : F.y, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookOutRight, { system: F.y < 0 ? -F.y : 0, needsUpdate: !0 }), a && (n = -this.mtAvatar.bodyRotateY.value, i = this.gaussianRandom(-0.2, 0.2), this.animQueue.push(this.animFactory({
5162
+ if ((u || a) && (E.setFromQuaternion(this.poseAvatar.props["Head.quaternion"]), E.x = Math.max(-0.9, Math.min(0.9, 2 * E.x - 0.5)), E.y = Math.max(-0.9, Math.min(0.9, -2.5 * E.y)), u ? (Object.assign(this.mtAvatar.eyesLookDown, { system: E.x < 0 ? -E.x : 0, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyesLookUp, { system: E.x < 0 ? 0 : E.x, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookInLeft, { system: E.y < 0 ? -E.y : 0, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookOutLeft, { system: E.y < 0 ? 0 : E.y, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookInRight, { system: E.y < 0 ? 0 : E.y, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookOutRight, { system: E.y < 0 ? -E.y : 0, needsUpdate: !0 }), a && (n = -this.mtAvatar.bodyRotateY.value, i = this.gaussianRandom(-0.2, 0.2), this.animQueue.push(this.animFactory({
5163
5163
  name: "headmove",
5164
5164
  dt: [[1e3, 2e3], [1e3, 2e3, 1, 2], [1e3, 2e3], [1e3, 2e3, 1, 2]],
5165
5165
  vs: {
@@ -5180,7 +5180,7 @@ class Fe {
5180
5180
  eyeLookOutRight: [null, 0],
5181
5181
  eyeContact: [0]
5182
5182
  }
5183
- })))), e > 2 * this.animFrameDur && (e = 2 * this.animFrameDur), (this.viewName !== "full" || this.isAvatarOnly) && (n = this.mtRandomized[Math.floor(Math.random() * this.mtRandomized.length)], i = this.mtAvatar[n], i.needsUpdate || Object.assign(i, { base: (this.mood.baseline[n] || 0) + (1 + l / 255) * Math.random() / 5, needsUpdate: !0 })), this.updatePoseBase(this.animClock), this.mixer && this.mixer.update(e / 1e3 * this.mixer.timeScale), this.updatePoseDelta(), (this.isSpeaking || this.isListening) && u ? l > this.volumeMax ? (this.volumeHeadBase = 0.05, Math.random() > 0.6 && (this.volumeHeadTarget = -0.05 - Math.random() / 15), this.volumeMax = l) : (this.volumeMax *= 0.92, this.volumeHeadTarget = this.volumeHeadBase - 0.9 * (this.volumeHeadBase - this.volumeHeadTarget)) : (this.volumeHeadTarget = 0, this.volumeMax = 0), n = this.volumeHeadTarget - this.volumeHeadCurrent, i = Math.abs(n), i > 1e-4 && (o = i * (this.volumeHeadEasing(Math.min(1, this.volumeHeadVelocity * e / 1e3 / i) / 2 + 0.5) - 0.5), this.volumeHeadCurrent += Math.sign(n) * Math.min(i, o)), Math.abs(this.volumeHeadCurrent) > 1e-4 && (V.setFromAxisAngle(ht, this.volumeHeadCurrent), this.objectNeck.quaternion.multiply(V)), Te.setFromObject(this.armature), this.objectLeftToeBase.getWorldPosition(ue), ue.sub(this.armature.position), this.objectRightToeBase.getWorldPosition(ce), ce.sub(this.armature.position), this.objectHips.position.y -= Te.min.y / 2, this.objectHips.position.x -= (ue.x + ce.x) / 4, this.objectHips.position.z -= (ue.z + ce.z) / 2, this.dynamicbones.update(e), this.fbxAnimationLoader && this.fbxAnimationLoader.update(), this.opt.update && this.opt.update(e), this.updateMorphTargets(e), this.isAvatarOnly)
5183
+ })))), e > 2 * this.animFrameDur && (e = 2 * this.animFrameDur), (this.viewName !== "full" || this.isAvatarOnly) && (n = this.mtRandomized[Math.floor(Math.random() * this.mtRandomized.length)], i = this.mtAvatar[n], i.needsUpdate || Object.assign(i, { base: (this.mood.baseline[n] || 0) + (1 + l / 255) * Math.random() / 5, needsUpdate: !0 })), this.updatePoseBase(this.animClock), this.mixer && this.mixer.update(e / 1e3 * this.mixer.timeScale), this.updatePoseDelta(), (this.isSpeaking || this.isListening) && u ? l > this.volumeMax ? (this.volumeHeadBase = 0.05, Math.random() > 0.6 && (this.volumeHeadTarget = -0.05 - Math.random() / 15), this.volumeMax = l) : (this.volumeMax *= 0.92, this.volumeHeadTarget = this.volumeHeadBase - 0.9 * (this.volumeHeadBase - this.volumeHeadTarget)) : (this.volumeHeadTarget = 0, this.volumeMax = 0), n = this.volumeHeadTarget - this.volumeHeadCurrent, i = Math.abs(n), i > 1e-4 && (o = i * (this.volumeHeadEasing(Math.min(1, this.volumeHeadVelocity * e / 1e3 / i) / 2 + 0.5) - 0.5), this.volumeHeadCurrent += Math.sign(n) * Math.min(i, o)), Math.abs(this.volumeHeadCurrent) > 1e-4 && (G.setFromAxisAngle(mt, this.volumeHeadCurrent), this.objectNeck.quaternion.multiply(G)), Pe.setFromObject(this.armature), this.objectLeftToeBase.getWorldPosition(ce), ce.sub(this.armature.position), this.objectRightToeBase.getWorldPosition(pe), pe.sub(this.armature.position), this.objectHips.position.y -= Pe.min.y / 2, this.objectHips.position.x -= (ce.x + pe.x) / 4, this.objectHips.position.z -= (ce.z + pe.z) / 2, this.dynamicbones.update(e), this.fbxAnimationLoader && this.fbxAnimationLoader.update(), this.opt.update && this.opt.update(e), this.updateMorphTargets(e), this.isAvatarOnly)
5184
5184
  this.stats && this.stats.end();
5185
5185
  else {
5186
5186
  if (this.cameraClock !== null && this.cameraClock < 1e3) {
@@ -5211,8 +5211,8 @@ class Fe {
5211
5211
  if (!this.lipsync.hasOwnProperty(t)) {
5212
5212
  const n = t.toLowerCase(), i = "Lipsync" + t.charAt(0).toUpperCase() + t.slice(1);
5213
5213
  try {
5214
- const s = He[n];
5215
- s && s[i] ? (this.lipsync[t] = new s[i](), console.log(`Loaded lip-sync module for ${t}`)) : console.warn(`Lip-sync module for ${t} not found. Available modules:`, Object.keys(He));
5214
+ const s = Fe[n];
5215
+ s && s[i] ? (this.lipsync[t] = new s[i](), console.log(`Loaded lip-sync module for ${t}`)) : console.warn(`Lip-sync module for ${t} not found. Available modules:`, Object.keys(Fe));
5216
5216
  } catch (s) {
5217
5217
  console.warn(`Failed to load lip-sync module for ${t}:`, s);
5218
5218
  }
@@ -5251,10 +5251,10 @@ class Fe {
5251
5251
  let h = "", r = "", c = 0, d = [], g = [];
5252
5252
  const y = Array.from(this.segmenter.segment(t), (x) => x.segment);
5253
5253
  for (let x = 0; x < y.length; x++) {
5254
- const I = x === y.length - 1, D = y[x].match(l);
5254
+ const I = x === y.length - 1, B = y[x].match(l);
5255
5255
  let p = y[x].match(s);
5256
- const C = y[x].match(u), z = y[x].match(o);
5257
- if (p && !I && !C && y[x + 1].match(s) && (p = !1), n && (h += y[x]), D && (!i || i.every((R) => x < R[0] || x > R[1])) && (r += y[x]), (z || p || I) && (r.length && (r = this.lipsyncPreProcessText(r, a), r.length && d.push({
5256
+ const H = y[x].match(u), z = y[x].match(o);
5257
+ if (p && !I && !H && y[x + 1].match(s) && (p = !1), n && (h += y[x]), B && (!i || i.every((v) => x < v[0] || x > v[1])) && (r += y[x]), (z || p || I) && (r.length && (r = this.lipsyncPreProcessText(r, a), r.length && d.push({
5258
5258
  mark: c,
5259
5259
  word: r
5260
5260
  })), h.length && (g.push({
@@ -5265,16 +5265,16 @@ class Fe {
5265
5265
  subtitles: [h]
5266
5266
  }
5267
5267
  }), h = ""), r.length)) {
5268
- const R = this.lipsyncWordsToVisemes(r, a);
5269
- if (R && R.visemes && R.visemes.length) {
5270
- const T = R.times[R.visemes.length - 1] + R.durations[R.visemes.length - 1];
5271
- for (let P = 0; P < R.visemes.length; P++)
5268
+ const v = this.lipsyncWordsToVisemes(r, a);
5269
+ if (v && v.visemes && v.visemes.length) {
5270
+ const T = v.times[v.visemes.length - 1] + v.durations[v.visemes.length - 1];
5271
+ for (let F = 0; F < v.visemes.length; F++)
5272
5272
  g.push({
5273
5273
  mark: c,
5274
5274
  template: { name: "viseme" },
5275
- ts: [(R.times[P] - 0.6) / T, (R.times[P] + 0.5) / T, (R.times[P] + R.durations[P] + 0.5) / T],
5275
+ ts: [(v.times[F] - 0.6) / T, (v.times[F] + 0.5) / T, (v.times[F] + v.durations[F] + 0.5) / T],
5276
5276
  vs: {
5277
- ["viseme_" + R.visemes[P]]: [null, R.visemes[P] === "PP" || R.visemes[P] === "FF" ? 0.9 : 0.6, 0]
5277
+ ["viseme_" + v.visemes[F]]: [null, v.visemes[F] === "PP" || v.visemes[F] === "FF" ? 0.9 : 0.6, 0]
5278
5278
  }
5279
5279
  });
5280
5280
  }
@@ -5282,14 +5282,14 @@ class Fe {
5282
5282
  }
5283
5283
  if (p || I) {
5284
5284
  if (d.length || I && g.length) {
5285
- const R = {
5285
+ const v = {
5286
5286
  anim: g
5287
5287
  };
5288
- n && (R.onSubtitles = n), d.length && !e.avatarMute && (R.text = d, e.avatarMood && (R.mood = e.avatarMood), e.ttsLang && (R.lang = e.ttsLang), e.ttsVoice && (R.voice = e.ttsVoice), e.ttsRate && (R.rate = e.ttsRate), e.ttsVoice && (R.pitch = e.ttsPitch), e.ttsVolume && (R.volume = e.ttsVolume)), this.speechQueue.push(R), d = [], r = "", c = 0, g = [];
5288
+ n && (v.onSubtitles = n), d.length && !e.avatarMute && (v.text = d, e.avatarMood && (v.mood = e.avatarMood), e.ttsLang && (v.lang = e.ttsLang), e.ttsVoice && (v.voice = e.ttsVoice), e.ttsRate && (v.rate = e.ttsRate), e.ttsVoice && (v.pitch = e.ttsPitch), e.ttsVolume && (v.volume = e.ttsVolume)), this.speechQueue.push(v), d = [], r = "", c = 0, g = [];
5289
5289
  }
5290
- if (C) {
5291
- let R = this.animEmojis[y[x]];
5292
- R && R.link && (R = this.animEmojis[R.link]), R && this.speechQueue.push({ emoji: R });
5290
+ if (H) {
5291
+ let v = this.animEmojis[y[x]];
5292
+ v && v.link && (v = this.animEmojis[v.link]), v && this.speechQueue.push({ emoji: v });
5293
5293
  }
5294
5294
  this.speechQueue.push({ break: 100 });
5295
5295
  }
@@ -5385,10 +5385,10 @@ class Fe {
5385
5385
  let y = 0.6 + this.convertRange(g, [0, h], [0, 0.4]);
5386
5386
  if (h = Math.min(h, c.visemes.length * 200), d > 0)
5387
5387
  for (let x = 0; x < c.visemes.length; x++) {
5388
- const I = a + c.times[x] / d * h, D = c.durations[x] / d * h;
5388
+ const I = a + c.times[x] / d * h, B = c.durations[x] / d * h;
5389
5389
  o.push({
5390
5390
  template: { name: "viseme" },
5391
- ts: [I - Math.min(60, 2 * D / 3), I + Math.min(25, D / 2), I + D + Math.min(60, D / 2)],
5391
+ ts: [I - Math.min(60, 2 * B / 3), I + Math.min(25, B / 2), I + B + Math.min(60, B / 2)],
5392
5392
  vs: {
5393
5393
  ["viseme_" + c.visemes[x]]: [null, c.visemes[x] === "PP" || c.visemes[x] === "FF" ? 0.9 : y, 0]
5394
5394
  }
@@ -5470,7 +5470,7 @@ class Fe {
5470
5470
  s.lang = o, s.rate = Math.max(0.1, Math.min(10, l)), s.pitch = Math.max(0, Math.min(2, u)), s.volume = Math.max(0, Math.min(1, a));
5471
5471
  const h = speechSynthesis.getVoices(), r = t.voice || this.avatar.ttsVoice || this.opt.ttsVoice;
5472
5472
  if (r && h.length > 0) {
5473
- const p = h.find((C) => C.name.includes(r) || C.lang === o);
5473
+ const p = h.find((H) => H.name.includes(r) || H.lang === o);
5474
5474
  p && (s.voice = p);
5475
5475
  }
5476
5476
  const c = i.length * 100 / s.rate, d = this.audioCtx.createBuffer(1, this.audioCtx.sampleRate * (c / 1e3), this.audioCtx.sampleRate), g = this.avatar.lipsyncLang || this.opt.lipsyncLang || "en", y = this.lipsyncPreProcessText(i, g), x = this.lipsyncWordsToVisemes(y, g);
@@ -5485,19 +5485,19 @@ class Fe {
5485
5485
  const I = [];
5486
5486
  if (x && x.visemes && x.visemes.length > 0) {
5487
5487
  const p = x.times[x.visemes.length - 1] + x.durations[x.visemes.length - 1];
5488
- for (let C = 0; C < x.visemes.length; C++) {
5489
- const z = x.visemes[C], R = x.times[C] / p, T = x.durations[C] / p, P = R * c, ie = T * c;
5488
+ for (let H = 0; H < x.visemes.length; H++) {
5489
+ const z = x.visemes[H], v = x.times[H] / p, T = x.durations[H] / p, F = v * c, J = T * c;
5490
5490
  I.push({
5491
5491
  template: { name: "viseme" },
5492
- ts: [P - Math.min(60, 2 * ie / 3), P + Math.min(25, ie / 2), P + ie + Math.min(60, ie / 2)],
5492
+ ts: [F - Math.min(60, 2 * J / 3), F + Math.min(25, J / 2), F + J + Math.min(60, J / 2)],
5493
5493
  vs: {
5494
5494
  ["viseme_" + z]: [null, z === "PP" || z === "FF" ? 0.9 : 0.6, 0]
5495
5495
  }
5496
5496
  });
5497
5497
  }
5498
5498
  }
5499
- const D = [...t.anim, ...I];
5500
- this.audioPlaylist.push({ anim: D, audio: d }), this.onSubtitles = t.onSubtitles || null, this.resetLips(), t.mood && this.setMood(t.mood), this.playAudio(), s.onend = () => {
5499
+ const B = [...t.anim, ...I];
5500
+ this.audioPlaylist.push({ anim: B, audio: d }), this.onSubtitles = t.onSubtitles || null, this.resetLips(), t.mood && this.setMood(t.mood), this.playAudio(), s.onend = () => {
5501
5501
  e();
5502
5502
  }, s.onerror = (p) => {
5503
5503
  console.error("Speech synthesis error:", p.error), n(p.error);
@@ -5895,7 +5895,7 @@ class Fe {
5895
5895
  }
5896
5896
  if (!this.workletLoaded)
5897
5897
  try {
5898
- const l = this.audioCtx.audioWorklet.addModule(lt.href), u = new Promise(
5898
+ const l = this.audioCtx.audioWorklet.addModule(dt.href), u = new Promise(
5899
5899
  (a, h) => setTimeout(() => h(new Error("Worklet loading timed out")), 5e3)
5900
5900
  );
5901
5901
  await Promise.race([l, u]), this.workletLoaded = !0;
@@ -6133,7 +6133,7 @@ class Fe {
6133
6133
  */
6134
6134
  lookAtCamera(t) {
6135
6135
  let e;
6136
- if (this.speakTo && (e = new f.Vector3(), this.speakTo.objectLeftEye?.isObject3D ? (this.speakTo.armature.objectHead, this.speakTo.objectLeftEye.updateMatrixWorld(!0), this.speakTo.objectRightEye.updateMatrixWorld(!0), ue.setFromMatrixPosition(this.speakTo.objectLeftEye.matrixWorld), ce.setFromMatrixPosition(this.speakTo.objectRightEye.matrixWorld), e.addVectors(ue, ce).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) {
6136
+ if (this.speakTo && (e = new f.Vector3(), this.speakTo.objectLeftEye?.isObject3D ? (this.speakTo.armature.objectHead, this.speakTo.objectLeftEye.updateMatrixWorld(!0), this.speakTo.objectRightEye.updateMatrixWorld(!0), ce.setFromMatrixPosition(this.speakTo.objectLeftEye.matrixWorld), pe.setFromMatrixPosition(this.speakTo.objectRightEye.matrixWorld), e.addVectors(ce, pe).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) {
6137
6137
  if (this.avatar.hasOwnProperty("avatarIgnoreCamera")) {
6138
6138
  if (this.avatar.avatarIgnoreCamera) {
6139
6139
  this.lookAhead(t);
@@ -6146,12 +6146,12 @@ class Fe {
6146
6146
  this.lookAt(null, null, t);
6147
6147
  return;
6148
6148
  }
6149
- this.objectLeftEye.updateMatrixWorld(!0), this.objectRightEye.updateMatrixWorld(!0), ue.setFromMatrixPosition(this.objectLeftEye.matrixWorld), ce.setFromMatrixPosition(this.objectRightEye.matrixWorld), ue.add(ce).divideScalar(2), V.copy(this.armature.quaternion), V.multiply(this.poseTarget.props["Hips.quaternion"]), V.multiply(this.poseTarget.props["Spine.quaternion"]), V.multiply(this.poseTarget.props["Spine1.quaternion"]), V.multiply(this.poseTarget.props["Spine2.quaternion"]), V.multiply(this.poseTarget.props["Neck.quaternion"]), V.multiply(this.poseTarget.props["Head.quaternion"]);
6150
- const n = new f.Vector3().subVectors(e, ue).normalize(), i = Math.atan2(n.x, n.z), s = Math.asin(-n.y);
6151
- F.set(s, i, 0, "YXZ");
6152
- const l = new f.Quaternion().setFromEuler(F), u = new f.Quaternion().copy(l).multiply(V.clone().invert());
6153
- F.setFromQuaternion(u, "YXZ");
6154
- let a = F.x / (40 / 24) + 0.2, h = F.y / (9 / 4), r = Math.min(0.6, Math.max(-0.3, a)), c = Math.min(0.8, Math.max(-0.8, h)), d = (Math.random() - 0.5) / 4, g = (Math.random() - 0.5) / 4;
6149
+ this.objectLeftEye.updateMatrixWorld(!0), this.objectRightEye.updateMatrixWorld(!0), ce.setFromMatrixPosition(this.objectLeftEye.matrixWorld), pe.setFromMatrixPosition(this.objectRightEye.matrixWorld), ce.add(pe).divideScalar(2), G.copy(this.armature.quaternion), G.multiply(this.poseTarget.props["Hips.quaternion"]), G.multiply(this.poseTarget.props["Spine.quaternion"]), G.multiply(this.poseTarget.props["Spine1.quaternion"]), G.multiply(this.poseTarget.props["Spine2.quaternion"]), G.multiply(this.poseTarget.props["Neck.quaternion"]), G.multiply(this.poseTarget.props["Head.quaternion"]);
6150
+ const n = new f.Vector3().subVectors(e, ce).normalize(), i = Math.atan2(n.x, n.z), s = Math.asin(-n.y);
6151
+ E.set(s, i, 0, "YXZ");
6152
+ const l = new f.Quaternion().setFromEuler(E), u = new f.Quaternion().copy(l).multiply(G.clone().invert());
6153
+ E.setFromQuaternion(u, "YXZ");
6154
+ let a = E.x / (40 / 24) + 0.2, h = E.y / (9 / 4), r = Math.min(0.6, Math.max(-0.3, a)), c = Math.min(0.8, Math.max(-0.8, h)), d = (Math.random() - 0.5) / 4, g = (Math.random() - 0.5) / 4;
6155
6155
  if (t) {
6156
6156
  let y = this.animQueue.findIndex((I) => I.template.name === "lookat");
6157
6157
  y !== -1 && this.animQueue.splice(y, 1);
@@ -6186,20 +6186,20 @@ class Fe {
6186
6186
  const s = new f.Vector3().setFromMatrixPosition(this.objectLeftEye.matrixWorld), o = new f.Vector3().setFromMatrixPosition(this.objectRightEye.matrixWorld), l = new f.Vector3().addVectors(s, o).divideScalar(2);
6187
6187
  l.project(this.camera);
6188
6188
  let u = (l.x + 1) / 2 * i.width + i.left, a = -(l.y - 1) / 2 * i.height + i.top;
6189
- t === null && (t = u), e === null && (e = a), V.copy(this.armature.quaternion), V.multiply(this.poseTarget.props["Hips.quaternion"]), V.multiply(this.poseTarget.props["Spine.quaternion"]), V.multiply(this.poseTarget.props["Spine1.quaternion"]), V.multiply(this.poseTarget.props["Spine2.quaternion"]), V.multiply(this.poseTarget.props["Neck.quaternion"]), V.multiply(this.poseTarget.props["Head.quaternion"]), F.setFromQuaternion(V);
6190
- let h = F.x / (40 / 24), r = F.y / (9 / 4), c = 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)), g = Math.max(window.innerWidth - u, u), y = Math.max(window.innerHeight - a, a), x = this.convertRange(e, [a - y, a + y], [-0.3, 0.6]) - h + c, I = this.convertRange(t, [u - g, u + g], [-0.8, 0.8]) - r + d;
6189
+ t === null && (t = u), e === null && (e = a), G.copy(this.armature.quaternion), G.multiply(this.poseTarget.props["Hips.quaternion"]), G.multiply(this.poseTarget.props["Spine.quaternion"]), G.multiply(this.poseTarget.props["Spine1.quaternion"]), G.multiply(this.poseTarget.props["Spine2.quaternion"]), G.multiply(this.poseTarget.props["Neck.quaternion"]), G.multiply(this.poseTarget.props["Head.quaternion"]), E.setFromQuaternion(G);
6190
+ let h = E.x / (40 / 24), r = E.y / (9 / 4), c = 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)), g = Math.max(window.innerWidth - u, u), y = Math.max(window.innerHeight - a, a), x = this.convertRange(e, [a - y, a + y], [-0.3, 0.6]) - h + c, I = this.convertRange(t, [u - g, u + g], [-0.8, 0.8]) - r + d;
6191
6191
  x = Math.min(0.6, Math.max(-0.3, x)), I = Math.min(0.8, Math.max(-0.8, I));
6192
- let D = (Math.random() - 0.5) / 4, p = (Math.random() - 0.5) / 4;
6192
+ let B = (Math.random() - 0.5) / 4, p = (Math.random() - 0.5) / 4;
6193
6193
  if (n) {
6194
- let C = this.animQueue.findIndex((R) => R.template.name === "lookat");
6195
- C !== -1 && this.animQueue.splice(C, 1);
6194
+ let H = this.animQueue.findIndex((v) => v.template.name === "lookat");
6195
+ H !== -1 && this.animQueue.splice(H, 1);
6196
6196
  const z = {
6197
6197
  name: "lookat",
6198
6198
  dt: [750, n],
6199
6199
  vs: {
6200
- bodyRotateX: [x + D],
6200
+ bodyRotateX: [x + B],
6201
6201
  bodyRotateY: [I + p],
6202
- eyesRotateX: [-3 * D + 0.1],
6202
+ eyesRotateX: [-3 * B + 0.1],
6203
6203
  eyesRotateY: [-5 * p],
6204
6204
  browInnerUp: [[0, 0.7]],
6205
6205
  mouthLeft: [[0, 0.7]],
@@ -6403,7 +6403,7 @@ class Fe {
6403
6403
  } catch (c) {
6404
6404
  console.warn(`Could not verify file existence for ${t}, attempting to load anyway:`, c);
6405
6405
  }
6406
- const h = new ze();
6406
+ const h = new Me();
6407
6407
  let r;
6408
6408
  try {
6409
6409
  r = await h.loadAsync(t, e);
@@ -6480,7 +6480,7 @@ class Fe {
6480
6480
  let l = this.animQueue.find((u) => u.template.name === "pose");
6481
6481
  l && (l.ts[0] = this.animClock + n * 1e3 + 2e3), this.setPoseFromTemplate(o);
6482
6482
  } else {
6483
- let u = await new ze().loadAsync(t, e);
6483
+ let u = await new Me().loadAsync(t, e);
6484
6484
  if (u && u.animations && u.animations[i]) {
6485
6485
  let a = u.animations[i];
6486
6486
  const h = {};
@@ -6577,12 +6577,12 @@ class Fe {
6577
6577
  const x = t.iterations || 10;
6578
6578
  if (e)
6579
6579
  for (let I = 0; I < x; I++) {
6580
- let D = !1;
6581
- for (let p = 0, C = y.length; p < C; p++) {
6580
+ let B = !1;
6581
+ for (let p = 0, H = y.length; p < H; p++) {
6582
6582
  const z = y[p].bone;
6583
6583
  z.matrixWorld.decompose(u, a, h), a.invert(), o.setFromMatrixPosition(g.matrixWorld), l.subVectors(o, u), l.applyQuaternion(a), l.normalize(), s.subVectors(e, u), s.applyQuaternion(a), s.normalize();
6584
- let R = s.dot(l);
6585
- R > 1 ? R = 1 : R < -1 && (R = -1), R = Math.acos(R), !(R < 1e-5) && (y[p].minAngle !== void 0 && R < y[p].minAngle && (R = y[p].minAngle), y[p].maxAngle !== void 0 && R > y[p].maxAngle && (R = y[p].maxAngle), r.crossVectors(l, s), r.normalize(), V.setFromAxisAngle(r, R), z.quaternion.multiply(V), z.rotation.setFromVector3(c.setFromEuler(z.rotation).clamp(new f.Vector3(
6584
+ let v = s.dot(l);
6585
+ v > 1 ? v = 1 : v < -1 && (v = -1), v = Math.acos(v), !(v < 1e-5) && (y[p].minAngle !== void 0 && v < y[p].minAngle && (v = y[p].minAngle), y[p].maxAngle !== void 0 && v > y[p].maxAngle && (v = y[p].maxAngle), r.crossVectors(l, s), r.normalize(), G.setFromAxisAngle(r, v), z.quaternion.multiply(G), z.rotation.setFromVector3(c.setFromEuler(z.rotation).clamp(new f.Vector3(
6586
6586
  y[p].minx !== void 0 ? y[p].minx : -1 / 0,
6587
6587
  y[p].miny !== void 0 ? y[p].miny : -1 / 0,
6588
6588
  y[p].minz !== void 0 ? y[p].minz : -1 / 0
@@ -6590,9 +6590,9 @@ class Fe {
6590
6590
  y[p].maxx !== void 0 ? y[p].maxx : 1 / 0,
6591
6591
  y[p].maxy !== void 0 ? y[p].maxy : 1 / 0,
6592
6592
  y[p].maxz !== void 0 ? y[p].maxz : 1 / 0
6593
- ))), z.updateMatrixWorld(!0), D = !0);
6593
+ ))), z.updateMatrixWorld(!0), B = !0);
6594
6594
  }
6595
- if (!D) break;
6595
+ if (!B) break;
6596
6596
  }
6597
6597
  i && y.forEach((I) => {
6598
6598
  this.poseTarget.props[I.link + ".quaternion"].copy(I.bone.quaternion), this.poseTarget.props[I.link + ".quaternion"].t = this.animClock, this.poseTarget.props[I.link + ".quaternion"].d = i;
@@ -6605,7 +6605,7 @@ class Fe {
6605
6605
  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();
6606
6606
  }
6607
6607
  }
6608
- const fe = {
6608
+ const Re = {
6609
6609
  apiKey: "sk_ace57ef3ef65a92b9d3bee2a00183b78ca790bc3e10964f2",
6610
6610
  // Replace with your actual API key (should start with sk_)
6611
6611
  endpoint: "https://api.elevenlabs.io/v1/text-to-speech",
@@ -6625,7 +6625,7 @@ const fe = {
6625
6625
  josh: "VR6AewLTigWG4xSOukaG"
6626
6626
  // Male, American
6627
6627
  }
6628
- }, Me = {
6628
+ }, Be = {
6629
6629
  defaultVoice: "aura-2-thalia-en",
6630
6630
  // Thalia (Female, English)
6631
6631
  voices: {
@@ -6645,26 +6645,26 @@ const fe = {
6645
6645
  // Male, English - Powerful
6646
6646
  }
6647
6647
  };
6648
- function Se() {
6648
+ function He() {
6649
6649
  return {
6650
6650
  service: "elevenlabs",
6651
- endpoint: fe.endpoint,
6652
- apiKey: fe.apiKey,
6653
- defaultVoice: fe.defaultVoice,
6654
- voices: fe.voices
6651
+ endpoint: Re.endpoint,
6652
+ apiKey: Re.apiKey,
6653
+ defaultVoice: Re.defaultVoice,
6654
+ voices: Re.voices
6655
6655
  };
6656
6656
  }
6657
- function Rt() {
6658
- const O = Se(), t = [];
6659
- return Object.entries(O.voices).forEach(([e, n]) => {
6657
+ function St() {
6658
+ const U = He(), t = [];
6659
+ return Object.entries(U.voices).forEach(([e, n]) => {
6660
6660
  t.push({
6661
6661
  value: n,
6662
- label: `${e.charAt(0).toUpperCase() + e.slice(1)} (${O.service})`
6662
+ label: `${e.charAt(0).toUpperCase() + e.slice(1)} (${U.service})`
6663
6663
  });
6664
6664
  }), t;
6665
6665
  }
6666
- const Pe = Le(({
6667
- avatarUrl: O = "/avatars/brunette.glb",
6666
+ const Ne = ze(({
6667
+ avatarUrl: U = "/avatars/brunette.glb",
6668
6668
  avatarBody: t = "F",
6669
6669
  mood: e = "neutral",
6670
6670
  ttsLang: n = "en",
@@ -6685,263 +6685,268 @@ const Pe = Le(({
6685
6685
  style: y = {},
6686
6686
  animations: x = {}
6687
6687
  }, I) => {
6688
- const D = Z(null), p = Z(null), C = Z(a), z = Z(null), R = Z(null), T = Z(!1), P = Z({ remainingText: null, originalText: null, options: null }), [ie, he] = ge(!0), [S, N] = ge(null), [X, Y] = ge(!1), [Q, J] = ge(!1);
6689
- ye(() => {
6690
- T.current = Q;
6691
- }, [Q]), ye(() => {
6692
- C.current = a;
6688
+ const B = N(null), p = N(null), H = N(a), z = N(null), v = N(null), T = N(!1), F = N({ remainingText: null, originalText: null, options: null }), J = N([]), ye = N(0), [S, W] = be(!0), [Y, Z] = be(null), [$, se] = be(!1), [de, me] = be(!1);
6689
+ ve(() => {
6690
+ T.current = de;
6691
+ }, [de]), ve(() => {
6692
+ H.current = a;
6693
6693
  }, [a]);
6694
- const oe = Se(), me = i || oe.service;
6695
- let se;
6696
- me === "browser" ? se = {
6694
+ const ie = He(), fe = i || ie.service;
6695
+ let X;
6696
+ fe === "browser" ? X = {
6697
6697
  service: "browser",
6698
6698
  endpoint: "",
6699
6699
  apiKey: null,
6700
6700
  defaultVoice: "Google US English"
6701
- } : me === "elevenlabs" ? se = {
6701
+ } : fe === "elevenlabs" ? X = {
6702
6702
  service: "elevenlabs",
6703
6703
  endpoint: "https://api.elevenlabs.io/v1/text-to-speech",
6704
- apiKey: o || oe.apiKey,
6705
- defaultVoice: s || oe.defaultVoice || fe.defaultVoice,
6706
- voices: oe.voices || fe.voices
6707
- } : me === "deepgram" ? se = {
6704
+ apiKey: o || ie.apiKey,
6705
+ defaultVoice: s || ie.defaultVoice || Re.defaultVoice,
6706
+ voices: ie.voices || Re.voices
6707
+ } : fe === "deepgram" ? X = {
6708
6708
  service: "deepgram",
6709
6709
  endpoint: "https://api.deepgram.com/v1/speak",
6710
- apiKey: o || oe.apiKey,
6711
- defaultVoice: s || oe.defaultVoice || Me.defaultVoice,
6712
- voices: oe.voices || Me.voices
6713
- } : se = {
6714
- ...oe,
6710
+ apiKey: o || ie.apiKey,
6711
+ defaultVoice: s || ie.defaultVoice || Be.defaultVoice,
6712
+ voices: ie.voices || Be.voices
6713
+ } : X = {
6714
+ ...ie,
6715
6715
  // Override API key if provided via props
6716
- apiKey: o !== null ? o : oe.apiKey
6716
+ apiKey: o !== null ? o : ie.apiKey
6717
6717
  };
6718
- const pe = {
6719
- url: O,
6718
+ const b = {
6719
+ url: U,
6720
6720
  body: t,
6721
6721
  avatarMood: e,
6722
- ttsLang: me === "browser" ? "en-US" : n,
6723
- ttsVoice: s || se.defaultVoice,
6722
+ ttsLang: fe === "browser" ? "en-US" : n,
6723
+ ttsVoice: s || X.defaultVoice,
6724
6724
  lipsyncLang: "en",
6725
6725
  showFullAvatar: a,
6726
6726
  bodyMovement: l,
6727
6727
  movementIntensity: u
6728
- }, ee = {
6729
- ttsEndpoint: se.endpoint,
6730
- ttsApikey: se.apiKey,
6731
- ttsService: me,
6728
+ }, R = {
6729
+ ttsEndpoint: X.endpoint,
6730
+ ttsApikey: X.apiKey,
6731
+ ttsService: fe,
6732
6732
  lipsyncModules: ["en"],
6733
6733
  cameraView: h
6734
- }, b = E(async () => {
6735
- if (!(!D.current || p.current))
6734
+ }, w = M(async () => {
6735
+ if (!(!B.current || p.current))
6736
6736
  try {
6737
- if (he(!0), N(null), p.current = new Fe(D.current, ee), p.current.controls && (p.current.controls.enableRotate = !1, p.current.controls.enableZoom = !1, p.current.controls.enablePan = !1, p.current.controls.enableDamping = !1), x && Object.keys(x).length > 0 && (p.current.customAnimations = x), await p.current.showAvatar(pe, (G) => {
6738
- if (G.lengthComputable) {
6739
- const M = Math.min(100, Math.round(G.loaded / G.total * 100));
6740
- c(M);
6737
+ if (W(!0), Z(null), p.current = new Oe(B.current, R), p.current.controls && (p.current.controls.enableRotate = !1, p.current.controls.enableZoom = !1, p.current.controls.enablePan = !1, p.current.controls.enableDamping = !1), x && Object.keys(x).length > 0 && (p.current.customAnimations = x), await p.current.showAvatar(b, (V) => {
6738
+ if (V.lengthComputable) {
6739
+ const Q = Math.min(100, Math.round(V.loaded / V.total * 100));
6740
+ c(Q);
6741
6741
  }
6742
- }), await new Promise((G) => {
6743
- const M = () => {
6744
- p.current.lipsync && Object.keys(p.current.lipsync).length > 0 ? G() : setTimeout(M, 100);
6742
+ }), await new Promise((V) => {
6743
+ const Q = () => {
6744
+ p.current.lipsync && Object.keys(p.current.lipsync).length > 0 ? V() : setTimeout(Q, 100);
6745
6745
  };
6746
- M();
6746
+ Q();
6747
6747
  }), p.current && p.current.setShowFullAvatar)
6748
6748
  try {
6749
6749
  p.current.setShowFullAvatar(a);
6750
- } catch (G) {
6751
- console.warn("Error setting full body mode on initialization:", G);
6750
+ } catch (V) {
6751
+ console.warn("Error setting full body mode on initialization:", V);
6752
6752
  }
6753
- p.current && p.current.controls && (p.current.controls.enableRotate = !1, p.current.controls.enableZoom = !1, p.current.controls.enablePan = !1, p.current.controls.enableDamping = !1, p.current.controls.update()), he(!1), Y(!0), r(p.current);
6754
- const B = () => {
6753
+ p.current && p.current.controls && (p.current.controls.enableRotate = !1, p.current.controls.enableZoom = !1, p.current.controls.enablePan = !1, p.current.controls.enableDamping = !1, p.current.controls.update()), W(!1), se(!0), r(p.current);
6754
+ const P = () => {
6755
6755
  document.visibilityState === "visible" ? p.current?.start() : p.current?.stop();
6756
6756
  };
6757
- return document.addEventListener("visibilitychange", B), () => {
6758
- document.removeEventListener("visibilitychange", B);
6757
+ return document.addEventListener("visibilitychange", P), () => {
6758
+ document.removeEventListener("visibilitychange", P);
6759
6759
  };
6760
6760
  } catch (L) {
6761
- console.error("Error initializing TalkingHead:", L), N(L.message || "Failed to initialize avatar"), he(!1), d(L);
6761
+ console.error("Error initializing TalkingHead:", L), Z(L.message || "Failed to initialize avatar"), W(!1), d(L);
6762
6762
  }
6763
- }, [O, t, e, n, i, s, o, a, l, u, h]);
6764
- ye(() => (b(), () => {
6763
+ }, [U, t, e, n, i, s, o, a, l, u, h]);
6764
+ ve(() => (w(), () => {
6765
6765
  p.current && (p.current.stop(), p.current.dispose(), p.current = null);
6766
- }), [b]), ye(() => {
6767
- if (!D.current || !p.current) return;
6768
- const L = new ResizeObserver((G) => {
6769
- for (const M of G)
6766
+ }), [w]), ve(() => {
6767
+ if (!B.current || !p.current) return;
6768
+ const L = new ResizeObserver((V) => {
6769
+ for (const Q of V)
6770
6770
  p.current && p.current.onResize && p.current.onResize();
6771
6771
  });
6772
- L.observe(D.current);
6773
- const B = () => {
6772
+ L.observe(B.current);
6773
+ const P = () => {
6774
6774
  p.current && p.current.onResize && p.current.onResize();
6775
6775
  };
6776
- return window.addEventListener("resize", B), () => {
6777
- L.disconnect(), window.removeEventListener("resize", B);
6776
+ return window.addEventListener("resize", P), () => {
6777
+ L.disconnect(), window.removeEventListener("resize", P);
6778
6778
  };
6779
- }, [X]);
6780
- const v = E(async () => {
6779
+ }, [$]);
6780
+ const C = M(async () => {
6781
6781
  if (p.current && p.current.audioCtx)
6782
6782
  try {
6783
6783
  (p.current.audioCtx.state === "suspended" || p.current.audioCtx.state === "interrupted") && (await p.current.audioCtx.resume(), console.log("Audio context resumed"));
6784
6784
  } catch (L) {
6785
6785
  console.warn("Failed to resume audio context:", L);
6786
6786
  }
6787
- }, []), w = E(async (L, B = {}) => {
6788
- if (p.current && X)
6787
+ }, []), D = M(async (L, P = {}) => {
6788
+ if (p.current && $)
6789
6789
  try {
6790
- R.current && (clearInterval(R.current), R.current = null), z.current = { text: L, options: B }, P.current = { remainingText: null, originalText: null, options: null }, J(!1), T.current = !1, await v();
6791
- const G = {
6792
- ...B,
6793
- lipsyncLang: B.lipsyncLang || pe.lipsyncLang || "en"
6790
+ v.current && (clearInterval(v.current), v.current = null), z.current = { text: L, options: P }, F.current = { remainingText: null, originalText: null, options: null };
6791
+ const V = /[!\.\?\n\p{Extended_Pictographic}]/ug, Q = L.split(V).map((O) => O.trim()).filter((O) => O.length > 0);
6792
+ J.current = Q, ye.current = 0, me(!1), T.current = !1, await C();
6793
+ const ae = {
6794
+ ...P,
6795
+ lipsyncLang: P.lipsyncLang || b.lipsyncLang || "en"
6794
6796
  };
6795
- if (B.onSpeechEnd && p.current) {
6796
- const M = p.current;
6797
- let W = null, ae = 0;
6798
- const ke = 1200;
6799
- let xe = !1;
6800
- W = setInterval(() => {
6801
- if (ae++, T.current)
6797
+ if (P.onSpeechEnd && p.current) {
6798
+ const O = p.current;
6799
+ let oe = null, Ie = 0;
6800
+ const xe = 1200;
6801
+ let ue = !1;
6802
+ oe = setInterval(() => {
6803
+ if (Ie++, T.current)
6802
6804
  return;
6803
- if (ae > ke) {
6804
- if (W && (clearInterval(W), W = null, R.current = null), !xe && !T.current) {
6805
- xe = !0;
6805
+ if (Ie > xe) {
6806
+ if (oe && (clearInterval(oe), oe = null, v.current = null), !ue && !T.current) {
6807
+ ue = !0;
6806
6808
  try {
6807
- B.onSpeechEnd();
6808
- } catch (we) {
6809
- console.error("Error in onSpeechEnd callback (timeout):", we);
6809
+ P.onSpeechEnd();
6810
+ } catch (Te) {
6811
+ console.error("Error in onSpeechEnd callback (timeout):", Te);
6810
6812
  }
6811
6813
  }
6812
6814
  return;
6813
6815
  }
6814
- const Oe = !M.speechQueue || M.speechQueue.length === 0, Ne = !M.audioPlaylist || M.audioPlaylist.length === 0;
6815
- M && M.isSpeaking === !1 && Oe && Ne && M.isAudioPlaying === !1 && !xe && !T.current && setTimeout(() => {
6816
- if (M && !T.current && M.isSpeaking === !1 && (!M.speechQueue || M.speechQueue.length === 0) && (!M.audioPlaylist || M.audioPlaylist.length === 0) && M.isAudioPlaying === !1 && !xe && !T.current) {
6817
- xe = !0, W && (clearInterval(W), W = null, R.current = null);
6816
+ const re = !O.speechQueue || O.speechQueue.length === 0, Le = !O.audioPlaylist || O.audioPlaylist.length === 0;
6817
+ O && O.isSpeaking === !1 && re && Le && O.isAudioPlaying === !1 && !ue && !T.current && setTimeout(() => {
6818
+ if (O && !T.current && O.isSpeaking === !1 && (!O.speechQueue || O.speechQueue.length === 0) && (!O.audioPlaylist || O.audioPlaylist.length === 0) && O.isAudioPlaying === !1 && !ue && !T.current) {
6819
+ ue = !0, oe && (clearInterval(oe), oe = null, v.current = null);
6818
6820
  try {
6819
- B.onSpeechEnd();
6820
- } catch (Ue) {
6821
- console.error("Error in onSpeechEnd callback:", Ue);
6821
+ P.onSpeechEnd();
6822
+ } catch (Ze) {
6823
+ console.error("Error in onSpeechEnd callback:", Ze);
6822
6824
  }
6823
6825
  }
6824
6826
  }, 100);
6825
- }, 100), R.current = W;
6827
+ }, 100), v.current = oe;
6826
6828
  }
6827
- p.current.lipsync && Object.keys(p.current.lipsync).length > 0 ? (p.current.setSlowdownRate && p.current.setSlowdownRate(1.05), p.current.speakText(L, G)) : setTimeout(async () => {
6828
- await v(), p.current && p.current.lipsync && (p.current.setSlowdownRate && p.current.setSlowdownRate(1.05), p.current.speakText(L, G));
6829
+ p.current.lipsync && Object.keys(p.current.lipsync).length > 0 ? (p.current.setSlowdownRate && p.current.setSlowdownRate(1.05), p.current.speakText(L, ae)) : setTimeout(async () => {
6830
+ await C(), p.current && p.current.lipsync && (p.current.setSlowdownRate && p.current.setSlowdownRate(1.05), p.current.speakText(L, ae));
6829
6831
  }, 100);
6830
- } catch (G) {
6831
- console.error("Error speaking text:", G), N(G.message || "Failed to speak text");
6832
+ } catch (V) {
6833
+ console.error("Error speaking text:", V), Z(V.message || "Failed to speak text");
6832
6834
  }
6833
- }, [X, v, pe.lipsyncLang]), H = E(() => {
6834
- p.current && (p.current.stopSpeaking(), p.current.setSlowdownRate && p.current.setSlowdownRate(1), z.current = null, J(!1));
6835
- }, []), U = E(() => {
6835
+ }, [$, C, b.lipsyncLang]), te = M(() => {
6836
+ p.current && (p.current.stopSpeaking(), p.current.setSlowdownRate && p.current.setSlowdownRate(1), z.current = null, me(!1));
6837
+ }, []), q = M(() => {
6836
6838
  if (p.current && p.current.pauseSpeaking) {
6837
6839
  const L = p.current;
6838
6840
  if (L.isSpeaking || L.audioPlaylist && L.audioPlaylist.length > 0 || L.speechQueue && L.speechQueue.length > 0) {
6839
- R.current && (clearInterval(R.current), R.current = null);
6840
- let G = "";
6841
- if (L.speechQueue && L.speechQueue.length > 0 && z.current) {
6842
- const M = L.speechQueue.filter((W) => W && W.text && Array.isArray(W.text) && W.text.length > 0).map((W) => W.text.map((ae) => ae.word || "").filter((ae) => ae.length > 0).join(" ")).filter((W) => W.length > 0).join(" ");
6843
- M && M.trim() && (G = M.trim());
6841
+ v.current && (clearInterval(v.current), v.current = null);
6842
+ let V = "";
6843
+ if (z.current && J.current.length > 0) {
6844
+ const Q = J.current.length, ae = L.speechQueue ? L.speechQueue.filter((xe) => xe && xe.text && Array.isArray(xe.text) && xe.text.length > 0).length : 0, O = L.audioPlaylist && L.audioPlaylist.length > 0, oe = ae + (O ? 1 : 0), Ie = Q - oe;
6845
+ if (oe > 0 && Ie < Q && (V = J.current.slice(Ie).join(". ").trim(), !V && ae > 0 && L.speechQueue)) {
6846
+ const ue = L.speechQueue.filter((re) => re && re.text && Array.isArray(re.text) && re.text.length > 0).map((re) => re.text.map((Le) => Le.word || "").filter((Le) => Le.length > 0).join(" ")).filter((re) => re.length > 0).join(" ");
6847
+ ue && ue.trim() && (V = ue.trim());
6848
+ }
6844
6849
  }
6845
- z.current && (P.current = {
6846
- remainingText: G || null,
6850
+ z.current && (F.current = {
6851
+ remainingText: V || null,
6847
6852
  originalText: z.current.text,
6848
6853
  options: z.current.options
6849
- }), L.speechQueue && (L.speechQueue.length = 0), p.current.pauseSpeaking(), T.current = !0, J(!0);
6854
+ }), L.speechQueue && (L.speechQueue.length = 0), p.current.pauseSpeaking(), T.current = !0, me(!0);
6850
6855
  }
6851
6856
  }
6852
- }, []), te = E(async () => {
6853
- if (!p.current || !Q)
6857
+ }, []), j = M(async () => {
6858
+ if (!p.current || !de)
6854
6859
  return;
6855
- let L = "", B = {};
6856
- if (P.current && P.current.remainingText)
6857
- L = P.current.remainingText, B = P.current.options || {}, P.current = { remainingText: null, originalText: null, options: null };
6860
+ let L = "", P = {};
6861
+ if (F.current && F.current.remainingText)
6862
+ L = F.current.remainingText, P = F.current.options || {}, F.current = { remainingText: null, originalText: null, options: null };
6858
6863
  else if (z.current && z.current.text)
6859
- L = z.current.text, B = z.current.options || {};
6864
+ L = z.current.text, P = z.current.options || {};
6860
6865
  else {
6861
- console.warn("Resume called but no paused speech found"), J(!1), T.current = !1;
6866
+ console.warn("Resume called but no paused speech found"), me(!1), T.current = !1;
6862
6867
  return;
6863
6868
  }
6864
- J(!1), T.current = !1, await v();
6865
- const G = {
6866
- ...B,
6867
- lipsyncLang: B.lipsyncLang || pe.lipsyncLang || "en"
6869
+ me(!1), T.current = !1, await C();
6870
+ const V = {
6871
+ ...P,
6872
+ lipsyncLang: P.lipsyncLang || b.lipsyncLang || "en"
6868
6873
  };
6869
6874
  try {
6870
- await w(L, G);
6871
- } catch (M) {
6872
- console.error("Error resuming speech:", M), J(!1), T.current = !1;
6875
+ await D(L, V);
6876
+ } catch (Q) {
6877
+ console.error("Error resuming speech:", Q), me(!1), T.current = !1;
6873
6878
  }
6874
- }, [v, Q, w, pe]), q = E((L) => {
6879
+ }, [C, de, D, b]), we = M((L) => {
6875
6880
  p.current && p.current.setMood(L);
6876
- }, []), j = E((L) => {
6881
+ }, []), We = M((L) => {
6877
6882
  p.current && p.current.setSlowdownRate && p.current.setSlowdownRate(L);
6878
- }, []), Ie = E((L, B = !1) => {
6883
+ }, []), Ve = M((L, P = !1) => {
6879
6884
  if (p.current && p.current.playAnimation) {
6880
6885
  if (x && x[L] && (L = x[L]), p.current.setShowFullAvatar)
6881
6886
  try {
6882
- p.current.setShowFullAvatar(C.current);
6883
- } catch (M) {
6884
- console.warn("Error setting full body mode:", M);
6887
+ p.current.setShowFullAvatar(H.current);
6888
+ } catch (Q) {
6889
+ console.warn("Error setting full body mode:", Q);
6885
6890
  }
6886
6891
  if (L.includes("."))
6887
6892
  try {
6888
- p.current.playAnimation(L, null, 10, 0, 0.01, B);
6889
- } catch (M) {
6890
- console.warn(`Failed to play ${L}:`, M);
6893
+ p.current.playAnimation(L, null, 10, 0, 0.01, P);
6894
+ } catch (Q) {
6895
+ console.warn(`Failed to play ${L}:`, Q);
6891
6896
  try {
6892
6897
  p.current.setBodyMovement("idle");
6893
- } catch (W) {
6894
- console.warn("Fallback animation also failed:", W);
6898
+ } catch (ae) {
6899
+ console.warn("Fallback animation also failed:", ae);
6895
6900
  }
6896
6901
  }
6897
6902
  else {
6898
- const M = [".fbx", ".glb", ".gltf"];
6899
- let W = !1;
6900
- for (const ae of M)
6903
+ const Q = [".fbx", ".glb", ".gltf"];
6904
+ let ae = !1;
6905
+ for (const O of Q)
6901
6906
  try {
6902
- p.current.playAnimation(L + ae, null, 10, 0, 0.01, B), W = !0;
6907
+ p.current.playAnimation(L + O, null, 10, 0, 0.01, P), ae = !0;
6903
6908
  break;
6904
6909
  } catch {
6905
6910
  }
6906
- if (!W) {
6911
+ if (!ae) {
6907
6912
  console.warn("Animation not found:", L);
6908
6913
  try {
6909
6914
  p.current.setBodyMovement("idle");
6910
- } catch (ae) {
6911
- console.warn("Fallback animation also failed:", ae);
6915
+ } catch (O) {
6916
+ console.warn("Fallback animation also failed:", O);
6912
6917
  }
6913
6918
  }
6914
6919
  }
6915
6920
  }
6916
- }, [x]), De = E(() => {
6921
+ }, [x]), Ge = M(() => {
6917
6922
  p.current && p.current.onResize && p.current.onResize();
6918
6923
  }, []);
6919
- return Ae(I, () => ({
6920
- speakText: w,
6921
- stopSpeaking: H,
6922
- pauseSpeaking: U,
6923
- resumeSpeaking: te,
6924
- resumeAudioContext: v,
6925
- setMood: q,
6926
- setTimingAdjustment: j,
6927
- playAnimation: Ie,
6928
- isReady: X,
6929
- isPaused: Q,
6924
+ return Ce(I, () => ({
6925
+ speakText: D,
6926
+ stopSpeaking: te,
6927
+ pauseSpeaking: q,
6928
+ resumeSpeaking: j,
6929
+ resumeAudioContext: C,
6930
+ setMood: we,
6931
+ setTimingAdjustment: We,
6932
+ playAnimation: Ve,
6933
+ isReady: $,
6934
+ isPaused: de,
6930
6935
  talkingHead: p.current,
6931
- handleResize: De,
6936
+ handleResize: Ge,
6932
6937
  setBodyMovement: (L) => {
6933
6938
  if (p.current && p.current.setShowFullAvatar && p.current.setBodyMovement)
6934
6939
  try {
6935
- p.current.setShowFullAvatar(C.current), p.current.setBodyMovement(L);
6936
- } catch (B) {
6937
- console.warn("Error setting body movement:", B);
6940
+ p.current.setShowFullAvatar(H.current), p.current.setBodyMovement(L);
6941
+ } catch (P) {
6942
+ console.warn("Error setting body movement:", P);
6938
6943
  }
6939
6944
  },
6940
6945
  setMovementIntensity: (L) => p.current?.setMovementIntensity(L),
6941
6946
  playRandomDance: () => {
6942
6947
  if (p.current && p.current.setShowFullAvatar && p.current.playRandomDance)
6943
6948
  try {
6944
- p.current.setShowFullAvatar(C.current), p.current.playRandomDance();
6949
+ p.current.setShowFullAvatar(H.current), p.current.playRandomDance();
6945
6950
  } catch (L) {
6946
6951
  console.warn("Error playing random dance:", L);
6947
6952
  }
@@ -6949,15 +6954,15 @@ const Pe = Le(({
6949
6954
  playReaction: (L) => {
6950
6955
  if (p.current && p.current.setShowFullAvatar && p.current.playReaction)
6951
6956
  try {
6952
- p.current.setShowFullAvatar(C.current), p.current.playReaction(L);
6953
- } catch (B) {
6954
- console.warn("Error playing reaction:", B);
6957
+ p.current.setShowFullAvatar(H.current), p.current.playReaction(L);
6958
+ } catch (P) {
6959
+ console.warn("Error playing reaction:", P);
6955
6960
  }
6956
6961
  },
6957
6962
  playCelebration: () => {
6958
6963
  if (p.current && p.current.setShowFullAvatar && p.current.playCelebration)
6959
6964
  try {
6960
- p.current.setShowFullAvatar(C.current), p.current.playCelebration();
6965
+ p.current.setShowFullAvatar(H.current), p.current.playCelebration();
6961
6966
  } catch (L) {
6962
6967
  console.warn("Error playing celebration:", L);
6963
6968
  }
@@ -6965,9 +6970,9 @@ const Pe = Le(({
6965
6970
  setShowFullAvatar: (L) => {
6966
6971
  if (p.current && p.current.setShowFullAvatar)
6967
6972
  try {
6968
- C.current = L, p.current.setShowFullAvatar(L);
6969
- } catch (B) {
6970
- console.warn("Error setting showFullAvatar:", B);
6973
+ H.current = L, p.current.setShowFullAvatar(L);
6974
+ } catch (P) {
6975
+ console.warn("Error setting showFullAvatar:", P);
6971
6976
  }
6972
6977
  },
6973
6978
  lockAvatarPosition: () => {
@@ -6986,7 +6991,7 @@ const Pe = Le(({
6986
6991
  console.warn("Error unlocking avatar position:", L);
6987
6992
  }
6988
6993
  }
6989
- })), /* @__PURE__ */ Ee(
6994
+ })), /* @__PURE__ */ De(
6990
6995
  "div",
6991
6996
  {
6992
6997
  className: `talking-head-avatar ${g}`,
@@ -6997,10 +7002,10 @@ const Pe = Le(({
6997
7002
  ...y
6998
7003
  },
6999
7004
  children: [
7000
- /* @__PURE__ */ de(
7005
+ /* @__PURE__ */ ge(
7001
7006
  "div",
7002
7007
  {
7003
- ref: D,
7008
+ ref: B,
7004
7009
  className: "talking-head-viewer",
7005
7010
  style: {
7006
7011
  width: "100%",
@@ -7009,7 +7014,7 @@ const Pe = Le(({
7009
7014
  }
7010
7015
  }
7011
7016
  ),
7012
- ie && /* @__PURE__ */ de("div", { className: "loading-overlay", style: {
7017
+ S && /* @__PURE__ */ ge("div", { className: "loading-overlay", style: {
7013
7018
  position: "absolute",
7014
7019
  top: "50%",
7015
7020
  left: "50%",
@@ -7018,7 +7023,7 @@ const Pe = Le(({
7018
7023
  fontSize: "18px",
7019
7024
  zIndex: 10
7020
7025
  }, children: "Loading avatar..." }),
7021
- S && /* @__PURE__ */ de("div", { className: "error-overlay", style: {
7026
+ Y && /* @__PURE__ */ ge("div", { className: "error-overlay", style: {
7022
7027
  position: "absolute",
7023
7028
  top: "50%",
7024
7029
  left: "50%",
@@ -7029,14 +7034,14 @@ const Pe = Le(({
7029
7034
  zIndex: 10,
7030
7035
  padding: "20px",
7031
7036
  borderRadius: "8px"
7032
- }, children: S })
7037
+ }, children: Y })
7033
7038
  ]
7034
7039
  }
7035
7040
  );
7036
7041
  });
7037
- Pe.displayName = "TalkingHeadAvatar";
7038
- const ut = Le(({
7039
- text: O = "Hello! I'm a talking avatar. How are you today?",
7042
+ Ne.displayName = "TalkingHeadAvatar";
7043
+ const pt = ze(({
7044
+ text: U = "Hello! I'm a talking avatar. How are you today?",
7040
7045
  onLoading: t = () => {
7041
7046
  },
7042
7047
  onError: e = () => {
@@ -7047,7 +7052,7 @@ const ut = Le(({
7047
7052
  style: s = {},
7048
7053
  avatarConfig: o = {}
7049
7054
  }, l) => {
7050
- const u = Z(null), a = Z(null), [h, r] = ge(!0), [c, d] = ge(null), [g, y] = ge(!1), x = Se(), I = o.ttsService || x.service, D = I === "browser" ? {
7055
+ const u = N(null), a = N(null), [h, r] = be(!0), [c, d] = be(null), [g, y] = be(!1), x = He(), I = o.ttsService || x.service, B = I === "browser" ? {
7051
7056
  endpoint: "",
7052
7057
  apiKey: null,
7053
7058
  defaultVoice: "Google US English"
@@ -7063,7 +7068,7 @@ const ut = Le(({
7063
7068
  body: "F",
7064
7069
  avatarMood: "neutral",
7065
7070
  ttsLang: I === "browser" ? "en-US" : "en",
7066
- ttsVoice: o.ttsVoice || D.defaultVoice,
7071
+ ttsVoice: o.ttsVoice || B.defaultVoice,
7067
7072
  lipsyncLang: "en",
7068
7073
  // English lip-sync
7069
7074
  showFullAvatar: !0,
@@ -7071,123 +7076,123 @@ const ut = Le(({
7071
7076
  bodyMovement: "idle",
7072
7077
  movementIntensity: 0.5,
7073
7078
  ...o
7074
- }, C = {
7075
- ttsEndpoint: D.endpoint,
7076
- ttsApikey: D.apiKey,
7079
+ }, H = {
7080
+ ttsEndpoint: B.endpoint,
7081
+ ttsApikey: B.apiKey,
7077
7082
  ttsService: I,
7078
7083
  lipsyncModules: ["en"],
7079
7084
  cameraView: "upper"
7080
- }, z = E(async () => {
7085
+ }, z = M(async () => {
7081
7086
  if (!(!u.current || a.current))
7082
7087
  try {
7083
- if (r(!0), d(null), a.current = new Fe(u.current, C), await a.current.showAvatar(p, (X) => {
7084
- if (X.lengthComputable) {
7085
- const Y = Math.min(100, Math.round(X.loaded / X.total * 100));
7086
- t(Y);
7088
+ if (r(!0), d(null), a.current = new Oe(u.current, H), await a.current.showAvatar(p, (Y) => {
7089
+ if (Y.lengthComputable) {
7090
+ const Z = Math.min(100, Math.round(Y.loaded / Y.total * 100));
7091
+ t(Z);
7087
7092
  }
7088
7093
  }), a.current.morphs && a.current.morphs.length > 0) {
7089
- const X = a.current.morphs[0].morphTargetDictionary;
7090
- console.log("Available morph targets:", Object.keys(X));
7091
- const Y = Object.keys(X).filter((Q) => Q.startsWith("viseme_"));
7092
- console.log("Viseme morph targets found:", Y), Y.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"));
7094
+ const Y = a.current.morphs[0].morphTargetDictionary;
7095
+ console.log("Available morph targets:", Object.keys(Y));
7096
+ const Z = Object.keys(Y).filter(($) => $.startsWith("viseme_"));
7097
+ console.log("Viseme morph targets found:", Z), Z.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"));
7093
7098
  }
7094
- if (await new Promise((X) => {
7095
- const Y = () => {
7096
- a.current.lipsync && Object.keys(a.current.lipsync).length > 0 ? (console.log("Lip-sync modules loaded:", Object.keys(a.current.lipsync)), X()) : (console.log("Waiting for lip-sync modules to load..."), setTimeout(Y, 100));
7099
+ if (await new Promise((Y) => {
7100
+ const Z = () => {
7101
+ a.current.lipsync && Object.keys(a.current.lipsync).length > 0 ? (console.log("Lip-sync modules loaded:", Object.keys(a.current.lipsync)), Y()) : (console.log("Waiting for lip-sync modules to load..."), setTimeout(Z, 100));
7097
7102
  };
7098
- Y();
7103
+ Z();
7099
7104
  }), a.current && a.current.setShowFullAvatar)
7100
7105
  try {
7101
7106
  a.current.setShowFullAvatar(!0), console.log("Avatar initialized in full body mode");
7102
- } catch (X) {
7103
- console.warn("Error setting full body mode on initialization:", X);
7107
+ } catch (Y) {
7108
+ console.warn("Error setting full body mode on initialization:", Y);
7104
7109
  }
7105
7110
  r(!1), y(!0), n(a.current);
7106
- const N = () => {
7111
+ const W = () => {
7107
7112
  document.visibilityState === "visible" ? a.current?.start() : a.current?.stop();
7108
7113
  };
7109
- return document.addEventListener("visibilitychange", N), () => {
7110
- document.removeEventListener("visibilitychange", N);
7114
+ return document.addEventListener("visibilitychange", W), () => {
7115
+ document.removeEventListener("visibilitychange", W);
7111
7116
  };
7112
7117
  } catch (S) {
7113
7118
  console.error("Error initializing TalkingHead:", S), d(S.message || "Failed to initialize avatar"), r(!1), e(S);
7114
7119
  }
7115
7120
  }, []);
7116
- ye(() => (z(), () => {
7121
+ ve(() => (z(), () => {
7117
7122
  a.current && (a.current.stop(), a.current.dispose(), a.current = null);
7118
7123
  }), [z]);
7119
- const R = E((S) => {
7124
+ const v = M((S) => {
7120
7125
  if (a.current && g)
7121
7126
  try {
7122
7127
  console.log("Speaking text:", S), console.log("Avatar config:", p), console.log("TalkingHead instance:", a.current), a.current.lipsync && Object.keys(a.current.lipsync).length > 0 ? (console.log("Lip-sync modules loaded:", Object.keys(a.current.lipsync)), a.current.setSlowdownRate && (a.current.setSlowdownRate(1.05), console.log("Applied timing adjustment for better lip-sync")), a.current.speakText(S)) : (console.warn("Lip-sync modules not ready, waiting..."), setTimeout(() => {
7123
7128
  a.current && a.current.lipsync ? (console.log("Lip-sync now ready, speaking..."), a.current.setSlowdownRate && (a.current.setSlowdownRate(1.05), console.log("Applied timing adjustment for better lip-sync")), a.current.speakText(S)) : console.error("Lip-sync still not ready after waiting");
7124
7129
  }, 500));
7125
- } catch (N) {
7126
- console.error("Error speaking text:", N), d(N.message || "Failed to speak text");
7130
+ } catch (W) {
7131
+ console.error("Error speaking text:", W), d(W.message || "Failed to speak text");
7127
7132
  }
7128
7133
  else
7129
7134
  console.warn("Avatar not ready for speaking. isReady:", g, "talkingHeadRef:", !!a.current);
7130
- }, [g, p]), T = E(() => {
7135
+ }, [g, p]), T = M(() => {
7131
7136
  a.current && (a.current.stopSpeaking(), a.current.setSlowdownRate && (a.current.setSlowdownRate(1), console.log("Reset timing to normal")));
7132
- }, []), P = E((S) => {
7137
+ }, []), F = M((S) => {
7133
7138
  a.current && a.current.setMood(S);
7134
- }, []), ie = E((S) => {
7139
+ }, []), J = M((S) => {
7135
7140
  a.current && a.current.setSlowdownRate && (a.current.setSlowdownRate(S), console.log("Timing adjustment set to:", S));
7136
- }, []), he = E((S, N = !1) => {
7141
+ }, []), ye = M((S, W = !1) => {
7137
7142
  if (a.current && a.current.playAnimation) {
7138
7143
  if (a.current.setShowFullAvatar)
7139
7144
  try {
7140
7145
  a.current.setShowFullAvatar(!0);
7141
- } catch (Y) {
7142
- console.warn("Error setting full body mode:", Y);
7146
+ } catch (Z) {
7147
+ console.warn("Error setting full body mode:", Z);
7143
7148
  }
7144
7149
  if (S.includes("."))
7145
7150
  try {
7146
- a.current.playAnimation(S, null, 10, 0, 0.01, N), console.log("Playing animation:", S);
7147
- } catch (Y) {
7148
- console.log(`Failed to play ${S}:`, Y);
7151
+ a.current.playAnimation(S, null, 10, 0, 0.01, W), console.log("Playing animation:", S);
7152
+ } catch (Z) {
7153
+ console.log(`Failed to play ${S}:`, Z);
7149
7154
  try {
7150
7155
  a.current.setBodyMovement("idle"), console.log("Fallback to idle animation");
7151
- } catch (Q) {
7152
- console.warn("Fallback animation also failed:", Q);
7156
+ } catch ($) {
7157
+ console.warn("Fallback animation also failed:", $);
7153
7158
  }
7154
7159
  }
7155
7160
  else {
7156
- const Y = [".fbx", ".glb", ".gltf"];
7157
- let Q = !1;
7158
- for (const J of Y)
7161
+ const Z = [".fbx", ".glb", ".gltf"];
7162
+ let $ = !1;
7163
+ for (const se of Z)
7159
7164
  try {
7160
- a.current.playAnimation(S + J, null, 10, 0, 0.01, N), console.log("Playing animation:", S + J), Q = !0;
7165
+ a.current.playAnimation(S + se, null, 10, 0, 0.01, W), console.log("Playing animation:", S + se), $ = !0;
7161
7166
  break;
7162
7167
  } catch {
7163
- console.log(`Failed to play ${S}${J}, trying next format...`);
7168
+ console.log(`Failed to play ${S}${se}, trying next format...`);
7164
7169
  }
7165
- if (!Q) {
7170
+ if (!$) {
7166
7171
  console.warn("Animation system not available or animation not found:", S);
7167
7172
  try {
7168
7173
  a.current.setBodyMovement("idle"), console.log("Fallback to idle animation");
7169
- } catch (J) {
7170
- console.warn("Fallback animation also failed:", J);
7174
+ } catch (se) {
7175
+ console.warn("Fallback animation also failed:", se);
7171
7176
  }
7172
7177
  }
7173
7178
  }
7174
7179
  } else
7175
7180
  console.warn("Animation system not available or animation not found:", S);
7176
7181
  }, []);
7177
- return Ae(l, () => ({
7178
- speakText: R,
7182
+ return Ce(l, () => ({
7183
+ speakText: v,
7179
7184
  stopSpeaking: T,
7180
- setMood: P,
7181
- setTimingAdjustment: ie,
7182
- playAnimation: he,
7185
+ setMood: F,
7186
+ setTimingAdjustment: J,
7187
+ playAnimation: ye,
7183
7188
  isReady: g,
7184
7189
  talkingHead: a.current,
7185
7190
  setBodyMovement: (S) => {
7186
7191
  if (a.current && a.current.setShowFullAvatar && a.current.setBodyMovement)
7187
7192
  try {
7188
7193
  a.current.setShowFullAvatar(!0), a.current.setBodyMovement(S), console.log("Body movement set with full body mode:", S);
7189
- } catch (N) {
7190
- console.warn("Error setting body movement:", N);
7194
+ } catch (W) {
7195
+ console.warn("Error setting body movement:", W);
7191
7196
  }
7192
7197
  },
7193
7198
  setMovementIntensity: (S) => a.current?.setMovementIntensity(S),
@@ -7203,8 +7208,8 @@ const ut = Le(({
7203
7208
  if (a.current && a.current.setShowFullAvatar && a.current.playReaction)
7204
7209
  try {
7205
7210
  a.current.setShowFullAvatar(!0), a.current.playReaction(S), console.log("Reaction played with full body mode:", S);
7206
- } catch (N) {
7207
- console.warn("Error playing reaction:", N);
7211
+ } catch (W) {
7212
+ console.warn("Error playing reaction:", W);
7208
7213
  }
7209
7214
  },
7210
7215
  playCelebration: () => {
@@ -7219,8 +7224,8 @@ const ut = Le(({
7219
7224
  if (a.current && a.current.setShowFullAvatar)
7220
7225
  try {
7221
7226
  a.current.setShowFullAvatar(S), console.log("Show full avatar set to:", S);
7222
- } catch (N) {
7223
- console.warn("Error setting showFullAvatar:", N);
7227
+ } catch (W) {
7228
+ console.warn("Error setting showFullAvatar:", W);
7224
7229
  }
7225
7230
  },
7226
7231
  lockAvatarPosition: () => {
@@ -7239,8 +7244,8 @@ const ut = Le(({
7239
7244
  console.warn("Error unlocking avatar position:", S);
7240
7245
  }
7241
7246
  }
7242
- })), /* @__PURE__ */ Ee("div", { className: `talking-head-container ${i}`, style: s, children: [
7243
- /* @__PURE__ */ de(
7247
+ })), /* @__PURE__ */ De("div", { className: `talking-head-container ${i}`, style: s, children: [
7248
+ /* @__PURE__ */ ge(
7244
7249
  "div",
7245
7250
  {
7246
7251
  ref: u,
@@ -7252,7 +7257,7 @@ const ut = Le(({
7252
7257
  }
7253
7258
  }
7254
7259
  ),
7255
- h && /* @__PURE__ */ de("div", { className: "loading-overlay", style: {
7260
+ h && /* @__PURE__ */ ge("div", { className: "loading-overlay", style: {
7256
7261
  position: "absolute",
7257
7262
  top: "50%",
7258
7263
  left: "50%",
@@ -7261,7 +7266,7 @@ const ut = Le(({
7261
7266
  fontSize: "18px",
7262
7267
  zIndex: 10
7263
7268
  }, children: "Loading avatar..." }),
7264
- c && /* @__PURE__ */ de("div", { className: "error-overlay", style: {
7269
+ c && /* @__PURE__ */ ge("div", { className: "error-overlay", style: {
7265
7270
  position: "absolute",
7266
7271
  top: "50%",
7267
7272
  left: "50%",
@@ -7275,9 +7280,9 @@ const ut = Le(({
7275
7280
  }, children: c })
7276
7281
  ] });
7277
7282
  });
7278
- ut.displayName = "TalkingHeadComponent";
7279
- const ct = Le(({
7280
- curriculumData: O = null,
7283
+ pt.displayName = "TalkingHeadComponent";
7284
+ const gt = ze(({
7285
+ curriculumData: U = null,
7281
7286
  avatarConfig: t = {},
7282
7287
  animations: e = {},
7283
7288
  onLessonStart: n = () => {
@@ -7292,7 +7297,7 @@ const ct = Le(({
7292
7297
  },
7293
7298
  autoStart: u = !1
7294
7299
  }, a) => {
7295
- const h = Z(null), r = Z({
7300
+ const h = N(null), r = N({
7296
7301
  currentModuleIndex: 0,
7297
7302
  currentLessonIndex: 0,
7298
7303
  currentQuestionIndex: 0,
@@ -7302,18 +7307,18 @@ const ct = Le(({
7302
7307
  curriculumCompleted: !1,
7303
7308
  score: 0,
7304
7309
  totalQuestions: 0
7305
- }), c = Z({
7310
+ }), c = N({
7306
7311
  onLessonStart: n,
7307
7312
  onLessonComplete: i,
7308
7313
  onQuestionAnswer: s,
7309
7314
  onCurriculumComplete: o,
7310
7315
  onCustomAction: l
7311
- }), d = Z(null), g = Z(null), y = Z(null), x = Z(null), I = Z(null), D = Z(null), p = Z(null), C = Z(O?.curriculum || {
7316
+ }), d = N(null), g = N(null), y = N(null), x = N(null), I = N(null), B = N(null), p = N(null), H = N(U?.curriculum || {
7312
7317
  title: "Default Curriculum",
7313
7318
  description: "No curriculum data provided",
7314
7319
  language: "en",
7315
7320
  modules: []
7316
- }), z = Z({
7321
+ }), z = N({
7317
7322
  avatarUrl: t.avatarUrl || "/avatars/brunette.glb",
7318
7323
  avatarBody: t.avatarBody || "F",
7319
7324
  mood: t.mood || "happy",
@@ -7327,7 +7332,7 @@ const ct = Le(({
7327
7332
  animations: e,
7328
7333
  lipsyncLang: "en"
7329
7334
  });
7330
- ye(() => {
7335
+ ve(() => {
7331
7336
  c.current = {
7332
7337
  onLessonStart: n,
7333
7338
  onLessonComplete: i,
@@ -7335,8 +7340,8 @@ const ct = Le(({
7335
7340
  onCurriculumComplete: o,
7336
7341
  onCustomAction: l
7337
7342
  };
7338
- }, [n, i, s, o, l]), ye(() => {
7339
- C.current = O?.curriculum || {
7343
+ }, [n, i, s, o, l]), ve(() => {
7344
+ H.current = U?.curriculum || {
7340
7345
  title: "Default Curriculum",
7341
7346
  description: "No curriculum data provided",
7342
7347
  language: "en",
@@ -7355,12 +7360,12 @@ const ct = Le(({
7355
7360
  animations: e,
7356
7361
  lipsyncLang: "en"
7357
7362
  };
7358
- }, [O, t, e]);
7359
- const R = E(() => (C.current || { modules: [] }).modules[r.current.currentModuleIndex]?.lessons[r.current.currentLessonIndex], []), T = E(() => R()?.questions[r.current.currentQuestionIndex], [R]), P = E((b, v) => v.type === "multiple_choice" || v.type === "true_false" ? b === v.answer : v.type === "code_test" && typeof b == "object" && b !== null ? b.passed === !0 : !1, []), ie = E(() => {
7363
+ }, [U, t, e]);
7364
+ const v = M(() => (H.current || { modules: [] }).modules[r.current.currentModuleIndex]?.lessons[r.current.currentLessonIndex], []), T = M(() => v()?.questions[r.current.currentQuestionIndex], [v]), F = M((b, R) => R.type === "multiple_choice" || R.type === "true_false" ? b === R.answer : R.type === "code_test" && typeof b == "object" && b !== null ? b.passed === !0 : !1, []), J = M(() => {
7360
7365
  r.current.lessonCompleted = !0, r.current.isQuestionMode = !1;
7361
7366
  const b = r.current.totalQuestions > 0 ? Math.round(r.current.score / r.current.totalQuestions * 100) : 100;
7362
- let v = "Congratulations! You've completed this lesson";
7363
- if (r.current.totalQuestions > 0 ? v += ` You got ${r.current.score} correct out of ${r.current.totalQuestions} question${r.current.totalQuestions === 1 ? "" : "s"}, achieving a score of ${b} percent. ` : v += "! ", b >= 80 ? v += "Excellent work! You have a great understanding of this topic." : b >= 60 ? v += "Good job! You understand most of the concepts." : v += "Keep practicing! You're making progress.", c.current.onLessonComplete({
7367
+ let R = "Congratulations! You've completed this lesson";
7368
+ if (r.current.totalQuestions > 0 ? R += ` You got ${r.current.score} correct out of ${r.current.totalQuestions} question${r.current.totalQuestions === 1 ? "" : "s"}, achieving a score of ${b} percent. ` : R += "! ", b >= 80 ? R += "Excellent work! You have a great understanding of this topic." : b >= 60 ? R += "Good job! You understand most of the concepts." : R += "Keep practicing! You're making progress.", c.current.onLessonComplete({
7364
7369
  moduleIndex: r.current.currentModuleIndex,
7365
7370
  lessonIndex: r.current.currentLessonIndex,
7366
7371
  score: r.current.score,
@@ -7380,8 +7385,8 @@ const ct = Le(({
7380
7385
  } catch {
7381
7386
  h.current.playCelebration();
7382
7387
  }
7383
- const w = C.current || { modules: [] }, H = w.modules[r.current.currentModuleIndex], U = r.current.currentLessonIndex < (H?.lessons?.length || 0) - 1, te = r.current.currentModuleIndex < (w.modules?.length || 0) - 1, q = U || te, j = z.current || { lipsyncLang: "en" };
7384
- h.current.speakText(v, {
7388
+ const w = H.current || { modules: [] }, C = w.modules[r.current.currentModuleIndex], D = r.current.currentLessonIndex < (C?.lessons?.length || 0) - 1, te = r.current.currentModuleIndex < (w.modules?.length || 0) - 1, q = D || te, j = z.current || { lipsyncLang: "en" };
7389
+ h.current.speakText(R, {
7385
7390
  lipsyncLang: j.lipsyncLang,
7386
7391
  onSpeechEnd: () => {
7387
7392
  c.current.onCustomAction({
@@ -7396,12 +7401,12 @@ const ct = Le(({
7396
7401
  }
7397
7402
  });
7398
7403
  }
7399
- }, [e.lessonComplete]), he = E(() => {
7404
+ }, [e.lessonComplete]), ye = M(() => {
7400
7405
  r.current.curriculumCompleted = !0;
7401
- const b = C.current || { modules: [] };
7406
+ const b = H.current || { modules: [] };
7402
7407
  if (c.current.onCurriculumComplete({
7403
7408
  modules: b.modules.length,
7404
- totalLessons: b.modules.reduce((v, w) => v + w.lessons.length, 0)
7409
+ totalLessons: b.modules.reduce((R, w) => R + w.lessons.length, 0)
7405
7410
  }), h.current) {
7406
7411
  if (h.current.setMood("celebrating"), e.curriculumComplete)
7407
7412
  try {
@@ -7409,99 +7414,99 @@ const ct = Le(({
7409
7414
  } catch {
7410
7415
  h.current.playCelebration();
7411
7416
  }
7412
- const v = z.current || { lipsyncLang: "en" };
7413
- h.current.speakText("Amazing! You've completed the entire curriculum! You're now ready to move on to more advanced topics. Well done!", { lipsyncLang: v.lipsyncLang });
7417
+ const R = z.current || { lipsyncLang: "en" };
7418
+ h.current.speakText("Amazing! You've completed the entire curriculum! You're now ready to move on to more advanced topics. Well done!", { lipsyncLang: R.lipsyncLang });
7414
7419
  }
7415
- }, [e.curriculumComplete]), S = E(() => {
7416
- const b = R();
7420
+ }, [e.curriculumComplete]), S = M(() => {
7421
+ const b = v();
7417
7422
  r.current.isQuestionMode = !0, r.current.currentQuestionIndex = 0, r.current.totalQuestions = b?.questions?.length || 0, r.current.score = 0;
7418
- const v = T();
7419
- v && c.current.onCustomAction({
7423
+ const R = T();
7424
+ R && c.current.onCustomAction({
7420
7425
  type: "questionStart",
7421
7426
  moduleIndex: r.current.currentModuleIndex,
7422
7427
  lessonIndex: r.current.currentLessonIndex,
7423
7428
  questionIndex: r.current.currentQuestionIndex,
7424
7429
  totalQuestions: r.current.totalQuestions,
7425
- question: v,
7430
+ question: R,
7426
7431
  score: r.current.score
7427
7432
  });
7428
7433
  const w = () => {
7429
- if (!h.current || !v) return;
7434
+ if (!h.current || !R) return;
7430
7435
  if (h.current.setMood("happy"), e.questionStart)
7431
7436
  try {
7432
7437
  h.current.playAnimation(e.questionStart, !0);
7433
- } catch (U) {
7434
- console.warn("Failed to play questionStart animation:", U);
7438
+ } catch (D) {
7439
+ console.warn("Failed to play questionStart animation:", D);
7435
7440
  }
7436
- const H = z.current || { lipsyncLang: "en" };
7437
- v.type === "code_test" ? h.current.speakText(`Let's test your coding skills! Here's your first challenge: ${v.question}`, { lipsyncLang: H.lipsyncLang }) : v.type === "multiple_choice" ? h.current.speakText(`Now let me ask you some questions. Here's the first one: ${v.question}`, { lipsyncLang: H.lipsyncLang }) : v.type === "true_false" ? h.current.speakText(`Let's start with some true or false questions. First question: ${v.question}`, { lipsyncLang: H.lipsyncLang }) : h.current.speakText(`Now let me ask you some questions. Here's the first one: ${v.question}`, { lipsyncLang: H.lipsyncLang });
7441
+ const C = z.current || { lipsyncLang: "en" };
7442
+ R.type === "code_test" ? h.current.speakText(`Let's test your coding skills! Here's your first challenge: ${R.question}`, { lipsyncLang: C.lipsyncLang }) : R.type === "multiple_choice" ? h.current.speakText(`Now let me ask you some questions. Here's the first one: ${R.question}`, { lipsyncLang: C.lipsyncLang }) : R.type === "true_false" ? h.current.speakText(`Let's start with some true or false questions. First question: ${R.question}`, { lipsyncLang: C.lipsyncLang }) : h.current.speakText(`Now let me ask you some questions. Here's the first one: ${R.question}`, { lipsyncLang: C.lipsyncLang });
7438
7443
  };
7439
- if (h.current && h.current.isReady && v)
7444
+ if (h.current && h.current.isReady && R)
7440
7445
  w();
7441
7446
  else if (h.current && h.current.isReady) {
7442
- const H = z.current || { lipsyncLang: "en" };
7443
- h.current.speakText("Now let me ask you some questions to test your understanding.", { lipsyncLang: H.lipsyncLang });
7447
+ const C = z.current || { lipsyncLang: "en" };
7448
+ h.current.speakText("Now let me ask you some questions to test your understanding.", { lipsyncLang: C.lipsyncLang });
7444
7449
  } else {
7445
- const H = setInterval(() => {
7446
- h.current && h.current.isReady && (clearInterval(H), v && w());
7450
+ const C = setInterval(() => {
7451
+ h.current && h.current.isReady && (clearInterval(C), R && w());
7447
7452
  }, 100);
7448
7453
  setTimeout(() => {
7449
- clearInterval(H);
7454
+ clearInterval(C);
7450
7455
  }, 5e3);
7451
7456
  }
7452
- }, [e.questionStart, R, T]), N = E(() => {
7453
- const b = R();
7457
+ }, [e.questionStart, v, T]), W = M(() => {
7458
+ const b = v();
7454
7459
  if (r.current.currentQuestionIndex < (b?.questions?.length || 0) - 1) {
7455
7460
  h.current && h.current.stopSpeaking && h.current.stopSpeaking(), r.current.currentQuestionIndex += 1;
7456
- const v = T();
7457
- v && c.current.onCustomAction({
7461
+ const R = T();
7462
+ R && c.current.onCustomAction({
7458
7463
  type: "nextQuestion",
7459
7464
  moduleIndex: r.current.currentModuleIndex,
7460
7465
  lessonIndex: r.current.currentLessonIndex,
7461
7466
  questionIndex: r.current.currentQuestionIndex,
7462
7467
  totalQuestions: r.current.totalQuestions,
7463
- question: v,
7468
+ question: R,
7464
7469
  score: r.current.score
7465
7470
  });
7466
7471
  const w = () => {
7467
- if (!h.current || !v) return;
7472
+ if (!h.current || !R) return;
7468
7473
  if (h.current.setMood("happy"), h.current.setBodyMovement("idle"), e.nextQuestion)
7469
7474
  try {
7470
7475
  h.current.playAnimation(e.nextQuestion, !0);
7471
7476
  } catch (j) {
7472
7477
  console.warn("Failed to play nextQuestion animation:", j);
7473
7478
  }
7474
- const H = z.current || { lipsyncLang: "en" }, te = R()?.questions?.length || 0, q = r.current.currentQuestionIndex >= te - 1;
7475
- if (v.type === "code_test") {
7476
- const j = q ? `Great! Here's your final coding challenge: ${v.question}` : `Great! Now let's move on to your next coding challenge: ${v.question}`;
7479
+ const C = z.current || { lipsyncLang: "en" }, te = v()?.questions?.length || 0, q = r.current.currentQuestionIndex >= te - 1;
7480
+ if (R.type === "code_test") {
7481
+ const j = q ? `Great! Here's your final coding challenge: ${R.question}` : `Great! Now let's move on to your next coding challenge: ${R.question}`;
7477
7482
  h.current.speakText(j, {
7478
- lipsyncLang: H.lipsyncLang
7483
+ lipsyncLang: C.lipsyncLang
7479
7484
  });
7480
- } else if (v.type === "multiple_choice") {
7481
- const j = q ? `Alright! Here's your final question: ${v.question}` : `Alright! Here's your next question: ${v.question}`;
7485
+ } else if (R.type === "multiple_choice") {
7486
+ const j = q ? `Alright! Here's your final question: ${R.question}` : `Alright! Here's your next question: ${R.question}`;
7482
7487
  h.current.speakText(j, {
7483
- lipsyncLang: H.lipsyncLang
7488
+ lipsyncLang: C.lipsyncLang
7484
7489
  });
7485
- } else if (v.type === "true_false") {
7486
- const j = q ? `Now let's try this final one: ${v.question}` : `Now let's try this one: ${v.question}`;
7490
+ } else if (R.type === "true_false") {
7491
+ const j = q ? `Now let's try this final one: ${R.question}` : `Now let's try this one: ${R.question}`;
7487
7492
  h.current.speakText(j, {
7488
- lipsyncLang: H.lipsyncLang
7493
+ lipsyncLang: C.lipsyncLang
7489
7494
  });
7490
7495
  } else {
7491
- const j = q ? `Here's your final question: ${v.question}` : `Here's the next question: ${v.question}`;
7496
+ const j = q ? `Here's your final question: ${R.question}` : `Here's the next question: ${R.question}`;
7492
7497
  h.current.speakText(j, {
7493
- lipsyncLang: H.lipsyncLang
7498
+ lipsyncLang: C.lipsyncLang
7494
7499
  });
7495
7500
  }
7496
7501
  };
7497
- if (h.current && h.current.isReady && v)
7502
+ if (h.current && h.current.isReady && R)
7498
7503
  w();
7499
- else if (v) {
7500
- const H = setInterval(() => {
7501
- h.current && h.current.isReady && (clearInterval(H), w());
7504
+ else if (R) {
7505
+ const C = setInterval(() => {
7506
+ h.current && h.current.isReady && (clearInterval(C), w());
7502
7507
  }, 100);
7503
7508
  setTimeout(() => {
7504
- clearInterval(H);
7509
+ clearInterval(C);
7505
7510
  }, 5e3);
7506
7511
  }
7507
7512
  } else
@@ -7512,11 +7517,11 @@ const ct = Le(({
7512
7517
  totalQuestions: r.current.totalQuestions,
7513
7518
  score: r.current.score
7514
7519
  });
7515
- }, [e.nextQuestion, R, T]), X = E(() => {
7516
- const b = C.current || { modules: [] }, v = b.modules[r.current.currentModuleIndex];
7517
- if (r.current.currentLessonIndex < (v?.lessons?.length || 0) - 1) {
7520
+ }, [e.nextQuestion, v, T]), Y = M(() => {
7521
+ const b = H.current || { modules: [] }, R = b.modules[r.current.currentModuleIndex];
7522
+ if (r.current.currentLessonIndex < (R?.lessons?.length || 0) - 1) {
7518
7523
  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;
7519
- const H = b.modules[r.current.currentModuleIndex], U = r.current.currentLessonIndex < (H?.lessons?.length || 0) - 1, te = r.current.currentModuleIndex < (b.modules?.length || 0) - 1, q = U || te;
7524
+ const C = b.modules[r.current.currentModuleIndex], D = r.current.currentLessonIndex < (C?.lessons?.length || 0) - 1, te = r.current.currentModuleIndex < (b.modules?.length || 0) - 1, q = D || te;
7520
7525
  c.current.onCustomAction({
7521
7526
  type: "lessonStart",
7522
7527
  moduleIndex: r.current.currentModuleIndex,
@@ -7525,11 +7530,11 @@ const ct = Le(({
7525
7530
  }), c.current.onLessonStart({
7526
7531
  moduleIndex: r.current.currentModuleIndex,
7527
7532
  lessonIndex: r.current.currentLessonIndex,
7528
- lesson: R()
7533
+ lesson: v()
7529
7534
  }), h.current && (h.current.setMood("happy"), h.current.setBodyMovement("idle"));
7530
7535
  } else if (r.current.currentModuleIndex < (b.modules?.length || 0) - 1) {
7531
7536
  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;
7532
- const U = b.modules[r.current.currentModuleIndex], te = r.current.currentLessonIndex < (U?.lessons?.length || 0) - 1, q = r.current.currentModuleIndex < (b.modules?.length || 0) - 1, j = te || q;
7537
+ const D = b.modules[r.current.currentModuleIndex], te = r.current.currentLessonIndex < (D?.lessons?.length || 0) - 1, q = r.current.currentModuleIndex < (b.modules?.length || 0) - 1, j = te || q;
7533
7538
  c.current.onCustomAction({
7534
7539
  type: "lessonStart",
7535
7540
  moduleIndex: r.current.currentModuleIndex,
@@ -7538,29 +7543,29 @@ const ct = Le(({
7538
7543
  }), c.current.onLessonStart({
7539
7544
  moduleIndex: r.current.currentModuleIndex,
7540
7545
  lessonIndex: r.current.currentLessonIndex,
7541
- lesson: R()
7546
+ lesson: v()
7542
7547
  }), h.current && (h.current.setMood("happy"), h.current.setBodyMovement("idle"));
7543
7548
  } else
7544
7549
  I.current && I.current();
7545
- }, []), Y = E(() => {
7546
- const b = R();
7547
- let v = null;
7550
+ }, []), Z = M(() => {
7551
+ const b = v();
7552
+ let R = null;
7548
7553
  if (b?.avatar_script && b?.body) {
7549
- const w = b.avatar_script.trim(), H = b.body.trim(), U = w.match(/[.!?]$/) ? " " : ". ";
7550
- v = `${w}${U}${H}`;
7554
+ const w = b.avatar_script.trim(), C = b.body.trim(), D = w.match(/[.!?]$/) ? " " : ". ";
7555
+ R = `${w}${D}${C}`;
7551
7556
  } else
7552
- v = b?.avatar_script || b?.body || null;
7553
- if (h.current && h.current.isReady && v) {
7557
+ R = b?.avatar_script || b?.body || null;
7558
+ if (h.current && h.current.isReady && R) {
7554
7559
  r.current.isTeaching = !0, r.current.isQuestionMode = !1, r.current.score = 0, r.current.totalQuestions = 0, h.current.setMood("happy");
7555
7560
  let w = !1;
7556
7561
  if (e.teaching)
7557
7562
  try {
7558
7563
  h.current.playAnimation(e.teaching, !0), w = !0;
7559
- } catch (U) {
7560
- console.warn("Failed to play teaching animation:", U);
7564
+ } catch (D) {
7565
+ console.warn("Failed to play teaching animation:", D);
7561
7566
  }
7562
7567
  w || h.current.setBodyMovement("gesturing");
7563
- const H = z.current || { lipsyncLang: "en" };
7568
+ const C = z.current || { lipsyncLang: "en" };
7564
7569
  c.current.onLessonStart({
7565
7570
  moduleIndex: r.current.currentModuleIndex,
7566
7571
  lessonIndex: r.current.currentLessonIndex,
@@ -7570,8 +7575,8 @@ const ct = Le(({
7570
7575
  moduleIndex: r.current.currentModuleIndex,
7571
7576
  lessonIndex: r.current.currentLessonIndex,
7572
7577
  lesson: b
7573
- }), h.current.speakText(v, {
7574
- lipsyncLang: H.lipsyncLang,
7578
+ }), h.current.speakText(R, {
7579
+ lipsyncLang: C.lipsyncLang,
7575
7580
  onSpeechEnd: () => {
7576
7581
  r.current.isTeaching = !1, c.current.onCustomAction({
7577
7582
  type: "teachingComplete",
@@ -7583,15 +7588,15 @@ const ct = Le(({
7583
7588
  }
7584
7589
  });
7585
7590
  }
7586
- }, [e.teaching, R]), Q = E((b) => {
7587
- const v = T(), w = P(b, v);
7591
+ }, [e.teaching, v]), $ = M((b) => {
7592
+ const R = T(), w = F(b, R);
7588
7593
  if (w && (r.current.score += 1), c.current.onQuestionAnswer({
7589
7594
  moduleIndex: r.current.currentModuleIndex,
7590
7595
  lessonIndex: r.current.currentLessonIndex,
7591
7596
  questionIndex: r.current.currentQuestionIndex,
7592
7597
  answer: b,
7593
7598
  isCorrect: w,
7594
- question: v
7599
+ question: R
7595
7600
  }), h.current)
7596
7601
  if (w) {
7597
7602
  if (h.current.setMood("happy"), e.correct)
@@ -7601,9 +7606,9 @@ const ct = Le(({
7601
7606
  h.current.setBodyMovement("happy");
7602
7607
  }
7603
7608
  h.current.setBodyMovement("gesturing");
7604
- const U = R()?.questions?.length || 0;
7605
- r.current.currentQuestionIndex >= U - 1;
7606
- const te = v.type === "code_test" ? `Great job! Your code passed all the tests! ${v.explanation || ""}` : `Excellent! That's correct! ${v.explanation || ""}`, q = z.current || { lipsyncLang: "en" };
7609
+ const D = v()?.questions?.length || 0;
7610
+ r.current.currentQuestionIndex >= D - 1;
7611
+ const te = R.type === "code_test" ? `Great job! Your code passed all the tests! ${R.explanation || ""}` : `Excellent! That's correct! ${R.explanation || ""}`, q = z.current || { lipsyncLang: "en" };
7607
7612
  h.current.speakText(te, {
7608
7613
  lipsyncLang: q.lipsyncLang,
7609
7614
  onSpeechEnd: () => {
@@ -7613,7 +7618,7 @@ const ct = Le(({
7613
7618
  lessonIndex: r.current.currentLessonIndex,
7614
7619
  questionIndex: r.current.currentQuestionIndex,
7615
7620
  isCorrect: !0,
7616
- hasNextQuestion: r.current.currentQuestionIndex < U - 1,
7621
+ hasNextQuestion: r.current.currentQuestionIndex < D - 1,
7617
7622
  score: r.current.score,
7618
7623
  totalQuestions: r.current.totalQuestions
7619
7624
  });
@@ -7627,7 +7632,7 @@ const ct = Le(({
7627
7632
  h.current.setBodyMovement("idle");
7628
7633
  }
7629
7634
  h.current.setBodyMovement("gesturing");
7630
- const U = R()?.questions?.length || 0, te = r.current.currentQuestionIndex >= U - 1, 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 || ""}${te ? "" : " Let's move on to the next question."}`, j = z.current || { lipsyncLang: "en" };
7635
+ const D = v()?.questions?.length || 0, te = r.current.currentQuestionIndex >= D - 1, q = R.type === "code_test" ? `Your code didn't pass all the tests. ${R.explanation || "Try again!"}` : `Not quite right, but don't worry! ${R.explanation || ""}${te ? "" : " Let's move on to the next question."}`, j = z.current || { lipsyncLang: "en" };
7631
7636
  h.current.speakText(q, {
7632
7637
  lipsyncLang: j.lipsyncLang,
7633
7638
  onSpeechEnd: () => {
@@ -7637,7 +7642,7 @@ const ct = Le(({
7637
7642
  lessonIndex: r.current.currentLessonIndex,
7638
7643
  questionIndex: r.current.currentQuestionIndex,
7639
7644
  isCorrect: !1,
7640
- hasNextQuestion: r.current.currentQuestionIndex < U - 1,
7645
+ hasNextQuestion: r.current.currentQuestionIndex < D - 1,
7641
7646
  score: r.current.score,
7642
7647
  totalQuestions: r.current.totalQuestions
7643
7648
  });
@@ -7645,26 +7650,26 @@ const ct = Le(({
7645
7650
  });
7646
7651
  }
7647
7652
  else {
7648
- const U = R()?.questions?.length || 0;
7653
+ const D = v()?.questions?.length || 0;
7649
7654
  c.current.onCustomAction({
7650
7655
  type: "answerFeedbackComplete",
7651
7656
  moduleIndex: r.current.currentModuleIndex,
7652
7657
  lessonIndex: r.current.currentLessonIndex,
7653
7658
  questionIndex: r.current.currentQuestionIndex,
7654
7659
  isCorrect: w,
7655
- hasNextQuestion: r.current.currentQuestionIndex < U - 1,
7660
+ hasNextQuestion: r.current.currentQuestionIndex < D - 1,
7656
7661
  score: r.current.score,
7657
7662
  totalQuestions: r.current.totalQuestions,
7658
7663
  avatarNotReady: !0
7659
7664
  });
7660
7665
  }
7661
- }, [e.correct, e.incorrect, T, R, P]), J = E((b) => {
7662
- const v = T();
7666
+ }, [e.correct, e.incorrect, T, v, F]), se = M((b) => {
7667
+ const R = T();
7663
7668
  if (!b || typeof b != "object") {
7664
7669
  console.error("Invalid code test result format. Expected object with {passed: boolean, ...}");
7665
7670
  return;
7666
7671
  }
7667
- if (v?.type !== "code_test") {
7672
+ if (R?.type !== "code_test") {
7668
7673
  console.warn("Current question is not a code test. Use handleAnswerSelect for other question types.");
7669
7674
  return;
7670
7675
  }
@@ -7684,9 +7689,9 @@ const ct = Le(({
7684
7689
  lessonIndex: r.current.currentLessonIndex,
7685
7690
  questionIndex: r.current.currentQuestionIndex,
7686
7691
  testResult: w,
7687
- question: v
7692
+ question: R
7688
7693
  }), p.current && p.current(w);
7689
- }, [T, P]), oe = E(() => {
7694
+ }, [T, F]), de = M(() => {
7690
7695
  if (r.current.currentQuestionIndex > 0) {
7691
7696
  r.current.currentQuestionIndex -= 1;
7692
7697
  const b = T();
@@ -7699,7 +7704,7 @@ const ct = Le(({
7699
7704
  question: b,
7700
7705
  score: r.current.score
7701
7706
  });
7702
- const v = () => {
7707
+ const R = () => {
7703
7708
  if (!h.current || !b) return;
7704
7709
  h.current.setMood("happy"), h.current.setBodyMovement("idle");
7705
7710
  const w = z.current || { lipsyncLang: "en" };
@@ -7710,18 +7715,18 @@ const ct = Le(({
7710
7715
  });
7711
7716
  };
7712
7717
  if (h.current && h.current.isReady && b)
7713
- v();
7718
+ R();
7714
7719
  else if (b) {
7715
7720
  const w = setInterval(() => {
7716
- h.current && h.current.isReady && (clearInterval(w), v());
7721
+ h.current && h.current.isReady && (clearInterval(w), R());
7717
7722
  }, 100);
7718
7723
  setTimeout(() => {
7719
7724
  clearInterval(w);
7720
7725
  }, 5e3);
7721
7726
  }
7722
7727
  }
7723
- }, [T]), me = E(() => {
7724
- const b = C.current || { modules: [] };
7728
+ }, [T]), me = M(() => {
7729
+ const b = H.current || { modules: [] };
7725
7730
  if (b.modules[r.current.currentModuleIndex], r.current.currentLessonIndex > 0)
7726
7731
  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, c.current.onCustomAction({
7727
7732
  type: "lessonStart",
@@ -7730,64 +7735,64 @@ const ct = Le(({
7730
7735
  }), c.current.onLessonStart({
7731
7736
  moduleIndex: r.current.currentModuleIndex,
7732
7737
  lessonIndex: r.current.currentLessonIndex,
7733
- lesson: R()
7738
+ lesson: v()
7734
7739
  }), h.current && (h.current.setMood("happy"), h.current.setBodyMovement("idle"));
7735
7740
  else if (r.current.currentModuleIndex > 0) {
7736
- const H = b.modules[r.current.currentModuleIndex - 1];
7737
- r.current.currentModuleIndex -= 1, r.current.currentLessonIndex = (H?.lessons?.length || 1) - 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, c.current.onCustomAction({
7741
+ const C = b.modules[r.current.currentModuleIndex - 1];
7742
+ r.current.currentModuleIndex -= 1, r.current.currentLessonIndex = (C?.lessons?.length || 1) - 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, c.current.onCustomAction({
7738
7743
  type: "lessonStart",
7739
7744
  moduleIndex: r.current.currentModuleIndex,
7740
7745
  lessonIndex: r.current.currentLessonIndex
7741
7746
  }), c.current.onLessonStart({
7742
7747
  moduleIndex: r.current.currentModuleIndex,
7743
7748
  lessonIndex: r.current.currentLessonIndex,
7744
- lesson: R()
7749
+ lesson: v()
7745
7750
  }), h.current && (h.current.setMood("happy"), h.current.setBodyMovement("idle"));
7746
7751
  }
7747
- }, [R]), se = E(() => {
7752
+ }, [v]), ie = M(() => {
7748
7753
  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;
7749
- }, []), pe = E((b) => {
7754
+ }, []), fe = M((b) => {
7750
7755
  console.log("Avatar is ready!", b);
7751
- const v = R(), w = v?.avatar_script || v?.body;
7756
+ const R = v(), w = R?.avatar_script || R?.body;
7752
7757
  u && w && setTimeout(() => {
7753
7758
  d.current && d.current();
7754
7759
  }, 10);
7755
- }, [u, R]);
7756
- We(() => {
7757
- d.current = Y, g.current = X, y.current = ie, x.current = N, I.current = he, D.current = S, p.current = Q;
7758
- }), Ae(a, () => ({
7760
+ }, [u, v]);
7761
+ Xe(() => {
7762
+ d.current = Z, g.current = Y, y.current = J, x.current = W, I.current = ye, B.current = S, p.current = $;
7763
+ }), Ce(a, () => ({
7759
7764
  // Curriculum control methods
7760
- startTeaching: Y,
7765
+ startTeaching: Z,
7761
7766
  startQuestions: S,
7762
- handleAnswerSelect: Q,
7763
- handleCodeTestResult: J,
7764
- nextQuestion: N,
7765
- previousQuestion: oe,
7766
- nextLesson: X,
7767
+ handleAnswerSelect: $,
7768
+ handleCodeTestResult: se,
7769
+ nextQuestion: W,
7770
+ previousQuestion: de,
7771
+ nextLesson: Y,
7767
7772
  previousLesson: me,
7768
- completeLesson: ie,
7769
- completeCurriculum: he,
7770
- resetCurriculum: se,
7773
+ completeLesson: J,
7774
+ completeCurriculum: ye,
7775
+ resetCurriculum: ie,
7771
7776
  getState: () => ({ ...r.current }),
7772
7777
  getCurrentQuestion: () => T(),
7773
- getCurrentLesson: () => R(),
7778
+ getCurrentLesson: () => v(),
7774
7779
  // Direct access to avatar ref (always returns current value)
7775
7780
  getAvatarRef: () => h.current,
7776
7781
  // Convenience methods that delegate to avatar (always check current ref)
7777
- speakText: async (b, v = {}) => {
7782
+ speakText: async (b, R = {}) => {
7778
7783
  await h.current?.resumeAudioContext?.();
7779
7784
  const w = z.current || { lipsyncLang: "en" };
7780
- h.current?.speakText(b, { ...v, lipsyncLang: v.lipsyncLang || w.lipsyncLang });
7785
+ h.current?.speakText(b, { ...R, lipsyncLang: R.lipsyncLang || w.lipsyncLang });
7781
7786
  },
7782
7787
  resumeAudioContext: async () => {
7783
7788
  if (h.current?.resumeAudioContext)
7784
7789
  return await h.current.resumeAudioContext();
7785
7790
  const b = h.current?.talkingHead;
7786
7791
  if (b?.audioCtx) {
7787
- const v = b.audioCtx;
7788
- if (v.state === "suspended" || v.state === "interrupted")
7792
+ const R = b.audioCtx;
7793
+ if (R.state === "suspended" || R.state === "interrupted")
7789
7794
  try {
7790
- await v.resume(), console.log("Audio context resumed via talkingHead");
7795
+ await R.resume(), console.log("Audio context resumed via talkingHead");
7791
7796
  } catch (w) {
7792
7797
  console.warn("Failed to resume audio context:", w);
7793
7798
  }
@@ -7799,7 +7804,7 @@ const ct = Le(({
7799
7804
  resumeSpeaking: async () => await h.current?.resumeSpeaking(),
7800
7805
  isPaused: () => h.current && typeof h.current.isPaused < "u" ? h.current.isPaused : !1,
7801
7806
  setMood: (b) => h.current?.setMood(b),
7802
- playAnimation: (b, v) => h.current?.playAnimation(b, v),
7807
+ playAnimation: (b, R) => h.current?.playAnimation(b, R),
7803
7808
  setBodyMovement: (b) => h.current?.setBodyMovement(b),
7804
7809
  setMovementIntensity: (b) => h.current?.setMovementIntensity(b),
7805
7810
  playRandomDance: () => h.current?.playRandomDance(),
@@ -7810,10 +7815,10 @@ const ct = Le(({
7810
7815
  lockAvatarPosition: () => h.current?.lockAvatarPosition(),
7811
7816
  unlockAvatarPosition: () => h.current?.unlockAvatarPosition(),
7812
7817
  // Custom action trigger
7813
- triggerCustomAction: (b, v) => {
7818
+ triggerCustomAction: (b, R) => {
7814
7819
  c.current.onCustomAction({
7815
7820
  type: b,
7816
- ...v,
7821
+ ...R,
7817
7822
  state: { ...r.current }
7818
7823
  });
7819
7824
  },
@@ -7821,8 +7826,8 @@ const ct = Le(({
7821
7826
  handleResize: () => h.current?.handleResize(),
7822
7827
  // Avatar readiness check (always returns current value)
7823
7828
  isAvatarReady: () => h.current?.isReady || !1
7824
- }), [Y, S, Q, J, N, X, ie, he, se, T, R]);
7825
- const ee = z.current || {
7829
+ }), [Z, S, $, se, W, Y, J, ye, ie, T, v]);
7830
+ const X = z.current || {
7826
7831
  avatarUrl: "/avatars/brunette.glb",
7827
7832
  avatarBody: "F",
7828
7833
  mood: "happy",
@@ -7835,23 +7840,23 @@ const ct = Le(({
7835
7840
  showFullAvatar: !1,
7836
7841
  animations: e
7837
7842
  };
7838
- return /* @__PURE__ */ de("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ de(
7839
- Pe,
7843
+ return /* @__PURE__ */ ge("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ ge(
7844
+ Ne,
7840
7845
  {
7841
7846
  ref: h,
7842
- avatarUrl: ee.avatarUrl,
7843
- avatarBody: ee.avatarBody,
7844
- mood: ee.mood,
7845
- ttsLang: ee.ttsLang,
7846
- ttsService: ee.ttsService,
7847
- ttsVoice: ee.ttsVoice,
7848
- ttsApiKey: ee.ttsApiKey,
7849
- bodyMovement: ee.bodyMovement,
7850
- movementIntensity: ee.movementIntensity,
7851
- showFullAvatar: ee.showFullAvatar,
7847
+ avatarUrl: X.avatarUrl,
7848
+ avatarBody: X.avatarBody,
7849
+ mood: X.mood,
7850
+ ttsLang: X.ttsLang,
7851
+ ttsService: X.ttsService,
7852
+ ttsVoice: X.ttsVoice,
7853
+ ttsApiKey: X.ttsApiKey,
7854
+ bodyMovement: X.bodyMovement,
7855
+ movementIntensity: X.movementIntensity,
7856
+ showFullAvatar: X.showFullAvatar,
7852
7857
  cameraView: "upper",
7853
- animations: ee.animations,
7854
- onReady: pe,
7858
+ animations: X.animations,
7859
+ onReady: fe,
7855
7860
  onLoading: () => {
7856
7861
  },
7857
7862
  onError: (b) => {
@@ -7860,8 +7865,8 @@ const ct = Le(({
7860
7865
  }
7861
7866
  ) });
7862
7867
  });
7863
- ct.displayName = "CurriculumLearning";
7864
- const Be = {
7868
+ gt.displayName = "CurriculumLearning";
7869
+ const Ue = {
7865
7870
  // Code-based dance animations (no FBX required)
7866
7871
  dance: {
7867
7872
  name: "dance",
@@ -7964,14 +7969,14 @@ const Be = {
7964
7969
  duration: 5e3,
7965
7970
  description: "Excited, energetic movement"
7966
7971
  }
7967
- }, It = (O) => Be[O] || null, Lt = (O) => Be.hasOwnProperty(O);
7972
+ }, kt = (U) => Ue[U] || null, wt = (U) => Ue.hasOwnProperty(U);
7968
7973
  export {
7969
- ct as CurriculumLearning,
7970
- Pe as TalkingHeadAvatar,
7971
- ut as TalkingHeadComponent,
7972
- Be as animations,
7973
- Se as getActiveTTSConfig,
7974
- It as getAnimation,
7975
- Rt as getVoiceOptions,
7976
- Lt as hasAnimation
7974
+ gt as CurriculumLearning,
7975
+ Ne as TalkingHeadAvatar,
7976
+ pt as TalkingHeadComponent,
7977
+ Ue as animations,
7978
+ He as getActiveTTSConfig,
7979
+ kt as getAnimation,
7980
+ St as getVoiceOptions,
7981
+ wt as hasAnimation
7977
7982
  };