markdown-flow-ui 0.2.25-dev.2 → 0.2.25-dev.3

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