markdown-flow-ui 0.1.108 → 0.1.109

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