@deep-eye/core 0.9.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/README.md +113 -174
  3. package/dist/components/chat/ChatBot.vue.d.ts +48 -17
  4. package/dist/components/chat/ChatBot.vue.d.ts.map +1 -1
  5. package/dist/components/chat/attachmentController.d.ts +25 -0
  6. package/dist/components/chat/attachmentController.d.ts.map +1 -0
  7. package/dist/components/chat/attachments.d.ts +12 -0
  8. package/dist/components/chat/attachments.d.ts.map +1 -0
  9. package/dist/components/chat/chatContext.d.ts +14 -0
  10. package/dist/components/chat/chatContext.d.ts.map +1 -0
  11. package/dist/components/chat/chatErrors.d.ts +16 -0
  12. package/dist/components/chat/chatErrors.d.ts.map +1 -0
  13. package/dist/components/chat/chatQueue.d.ts +6 -0
  14. package/dist/components/chat/chatQueue.d.ts.map +1 -0
  15. package/dist/components/chat/components/ArtifactPreview.vue.d.ts.map +1 -1
  16. package/dist/components/chat/components/ChatActionbar.vue.d.ts +3 -3
  17. package/dist/components/chat/components/ChatActionbar.vue.d.ts.map +1 -1
  18. package/dist/components/chat/components/ChatAttachments.vue.d.ts +12 -0
  19. package/dist/components/chat/components/ChatAttachments.vue.d.ts.map +1 -0
  20. package/dist/components/chat/components/ChatFilePreview.vue.d.ts +45 -0
  21. package/dist/components/chat/components/ChatFilePreview.vue.d.ts.map +1 -0
  22. package/dist/components/chat/components/ChatFilePreviewPanel.vue.d.ts +24 -0
  23. package/dist/components/chat/components/ChatFilePreviewPanel.vue.d.ts.map +1 -0
  24. package/dist/components/chat/components/ChatImageLightbox.vue.d.ts +16 -0
  25. package/dist/components/chat/components/ChatImageLightbox.vue.d.ts.map +1 -0
  26. package/dist/components/chat/components/ChatMediaPreview.vue.d.ts +9 -0
  27. package/dist/components/chat/components/ChatMediaPreview.vue.d.ts.map +1 -0
  28. package/dist/components/chat/components/ChatMessage.vue.d.ts +43 -2
  29. package/dist/components/chat/components/ChatMessage.vue.d.ts.map +1 -1
  30. package/dist/components/chat/components/ChatOfficePreview.vue.d.ts +9 -0
  31. package/dist/components/chat/components/ChatOfficePreview.vue.d.ts.map +1 -0
  32. package/dist/components/chat/components/ChatProvider.vue.d.ts +73 -0
  33. package/dist/components/chat/components/ChatProvider.vue.d.ts.map +1 -0
  34. package/dist/components/chat/components/ChatQueue.vue.d.ts +16 -0
  35. package/dist/components/chat/components/ChatQueue.vue.d.ts.map +1 -0
  36. package/dist/components/chat/components/ChatReasoning.vue.d.ts +21 -0
  37. package/dist/components/chat/components/ChatReasoning.vue.d.ts.map +1 -0
  38. package/dist/components/chat/components/ChatSender.vue.d.ts +34 -17
  39. package/dist/components/chat/components/ChatSender.vue.d.ts.map +1 -1
  40. package/dist/components/chat/components/ChatSidebarResizeHandle.vue.d.ts +13 -0
  41. package/dist/components/chat/components/ChatSidebarResizeHandle.vue.d.ts.map +1 -0
  42. package/dist/components/chat/components/ChatToolGroup.vue.d.ts +28 -0
  43. package/dist/components/chat/components/ChatToolGroup.vue.d.ts.map +1 -0
  44. package/dist/components/chat/components/ConversationList.vue.d.ts +129 -0
  45. package/dist/components/chat/components/ConversationList.vue.d.ts.map +1 -0
  46. package/dist/components/chat/components/InputContentParts.vue.d.ts +8 -0
  47. package/dist/components/chat/components/InputContentParts.vue.d.ts.map +1 -0
  48. package/dist/components/chat/components/MessageBubble.vue.d.ts +43 -2
  49. package/dist/components/chat/components/MessageBubble.vue.d.ts.map +1 -1
  50. package/dist/components/chat/components/TextPartRenderer.vue.d.ts.map +1 -1
  51. package/dist/components/chat/components/ToolCallPart.vue.d.ts +12 -3
  52. package/dist/components/chat/components/ToolCallPart.vue.d.ts.map +1 -1
  53. package/dist/components/chat/components/index.d.ts +9 -0
  54. package/dist/components/chat/components/index.d.ts.map +1 -1
  55. package/dist/components/chat/composables/index.d.ts +0 -1
  56. package/dist/components/chat/composables/index.d.ts.map +1 -1
  57. package/dist/components/chat/composables/useChatVoice.d.ts +45 -0
  58. package/dist/components/chat/composables/useChatVoice.d.ts.map +1 -0
  59. package/dist/components/chat/composables/useConversation.d.ts +1 -5
  60. package/dist/components/chat/composables/useConversation.d.ts.map +1 -1
  61. package/dist/components/chat/composables/useMeasuredHeight.d.ts +11 -0
  62. package/dist/components/chat/composables/useMeasuredHeight.d.ts.map +1 -0
  63. package/dist/components/chat/composables/useStreamSmoothing.d.ts +13 -0
  64. package/dist/components/chat/composables/useStreamSmoothing.d.ts.map +1 -0
  65. package/dist/components/chat/index.d.ts +12 -4
  66. package/dist/components/chat/index.d.ts.map +1 -1
  67. package/dist/components/chat/mdoc/ContentNodes.vue.d.ts.map +1 -1
  68. package/dist/components/chat/mdoc/MediaImageStack.vue.d.ts.map +1 -1
  69. package/dist/components/chat/previewRenderers.d.ts +6 -0
  70. package/dist/components/chat/previewRenderers.d.ts.map +1 -0
  71. package/dist/components/chat/qiniuUpload.d.ts +10 -0
  72. package/dist/components/chat/qiniuUpload.d.ts.map +1 -0
  73. package/dist/components/chat/responseStream.d.ts +17 -0
  74. package/dist/components/chat/responseStream.d.ts.map +1 -0
  75. package/dist/components/chat/toolLabels.d.ts +4 -0
  76. package/dist/components/chat/toolLabels.d.ts.map +1 -0
  77. package/dist/components/chat/toolStatus.d.ts +16 -0
  78. package/dist/components/chat/toolStatus.d.ts.map +1 -0
  79. package/dist/components/chat/types.d.ts +457 -144
  80. package/dist/components/chat/types.d.ts.map +1 -1
  81. package/dist/components/visualization/types.d.ts +8 -7
  82. package/dist/components/visualization/types.d.ts.map +1 -1
  83. package/dist/components/visualization/utils.d.ts +4 -2
  84. package/dist/components/visualization/utils.d.ts.map +1 -1
  85. package/dist/composables/useMindMapTheme.d.ts +4 -7
  86. package/dist/composables/useMindMapTheme.d.ts.map +1 -1
  87. package/dist/errors-CHzikrqu.js +70 -0
  88. package/dist/errors-upLl4kf2.cjs +1 -0
  89. package/dist/index-B4hgICk-.cjs +198 -0
  90. package/dist/index-BJdNN1GV.cjs +33 -0
  91. package/dist/index-Bj9h-xEr.cjs +112 -0
  92. package/dist/index-BufnUXnQ.js +5071 -0
  93. package/dist/index-CnxZBHPD.js +42825 -0
  94. package/dist/index-DF8KmkKX.js +38392 -0
  95. package/dist/index-DPhuLMkO.cjs +1 -0
  96. package/dist/index-Dq4cniDm.cjs +5 -0
  97. package/dist/index-cW_BnxHR.js +1722 -0
  98. package/dist/index-iCVvFIlX.js +28 -0
  99. package/dist/index.cjs +275 -134
  100. package/dist/index.js +20496 -10365
  101. package/dist/media-community-skin-Djo8L1G9.js +302 -0
  102. package/dist/media-community-skin-YI6NjsJg.cjs +1 -0
  103. package/dist/media-core-CkW37AYl.js +3827 -0
  104. package/dist/media-core-Rxz2MNwG.cjs +1 -0
  105. package/dist/media-outlet-CZTh6XmJ.cjs +1 -0
  106. package/dist/media-outlet-D2rcuhYN.js +2 -0
  107. package/dist/media-player-BZrIM0O_.js +387 -0
  108. package/dist/media-player-D_USOhtK.cjs +1 -0
  109. package/dist/media-ui-DfPbRfFS.js +2832 -0
  110. package/dist/media-ui-zZVnK1ts.cjs +1 -0
  111. package/dist/prod-Ba2x-T01.cjs +4 -0
  112. package/dist/prod-DBMM0zDd.js +992 -0
  113. package/dist/provider-B7wAEcCR.js +163 -0
  114. package/dist/provider-BPphQwpc.cjs +1 -0
  115. package/dist/provider-BSeBwvzM.cjs +1 -0
  116. package/dist/provider-DgSZc2dM.js +162 -0
  117. package/dist/provider-EKFFiZS1.js +27 -0
  118. package/dist/provider-O8r0RFmF.cjs +1 -0
  119. package/dist/provider-WrRdjcjY.js +483 -0
  120. package/dist/provider-sqICX3H9.cjs +1 -0
  121. package/dist/srt-parser-BECMkbXb.cjs +2 -0
  122. package/dist/srt-parser-BR28Llpk.js +27 -0
  123. package/dist/ssa-parser-BJTK0kd-.js +209 -0
  124. package/dist/ssa-parser-CuKkTpK_.cjs +4 -0
  125. package/dist/style.css +1 -1
  126. package/package.json +7 -2
  127. package/dist/components/chat/AiConversation.vue.d.ts +0 -28
  128. package/dist/components/chat/AiConversation.vue.d.ts.map +0 -1
  129. package/dist/components/chat/components/AssistantTrace.vue.d.ts +0 -27
  130. package/dist/components/chat/components/AssistantTrace.vue.d.ts.map +0 -1
  131. package/dist/components/chat/composables/useConversationStream.d.ts +0 -3
  132. package/dist/components/chat/composables/useConversationStream.d.ts.map +0 -1
  133. package/dist/components/chat/presentation.d.ts +0 -27
  134. package/dist/components/chat/presentation.d.ts.map +0 -1
@@ -0,0 +1,992 @@
1
+ var Q = Object.defineProperty;
2
+ var Z = (i, t, e) => t in i ? Q(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var h = (i, t, e) => Z(i, typeof t != "symbol" ? t + "" : t, e);
4
+ const U = {
5
+ LoadFail: 0,
6
+ BadSignature: 1,
7
+ BadTimestamp: 2,
8
+ BadSettingValue: 3,
9
+ BadFormat: 4,
10
+ UnknownSetting: 5
11
+ };
12
+ class tt extends Error {
13
+ constructor(e) {
14
+ super(e.reason);
15
+ h(this, "code");
16
+ h(this, "line");
17
+ this.code = e.code, this.line = e.line;
18
+ }
19
+ }
20
+ const j = /\r?\n|\r/gm;
21
+ class et {
22
+ constructor(t) {
23
+ h(this, "writable");
24
+ h(this, "readable");
25
+ const e = new it(t);
26
+ this.writable = new WritableStream({
27
+ write(s) {
28
+ e.transform(s);
29
+ },
30
+ close() {
31
+ e.close();
32
+ }
33
+ }), this.readable = new ReadableStream({
34
+ start(s) {
35
+ e.onLine = (n) => s.enqueue(n), e.onClose = () => s.close();
36
+ }
37
+ });
38
+ }
39
+ }
40
+ class it {
41
+ constructor(t) {
42
+ h(this, "x", "");
43
+ h(this, "y");
44
+ h(this, "onLine");
45
+ h(this, "onClose");
46
+ this.y = new TextDecoder(t);
47
+ }
48
+ transform(t) {
49
+ this.x += this.y.decode(t, { stream: !0 });
50
+ const e = this.x.split(j);
51
+ this.x = e.pop() || "";
52
+ for (let s = 0; s < e.length; s++)
53
+ this.onLine(e[s].trim());
54
+ }
55
+ close() {
56
+ this.x && this.onLine(this.x.trim()), this.x = "", this.onClose();
57
+ }
58
+ }
59
+ async function st(i, t) {
60
+ const e = new ReadableStream({
61
+ start(s) {
62
+ const n = i.split(j);
63
+ for (const r of n)
64
+ s.enqueue(r);
65
+ s.close();
66
+ }
67
+ });
68
+ return C(e, t);
69
+ }
70
+ async function C(i, t) {
71
+ const e = (t == null ? void 0 : t.type) ?? "vtt";
72
+ let s;
73
+ if (typeof e == "string")
74
+ switch (e) {
75
+ case "srt":
76
+ s = (await import("./srt-parser-BR28Llpk.js")).default;
77
+ break;
78
+ case "ssa":
79
+ case "ass":
80
+ s = (await import("./ssa-parser-BJTK0kd-.js")).default;
81
+ break;
82
+ default:
83
+ s = (await Promise.resolve().then(function() {
84
+ return Et;
85
+ })).default;
86
+ }
87
+ else
88
+ s = e;
89
+ let n;
90
+ const r = i.getReader(), o = s(), a = !!(t != null && t.strict) || !!(t != null && t.errors);
91
+ await o.init({
92
+ strict: !1,
93
+ ...t,
94
+ errors: a,
95
+ type: e,
96
+ cancel() {
97
+ r.cancel(), n = o.done(!0);
98
+ }
99
+ });
100
+ let l = 1;
101
+ for (; ; ) {
102
+ const { value: c, done: f } = await r.read();
103
+ if (f) {
104
+ o.parse("", l), n = o.done(!1);
105
+ break;
106
+ }
107
+ o.parse(c, l), l++;
108
+ }
109
+ return n;
110
+ }
111
+ async function rt(i, t) {
112
+ var o, a;
113
+ const e = await i;
114
+ if (!e.ok || !e.body)
115
+ return {
116
+ metadata: {},
117
+ cues: [],
118
+ regions: [],
119
+ errors: [void 0]
120
+ };
121
+ const s = e.headers.get("content-type") || "", n = (o = s.match(/text\/(.*?)(?:;|$)/)) == null ? void 0 : o[1], r = (a = s.match(/charset=(.*?)(?:;|$)/)) == null ? void 0 : a[1];
122
+ return $(e.body, { type: n, encoding: r, ...t });
123
+ }
124
+ async function $(i, { encoding: t = "utf-8", ...e } = {}) {
125
+ const s = i.pipeThrough(new et(t));
126
+ return C(s, e);
127
+ }
128
+ class nt extends EventTarget {
129
+ constructor(e, s, n) {
130
+ super();
131
+ /**
132
+ * A string that identifies the cue.
133
+ *
134
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCue/id}
135
+ */
136
+ h(this, "id", "");
137
+ /**
138
+ * A `double` that represents the video time that the cue will start being displayed, in seconds.
139
+ *
140
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCue/startTime}
141
+ */
142
+ h(this, "startTime");
143
+ /**
144
+ * A `double` that represents the video time that the cue will stop being displayed, in seconds.
145
+ *
146
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCue/endTime}
147
+ */
148
+ h(this, "endTime");
149
+ /**
150
+ * Returns a string with the contents of the cue.
151
+ *
152
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/text}
153
+ */
154
+ h(this, "text");
155
+ /**
156
+ * A `boolean` for whether the video will pause when this cue stops being displayed.
157
+ *
158
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCue/pauseOnExit}
159
+ */
160
+ h(this, "pauseOnExit", !1);
161
+ this.startTime = e, this.endTime = s, this.text = n;
162
+ }
163
+ addEventListener(e, s, n) {
164
+ super.addEventListener(e, s, n);
165
+ }
166
+ removeEventListener(e, s, n) {
167
+ super.removeEventListener(e, s, n);
168
+ }
169
+ }
170
+ const at = window.VTTCue;
171
+ class G extends at {
172
+ constructor() {
173
+ super(...arguments);
174
+ /**
175
+ * A `VTTRegion` object describing the video's sub-region that the cue will be drawn onto,
176
+ * or `null` if none is assigned.
177
+ *
178
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/region}
179
+ */
180
+ h(this, "region", null);
181
+ /**
182
+ * The cue writing direction.
183
+ *
184
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/vertical}
185
+ */
186
+ h(this, "vertical", "");
187
+ /**
188
+ * Returns `true` if the `VTTCue.line` attribute is an integer number of lines or a percentage
189
+ * of the video size.
190
+ *
191
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/snapToLines}
192
+ */
193
+ h(this, "snapToLines", !0);
194
+ /**
195
+ * Returns the line positioning of the cue. This can be the string `'auto'` or a number whose
196
+ * interpretation depends on the value of `VTTCue.snapToLines`.
197
+ *
198
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/line}
199
+ */
200
+ h(this, "line", "auto");
201
+ /**
202
+ * Returns an enum representing the alignment of the `VTTCue.line`.
203
+ *
204
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/lineAlign}
205
+ */
206
+ h(this, "lineAlign", "start");
207
+ /**
208
+ * Returns the indentation of the cue within the line. This can be the string `'auto'` or a
209
+ * number representing the percentage of the `VTTCue.region`, or the video size if `VTTCue`.region`
210
+ * is `null`.
211
+ *
212
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/position}
213
+ */
214
+ h(this, "position", "auto");
215
+ /**
216
+ * Returns an enum representing the alignment of the cue. This is used to determine what
217
+ * the `VTTCue.position` is anchored to. The default is `'auto'`.
218
+ *
219
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/positionAlign}
220
+ */
221
+ h(this, "positionAlign", "auto");
222
+ /**
223
+ * Returns a double representing the size of the cue, as a percentage of the video size.
224
+ *
225
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/size}
226
+ */
227
+ h(this, "size", 100);
228
+ /**
229
+ * Returns an enum representing the alignment of all the lines of text within the cue box.
230
+ *
231
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/align}
232
+ */
233
+ h(this, "align", "center");
234
+ /**
235
+ * Additional styles associated with the cue.
236
+ */
237
+ h(this, "style");
238
+ }
239
+ }
240
+ class H {
241
+ constructor() {
242
+ /**
243
+ * A string that identifies the region.
244
+ */
245
+ h(this, "id", "");
246
+ /**
247
+ * A `double` representing the width of the region, as a percentage of the video.
248
+ */
249
+ h(this, "width", 100);
250
+ /**
251
+ * A `double` representing the height of the region, in number of lines.
252
+ */
253
+ h(this, "lines", 3);
254
+ /**
255
+ * A `double` representing the region anchor X offset, as a percentage of the region.
256
+ */
257
+ h(this, "regionAnchorX", 0);
258
+ /**
259
+ * A `double` representing the region anchor Y offset, as a percentage of the region.
260
+ */
261
+ h(this, "regionAnchorY", 100);
262
+ /**
263
+ * A `double` representing the viewport anchor X offset, as a percentage of the video.
264
+ */
265
+ h(this, "viewportAnchorX", 0);
266
+ /**
267
+ * A `double` representing the viewport anchor Y offset, as a percentage of the video.
268
+ */
269
+ h(this, "viewportAnchorY", 100);
270
+ /**
271
+ * An enum representing how adding new cues will move existing cues.
272
+ */
273
+ h(this, "scroll", "");
274
+ }
275
+ }
276
+ const P = ",", ot = "%";
277
+ function lt(i) {
278
+ const t = parseInt(i, 10);
279
+ return Number.isNaN(t) ? null : t;
280
+ }
281
+ function v(i) {
282
+ const t = parseInt(i.replace(ot, ""), 10);
283
+ return !Number.isNaN(t) && t >= 0 && t <= 100 ? t : null;
284
+ }
285
+ function O(i) {
286
+ if (!i.includes(P))
287
+ return null;
288
+ const [t, e] = i.split(P).map(v);
289
+ return t !== null && e !== null ? [t, e] : null;
290
+ }
291
+ function ht(i) {
292
+ const t = parseFloat(i);
293
+ return Number.isNaN(t) ? null : t;
294
+ }
295
+ const ct = "WEBVTT", B = ",", ut = "%", b = /[:=]/, ft = /^[\s\t]*(region|vertical|line|position|size|align)[:=]/, dt = "NOTE", pt = "REGION", gt = /^REGION:?[\s\t]+/, y = /[\s\t]+/, mt = "-->", Tt = /[\s\t]*-->[\s\t]+/, bt = /start|center|end|left|right/, wt = /start|center|end/, yt = /line-(?:left|right)|center|auto/, vt = /^(?:(\d{1,2}):)?(\d{2}):(\d{2})(?:\.(\d{1,3}))?$/;
296
+ var V = /* @__PURE__ */ ((i) => (i[i.None = 0] = "None", i[i.Header = 1] = "Header", i[i.Cue = 2] = "Cue", i[i.Region = 3] = "Region", i[i.Note = 4] = "Note", i))(V || {});
297
+ class F {
298
+ constructor() {
299
+ h(this, "f");
300
+ h(this, "c", 0);
301
+ h(this, "g", {});
302
+ h(this, "h", {});
303
+ h(this, "j", []);
304
+ h(this, "a", null);
305
+ h(this, "b", null);
306
+ h(this, "k", []);
307
+ h(this, "d");
308
+ h(this, "l", "");
309
+ }
310
+ async init(t) {
311
+ this.f = t, t.strict && (this.c = 1), t.errors && (this.d = (await import("./errors-CHzikrqu.js")).ParseErrorBuilder);
312
+ }
313
+ parse(t, e) {
314
+ var s, n, r, o, a, l;
315
+ if (t === "")
316
+ this.a ? (this.j.push(this.a), (n = (s = this.f).onCue) == null || n.call(s, this.a), this.a = null) : this.b ? (this.h[this.b.id] = this.b, (o = (r = this.f).onRegion) == null || o.call(r, this.b), this.b = null) : this.c === 1 && (this.i(t, e), (l = (a = this.f).onHeaderMetadata) == null || l.call(a, this.g)), this.c = 0;
317
+ else if (this.c)
318
+ switch (this.c) {
319
+ case 1:
320
+ this.i(t, e);
321
+ break;
322
+ case 2:
323
+ if (this.a) {
324
+ const c = this.a.text.length > 0;
325
+ !c && ft.test(t) ? this.m(t.split(y), e) : this.a.text += (c ? `
326
+ ` : "") + t;
327
+ }
328
+ break;
329
+ case 3:
330
+ this.n(t.split(y), e);
331
+ break;
332
+ }
333
+ else if (t.startsWith(dt))
334
+ this.c = 4;
335
+ else if (t.startsWith(pt))
336
+ this.c = 3, this.b = new H(), this.n(t.replace(gt, "").split(y), e);
337
+ else if (t.includes(mt)) {
338
+ const c = this.o(t, e);
339
+ c && (this.a = new G(c[0], c[1], ""), this.a.id = this.l, this.m(c[2], e)), this.c = 2;
340
+ } else e === 1 && this.i(t, e);
341
+ this.l = t;
342
+ }
343
+ done() {
344
+ return {
345
+ metadata: this.g,
346
+ cues: this.j,
347
+ regions: Object.values(this.h),
348
+ errors: this.k
349
+ };
350
+ }
351
+ i(t, e) {
352
+ var s;
353
+ if (e > 1) {
354
+ if (b.test(t)) {
355
+ const [n, r] = t.split(b);
356
+ n && (this.g[n] = (r || "").replace(y, ""));
357
+ }
358
+ } else t.startsWith(ct) ? this.c = 1 : this.e((s = this.d) == null ? void 0 : s.p());
359
+ }
360
+ o(t, e) {
361
+ var c, f, u;
362
+ const [s, n = ""] = t.split(Tt), [r, ...o] = n.split(y), a = E(s), l = E(r);
363
+ if (a !== null && l !== null && l > a)
364
+ return [a, l, o];
365
+ a === null && this.e((c = this.d) == null ? void 0 : c.q(s, e)), l === null && this.e((f = this.d) == null ? void 0 : f.r(r, e)), a != null && l !== null && l > a && this.e((u = this.d) == null ? void 0 : u.s(a, l, e));
366
+ }
367
+ /**
368
+ * @see {@link https://www.w3.org/TR/webvtt1/#region-settings-parsing}
369
+ */
370
+ n(t, e) {
371
+ var n, r;
372
+ let s;
373
+ for (let o = 0; o < t.length; o++)
374
+ if (b.test(t[o])) {
375
+ s = !1;
376
+ const [a, l] = t[o].split(b);
377
+ switch (a) {
378
+ case "id":
379
+ this.b.id = l;
380
+ break;
381
+ case "width":
382
+ const c = v(l);
383
+ c !== null ? this.b.width = c : s = !0;
384
+ break;
385
+ case "lines":
386
+ const f = lt(l);
387
+ f !== null ? this.b.lines = f : s = !0;
388
+ break;
389
+ case "regionanchor":
390
+ const u = O(l);
391
+ u !== null ? (this.b.regionAnchorX = u[0], this.b.regionAnchorY = u[1]) : s = !0;
392
+ break;
393
+ case "viewportanchor":
394
+ const d = O(l);
395
+ d !== null ? (this.b.viewportAnchorX = d[0], this.b.viewportAnchorY = d[1]) : s = !0;
396
+ break;
397
+ case "scroll":
398
+ l === "up" ? this.b.scroll = "up" : s = !0;
399
+ break;
400
+ default:
401
+ this.e((n = this.d) == null ? void 0 : n.t(a, l, e));
402
+ }
403
+ s && this.e((r = this.d) == null ? void 0 : r.u(a, l, e));
404
+ }
405
+ }
406
+ /**
407
+ * @see {@link https://www.w3.org/TR/webvtt1/#cue-timings-and-settings-parsing}
408
+ */
409
+ m(t, e) {
410
+ var n, r;
411
+ let s;
412
+ for (let o = 0; o < t.length; o++)
413
+ if (s = !1, b.test(t[o])) {
414
+ const [a, l] = t[o].split(b);
415
+ switch (a) {
416
+ case "region":
417
+ const c = this.h[l];
418
+ c && (this.a.region = c);
419
+ break;
420
+ case "vertical":
421
+ l === "lr" || l === "rl" ? (this.a.vertical = l, this.a.region = null) : s = !0;
422
+ break;
423
+ case "line":
424
+ const [f, u] = l.split(B);
425
+ if (f.includes(ut)) {
426
+ const w = v(f);
427
+ w !== null ? (this.a.line = w, this.a.snapToLines = !1) : s = !0;
428
+ } else {
429
+ const w = ht(f);
430
+ w !== null ? this.a.line = w : s = !0;
431
+ }
432
+ wt.test(u) ? this.a.lineAlign = u : u && (s = !0), this.a.line !== "auto" && (this.a.region = null);
433
+ break;
434
+ case "position":
435
+ const [d, g] = l.split(B), M = v(d);
436
+ M !== null ? this.a.position = M : s = !0, g && yt.test(g) ? this.a.positionAlign = g : g && (s = !0);
437
+ break;
438
+ case "size":
439
+ const k = v(l);
440
+ k !== null ? (this.a.size = k, k < 100 && (this.a.region = null)) : s = !0;
441
+ break;
442
+ case "align":
443
+ bt.test(l) ? this.a.align = l : s = !0;
444
+ break;
445
+ default:
446
+ this.e((n = this.d) == null ? void 0 : n.v(a, l, e));
447
+ }
448
+ s && this.e((r = this.d) == null ? void 0 : r.w(a, l, e));
449
+ }
450
+ }
451
+ e(t) {
452
+ var e, s;
453
+ if (t) {
454
+ if (this.k.push(t), this.f.strict)
455
+ throw this.f.cancel(), t;
456
+ (s = (e = this.f).onError) == null || s.call(e, t);
457
+ }
458
+ }
459
+ }
460
+ function E(i) {
461
+ const t = i.match(vt);
462
+ if (!t)
463
+ return null;
464
+ const e = t[1] ? parseInt(t[1], 10) : 0, s = parseInt(t[2], 10), n = parseInt(t[3], 10), r = t[4] ? parseInt(t[4].padEnd(3, "0"), 10) : 0, o = e * 3600 + s * 60 + n + r / 1e3;
465
+ return e < 0 || s < 0 || n < 0 || r < 0 || s > 59 || n > 59 ? null : o;
466
+ }
467
+ function At() {
468
+ return new F();
469
+ }
470
+ var Et = /* @__PURE__ */ Object.freeze({
471
+ __proto__: null,
472
+ VTTBlock: V,
473
+ VTTParser: F,
474
+ default: At,
475
+ parseVTTTimestamp: E
476
+ });
477
+ const St = /[0-9]/, Nt = /[\s\t]+/, D = {
478
+ c: "span",
479
+ i: "i",
480
+ b: "b",
481
+ u: "u",
482
+ ruby: "ruby",
483
+ rt: "rt",
484
+ v: "span",
485
+ lang: "span",
486
+ timestamp: "span"
487
+ }, kt = {
488
+ "&amp;": "&",
489
+ "&lt;": "<",
490
+ "&gt;": ">",
491
+ "&quot;": '"',
492
+ "&#39;": "'",
493
+ "&nbsp;": " ",
494
+ "&lrm;": "‎",
495
+ "&rlm;": "‏"
496
+ }, _t = /&(?:amp|lt|gt|quot|#(0+)?39|nbsp|lrm|rlm);/g, Ct = /* @__PURE__ */ new Set([
497
+ "white",
498
+ "lime",
499
+ "cyan",
500
+ "red",
501
+ "yellow",
502
+ "magenta",
503
+ "blue",
504
+ "black"
505
+ ]), Rt = /* @__PURE__ */ new Set(Object.keys(D));
506
+ function W(i) {
507
+ var c, f;
508
+ let t = "", e = 1, s = [], n = [], r;
509
+ for (let u = 0; u < i.text.length; u++) {
510
+ const d = i.text[u];
511
+ switch (e) {
512
+ case 1:
513
+ d === "<" ? (l(), e = 2) : t += d;
514
+ break;
515
+ case 2:
516
+ switch (d) {
517
+ case `
518
+ `:
519
+ case " ":
520
+ case " ":
521
+ o(), e = 4;
522
+ break;
523
+ case ".":
524
+ o(), e = 3;
525
+ break;
526
+ case "/":
527
+ e = 5;
528
+ break;
529
+ case ">":
530
+ o(), e = 1;
531
+ break;
532
+ default:
533
+ !t && St.test(d) && (e = 6), t += d;
534
+ break;
535
+ }
536
+ break;
537
+ case 3:
538
+ switch (d) {
539
+ case " ":
540
+ case " ":
541
+ case `
542
+ `:
543
+ a(), r && ((c = r.class) == null || c.trim()), e = 4;
544
+ break;
545
+ case ".":
546
+ a();
547
+ break;
548
+ case ">":
549
+ a(), r && ((f = r.class) == null || f.trim()), e = 1;
550
+ break;
551
+ default:
552
+ t += d;
553
+ }
554
+ break;
555
+ case 4:
556
+ d === ">" ? (t = t.replace(Nt, " "), (r == null ? void 0 : r.type) === "v" ? r.voice = _(t) : (r == null ? void 0 : r.type) === "lang" && (r.lang = _(t)), t = "", e = 1) : t += d;
557
+ break;
558
+ case 5:
559
+ d === ">" && (t = "", r = n.pop(), e = 1);
560
+ break;
561
+ case 6:
562
+ if (d === ">") {
563
+ const g = E(t);
564
+ g !== null && g >= i.startTime && g <= i.endTime && (t = "timestamp", o(), r.time = g), t = "", e = 1;
565
+ } else
566
+ t += d;
567
+ break;
568
+ }
569
+ }
570
+ function o() {
571
+ if (Rt.has(t)) {
572
+ const u = r;
573
+ r = It(t), u ? (n[n.length - 1] !== u && n.push(u), u.children.push(r)) : s.push(r);
574
+ }
575
+ t = "", e = 1;
576
+ }
577
+ function a() {
578
+ if (r && t) {
579
+ const u = t.replace("bg_", "");
580
+ Ct.has(u) ? r[t.startsWith("bg_") ? "bgColor" : "color"] = u : r.class = r.class ? r.class + " " + t : t;
581
+ }
582
+ t = "";
583
+ }
584
+ function l() {
585
+ if (!t)
586
+ return;
587
+ const u = { type: "text", data: _(t) };
588
+ r ? r.children.push(u) : s.push(u), t = "";
589
+ }
590
+ return e === 1 && l(), s;
591
+ }
592
+ function It(i) {
593
+ return {
594
+ tagName: D[i],
595
+ type: i,
596
+ children: []
597
+ };
598
+ }
599
+ function _(i) {
600
+ return i.replace(_t, (t) => kt[t] || "'");
601
+ }
602
+ function p(i, t, e) {
603
+ i.style.setProperty(`--${t}`, e + "");
604
+ }
605
+ function m(i, t, e = !0) {
606
+ i.setAttribute(`data-${t}`, e === !0 ? "" : e + "");
607
+ }
608
+ function S(i, t) {
609
+ i.setAttribute("part", t);
610
+ }
611
+ function xt(i) {
612
+ return parseFloat(getComputedStyle(i).lineHeight) || 0;
613
+ }
614
+ function Lt(i) {
615
+ const t = document.createElement("template");
616
+ return t.innerHTML = R(i), { cue: i, content: t.content };
617
+ }
618
+ function R(i, t = 0) {
619
+ return I(W(i), t);
620
+ }
621
+ function I(i, t = 0) {
622
+ let e, s = "";
623
+ for (const n of i)
624
+ if (n.type === "text")
625
+ s += n.data;
626
+ else {
627
+ const r = n.type === "timestamp";
628
+ e = {}, e.class = n.class, e.title = n.type === "v" && n.voice, e.lang = n.type === "lang" && n.lang, e.part = n.type === "v" && "voice", r && (e.part = "timed", e["data-time"] = n.time, e["data-future"] = n.time > t, e["data-past"] = n.time < t), e.style = `${n.color ? `color: ${n.color};` : ""}${n.bgColor ? `background-color: ${n.bgColor};` : ""}`;
629
+ const o = Object.entries(e).filter((a) => a[1]).map((a) => `${a[0]}="${a[1] === !0 ? "" : a[1]}"`).join(" ");
630
+ s += `<${n.tagName}${o ? " " + o : ""}>${I(
631
+ n.children
632
+ )}</${n.tagName}>`;
633
+ }
634
+ return s;
635
+ }
636
+ function X(i, t) {
637
+ for (const e of i.querySelectorAll('[part="timed"]')) {
638
+ const s = Number(e.getAttribute("data-time"));
639
+ Number.isNaN(s) || (s > t ? m(e, "future") : e.removeAttribute("data-future"), s < t ? m(e, "past") : e.removeAttribute("data-past"));
640
+ }
641
+ }
642
+ function Mt(i, t) {
643
+ let e = null, s;
644
+ function n() {
645
+ r(), i(...s), s = void 0;
646
+ }
647
+ function r() {
648
+ clearTimeout(e), e = null;
649
+ }
650
+ function o() {
651
+ s = [].slice.call(arguments), r(), e = setTimeout(n, t);
652
+ }
653
+ return o;
654
+ }
655
+ const T = Symbol(0);
656
+ function x(i) {
657
+ return i instanceof HTMLElement ? {
658
+ top: i.offsetTop,
659
+ width: i.clientWidth,
660
+ height: i.clientHeight,
661
+ left: i.offsetLeft,
662
+ right: i.offsetLeft + i.clientWidth,
663
+ bottom: i.offsetTop + i.clientHeight
664
+ } : { ...i };
665
+ }
666
+ function N(i, t, e) {
667
+ switch (t) {
668
+ case "+x":
669
+ i.left += e, i.right += e;
670
+ break;
671
+ case "-x":
672
+ i.left -= e, i.right -= e;
673
+ break;
674
+ case "+y":
675
+ i.top += e, i.bottom += e;
676
+ break;
677
+ case "-y":
678
+ i.top -= e, i.bottom -= e;
679
+ break;
680
+ }
681
+ }
682
+ function Pt(i, t) {
683
+ return i.left <= t.right && i.right >= t.left && i.top <= t.bottom && i.bottom >= t.top;
684
+ }
685
+ function Ot(i, t) {
686
+ for (let e = 0; e < t.length; e++)
687
+ if (Pt(i, t[e]))
688
+ return t[e];
689
+ return null;
690
+ }
691
+ function z(i, t) {
692
+ return t.top >= 0 && t.bottom <= i.height && t.left >= 0 && t.right <= i.width;
693
+ }
694
+ function Bt(i, t, e) {
695
+ switch (e) {
696
+ case "+x":
697
+ return t.left < 0;
698
+ case "-x":
699
+ return t.right > i.width;
700
+ case "+y":
701
+ return t.top < 0;
702
+ case "-y":
703
+ return t.bottom > i.height;
704
+ }
705
+ }
706
+ function zt(i, t) {
707
+ const e = Math.max(0, Math.min(i.width, t.right) - Math.max(0, t.left)), s = Math.max(0, Math.min(i.height, t.bottom) - Math.max(0, t.top));
708
+ return e * s / (i.height * i.width);
709
+ }
710
+ function L(i, t) {
711
+ return {
712
+ top: t.top / i.height,
713
+ left: t.left / i.width,
714
+ right: (i.width - t.right) / i.width,
715
+ bottom: (i.height - t.bottom) / i.height
716
+ };
717
+ }
718
+ function q(i, t) {
719
+ return t.top = t.top * i.height, t.left = t.left * i.width, t.right = i.width - t.right * i.width, t.bottom = i.height - t.bottom * i.height, t;
720
+ }
721
+ const Y = ["top", "left", "right", "bottom"];
722
+ function K(i, t, e, s) {
723
+ const n = L(t, e);
724
+ for (const r of Y)
725
+ p(i, `${s}-${r}`, n[r] * 100 + "%");
726
+ }
727
+ function J(i, t, e, s) {
728
+ let n = 1, r, o = { ...t };
729
+ for (let a = 0; a < s.length; a++) {
730
+ for (; Bt(i, t, s[a]) || z(i, t) && Ot(t, e); )
731
+ N(t, s[a], 1);
732
+ if (z(i, t))
733
+ return t;
734
+ const l = zt(i, t);
735
+ n > l && (r = { ...t }, n = l), t = { ...o };
736
+ }
737
+ return r || o;
738
+ }
739
+ const A = Symbol(0);
740
+ function jt(i, t, e, s) {
741
+ let n = e.firstElementChild, r = Ht(t), o, a = [];
742
+ if (e[T] || (e[T] = $t(i, e)), o = q(i, { ...e[T] }), e[A])
743
+ a = [e[A] === "top" ? "+y" : "-y", "+x", "-x"];
744
+ else if (t.snapToLines) {
745
+ let l;
746
+ switch (t.vertical) {
747
+ case "":
748
+ a = ["+y", "-y"], l = "height";
749
+ break;
750
+ case "rl":
751
+ a = ["+x", "-x"], l = "width";
752
+ break;
753
+ case "lr":
754
+ a = ["-x", "+x"], l = "width";
755
+ break;
756
+ }
757
+ let c = xt(n), f = c * Math.round(r), u = i[l] + c, d = a[0];
758
+ Math.abs(f) > u && (f = f < 0 ? -1 : 1, f *= Math.ceil(u / c) * c), r < 0 && (f += t.vertical === "" ? i.height : i.width, a = a.reverse()), N(o, d, f);
759
+ } else {
760
+ const l = t.vertical === "", c = l ? "+y" : "+x", f = l ? o.height : o.width;
761
+ N(
762
+ o,
763
+ c,
764
+ (l ? i.height : i.width) * r / 100
765
+ ), N(
766
+ o,
767
+ c,
768
+ t.lineAlign === "center" ? f / 2 : t.lineAlign === "end" ? f : 0
769
+ ), a = l ? ["-y", "+y", "-x", "+x"] : ["-x", "+x", "-y", "+y"];
770
+ }
771
+ return o = J(i, o, s, a), K(e, i, o, "cue"), o;
772
+ }
773
+ function $t(i, t) {
774
+ const e = x(t), s = Gt(t);
775
+ if (t[A] = !1, s.top && (e.top = s.top, e.bottom = s.top + e.height, t[A] = "top"), s.bottom) {
776
+ const n = i.height - s.bottom;
777
+ e.top = n - e.height, e.bottom = n, t[A] = "bottom";
778
+ }
779
+ return s.left && (e.left = s.left), s.right && (e.right = i.width - s.right), L(i, e);
780
+ }
781
+ function Gt(i) {
782
+ const t = {};
783
+ for (const e of Y)
784
+ t[e] = parseFloat(i.style.getPropertyValue(`--cue-${e}`));
785
+ return t;
786
+ }
787
+ function Ht(i) {
788
+ return i.line === "auto" ? i.snapToLines ? -1 : 100 : i.line;
789
+ }
790
+ function Vt(i) {
791
+ if (i.position === "auto")
792
+ switch (i.align) {
793
+ case "start":
794
+ case "left":
795
+ return 0;
796
+ case "right":
797
+ case "end":
798
+ return 100;
799
+ default:
800
+ return 50;
801
+ }
802
+ return i.position;
803
+ }
804
+ function Ft(i, t) {
805
+ if (i.positionAlign === "auto")
806
+ switch (i.align) {
807
+ case "start":
808
+ return t === "ltr" ? "line-left" : "line-right";
809
+ case "end":
810
+ return t === "ltr" ? "line-right" : "line-left";
811
+ case "center":
812
+ return "center";
813
+ default:
814
+ return `line-${i.align}`;
815
+ }
816
+ return i.positionAlign;
817
+ }
818
+ const Dt = ["-y", "+y", "-x", "+x"];
819
+ function Wt(i, t, e, s) {
820
+ let n = Array.from(e.querySelectorAll('[part="cue-display"]')), r = 0, o = Math.max(0, n.length - t.lines);
821
+ for (let l = n.length - 1; l >= o; l--)
822
+ r += n[l].offsetHeight;
823
+ p(e, "region-height", r + "px"), e[T] || (e[T] = L(i, x(e)));
824
+ let a = { ...e[T] };
825
+ return a = q(i, a), a.width = e.clientWidth, a.height = r, a.right = a.left + a.width, a.bottom = a.top + r, a = J(i, a, s, Dt), K(e, i, a, "region"), a;
826
+ }
827
+ class Xt {
828
+ constructor(t, e) {
829
+ h(this, "overlay");
830
+ h(this, "z");
831
+ h(this, "A", 0);
832
+ h(this, "C", "ltr");
833
+ h(this, "B", []);
834
+ h(this, "D", !1);
835
+ h(this, "E");
836
+ h(this, "h", /* @__PURE__ */ new Map());
837
+ h(this, "j", /* @__PURE__ */ new Map());
838
+ h(this, "K", Mt(() => {
839
+ this.D = !1, this.G();
840
+ for (const t of this.h.values())
841
+ t[T] = null;
842
+ for (const t of this.j.values())
843
+ t && (t[T] = null);
844
+ this.H(!0);
845
+ }, 50));
846
+ this.overlay = t, this.dir = (e == null ? void 0 : e.dir) ?? "ltr", t.setAttribute("translate", "yes"), t.setAttribute("aria-live", "off"), t.setAttribute("aria-atomic", "true"), S(t, "captions"), this.G(), this.E = new ResizeObserver(this.I.bind(this)), this.E.observe(t);
847
+ }
848
+ /* Text direction. */
849
+ get dir() {
850
+ return this.C;
851
+ }
852
+ set dir(t) {
853
+ this.C = t, m(this.overlay, "dir", t);
854
+ }
855
+ get currentTime() {
856
+ return this.A;
857
+ }
858
+ set currentTime(t) {
859
+ this.A = t, this.update();
860
+ }
861
+ changeTrack({ regions: t, cues: e }) {
862
+ this.reset(), this.J(t);
863
+ for (const s of e)
864
+ this.j.set(s, null);
865
+ this.update();
866
+ }
867
+ addCue(t) {
868
+ this.j.set(t, null), this.update();
869
+ }
870
+ removeCue(t) {
871
+ this.j.delete(t), this.update();
872
+ }
873
+ update(t = !1) {
874
+ this.H(t);
875
+ }
876
+ reset() {
877
+ this.j.clear(), this.h.clear(), this.B = [], this.overlay.textContent = "";
878
+ }
879
+ destroy() {
880
+ this.reset(), this.E.disconnect();
881
+ }
882
+ I() {
883
+ this.D = !0, this.K();
884
+ }
885
+ G() {
886
+ this.z = x(this.overlay), p(this.overlay, "overlay-width", this.z.width + "px"), p(this.overlay, "overlay-height", this.z.height + "px");
887
+ }
888
+ H(t = !1) {
889
+ if (!this.j.size || this.D)
890
+ return;
891
+ let e, s = [...this.j.keys()].filter((r) => this.A >= r.startTime && this.A <= r.endTime).sort(
892
+ (r, o) => r.startTime !== o.startTime ? r.startTime - o.startTime : r.endTime - o.endTime
893
+ ), n = s.map((r) => r.region);
894
+ for (let r = 0; r < this.B.length; r++) {
895
+ if (e = this.B[r], s[r] === e)
896
+ continue;
897
+ if (e.region && !n.includes(e.region)) {
898
+ const a = this.h.get(e.region.id);
899
+ a && (a.removeAttribute("data-active"), t = !0);
900
+ }
901
+ const o = this.j.get(e);
902
+ o && (o.remove(), t = !0);
903
+ }
904
+ for (let r = 0; r < s.length; r++) {
905
+ e = s[r];
906
+ let o = this.j.get(e);
907
+ o || this.j.set(e, o = this.L(e));
908
+ const a = this.F(e) && this.h.get(e.region.id);
909
+ a && !a.hasAttribute("data-active") && (requestAnimationFrame(() => m(a, "active")), t = !0), o.isConnected || ((a || this.overlay).append(o), t = !0);
910
+ }
911
+ if (t) {
912
+ const r = [], o = /* @__PURE__ */ new Set();
913
+ for (let a = s.length - 1; a >= 0; a--) {
914
+ if (e = s[a], o.has(e.region || e))
915
+ continue;
916
+ const l = this.F(e), c = l ? this.h.get(e.region.id) : this.j.get(e);
917
+ l ? r.push(Wt(this.z, e.region, c, r)) : r.push(jt(this.z, e, c, r)), o.add(l ? e.region : e);
918
+ }
919
+ }
920
+ X(this.overlay, this.A), this.B = s;
921
+ }
922
+ J(t) {
923
+ if (t)
924
+ for (const e of t) {
925
+ const s = this.M(e);
926
+ this.h.set(e.id, s), this.overlay.append(s);
927
+ }
928
+ }
929
+ M(t) {
930
+ const e = document.createElement("div");
931
+ return S(e, "region"), m(e, "id", t.id), m(e, "scroll", t.scroll), p(e, "region-width", t.width + "%"), p(e, "region-anchor-x", t.regionAnchorX), p(e, "region-anchor-y", t.regionAnchorY), p(e, "region-viewport-anchor-x", t.viewportAnchorX), p(e, "region-viewport-anchor-y", t.viewportAnchorY), p(e, "region-lines", t.lines), e;
932
+ }
933
+ L(t) {
934
+ var o;
935
+ const e = document.createElement("div"), s = Vt(t), n = Ft(t, this.C);
936
+ if (S(e, "cue-display"), t.vertical !== "" && m(e, "vertical"), p(e, "cue-text-align", t.align), t.style)
937
+ for (const a of Object.keys(t.style))
938
+ e.style.setProperty(a, t.style[a]);
939
+ if (this.F(t))
940
+ p(
941
+ e,
942
+ "cue-offset",
943
+ `${s - (n === "line-right" ? 100 : n === "center" ? 50 : 0)}%`
944
+ );
945
+ else if (p(
946
+ e,
947
+ "cue-writing-mode",
948
+ t.vertical === "" ? "horizontal-tb" : t.vertical === "lr" ? "vertical-lr" : "vertical-rl"
949
+ ), !((o = t.style) != null && o["--cue-width"])) {
950
+ let a = s;
951
+ n === "line-left" ? a = 100 - s : n === "center" && s <= 50 ? a = s * 2 : n === "center" && s > 50 && (a = (100 - s) * 2);
952
+ const l = t.size < a ? t.size : a;
953
+ t.vertical === "" ? p(e, "cue-width", l + "%") : p(e, "cue-height", l + "%");
954
+ }
955
+ const r = document.createElement("div");
956
+ return S(r, "cue"), t.id && m(r, "id", t.id), r.innerHTML = R(t), e.append(r), e;
957
+ }
958
+ F(t) {
959
+ return t.region && t.size === 100 && t.vertical === "" && t.line === "auto";
960
+ }
961
+ }
962
+ const Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
963
+ __proto__: null,
964
+ CaptionsRenderer: Xt,
965
+ ParseError: tt,
966
+ ParseErrorCode: U,
967
+ TextCue: nt,
968
+ VTTCue: G,
969
+ VTTRegion: H,
970
+ createVTTCueTemplate: Lt,
971
+ parseByteStream: $,
972
+ parseResponse: rt,
973
+ parseText: st,
974
+ parseTextStream: C,
975
+ parseVTTTimestamp: E,
976
+ renderVTTCueString: R,
977
+ renderVTTTokensString: I,
978
+ tokenizeVTTCue: W,
979
+ updateTimedVTTCueNodes: X
980
+ }, Symbol.toStringTag, { value: "Module" }));
981
+ export {
982
+ Xt as C,
983
+ tt as P,
984
+ F as V,
985
+ V as a,
986
+ G as b,
987
+ U as c,
988
+ Yt as d,
989
+ E as p,
990
+ R as r,
991
+ X as u
992
+ };