@deep-eye/core 0.9.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +86 -0
- package/README.md +113 -174
- package/dist/components/chat/ChatBot.vue.d.ts +48 -17
- package/dist/components/chat/ChatBot.vue.d.ts.map +1 -1
- package/dist/components/chat/attachmentController.d.ts +25 -0
- package/dist/components/chat/attachmentController.d.ts.map +1 -0
- package/dist/components/chat/attachments.d.ts +12 -0
- package/dist/components/chat/attachments.d.ts.map +1 -0
- package/dist/components/chat/chatContext.d.ts +14 -0
- package/dist/components/chat/chatContext.d.ts.map +1 -0
- package/dist/components/chat/chatErrors.d.ts +16 -0
- package/dist/components/chat/chatErrors.d.ts.map +1 -0
- package/dist/components/chat/chatQueue.d.ts +6 -0
- package/dist/components/chat/chatQueue.d.ts.map +1 -0
- package/dist/components/chat/components/ArtifactPreview.vue.d.ts.map +1 -1
- package/dist/components/chat/components/ChatActionbar.vue.d.ts +3 -3
- package/dist/components/chat/components/ChatActionbar.vue.d.ts.map +1 -1
- package/dist/components/chat/components/ChatAttachments.vue.d.ts +12 -0
- package/dist/components/chat/components/ChatAttachments.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatFilePreview.vue.d.ts +45 -0
- package/dist/components/chat/components/ChatFilePreview.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatFilePreviewPanel.vue.d.ts +24 -0
- package/dist/components/chat/components/ChatFilePreviewPanel.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatImageLightbox.vue.d.ts +16 -0
- package/dist/components/chat/components/ChatImageLightbox.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatMediaPreview.vue.d.ts +9 -0
- package/dist/components/chat/components/ChatMediaPreview.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatMessage.vue.d.ts +43 -2
- package/dist/components/chat/components/ChatMessage.vue.d.ts.map +1 -1
- package/dist/components/chat/components/ChatOfficePreview.vue.d.ts +9 -0
- package/dist/components/chat/components/ChatOfficePreview.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatProvider.vue.d.ts +73 -0
- package/dist/components/chat/components/ChatProvider.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatQueue.vue.d.ts +16 -0
- package/dist/components/chat/components/ChatQueue.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatReasoning.vue.d.ts +21 -0
- package/dist/components/chat/components/ChatReasoning.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatSender.vue.d.ts +34 -17
- package/dist/components/chat/components/ChatSender.vue.d.ts.map +1 -1
- package/dist/components/chat/components/ChatSidebarResizeHandle.vue.d.ts +13 -0
- package/dist/components/chat/components/ChatSidebarResizeHandle.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatToolGroup.vue.d.ts +28 -0
- package/dist/components/chat/components/ChatToolGroup.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ConversationList.vue.d.ts +129 -0
- package/dist/components/chat/components/ConversationList.vue.d.ts.map +1 -0
- package/dist/components/chat/components/InputContentParts.vue.d.ts +8 -0
- package/dist/components/chat/components/InputContentParts.vue.d.ts.map +1 -0
- package/dist/components/chat/components/MessageBubble.vue.d.ts +43 -2
- package/dist/components/chat/components/MessageBubble.vue.d.ts.map +1 -1
- package/dist/components/chat/components/TextPartRenderer.vue.d.ts.map +1 -1
- package/dist/components/chat/components/ToolCallPart.vue.d.ts +12 -3
- package/dist/components/chat/components/ToolCallPart.vue.d.ts.map +1 -1
- package/dist/components/chat/components/index.d.ts +9 -0
- package/dist/components/chat/components/index.d.ts.map +1 -1
- package/dist/components/chat/composables/index.d.ts +0 -1
- package/dist/components/chat/composables/index.d.ts.map +1 -1
- package/dist/components/chat/composables/useChatVoice.d.ts +45 -0
- package/dist/components/chat/composables/useChatVoice.d.ts.map +1 -0
- package/dist/components/chat/composables/useConversation.d.ts +1 -5
- package/dist/components/chat/composables/useConversation.d.ts.map +1 -1
- package/dist/components/chat/composables/useMeasuredHeight.d.ts +11 -0
- package/dist/components/chat/composables/useMeasuredHeight.d.ts.map +1 -0
- package/dist/components/chat/composables/useStreamSmoothing.d.ts +13 -0
- package/dist/components/chat/composables/useStreamSmoothing.d.ts.map +1 -0
- package/dist/components/chat/index.d.ts +12 -4
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/mdoc/ContentNodes.vue.d.ts.map +1 -1
- package/dist/components/chat/mdoc/MediaImageStack.vue.d.ts.map +1 -1
- package/dist/components/chat/previewRenderers.d.ts +6 -0
- package/dist/components/chat/previewRenderers.d.ts.map +1 -0
- package/dist/components/chat/qiniuUpload.d.ts +10 -0
- package/dist/components/chat/qiniuUpload.d.ts.map +1 -0
- package/dist/components/chat/responseStream.d.ts +17 -0
- package/dist/components/chat/responseStream.d.ts.map +1 -0
- package/dist/components/chat/toolLabels.d.ts +4 -0
- package/dist/components/chat/toolLabels.d.ts.map +1 -0
- package/dist/components/chat/toolStatus.d.ts +16 -0
- package/dist/components/chat/toolStatus.d.ts.map +1 -0
- package/dist/components/chat/types.d.ts +457 -144
- package/dist/components/chat/types.d.ts.map +1 -1
- package/dist/components/visualization/types.d.ts +8 -7
- package/dist/components/visualization/types.d.ts.map +1 -1
- package/dist/components/visualization/utils.d.ts +4 -2
- package/dist/components/visualization/utils.d.ts.map +1 -1
- package/dist/composables/useMindMapTheme.d.ts +4 -7
- package/dist/composables/useMindMapTheme.d.ts.map +1 -1
- package/dist/errors-CHzikrqu.js +70 -0
- package/dist/errors-upLl4kf2.cjs +1 -0
- package/dist/index-B4hgICk-.cjs +198 -0
- package/dist/index-BJdNN1GV.cjs +33 -0
- package/dist/index-Bj9h-xEr.cjs +112 -0
- package/dist/index-BufnUXnQ.js +5071 -0
- package/dist/index-CnxZBHPD.js +42825 -0
- package/dist/index-DF8KmkKX.js +38392 -0
- package/dist/index-DPhuLMkO.cjs +1 -0
- package/dist/index-Dq4cniDm.cjs +5 -0
- package/dist/index-cW_BnxHR.js +1722 -0
- package/dist/index-iCVvFIlX.js +28 -0
- package/dist/index.cjs +275 -134
- package/dist/index.js +20496 -10365
- package/dist/media-community-skin-Djo8L1G9.js +302 -0
- package/dist/media-community-skin-YI6NjsJg.cjs +1 -0
- package/dist/media-core-CkW37AYl.js +3827 -0
- package/dist/media-core-Rxz2MNwG.cjs +1 -0
- package/dist/media-outlet-CZTh6XmJ.cjs +1 -0
- package/dist/media-outlet-D2rcuhYN.js +2 -0
- package/dist/media-player-BZrIM0O_.js +387 -0
- package/dist/media-player-D_USOhtK.cjs +1 -0
- package/dist/media-ui-DfPbRfFS.js +2832 -0
- package/dist/media-ui-zZVnK1ts.cjs +1 -0
- package/dist/prod-Ba2x-T01.cjs +4 -0
- package/dist/prod-DBMM0zDd.js +992 -0
- package/dist/provider-B7wAEcCR.js +163 -0
- package/dist/provider-BPphQwpc.cjs +1 -0
- package/dist/provider-BSeBwvzM.cjs +1 -0
- package/dist/provider-DgSZc2dM.js +162 -0
- package/dist/provider-EKFFiZS1.js +27 -0
- package/dist/provider-O8r0RFmF.cjs +1 -0
- package/dist/provider-WrRdjcjY.js +483 -0
- package/dist/provider-sqICX3H9.cjs +1 -0
- package/dist/srt-parser-BECMkbXb.cjs +2 -0
- package/dist/srt-parser-BR28Llpk.js +27 -0
- package/dist/ssa-parser-BJTK0kd-.js +209 -0
- package/dist/ssa-parser-CuKkTpK_.cjs +4 -0
- package/dist/style.css +1 -1
- package/package.json +7 -2
- package/dist/components/chat/AiConversation.vue.d.ts +0 -28
- package/dist/components/chat/AiConversation.vue.d.ts.map +0 -1
- package/dist/components/chat/components/AssistantTrace.vue.d.ts +0 -27
- package/dist/components/chat/components/AssistantTrace.vue.d.ts.map +0 -1
- package/dist/components/chat/composables/useConversationStream.d.ts +0 -3
- package/dist/components/chat/composables/useConversationStream.d.ts.map +0 -1
- package/dist/components/chat/presentation.d.ts +0 -27
- package/dist/components/chat/presentation.d.ts.map +0 -1
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
var k = Object.defineProperty;
|
|
2
|
+
var y = (d, t, i) => t in d ? k(d, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : d[t] = i;
|
|
3
|
+
var n = (d, t, i) => y(d, typeof t != "symbol" ? t + "" : t, i);
|
|
4
|
+
import { z as p, Z as l, aT as f, t as u, q as b, aL as v, aN as L, aU as E, aV as c, aW as w, aX as g, aY as z, X as j, aF as S, x as A, aD as _, aZ as q, aG as O, a_ as R, a$ as M, b0 as N, u as I, b1 as $, Y as C } from "./media-core-CkW37AYl.js";
|
|
5
|
+
import { y as m } from "./media-ui-DfPbRfFS.js";
|
|
6
|
+
class T {
|
|
7
|
+
constructor(t) {
|
|
8
|
+
n(this, "xi");
|
|
9
|
+
this.jf = t;
|
|
10
|
+
}
|
|
11
|
+
O() {
|
|
12
|
+
j(this.xi) && this.yi();
|
|
13
|
+
}
|
|
14
|
+
P() {
|
|
15
|
+
S(this.xi) && window.cancelAnimationFrame(this.xi), this.xi = void 0;
|
|
16
|
+
}
|
|
17
|
+
yi() {
|
|
18
|
+
this.xi = window.requestAnimationFrame(() => {
|
|
19
|
+
j(this.xi) || (this.jf(), this.yi());
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const P = (d) => A(d);
|
|
24
|
+
class W {
|
|
25
|
+
constructor(t) {
|
|
26
|
+
n(this, "ph");
|
|
27
|
+
n(this, "za", null);
|
|
28
|
+
n(this, "qh", null);
|
|
29
|
+
n(this, "nh", {});
|
|
30
|
+
n(this, "oh", /* @__PURE__ */ new Set());
|
|
31
|
+
this.qa = t;
|
|
32
|
+
}
|
|
33
|
+
get instance() {
|
|
34
|
+
return this.za;
|
|
35
|
+
}
|
|
36
|
+
setup(t, i) {
|
|
37
|
+
this.ph = i;
|
|
38
|
+
const s = p(i.$store.streamType).includes("live"), a = p(i.$store.streamType).includes("ll-");
|
|
39
|
+
this.za = new t({
|
|
40
|
+
lowLatencyMode: a,
|
|
41
|
+
backBufferLength: a ? 4 : s ? 8 : void 0,
|
|
42
|
+
renderTextTracksNatively: !1,
|
|
43
|
+
...this.nh
|
|
44
|
+
});
|
|
45
|
+
const e = this.rh.bind(this);
|
|
46
|
+
for (const h of Object.values(t.Events))
|
|
47
|
+
this.za.on(h, e);
|
|
48
|
+
this.za.on(t.Events.ERROR, this.Wb.bind(this));
|
|
49
|
+
for (const h of this.oh)
|
|
50
|
+
h(this.za);
|
|
51
|
+
i.player.dispatchEvent(new l("hls-instance", { detail: this.za })), this.za.attachMedia(this.qa), this.za.on(t.Events.AUDIO_TRACK_SWITCHED, this.sh.bind(this)), this.za.on(t.Events.LEVEL_SWITCHED, this.th.bind(this)), this.za.on(t.Events.LEVEL_LOADED, this.uh.bind(this)), this.za.on(t.Events.NON_NATIVE_TEXT_TRACKS_FOUND, this.vh.bind(this)), this.za.on(t.Events.CUES_PARSED, this.wh.bind(this)), i.qualities[f] = this.xh.bind(this), u(i.qualities, "change", this.Pf.bind(this)), u(i.audioTracks, "change", this.yh.bind(this)), this.qh = b(this.zh.bind(this));
|
|
52
|
+
}
|
|
53
|
+
zh() {
|
|
54
|
+
if (!this.ph.$store.live())
|
|
55
|
+
return;
|
|
56
|
+
const t = new T(this.Ah.bind(this));
|
|
57
|
+
return t.O(), t.P.bind(t);
|
|
58
|
+
}
|
|
59
|
+
Ah() {
|
|
60
|
+
var t;
|
|
61
|
+
this.ph.$store.liveSyncPosition.set(((t = this.za) == null ? void 0 : t.liveSyncPosition) ?? 1 / 0);
|
|
62
|
+
}
|
|
63
|
+
rh(t, i) {
|
|
64
|
+
this.ph.player.dispatchEvent(new l(P(t), { detail: i }));
|
|
65
|
+
}
|
|
66
|
+
vh(t, i) {
|
|
67
|
+
const s = new l(t, { detail: i });
|
|
68
|
+
let a = -1;
|
|
69
|
+
for (let e = 0; e < i.tracks.length; e++) {
|
|
70
|
+
const h = i.tracks[e], o = h.subtitleTrack ?? h.closedCaptions, r = new v({
|
|
71
|
+
id: `hls-${h.kind}${e}`,
|
|
72
|
+
src: o == null ? void 0 : o.url,
|
|
73
|
+
label: h.label,
|
|
74
|
+
language: o == null ? void 0 : o.lang,
|
|
75
|
+
kind: h.kind
|
|
76
|
+
});
|
|
77
|
+
r[L] = 2, r[E] = () => {
|
|
78
|
+
r.mode === "showing" ? (this.za.subtitleTrack = e, a = e) : a === e && (this.za.subtitleTrack = -1, a = -1);
|
|
79
|
+
}, h.default && r.setMode("showing", s), this.ph.textTracks.add(r, s);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
wh(t, i) {
|
|
83
|
+
const s = this.ph.textTracks.getById(`hls-${i.track}`);
|
|
84
|
+
if (!s)
|
|
85
|
+
return;
|
|
86
|
+
const a = new l(t, { detail: i });
|
|
87
|
+
for (const e of i.cues)
|
|
88
|
+
e.positionAlign = "auto", s.addCue(e, a);
|
|
89
|
+
}
|
|
90
|
+
sh(t, i) {
|
|
91
|
+
const s = this.ph.audioTracks[i.id];
|
|
92
|
+
s && this.ph.audioTracks[c](
|
|
93
|
+
s,
|
|
94
|
+
!0,
|
|
95
|
+
new l(t, { detail: i })
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
th(t, i) {
|
|
99
|
+
const s = this.ph.qualities[i.level];
|
|
100
|
+
s && this.ph.qualities[c](
|
|
101
|
+
s,
|
|
102
|
+
!0,
|
|
103
|
+
new l(t, { detail: i })
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
uh(t, i) {
|
|
107
|
+
if (this.ph.$store.canPlay())
|
|
108
|
+
return;
|
|
109
|
+
const { type: s, live: a, totalduration: e } = i.details, h = new l(t, { detail: i });
|
|
110
|
+
this.ph.delegate.p("stream-type-change", {
|
|
111
|
+
detail: a ? s === "EVENT" && Number.isFinite(e) ? "live:dvr" : "live" : "on-demand",
|
|
112
|
+
trigger: h
|
|
113
|
+
}), this.ph.delegate.p("duration-change", { detail: e, trigger: h });
|
|
114
|
+
const o = this.za.media;
|
|
115
|
+
this.za.currentLevel === -1 && this.ph.qualities[w](!0, h);
|
|
116
|
+
for (const r of this.za.audioTracks)
|
|
117
|
+
this.ph.audioTracks[g](
|
|
118
|
+
{
|
|
119
|
+
id: r.id + "",
|
|
120
|
+
label: r.name,
|
|
121
|
+
language: r.lang || "",
|
|
122
|
+
kind: "main"
|
|
123
|
+
},
|
|
124
|
+
h
|
|
125
|
+
);
|
|
126
|
+
for (const r of this.za.levels)
|
|
127
|
+
this.ph.qualities[g](
|
|
128
|
+
{
|
|
129
|
+
width: r.width,
|
|
130
|
+
height: r.height,
|
|
131
|
+
codec: r.codecSet,
|
|
132
|
+
bitrate: r.bitrate
|
|
133
|
+
},
|
|
134
|
+
h
|
|
135
|
+
);
|
|
136
|
+
o.dispatchEvent(new l("canplay", { trigger: h }));
|
|
137
|
+
}
|
|
138
|
+
Wb(t, i) {
|
|
139
|
+
var s, a, e;
|
|
140
|
+
if (i.fatal)
|
|
141
|
+
switch (i.type) {
|
|
142
|
+
case "networkError":
|
|
143
|
+
(s = this.za) == null || s.startLoad();
|
|
144
|
+
break;
|
|
145
|
+
case "mediaError":
|
|
146
|
+
(a = this.za) == null || a.recoverMediaError();
|
|
147
|
+
break;
|
|
148
|
+
default:
|
|
149
|
+
(e = this.za) == null || e.destroy(), this.za = null;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
xh() {
|
|
154
|
+
this.za && (this.za.currentLevel = -1);
|
|
155
|
+
}
|
|
156
|
+
Pf() {
|
|
157
|
+
const { qualities: t } = this.ph;
|
|
158
|
+
!this.za || t.auto || (this.za[t.switch + "Level"] = t.selectedIndex, z && (this.qa.currentTime = this.qa.currentTime));
|
|
159
|
+
}
|
|
160
|
+
yh() {
|
|
161
|
+
const { audioTracks: t } = this.ph;
|
|
162
|
+
this.za && this.za.audioTrack !== t.selectedIndex && (this.za.audioTrack = t.selectedIndex);
|
|
163
|
+
}
|
|
164
|
+
Jg() {
|
|
165
|
+
var t, i;
|
|
166
|
+
this.ph && (this.ph.qualities[f] = void 0), (t = this.za) == null || t.destroy(), this.za = null, (i = this.qh) == null || i.call(this), this.qh = null;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
class D {
|
|
170
|
+
constructor(t, i) {
|
|
171
|
+
n(this, "ih", q());
|
|
172
|
+
n(this, "Nh", !1);
|
|
173
|
+
n(this, "Qh", !1);
|
|
174
|
+
n(this, "Rh", !1);
|
|
175
|
+
n(this, "Oh", new T(this.Wh.bind(this)));
|
|
176
|
+
n(this, "ni");
|
|
177
|
+
n(this, "pi");
|
|
178
|
+
this.q = t, this.ph = i, this.Uh(), b(this.Vh.bind(this)), _(this.Eh.bind(this));
|
|
179
|
+
}
|
|
180
|
+
get j() {
|
|
181
|
+
return this.q.media;
|
|
182
|
+
}
|
|
183
|
+
get jg() {
|
|
184
|
+
return this.ph.delegate;
|
|
185
|
+
}
|
|
186
|
+
Eh() {
|
|
187
|
+
this.Oh.P(), this.ih.empty();
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* The `timeupdate` event fires surprisingly infrequently during playback, meaning your progress
|
|
191
|
+
* bar (or whatever else is synced to the currentTime) moves in a choppy fashion. This helps
|
|
192
|
+
* resolve that by retrieving time updates in a request animation frame loop.
|
|
193
|
+
*/
|
|
194
|
+
Wh() {
|
|
195
|
+
const t = this.q.currentTime;
|
|
196
|
+
this.ph.$store.currentTime() !== t && this.Mh(t);
|
|
197
|
+
}
|
|
198
|
+
Uh() {
|
|
199
|
+
this.Lh("loadstart", this.ge), this.Lh("abort", this.Sh), this.Lh("emptied", this.Xh), this.Lh("error", this.Wb);
|
|
200
|
+
}
|
|
201
|
+
Yh() {
|
|
202
|
+
this.Qh || (this.ih.add(
|
|
203
|
+
this.Lh("loadeddata", this.Zh),
|
|
204
|
+
this.Lh("loadedmetadata", this._h),
|
|
205
|
+
this.Lh("canplay", this.Rb),
|
|
206
|
+
this.Lh("canplaythrough", this.$h),
|
|
207
|
+
this.Lh("durationchange", this.ai),
|
|
208
|
+
this.Lh("play", this.bi),
|
|
209
|
+
this.Lh("progress", this.ci),
|
|
210
|
+
this.Lh("stalled", this.di),
|
|
211
|
+
this.Lh("suspend", this.ei)
|
|
212
|
+
), this.Qh = !0);
|
|
213
|
+
}
|
|
214
|
+
fi() {
|
|
215
|
+
this.Rh || (this.ih.add(
|
|
216
|
+
this.Lh("pause", this.gi),
|
|
217
|
+
this.Lh("playing", this.hi),
|
|
218
|
+
this.Lh("ratechange", this.ii),
|
|
219
|
+
this.Lh("seeked", this.ji),
|
|
220
|
+
this.Lh("seeking", this.ki),
|
|
221
|
+
this.Lh("ended", this.li),
|
|
222
|
+
this.Lh("volumechange", this.ac),
|
|
223
|
+
this.Lh("waiting", this.mi)
|
|
224
|
+
), this.Rh = !0);
|
|
225
|
+
}
|
|
226
|
+
Lh(t, i) {
|
|
227
|
+
return u(
|
|
228
|
+
this.j,
|
|
229
|
+
t,
|
|
230
|
+
i.bind(this)
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
qi(t) {
|
|
234
|
+
}
|
|
235
|
+
Mh(t, i) {
|
|
236
|
+
this.jg.p("time-update", {
|
|
237
|
+
// Avoid errors where `currentTime` can have higher precision.
|
|
238
|
+
detail: {
|
|
239
|
+
currentTime: Math.min(t, this.ph.$store.seekableEnd()),
|
|
240
|
+
played: this.j.played
|
|
241
|
+
},
|
|
242
|
+
trigger: i
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
ge(t) {
|
|
246
|
+
if (this.j.networkState === 3) {
|
|
247
|
+
this.Sh(t);
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
this.Yh(), this.jg.p("load-start", { trigger: t });
|
|
251
|
+
}
|
|
252
|
+
Sh(t) {
|
|
253
|
+
this.jg.p("abort", { trigger: t });
|
|
254
|
+
}
|
|
255
|
+
Xh() {
|
|
256
|
+
this.jg.p("emptied", { trigger: event });
|
|
257
|
+
}
|
|
258
|
+
Zh(t) {
|
|
259
|
+
this.jg.p("loaded-data", { trigger: t });
|
|
260
|
+
}
|
|
261
|
+
_h(t) {
|
|
262
|
+
this.Th(), this.fi(), this.jg.p("volume-change", {
|
|
263
|
+
detail: {
|
|
264
|
+
volume: this.j.volume,
|
|
265
|
+
muted: this.j.muted
|
|
266
|
+
}
|
|
267
|
+
}), this.jg.p("loaded-metadata", { trigger: t }), O && R(this.ph.$store.source()) && this.jg.lf(this.Ph(), t);
|
|
268
|
+
}
|
|
269
|
+
Ph() {
|
|
270
|
+
return {
|
|
271
|
+
duration: this.j.duration,
|
|
272
|
+
buffered: this.j.buffered,
|
|
273
|
+
seekable: this.j.seekable
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
Th() {
|
|
277
|
+
const t = !Number.isFinite(this.j.duration);
|
|
278
|
+
this.jg.p("stream-type-change", {
|
|
279
|
+
detail: t ? "live" : "on-demand"
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
bi(t) {
|
|
283
|
+
this.ph.$store.canPlay && this.jg.p("play", { trigger: t });
|
|
284
|
+
}
|
|
285
|
+
gi(t) {
|
|
286
|
+
this.j.readyState === 1 && !this.Nh || (this.Nh = !1, this.Oh.P(), this.jg.p("pause", { trigger: t }));
|
|
287
|
+
}
|
|
288
|
+
Rb(t) {
|
|
289
|
+
this.jg.lf(this.Ph(), t);
|
|
290
|
+
}
|
|
291
|
+
$h(t) {
|
|
292
|
+
this.ph.$store.started() || this.jg.p("can-play-through", {
|
|
293
|
+
trigger: t,
|
|
294
|
+
detail: this.Ph()
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
hi(t) {
|
|
298
|
+
this.Nh = !1, this.jg.p("playing", { trigger: t }), this.Oh.O();
|
|
299
|
+
}
|
|
300
|
+
di(t) {
|
|
301
|
+
this.jg.p("stalled", { trigger: t }), this.j.readyState < 3 && (this.Nh = !0, this.jg.p("waiting", { trigger: t }));
|
|
302
|
+
}
|
|
303
|
+
mi(t) {
|
|
304
|
+
this.j.readyState < 3 && (this.Nh = !0, this.jg.p("waiting", { trigger: t }));
|
|
305
|
+
}
|
|
306
|
+
li(t) {
|
|
307
|
+
this.Oh.P(), this.Mh(this.j.duration, t), this.jg.p("end", { trigger: t }), this.ph.$store.loop() ? this.oi() : this.jg.p("ended", { trigger: t });
|
|
308
|
+
}
|
|
309
|
+
Vh() {
|
|
310
|
+
this.ph.$store.paused() && u(this.j, "timeupdate", this.Vb.bind(this));
|
|
311
|
+
}
|
|
312
|
+
Vb(t) {
|
|
313
|
+
this.Mh(this.j.currentTime, t);
|
|
314
|
+
}
|
|
315
|
+
ai(t) {
|
|
316
|
+
this.Th(), this.ph.$store.ended() && this.Mh(this.j.duration, t), this.jg.p("duration-change", {
|
|
317
|
+
detail: this.j.duration,
|
|
318
|
+
trigger: t
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
ac(t) {
|
|
322
|
+
this.jg.p("volume-change", {
|
|
323
|
+
detail: {
|
|
324
|
+
volume: this.j.volume,
|
|
325
|
+
muted: this.j.muted
|
|
326
|
+
},
|
|
327
|
+
trigger: t
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
ji(t) {
|
|
331
|
+
this.Mh(this.j.currentTime, t), this.jg.p("seeked", {
|
|
332
|
+
detail: this.j.currentTime,
|
|
333
|
+
trigger: t
|
|
334
|
+
}), Math.trunc(this.j.currentTime) === Math.trunc(this.j.duration) && m(this.j.duration) > m(this.j.currentTime) && (this.Mh(this.j.duration, t), this.j.ended || this.ph.player.dispatchEvent(
|
|
335
|
+
new l("media-play-request", {
|
|
336
|
+
trigger: t
|
|
337
|
+
})
|
|
338
|
+
));
|
|
339
|
+
}
|
|
340
|
+
ki(t) {
|
|
341
|
+
this.jg.p("seeking", {
|
|
342
|
+
detail: this.j.currentTime,
|
|
343
|
+
trigger: t
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
ci(t) {
|
|
347
|
+
this.jg.p("progress", {
|
|
348
|
+
detail: {
|
|
349
|
+
buffered: this.j.buffered,
|
|
350
|
+
seekable: this.j.seekable
|
|
351
|
+
},
|
|
352
|
+
trigger: t
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
oi() {
|
|
356
|
+
M(this.j.controls) && (this.j.controls = !1), this.ph.player.dispatchEvent(new l("media-loop-request"));
|
|
357
|
+
}
|
|
358
|
+
ei(t) {
|
|
359
|
+
this.jg.p("suspend", { trigger: t });
|
|
360
|
+
}
|
|
361
|
+
ii(t) {
|
|
362
|
+
this.jg.p("rate-change", {
|
|
363
|
+
detail: this.j.playbackRate,
|
|
364
|
+
trigger: t
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
Wb(t) {
|
|
368
|
+
const i = this.j.error;
|
|
369
|
+
i && this.jg.p("error", {
|
|
370
|
+
detail: {
|
|
371
|
+
message: i.message,
|
|
372
|
+
code: i.code,
|
|
373
|
+
mediaError: i
|
|
374
|
+
},
|
|
375
|
+
trigger: t
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
class U {
|
|
380
|
+
constructor(t, i) {
|
|
381
|
+
this.q = t, this.ph = i, this.ri.onaddtrack = this.ti.bind(this), this.ri.onremovetrack = this.ui.bind(this), this.ri.onchange = this.vi.bind(this), u(this.ph.audioTracks, "change", this.wi.bind(this));
|
|
382
|
+
}
|
|
383
|
+
get ri() {
|
|
384
|
+
return this.q.media.audioTracks;
|
|
385
|
+
}
|
|
386
|
+
ti(t) {
|
|
387
|
+
const i = t.track;
|
|
388
|
+
if (i.label === "")
|
|
389
|
+
return;
|
|
390
|
+
const s = {
|
|
391
|
+
id: i.id + "",
|
|
392
|
+
label: i.label,
|
|
393
|
+
language: i.language,
|
|
394
|
+
kind: i.kind,
|
|
395
|
+
selected: !1
|
|
396
|
+
};
|
|
397
|
+
this.ph.audioTracks[g](s, t), i.enabled && (s.selected = !0);
|
|
398
|
+
}
|
|
399
|
+
ui(t) {
|
|
400
|
+
const i = this.ph.audioTracks.getById(t.track.id);
|
|
401
|
+
i && this.ph.audioTracks[N](i, t);
|
|
402
|
+
}
|
|
403
|
+
vi(t) {
|
|
404
|
+
let i = this.si();
|
|
405
|
+
if (!i)
|
|
406
|
+
return;
|
|
407
|
+
const s = this.ph.audioTracks.getById(i.id);
|
|
408
|
+
s && this.ph.audioTracks[c](s, !0, t);
|
|
409
|
+
}
|
|
410
|
+
si() {
|
|
411
|
+
return Array.from(this.ri).find((t) => t.enabled);
|
|
412
|
+
}
|
|
413
|
+
wi(t) {
|
|
414
|
+
const { current: i } = t.detail;
|
|
415
|
+
if (!i)
|
|
416
|
+
return;
|
|
417
|
+
const s = this.ri.getTrackById(i.id);
|
|
418
|
+
if (s) {
|
|
419
|
+
const a = this.si();
|
|
420
|
+
a && (a.enabled = !1), s.enabled = !0;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
class F {
|
|
425
|
+
constructor(t) {
|
|
426
|
+
this.j = t;
|
|
427
|
+
}
|
|
428
|
+
setup(t) {
|
|
429
|
+
new D(this, t), "audioTracks" in this.media && new U(this, t);
|
|
430
|
+
}
|
|
431
|
+
get type() {
|
|
432
|
+
return "";
|
|
433
|
+
}
|
|
434
|
+
get media() {
|
|
435
|
+
return this.j;
|
|
436
|
+
}
|
|
437
|
+
get paused() {
|
|
438
|
+
return this.j.paused;
|
|
439
|
+
}
|
|
440
|
+
get muted() {
|
|
441
|
+
return this.j.muted;
|
|
442
|
+
}
|
|
443
|
+
set muted(t) {
|
|
444
|
+
this.j.muted = t;
|
|
445
|
+
}
|
|
446
|
+
get volume() {
|
|
447
|
+
return this.j.volume;
|
|
448
|
+
}
|
|
449
|
+
set volume(t) {
|
|
450
|
+
this.j.volume = t;
|
|
451
|
+
}
|
|
452
|
+
get currentTime() {
|
|
453
|
+
return this.j.currentTime;
|
|
454
|
+
}
|
|
455
|
+
set currentTime(t) {
|
|
456
|
+
this.j.currentTime = t;
|
|
457
|
+
}
|
|
458
|
+
get playsinline() {
|
|
459
|
+
return this.j.hasAttribute("playsinline");
|
|
460
|
+
}
|
|
461
|
+
set playsinline(t) {
|
|
462
|
+
I(this.j, "playsinline", t);
|
|
463
|
+
}
|
|
464
|
+
get playbackRate() {
|
|
465
|
+
return this.j.playbackRate;
|
|
466
|
+
}
|
|
467
|
+
set playbackRate(t) {
|
|
468
|
+
this.j.playbackRate = t;
|
|
469
|
+
}
|
|
470
|
+
async play() {
|
|
471
|
+
return this.j.play();
|
|
472
|
+
}
|
|
473
|
+
async pause() {
|
|
474
|
+
return this.j.pause();
|
|
475
|
+
}
|
|
476
|
+
async loadSource({ src: t }, i) {
|
|
477
|
+
this.j.preload = i, $(t) ? this.j.srcObject = t : (this.j.srcObject = null, this.j.src = C(t) ? t : window.URL.createObjectURL(t)), this.j.load();
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
export {
|
|
481
|
+
F as H,
|
|
482
|
+
W as a
|
|
483
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var g=Object.defineProperty;var p=(l,t,i)=>t in l?g(l,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):l[t]=i;var d=(l,t,i)=>p(l,typeof t!="symbol"?t+"":t,i);const e=require("./media-core-Rxz2MNwG.cjs"),u=require("./media-ui-zZVnK1ts.cjs");class c{constructor(t){d(this,"xi");this.jf=t}O(){e.isUndefined(this.xi)&&this.yi()}P(){e.isNumber(this.xi)&&window.cancelAnimationFrame(this.xi),this.xi=void 0}yi(){this.xi=window.requestAnimationFrame(()=>{e.isUndefined(this.xi)||(this.jf(),this.yi())})}}const f=l=>e.camelToKebabCase(l);class j{constructor(t){d(this,"ph");d(this,"za",null);d(this,"qh",null);d(this,"nh",{});d(this,"oh",new Set);this.qa=t}get instance(){return this.za}setup(t,i){this.ph=i;const s=e.peek(i.$store.streamType).includes("live"),r=e.peek(i.$store.streamType).includes("ll-");this.za=new t({lowLatencyMode:r,backBufferLength:r?4:s?8:void 0,renderTextTracksNatively:!1,...this.nh});const h=this.rh.bind(this);for(const a of Object.values(t.Events))this.za.on(a,h);this.za.on(t.Events.ERROR,this.Wb.bind(this));for(const a of this.oh)a(this.za);i.player.dispatchEvent(new e.DOMEvent("hls-instance",{detail:this.za})),this.za.attachMedia(this.qa),this.za.on(t.Events.AUDIO_TRACK_SWITCHED,this.sh.bind(this)),this.za.on(t.Events.LEVEL_SWITCHED,this.th.bind(this)),this.za.on(t.Events.LEVEL_LOADED,this.uh.bind(this)),this.za.on(t.Events.NON_NATIVE_TEXT_TRACKS_FOUND,this.vh.bind(this)),this.za.on(t.Events.CUES_PARSED,this.wh.bind(this)),i.qualities[e.ENABLE_AUTO_QUALITY]=this.xh.bind(this),e.listenEvent(i.qualities,"change",this.Pf.bind(this)),e.listenEvent(i.audioTracks,"change",this.yh.bind(this)),this.qh=e.effect(this.zh.bind(this))}zh(){if(!this.ph.$store.live())return;const t=new c(this.Ah.bind(this));return t.O(),t.P.bind(t)}Ah(){var t;this.ph.$store.liveSyncPosition.set(((t=this.za)==null?void 0:t.liveSyncPosition)??1/0)}rh(t,i){this.ph.player.dispatchEvent(new e.DOMEvent(f(t),{detail:i}))}vh(t,i){const s=new e.DOMEvent(t,{detail:i});let r=-1;for(let h=0;h<i.tracks.length;h++){const a=i.tracks[h],o=a.subtitleTrack??a.closedCaptions,n=new e.TextTrack({id:`hls-${a.kind}${h}`,src:o==null?void 0:o.url,label:a.label,language:o==null?void 0:o.lang,kind:a.kind});n[e.TEXT_TRACK_READY_STATE]=2,n[e.TEXT_TRACK_ON_MODE_CHANGE]=()=>{n.mode==="showing"?(this.za.subtitleTrack=h,r=h):r===h&&(this.za.subtitleTrack=-1,r=-1)},a.default&&n.setMode("showing",s),this.ph.textTracks.add(n,s)}}wh(t,i){const s=this.ph.textTracks.getById(`hls-${i.track}`);if(!s)return;const r=new e.DOMEvent(t,{detail:i});for(const h of i.cues)h.positionAlign="auto",s.addCue(h,r)}sh(t,i){const s=this.ph.audioTracks[i.id];s&&this.ph.audioTracks[e.LIST_SELECT](s,!0,new e.DOMEvent(t,{detail:i}))}th(t,i){const s=this.ph.qualities[i.level];s&&this.ph.qualities[e.LIST_SELECT](s,!0,new e.DOMEvent(t,{detail:i}))}uh(t,i){if(this.ph.$store.canPlay())return;const{type:s,live:r,totalduration:h}=i.details,a=new e.DOMEvent(t,{detail:i});this.ph.delegate.p("stream-type-change",{detail:r?s==="EVENT"&&Number.isFinite(h)?"live:dvr":"live":"on-demand",trigger:a}),this.ph.delegate.p("duration-change",{detail:h,trigger:a});const o=this.za.media;this.za.currentLevel===-1&&this.ph.qualities[e.SET_AUTO_QUALITY](!0,a);for(const n of this.za.audioTracks)this.ph.audioTracks[e.LIST_ADD]({id:n.id+"",label:n.name,language:n.lang||"",kind:"main"},a);for(const n of this.za.levels)this.ph.qualities[e.LIST_ADD]({width:n.width,height:n.height,codec:n.codecSet,bitrate:n.bitrate},a);o.dispatchEvent(new e.DOMEvent("canplay",{trigger:a}))}Wb(t,i){var s,r,h;if(i.fatal)switch(i.type){case"networkError":(s=this.za)==null||s.startLoad();break;case"mediaError":(r=this.za)==null||r.recoverMediaError();break;default:(h=this.za)==null||h.destroy(),this.za=null;break}}xh(){this.za&&(this.za.currentLevel=-1)}Pf(){const{qualities:t}=this.ph;!this.za||t.auto||(this.za[t.switch+"Level"]=t.selectedIndex,e.IS_CHROME&&(this.qa.currentTime=this.qa.currentTime))}yh(){const{audioTracks:t}=this.ph;this.za&&this.za.audioTrack!==t.selectedIndex&&(this.za.audioTrack=t.selectedIndex)}Jg(){var t,i;this.ph&&(this.ph.qualities[e.ENABLE_AUTO_QUALITY]=void 0),(t=this.za)==null||t.destroy(),this.za=null,(i=this.qh)==null||i.call(this),this.qh=null}}class T{constructor(t,i){d(this,"ih",e.useDisposalBin());d(this,"Nh",!1);d(this,"Qh",!1);d(this,"Rh",!1);d(this,"Oh",new c(this.Wh.bind(this)));d(this,"ni");d(this,"pi");this.q=t,this.ph=i,this.Uh(),e.effect(this.Vh.bind(this)),e.onDispose(this.Eh.bind(this))}get j(){return this.q.media}get jg(){return this.ph.delegate}Eh(){this.Oh.P(),this.ih.empty()}Wh(){const t=this.q.currentTime;this.ph.$store.currentTime()!==t&&this.Mh(t)}Uh(){this.Lh("loadstart",this.ge),this.Lh("abort",this.Sh),this.Lh("emptied",this.Xh),this.Lh("error",this.Wb)}Yh(){this.Qh||(this.ih.add(this.Lh("loadeddata",this.Zh),this.Lh("loadedmetadata",this._h),this.Lh("canplay",this.Rb),this.Lh("canplaythrough",this.$h),this.Lh("durationchange",this.ai),this.Lh("play",this.bi),this.Lh("progress",this.ci),this.Lh("stalled",this.di),this.Lh("suspend",this.ei)),this.Qh=!0)}fi(){this.Rh||(this.ih.add(this.Lh("pause",this.gi),this.Lh("playing",this.hi),this.Lh("ratechange",this.ii),this.Lh("seeked",this.ji),this.Lh("seeking",this.ki),this.Lh("ended",this.li),this.Lh("volumechange",this.ac),this.Lh("waiting",this.mi)),this.Rh=!0)}Lh(t,i){return e.listenEvent(this.j,t,i.bind(this))}qi(t){}Mh(t,i){this.jg.p("time-update",{detail:{currentTime:Math.min(t,this.ph.$store.seekableEnd()),played:this.j.played},trigger:i})}ge(t){if(this.j.networkState===3){this.Sh(t);return}this.Yh(),this.jg.p("load-start",{trigger:t})}Sh(t){this.jg.p("abort",{trigger:t})}Xh(){this.jg.p("emptied",{trigger:event})}Zh(t){this.jg.p("loaded-data",{trigger:t})}_h(t){this.Th(),this.fi(),this.jg.p("volume-change",{detail:{volume:this.j.volume,muted:this.j.muted}}),this.jg.p("loaded-metadata",{trigger:t}),e.IS_SAFARI&&e.isHLSSrc(this.ph.$store.source())&&this.jg.lf(this.Ph(),t)}Ph(){return{duration:this.j.duration,buffered:this.j.buffered,seekable:this.j.seekable}}Th(){const t=!Number.isFinite(this.j.duration);this.jg.p("stream-type-change",{detail:t?"live":"on-demand"})}bi(t){this.ph.$store.canPlay&&this.jg.p("play",{trigger:t})}gi(t){this.j.readyState===1&&!this.Nh||(this.Nh=!1,this.Oh.P(),this.jg.p("pause",{trigger:t}))}Rb(t){this.jg.lf(this.Ph(),t)}$h(t){this.ph.$store.started()||this.jg.p("can-play-through",{trigger:t,detail:this.Ph()})}hi(t){this.Nh=!1,this.jg.p("playing",{trigger:t}),this.Oh.O()}di(t){this.jg.p("stalled",{trigger:t}),this.j.readyState<3&&(this.Nh=!0,this.jg.p("waiting",{trigger:t}))}mi(t){this.j.readyState<3&&(this.Nh=!0,this.jg.p("waiting",{trigger:t}))}li(t){this.Oh.P(),this.Mh(this.j.duration,t),this.jg.p("end",{trigger:t}),this.ph.$store.loop()?this.oi():this.jg.p("ended",{trigger:t})}Vh(){this.ph.$store.paused()&&e.listenEvent(this.j,"timeupdate",this.Vb.bind(this))}Vb(t){this.Mh(this.j.currentTime,t)}ai(t){this.Th(),this.ph.$store.ended()&&this.Mh(this.j.duration,t),this.jg.p("duration-change",{detail:this.j.duration,trigger:t})}ac(t){this.jg.p("volume-change",{detail:{volume:this.j.volume,muted:this.j.muted},trigger:t})}ji(t){this.Mh(this.j.currentTime,t),this.jg.p("seeked",{detail:this.j.currentTime,trigger:t}),Math.trunc(this.j.currentTime)===Math.trunc(this.j.duration)&&u.getNumberOfDecimalPlaces(this.j.duration)>u.getNumberOfDecimalPlaces(this.j.currentTime)&&(this.Mh(this.j.duration,t),this.j.ended||this.ph.player.dispatchEvent(new e.DOMEvent("media-play-request",{trigger:t})))}ki(t){this.jg.p("seeking",{detail:this.j.currentTime,trigger:t})}ci(t){this.jg.p("progress",{detail:{buffered:this.j.buffered,seekable:this.j.seekable},trigger:t})}oi(){e.isNil(this.j.controls)&&(this.j.controls=!1),this.ph.player.dispatchEvent(new e.DOMEvent("media-loop-request"))}ei(t){this.jg.p("suspend",{trigger:t})}ii(t){this.jg.p("rate-change",{detail:this.j.playbackRate,trigger:t})}Wb(t){const i=this.j.error;i&&this.jg.p("error",{detail:{message:i.message,code:i.code,mediaError:i},trigger:t})}}class m{constructor(t,i){this.q=t,this.ph=i,this.ri.onaddtrack=this.ti.bind(this),this.ri.onremovetrack=this.ui.bind(this),this.ri.onchange=this.vi.bind(this),e.listenEvent(this.ph.audioTracks,"change",this.wi.bind(this))}get ri(){return this.q.media.audioTracks}ti(t){const i=t.track;if(i.label==="")return;const s={id:i.id+"",label:i.label,language:i.language,kind:i.kind,selected:!1};this.ph.audioTracks[e.LIST_ADD](s,t),i.enabled&&(s.selected=!0)}ui(t){const i=this.ph.audioTracks.getById(t.track.id);i&&this.ph.audioTracks[e.LIST_REMOVE](i,t)}vi(t){let i=this.si();if(!i)return;const s=this.ph.audioTracks.getById(i.id);s&&this.ph.audioTracks[e.LIST_SELECT](s,!0,t)}si(){return Array.from(this.ri).find(t=>t.enabled)}wi(t){const{current:i}=t.detail;if(!i)return;const s=this.ri.getTrackById(i.id);if(s){const r=this.si();r&&(r.enabled=!1),s.enabled=!0}}}class b{constructor(t){this.j=t}setup(t){new T(this,t),"audioTracks"in this.media&&new m(this,t)}get type(){return""}get media(){return this.j}get paused(){return this.j.paused}get muted(){return this.j.muted}set muted(t){this.j.muted=t}get volume(){return this.j.volume}set volume(t){this.j.volume=t}get currentTime(){return this.j.currentTime}set currentTime(t){this.j.currentTime=t}get playsinline(){return this.j.hasAttribute("playsinline")}set playsinline(t){e.setAttribute(this.j,"playsinline",t)}get playbackRate(){return this.j.playbackRate}set playbackRate(t){this.j.playbackRate=t}async play(){return this.j.play()}async pause(){return this.j.pause()}async loadSource({src:t},i){this.j.preload=i,e.isMediaStream(t)?this.j.srcObject=t:(this.j.srcObject=null,this.j.src=e.isString(t)?t:window.URL.createObjectURL(t)),this.j.load()}}exports.HLSController=j;exports.HTMLMediaProvider=b;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./prod-Ba2x-T01.cjs"),h=/,/g,u="-->";class o extends e.VTTParser{parse(t,i){var r,a;if(t==="")this.a&&(this.j.push(this.a),(a=(r=this.f).onCue)==null||a.call(r,this.a),this.a=null),this.c=e.VTTBlock.None;else if(this.c===e.VTTBlock.Cue)this.a.text+=(this.a.text?`
|
|
2
|
+
`:"")+t;else if(t.includes(u)){const s=this.o(t,i);s&&(this.a=new e.VTTCue(s[0],s[1],s[2].join(" ")),this.a.id=this.l,this.c=e.VTTBlock.Cue)}this.l=t}o(t,i){return super.o(t.replace(h,"."),i)}}function c(){return new o}exports.SRTParser=o;exports.default=c;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { V as h, a as i, b as o } from "./prod-DBMM0zDd.js";
|
|
2
|
+
const u = /,/g, c = "-->";
|
|
3
|
+
class n extends h {
|
|
4
|
+
parse(s, e) {
|
|
5
|
+
var a, r;
|
|
6
|
+
if (s === "")
|
|
7
|
+
this.a && (this.j.push(this.a), (r = (a = this.f).onCue) == null || r.call(a, this.a), this.a = null), this.c = i.None;
|
|
8
|
+
else if (this.c === i.Cue)
|
|
9
|
+
this.a.text += (this.a.text ? `
|
|
10
|
+
` : "") + s;
|
|
11
|
+
else if (s.includes(c)) {
|
|
12
|
+
const t = this.o(s, e);
|
|
13
|
+
t && (this.a = new o(t[0], t[1], t[2].join(" ")), this.a.id = this.l, this.c = i.Cue);
|
|
14
|
+
}
|
|
15
|
+
this.l = s;
|
|
16
|
+
}
|
|
17
|
+
o(s, e) {
|
|
18
|
+
return super.o(s.replace(u, "."), e);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function l() {
|
|
22
|
+
return new n();
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
n as SRTParser,
|
|
26
|
+
l as default
|
|
27
|
+
};
|