@liforma/client 0.4.14 → 0.4.15

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/next/index.js +275 -263
  3. package/dist/next/index.js.map +1 -1
  4. package/dist/next/v2/embed/protocol.d.ts +7 -7
  5. package/dist/next/v2/embed/protocol.d.ts.map +1 -1
  6. package/dist/next/v2/experience.d.ts +8 -5
  7. package/dist/next/v2/experience.d.ts.map +1 -1
  8. package/dist/next/v2/types/sessionLaunch.d.ts +6 -0
  9. package/dist/next/v2/types/sessionLaunch.d.ts.map +1 -1
  10. package/dist/npm/index.js +475 -463
  11. package/dist/npm/index.js.map +1 -1
  12. package/dist/npm/v2/embed/protocol.d.ts +7 -7
  13. package/dist/npm/v2/embed/protocol.d.ts.map +1 -1
  14. package/dist/npm/v2/experience.d.ts +8 -5
  15. package/dist/npm/v2/experience.d.ts.map +1 -1
  16. package/dist/npm/v2/index.d.ts +1 -1
  17. package/dist/npm/v2/index.d.ts.map +1 -1
  18. package/dist/npm/v2/npm.d.ts +1 -1
  19. package/dist/npm/v2/npm.d.ts.map +1 -1
  20. package/dist/npm/v2/types/index.d.ts +1 -1
  21. package/dist/npm/v2/types/index.d.ts.map +1 -1
  22. package/dist/npm/v2/types/sessionLaunch.d.ts +6 -0
  23. package/dist/npm/v2/types/sessionLaunch.d.ts.map +1 -1
  24. package/dist/react/component/experienceComponentRuntime.d.ts +3 -1
  25. package/dist/react/component/experienceComponentRuntime.d.ts.map +1 -1
  26. package/dist/react/component/experienceComponentTypes.d.ts +6 -4
  27. package/dist/react/component/experienceComponentTypes.d.ts.map +1 -1
  28. package/dist/react/index.js +486 -468
  29. package/dist/react/index.js.map +1 -1
  30. package/dist/react/react/Experience.d.ts.map +1 -1
  31. package/dist/react/v2/embed/protocol.d.ts +7 -7
  32. package/dist/react/v2/embed/protocol.d.ts.map +1 -1
  33. package/dist/react/v2/experience.d.ts +8 -5
  34. package/dist/react/v2/experience.d.ts.map +1 -1
  35. package/dist/react/v2/types/sessionLaunch.d.ts +6 -0
  36. package/dist/react/v2/types/sessionLaunch.d.ts.map +1 -1
  37. package/dist/sdk/v2/client.js +3 -3
  38. package/dist/sdk/v2/client.js.map +1 -1
  39. package/dist/svelte/Experience.svelte +4 -0
  40. package/package.json +1 -1
@@ -263,7 +263,9 @@ function P(e = () => ({}), t = () => ({})) {
263
263
  interaction: d.interaction,
264
264
  closeButton: d.closeButton,
265
265
  returnUrl: f,
266
- ...d.theatreButton ? { theatreButton: !0 } : {},
266
+ ...d.settingsButton === void 0 ? {} : { settingsButton: d.settingsButton },
267
+ ...d.theatreButton === void 0 ? {} : { theatreButton: d.theatreButton },
268
+ ...d.fullscreenButton === void 0 ? {} : { fullscreenButton: d.fullscreenButton },
267
269
  ...d.theatre === void 0 ? {} : { theatre: d.theatre },
268
270
  onTheatreChange: (e) => t().onTheatreChange?.(e),
269
271
  showClose: !!(o().onClose || f || d.closeButton === !0 || d.closeButton && typeof d.closeButton == "object" && d.closeButton.visible !== !1),
@@ -355,8 +357,8 @@ function L(e, t) {
355
357
  }
356
358
  //#endregion
357
359
  //#region src/react/Experience.tsx
358
- var ne = e(function(e, a) {
359
- let { returnUrl: c, fit: l, stage: u, pipBackground: p, pipShadow: m, startButton: h, theme: g, showFeedback: y, interaction: b, theatreButton: x, theatre: S, onTheatreChange: C, closeButton: w, onReady: T, onStarted: E, onUserTranscript: D, onUserSpeechStarted: O, onUserSpeechEnded: ee, onCharacterSpeechStarted: j, onCharacterSpeechEnded: M, onCharacterFocusChanged: N, onConversationUpdate: F, onMessage: te, onListeningState: I, onActivityChange: ne, onFeedback: re, onFeedbackFailed: ie, onConversationProcessorError: R, onPlayerStatusChange: ae, onStateUpdate: oe, onClose: z, onError: se } = e, ce = o({}), le = o({
360
+ var R = e(function(e, a) {
361
+ let { returnUrl: c, fit: l, stage: u, pipBackground: p, pipShadow: m, startButton: h, theme: g, showFeedback: y, interaction: b, settingsButton: x, theatreButton: S, fullscreenButton: C, theatre: w, onTheatreChange: T, closeButton: E, onReady: D, onStarted: O, onUserTranscript: ee, onUserSpeechStarted: j, onUserSpeechEnded: M, onCharacterSpeechStarted: N, onCharacterSpeechEnded: F, onCharacterFocusChanged: te, onConversationUpdate: I, onMessage: R, onListeningState: ne, onActivityChange: re, onFeedback: z, onFeedbackFailed: ie, onConversationProcessorError: ae, onPlayerStatusChange: B, onStateUpdate: oe, onClose: se, onError: ce } = e, le = o({}), V = o({
360
362
  fit: l,
361
363
  stage: u,
362
364
  pipBackground: p,
@@ -365,13 +367,15 @@ var ne = e(function(e, a) {
365
367
  theme: g,
366
368
  showFeedback: y,
367
369
  interaction: b,
368
- closeButton: w,
370
+ closeButton: E,
369
371
  returnUrl: c,
370
- theatreButton: x,
371
- theatre: S,
372
- onTheatreChange: C
373
- }), B = o(P(() => ce.current, () => le.current)), V = o(null), [ue, de] = s(!1), [fe, pe] = s(null), H = o(null), me = o(null), he = v(e);
374
- le.current = {
372
+ settingsButton: x,
373
+ theatreButton: S,
374
+ fullscreenButton: C,
375
+ theatre: w,
376
+ onTheatreChange: T
377
+ }), H = o(P(() => le.current, () => V.current)), U = o(null), [ue, de] = s(!1), [W, fe] = s(null), pe = o(null), me = o(null), he = v(e);
378
+ V.current = {
375
379
  fit: l,
376
380
  stage: u,
377
381
  pipBackground: p,
@@ -380,110 +384,112 @@ var ne = e(function(e, a) {
380
384
  theme: g,
381
385
  showFeedback: y,
382
386
  interaction: b,
383
- closeButton: w,
387
+ closeButton: E,
384
388
  returnUrl: c,
385
- theatreButton: x,
386
- theatre: S,
387
- onTheatreChange: C
388
- }, ce.current = {
389
- onReady: T,
390
- onStarted: E,
391
- onUserTranscript: D,
392
- onUserSpeechStarted: O,
393
- onUserSpeechEnded: ee,
394
- onCharacterSpeechStarted: j,
395
- onCharacterSpeechEnded: M,
396
- onCharacterFocusChanged: N,
397
- onConversationUpdate: F,
398
- onMessage: te,
399
- onListeningState: I,
400
- onActivityChange: ne,
401
- onFeedback: re,
389
+ settingsButton: x,
390
+ theatreButton: S,
391
+ fullscreenButton: C,
392
+ theatre: w,
393
+ onTheatreChange: T
394
+ }, le.current = {
395
+ onReady: D,
396
+ onStarted: O,
397
+ onUserTranscript: ee,
398
+ onUserSpeechStarted: j,
399
+ onUserSpeechEnded: M,
400
+ onCharacterSpeechStarted: N,
401
+ onCharacterSpeechEnded: F,
402
+ onCharacterFocusChanged: te,
403
+ onConversationUpdate: I,
404
+ onMessage: R,
405
+ onListeningState: ne,
406
+ onActivityChange: re,
407
+ onFeedback: z,
402
408
  onFeedbackFailed: ie,
403
- onConversationProcessorError: R,
404
- onPlayerStatusChange: ae,
409
+ onConversationProcessorError: ae,
410
+ onPlayerStatusChange: B,
405
411
  onStateUpdate: oe,
406
- onClose: z,
407
- onError: se
412
+ onClose: se,
413
+ onError: ce
408
414
  };
409
415
  let ge = t((e) => {
410
- H.current = e, de(e !== null);
416
+ pe.current = e, de(e !== null);
411
417
  }, []);
412
418
  return r(a, () => ({
413
419
  ready: () => {
414
- let e = V.current;
420
+ let e = U.current;
415
421
  return !e || e.destroyed ? Promise.reject(k()) : e.ready.promise;
416
422
  },
417
423
  started: () => {
418
- let e = V.current;
424
+ let e = U.current;
419
425
  return !e || e.destroyed ? Promise.reject(k()) : e.started.promise;
420
426
  },
421
427
  speech: {
422
- speak: (e) => B.current.withSession((t) => t.speech.speak(e)),
423
- play: (e) => B.current.withSession((t) => t.speech.play(e)),
428
+ speak: (e) => H.current.withSession((t) => t.speech.speak(e)),
429
+ play: (e) => H.current.withSession((t) => t.speech.play(e)),
424
430
  createUtterance: (e) => {
425
- let t = B.current.getActiveInstance();
431
+ let t = H.current.getActiveInstance();
426
432
  if (!t) throw Error("Session has not started. Wait for the player start button and the started event before using speech APIs.");
427
433
  return t.speech.createUtterance(e);
428
434
  },
429
- interrupt: (e) => B.current.withSession((t) => t.speech.interrupt(e))
435
+ interrupt: (e) => H.current.withSession((t) => t.speech.interrupt(e))
430
436
  },
431
- startListening: () => B.current.withSession((e) => e.startListening()),
432
- stopListening: () => B.current.withSession((e) => e.stopListening()),
433
- listenOnce: (e) => B.current.withSession((t) => t.listenOnce(e)),
434
- getSession: () => B.current.getActiveInstance()?.getSession() ?? null,
435
- getManifest: () => B.current.getActiveInstance()?.getManifest() ?? null,
436
- getConversation: () => B.current.getActiveInstance()?.getConversation() ?? [],
437
- focusCharacter: (e) => B.current.withSession((t) => t.focusCharacter(e)),
438
- setFit: (e) => B.current.withSession((t) => t.setFit(e)),
439
- setStage: (e) => B.current.withSession((t) => t.setStage(e)),
440
- setPipBackground: (e) => B.current.withSession((t) => t.setPipBackground(e)),
441
- setPipShadow: (e) => B.current.withSession((t) => t.setPipShadow(e)),
437
+ startListening: () => H.current.withSession((e) => e.startListening()),
438
+ stopListening: () => H.current.withSession((e) => e.stopListening()),
439
+ listenOnce: (e) => H.current.withSession((t) => t.listenOnce(e)),
440
+ getSession: () => H.current.getActiveInstance()?.getSession() ?? null,
441
+ getManifest: () => H.current.getActiveInstance()?.getManifest() ?? null,
442
+ getConversation: () => H.current.getActiveInstance()?.getConversation() ?? [],
443
+ focusCharacter: (e) => H.current.withSession((t) => t.focusCharacter(e)),
444
+ setFit: (e) => H.current.withSession((t) => t.setFit(e)),
445
+ setStage: (e) => H.current.withSession((t) => t.setStage(e)),
446
+ setPipBackground: (e) => H.current.withSession((t) => t.setPipBackground(e)),
447
+ setPipShadow: (e) => H.current.withSession((t) => t.setPipShadow(e)),
442
448
  setTheatre: (e) => {
443
- B.current.getActiveInstance()?.setTheatre(e);
449
+ H.current.getActiveInstance()?.setTheatre(e);
444
450
  },
445
- conversion: (e) => B.current.withSession((t) => t.conversion(e)),
446
- engage: () => B.current.withSession((e) => e.engage()),
447
- end: () => B.current.withSession((e) => e.end())
451
+ conversion: (e) => H.current.withSession((t) => t.conversion(e)),
452
+ engage: () => H.current.withSession((e) => e.engage()),
453
+ end: () => H.current.withSession((e) => e.end())
448
454
  }), []), i(() => {
449
- if (!ue || !H.current) return;
450
- let t = H.current, n = B.current, r;
455
+ if (!ue || !pe.current) return;
456
+ let t = pe.current, n = H.current, r;
451
457
  try {
452
458
  r = { options: _(e) };
453
459
  } catch (e) {
454
460
  r = { error: A(e) };
455
461
  }
456
- let i = n.activateGeneration(t, r, c, pe);
457
- return V.current = i, () => {
458
- n.cancelGeneration(i), V.current === i && (V.current = null);
462
+ let i = n.activateGeneration(t, r, c, fe);
463
+ return U.current = i, () => {
464
+ n.cancelGeneration(i), U.current === i && (U.current = null);
459
465
  };
460
466
  }, [
461
467
  ue,
462
468
  he,
463
469
  c
464
470
  ]), n(() => {
465
- let e = B.current.getActiveInstance();
471
+ let e = H.current.getActiveInstance();
466
472
  e && e.setFit(l ?? "full");
467
473
  }, [l]), n(() => {
468
- let e = B.current.getActiveInstance();
474
+ let e = H.current.getActiveInstance();
469
475
  e && e.setStage(u ?? "fill");
470
476
  }, [u]), n(() => {
471
- let e = B.current.getActiveInstance();
477
+ let e = H.current.getActiveInstance();
472
478
  e && e.setPipBackground(p ?? "none");
473
479
  }, [p]), n(() => {
474
480
  if (m === void 0) return;
475
- let e = B.current.getActiveInstance();
481
+ let e = H.current.getActiveInstance();
476
482
  e && e.setPipShadow(m);
477
483
  }, [m]), n(() => {
478
- if (!x) return;
479
- let e = B.current.getActiveInstance();
480
- e && e.setTheatre(S === !0);
481
- }, [x, S]), n(() => {
484
+ if (!S) return;
485
+ let e = H.current.getActiveInstance();
486
+ e && e.setTheatre(w === !0);
487
+ }, [S, w]), n(() => {
482
488
  let e = me.current;
483
- if (!e || (e.replaceChildren(), !fe)) return;
484
- let t = L(e, fe);
489
+ if (!e || (e.replaceChildren(), !W)) return;
490
+ let t = L(e, W);
485
491
  return () => t.remove();
486
- }, [fe]), /* @__PURE__ */ f("div", {
492
+ }, [W]), /* @__PURE__ */ f("div", {
487
493
  className: "liforma-experience-shell",
488
494
  style: {
489
495
  position: "relative",
@@ -494,12 +500,12 @@ var ne = e(function(e, a) {
494
500
  children: [/* @__PURE__ */ d("div", {
495
501
  ref: me,
496
502
  className: "liforma-experience-error-host",
497
- "aria-hidden": fe ? void 0 : !0,
503
+ "aria-hidden": W ? void 0 : !0,
498
504
  style: {
499
505
  position: "absolute",
500
506
  inset: 0,
501
507
  zIndex: 20,
502
- pointerEvents: fe ? "auto" : "none"
508
+ pointerEvents: W ? "auto" : "none"
503
509
  }
504
510
  }), /* @__PURE__ */ d("div", {
505
511
  ref: ge,
@@ -514,20 +520,20 @@ var ne = e(function(e, a) {
514
520
  });
515
521
  //#endregion
516
522
  //#region src/thumbnail/types.ts
517
- function re(e) {
523
+ function ne(e) {
518
524
  return e === "face" ? "liforma-et--fit-face" : e === "medium" ? "liforma-et--fit-medium" : "";
519
525
  }
520
526
  //#endregion
521
527
  //#region src/thumbnail/locationPlate.ts
522
- var ie = /(-)(\d+x\d+)(\.(?:webp|avif))(\?|$)/i;
523
- function R(e, t) {
528
+ var re = /(-)(\d+x\d+)(\.(?:webp|avif))(\?|$)/i;
529
+ function z(e, t) {
524
530
  return !Number.isFinite(e) || !Number.isFinite(t) || e < 1 || t < 1 || e <= t ? "256x256" : t <= 225 ? "400x225" : e > 800 || t > 450 ? "1672x941" : "800x450";
525
531
  }
526
- function ae(e, t) {
532
+ function ie(e, t) {
527
533
  let n = e.trim();
528
- return n && n.replace(ie, (e, n, r, i, a) => `${n}${t}${i}${a}`);
534
+ return n && n.replace(re, (e, n, r, i, a) => `${n}${t}${i}${a}`);
529
535
  }
530
- function oe(e, t) {
536
+ function ae(e, t) {
531
537
  let n = () => {
532
538
  t(e.clientWidth, e.clientHeight);
533
539
  };
@@ -535,17 +541,17 @@ function oe(e, t) {
535
541
  let r = new ResizeObserver(n);
536
542
  return r.observe(e), () => r.disconnect();
537
543
  }
538
- var z = /-(256x256|400x225|400x450|800x450|836x971|1672x941|167x94)$/i;
539
- function se(e) {
544
+ var B = /-(256x256|400x225|400x450|800x450|836x971|1672x941|167x94)$/i;
545
+ function oe(e) {
540
546
  return e?.trim().replace(/\/$/, "") || "https://cdn.liforma.ai";
541
547
  }
542
- function ce(e) {
548
+ function se(e) {
543
549
  return /^https?:\/\//i.test(e) || e.startsWith("//");
544
550
  }
545
- function le(e) {
551
+ function ce(e) {
546
552
  return e.startsWith("//") ? `https:${e}` : e;
547
553
  }
548
- function B(e) {
554
+ function le(e) {
549
555
  let t = e.indexOf("?");
550
556
  return t === -1 ? {
551
557
  pathname: e,
@@ -558,24 +564,24 @@ function B(e) {
558
564
  function V(e, t, n = "") {
559
565
  return `${e}${t.startsWith("/") ? t : `/${t}`}${n}`;
560
566
  }
561
- function ue(e, t, n) {
567
+ function H(e, t, n) {
562
568
  let r = e.trim();
563
569
  if (!r) return r;
564
- let i = se(n);
565
- if (ce(r)) return ae(le(r), t);
566
- let { pathname: a, search: o } = B(r.replace(/\\/g, "/")), s = a;
570
+ let i = oe(n);
571
+ if (se(r)) return ie(ce(r), t);
572
+ let { pathname: a, search: o } = le(r.replace(/\\/g, "/")), s = a;
567
573
  if (!s.startsWith("/")) s = `/locations/${s.replace(/^locations\//i, "")}`;
568
574
  else if (!/^\/locations\//i.test(s)) return /^\/avatars\//i.test(s) ? V(i, s, o) : r;
569
- if (/\.webp$/i.test(s) && !z.test(s.replace(/\.webp$/i, ""))) return V(i, s, o);
575
+ if (/\.webp$/i.test(s) && !B.test(s.replace(/\.webp$/i, ""))) return V(i, s, o);
570
576
  let c = s.replace(/^\/locations\//i, "").replace(/\.webp$/i, "");
571
- return c = c.replace(z, ""), `${i}/locations/${c}-${t}.webp${o}`;
577
+ return c = c.replace(B, ""), `${i}/locations/${c}-${t}.webp${o}`;
572
578
  }
573
- function de(e, t) {
579
+ function U(e, t) {
574
580
  let n = e.trim();
575
581
  if (!n) return n;
576
- let r = se(t);
577
- if (ce(n)) return le(n);
578
- let { pathname: i, search: a } = B(n.replace(/\\/g, "/")), o = i;
582
+ let r = oe(t);
583
+ if (se(n)) return ce(n);
584
+ let { pathname: i, search: a } = le(n.replace(/\\/g, "/")), o = i;
579
585
  if (!o.startsWith("/")) if (/^avatars\//i.test(o)) o = `/${o}`;
580
586
  else if (/^[^/]+$/.test(o) && !a) return `${r}/avatars/${o}/256/${o}_neutral.webp`;
581
587
  else return n;
@@ -585,21 +591,21 @@ function de(e, t) {
585
591
  }
586
592
  //#endregion
587
593
  //#region src/thumbnail/toGalleryThumbUrl.ts
588
- var fe = /(\/avatars\/[^/]+\/)(\d+)(\/)/i, pe = /_CH(\.webp)/i;
589
- function H(e) {
594
+ var ue = /(\/avatars\/[^/]+\/)(\d+)(\/)/i, de = /_CH(\.webp)/i;
595
+ function W(e) {
590
596
  return /\/locations\//i.test(e) || /^locations\//i.test(e) ? !0 : /^https?:\/\//i.test(e) || e.startsWith("//") || /^\/?avatars\//i.test(e) || e.startsWith("/") ? !1 : e.includes("/");
591
597
  }
592
- function me(e, t = "256x256", n) {
598
+ function fe(e, t = "256x256", n) {
593
599
  let r = e.trim();
594
600
  if (!r) return r;
595
- if (H(r)) return ue(r, t, n);
596
- let i = de(r, n);
597
- return i = i.replace(fe, (e, t, n, r) => n === "256" ? `${t}${n}${r}` : `${t}256${r}`), i.replace(pe, "_neutral$1");
601
+ if (W(r)) return H(r, t, n);
602
+ let i = U(r, n);
603
+ return i = i.replace(ue, (e, t, n, r) => n === "256" ? `${t}${n}${r}` : `${t}256${r}`), i.replace(de, "_neutral$1");
598
604
  }
599
- function he(e) {
605
+ function pe(e) {
600
606
  let t = e.avatarImage?.trim() || e.galleryThumb?.avatarImage?.trim() || "";
601
607
  if (!t) return null;
602
- let n = e.backgroundImage?.trim() || e.galleryThumb?.backgroundImage?.trim() || "", r = e.foregroundImage?.trim() || e.galleryThumb?.foregroundImage?.trim() || "", i = e.fallbackImage?.trim() || "", a = e.locationPlateSize ?? "256x256", o = se(e.cdnBaseUrl), s = e.normalize !== !1, c = (e) => !s && /^https?:\/\//i.test(e.trim()) ? e.trim() : me(e, a, o), l = (e) => !s && /^https?:\/\//i.test(e.trim()) ? e.trim() : ue(e, a, o);
608
+ let n = e.backgroundImage?.trim() || e.galleryThumb?.backgroundImage?.trim() || "", r = e.foregroundImage?.trim() || e.galleryThumb?.foregroundImage?.trim() || "", i = e.fallbackImage?.trim() || "", a = e.locationPlateSize ?? "256x256", o = oe(e.cdnBaseUrl), s = e.normalize !== !1, c = (e) => !s && /^https?:\/\//i.test(e.trim()) ? e.trim() : fe(e, a, o), l = (e) => !s && /^https?:\/\//i.test(e.trim()) ? e.trim() : H(e, a, o);
603
609
  return {
604
610
  avatarImage: c(t),
605
611
  ...n ? { backgroundImage: l(n) } : {},
@@ -609,7 +615,7 @@ function he(e) {
609
615
  }
610
616
  //#endregion
611
617
  //#region src/shims/localStack.ts
612
- function ge() {
618
+ function me() {
613
619
  if (globalThis.__LIFORMA_STACK === "local") return !0;
614
620
  if (typeof location > "u") return !1;
615
621
  try {
@@ -620,16 +626,16 @@ function ge() {
620
626
  }
621
627
  //#endregion
622
628
  //#region src/thumbnail/hostedLaunchUrl.ts
623
- var _e = "https://player.liforma.ai", ve = "http://localhost:3002";
624
- function U(e) {
629
+ var he = "https://player.liforma.ai", ge = "http://localhost:3002";
630
+ function _e(e) {
625
631
  return e.href?.trim() ? "anchor" : e.hasClickHandler ? "button" : e.experienceId?.trim() ? "anchor" : "presentational";
626
632
  }
627
- function W(e) {
633
+ function ve(e) {
628
634
  let t = e?.trim();
629
- return t ? t.replace(/\/$/, "") : ge() ? ve : _e;
635
+ return t ? t.replace(/\/$/, "") : me() ? ge : he;
630
636
  }
631
637
  function ye(e) {
632
- let t = e.experienceId.trim(), n = W(e.playerBaseUrl), r = new URL(`${n}/${encodeURIComponent(t)}`), i = e.returnUrl?.trim();
638
+ let t = e.experienceId.trim(), n = ve(e.playerBaseUrl), r = new URL(`${n}/${encodeURIComponent(t)}`), i = e.returnUrl?.trim();
633
639
  return i && r.searchParams.set("returnUrl", i), r.toString();
634
640
  }
635
641
  function be(e) {
@@ -842,7 +848,7 @@ function Xe(e, t) {
842
848
  return `${e} liforma-et__media${t ? " liforma-et__media--ready" : ""}`;
843
849
  }
844
850
  function Ze(e) {
845
- let { galleryThumb: t, avatarImage: r, backgroundImage: i, foregroundImage: c, alt: l, experienceId: p, href: m, target: h, rel: g, onClick: _, returnUrl: v, playerBaseUrl: y, parallax: b = !0, fit: x = "full", lazy: S = !0, className: C = "", fallbackImage: w, normalizeUrls: T = !0, cdnBaseUrl: E } = e, D = o(null), O = o(!1), [k, A] = s(0), [ee, j] = s(0), M = R(k, ee), N = a(() => he({
851
+ let { galleryThumb: t, avatarImage: r, backgroundImage: i, foregroundImage: c, alt: l, experienceId: p, href: m, target: h, rel: g, onClick: _, returnUrl: v, playerBaseUrl: y, parallax: b = !0, fit: x = "full", lazy: S = !0, className: C = "", fallbackImage: w, normalizeUrls: T = !0, cdnBaseUrl: E } = e, D = o(null), O = o(!1), [k, A] = s(0), [ee, j] = s(0), M = z(k, ee), N = a(() => pe({
846
852
  galleryThumb: t,
847
853
  avatarImage: r,
848
854
  backgroundImage: i,
@@ -860,14 +866,14 @@ function Ze(e) {
860
866
  T,
861
867
  M,
862
868
  E
863
- ]), P = U({
869
+ ]), P = _e({
864
870
  href: m,
865
871
  hasClickHandler: typeof _ == "function",
866
872
  experienceId: p
867
- }), F = P === "anchor" && !m?.trim() && !!p?.trim(), te = !!N?.backgroundImage, I = b !== !1, [L, ne] = s(!S), [ie, ae] = s(!1), [z, se] = s(!1), [ce, le] = s(!1), [B, V] = s(!1), [ue, de] = s(!1), [fe, pe] = s(!1), [H, me] = s(!1), [ge, _e] = s(0), [ve, W] = s(0), [ye, xe] = s(!1), [Se, Ce] = s(!1), [we, G] = s(!1), [Te, Ee] = s(!1), [De, Oe] = s(), K = N ? ye && N.fallbackImage ? N.fallbackImage : N.avatarImage : "";
873
+ }), F = P === "anchor" && !m?.trim() && !!p?.trim(), te = !!N?.backgroundImage, I = b !== !1, [L, R] = s(!S), [re, ie] = s(!1), [B, oe] = s(!1), [se, ce] = s(!1), [le, V] = s(!1), [H, U] = s(!1), [ue, de] = s(!1), [W, fe] = s(!1), [me, he] = s(0), [ge, ve] = s(0), [ye, xe] = s(!1), [Se, Ce] = s(!1), [we, G] = s(!1), [Te, Ee] = s(!1), [De, Oe] = s(), K = N ? ye && N.fallbackImage ? N.fallbackImage : N.avatarImage : "";
868
874
  n(() => {
869
875
  Ve(ze), Ke().then((e) => {
870
- ae(e), se(!0);
876
+ ie(e), oe(!0);
871
877
  });
872
878
  }, []), n(() => {
873
879
  Oe(be({
@@ -884,25 +890,25 @@ function Ze(e) {
884
890
  y,
885
891
  F
886
892
  ]), n(() => {
887
- Ce(!1), G(!1), Ee(!1), xe(!1), le(!1), V(!1), de(!1);
893
+ Ce(!1), G(!1), Ee(!1), xe(!1), ce(!1), V(!1), U(!1);
888
894
  }, [
889
895
  N?.backgroundImage,
890
896
  N?.foregroundImage,
891
897
  K
892
898
  ]), n(() => {
893
899
  let e = D.current;
894
- if (e) return oe(e, (e, t) => {
900
+ if (e) return ae(e, (e, t) => {
895
901
  A(e), j(t);
896
902
  });
897
903
  }, [P, De]), n(() => {
898
904
  let e = D.current;
899
905
  if (e) {
900
906
  if (!S) {
901
- ne(!0);
907
+ R(!0);
902
908
  return;
903
909
  }
904
910
  return ke(e, { onVisibleChange: (e) => {
905
- e && ne(!0);
911
+ e && R(!0);
906
912
  } });
907
913
  }
908
914
  }, [
@@ -914,7 +920,7 @@ function Ze(e) {
914
920
  let e = D.current;
915
921
  if (!(!e || !I)) return Le(e, {
916
922
  onParallax: (e) => {
917
- me(!0), O.current || (_e(e), W(0));
923
+ fe(!0), O.current || (he(e), ve(0));
918
924
  },
919
925
  pointerActive: () => O.current
920
926
  });
@@ -925,15 +931,15 @@ function Ze(e) {
925
931
  De
926
932
  ]);
927
933
  let Ae = (e) => {
928
- if (!I || H) return;
934
+ if (!I || W) return;
929
935
  let t = e.currentTarget.getBoundingClientRect();
930
- t.width <= 0 || t.height <= 0 || (_e(((e.clientX - t.left) / t.width - .5) * 2), W(((e.clientY - t.top) / t.height - .5) * 2));
936
+ t.width <= 0 || t.height <= 0 || (he(((e.clientX - t.left) / t.width - .5) * 2), ve(((e.clientY - t.top) / t.height - .5) * 2));
931
937
  }, q = (e) => {
932
938
  let t = O.current;
933
- O.current = !1, pe(!1), H && t ? (_e(je(e.getBoundingClientRect(), window.innerHeight)), W(0)) : H || (_e(0), W(0));
939
+ O.current = !1, de(!1), W && t ? (he(je(e.getBoundingClientRect(), window.innerHeight)), ve(0)) : W || (he(0), ve(0));
934
940
  }, Me = (e) => {
935
941
  if (!I) return;
936
- O.current = !0, e.pointerType === "mouse" && pe(!0);
942
+ O.current = !0, e.pointerType === "mouse" && de(!0);
937
943
  let t = e.currentTarget, n = () => {
938
944
  q(t), window.removeEventListener("pointerup", n), window.removeEventListener("pointercancel", n);
939
945
  };
@@ -949,18 +955,18 @@ function Ze(e) {
949
955
  }
950
956
  };
951
957
  if (!N) return null;
952
- let Ne = I && (fe || H), Pe = L && z && (we || Se || Te), Fe = [
958
+ let Ne = I && (ue || W), Pe = L && B && (we || Se || Te), Fe = [
953
959
  "liforma-et",
954
960
  te ? "liforma-et--scene" : "",
955
- re(x),
961
+ ne(x),
956
962
  Ne ? "liforma-et--parallax" : "",
957
- H ? "liforma-et--scroll-parallax" : "",
963
+ W ? "liforma-et--scroll-parallax" : "",
958
964
  L && !Pe ? "liforma-et--loading" : "",
959
965
  Pe ? "liforma-et--revealed" : "",
960
966
  C
961
967
  ].filter(Boolean).join(" "), Ie = {
962
- "--liforma-et-parallax-x": ge,
963
- "--liforma-et-parallax-y": ve
968
+ "--liforma-et-parallax-x": me,
969
+ "--liforma-et-parallax-y": ge
964
970
  }, Re = (e, t) => {
965
971
  e.complete && t(!0);
966
972
  }, Be = /* @__PURE__ */ f(u, { children: [
@@ -968,9 +974,9 @@ function Ze(e) {
968
974
  className: "liforma-et__placeholder",
969
975
  "aria-hidden": "true"
970
976
  }),
971
- L && z && N.backgroundImage ? /* @__PURE__ */ d("img", {
977
+ L && B && N.backgroundImage ? /* @__PURE__ */ d("img", {
972
978
  className: Xe("liforma-et__background", Se),
973
- src: qe(N.backgroundImage, ie),
979
+ src: qe(N.backgroundImage, re),
974
980
  alt: "",
975
981
  decoding: "async",
976
982
  ref: (e) => {
@@ -979,16 +985,16 @@ function Ze(e) {
979
985
  onLoad: () => Ce(!0),
980
986
  onError: (e) => {
981
987
  let t = e.currentTarget, n = Ye(t.src);
982
- if (n && !ce) {
983
- le(!0), t.src = n;
988
+ if (n && !se) {
989
+ ce(!0), t.src = n;
984
990
  return;
985
991
  }
986
992
  Ce(!0);
987
993
  }
988
994
  }) : null,
989
- L && z && K ? /* @__PURE__ */ d("img", {
995
+ L && B && K ? /* @__PURE__ */ d("img", {
990
996
  className: Xe("liforma-et__avatar", we),
991
- src: qe(K, ie),
997
+ src: qe(K, re),
992
998
  alt: "",
993
999
  decoding: "async",
994
1000
  ref: (e) => {
@@ -997,16 +1003,16 @@ function Ze(e) {
997
1003
  onLoad: () => G(!0),
998
1004
  onError: (e) => {
999
1005
  let t = e.currentTarget, n = Je(t.src);
1000
- if (n && !ue) {
1001
- de(!0), t.src = n;
1006
+ if (n && !H) {
1007
+ U(!0), t.src = n;
1002
1008
  return;
1003
1009
  }
1004
1010
  N.fallbackImage ? xe(!0) : G(!0);
1005
1011
  }
1006
1012
  }) : null,
1007
- L && z && N.foregroundImage ? /* @__PURE__ */ d("img", {
1013
+ L && B && N.foregroundImage ? /* @__PURE__ */ d("img", {
1008
1014
  className: Xe("liforma-et__foreground", Te),
1009
- src: qe(N.foregroundImage, ie),
1015
+ src: qe(N.foregroundImage, re),
1010
1016
  alt: "",
1011
1017
  decoding: "async",
1012
1018
  ref: (e) => {
@@ -1015,7 +1021,7 @@ function Ze(e) {
1015
1021
  onLoad: () => Ee(!0),
1016
1022
  onError: (e) => {
1017
1023
  let t = e.currentTarget, n = Ye(t.src);
1018
- if (n && !B) {
1024
+ if (n && !le) {
1019
1025
  V(!0), t.src = n;
1020
1026
  return;
1021
1027
  }
@@ -1027,11 +1033,11 @@ function Ze(e) {
1027
1033
  onPointerUp: (e) => q(e.currentTarget),
1028
1034
  onPointerCancel: (e) => q(e.currentTarget),
1029
1035
  onPointerEnter: (e) => {
1030
- I && e.pointerType === "mouse" && pe(!0);
1036
+ I && e.pointerType === "mouse" && de(!0);
1031
1037
  },
1032
1038
  onPointerMove: Ae,
1033
1039
  onPointerLeave: () => {
1034
- O.current || (pe(!1), H || (_e(0), W(0)));
1040
+ O.current || (de(!1), W || (he(0), ve(0)));
1035
1041
  }
1036
1042
  }, Ue = (e) => {
1037
1043
  D.current = e;
@@ -1091,7 +1097,7 @@ function rt() {
1091
1097
  return t ? t.replace(/\/$/, "") : null;
1092
1098
  }
1093
1099
  function it() {
1094
- return rt() || (ge() ? nt : tt);
1100
+ return rt() || (me() ? nt : tt);
1095
1101
  }
1096
1102
  //#endregion
1097
1103
  //#region src/v2/api/fetchExperiencePreview.ts
@@ -1251,16 +1257,19 @@ function gt(e, t) {
1251
1257
  }
1252
1258
  //#endregion
1253
1259
  //#region src/v2/types/sessionLaunch.ts
1254
- function _t(e) {
1260
+ function _t(e, t) {
1261
+ return t === void 0 ? {} : { [e]: t };
1262
+ }
1263
+ function vt(e) {
1255
1264
  return !!e && typeof e == "object" && !Array.isArray(e);
1256
1265
  }
1257
1266
  function X(e) {
1258
1267
  return typeof e == "boolean";
1259
1268
  }
1260
- function vt(e) {
1261
- if (!_t(e)) return null;
1269
+ function yt(e) {
1270
+ if (!vt(e)) return null;
1262
1271
  let t = e.speech, n = e.conversation, r = e.avatar, i = e.tools;
1263
- return !_t(t) || !_t(n) || !_t(r) || !_t(i) || !X(t.input) || !X(t.output) || !X(t.externalAudio) || !X(n.managed) || !X(r.enabled) || !X(i.enabled) ? null : {
1272
+ return !vt(t) || !vt(n) || !vt(r) || !vt(i) || !X(t.input) || !X(t.output) || !X(t.externalAudio) || !X(n.managed) || !X(r.enabled) || !X(i.enabled) ? null : {
1264
1273
  speech: {
1265
1274
  input: t.input,
1266
1275
  output: t.output,
@@ -1271,8 +1280,8 @@ function vt(e) {
1271
1280
  tools: { enabled: i.enabled }
1272
1281
  };
1273
1282
  }
1274
- function yt(e) {
1275
- return !_t(e) || !X(e.avatar) || !X(e.speechInput) || !X(e.speechOutput) || !X(e.tools) || !X(e.externalAudio) ? null : {
1283
+ function bt(e) {
1284
+ return !vt(e) || !X(e.avatar) || !X(e.speechInput) || !X(e.speechOutput) || !X(e.tools) || !X(e.externalAudio) ? null : {
1276
1285
  speech: {
1277
1286
  input: e.speechInput,
1278
1287
  output: e.speechOutput,
@@ -1283,12 +1292,12 @@ function yt(e) {
1283
1292
  tools: { enabled: e.tools }
1284
1293
  };
1285
1294
  }
1286
- function bt(e) {
1287
- return vt(e) ?? yt(e);
1288
- }
1289
1295
  function xt(e) {
1290
- if (!_t(e)) throw Error("Session Launch response is missing session.");
1291
- let t = typeof e.id == "string" ? e.id.trim() : "", n = typeof e.experienceId == "string" ? e.experienceId.trim() : "", r = typeof e.experienceRevisionId == "string" ? e.experienceRevisionId.trim() : "", i = typeof e.expiresAt == "string" ? e.expiresAt.trim() : "", a = typeof e.locale == "string" ? e.locale.trim() : "", o = typeof e.secondaryLocale == "string" && e.secondaryLocale.trim() ? e.secondaryLocale.trim() : void 0, s = e.mode === "conversation" || e.mode === "presenter" ? e.mode : null, c = bt(e.capabilities), l = St(e.localeVoiceFallbacks), u = e.status === "active" || e.status === "ended" ? e.status : void 0, d = typeof e.createdAt == "string" && e.createdAt.trim() ? e.createdAt.trim() : void 0;
1296
+ return yt(e) ?? bt(e);
1297
+ }
1298
+ function St(e) {
1299
+ if (!vt(e)) throw Error("Session Launch response is missing session.");
1300
+ let t = typeof e.id == "string" ? e.id.trim() : "", n = typeof e.experienceId == "string" ? e.experienceId.trim() : "", r = typeof e.experienceRevisionId == "string" ? e.experienceRevisionId.trim() : "", i = typeof e.expiresAt == "string" ? e.expiresAt.trim() : "", a = typeof e.locale == "string" ? e.locale.trim() : "", o = typeof e.secondaryLocale == "string" && e.secondaryLocale.trim() ? e.secondaryLocale.trim() : void 0, s = e.mode === "conversation" || e.mode === "presenter" ? e.mode : null, c = xt(e.capabilities), l = Ct(e.localeVoiceFallbacks), u = e.status === "active" || e.status === "ended" ? e.status : void 0, d = typeof e.createdAt == "string" && e.createdAt.trim() ? e.createdAt.trim() : void 0;
1292
1301
  if (!t || !n || !r || !i || !a || !s || !c) throw Error("Session Launch response has an invalid session object.");
1293
1302
  return {
1294
1303
  id: t,
@@ -1304,11 +1313,11 @@ function xt(e) {
1304
1313
  ...d ? { createdAt: d } : {}
1305
1314
  };
1306
1315
  }
1307
- function St(e) {
1316
+ function Ct(e) {
1308
1317
  if (!Array.isArray(e) || e.length === 0) return;
1309
1318
  let t = [];
1310
1319
  for (let n of e) {
1311
- if (!_t(n)) continue;
1320
+ if (!vt(n)) continue;
1312
1321
  let e = n.axis === "locale" || n.axis === "secondaryLocale" ? n.axis : null, r = typeof n.requested == "string" ? n.requested.trim() : "", i = typeof n.resolved == "string" ? n.resolved.trim() : "";
1313
1322
  !e || !r || !i || n.reason !== "voice_unsupported" || t.push({
1314
1323
  axis: e,
@@ -1319,35 +1328,35 @@ function St(e) {
1319
1328
  }
1320
1329
  return t.length > 0 ? t : void 0;
1321
1330
  }
1322
- function Ct(e) {
1331
+ function wt(e) {
1323
1332
  let t = e.localeVoiceFallbacks;
1324
1333
  if (t?.length) for (let e of t) {
1325
1334
  let t = e.axis === "secondaryLocale" ? "secondaryLocale" : "locale";
1326
1335
  console.warn(`[liforma] Session ${t} fell back to ${e.resolved} because the voice does not support ${e.requested}.`);
1327
1336
  }
1328
1337
  }
1329
- function wt(e) {
1330
- if (!_t(e)) throw Error("Session Launch response must be a JSON object.");
1338
+ function Tt(e) {
1339
+ if (!vt(e)) throw Error("Session Launch response must be a JSON object.");
1331
1340
  let t = typeof e.launch == "string" ? e.launch.trim() : "";
1332
1341
  if (!t) throw Error("Session Launch response is missing launch.");
1333
- let n = xt(e.session);
1334
- return Ct(n), {
1342
+ let n = St(e.session);
1343
+ return wt(n), {
1335
1344
  session: n,
1336
1345
  launch: t
1337
1346
  };
1338
1347
  }
1339
1348
  //#endregion
1340
1349
  //#region src/v2/api/mintPublicSession.ts
1341
- function Tt() {
1350
+ function Et() {
1342
1351
  try {
1343
1352
  if (typeof globalThis.location?.origin == "string" && globalThis.location.origin) return globalThis.location.origin;
1344
1353
  } catch {}
1345
1354
  }
1346
- function Et(e) {
1355
+ function Dt(e) {
1347
1356
  return e ? e.trim().toUpperCase().replace(/-/g, "_") : "";
1348
1357
  }
1349
- function Dt(e, t) {
1350
- let n = Tt(), r = Et(t.code), i = t.message.trim(), a = t.details ?? {};
1358
+ function Ot(e, t) {
1359
+ let n = Et(), r = Dt(t.code), i = t.message.trim(), a = t.details ?? {};
1351
1360
  if (r === "ORIGIN_NOT_ALLOWED" || /^Origin not allowed/i.test(i) && n) {
1352
1361
  if (i.includes(e) && i.includes("allowed origin")) return t;
1353
1362
  let r = typeof a.origin == "string" && a.origin || n || "(unknown origin)";
@@ -1370,38 +1379,38 @@ function Dt(e, t) {
1370
1379
  details: a
1371
1380
  }) : t;
1372
1381
  }
1373
- function Ot(e) {
1382
+ function kt(e) {
1374
1383
  let t = e?.locale?.trim();
1375
1384
  if (t) return t;
1376
1385
  let n = e?.language?.trim();
1377
1386
  if (n) return n;
1378
1387
  if (typeof navigator < "u" && navigator.language?.trim()) return navigator.language.trim();
1379
1388
  }
1380
- function kt(e) {
1389
+ function At(e) {
1381
1390
  let t = e?.secondaryLocale?.trim(), n = e?.learningLocale?.trim();
1382
1391
  if (t && n && t !== n) throw new st("secondaryLocale and learningLocale disagree; pass only one or make them equal.", { code: "INVALID_BODY" });
1383
1392
  return t || n || void 0;
1384
1393
  }
1385
- function At(e, t) {
1386
- let n = { experienceId: e }, r = Ot(t);
1394
+ function jt(e, t) {
1395
+ let n = { experienceId: e }, r = kt(t);
1387
1396
  r && (n.locale = r);
1388
- let i = kt(t);
1397
+ let i = At(t);
1389
1398
  i && (n.secondaryLocale = i), t?.mode && (n.mode = t.mode), t?.speechInputMode && (n.speechInputMode = t.speechInputMode), t?.speechOnly !== void 0 && (n.speechOnly = t.speechOnly);
1390
1399
  let a = pt(t?.attribution);
1391
1400
  return a && (n.attribution = a), t?.alreadyConverted?.length && (n.alreadyConverted = [...t.alreadyConverted]), n;
1392
1401
  }
1393
- async function jt(e, t) {
1402
+ async function Mt(e, t) {
1394
1403
  let n = it(), r = t?.idempotencyKey?.trim(), i = await fetch(`${n}/v1/browser-sessions`, {
1395
1404
  method: "POST",
1396
1405
  headers: {
1397
1406
  "Content-Type": "application/json",
1398
1407
  ...r ? { "Idempotency-Key": r } : {}
1399
1408
  },
1400
- body: JSON.stringify(At(e, t))
1409
+ body: JSON.stringify(jt(e, t))
1401
1410
  });
1402
1411
  if (!i.ok) {
1403
1412
  let t = await i.text();
1404
- throw Dt(e, lt(i.status, t, i.headers));
1413
+ throw Ot(e, lt(i.status, t, i.headers));
1405
1414
  }
1406
1415
  let a;
1407
1416
  try {
@@ -1413,9 +1422,9 @@ async function jt(e, t) {
1413
1422
  requestId: i.headers.get("Liforma-Request-Id") ?? void 0
1414
1423
  });
1415
1424
  }
1416
- return wt(a);
1425
+ return Tt(a);
1417
1426
  }
1418
- async function Mt(e, t) {
1427
+ async function Nt(e, t) {
1419
1428
  let n = gt(e, t), r = new AbortController(), i = () => r.abort(t.signal?.reason);
1420
1429
  t.signal?.aborted ? i() : t.signal?.addEventListener("abort", i, { once: !0 });
1421
1430
  let a = globalThis.setTimeout(() => r.abort(new DOMException("Session endpoint timed out.", "TimeoutError")), t.timeoutMs ?? 3e4), o;
@@ -1446,14 +1455,14 @@ async function Mt(e, t) {
1446
1455
  requestId: o.headers.get("Liforma-Request-Id") ?? void 0
1447
1456
  });
1448
1457
  }
1449
- return wt(s);
1458
+ return Tt(s);
1450
1459
  }
1451
1460
  //#endregion
1452
1461
  //#region src/v2/conversationProcessor.ts
1453
- function Nt(e) {
1462
+ function Pt(e) {
1454
1463
  return typeof e != "object" || !e ? !1 : typeof e[Symbol.asyncIterator] == "function";
1455
1464
  }
1456
- function Pt(e) {
1465
+ function Ft(e) {
1457
1466
  if (typeof e == "string") {
1458
1467
  let t = e.trim();
1459
1468
  if (!t) throw Error("conversationProcessor returned empty text.");
@@ -1467,24 +1476,24 @@ function Pt(e) {
1467
1476
  ...e.behavior ? { behavior: e.behavior } : {}
1468
1477
  };
1469
1478
  }
1470
- async function Ft(e, t) {
1479
+ async function It(e, t) {
1471
1480
  let n = await e(t);
1472
- return Nt(n) ? {
1481
+ return Pt(n) ? {
1473
1482
  kind: "stream",
1474
1483
  stream: n
1475
1484
  } : {
1476
1485
  kind: "complete",
1477
- speech: Pt(n)
1486
+ speech: Ft(n)
1478
1487
  };
1479
1488
  }
1480
1489
  //#endregion
1481
1490
  //#region src/v2/embed/playerReachability.ts
1482
- var It = "3002";
1483
- function Lt(e) {
1491
+ var Lt = "3002";
1492
+ function Rt(e) {
1484
1493
  let t = new URL(e);
1485
- return t.hostname === "localhost" || t.hostname === "127.0.0.1" ? `Cannot connect to the Liforma player at ${e} — nothing is listening on port ${t.port || It}. Start the player dev server in player.liforma.ai (npm run dev).` : `Cannot connect to the Liforma player at ${e}. The embed did not load; check your network connection and player URL configuration.`;
1494
+ return t.hostname === "localhost" || t.hostname === "127.0.0.1" ? `Cannot connect to the Liforma player at ${e} — nothing is listening on port ${t.port || Lt}. Start the player dev server in player.liforma.ai (npm run dev).` : `Cannot connect to the Liforma player at ${e}. The embed did not load; check your network connection and player URL configuration.`;
1486
1495
  }
1487
- async function Rt(e, t) {
1496
+ async function zt(e, t) {
1488
1497
  try {
1489
1498
  await fetch(e, {
1490
1499
  method: "GET",
@@ -1492,25 +1501,25 @@ async function Rt(e, t) {
1492
1501
  signal: AbortSignal.timeout(8e3)
1493
1502
  });
1494
1503
  } catch {
1495
- throw Error(Lt(t));
1504
+ throw Error(Rt(t));
1496
1505
  }
1497
1506
  }
1498
- function zt(e, t, n, r) {
1507
+ function Bt(e, t, n, r) {
1499
1508
  try {
1500
1509
  r && r.length > 0 ? e.postMessage(t, n, r) : e.postMessage(t, n);
1501
1510
  } catch (e) {
1502
- throw e instanceof DOMException && e.name === "SecurityError" ? Error(Lt(n), { cause: e }) : e;
1511
+ throw e instanceof DOMException && e.name === "SecurityError" ? Error(Rt(n), { cause: e }) : e;
1503
1512
  }
1504
1513
  }
1505
- var Bt = new Set([1, 2]);
1506
- function Vt(e) {
1507
- return typeof e == "number" && Bt.has(e);
1514
+ var Vt = new Set([1, 2]);
1515
+ function Ht(e) {
1516
+ return typeof e == "number" && Vt.has(e);
1508
1517
  }
1509
- var Ht = new Set(/* @__PURE__ */ "close.stateUpdate.commandResult.userTranscript.characterSpeechStarted.characterSpeechEnded.characterFocusChanged.conversationUpdate.listeningState.userSpeechStarted.userSpeechEnded.modeChange.activityChange.feedback.feedbackFailed.message.started.embedReady.widgetReady.widgetExpand.widgetCollapse.widgetAudioSettings.widgetDragStart.widgetDragMove.widgetDragEnd.fullWindow.theatre.interactionChange".split("."));
1510
- function Ut(e) {
1518
+ var Ut = new Set(/* @__PURE__ */ "close.stateUpdate.commandResult.userTranscript.characterSpeechStarted.characterSpeechEnded.characterFocusChanged.conversationUpdate.listeningState.userSpeechStarted.userSpeechEnded.modeChange.activityChange.feedback.feedbackFailed.message.started.embedReady.widgetReady.widgetExpand.widgetCollapse.widgetAudioSettings.widgetDragStart.widgetDragMove.widgetDragEnd.fullWindow.theatre.interactionChange".split("."));
1519
+ function Wt(e) {
1511
1520
  if (!e || typeof e != "object") return null;
1512
1521
  let t = e;
1513
- if (!Vt(t.schemaVersion) || !t.type || !Ht.has(t.type)) return null;
1522
+ if (!Ht(t.schemaVersion) || !t.type || !Ut.has(t.type)) return null;
1514
1523
  if (t.type === "embedReady" || t.type === "widgetReady" || t.type === "widgetExpand" || t.type === "widgetCollapse") return t;
1515
1524
  if (t.type === "fullWindow" || t.type === "theatre") {
1516
1525
  let e = t.payload;
@@ -1533,10 +1542,13 @@ function Ut(e) {
1533
1542
  let n = t.payload;
1534
1543
  return !n || typeof n != "object" ? null : t;
1535
1544
  }
1536
- function Wt(e, t, n) {
1545
+ function Gt(e, t) {
1546
+ return t === void 0 ? {} : { [e]: t };
1547
+ }
1548
+ function Kt(e, t, n) {
1537
1549
  let r = e.trim();
1538
1550
  if (!r) throw Error("createLaunchMessage requires a non-empty launch string.");
1539
- let i = n?.startButton, a = n?.theme, o = n?.showFeedback, s = n?.interaction, c = n?.theatreButton, l = n?.theatre;
1551
+ let i = n?.startButton, a = n?.theme, o = n?.showFeedback, s = n?.interaction, c = n?.theatre;
1540
1552
  return {
1541
1553
  type: "launch",
1542
1554
  schemaVersion: 2,
@@ -1547,32 +1559,34 @@ function Wt(e, t, n) {
1547
1559
  ...a ? { theme: a } : {},
1548
1560
  ...o === void 0 ? {} : { showFeedback: o },
1549
1561
  ...s ? { interaction: s } : {},
1550
- ...c ? { theatreButton: !0 } : {},
1551
- ...l === void 0 ? {} : { theatre: l }
1562
+ ...Gt("settingsButton", n?.settingsButton),
1563
+ ...Gt("theatreButton", n?.theatreButton),
1564
+ ...Gt("fullscreenButton", n?.fullscreenButton),
1565
+ ...c === void 0 ? {} : { theatre: c }
1552
1566
  }
1553
1567
  };
1554
1568
  }
1555
- function Gt() {
1569
+ function qt() {
1556
1570
  return {
1557
1571
  type: "parentHello",
1558
1572
  schemaVersion: 2
1559
1573
  };
1560
1574
  }
1561
- function Kt(e) {
1575
+ function Jt(e) {
1562
1576
  return {
1563
1577
  type: "widgetSetChrome",
1564
1578
  schemaVersion: 2,
1565
1579
  payload: { mode: e }
1566
1580
  };
1567
1581
  }
1568
- function qt() {
1582
+ function Yt() {
1569
1583
  return {
1570
1584
  type: "widgetToggleAudioSettings",
1571
1585
  schemaVersion: 2,
1572
1586
  payload: {}
1573
1587
  };
1574
1588
  }
1575
- function Jt(e) {
1589
+ function Xt(e) {
1576
1590
  return {
1577
1591
  type: "setTheatre",
1578
1592
  schemaVersion: 2,
@@ -1581,8 +1595,8 @@ function Jt(e) {
1581
1595
  }
1582
1596
  //#endregion
1583
1597
  //#region src/v2/embed/fullWindowHost.ts
1584
- var Yt = "2147483000";
1585
- function Xt(e) {
1598
+ var Zt = "2147483000";
1599
+ function Qt(e) {
1586
1600
  let { style: t } = e;
1587
1601
  return {
1588
1602
  position: t.position,
@@ -1600,11 +1614,11 @@ function Xt(e) {
1600
1614
  maxHeight: t.maxHeight
1601
1615
  };
1602
1616
  }
1603
- function Zt(e) {
1617
+ function $t(e) {
1604
1618
  let { style: t } = e;
1605
- t.position = "fixed", t.top = "0", t.right = "0", t.bottom = "0", t.left = "0", t.inset = "0", t.width = "100vw", t.width = "100dvw", t.height = "100vh", t.height = "100dvh", t.zIndex = Yt, t.margin = "0", t.borderRadius = "0", t.maxWidth = "none", t.maxHeight = "none", e.dataset.liformaFullWindow = "1";
1619
+ t.position = "fixed", t.top = "0", t.right = "0", t.bottom = "0", t.left = "0", t.inset = "0", t.width = "100vw", t.width = "100dvw", t.height = "100vh", t.height = "100dvh", t.zIndex = Zt, t.margin = "0", t.borderRadius = "0", t.maxWidth = "none", t.maxHeight = "none", e.dataset.liformaFullWindow = "1";
1606
1620
  }
1607
- function Qt(e, t) {
1621
+ function en(e, t) {
1608
1622
  if (delete e.dataset.liformaFullWindow, !t) {
1609
1623
  e.style.position = "", e.style.top = "", e.style.right = "", e.style.bottom = "", e.style.left = "", e.style.inset = "", e.style.width = "", e.style.height = "", e.style.zIndex = "", e.style.margin = "", e.style.borderRadius = "", e.style.maxWidth = "", e.style.maxHeight = "";
1610
1624
  return;
@@ -1614,20 +1628,20 @@ function Qt(e, t) {
1614
1628
  }
1615
1629
  //#endregion
1616
1630
  //#region src/v2/embed/iframeHost.ts
1617
- function $t(e) {
1631
+ function tn(e) {
1618
1632
  return e;
1619
1633
  }
1620
1634
  function Z() {
1621
1635
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `cmd_${crypto.randomUUID().replace(/-/g, "").slice(0, 12)}` : `cmd_${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;
1622
1636
  }
1623
- var en = 3e4;
1624
- function tn(e) {
1637
+ var nn = 3e4;
1638
+ function rn(e) {
1625
1639
  let t = e.container;
1626
1640
  getComputedStyle(t).position === "static" && (t.style.position = "relative");
1627
1641
  let n = document.createElement("iframe");
1628
1642
  n.src = e.src, n.title = "Liforma experience", n.setAttribute("allow", "microphone; autoplay; clipboard-read; clipboard-write; fullscreen"), n.setAttribute("allowfullscreen", ""), n.style.cssText = e.transparent ? "display:block;position:absolute;inset:0;width:100%;height:100%;border:0;background:transparent;" : "display:block;position:absolute;inset:0;width:100%;height:100%;border:0;background:#030508;", e.transparent && n.setAttribute("allowtransparency", "true"), n.setAttribute("fetchpriority", "high"), "fetchPriority" in n && (n.fetchPriority = "high");
1629
1643
  let r = !1, i = !1, a = null, o = null, s = (r) => {
1630
- i !== r && (i = r, r ? (a = Xt(n), o = document.body.style.overflow, document.body.append(n), Zt(n), document.body.style.overflow = "hidden") : (t.append(n), Qt(n, a), a = null, o !== null && (document.body.style.overflow = o, o = null)), e.onFullWindowChange?.(r));
1644
+ i !== r && (i = r, r ? (a = Qt(n), o = document.body.style.overflow, document.body.append(n), $t(n), document.body.style.overflow = "hidden") : (t.append(n), en(n, a), a = null, o !== null && (document.body.style.overflow = o, o = null)), e.onFullWindowChange?.(r));
1631
1645
  }, c = /* @__PURE__ */ new Map(), l = null, u = 0, d = 0, f = [], p = null, m = null, h = new Promise((e, t) => {
1632
1646
  p = e, m = t;
1633
1647
  }), g = () => {
@@ -1638,10 +1652,10 @@ function tn(e) {
1638
1652
  let i = Date.now();
1639
1653
  if (d > 0 && i - d < 250) return;
1640
1654
  d = i, g();
1641
- let a = Wt(t.launch, t.session, t.chrome), o = () => {
1655
+ let a = Kt(t.launch, t.session, t.chrome), o = () => {
1642
1656
  if (r) return;
1643
1657
  let t = n.contentWindow;
1644
- t && zt(t, a, e.playerOrigin);
1658
+ t && Bt(t, a, e.playerOrigin);
1645
1659
  };
1646
1660
  o();
1647
1661
  for (let e = 1; e <= 12; e += 1) f.push(window.setTimeout(o, e * 75));
@@ -1649,17 +1663,17 @@ function tn(e) {
1649
1663
  r || !l || _(l);
1650
1664
  }, y = () => {
1651
1665
  if (u += 1, u === 1) {
1652
- Rt(e.src, e.playerOrigin).then(() => p?.(), (e) => m?.(e instanceof Error ? e : Error(String(e))));
1666
+ zt(e.src, e.playerOrigin).then(() => p?.(), (e) => m?.(e instanceof Error ? e : Error(String(e))));
1653
1667
  return;
1654
1668
  }
1655
1669
  d = 0, v();
1656
1670
  }, b = () => {
1657
- u > 0 || m?.(Error(Lt(e.playerOrigin)));
1671
+ u > 0 || m?.(Error(Rt(e.playerOrigin)));
1658
1672
  };
1659
1673
  n.addEventListener("load", y), n.addEventListener("error", b);
1660
1674
  let x = (t) => {
1661
1675
  if (r || t.source !== n.contentWindow || t.origin !== e.playerOrigin) return;
1662
- let i = Ut(t.data);
1676
+ let i = Wt(t.data);
1663
1677
  if (i) switch (i.type) {
1664
1678
  case "close":
1665
1679
  e.onClose?.(i.payload);
@@ -1698,7 +1712,7 @@ function tn(e) {
1698
1712
  e.onUserSpeechEnded?.(i.payload);
1699
1713
  break;
1700
1714
  case "modeChange":
1701
- e.onActivityChange?.($t(i.payload.mode));
1715
+ e.onActivityChange?.(tn(i.payload.mode));
1702
1716
  break;
1703
1717
  case "activityChange":
1704
1718
  e.onActivityChange?.(i.payload.activity);
@@ -1757,8 +1771,8 @@ function tn(e) {
1757
1771
  let S = (t, i) => {
1758
1772
  if (r) return;
1759
1773
  let a = n.contentWindow;
1760
- if (!a) throw Error(Lt(e.playerOrigin));
1761
- zt(a, t, e.playerOrigin, i);
1774
+ if (!a) throw Error(Rt(e.playerOrigin));
1775
+ Bt(a, t, e.playerOrigin, i);
1762
1776
  }, C = (e, t = 12e4, n) => {
1763
1777
  let r = e.type !== "parentHello" && e.payload && "correlationId" in e.payload ? e.payload.correlationId : Z();
1764
1778
  return e.type !== "parentHello" && e.payload && "correlationId" in e.payload || e.type !== "parentHello" && e.payload && (e.payload.correlationId = r), new Promise((i, a) => {
@@ -1775,7 +1789,7 @@ function tn(e) {
1775
1789
  return h;
1776
1790
  },
1777
1791
  postParentHello() {
1778
- S(Gt());
1792
+ S(qt());
1779
1793
  },
1780
1794
  postLaunch(e, t, n) {
1781
1795
  r || (l = {
@@ -1797,13 +1811,13 @@ function tn(e) {
1797
1811
  throw Error("postManifest is deprecated; use postLaunch with an opaque launch string from SessionLaunchResponse.");
1798
1812
  },
1799
1813
  postWidgetSetChrome(e) {
1800
- S(Kt(e));
1814
+ S(Jt(e));
1801
1815
  },
1802
1816
  postWidgetToggleAudioSettings() {
1803
- S(qt());
1817
+ S(Yt());
1804
1818
  },
1805
1819
  postSetTheatre(e) {
1806
- S(Jt(e));
1820
+ S(Xt(e));
1807
1821
  },
1808
1822
  speak(e) {
1809
1823
  return C({
@@ -1925,7 +1939,7 @@ function tn(e) {
1925
1939
  audio: e.audio,
1926
1940
  byteLength: e.byteLength
1927
1941
  }
1928
- }, en, [e.audio]);
1942
+ }, nn, [e.audio]);
1929
1943
  },
1930
1944
  speechUtteranceSetTranscript(e) {
1931
1945
  return C({
@@ -2087,7 +2101,7 @@ function tn(e) {
2087
2101
  }
2088
2102
  //#endregion
2089
2103
  //#region src/v2/embed/readyGate.ts
2090
- function nn(e) {
2104
+ function an(e) {
2091
2105
  let t, n = !1, r = !1, i = () => {
2092
2106
  r || !n || t === void 0 || (r = !0, e(t));
2093
2107
  };
@@ -2102,9 +2116,9 @@ function nn(e) {
2102
2116
  }
2103
2117
  //#endregion
2104
2118
  //#region src/v2/sdkRelease.ts
2105
- var rn = `sdk@${{
2119
+ var on = `sdk@${{
2106
2120
  name: "@liforma/client",
2107
- version: "0.4.14",
2121
+ version: "0.4.15",
2108
2122
  type: "module",
2109
2123
  description: "Liforma browser SDK — Experience sessions, speech API, and Svelte embed component.",
2110
2124
  license: "MIT",
@@ -2326,54 +2340,54 @@ var rn = `sdk@${{
2326
2340
  vitest: "^4.1.10",
2327
2341
  wrangler: "^4.101.0"
2328
2342
  }
2329
- }.version}`, an = "https://player.liforma.ai/embed", on = "http://localhost:3002/embed";
2330
- function sn() {
2343
+ }.version}`, sn = "https://player.liforma.ai/embed", cn = "http://localhost:3002/embed";
2344
+ function ln() {
2331
2345
  let e = globalThis.__LIFORMA_PLAYER_EMBED_URL;
2332
2346
  if (e?.trim()) return e.trim().replace(/\/$/, "");
2333
2347
  if (typeof document > "u") return null;
2334
2348
  let t = (document.querySelector("script[data-liforma-sdk][src*=\"client.js\"]") ?? document.querySelector("script[src*=\"/sdk/v2/client.js\"]"))?.getAttribute("data-player-embed-url")?.trim();
2335
2349
  return t ? t.replace(/\/$/, "") : null;
2336
2350
  }
2337
- function cn() {
2338
- let e = sn();
2339
- return e ? e.endsWith("/embed") ? e : `${e}/embed` : ge() ? on : an;
2351
+ function un() {
2352
+ let e = ln();
2353
+ return e ? e.endsWith("/embed") ? e : `${e}/embed` : me() ? cn : sn;
2340
2354
  }
2341
- function ln(e, t) {
2355
+ function dn(e, t) {
2342
2356
  return e?.trim() || t?.trim() || void 0;
2343
2357
  }
2344
- function un(e, t, n, r, i, a, o, s, c, l, u, d, f) {
2345
- let p = (e ?? cn()).replace(/\/$/, ""), m = p.endsWith("/embed") ? p : `${p}/embed`, h = new URL(m), g = n?.trim();
2358
+ function fn(e, t, n, r, i, a, o, s, c, l, u, d, f) {
2359
+ let p = (e ?? un()).replace(/\/$/, ""), m = p.endsWith("/embed") ? p : `${p}/embed`, h = new URL(m), g = n?.trim();
2346
2360
  g && h.searchParams.set("backdropId", g);
2347
2361
  let _ = r?.trim();
2348
2362
  _ && h.searchParams.set("avatarId", _);
2349
2363
  let v = d?.trim();
2350
2364
  v && h.searchParams.set("previewBg", v);
2351
2365
  let y = f?.trim();
2352
- return y && h.searchParams.set("previewFg", y), (i === "face" || i === "medium") && h.searchParams.set("fit", i), c === "pip" && h.searchParams.set("stage", "pip"), l === "set" && h.searchParams.set("pipBackground", "set"), u === !1 && h.searchParams.set("pipShadow", "0"), a === "widget" && h.searchParams.set("ui", "widget"), o && h.searchParams.set("close", "1"), t && h.searchParams.set("debug", "true"), (s === 2 || s === 3 || s === 4) && h.searchParams.set("cast", String(s)), dn(h.toString());
2366
+ return y && h.searchParams.set("previewFg", y), (i === "face" || i === "medium") && h.searchParams.set("fit", i), c === "pip" && h.searchParams.set("stage", "pip"), l === "set" && h.searchParams.set("pipBackground", "set"), u === !1 && h.searchParams.set("pipShadow", "0"), a === "widget" && h.searchParams.set("ui", "widget"), o && h.searchParams.set("close", "1"), t && h.searchParams.set("debug", "true"), (s === 2 || s === 3 || s === 4) && h.searchParams.set("cast", String(s)), pn(h.toString());
2353
2367
  }
2354
- function dn(e) {
2368
+ function pn(e) {
2355
2369
  if (typeof location > "u") return e;
2356
2370
  let t = new URL(e);
2357
2371
  return t.searchParams.set("parentOrigin", location.origin), t.toString();
2358
2372
  }
2359
- function fn(e) {
2373
+ function mn(e) {
2360
2374
  return new URL(e).origin;
2361
2375
  }
2362
2376
  //#endregion
2363
2377
  //#region src/v2/experienceEvents.ts
2364
- function pn() {
2378
+ function hn() {
2365
2379
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `evt_${crypto.randomUUID().replace(/-/g, "").slice(0, 12)}` : `evt_${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;
2366
2380
  }
2367
- function mn(e, t, n) {
2381
+ function gn(e, t, n) {
2368
2382
  return {
2369
- id: pn(),
2383
+ id: hn(),
2370
2384
  type: e,
2371
2385
  sessionId: t,
2372
2386
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2373
2387
  data: n
2374
2388
  };
2375
2389
  }
2376
- function hn() {
2390
+ function _n() {
2377
2391
  return {
2378
2392
  ready: /* @__PURE__ */ new Set(),
2379
2393
  started: /* @__PURE__ */ new Set(),
@@ -2394,39 +2408,39 @@ function hn() {
2394
2408
  conversationProcessorError: /* @__PURE__ */ new Set()
2395
2409
  };
2396
2410
  }
2397
- function gn(e, t, n) {
2411
+ function vn(e, t, n) {
2398
2412
  return e[t].add(n), () => e[t].delete(n);
2399
2413
  }
2400
- function _n(e, t, n) {
2414
+ function yn(e, t, n) {
2401
2415
  for (let r of e[t]) r(n);
2402
2416
  }
2403
- function vn(e) {
2417
+ function bn(e) {
2404
2418
  for (let t of Object.keys(e)) e[t].clear();
2405
2419
  }
2406
2420
  //#endregion
2407
2421
  //#region src/v2/speech/types.ts
2408
- function yn(e) {
2422
+ function xn(e) {
2409
2423
  return "data" in e && "format" in e && e.format != null && !("track" in e);
2410
2424
  }
2411
- function bn(e) {
2425
+ function Sn(e) {
2412
2426
  return "url" in e && typeof e.url == "string";
2413
2427
  }
2414
- function xn(e) {
2428
+ function Cn(e) {
2415
2429
  if (!("track" in e)) return !1;
2416
2430
  let t = e.track;
2417
2431
  return typeof t != "object" || !t ? !1 : typeof MediaStreamTrack < "u" && t instanceof MediaStreamTrack ? !0 : "kind" in t && "readyState" in t;
2418
2432
  }
2419
- function Sn(e) {
2420
- return !yn(e) && !bn(e) && !xn(e) && "encoding" in e && typeof e.encoding == "string";
2433
+ function wn(e) {
2434
+ return !xn(e) && !Sn(e) && !Cn(e) && "encoding" in e && typeof e.encoding == "string";
2421
2435
  }
2422
- var Cn = [
2436
+ var Tn = [
2423
2437
  8e3,
2424
2438
  16e3,
2425
2439
  22050,
2426
2440
  24e3,
2427
2441
  44100,
2428
2442
  48e3
2429
- ], wn = {
2443
+ ], En = {
2430
2444
  MAX_CHUNK_BYTES: 64 * 1024,
2431
2445
  RECOMMENDED_CHUNK_MS_MIN: 20,
2432
2446
  RECOMMENDED_CHUNK_MS_MAX: 200,
@@ -2437,14 +2451,14 @@ var Cn = [
2437
2451
  MAX_UTTERANCE_DURATION_MS: 9e4,
2438
2452
  MAX_PENDING_WRITES: 8,
2439
2453
  DEFAULT_WRITE_TIMEOUT_MS: 5e3
2440
- }, Tn = class extends Error {
2454
+ }, Dn = class extends Error {
2441
2455
  operation;
2442
2456
  requiredCapability;
2443
2457
  name = "UnsupportedSpeechOperationError";
2444
2458
  constructor(e, t) {
2445
2459
  super(`Speech operation "${e}" requires capability "${t}".`), this.operation = e, this.requiredCapability = t;
2446
2460
  }
2447
- }, En = class extends Error {
2461
+ }, On = class extends Error {
2448
2462
  name = "SpeechUtteranceClosedError";
2449
2463
  constructor(e = "Cannot write to a closed or cancelled speech utterance.") {
2450
2464
  super(e);
@@ -2454,72 +2468,72 @@ var Cn = [
2454
2468
  constructor(e, t) {
2455
2469
  super(e, t);
2456
2470
  }
2457
- }, Dn = class extends Error {
2471
+ }, kn = class extends Error {
2458
2472
  name = "SpeechBufferTimeoutError";
2459
2473
  constructor(e = "Timed out waiting for speech buffer capacity.") {
2460
2474
  super(e);
2461
2475
  }
2462
2476
  };
2463
- function On(e = "none") {
2477
+ function An(e = "none") {
2464
2478
  return {
2465
2479
  mode: e,
2466
2480
  trackedDurationMs: 0,
2467
2481
  fallbackDurationMs: 0
2468
2482
  };
2469
2483
  }
2470
- function kn(e) {
2471
- return Cn.includes(e);
2484
+ function jn(e) {
2485
+ return Tn.includes(e);
2472
2486
  }
2473
- function An(e) {
2487
+ function Mn(e) {
2474
2488
  if (e.encoding !== "pcm_s16le") throw new Q(`Unsupported audio encoding: ${e.encoding}`);
2475
2489
  if (e.channels !== 1) throw new Q(`Unsupported channel count: ${e.channels}`);
2476
- if (!kn(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
2490
+ if (!jn(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
2477
2491
  }
2478
- function jn(e) {
2479
- if (yn(e)) {
2480
- An(e.format);
2492
+ function Nn(e) {
2493
+ if (xn(e)) {
2494
+ Mn(e.format);
2481
2495
  return;
2482
2496
  }
2483
- if (bn(e)) {
2497
+ if (Sn(e)) {
2484
2498
  if (!e.url.trim()) throw new Q("Audio URL must be non-empty.");
2485
- if (e.sampleRate !== void 0 && !kn(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
2499
+ if (e.sampleRate !== void 0 && !jn(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
2486
2500
  return;
2487
2501
  }
2488
- if (xn(e)) {
2502
+ if (Cn(e)) {
2489
2503
  if (e.track.kind !== "audio") throw new Q("speech.play track must be an audio MediaStreamTrack.");
2490
- if (e.sampleRate !== void 0 && !kn(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
2504
+ if (e.sampleRate !== void 0 && !jn(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
2491
2505
  return;
2492
2506
  }
2493
- if (Sn(e)) {
2507
+ if (wn(e)) {
2494
2508
  let t = e.encoding.trim().toLowerCase();
2495
2509
  if (!t) throw new Q("Encoded audio MIME type is required.");
2496
2510
  if (t === "pcm_s16le") throw new Q("Use format: { encoding: \"pcm_s16le\", … } for raw PCM.");
2497
- if (e.sampleRate !== void 0 && !kn(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
2511
+ if (e.sampleRate !== void 0 && !jn(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
2498
2512
  return;
2499
2513
  }
2500
2514
  throw new Q("Unsupported speech.play audio shape.");
2501
2515
  }
2502
- function Mn(e) {
2503
- if (e.format) return An(e.format), e.format;
2516
+ function Pn(e) {
2517
+ if (e.format) return Mn(e.format), e.format;
2504
2518
  if (e.track) {
2505
2519
  let t = {
2506
2520
  encoding: "pcm_s16le",
2507
2521
  sampleRate: e.sampleRate ?? 24e3,
2508
2522
  channels: 1
2509
2523
  };
2510
- return An(t), t;
2524
+ return Mn(t), t;
2511
2525
  }
2512
2526
  throw new Q("createUtterance requires format or track.");
2513
2527
  }
2514
- function Nn(e) {
2528
+ function Fn(e) {
2515
2529
  return e instanceof Uint8Array ? e : new Uint8Array(e);
2516
2530
  }
2517
- function Pn(e) {
2531
+ function In(e) {
2518
2532
  return e === "replace-active" || e === "replace-all" ? "interrupt" : "enqueue";
2519
2533
  }
2520
2534
  //#endregion
2521
2535
  //#region src/byo/pcm.ts
2522
- function Fn(e) {
2536
+ function Ln(e) {
2523
2537
  let t = new Uint8Array(e.length * 2), n = new DataView(t.buffer);
2524
2538
  for (let t = 0; t < e.length; t++) {
2525
2539
  let r = Math.max(-1, Math.min(1, e[t]));
@@ -2529,11 +2543,11 @@ function Fn(e) {
2529
2543
  }
2530
2544
  //#endregion
2531
2545
  //#region src/byo/resample.ts
2532
- function In(e, t, n, r, i) {
2546
+ function Rn(e, t, n, r, i) {
2533
2547
  let a = -.5 * e + 1.5 * t - 1.5 * n + .5 * r, o = e - 2.5 * t + 2 * n - .5 * r, s = -.5 * e + .5 * n, c = t;
2534
2548
  return ((a * i + o) * i + s) * i + c;
2535
2549
  }
2536
- function Ln(e, t) {
2550
+ function zn(e, t) {
2537
2551
  if (!(e > 0) || !(t > 0)) throw Error("Resampler rates must be positive");
2538
2552
  if (e === t) return {
2539
2553
  fromRate: e,
@@ -2556,7 +2570,7 @@ function Ln(e, t) {
2556
2570
  let a = [];
2557
2571
  for (; i + 2 < r.length - 1;) {
2558
2572
  let e = Math.floor(i), t = i - e, o = Math.max(0, e - 1), s = Math.min(r.length - 1, e + 1), c = Math.min(r.length - 1, e + 2);
2559
- a.push(In(r[o], r[e], r[s], r[c], t)), i += n;
2573
+ a.push(Rn(r[o], r[e], r[s], r[c], t)), i += n;
2560
2574
  }
2561
2575
  let o = Math.max(0, Math.floor(i) - 1);
2562
2576
  return o > 0 && (r = r.subarray(o), i -= o), a.length ? Float32Array.from(a) : new Float32Array();
@@ -2568,7 +2582,7 @@ function Ln(e, t) {
2568
2582
  }
2569
2583
  //#endregion
2570
2584
  //#region src/byo/audioCapture.ts
2571
- var Rn = "liforma-pcm-capture", zn = `
2585
+ var Bn = "liforma-pcm-capture", Vn = `
2572
2586
  class LiformaPcmCaptureProcessor extends AudioWorkletProcessor {
2573
2587
  process(inputs) {
2574
2588
  const ch = inputs[0] && inputs[0][0];
@@ -2580,29 +2594,29 @@ class LiformaPcmCaptureProcessor extends AudioWorkletProcessor {
2580
2594
  return true;
2581
2595
  }
2582
2596
  }
2583
- registerProcessor('${Rn}', LiformaPcmCaptureProcessor);
2584
- `, Bn = null;
2585
- function Vn() {
2586
- return Bn ||= URL.createObjectURL(new Blob([zn], { type: "application/javascript" })), Bn;
2597
+ registerProcessor('${Bn}', LiformaPcmCaptureProcessor);
2598
+ `, Hn = null;
2599
+ function Un() {
2600
+ return Hn ||= URL.createObjectURL(new Blob([Vn], { type: "application/javascript" })), Hn;
2587
2601
  }
2588
- function Hn() {
2602
+ function Wn() {
2589
2603
  return window.AudioContext || window.webkitAudioContext || null;
2590
2604
  }
2591
- async function Un(e) {
2592
- let { mediaStream: t, targetSampleRate: n, onPcm: r, shouldSend: i, onLog: a } = e, o = Hn();
2605
+ async function Gn(e) {
2606
+ let { mediaStream: t, targetSampleRate: n, onPcm: r, shouldSend: i, onLog: a } = e, o = Wn();
2593
2607
  if (!o) throw Error("Web Audio is required for audio capture");
2594
2608
  let s = new o(), c = s.createMediaStreamSource(t), l = s.createGain();
2595
2609
  l.gain.value = 0;
2596
- let u = s.sampleRate, d = Ln(u, n), f = !1, p = !1, m = (e) => {
2610
+ let u = s.sampleRate, d = zn(u, n), f = !1, p = !1, m = (e) => {
2597
2611
  if (f || i && !i()) return;
2598
2612
  let t = d.push(e);
2599
- t.length !== 0 && r(Fn(t));
2613
+ t.length !== 0 && r(Ln(t));
2600
2614
  }, h = () => void 0;
2601
2615
  return await (async () => {
2602
2616
  if (typeof s.audioWorklet?.addModule != "function") return !1;
2603
2617
  try {
2604
- await s.audioWorklet.addModule(Vn());
2605
- let e = new AudioWorkletNode(s, Rn, {
2618
+ await s.audioWorklet.addModule(Un());
2619
+ let e = new AudioWorkletNode(s, Bn, {
2606
2620
  numberOfInputs: 1,
2607
2621
  numberOfOutputs: 1,
2608
2622
  outputChannelCount: [1]
@@ -2652,7 +2666,7 @@ async function Un(e) {
2652
2666
  }
2653
2667
  //#endregion
2654
2668
  //#region src/v2/speech/captureMediaStreamTrack.ts
2655
- async function Wn(e) {
2669
+ async function Kn(e) {
2656
2670
  let { track: t, utterance: n, sampleRate: r, signal: i } = e;
2657
2671
  if (typeof MediaStreamTrack > "u" || !(t instanceof MediaStreamTrack)) throw new Q("MediaStreamTrack is not available in this environment.");
2658
2672
  if (t.kind !== "audio") throw new Q("speech.play track must be an audio MediaStreamTrack.");
@@ -2661,18 +2675,18 @@ async function Wn(e) {
2661
2675
  s || (s = !0, c?.stop(), c = null);
2662
2676
  };
2663
2677
  try {
2664
- c = await Un({
2678
+ c = await Gn({
2665
2679
  mediaStream: a,
2666
2680
  targetSampleRate: r,
2667
2681
  shouldSend: () => !s && !i?.aborted,
2668
2682
  onPcm: (e) => {
2669
2683
  if (s || i?.aborted) return;
2670
- let t = Nn(e);
2684
+ let t = Fn(e);
2671
2685
  o = o.then(async () => {
2672
2686
  if (s || i?.aborted) return;
2673
2687
  let e = 0;
2674
2688
  for (; e < t.byteLength;) {
2675
- let r = Math.min(e + wn.MAX_CHUNK_BYTES, t.byteLength);
2689
+ let r = Math.min(e + En.MAX_CHUNK_BYTES, t.byteLength);
2676
2690
  if ((r - e) % 2 == 1 && --r, r <= e) break;
2677
2691
  let i = t.subarray(e, r);
2678
2692
  e = r, i.byteLength !== 0 && await n.write(i);
@@ -2696,10 +2710,10 @@ async function Wn(e) {
2696
2710
  }
2697
2711
  //#endregion
2698
2712
  //#region src/v2/speech/speechController.ts
2699
- async function Gn(e, t) {
2700
- if (xn(e)) throw new Q("MediaStreamTrack play is handled on the host before embed.");
2701
- if (yn(e)) {
2702
- let t = Nn(e.data);
2713
+ async function qn(e, t) {
2714
+ if (Cn(e)) throw new Q("MediaStreamTrack play is handled on the host before embed.");
2715
+ if (xn(e)) {
2716
+ let t = Fn(e.data);
2703
2717
  if (t.byteLength & 1) throw new Q("PCM byte length must be even.");
2704
2718
  return {
2705
2719
  kind: "pcm",
@@ -2707,17 +2721,17 @@ async function Gn(e, t) {
2707
2721
  format: e.format
2708
2722
  };
2709
2723
  }
2710
- if (bn(e)) return {
2724
+ if (Sn(e)) return {
2711
2725
  kind: "url",
2712
2726
  url: e.url.trim(),
2713
2727
  ...e.sampleRate === void 0 ? {} : { sampleRate: e.sampleRate }
2714
2728
  };
2715
- if (!Sn(e)) throw new Q("Unsupported speech.play audio shape.");
2729
+ if (!wn(e)) throw new Q("Unsupported speech.play audio shape.");
2716
2730
  let n;
2717
2731
  if (typeof Blob < "u" && e.data instanceof Blob) {
2718
2732
  if (t?.aborted) throw new DOMException("Play aborted.", "AbortError");
2719
2733
  n = new Uint8Array(await e.data.arrayBuffer());
2720
- } else n = Nn(e.data);
2734
+ } else n = Fn(e.data);
2721
2735
  return {
2722
2736
  kind: "encoded",
2723
2737
  data: n.slice().buffer,
@@ -2725,10 +2739,10 @@ async function Gn(e, t) {
2725
2739
  ...e.sampleRate === void 0 ? {} : { sampleRate: e.sampleRate }
2726
2740
  };
2727
2741
  }
2728
- function Kn() {
2742
+ function Jn() {
2729
2743
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `utt_${crypto.randomUUID().replace(/-/g, "").slice(0, 12)}` : `utt_${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;
2730
2744
  }
2731
- function qn(e, t = "completed") {
2745
+ function Yn(e, t = "completed") {
2732
2746
  return {
2733
2747
  utteranceId: e.speechId,
2734
2748
  characterId: e.characterId,
@@ -2742,13 +2756,13 @@ function qn(e, t = "completed") {
2742
2756
  }
2743
2757
  };
2744
2758
  }
2745
- function Jn(e) {
2759
+ function Xn(e) {
2746
2760
  return e instanceof Error ? e : new Q(String(e));
2747
2761
  }
2748
- function Yn(e) {
2762
+ function Zn(e) {
2749
2763
  return e instanceof DOMException && e.name === "AbortError" || e instanceof Error && e.name === "AbortError";
2750
2764
  }
2751
- var Xn = class {
2765
+ var Qn = class {
2752
2766
  id;
2753
2767
  characterId;
2754
2768
  result;
@@ -2777,29 +2791,29 @@ var Xn = class {
2777
2791
  queue: e.queue,
2778
2792
  ...e.transcript === void 0 ? {} : { transcript: e.transcript }
2779
2793
  }).catch((e) => {
2780
- throw this.fail(Jn(e)), Jn(e);
2794
+ throw this.fail(Xn(e)), Xn(e);
2781
2795
  }), this.signal?.addEventListener("abort", () => {
2782
2796
  this.cancel();
2783
2797
  }, { once: !0 });
2784
2798
  }
2785
2799
  async write(e, t) {
2786
- if (this.closed || this.settled || (await this.beginPromise.catch(() => void 0), this.closed || this.settled)) throw new En();
2787
- let n = Nn(e);
2800
+ if (this.closed || this.settled || (await this.beginPromise.catch(() => void 0), this.closed || this.settled)) throw new On();
2801
+ let n = Fn(e);
2788
2802
  if (n.byteLength & 1) throw new Q("PCM chunk byte length must be even (complete s16 samples).");
2789
- if (n.byteLength > wn.MAX_CHUNK_BYTES) throw new Q(`PCM chunk exceeds MAX_CHUNK_BYTES (${wn.MAX_CHUNK_BYTES}).`);
2803
+ if (n.byteLength > En.MAX_CHUNK_BYTES) throw new Q(`PCM chunk exceeds MAX_CHUNK_BYTES (${En.MAX_CHUNK_BYTES}).`);
2790
2804
  if (n.byteLength === 0) return;
2791
- let r = t?.timeoutMs ?? wn.DEFAULT_WRITE_TIMEOUT_MS;
2805
+ let r = t?.timeoutMs ?? En.DEFAULT_WRITE_TIMEOUT_MS;
2792
2806
  await this.acquireWriteSlot(r);
2793
2807
  let i = n.byteLength / 2 / this.sampleRate * 1e3;
2794
- if (this.bufferedMs + i > wn.MAX_UTTERANCE_DURATION_MS) throw this.releaseWriteSlot(), new Q("Utterance exceeds MAX_UTTERANCE_DURATION_MS.");
2808
+ if (this.bufferedMs + i > En.MAX_UTTERANCE_DURATION_MS) throw this.releaseWriteSlot(), new Q("Utterance exceeds MAX_UTTERANCE_DURATION_MS.");
2795
2809
  let a = async () => {
2796
- if (this.closed || this.settled) throw new En();
2810
+ if (this.closed || this.settled) throw new On();
2797
2811
  let e = this.requireHost(), t = n.slice(), i = e.speechUtteranceWrite({
2798
2812
  utteranceId: this.id,
2799
2813
  audio: t.buffer,
2800
2814
  byteLength: t.byteLength
2801
2815
  }), a = await Promise.race([i, new Promise((e, t) => {
2802
- setTimeout(() => t(new Dn()), r);
2816
+ setTimeout(() => t(new kn()), r);
2803
2817
  })]);
2804
2818
  this.bufferedMs = Math.max(0, a.bufferedMs);
2805
2819
  }, o = this.writeChain.then(a, a);
@@ -2811,7 +2825,7 @@ var Xn = class {
2811
2825
  }
2812
2826
  }
2813
2827
  async setTranscript(e) {
2814
- if (this.closed || this.settled || (await this.beginPromise.catch(() => void 0), this.closed || this.settled)) throw new En();
2828
+ if (this.closed || this.settled || (await this.beginPromise.catch(() => void 0), this.closed || this.settled)) throw new On();
2815
2829
  await this.requireHost().speechUtteranceSetTranscript({
2816
2830
  utteranceId: this.id,
2817
2831
  transcript: e
@@ -2828,7 +2842,7 @@ var Xn = class {
2828
2842
  });
2829
2843
  return this.resolve(t), t;
2830
2844
  } catch (e) {
2831
- let t = Jn(e);
2845
+ let t = Xn(e);
2832
2846
  throw this.fail(t), t;
2833
2847
  }
2834
2848
  }
@@ -2846,11 +2860,11 @@ var Xn = class {
2846
2860
  characterId: this.characterId,
2847
2861
  status: "cancelled",
2848
2862
  durationMs: 0,
2849
- animation: On("none")
2863
+ animation: An("none")
2850
2864
  };
2851
2865
  return this.resolve(t), t;
2852
2866
  } catch (e) {
2853
- let t = Jn(e);
2867
+ let t = Xn(e);
2854
2868
  throw this.fail(t), t;
2855
2869
  }
2856
2870
  }
@@ -2863,19 +2877,19 @@ var Xn = class {
2863
2877
  return e;
2864
2878
  }
2865
2879
  resolve(e) {
2866
- this.settled || (this.settled = !0, this.settleResolve(Object.freeze(e)), this.flushWriteWaiters(new En()));
2880
+ this.settled || (this.settled = !0, this.settleResolve(Object.freeze(e)), this.flushWriteWaiters(new On()));
2867
2881
  }
2868
2882
  fail(e) {
2869
2883
  this.settled || (this.settled = !0, this.settleReject(e), this.flushWriteWaiters(e));
2870
2884
  }
2871
2885
  async acquireWriteSlot(e) {
2872
- if (this.pendingWriteCount < wn.MAX_PENDING_WRITES) {
2886
+ if (this.pendingWriteCount < En.MAX_PENDING_WRITES) {
2873
2887
  this.pendingWriteCount += 1;
2874
2888
  return;
2875
2889
  }
2876
2890
  await new Promise((t, n) => {
2877
2891
  let r = setTimeout(() => {
2878
- n(new Dn());
2892
+ n(new kn());
2879
2893
  }, e);
2880
2894
  this.pendingWriteWaiters.push({
2881
2895
  resolve: () => {
@@ -2894,13 +2908,13 @@ var Xn = class {
2894
2908
  for (; this.pendingWriteWaiters.length > 0;) this.pendingWriteWaiters.shift()?.reject(e);
2895
2909
  }
2896
2910
  };
2897
- function Zn(e) {
2911
+ function $n(e) {
2898
2912
  let t = null, n = (t, n) => {
2899
- if (!e.getCapabilities()[n]) throw new Tn(t, n);
2913
+ if (!e.getCapabilities()[n]) throw new Dn(t, n);
2900
2914
  }, r = {
2901
2915
  async speak(r) {
2902
2916
  if (e.assertSessionStarted(), n("speak", "textSpeech"), r.signal?.aborted) throw new DOMException("Speak aborted.", "AbortError");
2903
- let i = Pn(r.queue ?? "append");
2917
+ let i = In(r.queue ?? "append");
2904
2918
  i === "interrupt" && (e.onProcessorInterrupt?.(), t &&= (t.cancel(), null));
2905
2919
  let a = e.getIframeHost();
2906
2920
  if (!a) throw new Q("Speech session is not attached.");
@@ -2920,41 +2934,41 @@ function Zn(e) {
2920
2934
  return;
2921
2935
  }
2922
2936
  t.addEventListener("abort", s, { once: !0 }), o.then((e) => {
2923
- t.removeEventListener("abort", s), n(qn(e, "completed"));
2937
+ t.removeEventListener("abort", s), n(Yn(e, "completed"));
2924
2938
  }, (a) => {
2925
- if (t.removeEventListener("abort", s), Yn(a)) {
2939
+ if (t.removeEventListener("abort", s), Zn(a)) {
2926
2940
  n({
2927
2941
  utteranceId: "utt_interrupted",
2928
2942
  characterId: r.characterId ?? e.getActiveCharacterId(),
2929
2943
  status: "interrupted",
2930
2944
  durationMs: 0,
2931
2945
  transcript: r.text,
2932
- animation: On("none")
2946
+ animation: An("none")
2933
2947
  });
2934
2948
  return;
2935
2949
  }
2936
- i(Jn(a));
2950
+ i(Xn(a));
2937
2951
  });
2938
2952
  });
2939
2953
  }
2940
2954
  try {
2941
- return qn(await o, "completed");
2955
+ return Yn(await o, "completed");
2942
2956
  } catch (t) {
2943
- if (Yn(t)) return {
2957
+ if (Zn(t)) return {
2944
2958
  utteranceId: "utt_interrupted",
2945
2959
  characterId: r.characterId ?? e.getActiveCharacterId(),
2946
2960
  status: "interrupted",
2947
2961
  durationMs: 0,
2948
2962
  transcript: r.text,
2949
- animation: On("none")
2963
+ animation: An("none")
2950
2964
  };
2951
- throw Jn(t);
2965
+ throw Xn(t);
2952
2966
  }
2953
2967
  },
2954
2968
  async play(i) {
2955
- if (e.assertSessionStarted(), n("play", "externalSpeechAudio"), jn(i.audio), i.signal?.aborted) throw new DOMException("Play aborted.", "AbortError");
2969
+ if (e.assertSessionStarted(), n("play", "externalSpeechAudio"), Nn(i.audio), i.signal?.aborted) throw new DOMException("Play aborted.", "AbortError");
2956
2970
  let a = i.queue ?? "append";
2957
- if ((a === "replace-active" || a === "replace-all") && (e.onProcessorInterrupt?.(), t &&= (t.cancel(), null)), xn(i.audio)) {
2971
+ if ((a === "replace-active" || a === "replace-all") && (e.onProcessorInterrupt?.(), t &&= (t.cancel(), null)), Cn(i.audio)) {
2958
2972
  let e = i.audio.sampleRate ?? 24e3;
2959
2973
  return r.createUtterance({
2960
2974
  format: {
@@ -2970,7 +2984,7 @@ function Zn(e) {
2970
2984
  }
2971
2985
  let o = e.getIframeHost();
2972
2986
  if (!o) throw new Q("Speech session is not attached.");
2973
- let s = await Gn(i.audio, i.signal);
2987
+ let s = await qn(i.audio, i.signal);
2974
2988
  return o.speechPlay({
2975
2989
  source: s,
2976
2990
  characterId: i.characterId,
@@ -2982,13 +2996,13 @@ function Zn(e) {
2982
2996
  },
2983
2997
  createUtterance(r) {
2984
2998
  e.assertSessionStarted(), n("createUtterance", "externalSpeechAudio");
2985
- let i = Mn(r);
2999
+ let i = Pn(r);
2986
3000
  if (r.track && r.track.kind !== "audio") throw new Q("createUtterance track must be an audio MediaStreamTrack.");
2987
3001
  let a = r.queue ?? "replace-active";
2988
3002
  if (a !== "replace-active" && a !== "replace-all") throw new Q("createUtterance queue must be replace-active or replace-all.");
2989
3003
  e.onProcessorInterrupt?.(), t &&= (t.cancel(), null);
2990
- let o = new Xn({
2991
- id: Kn(),
3004
+ let o = new Qn({
3005
+ id: Jn(),
2992
3006
  characterId: r.characterId ?? e.getActiveCharacterId(),
2993
3007
  format: i,
2994
3008
  queue: a,
@@ -3000,7 +3014,7 @@ function Zn(e) {
3000
3014
  t === o && (t = null);
3001
3015
  }), r.track && (async () => {
3002
3016
  try {
3003
- if (await Wn({
3017
+ if (await Kn({
3004
3018
  track: r.track,
3005
3019
  utterance: o,
3006
3020
  sampleRate: i.sampleRate,
@@ -3028,16 +3042,16 @@ function Zn(e) {
3028
3042
  }
3029
3043
  //#endregion
3030
3044
  //#region src/v2/types/sessionInteraction.ts
3031
- function Qn(e) {
3045
+ function er(e) {
3032
3046
  let t = e?.trim();
3033
3047
  return t === "full" || t === "face" || t === "medium" ? t : void 0;
3034
3048
  }
3035
3049
  //#endregion
3036
3050
  //#region src/v2/experience.ts
3037
- function $n(e) {
3051
+ function tr(e) {
3038
3052
  return !!(e.showClose === !0 || e.returnUrl?.trim() || e.closeButton === !0 || e.closeButton && typeof e.closeButton == "object" && e.closeButton.visible !== !1);
3039
3053
  }
3040
- var er = class e {
3054
+ var nr = class e {
3041
3055
  bootstrap;
3042
3056
  conversationProcessor;
3043
3057
  iframeHost = null;
@@ -3057,17 +3071,17 @@ var er = class e {
3057
3071
  pendingTheatre = null;
3058
3072
  lastInteraction = null;
3059
3073
  closeHandlers = [];
3060
- eventRegistry = hn();
3074
+ eventRegistry = _n();
3061
3075
  readyEnvelope = null;
3062
3076
  startedEnvelope = null;
3063
3077
  sessionMintedEnvelope = null;
3064
3078
  conversationCache = [];
3065
3079
  speech;
3066
3080
  constructor(e) {
3067
- this.bootstrap = e, this.conversationProcessor = e.conversationProcessor ?? null, this.resolvedSession = e.kind === "launch" ? e.session ?? null : null, this.launchToken = e.kind === "launch" ? e.launch : null, this.speech = Zn({
3081
+ this.bootstrap = e, this.conversationProcessor = e.conversationProcessor ?? null, this.resolvedSession = e.kind === "launch" ? e.session ?? null : null, this.launchToken = e.kind === "launch" ? e.launch : null, this.speech = $n({
3068
3082
  getIframeHost: () => this.iframeHost,
3069
3083
  assertSessionStarted: () => this.assertSessionStarted(),
3070
- getCapabilities: () => tr(this.resolvedSession),
3084
+ getCapabilities: () => rr(this.resolvedSession),
3071
3085
  getActiveCharacterId: () => "character_unknown",
3072
3086
  onProcessorInterrupt: () => {
3073
3087
  this.processorAbortController?.abort(), this.processorAbortController = null;
@@ -3156,7 +3170,7 @@ var er = class e {
3156
3170
  return null;
3157
3171
  }
3158
3172
  on(e, t) {
3159
- let n = gn(this.eventRegistry, e, t);
3173
+ let n = vn(this.eventRegistry, e, t);
3160
3174
  return e === "ready" && this.readyEnvelope && queueMicrotask(() => t(this.readyEnvelope)), e === "started" && this.startedEnvelope && queueMicrotask(() => t(this.startedEnvelope)), e === "sessionMinted" && this.sessionMintedEnvelope && queueMicrotask(() => t(this.sessionMintedEnvelope)), n;
3161
3175
  }
3162
3176
  async attach(e) {
@@ -3170,13 +3184,13 @@ var er = class e {
3170
3184
  if (this.closed) throw Error("Session has ended.");
3171
3185
  if (this.attached && this.iframeHost) return this.createPlayerFacade();
3172
3186
  this.iframeHost &&= (this.iframeHost.destroy(), null), this.attachReturnUrl = e.returnUrl?.trim() || null;
3173
- let t = this.bootstrap.embedBaseUrl ?? cn(), n = this.bootstrap.debug === !0, r = this.bootstrap.speechOnly === !0, i = un(t, n, r ? void 0 : ln(this.bootstrap.backdropId, this.bootstrap.locationId), r ? void 0 : this.bootstrap.avatarId, e.fit, this.bootstrap.ui, $n(e), this.bootstrap.kind === "launch" ? void 0 : this.bootstrap.castSize, e.stage, e.pipBackground, e.pipShadow, r ? void 0 : this.bootstrap.previewBackground, r ? void 0 : this.bootstrap.previewForeground), a = fn(i), o = null, s = new Promise((e) => {
3187
+ let t = this.bootstrap.embedBaseUrl ?? un(), n = this.bootstrap.debug === !0, r = this.bootstrap.speechOnly === !0, i = fn(t, n, r ? void 0 : dn(this.bootstrap.backdropId, this.bootstrap.locationId), r ? void 0 : this.bootstrap.avatarId, e.fit, this.bootstrap.ui, tr(e), this.bootstrap.kind === "launch" ? void 0 : this.bootstrap.castSize, e.stage, e.pipBackground, e.pipShadow, r ? void 0 : this.bootstrap.previewBackground, r ? void 0 : this.bootstrap.previewForeground), a = mn(i), o = null, s = new Promise((e) => {
3174
3188
  o = e;
3175
3189
  }), c = null, l = new Promise((e) => {
3176
3190
  c = e;
3177
- }), u = nn((e) => {
3191
+ }), u = an((e) => {
3178
3192
  this.readyEnvelope ||= (this.resolvedSession = e, this.emitWrapped("ready", { session: e }));
3179
- }), d = this.bootstrap.onUserTranscript, f = tn({
3193
+ }), d = this.bootstrap.onUserTranscript, f = rn({
3180
3194
  container: e.container,
3181
3195
  src: i,
3182
3196
  playerOrigin: a,
@@ -3243,7 +3257,7 @@ var er = class e {
3243
3257
  onTheatreChange: (t) => e.onTheatreChange?.(t)
3244
3258
  });
3245
3259
  this.iframeHost = f;
3246
- let p = this.resolveMintInteraction(), m = this.bootstrap.kind === "sessionEndpoint" ? (this.endpointAbortController = new AbortController(), Mt(this.bootstrap.sessionEndpoint, {
3260
+ let p = this.resolveMintInteraction(), m = this.bootstrap.kind === "sessionEndpoint" ? (this.endpointAbortController = new AbortController(), Nt(this.bootstrap.sessionEndpoint, {
3247
3261
  experienceId: this.bootstrap.experienceId,
3248
3262
  locale: this.bootstrap.locale,
3249
3263
  secondaryLocale: this.bootstrap.secondaryLocale,
@@ -3255,7 +3269,7 @@ var er = class e {
3255
3269
  attribution: this.bootstrap.attribution,
3256
3270
  alreadyConverted: this.bootstrap.alreadyConverted,
3257
3271
  signal: this.endpointAbortController.signal
3258
- })) : this.bootstrap.kind === "public" ? jt(this.bootstrap.experienceId, {
3272
+ })) : this.bootstrap.kind === "public" ? Mt(this.bootstrap.experienceId, {
3259
3273
  locale: this.bootstrap.locale,
3260
3274
  secondaryLocale: this.bootstrap.secondaryLocale,
3261
3275
  learningLocale: this.bootstrap.learningLocale,
@@ -3279,7 +3293,7 @@ var er = class e {
3279
3293
  operation: "attach",
3280
3294
  message: e instanceof Error ? e.message : String(e),
3281
3295
  stack: e instanceof Error ? e.stack : void 0,
3282
- release: rn
3296
+ release: on
3283
3297
  });
3284
3298
  } catch {}
3285
3299
  throw f.destroy(), this.iframeHost === f && (this.iframeHost = null), e;
@@ -3291,19 +3305,23 @@ var er = class e {
3291
3305
  if (!g) throw f.destroy(), this.iframeHost === f && (this.iframeHost = null), Error("Session Launch response did not include a launch token.");
3292
3306
  this.launchToken = g;
3293
3307
  let v = _ ?? (this.bootstrap.kind === "launch" ? this.bootstrap.session : void 0);
3294
- return v && !this.sessionMintedEnvelope && (this.resolvedSession = v, this.sessionMintedEnvelope = this.emitWrapped("sessionMinted", { session: v })), _ ? (this.resolvedSession = _, this.bootstrap.kind === "launch" && Ct(_), f.postLaunch(g, _, {
3308
+ return v && !this.sessionMintedEnvelope && (this.resolvedSession = v, this.sessionMintedEnvelope = this.emitWrapped("sessionMinted", { session: v })), _ ? (this.resolvedSession = _, this.bootstrap.kind === "launch" && wt(_), f.postLaunch(g, _, {
3295
3309
  startButton: e.startButton,
3296
3310
  theme: e.theme,
3297
3311
  showFeedback: e.showFeedback,
3298
3312
  interaction: e.interaction,
3299
- ...e.theatreButton ? { theatreButton: !0 } : {},
3313
+ ..._t("settingsButton", e.settingsButton),
3314
+ ..._t("theatreButton", e.theatreButton),
3315
+ ..._t("fullscreenButton", e.fullscreenButton),
3300
3316
  ...e.theatre === void 0 ? {} : { theatre: e.theatre }
3301
3317
  }), u.setValue(_)) : f.postLaunch(g, void 0, {
3302
3318
  startButton: e.startButton,
3303
3319
  theme: e.theme,
3304
3320
  showFeedback: e.showFeedback,
3305
3321
  interaction: e.interaction,
3306
- ...e.theatreButton ? { theatreButton: !0 } : {},
3322
+ ..._t("settingsButton", e.settingsButton),
3323
+ ..._t("theatreButton", e.theatreButton),
3324
+ ..._t("fullscreenButton", e.fullscreenButton),
3307
3325
  ...e.theatre === void 0 ? {} : { theatre: e.theatre }
3308
3326
  }), await Promise.race([s, new Promise((e, t) => {
3309
3327
  setTimeout(() => t(/* @__PURE__ */ Error("Timed out waiting for player loading UI.")), 12e4);
@@ -3315,7 +3333,7 @@ var er = class e {
3315
3333
  operation: "attach",
3316
3334
  message: e instanceof Error ? e.message : String(e),
3317
3335
  stack: e instanceof Error ? e.stack : void 0,
3318
- release: rn
3336
+ release: on
3319
3337
  });
3320
3338
  } catch {}
3321
3339
  throw e;
@@ -3329,7 +3347,7 @@ var er = class e {
3329
3347
  operation: "attach",
3330
3348
  message: e instanceof Error ? e.message : String(e),
3331
3349
  stack: e instanceof Error ? e.stack : void 0,
3332
- release: rn
3350
+ release: on
3333
3351
  });
3334
3352
  } catch {}
3335
3353
  throw e;
@@ -3361,7 +3379,7 @@ var er = class e {
3361
3379
  this.assertSessionStarted(), await this.iframeHost.focusCharacter(e);
3362
3380
  }
3363
3381
  async setFit(e) {
3364
- let t = Qn(e);
3382
+ let t = er(e);
3365
3383
  if (!t) throw Error("setFit requires \"full\", \"medium\", or \"face\".");
3366
3384
  if (this.closed) throw Error("Session has ended.");
3367
3385
  this.pendingFit = t, !(!this.attached || !this.iframeHost) && await this.iframeHost.setFit(t);
@@ -3411,7 +3429,7 @@ var er = class e {
3411
3429
  this.close();
3412
3430
  }
3413
3431
  destroy() {
3414
- this.closed || (this.closed = !0, this.processorAbortController?.abort(), this.processorAbortController = null, this.endpointAbortController?.abort(), this.endpointAbortController = null, this.attachInFlight = null, this.iframeHost?.destroy(), this.iframeHost = null, vn(this.eventRegistry), this.readyEnvelope = null, this.startedEnvelope = null, this.closeHandlers.length = 0, this.lastInteraction = null, this.attached = !1);
3432
+ this.closed || (this.closed = !0, this.processorAbortController?.abort(), this.processorAbortController = null, this.endpointAbortController?.abort(), this.endpointAbortController = null, this.attachInFlight = null, this.iframeHost?.destroy(), this.iframeHost = null, bn(this.eventRegistry), this.readyEnvelope = null, this.startedEnvelope = null, this.closeHandlers.length = 0, this.lastInteraction = null, this.attached = !1);
3415
3433
  }
3416
3434
  resolveMintInteraction() {
3417
3435
  return this.bootstrap.kind === "launch" ? {} : {
@@ -3423,8 +3441,8 @@ var er = class e {
3423
3441
  return this.resolvedSession?.id ?? "";
3424
3442
  }
3425
3443
  emitWrapped(e, t) {
3426
- let n = mn(e, this.getSessionId(), t);
3427
- return _n(this.eventRegistry, e, n), n;
3444
+ let n = gn(e, this.getSessionId(), t);
3445
+ return yn(this.eventRegistry, e, n), n;
3428
3446
  }
3429
3447
  queueProcessorTurn(e) {
3430
3448
  if (!e.isFinal || !e.text.trim() || !this.conversationProcessor) return;
@@ -3433,7 +3451,7 @@ var er = class e {
3433
3451
  let n = this.processorAbortController.signal;
3434
3452
  this.processorChain = this.processorChain.then(async () => {
3435
3453
  if (!n.aborted) try {
3436
- let r = await Ft(t, {
3454
+ let r = await It(t, {
3437
3455
  utteranceId: e.utteranceId,
3438
3456
  text: e.text,
3439
3457
  conversation: this.conversationCache,
@@ -3483,7 +3501,7 @@ var er = class e {
3483
3501
  };
3484
3502
  }
3485
3503
  };
3486
- function tr(e) {
3504
+ function rr(e) {
3487
3505
  return e ? {
3488
3506
  textSpeech: e.capabilities.speech.output,
3489
3507
  externalSpeechAudio: e.capabilities.speech.externalAudio
@@ -3494,41 +3512,41 @@ function tr(e) {
3494
3512
  }
3495
3513
  //#endregion
3496
3514
  //#region src/widget/dockGeometry.ts
3497
- var nr = "(min-width: 768px)", rr = 24, ir = .5, ar = 1200, or = .85, sr = 9 / 16;
3498
- function cr() {
3515
+ var ir = "(min-width: 768px)", ar = 24, or = .5, sr = 1200, cr = .85, lr = 9 / 16;
3516
+ function ur() {
3499
3517
  if (typeof window > "u") return 800;
3500
3518
  let e = window.screen?.availHeight;
3501
3519
  return typeof e == "number" && e > 0 ? e : window.innerHeight;
3502
3520
  }
3503
- function lr(e = typeof window < "u" ? window.innerWidth : 1280, t = typeof window < "u" ? window.innerHeight : 800, n = rr, r = typeof window < "u" ? cr() : 800) {
3504
- let i = Math.max(160, Math.min(t - n * 2, t * or)), a = Math.max(120, e - n * 2), o = Math.min(r * ir, ar, i), s = o * sr;
3505
- return s > a && (s = a, o = s / sr, o > i && (o = i, s = o * sr)), {
3521
+ function dr(e = typeof window < "u" ? window.innerWidth : 1280, t = typeof window < "u" ? window.innerHeight : 800, n = ar, r = typeof window < "u" ? ur() : 800) {
3522
+ let i = Math.max(160, Math.min(t - n * 2, t * cr)), a = Math.max(120, e - n * 2), o = Math.min(r * or, sr, i), s = o * lr;
3523
+ return s > a && (s = a, o = s / lr, o > i && (o = i, s = o * lr)), {
3506
3524
  width: Math.round(s),
3507
3525
  height: Math.round(o)
3508
3526
  };
3509
3527
  }
3510
- function ur(e, t = typeof window < "u" ? window.innerWidth : 1280, n = typeof window < "u" ? window.innerHeight : 800, r = rr) {
3528
+ function fr(e, t = typeof window < "u" ? window.innerWidth : 1280, n = typeof window < "u" ? window.innerHeight : 800, r = ar) {
3511
3529
  return {
3512
3530
  left: Math.max(r, t - e.width - r),
3513
3531
  top: Math.max(r, n - e.height - r)
3514
3532
  };
3515
3533
  }
3516
- function dr(e, t, n, r = typeof window < "u" ? window.innerWidth : 1280, i = typeof window < "u" ? window.innerHeight : 800, a = rr) {
3534
+ function pr(e, t, n, r = typeof window < "u" ? window.innerWidth : 1280, i = typeof window < "u" ? window.innerHeight : 800, a = ar) {
3517
3535
  let o = Math.max(a, r - n.width - a), s = Math.max(a, i - n.height - a);
3518
3536
  return {
3519
3537
  left: Math.min(Math.max(a, e), o),
3520
3538
  top: Math.min(Math.max(a, t), s)
3521
3539
  };
3522
3540
  }
3523
- function fr(e = typeof window < "u" ? window.matchMedia.bind(window) : () => ({ matches: !0 })) {
3524
- return e(nr).matches;
3541
+ function mr(e = typeof window < "u" ? window.matchMedia.bind(window) : () => ({ matches: !0 })) {
3542
+ return e(ir).matches;
3525
3543
  }
3526
3544
  //#endregion
3527
3545
  //#region src/widget/mountExperienceWidget.ts
3528
- function pr(e) {
3546
+ function hr(e) {
3529
3547
  return e === "bottom-right" || e === "bottom-left" ? e : "static";
3530
3548
  }
3531
- function mr(e) {
3549
+ function gr(e) {
3532
3550
  if (typeof e == "number" && Number.isFinite(e)) return `${e}px`;
3533
3551
  let t = typeof e == "string" ? e.trim() : "";
3534
3552
  return t ? /^\d+(\.\d+)?$/.test(t) ? `${t}px` : t : "16px";
@@ -3536,10 +3554,10 @@ function mr(e) {
3536
3554
  function $(e) {
3537
3555
  return e === "expanded" || e === "docked";
3538
3556
  }
3539
- var hr = "<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065\"/><path d=\"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0\"/></svg>", gr = "<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M18.3 5.71a1 1 0 0 0-1.41 0L12 10.59 7.11 5.7A1 1 0 0 0 5.7 7.11L10.59 12l-4.9 4.89a1 1 0 1 0 1.42 1.42L12 13.41l4.89 4.9a1 1 0 0 0 1.42-1.42L13.41 12l4.9-4.89a1 1 0 0 0-.01-1.4Z\"/></svg>", _r = "<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M18 10h-4V6m6-2l-6 6m-8 4h4v4m0-4l-6 6\"/></svg>", vr = "<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M16 4h4v4m-6 2l6-6M8 20H4v-4m0 4l6-6\"/></svg>";
3540
- function yr(e, t, n) {
3557
+ var _r = "<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065\"/><path d=\"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0\"/></svg>", vr = "<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M18.3 5.71a1 1 0 0 0-1.41 0L12 10.59 7.11 5.7A1 1 0 0 0 5.7 7.11L10.59 12l-4.9 4.89a1 1 0 1 0 1.42 1.42L12 13.41l4.89 4.9a1 1 0 0 0 1.42-1.42L13.41 12l4.9-4.89a1 1 0 0 0-.01-1.4Z\"/></svg>", yr = "<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M18 10h-4V6m6-2l-6 6m-8 4h4v4m0-4l-6 6\"/></svg>", br = "<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M16 4h4v4m-6 2l6-6M8 20H4v-4m0 4l6-6\"/></svg>";
3558
+ function xr(e, t, n) {
3541
3559
  Ve(ze);
3542
- let r = he({
3560
+ let r = pe({
3543
3561
  galleryThumb: t.galleryThumb,
3544
3562
  avatarImage: t.avatarImage,
3545
3563
  backgroundImage: t.backgroundImage,
@@ -3567,7 +3585,7 @@ function yr(e, t, n) {
3567
3585
  }
3568
3586
  return e.replaceChildren(i), n?.parallax === !1 ? () => {} : Re(i);
3569
3587
  }
3570
- function br(e) {
3588
+ function Sr(e) {
3571
3589
  return e.startButton ? {
3572
3590
  ...e.startButton,
3573
3591
  label: e.startButton.label ?? e.startButtonLabel ?? "Tap to talk",
@@ -3579,7 +3597,7 @@ function br(e) {
3579
3597
  variant: "primary"
3580
3598
  };
3581
3599
  }
3582
- function xr(e) {
3600
+ function Cr(e) {
3583
3601
  let t = !1, n = () => {
3584
3602
  t || e();
3585
3603
  }, r = () => {
@@ -3599,12 +3617,12 @@ function xr(e) {
3599
3617
  t = !0, window.removeEventListener("load", r), i?.();
3600
3618
  };
3601
3619
  }
3602
- function Sr(e, t) {
3620
+ function wr(e, t) {
3603
3621
  et(Qe);
3604
3622
  let n = t.experienceId?.trim();
3605
3623
  if (!n) throw Error("ExperienceWidget requires experienceId.");
3606
- let r = t.prefetch ?? "onExpand", i = pr(t.position), a = document.createElement("div");
3607
- a.className = "liforma-ew", a.dataset.state = "collapsed", a.dataset.prefetch = r, a.dataset.position = i, a.style.setProperty("--liforma-ew-max-w", t.expandedMaxWidth ?? "100%"), a.style.setProperty("--liforma-ew-max-h", t.expandedMaxHeight ?? "100%"), i !== "static" && a.style.setProperty("--liforma-ew-offset", mr(t.offset));
3624
+ let r = t.prefetch ?? "onExpand", i = hr(t.position), a = document.createElement("div");
3625
+ a.className = "liforma-ew", a.dataset.state = "collapsed", a.dataset.prefetch = r, a.dataset.position = i, a.style.setProperty("--liforma-ew-max-w", t.expandedMaxWidth ?? "100%"), a.style.setProperty("--liforma-ew-max-h", t.expandedMaxHeight ?? "100%"), i !== "static" && a.style.setProperty("--liforma-ew-offset", gr(t.offset));
3608
3626
  let o = document.createElement("button");
3609
3627
  o.type = "button", o.className = "liforma-ew__hit", o.setAttribute("aria-label", t.alt), o.disabled = !0;
3610
3628
  let s = document.createElement("div");
@@ -3624,82 +3642,82 @@ function Sr(e, t) {
3624
3642
  let m = document.createElement("span");
3625
3643
  m.className = "liforma-ew__drag-grip", m.setAttribute("aria-hidden", "true");
3626
3644
  let h = document.createElement("button");
3627
- h.type = "button", h.className = "liforma-ew__icon-btn liforma-ew__dock-toggle", h.innerHTML = _r, h.setAttribute("aria-label", "Reduce");
3645
+ h.type = "button", h.className = "liforma-ew__icon-btn liforma-ew__dock-toggle", h.innerHTML = yr, h.setAttribute("aria-label", "Reduce");
3628
3646
  let g = document.createElement("button");
3629
- g.type = "button", g.className = "liforma-ew__icon-btn liforma-ew__settings", g.innerHTML = hr, g.setAttribute("aria-label", "Audio settings"), g.setAttribute("aria-pressed", "false");
3647
+ g.type = "button", g.className = "liforma-ew__icon-btn liforma-ew__settings", g.innerHTML = _r, g.setAttribute("aria-label", "Audio settings"), g.setAttribute("aria-pressed", "false");
3630
3648
  let _ = document.createElement("button");
3631
- _.type = "button", _.className = "liforma-ew__icon-btn liforma-ew__close", _.innerHTML = gr, _.setAttribute("aria-label", "Close"), p.append(m, h, g, _);
3649
+ _.type = "button", _.className = "liforma-ew__icon-btn liforma-ew__close", _.innerHTML = vr, _.setAttribute("aria-label", "Close"), p.append(m, h, g, _);
3632
3650
  let v = document.createElement("div");
3633
3651
  v.className = "liforma-ew__stage";
3634
3652
  let y = document.createElement("div");
3635
3653
  y.className = "liforma-ew__status", y.hidden = !0, f.append(v, y), u.append(d, f), a.append(o, l, u, p), e.replaceChildren(a);
3636
- let b = null, x = !1, S = !1, C = !1, w = !1, T = !1, E = !1, D = !1, O = 0, k = "", A = null, ee = null, j = null, M = null, N = null, P = null, F = null, te = 0, I = 0, L = null, ne = !1, re = new AbortController(), ie = t.parallax !== !1, R = () => {
3654
+ let b = null, x = !1, S = !1, C = !1, w = !1, T = !1, E = !1, D = !1, O = 0, k = "", A = null, ee = null, j = null, M = null, N = null, P = null, F = null, te = 0, I = 0, L = null, R = !1, ne = new AbortController(), re = t.parallax !== !1, z = () => {
3637
3655
  let e = a.dataset.state;
3638
3656
  return e === "expanded" || e === "docked" || e === "collapsed" ? e : "collapsed";
3639
- }, ae = () => {
3657
+ }, ie = () => {
3640
3658
  j !== null && (clearTimeout(j), j = null);
3641
- }, oe = () => {
3659
+ }, ae = () => {
3642
3660
  M !== null && (clearTimeout(M), M = null), a.classList.remove("liforma-ew--layout-settling");
3643
- }, z = () => {
3661
+ }, B = () => {
3644
3662
  for (let e of [
3645
3663
  f,
3646
3664
  l,
3647
3665
  p
3648
3666
  ]) e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("width"), e.style.removeProperty("height"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
3649
3667
  p.classList.remove("liforma-ew__toolbar--dragging"), a.classList.remove("liforma-ew--dock-dragging");
3650
- }, se = (e, t, n, r) => {
3668
+ }, oe = (e, t, n, r) => {
3651
3669
  let i = (i) => {
3652
3670
  i.style.left = `${e}px`, i.style.top = `${t}px`, i.style.width = `${n}px`, i.style.height = `${r}px`, i.style.right = "auto", i.style.bottom = "auto";
3653
3671
  };
3654
3672
  i(f), i(l);
3655
3673
  let a = p.offsetWidth || 120;
3656
3674
  p.style.left = `${e + n - a - 10}px`, p.style.top = `${t + 10}px`, p.style.right = "auto", p.style.bottom = "auto", p.style.width = "auto", p.style.height = "auto";
3675
+ }, se = (e, t) => {
3676
+ if (z() !== "docked") return;
3677
+ let n = dr(), r = pr(e - te, t - I, n);
3678
+ N = r.left, P = r.top, oe(r.left, r.top, n.width, n.height);
3657
3679
  }, ce = (e, t) => {
3658
- if (R() !== "docked") return;
3659
- let n = lr(), r = dr(e - te, t - I, n);
3660
- N = r.left, P = r.top, se(r.left, r.top, n.width, n.height);
3661
- }, le = (e, t) => {
3662
- if (R() !== "docked" || !Number.isFinite(e) || !Number.isFinite(t) || e === 0 && t === 0) return;
3663
- let n = lr(), r = N ?? f.getBoundingClientRect().left, i = P ?? f.getBoundingClientRect().top, a = dr(r + e, i + t, n);
3664
- N = a.left, P = a.top, se(a.left, a.top, n.width, n.height);
3665
- }, B = (e) => {
3666
- L === "toolbar" && (F === null || e.pointerId !== F || (e.preventDefault(), ce(e.clientX, e.clientY)));
3680
+ if (z() !== "docked" || !Number.isFinite(e) || !Number.isFinite(t) || e === 0 && t === 0) return;
3681
+ let n = dr(), r = N ?? f.getBoundingClientRect().left, i = P ?? f.getBoundingClientRect().top, a = pr(r + e, i + t, n);
3682
+ N = a.left, P = a.top, oe(a.left, a.top, n.width, n.height);
3683
+ }, le = (e) => {
3684
+ L === "toolbar" && (F === null || e.pointerId !== F || (e.preventDefault(), se(e.clientX, e.clientY)));
3667
3685
  }, V = (e) => {
3668
3686
  if (F === null || e && e.pointerId !== F) return;
3669
3687
  let t = L;
3670
- F = null, L = null, p.classList.remove("liforma-ew__toolbar--dragging"), a.classList.remove("liforma-ew--dock-dragging"), t === "toolbar" && ne && (ne = !1, window.removeEventListener("pointermove", B), window.removeEventListener("pointerup", V), window.removeEventListener("pointercancel", V));
3671
- }, ue = (e, t, n) => {
3672
- if (S || R() !== "docked" || !fr() || F !== null) return;
3688
+ F = null, L = null, p.classList.remove("liforma-ew__toolbar--dragging"), a.classList.remove("liforma-ew--dock-dragging"), t === "toolbar" && R && (R = !1, window.removeEventListener("pointermove", le), window.removeEventListener("pointerup", V), window.removeEventListener("pointercancel", V));
3689
+ }, H = (e, t, n) => {
3690
+ if (S || z() !== "docked" || !mr() || F !== null) return;
3673
3691
  F = n, L = "toolbar", p.classList.add("liforma-ew__toolbar--dragging"), a.classList.add("liforma-ew--dock-dragging");
3674
3692
  let r = f.getBoundingClientRect();
3675
- te = e - r.left, I = t - r.top, ne || (ne = !0, window.addEventListener("pointermove", B), window.addEventListener("pointerup", V), window.addEventListener("pointercancel", V));
3676
- }, de = (e) => {
3677
- if (S || R() !== "docked" || !fr() || F !== null) return;
3693
+ te = e - r.left, I = t - r.top, R || (R = !0, window.addEventListener("pointermove", le), window.addEventListener("pointerup", V), window.addEventListener("pointercancel", V));
3694
+ }, U = (e) => {
3695
+ if (S || z() !== "docked" || !mr() || F !== null) return;
3678
3696
  F = e.pointerId, L = "player", p.classList.add("liforma-ew__toolbar--dragging"), a.classList.add("liforma-ew--dock-dragging");
3679
3697
  let t = f.getBoundingClientRect();
3680
3698
  N = t.left, P = t.top;
3681
- }, fe = (e) => {
3682
- L === "player" && (F === null || e.pointerId !== F || le(e.dx, e.dy));
3683
- }, pe = (e) => {
3699
+ }, ue = (e) => {
3700
+ L === "player" && (F === null || e.pointerId !== F || ce(e.dx, e.dy));
3701
+ }, de = (e) => {
3684
3702
  L === "player" && (F === null || e.pointerId !== F || V());
3685
- }, H = () => {
3686
- let e = fr(), t = R();
3703
+ }, W = () => {
3704
+ let e = mr(), t = z();
3687
3705
  if (!e || t !== "expanded" && t !== "docked") {
3688
3706
  h.hidden = !0;
3689
3707
  return;
3690
3708
  }
3691
- h.hidden = !1, t === "docked" ? (h.innerHTML = vr, h.setAttribute("aria-label", "Maximize")) : (h.innerHTML = _r, h.setAttribute("aria-label", "Reduce"));
3692
- }, me = (e) => {
3693
- let t = lr(), n = e && N !== null && P !== null ? dr(N, P, t) : ur(t);
3694
- n = dr(n.left, n.top, t), N = n.left, P = n.top, se(n.left, n.top, t.width, t.height), H();
3695
- }, he = () => {
3709
+ h.hidden = !1, t === "docked" ? (h.innerHTML = br, h.setAttribute("aria-label", "Maximize")) : (h.innerHTML = yr, h.setAttribute("aria-label", "Reduce"));
3710
+ }, fe = (e) => {
3711
+ let t = dr(), n = e && N !== null && P !== null ? pr(N, P, t) : fr(t);
3712
+ n = pr(n.left, n.top, t), N = n.left, P = n.top, oe(n.left, n.top, t.width, t.height), W();
3713
+ }, pe = () => {
3696
3714
  a.classList.remove("liforma-ew--session-revealed"), requestAnimationFrame(() => {
3697
3715
  requestAnimationFrame(() => {
3698
3716
  S || !$(a.dataset.state) || a.classList.add("liforma-ew--session-revealed");
3699
3717
  });
3700
3718
  });
3701
- }, ge = (e) => {
3702
- if (oe(), a.classList.remove("liforma-ew--session-revealed"), a.classList.add("liforma-ew--layout-settling"), e(), !D) {
3719
+ }, me = (e) => {
3720
+ if (ae(), a.classList.remove("liforma-ew--session-revealed"), a.classList.add("liforma-ew--layout-settling"), e(), !D) {
3703
3721
  a.classList.remove("liforma-ew--layout-settling");
3704
3722
  return;
3705
3723
  }
@@ -3708,52 +3726,52 @@ function Sr(e, t) {
3708
3726
  a.classList.remove("liforma-ew--layout-settling");
3709
3727
  return;
3710
3728
  }
3711
- a.classList.remove("liforma-ew--layout-settling"), he();
3729
+ a.classList.remove("liforma-ew--layout-settling"), pe();
3712
3730
  }, 220);
3713
- }, _e = () => (a.classList.add("liforma-ew--session-concealing"), a.classList.remove("liforma-ew--session-revealed"), new Promise((e) => {
3714
- ae(), j = setTimeout(() => {
3731
+ }, he = () => (a.classList.add("liforma-ew--session-concealing"), a.classList.remove("liforma-ew--session-revealed"), new Promise((e) => {
3732
+ ie(), j = setTimeout(() => {
3715
3733
  j = null, a.classList.remove("liforma-ew--session-concealing"), e();
3716
3734
  }, 280);
3717
- })), ve = {
3735
+ })), ge = {
3718
3736
  galleryThumb: t.galleryThumb,
3719
3737
  avatarImage: t.avatarImage,
3720
3738
  backgroundImage: t.backgroundImage,
3721
3739
  foregroundImage: t.foregroundImage,
3722
3740
  fallbackImage: t.fallbackImage
3723
- }, U = (e) => {
3741
+ }, _e = (e) => {
3724
3742
  if (!e) {
3725
3743
  y.hidden = !0, y.textContent = "";
3726
3744
  return;
3727
3745
  }
3728
3746
  y.hidden = !1, y.textContent = e;
3729
- }, W = (e) => {
3747
+ }, ve = (e) => {
3730
3748
  if (!e) {
3731
3749
  c.hidden = !0, c.textContent = "";
3732
3750
  return;
3733
3751
  }
3734
3752
  c.hidden = !1, c.textContent = e, s.contains(c) || s.append(c);
3735
3753
  }, ye = () => {
3736
- C = !0, o.disabled = !1, W(null), r === "onExpand" && t.onPrefetchReady?.();
3754
+ C = !0, o.disabled = !1, ve(null), r === "onExpand" && t.onPrefetchReady?.();
3737
3755
  }, be = () => {
3738
3756
  w = !0, a.dataset.warm = "true", l.hidden = !1, D || (o.tabIndex = -1, o.setAttribute("aria-hidden", "true")), t.onPrefetchReady?.();
3739
3757
  }, xe = (e) => {
3740
3758
  A?.(), A = null;
3741
- let t = yr(s, e, { parallax: ie });
3759
+ let t = xr(s, e, { parallax: re });
3742
3760
  return t ? (A = t, !0) : !1;
3743
3761
  }, Se = () => {
3744
- if (xe(ve)) {
3762
+ if (xe(ge)) {
3745
3763
  ye();
3746
3764
  return;
3747
3765
  }
3748
- W("Loading…"), ot(n, { signal: re.signal }).then((e) => {
3766
+ ve("Loading…"), ot(n, { signal: ne.signal }).then((e) => {
3749
3767
  if (!S) {
3750
3768
  if (!xe({ galleryThumb: e.galleryThumb })) throw Error("Experience preview is missing gallery thumb images.");
3751
3769
  ye();
3752
3770
  }
3753
3771
  }).catch((e) => {
3754
- if (S || re.signal.aborted) return;
3772
+ if (S || ne.signal.aborted) return;
3755
3773
  let n = e instanceof Error ? e : Error(String(e));
3756
- W("Preview unavailable"), o.disabled = !0, t.onError?.(n), console.error("[ExperienceWidget]", n);
3774
+ ve("Preview unavailable"), o.disabled = !0, t.onError?.(n), console.error("[ExperienceWidget]", n);
3757
3775
  });
3758
3776
  }, Ce = () => ({
3759
3777
  experienceId: n,
@@ -3770,25 +3788,25 @@ function Sr(e, t) {
3770
3788
  ...t.embedBaseUrl ? { embedBaseUrl: t.embedBaseUrl } : {}
3771
3789
  }), we = () => ({
3772
3790
  ...t.fit ? { fit: t.fit } : {},
3773
- startButton: br(t),
3791
+ startButton: Sr(t),
3774
3792
  ...t.showFeedback === void 0 ? {} : { showFeedback: t.showFeedback },
3775
3793
  ...t.interaction ? { interaction: t.interaction } : {}
3776
3794
  }), G = (e = !0) => {
3777
- o.hidden = !0, u.hidden = !1, p.hidden = !1, u.setAttribute("aria-modal", "true"), z(), a.dataset.state = "expanded", U(null), typeof document < "u" && (k = document.body.style.overflow, document.body.style.overflow = "hidden"), H(), e && t.onExpanded?.();
3795
+ o.hidden = !0, u.hidden = !1, p.hidden = !1, u.setAttribute("aria-modal", "true"), B(), a.dataset.state = "expanded", _e(null), typeof document < "u" && (k = document.body.style.overflow, document.body.style.overflow = "hidden"), W(), e && t.onExpanded?.();
3778
3796
  }, Te = () => {
3779
- o.hidden = !0, u.hidden = !1, p.hidden = !1, u.setAttribute("aria-modal", "false"), a.dataset.state = "docked", U(null), typeof document < "u" && (document.body.style.overflow = k), me(!0), H(), b?.setWidgetChrome("docked");
3797
+ o.hidden = !0, u.hidden = !1, p.hidden = !1, u.setAttribute("aria-modal", "false"), a.dataset.state = "docked", _e(null), typeof document < "u" && (document.body.style.overflow = k), fe(!0), W(), b?.setWidgetChrome("docked");
3780
3798
  }, Ee = (e) => {
3781
3799
  e.on("started", () => {
3782
- S || (D = !0, a.dataset.live = "true", U(null), t.onStarted?.(), $(a.dataset.state) && he());
3800
+ S || (D = !0, a.dataset.live = "true", _e(null), t.onStarted?.(), $(a.dataset.state) && pe());
3783
3801
  }), e.on("feedback", (e) => {
3784
3802
  S || t.onFeedback?.(e);
3785
3803
  }), e.on("feedbackFailed", (e) => {
3786
3804
  S || t.onFeedbackFailed?.(e);
3787
3805
  });
3788
3806
  }, De = () => {
3789
- oe(), u.hidden = !0, p.hidden = !0, z(), a.dataset.state = "collapsed", a.classList.remove("liforma-ew--session-revealed"), a.classList.remove("liforma-ew--session-concealing"), g.setAttribute("aria-pressed", "false"), o.hidden = !1, o.tabIndex = 0, o.removeAttribute("aria-hidden"), C && (o.disabled = !1), U(null), typeof document < "u" && (document.body.style.overflow = k), H();
3807
+ ae(), u.hidden = !0, p.hidden = !0, B(), a.dataset.state = "collapsed", a.classList.remove("liforma-ew--session-revealed"), a.classList.remove("liforma-ew--session-concealing"), g.setAttribute("aria-pressed", "false"), o.hidden = !1, o.tabIndex = 0, o.removeAttribute("aria-hidden"), C && (o.disabled = !1), _e(null), typeof document < "u" && (document.body.style.overflow = k), W();
3790
3808
  }, Oe = () => {
3791
- ae(), oe(), O += 1, x = !1, w = !1, T = !1, E = !1, D = !1;
3809
+ ie(), ae(), O += 1, x = !1, w = !1, T = !1, E = !1, D = !1;
3792
3810
  let e = b;
3793
3811
  b = null, e?.destroy(), v.replaceChildren(), l.replaceChildren(), l.hidden = !0, delete a.dataset.warm, delete a.dataset.live, a.classList.remove("liforma-ew--session-revealed");
3794
3812
  }, K = () => {
@@ -3796,33 +3814,33 @@ function Sr(e, t) {
3796
3814
  if (V(), x = !1, b && E) {
3797
3815
  let e = b;
3798
3816
  (async () => {
3799
- D && (await _e(), S || b !== e) || (w && e.setWidgetChrome("collapsed"), De(), D ? (a.dataset.live = "true", o.tabIndex = 0, o.removeAttribute("aria-hidden"), o.disabled = !1) : w && be(), t.onCollapsed?.(), t.onClose?.());
3817
+ D && (await he(), S || b !== e) || (w && e.setWidgetChrome("collapsed"), De(), D ? (a.dataset.live = "true", o.tabIndex = 0, o.removeAttribute("aria-hidden"), o.disabled = !1) : w && be(), t.onCollapsed?.(), t.onClose?.());
3800
3818
  })();
3801
3819
  return;
3802
3820
  }
3803
3821
  Oe(), De(), t.onCollapsed?.(), t.onClose?.();
3804
3822
  }
3805
3823
  }, ke = () => {
3806
- S || fr() && R() === "expanded" && ge(() => {
3824
+ S || mr() && z() === "expanded" && me(() => {
3807
3825
  Te();
3808
3826
  });
3809
3827
  }, Ae = () => {
3810
- S || R() === "docked" && (V(), ge(() => {
3811
- z(), G(!1), b?.setWidgetChrome("expanded");
3828
+ S || z() === "docked" && (V(), me(() => {
3829
+ B(), G(!1), b?.setWidgetChrome("expanded");
3812
3830
  }));
3813
3831
  }, je = () => {
3814
- !b || !D || (ae(), a.classList.remove("liforma-ew--session-revealed"), G(), b.setWidgetChrome("expanded"), x = !1, he());
3832
+ !b || !D || (ie(), a.classList.remove("liforma-ew--session-revealed"), G(), b.setWidgetChrome("expanded"), x = !1, pe());
3815
3833
  }, q = () => {
3816
- !b || !E || D || (ae(), a.classList.remove("liforma-ew--session-revealed"), G(), x = !1, w || b.setWidgetChrome("expanded"));
3834
+ !b || !E || D || (ie(), a.classList.remove("liforma-ew--session-revealed"), G(), x = !1, w || b.setWidgetChrome("expanded"));
3817
3835
  }, Me = (e) => {
3818
- S || e !== O && !D || (ae(), a.classList.remove("liforma-ew--session-revealed"), G(), x = !1, D && he());
3836
+ S || e !== O && !D || (ie(), a.classList.remove("liforma-ew--session-revealed"), G(), x = !1, D && pe());
3819
3837
  }, J = () => {
3820
3838
  if (S || T || w || b || $(a.dataset.state)) return;
3821
3839
  T = !0;
3822
3840
  let e = O;
3823
3841
  l.hidden = !1, (async () => {
3824
3842
  try {
3825
- let t = await er.startSession(Ce());
3843
+ let t = await nr.startSession(Ce());
3826
3844
  if (S || e !== O) {
3827
3845
  t.destroy();
3828
3846
  return;
@@ -3841,16 +3859,16 @@ function Sr(e, t) {
3841
3859
  S || Ie(e);
3842
3860
  },
3843
3861
  onWidgetDragStart: (e) => {
3844
- S || de(e);
3862
+ S || U(e);
3845
3863
  },
3846
3864
  onWidgetDragMove: (e) => {
3847
- S || fe(e);
3865
+ S || ue(e);
3848
3866
  },
3849
3867
  onWidgetDragEnd: (e) => {
3850
- S || pe(e);
3868
+ S || de(e);
3851
3869
  },
3852
3870
  onPlayerStatusChange: (e) => {
3853
- S || e === "error" && $(a.dataset.state) && U("Could not load the experience.");
3871
+ S || e === "error" && $(a.dataset.state) && _e("Could not load the experience.");
3854
3872
  }
3855
3873
  });
3856
3874
  if (S || e !== O) {
@@ -3881,7 +3899,7 @@ function Sr(e, t) {
3881
3899
  x = !0, w = !1, T = !1, E = !1, D = !1, delete a.dataset.warm, delete a.dataset.live, l.hidden = !0, l.replaceChildren(), b &&= (b.destroy(), null), (async () => {
3882
3900
  try {
3883
3901
  G();
3884
- let t = await er.startSession(Ce());
3902
+ let t = await nr.startSession(Ce());
3885
3903
  if (S || e !== O) {
3886
3904
  t.destroy();
3887
3905
  return;
@@ -3894,16 +3912,16 @@ function Sr(e, t) {
3894
3912
  S || Ie(e);
3895
3913
  },
3896
3914
  onWidgetDragStart: (e) => {
3897
- S || de(e);
3915
+ S || U(e);
3898
3916
  },
3899
3917
  onWidgetDragMove: (e) => {
3900
- S || fe(e);
3918
+ S || ue(e);
3901
3919
  },
3902
3920
  onWidgetDragEnd: (e) => {
3903
- S || pe(e);
3921
+ S || de(e);
3904
3922
  },
3905
3923
  onPlayerStatusChange: (e) => {
3906
- S || (e === "error" ? U("Could not load the experience.") : $(a.dataset.state) && U(null));
3924
+ S || (e === "error" ? _e("Could not load the experience.") : $(a.dataset.state) && _e(null));
3907
3925
  }
3908
3926
  });
3909
3927
  if (S || e !== O) {
@@ -3916,7 +3934,7 @@ function Sr(e, t) {
3916
3934
  } catch (n) {
3917
3935
  if (S || e !== O) return;
3918
3936
  let r = n instanceof Error ? n : Error(String(n));
3919
- U(r.message), t.onError?.(r), console.error("[ExperienceWidget]", r);
3937
+ _e(r.message), t.onError?.(r), console.error("[ExperienceWidget]", r);
3920
3938
  } finally {
3921
3939
  e === O && (x = !1);
3922
3940
  }
@@ -3938,47 +3956,47 @@ function Sr(e, t) {
3938
3956
  Ne();
3939
3957
  }
3940
3958
  }, Fe = (e) => {
3941
- if (e.stopPropagation(), R() === "expanded") {
3959
+ if (e.stopPropagation(), z() === "expanded") {
3942
3960
  ke();
3943
3961
  return;
3944
3962
  }
3945
- R() === "docked" && Ae();
3963
+ z() === "docked" && Ae();
3946
3964
  }, Ie = (e) => {
3947
3965
  g.setAttribute("aria-pressed", e ? "true" : "false");
3948
3966
  }, Le = (e) => {
3949
3967
  e.stopPropagation(), $(a.dataset.state) && b?.toggleAudioSettings();
3950
3968
  }, Re = (e) => {
3951
- R() === "docked" && fr() && (e.target?.closest("button") || (e.preventDefault(), ue(e.clientX, e.clientY, e.pointerId)));
3969
+ z() === "docked" && mr() && (e.target?.closest("button") || (e.preventDefault(), H(e.clientX, e.clientY, e.pointerId)));
3952
3970
  }, ze = (e) => {
3953
3971
  e.key === "Escape" && $(a.dataset.state) && (e.preventDefault(), K());
3954
3972
  }, Be = () => {
3955
3973
  if (!S) {
3956
- if (R() === "docked") {
3957
- if (!fr()) {
3974
+ if (z() === "docked") {
3975
+ if (!mr()) {
3958
3976
  Ae();
3959
3977
  return;
3960
3978
  }
3961
- D ? ge(() => {
3962
- me(!0);
3963
- }) : me(!0);
3979
+ D ? me(() => {
3980
+ fe(!0);
3981
+ }) : fe(!0);
3964
3982
  return;
3965
3983
  }
3966
- H();
3984
+ W();
3967
3985
  }
3968
- }, Ve = typeof window < "u" ? window.matchMedia(nr) : null, He = () => {
3986
+ }, Ve = typeof window < "u" ? window.matchMedia(ir) : null, He = () => {
3969
3987
  if (!S) {
3970
- if (R() === "docked" && !fr()) {
3988
+ if (z() === "docked" && !mr()) {
3971
3989
  Ae();
3972
3990
  return;
3973
3991
  }
3974
- H();
3992
+ W();
3975
3993
  }
3976
3994
  };
3977
3995
  return o.addEventListener("click", Pe), d.addEventListener("click", K), _.addEventListener("click", (e) => {
3978
3996
  e.stopPropagation(), K();
3979
- }), h.addEventListener("click", Fe), g.addEventListener("click", Le), p.addEventListener("pointerdown", Re), window.addEventListener("keydown", ze), window.addEventListener("resize", Be), Ve?.addEventListener("change", He), Se(), H(), r === "eager" ? queueMicrotask(() => {
3997
+ }), h.addEventListener("click", Fe), g.addEventListener("click", Le), p.addEventListener("pointerdown", Re), window.addEventListener("keydown", ze), window.addEventListener("resize", Be), Ve?.addEventListener("change", He), Se(), W(), r === "eager" ? queueMicrotask(() => {
3980
3998
  S || J();
3981
- }) : r === "idle" && (ee = xr(() => {
3999
+ }) : r === "idle" && (ee = Cr(() => {
3982
4000
  S || J();
3983
4001
  })), {
3984
4002
  root: a,
@@ -3994,18 +4012,18 @@ function Sr(e, t) {
3994
4012
  J();
3995
4013
  },
3996
4014
  destroy() {
3997
- S || (S = !0, V(), ee?.(), ee = null, re.abort(), A?.(), A = null, window.removeEventListener("keydown", ze), window.removeEventListener("resize", Be), Ve?.removeEventListener("change", He), Oe(), De(), e.replaceChildren());
4015
+ S || (S = !0, V(), ee?.(), ee = null, ne.abort(), A?.(), A = null, window.removeEventListener("keydown", ze), window.removeEventListener("resize", Be), Ve?.removeEventListener("change", He), Oe(), De(), e.replaceChildren());
3998
4016
  }
3999
4017
  };
4000
4018
  }
4001
4019
  //#endregion
4002
4020
  //#region src/react/ExperienceWidget.tsx
4003
- function Cr(e) {
4004
- let t = o(null), { experienceId: r, alt: i, galleryThumb: a, avatarImage: s, backgroundImage: c, foregroundImage: l, fallbackImage: u, prefetch: f = "onExpand", parallax: p = !0, position: m = "static", offset: h, sessionEndpoint: g, locale: _, secondaryLocale: v, learningLocale: y, language: b, mode: x, speechInputMode: S, speechOnly: C, fit: w, embedBaseUrl: T, expandedMaxWidth: E, expandedMaxHeight: D, startButtonLabel: O, startButton: k, showFeedback: A, className: ee = "", onExpanded: j, onCollapsed: M, onStarted: N, onClose: P, onError: F, onPrefetchReady: te, onFeedback: I, onFeedbackFailed: L } = e, ne = m === "bottom-right" || m === "bottom-left";
4021
+ function Tr(e) {
4022
+ let t = o(null), { experienceId: r, alt: i, galleryThumb: a, avatarImage: s, backgroundImage: c, foregroundImage: l, fallbackImage: u, prefetch: f = "onExpand", parallax: p = !0, position: m = "static", offset: h, sessionEndpoint: g, locale: _, secondaryLocale: v, learningLocale: y, language: b, mode: x, speechInputMode: S, speechOnly: C, fit: w, embedBaseUrl: T, expandedMaxWidth: E, expandedMaxHeight: D, startButtonLabel: O, startButton: k, showFeedback: A, className: ee = "", onExpanded: j, onCollapsed: M, onStarted: N, onClose: P, onError: F, onPrefetchReady: te, onFeedback: I, onFeedbackFailed: L } = e, R = m === "bottom-right" || m === "bottom-left";
4005
4023
  return n(() => {
4006
4024
  let e = t.current;
4007
4025
  if (!e || !r.trim()) return;
4008
- let n = Sr(e, {
4026
+ let n = wr(e, {
4009
4027
  experienceId: r,
4010
4028
  alt: i,
4011
4029
  galleryThumb: a,
@@ -4080,7 +4098,7 @@ function Cr(e) {
4080
4098
  ]), /* @__PURE__ */ d("div", {
4081
4099
  ref: t,
4082
4100
  className: ee,
4083
- style: ne ? { display: "contents" } : {
4101
+ style: R ? { display: "contents" } : {
4084
4102
  width: "100%",
4085
4103
  height: "100%",
4086
4104
  minHeight: "inherit"
@@ -4088,6 +4106,6 @@ function Cr(e) {
4088
4106
  });
4089
4107
  }
4090
4108
  //#endregion
4091
- export { ne as Experience, Ze as ExperienceThumbnail, Cr as ExperienceWidget };
4109
+ export { R as Experience, Ze as ExperienceThumbnail, Tr as ExperienceWidget };
4092
4110
 
4093
4111
  //# sourceMappingURL=index.js.map