@webitel/ui-sdk 26.6.34 → 26.6.36

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 (182) hide show
  1. package/dist/AgentStatus.enum-C3IGHtvR.js +9 -0
  2. package/dist/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
  3. package/dist/caseConverters-DXegZoCt.js +27 -0
  4. package/dist/chunk-CY3AvKd6.js +20 -0
  5. package/dist/clients-A6MHYfOX.js +36118 -0
  6. package/dist/components-DFOWyAAb.js +5395 -0
  7. package/dist/composables-DnDH-KUv.js +263 -0
  8. package/dist/convertDuration-1K7fuEpO.js +8 -0
  9. package/dist/debounce-DrmECuJ2.js +128 -0
  10. package/dist/deep-copy-CQw5yeEH.js +41 -0
  11. package/dist/displayText-CtaxzaBz.js +3 -0
  12. package/dist/dist-05Bf47Wg.js +87 -0
  13. package/dist/dist-BYiYpK00.js +7 -0
  14. package/dist/dist-Dz55hlwp.js +1371 -0
  15. package/dist/engineCallFileType-D7QVFOac.js +11 -0
  16. package/dist/enums-pbYAJNeb.js +158 -0
  17. package/dist/errors-SUXKojVW.js +69 -0
  18. package/dist/floating-ui.dom-n2j9PKCB.js +842 -0
  19. package/dist/generateInstance-ppTIeLX4.js +2582 -0
  20. package/dist/isObject-Dgs_L5xI.js +11 -0
  21. package/dist/logger-hl3ueNok.js +47 -0
  22. package/dist/prod-Cp0BjuxI.js +775 -0
  23. package/dist/prod-DSuxcp5t.js +2 -0
  24. package/dist/side-channel-Cyte-MzW.js +833 -0
  25. package/dist/sortQueryAdapters-CyYXvnDN.js +14 -0
  26. package/dist/srt-parser-DdH5U08c.js +21 -0
  27. package/dist/ssa-parser-Bjs7yDD1.js +184 -0
  28. package/dist/ui-sdk.css +2 -1
  29. package/dist/ui-sdk.js +34567 -4
  30. package/dist/ui-sdk.umd.cjs +7748 -7606
  31. package/dist/useExpansion-DVdIpoOn.js +24 -0
  32. package/dist/useValidation-DG0tifBv.js +37 -0
  33. package/dist/useVidstackSrc-DfNrFbOO.js +155 -0
  34. package/dist/useWtTable-tqmVOvve.js +12 -0
  35. package/dist/vidstack-B01xzxC4-DeYSgDZy.js +7 -0
  36. package/dist/vidstack-BGSTndAW-CyKM_CM4.js +957 -0
  37. package/dist/vidstack-BQlOPwOu-ChhdffAJ.js +43 -0
  38. package/dist/vidstack-Bq6c3Bam-3dCf_D36.js +398 -0
  39. package/dist/vidstack-C2US-gSO-DeIgENrW.js +127 -0
  40. package/dist/vidstack-C9vIqaYT-C1EgPq17.js +9 -0
  41. package/dist/vidstack-CTojmhKq-D7sZJxgm.js +30 -0
  42. package/dist/vidstack-ChQTHmIQ-nTO94M6P.js +51 -0
  43. package/dist/vidstack-Ci54COQW-CAAXpwzv.js +208 -0
  44. package/dist/vidstack-D2pY00kU-DoW028io.js +70 -0
  45. package/dist/vidstack-D5EzK014-DOe01V3H.js +14 -0
  46. package/dist/vidstack-DDXt6fpN-Don_e6LS.js +42 -0
  47. package/dist/vidstack-D_-9AA6_-Dq3APB0-.js +19 -0
  48. package/dist/vidstack-Dihypf8P-ibWMCHK-.js +12 -0
  49. package/dist/vidstack-Dm1xEU9Q-VlefmrP8.js +31 -0
  50. package/dist/vidstack-DqAw8m9J-Dk1GT3Oe.js +22 -0
  51. package/dist/vidstack-audio-B58bvsna.js +23 -0
  52. package/dist/vidstack-dash-CX-LTHx3.js +332 -0
  53. package/dist/vidstack-google-cast-Co5Q_rfL.js +361 -0
  54. package/dist/vidstack-hls-CLzdTFu6.js +269 -0
  55. package/dist/vidstack-krOAtKMi-DN1WZC3p.js +30 -0
  56. package/dist/vidstack-video-XtP8iTBc.js +151 -0
  57. package/dist/vidstack-vimeo-EzzPpggD.js +386 -0
  58. package/dist/vidstack-youtube-C1_NAfWa.js +205 -0
  59. package/dist/vue-i18n-B8Px6VcD.js +2201 -0
  60. package/dist/wt-action-bar-Ba1ZJjE_.js +85 -0
  61. package/dist/wt-button-DENbrKdy.js +785 -0
  62. package/dist/wt-button-select-BnRHgJ4i.js +80 -0
  63. package/dist/wt-call-media-action-Bkyppnsm.js +42 -0
  64. package/dist/wt-chat-emoji-D3SBme6f.js +2208 -0
  65. package/dist/wt-confirm-dialog-DCUitG2v.js +70 -0
  66. package/dist/wt-context-menu-yW52oF-2.js +89 -0
  67. package/dist/wt-copy-action-d9gVzAsB.js +38 -0
  68. package/dist/wt-datepicker-Cnbarx_j.js +5774 -0
  69. package/dist/wt-display-chip-items-DagfTTIq.js +34 -0
  70. package/dist/wt-dual-panel-DAhTYFS_.js +49 -0
  71. package/dist/wt-dummy-CLjhRWZ6.js +59 -0
  72. package/dist/wt-error-page-vhu4lIyF.js +62 -0
  73. package/dist/wt-expand-transition-C2p9bR4j.js +39 -0
  74. package/dist/wt-expansion-card-qsxvbtZm.js +47 -0
  75. package/dist/wt-expansion-panel-C_EXvx1d.js +40 -0
  76. package/dist/wt-filters-panel-wrapper-Cc9b3aci.js +51 -0
  77. package/dist/wt-galleria-CWXKuZTD.js +224 -0
  78. package/dist/wt-icon-action-CQlZHMDB.js +100 -0
  79. package/dist/wt-icon-btn-CjjI4cgE.js +107 -0
  80. package/dist/wt-icon-pxO7IjwV.js +1026 -0
  81. package/dist/wt-inline-add-panel-B0E4Vk2l.js +43 -0
  82. package/dist/wt-navigation-menu-CenQi_-T.js +126 -0
  83. package/dist/wt-notifications-bar-Ep1QuFZi.js +52 -0
  84. package/dist/wt-page-header-CDbd4aOh.js +59 -0
  85. package/dist/wt-pagination-BA_PZPIE.js +94 -0
  86. package/dist/wt-player-uidPXSTe.js +287 -0
  87. package/dist/wt-popover-CJZH3wMl.js +98 -0
  88. package/dist/wt-screen-recordings-action-Dg7Ts2Jt.js +37 -0
  89. package/dist/wt-search-bar-CWZdvAOf.js +123 -0
  90. package/dist/wt-selection-popup-B77UY7Yu.js +79 -0
  91. package/dist/wt-send-message-popup-CltYZA9D.js +77 -0
  92. package/dist/wt-slider-BS3SoGht.js +68 -0
  93. package/dist/wt-start-page-eN1PEokc.js +86 -0
  94. package/dist/wt-status-select-A5t6Vjm4.js +101 -0
  95. package/dist/wt-stepper-B6zpd1Uh.js +41 -0
  96. package/dist/wt-table-D0FynxIE.js +364 -0
  97. package/dist/wt-table-actions-4-peSVkc.js +63 -0
  98. package/dist/wt-table-column-select-DFF6z3a3.js +100 -0
  99. package/dist/wt-tabs-DuOgj-lZ.js +60 -0
  100. package/dist/wt-time-input-CO2cop3y.js +62 -0
  101. package/dist/wt-timepicker-BltFF1QD.js +145 -0
  102. package/dist/wt-tree-ZyoPrNOl.js +1206 -0
  103. package/dist/wt-tree-table-MLET4gIv.js +221 -0
  104. package/dist/wt-type-extension-value-input-028o8xRF.js +104 -0
  105. package/dist/wt-vidstack-player-B-WSB_Be.js +7440 -0
  106. package/package.json +5 -5
  107. package/src/components/wt-multi-select/wt-multi-select.vue +3 -0
  108. package/src/components/wt-single-select/wt-single-select.vue +5 -0
  109. package/src/components/wt-table-column-select/__tests__/WtTableColumnSelect.spec.js +3 -3
  110. package/src/plugins/primevue/theme/components/multi-select/multi-select.js +4 -0
  111. package/src/plugins/primevue/theme/components/single-select/single-select.js +4 -0
  112. package/types/plugins/primevue/theme/components/multi-select/multi-select.d.ts +2 -0
  113. package/types/plugins/primevue/theme/components/single-select/single-select.d.ts +2 -0
  114. package/dist/contacts-DzLKP4GQ.js +0 -49654
  115. package/dist/displayText-Cbh4IOfM.js +0 -5
  116. package/dist/engineCallFileType-yaadA7-2.js +0 -8
  117. package/dist/errors-CTL-RV3B.js +0 -70
  118. package/dist/index-BgLoxAyu.js +0 -50
  119. package/dist/install-Cm-8fwtB.js +0 -53489
  120. package/dist/isObject-BSIwu4UO.js +0 -28
  121. package/dist/prod-BoQuiIB3.js +0 -973
  122. package/dist/srt-parser-CsN7bp5E.js +0 -26
  123. package/dist/ssa-parser-BJOOPeQF.js +0 -200
  124. package/dist/useExpansion-BrQ40HiR.js +0 -24
  125. package/dist/useVidstackSrc-DKXY5f7v.js +0 -1341
  126. package/dist/vidstack-Bq6c3Bam-BHF-0bv4.js +0 -426
  127. package/dist/vidstack-D2pY00kU-B8Mhvp0m.js +0 -136
  128. package/dist/vidstack-DDXt6fpN-D0eou9h7.js +0 -51
  129. package/dist/vidstack-D_-9AA6_-DYAfclN7.js +0 -21
  130. package/dist/vidstack-Dm1xEU9Q-CXHNvShT.js +0 -30
  131. package/dist/vidstack-DqAw8m9J-b5BHkhrw.js +0 -22
  132. package/dist/vidstack-audio-CPu_TbjK.js +0 -28
  133. package/dist/vidstack-dash-VYriMjws.js +0 -393
  134. package/dist/vidstack-google-cast-Byp1cemB.js +0 -383
  135. package/dist/vidstack-hls-DdUQcmEx.js +0 -310
  136. package/dist/vidstack-krOAtKMi-C50BTxmn.js +0 -28
  137. package/dist/vidstack-video-BpSKQ3wb.js +0 -164
  138. package/dist/vidstack-vimeo-CgVJJm06.js +0 -452
  139. package/dist/vidstack-youtube-DuES80MV.js +0 -233
  140. package/dist/wt-action-bar-TMuck-q1.js +0 -102
  141. package/dist/wt-button-select-D1NP5Xw9.js +0 -105
  142. package/dist/wt-call-media-action-BsepfSVy.js +0 -60
  143. package/dist/wt-chat-emoji-B00dUXbP.js +0 -2909
  144. package/dist/wt-confirm-dialog-1hO851Da.js +0 -92
  145. package/dist/wt-context-menu-BrzRmoDw.js +0 -104
  146. package/dist/wt-copy-action-CEMOiYzN.js +0 -60
  147. package/dist/wt-datepicker-DHqZIkg2.js +0 -5660
  148. package/dist/wt-display-chip-items-D7kEAcOo.js +0 -47
  149. package/dist/wt-dual-panel-DEWR3-k-.js +0 -66
  150. package/dist/wt-dummy-DfgxciHw.js +0 -104
  151. package/dist/wt-error-page-DUSVxkXq.js +0 -89
  152. package/dist/wt-expansion-card-B8JKBMLa.js +0 -56
  153. package/dist/wt-expansion-panel-DL3eoj_b.js +0 -54
  154. package/dist/wt-filters-panel-wrapper-CGXQiRvh.js +0 -75
  155. package/dist/wt-galleria-Bahv6Mgq.js +0 -323
  156. package/dist/wt-inline-add-panel-B4RjHVDI.js +0 -49
  157. package/dist/wt-navigation-menu-DqCXAV8E.js +0 -159
  158. package/dist/wt-notifications-bar-CRIKdVai.js +0 -79
  159. package/dist/wt-page-header-DdsnoLgd.js +0 -115
  160. package/dist/wt-pagination-C_b3WmH1.js +0 -144
  161. package/dist/wt-player-B4GWEqdu.js +0 -291
  162. package/dist/wt-popover-Di-7_rDL.js +0 -4
  163. package/dist/wt-popover.vue_vue_type_style_index_0_lang-DMDTlCgv.js +0 -81
  164. package/dist/wt-screen-recordings-action-B4OpN5kl.js +0 -54
  165. package/dist/wt-search-bar-B_0_YwCn.js +0 -144
  166. package/dist/wt-selection-popup-Boyw9_V_.js +0 -109
  167. package/dist/wt-send-message-popup-0C23Zocu.js +0 -579
  168. package/dist/wt-slider-BEkw4KGp.js +0 -4
  169. package/dist/wt-slider.vue_vue_type_script_setup_true_lang-DlaRDHxo.js +0 -55
  170. package/dist/wt-start-page-HQMIG05a.js +0 -99
  171. package/dist/wt-status-select-H_me1xwA.js +0 -138
  172. package/dist/wt-stepper-hJxqyiyo.js +0 -65
  173. package/dist/wt-table-Du6mtkPw.js +0 -426
  174. package/dist/wt-table-actions-ah_H6LY9.js +0 -79
  175. package/dist/wt-table-column-select-C2Nbic5-.js +0 -128
  176. package/dist/wt-tabs-D4aGEd_t.js +0 -74
  177. package/dist/wt-time-input-DYiW0ijt.js +0 -42
  178. package/dist/wt-timepicker-BE8POMhF.js +0 -118
  179. package/dist/wt-tree-table-BJxaXqKl.js +0 -285
  180. package/dist/wt-tree-u0Zp8nb5.js +0 -2777
  181. package/dist/wt-type-extension-value-input-C1VlNa4K.js +0 -121
  182. package/dist/wt-vidstack-player-C1eyCEzP.js +0 -9094
@@ -1,28 +0,0 @@
1
- import { s as t } from "./useVidstackSrc-DKXY5f7v.js";
2
- import { H as r, a as s } from "./vidstack-Bq6c3Bam-BHF-0bv4.js";
3
- class d extends r {
4
- $$PROVIDER_TYPE = "AUDIO";
5
- get type() {
6
- return "audio";
7
- }
8
- airPlay;
9
- constructor(i, e) {
10
- super(i, e), t(() => {
11
- this.airPlay = new s(this.media, e);
12
- }, this.scope);
13
- }
14
- setup() {
15
- super.setup(), this.type === "audio" && this.ctx.notify("provider-setup", this);
16
- }
17
- /**
18
- * The native HTML `<audio>` element.
19
- *
20
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement}
21
- */
22
- get audio() {
23
- return this.media;
24
- }
25
- }
26
- export {
27
- d as AudioProvider
28
- };
@@ -1,393 +0,0 @@
1
- import { p as x, Q as S, b as g, T as k, L as u, d as M, l as C } from "./wt-vidstack-player-C1eyCEzP.js";
2
- import { a0 as N, d as p, x as R, l as b, m as F, D as l, B as I, Z as P, $, h as _, R as q, b as E, j as H } from "./useVidstackSrc-DKXY5f7v.js";
3
- import { VideoProvider as j } from "./vidstack-video-BpSKQ3wb.js";
4
- import { R as O } from "./vidstack-DqAw8m9J-b5BHkhrw.js";
5
- function v(n) {
6
- try {
7
- return new Intl.DisplayNames(navigator.languages, { type: "language" }).of(n) ?? null;
8
- } catch {
9
- return null;
10
- }
11
- }
12
- const Q = (n) => `dash-${I(n)}`;
13
- class G {
14
- #e;
15
- #i;
16
- #t = null;
17
- #a = /* @__PURE__ */ new Set();
18
- #r = null;
19
- config = {};
20
- get instance() {
21
- return this.#t;
22
- }
23
- constructor(t, i) {
24
- this.#e = t, this.#i = i;
25
- }
26
- setup(t) {
27
- this.#t = t().create();
28
- const i = this.#g.bind(this);
29
- for (const s of Object.values(t.events)) this.#t.on(s, i);
30
- this.#t.on(t.events.ERROR, this.#v.bind(this));
31
- for (const s of this.#a) s(this.#t);
32
- this.#i.player.dispatch("dash-instance", {
33
- detail: this.#t
34
- }), this.#t.initialize(this.#e, void 0, !1), this.#t.updateSettings({
35
- streaming: {
36
- text: {
37
- // Disabling text rendering by dash.
38
- defaultEnabled: !1,
39
- dispatchForManualRendering: !0
40
- },
41
- buffer: {
42
- /// Enables buffer replacement when switching bitrates for faster switching.
43
- fastSwitchEnabled: !0
44
- }
45
- },
46
- ...this.config
47
- }), this.#t.on(t.events.FRAGMENT_LOADING_STARTED, this.#w.bind(this)), this.#t.on(
48
- t.events.FRAGMENT_LOADING_COMPLETED,
49
- this.#E.bind(this)
50
- ), this.#t.on(t.events.MANIFEST_LOADED, this.#b.bind(this)), this.#t.on(t.events.QUALITY_CHANGE_RENDERED, this.#S.bind(this)), this.#t.on(t.events.TEXT_TRACKS_ADDED, this.#m.bind(this)), this.#t.on(t.events.TRACK_CHANGE_RENDERED, this.#T.bind(this)), this.#i.qualities[S.enableAuto] = this.#A.bind(this), b(this.#i.qualities, "change", this.#D.bind(this)), b(this.#i.audioTracks, "change", this.#x.bind(this)), this.#r = F(this.#d.bind(this));
51
- }
52
- #s(t) {
53
- return new l(Q(t.type), { detail: t });
54
- }
55
- #d() {
56
- if (!this.#i.$state.live()) return;
57
- const t = new O(this.#f.bind(this));
58
- return t.start(), t.stop.bind(t);
59
- }
60
- #f() {
61
- if (!this.#t) return;
62
- const t = this.#t.duration() - this.#t.time();
63
- this.#i.$state.liveSyncPosition.set(isNaN(t) ? 1 / 0 : t);
64
- }
65
- #g(t) {
66
- this.#i.player?.dispatch(this.#s(t));
67
- }
68
- #n = null;
69
- #h = {};
70
- #y(t) {
71
- const i = this.#n?.[g.native], s = (i?.track).cues;
72
- if (!i || !s) return;
73
- const r = this.#n.id, a = this.#h[r] ?? 0, o = this.#s(t);
74
- for (let c = a; c < s.length; c++) {
75
- const h = s[c];
76
- h.positionAlign || (h.positionAlign = "auto"), this.#n.addCue(h, o);
77
- }
78
- this.#h[r] = s.length;
79
- }
80
- #m(t) {
81
- if (!this.#t) return;
82
- const i = t.tracks, s = [...this.#e.textTracks].filter((a) => "manualMode" in a), r = this.#s(t);
83
- for (let a = 0; a < s.length; a++) {
84
- const o = i[a], c = s[a], h = `dash-${o.kind}-${a}`, d = new k({
85
- id: h,
86
- label: o?.label ?? o.labels.find((y) => y.text)?.text ?? (o?.lang && v(o.lang)) ?? o?.lang ?? void 0,
87
- language: o.lang ?? void 0,
88
- kind: o.kind,
89
- default: o.defaultTrack
90
- });
91
- d[g.native] = {
92
- managed: !0,
93
- track: c
94
- }, d[g.readyState] = 2, d[g.onModeChange] = () => {
95
- this.#t && (d.mode === "showing" ? (this.#t.setTextTrack(a), this.#n = d) : (this.#t.setTextTrack(-1), this.#n = null));
96
- }, this.#i.textTracks.add(d, r);
97
- }
98
- }
99
- #T(t) {
100
- const { mediaType: i, newMediaInfo: s } = t;
101
- if (i === "audio") {
102
- const r = this.#i.audioTracks.getById(`dash-audio-${s.index}`);
103
- if (r) {
104
- const a = this.#s(t);
105
- this.#i.audioTracks[u.select](r, !0, a);
106
- }
107
- }
108
- }
109
- #S(t) {
110
- if (t.mediaType !== "video") return;
111
- const i = this.#i.qualities[t.newQuality];
112
- if (i) {
113
- const s = this.#s(t);
114
- this.#i.qualities[u.select](i, !0, s);
115
- }
116
- }
117
- #b(t) {
118
- if (this.#i.$state.canPlay() || !this.#t) return;
119
- const { type: i, mediaPresentationDuration: s } = t.data, r = this.#s(t);
120
- this.#i.notify("stream-type-change", i !== "static" ? "live" : "on-demand", r), this.#i.notify("duration-change", s, r), this.#i.qualities[S.setAuto](!0, r);
121
- const a = this.#t.getVideoElement(), o = this.#t.getTracksForTypeFromManifest(
122
- "video",
123
- t.data
124
- ), c = [...new Set(o.map((e) => e.mimeType))].find(
125
- (e) => e && P(a, e)
126
- ), h = o.filter(
127
- (e) => c === e.mimeType
128
- )[0];
129
- let d = this.#t.getTracksForTypeFromManifest(
130
- "audio",
131
- t.data
132
- );
133
- const y = [...new Set(d.map((e) => e.mimeType))].find(
134
- (e) => e && $(a, e)
135
- );
136
- if (d = d.filter((e) => y === e.mimeType), h.bitrateList.forEach((e, f) => {
137
- const m = {
138
- id: e.id?.toString() ?? `dash-bitrate-${f}`,
139
- width: e.width ?? 0,
140
- height: e.height ?? 0,
141
- bitrate: e.bandwidth ?? 0,
142
- codec: h.codec,
143
- index: f
144
- };
145
- this.#i.qualities[u.add](m, r);
146
- }), _(h.index)) {
147
- const e = this.#i.qualities[h.index];
148
- e && this.#i.qualities[u.select](e, !0, r);
149
- }
150
- d.forEach((e, f) => {
151
- const L = e.labels.find((T) => navigator.languages.some((D) => T.lang && D.toLowerCase().startsWith(T.lang.toLowerCase()))) || e.labels[0], A = {
152
- id: `dash-audio-${e?.index}`,
153
- label: L?.text ?? (e.lang && v(e.lang)) ?? e.lang ?? "",
154
- language: e.lang ?? "",
155
- kind: "main",
156
- mimeType: e.mimeType,
157
- codec: e.codec,
158
- index: f
159
- };
160
- this.#i.audioTracks[u.add](A, r);
161
- }), a.dispatchEvent(new l("canplay", { trigger: r }));
162
- }
163
- #v(t) {
164
- const { type: i, error: s } = t;
165
- s.code === 27 ? this.#L(s) : this.#l(s);
166
- }
167
- #w() {
168
- this.#o >= 0 && this.#c();
169
- }
170
- #E(t) {
171
- t.mediaType === "text" && requestAnimationFrame(this.#y.bind(this, t));
172
- }
173
- #o = -1;
174
- #L(t) {
175
- this.#c(), this.#t?.play(), this.#o = window.setTimeout(() => {
176
- this.#o = -1, this.#l(t);
177
- }, 5e3);
178
- }
179
- #c() {
180
- clearTimeout(this.#o), this.#o = -1;
181
- }
182
- #l(t) {
183
- this.#i.notify("error", {
184
- message: t.message ?? "",
185
- code: 1,
186
- error: t
187
- });
188
- }
189
- #A() {
190
- this.#u("video", !0);
191
- const { qualities: t } = this.#i;
192
- this.#t?.setQualityFor("video", t.selectedIndex, !0);
193
- }
194
- #u(t, i) {
195
- this.#t?.updateSettings({
196
- streaming: { abr: { autoSwitchBitrate: { [t]: i } } }
197
- });
198
- }
199
- #D() {
200
- const { qualities: t } = this.#i;
201
- !this.#t || t.auto || !t.selected || (this.#u("video", !1), this.#t.setQualityFor("video", t.selectedIndex, t.switch === "current"), q && (this.#e.currentTime = this.#e.currentTime));
202
- }
203
- #x() {
204
- if (!this.#t) return;
205
- const { audioTracks: t } = this.#i, i = this.#t.getTracksFor("audio").find(
206
- (s) => t.selected && t.selected.id === `dash-audio-${s.index}`
207
- );
208
- i && this.#t.setCurrentTrack(i);
209
- }
210
- #p() {
211
- this.#c(), this.#n = null, this.#h = {};
212
- }
213
- onInstance(t) {
214
- return this.#a.add(t), () => this.#a.delete(t);
215
- }
216
- loadSource(t) {
217
- this.#p(), p(t.src) && this.#t?.attachSource(t.src);
218
- }
219
- destroy() {
220
- this.#p(), this.#t?.destroy(), this.#t = null, this.#r?.(), this.#r = null;
221
- }
222
- }
223
- class V {
224
- #e;
225
- #i;
226
- #t;
227
- constructor(t, i, s) {
228
- this.#e = t, this.#i = i, this.#t = s, this.#a();
229
- }
230
- async #a() {
231
- const t = {
232
- onLoadStart: this.#r.bind(this),
233
- onLoaded: this.#s.bind(this),
234
- onLoadError: this.#d.bind(this)
235
- };
236
- let i = await U(this.#e, t);
237
- if (E(i) && !p(this.#e) && (i = await B(this.#e, t)), !i) return null;
238
- if (!window.dashjs.supportsMediaSource()) {
239
- const s = "[vidstack] `dash.js` is not supported in this environment";
240
- return this.#i.player.dispatch(new l("dash-unsupported")), this.#i.notify("error", { message: s, code: 4 }), null;
241
- }
242
- return i;
243
- }
244
- #r() {
245
- this.#i.player.dispatch(new l("dash-lib-load-start"));
246
- }
247
- #s(t) {
248
- this.#i.player.dispatch(
249
- new l("dash-lib-loaded", {
250
- detail: t
251
- })
252
- ), this.#t(t);
253
- }
254
- #d(t) {
255
- const i = M(t);
256
- this.#i.player.dispatch(
257
- new l("dash-lib-load-error", {
258
- detail: i
259
- })
260
- ), this.#i.notify("error", {
261
- message: i.message,
262
- code: 4,
263
- error: i
264
- });
265
- }
266
- }
267
- async function B(n, t = {}) {
268
- if (!E(n)) {
269
- if (t.onLoadStart?.(), K(n))
270
- return t.onLoaded?.(n), n;
271
- if (w(n)) {
272
- const i = n.MediaPlayer;
273
- return t.onLoaded?.(i), i;
274
- }
275
- try {
276
- const i = (await n())?.default;
277
- if (w(i))
278
- return t.onLoaded?.(i.MediaPlayer), i.MediaPlayer;
279
- if (i)
280
- t.onLoaded?.(i);
281
- else
282
- throw Error(
283
- ""
284
- );
285
- return i;
286
- } catch (i) {
287
- t.onLoadError?.(i);
288
- }
289
- }
290
- }
291
- async function U(n, t = {}) {
292
- if (p(n)) {
293
- t.onLoadStart?.();
294
- try {
295
- if (await C(n), !H(window.dashjs.MediaPlayer))
296
- throw Error(
297
- ""
298
- );
299
- const i = window.dashjs.MediaPlayer;
300
- return t.onLoaded?.(i), i;
301
- } catch (i) {
302
- t.onLoadError?.(i);
303
- }
304
- }
305
- }
306
- function K(n) {
307
- return n && n.prototype && n.prototype !== Function;
308
- }
309
- function w(n) {
310
- return n && "MediaPlayer" in n;
311
- }
312
- const Y = "https://cdn.jsdelivr.net";
313
- class Z extends j {
314
- $$PROVIDER_TYPE = "DASH";
315
- #e = null;
316
- #i = new G(this.video, this.ctx);
317
- /**
318
- * The `dash.js` constructor.
319
- */
320
- get ctor() {
321
- return this.#e;
322
- }
323
- /**
324
- * The current `dash.js` instance.
325
- */
326
- get instance() {
327
- return this.#i.instance;
328
- }
329
- /**
330
- * Whether `dash.js` is supported in this environment.
331
- */
332
- static supported = N();
333
- get type() {
334
- return "dash";
335
- }
336
- get canLiveSync() {
337
- return !0;
338
- }
339
- #t = `${Y}/npm/dashjs@4.7.4/dist/dash.all.min.js`;
340
- /**
341
- * The `dash.js` configuration object.
342
- *
343
- * @see {@link https://cdn.dashjs.org/latest/jsdoc/module-Settings.html}
344
- */
345
- get config() {
346
- return this.#i.config;
347
- }
348
- set config(t) {
349
- this.#i.config = t;
350
- }
351
- /**
352
- * The `dash.js` constructor (supports dynamic imports) or a URL of where it can be found.
353
- *
354
- * @defaultValue `https://cdn.jsdelivr.net/npm/dashjs@4.7.4/dist/dash.all.min.js`
355
- */
356
- get library() {
357
- return this.#t;
358
- }
359
- set library(t) {
360
- this.#t = t;
361
- }
362
- preconnect() {
363
- p(this.#t) && x(this.#t);
364
- }
365
- setup() {
366
- super.setup(), new V(this.#t, this.ctx, (t) => {
367
- this.#e = t, this.#i.setup(t), this.ctx.notify("provider-setup", this);
368
- const i = R(this.ctx.$state.source);
369
- i && this.loadSource(i);
370
- });
371
- }
372
- async loadSource(t, i) {
373
- if (!p(t.src)) {
374
- this.removeSource();
375
- return;
376
- }
377
- this.media.preload = i || "", this.appendSource(t, "application/x-mpegurl"), this.#i.loadSource(t), this.currentSrc = t;
378
- }
379
- /**
380
- * The given callback is invoked when a new `dash.js` instance is created and right before it's
381
- * attached to media.
382
- */
383
- onInstance(t) {
384
- const i = this.#i.instance;
385
- return i && t(i), this.#i.onInstance(t);
386
- }
387
- destroy() {
388
- this.#i.destroy();
389
- }
390
- }
391
- export {
392
- Z as DASHProvider
393
- };