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