markdown-flow-ui 0.1.128 → 0.1.129

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