markdown-flow-ui 0.1.115-beta.3 → 0.1.115-beta.5

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