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