markdown-flow-ui 0.1.111 → 0.1.112-beta.1

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