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