@ix_waterford/lib 1.0.6 → 1.0.8

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 (36) hide show
  1. package/dist/index.html +1 -1
  2. package/dist/index.js +122379 -0
  3. package/dist/index.js.map +1 -0
  4. package/package.json +5 -5
  5. package/dist/static/js/async/reactPlayerDash.js +0 -351
  6. package/dist/static/js/async/reactPlayerDash.js.map +0 -1
  7. package/dist/static/js/async/reactPlayerHls.js +0 -430
  8. package/dist/static/js/async/reactPlayerHls.js.map +0 -1
  9. package/dist/static/js/async/reactPlayerMux.js +0 -16076
  10. package/dist/static/js/async/reactPlayerMux.js.map +0 -1
  11. package/dist/static/js/async/reactPlayerPreview.js +0 -112
  12. package/dist/static/js/async/reactPlayerPreview.js.map +0 -1
  13. package/dist/static/js/async/reactPlayerSpotify.js +0 -519
  14. package/dist/static/js/async/reactPlayerSpotify.js.map +0 -1
  15. package/dist/static/js/async/reactPlayerTiktok.js +0 -489
  16. package/dist/static/js/async/reactPlayerTiktok.js.map +0 -1
  17. package/dist/static/js/async/reactPlayerTwitch.js +0 -587
  18. package/dist/static/js/async/reactPlayerTwitch.js.map +0 -1
  19. package/dist/static/js/async/reactPlayerVimeo.js +0 -4265
  20. package/dist/static/js/async/reactPlayerVimeo.js.map +0 -1
  21. package/dist/static/js/async/reactPlayerWistia.js +0 -768
  22. package/dist/static/js/async/reactPlayerWistia.js.map +0 -1
  23. package/dist/static/js/async/reactPlayerYouTube.js +0 -739
  24. package/dist/static/js/async/reactPlayerYouTube.js.map +0 -1
  25. package/dist/static/js/async/vendors-node_modules_custom-media-element_dist_custom-media-element_js-node_modules_media-tra-835023.js +0 -1254
  26. package/dist/static/js/async/vendors-node_modules_custom-media-element_dist_custom-media-element_js-node_modules_media-tra-835023.js.map +0 -1
  27. package/dist/static/js/async/vendors-node_modules_dashjs_dist_modern_esm_dash_all_min_js.js +0 -22
  28. package/dist/static/js/async/vendors-node_modules_dashjs_dist_modern_esm_dash_all_min_js.js.map +0 -1
  29. package/dist/static/js/async/vendors-node_modules_hls_js_dist_hls_mjs.js +0 -36692
  30. package/dist/static/js/async/vendors-node_modules_hls_js_dist_hls_mjs.js.map +0 -1
  31. package/dist/static/js/index.js +0 -6362
  32. package/dist/static/js/index.js.map +0 -1
  33. package/dist/static/js/lib-react.js +0 -3235
  34. package/dist/static/js/lib-react.js.map +0 -1
  35. package/dist/static/js/vendors-node_modules_rspack_core_dist_cssExtractHmr_js-node_modules_dayjs_plugin_utc_js-node_-897cfa.js +0 -113737
  36. package/dist/static/js/vendors-node_modules_rspack_core_dist_cssExtractHmr_js-node_modules_dayjs_plugin_utc_js-node_-897cfa.js.map +0 -1
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@ix_waterford/lib",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "type": "module",
5
- "main": "./dist/static/js/index.js",
6
- "module": "./dist/static/js/index.js",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
7
  "types": "./dist/types/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
10
  "types": "./dist/types/index.d.ts",
11
- "import": "./dist/static/js/index.js",
12
- "require": "./dist/static/js/index.js"
11
+ "import": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
13
  }
14
14
  },
15
15
  "sideEffects": false,
@@ -1,351 +0,0 @@
1
- "use strict";
2
- (self["webpackChunk_ix_waterford_lib"] = self["webpackChunk_ix_waterford_lib"] || []).push([["reactPlayerDash"], {
3
- "./node_modules/dash-video-element/dist/dash-video-element.js": (function (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
4
- __webpack_require__.r(__webpack_exports__);
5
- __webpack_require__.d(__webpack_exports__, {
6
- "default": () => (dash_video_element_default)
7
- });
8
- /* import */var custom_media_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/custom-media-element/dist/custom-media-element.js");
9
- /* import */var media_tracks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/media-tracks/dist/index.js");
10
-
11
-
12
- class DashVideoElement extends (0,media_tracks__WEBPACK_IMPORTED_MODULE_1__.MediaTracksMixin)(custom_media_element__WEBPACK_IMPORTED_MODULE_0__.CustomVideoElement) {
13
- static shadowRootOptions = { ...custom_media_element__WEBPACK_IMPORTED_MODULE_0__.CustomVideoElement.shadowRootOptions };
14
- static getTemplateHTML = (attrs) => {
15
- const { src, ...rest } = attrs;
16
- return custom_media_element__WEBPACK_IMPORTED_MODULE_0__.CustomVideoElement.getTemplateHTML(rest);
17
- };
18
- #apiInit;
19
- attributeChangedCallback(attrName, oldValue, newValue) {
20
- if (attrName !== "src") {
21
- super.attributeChangedCallback(attrName, oldValue, newValue);
22
- }
23
- if (attrName === "src" && oldValue != newValue) {
24
- this.load();
25
- }
26
- }
27
- async _initThumbnails(representation) {
28
- const generateAllCues = async (totalThumbnails2, thumbnailDuration2) => {
29
- const promises = [];
30
- const timescale = representation.timescale || 1;
31
- const startNumber = representation.startNumber || 1;
32
- const pto = representation.presentationTimeOffset ? representation.presentationTimeOffset / timescale : 0;
33
- const tduration = representation.segmentDuration;
34
- for (let thIndex = 0; thIndex < totalThumbnails2; thIndex++) {
35
- const startTime = calculateThumbnailStartTime({
36
- thIndex,
37
- thduration: thumbnailDuration2,
38
- ttiles: totalThumbnails2,
39
- tduration,
40
- startNumber,
41
- pto
42
- });
43
- const endTime = startTime + thumbnailDuration2;
44
- const promise = new Promise((resolve, reject) => {
45
- this.api.provideThumbnail(startTime, ({ url, width, height, x, y }) => {
46
- try {
47
- const cue = new VTTCue(
48
- startTime,
49
- endTime,
50
- `${url}#xywh=${x},${y},${width},${height}`
51
- );
52
- resolve(cue);
53
- } catch (err) {
54
- reject(err);
55
- }
56
- });
57
- });
58
- promises.push(promise);
59
- }
60
- return await Promise.all(promises).catch((e) => console.error("Error processing thumbnails", e));
61
- };
62
- const { totalThumbnails, thumbnailDuration } = calculateThumbnailTimes(representation);
63
- const cues = await generateAllCues(totalThumbnails, thumbnailDuration);
64
- let track = this.nativeEl.querySelector('track[label="thumbnails"]');
65
- if (!track) {
66
- track = createThumbnailTrack();
67
- this.nativeEl.appendChild(track);
68
- const vttUrl = cuesToVttBlobUrl(cues);
69
- track.src = vttUrl;
70
- track.dispatchEvent(new Event("change"));
71
- }
72
- }
73
- async load() {
74
- if (this.#apiInit) {
75
- this.api.attachSource(this.src);
76
- return;
77
- }
78
- this.#apiInit = true;
79
- const Dash = await __webpack_require__.e(/* import() */ "vendors-node_modules_dashjs_dist_modern_esm_dash_all_min_js").then(__webpack_require__.bind(__webpack_require__, "./node_modules/dashjs/dist/modern/esm/dash.all.min.js"));
80
- this.api = Dash.MediaPlayer().create();
81
- this.api.initialize(this.nativeEl, this.src, this.autoplay);
82
- this.api.on(Dash.MediaPlayer.events.STREAM_INITIALIZED, () => {
83
- const bitrateList = this.api.getRepresentationsByType("video");
84
- let videoTrack = this.videoTracks.getTrackById("main");
85
- if (!videoTrack) {
86
- videoTrack = this.addVideoTrack("main");
87
- videoTrack.id = "main";
88
- videoTrack.selected = true;
89
- }
90
- bitrateList.forEach((rep) => {
91
- const bitrate = rep.bandwidth ?? rep.bitrate ?? (Number.isFinite(rep.bitrateInKbit) ? rep.bitrateInKbit * 1e3 : void 0);
92
- const rendition = videoTrack.addRendition(rep.id, rep.width, rep.height, rep.mimeType ?? rep.codec, bitrate);
93
- rendition.id = rep.id;
94
- });
95
- this.videoRenditions.addEventListener("change", () => {
96
- const selected = this.videoRenditions[this.videoRenditions.selectedIndex];
97
- if (selected == null ? void 0 : selected.id) {
98
- this.api.updateSettings({ streaming: { abr: { autoSwitchBitrate: { video: false } } } });
99
- this.api.setRepresentationForTypeById("video", selected.id, true);
100
- } else {
101
- this.api.updateSettings({ streaming: { abr: { autoSwitchBitrate: { video: true } } } });
102
- }
103
- });
104
- if (!this.api.isDynamic()) {
105
- const imageReps = this.api.getRepresentationsByType("image");
106
- imageReps.forEach(async (rep, idx) => {
107
- if (idx > 0) return;
108
- this._initThumbnails(rep);
109
- });
110
- }
111
- });
112
- }
113
- }
114
- function calculateThumbnailTimes(representation) {
115
- var _a, _b;
116
- const essentialProp = representation.essentialProperties[0];
117
- const [htiles, vtiles] = essentialProp.value.split("x").map(Number);
118
- const ttiles = htiles * vtiles;
119
- const periodDuration = ((_b = (_a = representation.adaptation) == null ? void 0 : _a.period) == null ? void 0 : _b.duration) || null;
120
- const tileDuration = representation.segmentDuration;
121
- const timescale = representation.timescale || 1;
122
- const tduration = tileDuration / timescale;
123
- const thduration = tduration / ttiles;
124
- const totalThumbnails = periodDuration != null ? Math.ceil(periodDuration / thduration) : Math.ceil(tileDuration / thduration);
125
- return { totalThumbnails, thumbnailDuration: thduration };
126
- }
127
- function calculateThumbnailStartTime({ thIndex, tduration, thduration, ttiles, startNumber, pto }) {
128
- const tnumber = Math.floor(thIndex / ttiles) + startNumber;
129
- const thnumber = thIndex % ttiles + 1;
130
- const tileStartTime = (tnumber - 1) * tduration - pto;
131
- const thumbnailStartTime = (thnumber - 1) * thduration;
132
- return tileStartTime + thumbnailStartTime;
133
- }
134
- function createThumbnailTrack() {
135
- const track = document.createElement("track");
136
- track.kind = "metadata";
137
- track.label = "thumbnails";
138
- track.srclang = "en";
139
- track.mode = "hidden";
140
- track.default = true;
141
- return track;
142
- }
143
- function cuesToVttBlobUrl(cues) {
144
- let vtt = "WEBVTT\n\n";
145
- for (const cue of cues) {
146
- vtt += `${formatTime(cue.startTime)} --> ${formatTime(cue.endTime)}
147
- `;
148
- vtt += `${cue.text}
149
-
150
- `;
151
- }
152
- const blob = new Blob([vtt], { type: "text/vtt" });
153
- return URL.createObjectURL(blob);
154
- function formatTime(t) {
155
- const h = String(Math.floor(t / 3600)).padStart(2, "0");
156
- const m = String(Math.floor(t % 3600 / 60)).padStart(2, "0");
157
- const s = (t % 60).toFixed(3).padStart(6, "0");
158
- return `${h}:${m}:${s}`;
159
- }
160
- }
161
- if (globalThis.customElements && !globalThis.customElements.get("dash-video")) {
162
- globalThis.customElements.define("dash-video", DashVideoElement);
163
- }
164
- var dash_video_element_default = DashVideoElement;
165
-
166
-
167
-
168
- }),
169
- "./node_modules/dash-video-element/dist/react.js": (function (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
170
- __webpack_require__.r(__webpack_exports__);
171
- __webpack_require__.d(__webpack_exports__, {
172
- "default": () => (react_default)
173
- });
174
- /* import */var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/react/index.js");
175
- /* import */var _dash_video_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/dash-video-element/dist/dash-video-element.js");
176
- "use client";
177
-
178
- // dist/react.ts
179
-
180
-
181
-
182
- // ../../node_modules/ce-la-react/dist/ce-la-react.js
183
- var reservedReactProps = /* @__PURE__ */ new Set([
184
- "style",
185
- "children",
186
- "ref",
187
- "key",
188
- "suppressContentEditableWarning",
189
- "suppressHydrationWarning",
190
- "dangerouslySetInnerHTML"
191
- ]);
192
- var reactPropToAttrNameMap = {
193
- className: "class",
194
- htmlFor: "for"
195
- };
196
- function defaultToAttributeName(propName) {
197
- return propName.toLowerCase();
198
- }
199
- function defaultToAttributeValue(propValue) {
200
- if (typeof propValue === "boolean") return propValue ? "" : void 0;
201
- if (typeof propValue === "function") return void 0;
202
- if (typeof propValue === "object" && propValue !== null) return void 0;
203
- return propValue;
204
- }
205
- function createComponent({
206
- react: React2,
207
- tagName,
208
- elementClass,
209
- events,
210
- displayName,
211
- defaultProps,
212
- toAttributeName = defaultToAttributeName,
213
- toAttributeValue = defaultToAttributeValue
214
- }) {
215
- const IS_REACT_19_OR_NEWER = Number.parseInt(React2.version) >= 19;
216
- const ReactComponent = React2.forwardRef((props, ref) => {
217
- var _a, _b;
218
- const elementRef = React2.useRef(null);
219
- const prevElemPropsRef = React2.useRef(/* @__PURE__ */ new Map());
220
- const eventProps = {};
221
- const attrs = {};
222
- const reactProps = {};
223
- const elementProps = {};
224
- for (const [k, v] of Object.entries(props)) {
225
- if (reservedReactProps.has(k)) {
226
- reactProps[k] = v;
227
- continue;
228
- }
229
- const attrName = toAttributeName(reactPropToAttrNameMap[k] ?? k);
230
- if (elementClass.prototype && k in elementClass.prototype && !(k in (((_a = globalThis.HTMLElement) == null ? void 0 : _a.prototype) ?? {})) && !((_b = elementClass.observedAttributes) == null ? void 0 : _b.some((attr) => attr === attrName))) {
231
- elementProps[k] = v;
232
- continue;
233
- }
234
- if (k.startsWith("on")) {
235
- eventProps[k] = v;
236
- continue;
237
- }
238
- const attrValue = toAttributeValue(v);
239
- if (attrName && attrValue != null) {
240
- attrs[attrName] = String(attrValue);
241
- if (!IS_REACT_19_OR_NEWER) {
242
- reactProps[attrName] = attrValue;
243
- }
244
- }
245
- if (attrName && IS_REACT_19_OR_NEWER) {
246
- const attrValueFromDefault = defaultToAttributeValue(v);
247
- if (attrValue !== attrValueFromDefault) {
248
- reactProps[attrName] = attrValue;
249
- } else {
250
- reactProps[attrName] = v;
251
- }
252
- }
253
- }
254
- if (typeof window !== "undefined") {
255
- for (const propName in eventProps) {
256
- const callback = eventProps[propName];
257
- const useCapture = propName.endsWith("Capture");
258
- const eventName = ((events == null ? void 0 : events[propName]) ?? propName.slice(2).toLowerCase()).slice(
259
- 0,
260
- useCapture ? -7 : void 0
261
- );
262
- React2.useLayoutEffect(() => {
263
- const eventTarget = elementRef == null ? void 0 : elementRef.current;
264
- if (!eventTarget || typeof callback !== "function") return;
265
- eventTarget.addEventListener(eventName, callback, useCapture);
266
- return () => {
267
- eventTarget.removeEventListener(eventName, callback, useCapture);
268
- };
269
- }, [elementRef == null ? void 0 : elementRef.current, callback]);
270
- }
271
- React2.useLayoutEffect(() => {
272
- if (elementRef.current === null) return;
273
- const newElemProps = /* @__PURE__ */ new Map();
274
- for (const key in elementProps) {
275
- setProperty(elementRef.current, key, elementProps[key]);
276
- prevElemPropsRef.current.delete(key);
277
- newElemProps.set(key, elementProps[key]);
278
- }
279
- for (const [key, _value] of prevElemPropsRef.current) {
280
- setProperty(elementRef.current, key, void 0);
281
- }
282
- prevElemPropsRef.current = newElemProps;
283
- });
284
- }
285
- if (typeof window === "undefined" && (elementClass == null ? void 0 : elementClass.getTemplateHTML) && (elementClass == null ? void 0 : elementClass.shadowRootOptions)) {
286
- const { mode, delegatesFocus } = elementClass.shadowRootOptions;
287
- const templateShadowRoot = React2.createElement("template", {
288
- shadowrootmode: mode,
289
- shadowrootdelegatesfocus: delegatesFocus,
290
- dangerouslySetInnerHTML: {
291
- __html: elementClass.getTemplateHTML(attrs, props)
292
- }
293
- });
294
- reactProps.children = [templateShadowRoot, reactProps.children];
295
- }
296
- return React2.createElement(tagName, {
297
- ...defaultProps,
298
- ...reactProps,
299
- ref: React2.useCallback(
300
- (node) => {
301
- elementRef.current = node;
302
- if (typeof ref === "function") {
303
- ref(node);
304
- } else if (ref !== null) {
305
- ref.current = node;
306
- }
307
- },
308
- [ref]
309
- )
310
- });
311
- });
312
- ReactComponent.displayName = displayName ?? elementClass.name;
313
- return ReactComponent;
314
- }
315
- function setProperty(node, name, value) {
316
- var _a;
317
- node[name] = value;
318
- if (value == null && name in (((_a = globalThis.HTMLElement) == null ? void 0 : _a.prototype) ?? {})) {
319
- node.removeAttribute(name);
320
- }
321
- }
322
-
323
- // dist/react.ts
324
- var react_default = createComponent({
325
- react: react__WEBPACK_IMPORTED_MODULE_0__,
326
- tagName: "dash-video",
327
- elementClass: _dash_video_element_js__WEBPACK_IMPORTED_MODULE_1__["default"],
328
- toAttributeName(propName) {
329
- if (propName === "muted") return "";
330
- if (propName === "defaultMuted") return "muted";
331
- return defaultToAttributeName(propName);
332
- }
333
- });
334
-
335
- /*! Bundled license information:
336
-
337
- ce-la-react/dist/ce-la-react.js:
338
- (**
339
- * @license
340
- * Copyright 2018 Google LLC
341
- * SPDX-License-Identifier: BSD-3-Clause
342
- *
343
- * Modified version of `@lit/react` for vanilla custom elements with support for SSR.
344
- *)
345
- */
346
-
347
-
348
- }),
349
-
350
- }]);
351
- //# sourceMappingURL=reactPlayerDash.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/js/async/reactPlayerDash.js","sources":["/Users/kirubakaran.r/Documents/projects/hub/components/waterford_library/node_modules/dash-video-element/dist/dash-video-element.js","/Users/kirubakaran.r/Documents/projects/hub/components/waterford_library/node_modules/dash-video-element/dist/react.js"],"sourcesContent":["import { CustomVideoElement } from \"custom-media-element\";\nimport { MediaTracksMixin } from \"media-tracks\";\nclass DashVideoElement extends MediaTracksMixin(CustomVideoElement) {\n static shadowRootOptions = { ...CustomVideoElement.shadowRootOptions };\n static getTemplateHTML = (attrs) => {\n const { src, ...rest } = attrs;\n return CustomVideoElement.getTemplateHTML(rest);\n };\n #apiInit;\n attributeChangedCallback(attrName, oldValue, newValue) {\n if (attrName !== \"src\") {\n super.attributeChangedCallback(attrName, oldValue, newValue);\n }\n if (attrName === \"src\" && oldValue != newValue) {\n this.load();\n }\n }\n async _initThumbnails(representation) {\n const generateAllCues = async (totalThumbnails2, thumbnailDuration2) => {\n const promises = [];\n const timescale = representation.timescale || 1;\n const startNumber = representation.startNumber || 1;\n const pto = representation.presentationTimeOffset ? representation.presentationTimeOffset / timescale : 0;\n const tduration = representation.segmentDuration;\n for (let thIndex = 0; thIndex < totalThumbnails2; thIndex++) {\n const startTime = calculateThumbnailStartTime({\n thIndex,\n thduration: thumbnailDuration2,\n ttiles: totalThumbnails2,\n tduration,\n startNumber,\n pto\n });\n const endTime = startTime + thumbnailDuration2;\n const promise = new Promise((resolve, reject) => {\n this.api.provideThumbnail(startTime, ({ url, width, height, x, y }) => {\n try {\n const cue = new VTTCue(\n startTime,\n endTime,\n `${url}#xywh=${x},${y},${width},${height}`\n );\n resolve(cue);\n } catch (err) {\n reject(err);\n }\n });\n });\n promises.push(promise);\n }\n return await Promise.all(promises).catch((e) => console.error(\"Error processing thumbnails\", e));\n };\n const { totalThumbnails, thumbnailDuration } = calculateThumbnailTimes(representation);\n const cues = await generateAllCues(totalThumbnails, thumbnailDuration);\n let track = this.nativeEl.querySelector('track[label=\"thumbnails\"]');\n if (!track) {\n track = createThumbnailTrack();\n this.nativeEl.appendChild(track);\n const vttUrl = cuesToVttBlobUrl(cues);\n track.src = vttUrl;\n track.dispatchEvent(new Event(\"change\"));\n }\n }\n async load() {\n if (this.#apiInit) {\n this.api.attachSource(this.src);\n return;\n }\n this.#apiInit = true;\n const Dash = await import(\"dashjs\");\n this.api = Dash.MediaPlayer().create();\n this.api.initialize(this.nativeEl, this.src, this.autoplay);\n this.api.on(Dash.MediaPlayer.events.STREAM_INITIALIZED, () => {\n const bitrateList = this.api.getRepresentationsByType(\"video\");\n let videoTrack = this.videoTracks.getTrackById(\"main\");\n if (!videoTrack) {\n videoTrack = this.addVideoTrack(\"main\");\n videoTrack.id = \"main\";\n videoTrack.selected = true;\n }\n bitrateList.forEach((rep) => {\n const bitrate = rep.bandwidth ?? rep.bitrate ?? (Number.isFinite(rep.bitrateInKbit) ? rep.bitrateInKbit * 1e3 : void 0);\n const rendition = videoTrack.addRendition(rep.id, rep.width, rep.height, rep.mimeType ?? rep.codec, bitrate);\n rendition.id = rep.id;\n });\n this.videoRenditions.addEventListener(\"change\", () => {\n const selected = this.videoRenditions[this.videoRenditions.selectedIndex];\n if (selected == null ? void 0 : selected.id) {\n this.api.updateSettings({ streaming: { abr: { autoSwitchBitrate: { video: false } } } });\n this.api.setRepresentationForTypeById(\"video\", selected.id, true);\n } else {\n this.api.updateSettings({ streaming: { abr: { autoSwitchBitrate: { video: true } } } });\n }\n });\n if (!this.api.isDynamic()) {\n const imageReps = this.api.getRepresentationsByType(\"image\");\n imageReps.forEach(async (rep, idx) => {\n if (idx > 0) return;\n this._initThumbnails(rep);\n });\n }\n });\n }\n}\nfunction calculateThumbnailTimes(representation) {\n var _a, _b;\n const essentialProp = representation.essentialProperties[0];\n const [htiles, vtiles] = essentialProp.value.split(\"x\").map(Number);\n const ttiles = htiles * vtiles;\n const periodDuration = ((_b = (_a = representation.adaptation) == null ? void 0 : _a.period) == null ? void 0 : _b.duration) || null;\n const tileDuration = representation.segmentDuration;\n const timescale = representation.timescale || 1;\n const tduration = tileDuration / timescale;\n const thduration = tduration / ttiles;\n const totalThumbnails = periodDuration != null ? Math.ceil(periodDuration / thduration) : Math.ceil(tileDuration / thduration);\n return { totalThumbnails, thumbnailDuration: thduration };\n}\nfunction calculateThumbnailStartTime({ thIndex, tduration, thduration, ttiles, startNumber, pto }) {\n const tnumber = Math.floor(thIndex / ttiles) + startNumber;\n const thnumber = thIndex % ttiles + 1;\n const tileStartTime = (tnumber - 1) * tduration - pto;\n const thumbnailStartTime = (thnumber - 1) * thduration;\n return tileStartTime + thumbnailStartTime;\n}\nfunction createThumbnailTrack() {\n const track = document.createElement(\"track\");\n track.kind = \"metadata\";\n track.label = \"thumbnails\";\n track.srclang = \"en\";\n track.mode = \"hidden\";\n track.default = true;\n return track;\n}\nfunction cuesToVttBlobUrl(cues) {\n let vtt = \"WEBVTT\\n\\n\";\n for (const cue of cues) {\n vtt += `${formatTime(cue.startTime)} --> ${formatTime(cue.endTime)}\n`;\n vtt += `${cue.text}\n\n`;\n }\n const blob = new Blob([vtt], { type: \"text/vtt\" });\n return URL.createObjectURL(blob);\n function formatTime(t) {\n const h = String(Math.floor(t / 3600)).padStart(2, \"0\");\n const m = String(Math.floor(t % 3600 / 60)).padStart(2, \"0\");\n const s = (t % 60).toFixed(3).padStart(6, \"0\");\n return `${h}:${m}:${s}`;\n }\n}\nif (globalThis.customElements && !globalThis.customElements.get(\"dash-video\")) {\n globalThis.customElements.define(\"dash-video\", DashVideoElement);\n}\nvar dash_video_element_default = DashVideoElement;\nexport {\n dash_video_element_default as default\n};\n","\"use client\";\n\n// dist/react.ts\nimport React from \"react\";\nimport CustomMediaElement from \"./dash-video-element.js\";\n\n// ../../node_modules/ce-la-react/dist/ce-la-react.js\nvar reservedReactProps = /* @__PURE__ */ new Set([\n \"style\",\n \"children\",\n \"ref\",\n \"key\",\n \"suppressContentEditableWarning\",\n \"suppressHydrationWarning\",\n \"dangerouslySetInnerHTML\"\n]);\nvar reactPropToAttrNameMap = {\n className: \"class\",\n htmlFor: \"for\"\n};\nfunction defaultToAttributeName(propName) {\n return propName.toLowerCase();\n}\nfunction defaultToAttributeValue(propValue) {\n if (typeof propValue === \"boolean\") return propValue ? \"\" : void 0;\n if (typeof propValue === \"function\") return void 0;\n if (typeof propValue === \"object\" && propValue !== null) return void 0;\n return propValue;\n}\nfunction createComponent({\n react: React2,\n tagName,\n elementClass,\n events,\n displayName,\n defaultProps,\n toAttributeName = defaultToAttributeName,\n toAttributeValue = defaultToAttributeValue\n}) {\n const IS_REACT_19_OR_NEWER = Number.parseInt(React2.version) >= 19;\n const ReactComponent = React2.forwardRef((props, ref) => {\n var _a, _b;\n const elementRef = React2.useRef(null);\n const prevElemPropsRef = React2.useRef(/* @__PURE__ */ new Map());\n const eventProps = {};\n const attrs = {};\n const reactProps = {};\n const elementProps = {};\n for (const [k, v] of Object.entries(props)) {\n if (reservedReactProps.has(k)) {\n reactProps[k] = v;\n continue;\n }\n const attrName = toAttributeName(reactPropToAttrNameMap[k] ?? k);\n if (elementClass.prototype && k in elementClass.prototype && !(k in (((_a = globalThis.HTMLElement) == null ? void 0 : _a.prototype) ?? {})) && !((_b = elementClass.observedAttributes) == null ? void 0 : _b.some((attr) => attr === attrName))) {\n elementProps[k] = v;\n continue;\n }\n if (k.startsWith(\"on\")) {\n eventProps[k] = v;\n continue;\n }\n const attrValue = toAttributeValue(v);\n if (attrName && attrValue != null) {\n attrs[attrName] = String(attrValue);\n if (!IS_REACT_19_OR_NEWER) {\n reactProps[attrName] = attrValue;\n }\n }\n if (attrName && IS_REACT_19_OR_NEWER) {\n const attrValueFromDefault = defaultToAttributeValue(v);\n if (attrValue !== attrValueFromDefault) {\n reactProps[attrName] = attrValue;\n } else {\n reactProps[attrName] = v;\n }\n }\n }\n if (typeof window !== \"undefined\") {\n for (const propName in eventProps) {\n const callback = eventProps[propName];\n const useCapture = propName.endsWith(\"Capture\");\n const eventName = ((events == null ? void 0 : events[propName]) ?? propName.slice(2).toLowerCase()).slice(\n 0,\n useCapture ? -7 : void 0\n );\n React2.useLayoutEffect(() => {\n const eventTarget = elementRef == null ? void 0 : elementRef.current;\n if (!eventTarget || typeof callback !== \"function\") return;\n eventTarget.addEventListener(eventName, callback, useCapture);\n return () => {\n eventTarget.removeEventListener(eventName, callback, useCapture);\n };\n }, [elementRef == null ? void 0 : elementRef.current, callback]);\n }\n React2.useLayoutEffect(() => {\n if (elementRef.current === null) return;\n const newElemProps = /* @__PURE__ */ new Map();\n for (const key in elementProps) {\n setProperty(elementRef.current, key, elementProps[key]);\n prevElemPropsRef.current.delete(key);\n newElemProps.set(key, elementProps[key]);\n }\n for (const [key, _value] of prevElemPropsRef.current) {\n setProperty(elementRef.current, key, void 0);\n }\n prevElemPropsRef.current = newElemProps;\n });\n }\n if (typeof window === \"undefined\" && (elementClass == null ? void 0 : elementClass.getTemplateHTML) && (elementClass == null ? void 0 : elementClass.shadowRootOptions)) {\n const { mode, delegatesFocus } = elementClass.shadowRootOptions;\n const templateShadowRoot = React2.createElement(\"template\", {\n shadowrootmode: mode,\n shadowrootdelegatesfocus: delegatesFocus,\n dangerouslySetInnerHTML: {\n __html: elementClass.getTemplateHTML(attrs, props)\n }\n });\n reactProps.children = [templateShadowRoot, reactProps.children];\n }\n return React2.createElement(tagName, {\n ...defaultProps,\n ...reactProps,\n ref: React2.useCallback(\n (node) => {\n elementRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref !== null) {\n ref.current = node;\n }\n },\n [ref]\n )\n });\n });\n ReactComponent.displayName = displayName ?? elementClass.name;\n return ReactComponent;\n}\nfunction setProperty(node, name, value) {\n var _a;\n node[name] = value;\n if (value == null && name in (((_a = globalThis.HTMLElement) == null ? void 0 : _a.prototype) ?? {})) {\n node.removeAttribute(name);\n }\n}\n\n// dist/react.ts\nvar react_default = createComponent({\n react: React,\n tagName: \"dash-video\",\n elementClass: CustomMediaElement,\n toAttributeName(propName) {\n if (propName === \"muted\") return \"\";\n if (propName === \"defaultMuted\") return \"muted\";\n return defaultToAttributeName(propName);\n }\n});\nexport {\n react_default as default\n};\n/*! Bundled license information:\n\nce-la-react/dist/ce-la-react.js:\n (**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Modified version of `@lit/react` for vanilla custom elements with support for SSR.\n *)\n*/\n"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;;;;;;;;;;;AC7JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}