markdown-flow-ui 0.1.124 → 0.1.126

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