markdown-flow-ui 0.1.109 → 0.1.112-beta.0

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