@liforma/client 0.4.9 → 0.4.11

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 (138) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/dist/next/index.js +763 -623
  3. package/dist/next/index.js.map +1 -1
  4. package/dist/next/react/ExperienceThumbnail.d.ts +2 -0
  5. package/dist/next/react/ExperienceThumbnail.d.ts.map +1 -1
  6. package/dist/next/react/ExperienceWidget.d.ts +3 -0
  7. package/dist/next/react/ExperienceWidget.d.ts.map +1 -1
  8. package/dist/next/thumbnail/expandAssetUrl.d.ts +17 -0
  9. package/dist/next/thumbnail/expandAssetUrl.d.ts.map +1 -0
  10. package/dist/next/thumbnail/expandAssetUrl.test.d.ts +2 -0
  11. package/dist/next/thumbnail/expandAssetUrl.test.d.ts.map +1 -0
  12. package/dist/next/thumbnail/index.d.ts +3 -0
  13. package/dist/next/thumbnail/index.d.ts.map +1 -1
  14. package/dist/next/thumbnail/locationPlate.d.ts +13 -0
  15. package/dist/next/thumbnail/locationPlate.d.ts.map +1 -0
  16. package/dist/next/thumbnail/locationPlate.test.d.ts +2 -0
  17. package/dist/next/thumbnail/locationPlate.test.d.ts.map +1 -0
  18. package/dist/next/thumbnail/styles.d.ts.map +1 -1
  19. package/dist/next/thumbnail/toGalleryThumbUrl.d.ts +12 -2
  20. package/dist/next/thumbnail/toGalleryThumbUrl.d.ts.map +1 -1
  21. package/dist/next/thumbnail/types.d.ts +7 -1
  22. package/dist/next/thumbnail/types.d.ts.map +1 -1
  23. package/dist/next/thumbnail.js +273 -192
  24. package/dist/next/thumbnail.js.map +1 -1
  25. package/dist/next/v2/embed/iframeHost.d.ts +6 -2
  26. package/dist/next/v2/embed/iframeHost.d.ts.map +1 -1
  27. package/dist/next/v2/embed/protocol.d.ts +25 -2
  28. package/dist/next/v2/embed/protocol.d.ts.map +1 -1
  29. package/dist/next/v2/experience.d.ts +25 -3
  30. package/dist/next/v2/experience.d.ts.map +1 -1
  31. package/dist/next/v2/shims/embedBaseUrl.d.ts +15 -1
  32. package/dist/next/v2/shims/embedBaseUrl.d.ts.map +1 -1
  33. package/dist/next/v2/types/sessionInteraction.d.ts +13 -1
  34. package/dist/next/v2/types/sessionInteraction.d.ts.map +1 -1
  35. package/dist/next/v2/types/sessionManifest.d.ts +1 -0
  36. package/dist/next/v2/types/sessionManifest.d.ts.map +1 -1
  37. package/dist/next/v2/types/stage.d.ts +8 -0
  38. package/dist/next/v2/types/stage.d.ts.map +1 -0
  39. package/dist/next/widget/mountExperienceWidget.d.ts.map +1 -1
  40. package/dist/next/widget/types.d.ts +1 -0
  41. package/dist/next/widget/types.d.ts.map +1 -1
  42. package/dist/npm/index.js +566 -454
  43. package/dist/npm/index.js.map +1 -1
  44. package/dist/npm/thumbnail/expandAssetUrl.d.ts +17 -0
  45. package/dist/npm/thumbnail/expandAssetUrl.d.ts.map +1 -0
  46. package/dist/npm/thumbnail/index.d.ts +3 -0
  47. package/dist/npm/thumbnail/index.d.ts.map +1 -1
  48. package/dist/npm/thumbnail/index.js +151 -75
  49. package/dist/npm/thumbnail/index.js.map +1 -1
  50. package/dist/npm/thumbnail/locationPlate.d.ts +13 -0
  51. package/dist/npm/thumbnail/locationPlate.d.ts.map +1 -0
  52. package/dist/npm/thumbnail/styles.d.ts.map +1 -1
  53. package/dist/npm/thumbnail/toGalleryThumbUrl.d.ts +12 -2
  54. package/dist/npm/thumbnail/toGalleryThumbUrl.d.ts.map +1 -1
  55. package/dist/npm/thumbnail/types.d.ts +7 -1
  56. package/dist/npm/thumbnail/types.d.ts.map +1 -1
  57. package/dist/npm/v2/embed/iframeHost.d.ts +6 -2
  58. package/dist/npm/v2/embed/iframeHost.d.ts.map +1 -1
  59. package/dist/npm/v2/embed/protocol.d.ts +25 -2
  60. package/dist/npm/v2/embed/protocol.d.ts.map +1 -1
  61. package/dist/npm/v2/experience.d.ts +25 -3
  62. package/dist/npm/v2/experience.d.ts.map +1 -1
  63. package/dist/npm/v2/index.d.ts +2 -1
  64. package/dist/npm/v2/index.d.ts.map +1 -1
  65. package/dist/npm/v2/liforma-experience-thumbnail.d.ts.map +1 -1
  66. package/dist/npm/v2/liforma-experience.d.ts +2 -0
  67. package/dist/npm/v2/liforma-experience.d.ts.map +1 -1
  68. package/dist/npm/v2/npm.d.ts +2 -1
  69. package/dist/npm/v2/npm.d.ts.map +1 -1
  70. package/dist/npm/v2/shims/embedBaseUrl.d.ts +15 -1
  71. package/dist/npm/v2/shims/embedBaseUrl.d.ts.map +1 -1
  72. package/dist/npm/v2/types/sessionInteraction.d.ts +13 -1
  73. package/dist/npm/v2/types/sessionInteraction.d.ts.map +1 -1
  74. package/dist/npm/v2/types/sessionManifest.d.ts +1 -0
  75. package/dist/npm/v2/types/sessionManifest.d.ts.map +1 -1
  76. package/dist/npm/v2/types/sessionManifestSchema.d.ts +17 -0
  77. package/dist/npm/v2/types/sessionManifestSchema.d.ts.map +1 -1
  78. package/dist/npm/v2/types/stage.d.ts +8 -0
  79. package/dist/npm/v2/types/stage.d.ts.map +1 -0
  80. package/dist/npm/widget/mountExperienceWidget.d.ts.map +1 -1
  81. package/dist/npm/widget/types.d.ts +1 -0
  82. package/dist/npm/widget/types.d.ts.map +1 -1
  83. package/dist/react/component/experienceComponentRuntime.d.ts +4 -0
  84. package/dist/react/component/experienceComponentRuntime.d.ts.map +1 -1
  85. package/dist/react/component/experienceComponentTypes.d.ts +15 -1
  86. package/dist/react/component/experienceComponentTypes.d.ts.map +1 -1
  87. package/dist/react/index.js +884 -719
  88. package/dist/react/index.js.map +1 -1
  89. package/dist/react/react/Experience.d.ts.map +1 -1
  90. package/dist/react/react/ExperienceThumbnail.d.ts +2 -0
  91. package/dist/react/react/ExperienceThumbnail.d.ts.map +1 -1
  92. package/dist/react/react/ExperienceWidget.d.ts +3 -0
  93. package/dist/react/react/ExperienceWidget.d.ts.map +1 -1
  94. package/dist/react/thumbnail/expandAssetUrl.d.ts +17 -0
  95. package/dist/react/thumbnail/expandAssetUrl.d.ts.map +1 -0
  96. package/dist/react/thumbnail/expandAssetUrl.test.d.ts +2 -0
  97. package/dist/react/thumbnail/expandAssetUrl.test.d.ts.map +1 -0
  98. package/dist/react/thumbnail/index.d.ts +3 -0
  99. package/dist/react/thumbnail/index.d.ts.map +1 -1
  100. package/dist/react/thumbnail/locationPlate.d.ts +13 -0
  101. package/dist/react/thumbnail/locationPlate.d.ts.map +1 -0
  102. package/dist/react/thumbnail/locationPlate.test.d.ts +2 -0
  103. package/dist/react/thumbnail/locationPlate.test.d.ts.map +1 -0
  104. package/dist/react/thumbnail/styles.d.ts.map +1 -1
  105. package/dist/react/thumbnail/toGalleryThumbUrl.d.ts +12 -2
  106. package/dist/react/thumbnail/toGalleryThumbUrl.d.ts.map +1 -1
  107. package/dist/react/thumbnail/types.d.ts +7 -1
  108. package/dist/react/thumbnail/types.d.ts.map +1 -1
  109. package/dist/react/thumbnail.js +273 -192
  110. package/dist/react/thumbnail.js.map +1 -1
  111. package/dist/react/v2/embed/iframeHost.d.ts +6 -2
  112. package/dist/react/v2/embed/iframeHost.d.ts.map +1 -1
  113. package/dist/react/v2/embed/protocol.d.ts +25 -2
  114. package/dist/react/v2/embed/protocol.d.ts.map +1 -1
  115. package/dist/react/v2/experience.d.ts +25 -3
  116. package/dist/react/v2/experience.d.ts.map +1 -1
  117. package/dist/react/v2/shims/embedBaseUrl.d.ts +15 -1
  118. package/dist/react/v2/shims/embedBaseUrl.d.ts.map +1 -1
  119. package/dist/react/v2/types/sessionInteraction.d.ts +13 -1
  120. package/dist/react/v2/types/sessionInteraction.d.ts.map +1 -1
  121. package/dist/react/v2/types/sessionManifest.d.ts +1 -0
  122. package/dist/react/v2/types/sessionManifest.d.ts.map +1 -1
  123. package/dist/react/v2/types/stage.d.ts +8 -0
  124. package/dist/react/v2/types/stage.d.ts.map +1 -0
  125. package/dist/react/widget/mountExperienceWidget.d.ts.map +1 -1
  126. package/dist/react/widget/types.d.ts +1 -0
  127. package/dist/react/widget/types.d.ts.map +1 -1
  128. package/dist/sdk/v2/client.js +2 -2
  129. package/dist/sdk/v2/client.js.map +1 -1
  130. package/dist/sdk/v2/thumbnail.js +9 -2
  131. package/dist/sdk/v2/thumbnail.js.map +1 -1
  132. package/dist/svelte/Experience.svelte +43 -0
  133. package/dist/svelte/Experience.svelte.d.ts +3 -0
  134. package/dist/svelte/ExperienceThumbnail.svelte +24 -2
  135. package/dist/svelte/ExperienceThumbnail.svelte.d.ts +2 -0
  136. package/dist/svelte/ExperienceWidget.svelte +9 -0
  137. package/dist/svelte/ExperienceWidget.svelte.d.ts +3 -0
  138. package/package.json +1 -1
@@ -106,28 +106,98 @@ function y(e) {
106
106
  return e === "face" ? "liforma-et--fit-face" : e === "medium" ? "liforma-et--fit-medium" : "";
107
107
  }
108
108
  //#endregion
109
+ //#region src/thumbnail/locationPlate.ts
110
+ var b = /(-)(\d+x\d+)(\.webp)(\?|$)/i;
111
+ function x(e, t) {
112
+ return !Number.isFinite(e) || !Number.isFinite(t) || e < 1 || t < 1 || e <= t ? "256x256" : e > 800 || t > 450 ? "1672x941" : "800x450";
113
+ }
114
+ function S(e, t) {
115
+ let n = e.trim();
116
+ return n && n.replace(b, (e, n, r, i, a) => `${n}${t}${i}${a}`);
117
+ }
118
+ function C(e, t) {
119
+ let n = () => {
120
+ t(e.clientWidth, e.clientHeight);
121
+ };
122
+ if (n(), typeof ResizeObserver > "u") return () => {};
123
+ let r = new ResizeObserver(n);
124
+ return r.observe(e), () => r.disconnect();
125
+ }
126
+ var w = /-(256x256|400x450|800x450|836x971|1672x941|167x94)$/i;
127
+ function T(e) {
128
+ return e?.trim().replace(/\/$/, "") || "https://cdn.liforma.ai";
129
+ }
130
+ function E(e) {
131
+ return /^https?:\/\//i.test(e) || e.startsWith("//");
132
+ }
133
+ function D(e) {
134
+ return e.startsWith("//") ? `https:${e}` : e;
135
+ }
136
+ function O(e) {
137
+ let t = e.indexOf("?");
138
+ return t === -1 ? {
139
+ pathname: e,
140
+ search: ""
141
+ } : {
142
+ pathname: e.slice(0, t),
143
+ search: e.slice(t)
144
+ };
145
+ }
146
+ function k(e, t, n = "") {
147
+ return `${e}${t.startsWith("/") ? t : `/${t}`}${n}`;
148
+ }
149
+ function A(e, t, n) {
150
+ let r = e.trim();
151
+ if (!r) return r;
152
+ let i = T(n);
153
+ if (E(r)) return S(D(r), t);
154
+ let { pathname: a, search: o } = O(r.replace(/\\/g, "/")), s = a;
155
+ if (!s.startsWith("/")) s = `/locations/${s.replace(/^locations\//i, "")}`;
156
+ else if (!/^\/locations\//i.test(s)) return /^\/avatars\//i.test(s) ? k(i, s, o) : r;
157
+ if (/\.webp$/i.test(s) && !w.test(s.replace(/\.webp$/i, ""))) return k(i, s, o);
158
+ let c = s.replace(/^\/locations\//i, "").replace(/\.webp$/i, "");
159
+ return c = c.replace(w, ""), `${i}/locations/${c}-${t}.webp${o}`;
160
+ }
161
+ function j(e, t) {
162
+ let n = e.trim();
163
+ if (!n) return n;
164
+ let r = T(t);
165
+ if (E(n)) return D(n);
166
+ let { pathname: i, search: a } = O(n.replace(/\\/g, "/")), o = i;
167
+ if (!o.startsWith("/")) if (/^avatars\//i.test(o)) o = `/${o}`;
168
+ else if (/^[^/]+$/.test(o) && !a) return `${r}/avatars/${o}/256/${o}_neutral.webp`;
169
+ else return n;
170
+ if (!/^\/avatars\//i.test(o)) return n;
171
+ let s = o.replace(/^\/avatars\//i, "").replace(/\/+$/, "");
172
+ return s && !s.includes("/") && !a ? `${r}/avatars/${s}/256/${s}_neutral.webp` : k(r, o, a);
173
+ }
174
+ //#endregion
109
175
  //#region src/thumbnail/toGalleryThumbUrl.ts
110
- var b = /(\/avatars\/[^/]+\/)(\d+)(\/)/i, x = /_CH(\.webp)/i, S = /(-)(\d+x\d+)(\.webp)(\?|$)/i;
111
- function C(e) {
112
- let t = e.trim();
113
- if (!t) return t;
114
- let n = t.replace(b, (e, t, n, r) => n === "256" ? `${t}${n}${r}` : `${t}256${r}`);
115
- return n = n.replace(x, "_neutral$1"), n = n.replace(S, (e, t, n, r, i) => n === "256x256" ? `${t}${n}${r}${i}` : `${t}256x256${r}${i}`), n;
116
- }
117
- function w(e) {
176
+ var M = /(\/avatars\/[^/]+\/)(\d+)(\/)/i, ee = /_CH(\.webp)/i;
177
+ function N(e) {
178
+ 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("/");
179
+ }
180
+ function P(e, t = "256x256", n) {
181
+ let r = e.trim();
182
+ if (!r) return r;
183
+ if (N(r)) return A(r, t, n);
184
+ let i = j(r, n);
185
+ return i = i.replace(M, (e, t, n, r) => n === "256" ? `${t}${n}${r}` : `${t}256${r}`), i.replace(ee, "_neutral$1");
186
+ }
187
+ function F(e) {
118
188
  let t = e.avatarImage?.trim() || e.galleryThumb?.avatarImage?.trim() || "";
119
189
  if (!t) return null;
120
- let n = e.backgroundImage?.trim() || e.galleryThumb?.backgroundImage?.trim() || "", r = e.foregroundImage?.trim() || e.galleryThumb?.foregroundImage?.trim() || "", i = e.fallbackImage?.trim() || "";
190
+ 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 = T(e.cdnBaseUrl), s = e.normalize !== !1, c = (e) => !s && /^https?:\/\//i.test(e.trim()) ? e.trim() : P(e, a, o), l = (e) => !s && /^https?:\/\//i.test(e.trim()) ? e.trim() : A(e, a, o);
121
191
  return {
122
- avatarImage: C(t),
123
- ...n ? { backgroundImage: C(n) } : {},
124
- ...r ? { foregroundImage: C(r) } : {},
125
- ...i ? { fallbackImage: C(i) } : {}
192
+ avatarImage: c(t),
193
+ ...n ? { backgroundImage: l(n) } : {},
194
+ ...r ? { foregroundImage: l(r) } : {},
195
+ ...i ? { fallbackImage: c(i) } : {}
126
196
  };
127
197
  }
128
198
  //#endregion
129
199
  //#region src/shims/localStack.ts
130
- function T() {
200
+ function te() {
131
201
  if (globalThis.__LIFORMA_STACK === "local") return !0;
132
202
  if (typeof location > "u") return !1;
133
203
  try {
@@ -138,83 +208,83 @@ function T() {
138
208
  }
139
209
  //#endregion
140
210
  //#region src/thumbnail/hostedLaunchUrl.ts
141
- var E = "https://player.liforma.ai", D = "http://localhost:3002";
142
- function O(e) {
211
+ var I = "https://player.liforma.ai", L = "http://localhost:3002";
212
+ function ne(e) {
143
213
  return e.href?.trim() ? "anchor" : e.hasClickHandler ? "button" : e.experienceId?.trim() ? "anchor" : "presentational";
144
214
  }
145
- function k(e) {
215
+ function re(e) {
146
216
  let t = e?.trim();
147
- return t ? t.replace(/\/$/, "") : T() ? D : E;
217
+ return t ? t.replace(/\/$/, "") : te() ? L : I;
148
218
  }
149
- function A(e) {
150
- let t = e.experienceId.trim(), n = k(e.playerBaseUrl), r = new URL(`${n}/${encodeURIComponent(t)}`), i = e.returnUrl?.trim();
219
+ function ie(e) {
220
+ let t = e.experienceId.trim(), n = re(e.playerBaseUrl), r = new URL(`${n}/${encodeURIComponent(t)}`), i = e.returnUrl?.trim();
151
221
  return i && r.searchParams.set("returnUrl", i), r.toString();
152
222
  }
153
- function ee(e) {
223
+ function R(e) {
154
224
  let t = e.href?.trim();
155
225
  if (t) return t;
156
226
  let n = e.experienceId?.trim();
157
227
  if (!n) return;
158
228
  let r = e.returnUrl?.trim();
159
- return !r && e.useCurrentPageAsReturnUrl && typeof window < "u" && (r = window.location.href), A({
229
+ return !r && e.useCurrentPageAsReturnUrl && typeof window < "u" && (r = window.location.href), ie({
160
230
  experienceId: n,
161
231
  ...r ? { returnUrl: r } : {},
162
232
  playerBaseUrl: e.playerBaseUrl
163
233
  });
164
234
  }
165
- function j() {
235
+ function z() {
166
236
  return typeof window > "u" ? !1 : window.matchMedia("(hover: none), (pointer: coarse)").matches;
167
237
  }
168
- var M = 0, N = [];
169
- function P() {
170
- return j() ? 4 : Infinity;
238
+ var B = 0, ae = [];
239
+ function oe() {
240
+ return z() ? 4 : Infinity;
171
241
  }
172
- function F() {
173
- return j() ? 160 : 0;
242
+ function se() {
243
+ return z() ? 160 : 0;
174
244
  }
175
- function te() {
176
- let e = P();
177
- for (; M < e && N.length > 0;) {
178
- let e = N.shift();
245
+ function ce() {
246
+ let e = oe();
247
+ for (; B < e && ae.length > 0;) {
248
+ let e = ae.shift();
179
249
  if (!e || e.cancelled) continue;
180
- M += 1, e.start();
181
- let t = F();
250
+ B += 1, e.start();
251
+ let t = se();
182
252
  if (t <= 0) {
183
- M = Math.max(0, M - 1);
253
+ B = Math.max(0, B - 1);
184
254
  continue;
185
255
  }
186
256
  window.setTimeout(() => {
187
- M = Math.max(0, M - 1), te();
257
+ B = Math.max(0, B - 1), ce();
188
258
  }, t);
189
259
  }
190
260
  }
191
- function ne(e) {
192
- if (!j()) return e(), () => {};
261
+ function le(e) {
262
+ if (!z()) return e(), () => {};
193
263
  let t = {
194
264
  start: e,
195
265
  cancelled: !1
196
266
  };
197
- return N.push(t), te(), () => {
267
+ return ae.push(t), ce(), () => {
198
268
  t.cancelled = !0;
199
269
  };
200
270
  }
201
271
  //#endregion
202
272
  //#region src/thumbnail/lazyLoad.ts
203
- function I() {
204
- return j() ? "96px 0px" : "280px 0px";
273
+ function V() {
274
+ return z() ? "96px 0px" : "280px 0px";
205
275
  }
206
- function L(e) {
276
+ function ue(e) {
207
277
  let t = e.trim().split(/\s+/)[0] ?? "0px", n = Number.parseFloat(t);
208
278
  return Number.isFinite(n) ? Math.abs(n) : 280;
209
279
  }
210
- function re(e, t) {
280
+ function de(e, t) {
211
281
  if (typeof window > "u") return !1;
212
282
  let n = e.getBoundingClientRect();
213
283
  return n.bottom >= -t && n.top <= window.innerHeight + t;
214
284
  }
215
- function ie(e, t) {
216
- let { onVisibleChange: n } = t, r = t.rootMargin ?? I(), i = L(r), a = !1, o = !1, s = null, c = () => {
217
- o || (s?.(), s = ne(() => {
285
+ function fe(e, t) {
286
+ let { onVisibleChange: n } = t, r = t.rootMargin ?? V(), i = ue(r), a = !1, o = !1, s = null, c = () => {
287
+ o || (s?.(), s = le(() => {
218
288
  s = null, o = !0, n(!0);
219
289
  }));
220
290
  }, l = (e) => {
@@ -236,55 +306,55 @@ function ie(e, t) {
236
306
  rootMargin: r,
237
307
  threshold: 0
238
308
  });
239
- return u.observe(e), re(e, i) && l(!0), () => {
309
+ return u.observe(e), de(e, i) && l(!0), () => {
240
310
  s?.(), s = null, u.disconnect();
241
311
  };
242
312
  }
243
313
  //#endregion
244
314
  //#region src/thumbnail/scrollParallax.ts
245
- function R() {
315
+ function pe() {
246
316
  return typeof window > "u" || window.matchMedia("(prefers-reduced-motion: reduce)").matches ? !1 : window.matchMedia("(hover: none), (pointer: coarse)").matches;
247
317
  }
248
- function z(e, t) {
318
+ function H(e, t) {
249
319
  return ((e.top + e.height / 2) / Math.max(t, 1) - .5) * 2;
250
320
  }
251
- var B = /* @__PURE__ */ new Set(), ae = !1, V = 0;
252
- function oe() {
253
- if (V = 0, B.size === 0 || typeof window > "u") return;
321
+ var me = /* @__PURE__ */ new Set(), U = !1, W = 0;
322
+ function he() {
323
+ if (W = 0, me.size === 0 || typeof window > "u") return;
254
324
  let e = window.innerHeight;
255
- for (let t of B) {
325
+ for (let t of me) {
256
326
  if (t.pointerActive?.()) continue;
257
327
  let n = t.element.getBoundingClientRect();
258
- n.bottom < -64 || n.top > e + 64 || t.onParallax(z(n, e));
328
+ n.bottom < -64 || n.top > e + 64 || t.onParallax(H(n, e));
259
329
  }
260
330
  }
261
- function se() {
262
- V === 0 && (V = requestAnimationFrame(oe));
331
+ function ge() {
332
+ W === 0 && (W = requestAnimationFrame(he));
263
333
  }
264
- function ce() {
265
- ae || typeof window > "u" || (ae = !0, window.addEventListener("scroll", se, { passive: !0 }), window.addEventListener("resize", se, { passive: !0 }));
334
+ function G() {
335
+ U || typeof window > "u" || (U = !0, window.addEventListener("scroll", ge, { passive: !0 }), window.addEventListener("resize", ge, { passive: !0 }));
266
336
  }
267
- function H() {
268
- B.size > 0 || !ae || typeof window > "u" || (ae = !1, V !== 0 && (cancelAnimationFrame(V), V = 0), window.removeEventListener("scroll", se), window.removeEventListener("resize", se));
337
+ function _e() {
338
+ me.size > 0 || !U || typeof window > "u" || (U = !1, W !== 0 && (cancelAnimationFrame(W), W = 0), window.removeEventListener("scroll", ge), window.removeEventListener("resize", ge));
269
339
  }
270
- function le(e, t) {
271
- if (!R()) return () => {};
340
+ function ve(e, t) {
341
+ if (!pe()) return () => {};
272
342
  let n = {
273
343
  element: e,
274
344
  onParallax: t.onParallax,
275
345
  pointerActive: t.pointerActive
276
346
  };
277
- return B.add(n), ce(), n.pointerActive?.() || t.onParallax(z(e.getBoundingClientRect(), window.innerHeight)), () => {
278
- B.delete(n), H();
347
+ return me.add(n), G(), n.pointerActive?.() || t.onParallax(H(e.getBoundingClientRect(), window.innerHeight)), () => {
348
+ me.delete(n), _e();
279
349
  };
280
350
  }
281
351
  //#endregion
282
352
  //#region src/thumbnail/attachThumbnailParallax.ts
283
- function ue(e) {
353
+ function ye(e) {
284
354
  let t = 0, n = 0, r = !1, i = !1, a = !1, o = () => {
285
355
  let a = r || i;
286
356
  e.classList.toggle("liforma-et--parallax", a), e.classList.toggle("liforma-et--scroll-parallax", i), e.style.setProperty("--liforma-et-parallax-x", String(t)), e.style.setProperty("--liforma-et-parallax-y", String(n));
287
- }, s = le(e, {
357
+ }, s = ve(e, {
288
358
  onParallax: (e) => {
289
359
  i = !0, a || (t = e, n = 0, o());
290
360
  },
@@ -297,7 +367,7 @@ function ue(e) {
297
367
  a = !0, e.pointerType === "mouse" && (r = !0), o();
298
368
  }, u = () => {
299
369
  let s = a;
300
- a = !1, r = !1, i && s ? (t = z(e.getBoundingClientRect(), window.innerHeight), n = 0) : i || (t = 0, n = 0), o();
370
+ a = !1, r = !1, i && s ? (t = H(e.getBoundingClientRect(), window.innerHeight), n = 0) : i || (t = 0, n = 0), o();
301
371
  }, d = (e) => {
302
372
  e.pointerType === "mouse" && (r = !0, o());
303
373
  }, f = () => {
@@ -309,108 +379,119 @@ function ue(e) {
309
379
  }
310
380
  //#endregion
311
381
  //#region src/thumbnail/styles.ts
312
- var de = ".liforma-et {\n --liforma-et-parallax-x: 0;\n --liforma-et-parallax-y: 0;\n --liforma-et-bg-scale: 1;\n --liforma-et-fg-scale: 1;\n --liforma-et-avatar-scale: 1;\n --liforma-et-bg-shift: 0px;\n --liforma-et-fg-shift: 0px;\n --liforma-et-avatar-shift: 0px;\n --liforma-et-reveal-duration: 420ms;\n\n box-sizing: border-box;\n position: relative;\n display: block;\n width: 100%;\n height: 100%;\n min-height: 0;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: 0.65rem;\n overflow: hidden;\n background: #111;\n color: inherit;\n text-decoration: none;\n cursor: inherit;\n -webkit-tap-highlight-color: transparent;\n}\n\na.liforma-et,\nbutton.liforma-et {\n cursor: pointer;\n}\n\nbutton.liforma-et {\n font: inherit;\n appearance: none;\n}\n\n.liforma-et__placeholder {\n position: absolute;\n inset: 0;\n z-index: 0;\n background:\n radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 58%),\n linear-gradient(180deg, #1a1a1a 0%, #101010 100%);\n opacity: 1;\n transition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n.liforma-et--revealed .liforma-et__placeholder {\n opacity: 0;\n}\n\n.liforma-et__media {\n opacity: 0;\n transition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n.liforma-et__media--ready {\n opacity: 1;\n}\n\n.liforma-et__background {\n position: absolute;\n inset: 0;\n z-index: 1;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center center;\n transform: translate(\n calc(var(--liforma-et-parallax-x) * var(--liforma-et-bg-shift)),\n calc(var(--liforma-et-parallax-y) * var(--liforma-et-bg-shift))\n )\n scale(var(--liforma-et-bg-scale));\n transform-origin: center center;\n transition:\n opacity var(--liforma-et-reveal-duration) ease,\n transform 160ms ease;\n}\n\n.liforma-et__avatar {\n position: relative;\n z-index: 2;\n display: block;\n width: 100%;\n height: 100%;\n object-fit: contain;\n object-position: center bottom;\n transform: scale(var(--liforma-et-avatar-scale))\n translate(\n calc(var(--liforma-et-parallax-x) * var(--liforma-et-avatar-shift)),\n calc(var(--liforma-et-parallax-y) * var(--liforma-et-avatar-shift))\n );\n transform-origin: center center;\n transition:\n opacity var(--liforma-et-reveal-duration) ease,\n transform 160ms ease;\n}\n\n/* Gallery plates are typically square in a square tile — contain vs cover is a no-op\n without a zoom. Scale the whole scene from the upper third so Face matches\n player fit (location + avatar crop together). */\n.liforma-et--fit-face {\n --liforma-et-avatar-scale: 1.85;\n --liforma-et-bg-scale: 1.85;\n --liforma-et-fg-scale: 1.85;\n}\n\n.liforma-et--fit-face .liforma-et__avatar,\n.liforma-et--fit-face .liforma-et__background,\n.liforma-et--fit-face .liforma-et__foreground {\n transform-origin: 50% 18%;\n}\n\n.liforma-et--fit-face .liforma-et__avatar {\n object-fit: cover;\n object-position: 50% 18%;\n}\n\n/* Bust / medium: less zoom than face so upper chest stays in frame (player 3.75H window). */\n.liforma-et--fit-medium {\n --liforma-et-avatar-scale: 1.35;\n --liforma-et-bg-scale: 1.35;\n --liforma-et-fg-scale: 1.35;\n}\n\n.liforma-et--fit-medium .liforma-et__avatar,\n.liforma-et--fit-medium .liforma-et__background,\n.liforma-et--fit-medium .liforma-et__foreground {\n transform-origin: 50% 28%;\n}\n\n.liforma-et--fit-medium .liforma-et__avatar {\n object-fit: cover;\n object-position: 50% 28%;\n}\n\n.liforma-et__foreground {\n position: absolute;\n inset: 0;\n z-index: 3;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center center;\n pointer-events: none;\n transform: translate(\n calc(var(--liforma-et-parallax-x) * var(--liforma-et-fg-shift) * -1),\n calc(var(--liforma-et-parallax-y) * var(--liforma-et-fg-shift) * -1)\n )\n scale(var(--liforma-et-fg-scale));\n transform-origin: center center;\n transition:\n opacity var(--liforma-et-reveal-duration) ease,\n transform 160ms ease;\n}\n\n.liforma-et--parallax {\n --liforma-et-bg-scale: 1.08;\n --liforma-et-fg-scale: 1.05;\n --liforma-et-avatar-scale: 1.08;\n --liforma-et-bg-shift: 10px;\n --liforma-et-fg-shift: 4px;\n --liforma-et-avatar-shift: 4px;\n}\n\n/* Promote layers only while parallax is active — avoids N compositor surfaces on galleries. */\n.liforma-et--parallax .liforma-et__background,\n.liforma-et--parallax .liforma-et__foreground,\n.liforma-et--parallax .liforma-et__avatar {\n will-change: transform;\n}\n\n.liforma-et--parallax.liforma-et--fit-face {\n --liforma-et-avatar-scale: 1.95;\n --liforma-et-bg-scale: 1.95;\n --liforma-et-fg-scale: 1.95;\n --liforma-et-avatar-shift: 0px;\n}\n\n.liforma-et--parallax.liforma-et--fit-medium {\n --liforma-et-avatar-scale: 1.42;\n --liforma-et-bg-scale: 1.42;\n --liforma-et-fg-scale: 1.42;\n --liforma-et-avatar-shift: 0px;\n}\n\n.liforma-et--scroll-parallax .liforma-et__background,\n.liforma-et--scroll-parallax .liforma-et__foreground,\n.liforma-et--scroll-parallax .liforma-et__avatar {\n transition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .liforma-et {\n --liforma-et-reveal-duration: 0ms;\n }\n\n .liforma-et--parallax {\n --liforma-et-bg-scale: 1;\n --liforma-et-fg-scale: 1;\n --liforma-et-avatar-scale: 1;\n --liforma-et-bg-shift: 0px;\n --liforma-et-fg-shift: 0px;\n --liforma-et-avatar-shift: 0px;\n }\n\n .liforma-et--parallax.liforma-et--fit-face {\n --liforma-et-avatar-scale: 1.85;\n --liforma-et-bg-scale: 1.85;\n --liforma-et-fg-scale: 1.85;\n }\n\n .liforma-et__background,\n .liforma-et__foreground,\n .liforma-et__avatar {\n transition: none;\n }\n}", U = !1;
313
- function W(e) {
314
- if (typeof document > "u" || U) return;
382
+ var be = ":host {\n display: block;\n width: 100%;\n height: 100%;\n min-height: 0;\n}\n\n.liforma-et {\n --liforma-et-parallax-x: 0;\n --liforma-et-parallax-y: 0;\n --liforma-et-bg-scale: 1;\n --liforma-et-fg-scale: 1;\n --liforma-et-avatar-scale: 1;\n --liforma-et-bg-shift: 0px;\n --liforma-et-fg-shift: 0px;\n --liforma-et-avatar-shift: 0px;\n --liforma-et-reveal-duration: 420ms;\n\n box-sizing: border-box;\n position: relative;\n display: block;\n width: 100%;\n height: 100%;\n min-height: 0;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: 0.65rem;\n overflow: hidden;\n background: #111;\n color: inherit;\n text-decoration: none;\n cursor: inherit;\n -webkit-tap-highlight-color: transparent;\n}\n\na.liforma-et,\nbutton.liforma-et {\n cursor: pointer;\n}\n\nbutton.liforma-et {\n font: inherit;\n appearance: none;\n}\n\n.liforma-et__placeholder {\n position: absolute;\n inset: 0;\n z-index: 0;\n background:\n radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 58%),\n linear-gradient(180deg, #1a1a1a 0%, #101010 100%);\n opacity: 1;\n transition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n.liforma-et--revealed .liforma-et__placeholder {\n opacity: 0;\n}\n\n.liforma-et__media {\n opacity: 0;\n transition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n.liforma-et__media--ready {\n opacity: 1;\n}\n\n.liforma-et__background {\n position: absolute;\n inset: 0;\n z-index: 1;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center center;\n transform: translate(\n calc(var(--liforma-et-parallax-x) * var(--liforma-et-bg-shift)),\n calc(var(--liforma-et-parallax-y) * var(--liforma-et-bg-shift))\n )\n scale(var(--liforma-et-bg-scale));\n transform-origin: center center;\n transition:\n opacity var(--liforma-et-reveal-duration) ease,\n transform 160ms ease;\n}\n\n.liforma-et__avatar {\n position: relative;\n z-index: 2;\n display: block;\n width: 100%;\n height: 100%;\n object-fit: contain;\n object-position: center bottom;\n transform: scale(var(--liforma-et-avatar-scale))\n translate(\n calc(var(--liforma-et-parallax-x) * var(--liforma-et-avatar-shift)),\n calc(var(--liforma-et-parallax-y) * var(--liforma-et-avatar-shift))\n );\n transform-origin: center center;\n transition:\n opacity var(--liforma-et-reveal-duration) ease,\n transform 160ms ease;\n}\n\n/* Gallery plates are typically square in a square tile — contain vs cover is a no-op\n without a zoom. Scale the whole scene from the upper third so Face matches\n player fit (location + avatar crop together). */\n.liforma-et--fit-face {\n --liforma-et-avatar-scale: 1.85;\n --liforma-et-bg-scale: 1.85;\n --liforma-et-fg-scale: 1.85;\n}\n\n.liforma-et--fit-face .liforma-et__avatar,\n.liforma-et--fit-face .liforma-et__background,\n.liforma-et--fit-face .liforma-et__foreground {\n transform-origin: 50% 18%;\n}\n\n.liforma-et--fit-face .liforma-et__avatar {\n object-fit: cover;\n object-position: 50% 18%;\n}\n\n/* Bust / medium: less zoom than face so upper chest stays in frame (player 3.75H window). */\n.liforma-et--fit-medium {\n --liforma-et-avatar-scale: 1.35;\n --liforma-et-bg-scale: 1.35;\n --liforma-et-fg-scale: 1.35;\n}\n\n.liforma-et--fit-medium .liforma-et__avatar,\n.liforma-et--fit-medium .liforma-et__background,\n.liforma-et--fit-medium .liforma-et__foreground {\n transform-origin: 50% 28%;\n}\n\n.liforma-et--fit-medium .liforma-et__avatar {\n object-fit: cover;\n object-position: 50% 28%;\n}\n\n.liforma-et__foreground {\n position: absolute;\n inset: 0;\n z-index: 3;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center center;\n pointer-events: none;\n transform: translate(\n calc(var(--liforma-et-parallax-x) * var(--liforma-et-fg-shift) * -1),\n calc(var(--liforma-et-parallax-y) * var(--liforma-et-fg-shift) * -1)\n )\n scale(var(--liforma-et-fg-scale));\n transform-origin: center center;\n transition:\n opacity var(--liforma-et-reveal-duration) ease,\n transform 160ms ease;\n}\n\n.liforma-et--parallax {\n --liforma-et-bg-scale: 1.08;\n --liforma-et-fg-scale: 1.05;\n --liforma-et-avatar-scale: 1.08;\n --liforma-et-bg-shift: 10px;\n --liforma-et-fg-shift: 4px;\n --liforma-et-avatar-shift: 4px;\n}\n\n/* Promote layers only while parallax is active — avoids N compositor surfaces on galleries. */\n.liforma-et--parallax .liforma-et__background,\n.liforma-et--parallax .liforma-et__foreground,\n.liforma-et--parallax .liforma-et__avatar {\n will-change: transform;\n}\n\n.liforma-et--parallax.liforma-et--fit-face {\n --liforma-et-avatar-scale: 1.95;\n --liforma-et-bg-scale: 1.95;\n --liforma-et-fg-scale: 1.95;\n --liforma-et-avatar-shift: 0px;\n}\n\n.liforma-et--parallax.liforma-et--fit-medium {\n --liforma-et-avatar-scale: 1.42;\n --liforma-et-bg-scale: 1.42;\n --liforma-et-fg-scale: 1.42;\n --liforma-et-avatar-shift: 0px;\n}\n\n.liforma-et--scroll-parallax .liforma-et__background,\n.liforma-et--scroll-parallax .liforma-et__foreground,\n.liforma-et--scroll-parallax .liforma-et__avatar {\n transition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .liforma-et {\n --liforma-et-reveal-duration: 0ms;\n }\n\n .liforma-et--parallax {\n --liforma-et-bg-scale: 1;\n --liforma-et-fg-scale: 1;\n --liforma-et-avatar-scale: 1;\n --liforma-et-bg-shift: 0px;\n --liforma-et-fg-shift: 0px;\n --liforma-et-avatar-shift: 0px;\n }\n\n .liforma-et--parallax.liforma-et--fit-face {\n --liforma-et-avatar-scale: 1.85;\n --liforma-et-bg-scale: 1.85;\n --liforma-et-fg-scale: 1.85;\n }\n\n .liforma-et__background,\n .liforma-et__foreground,\n .liforma-et__avatar {\n transition: none;\n }\n}", xe = !1;
383
+ function Se(e) {
384
+ if (typeof document > "u" || xe) return;
315
385
  if (document.querySelector("style[data-liforma-et]")) {
316
- U = !0;
386
+ xe = !0;
317
387
  return;
318
388
  }
319
389
  let t = document.createElement("style");
320
- t.setAttribute("data-liforma-et", ""), t.textContent = e, document.head.appendChild(t), U = !0;
390
+ t.setAttribute("data-liforma-et", ""), t.textContent = e, document.head.appendChild(t), xe = !0;
321
391
  }
322
392
  //#endregion
323
393
  //#region src/react/ExperienceThumbnail.tsx
324
- function fe(e, t) {
394
+ function Ce(e, t) {
325
395
  return `${e} liforma-et__media${t ? " liforma-et__media--ready" : ""}`;
326
396
  }
327
- function pe(s) {
328
- let { galleryThumb: c, avatarImage: l, backgroundImage: u, foregroundImage: d, alt: f, experienceId: p, href: m, target: h, rel: g, onClick: _, returnUrl: v, playerBaseUrl: b, parallax: x = !0, fit: S = "full", lazy: C = !0, className: T = "", fallbackImage: E } = s, D = t(() => w({
397
+ function we(s) {
398
+ let { galleryThumb: c, avatarImage: l, backgroundImage: u, foregroundImage: d, alt: f, experienceId: p, href: m, target: h, rel: g, onClick: _, returnUrl: v, playerBaseUrl: b, parallax: S = !0, fit: w = "full", lazy: T = !0, className: E = "", fallbackImage: D, normalizeUrls: O = !0, cdnBaseUrl: k } = s, A = n(null), j = n(!1), [M, ee] = r(0), [N, P] = r(0), te = x(M, N), I = t(() => F({
329
399
  galleryThumb: c,
330
400
  avatarImage: l,
331
401
  backgroundImage: u,
332
402
  foregroundImage: d,
333
- fallbackImage: E
403
+ fallbackImage: D,
404
+ normalize: O,
405
+ locationPlateSize: te,
406
+ cdnBaseUrl: k
334
407
  }), [
335
408
  c,
336
409
  l,
337
410
  u,
338
411
  d,
339
- E
340
- ]), k = O({
412
+ D,
413
+ O,
414
+ te,
415
+ k
416
+ ]), L = ne({
341
417
  href: m,
342
418
  hasClickHandler: typeof _ == "function",
343
419
  experienceId: p
344
- }), A = k === "anchor" && !m?.trim() && !!p?.trim(), j = !!D?.backgroundImage, M = x !== !1, N = n(null), P = n(!1), [F, te] = r(!C), [ne, I] = r(!1), [L, re] = r(!1), [R, B] = r(0), [ae, V] = r(0), [oe, se] = r(!1), [ce, H] = r(!1), [ue, U] = r(!1), [pe, me] = r(!1), [G, he] = r(), ge = D ? oe && D.fallbackImage ? D.fallbackImage : D.avatarImage : "";
420
+ }), re = L === "anchor" && !m?.trim() && !!p?.trim(), ie = !!I?.backgroundImage, z = S !== !1, [B, ae] = r(!T), [oe, se] = r(!1), [ce, le] = r(!1), [V, ue] = r(0), [de, pe] = r(0), [me, U] = r(!1), [W, he] = r(!1), [ge, G] = r(!1), [_e, ye] = r(!1), [xe, we] = r(), Te = I ? me && I.fallbackImage ? I.fallbackImage : I.avatarImage : "";
345
421
  e(() => {
346
- W(de);
422
+ Se(be);
347
423
  }, []), e(() => {
348
- he(ee({
424
+ we(R({
349
425
  href: m,
350
426
  experienceId: p,
351
427
  returnUrl: v,
352
428
  playerBaseUrl: b,
353
- useCurrentPageAsReturnUrl: A && !v?.trim()
429
+ useCurrentPageAsReturnUrl: re && !v?.trim()
354
430
  }));
355
431
  }, [
356
432
  m,
357
433
  p,
358
434
  v,
359
435
  b,
360
- A
436
+ re
361
437
  ]), e(() => {
362
- H(!1), U(!1), me(!1), se(!1);
438
+ he(!1), G(!1), ye(!1), U(!1);
363
439
  }, [
364
- D?.backgroundImage,
365
- D?.foregroundImage,
366
- ge
440
+ I?.backgroundImage,
441
+ I?.foregroundImage,
442
+ Te
367
443
  ]), e(() => {
368
- let e = N.current;
444
+ let e = A.current;
445
+ if (e) return C(e, (e, t) => {
446
+ ee(e), P(t);
447
+ });
448
+ }, [L, xe]), e(() => {
449
+ let e = A.current;
369
450
  if (e) {
370
- if (!C) {
371
- te(!0);
451
+ if (!T) {
452
+ ae(!0);
372
453
  return;
373
454
  }
374
- return ie(e, { onVisibleChange: (e) => {
375
- e && te(!0);
455
+ return fe(e, { onVisibleChange: (e) => {
456
+ e && ae(!0);
376
457
  } });
377
458
  }
378
459
  }, [
379
- C,
380
- D,
381
- k,
382
- G
460
+ T,
461
+ I,
462
+ L,
463
+ xe
383
464
  ]), e(() => {
384
- let e = N.current;
385
- if (!(!e || !M)) return le(e, {
465
+ let e = A.current;
466
+ if (!(!e || !z)) return ve(e, {
386
467
  onParallax: (e) => {
387
- re(!0), P.current || (B(e), V(0));
468
+ le(!0), j.current || (ue(e), pe(0));
388
469
  },
389
- pointerActive: () => P.current
470
+ pointerActive: () => j.current
390
471
  });
391
472
  }, [
392
- M,
393
- D,
394
- k,
395
- G
473
+ z,
474
+ I,
475
+ L,
476
+ xe
396
477
  ]);
397
- let _e = (e) => {
398
- if (!M || L) return;
478
+ let Ee = (e) => {
479
+ if (!z || ce) return;
399
480
  let t = e.currentTarget.getBoundingClientRect();
400
- t.width <= 0 || t.height <= 0 || (B(((e.clientX - t.left) / t.width - .5) * 2), V(((e.clientY - t.top) / t.height - .5) * 2));
401
- }, K = (e) => {
402
- let t = P.current;
403
- P.current = !1, I(!1), L && t ? (B(z(e.getBoundingClientRect(), window.innerHeight)), V(0)) : L || (B(0), V(0));
404
- }, ve = (e) => {
405
- if (!M) return;
406
- P.current = !0, e.pointerType === "mouse" && I(!0);
481
+ t.width <= 0 || t.height <= 0 || (ue(((e.clientX - t.left) / t.width - .5) * 2), pe(((e.clientY - t.top) / t.height - .5) * 2));
482
+ }, De = (e) => {
483
+ let t = j.current;
484
+ j.current = !1, se(!1), ce && t ? (ue(H(e.getBoundingClientRect(), window.innerHeight)), pe(0)) : ce || (ue(0), pe(0));
485
+ }, Oe = (e) => {
486
+ if (!z) return;
487
+ j.current = !0, e.pointerType === "mouse" && se(!0);
407
488
  let t = e.currentTarget, n = () => {
408
- K(t), window.removeEventListener("pointerup", n), window.removeEventListener("pointercancel", n);
489
+ De(t), window.removeEventListener("pointerup", n), window.removeEventListener("pointercancel", n);
409
490
  };
410
491
  window.addEventListener("pointerup", n), window.addEventListener("pointercancel", n);
411
- }, ye = (e) => {
412
- if (_?.(e), !e.defaultPrevented && A && !v?.trim()) {
413
- let t = ee({
492
+ }, ke = (e) => {
493
+ if (_?.(e), !e.defaultPrevented && re && !v?.trim()) {
494
+ let t = R({
414
495
  experienceId: p,
415
496
  playerBaseUrl: b,
416
497
  useCurrentPageAsReturnUrl: !0
@@ -418,135 +499,135 @@ function pe(s) {
418
499
  t && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && (e.preventDefault(), window.location.assign(t));
419
500
  }
420
501
  };
421
- if (!D) return null;
422
- let be = M && (ne || L), q = F && (ue || ce || pe), xe = [
502
+ if (!I) return null;
503
+ let Ae = z && (oe || ce), K = B && (ge || W || _e), je = [
423
504
  "liforma-et",
424
- j ? "liforma-et--scene" : "",
425
- y(S),
426
- be ? "liforma-et--parallax" : "",
427
- L ? "liforma-et--scroll-parallax" : "",
428
- F && !q ? "liforma-et--loading" : "",
429
- q ? "liforma-et--revealed" : "",
430
- T
431
- ].filter(Boolean).join(" "), Se = {
432
- "--liforma-et-parallax-x": R,
433
- "--liforma-et-parallax-y": ae
434
- }, Ce = (e, t) => {
505
+ ie ? "liforma-et--scene" : "",
506
+ y(w),
507
+ Ae ? "liforma-et--parallax" : "",
508
+ ce ? "liforma-et--scroll-parallax" : "",
509
+ B && !K ? "liforma-et--loading" : "",
510
+ K ? "liforma-et--revealed" : "",
511
+ E
512
+ ].filter(Boolean).join(" "), Me = {
513
+ "--liforma-et-parallax-x": V,
514
+ "--liforma-et-parallax-y": de
515
+ }, q = (e, t) => {
435
516
  e.complete && t(!0);
436
- }, we = /* @__PURE__ */ o(i, { children: [
517
+ }, Ne = /* @__PURE__ */ o(i, { children: [
437
518
  /* @__PURE__ */ a("span", {
438
519
  className: "liforma-et__placeholder",
439
520
  "aria-hidden": "true"
440
521
  }),
441
- F && D.backgroundImage ? /* @__PURE__ */ a("img", {
442
- className: fe("liforma-et__background", ce),
443
- src: D.backgroundImage,
522
+ B && I.backgroundImage ? /* @__PURE__ */ a("img", {
523
+ className: Ce("liforma-et__background", W),
524
+ src: I.backgroundImage,
444
525
  alt: "",
445
526
  decoding: "async",
446
527
  ref: (e) => {
447
- e && Ce(e, H);
528
+ e && q(e, he);
448
529
  },
449
- onLoad: () => H(!0),
450
- onError: () => H(!0)
530
+ onLoad: () => he(!0),
531
+ onError: () => he(!0)
451
532
  }) : null,
452
- F && ge ? /* @__PURE__ */ a("img", {
453
- className: fe("liforma-et__avatar", ue),
454
- src: ge,
533
+ B && Te ? /* @__PURE__ */ a("img", {
534
+ className: Ce("liforma-et__avatar", ge),
535
+ src: Te,
455
536
  alt: "",
456
537
  decoding: "async",
457
538
  ref: (e) => {
458
- e && Ce(e, U);
539
+ e && q(e, G);
459
540
  },
460
- onLoad: () => U(!0),
541
+ onLoad: () => G(!0),
461
542
  onError: () => {
462
- D.fallbackImage ? se(!0) : U(!0);
543
+ I.fallbackImage ? U(!0) : G(!0);
463
544
  }
464
545
  }) : null,
465
- F && D.foregroundImage ? /* @__PURE__ */ a("img", {
466
- className: fe("liforma-et__foreground", pe),
467
- src: D.foregroundImage,
546
+ B && I.foregroundImage ? /* @__PURE__ */ a("img", {
547
+ className: Ce("liforma-et__foreground", _e),
548
+ src: I.foregroundImage,
468
549
  alt: "",
469
550
  decoding: "async",
470
551
  ref: (e) => {
471
- e && Ce(e, me);
552
+ e && q(e, ye);
472
553
  },
473
- onLoad: () => me(!0),
474
- onError: () => me(!0)
554
+ onLoad: () => ye(!0),
555
+ onError: () => ye(!0)
475
556
  }) : null
476
- ] }), J = {
477
- onPointerDown: ve,
478
- onPointerUp: (e) => K(e.currentTarget),
479
- onPointerCancel: (e) => K(e.currentTarget),
557
+ ] }), Pe = {
558
+ onPointerDown: Oe,
559
+ onPointerUp: (e) => De(e.currentTarget),
560
+ onPointerCancel: (e) => De(e.currentTarget),
480
561
  onPointerEnter: (e) => {
481
- M && e.pointerType === "mouse" && I(!0);
562
+ z && e.pointerType === "mouse" && se(!0);
482
563
  },
483
- onPointerMove: _e,
564
+ onPointerMove: Ee,
484
565
  onPointerLeave: () => {
485
- P.current || (I(!1), L || (B(0), V(0)));
566
+ j.current || (se(!1), ce || (ue(0), pe(0)));
486
567
  }
487
- }, Te = (e) => {
488
- N.current = e;
568
+ }, Fe = (e) => {
569
+ A.current = e;
489
570
  };
490
- return k === "anchor" && G ? /* @__PURE__ */ a("a", {
491
- ref: Te,
492
- className: xe,
493
- style: Se,
494
- href: G,
571
+ return L === "anchor" && xe ? /* @__PURE__ */ a("a", {
572
+ ref: Fe,
573
+ className: je,
574
+ style: Me,
575
+ href: xe,
495
576
  target: h,
496
577
  rel: g,
497
578
  "aria-label": f,
498
- onClick: ye,
499
- ...J,
500
- children: we
501
- }) : k === "button" ? /* @__PURE__ */ a("button", {
579
+ onClick: ke,
580
+ ...Pe,
581
+ children: Ne
582
+ }) : L === "button" ? /* @__PURE__ */ a("button", {
502
583
  type: "button",
503
- ref: Te,
504
- className: xe,
505
- style: Se,
584
+ ref: Fe,
585
+ className: je,
586
+ style: Me,
506
587
  "aria-label": f,
507
- onClick: ye,
508
- ...J,
509
- children: we
588
+ onClick: ke,
589
+ ...Pe,
590
+ children: Ne
510
591
  }) : /* @__PURE__ */ a("div", {
511
- ref: Te,
512
- className: xe,
513
- style: Se,
592
+ ref: Fe,
593
+ className: je,
594
+ style: Me,
514
595
  role: f ? "img" : void 0,
515
596
  "aria-label": f || void 0,
516
597
  "aria-hidden": f ? void 0 : !0,
517
- ...J,
518
- children: we
598
+ ...Pe,
599
+ children: Ne
519
600
  });
520
601
  }
521
602
  //#endregion
522
603
  //#region src/widget/styles.ts
523
- var me = "\n.liforma-ew {\n box-sizing: border-box;\n position: relative;\n display: block;\n width: 100%;\n height: 100%;\n min-height: 0;\n margin: 0;\n padding: 0;\n border: 0;\n}\n\n/* Optional self-positioned FAB (position=bottom-right|bottom-left).\n * Cap at 50vmin so small phones don't get an oversized thumb (desktop 224px stays). */\n.liforma-ew[data-position='bottom-right'],\n.liforma-ew[data-position='bottom-left'] {\n position: fixed;\n width: min(var(--liforma-ew-fab-size, 224px), 50vmin);\n height: min(var(--liforma-ew-fab-size, 224px), 50vmin);\n bottom: var(--liforma-ew-offset, 16px);\n z-index: 2147482900;\n}\n\n.liforma-ew[data-position='bottom-right'] {\n right: var(--liforma-ew-offset, 16px);\n left: auto;\n}\n\n.liforma-ew[data-position='bottom-left'] {\n left: var(--liforma-ew-offset, 16px);\n right: auto;\n}\n\n/* While open, collapse the FAB box so a corner hole / thumb never remains. */\n.liforma-ew[data-position='bottom-right'][data-state='expanded'],\n.liforma-ew[data-position='bottom-right'][data-state='docked'],\n.liforma-ew[data-position='bottom-left'][data-state='expanded'],\n.liforma-ew[data-position='bottom-left'][data-state='docked'] {\n width: 0;\n height: 0;\n min-width: 0;\n min-height: 0;\n overflow: visible;\n pointer-events: none;\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__warm,\n.liforma-ew[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-state='expanded'] .liforma-ew__overlay,\n.liforma-ew[data-state='expanded'] .liforma-ew__toolbar,\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar {\n pointer-events: auto;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__overlay {\n pointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel {\n pointer-events: auto;\n}\n\n.liforma-ew__hit {\n box-sizing: border-box;\n display: block;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n cursor: pointer;\n font: inherit;\n appearance: none;\n -webkit-tap-highlight-color: transparent;\n transform: scale(1);\n transform-origin: center center;\n transition:\n transform 180ms ease,\n filter 180ms ease;\n will-change: transform;\n}\n\n/* Author display must not defeat the HTML hidden attribute. */\n.liforma-ew__hit[hidden] {\n display: none !important;\n}\n\n.liforma-ew__hit:focus-visible {\n outline: 2px solid #5b8def;\n outline-offset: 3px;\n border-radius: 0.75rem;\n}\n\n@media (hover: hover) and (pointer: fine) {\n /* Scale the thumb whenever the collapsed FAB is hovered — including via the warm iframe hit layer. */\n .liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover,\n .liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-ew__hit {\n transform: scale(1.06);\n }\n\n .liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover .liforma-et,\n .liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-et {\n box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34);\n }\n}\n\n.liforma-ew__face {\n width: 100%;\n height: 100%;\n min-height: 0;\n position: relative;\n}\n\n.liforma-ew__face-status {\n position: absolute;\n inset: 0;\n z-index: 1;\n display: grid;\n place-items: center;\n padding: 0.5rem;\n text-align: center;\n font: 600 0.75rem/1.3 system-ui, sans-serif;\n color: #e8ecf4;\n background: rgba(10, 12, 18, 0.72);\n border-radius: 0.75rem;\n pointer-events: none;\n}\n\n.liforma-ew__face-status[hidden] {\n display: none !important;\n}\n\n.liforma-ew__hit:disabled {\n cursor: default;\n opacity: 0.85;\n}\n\n.liforma-ew__face .liforma-et {\n border-radius: 0.75rem;\n box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);\n transition: box-shadow 180ms ease;\n}\n\n.liforma-ew__warm {\n box-sizing: border-box;\n position: absolute;\n inset: 0;\n z-index: 2;\n border-radius: 0.75rem;\n overflow: hidden;\n background: transparent;\n pointer-events: none;\n opacity: 1;\n transition: opacity 1000ms ease;\n}\n\n/*\n * Collapsed: keep the warm iframe as an invisible hit target only.\n * Painting it over the thumb causes a “ghost enlarge” (face scales under a static iframe).\n */\n.liforma-ew[data-state='collapsed'] .liforma-ew__warm {\n opacity: 0;\n transition: none;\n}\n\n.liforma-ew[data-warm='true'] .liforma-ew__warm {\n pointer-events: auto;\n}\n\n.liforma-ew[data-warm='true']:not([data-live='true']) .liforma-ew__hit {\n pointer-events: none;\n}\n\n.liforma-ew[data-live='true'][data-state='collapsed'] .liforma-ew__hit {\n pointer-events: auto;\n}\n\n.liforma-ew[data-live='true'] .liforma-ew__warm,\n.liforma-ew[data-live='true'] .liforma-ew__stage {\n /* Hidden under the thumb / until post-resize fade-in (matches cold avatar reveal). */\n opacity: 0;\n}\n\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='expanded'] .liforma-ew__warm,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='expanded'] .liforma-ew__stage,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='docked'] .liforma-ew__stage {\n opacity: 1;\n}\n\n.liforma-ew--session-concealing .liforma-ew__warm,\n.liforma-ew--session-concealing .liforma-ew__stage {\n transition-duration: 280ms;\n}\n\n/* Instant hide while dock/maximize geometry settles (player morph resize ~160ms). */\n.liforma-ew--layout-settling .liforma-ew__warm,\n.liforma-ew--layout-settling .liforma-ew__stage {\n opacity: 0 !important;\n transition: none !important;\n}\n\n.liforma-ew[data-live='true'][data-state='collapsed'] .liforma-ew__warm {\n /* Keep the live iframe under the thumb; FAB click resumes the shell. */\n pointer-events: none;\n opacity: 0;\n /* Instant hide when collapsed so the FAB never shows a resized live mesh. */\n transition: none;\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__warm {\n position: fixed;\n /* Match overlay panel inset so the warm iframe fills the conversation shell. */\n inset: clamp(12px, 3vw, 28px);\n z-index: 2147483001;\n width: auto;\n height: auto;\n border-radius: 16px;\n pointer-events: auto;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__warm {\n position: fixed;\n inset: auto;\n z-index: 2147483001;\n border-radius: 16px;\n pointer-events: auto;\n /* left/top/width/height set inline from dock geometry */\n}\n\n.liforma-ew__toolbar {\n display: none;\n position: fixed;\n z-index: 2147483002;\n pointer-events: auto;\n box-sizing: border-box;\n align-items: center;\n gap: 0.35rem;\n padding: 0.35rem 0.4rem;\n border-radius: 999px;\n background: rgba(12, 14, 20, 0.72);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__toolbar {\n display: flex;\n top: calc(clamp(12px, 3vw, 28px) + 10px);\n right: calc(clamp(12px, 3vw, 28px) + 10px);\n left: auto;\n cursor: default;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar {\n display: flex;\n /* left/top set inline to track the panel; strip remains a drag handle */\n cursor: grab;\n touch-action: none;\n user-select: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel,\n.liforma-ew[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-state='docked'] .liforma-ew__stage {\n /* Player also reports surface drags via postMessage when docked. */\n cursor: grab;\n touch-action: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar.liforma-ew__toolbar--dragging,\n.liforma-ew--dock-dragging,\n.liforma-ew--dock-dragging .liforma-ew__toolbar,\n.liforma-ew--dock-dragging .liforma-ew__panel,\n.liforma-ew--dock-dragging .liforma-ew__warm,\n.liforma-ew--dock-dragging .liforma-ew__stage {\n cursor: grabbing;\n}\n\n\n.liforma-ew__toolbar[hidden] {\n display: none !important;\n}\n\n.liforma-ew__icon-btn {\n appearance: none;\n box-sizing: border-box;\n display: inline-grid;\n place-items: center;\n width: 2rem;\n height: 2rem;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: 999px;\n color: #f5f7fb;\n background: transparent;\n cursor: pointer;\n}\n\n.liforma-ew__icon-btn:hover {\n background: rgba(255, 255, 255, 0.12);\n}\n\n.liforma-ew__icon-btn[aria-pressed='true'] {\n background: rgba(255, 255, 255, 0.2);\n}\n\n.liforma-ew__icon-btn:focus-visible {\n outline: 2px solid #5b8def;\n outline-offset: 2px;\n}\n\n.liforma-ew__icon-btn svg {\n width: 1.05rem;\n height: 1.05rem;\n display: block;\n}\n\n.liforma-ew__drag-grip {\n display: none;\n width: 0.85rem;\n height: 1.25rem;\n margin: 0 0.15rem 0 0.25rem;\n background:\n radial-gradient(circle, currentColor 1.1px, transparent 1.2px) 0 0 / 0.35rem 0.35rem,\n radial-gradient(circle, currentColor 1.1px, transparent 1.2px) 0.35rem 0 / 0.35rem 0.35rem;\n background-repeat: repeat-y;\n opacity: 0.55;\n color: #f5f7fb;\n pointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__drag-grip {\n display: block;\n}\n\n.liforma-ew__dock-toggle[hidden] {\n display: none !important;\n}\n\n.liforma-ew__overlay {\n position: fixed;\n inset: 0;\n z-index: 2147483000;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: clamp(12px, 3vw, 28px);\n box-sizing: border-box;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__overlay {\n padding: 0;\n align-items: stretch;\n justify-content: stretch;\n pointer-events: none;\n background: transparent;\n}\n\n.liforma-ew__overlay[hidden] {\n display: none !important;\n}\n\n.liforma-ew__backdrop {\n position: absolute;\n inset: 0;\n border: 0;\n padding: 0;\n margin: 0;\n background: rgba(6, 8, 14, 0.62);\n cursor: pointer;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__backdrop {\n display: none !important;\n}\n\n.liforma-ew__panel {\n position: relative;\n z-index: 1;\n display: flex;\n flex-direction: column;\n /* Fill the overlay so player loading / start UI centers in the visible window. */\n width: var(--liforma-ew-max-w, 100%);\n height: var(--liforma-ew-max-h, 100%);\n max-width: 100%;\n max-height: 100%;\n border-radius: 16px;\n overflow: hidden;\n background: #030508;\n box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);\n /* Warm iframe sits above as a sibling; keep panel as chrome shell. */\n pointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel {\n position: fixed;\n inset: auto;\n max-width: none;\n max-height: none;\n pointer-events: auto;\n /* left/top/width/height set inline from dock geometry */\n}\n\n.liforma-ew:not([data-warm='true']) .liforma-ew__panel {\n pointer-events: auto;\n}\n\n.liforma-ew__stage {\n position: relative;\n flex: 1;\n min-height: 0;\n width: 100%;\n height: 100%;\n background: #030508;\n opacity: 1;\n transition: opacity 1000ms ease;\n}\n\n.liforma-ew__status {\n position: absolute;\n inset: 0;\n z-index: 1;\n display: grid;\n place-items: center;\n padding: 1.5rem;\n text-align: center;\n color: #d7dde8;\n font: 500 0.9375rem/1.45 system-ui, sans-serif;\n background: rgba(3, 5, 8, 0.92);\n pointer-events: none;\n}\n\n.liforma-ew__status[hidden] {\n display: none !important;\n}\n\n/* Mobile expanded: ~90% viewport, no reduce control. */\n@media (max-width: 767px) {\n .liforma-ew[data-state='expanded'] .liforma-ew__overlay {\n padding: 5vh 5vw;\n }\n\n .liforma-ew[data-state='expanded'] .liforma-ew__panel {\n width: 90vw;\n height: 90vh;\n max-width: 90vw;\n max-height: 90vh;\n }\n\n .liforma-ew[data-state='expanded'] .liforma-ew__warm {\n inset: 5vh 5vw;\n }\n\n .liforma-ew[data-state='expanded'] .liforma-ew__toolbar {\n top: calc(5vh + 10px);\n right: calc(5vw + 10px);\n }\n\n .liforma-ew__dock-toggle {\n display: none !important;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .liforma-ew__hit {\n transition: none;\n will-change: auto;\n }\n\n .liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover,\n .liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-ew__hit {\n transform: none;\n }\n\n .liforma-ew__face .liforma-et {\n box-shadow: none;\n transition: none;\n }\n\n .liforma-ew__warm,\n .liforma-ew__stage {\n transition: none;\n }\n}\n", G = "liforma-experience-widget-styles";
524
- function he(e = me) {
604
+ var Te = "\n.liforma-ew {\n box-sizing: border-box;\n position: relative;\n display: block;\n width: 100%;\n height: 100%;\n min-height: 0;\n margin: 0;\n padding: 0;\n border: 0;\n}\n\n/* Optional self-positioned FAB (position=bottom-right|bottom-left).\n * Cap at 50vmin so small phones don't get an oversized thumb (desktop 224px stays). */\n.liforma-ew[data-position='bottom-right'],\n.liforma-ew[data-position='bottom-left'] {\n position: fixed;\n width: min(var(--liforma-ew-fab-size, 224px), 50vmin);\n height: min(var(--liforma-ew-fab-size, 224px), 50vmin);\n bottom: var(--liforma-ew-offset, 16px);\n z-index: 2147482900;\n}\n\n.liforma-ew[data-position='bottom-right'] {\n right: var(--liforma-ew-offset, 16px);\n left: auto;\n}\n\n.liforma-ew[data-position='bottom-left'] {\n left: var(--liforma-ew-offset, 16px);\n right: auto;\n}\n\n/* While open, collapse the FAB box so a corner hole / thumb never remains. */\n.liforma-ew[data-position='bottom-right'][data-state='expanded'],\n.liforma-ew[data-position='bottom-right'][data-state='docked'],\n.liforma-ew[data-position='bottom-left'][data-state='expanded'],\n.liforma-ew[data-position='bottom-left'][data-state='docked'] {\n width: 0;\n height: 0;\n min-width: 0;\n min-height: 0;\n overflow: visible;\n pointer-events: none;\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__warm,\n.liforma-ew[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-state='expanded'] .liforma-ew__overlay,\n.liforma-ew[data-state='expanded'] .liforma-ew__toolbar,\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar {\n pointer-events: auto;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__overlay {\n pointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel {\n pointer-events: auto;\n}\n\n.liforma-ew__hit {\n box-sizing: border-box;\n display: block;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n cursor: pointer;\n font: inherit;\n appearance: none;\n -webkit-tap-highlight-color: transparent;\n transform: scale(1);\n transform-origin: center center;\n transition:\n transform 180ms ease,\n filter 180ms ease;\n will-change: transform;\n}\n\n/* Author display must not defeat the HTML hidden attribute. */\n.liforma-ew__hit[hidden] {\n display: none !important;\n}\n\n.liforma-ew__hit:focus-visible {\n outline: 2px solid #5b8def;\n outline-offset: 3px;\n border-radius: 0.75rem;\n}\n\n@media (hover: hover) and (pointer: fine) {\n /* Scale the thumb whenever the collapsed FAB is hovered — including via the warm iframe hit layer. */\n .liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover,\n .liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-ew__hit {\n transform: scale(1.06);\n }\n\n .liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover .liforma-et,\n .liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-et {\n box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34);\n }\n}\n\n.liforma-ew__face {\n width: 100%;\n height: 100%;\n min-height: 0;\n position: relative;\n}\n\n.liforma-ew__face-status {\n position: absolute;\n inset: 0;\n z-index: 1;\n display: grid;\n place-items: center;\n padding: 0.5rem;\n text-align: center;\n font: 600 0.75rem/1.3 system-ui, sans-serif;\n color: #e8ecf4;\n background: rgba(10, 12, 18, 0.72);\n border-radius: 0.75rem;\n pointer-events: none;\n}\n\n.liforma-ew__face-status[hidden] {\n display: none !important;\n}\n\n.liforma-ew__hit:disabled {\n cursor: default;\n opacity: 0.85;\n}\n\n.liforma-ew__face .liforma-et {\n border-radius: 0.75rem;\n box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);\n transition: box-shadow 180ms ease;\n}\n\n.liforma-ew__warm {\n box-sizing: border-box;\n position: absolute;\n inset: 0;\n z-index: 2;\n border-radius: 0.75rem;\n overflow: hidden;\n background: transparent;\n pointer-events: none;\n opacity: 1;\n transition: opacity 1000ms ease;\n}\n\n/*\n * Collapsed: keep the warm iframe as an invisible hit target only.\n * Painting it over the thumb causes a “ghost enlarge” (face scales under a static iframe).\n */\n.liforma-ew[data-state='collapsed'] .liforma-ew__warm {\n opacity: 0;\n transition: none;\n}\n\n.liforma-ew[data-warm='true'] .liforma-ew__warm {\n pointer-events: auto;\n}\n\n.liforma-ew[data-warm='true']:not([data-live='true']) .liforma-ew__hit {\n pointer-events: none;\n}\n\n.liforma-ew[data-live='true'][data-state='collapsed'] .liforma-ew__hit {\n pointer-events: auto;\n}\n\n.liforma-ew[data-live='true'] .liforma-ew__warm,\n.liforma-ew[data-live='true'] .liforma-ew__stage {\n /* Hidden under the thumb / until post-resize fade-in (matches cold avatar reveal). */\n opacity: 0;\n}\n\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='expanded'] .liforma-ew__warm,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='expanded'] .liforma-ew__stage,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='docked'] .liforma-ew__stage {\n opacity: 1;\n}\n\n.liforma-ew--session-concealing .liforma-ew__warm,\n.liforma-ew--session-concealing .liforma-ew__stage {\n transition-duration: 280ms;\n}\n\n/* Instant hide while dock/maximize geometry settles (player morph resize ~160ms). */\n.liforma-ew--layout-settling .liforma-ew__warm,\n.liforma-ew--layout-settling .liforma-ew__stage {\n opacity: 0 !important;\n transition: none !important;\n}\n\n.liforma-ew[data-live='true'][data-state='collapsed'] .liforma-ew__warm {\n /* Keep the live iframe under the thumb; FAB click resumes the shell. */\n pointer-events: none;\n opacity: 0;\n /* Instant hide when collapsed so the FAB never shows a resized live mesh. */\n transition: none;\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__warm {\n position: fixed;\n /* Match overlay panel inset so the warm iframe fills the conversation shell. */\n inset: clamp(12px, 3vw, 28px);\n z-index: 2147483001;\n width: auto;\n height: auto;\n border-radius: 16px;\n pointer-events: auto;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__warm {\n position: fixed;\n inset: auto;\n z-index: 2147483001;\n border-radius: 16px;\n pointer-events: auto;\n /* left/top/width/height set inline from dock geometry */\n}\n\n.liforma-ew__toolbar {\n display: none;\n position: fixed;\n z-index: 2147483002;\n pointer-events: auto;\n box-sizing: border-box;\n align-items: center;\n gap: 0.35rem;\n padding: 0.35rem 0.4rem;\n border-radius: 999px;\n background: rgba(12, 14, 20, 0.72);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__toolbar {\n display: flex;\n top: calc(clamp(12px, 3vw, 28px) + 10px);\n right: calc(clamp(12px, 3vw, 28px) + 10px);\n left: auto;\n cursor: default;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar {\n display: flex;\n /* left/top set inline to track the panel; strip remains a drag handle */\n cursor: grab;\n touch-action: none;\n user-select: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel,\n.liforma-ew[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-state='docked'] .liforma-ew__stage {\n /* Player also reports surface drags via postMessage when docked. */\n cursor: grab;\n touch-action: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar.liforma-ew__toolbar--dragging,\n.liforma-ew--dock-dragging,\n.liforma-ew--dock-dragging .liforma-ew__toolbar,\n.liforma-ew--dock-dragging .liforma-ew__panel,\n.liforma-ew--dock-dragging .liforma-ew__warm,\n.liforma-ew--dock-dragging .liforma-ew__stage {\n cursor: grabbing;\n}\n\n\n.liforma-ew__toolbar[hidden] {\n display: none !important;\n}\n\n.liforma-ew__icon-btn {\n appearance: none;\n box-sizing: border-box;\n display: inline-grid;\n place-items: center;\n width: 2rem;\n height: 2rem;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: 999px;\n color: #f5f7fb;\n background: transparent;\n cursor: pointer;\n}\n\n.liforma-ew__icon-btn:hover {\n background: rgba(255, 255, 255, 0.12);\n}\n\n.liforma-ew__icon-btn[aria-pressed='true'] {\n background: rgba(255, 255, 255, 0.2);\n}\n\n.liforma-ew__icon-btn:focus-visible {\n outline: 2px solid #5b8def;\n outline-offset: 2px;\n}\n\n.liforma-ew__icon-btn svg {\n width: 1.05rem;\n height: 1.05rem;\n display: block;\n}\n\n.liforma-ew__drag-grip {\n display: none;\n width: 0.85rem;\n height: 1.25rem;\n margin: 0 0.15rem 0 0.25rem;\n background:\n radial-gradient(circle, currentColor 1.1px, transparent 1.2px) 0 0 / 0.35rem 0.35rem,\n radial-gradient(circle, currentColor 1.1px, transparent 1.2px) 0.35rem 0 / 0.35rem 0.35rem;\n background-repeat: repeat-y;\n opacity: 0.55;\n color: #f5f7fb;\n pointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__drag-grip {\n display: block;\n}\n\n.liforma-ew__dock-toggle[hidden] {\n display: none !important;\n}\n\n.liforma-ew__overlay {\n position: fixed;\n inset: 0;\n z-index: 2147483000;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: clamp(12px, 3vw, 28px);\n box-sizing: border-box;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__overlay {\n padding: 0;\n align-items: stretch;\n justify-content: stretch;\n pointer-events: none;\n background: transparent;\n}\n\n.liforma-ew__overlay[hidden] {\n display: none !important;\n}\n\n.liforma-ew__backdrop {\n position: absolute;\n inset: 0;\n border: 0;\n padding: 0;\n margin: 0;\n background: rgba(6, 8, 14, 0.62);\n cursor: pointer;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__backdrop {\n display: none !important;\n}\n\n.liforma-ew__panel {\n position: relative;\n z-index: 1;\n display: flex;\n flex-direction: column;\n /* Fill the overlay so player loading / start UI centers in the visible window. */\n width: var(--liforma-ew-max-w, 100%);\n height: var(--liforma-ew-max-h, 100%);\n max-width: 100%;\n max-height: 100%;\n border-radius: 16px;\n overflow: hidden;\n background: #030508;\n box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);\n /* Warm iframe sits above as a sibling; keep panel as chrome shell. */\n pointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel {\n position: fixed;\n inset: auto;\n max-width: none;\n max-height: none;\n pointer-events: auto;\n /* left/top/width/height set inline from dock geometry */\n}\n\n.liforma-ew:not([data-warm='true']) .liforma-ew__panel {\n pointer-events: auto;\n}\n\n.liforma-ew__stage {\n position: relative;\n flex: 1;\n min-height: 0;\n width: 100%;\n height: 100%;\n background: #030508;\n opacity: 1;\n transition: opacity 1000ms ease;\n}\n\n.liforma-ew__status {\n position: absolute;\n inset: 0;\n z-index: 1;\n display: grid;\n place-items: center;\n padding: 1.5rem;\n text-align: center;\n color: #d7dde8;\n font: 500 0.9375rem/1.45 system-ui, sans-serif;\n background: rgba(3, 5, 8, 0.92);\n pointer-events: none;\n}\n\n.liforma-ew__status[hidden] {\n display: none !important;\n}\n\n/* Mobile expanded: ~90% viewport, no reduce control. */\n@media (max-width: 767px) {\n .liforma-ew[data-state='expanded'] .liforma-ew__overlay {\n padding: 5vh 5vw;\n }\n\n .liforma-ew[data-state='expanded'] .liforma-ew__panel {\n width: 90vw;\n height: 90vh;\n max-width: 90vw;\n max-height: 90vh;\n }\n\n .liforma-ew[data-state='expanded'] .liforma-ew__warm {\n inset: 5vh 5vw;\n }\n\n .liforma-ew[data-state='expanded'] .liforma-ew__toolbar {\n top: calc(5vh + 10px);\n right: calc(5vw + 10px);\n }\n\n .liforma-ew__dock-toggle {\n display: none !important;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .liforma-ew__hit {\n transition: none;\n will-change: auto;\n }\n\n .liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover,\n .liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-ew__hit {\n transform: none;\n }\n\n .liforma-ew__face .liforma-et {\n box-shadow: none;\n transition: none;\n }\n\n .liforma-ew__warm,\n .liforma-ew__stage {\n transition: none;\n }\n}\n", Ee = "liforma-experience-widget-styles";
605
+ function De(e = Te) {
525
606
  if (typeof document > "u") return;
526
- let t = document.getElementById(G);
607
+ let t = document.getElementById(Ee);
527
608
  if (t) {
528
609
  t.textContent = e;
529
610
  return;
530
611
  }
531
612
  let n = document.createElement("style");
532
- n.id = G, n.textContent = e, document.head.append(n);
613
+ n.id = Ee, n.textContent = e, document.head.append(n);
533
614
  }
534
615
  //#endregion
535
616
  //#region src/shims/apiBaseUrl.ts
536
- var ge = "https://api.liforma.ai", _e = "http://localhost:3001";
537
- function K() {
617
+ var Oe = "https://api.liforma.ai", ke = "http://localhost:3001";
618
+ function Ae() {
538
619
  let e = globalThis.__LIFORMA_API_BASE_URL;
539
620
  if (e?.trim()) return e.trim().replace(/\/$/, "");
540
621
  if (typeof document > "u") return null;
541
622
  let t = (document.querySelector("script[data-liforma-sdk][src*=\"client.js\"]") ?? document.querySelector("script[src*=\"/sdk/v2/client.js\"]"))?.getAttribute("data-api-base-url")?.trim();
542
623
  return t ? t.replace(/\/$/, "") : null;
543
624
  }
544
- function ve() {
545
- return K() || (T() ? _e : ge);
625
+ function K() {
626
+ return Ae() || (te() ? ke : Oe);
546
627
  }
547
628
  //#endregion
548
629
  //#region src/v2/api/fetchExperiencePreview.ts
549
- function ye(e) {
630
+ function je(e) {
550
631
  if (!e || typeof e != "object") return null;
551
632
  let t = e, n = typeof t.avatarImage == "string" ? t.avatarImage.trim() : "";
552
633
  return n ? {
@@ -555,10 +636,10 @@ function ye(e) {
555
636
  ...typeof t.foregroundImage == "string" && t.foregroundImage.trim() ? { foregroundImage: t.foregroundImage.trim() } : {}
556
637
  } : null;
557
638
  }
558
- async function be(e, t) {
639
+ async function Me(e, t) {
559
640
  let n = e.trim();
560
641
  if (!n) throw Error("Experience preview requires experienceId.");
561
- let r = (t?.apiBaseUrl ?? ve()).replace(/\/$/, ""), i = await fetch(`${r}/v1/experiences/${encodeURIComponent(n)}/preview`, {
642
+ let r = (t?.apiBaseUrl ?? K()).replace(/\/$/, ""), i = await fetch(`${r}/v1/experiences/${encodeURIComponent(n)}/preview`, {
562
643
  method: "GET",
563
644
  headers: { Accept: "application/json" },
564
645
  signal: t?.signal
@@ -578,7 +659,7 @@ async function be(e, t) {
578
659
  throw Error("Experience preview returned invalid JSON.");
579
660
  }
580
661
  if (!a || typeof a != "object") throw Error("Experience preview returned an invalid payload.");
581
- let o = a, s = typeof o.experienceId == "string" ? o.experienceId.trim() : n, c = typeof o.title == "string" ? o.title.trim() : "", l = ye(o.galleryThumb);
662
+ let o = a, s = typeof o.experienceId == "string" ? o.experienceId.trim() : n, c = typeof o.title == "string" ? o.title.trim() : "", l = je(o.galleryThumb);
582
663
  if (!l) throw Error("Experience preview is missing gallery thumb images.");
583
664
  return {
584
665
  experienceId: s || n,
@@ -597,15 +678,15 @@ var q = class extends Error {
597
678
  super(e, t?.cause === void 0 ? void 0 : { cause: t.cause }), this.name = "LiformaError", this.code = t?.code?.trim() || "UNKNOWN", this.requestId = t?.requestId?.trim() || void 0, this.status = t?.status, this.details = t?.details;
598
679
  }
599
680
  };
600
- function xe(e) {
681
+ function Ne(e) {
601
682
  if (!(!e || typeof e != "object" || Array.isArray(e))) return e;
602
683
  }
603
- function Se(e, t, n) {
684
+ function Pe(e, t, n) {
604
685
  let r = n?.get("Liforma-Request-Id")?.trim() || void 0, i;
605
686
  try {
606
687
  i = JSON.parse(t);
607
688
  } catch {}
608
- let a = i?.error && typeof i.error == "object" ? i.error : void 0, o = a?.code ?? i?.code, s = a?.message ?? i?.message, c = a?.requestId ?? i?.requestId ?? r, l = typeof o == "string" && o.trim() ? o.trim() : "HTTP_ERROR", u = typeof s == "string" && s.trim() ? s.trim() : t.trim().slice(0, 500) || `Request failed (${e})`, d = typeof c == "string" && c.trim() ? c.trim() : r, { code: f, message: p, requestId: m, ...h } = xe(a) ?? xe(i) ?? {};
689
+ let a = i?.error && typeof i.error == "object" ? i.error : void 0, o = a?.code ?? i?.code, s = a?.message ?? i?.message, c = a?.requestId ?? i?.requestId ?? r, l = typeof o == "string" && o.trim() ? o.trim() : "HTTP_ERROR", u = typeof s == "string" && s.trim() ? s.trim() : t.trim().slice(0, 500) || `Request failed (${e})`, d = typeof c == "string" && c.trim() ? c.trim() : r, { code: f, message: p, requestId: m, ...h } = Ne(a) ?? Ne(i) ?? {};
609
690
  return new q(u, {
610
691
  code: l,
611
692
  requestId: d,
@@ -615,13 +696,13 @@ function Se(e, t, n) {
615
696
  }
616
697
  //#endregion
617
698
  //#region src/v2/api/captureAttribution.ts
618
- var Ce = 128, we = /[\u0000-\u001f\u007f]/g;
699
+ var Fe = 128, Ie = /[\u0000-\u001f\u007f]/g;
619
700
  function J(e) {
620
701
  if (!e) return;
621
- let t = e.replace(we, "").trim();
622
- if (t) return t.slice(0, Ce);
702
+ let t = e.replace(Ie, "").trim();
703
+ if (t) return t.slice(0, Fe);
623
704
  }
624
- function Te(e) {
705
+ function Le(e) {
625
706
  let t = new URLSearchParams((e ?? "").startsWith("?") ? (e ?? "").slice(1) : e ?? "");
626
707
  return {
627
708
  ...J(t.get("utm_source")) ? { utmSource: J(t.get("utm_source")) } : {},
@@ -631,7 +712,7 @@ function Te(e) {
631
712
  ...J(t.get("utm_term")) ? { utmTerm: J(t.get("utm_term")) } : {}
632
713
  };
633
714
  }
634
- function Ee(e) {
715
+ function Re(e) {
635
716
  if (e === !1) return;
636
717
  if (e && typeof e == "object") {
637
718
  let t = {
@@ -645,7 +726,7 @@ function Ee(e) {
645
726
  return Object.keys(t).length ? t : void 0;
646
727
  }
647
728
  if (typeof window > "u") return;
648
- let t = Te(window.location?.search), n = J(document.referrer || void 0), r = {
729
+ let t = Le(window.location?.search), n = J(document.referrer || void 0), r = {
649
730
  ...t,
650
731
  ...n ? { referrer: n } : {}
651
732
  };
@@ -653,19 +734,19 @@ function Ee(e) {
653
734
  }
654
735
  //#endregion
655
736
  //#region src/v2/api/sessionEndpointRequest.ts
656
- function De(e) {
737
+ function ze(e) {
657
738
  let t = e.locale?.trim();
658
739
  if (t) return t;
659
740
  let n = e.language?.trim();
660
741
  if (n) return n;
661
742
  if (typeof navigator < "u" && navigator.language?.trim()) return navigator.language.trim();
662
743
  }
663
- function Oe(e) {
744
+ function Be(e) {
664
745
  let t = e.secondaryLocale?.trim(), n = e.learningLocale?.trim();
665
746
  if (t && n && t !== n) throw Error("secondaryLocale and learningLocale disagree; pass only one or make them equal.");
666
747
  return t || n || void 0;
667
748
  }
668
- function ke(e, t) {
749
+ function Ve(e, t) {
669
750
  let n = e.trim();
670
751
  if (!n) throw Error("sessionEndpoint must not be empty.");
671
752
  if (typeof location > "u") throw Error("sessionEndpoint is only available in a browser.");
@@ -673,7 +754,7 @@ function ke(e, t) {
673
754
  if (r.origin !== location.origin) throw Error("sessionEndpoint must be same-origin.");
674
755
  let i = t.experienceId.trim();
675
756
  if (!i) throw Error("sessionEndpoint requires experienceId.");
676
- let a = De(t), o = Oe(t), s = t.idempotencyKey?.trim();
757
+ let a = ze(t), o = Be(t), s = t.idempotencyKey?.trim();
677
758
  return {
678
759
  url: r.toString(),
679
760
  init: {
@@ -692,7 +773,7 @@ function ke(e, t) {
692
773
  ...t.speechInputMode ? { speechInputMode: t.speechInputMode } : {},
693
774
  ...t.speechOnly === void 0 ? {} : { speechOnly: t.speechOnly },
694
775
  ...(() => {
695
- let e = Ee(t.attribution);
776
+ let e = Re(t.attribution);
696
777
  return e ? { attribution: e } : {};
697
778
  })(),
698
779
  ...t.alreadyConverted?.length ? { alreadyConverted: [...t.alreadyConverted] } : {}
@@ -708,7 +789,7 @@ function Y(e) {
708
789
  function X(e) {
709
790
  return typeof e == "boolean";
710
791
  }
711
- function Ae(e) {
792
+ function He(e) {
712
793
  if (!Y(e)) return null;
713
794
  let t = e.speech, n = e.conversation, r = e.avatar, i = e.tools;
714
795
  return !Y(t) || !Y(n) || !Y(r) || !Y(i) || !X(t.input) || !X(t.output) || !X(t.externalAudio) || !X(n.managed) || !X(r.enabled) || !X(i.enabled) ? null : {
@@ -722,7 +803,7 @@ function Ae(e) {
722
803
  tools: { enabled: i.enabled }
723
804
  };
724
805
  }
725
- function je(e) {
806
+ function Ue(e) {
726
807
  return !Y(e) || !X(e.avatar) || !X(e.speechInput) || !X(e.speechOutput) || !X(e.tools) || !X(e.externalAudio) ? null : {
727
808
  speech: {
728
809
  input: e.speechInput,
@@ -734,12 +815,12 @@ function je(e) {
734
815
  tools: { enabled: e.tools }
735
816
  };
736
817
  }
737
- function Me(e) {
738
- return Ae(e) ?? je(e);
818
+ function We(e) {
819
+ return He(e) ?? Ue(e);
739
820
  }
740
- function Ne(e) {
821
+ function Ge(e) {
741
822
  if (!Y(e)) throw Error("Session Launch response is missing session.");
742
- 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 = Me(e.capabilities), l = Pe(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;
823
+ 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 = We(e.capabilities), l = Ke(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;
743
824
  if (!t || !n || !r || !i || !a || !s || !c) throw Error("Session Launch response has an invalid session object.");
744
825
  return {
745
826
  id: t,
@@ -755,7 +836,7 @@ function Ne(e) {
755
836
  ...d ? { createdAt: d } : {}
756
837
  };
757
838
  }
758
- function Pe(e) {
839
+ function Ke(e) {
759
840
  if (!Array.isArray(e) || e.length === 0) return;
760
841
  let t = [];
761
842
  for (let n of e) {
@@ -770,35 +851,35 @@ function Pe(e) {
770
851
  }
771
852
  return t.length > 0 ? t : void 0;
772
853
  }
773
- function Fe(e) {
854
+ function qe(e) {
774
855
  let t = e.localeVoiceFallbacks;
775
856
  if (t?.length) for (let e of t) {
776
857
  let t = e.axis === "secondaryLocale" ? "secondaryLocale" : "locale";
777
858
  console.warn(`[liforma] Session ${t} fell back to ${e.resolved} because the voice does not support ${e.requested}.`);
778
859
  }
779
860
  }
780
- function Ie(e) {
861
+ function Je(e) {
781
862
  if (!Y(e)) throw Error("Session Launch response must be a JSON object.");
782
863
  let t = typeof e.launch == "string" ? e.launch.trim() : "";
783
864
  if (!t) throw Error("Session Launch response is missing launch.");
784
- let n = Ne(e.session);
785
- return Fe(n), {
865
+ let n = Ge(e.session);
866
+ return qe(n), {
786
867
  session: n,
787
868
  launch: t
788
869
  };
789
870
  }
790
871
  //#endregion
791
872
  //#region src/v2/api/mintPublicSession.ts
792
- function Le() {
873
+ function Ye() {
793
874
  try {
794
875
  if (typeof globalThis.location?.origin == "string" && globalThis.location.origin) return globalThis.location.origin;
795
876
  } catch {}
796
877
  }
797
- function Re(e) {
878
+ function Xe(e) {
798
879
  return e ? e.trim().toUpperCase().replace(/-/g, "_") : "";
799
880
  }
800
- function ze(e, t) {
801
- let n = Le(), r = Re(t.code), i = t.message.trim(), a = t.details ?? {};
881
+ function Ze(e, t) {
882
+ let n = Ye(), r = Xe(t.code), i = t.message.trim(), a = t.details ?? {};
802
883
  if (r === "ORIGIN_NOT_ALLOWED" || /^Origin not allowed/i.test(i) && n) {
803
884
  if (i.includes(e) && i.includes("allowed origin")) return t;
804
885
  let r = typeof a.origin == "string" && a.origin || n || "(unknown origin)";
@@ -821,38 +902,38 @@ function ze(e, t) {
821
902
  details: a
822
903
  }) : t;
823
904
  }
824
- function Be(e) {
905
+ function Qe(e) {
825
906
  let t = e?.locale?.trim();
826
907
  if (t) return t;
827
908
  let n = e?.language?.trim();
828
909
  if (n) return n;
829
910
  if (typeof navigator < "u" && navigator.language?.trim()) return navigator.language.trim();
830
911
  }
831
- function Ve(e) {
912
+ function $e(e) {
832
913
  let t = e?.secondaryLocale?.trim(), n = e?.learningLocale?.trim();
833
914
  if (t && n && t !== n) throw new q("secondaryLocale and learningLocale disagree; pass only one or make them equal.", { code: "INVALID_BODY" });
834
915
  return t || n || void 0;
835
916
  }
836
- function He(e, t) {
837
- let n = { experienceId: e }, r = Be(t);
917
+ function et(e, t) {
918
+ let n = { experienceId: e }, r = Qe(t);
838
919
  r && (n.locale = r);
839
- let i = Ve(t);
920
+ let i = $e(t);
840
921
  i && (n.secondaryLocale = i), t?.mode && (n.mode = t.mode), t?.speechInputMode && (n.speechInputMode = t.speechInputMode), t?.speechOnly !== void 0 && (n.speechOnly = t.speechOnly);
841
- let a = Ee(t?.attribution);
922
+ let a = Re(t?.attribution);
842
923
  return a && (n.attribution = a), t?.alreadyConverted?.length && (n.alreadyConverted = [...t.alreadyConverted]), n;
843
924
  }
844
- async function Ue(e, t) {
845
- let n = ve(), r = t?.idempotencyKey?.trim(), i = await fetch(`${n}/v1/browser-sessions`, {
925
+ async function tt(e, t) {
926
+ let n = K(), r = t?.idempotencyKey?.trim(), i = await fetch(`${n}/v1/browser-sessions`, {
846
927
  method: "POST",
847
928
  headers: {
848
929
  "Content-Type": "application/json",
849
930
  ...r ? { "Idempotency-Key": r } : {}
850
931
  },
851
- body: JSON.stringify(He(e, t))
932
+ body: JSON.stringify(et(e, t))
852
933
  });
853
934
  if (!i.ok) {
854
935
  let t = await i.text();
855
- throw ze(e, Se(i.status, t, i.headers));
936
+ throw Ze(e, Pe(i.status, t, i.headers));
856
937
  }
857
938
  let a;
858
939
  try {
@@ -864,10 +945,10 @@ async function Ue(e, t) {
864
945
  requestId: i.headers.get("Liforma-Request-Id") ?? void 0
865
946
  });
866
947
  }
867
- return Ie(a);
948
+ return Je(a);
868
949
  }
869
- async function We(e, t) {
870
- let n = ke(e, t), r = new AbortController(), i = () => r.abort(t.signal?.reason);
950
+ async function nt(e, t) {
951
+ let n = Ve(e, t), r = new AbortController(), i = () => r.abort(t.signal?.reason);
871
952
  t.signal?.aborted ? i() : t.signal?.addEventListener("abort", i, { once: !0 });
872
953
  let a = globalThis.setTimeout(() => r.abort(new DOMException("Session endpoint timed out.", "TimeoutError")), t.timeoutMs ?? 3e4), o;
873
954
  try {
@@ -880,7 +961,7 @@ async function We(e, t) {
880
961
  }
881
962
  if (!o.ok) {
882
963
  let e = await o.text();
883
- throw Se(o.status, e, o.headers);
964
+ throw Pe(o.status, e, o.headers);
884
965
  }
885
966
  if (!o.headers.get("content-type")?.toLowerCase().includes("application/json")) throw new q("Session endpoint must return a JSON Session Launch response.", {
886
967
  code: "INVALID_RESPONSE",
@@ -897,14 +978,14 @@ async function We(e, t) {
897
978
  requestId: o.headers.get("Liforma-Request-Id") ?? void 0
898
979
  });
899
980
  }
900
- return Ie(s);
981
+ return Je(s);
901
982
  }
902
983
  //#endregion
903
984
  //#region src/v2/conversationProcessor.ts
904
- function Ge(e) {
985
+ function rt(e) {
905
986
  return typeof e != "object" || !e ? !1 : typeof e[Symbol.asyncIterator] == "function";
906
987
  }
907
- function Ke(e) {
988
+ function it(e) {
908
989
  if (typeof e == "string") {
909
990
  let t = e.trim();
910
991
  if (!t) throw Error("conversationProcessor returned empty text.");
@@ -918,24 +999,24 @@ function Ke(e) {
918
999
  ...e.behavior ? { behavior: e.behavior } : {}
919
1000
  };
920
1001
  }
921
- async function qe(e, t) {
1002
+ async function at(e, t) {
922
1003
  let n = await e(t);
923
- return Ge(n) ? {
1004
+ return rt(n) ? {
924
1005
  kind: "stream",
925
1006
  stream: n
926
1007
  } : {
927
1008
  kind: "complete",
928
- speech: Ke(n)
1009
+ speech: it(n)
929
1010
  };
930
1011
  }
931
1012
  //#endregion
932
1013
  //#region src/v2/embed/playerReachability.ts
933
- var Je = "3002";
934
- function Ye(e) {
1014
+ var ot = "3002";
1015
+ function st(e) {
935
1016
  let t = new URL(e);
936
- 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 || Je}. 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.`;
1017
+ 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 || ot}. 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.`;
937
1018
  }
938
- async function Xe(e, t) {
1019
+ async function ct(e, t) {
939
1020
  try {
940
1021
  await fetch(e, {
941
1022
  method: "GET",
@@ -943,25 +1024,25 @@ async function Xe(e, t) {
943
1024
  signal: AbortSignal.timeout(8e3)
944
1025
  });
945
1026
  } catch {
946
- throw Error(Ye(t));
1027
+ throw Error(st(t));
947
1028
  }
948
1029
  }
949
- function Ze(e, t, n, r) {
1030
+ function lt(e, t, n, r) {
950
1031
  try {
951
1032
  r && r.length > 0 ? e.postMessage(t, n, r) : e.postMessage(t, n);
952
1033
  } catch (e) {
953
- throw e instanceof DOMException && e.name === "SecurityError" ? Error(Ye(n), { cause: e }) : e;
1034
+ throw e instanceof DOMException && e.name === "SecurityError" ? Error(st(n), { cause: e }) : e;
954
1035
  }
955
1036
  }
956
- var Qe = new Set([1, 2]);
957
- function $e(e) {
958
- return typeof e == "number" && Qe.has(e);
1037
+ var ut = new Set([1, 2]);
1038
+ function dt(e) {
1039
+ return typeof e == "number" && ut.has(e);
959
1040
  }
960
- var et = 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.interactionChange".split("."));
961
- function tt(e) {
1041
+ var ft = 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.interactionChange".split("."));
1042
+ function pt(e) {
962
1043
  if (!e || typeof e != "object") return null;
963
1044
  let t = e;
964
- if (!$e(t.schemaVersion) || !t.type || !et.has(t.type)) return null;
1045
+ if (!dt(t.schemaVersion) || !t.type || !ft.has(t.type)) return null;
965
1046
  if (t.type === "embedReady" || t.type === "widgetReady" || t.type === "widgetExpand" || t.type === "widgetCollapse") return t;
966
1047
  if (t.type === "fullWindow") {
967
1048
  let e = t.payload;
@@ -984,10 +1065,10 @@ function tt(e) {
984
1065
  let n = t.payload;
985
1066
  return !n || typeof n != "object" ? null : t;
986
1067
  }
987
- function nt(e, t, n) {
1068
+ function mt(e, t, n) {
988
1069
  let r = e.trim();
989
1070
  if (!r) throw Error("createLaunchMessage requires a non-empty launch string.");
990
- let i = n?.startButton, a = n?.theme, o = n?.showFeedback;
1071
+ let i = n?.startButton, a = n?.theme, o = n?.showFeedback, s = n?.interaction;
991
1072
  return {
992
1073
  type: "launch",
993
1074
  schemaVersion: 2,
@@ -996,24 +1077,25 @@ function nt(e, t, n) {
996
1077
  ...t === void 0 ? {} : { session: t },
997
1078
  ...i ? { startButton: i } : {},
998
1079
  ...a ? { theme: a } : {},
999
- ...o === void 0 ? {} : { showFeedback: o }
1080
+ ...o === void 0 ? {} : { showFeedback: o },
1081
+ ...s ? { interaction: s } : {}
1000
1082
  }
1001
1083
  };
1002
1084
  }
1003
- function rt() {
1085
+ function ht() {
1004
1086
  return {
1005
1087
  type: "parentHello",
1006
1088
  schemaVersion: 2
1007
1089
  };
1008
1090
  }
1009
- function it(e) {
1091
+ function gt(e) {
1010
1092
  return {
1011
1093
  type: "widgetSetChrome",
1012
1094
  schemaVersion: 2,
1013
1095
  payload: { mode: e }
1014
1096
  };
1015
1097
  }
1016
- function at() {
1098
+ function _t() {
1017
1099
  return {
1018
1100
  type: "widgetToggleAudioSettings",
1019
1101
  schemaVersion: 2,
@@ -1022,8 +1104,8 @@ function at() {
1022
1104
  }
1023
1105
  //#endregion
1024
1106
  //#region src/v2/embed/fullWindowHost.ts
1025
- var ot = "2147483000";
1026
- function st(e) {
1107
+ var vt = "2147483000";
1108
+ function yt(e) {
1027
1109
  let { style: t } = e;
1028
1110
  return {
1029
1111
  position: t.position,
@@ -1041,11 +1123,11 @@ function st(e) {
1041
1123
  maxHeight: t.maxHeight
1042
1124
  };
1043
1125
  }
1044
- function ct(e) {
1126
+ function bt(e) {
1045
1127
  let { style: t } = e;
1046
- 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 = ot, t.margin = "0", t.borderRadius = "0", t.maxWidth = "none", t.maxHeight = "none", e.dataset.liformaFullWindow = "1";
1128
+ 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 = vt, t.margin = "0", t.borderRadius = "0", t.maxWidth = "none", t.maxHeight = "none", e.dataset.liformaFullWindow = "1";
1047
1129
  }
1048
- function lt(e, t) {
1130
+ function xt(e, t) {
1049
1131
  if (delete e.dataset.liformaFullWindow, !t) {
1050
1132
  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 = "";
1051
1133
  return;
@@ -1055,20 +1137,20 @@ function lt(e, t) {
1055
1137
  }
1056
1138
  //#endregion
1057
1139
  //#region src/v2/embed/iframeHost.ts
1058
- function ut(e) {
1140
+ function St(e) {
1059
1141
  return e;
1060
1142
  }
1061
1143
  function Z() {
1062
1144
  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)}`;
1063
1145
  }
1064
- var dt = 3e4;
1065
- function ft(e) {
1146
+ var Ct = 3e4;
1147
+ function wt(e) {
1066
1148
  let t = e.container;
1067
1149
  getComputedStyle(t).position === "static" && (t.style.position = "relative");
1068
1150
  let n = document.createElement("iframe");
1069
1151
  n.src = e.src, n.title = "Liforma experience", n.setAttribute("allow", "microphone; autoplay; clipboard-read; clipboard-write"), 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");
1070
1152
  let r = !1, i = !1, a = null, o = t.closest(".liforma-experience-shell") instanceof HTMLElement ? t.closest(".liforma-experience-shell") : t, s = (t) => {
1071
- i !== t && (i = t, t ? (a = st(o), ct(o)) : (lt(o, a), a = null), e.onFullWindowChange?.(t));
1153
+ i !== t && (i = t, t ? (a = yt(o), bt(o)) : (xt(o, a), a = null), e.onFullWindowChange?.(t));
1072
1154
  }, c = /* @__PURE__ */ new Map(), l = null, u = 0, d = 0, f = [], p = null, m = null, h = new Promise((e, t) => {
1073
1155
  p = e, m = t;
1074
1156
  }), g = () => {
@@ -1079,10 +1161,10 @@ function ft(e) {
1079
1161
  let i = Date.now();
1080
1162
  if (d > 0 && i - d < 250) return;
1081
1163
  d = i, g();
1082
- let a = nt(t.launch, t.session, t.chrome), o = () => {
1164
+ let a = mt(t.launch, t.session, t.chrome), o = () => {
1083
1165
  if (r) return;
1084
1166
  let t = n.contentWindow;
1085
- t && Ze(t, a, e.playerOrigin);
1167
+ t && lt(t, a, e.playerOrigin);
1086
1168
  };
1087
1169
  o();
1088
1170
  for (let e = 1; e <= 12; e += 1) f.push(window.setTimeout(o, e * 75));
@@ -1090,17 +1172,17 @@ function ft(e) {
1090
1172
  r || !l || _(l);
1091
1173
  }, y = () => {
1092
1174
  if (u += 1, u === 1) {
1093
- Xe(e.src, e.playerOrigin).then(() => p?.(), (e) => m?.(e instanceof Error ? e : Error(String(e))));
1175
+ ct(e.src, e.playerOrigin).then(() => p?.(), (e) => m?.(e instanceof Error ? e : Error(String(e))));
1094
1176
  return;
1095
1177
  }
1096
1178
  d = 0, v();
1097
1179
  }, b = () => {
1098
- u > 0 || m?.(Error(Ye(e.playerOrigin)));
1180
+ u > 0 || m?.(Error(st(e.playerOrigin)));
1099
1181
  };
1100
1182
  n.addEventListener("load", y), n.addEventListener("error", b);
1101
1183
  let x = (t) => {
1102
1184
  if (r || t.source !== n.contentWindow || t.origin !== e.playerOrigin) return;
1103
- let i = tt(t.data);
1185
+ let i = pt(t.data);
1104
1186
  if (i) switch (i.type) {
1105
1187
  case "close":
1106
1188
  e.onClose?.(i.payload);
@@ -1139,7 +1221,7 @@ function ft(e) {
1139
1221
  e.onUserSpeechEnded?.(i.payload);
1140
1222
  break;
1141
1223
  case "modeChange":
1142
- e.onActivityChange?.(ut(i.payload.mode));
1224
+ e.onActivityChange?.(St(i.payload.mode));
1143
1225
  break;
1144
1226
  case "activityChange":
1145
1227
  e.onActivityChange?.(i.payload.activity);
@@ -1195,8 +1277,8 @@ function ft(e) {
1195
1277
  let S = (t, i) => {
1196
1278
  if (r) return;
1197
1279
  let a = n.contentWindow;
1198
- if (!a) throw Error(Ye(e.playerOrigin));
1199
- Ze(a, t, e.playerOrigin, i);
1280
+ if (!a) throw Error(st(e.playerOrigin));
1281
+ lt(a, t, e.playerOrigin, i);
1200
1282
  }, C = (e, t = 12e4, n) => {
1201
1283
  let r = e.type !== "parentHello" && e.payload && "correlationId" in e.payload ? e.payload.correlationId : Z();
1202
1284
  return e.type !== "parentHello" && e.payload && "correlationId" in e.payload || e.type !== "parentHello" && e.payload && (e.payload.correlationId = r), new Promise((i, a) => {
@@ -1213,7 +1295,7 @@ function ft(e) {
1213
1295
  return h;
1214
1296
  },
1215
1297
  postParentHello() {
1216
- S(rt());
1298
+ S(ht());
1217
1299
  },
1218
1300
  postLaunch(e, t, n) {
1219
1301
  r || (l = {
@@ -1235,10 +1317,10 @@ function ft(e) {
1235
1317
  throw Error("postManifest is deprecated; use postLaunch with an opaque launch string from SessionLaunchResponse.");
1236
1318
  },
1237
1319
  postWidgetSetChrome(e) {
1238
- S(it(e));
1320
+ S(gt(e));
1239
1321
  },
1240
1322
  postWidgetToggleAudioSettings() {
1241
- S(at());
1323
+ S(_t());
1242
1324
  },
1243
1325
  speak(e) {
1244
1326
  return C({
@@ -1360,7 +1442,7 @@ function ft(e) {
1360
1442
  audio: e.audio,
1361
1443
  byteLength: e.byteLength
1362
1444
  }
1363
- }, dt, [e.audio]);
1445
+ }, Ct, [e.audio]);
1364
1446
  },
1365
1447
  speechUtteranceSetTranscript(e) {
1366
1448
  return C({
@@ -1432,6 +1514,36 @@ function ft(e) {
1432
1514
  }
1433
1515
  });
1434
1516
  },
1517
+ setStage(e) {
1518
+ return C({
1519
+ type: "setStage",
1520
+ schemaVersion: 2,
1521
+ payload: {
1522
+ correlationId: Z(),
1523
+ stage: e
1524
+ }
1525
+ });
1526
+ },
1527
+ setPipBackground(e) {
1528
+ return C({
1529
+ type: "setPipBackground",
1530
+ schemaVersion: 2,
1531
+ payload: {
1532
+ correlationId: Z(),
1533
+ pipBackground: e
1534
+ }
1535
+ });
1536
+ },
1537
+ setPipShadow(e) {
1538
+ return C({
1539
+ type: "setPipShadow",
1540
+ schemaVersion: 2,
1541
+ payload: {
1542
+ correlationId: Z(),
1543
+ pipShadow: e
1544
+ }
1545
+ });
1546
+ },
1435
1547
  setInteraction(e) {
1436
1548
  return C({
1437
1549
  type: "setInteraction",
@@ -1492,7 +1604,7 @@ function ft(e) {
1492
1604
  }
1493
1605
  //#endregion
1494
1606
  //#region src/v2/embed/readyGate.ts
1495
- function pt(e) {
1607
+ function Tt(e) {
1496
1608
  let t, n = !1, r = !1, i = () => {
1497
1609
  r || !n || t === void 0 || (r = !0, e(t));
1498
1610
  };
@@ -1507,9 +1619,9 @@ function pt(e) {
1507
1619
  }
1508
1620
  //#endregion
1509
1621
  //#region src/v2/sdkRelease.ts
1510
- var mt = `sdk@${{
1622
+ var Et = `sdk@${{
1511
1623
  name: "@liforma/client",
1512
- version: "0.4.9",
1624
+ version: "0.4.11",
1513
1625
  type: "module",
1514
1626
  description: "Liforma browser SDK — Experience sessions, speech API, and Svelte embed component.",
1515
1627
  license: "MIT",
@@ -1728,50 +1840,50 @@ var mt = `sdk@${{
1728
1840
  vitest: "^4.1.10",
1729
1841
  wrangler: "^4.101.0"
1730
1842
  }
1731
- }.version}`, ht = "https://player.liforma.ai/embed", gt = "http://localhost:3002/embed";
1732
- function _t() {
1843
+ }.version}`, Dt = "https://player.liforma.ai/embed", Ot = "http://localhost:3002/embed";
1844
+ function kt() {
1733
1845
  let e = globalThis.__LIFORMA_PLAYER_EMBED_URL;
1734
1846
  if (e?.trim()) return e.trim().replace(/\/$/, "");
1735
1847
  if (typeof document > "u") return null;
1736
1848
  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();
1737
1849
  return t ? t.replace(/\/$/, "") : null;
1738
1850
  }
1739
- function vt() {
1740
- let e = _t();
1741
- return e ? e.endsWith("/embed") ? e : `${e}/embed` : T() ? gt : ht;
1851
+ function At() {
1852
+ let e = kt();
1853
+ return e ? e.endsWith("/embed") ? e : `${e}/embed` : te() ? Ot : Dt;
1742
1854
  }
1743
- function yt(e, t) {
1855
+ function jt(e, t) {
1744
1856
  return e?.trim() || t?.trim() || void 0;
1745
1857
  }
1746
- function bt(e, t, n, r, i, a, o, s) {
1747
- let c = (e ?? vt()).replace(/\/$/, ""), l = c.endsWith("/embed") ? c : `${c}/embed`, u = new URL(l), d = n?.trim();
1748
- d && (u.searchParams.set("backdropId", d), u.searchParams.set("locationId", d));
1749
- let f = r?.trim();
1750
- return f && u.searchParams.set("avatarId", f), (i === "face" || i === "medium") && u.searchParams.set("fit", i), a === "widget" && u.searchParams.set("ui", "widget"), o && u.searchParams.set("close", "1"), t && u.searchParams.set("debug", "true"), (s === 2 || s === 3 || s === 4) && u.searchParams.set("cast", String(s)), xt(u.toString());
1858
+ function Mt(e, t, n, r, i, a, o, s, c, l, u) {
1859
+ let d = (e ?? At()).replace(/\/$/, ""), f = d.endsWith("/embed") ? d : `${d}/embed`, p = new URL(f), m = n?.trim();
1860
+ m && p.searchParams.set("backdropId", m);
1861
+ let h = r?.trim();
1862
+ return h && p.searchParams.set("avatarId", h), (i === "face" || i === "medium") && p.searchParams.set("fit", i), c === "pip" && p.searchParams.set("stage", "pip"), l === "set" && p.searchParams.set("pipBackground", "set"), u === !1 && p.searchParams.set("pipShadow", "0"), a === "widget" && p.searchParams.set("ui", "widget"), o && p.searchParams.set("close", "1"), t && p.searchParams.set("debug", "true"), (s === 2 || s === 3 || s === 4) && p.searchParams.set("cast", String(s)), Nt(p.toString());
1751
1863
  }
1752
- function xt(e) {
1864
+ function Nt(e) {
1753
1865
  if (typeof location > "u") return e;
1754
1866
  let t = new URL(e);
1755
1867
  return t.searchParams.set("parentOrigin", location.origin), t.toString();
1756
1868
  }
1757
- function St(e) {
1869
+ function Pt(e) {
1758
1870
  return new URL(e).origin;
1759
1871
  }
1760
1872
  //#endregion
1761
1873
  //#region src/v2/experienceEvents.ts
1762
- function Ct() {
1874
+ function Ft() {
1763
1875
  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)}`;
1764
1876
  }
1765
- function wt(e, t, n) {
1877
+ function It(e, t, n) {
1766
1878
  return {
1767
- id: Ct(),
1879
+ id: Ft(),
1768
1880
  type: e,
1769
1881
  sessionId: t,
1770
1882
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1771
1883
  data: n
1772
1884
  };
1773
1885
  }
1774
- function Tt() {
1886
+ function Lt() {
1775
1887
  return {
1776
1888
  ready: /* @__PURE__ */ new Set(),
1777
1889
  started: /* @__PURE__ */ new Set(),
@@ -1792,39 +1904,39 @@ function Tt() {
1792
1904
  conversationProcessorError: /* @__PURE__ */ new Set()
1793
1905
  };
1794
1906
  }
1795
- function Et(e, t, n) {
1907
+ function Rt(e, t, n) {
1796
1908
  return e[t].add(n), () => e[t].delete(n);
1797
1909
  }
1798
- function Dt(e, t, n) {
1910
+ function zt(e, t, n) {
1799
1911
  for (let r of e[t]) r(n);
1800
1912
  }
1801
- function Ot(e) {
1913
+ function Bt(e) {
1802
1914
  for (let t of Object.keys(e)) e[t].clear();
1803
1915
  }
1804
1916
  //#endregion
1805
1917
  //#region src/v2/speech/types.ts
1806
- function kt(e) {
1918
+ function Vt(e) {
1807
1919
  return "data" in e && "format" in e && e.format != null && !("track" in e);
1808
1920
  }
1809
- function At(e) {
1921
+ function Ht(e) {
1810
1922
  return "url" in e && typeof e.url == "string";
1811
1923
  }
1812
- function jt(e) {
1924
+ function Ut(e) {
1813
1925
  if (!("track" in e)) return !1;
1814
1926
  let t = e.track;
1815
1927
  return typeof t != "object" || !t ? !1 : typeof MediaStreamTrack < "u" && t instanceof MediaStreamTrack ? !0 : "kind" in t && "readyState" in t;
1816
1928
  }
1817
- function Mt(e) {
1818
- return !kt(e) && !At(e) && !jt(e) && "encoding" in e && typeof e.encoding == "string";
1929
+ function Wt(e) {
1930
+ return !Vt(e) && !Ht(e) && !Ut(e) && "encoding" in e && typeof e.encoding == "string";
1819
1931
  }
1820
- var Nt = [
1932
+ var Gt = [
1821
1933
  8e3,
1822
1934
  16e3,
1823
1935
  22050,
1824
1936
  24e3,
1825
1937
  44100,
1826
1938
  48e3
1827
- ], Pt = {
1939
+ ], Kt = {
1828
1940
  MAX_CHUNK_BYTES: 64 * 1024,
1829
1941
  RECOMMENDED_CHUNK_MS_MIN: 20,
1830
1942
  RECOMMENDED_CHUNK_MS_MAX: 200,
@@ -1835,14 +1947,14 @@ var Nt = [
1835
1947
  MAX_UTTERANCE_DURATION_MS: 9e4,
1836
1948
  MAX_PENDING_WRITES: 8,
1837
1949
  DEFAULT_WRITE_TIMEOUT_MS: 5e3
1838
- }, Ft = class extends Error {
1950
+ }, qt = class extends Error {
1839
1951
  operation;
1840
1952
  requiredCapability;
1841
1953
  name = "UnsupportedSpeechOperationError";
1842
1954
  constructor(e, t) {
1843
1955
  super(`Speech operation "${e}" requires capability "${t}".`), this.operation = e, this.requiredCapability = t;
1844
1956
  }
1845
- }, It = class extends Error {
1957
+ }, Jt = class extends Error {
1846
1958
  name = "SpeechUtteranceClosedError";
1847
1959
  constructor(e = "Cannot write to a closed or cancelled speech utterance.") {
1848
1960
  super(e);
@@ -1852,72 +1964,72 @@ var Nt = [
1852
1964
  constructor(e, t) {
1853
1965
  super(e, t);
1854
1966
  }
1855
- }, Lt = class extends Error {
1967
+ }, Yt = class extends Error {
1856
1968
  name = "SpeechBufferTimeoutError";
1857
1969
  constructor(e = "Timed out waiting for speech buffer capacity.") {
1858
1970
  super(e);
1859
1971
  }
1860
1972
  };
1861
- function Rt(e = "none") {
1973
+ function Xt(e = "none") {
1862
1974
  return {
1863
1975
  mode: e,
1864
1976
  trackedDurationMs: 0,
1865
1977
  fallbackDurationMs: 0
1866
1978
  };
1867
1979
  }
1868
- function zt(e) {
1869
- return Nt.includes(e);
1980
+ function Zt(e) {
1981
+ return Gt.includes(e);
1870
1982
  }
1871
- function Bt(e) {
1983
+ function Qt(e) {
1872
1984
  if (e.encoding !== "pcm_s16le") throw new Q(`Unsupported audio encoding: ${e.encoding}`);
1873
1985
  if (e.channels !== 1) throw new Q(`Unsupported channel count: ${e.channels}`);
1874
- if (!zt(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
1986
+ if (!Zt(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
1875
1987
  }
1876
- function Vt(e) {
1877
- if (kt(e)) {
1878
- Bt(e.format);
1988
+ function $t(e) {
1989
+ if (Vt(e)) {
1990
+ Qt(e.format);
1879
1991
  return;
1880
1992
  }
1881
- if (At(e)) {
1993
+ if (Ht(e)) {
1882
1994
  if (!e.url.trim()) throw new Q("Audio URL must be non-empty.");
1883
- if (e.sampleRate !== void 0 && !zt(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
1995
+ if (e.sampleRate !== void 0 && !Zt(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
1884
1996
  return;
1885
1997
  }
1886
- if (jt(e)) {
1998
+ if (Ut(e)) {
1887
1999
  if (e.track.kind !== "audio") throw new Q("speech.play track must be an audio MediaStreamTrack.");
1888
- if (e.sampleRate !== void 0 && !zt(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
2000
+ if (e.sampleRate !== void 0 && !Zt(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
1889
2001
  return;
1890
2002
  }
1891
- if (Mt(e)) {
2003
+ if (Wt(e)) {
1892
2004
  let t = e.encoding.trim().toLowerCase();
1893
2005
  if (!t) throw new Q("Encoded audio MIME type is required.");
1894
2006
  if (t === "pcm_s16le") throw new Q("Use format: { encoding: \"pcm_s16le\", … } for raw PCM.");
1895
- if (e.sampleRate !== void 0 && !zt(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
2007
+ if (e.sampleRate !== void 0 && !Zt(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
1896
2008
  return;
1897
2009
  }
1898
2010
  throw new Q("Unsupported speech.play audio shape.");
1899
2011
  }
1900
- function Ht(e) {
1901
- if (e.format) return Bt(e.format), e.format;
2012
+ function en(e) {
2013
+ if (e.format) return Qt(e.format), e.format;
1902
2014
  if (e.track) {
1903
2015
  let t = {
1904
2016
  encoding: "pcm_s16le",
1905
2017
  sampleRate: e.sampleRate ?? 24e3,
1906
2018
  channels: 1
1907
2019
  };
1908
- return Bt(t), t;
2020
+ return Qt(t), t;
1909
2021
  }
1910
2022
  throw new Q("createUtterance requires format or track.");
1911
2023
  }
1912
- function Ut(e) {
2024
+ function tn(e) {
1913
2025
  return e instanceof Uint8Array ? e : new Uint8Array(e);
1914
2026
  }
1915
- function Wt(e) {
2027
+ function nn(e) {
1916
2028
  return e === "replace-active" || e === "replace-all" ? "interrupt" : "enqueue";
1917
2029
  }
1918
2030
  //#endregion
1919
2031
  //#region src/byo/pcm.ts
1920
- function Gt(e) {
2032
+ function rn(e) {
1921
2033
  let t = new Uint8Array(e.length * 2), n = new DataView(t.buffer);
1922
2034
  for (let t = 0; t < e.length; t++) {
1923
2035
  let r = Math.max(-1, Math.min(1, e[t]));
@@ -1927,11 +2039,11 @@ function Gt(e) {
1927
2039
  }
1928
2040
  //#endregion
1929
2041
  //#region src/byo/resample.ts
1930
- function Kt(e, t, n, r, i) {
2042
+ function an(e, t, n, r, i) {
1931
2043
  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;
1932
2044
  return ((a * i + o) * i + s) * i + c;
1933
2045
  }
1934
- function qt(e, t) {
2046
+ function on(e, t) {
1935
2047
  if (!(e > 0) || !(t > 0)) throw Error("Resampler rates must be positive");
1936
2048
  if (e === t) return {
1937
2049
  fromRate: e,
@@ -1954,7 +2066,7 @@ function qt(e, t) {
1954
2066
  let a = [];
1955
2067
  for (; i + 2 < r.length - 1;) {
1956
2068
  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);
1957
- a.push(Kt(r[o], r[e], r[s], r[c], t)), i += n;
2069
+ a.push(an(r[o], r[e], r[s], r[c], t)), i += n;
1958
2070
  }
1959
2071
  let o = Math.max(0, Math.floor(i) - 1);
1960
2072
  return o > 0 && (r = r.subarray(o), i -= o), a.length ? Float32Array.from(a) : new Float32Array();
@@ -1966,7 +2078,7 @@ function qt(e, t) {
1966
2078
  }
1967
2079
  //#endregion
1968
2080
  //#region src/byo/audioCapture.ts
1969
- var Jt = "liforma-pcm-capture", Yt = `
2081
+ var sn = "liforma-pcm-capture", cn = `
1970
2082
  class LiformaPcmCaptureProcessor extends AudioWorkletProcessor {
1971
2083
  process(inputs) {
1972
2084
  const ch = inputs[0] && inputs[0][0];
@@ -1978,29 +2090,29 @@ class LiformaPcmCaptureProcessor extends AudioWorkletProcessor {
1978
2090
  return true;
1979
2091
  }
1980
2092
  }
1981
- registerProcessor('${Jt}', LiformaPcmCaptureProcessor);
1982
- `, Xt = null;
1983
- function Zt() {
1984
- return Xt ||= URL.createObjectURL(new Blob([Yt], { type: "application/javascript" })), Xt;
2093
+ registerProcessor('${sn}', LiformaPcmCaptureProcessor);
2094
+ `, ln = null;
2095
+ function un() {
2096
+ return ln ||= URL.createObjectURL(new Blob([cn], { type: "application/javascript" })), ln;
1985
2097
  }
1986
- function Qt() {
2098
+ function dn() {
1987
2099
  return window.AudioContext || window.webkitAudioContext || null;
1988
2100
  }
1989
- async function $t(e) {
1990
- let { mediaStream: t, targetSampleRate: n, onPcm: r, shouldSend: i, onLog: a } = e, o = Qt();
2101
+ async function fn(e) {
2102
+ let { mediaStream: t, targetSampleRate: n, onPcm: r, shouldSend: i, onLog: a } = e, o = dn();
1991
2103
  if (!o) throw Error("Web Audio is required for audio capture");
1992
2104
  let s = new o(), c = s.createMediaStreamSource(t), l = s.createGain();
1993
2105
  l.gain.value = 0;
1994
- let u = s.sampleRate, d = qt(u, n), f = !1, p = !1, m = (e) => {
2106
+ let u = s.sampleRate, d = on(u, n), f = !1, p = !1, m = (e) => {
1995
2107
  if (f || i && !i()) return;
1996
2108
  let t = d.push(e);
1997
- t.length !== 0 && r(Gt(t));
2109
+ t.length !== 0 && r(rn(t));
1998
2110
  }, h = () => void 0;
1999
2111
  return await (async () => {
2000
2112
  if (typeof s.audioWorklet?.addModule != "function") return !1;
2001
2113
  try {
2002
- await s.audioWorklet.addModule(Zt());
2003
- let e = new AudioWorkletNode(s, Jt, {
2114
+ await s.audioWorklet.addModule(un());
2115
+ let e = new AudioWorkletNode(s, sn, {
2004
2116
  numberOfInputs: 1,
2005
2117
  numberOfOutputs: 1,
2006
2118
  outputChannelCount: [1]
@@ -2050,7 +2162,7 @@ async function $t(e) {
2050
2162
  }
2051
2163
  //#endregion
2052
2164
  //#region src/v2/speech/captureMediaStreamTrack.ts
2053
- async function en(e) {
2165
+ async function pn(e) {
2054
2166
  let { track: t, utterance: n, sampleRate: r, signal: i } = e;
2055
2167
  if (typeof MediaStreamTrack > "u" || !(t instanceof MediaStreamTrack)) throw new Q("MediaStreamTrack is not available in this environment.");
2056
2168
  if (t.kind !== "audio") throw new Q("speech.play track must be an audio MediaStreamTrack.");
@@ -2059,18 +2171,18 @@ async function en(e) {
2059
2171
  s || (s = !0, c?.stop(), c = null);
2060
2172
  };
2061
2173
  try {
2062
- c = await $t({
2174
+ c = await fn({
2063
2175
  mediaStream: a,
2064
2176
  targetSampleRate: r,
2065
2177
  shouldSend: () => !s && !i?.aborted,
2066
2178
  onPcm: (e) => {
2067
2179
  if (s || i?.aborted) return;
2068
- let t = Ut(e);
2180
+ let t = tn(e);
2069
2181
  o = o.then(async () => {
2070
2182
  if (s || i?.aborted) return;
2071
2183
  let e = 0;
2072
2184
  for (; e < t.byteLength;) {
2073
- let r = Math.min(e + Pt.MAX_CHUNK_BYTES, t.byteLength);
2185
+ let r = Math.min(e + Kt.MAX_CHUNK_BYTES, t.byteLength);
2074
2186
  if ((r - e) % 2 == 1 && --r, r <= e) break;
2075
2187
  let i = t.subarray(e, r);
2076
2188
  e = r, i.byteLength !== 0 && await n.write(i);
@@ -2094,10 +2206,10 @@ async function en(e) {
2094
2206
  }
2095
2207
  //#endregion
2096
2208
  //#region src/v2/speech/speechController.ts
2097
- async function tn(e, t) {
2098
- if (jt(e)) throw new Q("MediaStreamTrack play is handled on the host before embed.");
2099
- if (kt(e)) {
2100
- let t = Ut(e.data);
2209
+ async function mn(e, t) {
2210
+ if (Ut(e)) throw new Q("MediaStreamTrack play is handled on the host before embed.");
2211
+ if (Vt(e)) {
2212
+ let t = tn(e.data);
2101
2213
  if (t.byteLength & 1) throw new Q("PCM byte length must be even.");
2102
2214
  return {
2103
2215
  kind: "pcm",
@@ -2105,17 +2217,17 @@ async function tn(e, t) {
2105
2217
  format: e.format
2106
2218
  };
2107
2219
  }
2108
- if (At(e)) return {
2220
+ if (Ht(e)) return {
2109
2221
  kind: "url",
2110
2222
  url: e.url.trim(),
2111
2223
  ...e.sampleRate === void 0 ? {} : { sampleRate: e.sampleRate }
2112
2224
  };
2113
- if (!Mt(e)) throw new Q("Unsupported speech.play audio shape.");
2225
+ if (!Wt(e)) throw new Q("Unsupported speech.play audio shape.");
2114
2226
  let n;
2115
2227
  if (typeof Blob < "u" && e.data instanceof Blob) {
2116
2228
  if (t?.aborted) throw new DOMException("Play aborted.", "AbortError");
2117
2229
  n = new Uint8Array(await e.data.arrayBuffer());
2118
- } else n = Ut(e.data);
2230
+ } else n = tn(e.data);
2119
2231
  return {
2120
2232
  kind: "encoded",
2121
2233
  data: n.slice().buffer,
@@ -2123,10 +2235,10 @@ async function tn(e, t) {
2123
2235
  ...e.sampleRate === void 0 ? {} : { sampleRate: e.sampleRate }
2124
2236
  };
2125
2237
  }
2126
- function nn() {
2238
+ function hn() {
2127
2239
  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)}`;
2128
2240
  }
2129
- function rn(e, t = "completed") {
2241
+ function gn(e, t = "completed") {
2130
2242
  return {
2131
2243
  utteranceId: e.speechId,
2132
2244
  characterId: e.characterId,
@@ -2140,13 +2252,13 @@ function rn(e, t = "completed") {
2140
2252
  }
2141
2253
  };
2142
2254
  }
2143
- function an(e) {
2255
+ function _n(e) {
2144
2256
  return e instanceof Error ? e : new Q(String(e));
2145
2257
  }
2146
- function on(e) {
2258
+ function vn(e) {
2147
2259
  return e instanceof DOMException && e.name === "AbortError" || e instanceof Error && e.name === "AbortError";
2148
2260
  }
2149
- var sn = class {
2261
+ var yn = class {
2150
2262
  id;
2151
2263
  characterId;
2152
2264
  result;
@@ -2175,29 +2287,29 @@ var sn = class {
2175
2287
  queue: e.queue,
2176
2288
  ...e.transcript === void 0 ? {} : { transcript: e.transcript }
2177
2289
  }).catch((e) => {
2178
- throw this.fail(an(e)), an(e);
2290
+ throw this.fail(_n(e)), _n(e);
2179
2291
  }), this.signal?.addEventListener("abort", () => {
2180
2292
  this.cancel();
2181
2293
  }, { once: !0 });
2182
2294
  }
2183
2295
  async write(e, t) {
2184
- if (this.closed || this.settled || (await this.beginPromise.catch(() => void 0), this.closed || this.settled)) throw new It();
2185
- let n = Ut(e);
2296
+ if (this.closed || this.settled || (await this.beginPromise.catch(() => void 0), this.closed || this.settled)) throw new Jt();
2297
+ let n = tn(e);
2186
2298
  if (n.byteLength & 1) throw new Q("PCM chunk byte length must be even (complete s16 samples).");
2187
- if (n.byteLength > Pt.MAX_CHUNK_BYTES) throw new Q(`PCM chunk exceeds MAX_CHUNK_BYTES (${Pt.MAX_CHUNK_BYTES}).`);
2299
+ if (n.byteLength > Kt.MAX_CHUNK_BYTES) throw new Q(`PCM chunk exceeds MAX_CHUNK_BYTES (${Kt.MAX_CHUNK_BYTES}).`);
2188
2300
  if (n.byteLength === 0) return;
2189
- let r = t?.timeoutMs ?? Pt.DEFAULT_WRITE_TIMEOUT_MS;
2301
+ let r = t?.timeoutMs ?? Kt.DEFAULT_WRITE_TIMEOUT_MS;
2190
2302
  await this.acquireWriteSlot(r);
2191
2303
  let i = n.byteLength / 2 / this.sampleRate * 1e3;
2192
- if (this.bufferedMs + i > Pt.MAX_UTTERANCE_DURATION_MS) throw this.releaseWriteSlot(), new Q("Utterance exceeds MAX_UTTERANCE_DURATION_MS.");
2304
+ if (this.bufferedMs + i > Kt.MAX_UTTERANCE_DURATION_MS) throw this.releaseWriteSlot(), new Q("Utterance exceeds MAX_UTTERANCE_DURATION_MS.");
2193
2305
  let a = async () => {
2194
- if (this.closed || this.settled) throw new It();
2306
+ if (this.closed || this.settled) throw new Jt();
2195
2307
  let e = this.requireHost(), t = n.slice(), i = e.speechUtteranceWrite({
2196
2308
  utteranceId: this.id,
2197
2309
  audio: t.buffer,
2198
2310
  byteLength: t.byteLength
2199
2311
  }), a = await Promise.race([i, new Promise((e, t) => {
2200
- setTimeout(() => t(new Lt()), r);
2312
+ setTimeout(() => t(new Yt()), r);
2201
2313
  })]);
2202
2314
  this.bufferedMs = Math.max(0, a.bufferedMs);
2203
2315
  }, o = this.writeChain.then(a, a);
@@ -2209,7 +2321,7 @@ var sn = class {
2209
2321
  }
2210
2322
  }
2211
2323
  async setTranscript(e) {
2212
- if (this.closed || this.settled || (await this.beginPromise.catch(() => void 0), this.closed || this.settled)) throw new It();
2324
+ if (this.closed || this.settled || (await this.beginPromise.catch(() => void 0), this.closed || this.settled)) throw new Jt();
2213
2325
  await this.requireHost().speechUtteranceSetTranscript({
2214
2326
  utteranceId: this.id,
2215
2327
  transcript: e
@@ -2226,7 +2338,7 @@ var sn = class {
2226
2338
  });
2227
2339
  return this.resolve(t), t;
2228
2340
  } catch (e) {
2229
- let t = an(e);
2341
+ let t = _n(e);
2230
2342
  throw this.fail(t), t;
2231
2343
  }
2232
2344
  }
@@ -2244,11 +2356,11 @@ var sn = class {
2244
2356
  characterId: this.characterId,
2245
2357
  status: "cancelled",
2246
2358
  durationMs: 0,
2247
- animation: Rt("none")
2359
+ animation: Xt("none")
2248
2360
  };
2249
2361
  return this.resolve(t), t;
2250
2362
  } catch (e) {
2251
- let t = an(e);
2363
+ let t = _n(e);
2252
2364
  throw this.fail(t), t;
2253
2365
  }
2254
2366
  }
@@ -2261,19 +2373,19 @@ var sn = class {
2261
2373
  return e;
2262
2374
  }
2263
2375
  resolve(e) {
2264
- this.settled || (this.settled = !0, this.settleResolve(Object.freeze(e)), this.flushWriteWaiters(new It()));
2376
+ this.settled || (this.settled = !0, this.settleResolve(Object.freeze(e)), this.flushWriteWaiters(new Jt()));
2265
2377
  }
2266
2378
  fail(e) {
2267
2379
  this.settled || (this.settled = !0, this.settleReject(e), this.flushWriteWaiters(e));
2268
2380
  }
2269
2381
  async acquireWriteSlot(e) {
2270
- if (this.pendingWriteCount < Pt.MAX_PENDING_WRITES) {
2382
+ if (this.pendingWriteCount < Kt.MAX_PENDING_WRITES) {
2271
2383
  this.pendingWriteCount += 1;
2272
2384
  return;
2273
2385
  }
2274
2386
  await new Promise((t, n) => {
2275
2387
  let r = setTimeout(() => {
2276
- n(new Lt());
2388
+ n(new Yt());
2277
2389
  }, e);
2278
2390
  this.pendingWriteWaiters.push({
2279
2391
  resolve: () => {
@@ -2292,13 +2404,13 @@ var sn = class {
2292
2404
  for (; this.pendingWriteWaiters.length > 0;) this.pendingWriteWaiters.shift()?.reject(e);
2293
2405
  }
2294
2406
  };
2295
- function cn(e) {
2407
+ function bn(e) {
2296
2408
  let t = null, n = (t, n) => {
2297
- if (!e.getCapabilities()[n]) throw new Ft(t, n);
2409
+ if (!e.getCapabilities()[n]) throw new qt(t, n);
2298
2410
  }, r = {
2299
2411
  async speak(r) {
2300
2412
  if (e.assertSessionStarted(), n("speak", "textSpeech"), r.signal?.aborted) throw new DOMException("Speak aborted.", "AbortError");
2301
- let i = Wt(r.queue ?? "append");
2413
+ let i = nn(r.queue ?? "append");
2302
2414
  i === "interrupt" && (e.onProcessorInterrupt?.(), t &&= (t.cancel(), null));
2303
2415
  let a = e.getIframeHost();
2304
2416
  if (!a) throw new Q("Speech session is not attached.");
@@ -2318,41 +2430,41 @@ function cn(e) {
2318
2430
  return;
2319
2431
  }
2320
2432
  t.addEventListener("abort", s, { once: !0 }), o.then((e) => {
2321
- t.removeEventListener("abort", s), n(rn(e, "completed"));
2433
+ t.removeEventListener("abort", s), n(gn(e, "completed"));
2322
2434
  }, (a) => {
2323
- if (t.removeEventListener("abort", s), on(a)) {
2435
+ if (t.removeEventListener("abort", s), vn(a)) {
2324
2436
  n({
2325
2437
  utteranceId: "utt_interrupted",
2326
2438
  characterId: r.characterId ?? e.getActiveCharacterId(),
2327
2439
  status: "interrupted",
2328
2440
  durationMs: 0,
2329
2441
  transcript: r.text,
2330
- animation: Rt("none")
2442
+ animation: Xt("none")
2331
2443
  });
2332
2444
  return;
2333
2445
  }
2334
- i(an(a));
2446
+ i(_n(a));
2335
2447
  });
2336
2448
  });
2337
2449
  }
2338
2450
  try {
2339
- return rn(await o, "completed");
2451
+ return gn(await o, "completed");
2340
2452
  } catch (t) {
2341
- if (on(t)) return {
2453
+ if (vn(t)) return {
2342
2454
  utteranceId: "utt_interrupted",
2343
2455
  characterId: r.characterId ?? e.getActiveCharacterId(),
2344
2456
  status: "interrupted",
2345
2457
  durationMs: 0,
2346
2458
  transcript: r.text,
2347
- animation: Rt("none")
2459
+ animation: Xt("none")
2348
2460
  };
2349
- throw an(t);
2461
+ throw _n(t);
2350
2462
  }
2351
2463
  },
2352
2464
  async play(i) {
2353
- if (e.assertSessionStarted(), n("play", "externalSpeechAudio"), Vt(i.audio), i.signal?.aborted) throw new DOMException("Play aborted.", "AbortError");
2465
+ if (e.assertSessionStarted(), n("play", "externalSpeechAudio"), $t(i.audio), i.signal?.aborted) throw new DOMException("Play aborted.", "AbortError");
2354
2466
  let a = i.queue ?? "append";
2355
- if ((a === "replace-active" || a === "replace-all") && (e.onProcessorInterrupt?.(), t &&= (t.cancel(), null)), jt(i.audio)) {
2467
+ if ((a === "replace-active" || a === "replace-all") && (e.onProcessorInterrupt?.(), t &&= (t.cancel(), null)), Ut(i.audio)) {
2356
2468
  let e = i.audio.sampleRate ?? 24e3;
2357
2469
  return r.createUtterance({
2358
2470
  format: {
@@ -2368,7 +2480,7 @@ function cn(e) {
2368
2480
  }
2369
2481
  let o = e.getIframeHost();
2370
2482
  if (!o) throw new Q("Speech session is not attached.");
2371
- let s = await tn(i.audio, i.signal);
2483
+ let s = await mn(i.audio, i.signal);
2372
2484
  return o.speechPlay({
2373
2485
  source: s,
2374
2486
  characterId: i.characterId,
@@ -2380,13 +2492,13 @@ function cn(e) {
2380
2492
  },
2381
2493
  createUtterance(r) {
2382
2494
  e.assertSessionStarted(), n("createUtterance", "externalSpeechAudio");
2383
- let i = Ht(r);
2495
+ let i = en(r);
2384
2496
  if (r.track && r.track.kind !== "audio") throw new Q("createUtterance track must be an audio MediaStreamTrack.");
2385
2497
  let a = r.queue ?? "replace-active";
2386
2498
  if (a !== "replace-active" && a !== "replace-all") throw new Q("createUtterance queue must be replace-active or replace-all.");
2387
2499
  e.onProcessorInterrupt?.(), t &&= (t.cancel(), null);
2388
- let o = new sn({
2389
- id: nn(),
2500
+ let o = new yn({
2501
+ id: hn(),
2390
2502
  characterId: r.characterId ?? e.getActiveCharacterId(),
2391
2503
  format: i,
2392
2504
  queue: a,
@@ -2398,7 +2510,7 @@ function cn(e) {
2398
2510
  t === o && (t = null);
2399
2511
  }), r.track && (async () => {
2400
2512
  try {
2401
- if (await en({
2513
+ if (await pn({
2402
2514
  track: r.track,
2403
2515
  utterance: o,
2404
2516
  sampleRate: i.sampleRate,
@@ -2426,16 +2538,16 @@ function cn(e) {
2426
2538
  }
2427
2539
  //#endregion
2428
2540
  //#region src/v2/types/sessionInteraction.ts
2429
- function ln(e) {
2541
+ function xn(e) {
2430
2542
  let t = e?.trim();
2431
2543
  return t === "full" || t === "face" || t === "medium" ? t : void 0;
2432
2544
  }
2433
2545
  //#endregion
2434
2546
  //#region src/v2/experience.ts
2435
- function un(e) {
2547
+ function Sn(e) {
2436
2548
  return !!(e.showClose === !0 || e.returnUrl?.trim() || e.closeButton === !0 || e.closeButton && typeof e.closeButton == "object" && e.closeButton.visible !== !1);
2437
2549
  }
2438
- var dn = class e {
2550
+ var Cn = class e {
2439
2551
  bootstrap;
2440
2552
  conversationProcessor;
2441
2553
  iframeHost = null;
@@ -2449,19 +2561,22 @@ var dn = class e {
2449
2561
  closed = !1;
2450
2562
  attached = !1;
2451
2563
  pendingFit = null;
2564
+ pendingStage = null;
2565
+ pendingPipBackground = null;
2566
+ pendingPipShadow = null;
2452
2567
  lastInteraction = null;
2453
2568
  closeHandlers = [];
2454
- eventRegistry = Tt();
2569
+ eventRegistry = Lt();
2455
2570
  readyEnvelope = null;
2456
2571
  startedEnvelope = null;
2457
2572
  sessionMintedEnvelope = null;
2458
2573
  conversationCache = [];
2459
2574
  speech;
2460
2575
  constructor(e) {
2461
- 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 = cn({
2576
+ 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 = bn({
2462
2577
  getIframeHost: () => this.iframeHost,
2463
2578
  assertSessionStarted: () => this.assertSessionStarted(),
2464
- getCapabilities: () => fn(this.resolvedSession),
2579
+ getCapabilities: () => wn(this.resolvedSession),
2465
2580
  getActiveCharacterId: () => "character_unknown",
2466
2581
  onProcessorInterrupt: () => {
2467
2582
  this.processorAbortController?.abort(), this.processorAbortController = null;
@@ -2544,7 +2659,7 @@ var dn = class e {
2544
2659
  return null;
2545
2660
  }
2546
2661
  on(e, t) {
2547
- let n = Et(this.eventRegistry, e, t);
2662
+ let n = Rt(this.eventRegistry, e, t);
2548
2663
  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;
2549
2664
  }
2550
2665
  async attach(e) {
@@ -2558,13 +2673,13 @@ var dn = class e {
2558
2673
  if (this.closed) throw Error("Session has ended.");
2559
2674
  if (this.attached && this.iframeHost) return this.createPlayerFacade();
2560
2675
  this.iframeHost &&= (this.iframeHost.destroy(), null), this.attachReturnUrl = e.returnUrl?.trim() || null;
2561
- let t = this.bootstrap.embedBaseUrl ?? vt(), n = this.bootstrap.debug === !0, r = this.bootstrap.speechOnly === !0, i = bt(t, n, r ? void 0 : yt(this.bootstrap.backdropId, this.bootstrap.locationId), r ? void 0 : this.bootstrap.avatarId, e.fit, this.bootstrap.ui, un(e), this.bootstrap.kind === "launch" ? void 0 : this.bootstrap.castSize), a = St(i), o = null, s = new Promise((e) => {
2676
+ let t = this.bootstrap.embedBaseUrl ?? At(), n = this.bootstrap.debug === !0, r = this.bootstrap.speechOnly === !0, i = Mt(t, n, r ? void 0 : jt(this.bootstrap.backdropId, this.bootstrap.locationId), r ? void 0 : this.bootstrap.avatarId, e.fit, this.bootstrap.ui, Sn(e), this.bootstrap.kind === "launch" ? void 0 : this.bootstrap.castSize, e.stage, e.pipBackground, e.pipShadow), a = Pt(i), o = null, s = new Promise((e) => {
2562
2677
  o = e;
2563
2678
  }), c = null, l = new Promise((e) => {
2564
2679
  c = e;
2565
- }), u = pt((e) => {
2680
+ }), u = Tt((e) => {
2566
2681
  this.readyEnvelope ||= (this.resolvedSession = e, this.emitWrapped("ready", { session: e }));
2567
- }), d = this.bootstrap.onUserTranscript, f = ft({
2682
+ }), d = this.bootstrap.onUserTranscript, f = wt({
2568
2683
  container: e.container,
2569
2684
  src: i,
2570
2685
  playerOrigin: a,
@@ -2630,7 +2745,7 @@ var dn = class e {
2630
2745
  onWidgetDragEnd: (t) => e.onWidgetDragEnd?.(t)
2631
2746
  });
2632
2747
  this.iframeHost = f;
2633
- let p = this.resolveMintInteraction(), m = this.bootstrap.kind === "sessionEndpoint" ? (this.endpointAbortController = new AbortController(), We(this.bootstrap.sessionEndpoint, {
2748
+ let p = this.resolveMintInteraction(), m = this.bootstrap.kind === "sessionEndpoint" ? (this.endpointAbortController = new AbortController(), nt(this.bootstrap.sessionEndpoint, {
2634
2749
  experienceId: this.bootstrap.experienceId,
2635
2750
  locale: this.bootstrap.locale,
2636
2751
  secondaryLocale: this.bootstrap.secondaryLocale,
@@ -2642,7 +2757,7 @@ var dn = class e {
2642
2757
  attribution: this.bootstrap.attribution,
2643
2758
  alreadyConverted: this.bootstrap.alreadyConverted,
2644
2759
  signal: this.endpointAbortController.signal
2645
- })) : this.bootstrap.kind === "public" ? Ue(this.bootstrap.experienceId, {
2760
+ })) : this.bootstrap.kind === "public" ? tt(this.bootstrap.experienceId, {
2646
2761
  locale: this.bootstrap.locale,
2647
2762
  secondaryLocale: this.bootstrap.secondaryLocale,
2648
2763
  learningLocale: this.bootstrap.learningLocale,
@@ -2666,7 +2781,7 @@ var dn = class e {
2666
2781
  operation: "attach",
2667
2782
  message: e instanceof Error ? e.message : String(e),
2668
2783
  stack: e instanceof Error ? e.stack : void 0,
2669
- release: mt
2784
+ release: Et
2670
2785
  });
2671
2786
  } catch {}
2672
2787
  throw f.destroy(), this.iframeHost === f && (this.iframeHost = null), e;
@@ -2678,14 +2793,16 @@ var dn = class e {
2678
2793
  if (!g) throw f.destroy(), this.iframeHost === f && (this.iframeHost = null), Error("Session Launch response did not include a launch token.");
2679
2794
  this.launchToken = g;
2680
2795
  let v = _ ?? (this.bootstrap.kind === "launch" ? this.bootstrap.session : void 0);
2681
- return v && !this.sessionMintedEnvelope && (this.resolvedSession = v, this.sessionMintedEnvelope = this.emitWrapped("sessionMinted", { session: v })), _ ? (this.resolvedSession = _, this.bootstrap.kind === "launch" && Fe(_), f.postLaunch(g, _, {
2796
+ return v && !this.sessionMintedEnvelope && (this.resolvedSession = v, this.sessionMintedEnvelope = this.emitWrapped("sessionMinted", { session: v })), _ ? (this.resolvedSession = _, this.bootstrap.kind === "launch" && qe(_), f.postLaunch(g, _, {
2682
2797
  startButton: e.startButton,
2683
2798
  theme: e.theme,
2684
- showFeedback: e.showFeedback
2799
+ showFeedback: e.showFeedback,
2800
+ interaction: e.interaction
2685
2801
  }), u.setValue(_)) : f.postLaunch(g, void 0, {
2686
2802
  startButton: e.startButton,
2687
2803
  theme: e.theme,
2688
- showFeedback: e.showFeedback
2804
+ showFeedback: e.showFeedback,
2805
+ interaction: e.interaction
2689
2806
  }), await Promise.race([s, new Promise((e, t) => {
2690
2807
  setTimeout(() => t(/* @__PURE__ */ Error("Timed out waiting for player loading UI.")), 12e4);
2691
2808
  })]).catch((e) => {
@@ -2696,7 +2813,7 @@ var dn = class e {
2696
2813
  operation: "attach",
2697
2814
  message: e instanceof Error ? e.message : String(e),
2698
2815
  stack: e instanceof Error ? e.stack : void 0,
2699
- release: mt
2816
+ release: Et
2700
2817
  });
2701
2818
  } catch {}
2702
2819
  throw e;
@@ -2710,11 +2827,11 @@ var dn = class e {
2710
2827
  operation: "attach",
2711
2828
  message: e instanceof Error ? e.message : String(e),
2712
2829
  stack: e instanceof Error ? e.stack : void 0,
2713
- release: mt
2830
+ release: Et
2714
2831
  });
2715
2832
  } catch {}
2716
2833
  throw e;
2717
- }), this.attached = !0, this.pendingFit && await f.setFit(this.pendingFit), this.createPlayerFacade();
2834
+ }), this.attached = !0, this.pendingFit && await f.setFit(this.pendingFit), this.pendingStage && await f.setStage(this.pendingStage), this.pendingPipBackground && await f.setPipBackground(this.pendingPipBackground), this.pendingPipShadow !== null && await f.setPipShadow(this.pendingPipShadow), this.createPlayerFacade();
2718
2835
  }
2719
2836
  async startListening() {
2720
2837
  this.assertSessionStarted(), await this.iframeHost.startListening();
@@ -2738,11 +2855,25 @@ var dn = class e {
2738
2855
  this.assertSessionStarted(), await this.iframeHost.focusCharacter(e);
2739
2856
  }
2740
2857
  async setFit(e) {
2741
- let t = ln(e);
2858
+ let t = xn(e);
2742
2859
  if (!t) throw Error("setFit requires \"full\", \"medium\", or \"face\".");
2743
2860
  if (this.closed) throw Error("Session has ended.");
2744
2861
  this.pendingFit = t, !(!this.attached || !this.iframeHost) && await this.iframeHost.setFit(t);
2745
2862
  }
2863
+ async setStage(e) {
2864
+ if (e !== "fill" && e !== "pip") throw Error("setStage requires \"fill\" or \"pip\".");
2865
+ if (this.closed) throw Error("Session has ended.");
2866
+ this.pendingStage = e, !(!this.attached || !this.iframeHost) && await this.iframeHost.setStage(e);
2867
+ }
2868
+ async setPipBackground(e) {
2869
+ if (e !== "none" && e !== "set") throw Error("setPipBackground requires \"none\" or \"set\".");
2870
+ if (this.closed) throw Error("Session has ended.");
2871
+ this.pendingPipBackground = e, !(!this.attached || !this.iframeHost) && await this.iframeHost.setPipBackground(e);
2872
+ }
2873
+ async setPipShadow(e) {
2874
+ if (this.closed) throw Error("Session has ended.");
2875
+ this.pendingPipShadow = e, !(!this.attached || !this.iframeHost) && await this.iframeHost.setPipShadow(e);
2876
+ }
2746
2877
  async setInteraction(e) {
2747
2878
  if (this.closed) throw Error("Session has ended.");
2748
2879
  if (!this.iframeHost) throw Error("setInteraction() requires attach() first.");
@@ -2774,7 +2905,7 @@ var dn = class e {
2774
2905
  this.close();
2775
2906
  }
2776
2907
  destroy() {
2777
- 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, Ot(this.eventRegistry), this.readyEnvelope = null, this.startedEnvelope = null, this.closeHandlers.length = 0, this.lastInteraction = null, this.attached = !1);
2908
+ 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, Bt(this.eventRegistry), this.readyEnvelope = null, this.startedEnvelope = null, this.closeHandlers.length = 0, this.lastInteraction = null, this.attached = !1);
2778
2909
  }
2779
2910
  resolveMintInteraction() {
2780
2911
  return this.bootstrap.kind === "launch" ? {} : {
@@ -2786,8 +2917,8 @@ var dn = class e {
2786
2917
  return this.resolvedSession?.id ?? "";
2787
2918
  }
2788
2919
  emitWrapped(e, t) {
2789
- let n = wt(e, this.getSessionId(), t);
2790
- return Dt(this.eventRegistry, e, n), n;
2920
+ let n = It(e, this.getSessionId(), t);
2921
+ return zt(this.eventRegistry, e, n), n;
2791
2922
  }
2792
2923
  queueProcessorTurn(e) {
2793
2924
  if (!e.isFinal || !e.text.trim() || !this.conversationProcessor) return;
@@ -2796,7 +2927,7 @@ var dn = class e {
2796
2927
  let n = this.processorAbortController.signal;
2797
2928
  this.processorChain = this.processorChain.then(async () => {
2798
2929
  if (!n.aborted) try {
2799
- let r = await qe(t, {
2930
+ let r = await at(t, {
2800
2931
  utteranceId: e.utteranceId,
2801
2932
  text: e.text,
2802
2933
  conversation: this.conversationCache,
@@ -2846,7 +2977,7 @@ var dn = class e {
2846
2977
  };
2847
2978
  }
2848
2979
  };
2849
- function fn(e) {
2980
+ function wn(e) {
2850
2981
  return e ? {
2851
2982
  textSpeech: e.capabilities.speech.output,
2852
2983
  externalSpeechAudio: e.capabilities.speech.externalAudio
@@ -2857,41 +2988,41 @@ function fn(e) {
2857
2988
  }
2858
2989
  //#endregion
2859
2990
  //#region src/widget/dockGeometry.ts
2860
- var pn = "(min-width: 768px)", mn = 24, hn = .5, gn = 1200, _n = .85, vn = 9 / 16;
2861
- function yn() {
2991
+ var Tn = "(min-width: 768px)", En = 24, Dn = .5, On = 1200, kn = .85, An = 9 / 16;
2992
+ function jn() {
2862
2993
  if (typeof window > "u") return 800;
2863
2994
  let e = window.screen?.availHeight;
2864
2995
  return typeof e == "number" && e > 0 ? e : window.innerHeight;
2865
2996
  }
2866
- function bn(e = typeof window < "u" ? window.innerWidth : 1280, t = typeof window < "u" ? window.innerHeight : 800, n = mn, r = typeof window < "u" ? yn() : 800) {
2867
- let i = Math.max(160, Math.min(t - n * 2, t * _n)), a = Math.max(120, e - n * 2), o = Math.min(r * hn, gn, i), s = o * vn;
2868
- return s > a && (s = a, o = s / vn, o > i && (o = i, s = o * vn)), {
2997
+ function Mn(e = typeof window < "u" ? window.innerWidth : 1280, t = typeof window < "u" ? window.innerHeight : 800, n = En, r = typeof window < "u" ? jn() : 800) {
2998
+ let i = Math.max(160, Math.min(t - n * 2, t * kn)), a = Math.max(120, e - n * 2), o = Math.min(r * Dn, On, i), s = o * An;
2999
+ return s > a && (s = a, o = s / An, o > i && (o = i, s = o * An)), {
2869
3000
  width: Math.round(s),
2870
3001
  height: Math.round(o)
2871
3002
  };
2872
3003
  }
2873
- function xn(e, t = typeof window < "u" ? window.innerWidth : 1280, n = typeof window < "u" ? window.innerHeight : 800, r = mn) {
3004
+ function Nn(e, t = typeof window < "u" ? window.innerWidth : 1280, n = typeof window < "u" ? window.innerHeight : 800, r = En) {
2874
3005
  return {
2875
3006
  left: Math.max(r, t - e.width - r),
2876
3007
  top: Math.max(r, n - e.height - r)
2877
3008
  };
2878
3009
  }
2879
- function Sn(e, t, n, r = typeof window < "u" ? window.innerWidth : 1280, i = typeof window < "u" ? window.innerHeight : 800, a = mn) {
3010
+ function Pn(e, t, n, r = typeof window < "u" ? window.innerWidth : 1280, i = typeof window < "u" ? window.innerHeight : 800, a = En) {
2880
3011
  let o = Math.max(a, r - n.width - a), s = Math.max(a, i - n.height - a);
2881
3012
  return {
2882
3013
  left: Math.min(Math.max(a, e), o),
2883
3014
  top: Math.min(Math.max(a, t), s)
2884
3015
  };
2885
3016
  }
2886
- function Cn(e = typeof window < "u" ? window.matchMedia.bind(window) : () => ({ matches: !0 })) {
2887
- return e(pn).matches;
3017
+ function Fn(e = typeof window < "u" ? window.matchMedia.bind(window) : () => ({ matches: !0 })) {
3018
+ return e(Tn).matches;
2888
3019
  }
2889
3020
  //#endregion
2890
3021
  //#region src/widget/mountExperienceWidget.ts
2891
- function wn(e) {
3022
+ function In(e) {
2892
3023
  return e === "bottom-right" || e === "bottom-left" ? e : "static";
2893
3024
  }
2894
- function Tn(e) {
3025
+ function Ln(e) {
2895
3026
  if (typeof e == "number" && Number.isFinite(e)) return `${e}px`;
2896
3027
  let t = typeof e == "string" ? e.trim() : "";
2897
3028
  return t ? /^\d+(\.\d+)?$/.test(t) ? `${t}px` : t : "16px";
@@ -2899,10 +3030,10 @@ function Tn(e) {
2899
3030
  function $(e) {
2900
3031
  return e === "expanded" || e === "docked";
2901
3032
  }
2902
- var En = "<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>", Dn = "<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>", On = "<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>", kn = "<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>";
2903
- function An(e, t, n) {
2904
- W(de);
2905
- let r = w({
3033
+ var Rn = "<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>", zn = "<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>", Bn = "<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>", Vn = "<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>";
3034
+ function Hn(e, t, n) {
3035
+ Se(be);
3036
+ let r = F({
2906
3037
  galleryThumb: t.galleryThumb,
2907
3038
  avatarImage: t.avatarImage,
2908
3039
  backgroundImage: t.backgroundImage,
@@ -2928,9 +3059,9 @@ function An(e, t, n) {
2928
3059
  let e = document.createElement("img");
2929
3060
  e.className = "liforma-et__foreground liforma-et__media", e.alt = "", e.decoding = "async", e.src = r.foregroundImage, e.addEventListener("load", () => o(e), { once: !0 }), i.append(e);
2930
3061
  }
2931
- return e.replaceChildren(i), n?.parallax === !1 ? () => {} : ue(i);
3062
+ return e.replaceChildren(i), n?.parallax === !1 ? () => {} : ye(i);
2932
3063
  }
2933
- function jn(e) {
3064
+ function Un(e) {
2934
3065
  return e.startButton ? {
2935
3066
  ...e.startButton,
2936
3067
  label: e.startButton.label ?? e.startButtonLabel ?? "Tap to talk",
@@ -2942,7 +3073,7 @@ function jn(e) {
2942
3073
  variant: "primary"
2943
3074
  };
2944
3075
  }
2945
- function Mn(e) {
3076
+ function Wn(e) {
2946
3077
  let t = !1, n = () => {
2947
3078
  t || e();
2948
3079
  }, r = () => {
@@ -2962,12 +3093,12 @@ function Mn(e) {
2962
3093
  t = !0, window.removeEventListener("load", r), i?.();
2963
3094
  };
2964
3095
  }
2965
- function Nn(e, t) {
2966
- he(me);
3096
+ function Gn(e, t) {
3097
+ De(Te);
2967
3098
  let n = t.experienceId?.trim();
2968
3099
  if (!n) throw Error("ExperienceWidget requires experienceId.");
2969
- let r = t.prefetch ?? "onExpand", i = wn(t.position), a = document.createElement("div");
2970
- 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", Tn(t.offset));
3100
+ let r = t.prefetch ?? "onExpand", i = In(t.position), a = document.createElement("div");
3101
+ 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", Ln(t.offset));
2971
3102
  let o = document.createElement("button");
2972
3103
  o.type = "button", o.className = "liforma-ew__hit", o.setAttribute("aria-label", t.alt), o.disabled = !0;
2973
3104
  let s = document.createElement("div");
@@ -2987,22 +3118,22 @@ function Nn(e, t) {
2987
3118
  let m = document.createElement("span");
2988
3119
  m.className = "liforma-ew__drag-grip", m.setAttribute("aria-hidden", "true");
2989
3120
  let h = document.createElement("button");
2990
- h.type = "button", h.className = "liforma-ew__icon-btn liforma-ew__dock-toggle", h.innerHTML = On, h.setAttribute("aria-label", "Reduce");
3121
+ h.type = "button", h.className = "liforma-ew__icon-btn liforma-ew__dock-toggle", h.innerHTML = Bn, h.setAttribute("aria-label", "Reduce");
2991
3122
  let g = document.createElement("button");
2992
- g.type = "button", g.className = "liforma-ew__icon-btn liforma-ew__settings", g.innerHTML = En, g.setAttribute("aria-label", "Audio settings"), g.setAttribute("aria-pressed", "false");
3123
+ g.type = "button", g.className = "liforma-ew__icon-btn liforma-ew__settings", g.innerHTML = Rn, g.setAttribute("aria-label", "Audio settings"), g.setAttribute("aria-pressed", "false");
2993
3124
  let _ = document.createElement("button");
2994
- _.type = "button", _.className = "liforma-ew__icon-btn liforma-ew__close", _.innerHTML = Dn, _.setAttribute("aria-label", "Close"), p.append(m, h, g, _);
3125
+ _.type = "button", _.className = "liforma-ew__icon-btn liforma-ew__close", _.innerHTML = zn, _.setAttribute("aria-label", "Close"), p.append(m, h, g, _);
2995
3126
  let v = document.createElement("div");
2996
3127
  v.className = "liforma-ew__stage";
2997
3128
  let y = document.createElement("div");
2998
3129
  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);
2999
- 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, ne = 0, I = null, L = !1, re = new AbortController(), ie = t.parallax !== !1, R = () => {
3130
+ let b = null, x = !1, S = !1, C = !1, w = !1, T = !1, E = !1, D = !1, O = 0, k = "", A = null, j = null, M = null, ee = null, N = null, P = null, F = null, te = 0, I = 0, L = null, ne = !1, re = new AbortController(), ie = t.parallax !== !1, R = () => {
3000
3131
  let e = a.dataset.state;
3001
3132
  return e === "expanded" || e === "docked" || e === "collapsed" ? e : "collapsed";
3002
3133
  }, z = () => {
3003
- j !== null && (clearTimeout(j), j = null);
3134
+ M !== null && (clearTimeout(M), M = null);
3004
3135
  }, B = () => {
3005
- M !== null && (clearTimeout(M), M = null), a.classList.remove("liforma-ew--layout-settling");
3136
+ ee !== null && (clearTimeout(ee), ee = null), a.classList.remove("liforma-ew--layout-settling");
3006
3137
  }, ae = () => {
3007
3138
  for (let e of [
3008
3139
  f,
@@ -3010,207 +3141,210 @@ function Nn(e, t) {
3010
3141
  p
3011
3142
  ]) e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("width"), e.style.removeProperty("height"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
3012
3143
  p.classList.remove("liforma-ew__toolbar--dragging"), a.classList.remove("liforma-ew--dock-dragging");
3013
- }, V = (e, t, n, r) => {
3144
+ }, oe = (e, t, n, r) => {
3014
3145
  let i = (i) => {
3015
3146
  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";
3016
3147
  };
3017
3148
  i(f), i(l);
3018
3149
  let a = p.offsetWidth || 120;
3019
3150
  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";
3020
- }, oe = (e, t) => {
3021
- if (R() !== "docked") return;
3022
- let n = bn(), r = Sn(e - te, t - ne, n);
3023
- N = r.left, P = r.top, V(r.left, r.top, n.width, n.height);
3024
3151
  }, se = (e, t) => {
3152
+ if (R() !== "docked") return;
3153
+ let n = Mn(), r = Pn(e - te, t - I, n);
3154
+ N = r.left, P = r.top, oe(r.left, r.top, n.width, n.height);
3155
+ }, ce = (e, t) => {
3025
3156
  if (R() !== "docked" || !Number.isFinite(e) || !Number.isFinite(t) || e === 0 && t === 0) return;
3026
- let n = bn(), r = N ?? f.getBoundingClientRect().left, i = P ?? f.getBoundingClientRect().top, a = Sn(r + e, i + t, n);
3027
- N = a.left, P = a.top, V(a.left, a.top, n.width, n.height);
3028
- }, ce = (e) => {
3029
- I === "toolbar" && (F === null || e.pointerId !== F || (e.preventDefault(), oe(e.clientX, e.clientY)));
3030
- }, H = (e) => {
3157
+ let n = Mn(), r = N ?? f.getBoundingClientRect().left, i = P ?? f.getBoundingClientRect().top, a = Pn(r + e, i + t, n);
3158
+ N = a.left, P = a.top, oe(a.left, a.top, n.width, n.height);
3159
+ }, le = (e) => {
3160
+ L === "toolbar" && (F === null || e.pointerId !== F || (e.preventDefault(), se(e.clientX, e.clientY)));
3161
+ }, V = (e) => {
3031
3162
  if (F === null || e && e.pointerId !== F) return;
3032
- let t = I;
3033
- F = null, I = null, p.classList.remove("liforma-ew__toolbar--dragging"), a.classList.remove("liforma-ew--dock-dragging"), t === "toolbar" && L && (L = !1, window.removeEventListener("pointermove", ce), window.removeEventListener("pointerup", H), window.removeEventListener("pointercancel", H));
3034
- }, le = (e, t, n) => {
3035
- if (S || R() !== "docked" || !Cn() || F !== null) return;
3036
- F = n, I = "toolbar", p.classList.add("liforma-ew__toolbar--dragging"), a.classList.add("liforma-ew--dock-dragging");
3163
+ let t = L;
3164
+ 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", le), window.removeEventListener("pointerup", V), window.removeEventListener("pointercancel", V));
3165
+ }, ue = (e, t, n) => {
3166
+ if (S || R() !== "docked" || !Fn() || F !== null) return;
3167
+ F = n, L = "toolbar", p.classList.add("liforma-ew__toolbar--dragging"), a.classList.add("liforma-ew--dock-dragging");
3037
3168
  let r = f.getBoundingClientRect();
3038
- te = e - r.left, ne = t - r.top, L || (L = !0, window.addEventListener("pointermove", ce), window.addEventListener("pointerup", H), window.addEventListener("pointercancel", H));
3039
- }, ue = (e) => {
3040
- if (S || R() !== "docked" || !Cn() || F !== null) return;
3041
- F = e.pointerId, I = "player", p.classList.add("liforma-ew__toolbar--dragging"), a.classList.add("liforma-ew--dock-dragging");
3169
+ te = e - r.left, I = t - r.top, ne || (ne = !0, window.addEventListener("pointermove", le), window.addEventListener("pointerup", V), window.addEventListener("pointercancel", V));
3170
+ }, de = (e) => {
3171
+ if (S || R() !== "docked" || !Fn() || F !== null) return;
3172
+ F = e.pointerId, L = "player", p.classList.add("liforma-ew__toolbar--dragging"), a.classList.add("liforma-ew--dock-dragging");
3042
3173
  let t = f.getBoundingClientRect();
3043
3174
  N = t.left, P = t.top;
3044
- }, de = (e) => {
3045
- I === "player" && (F === null || e.pointerId !== F || se(e.dx, e.dy));
3046
- }, U = (e) => {
3047
- I === "player" && (F === null || e.pointerId !== F || H());
3048
- }, W = () => {
3049
- let e = Cn(), t = R();
3175
+ }, fe = (e) => {
3176
+ L === "player" && (F === null || e.pointerId !== F || ce(e.dx, e.dy));
3177
+ }, pe = (e) => {
3178
+ L === "player" && (F === null || e.pointerId !== F || V());
3179
+ }, H = () => {
3180
+ let e = Fn(), t = R();
3050
3181
  if (!e || t !== "expanded" && t !== "docked") {
3051
3182
  h.hidden = !0;
3052
3183
  return;
3053
3184
  }
3054
- h.hidden = !1, t === "docked" ? (h.innerHTML = kn, h.setAttribute("aria-label", "Maximize")) : (h.innerHTML = On, h.setAttribute("aria-label", "Reduce"));
3055
- }, fe = (e) => {
3056
- let t = bn(), n = e && N !== null && P !== null ? Sn(N, P, t) : xn(t);
3057
- n = Sn(n.left, n.top, t), N = n.left, P = n.top, V(n.left, n.top, t.width, t.height), W();
3058
- }, pe = () => {
3185
+ h.hidden = !1, t === "docked" ? (h.innerHTML = Vn, h.setAttribute("aria-label", "Maximize")) : (h.innerHTML = Bn, h.setAttribute("aria-label", "Reduce"));
3186
+ }, me = (e) => {
3187
+ let t = Mn(), n = e && N !== null && P !== null ? Pn(N, P, t) : Nn(t);
3188
+ n = Pn(n.left, n.top, t), N = n.left, P = n.top, oe(n.left, n.top, t.width, t.height), H();
3189
+ }, U = () => {
3059
3190
  a.classList.remove("liforma-ew--session-revealed"), requestAnimationFrame(() => {
3060
3191
  requestAnimationFrame(() => {
3061
3192
  S || !$(a.dataset.state) || a.classList.add("liforma-ew--session-revealed");
3062
3193
  });
3063
3194
  });
3064
- }, G = (e) => {
3195
+ }, W = (e) => {
3065
3196
  if (B(), a.classList.remove("liforma-ew--session-revealed"), a.classList.add("liforma-ew--layout-settling"), e(), !D) {
3066
3197
  a.classList.remove("liforma-ew--layout-settling");
3067
3198
  return;
3068
3199
  }
3069
- M = setTimeout(() => {
3070
- if (M = null, S || !$(a.dataset.state)) {
3200
+ ee = setTimeout(() => {
3201
+ if (ee = null, S || !$(a.dataset.state)) {
3071
3202
  a.classList.remove("liforma-ew--layout-settling");
3072
3203
  return;
3073
3204
  }
3074
- a.classList.remove("liforma-ew--layout-settling"), pe();
3205
+ a.classList.remove("liforma-ew--layout-settling"), U();
3075
3206
  }, 220);
3076
- }, ge = () => (a.classList.add("liforma-ew--session-concealing"), a.classList.remove("liforma-ew--session-revealed"), new Promise((e) => {
3077
- z(), j = setTimeout(() => {
3078
- j = null, a.classList.remove("liforma-ew--session-concealing"), e();
3207
+ }, he = () => (a.classList.add("liforma-ew--session-concealing"), a.classList.remove("liforma-ew--session-revealed"), new Promise((e) => {
3208
+ z(), M = setTimeout(() => {
3209
+ M = null, a.classList.remove("liforma-ew--session-concealing"), e();
3079
3210
  }, 280);
3080
- })), _e = {
3211
+ })), ge = {
3081
3212
  galleryThumb: t.galleryThumb,
3082
3213
  avatarImage: t.avatarImage,
3083
3214
  backgroundImage: t.backgroundImage,
3084
3215
  foregroundImage: t.foregroundImage,
3085
3216
  fallbackImage: t.fallbackImage
3086
- }, K = (e) => {
3217
+ }, G = (e) => {
3087
3218
  if (!e) {
3088
3219
  y.hidden = !0, y.textContent = "";
3089
3220
  return;
3090
3221
  }
3091
3222
  y.hidden = !1, y.textContent = e;
3092
- }, ve = (e) => {
3223
+ }, _e = (e) => {
3093
3224
  if (!e) {
3094
3225
  c.hidden = !0, c.textContent = "";
3095
3226
  return;
3096
3227
  }
3097
3228
  c.hidden = !1, c.textContent = e, s.contains(c) || s.append(c);
3229
+ }, ve = () => {
3230
+ C = !0, o.disabled = !1, _e(null), r === "onExpand" && t.onPrefetchReady?.();
3098
3231
  }, ye = () => {
3099
- C = !0, o.disabled = !1, ve(null), r === "onExpand" && t.onPrefetchReady?.();
3100
- }, q = () => {
3101
3232
  w = !0, a.dataset.warm = "true", l.hidden = !1, D || (o.tabIndex = -1, o.setAttribute("aria-hidden", "true")), t.onPrefetchReady?.();
3102
- }, xe = (e) => {
3233
+ }, be = (e) => {
3103
3234
  A?.(), A = null;
3104
- let t = An(s, e, { parallax: ie });
3235
+ let t = Hn(s, e, { parallax: ie });
3105
3236
  return t ? (A = t, !0) : !1;
3106
- }, Se = () => {
3107
- if (xe(_e)) {
3108
- ye();
3237
+ }, xe = () => {
3238
+ if (be(ge)) {
3239
+ ve();
3109
3240
  return;
3110
3241
  }
3111
- ve("Loading…"), be(n, { signal: re.signal }).then((e) => {
3242
+ _e("Loading…"), Me(n, { signal: re.signal }).then((e) => {
3112
3243
  if (!S) {
3113
- if (!xe({ galleryThumb: e.galleryThumb })) throw Error("Experience preview is missing gallery thumb images.");
3114
- ye();
3244
+ if (!be({ galleryThumb: e.galleryThumb })) throw Error("Experience preview is missing gallery thumb images.");
3245
+ ve();
3115
3246
  }
3116
3247
  }).catch((e) => {
3117
3248
  if (S || re.signal.aborted) return;
3118
3249
  let n = e instanceof Error ? e : Error(String(e));
3119
- ve("Preview unavailable"), o.disabled = !0, t.onError?.(n), console.error("[ExperienceWidget]", n);
3250
+ _e("Preview unavailable"), o.disabled = !0, t.onError?.(n), console.error("[ExperienceWidget]", n);
3120
3251
  });
3121
- }, Ce = () => ({
3252
+ }, Se = () => ({
3122
3253
  experienceId: n,
3123
3254
  ui: "widget",
3124
3255
  ...t.sessionEndpoint ? { sessionEndpoint: t.sessionEndpoint } : {},
3125
3256
  ...t.locale ? { locale: t.locale } : {},
3257
+ ...t.secondaryLocale ? { secondaryLocale: t.secondaryLocale } : {},
3258
+ ...t.learningLocale ? { learningLocale: t.learningLocale } : {},
3126
3259
  ...t.language ? { language: t.language } : {},
3127
3260
  ...t.mode ? { mode: t.mode } : {},
3128
3261
  ...t.speechInputMode ? { speechInputMode: t.speechInputMode } : {},
3129
3262
  ...t.speechOnly === void 0 ? {} : { speechOnly: t.speechOnly },
3130
3263
  ...t.alreadyConverted?.length ? { alreadyConverted: t.alreadyConverted } : {},
3131
3264
  ...t.embedBaseUrl ? { embedBaseUrl: t.embedBaseUrl } : {}
3132
- }), we = () => ({
3265
+ }), Ce = () => ({
3133
3266
  ...t.fit ? { fit: t.fit } : {},
3134
- startButton: jn(t),
3135
- ...t.showFeedback === void 0 ? {} : { showFeedback: t.showFeedback }
3136
- }), J = (e = !0) => {
3137
- o.hidden = !0, u.hidden = !1, p.hidden = !1, u.setAttribute("aria-modal", "true"), ae(), a.dataset.state = "expanded", K(null), typeof document < "u" && (k = document.body.style.overflow, document.body.style.overflow = "hidden"), W(), e && t.onExpanded?.();
3138
- }, Te = () => {
3139
- o.hidden = !0, u.hidden = !1, p.hidden = !1, u.setAttribute("aria-modal", "false"), a.dataset.state = "docked", K(null), typeof document < "u" && (document.body.style.overflow = k), fe(!0), W(), b?.setWidgetChrome("docked");
3140
- }, Ee = (e) => {
3267
+ startButton: Un(t),
3268
+ ...t.showFeedback === void 0 ? {} : { showFeedback: t.showFeedback },
3269
+ ...t.interaction ? { interaction: t.interaction } : {}
3270
+ }), we = (e = !0) => {
3271
+ o.hidden = !0, u.hidden = !1, p.hidden = !1, u.setAttribute("aria-modal", "true"), ae(), a.dataset.state = "expanded", G(null), typeof document < "u" && (k = document.body.style.overflow, document.body.style.overflow = "hidden"), H(), e && t.onExpanded?.();
3272
+ }, Ee = () => {
3273
+ o.hidden = !0, u.hidden = !1, p.hidden = !1, u.setAttribute("aria-modal", "false"), a.dataset.state = "docked", G(null), typeof document < "u" && (document.body.style.overflow = k), me(!0), H(), b?.setWidgetChrome("docked");
3274
+ }, Oe = (e) => {
3141
3275
  e.on("started", () => {
3142
- S || (D = !0, a.dataset.live = "true", K(null), t.onStarted?.(), $(a.dataset.state) && pe());
3276
+ S || (D = !0, a.dataset.live = "true", G(null), t.onStarted?.(), $(a.dataset.state) && U());
3143
3277
  }), e.on("feedback", (e) => {
3144
3278
  S || t.onFeedback?.(e);
3145
3279
  }), e.on("feedbackFailed", (e) => {
3146
3280
  S || t.onFeedbackFailed?.(e);
3147
3281
  });
3148
- }, De = () => {
3149
- B(), u.hidden = !0, p.hidden = !0, ae(), 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), K(null), typeof document < "u" && (document.body.style.overflow = k), W();
3150
- }, Oe = () => {
3282
+ }, ke = () => {
3283
+ B(), u.hidden = !0, p.hidden = !0, ae(), 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), G(null), typeof document < "u" && (document.body.style.overflow = k), H();
3284
+ }, Ae = () => {
3151
3285
  z(), B(), O += 1, x = !1, w = !1, T = !1, E = !1, D = !1;
3152
3286
  let e = b;
3153
3287
  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");
3154
- }, ke = () => {
3288
+ }, K = () => {
3155
3289
  if (!S && $(a.dataset.state)) {
3156
- if (H(), x = !1, b && E) {
3290
+ if (V(), x = !1, b && E) {
3157
3291
  let e = b;
3158
3292
  (async () => {
3159
- D && (await ge(), S || b !== e) || (w && e.setWidgetChrome("collapsed"), De(), D ? (a.dataset.live = "true", o.tabIndex = 0, o.removeAttribute("aria-hidden"), o.disabled = !1) : w && q(), t.onCollapsed?.(), t.onClose?.());
3293
+ D && (await he(), S || b !== e) || (w && e.setWidgetChrome("collapsed"), ke(), D ? (a.dataset.live = "true", o.tabIndex = 0, o.removeAttribute("aria-hidden"), o.disabled = !1) : w && ye(), t.onCollapsed?.(), t.onClose?.());
3160
3294
  })();
3161
3295
  return;
3162
3296
  }
3163
- Oe(), De(), t.onCollapsed?.(), t.onClose?.();
3297
+ Ae(), ke(), t.onCollapsed?.(), t.onClose?.();
3164
3298
  }
3165
- }, Y = () => {
3166
- S || Cn() && R() === "expanded" && G(() => {
3167
- Te();
3299
+ }, je = () => {
3300
+ S || Fn() && R() === "expanded" && W(() => {
3301
+ Ee();
3168
3302
  });
3169
- }, X = () => {
3170
- S || R() === "docked" && (H(), G(() => {
3171
- ae(), J(!1), b?.setWidgetChrome("expanded");
3303
+ }, q = () => {
3304
+ S || R() === "docked" && (V(), W(() => {
3305
+ ae(), we(!1), b?.setWidgetChrome("expanded");
3172
3306
  }));
3173
- }, Ae = () => {
3174
- !b || !D || (z(), a.classList.remove("liforma-ew--session-revealed"), J(), b.setWidgetChrome("expanded"), x = !1, pe());
3175
- }, je = () => {
3176
- !b || !E || D || (z(), a.classList.remove("liforma-ew--session-revealed"), J(), x = !1, w || b.setWidgetChrome("expanded"));
3177
- }, Me = (e) => {
3178
- S || e !== O && !D || (z(), a.classList.remove("liforma-ew--session-revealed"), J(), x = !1, D && pe());
3179
3307
  }, Ne = () => {
3308
+ !b || !D || (z(), a.classList.remove("liforma-ew--session-revealed"), we(), b.setWidgetChrome("expanded"), x = !1, U());
3309
+ }, Pe = () => {
3310
+ !b || !E || D || (z(), a.classList.remove("liforma-ew--session-revealed"), we(), x = !1, w || b.setWidgetChrome("expanded"));
3311
+ }, Fe = (e) => {
3312
+ S || e !== O && !D || (z(), a.classList.remove("liforma-ew--session-revealed"), we(), x = !1, D && U());
3313
+ }, Ie = () => {
3180
3314
  if (S || T || w || b || $(a.dataset.state)) return;
3181
3315
  T = !0;
3182
3316
  let e = O;
3183
3317
  l.hidden = !1, (async () => {
3184
3318
  try {
3185
- let t = await dn.startSession(Ce());
3319
+ let t = await Cn.startSession(Se());
3186
3320
  if (S || e !== O) {
3187
3321
  t.destroy();
3188
3322
  return;
3189
3323
  }
3190
- b = t, Ee(t);
3324
+ b = t, Oe(t);
3191
3325
  let n = await t.attach({
3192
3326
  container: l,
3193
- ...we(),
3327
+ ...Ce(),
3194
3328
  onWidgetReady: () => {
3195
- S || e !== O || (T = !1, E = !0, $(a.dataset.state) ? t.setWidgetChrome("expanded") : q());
3329
+ S || e !== O || (T = !1, E = !0, $(a.dataset.state) ? t.setWidgetChrome("expanded") : ye());
3196
3330
  },
3197
3331
  onWidgetExpand: () => {
3198
- Me(e);
3332
+ Fe(e);
3199
3333
  },
3200
3334
  onWidgetAudioSettings: (e) => {
3201
- S || Le(e);
3335
+ S || ze(e);
3202
3336
  },
3203
3337
  onWidgetDragStart: (e) => {
3204
- S || ue(e);
3338
+ S || de(e);
3205
3339
  },
3206
3340
  onWidgetDragMove: (e) => {
3207
- S || de(e);
3341
+ S || fe(e);
3208
3342
  },
3209
3343
  onWidgetDragEnd: (e) => {
3210
- S || U(e);
3344
+ S || pe(e);
3211
3345
  },
3212
3346
  onPlayerStatusChange: (e) => {
3213
- S || e === "error" && $(a.dataset.state) && K("Could not load the experience.");
3347
+ S || e === "error" && $(a.dataset.state) && G("Could not load the experience.");
3214
3348
  }
3215
3349
  });
3216
3350
  if (S || e !== O) {
@@ -3218,7 +3352,7 @@ function Nn(e, t) {
3218
3352
  return;
3219
3353
  }
3220
3354
  n.on("close", () => {
3221
- S || ke();
3355
+ S || K();
3222
3356
  });
3223
3357
  } catch (n) {
3224
3358
  if (S || e !== O) return;
@@ -3227,43 +3361,43 @@ function Nn(e, t) {
3227
3361
  t.onError?.(r), console.error("[ExperienceWidget] warm prefetch failed", r);
3228
3362
  }
3229
3363
  })();
3230
- }, Pe = () => {
3364
+ }, J = () => {
3231
3365
  if (S || x || !C || $(a.dataset.state)) return;
3232
3366
  if (b && D) {
3233
- Ae();
3367
+ Ne();
3234
3368
  return;
3235
3369
  }
3236
3370
  if (b && E) {
3237
- je();
3371
+ Pe();
3238
3372
  return;
3239
3373
  }
3240
3374
  let e = ++O;
3241
3375
  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 () => {
3242
3376
  try {
3243
- J();
3244
- let t = await dn.startSession(Ce());
3377
+ we();
3378
+ let t = await Cn.startSession(Se());
3245
3379
  if (S || e !== O) {
3246
3380
  t.destroy();
3247
3381
  return;
3248
3382
  }
3249
- b = t, Ee(t);
3383
+ b = t, Oe(t);
3250
3384
  let n = await t.attach({
3251
3385
  container: v,
3252
- ...we(),
3386
+ ...Ce(),
3253
3387
  onWidgetAudioSettings: (e) => {
3254
- S || Le(e);
3388
+ S || ze(e);
3255
3389
  },
3256
3390
  onWidgetDragStart: (e) => {
3257
- S || ue(e);
3391
+ S || de(e);
3258
3392
  },
3259
3393
  onWidgetDragMove: (e) => {
3260
- S || de(e);
3394
+ S || fe(e);
3261
3395
  },
3262
3396
  onWidgetDragEnd: (e) => {
3263
- S || U(e);
3397
+ S || pe(e);
3264
3398
  },
3265
3399
  onPlayerStatusChange: (e) => {
3266
- S || (e === "error" ? K("Could not load the experience.") : $(a.dataset.state) && K(null));
3400
+ S || (e === "error" ? G("Could not load the experience.") : $(a.dataset.state) && G(null));
3267
3401
  }
3268
3402
  });
3269
3403
  if (S || e !== O) {
@@ -3271,101 +3405,101 @@ function Nn(e, t) {
3271
3405
  return;
3272
3406
  }
3273
3407
  E = !0, t.setWidgetChrome("expanded"), n.on("close", () => {
3274
- S || ke();
3408
+ S || K();
3275
3409
  });
3276
3410
  } catch (n) {
3277
3411
  if (S || e !== O) return;
3278
3412
  let r = n instanceof Error ? n : Error(String(n));
3279
- K(r.message), t.onError?.(r), console.error("[ExperienceWidget]", r);
3413
+ G(r.message), t.onError?.(r), console.error("[ExperienceWidget]", r);
3280
3414
  } finally {
3281
3415
  e === O && (x = !1);
3282
3416
  }
3283
3417
  })();
3284
- }, Fe = () => {
3418
+ }, Le = () => {
3285
3419
  if (!(S || $(a.dataset.state))) {
3286
3420
  if (b && D) {
3287
- Ae();
3421
+ Ne();
3288
3422
  return;
3289
3423
  }
3290
3424
  if (b && E) {
3291
- je();
3425
+ Pe();
3292
3426
  return;
3293
3427
  }
3294
3428
  if (T || b) {
3295
- J();
3429
+ we();
3296
3430
  return;
3297
3431
  }
3298
- Pe();
3432
+ J();
3299
3433
  }
3300
- }, Ie = (e) => {
3434
+ }, Re = (e) => {
3301
3435
  if (e.stopPropagation(), R() === "expanded") {
3302
- Y();
3436
+ je();
3303
3437
  return;
3304
3438
  }
3305
- R() === "docked" && X();
3306
- }, Le = (e) => {
3307
- g.setAttribute("aria-pressed", e ? "true" : "false");
3308
- }, Re = (e) => {
3309
- e.stopPropagation(), $(a.dataset.state) && b?.toggleAudioSettings();
3439
+ R() === "docked" && q();
3310
3440
  }, ze = (e) => {
3311
- R() === "docked" && Cn() && (e.target?.closest("button") || (e.preventDefault(), le(e.clientX, e.clientY, e.pointerId)));
3441
+ g.setAttribute("aria-pressed", e ? "true" : "false");
3312
3442
  }, Be = (e) => {
3313
- e.key === "Escape" && $(a.dataset.state) && (e.preventDefault(), ke());
3314
- }, Ve = () => {
3443
+ e.stopPropagation(), $(a.dataset.state) && b?.toggleAudioSettings();
3444
+ }, Ve = (e) => {
3445
+ R() === "docked" && Fn() && (e.target?.closest("button") || (e.preventDefault(), ue(e.clientX, e.clientY, e.pointerId)));
3446
+ }, Y = (e) => {
3447
+ e.key === "Escape" && $(a.dataset.state) && (e.preventDefault(), K());
3448
+ }, X = () => {
3315
3449
  if (!S) {
3316
3450
  if (R() === "docked") {
3317
- if (!Cn()) {
3318
- X();
3451
+ if (!Fn()) {
3452
+ q();
3319
3453
  return;
3320
3454
  }
3321
- D ? G(() => {
3322
- fe(!0);
3323
- }) : fe(!0);
3455
+ D ? W(() => {
3456
+ me(!0);
3457
+ }) : me(!0);
3324
3458
  return;
3325
3459
  }
3326
- W();
3460
+ H();
3327
3461
  }
3328
- }, He = typeof window < "u" ? window.matchMedia(pn) : null, Ue = () => {
3462
+ }, He = typeof window < "u" ? window.matchMedia(Tn) : null, Ue = () => {
3329
3463
  if (!S) {
3330
- if (R() === "docked" && !Cn()) {
3331
- X();
3464
+ if (R() === "docked" && !Fn()) {
3465
+ q();
3332
3466
  return;
3333
3467
  }
3334
- W();
3468
+ H();
3335
3469
  }
3336
3470
  };
3337
- return o.addEventListener("click", Fe), d.addEventListener("click", ke), _.addEventListener("click", (e) => {
3338
- e.stopPropagation(), ke();
3339
- }), h.addEventListener("click", Ie), g.addEventListener("click", Re), p.addEventListener("pointerdown", ze), window.addEventListener("keydown", Be), window.addEventListener("resize", Ve), He?.addEventListener("change", Ue), Se(), W(), r === "eager" ? queueMicrotask(() => {
3340
- S || Ne();
3341
- }) : r === "idle" && (ee = Mn(() => {
3342
- S || Ne();
3471
+ return o.addEventListener("click", Le), d.addEventListener("click", K), _.addEventListener("click", (e) => {
3472
+ e.stopPropagation(), K();
3473
+ }), h.addEventListener("click", Re), g.addEventListener("click", Be), p.addEventListener("pointerdown", Ve), window.addEventListener("keydown", Y), window.addEventListener("resize", X), He?.addEventListener("change", Ue), xe(), H(), r === "eager" ? queueMicrotask(() => {
3474
+ S || Ie();
3475
+ }) : r === "idle" && (j = Wn(() => {
3476
+ S || Ie();
3343
3477
  })), {
3344
3478
  root: a,
3345
- expand: Fe,
3346
- collapse: ke,
3347
- dock: Y,
3348
- maximize: X,
3479
+ expand: Le,
3480
+ collapse: K,
3481
+ dock: je,
3482
+ maximize: q,
3349
3483
  prefetch() {
3350
3484
  if (r === "onExpand") {
3351
- Ne();
3485
+ Ie();
3352
3486
  return;
3353
3487
  }
3354
- Ne();
3488
+ Ie();
3355
3489
  },
3356
3490
  destroy() {
3357
- S || (S = !0, H(), ee?.(), ee = null, re.abort(), A?.(), A = null, window.removeEventListener("keydown", Be), window.removeEventListener("resize", Ve), He?.removeEventListener("change", Ue), Oe(), De(), e.replaceChildren());
3491
+ S || (S = !0, V(), j?.(), j = null, re.abort(), A?.(), A = null, window.removeEventListener("keydown", Y), window.removeEventListener("resize", X), He?.removeEventListener("change", Ue), Ae(), ke(), e.replaceChildren());
3358
3492
  }
3359
3493
  };
3360
3494
  }
3361
3495
  //#endregion
3362
3496
  //#region src/react/ExperienceWidget.tsx
3363
- function Pn(t) {
3364
- let r = n(null), { experienceId: i, alt: o, galleryThumb: s, avatarImage: c, backgroundImage: l, foregroundImage: u, fallbackImage: d, prefetch: f = "onExpand", parallax: p = !0, position: m = "static", offset: h, sessionEndpoint: g, language: _, mode: v, speechInputMode: y, speechOnly: b, fit: x, embedBaseUrl: S, expandedMaxWidth: C, expandedMaxHeight: w, startButtonLabel: T, startButton: E, showFeedback: D, className: O = "", onExpanded: k, onCollapsed: A, onStarted: ee, onClose: j, onError: M, onPrefetchReady: N, onFeedback: P, onFeedbackFailed: F } = t, te = m === "bottom-right" || m === "bottom-left";
3497
+ function Kn(t) {
3498
+ let r = n(null), { experienceId: i, alt: o, galleryThumb: s, avatarImage: c, backgroundImage: l, foregroundImage: u, fallbackImage: d, 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: j = "", onExpanded: M, onCollapsed: ee, onStarted: N, onClose: P, onError: F, onPrefetchReady: te, onFeedback: I, onFeedbackFailed: L } = t, ne = m === "bottom-right" || m === "bottom-left";
3365
3499
  return e(() => {
3366
3500
  let e = r.current;
3367
3501
  if (!e || !i.trim()) return;
3368
- let t = Nn(e, {
3502
+ let t = Gn(e, {
3369
3503
  experienceId: i,
3370
3504
  alt: o,
3371
3505
  galleryThumb: s,
@@ -3378,25 +3512,28 @@ function Pn(t) {
3378
3512
  position: m,
3379
3513
  offset: h,
3380
3514
  sessionEndpoint: g,
3381
- language: _,
3382
- mode: v,
3383
- speechInputMode: y,
3384
- speechOnly: b,
3385
- fit: x,
3386
- embedBaseUrl: S,
3387
- expandedMaxWidth: C,
3388
- expandedMaxHeight: w,
3389
- startButtonLabel: T,
3390
- startButton: E,
3391
- showFeedback: D,
3392
- onFeedback: P,
3393
- onFeedbackFailed: F,
3394
- onExpanded: k,
3395
- onCollapsed: A,
3396
- onStarted: ee,
3397
- onClose: j,
3398
- onError: M,
3399
- onPrefetchReady: N
3515
+ locale: _,
3516
+ secondaryLocale: v,
3517
+ learningLocale: y,
3518
+ language: b,
3519
+ mode: x,
3520
+ speechInputMode: S,
3521
+ speechOnly: C,
3522
+ fit: w,
3523
+ embedBaseUrl: T,
3524
+ expandedMaxWidth: E,
3525
+ expandedMaxHeight: D,
3526
+ startButtonLabel: O,
3527
+ startButton: k,
3528
+ showFeedback: A,
3529
+ onFeedback: I,
3530
+ onFeedbackFailed: L,
3531
+ onExpanded: M,
3532
+ onCollapsed: ee,
3533
+ onStarted: N,
3534
+ onClose: P,
3535
+ onError: F,
3536
+ onPrefetchReady: te
3400
3537
  });
3401
3538
  return () => t.destroy();
3402
3539
  }, [
@@ -3423,18 +3560,21 @@ function Pn(t) {
3423
3560
  T,
3424
3561
  E,
3425
3562
  D,
3426
- P,
3427
- F,
3563
+ O,
3428
3564
  k,
3429
3565
  A,
3430
- ee,
3431
- j,
3566
+ I,
3567
+ L,
3432
3568
  M,
3433
- N
3569
+ ee,
3570
+ N,
3571
+ P,
3572
+ F,
3573
+ te
3434
3574
  ]), /* @__PURE__ */ a("div", {
3435
3575
  ref: r,
3436
- className: O,
3437
- style: te ? { display: "contents" } : {
3576
+ className: j,
3577
+ style: ne ? { display: "contents" } : {
3438
3578
  width: "100%",
3439
3579
  height: "100%",
3440
3580
  minHeight: "inherit"
@@ -3443,11 +3583,11 @@ function Pn(t) {
3443
3583
  }
3444
3584
  //#endregion
3445
3585
  //#region src/next/index.ts
3446
- function Fn(e = {}) {
3586
+ function qn(e = {}) {
3447
3587
  let t = v(e);
3448
3588
  return { POST: ({ request: e }) => t(e) };
3449
3589
  }
3450
3590
  //#endregion
3451
- export { pe as ExperienceThumbnail, Pn as ExperienceWidget, v as createLiformaSessionRouteHandler, Fn as createLiformaSvelteKitSessionHandler };
3591
+ export { we as ExperienceThumbnail, Kn as ExperienceWidget, v as createLiformaSessionRouteHandler, qn as createLiformaSvelteKitSessionHandler };
3452
3592
 
3453
3593
  //# sourceMappingURL=index.js.map