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

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