markdown-flow-ui 0.2.3-dev.1 → 0.2.3-dev.2

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