markdown-flow-ui 0.1.112-beta.0 → 0.1.112-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/_virtual/index.cjs10.js +1 -1
  2. package/dist/_virtual/index.cjs4.js +1 -1
  3. package/dist/_virtual/index.cjs6.js +1 -1
  4. package/dist/_virtual/index.cjs7.js +1 -1
  5. package/dist/_virtual/index.cjs9.js +1 -1
  6. package/dist/_virtual/index.es10.js +2 -2
  7. package/dist/_virtual/index.es4.js +4 -4
  8. package/dist/_virtual/index.es6.js +2 -5
  9. package/dist/_virtual/index.es6.js.map +1 -1
  10. package/dist/_virtual/index.es7.js +5 -2
  11. package/dist/_virtual/index.es7.js.map +1 -1
  12. package/dist/_virtual/index.es9.js +2 -2
  13. package/dist/components/Slide/Slide.cjs.js +1 -1
  14. package/dist/components/Slide/Slide.cjs.js.map +1 -1
  15. package/dist/components/Slide/Slide.es.js +550 -495
  16. package/dist/components/Slide/Slide.es.js.map +1 -1
  17. package/dist/components/ui/inputGroup/textarea.cjs.js +1 -1
  18. package/dist/components/ui/inputGroup/textarea.es.js +1 -1
  19. package/dist/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.cjs.js +1 -1
  20. package/dist/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.cjs.js.map +1 -1
  21. package/dist/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  22. package/dist/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs.js +1 -1
  23. package/dist/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js +1 -1
  24. package/dist/markdown-flow-ui/node_modules/.pnpm/hast-util-to-jsx-runtime@2.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.cjs.js +1 -1
  25. package/dist/markdown-flow-ui/node_modules/.pnpm/hast-util-to-jsx-runtime@2.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.es.js +1 -1
  26. package/dist/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.cjs.js +1 -1
  27. package/dist/markdown-flow-ui/node_modules/.pnpm/rc-input@1.8.0_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-input/es/BaseInput.es.js +1 -1
  28. package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.cjs.js +1 -1
  29. package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
  30. package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.cjs.js +1 -1
  31. package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/TextArea.es.js +1 -1
  32. package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.cjs.js +1 -1
  33. package/dist/markdown-flow-ui/node_modules/.pnpm/rc-textarea@1.10.2_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-textarea/es/index.es.js +1 -1
  34. package/dist/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.cjs.js +1 -1
  35. package/dist/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.es.js +1 -1
  36. package/package.json +1 -1
@@ -1,54 +1,54 @@
1
- import { j as n } from "../../_virtual/jsx-runtime.es.js";
2
- import In, { memo as wn, useRef as m, useMemo as u, useState as v, useCallback as r, useEffect as a } from "react";
3
- import { isSandboxInteractionMessage as _n } from "../../lib/sandboxInteraction.es.js";
1
+ import { j as r } from "../../_virtual/jsx-runtime.es.js";
2
+ import wn, { memo as _n, useRef as v, useMemo as c, useState as y, useCallback as n, useEffect as a } from "react";
3
+ import { isSandboxInteractionMessage as Tn } from "../../lib/sandboxInteraction.es.js";
4
4
  import { cn as Z } from "../../lib/utils.es.js";
5
- import Tn from "../ui/loading-overlay-card.es.js";
6
- import En from "../ContentRender/ContentRender.es.js";
5
+ import En from "../ui/loading-overlay-card.es.js";
6
+ import Cn from "../ContentRender/ContentRender.es.js";
7
7
  import Ot from "../ContentRender/IframeSandbox.es.js";
8
8
  import "../ui/inputGroup/input-group.es.js";
9
- import { getInteractionDefaultValues as Cn, getInteractionDefaultSelectedValues as Rn } from "../../lib/interaction-defaults.es.js";
10
- import { isMobileDevice as Pn, isLandscapeViewport as kt, subscribeMobileDeviceChange as Mn } from "../../lib/mobileDevice.es.js";
11
- import Fn from "./Player.es.js";
12
- import On from "./SubtitleOverlay.es.js";
13
- import { DEFAULT_SLIDE_PLAYER_TEXTS as kn, DEFAULT_STREAM_INACTIVITY_TIMEOUT_MS as Nn, SLIDE_ERROR_CODES as Bn } from "./constants.es.js";
14
- import jn from "./SlideFullscreenHint.es.js";
15
- import Ln from "./useSlide.es.js";
16
- import Kn from "./useWakePlayerFromIframe.es.js";
17
- import { DEFAULT_MOBILE_VIEW_MODE as Ce, resolveMobileViewModeState as Vn } from "./utils/mobileScreenMode.es.js";
9
+ import { getInteractionDefaultValues as Rn, getInteractionDefaultSelectedValues as Pn } from "../../lib/interaction-defaults.es.js";
10
+ import { isMobileDevice as Mn, isLandscapeViewport as kt, subscribeMobileDeviceChange as Fn } from "../../lib/mobileDevice.es.js";
11
+ import On from "./Player.es.js";
12
+ import kn from "./SubtitleOverlay.es.js";
13
+ import { DEFAULT_SLIDE_PLAYER_TEXTS as Nn, DEFAULT_STREAM_INACTIVITY_TIMEOUT_MS as Bn, SLIDE_ERROR_CODES as jn } from "./constants.es.js";
14
+ import Ln from "./SlideFullscreenHint.es.js";
15
+ import Kn from "./useSlide.es.js";
16
+ import Vn from "./useWakePlayerFromIframe.es.js";
17
+ import { DEFAULT_MOBILE_VIEW_MODE as Re, resolveMobileViewModeState as qn } from "./utils/mobileScreenMode.es.js";
18
18
  import { shouldPresentInteractionOverlay as Dn } from "./utils/interactionPlayback.es.js";
19
- import { shouldAutoAdvanceIntoAppendedMarker as qn } from "./utils/appendedMarkerAdvance.es.js";
20
- import { getPlaybackSequenceTransition as Hn } from "./utils/playbackSequence.es.js";
21
- import { resolvePlayerCustomActionElement as Un, getPlayerCustomActionCount as $n } from "./utils/playerCustomActions.es.js";
22
- import { createPlaybackTimeStore as zn } from "./utils/playbackTimeStore.es.js";
23
- import { shouldUseAutoAdvanceToggle as Gn } from "./utils/playerToggleMode.es.js";
19
+ import { shouldAutoAdvanceIntoAppendedMarker as Hn } from "./utils/appendedMarkerAdvance.es.js";
20
+ import { getPlaybackSequenceTransition as Un } from "./utils/playbackSequence.es.js";
21
+ import { resolvePlayerCustomActionElement as $n, getPlayerCustomActionCount as zn } from "./utils/playerCustomActions.es.js";
22
+ import { createPlaybackTimeStore as Gn } from "./utils/playbackTimeStore.es.js";
23
+ import { shouldUseAutoAdvanceToggle as Wn } from "./utils/playerToggleMode.es.js";
24
24
  /* empty css */
25
- import Wn from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/chevron-left.es.js";
26
- const Yn = 2e3, Xn = 300, Jn = 160, Qn = 16, Nt = wn(
25
+ import Yn from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/chevron-left.es.js";
26
+ const Xn = 2e3, Jn = 300, Qn = 160, Zn = 16, Nt = _n(
27
27
  ({
28
- content: o,
29
- title: s,
28
+ content: i,
29
+ title: o,
30
30
  defaultButtonText: F,
31
31
  defaultInputText: O,
32
- defaultSelectedValues: L,
33
- confirmButtonText: K,
34
- copyButtonText: q,
32
+ defaultSelectedValues: V,
33
+ confirmButtonText: q,
34
+ copyButtonText: U,
35
35
  copiedButtonText: ee,
36
- onSend: Re,
37
- readonly: Pe = !1
38
- }) => /* @__PURE__ */ n.jsxs("div", { className: "slide-player__interaction-card", children: [
39
- /* @__PURE__ */ n.jsx("div", { className: "slide-player__interaction-header", children: /* @__PURE__ */ n.jsx("p", { className: "slide-player__interaction-title", children: s }) }),
40
- /* @__PURE__ */ n.jsx("div", { className: "slide-player__interaction-body", children: /* @__PURE__ */ n.jsx(
41
- En,
36
+ onSend: Pe,
37
+ readonly: Me = !1
38
+ }) => /* @__PURE__ */ r.jsxs("div", { className: "slide-player__interaction-card", children: [
39
+ /* @__PURE__ */ r.jsx("div", { className: "slide-player__interaction-header", children: /* @__PURE__ */ r.jsx("p", { className: "slide-player__interaction-title", children: o }) }),
40
+ /* @__PURE__ */ r.jsx("div", { className: "slide-player__interaction-body", children: /* @__PURE__ */ r.jsx(
41
+ Cn,
42
42
  {
43
- content: o,
43
+ content: i,
44
44
  defaultButtonText: F,
45
45
  defaultInputText: O,
46
- defaultSelectedValues: L,
47
- confirmButtonText: K,
48
- copyButtonText: q,
46
+ defaultSelectedValues: V,
47
+ confirmButtonText: q,
48
+ copyButtonText: U,
49
49
  copiedButtonText: ee,
50
- onSend: Re,
51
- readonly: Pe,
50
+ onSend: Pe,
51
+ readonly: Me,
52
52
  enableTypewriter: !1,
53
53
  sandboxMode: "content"
54
54
  }
@@ -56,49 +56,49 @@ const Yn = 2e3, Xn = 300, Jn = 160, Qn = 16, Nt = wn(
56
56
  ] })
57
57
  );
58
58
  Nt.displayName = "InteractionOverlayCard";
59
- const Zn = (o, s) => o.length === s.length && o.every((F, O) => {
60
- const L = s[O];
61
- return F.sequence_number === L?.sequence_number && F.type === L?.type && F.content === L?.content;
62
- }), er = (o) => typeof o == "string" ? `string:${o.length}:${o.slice(-32)}` : typeof o == "number" || typeof o == "boolean" ? `primitive:${String(o)}` : In.isValidElement(o) ? `element:${String(o.key ?? "")}` : Array.isArray(o) ? `array:${o.length}` : o == null ? "null" : `object:${typeof o}`, tr = (o) => (o ?? []).map(
63
- (s) => [
64
- String(s.segment_index ?? "none"),
65
- s.is_final ? "1" : "0",
66
- String(s.duration_ms ?? 0),
67
- String(s.audio_url ?? ""),
68
- String(s.audio_data?.length ?? 0)
59
+ const er = (i, o) => i.length === o.length && i.every((F, O) => {
60
+ const V = o[O];
61
+ return F.sequence_number === V?.sequence_number && F.type === V?.type && F.content === V?.content;
62
+ }), tr = (i) => typeof i == "string" ? `string:${i.length}:${i.slice(-32)}` : typeof i == "number" || typeof i == "boolean" ? `primitive:${String(i)}` : wn.isValidElement(i) ? `element:${String(i.key ?? "")}` : Array.isArray(i) ? `array:${i.length}` : i == null ? "null" : `object:${typeof i}`, nr = (i) => (i ?? []).map(
63
+ (o) => [
64
+ String(o.segment_index ?? "none"),
65
+ o.is_final ? "1" : "0",
66
+ String(o.duration_ms ?? 0),
67
+ String(o.audio_url ?? ""),
68
+ String(o.audio_data?.length ?? 0)
69
69
  ].join(":")
70
- ).join(","), nr = (o) => o.map(
71
- (s, F) => [
72
- String(s.sequence_number ?? F),
73
- String(s.type),
74
- er(s.content),
75
- String(s.audio_url ?? ""),
76
- tr(s.audio_segments),
77
- s.is_renderable === !1 ? "hidden" : "visible",
78
- s.is_new ? "new" : "stable",
79
- s.is_speakable ? "speakable" : "silent",
80
- String(s.user_input ?? ""),
81
- s.readonly ? "readonly" : "editable"
70
+ ).join(","), rr = (i) => i.map(
71
+ (o, F) => [
72
+ String(o.sequence_number ?? F),
73
+ String(o.type),
74
+ tr(o.content),
75
+ String(o.audio_url ?? ""),
76
+ nr(o.audio_segments),
77
+ o.is_renderable === !1 ? "hidden" : "visible",
78
+ o.is_new ? "new" : "stable",
79
+ o.is_speakable ? "speakable" : "silent",
80
+ String(o.user_input ?? ""),
81
+ o.readonly ? "readonly" : "editable"
82
82
  ].join("|")
83
- ).join("||"), Pr = ({
84
- elementList: o = [],
85
- isStreaming: s = !1,
83
+ ).join("||"), Mr = ({
84
+ elementList: i = [],
85
+ isStreaming: o = !1,
86
86
  showPlayer: F = !0,
87
87
  playerAlwaysVisible: O = !1,
88
- playerClassName: L,
89
- fullscreenHeader: K,
90
- playerCustomActions: q,
88
+ playerClassName: V,
89
+ fullscreenHeader: q,
90
+ playerCustomActions: U,
91
91
  playerCustomActionPauseOnActive: ee = !0,
92
- bufferingText: Re = "Buffering...",
93
- interactionTitle: Pe,
94
- interactionTexts: pe,
92
+ bufferingText: Pe = "Buffering...",
93
+ interactionTitle: Me,
94
+ interactionTexts: he,
95
95
  playerTexts: Xe,
96
- playerAutoHideDelay: Me = 3e3,
97
- markerAutoAdvanceDelay: Je = Yn,
98
- streamInactivityTimeoutMs: Fe = Nn,
99
- interactionDefaultValueOptions: he,
96
+ playerAutoHideDelay: Fe = 3e3,
97
+ markerAutoAdvanceDelay: Je = Xn,
98
+ streamInactivityTimeoutMs: Oe = Bn,
99
+ interactionDefaultValueOptions: ve,
100
100
  onSend: Qe,
101
- onPlayerVisibilityChange: Oe,
101
+ onPlayerVisibilityChange: ke,
102
102
  onMobileViewModeChange: Ze,
103
103
  onError: et,
104
104
  onStepChange: tt,
@@ -107,135 +107,160 @@ const Zn = (o, s) => o.length === s.length && o.every((F, O) => {
107
107
  onPointerDown: nt,
108
108
  ...Lt
109
109
  }) => {
110
- const ve = m(null), rt = m(null), ke = m(null), ot = m(null), te = m(null), ne = m(null), re = m(null), oe = m(null), se = m(null), st = m(null), it = m([]), Ne = m(null), ye = m(!1), Be = m(!1), ie = m(!1), H = m(null), lt = m(null), at = m({
110
+ const ye = v(null), rt = v(null), Ne = v(null), ot = v(null), te = v(null), ne = v(null), re = v(null), oe = v(null), ie = v(null), it = v(null), lt = v([]), Be = v(null), ge = v(!1), je = v(!1), le = v(!1), $ = v(null), st = v(null), at = v({
111
111
  markerCount: 0,
112
112
  currentIndex: -1,
113
113
  canGoNext: !1
114
114
  }), {
115
115
  currentElementList: k,
116
- stepElementLists: ct,
116
+ stepElementLists: ut,
117
117
  slideElementList: N,
118
- currentIndex: p,
119
- audioList: y,
118
+ currentIndex: f,
119
+ audioList: b,
120
120
  currentAudioSequenceIndexes: Se,
121
- currentStepHasSpeakableElement: b,
122
- currentInteractionElement: f,
121
+ currentStepHasSpeakableElement: S,
122
+ currentInteractionElement: h,
123
123
  canGoPrev: Kt,
124
124
  canGoNext: I,
125
- handlePrev: ut,
126
- handleNext: T
127
- } = Ln(o), le = u(() => {
128
- if (!(p < 0))
129
- return N[p];
130
- }, [p, N]), Vt = N.filter(
125
+ handlePrev: ct,
126
+ handleNext: E
127
+ } = Kn(i), se = c(() => {
128
+ if (!(f < 0))
129
+ return N[f];
130
+ }, [f, N]), Vt = N.filter(
131
131
  (e) => e.is_renderable !== !1
132
- ).length === 1, w = F && (N.length > 0 || y.length > 0 || !!f), E = u(
133
- () => Se.map((e) => y[e]?.audioKey).filter((e) => !!e),
134
- [y, Se]
135
- ), [dt, ge] = v(!0), [be, ae] = v(!1), [ce, ft] = v(!0), [S, U] = v(null), [Dt, x] = v(!1), [$, je] = v(!1), [C, mt] = v(!1), [qt, Le] = v(!1), [pt, Ht] = v(!0), [Ke, Ve] = v(!1), [i, De] = v(), [xe, Ae] = v(!1), [
136
- Ut,
137
- ue
138
- ] = v(0), [$t, zt] = v(!1), R = u(() => Pn(), []), [Ie, qe] = v(
139
- Ce
140
- ), [ht, He] = v(!1), [Ue, vt] = v(
132
+ ).length === 1, _ = F && (N.length > 0 || b.length > 0 || !!h), C = c(
133
+ () => Se.map((e) => b[e]?.audioKey).filter((e) => !!e),
134
+ [b, Se]
135
+ ), [dt, be] = y(!0), [Ae, ae] = y(!1), [ue, ft] = y(!0), [g, z] = y(null), [qt, Dt] = y(!1), [j, Le] = y(!1), [w, mt] = y(!1), [Ht, Ke] = y(!1), [pt, Ut] = y(!0), [Ve, qe] = y(!1), [s, De] = y(), [xe, Ie] = y(!1), [
136
+ $t,
137
+ ce
138
+ ] = y(0), [zt, Gt] = y(!1), R = c(() => Mn(), []), [we, He] = y(
139
+ Re
140
+ ), [ht, Ue] = y(!1), [$e, vt] = y(
141
141
  () => R ? kt() : !1
142
- ), [Gt, we] = v(!1), z = u(() => zn(), []), {
143
- effectiveMobileViewMode: j,
144
- isImmersiveMobileFullscreen: G,
142
+ ), [Wt, _e] = y(!1), G = c(() => Gn(), []), {
143
+ effectiveMobileViewMode: L,
144
+ isImmersiveMobileFullscreen: W,
145
145
  isNativeMobileFullscreen: yt,
146
- shouldRotateFullscreenViewport: Wt
147
- } = u(
148
- () => Vn({
146
+ shouldRotateFullscreenViewport: Yt
147
+ } = c(
148
+ () => qn({
149
149
  hasManualMobileViewMode: ht,
150
150
  isMobileDevice: R,
151
- mobileViewMode: Ie
151
+ mobileViewMode: we
152
152
  }),
153
153
  [
154
154
  ht,
155
155
  R,
156
- Ue,
157
- Ie
156
+ $e,
157
+ we
158
158
  ]
159
- ), St = m(j), P = w && (O || dt), Yt = G && P, Xt = G && P, Jt = G || yt, Qt = Xe?.fullscreenHintText ?? kn.fullscreenHintText, $e = u(
160
- () => nr(o),
161
- [o]
162
- ), Zt = r(
159
+ ), gt = v(L), P = _ && (O || dt), Xt = W && P, Jt = W && P, Qt = W || yt, Zt = Xe?.fullscreenHintText ?? Nn.fullscreenHintText, de = c(
160
+ () => rr(i),
161
+ [i]
162
+ ), d = n(
163
+ (e, t, l) => {
164
+ Dt((m) => (console.log("[Slide buffering loading]", {
165
+ reason: t,
166
+ previousVisible: m,
167
+ nextVisible: e,
168
+ currentIndex: f,
169
+ currentAudioKey: g,
170
+ currentStepHasSpeakableElement: S,
171
+ hasCompletedCurrentStepAudio: w,
172
+ hasStreamInactivityTimedOut: j,
173
+ isStreaming: o,
174
+ streamActivityKey: de,
175
+ ...l
176
+ }), e));
177
+ },
178
+ [
179
+ g,
180
+ f,
181
+ S,
182
+ w,
183
+ j,
184
+ o,
185
+ de
186
+ ]
187
+ ), en = n(
163
188
  (e) => {
164
- He(!0), qe(e);
189
+ Ue(!0), He(e);
165
190
  },
166
191
  []
167
- ), gt = r(() => {
168
- He(!1), qe(Ce);
169
- }, []), en = r(() => {
170
- gt(), K?.onBack?.();
171
- }, [K, gt]), tn = r(() => {
172
- we(!1);
173
- }, []), bt = r((e) => {
174
- Ve(e);
175
- }, []), xt = r(() => {
176
- Ve((e) => !e);
177
- }, []), { mountedStepStates: nn, currentMountedStateIndex: rn } = u(() => {
192
+ ), St = n(() => {
193
+ Ue(!1), He(Re);
194
+ }, []), tn = n(() => {
195
+ St(), q?.onBack?.();
196
+ }, [q, St]), nn = n(() => {
197
+ _e(!1);
198
+ }, []), bt = n((e) => {
199
+ qe(e);
200
+ }, []), At = n(() => {
201
+ qe((e) => !e);
202
+ }, []), { mountedStepStates: rn, currentMountedStateIndex: on } = c(() => {
178
203
  const e = [], t = /* @__PURE__ */ new Map();
179
- return ct.forEach((l, h) => {
180
- const c = e.findIndex(
181
- (d) => Zn(
182
- d.elementList,
204
+ return ut.forEach((l, m) => {
205
+ const u = e.findIndex(
206
+ (p) => er(
207
+ p.elementList,
183
208
  l
184
209
  )
185
210
  );
186
- if (c >= 0) {
187
- e[c]?.sourceStepIndexes.push(h), t.set(h, c);
211
+ if (u >= 0) {
212
+ e[u]?.sourceStepIndexes.push(m), t.set(m, u);
188
213
  return;
189
214
  }
190
215
  e.push({
191
216
  elementList: l,
192
- sourceStepIndexes: [h]
193
- }), t.set(h, e.length - 1);
217
+ sourceStepIndexes: [m]
218
+ }), t.set(m, e.length - 1);
194
219
  }), {
195
220
  mountedStepStates: e,
196
- currentMountedStateIndex: p >= 0 ? t.get(p) ?? -1 : -1
221
+ currentMountedStateIndex: f >= 0 ? t.get(f) ?? -1 : -1
197
222
  };
198
- }, [p, ct]), At = u(() => String(p), [p]), g = u(() => S ? y.findIndex(
199
- (e) => (e.audioKey ?? "") === S
200
- ) : -1, [y, S]), ze = u(
201
- () => g >= 0 ? y[g] : void 0,
202
- [y, g]
203
- ), on = ze?.element?.subtitle_cues ?? [], _e = u(
204
- () => E[0] ?? "none",
205
- [E]
206
- ), Ge = u(
223
+ }, [f, ut]), xt = c(() => String(f), [f]), A = c(() => g ? b.findIndex(
224
+ (e) => (e.audioKey ?? "") === g
225
+ ) : -1, [b, g]), ze = c(
226
+ () => A >= 0 ? b[A] : void 0,
227
+ [b, A]
228
+ ), ln = ze?.element?.subtitle_cues ?? [], Te = c(
229
+ () => C[0] ?? "none",
230
+ [C]
231
+ ), Ge = c(
207
232
  () => ({
208
- currentElement: Un({
209
- currentAudioIndex: g,
233
+ currentElement: $n({
234
+ currentAudioIndex: A,
210
235
  currentAudioSequenceIndexes: Se,
211
- audioList: y,
212
- currentInteractionElement: i,
213
- currentStepElement: le
236
+ audioList: b,
237
+ currentInteractionElement: s,
238
+ currentStepElement: se
214
239
  }),
215
- currentIndex: p,
216
- currentStepElement: le,
217
- isActive: Ke,
240
+ currentIndex: f,
241
+ currentStepElement: se,
242
+ isActive: Ve,
218
243
  setActive: bt,
219
- toggleActive: xt
244
+ toggleActive: At
220
245
  }),
221
246
  [
222
- i,
223
- y,
224
- g,
247
+ s,
248
+ b,
249
+ A,
225
250
  Se,
226
- p,
227
- le,
228
- Ke,
251
+ f,
252
+ se,
253
+ Ve,
229
254
  bt,
230
- xt
255
+ At
231
256
  ]
232
- ), We = u(
233
- () => $n(
234
- q,
257
+ ), We = c(
258
+ () => zn(
259
+ U,
235
260
  Ge
236
261
  ),
237
- [Ge, q]
238
- ), sn = u(
262
+ [Ge, U]
263
+ ), sn = c(
239
264
  () => ({
240
265
  "--slide-player-custom-action-count": String(We),
241
266
  "--slide-player-mobile-control-count": String(
@@ -243,124 +268,126 @@ const Zn = (o, s) => o.length === s.length && o.every((F, O) => {
243
268
  )
244
269
  }),
245
270
  [We]
246
- ), It = E.length > 0, wt = u(() => f ? `${f.sequence_number ?? "none"}:${String(
247
- f.content ?? ""
248
- )}` : "none", [f]), de = u(
249
- () => [At, wt].join("|"),
250
- [wt, At]
251
- ), ln = u(
271
+ ), It = C.length > 0, wt = c(() => h ? `${h.sequence_number ?? "none"}:${String(
272
+ h.content ?? ""
273
+ )}` : "none", [h]), fe = c(
274
+ () => [xt, wt].join("|"),
275
+ [wt, xt]
276
+ ), an = c(
252
277
  () => [
253
- de,
278
+ fe,
254
279
  ze?.audioKey ?? "none",
255
- String(g)
280
+ String(A)
256
281
  ].join("|"),
257
- [g, ze?.audioKey, de]
258
- ), _t = !!u(() => !_e || _e === "none" ? "" : y.find(
259
- (t) => t.audioKey === _e
260
- )?.audioUrl?.trim() ?? "", [y, _e]), V = ee && !!q && Ke, fe = u(
261
- () => Gn({
282
+ [A, ze?.audioKey, fe]
283
+ ), _t = !!c(() => !Te || Te === "none" ? "" : b.find(
284
+ (t) => t.audioKey === Te
285
+ )?.audioUrl?.trim() ?? "", [b, Te]), K = ee && !!U && Ve, me = c(
286
+ () => Wn({
262
287
  canGoNext: I,
263
- currentAudioIndex: g,
264
- currentStepHasSpeakableElement: b,
265
- hasInteraction: !!f
288
+ currentAudioIndex: A,
289
+ currentStepHasSpeakableElement: S,
290
+ hasInteraction: !!h
266
291
  }),
267
292
  [
268
293
  I,
269
- g,
270
- f,
271
- b
294
+ A,
295
+ h,
296
+ S
272
297
  ]
273
- ), D = r(() => {
298
+ ), D = n(() => {
274
299
  te.current !== null && (window.clearTimeout(te.current), te.current = null);
275
- }, []), B = r(() => {
300
+ }, []), B = n(() => {
276
301
  re.current !== null && (window.clearTimeout(re.current), re.current = null);
277
- }, []), M = r(() => {
302
+ }, []), M = n(() => {
278
303
  oe.current !== null && (window.clearTimeout(oe.current), oe.current = null);
279
- }, []), W = r(() => {
304
+ }, []), Y = n(() => {
280
305
  ne.current !== null && (window.clearTimeout(ne.current), ne.current = null);
281
- }, []), Y = r(() => {
282
- se.current !== null && (window.clearTimeout(se.current), se.current = null);
283
- }, []), X = r(() => {
284
- W(), B(), M(), U(null), z.reset(), x(!1), mt(!1), Le(!1), De(void 0), Ae(!1), ue(0);
306
+ }, []), X = n(() => {
307
+ ie.current !== null && (window.clearTimeout(ie.current), ie.current = null);
308
+ }, []), J = n(() => {
309
+ Y(), B(), M(), z(null), G.reset(), d(!1, "reset-audio-sequence"), mt(!1), Ke(!1), De(void 0), Ie(!1), ce(0);
285
310
  }, [
286
- W,
311
+ Y,
287
312
  B,
288
313
  M,
289
- z
290
- ]), J = r(() => {
291
- const e = E[0];
292
- return e ? (U(e), !0) : !1;
293
- }, [E]), Te = r(() => {
294
- B(), M(), Ae(!1), ue(0), !J() && I && T();
314
+ G,
315
+ d
316
+ ]), Q = n(() => {
317
+ const e = C[0];
318
+ return e ? (z(e), !0) : !1;
319
+ }, [C]), Ee = n(() => {
320
+ B(), M(), Ie(!1), ce(0), !Q() && I && E();
295
321
  }, [
296
322
  I,
297
323
  B,
298
324
  M,
299
- T,
300
- J
301
- ]), Tt = r(
325
+ E,
326
+ Q
327
+ ]), Tt = n(
302
328
  (e) => {
303
329
  if (M(), !e)
304
330
  return;
305
331
  const t = () => {
306
- oe.current = null, ue(
307
- Jn
308
- ), Ae(!0), H.current = null;
332
+ oe.current = null, ce(
333
+ Qn
334
+ ), Ie(!0), $.current = null;
309
335
  };
310
336
  oe.current = window.setTimeout(
311
337
  t,
312
- Xn
338
+ Jn
313
339
  );
314
340
  },
315
341
  [M]
316
- ), A = r(
317
- (e = be) => {
318
- w && (ge(!0), D(), !(O || !e || Me <= 0) && (te.current = window.setTimeout(() => {
319
- ge(!1), te.current = null;
320
- }, Me)));
342
+ ), x = n(
343
+ (e = Ae) => {
344
+ _ && (be(!0), D(), !(O || !e || Fe <= 0) && (te.current = window.setTimeout(() => {
345
+ be(!1), te.current = null;
346
+ }, Fe)));
321
347
  },
322
348
  [
323
349
  D,
324
- be,
350
+ Ae,
325
351
  O,
326
- Me,
327
- w
352
+ Fe,
353
+ _
328
354
  ]
329
- ), me = !!(f?.readonly || f?.user_input?.trim()), Q = !!f && !me;
355
+ ), pe = !!(h?.readonly || h?.user_input?.trim()), H = !!h && !pe;
330
356
  a(() => {
331
- ft(!0), ee && Ve(!1);
332
- }, [p, ee]), a(() => () => {
333
- W(), D(), B(), M(), Y();
357
+ ft(!0), ee && qe(!1);
358
+ }, [f, ee]), a(() => () => {
359
+ Y(), D(), B(), M(), X();
334
360
  }, [
335
- W,
361
+ Y,
336
362
  B,
337
363
  M,
338
364
  D,
339
- Y
365
+ X
340
366
  ]), a(() => {
341
- if (!s || Fe <= 0) {
342
- Y(), Ne.current = null, Be.current = !1, ie.current = !1, je(!1);
367
+ if (!o || Oe <= 0) {
368
+ X(), Be.current = null, je.current = !1, le.current = !1, Le(!1);
343
369
  return;
344
370
  }
345
- const e = !Be.current, t = Ne.current !== $e;
346
- return Be.current = !0, (e || t) && (Ne.current = $e, ie.current && (ie.current = !1, je(!1))), Y(), se.current = window.setTimeout(() => {
347
- se.current = null, !ie.current && (ie.current = !0, je(!0), x(!1), et?.({
348
- code: Bn.STREAM_INACTIVITY_TIMEOUT
371
+ const e = !je.current, t = Be.current !== de;
372
+ return je.current = !0, (e || t) && (Be.current = de, le.current && (le.current = !1, Le(!1))), X(), ie.current = window.setTimeout(() => {
373
+ ie.current = null, !le.current && (le.current = !0, Le(!0), d(!1, "stream-inactivity-timeout"), et?.({
374
+ code: jn.STREAM_INACTIVITY_TIMEOUT
349
375
  }));
350
- }, Fe), () => {
351
- Y();
376
+ }, Oe), () => {
377
+ X();
352
378
  };
353
379
  }, [
354
- Y,
355
- s,
380
+ X,
381
+ o,
356
382
  et,
357
- $e,
358
- Fe
359
- ]), a(() => (Oe?.(P), () => {
360
- Oe?.(!1);
361
- }), [Oe, P]), a(() => {
362
- R || Ie === Ce || (He(!1), qe(Ce));
363
- }, [R, Ie]), a(() => {
383
+ de,
384
+ Oe,
385
+ d
386
+ ]), a(() => (ke?.(P), () => {
387
+ ke?.(!1);
388
+ }), [ke, P]), a(() => {
389
+ R || we === Re || (Ue(!1), He(Re));
390
+ }, [R, we]), a(() => {
364
391
  if (!R) {
365
392
  vt(!1);
366
393
  return;
@@ -368,237 +395,248 @@ const Zn = (o, s) => o.length === s.length && o.every((F, O) => {
368
395
  const e = () => {
369
396
  vt(kt());
370
397
  };
371
- return e(), Mn(e);
398
+ return e(), Fn(e);
372
399
  }, [R]), a(() => {
373
- Ze?.(j);
374
- }, [j, Ze]), a(() => {
375
- const l = St.current !== "fullscreen" && j === "fullscreen" && !Ue;
376
- if (St.current = j, !R) {
377
- we(!1);
400
+ Ze?.(L);
401
+ }, [L, Ze]), a(() => {
402
+ const l = gt.current !== "fullscreen" && L === "fullscreen" && !$e;
403
+ if (gt.current = L, !R) {
404
+ _e(!1);
378
405
  return;
379
406
  }
380
407
  if (l) {
381
- we(!0);
408
+ _e(!0);
382
409
  return;
383
410
  }
384
- j !== "fullscreen" && we(!1);
385
- }, [j, R, Ue]), a(() => {
386
- tt?.(le, p);
387
- }, [p, le, tt]), a(() => {
388
- const e = at.current, t = qn(
411
+ L !== "fullscreen" && _e(!1);
412
+ }, [L, R, $e]), a(() => {
413
+ tt?.(se, f);
414
+ }, [f, se, tt]), a(() => {
415
+ const e = at.current, t = Hn(
389
416
  {
390
417
  previousMarkerCount: e.markerCount,
391
418
  nextMarkerCount: N.length,
392
419
  previousIndex: e.currentIndex,
393
420
  previousCanGoNext: e.canGoNext,
394
421
  nextCanGoNext: I,
395
- currentAudioKey: S,
396
- hasCompletedCurrentStepAudio: C,
397
- hasResolvedCurrentInteraction: me,
398
- currentStepHasSpeakableElement: b,
399
- currentInteractionElement: f,
400
- isAutoAdvanceEnabled: ce,
401
- shouldUseSilentStepAutoAdvanceToggle: fe
422
+ currentAudioKey: g,
423
+ hasCompletedCurrentStepAudio: w,
424
+ hasResolvedCurrentInteraction: pe,
425
+ currentStepHasSpeakableElement: S,
426
+ currentInteractionElement: h,
427
+ isAutoAdvanceEnabled: ue,
428
+ shouldUseSilentStepAutoAdvanceToggle: me
402
429
  }
403
430
  );
404
431
  at.current = {
405
432
  markerCount: N.length,
406
- currentIndex: p,
433
+ currentIndex: f,
407
434
  canGoNext: I
408
- }, t && T();
435
+ }, t && E();
409
436
  }, [
410
437
  I,
411
- S,
412
- p,
438
+ g,
413
439
  f,
414
- b,
415
- T,
416
- C,
440
+ h,
441
+ S,
442
+ E,
443
+ w,
444
+ pe,
445
+ ue,
417
446
  me,
418
- ce,
419
- fe,
420
447
  N.length
421
448
  ]), a(() => {
422
- if (!w) {
423
- D(), ge(!1);
449
+ if (!_) {
450
+ D(), be(!1);
424
451
  return;
425
452
  }
426
453
  if (O) {
427
- D(), ge(!0);
454
+ D(), be(!0);
428
455
  return;
429
456
  }
430
- be || A(!0);
457
+ Ae || x(!0);
431
458
  }, [
432
459
  D,
433
- be,
460
+ Ae,
434
461
  O,
435
- w,
436
- A
462
+ _,
463
+ x
437
464
  ]), a(() => {
438
465
  if (typeof window > "u")
439
466
  return;
440
467
  const e = (t) => {
441
- t.origin === window.location.origin && _n(t.data) && t.data.eventType === "click" && w && (ae(!0), A(!0));
468
+ t.origin === window.location.origin && Tn(t.data) && t.data.eventType === "click" && _ && (ae(!0), x(!0));
442
469
  };
443
470
  return window.addEventListener("message", e), () => {
444
471
  window.removeEventListener("message", e);
445
472
  };
446
- }, [w, A]), Kn({
447
- sectionRef: ve,
448
- enabled: w,
473
+ }, [_, x]), Vn({
474
+ sectionRef: ye,
475
+ enabled: _,
449
476
  onWake: () => {
450
- ae(!0), A(!0);
477
+ ae(!0), x(!0);
451
478
  }
452
479
  }), a(() => {
453
- const { hasPlaybackContextChanged: e, shouldInitializeAudioSequence: t } = Hn({
454
- previousResetKey: lt.current,
455
- nextResetKey: de,
456
- currentAudioKey: S,
457
- hasCompletedCurrentStepAudio: C
480
+ const { hasPlaybackContextChanged: e, shouldInitializeAudioSequence: t } = Un({
481
+ previousResetKey: st.current,
482
+ nextResetKey: fe,
483
+ currentAudioKey: g,
484
+ hasCompletedCurrentStepAudio: w
458
485
  });
459
- lt.current = de;
460
- const l = H.current === p && !!f, h = Dn({
461
- hasInteraction: !!f,
462
- shouldBlockPlaybackForInteraction: Q,
486
+ st.current = fe;
487
+ const l = $.current === f && !!h, m = Dn({
488
+ hasInteraction: !!h,
489
+ shouldBlockPlaybackForInteraction: H,
463
490
  shouldOpenInteractionOverlayAfterAudio: l,
464
491
  hasPlaybackContextChanged: e,
465
- hasResolvedCurrentInteraction: me,
466
- currentStepHasSpeakableElement: b
492
+ hasResolvedCurrentInteraction: pe,
493
+ currentStepHasSpeakableElement: S
467
494
  });
468
- if (e && X(), !(k.length === 0 && !f) && !V) {
469
- if (f && De(f), h) {
470
- Tt(f);
495
+ if (e && J(), !(k.length === 0 && !h) && !K) {
496
+ if (h && De(h), m) {
497
+ Tt(h);
471
498
  return;
472
499
  }
473
- if (M(), H.current = null, !!t && !J()) {
474
- if (b) {
475
- if ($) {
476
- x(!1);
500
+ if (M(), $.current = null, !!t && !Q()) {
501
+ if (S) {
502
+ if (j) {
503
+ d(
504
+ !1,
505
+ "step-wait-suppressed-after-timeout"
506
+ );
477
507
  return;
478
508
  }
479
- x(!0);
509
+ d(!0, "step-waiting-for-first-audio");
480
510
  return;
481
511
  }
482
- if (I && !(fe && !ce))
512
+ if (I && !(me && !ue))
483
513
  return ne.current = window.setTimeout(() => {
484
- ne.current = null, T();
514
+ ne.current = null, E();
485
515
  }, Je), () => {
486
- W();
516
+ Y();
487
517
  };
488
518
  }
489
519
  }
490
520
  }, [
491
521
  I,
492
- W,
522
+ Y,
493
523
  k.length,
494
- f,
524
+ h,
525
+ g,
526
+ fe,
495
527
  S,
496
- de,
497
- b,
498
528
  Je,
499
- T,
500
- C,
501
- $,
502
- ce,
503
- me,
504
- Q,
529
+ E,
530
+ w,
531
+ j,
532
+ ue,
533
+ pe,
534
+ H,
505
535
  M,
506
- X,
507
- Tt,
508
536
  J,
509
- V,
510
- fe
537
+ Tt,
538
+ Q,
539
+ K,
540
+ me,
541
+ d
511
542
  ]), a(() => {
512
- if ($ || V || !b || Q) {
513
- x(!1);
543
+ if (j || K || !S || H) {
544
+ d(!1, "loading-hidden-blocked-state", {
545
+ shouldPausePlaybackForCustomAction: K,
546
+ shouldBlockPlaybackForInteraction: H
547
+ });
514
548
  return;
515
549
  }
516
- if (C) {
517
- x(!1);
550
+ if (w) {
551
+ d(
552
+ !1,
553
+ "loading-hidden-step-audio-completed"
554
+ );
518
555
  return;
519
556
  }
520
557
  if (It) {
521
- x(!1);
558
+ d(!1, "loading-hidden-audio-available");
522
559
  return;
523
560
  }
524
- x(!0);
561
+ d(!0, "loading-visible-awaiting-step-audio");
525
562
  }, [
526
- $,
563
+ j,
527
564
  It,
528
- b,
529
- C,
530
- V,
531
- Q
565
+ S,
566
+ w,
567
+ K,
568
+ H,
569
+ d
532
570
  ]), a(() => {
533
- S || E.length === 0 || V || !b || Q || C || J();
571
+ g || C.length === 0 || K || !S || H || w || Q();
534
572
  }, [
535
- S,
536
- E,
537
- b,
573
+ g,
538
574
  C,
539
- V,
540
- Q,
541
- J
575
+ S,
576
+ w,
577
+ K,
578
+ H,
579
+ Q
542
580
  ]), a(() => {
543
- !S || g >= 0 || U(null);
544
- }, [g, S]), a(() => {
545
- g >= 0 || z.reset();
546
- }, [g, z]), a(() => {
547
- Le(!1);
548
- }, [ln]);
549
- const Et = u(() => {
550
- if (!i)
581
+ !g || A >= 0 || z(null);
582
+ }, [A, g]), a(() => {
583
+ A >= 0 || G.reset();
584
+ }, [A, G]), a(() => {
585
+ Ke(!1);
586
+ }, [an]);
587
+ const Et = c(() => {
588
+ if (!s)
551
589
  return {};
552
- const e = !!i.user_input?.trim();
553
- return Cn(
554
- typeof i.content == "string" ? i.content : void 0,
555
- i.user_input,
556
- e ? void 0 : he
590
+ const e = !!s.user_input?.trim();
591
+ return Rn(
592
+ typeof s.content == "string" ? s.content : void 0,
593
+ s.user_input,
594
+ e ? void 0 : ve
557
595
  );
558
- }, [i, he]), an = u(() => {
559
- if (!i)
596
+ }, [s, ve]), un = c(() => {
597
+ if (!s)
560
598
  return;
561
- const e = !!i.user_input?.trim();
562
- return Rn(
563
- typeof i.content == "string" ? i.content : void 0,
564
- i.user_input,
565
- e ? void 0 : he
599
+ const e = !!s.user_input?.trim();
600
+ return Pn(
601
+ typeof s.content == "string" ? s.content : void 0,
602
+ s.user_input,
603
+ e ? void 0 : ve
566
604
  );
567
- }, [i, he]), Ct = !!i?.user_input?.trim(), Rt = !!i?.readonly || Ct, Pt = Rt || Ct, Ye = !!i && xe, cn = r(
605
+ }, [s, ve]), Ct = !!s?.user_input?.trim(), Rt = !!s?.readonly || Ct, Pt = Rt || Ct, Ye = !!s && xe, cn = n(
568
606
  (e) => {
569
607
  const l = [
570
608
  ...e.selectedValues ?? [],
571
609
  e.inputText?.trim() ?? "",
572
610
  e.buttonText?.trim() ?? ""
573
611
  ].filter(Boolean).join(", ");
574
- De((h) => !h || !l ? h : {
575
- ...h,
612
+ De((m) => !m || !l ? m : {
613
+ ...m,
576
614
  user_input: l
577
- }), Qe?.(e, i), Te();
615
+ }), Qe?.(e, s), Ee();
578
616
  },
579
- [i, Te, Qe]
617
+ [s, Ee, Qe]
580
618
  );
581
619
  a(() => {
582
620
  const e = () => {
583
- zt(document.fullscreenElement === ve.current);
621
+ Gt(document.fullscreenElement === ye.current);
584
622
  };
585
623
  return e(), document.addEventListener("fullscreenchange", e), () => {
586
624
  document.removeEventListener("fullscreenchange", e);
587
625
  };
588
626
  }, []), a(() => {
589
627
  if (!Ye) {
590
- ue(0);
628
+ ce(0);
591
629
  return;
592
630
  }
593
- const e = st.current;
631
+ const e = it.current;
594
632
  if (!e)
595
633
  return;
596
634
  const t = () => {
597
- const h = Math.ceil(
635
+ const m = Math.ceil(
598
636
  e.getBoundingClientRect().height
599
637
  );
600
- ue(
601
- h + Qn
638
+ ce(
639
+ m + Zn
602
640
  );
603
641
  };
604
642
  if (t(), typeof ResizeObserver > "u")
@@ -612,17 +650,17 @@ const Zn = (o, s) => o.length === s.length && o.every((F, O) => {
612
650
  }, [Ye]), a(() => {
613
651
  if (B(), !(!xe || !Pt))
614
652
  return re.current = window.setTimeout(() => {
615
- re.current = null, Te();
653
+ re.current = null, Ee();
616
654
  }, 2e3), () => {
617
655
  B();
618
656
  };
619
657
  }, [
620
658
  B,
621
- Te,
659
+ Ee,
622
660
  xe,
623
661
  Pt
624
662
  ]);
625
- const un = (e, t = {}) => e ? e.type === "slot" ? /* @__PURE__ */ n.jsx(n.Fragment, { children: e.content }) : e.type === "html" ? /* @__PURE__ */ n.jsx(
663
+ const dn = (e, t = {}) => e ? e.type === "slot" ? /* @__PURE__ */ r.jsx(r.Fragment, { children: e.content }) : e.type === "html" ? /* @__PURE__ */ r.jsx(
626
664
  Ot,
627
665
  {
628
666
  className: "content-render-iframe",
@@ -633,7 +671,7 @@ const Zn = (o, s) => o.length === s.length && o.every((F, O) => {
633
671
  content: e.content,
634
672
  enableScaling: Bt
635
673
  }
636
- ) : /* @__PURE__ */ n.jsx(
674
+ ) : /* @__PURE__ */ r.jsx(
637
675
  Ot,
638
676
  {
639
677
  className: "content-render-iframe",
@@ -642,36 +680,36 @@ const Zn = (o, s) => o.length === s.length && o.every((F, O) => {
642
680
  type: "markdown",
643
681
  content: e.content
644
682
  }
645
- ) : null, dn = (e = [], t = !1) => {
683
+ ) : null, fn = (e = [], t = !1) => {
646
684
  if (e.length === 0)
647
685
  return null;
648
686
  const l = e.filter(
649
- (c) => c.is_renderable !== !1
650
- ).length, h = e.reduce(
651
- (c, d, _) => d.is_renderable !== !1 ? _ : c,
687
+ (u) => u.is_renderable !== !1
688
+ ).length, m = e.reduce(
689
+ (u, p, T) => p.is_renderable !== !1 ? T : u,
652
690
  -1
653
691
  );
654
- return /* @__PURE__ */ n.jsx("div", { className: "slide-stage__content flex w-full flex-col gap-4", children: e.map((c, d) => {
655
- const _ = c.type === "html" && c.is_renderable === !1;
656
- return /* @__PURE__ */ n.jsx(
692
+ return /* @__PURE__ */ r.jsx("div", { className: "slide-stage__content flex w-full flex-col gap-4", children: e.map((u, p) => {
693
+ const T = u.type === "html" && u.is_renderable === !1;
694
+ return /* @__PURE__ */ r.jsx(
657
695
  "div",
658
696
  {
659
- ref: t && d === h ? ot : null,
660
- "aria-hidden": _ || void 0,
697
+ ref: t && p === m ? ot : null,
698
+ "aria-hidden": T || void 0,
661
699
  className: Z(
662
700
  "w-full shrink-0",
663
- l === 1 && c.is_renderable !== !1 && "slide-element--single",
664
- _ ? "pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0" : c.is_renderable === !1 && "hidden"
701
+ l === 1 && u.is_renderable !== !1 && "slide-element--single",
702
+ T ? "pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0" : u.is_renderable === !1 && "hidden"
665
703
  ),
666
- children: un(c, {
667
- replaceRootScreenHeightWithFull: l === 1 && c.type === "html" && c.is_renderable !== !1
704
+ children: dn(u, {
705
+ replaceRootScreenHeightWithFull: l === 1 && u.type === "html" && u.is_renderable !== !1
668
706
  })
669
707
  },
670
- c.sequence_number ?? `${c.type}-${d}`
708
+ u.sequence_number ?? `${u.type}-${p}`
671
709
  );
672
710
  }) });
673
- }, fn = r(() => {
674
- const e = ve.current;
711
+ }, mn = n(() => {
712
+ const e = ye.current;
675
713
  if (e) {
676
714
  if (document.fullscreenElement === e) {
677
715
  document.exitFullscreen().catch(() => {
@@ -681,102 +719,119 @@ const Zn = (o, s) => o.length === s.length && o.every((F, O) => {
681
719
  e.requestFullscreen?.().catch(() => {
682
720
  });
683
721
  }
684
- }, []), Mt = r(() => {
685
- const e = ke.current;
722
+ }, []), Mt = n(() => {
723
+ const e = Ne.current;
686
724
  e && e.scrollTo({
687
725
  top: e.scrollHeight,
688
726
  behavior: "smooth"
689
727
  });
690
- }, []), mn = r(() => {
691
- ye.current = !0, H.current = null, ae(!0), x(!1), A(!0), X(), ut();
692
- }, [ut, X, A]), pn = r(() => {
693
- ye.current = !0, H.current = null, ae(!0), x(!1), A(!0), X(), T();
694
- }, [T, X, A]), hn = r(
728
+ }, []), pn = n(() => {
729
+ ge.current = !0, $.current = null, ae(!0), d(!1, "player-prev"), x(!0), J(), ct();
730
+ }, [
731
+ ct,
732
+ J,
733
+ x,
734
+ d
735
+ ]), hn = n(() => {
736
+ ge.current = !0, $.current = null, ae(!0), d(!1, "player-next"), x(!0), J(), E();
737
+ }, [
738
+ E,
739
+ J,
740
+ x,
741
+ d
742
+ ]), vn = n(
695
743
  (e) => {
696
- if ($ || !b || C) {
697
- x(!1);
744
+ if (j || !S || w) {
745
+ d(!1, "player-loading-change-ignored", {
746
+ loading: e
747
+ });
698
748
  return;
699
749
  }
700
- x(e);
750
+ d(
751
+ e,
752
+ e ? "player-reported-loading" : "player-reported-ready"
753
+ );
701
754
  },
702
755
  [
703
- b,
704
- C,
705
- $
756
+ S,
757
+ w,
758
+ j,
759
+ d
706
760
  ]
707
- ), vn = r(
761
+ ), yn = n(
708
762
  (e) => {
709
- const t = y[e]?.audioKey;
710
- if (!t || !S || t !== S)
763
+ const t = b[e]?.audioKey;
764
+ if (!t || !g || t !== g)
711
765
  return;
712
- const l = E.findIndex(
713
- (d) => d === t
766
+ const l = C.findIndex(
767
+ (p) => p === t
714
768
  );
715
769
  if (l < 0) {
716
- U(null);
770
+ z(null);
717
771
  return;
718
772
  }
719
- const h = l + 1, c = E[h];
720
- if (c) {
721
- U(c);
773
+ const m = l + 1, u = C[m];
774
+ if (u) {
775
+ z(u);
722
776
  return;
723
777
  }
724
- if (U(null), mt(!0), x(!1), I) {
725
- const d = p + 1, _ = N[d];
726
- _t && _?.type === "interaction" && (H.current = d), T();
778
+ if (z(null), mt(!0), d(!1, "player-ended-step-complete"), I) {
779
+ const p = f + 1, T = N[p];
780
+ _t && T?.type === "interaction" && ($.current = p), E();
727
781
  }
728
782
  },
729
783
  [
730
- y,
784
+ b,
731
785
  I,
732
- p,
733
- S,
786
+ f,
787
+ g,
788
+ C,
734
789
  E,
735
- T,
736
790
  _t,
737
- N
791
+ N,
792
+ d
738
793
  ]
739
- ), yn = r(() => {
740
- i && Ae((e) => !e);
741
- }, [i]), Ft = r(
794
+ ), gn = n(() => {
795
+ s && Ie((e) => !e);
796
+ }, [s]), Ft = n(
742
797
  (e) => {
743
- e.stopPropagation(), P && A(!0);
798
+ e.stopPropagation(), P && x(!0);
744
799
  },
745
- [dt, A]
746
- ), Sn = r(
800
+ [dt, x]
801
+ ), Sn = n(
747
802
  (e) => {
748
803
  nt?.(e);
749
804
  },
750
805
  [nt]
751
- ), gn = r(() => {
752
- ae(!0), A(!0);
753
- }, [A]), Ee = u(
806
+ ), bn = n(() => {
807
+ ae(!0), x(!0);
808
+ }, [x]), Ce = c(
754
809
  () => k.map(
755
810
  (e, t) => `${e.sequence_number ?? `${e.type}-${t}`}:${String(e.is_new ?? "")}`
756
811
  ),
757
812
  [k]
758
813
  );
759
814
  return a(() => {
760
- const e = it.current, h = (e.length > 0 && e.length < Ee.length && e.every((d, _) => d === Ee[_]) ? k.slice(e.length) : []).some(
761
- (d) => d.is_new === !1
815
+ const e = lt.current, m = (e.length > 0 && e.length < Ce.length && e.every((p, T) => p === Ce[T]) ? k.slice(e.length) : []).some(
816
+ (p) => p.is_new === !1
762
817
  );
763
- if (it.current = Ee, !h)
818
+ if (lt.current = Ce, !m)
764
819
  return;
765
- const c = window.requestAnimationFrame(() => {
766
- const d = ke.current, _ = ot.current;
767
- if (!d || !_)
820
+ const u = window.requestAnimationFrame(() => {
821
+ const p = Ne.current, T = ot.current;
822
+ if (!p || !T)
768
823
  return;
769
- const bn = d.getBoundingClientRect(), xn = _.getBoundingClientRect(), An = d.scrollTop + (xn.top - bn.top);
770
- d.scrollTo({
771
- top: Math.max(An, 0),
824
+ const An = p.getBoundingClientRect(), xn = T.getBoundingClientRect(), In = p.scrollTop + (xn.top - An.top);
825
+ p.scrollTo({
826
+ top: Math.max(In, 0),
772
827
  behavior: "smooth"
773
828
  });
774
829
  });
775
830
  return () => {
776
- window.cancelAnimationFrame(c);
831
+ window.cancelAnimationFrame(u);
777
832
  };
778
- }, [k, Ee]), a(() => {
779
- if (!ye.current || (ye.current = !1, k.length === 0))
833
+ }, [k, Ce]), a(() => {
834
+ if (!ge.current || (ge.current = !1, k.length === 0))
780
835
  return;
781
836
  const e = window.requestAnimationFrame(() => {
782
837
  Mt();
@@ -784,69 +839,69 @@ const Zn = (o, s) => o.length === s.length && o.every((F, O) => {
784
839
  return () => {
785
840
  window.cancelAnimationFrame(e);
786
841
  };
787
- }, [k, Mt]), /* @__PURE__ */ n.jsxs(
842
+ }, [k, Mt]), /* @__PURE__ */ r.jsxs(
788
843
  "section",
789
844
  {
790
- ref: ve,
845
+ ref: ye,
791
846
  className: Z(
792
847
  "relative h-full w-full",
793
848
  R && "slide--mobile-device",
794
- G && "slide--mobile-landscape",
849
+ W && "slide--mobile-landscape",
795
850
  yt && "slide--mobile-landscape-native",
796
851
  jt
797
852
  ),
798
- onClick: gn,
853
+ onClick: bn,
799
854
  onPointerDown: Sn,
800
855
  ...Lt,
801
856
  children: [
802
- Jt ? /* @__PURE__ */ n.jsx(
857
+ Qt ? /* @__PURE__ */ r.jsx(
803
858
  "div",
804
859
  {
805
860
  "aria-hidden": "true",
806
861
  className: "pointer-events-none fixed left-0 top-0 z-[9999] h-[100vh] max-h-[100vh] w-[100vw]"
807
862
  }
808
863
  ) : null,
809
- /* @__PURE__ */ n.jsxs(
864
+ /* @__PURE__ */ r.jsxs(
810
865
  "div",
811
866
  {
812
867
  ref: rt,
813
868
  className: Z(
814
869
  "slide__viewport relative h-full min-h-0 w-full",
815
- G && "slide__viewport--mobile-landscape",
816
- G && !Wt && "slide__viewport--mobile-landscape-native"
870
+ W && "slide__viewport--mobile-landscape",
871
+ W && !Yt && "slide__viewport--mobile-landscape-native"
817
872
  ),
818
873
  children: [
819
- Yt ? /* @__PURE__ */ n.jsxs("div", { className: "slide-landscape-header", children: [
820
- /* @__PURE__ */ n.jsx(
874
+ Xt ? /* @__PURE__ */ r.jsxs("div", { className: "slide-landscape-header", children: [
875
+ /* @__PURE__ */ r.jsx(
821
876
  "button",
822
877
  {
823
- "aria-label": K?.backAriaLabel ?? "Back",
878
+ "aria-label": q?.backAriaLabel ?? "Back",
824
879
  className: "slide-landscape-header__back",
825
- onClick: en,
880
+ onClick: tn,
826
881
  type: "button",
827
- children: /* @__PURE__ */ n.jsx(Wn, { className: "h-6 w-6 text-white", strokeWidth: 2.25 })
882
+ children: /* @__PURE__ */ r.jsx(Yn, { className: "h-6 w-6 text-white", strokeWidth: 2.25 })
828
883
  }
829
884
  ),
830
- K?.content ? /* @__PURE__ */ n.jsx("div", { className: "min-w-0 flex-1 overflow-hidden", children: K.content }) : null
885
+ q?.content ? /* @__PURE__ */ r.jsx("div", { className: "min-w-0 flex-1 overflow-hidden", children: q.content }) : null
831
886
  ] }) : null,
832
- /* @__PURE__ */ n.jsx(
887
+ /* @__PURE__ */ r.jsx(
833
888
  "div",
834
889
  {
835
890
  className: Z(
836
891
  "h-full min-h-0 w-full",
837
- Xt && "slide__viewport-content--with-header",
892
+ Jt && "slide__viewport-content--with-header",
838
893
  Vt ? "slide-content--single" : "grid gap-4"
839
894
  ),
840
- children: k.length > 0 ? /* @__PURE__ */ n.jsx("div", { className: "slide-stage", children: /* @__PURE__ */ n.jsx("div", { ref: ke, className: "slide-stage__layer w-full", children: nn.map(
895
+ children: k.length > 0 ? /* @__PURE__ */ r.jsx("div", { className: "slide-stage", children: /* @__PURE__ */ r.jsx("div", { ref: Ne, className: "slide-stage__layer w-full", children: rn.map(
841
896
  (e, t) => {
842
- const l = t === rn;
843
- return /* @__PURE__ */ n.jsx(
897
+ const l = t === on;
898
+ return /* @__PURE__ */ r.jsx(
844
899
  "div",
845
900
  {
846
901
  "aria-hidden": !l || void 0,
847
902
  className: "w-full h-full",
848
903
  style: { display: l ? void 0 : "none" },
849
- children: dn(
904
+ children: fn(
850
905
  e.elementList,
851
906
  l
852
907
  )
@@ -857,101 +912,101 @@ const Zn = (o, s) => o.length === s.length && o.every((F, O) => {
857
912
  ) }) }) : null
858
913
  }
859
914
  ),
860
- Dt ? /* @__PURE__ */ n.jsx(
861
- Tn,
915
+ qt ? /* @__PURE__ */ r.jsx(
916
+ En,
862
917
  {
863
- message: Re,
918
+ message: Pe,
864
919
  className: "absolute left-1/2 top-1/2 z-[3] -translate-x-1/2 -translate-y-1/2"
865
920
  }
866
921
  ) : null,
867
- /* @__PURE__ */ n.jsx(
868
- jn,
922
+ /* @__PURE__ */ r.jsx(
923
+ Ln,
869
924
  {
870
- onClose: tn,
871
- open: Gt,
872
- text: Qt
925
+ onClose: nn,
926
+ open: Wt,
927
+ text: Zt
873
928
  }
874
929
  ),
875
- /* @__PURE__ */ n.jsx(
876
- On,
930
+ /* @__PURE__ */ r.jsx(
931
+ kn,
877
932
  {
878
- extraBottomOffset: Ut,
933
+ extraBottomOffset: $t,
879
934
  hasPlayerGap: P,
880
- isEnabled: pt && qt,
881
- isPlayerHidden: w && !P,
882
- playbackTimeStore: z,
883
- subtitleCues: on
935
+ isEnabled: pt && Ht,
936
+ isPlayerHidden: _ && !P,
937
+ playbackTimeStore: G,
938
+ subtitleCues: ln
884
939
  }
885
940
  ),
886
- Ye ? /* @__PURE__ */ n.jsx(
941
+ Ye ? /* @__PURE__ */ r.jsx(
887
942
  "div",
888
943
  {
889
- ref: st,
944
+ ref: it,
890
945
  className: Z(
891
946
  "slide-interaction-overlay",
892
- P && w ? "slide-interaction-overlay--with-player" : "slide-interaction-overlay--standalone"
947
+ P && _ ? "slide-interaction-overlay--with-player" : "slide-interaction-overlay--standalone"
893
948
  ),
894
949
  onClick: Ft,
895
950
  onPointerDown: Ft,
896
951
  style: sn,
897
- children: /* @__PURE__ */ n.jsx(
952
+ children: /* @__PURE__ */ r.jsx(
898
953
  Nt,
899
954
  {
900
- content: String(i?.content ?? ""),
955
+ content: String(s?.content ?? ""),
901
956
  defaultButtonText: Et.buttonText ?? "",
902
957
  defaultInputText: Et.inputText ?? "",
903
- defaultSelectedValues: an,
904
- confirmButtonText: pe?.confirmButtonText,
905
- copyButtonText: pe?.copyButtonText,
906
- copiedButtonText: pe?.copiedButtonText,
958
+ defaultSelectedValues: un,
959
+ confirmButtonText: he?.confirmButtonText,
960
+ copyButtonText: he?.copyButtonText,
961
+ copiedButtonText: he?.copiedButtonText,
907
962
  onSend: cn,
908
963
  readonly: Rt,
909
- title: pe?.title ?? Pe ?? "Submit the content below to continue."
964
+ title: he?.title ?? Me ?? "Submit the content below to continue."
910
965
  }
911
966
  )
912
967
  }
913
968
  ) : null,
914
- w ? /* @__PURE__ */ n.jsx(
915
- Fn,
969
+ _ ? /* @__PURE__ */ r.jsx(
970
+ On,
916
971
  {
917
- audioList: y,
972
+ audioList: b,
918
973
  className: Z(
919
974
  "absolute left-1/2 bottom-6 z-[2] -translate-x-1/2",
920
- L,
975
+ V,
921
976
  !P && "pointer-events-none opacity-0"
922
977
  ),
923
- currentAudioIndex: g,
978
+ currentAudioIndex: A,
924
979
  defaultPlaying: !0,
925
- isPlaybackPaused: V,
926
- isAutoAdvanceEnabled: ce,
927
- hasInteraction: !!i,
980
+ isPlaybackPaused: K,
981
+ isAutoAdvanceEnabled: ue,
982
+ hasInteraction: !!s,
928
983
  isInteractionOpen: xe,
929
984
  isSubtitleEnabled: pt,
930
985
  onAutoAdvanceToggle: ft,
931
- onLoadingChange: hn,
986
+ onLoadingChange: vn,
932
987
  onPlaybackStarted: () => {
933
- Le(!0);
988
+ Ke(!0);
934
989
  },
935
- onPlaybackTimeChange: z.setTime,
990
+ onPlaybackTimeChange: G.setTime,
936
991
  onSubtitleToggle: () => {
937
- Ht((e) => !e);
992
+ Ut((e) => !e);
938
993
  },
939
994
  nextDisabled: !I,
940
- onEnded: vn,
941
- onFullscreen: fn,
942
- isFullscreen: $t,
943
- mobileViewMode: j,
995
+ onEnded: yn,
996
+ onFullscreen: mn,
997
+ isFullscreen: zt,
998
+ mobileViewMode: L,
944
999
  settingsPortalContainer: rt.current,
945
- onMobileViewModeChange: Zt,
946
- onInteractionToggle: yn,
947
- onNext: pn,
948
- onPrev: mn,
1000
+ onMobileViewModeChange: en,
1001
+ onInteractionToggle: gn,
1002
+ onNext: hn,
1003
+ onPrev: pn,
949
1004
  prevDisabled: !Kt,
950
1005
  showControls: P,
951
1006
  texts: Xe,
952
1007
  customActionContext: Ge,
953
- customActions: q,
954
- useAutoAdvanceToggle: fe
1008
+ customActions: U,
1009
+ useAutoAdvanceToggle: me
955
1010
  }
956
1011
  ) : null
957
1012
  ]
@@ -962,6 +1017,6 @@ const Zn = (o, s) => o.length === s.length && o.every((F, O) => {
962
1017
  );
963
1018
  };
964
1019
  export {
965
- Pr as default
1020
+ Mr as default
966
1021
  };
967
1022
  //# sourceMappingURL=Slide.es.js.map