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